numbers

Best method for converting several sets of numbers with several different ratios

I'm working on an open-source harm reduction application for opioid addicts. One of the features in this application is the conversion (in mg/mcg) between common opioids, so people don't overdose by accident. If you're morally against opioid addiction and wouldn't respond because of your morals, please consider that this application is...

letters or numbers only in a password with jquery

Hi, I found this code for alphanumeric check ("Letters, numbers, spaces or underscores") but I want to change so I will be able to write only letters or numbers. Can anyone tell me how to change this code: function(value, element) { return this.optional(element) || /^\w+$/i.test(value);} Thanks! Greg ...

Most accurate open-source OCR for handwritten numbers?

My software needs to read a fixed-length handwritten number. While I could use a general-purpose library like Tesseract, I am sure there is something smarter. Tesseract will probably misinterpret some of the 1 or 7 as I or l, whereas a software that expects only numbers would not. Knowing that there are only numbers (American-English w...

How to show number of a line in a RichTextBox C#

I am making a simple text and script editor with code highlighting. For that I use a RichTextBox. But I don't know how to make it show the lines' numbers on the left side, like in VS or Notepad++. Is there any solution? ...

Check if last characters of an NSString are numbers.

Is it possible to see of a string ends with a number which length is not known? "String 1" -> 1 "String 4356" -> 4356 "String" -> nil If so, how can I determine that number? ...

number out of string in java

I have something like "ali123hgj". i want to have 123 in integer. how can i make it in java? ...

Enhancing an 'ORDER BY' clause to judge condition by more than 1 integer

Hi folks, I have some PHP code which allows me to sort a column into ascending and descending order (upon click of a table row title), which is good. It works perfectly for my D.O.B colum (with date/time field type), but not for a quantity column. For example, I have quantites of 10, 50, 100, 30 and another 100. The order seems to be...

Precision of cos(atan2(y,x)) versus using complex <double>, C++

Hi all, I'm writing some coordinate transformations (more specifically the Joukoswky Transform, Wikipedia Joukowsky Transform), and I'm interested in performance, but of course precision. I'm trying to do the coordinate transformations in two ways: 1) Calculating the real and complex parts in separate, using double precision, as below:...

Iwork Numbers Spreadsheet Referencing

I am new to Mac Numbers. I would like to know if there is a way that one spreadsheet file can reference the values from a completely different spreadsheet file. ...

how to determine base of a number?

Given a integer number and its reresentation in some arbitrary number system. The purpose is to find the base of the number system. For example, number is 10 and representation is 000010, then the base should be 10. Another example: number 21 representation is 0010101 then base is 2. One more example is: number is 6 and representation os...

Blackberry Java Development - Increment version number

Hi everyone, I'm using Eclise to develop a Blackberry Java application.Is possible to automatically increment version number on every build like its done in Visual Studio? Thanks in advance. ...

How to get element order number

Hello everyone, how can i get order number of some element by javascript/jquery? <ul> <li>Anton</li> <li class="abc">Victor</li> <li class="abc">Simon</li> <li>Adam</li> <li>Peter</li> <li class="abc">Tom</li> </ul> There is 3xli with abc class. Now I need to get order(sequence) number of Simon li. Thanks in advance ...

iPhone Game Having a statement checked every 50 points

Hello! I've run into a little hurdle and wanted to see if somebody could help me! I want to write an algorithm for an if statement that says: if (for every 50 points) { //do something } I thought += 50 would do the trick, but nope. Any ideas? Thanks! ...

Changing text depending on rounded total from database

On a website I have a number of small PHP scripts to automate changes to the text of the site, depending on a figure that's calculated from a MySQL database. The site is for a fundraising group, and the text in question on the home page gives the total amount raised. The amount raised is pulled from the database and rounded to the neare...

form a number using consecutive numbers

Hi, I was puzzled with one of the question in Microsoft interview which is as given below: A function should accept a range( 3 - 21 ) and it should print all the consecutive numbers combinations to form each number as given below: 3 = 1+2 5 = 2+3 6 = 1+2+3 7 = 3+4 9 = 4+5 10 = 1+2+3+4 11 = 5+6 12 = 3+4+5 13 = 6+7 14 = 2+3+4+5 15...

Rounding values up or down in C#

Hey all, I've created a game which gives a score at the end of the game, but the problem is that this score is sometimes a number with a lot of digits after the decimal point (like 87.124563563566). How would I go about rounding up or down the value so that I could have something like 87.12? Thanks! ...

Big numbers in C

I need help working with very big numbers. According to Windows calc, the exponent 174^55 = 1.6990597648061509725749329578093e+123. How would I store this using C (c99 standard). int main(){ long long int x = 174^55; //result is 153 printf("%lld\n", x); } For those curious, it is for a school project where we are implementing the RS...

How can I convert a string like 3 10^-20 into a number in Perl?

I have a file that contain list of numbers that looks like this: 10^-92 2 10^-14 10^-105 3 10^-20 To explain a bit further 10^-92 is essentially 1E-92 and 2 10^-14 is 2E^-14. Is there a compact way to convert the number in above file into Perl number? At the end I want to sort these numbers numerically. ...

Sorting Scientific Number With Unix Sort

I tried to sort these number with Unix sort, but it doesn't seem to work: 2e-13 1e-91 2e-13 1e-104 3e-19 9e-99 This is my command: sort -nr file.txt What's the right way to do it? ...

How to get nth bit (from right) in a binary equivalent of an integer in PHP?

Suppose I want to find 2nd bit in binary equivalent of 13 (binary : 1101). It should return 0. ...