Posts

ruby - How can I have console output display to stdout AND store it in a variable? -

अगर मैं ऐसा करता हूं: आउटपुट =% x {some_script} ... तो मेरे पास stdout में मुद्रित सामान आउटपुट में संग्रहीत है; लेकिन मैं नहीं इसे स्क्रीन पर दिखाई देता है। दूसरी ओर, अगर मैं ऐसा करता हूं: success = system " Some_script " ... तो मुझे स्क्रीन पर दिखाई देने वाला आउटपुट दिखाई देता है, लेकिन मेरे पास यह एक चर में ( सफलता ) एक बूलियन धारण नहीं है मान)। क्या दोनों को पाने का कोई तरीका है? मुझे पता है कि मैं यह कर सकता हूं: आउटपुट =% x {some_script} आउटपुट डालता है लेकिन समस्या यह है कि some_script एक बहुत लंबे समय से चलने वाली स्क्रिप्ट हो सकती है, जिस स्थिति में मैं कुछ भी नहीं जब तक कि पूरी चीज समाप्त नहीं हो जाती। मैं आउटपुट को देखना पसंद करता हूं क्योंकि यह उत्पादन किया गया है, और जब यह पूरा हो चुका है तो यह सभी आउटपुट चर में संग्रहीत है। यह IO.popen के साथ एक समाधान है: की आवश्यकता होती है 'stringio 'आउटपुट = स्ट्रिंग आईओ.न्यूव IO.popen ("ls") करो | पाइप | पाइप.ईच करो | लाइन | Output.puts लाइन लाइन अंत अंत डालता...

Get running time of a thread java -

How can I get a thread to runtime in java like: 00:30 minute thread [n] Something has happened (). I am basically looking to create a log file for programs related to audio files. Thank you. You can initially get System.nanoTime () and then Finally, you can calculate the difference. Also check that one MBean is providing information about threads.

php - Possible to order an SQL query that matches with a REGEX by the number of matches found? -

I am using a SQL query such as WHERE name REGEXP '[[: & lt ;:] ] Some [[:: & gt ;:]] ' . Now all this works very well, but orders are not ordered based on the number of matches of my results, which is what I see. Thanks Full Query Select Item. `` `` `` `` `` `` `` `` `` ] '' Or (`item` .`name` regxp '[[:: & lt ;:]] world [[: & gt;:]]') The user is prepared on the basis of input, in each place it divides into a different part that is searched. I would like to order results based on the number of matches of all parts, thus the most relevant results are on top I got an UDF sometime back to do this. I'm really sorry I can not quote though the source. DELIMITER // CREATE DEFINER = `Route` @ 'localhost' function 'substrate number' (SVARAR (255), SS VAARAR (255)) Return tint (3) unsigned SQL data The redirection starts is calculated from the tinnitus (3), DECLARE offset TINYINT (3) Uncredited; DECLARE CONTI...

internet explorer - How do I refresh a table in GWT without giving it focus? -

I am using Google Web Toolkit (GWT) 2.1. I have a GWT grid (which is just an HTML table, in fact) that I am using for data entry. When you click on some elements outside the grid, it changes the content within the grid. I want to add / remove CSS styles to hide some rows in the grid based on the selected outside the grid. The style I am adding and removing is like this: . Thegrid .hiderow, .thegrid .hiderow div, .thegrid .hiderow td, .thegrid .hiderow *, .thegrid .hiderow input {do not display anything; Hidden flurry; Height: 0; } To do this I had to make IE6 properly hide the rows. Everything is fine, (surprise, surprise) except in IE6. In IE6, the rows are hidden properly, but when I want to re-display the rows after removing the style, the table maintains a lower size, whose rows were hidden. When I give it a table focus by clicking on it, it changes the size of the table and shows me all the rows. After the removal by me, is there a way to expand the table in the right...

node.js - Why does my multiplayer javascript game slow down when another client (new tab) connects? -

I am trying to use a simple multiplayer game canvas, socket.o and node.js. Everything is fine unless someone else connects (I open another tab and load the game there). When this happens, everything gets slowed down and finally closes (I can 'move around'). How it works: When one connects to a server, the server saves its socket in an array object and the customer. The customer sends an object containing the name and location of that item, and then the server is sent to the array of chairs and that the rest connects. When a customer receives the message, he removes the data, does something with it (as the drawing on the basis of the situation) and then sets one timeout at 10.2 so that the server answers with its status and name . As long as I open a new window / tab and reconnect it, it works fine and works. as I said. Why do I slow down when I start another client? Here is the code: server.js (this is just a piece of code, the rest is from socket.io example) io.so...

Does the youTube iFrame embed code work on mobile devices? (iPhone, Android) -

I've created a sample page from ITube using the HTML5 IFrame embed code. While browsing on my iPhone, I get a play button, but even if I click on it then the video never plays. When I embed the video with the HTML5 video tag, everything is fine. Does anyone know if YouTube officially supports mobile devices with embed code? Do I Need Extra Parameters? I tried the following code: & lt; Iframe width = "420" height = "345" src = "http://www.youtube.com/embed/OZOX5sad2FE" frameborder = "0" acceptable screen & gt; & Lt; / Iframe & gt; Mobile Safari supports IFrame on IFrame. Here's an example: Have you tried to include class and type? Class = "youtube-player" type = "text / html"

mysql - How can I pull multiple user info from one query? -

After I have an invoice table that contains the ID that the user has sent the invoice ( from_id ) and The user has received the invoice ( to_id ). I want to be able to pull both of my information from the profile table, but I am unable to figure out how. The query below, I think, is running because I'm moving information ( from_id ) for just one user joining. select jobs .title, profiles.display_name, invoice.to_id, invoice.from_id, join (invoice) jobs on invoice.amount jobs.job_id = invoice.job_id on invoice. From_id = profiles.user_id where `invoice_id` = join the profile '3' You can use the same table twice. Give them a different aliased, which makes me think that anyway makes a more readable question. Select j.title, tp.display_name, FROM_NAME, i.to_id, i.from_id as fp.display_name, i.amount join invoices from invoices. Join j.job_id = i.job_id on profile fp i.from_id = fp.user_id Join profile tp at i.to_id = tp.user_id Where i.invoice_id = '3...