Search Results

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

Page 34/1194 | < Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >

  • Length of Page Title, URL, Meta Description and total number of links on a page

    - by MJWadmin
    We've been examining a number of different SEO tools recently. Several of these tell us that some of our page title's, urls and meta descriptions are too long. We've also been told that some of our pages have too many links on them. I guess our first question is - is any of that feedback true! Can URL's etc actually be too long and if so how much does this affect ranking? Secondly can you have too many links on a page and if so, how many is too many? Thanks in advance...

    Read the article

  • Optimum Number of Parallel Processes

    - by System Down
    I just finished coding a (basic) ray tracer in C# for fun and for the learning experience. Now I want to further that learning experience. It seems to me that ray tracing is a prime candidate for parallel processing, which is something I have very little experience in. My question is this: how do I know the optimum number of concurrent processes to run? My first instinct tells me: it depends on how many cores my processor has, but like I said I'm new to this and I may be neglecting something.

    Read the article

  • Output the total number of String Characters [migrated]

    - by Programmerwannabe
    My Question is what method should I use if I wanted to get the total number of characters a user inputs? without using arrays, i tried using .length() but it did not return all characters say from the first and lastname, it only returned the first name. Here's an example of my code. (Please dont laugh im really new in programming :) ) System.out.print("Enter your first and last name: "); String yourName = keyboard.next(); System.out.println("Your name has a total of " + yourName.length() + " numbers"); what happened was if i enter say "Neo Matrix" it would only return 3. I appreciate any help. thank you!

    Read the article

  • Random select rows via JPA

    - by Ke
    In Mysql, SELECT id FROM table ORDER BY RANDOM() LIMIT 5 this sql can select 5 random rows. How to do this via JPA Query (Hibernate as provider, Mysql database)? Thanks.

    Read the article

  • pythonic way of selecing a random value that satisfies a certain predicate

    - by MK
    Suppose I have a list of elements and I want to randomly select an element from the list that satisfies a predicate. What is the pythonic way of doing this? I currently do a comprehension followed by a random.choice() but that is unnecessarily inefficient : intlist = [1,2,3,4,5,6,7,8,9] evenlist = [ i for i in intlist if i % 2 == 0 ] randomeven = random.choice(evenlist) Thanks!

    Read the article

  • iPhone SDK: How to generate a random time of day

    - by bigdave
    Hello all, I am having some problems trying to figure out the best way of generating a random time of day. For instance, if I want to choose a random time between the hours of 9am and 5pm, what would be the best way with the least amount of overhead on the device? I guess I need someone to point me in the right direction. Thanks!

    Read the article

  • Pick random property from a Javascript object

    - by Bemmu
    Suppose you have a Javascript object like {'cat':'meow','dog':'woof' ...} Is there a more concise way to pick a random property from the object than this long winded way I came up with: function pickRandomProperty(obj) { var prop, len = 0, randomPos, pos = 0; for (prop in obj) { if (obj.hasOwnProperty(prop)) { len += 1; } } randomPos = Math.floor(Math.random() * len); for (prop in obj) { if (obj.hasOwnProperty(prop)) { if (pos === randomPos) { return prop; } pos += 1; } } }

    Read the article

  • Selecting and Copying a Random File Several Times

    - by user1252778
    [Edit: see below for final code] I have the following code and I'm trying to figure out where to insert the random.choice code to make it select a single file, copy it, and repeat (here 6 times). import os import shutil import random dir_input = str(input("Enter Source Directory: ")) src_files = (os.listdir(dir_input)) for x in range (0,5): print ('This is the %d time' % x) for file_name in src_files: full_file_name = (os.path.join(dir_input, file_name)) if (os.path.isfile(full_file_name)): print ('copying...' + full_file_name) shutil.copy(full_file_name, r'C:\Dir')) else: print ('Finished!')

    Read the article

  • Using Selenium IDE with random values

    - by Toby Hede
    Is it possible to create Selenium tests using the Firefox plugin that use randomly generated values to help do regression tests? The full story: I would like to help my clients do acceptance testing by providing them with a suite of tests that use some smarts to create random (or at least pseudo-random) values for the database. One of the issues with my Selenium IDE tests at the moment is that they have predefined values - which makes some types of testing problematic.

    Read the article

  • What is the relationship between a R.V N(0,1) and others continuous random variables

    - by calejero
    Hello. I have a question. I need to kwon what is the relationship between a Random Variable with Normal distribuation (N(0,1)) and others continuous random variables. Can you write to me an example? Thank You Hola a todos. Necesito saber qué relación existe entre una variable aleatoria Normal (0,1) y cualquier variable aleatoria continua. Además, me vendría bien un ejemplo. Gracias por vuestra ayuda

    Read the article

  • random number in VC++

    - by BillDickson
    int randomNumber = (double)rand() / (RAND_MAX + 1) * (10 - 0) + 0; is the code I'm using, it is getting a random number, but is getting the SAME random combination every time? Can anyone see what I'm doing wrong?

    Read the article

  • scale random 3d model to fit in a viewport

    - by John Qualis
    How can I scale a random 3d model to fit in an opengl viewport? I am able to center the model in the middle of the view port. How do I scale it to fit it in the viewport. The model could be an airplane, a cone, an 3d object or any other random model. Appreciate any help.

    Read the article

  • Directories with random numbers as foldername being created that contain .ser files

    - by Dur4ndal
    Hi all: So in our server there are folders being generated with random names (such as "7nxxd", "tpy16q"). Inside each of these is the same subdirectory structure: <randomfilename>/.tld_cache/WEB-INF/tld/ c.tld/ fn.tld/ spring-form.tld/ fmt.tld/ spring.tld/ tiles-jsp.tld/ Each of these directories has 2 files: crc.ser and des.ser. Why are these files being created? Is there a way to specify the directory that they get written to besides the random name?

    Read the article

  • Code to generate random numbers in C++

    - by user1678927
    Basically I have to write a program to generate random numbers to simulate the rolling of a pair of dice. This program should be constructed in multiple files. The main function should be in one file, the other functions should be in a second source file, and their prototypes should be in a header file. First I write a short function that returns a random value between 1 and 6 to simulate the rolling of a single 6-sided die.Second, i write a function that pretends to roll a pair of dice by calling this function twice. My program starts by asking the user how many rolls should be made. Then I write a function to simulate rolling the dice this many times, keeping a count of exactly how many times the values 2,3,4,5,6,7,8,9,10,11,12(each number is the sum of a pair of dice) occur in an array. Later I write a function to display a small bar chart using these counts that ideally would look something like below for a sample of 144 rolls, where the number of asterisks printed corresponds to the count: 2 3 4 5 6 7 8 9 10 11 12 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Next, to see how well the random number generator is doing, I write a function to compute the average value rolled. Compare this to the ideal average of 7. Also, print out a small table showing the counts of each roll made by the program, the ideal count based on the frequencies above given the total number of rolls, and the difference between these values in separate columns. This is my incomplete code so far: "Compiler visual studio 2010" int rolling(){ //Function that returns a random value between 1 and 6 rand(unsigned(time(NULL))); int dice = 1 + (rand() %6); return dice; } int roll_dice(int num1,int num2){ //it calls 'rolling function' twice int result1,result2; num1 = rolling(); num2 = rolling(); result1 = num1; result2 = num2; return result1,result2; } int main(void){ int times,i,sum,n1,n2; int c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11;//counters for each sum printf("Please enter how many times you want to roll the dice.\n") scanf_s("%i",&times); I pretend to use counters to count each sum and store the number(the count) in an array. I know i need a loop (for) and some conditional statements (if) but m main problem is to get the values from roll_dice and store them in n1 and n2 so then i can sum them up and store the sum in 'sum'.

    Read the article

  • Random Int in VB.Net

    - by brendan
    I need to generate random integer between 1-n (where n is a positive whole number) to use for a unit test. I don't need something overly complicated to ensure true randomnesses - just an old fashioned random number. How would I do that?

    Read the article

  • how to record mic input and pipe the output to another program

    - by acrs
    Hi everyone Im trying to follow a tutorial on generating truly random bits How To Generate Truly Random Bits This is the command from the tutorial but it does not work rec -c 1 -d /dev/dsp -r 8000 -t wav -s w - | ./noise-filter >bits I know i can record my mic input using rec -c 1 no.wav this is the command i tried using rec -c 1 -r 8000 -t wav -s noise.wav | ./noise-filter >bits but i get root@xxc:~/cc# rec -c 1 -r 8000 -t wav -s noise.wav - | ./noise-filter >bits rec WARN formats: can't set sample rate 8000; using 48000 rec FAIL sox: Input files must have the same sample-rate I have complied noise-filter noise-filter I think the tutorial is using an older version of SOX and REC I'm using sox: SoX v14.3.2 on Ubuntu 12.04 server Can someone please help me ?

    Read the article

  • Unreliable resume from suspend?

    - by dsimcha
    My desktop PC (home-built) resumes from suspend somewhat unreliably. I'd say that it resumes successfully about 85-90% of the time and hangs with a blank screen 5-10% of the time. As far as I can tell, the success or failure of the resume is completely random. I doubt it's a software problem because I triple boot Windows 7, Windows XP and Ubuntu and it's similar under all 3 operating systems. If it matters, my system is overclocked, though other than the resume-from-suspend issue, it's definitely rock stable. What are some of the obvious suspects that would cause random, sporadic failures to resume from suspend?

    Read the article

  • Adding interactions to admin pages generated by the admin generator

    - by Stick it to THE MAN
    I am using Symfony 1.2.9 (with Propel ORM) to create a website. I have started using the admin generator to implement the admin functionality. I have come accross a slight 'problem' however. My models are related (e.g. one table may have several 1:N relations and N:N relations). I have not found a way to address this satisfactorily yet. As a tactical solution (for list views), I have decided to simply show the parent object, and then add interactions to show the related objects. I'll use a Blog model to illustrate this. Here are the relationships for a blog model: N:M relationship with Blogroll (models a blog roll) 1:N relationship with Blogpost (models a post submitted to a blog) I had originally intended on displaying the (paged) blogpost list for a blog,, when it was selected, using AJAX, but I am struggling enough with the admin generator as it is, so I have shelved that idea - unless someone is kind enough to shed some light on how to do this. Instead, what I am now doing (as a tactical/interim soln), is I have added interactions to the list view which allow a user to: View a list of the blog roll for the blog on that row View a list of the posts for the blog on that row Add a post for the blog on tha row In all of the above, I have written actions that will basically forward the request to the approriate action (admin generated). However, I need to pass some parameters (like the blog id etc), so that the correct blog roll or blog post list etc is returned. I am sure there is a better way of doing what I want to do, but in case there isn't here are my questions: How may I obtain the object that relates to a specific row (of the clicked link) in the list view (e.g. the blog object in this example) Once I have the object, I may choose to extract various fields: id etc. How can I pass these arguments to the admin generated action ? Regarding the second question, my guess is that this may be the way to do it (I may be wrong) public function executeMyAddedBlogRollInteractionLink(sfWebRequest $request) { // get the object *somehow* (I'm guessing this may work) $object = $this->getRoute()->getObject(); // retrieve the required parameters from the object, and build a query string $query_str=$object->getId(); //forward the request to the generated code (action to display blogroll list in this case) $this->forward('backendmodulename',"getblogrolllistaction?params=$query_string"); } This feels like a bit of a hack, but I'm not sure how else to go about it. I'm also not to keen on sending params (which may include user_id etc via a GET, even a POST is not that much safer, since it is fairly sraightforward to see what requests a browser is making). if there is a better way than what I suggest above to implement this kind of administration that is required for objects with 1 or more M:N relationships, I will be very glad to hear the "recommended" way of going about it. I remember reading about marking certain actions as internal. i.e. callable from only within the app. I wonder if that would be useful in this instance?

    Read the article

< Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >