Questions for numbers


How can I write a .htaccess redirect to find all numbers?

I'm trying to figure out a regular expression that will find some numbers in a URL and use them in the URL I redirect to.

How safe is comparing numbers in lua with equality operator?

In my engine I have a Lua VM for scripting. In the scripts, I write things like:

How does Perl decide to treat a scalar as a string or a number?

Consider the following code and its output:

python search string for numbers, put brackets around them

I'm trying to search a string for numbers, and when finding them, wrap some chars around them, e.g.

Formatting currency in String from different locale currency formats

I have a java string variable in my groovy app. The variable contains a user input of price in possibly different currency formats:

Preventing overlap of number ranges

I failed at this problem for several hours now and just can't get my head around it. It seems fairly simple from a "human" POV, but somehow I just can't seem able to write it into code.

Number types emulation on javascript

I wonder if there is any library to emulate the native type numbers on other languages, like int and double. The library should emulate those types accurately, including overflow.

How to take off line numbers in Vi?

For displaying line numbers in a file, I use command:

Oracle Floats vs Number

I'm seeing conflicting references in Oracles documentation. Is there any difference between how decimals are stored in a FLOAT and a NUMBER types in the database?

PHP json_decode integers and floats to string

I want to pre-parse a json an convert all numbers in the json (integers or float) to strings.

Numeric Captcha for PHP

Is there a numeric captcha available for PHP?

Prolog find maximum even number in the list

I need to find max even number in the list. For example

JavaScript get number from string

I have a string in javascript like `#box2' and I just want the '2' from it.

dart, total available string characters?

I'm not familiar with character sets and whether languages pick them up from their environments or if they are baked into the language itself, I wanted to make a simple number system in dart that h...

Java : large integer numbers error

I am trying to do the following math equation in Java:

How i can round to the nearest 60 sec interval in MySQL

I got a table that have records of calls. The detail have the the phone_number and call_time in milliseconds. Which could be the SQL statement to have a column with the rounded call_time to the nea...

Convert Input Value to Integer or Float, as Appropriate Using Ruby

I believe I have a good answer to this issue, but I wanted to make sure ruby-philes didn't have a much better way to do this.

Generating random number strings on the same page

I'm trying to add about 20 separate random generated number strings between 55 and 999 on a single page, is this possible? I have tried appending the element ID from "randomnumber" to randomnumber2...

NSUInteger in iOS7

I'm having a really weird problem here with NSUInteger in iOS7,

UITextField - Allow only numbers and punctuation input/keypad

I have tried the code below but that only allows for numbers on the keypad to be inputted. My app requires the keypad to use a period/full stop (for money transactions). The code I tried is:

How to generate random numbers with rand() without time.h in C

How to generate random numbers with rand() and srand() without time.h in C ?

C++ How to create two seperate objects that display random numbers 10 times?

The program I am trying to write is to create two objects to display random numbers between 1000-9000 and 100-900 respectively.

issue with self made random number generator in python. (using time.time())

I am well aware that python has a built in random library, so please do not include any reference to it in this. I am taking a do-it-yourself approach using time.time(). I made a simple random num...

java convert GB, Mb, KB, and byte to double with precision

Im downloading files in various sizes and like to

setter/getter not working for Number literal

I thougt it would be fun to rewrite my zero padding extension to the Number.prototype into a genuine getter/setter pattern. Not very difficult. I ended up with this code (addSetter and addGetter ar...

c# number shaper for money amount like convert int 12333545 = 12,333,545

What is the easiest and fastest way of converting string or int to the money format

Display Amount in Words in

I have a column called FeeAmount in my table.

PHP Regex Separate Number from String

I have the following string: 01SOMECOMPANY and I want to end up with 01 SOMECOMPANY. How do I do this using regular expressions?

What is the smallest positive floating point value?

How can I express a number in Objective-C "infinitely" close to zero but still larger. Essentially I want the smallest positive number.

Integer distance

As a single operation between two positive integers we understand multiplying one of the numbers by some prime number or dividing it by such (provided it can be divided by this prime number

BitConverter VS ToString for Hex

Just wondering if someone could explain why the two following lines of code return "different" results? What causes the reversed values? Is this something to do with endianness?

Javascript using prototype how can I set the value of “this” for a number?

So if we can get past the "should you?" question ... does anyone know how to set the value of an integer in prototype?

Sort a list with a specific way

I have a list of number in my database and wanna list them like this:

i m trying to generate random number but every time i am getting error ‘ranf’ was not declared in this scope

here is the code which is giving error 'ranf' was not declared in this scope.

Determine if a string is an integer or a float in ANSI C

Using only ANSI C, what is the best way to, with fair certainty, determine if a C style string is either a integer or a real number (i.e float/double)?

Regex: Lookahead and lookbehind, checking a . (dot) for use as decimal vs full-stop

I've had a good look around the net for an answer to this, but can't seem to get it working.

What is the most exact Java type to describe a Number

Assuming that performance is not an issue, and knowing that I only want to use ONE type for all the numbers I have in my program, which type will be the correct one to use? I think that BigDecimal is

The mt_rand() function of PHP returns only 2^31 different random numbers. How does it modify the normal Mersenne twister?

I implemented Mersenne twister in java, and it can generate 32 bit uniformly distributed random numbers in the closed interval [Integer.MIN_VALUE,Integer.MAX_VALUE].

How can I convert a number to its English form in Perl?

I need a Perl script which takes numbers as input example 222

Java Negative of a Number Instance

I have a class like this:

Compress a very large number (in Python)

I need a very very very large number (143 millions digits) to be compressed. I'm looking for a solution that compresses it without loss to at least 10% of it. I've tried zlib, zipfile, gzip, and so...

Check every possible combination of numbers against one

I currently load numbers into an array, these are always different numbers and there can be any amount of them, here is an example;

PHP: Converting an url variable number to a number

I'm trying to send a number from a page to another on in order to save it on my database, but when I use number_format method the number is converted to 0:

what is the difference between the java.lang.Math class and the java.Math class

I am trying to figure out which 'Library' the BigDecimal Class resides in. When I read the referencing information it says this:

In swift, how do I do this?

My English is not enough to search the question. So, I have to write here. My integer is 600000000 for ex. I want to convert it like this: 600,000,000. How do I do this?

Complex regular expression to handle number sequence

Hi I have been upto a difficult regular expression to handle of which I have very limited knowledge. It would be great if someone can let me understand how to interprete such problem:

How to accurately convert numbers to strings in JavaScript

JavaScript stores all numbers in double-precision floating-point format, with a 52-bit mantissa and an 11-bit exponent (the IEEE 754 Standard for storing numeric values), and therefore its

How to write a function to generate random number 0/1 use another random function?

If I have a function named rand1() which generates number 0(30% probability) or 1(70% probability), how to write a function rand2() which generates number 0 or 1 equiprobability use rand1() ?

Are there are any side effects of using this method to convert a string to an integer

Are there any side effects if i convert a string to a number like below..

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.