Search Results

Search found 29841 results on 1194 pages for 'random number generator'.

Page 65/1194 | < Previous Page | 61 62 63 64 65 66 67 68 69 70 71 72  | Next Page >

  • C++ template meta-programming, number of member variables?

    - by aaa
    hello Is it possible in C++ to determine number of variables/fields in the generic class? for example // suppose I need metaclass number_members determines number of members struct example { int i, j; }; assert(number_members::value==2); I looked through mpl but could not find implementation thanks.

    Read the article

  • An algorithm for converting a base-10 number to a base-N number.

    - by roja
    Guys, I am looking for a way to convert a base-10 number into a base-N number where N can be large. Specifically i am looking at converting to base-85 and back again. Does anyone know a simple algorithm to perform the conversion? Ideally it would provide something like: to_radix(83992, 85) - [11, 53, 12] Any ideas are appreciated! Roja

    Read the article

  • rails convert string to number

    - by Yang
    hi guys, i am wondering is there a convenient function in rails to convert string with negative signs into a number. e.g. -1005.32 when i use to_f method, the number will simply become 1005 with the negative sign and decimal part being ignored. thanks in advance!

    Read the article

  • Algorithm for multiple word matching in a text, count the number of every matched word

    - by 66
    I have noticed that it has solutions for matching multiple words in a given text, such as below: http://stackoverflow.com/questions/1099985/algorithm-for-multiple-word-matching-in-text If I want to know exactly the number of appearances of each matched word in the text, my solution is like this: step 1: using ac-algorithm to obtain the maching words; step 2: count the number of each word obtained in step 1 is there a faster way? Thx~

    Read the article

  • Validate a number between 10 and 11 characters in length

    - by Montana Flynn
    I am using javascript (and PHP) to validate a simple form with a phone number field. I have it working fine checking that the field has only 10 characters, but I really want to check if the field has between 10 and 11 characters. Reason being, some people type numbers like so: 1 555 555 5555 and some people do this 555 555 5555. Here is what I have that works for checking if the length is 10: if (!(stripped.length == 10)) { alert("Please enter a valid US phone number.") return false }

    Read the article

  • jQuery - count number of rows in a table

    - by danjan
    How do I count the number of tr elements within a table using jquery. Sorry, I sense this might be basic but i've been banging my head against it. I know there is a similar thread, but I just want the total rows. http://stackoverflow.com/questions/613024/count-number-of-table-rows-between-two-specific-rows-with-jquery

    Read the article

  • inserting number into oracle sql - using jython

    - by kdev
    I have this insert command where iam trying to insert a number to be taken from loop i=0 for line in column: myStmt.executeQuery("INSERT INTO REVERSE_COL ( TABLE_NAME,COL_NAME,POS) values (,'test','"+column[i]+"','"+i+"'") i=i+1 POS IS NUMBER DATATYPE but it works if i hard code as 1 i=0 for line in column: myStmt.executeQuery("INSERT INTO REVERSE_COL ( TABLE_NAME,COL_NAME,POS) values (,'test','"+column[i]+"',1") I have tried only i , +i+ and other method but its not working any suggestion how to solve this . Thanks everyone .

    Read the article

  • rails solr search limit total search results / get fixed number of results

    - by kLeos
    I'm trying to perform a search, order the results randomly, and only return a number of results, not all matches. Something like limit(2) I've tried using the Solr param 'rows' but that doesn't seem to do anything: @featured_articles = Article.search do with(:is_featured, true) order_by :random adjust_solr_params do |params| params[:rows] = 2 end end @featured_articles.total should be 2, but it returns more than 2 How can I get a randomized fixed number of results?

    Read the article

  • mySQL search for a number in VARCHAR field

    - by sea_1987
    Hi There, I have a field in my database that contain comma seperated values these values are numbers, and I am trying to do a search and count the number of times that a number appears in that column throughout the column, $sql = "SELECT sector_id_csv, COUNT(sector_id_csv) as count FROM cv WHERE sector_id_csv LIKE '$sectorId'"; This seems slow and does not return any results, and I know the sector_id it is search exsists in the table.

    Read the article

  • Store number in Excel using Apache POI.

    - by Manoj
    Hi All, I am using Apache POI to store data in excel sheet. I can store data like "50%" in the cell. Excel also shows up, but it show error like "Number stored as String". If i click that message and click "convert number to String". It shows perfectly. How to store it without errror using POI

    Read the article

  • How to return number of rows in the template

    - by xRobot
    In my view I return all posts of one blog: posts = Post.objects.filter(blog=blog) and pass it to context. But.. How can I get the number of posts in the template ? This is my template: <h1>Number of posts: {{ ??? }} </h1> {% for post in posts %} {{ post.title }} {{ post.body }} {% endfor %}

    Read the article

  • Getting number of instances of asp.net website

    - by flopdix
    I have an asp.net website and i want to get the number of users currently viewing my site. I am aware that there are some third party softwares available, that would give me the list of the users online but i don't want to do that. Does anyone know how this can be achieved in asp.net? May be if there are any server variables that would keep a track of the website instances that gives the number of users currently visiting the site. Please help me.

    Read the article

  • Determine precision and scale of particular number in Python

    - by jrdioko
    I have a variable in Python containing a floating point number (e.g. num = 24654.123), and I'd like to determine the number's precision and scale values (in the Oracle sense), so 123.45678 should give me (8,5), 12.76 should give me (4,2), etc. I was first thinking about using the string representation (via str or repr), but those fail for large numbers: >>> num = 1234567890.0987654321 >>> str(num) = 1234567890.1 >>> repr(num) = 1234567890.0987654

    Read the article

  • Android number input with plus and minus sign.

    - by alaak
    Hi, I am developing in android and I would like an input field for numbers, where the user can select the correct number using the plus sign at the top and the minus sign at the bottom of the input field. I know this works for date picker. Is there some property or something similar to make this available for any integer number input field? Thanks

    Read the article

< Previous Page | 61 62 63 64 65 66 67 68 69 70 71 72  | Next Page >