Search Results

Search found 2558 results on 103 pages for 'significant digits'.

Page 25/103 | < Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >

  • Base 62 conversion in Python

    - by mikl
    How would you convert an integer to base 62 (like hexadecimal, but with these digits: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'). I have been trying to find a good Python library for it, but they all seems to be occupied with converting strings. The Python base64 module only accepts strings and turns a single digit into four characters. I was looking for something akin to what URL shorteners use.

    Read the article

  • How do I do arithmetic operations on HH:MM:SS format time strings in C#?

    - by Jake
    I have a series of times that are coming to me as strings from a web service. The times are formated as HH:MM:SS:000 (3 milisecond digits). I need to compare two times to determine if one is more than twice as long as the other: if ( timeA / timeB > 2 ) What's the simplest way to work with the time strings? If I was writing in Python this would be the answer to my question: Difference between two time intervals in Python

    Read the article

  • WPF Textbox Preview events related

    - by Nitin Chaudhari
    I have a WPF textbox, and perform the following actions Enter text as "12345" Move cursor between 3 and 4 (using arrow or mouseclick) Enter 0 (so Text is now "123045") Which event/eventargs can tell me that 0 was typed at location 4. I need to know this at Preview level so that I can reject the character 0 based on the prefixed and suffixed digits.

    Read the article

  • Why does this code sometimes return NaN?

    - by carrots
    This often returns NAN ("Not A Number") depending on input: #define PI 3.1415f GLfloat sineEaseIn(GLfloat ratio) { return 1.0f-cosf(ratio * (PI / 2.0f)); } I tried making PI a few digits smaller to see if that would help. No dice. Then I thought it might be a datatype mismatch, but float and glfloat seem to be equivalent: gl.h typedef float GLfloat; math.h extern float cosf( float ); Is this a casting issue?

    Read the article

  • question with its query

    - by user329820
    Hi this is my homework and the question is this: List the average balance of customers by city and short zip code (the first five digits of thezip code). Only include customers residing in Washington State (‘WA’). also the Customer table has 5 columns(Name,Family,CustZip,CustCity,CustAVGBal) I wrote the query like below is this correct? SELECT CustCity,LEFT(CustZip,5) AS NewCustZip,CustAVGBal FROM Customer WHERE CustCity = 'WA' THANKS!!

    Read the article

  • Rounding values up or down in C#

    - by c11ada
    Hey all, I've created a game which gives a score at the end of the game, but the problem is that this score is sometimes a number with a lot of digits after the decimal point (like 87.124563563566). How would I go about rounding up or down the value so that I could have something like 87.12? Thanks!

    Read the article

  • convert an integer number into an array

    - by droseman
    Hi, I am trying to convert an integer number in C into an array containing each of that number's digits i.e. if I have int number = 5400 how can I get to int numberArray[4] where numberArray[0] = 0; numberArray[1] = 0; numberArray[2] = 4; numberArray[3] = 5; Any suggestions gratefully received --dave

    Read the article

  • Mass update of data in sql from int to varchar

    - by Christopher Kelly
    we have a large table (5608782 rows and growing) that has 3 columns Zip1,Zip2, distance all columns are currently int, we would like to convert this table to use varchars for international usage but need to do a mass import into the new table convert zip < 5 digits to 0 padded varchars 123 becomes 00123 etc. is there a way to do this short of looping over each row and doing the translation programmaticly?

    Read the article

  • Is it possible to resize text to fit a fixed size div?

    - by int3
    This seems like a pretty natural use case to me, though I haven't been able to find anything on it: Say I have a fixed-width div that is dynamically populated with some number. What's the best way to ensure that numbers with more digits take smaller font sizes such that they fit nicely into that fixed width? Is there some CSS property for this, or do I have to resort to Javascript hackage?

    Read the article

  • How to generate a transaction number?

    - by 001
    I was thinking of formatting it like this TYYYYMMDDNNNNNNNNNNX (1 character + 19 digits) Where T is type YYYY is year MM is month DD is day N is sequencial number X is check digit The problem is, how do I generate the sequencial number? since my primary key is not an auto increment integer value, if it was i would use that, but its not. EDIT can I have the sequencial number resets itself after 1 day (24hours). P201012080000000001X <-- first transaction of 2010/12/08 P2010120810000000002X <--- second transaction of 2010/12/08 P201012090000000001X <--- First transaction of 2010/12/09 (X is the check digit)

    Read the article

  • Java Method declaration

    - by user1701604
    I'm trying to declare a method for my program that takes only a 5 digit integer and for each digit of the integer, reads a value from the program and prints it out. I understand this isn't very clear but im having trouble relaying what I mean. I understand it will be some sort of for loop to read each digit of the integer individually until something reaches 5. Something like the charAt() string method but works for digits.

    Read the article

  • PHP preg_replace - Very quick question

    - by RC
    Masters of regular expressions, please help! See this string: $string = "http://www.url.com/?fieldA=123&fieldB=456&fieldC=789"; Assuming "fieldB" always has a positive non-decimal numerical value (but not necessarily three digits long), what preg_replace command do I need to remove it completely, such that the string will then read: $string = "http://www.url.com/?fieldA=123&fieldC=789"; Thanks!

    Read the article

  • Breaking a simple Captcha

    - by maSnun
    Hello All, For testing purpose, I need to break this captcha: http://wapforum.us/web/img.php As you can see, this is a very simple captcha with only 4 digits of numbers. Any sample code will be highly appreciated. Thanks and Regards, Masnun

    Read the article

  • How to Validate Pasted Dates in Excel

    - by jimdrang
    I want to validate pasted dates to remove /'s and ensure the year is 4 digits and when users paste them in it overwrites my excel validation. So, If a user pastes 05/19/10 into a cell, I would like it to convert to 05192010 or at least give an error if this is not possible. I don't know enough VB to add sheet-wide code that does this and I'm not sure if it would work when users paste multiple cells at a time.

    Read the article

  • extract variables from an expression using javascript regexp

    - by powerboy
    For example, here is a string representing an expression: var str = 'total = sum(price * qty) * 1.09875'; I want to extract variables (i.e., 'total', 'price' and 'qty' but not 'sum' since 'sum' is a function name) from this expression. What is the regexp pattern in javascript? Variable name consists of letters, digits, or the underscore, beginning with letters or the underscore.

    Read the article

  • money_format() options

    - by John Isaacks
    I am looking at the money_format function in php and confused on how to get it to format the way I want. I do not want USD in front of my string, I want a comma every 3 digits and 2 decimal points so 12345.67 will be formated to $12,345.67 Thanks.

    Read the article

  • Javscript REGEX

    - by Rabbott
    I need a javascript REGEX to check that the length of the string is 9 characters. Starts with 'A' or 'a' and is followed by 8 digits. Axxxxxxxx or axxxxxxxx

    Read the article

  • Sorting a list of version strings

    - by Zack
    I have a list containing version strings, such as things: versions_list = ["1.1.2", "1.0.0", "1.3.3", "1.0.12", "1.0.2"] I would like to sort it, so the result would be something like this: versions_list = ["1.0.0", "1.0.2", "1.0.12", "1.1.2", "1.3.3"] The order of precendece for the digits should obviously be from left to right, and it should be decending. So 1.2.3 comes before 2.2.3 and 2.2.2 comes before 2.2.3. How do I do this in Python?

    Read the article

< Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >