Search Results

Search found 6031 results on 242 pages for 'imaginary numbers'.

Page 19/242 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Print numbers sequentially using printf with filling zeroes

    - by Werner
    Hi, in C++, using printf I want to print a sequence of number, so I get, from a "for" loop; 1 2 ... 9 10 11 and I create files from those numbers. But when I list them using "ls" I get 10 11 1 2 .. so instead of trying to solve the problem using bash, I wonder how could I print; 0001 0002 ... 0009 0010 0011 and so on Thanks

    Read the article

  • Regular expression for a list of numbers without other characters

    - by JamesW
    I need a regular expression for a list of numbers in a text box with carriage returns and line feeds, but no other characters. e.g. 1234 5678 5874 3478 I have this: Regex(@"\d\r\n${0,}?"); ... but it is accepting commas when I paste them into my text box: e.g. 1234, 5678 5874, 3478 Can someone please tell me what I'm doing wrong? Thanks

    Read the article

  • Best way to send floating point numbers from .NET to Java and back

    - by Evgeny
    I'm writing a .NET application that will make an RPC call to a Java application (via a message queue). The data sent in both directions will be large arrays of floating-point numbers. What is the best way to serialize them to send them across the wire? I'd like something more compact than text, but architecture-independent as the server may not be an x86 machine. The Java application can be changed as needed.

    Read the article

  • Removing Numbers from a String using Javascript

    - by Abs
    Hello all, How do I remove numbers from a string using Javascript? I am not very good with regex at all but I think I can use with replace to achieve the above? It would actually be great if there was something JQuery offered already to do this? //Something Like this?? var string = 'All23'; string.replace('REGEX', ''); I appreciate any help on this.

    Read the article

  • Finding the count of characters and numbers in a string

    - by Aspirant
    Hi I have a table test as below NAME --------- abc1234 XYZ12789 a12X8b78Y9c5Z I try to find out the count of number of numbers and characters in the string as select name,length(replace(translate(lower(name),'abcdefghijklmnopqrstuvwxyz',' '),' ','')) as char_count, length(replace(translate(name,'1234567890',' '),' ','')) as num_count from test6; Its executing fine giving the output NAME CHAR_COUNT NUM_COUNT abc1234 4 3 XYZ12789 5 3 a12X8b78Y9c5Z 7 6 But my question is there any option by not giving the abcdefghijklmnopqrstuvwxyz and 1234567890 manually

    Read the article

  • fill array with binary numbers

    - by davit-datuashvili
    hi, first of all this is not homework!! my question is from book: Algorithms in C++ third edition by robert sedgewick question is: there is given array of size n by 2^n(two dimensional) and we should fill it by binary numbers with bits size exactly n or for example n=5 so result will be 00001 00010 00011 00100 00101 00110 00111 and so on we should put this sequence of bits into arrays please help me

    Read the article

  • UITextField with numbers and default keyboard

    - by n35
    Created a UITextField for "Postal Code/ZIP" field with a keyboardType of UIKeyboardTypeDefault. I would like to use the default keyboard but want the numbers & symbols to be shown by default as apposed to letters. Apple does this when you are entering addresses in the Contacts.app. Anyone know how to get this accomplished?

    Read the article

  • Display Commas in Large Numbers: JavaScript

    - by user3723918
    I'm working on a customized calculator, which is working pretty well except that I can't figure out how to get the generated numbers to display commas within the number. For example, it might spit out "450000" when I need it to say "450,000". This thread gives a number of suggestions on how to create a new function to deal with the problem, but I'm rather new to JavaScript and I don't really know how to make such a function interact with what I have now. I'd really appreciate any help as to how to get generated numbers with commas! :) HTML: <table id="inputValues"> <tr> <td>Percentage:</td> <td><input id="sempPer" type="text"></td> </tr> <tr> <td>Price:</td> <td><input id="unitPrice" type="text"></td> </tr> <tr> <td colspan="2"><input id="button" type="submit" value="Calculate"></td> </tr> </table> <table id="revenue" class="TFtable"> <tr> <td class="bold">Market Share</td> <td class="bold">Partner A</td> <td class="bold">Partner B</td> </tr> <tr> <td class="bold">1%</td> <td><span id="moss1"></span></td> <td><span id="semp1"></span></td> </tr> </table> </form> JavaScript: <script> function calc() { var z = Number(document.getElementById('sempPer').value); var x = Number(document.getElementById('unitPrice').value); var y = z / 100; var dm1 = .01 * 50000 * x * (1-y); var se1 = .01 * 50000 * x * y; document.getElementById("moss1").innerHTML= "$"+Number(dm1).toFixed(2); document.getElementById("semp1").innerHTML= "$"+Number(se1).toFixed(2); } </script>

    Read the article

  • this program runs but not correctly numbers arent right, i read numbers from a file and then when i

    - by user320950
    this is what i have to do: write a program that determines the grade dispersal for 100 students You are to read the exam scores into three arrays, one array for each exam. You must then calculate how many students scored A’s (90 or above), B’s (80 or above), C’s (70 or above), D’s (60 or above), and F’s (less than 60). Do this for each exam and write the distribution to the screen. // basic file operations #include <iostream> #include <fstream> using namespace std; int read_file_in_array(double exam[100][3]); double calculate_total(double exam1[], double exam2[], double exam3[]); // function that calcualates grades to see how many 90,80,70,60 //void display_totals(); double exam[100][3]; int main() { double go,go2,go3; double exam[100][3],exam1[100],exam2[100],exam3[100]; go=read_file_in_array(exam); go2=calculate_total(exam1,exam2,exam3); //go3=display_totals(); cout << go,go2,go3; return 0; } /* int display_totals() { int grade_total; grade_total=calculate_total(exam1,exam2,exam3); return 0; } */ double calculate_total(double exam1[],double exam2[],double exam3[]) { int calc_tot,above90=0, above80=0, above70=0, above60=0,i,j, fail=0; double exam[100][3]; calc_tot=read_file_in_array(exam); for(i=0;i<100;i++) { for (j=0; j<3; j++) { exam1[i]=exam[100][0]; exam2[i]=exam[100][1]; exam3[i]=exam[100][2]; if(exam[i][j] <=90 && exam[i][j] >=100) { above90++; { if(exam[i][j] <=80 && exam[i][j] >=89) { above80++; { if(exam[i][j] <=70 && exam[i][j] >=79) { above70++; { if(exam[i][j] <=60 && exam[i][j] >=69) { above60++; { if(exam[i][j] >=59) { fail++; } } } } } } } } } } } return 0; } int read_file_in_array(double exam[100][3]) { ifstream infile; int exam1[100]; int exam2[100]; int exam3[100]; infile.open("grades.txt");// file containing numbers in 3 columns if(infile.fail()) // checks to see if file opended { cout << "error" << endl; } int num, i=0,j=0; while(!infile.eof()) // reads file to end of line { for(i=0;i<100;i++) // array numbers less than 100 { for(j=0;j<3;j++) // while reading get 1st array or element infile >> exam[i][j]; infile >> exam[i][j]; infile >> exam[i][j]; cout << exam[i][j] << endl; { if (! (infile >> exam[i][j]) ) cout << exam[i][j] << endl; } exam[i][j]=exam1[i]; exam[i][j]=exam2[i]; exam[i][j]=exam3[i]; } infile.close(); } return 0; }

    Read the article

  • Explanation of SendMessage message numbers? (C#, Winforms)

    - by John
    I've successfully used the Windows SendMessage method to help me do various things in my text editor, but each time I am just copying and pasting code suggested by others, and I don't really know what it means. There is always a cryptic message number that is a parameter. How do I know what these code numbers mean so that I can actually understand what is happening and (hopefully) be a little more self-sufficient in the future? Thanks. Recent example: using System.Runtime.InteropServices; [DllImport("user32.dll")] static extern int SendMessage(IntPtr hWnd, uint wMsg,UIntPtr wParam, IntPtr lParam); SendMessage(myRichTextBox.Handle, (uint)0x00B6, (UIntPtr)0, (IntPtr)(-1));

    Read the article

  • help with number calculation algorithm [hw]

    - by sa125
    Hi - I'm working on a hw problem that asks me this: given a finite set of numbers, and a target number, find if the set can be used to calculate the target number using basic math operations (add, sub, mult, div) and using each number in the set exactly once (so I need to exhaust the set). This has to be done with recursion. So, for example, if I have the set {1, 2, 3, 4} and target 10, then I could get to it by using ((3 * 4) - 2)/1 = 10. I'm trying to phrase the algorithm in pseudo-code, but so far haven't gotten too far. I'm thinking graphs are the way to go, but would definitely appreciate help on this. thanks.

    Read the article

  • *Client* scalability for large numbers of remote web service calls

    - by Yuriy
    Hey Guys, I was wondering if you could share best practices and common mistakes when it comes to making large numbers of time-sensitive web service calls. In my case, I have a SOAP and an XML-RPC based web service to which I'm constantly making calls. I predict that this will soon become an issue as the number of calls per second will grow. On a higher level, I was thinking of batching those calls and submitting those to the web services every 100 ms. Could you share what else works? On a lower level side of the things, I use Apache Xml-Rpc client and standard javax.xml.soap.* packages for my client implementations. Are you aware of any client scalability related tricks/tips/warnings with these packages? Thanks in advance Yuriy

    Read the article

  • Get signal names from numbers in Python

    - by Brian M. Hunt
    Is there a way to map a signal number (e.g. signal.SIGINT) to its respective name (i.e. "SIGINT")? I'd like to be able to print the name of a signal in the log when I receive it, however I cannot find a map from signal numbers to names in Python, i.e. import signal def signal_handler(signum, frame): logging.debug("Received signal (%s)" % sig_names[signum]) signal.signal(signal.SIGINT, signal_handler) For some dictionary sig_names, so when the process receives SIGINT it prints: Received signal (SIGINT) Thank you.

    Read the article

  • Replacing Credit Card Numbers

    - by Del
    Hi, I'm using an sql to replace credit card numbers with xxxx and finding that REGEX_REPLACE does not consistently replace everything. Below is the SET command i'm using on the SQL SET COMMENTS_LONG = REGEXP_REPLACE (COMMENTS_LONG,'\D[1-6]\d{3}.\d{4}.\d{4}.\d{3}(\d{1}.\d{3})?|\D[1-6]\d{12,15}|\D[1-6]\d{3}.\d{3}.?\d{3}.\d{5}', ' XXXXXXXXXXXXXXXX') Before Elizabeth aclled to change address.5430-6000-2111-1931 A After Elizabeth aclled to change address XXXXXXXXXXXXXXXX1 A I tried increasing the number of X but result is the same. I also find that i have to put a space in front of the first X as it appears to move 1 char to the left.

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >