numbers

What are your build and release steps? When to increment build numbers?

I am having trouble defining and automating my build process despite simple requirements: Every build should have a unique build number. Every tagged release should be reproducible What I have: A C++, Red Hat Enterprise Linux 5.x, Subversion development environment. A build machine ( actually a virtual machine ) A version.h file ...

PHP - How to remove the first number in a string?

Hello. How can I remove the first number in a string? Say if I had these 48 numbers seperated with a ',' (comma): 8,5,8,10,15,20,27,25,60,31,25,39,25,31,26,28,80,28,27,31,27,29,26,35,8,5,8,10,15,20,27,25,60,31,25,39,25,31,26,28,80,28,27,31,27,29,26,35 How would I remove the "8," from the string? Thanks. ...

vb.net, full number presentation with small double number

if I have a small double in vb.net like this: dim x as double = 0.00000003 a conversion to a string would produce a E-presentation (3E-7). in debugging the value it will be shown as full number (0.00000003). how can I get the full number in a string? ...

read numbers from files in columns, one column whole numbers, other column numbers with decimals

int price=' '; // attempt to grab a decimal number - but not the correct way int itemnum=' '; // attempt to grab a whole number - but not the right way while((price== (price*1.00)) && (itemnum == (itemnum*1))) What is a way to get numbers in 2 diff columns where one column is whole numbers and the other are numbers with decimal plac...

given a list of up to 10 integer numbers and a sum, will display a subset of the numbers whose total is that sum

Write a program which, given a list of up to 10 integer numbers and a sum, will display a subset of the numbers whose total is that sum if one exists or indicate that none exists otherwise. For example, for the list: 5,13,24,9,3,3 and sum = 28, your program should display 13, 9, 3, 3. How to do this in C++ using a recursive function? ...

How to eliminate a prefix of '0' before a number using jquery

I need a jquery script section that checks to see if the first digit of a textbox entered number string is a '0' and eliminate it if so. For example "044055" needs to become "44055" ...

Python: Socket set source port number

Hi all, I'd like to send a specific UDP broadcast packet.. unfortunatly i need to send the udp packet from a very specific port for all packet I send. Let say I broadcast via UDP "BLABLAH", the server will only answer if my incoming packet source port was 1444, if not the packet is discarded. My broadcast socket setup look like this ...

Simple, Custom Parsing with c++

Hi! I have been reading SO for some time now, but I truly cannot find any help for my problem. I have a c++ assignment to create an IAS Simulator. Here is some sample code... 0 1 a 1 2 b 2 c 3 1 10 begin 11 . load a, subtract b and offset by -1 for jump+ 11 load M(0) 12 sub M(1) 13 sub M(3) 14 halt Using c++, I ne...

Example using build number in version string when building Android project via ant ?

We are using Hudson to automate our Android build. I need to incorporate the build number into the version string used in our app. Was wondering if anyone had an example of doing that before I (re?)invent that wheel. Obviously I need to replace a string value in one of our config files. ...

Return a number between 0 and 4

How do I return a number between 0 and 4, depending the input number? For example if I pass it number 23 it will return 3. The number set should look like 0 5 10 15 20 .. 1 6 11 16 21 .. 2 7 12 17 22 .. 3 8 13 18 23 .. 4 9 14 19 24 What's the math for this? ...

Casting strings to numbers using XSLT

There is a task to output some data taken from database using XSLT. The application current locale is ru_RU, so decimal separator is comma. It looks like <data> <row> <date value="28.04.2010"/> <clicks value="281"/> <depth value="1,7"/> <row> <row> <date value="29.04.2010"/> <clicks value="15"/> <depth valu...

Find numbers whose sum of digits is 7 [PHP]

i have a question that i want to display the numbers up to 100 where the sum of their digits is 7. can any one help me suppos there is 25 . in ths 2+5=7 then it will be displayed. i have problem to break 25 as 2 and 5 ...

Float to binary in C++

Hi, I'm wondering if there is a way to represent a float using a char in C++? For example: int main() { float test = 4.7567; char result = charRepresentation(test); return 0; } I read that probably using bitset I can do it but I'm not pretty sure. Let's suppose that my float variable is 01001010 01001010 010...

multi-shop orders table and sequential order numbers based on shop

Hey, I am looking at building a shop solution that needs to be scalable. Currently it retrieves 1-2000 orders on average per day across multiple country based shops (e.g. uk, us, de, dk, es etc.) but this order could be 10x this amount in two years. I am looking at either using separate country-shop databases to store the orders table...

obj-c : iphone programming disabling the round off of a number

hi, i need to show a number to a user : 1.96666777 (timeHour) moduloformat = [NSString stringWithFormat:@"%0.0f hours ",timeHour]; but it is rounding off the number automaticly. It gives "2" and i want to show "1" i could use a NSrange and take the first number but i wanna know how to deal with this. Thanks!! ...

Jquery convert integer to string and back

These are the logical steps which I need to do with jquery: x is a 2 digit number(integer) derived from an input.value(); If var x is **not** 33 or 44 Convert this 2 digit number to string; split the string in 2 parts as number; Add these 2 values until they reduce to single digit; Return var x value as this value; Els...

How would I find all sets of N single-digit, non-repeating numbers that add up to a given sum in PHP?

Let's say I want to find all sets of 5 single-digit, non-repeating numbers that add up to 30... I'd end up with [9,8,7,5,1], [9,8,7,4,2], [9,8,6,4,3], [9,8,6,5,2], [9,7,6,5,3], and [8,7,6,5,4]. Each of those sets contains 5 non-repeating digits that add up to 30, the given sum. Any help would be greatly appreciated. Even just a starting...

C# Extension Method for String Data Type

My web application deals with strings that need to be converted to numbers alot - users often put commas, units (like cm, m, g, kg) and currency symbols in these fields so what I want to do is create a string extension method that cleans the field up and converts it to a decimal. For example: decimal myNumber = "15 cm".ToDecimal(); ...

How to create a magic square in PHP?

I'd like to try my hand at creating a Magic Square in PHP (i.e. a grid of numbers that all add up to the same value), but I really don't know where to start. I know of the many methods that create magic square, such as starting "1" at a fixed position, then moving in a specific direction with each iteration. But that doesn't create a tru...

Convert number into words using flex.

Hi I am trying to convert an entry using a numeric stepper in flex into words to display in a textarea. i.e a user uses the stepper to enter "89" as a value and in the text area the words "Eighty nine" are displayed. After much searching i haven't found anything that helps - a few javascript functions but that is all. any help sampl...