I have variables with values like 1.7m 1.8k and 1.2b how can I convert them to a real number value for example
1.7m = 1700000
1.8k = 1800
1.2b = 1200000000
I wrote these two methods to determine if a number is perfect. My prof wants me to combine them to find out if there is an odd perfect number. I know there isn't one(that is known), but I need to actually write the code to prove that.
The issue is with my main method. I tested the two test methods. I tried debugging and it gets stuck on the…
I'm trying to use Notepadd++ to find all occurrences of width=xxx so I can change them to width="xxx"
as far as I have got is width=[^\n] which only selects width=x
Just wondering if anybody has a good convention to follow in this corner-corner-corner case. I really use Java but figured the C# folks might have some good insight too.
Say I am trying to name a class where two consecutive words in the class name are numeric (note that the same question could asked about identifier names). Can't get a…
Here's a screen shot from Google Analytics. It's my last months traffic, and this is the 'Frequency & Recency' tab.
So I believe that if I add up all the numbers under 'visits' I get 11,432, which is right, and if I add up all the numbers under 'pageviews' I get 14,785 and that's right as well. But, let's take the last line - the…
int exam1[100];// array that can hold 100 numbers for 1st column
int exam2[100];// array that can hold 100 numbers for 2nd column
int exam3[100];// array that can hold 100 numbers for 3rd column
void main()
{
ifstream infile;
int num;
infile.open("example.txt");// file containing numbers in 3 columns
…
I want to write a function which will be repeatedly called by other functions many times. Inside this function it is supposed to generate a lot of random numbers and this part will be treated in parallel. If only for one run, the seed can be chosen differently for each thread, so that the random numbers will be…
Hi all,
I want to align the code's frame with the formated text's frame.
If the numbers=left,the mission is accomplished by configuring xleftmargin, xrightmargin, framesep, and numbersep.
However, when I set numbers=none, I cannot accomplish my mission by configuring those properties.
Regardless of the…
I'm looking at migrating a large suite of IBM Assembler Language programs, from a vcs based on "filenames include version numbers", to a modern vcs which will give me, among other things, the ability to branch and merge.
These files have 80-column records, the last 8 columns being an almost-meaningless…
I know the IEEE 754 floating point standard by heart as I had to learn it for an exam. I know exactly how floating point numbers are used and the problems that they can have. I can manually do any operation on the binary representation of floating point numbers.
However, I have not found a single source…
I have an web application that creates printable forms, these forms have a unique number on them, the problem is I have 2 forms that separate numbers need to be created for them.
ie)
Form1- Numbered 2000000-2999999
Form2- Numbered 3000000-3999999
dbo.test2 - is my form information table
Tsel - is my…
I'm trying to count the frequency of numbers from 1 to 100 on different fields of a table.
Let's say I have the table "Results" with the following data:
LottoId Winner Second Third …
I was trying a basic sorting exercise and I was hoping I could receive some help with what is probably a basic logic error.
int[] numbers = new int[] { 2, 5, 11, 38, 24, 6, 9, 0, 83, 7 };
for (int loop = 0; loop < numbers.Length; loop++)
{
Console.WriteLine(numbers[loop]);…
I have a pdf document I created through non-Acrobat means (printing to pdf, then merging a bunch of pdfs), but I'd like to manually change the page numbers (i.e. the first several pages are simply title pages, the page that is labeled "page 1" is really the 7th sheet of the pdf). What's the simplest…
I have a pdf document I created through non-Acrobat means (printing to pdf, then merging a bunch of pdfs), but I'd like to manually change the page numbers (i.e. the first several pages are simply title pages, the page that is labeled "page 1" is really the 7th sheet of the pdf). What's the simplest…
We're all aware that magic numbers (hard-coded values) can wreak havoc in your program, especially when it's time to modify a section of code that has no comments, but where do you draw the line?
For instance, if you have a function that calculates the number of seconds between two days, do you…
G'day All
Most Australian phone numbers are 10 digits with the 1st 2 optional if they're a local area code. For those setting...
viewer.dataDetectorTypes = UIDataDetectorTypePhoneNumber;
on a web view works. We also have a range of 6 digit phone numbers (usually written xxx xxx or xx xxxx)…
I've been using java to parse numbers, e.g.
(. Integer parseInt numberString)
Is there a more clojuriffic way that would handle both integers and floats, and return clojure numbers? I'm not especially worried about performance here, I just want to process a bunch of white space delimited…
What is a good data structure for storing phone numbers in database fields? I'm looking for something that is flexible enough to handle international numbers, and also something that allows the various parts of the number to be queried efficiently.
[Edit] Just to clarify the use case here: I…
I've got a list of number that I need to keep track of. The numbers are loosely related, but represent distinctly different items. I'd like to keep a list of the numbers but be able to refer to them by name so that I can call them and use them where needed easily. Kind of like an inventory…
I really want to do something useful when a PK violation occurs but I hate trapping error numbers... they just don't read right without comments (they're certainly not self documenting).
I know I can find all the potential error numbers at SQL Server books online but I really want to be…
There have been several questions posted to SO about floating-point representation. For example, the decimal number 0.1 doesn't have an exact binary representation, so it's dangerous to use the == operator to compare it to another floating-point number. I understand the principles behind…