numbers

Commit certain number of records to DB with java

I have table in DB,e.g. TableOne. By some rules i should commit N records from this table to other tables. Is it possible to do with jdbc or ResultSet or CachedRowSet? Preliminary flow, as i see: 1. loop through ResultSet of TableOne 2. increment counter if certain condition is met 3. if condition is not met, it's time to commit to othe...

Convert Text to Number Format In Excel

How to convert text to number, especially negative value:- 9,669.34 to 9,669.34 2,553.57- to (2,553.57) When I used this formula, =SUBSTITUTE(A1,CHAR(160),"")+0, it works well but only for positive value. I rcv'd #VALUE! for all negative values. ...

ocr using a command line tool

hello folks, I'm looking for a windows command line tool that does OCR. Specifically I'm trying to extract the number from this image: http://img691.imageshack.us/img691/6075/wantocr.png I've tried tesseract and found it quite poor imho. Perhaps it needs settings that I'm not aware of. I've tried a few others and they too were pretty p...

NSDecimalNumber round long numbers

I'm trying to get NSDecimalNumber to print out large numbers, 15 or more digits. At 15 digits I see 111,111,111,111,111. Above 15 digits I see 1,111,111,111,111,110 even though the number being formatted is 1111111111111111. An example to illustrate my problem: NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; [formatt...

Conversion between numeric objects in Java

I am looking for a simple, concise way to convert a given Number object to an object of a given numeric type. Loss of precision due to narrowing conversions is fine I prefer not to go through strings. I need something like: private static Number convert(Number num, Class<? extends Number> targetType) Is there a way to do it withou...

Lex : print line numbers

Hello, I have a source code and I would like to add line numbers. What I've done : %{ int lines=0; %} LINE \n %% {LINE} {ECHO;printf("%d", ++lines);} However, I don't know how to catch the first line. Can you help me ? ...

java decimal separator

Hi mates, Is there a way to configure Java's decimal separators with JVM parameters? I'd know how to do it in code level, but unfortunately this time I cannot touch it. I have now: "1,322.03" and I wish there was some config that would make that look like 1.322,03. Oracle has that NLS_NUMERIC_CHARACTERS, which solve's for me in most c...

latex enumerate custom numerical order

are there any simple: almost a single liner latex commands to make enumerate count in a weird order for instance that of a homework assignment? Ex. 1, 5, 6, 9, 10, 13, 16 ...

Javascript Thousand Separator / string format

Is there any function in Javascript for formatting number and strings ? I am looking for a way for thousand separator for string or numbers... (Like String.Format In c#) ...

Best way to restrict a text field to numbers only?

I'm using the following Javascript to restrict a text field on my website to only accept numerical input, and no other letters or characters. The problem is, it REALLY rejects all other key inputs, like ctrl-A to select the text, or even any other browser functions like ctrl-T or ctrl-W while the text box is selected. Does anyone know of...

Better name for "non-negative" value?

I'm validating that the integer is zero or greater. To describe the requirement as "zero or greater" feels too verbose. To say "non-negative" introduces negative language, which I try to avoid when I can. What concise descriptor do you use when describing a value that must be zero or greater? ...

javax.xml.transform.Transformer encoding entity numbers

Hello, I have a problem using a transformer to generate an XML document. The incoming org.w3c.dom.Document has the entity codes correct: &#174; However, once the Document is transformed the ampersand is encoded: &amp;#174; I was expecting ampersands followed by a # to have been respected, but I guess perhaps this is correct behav...

How do I generate this specific sequence of numbers?

Apparently there is no predefined list available in .net. I'd like to use a number of standard colors, e.g. something like red, green, blue, yellow, ... i.e. the typical colors consisting of 00 and FF components, followed by those with additional 7F components, ... Is there a way to retrieve these "standard" colors or do I have to writ...

jquery issue with numbers starting wth zero

At the top of my script I have created a variable out of todays date: <?php $today = date('dmy'); ?> I then have a table and each table row has a class either of "nodate" or of a six digit number, this number represents a date. eg 230910 (yesterday). I am trying to write some jquery that hides the table row if the class (six digits) ...

Hiding the HTML5 number input spin box

Is there a consistent way across browsers to hide the new spin boxes that some browsers (such as Chrome) render for HTML input of type number? I am looking for a CSS or javascript method to prevent the up/down arrows from appearing. ...

Random Number Generator not working

I use this function to create random numbers between 100000000 and 999999999 int irand(int start, int stop) { double range = stop - start + 1; return start + (int)(range * rand()/(RAND_MAX+1.0)); } When I use it like this, it's properly working while(1) { DWORD dw = irand(100000000, 999999999); printf("dynamic key: %d\n",...

Finding Unicode character name with Javascript

I need to find out the names for Unicode characters when the user enters the number for it. An example would be to enter 0041 and get given "Latin Capital Letter A" as the result. Thanks ...

How to compare two numbers to see which is greater

Comparing two numbers x,y; if x>y I return 1, else return 0. I am trying to do this using only bitwise operators such as >> << ~ ! & | ^ +. So far I got this: int greaterThan(int x,int y) { return ((~(x-y))>>31); } So if x-y is negative, the most significant bit would be a 1. So I negate it to get a 0 and shift it so that it returns...

How do I decide if a variable is numeric in Perl?

Possible Duplicate: How do I tell if a variable has a numeric value in Perl? I want to decide if a variable (value parsed from a string) is a number or not. How can I do that? Well, I guess /^[0-9]+$/ would work, but is there a more elegant version? ...

XSL - rounding/format-number problem

Hi guys, I'm trying to get the value of a number to 2 dec places from my xml. XML:<Quantity>0.0050</Quantity> XSL:<xsl:value-of select="format-number($quantity, '####0.00')" /> However XSL seems to have a problem with this value and outputs 0.00 in one area of the page and 0.01 in the other. Of course in this situation it is favourab...