Search Results

Search found 4 results on 1 pages for 'alleywayjack'.

Page 1/1 | 1 

  • Ruby w/ Postgres & Sinatra - Query won't order right with parameter??

    - by alleywayjack
    So I set a variable in my main ruby file that's handling all my post and get requests and then use ERB templates to actually show the pages. I pass the database handler itself into the erb templates, and then run a query in the template to get all (for this example) grants. In my main ruby file: grants_main_order = "id_num" get '/grants' do erb :grants, :locals => {:db=>db, :order=>grants_main_order, :message=>params[:message]} end In the erb template: db = locals[:db] getGrants = db.exec("SELECT * FROM grants ORDER BY $1", [locals[:order]]) This produces some very random ordering, however if I replace the $1 with id_num, it works as it should. Is this a typing issue? How can I fix this? Using string replacement with #{locals[:order]} also gives funky results.

    Read the article

  • How to see full compile path in Eclipse?

    - by alleywayjack
    I have looked for an answer for this nearly every where that I can think of, but there doesn't seem to be any way to actually SEE what Eclipse "runs" to compile the projects (as it does need the JDK installed and visible to actually build). I ask because I imported a few jars into my project, and even though I've looked through all the javac documentation, I can't seem to figure out how to mimic it quite like Eclipse does. I really, really need to be able to compile on the command line in this case - Eclipse or any other IDE just isn't what is needed. I started to look through the Eclipse source, and although this sounds lazy, I just became overwhelmed and figured I would ask here first, hoping someone else had the same question at one point.

    Read the article

  • Simple way to play a single frequency in java?

    - by alleywayjack
    I just want to play a very simple, straight forward note by giving my computer a certain frequency as an integer, and from there I can figure out how to make it play the note longer or shorter. It does not necessarily have to come out of the actual sound card - if it's generated and output by the internal speaker that's okay. I looked at the midi libraries that java has included, and they are way more than what I want to do. This just needs to be very basic.

    Read the article

  • How to queue and call actual methods (rather than immediately eval) in java?

    - by alleywayjack
    There are a list of tasks that are time sensitive (but "time" in this case is arbitrary to what another program tells me - it's more like "ticks" rather than time). However, I do NOT want said methods to evaluate immediately. I want one to execute after the other finished. I'm using a linked list for my queue, but I'm not really sure how/if I can access the actual methods in a class without evaluating them immediate. The code would look something like... LinkedList<Method> l = new LinkedList<Method>(); l.add( this.move(4) ); l.add( this.read() ); l.removeFirst().call(); //wait 80 ticks l.removeFirst().call(); move(4) would execute immediately, then 80 ticks later, I would remove it from the list and call this.read() which would then be executed. I'm assuming this has to do with the reflection classes, and I've poked around a bit, but I can't seem to get anything to work, or do what I want. If only I could use pointers...

    Read the article

1