I feel like I should know the answer to this, but I don't.
What is the type character on a numeric literal called?
double myDouble = 12d;
float myFloat = 10f;
I wanted to find a complete list of them today, but couldn't come up with what to ask Google to search for.
EDIT
Found a decent list if anyone is interested
http://www...
(sorry if this is a dumb question, I'm still learning)
I'm making a program that, for part of the prog, rolls four dice and subtracts the lowest dice from the outcome. The code I'm using is
die1 = random.randrange(6) + 1
die2 = random.randrange(6) + 1
die3 = random.randrange(6) + 1
die4 = random.randrange(6) + 1
if die1 <= die2 and die...
If a string in Perl 5 passes looks_like_number, it might as well be a number. For instance,
my $s = "10" + 5;
results in $s being assigned 15.
Are there any cases where a string does not behave like it's numeric equivalent would have?
...
I would like to extract the number from a string in MSBuild.
How can I do that using the built in tasks or the MSBuild.Community.Tasks? (RegexMatch might do, but how?)
Example: I have the string
agent0076
and I would like to get out the number, without the leading zeros:
76
...
In PHP, how do I distinguish between a number as a string [0-9] versus an operator (+-*/) or letter [A-Za-z]?
I tried this, but intval also converts the type of nonnumbers to ints as well:
is_int(intval($somestr));
Is regex the way to do it?
...
I have data like:
Audio 1 Test
File 10
Audio 2
Audio 3
File 11
Audio 1
Audio 13
Audio 22
File 20 Test
Test File 22
Audio 10
File 1
File 2
I need it order first by the text (i.e. Audio, File, Test) and then by number (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 etc.)
The problem is that sorti...
Intro
Consider you have a list of key/value pairs:
(0,a) (1,b) (2,c)
You have a function, that inserts a new value between two current pairs, and you need to give it a key that keeps the order:
(0,a) (0.5,z) (1,b) (2,c)
Here the new key was chosen as the average between the average of keys of the bounding pairs.
The problem is, t...
Hi,
I have a question. How can I calculate/estimate upper bound of random number, that a random number can generate ? Thanks in advance!
...
Hi I am working on an app at the moment that requires number input to be formatted as the textfield changes as well as perform a calculation. I have the text fields set up so that as the user types notifications are passed out and a calculation is performed. However what I need to do now is format the text to be in this style: €1,000,000...
I have a WPF application in which I have a hook at PreviewTextInput, through that I get the currently entered character and I have the string already entered. Given this I need to write the following function :
bool ShouldAccept(char newChar,string existingText)
existingText can be comma seperated valid numbers(including exponential) ...
Hey guys!
I'm awful with computers! I'm trying to use Filezilla to connect to my server. When I do this, this is the message it give me verbatim:
Protocol error: Unknown protocol identifier (0x50 0x50 0x48). Most likely connected to the wrong port.
Connection to server closed.
but it's not the wrong port!... what am I doing wrong?
...
Hi, not necessarily a programmer question but I need to enter a TAB after every 84th character of a text. I'm trying to do it in InDesign but I don’t see an option for this. Is there a good application to do this?
Preferably Mac OS X compatlible but Windows XP is fine too.
Thank you very much!
...
I have an HTML table with number values. What i need to do is to get all these values and add them together using jQuery.
Any ideas?
Example table:
http://pastie.org/998759
...
I'm writing a Cocoa application and I'd like to generate a Numbers spreadsheet from my application using Scripting Bridge. I've generated the Numbers.h file and linked the ScriptingBridge.framework per the directions in Apple's Documentation. Below is the code I'm using to try to simply create a Numbers document and save it.
NSString *...
I am working through a problem for my MCTS certification. The program has to calculate pi until the user presses a key, at which point the thread is aborted, the result returned to the main thread and printed in the console. Simple enough, right? This exercise is really meant to be about threading, but I'm running into another problem. T...
I need to have a list with id's for each list item being #one, #two etc.
Is this the most efficient way or am I missing an in built ruby function here?
-num_array = ["one", "two", "three", "four", "five", "six", "seven"]
-navigation[:primary_level].each_with_index do |primary_item, idx|
%li{ :id => "#{num_array[idx]}"}
...
I would like an algorithm for a function that takes n integers and returns one integer. For small changes in the input, the resulting integer should vary greatly. Even though I've taken a number of courses in math, I have not used that knowledge very much and now I need some help...
An important property of this function should be that ...
I'm trying to use this number:
294670251400
This number will be an attribute in a model that is keeping counter tabs on membership cards. The membership cards have three four digit vanity sets.
But when I update_attribute to contain this, the number is reset to mySQL's max int :
2147483647
Anyone have a workaround to this ?
...
can anyone tell me if the C# Random.Next() method is thread safe?
...
well this isnt my homework so you can help me out in this, im tryin to solve this for my firm
but im really lost in between do i sue sequence or not
for example
person
Input 277-5387
Output BRSKEUP
...