numbers

Reading the serial number of USB storage device in Vb

Is it possible to read the serial number of a USB drive using VB. ...

Java library to check whether a String contains a number *without* exceptions

I'm looking for a method that returns a boolean if the String it is passed is a valid number (e.g. "123.55e-9", "-333,556"). I don't want to just do: public boolean isANumber(String s) { try { BigDecimal a = new BigDecimal(s); return true; } catch (NumberFormatException e) { return false; } } Clea...

Update SQL with consecutive numbering

I want to update a table with consecutive numbering starting with 1. The update has a where clause so only results that meet the clause will be renumbered. Can I accomplish this efficiently without using a temp table? ...

Using mysqli error numbers

I am building an object oriented wrapper for sql using mysqli - thats neither here nor there. I'm trying to use error numbers to detect if a database/table/column doesn't exist. Things would all be fine and dandy if I didn't receive error number 656434540.... Of course the error message is "bo.boo' doesn't exist". Its SUPPOSED to read "T...

Need help generating discrete random numbers from distribution

I searched the site but did not find exactly what I was looking for... I wanted to generate a discrete random number from normal distribution. For example, if I have a range from a minimum of 4 and a maximum of 10 and an average of 7. What code or function call ( Objective C preferred ) would I need to return a number in that range. ...

How to create our own numeric system?

The question is for any modern unmanaged language.C-like languages,delphi,anything. I'd like to create my own cryptography algorithm that ,unlike others,decreases the length of the encrypted string. My first thought was to create my own numberic system similiar to hexadicimal,but with more characters.For example [0..9] + [A..Z].That wo...

JQuery/JavaScript increment number

Hi Guys, I am trying to increment a number by a given value each second and retain the formatting using JavaScript or JQuery I am struggling to do it. Say I have a number like so: 1412015 the number which this can be incremented by each second is variable it could be anything beween 0.1 and 2. Is it possible, if the value which...

special random number

I'd like to have a random number like this:(in C#) Random r = new Random(); r.next (0,10) BUT it's important to the random number be more near 8,(or it be usually big), I mean if we use a for: for (int i =0; i<...;i++) { write: r.next (0,10) } the result be like this; 8 7 6 9 1 0 5 3 2 2 3 8 9 7 7 6 2 3 8 8 9 7 2 8 2 8 4 3 ...

How to convert a string 3.0103E-7 to 0.00000030103 in Java?

How to convert a string 0E-11 to 0.00000000000 in Java? I want to display the number in non scientific notations. I've tried looking at the number formatter in Java, however I need to specific the exact number of decimals I want but I will not always know. I simply want the number of decimal places as specificed by my original number. ...

How do we remove all non-numeric characters from a string in Python?

Quite a simple question, but I'm a python noobie. How do we remove all non-numeric characters from a string in Python? How can I do that? ...

Finding port number of connected device from Registry editor

hi can you pls tell me pls is there any win32 api,s are there for getting connected device port number.Now in my appillication i am giving hardcoded value for com port number . and for that i am checking manually from control panel -> phone and modem options , there i am getting port number. But now i am trying do this programm...

How do I get the whole number portion of a number (javascript)

e.g 1.2=1 1.5=1 1.9=1 ...

Should Java Thread IDs always start at 0?

I am working on a mutual exclusion assignment, but when I started I noticed my application's thread ID's start at 9. It doesn't change when I compile and execute it again. Is there some problem I'm missing, or can Java Thread IDs start at an arbitrary number? This question is related. For those interested, here is a class from Herlih...

Generics - where T is a number?

Hi All, I'm trying to figure a way to create a generic class for number types only, for doing some calculations. Is there a common interface for all number types (int, double, float...) that I'm missing??? If not, what will be the best way to create such a class? UPDATE: The main thing I'm trying to achieve is checking who is the bi...

Convert Number to Corresponding Excel Column

Hi, I need some help in doing a logic that would convert a numeric value to corresponding MS Excel header value. For example: 1 = "A" 2 = "B" 3 = "C" 4 = "D" 5 = "E" ......... 25 = "Y" 26 = "Z" 27 = "AA" 28 = "AB" 29 = "AC" 30 = "AD" ......... Would appreciate some .NET codes (C# or VB) for this. Thanks. ...

Oracle hibernate sequence generator problem

Hello friends, I am developing an application using oracle 11g, Java(struts2) and Hibernate. I have table named mytemp with column mytemp_id which is of type NUMBER(22,0). In my mytemp.hbm.xml file id is as given below <id name="mytempId" type="big_decimal"> <column name="MYTEMP_ID" precision="22" scale="0" /> <genera...

Phone Number Auto Spacing like AddressBook on iPhone

I want to be able to replicate what the AddressBook does in Contacts app and Phone app when entering a phone number in both the keypad on the Phone app and adding a contact. I know I could do it checking each time a character is entered into the UITextField but there are hundreds of number formats out there and it would take me forever...

iPhone SDK log to base 10

Is there a method for determining the base 10 log of any number in the iPhone language? Any help with the math for this would be appreciated by a newbie budding iPhone developer. Thanks in advance. M ...

Distribution algorithm for given set of numbers and intervals

I'm in search of an algorithm, which can handle the problem described below. I already have written an algorithm (which is too specialised to post, I think), optimised as much as I could think of, but on larger sets of numbers it still is too slow (as the costs rise exponentially). The solution should take no longer than 5s on a decent c...

Oracle Bankers rule

Why Oracle is not using Bankers rule (the rounding method)? ...