Search Results

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

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

  • gridview, order number + 1/- 1

    - by MyHeadHurts
    So I am working on a gridview that uses the order number to order the table. However, my users are able to ad a row. What i want is something similar to pages that have the arrows next to each row and the user can click up if they want that row to go up. I also want it to change the actual number in the row column. for the one being moved and for the other one being affected. I hope i am being clear enough

    Read the article

  • Get the number of packages transmitted per connection

    - by Daniel
    How do I get the number of packages transmitted per TCP connection? I am using Java, but i know I will have to fetch the number from the underlying OS, so this quastion applies to Linux and Windows operating systems and will have different answers for each of them, I assume. I need this information to profile the network load of an application which seems to send too many small packages by flushing the socket streams too often.

    Read the article

  • How to map frame number to time in ffmpeg output

    - by jabberbuzz
    Is it possible to get the ffmpeg output in multiple lines? I am trying to map the frame number to the time, but ffmpeg overwrites the output on the same line. frame= 638 fps=160 q=0.0 Lsize= -0kB time=26.61 bitrate= -0.0kbits/s Or is there a quicker way to get the time on the video timeline given the frame number?

    Read the article

  • JavaScript: add or subtract from number in string

    - by yoavf
    I have a string that looks like "(3) New stuff" where 3 can be any number. I would like to add or subtract to this number. I figured out the following way: var thenumber = string.match((/\d+/)); thenumber++; string = string.replace(/\(\d+\)/ ,'('+ thenumber +')'); Is there a more elegant way to do it?

    Read the article

  • Getting a substring in Ruby by x number of chars

    - by wotaskd
    I'm trying to produce some Ruby code that will take a string and return a new one, with a number x number of characters removed from its end - these can be actual letters, numbers, spaces etc. Ex: given the following string a_string = "a1wer4zx" I need a simple way to get the same string, minus - say - the 3 last digits. In the case above, that would be "a1wer". The way I'm doing it right now seems very convoluted: an_array = a_string.split(//,(a_string.length-2)) an_array.pop new_string = an_array.join Any ideas?

    Read the article

  • UITextField for Phone Number

    Hello everyone, I was wondering how I can format the textField that I'm using for a phone number (ie like the "Add New Contact" page on the iPhone. When I enter in a new mobile phone, ex. 1236890987 it formats it as (123) 689-0987.) I already have the keyboard set as the number pad. Thanks!

    Read the article

  • Maximum number of cookies allowed

    - by Nouveau
    As far as Google searches tell me, the maximum allowed number of cookies depends very much on the browser, however I cannot find any recent data as to how much cookies are allowed on modern browsers. I need to store a somewhat large number of user preferences in cookies (for not-yet-registered users), so what would be the best way of doing that? (Also, those cookies would be accessed both via javascript client-side and php server-side)

    Read the article

  • Representing a number in a byte array (java programming)

    - by Mark Roberts
    I'm trying to represent the port number 9876 (or 0x2694 in hex) in a two byte array: class foo { public static void main (String args[]) { byte[] sendData = new byte[1]; sendData[0] = 0x26; sendData[1] = 0x94; } } But I get a warning about possible loss of precision: foo.java:5: possible loss of precision found : int required: byte sendData[1] = 0x94; ^ 1 error How can I represent the number 9876 in a two byte array without losing precision?

    Read the article

  • phone number validation with added input

    - by Rkstarcass
    I recently filled out a form and when I got to the phone number textBox I noticed some really cool things going on. As I entered my number, general phone symbols were getting added automatically. Example: I start entering my area code '555' and my input was changed to 1 (555) to test what just happened I backspaced on the ) and it quickly added it back in. So my question is, how do I get this input to happen?

    Read the article

  • current line number in Lua

    - by prideout
    Does Lua support something like C's _LINE_ macro, which returns the number of the current code line? I know Lua has a special built-in variable called _G, but I don't see line number in there...

    Read the article

  • Any tools can randomly generate the source code according to a language grammar?

    - by wbsun
    A C program source code can be parsed according to the C grammar(described in CFG) and eventually turned into many ASTs. I am considering if such tool exists: it can do the reverse thing by firstly randomly generating many ASTs, which include tokens that don't have the concrete string values, just the types of the tokens, according to the CFG, then generating the concrete tokens according to the tokens' definitions in the regular expression. I can imagine the first step looks like an iterative non-terminals replacement, which is randomly and can be limited by certain number of iteration times. The second step is just generating randomly strings according to regular expressions. Is there any tool that can do this?

    Read the article

  • Classifying captured data in unknown format?

    - by monch1962
    I've got a large set of captured data (potentially hundreds of thousands of records), and I need to be able to break it down so I can both classify it and also produce "typical" data myself. Let me explain further... If I have the following strings of data: 132T339G1P112S 164T897F5A498S 144T989B9B223T 155T928X9Z554T ... you might start to infer the following: possibly all strings are 14 characters long the 4th, 8th, 10th and 14th characters may always be alphas, while the rest are numeric the first character may always be a '1' the 4th character may always be the letter 'T' the 14th character may be limited to only being 'S' or 'T' and so on... As you get more and more samples of real data, some of these "rules" might disappear; if you see a 15 character long string, then you have evidence that the 1st "rule" is incorrect. However, given a sufficiently large sample of strings that are exactly 14 characters long, you can start to assume that "all strings are 14 characters long" and assign a numeric figure to your degree of confidence (with an appropriate set of assumptions around the fact that you're seeing a suitably random set of all possible captured data). As you can probably tell, a human can do a lot of this classification by eye, but I'm not aware of libraries or algorithms that would allow a computer to do it. Given a set of captured data (significantly more complex than the above...), are there libraries that I can apply in my code to do this sort of classification for me, that will identify "rules" with a given degree of confidence? As a next step, I need to be able to take those rules, and use them to create my own data that conforms to these rules. I assume this is a significantly easier step than the classification, but I've never had to perform a task like this before so I'm really not sure how complex it is. At a guess, Python or Java (or possibly Perl or R) are possibly the "common" languages most likely to have these sorts of libraries, and maybe some of the bioinformatic libraries do this sort of thing. I really don't care which language I have to use; I need to solve the problem in whatever way I can. Any sort of pointer to information would be very useful. As you can probably tell, I'm struggling to describe this problem clearly, and there may be a set of appropriate keywords I can plug into Google that will point me towards the solution. Thanks in advance

    Read the article

  • determine parity of a bit representation of a number in MIPS

    - by Hristo
    Is there some instruction in MIPS that will determine the parity of a certain bit representation? I know to determine whether a "number" has an even parity or an odd parity is to XOR the individual bits of the binary representation together, but that seems computationally-intensive for a set of MIPS instructions... and I need to do this as quick as possible. Also, the number I'm working in is represented in Grey Code... just to throw that in there. So is there some pseudo-instruction in MIPS to determine the parity of a "number" or do I have to do it by hand? If there is no MIPS instruction, which it seems very unlikely to be, any advice on how to do it by hand? Thanks, Hristo follow-up: I found a optimization, but my implementation isn't working. unsigned int v; // 32-bit word v ^= v >> 1; v ^= v >> 2; v = (v & 0x11111111U) * 0x11111111U; return (v >> 28) & 1;

    Read the article

  • Excel Range Format: Number is automatically formatted when Range::Value2 is set

    - by A9S6
    I have an Excel addin written in C# that imports a text file into Excel worksheet. Some of the fields in the file are text and some oare numbers. Problem Steps: Change the System's Regional Settings to Dutch (Belgium) Open Excel and import the file into Excel. Records contain values such as 78,1118 which gets converted to 781.118. Note that in Dutch(Belgium), COMMA is the decimal character and DOT is the thousand character. I do not require the number to be formatted automatically but just want to display whatver I get from the file (78,1118). If I set the cell's NumberFormat to "@" i.e. Text, then it displays an error (SmartTag) saying "Number stored as Text". I know I can change the settings by going to the "Options" box but I dont want to change any user options in Excel for this. I have tried setting the cell's Value2 with an "'" (apostrophe) but the same error is displayed. If I set the cell's format to something else after the value is set then the actual value changes and I loose the decimal. Is there a way in Excel to just display the value and NOT display the "Number Stored as Text" error in cell?

    Read the article

  • Source of parsers for programming languages?

    - by Arkaaito
    I'm dusting off an old project of mine which calculates a number of simple metrics about large software projects. One of the metrics is the length of files/classes/methods. Currently my code "guesses" where class/method boundaries are based on a very crude algorithm (traverse the file, maintaining a "current depth" and adjusting it whenever you encounter unquoted brackets; when you return to the level a class or method began on, consider it exited). However, there are many problems with this procedure, and a "simple" way of detecting when your depth has changed is not always effective. To make this give accurate results, I need to use the canonical way (in each language) of detecting function definitions, class definitions and depth changes. This amounts to writing a simple parser to generate parse trees containing at least these elements for every language I want my project to be applicable to. Obviously parsers have been written for all these languages before, so it seems like I shouldn't have to duplicate that effort (even though writing parsers is fun). Is there some open-source project which collects ready-to-use parser libraries for a bunch of source languages? Or should I just be using ANTLR to make my own from scratch? (Note: I'd be delighted to port the project to another language to make use of a great existing resource, so if you know of one, it doesn't matter what language it's written in.)

    Read the article

  • Converting an input text value to a decimal number

    - by vitto
    Hi, I'm trying to work with decimal data in my PHP and MySql practice and I'm not sure about how can I do for an acceptable level af accuracy. I've wrote a simple function which recives my input text value and converts it to a decimal number ready to be stored in the database. <?php function unit ($value, $decimal_point = 2) { return number_format (str_replace (",", ".", strip_tags (trim ($value))), $decimal_point); } ?> I've resolved something like AbdlBsF5%?nl with some jQuery code for replace and some regex to keep only numbers, dots and commas. In some country, people uses the comma , to send decimal numbers, so a number like 72.08 is wrote like 72,08. I'd like avoid to forcing people to change their usual chars and I've decided to use a jQuery to keep this too. Now every web developer knows the last validation must be handled by the dynamic page for security reasons. So my answer is should I use something like unit (); function to store data or shoul I also check if users inserts invalid chars like letters or something else? If I try this and send letters, the query works without save the invalid data, I think this isn't bad, but I could easily be wrong because I'm a rookie. What kind of method should I use if I want a number like 99999.99 for my query?

    Read the article

  • Getting percentage of "Count(*)" to the number of all items in "GROUP BY"

    - by celalo
    Let's say I need to have the ratio of "number of items available from certain category" to "the the number of all items". Please consider a MySQL table like this: /* mysql> select * from Item; +----+------------+----------+ | ID | Department | Category | +----+------------+----------+ | 1 | Popular | Rock | | 2 | Classical | Opera | | 3 | Popular | Jazz | | 4 | Classical | Dance | | 5 | Classical | General | | 6 | Classical | Vocal | | 7 | Popular | Blues | | 8 | Popular | Jazz | | 9 | Popular | Country | | 10 | Popular | New Age | | 11 | Popular | New Age | | 12 | Classical | General | | 13 | Classical | Dance | | 14 | Classical | Opera | | 15 | Popular | Blues | | 16 | Popular | Blues | +----+------------+----------+ 16 rows in set (0.03 sec) mysql> SELECT Category, COUNT(*) AS Total -> FROM Item -> WHERE Department='Popular' -> GROUP BY Category; +----------+-------+ | Category | Total | +----------+-------+ | Blues | 3 | | Country | 1 | | Jazz | 2 | | New Age | 2 | | Rock | 1 | +----------+-------+ 5 rows in set (0.02 sec) */ What I need is basically a result set resembles this one: /* +----------+-------+-----------------------------+ | Category | Total | percentage to the all items | (Note that number of all available items is "9") +----------+-------+-----------------------------+ | Blues | 3 | 33 | (3/9)*100 | Country | 1 | 11 | (1/9)*100 | Jazz | 2 | 22 | (2/9)*100 | New Age | 2 | 22 | (2/9)*100 | Rock | 1 | 11 | (1/9)*100 +----------+-------+-----------------------------+ 5 rows in set (0.02 sec) */ How can I achieve such a result set in a single query? Thanks in advance.

    Read the article

  • .NET application per-machine/per-user licensing

    - by MainMa
    I am about to implement a very basic licensing feature for my application. A serial number may be granted per-machine (or per-operating-system) or per-user (as for CAL in Windows Server: if my application is used by several users on one machine or if it is used by one user on several machines). For per-operating-system licensing, I use SerialNumber of Win32_OperatingSystem. For per-user licensing, I use: WindowsIdentity currentIdentity = WindowsIdentity.GetCurrent(); if (currentIdentity != null) { SecurityIdentifier userSid = currentIdentity.User.AccountDomainSid; Console.WriteLine(userSid); } A hash of an obtained OS serial number or SID is then stored in the database, associated with application serial; each time the program starts, it queries the server, sending hash of OS SN/SID and application serial. Is it a right thing to do it or is it completely wrong? Will it work on every Windows machine? (For example, using motherboard serial is wrong)

    Read the article

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