Is there a common method to encode and decode arbitrary data so the encoded end result consists of numbers only - like base64_encode but without the letters?
Fictitious example:
$encoded = numbers_encode("Mary had a little lamb");
echo $encoded; // outputs e.g. 122384337422394237423 (fictitious result)
$decoded = numbers_decode("122384337422394237423");
echo $decoded; // outputs "Mary had a little lamb"
I need to store phone numbers starting with 0 but whenever i try to store this in MySql table the starting ZERO is removed because no number start with Zero actually
how i can solve this problem please do i need to change the field type from Integer to another type
please help
I have some numbers stored in a vector . I want to find which number appears most in the vector.
Is there any easy/fast algorithm (STL or whatever) that does this ?
I'm having trouble checking in PHP if a value is is any of the following combinations
letters (upper or lowercase)
numbers (0-9)
underscore (_)
dash (-)
point (.)
no spaces! or other characters
a few examples:
OK: "screen123.css"
OK: "screen-new-file.css"
OK: "screen_new.js"
NOT OK: "screen new file.css"
I guess I need a regex for this, since I need to throw an error when a give string has other characters in it than the ones mentioned above.
Suppose I have One set of numbers i.e
{1, 6, 3, 5, 7, 9}
I want to Generate Random number from this set of number only i.e. a Generated number should be random and should be from these number({1, 6, 3, 5, 7, 9}) only.
standard C/C++ function will also do...
i am trying to code for my system in NetBeans IDE 6.5 to auto generate ID numbers for me like autonumbers in Ms Access. does any one have any ideas about going about that?i mean code for it.
Okay so i need really FAST algorithm or code in C if you have any it would be nice. The task is to sum all numbers from 1 to N for a given number N (it can be negative number too), so i did the usual way (you know just summing with loop from 1 to N) but it's not fast enough - i need something faster, i guess that i need the fastest possible way to do this.
If anyone could help me, please do. Thanks.
I want to retrieve the left 3 numbers from an integer to be stored in a table. For example, if the int is 1234567, I want to retrieve 123. I want the second number (123) to also be an int; I don't want to convert anything to a string.
(And yes, really I should be working with strings. But I don't have control over that aspect of the issue.)
Thank you!
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
i need the code for sorting of numbers in ascending order using visual c++ in the windows forms,the output comes on the forms text box and i am doing it in visual studio....
anyone please help...provide the code
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?
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.
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.
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)
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
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...
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
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