Hi everyone,
I want to parse a text file, where
I get numbers that are between parenthesis like
this:
1 2 3 (4 - 7) 8 9
1 3 8 (7 - 8) 2 1
1 2 (8 - 10) 3 2
should return an array for each:
array1:
4
7
8
array2:
7
8
10
I am thinking of using split for each line, like line.split("("), but that doesn't quite doing the trick.. I was wondering if there is something more sophisticated for the job.
Any help appreciated,
Ted
Given any number of the random real numbers from the interval [0,1] is there exist any method to construct a floating point number with zero decimal part?
Your algorithm can use only random() function calls and no variables or constants. No constants and variables are allowed, no type casting is allowed. You can use for/while, if/else or any other programming language operands.
hi friends.
I am supposed to write and algorithm which uses recursion (Divide-And-Conquer) to multiply two arrays.These arrays hold big Numbers that are greater than long(int 64) or double capacity.
Would please help to write this algorithm in C#?
i am writing a visual basic ide , and i need to add lines numbers to QTextEdit and highlight current line . i have found this tutorial but it is written in java and i write my project in c++
so where to find tutorial like that in c++ , or if there is a ready to use component ?
thanks .
what is the best way to handle floating point numbers in XML?
If I have, for instance:
double a = 123.456;
and I would like to keep it as
<A> 123.456 </A>
simply using
...
myDoc.createTextNode(a.ToString());
is fine?
Or should it be done with some Globalization stuff to make it region-independent?
Dear Folks,
I am trying to sort string column (containing numbers).
// SELECT `name` FROM `mytable` ORDER BY `name` ASC
+----------+
+-- name --+
+----------+
+-- a 1 ---+
+-- a 12 --+
+-- a 2 ---+
+-- a 3 ---+
You see natural sorting algorithm of Mysql is placing a 12 after a 1 (which is ok for most apps), But I have unique needs, so I want result should be sorted like this.
+----------+
+-- name --+
+----------+
+-- a 1 ---+
+-- a 2 ---+
+-- a 3 ---+
+-- a 12 --+
Is it possible with just SQL, or I have to manipulate result-set at application level?
Thanks for reading...
Hello all
I'm trying to find all the 6 digit numbers in a string that do not end in 00.
Something like that
/([0-9]{4})([^00])/ //i know this is wrong
so the string
asdfs dfg_123456_adsagu432100jhasj654321
will give me
results=[123456,654321] and not 432100
Thanks
Have a good day
I want to make a simple macro with #define for returning the smaller of two numbers.
How can i do this in C ? Suggest some ideas, and see if you can make it more obfuscated too.
Without relying on third party libraries or obscenely complex custom number generating things, which of those two languages makes the most 'random' random numbers?
not too important, just a program that simulates dice rolls (I'm still a little new at both languages)
Hi,
i am wrestling with my regex.
I want to allow only letters and numbers and a dot in a username, and 2 to 20 chars long
I thought of something like this
[0-9a-zA-Z]{2,20}
but then 21 chars is also ok, and that's not what i want
Hi,
I'm trying to get a report done and I have a small problem with the twocolums and the line numbering in listings.
The text is on two columns, the listings can be on the two columns as well.
If I put the number=left, the space between the columns is not sufficient and the text from the first column is written over.
Is there any way to ask the listings to put the line numbers "outside" ?
Thanks
I don't want to have to download and install eclipse on this machine, but for you who do have it, what is the first line on the Eclipse IDE? On the left after you enable line numbers in the left hand column, the first number is?
Hi All,
I need to create a larger file, which would be filled by strings and numbers of a certain length.
Eg File content would be like :
Dougan | 15 | Sapient
Patric | 25 | Patni.
IGHIGH | 10 | IHIUDWHKJDBHKJ
I need an outline as to how I can approach this in either c or c++..
Kindly let me know if more information is needed.
I already used some script to implement the shortcuts in my web page
but i was wondering if could be possible to associate some combination not syncronic like Ctrl+X but more like a sequence typing 1..2..3 or any other combination to execute a script...
lets assume this example:
you have a long list with numbers:
you could type 3..5...6, so you can go to the item 356 passing trough the item 3 then 35 then 356
more or less like when you type while selecting a select box
i hope it was clear, id not easy to explain...
What is the simplest way to calculate the amount of even numbers in a range of unsigned integers?
An example: if range is [0...4] then the answer is 3 (0,2,4)
I'm having hard time to think of any simple way. The only solution I came up involved couple of if-statements. Is there a simple line of code that can do this without if-statements or ternary operators?
I have a page with a menu like navigation pane (too repeater) and a placeholder in these page.
This is my problem : on menu item click i open different control in my placeholder, one at click.
When i change them selected item in my menu on page init i load the old control and i load the new control on menu event. How i can get te selected item of a repeater on page init???? or load.
P.s items are LinkButton
how does one use code to do this:
produce 15 random numbers that are not in any order, and that only occur once
eg.
1 4, 2, 5, 3, 6, 8, 7, 9, 10, 13, 12, 15, 14, 11
rand() or arc4rand() can repeat some, which is not what im after.
Thanks
Hi,
in C++, using printf I want to print a sequence of number, so I get, from a "for" loop;
1
2
...
9
10
11
and I create files from those numbers. But when I list them using "ls" I get
10
11
1
2
..
so instead of trying to solve the problem using bash, I wonder how could I print;
0001
0002
...
0009
0010
0011
and so on
Thanks
I'm writing a .NET application that will make an RPC call to a Java application (via a message queue). The data sent in both directions will be large arrays of floating-point numbers. What is the best way to serialize them to send them across the wire? I'd like something more compact than text, but architecture-independent as the server may not be an x86 machine. The Java application can be changed as needed.
I have an ordered list in ie7 and the list-style-type decimal is not allowing space on two digit numbers
E.G 1. blah blah, blah
12.blah, blah, blah
anyone know of a answer?
Hello all,
How do I remove numbers from a string using Javascript?
I am not very good with regex at all but I think I can use with replace to achieve the above?
It would actually be great if there was something JQuery offered already to do this?
//Something Like this??
var string = 'All23';
string.replace('REGEX', '');
I appreciate any help on this.