Search Results

Search found 1022 results on 41 pages for 'pseudo'.

Page 14/41 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • How do I conditionally select a field from one of two tables?

    - by freakwincy
    I have two tables invoices and pending_payments both of which have the following rows in common: invoice_id and balance. I want to do a select in MySQL that'll work thus: [pseudo-code] if(invoice_id exists in pending_payments table) { select balance from pending_payments where invoice_id = yadayadayada } else { select balance from invoices where invoice_id = yadayadayada } Is this even doable in MySQL? If so, how?

    Read the article

  • How do I write a bash script to restart a process if it dies?

    - by Tom
    I have a python script that'll be checking a queue and performing an action on each item: # checkqueue.py while True: check_queue() do_something() How do I write a bash script that will check if it's running, and if not, start it. Roughly the following pseudo code (or maybe it should do something like ps | grep?): # keepalivescript.sh if processidfile exists: if processid is running: exit, all ok run checkqueue.py write processid to processidfile I'll call that from a crontab: # crontab */5 * * * * /path/to/keepalivescript.sh Thanks in advance.

    Read the article

  • Timer to find elapsed time in a function call in C

    - by Mohit Nanda
    I want to calculate time elapsed during a function call in C, to the precision of 1 nanosecond. Is there a timer function available in C to do it? If yes please provide a sample code-snippet. Pseudo code Timer.Start() foo(); Timer.Stop() Display time elapsed in execution of foo() Environment details: - using gcc 3.4 compiler on a RHEL machine

    Read the article

  • Javascript match part of url, if statement based on result.

    - by nick
    Here is an example of the url i'm trying to match: http://store.mywebsite.com/folder-1/folder-2/item3423434.aspx What im trying to match is http: //store.mywebsite.com/folder-1 except that "folder-1" will always be a different value. I can't figure out how to write an if statement for this: Example (pseudo-code) if(url contains http://store.mywebsite.com/folder-1) do this else if (url contains http://store.mywebsite.com/folder-2) do something else etc

    Read the article

  • JavaScript: How do I create an Array into another Array?

    - by Timnkd
    I have the following JavaScript Array: var jsonArray = { 'homes' : [ { "home_id":"203", "price":"925", "sqft":"1100", "num_of_beds":"2", "num_of_baths":"2.0", }, { "home_id":"59", "price":"1425", "sqft":"1900", "num_of_beds":"4", "num_of_baths":"2.5", }, // ... (more homes) ... ]} I want to convert this in an Array like such (pseudo code): var newArray = new Array(); newArray.push(home_id's); How can I do that? Notice how the newArray only has home_ids from the big jsonArray array.

    Read the article

  • selenium scripts

    - by user121196
    I want to use selenium scripts to click on a bunch of links on my webpage one by one, each click results in a page refresh. However selenium doesn't support css pseudo class like :visited, so I can't distinguish the ones that are already clicked from the ones that I want to click on next. Is there a way to solve my problem?

    Read the article

  • php+jquery+captcha, is this is the correct way?

    - by user354051
    I am using combination of php+jQuery for captcha validation and later sending mails and do other stuff. The pseudo code is something like this: captcha_code = jQuery.post(.....execute captcha script and get status) if(captcha_code == "correct"){ send_mail_using_php_script; } Now I have no idea whether spammers can directly execute the "send_mail_using_php_script". Do they? If yes, then shall I move captcha validation in send_mail_using_php_script to make it more safer? Is there any other safer method? Prashant

    Read the article

  • How effecient is a details table?

    - by Jeffrey Lott
    At my job, we have pseudo-standard of creating one table to hold the "standard" information for an entity, and a second table, named like 'TableNameDetails', which holds optional data elements. On average, for every row in the main table will have about 8-10 detail rows in it. My question is: What kind of performance impacts does this have over adding these details as additional nullable columns on the main table?

    Read the article

  • PHP: Collect all variables passed to a function as array?

    - by Industrial
    Hi everybody, I was thinking about the possibility of accessing all the variables that are passed into an function, and merge them into an array. (Without passing variables into an array from the beginning) Pseudo-code: // Call function newFunction('one', 'two', 'three' ) ;// All values are interpreted as a one rray in some way // Function layout newFunction( ) { // $functionvariables = array( All passed variables) foreach ($functionvariable as $k => $v) { // Do stuff } }

    Read the article

  • Start a list from a certain number

    - by Colin
    What's the best way to get a ul to start from 'x'? The start tag is depricated and everything I have found on Google has used the :before pseudo class which doesn't work in IE6 or 7. Didn't have much luck when searching stack either. Only thing I can think of is manually go through and number the lists myself and style accordingly? Any help appreciated.

    Read the article

  • Handling a colon in an element ID in a CSS selector

    - by sblundy
    JSF is setting the ID of an input field to search_form:expression. I need to specify some styling on that element, but that colon looks like the beginning of a pseudo-element to the browser so it gets marked invalid and ignored. Is there anyway to escape the colon or something? input#search_form:expression { ///... }

    Read the article

  • Autopruning after a specified amount of row are created?

    - by Rob
    Basic question, sorry. Basically, I have a script that creates a MySQL entry each time someone visits the page. A logging script. However, I want to make it autoprune after, say, 100 visits. For example in pseudo code: if amount of rows > 100 { delete rows 1+ until amount of rows == 100 } So in a nutshell, each time a new row is added after 100, it needs to automatically remove the row with the smallest id (My primary key).

    Read the article

  • Regex vs. string:find() for simple word boundary

    - by user576267
    Say I only need to find out whether a line read from a file contains a word from a finite set of words. One way of doing this is to use a regex like this: .*\y(good|better|best)\y.* Another way of accomplishing this is using a pseudo code like this: if ( (readLine.find("good") != string::npos) || (readLine.find("better") != string::npos) || (readLine.find("best") != string::npos) ) { // line contains a word from a finite set of words. } Which way will have better performance? (i.e. speed and CPU utilization)

    Read the article

  • How can I iterate through all of the Models in my rails app?

    - by James
    I would like to be able to iterate over and inspect all the models in my rails app. In pseudo-code it would look something like: rails_env.models.each do |model| associations = model.reflect_on_all_associations(:has_many) ... do some stuff end My question is how do I inspect my rails app to get a collection of the models (rails_env.models) ?

    Read the article

  • Use reflection to get the value of a property by name in a class instance

    - by TheMoot
    Lets say I have class Person { public Person(int age, string name) { Age = age; Name = name; } public int Age{get;set} public string Name{get;set} } and I would like to create a method that accepts a string that contains either "age" or "name" and returns an object with the value of that property. Like the following pseudo code: public object GetVal(string propName) { return <propName>.value; } How can I do this using reflection? I am coding using asp.net 3.5, c# 3.5

    Read the article

  • PHP: Prevent a function from returning value?

    - by Industrial
    Hi everybody, How could I make sure that the startProcess(); function is being called, but without halting the execution for myFunction(). I'll guess that there's a way to call a function and prevent it from returning it's value to thereby accomplishing this? Pseudo-code: function myFunction() { startProcess(); return $something; } function startProcess() { sleep(5); // Do stuff that user doesn't should have to wait for. }

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >