Search Results

Search found 20799 results on 832 pages for 'long integer'.

Page 45/832 | < Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >

  • Swing Timer in Conjunction with Possible Long-running Background Task

    - by javacavaj
    I need to perform a task repeatedly that affects both GUI-related and non GUI-related objects. One caveat is that no action should performed if the previous task had not completed when the next timer event is fired. My initial thoughts are to use a SwingTimer in conjunction with a javax.swing.SwingWorker object. The general setup would look like this. class { timer = new Timer(speed, this); timer.start(); public void actionPerformed(ActionEvent e) { SwingWorker worker = new SwingWorker() { @Override public ImageIcon[] doInBackground() { // potential long running task } @Override public void done() { // update GUI on event dispatch thread when complete } } } Some potential issues I see with this approach are: 1) Multiple SwingWorkers will be active if a worker has not completed before the next ActionEvent is fired by the timer. 2) A SwingWorker is only designed to be executed once, so holding a reference to the worker and reusing (is not?) a viable option. Is there a better way to achieve this?

    Read the article

  • retrieve columns from sqlite3

    - by John Smith
    I have two tables in sqlite: CREATE TABLE fruit ('fid' integer, 'name' text); CREATE TABLE basket ('fid1' integer, 'fid2' integer, 'c1' integer, 'c2' integer); basket is supposed to have count c1 of fruit fid1 and c2 of fruit fid2 I created a view fruitbasket; create view fruitbasket as select * from basket inner join fruit a on a.fid=basket.fid1 inner join fruit b on b.fid=basket.fid2; it works (almost) as expected. When I type pragma table_info(fruitbasket); I get the following output 0|fid1|integer|0||0 1|fid2|integer|0||0 2|c1|integer|0||0 3|c2|integer|0||0 4|fid|integer|0||0 5|name|text|0||0 6|fid:1|integer|0||0 7|name:1|text|0||0 The problem is that I cannot seem to SELECT name:1. How can I do it other than going back and re-aliasing the columns?

    Read the article

  • flash.media.Sound.play takes long time to return

    - by Fire Lancer
    I'm trying to play some sounds in my flash project through action script. However for some reason in my code the call to Sound.play takes from 40ms to over 100ms in extreme cases, which is obviously more than enough to be very noticeable whenever a sound is played. This happens every time a sound is played, not just when that sound is first played, so I dont think its because the Sound object is still loading data or anything like that... At the start I have this to load the sound: class MyClass { [Embed(source='data/test_snd.mp3')] private var TestSound:Class; private var testSound:Sound;//flash.media.Sound public function MyClass() { testSound = new TestSound(); } Then im just using the play method of the sound object to play it later on. testSound.play();//seems to take a long time to return This as far as I can tell is following the same process as other Flash programs I found, however none of them seem to have this problem. Is there something that I've missed that would cause the play() method to be so slow?

    Read the article

  • ASP.NET Long Process and Sending updates to Browser

    - by user204588
    Hello, I've asked this before but I was hoping for another answer and perhaps some code samples because I've been having a difficult time with this. I have an asp.net page. The user hits the "Run" button and I have code IN AN ASSEMBLY, not in the APP_CODE folder that is called and runs a long process that moves product info from a file into the database. While the user waits, I would like them to see status updates like what product the import process in on and status info. I'm assuming I'd break off into another thread and use Ajax but I have no idea how to do this. Some code samples would be very helpful, thanks.

    Read the article

  • executing php cURL script for long time without changing php.ini settings

    - by Pragati Sureka
    Scenario I have a old blog on blogger that contains thousands of images and posts, i have already imported the posts from blogger to wordpress using their import service (which does not import images) now i want to write a php cURL script that will download all the images off my old blogger blog to wordpress. Problem I have already written a script that goes through all the posts and find the image links of blogger and download the links recursively and store them local to wordpress installation but the problem is that the script stops if its taking longer than max_execution_time which is generally set to 30 secs. Now i dont want to change setting in php.ini file. Is there some way that i can keep my script executing for that long or some other alternative.... like executing in batch or something else... Reason for not changing php.ini settings is that i want to release this script as opensource plugin for wordpress, and not many have access to their php.ini file on the server and and many don't like changing settings for just one script that might run just once. Thank You for helping....

    Read the article

  • Convert wide to long format in R

    - by Anthony
    My data has a long format similar to the one below: ID Language MotherTongue SpokenatHome HomeLang 1 English English English 1 French French 1 Polish Polish 2 Lebanese Lebanese Lebanese Labanese 2 Arabic Arabbic Here is the output I am looking for: ID Language1 Language2 Language 3 MotherTongue1 MotherTongue2 SpokenatHome1 HomeLan 1 English French Polish English Polish French English 2 Lebanese Arabic Labanese Arabic I'm using using the melt and dcast functions of the reshape2 package, but it does not work. Does anyone know how to do this? Thanks. df<-df[,c("OEN", "Langugae","MotherTongue", "SpokenatHome", "MainHomeLanguage")] dfl <- melt(df, id.vars=c("OEN", "Langugae"), measure.vars=c("MotherTongue", "SpokenatHome", "MainHomeLanguage"), variable.name="Language") dfw <- dcast(dfl, OEN ~ Langugae , value.var="value" )

    Read the article

  • Get countries within range of LAT/LONG coordinates

    - by ptrn
    Trouble! I'm looking for a way to find the countries within a given range of LAT/LONG coordinates. E.g.: When viewing a place in Africa in Google Maps, I get out which countries that are in my current view. This is a bit ambitious, and I think the main problem will be dealing with accuracy of the needed polygons. The accuracy of these don't need to be all that great, the borders can probably be tens of miles off, or even more. This will be needed for the entire world.

    Read the article

  • Can I wrap a long filename?

    - by user54197
    I have a table in a fieldset that is not displayed properly (overflow) because of a long file name that I cannot wrap. Is there a way to wrap the file name that is in the table? <table> <tr><td>stackoverflow.com/questions/4584756/how-can-i-make-the-datagridviewtextboxcolumn-wrap-to-a-new-line-if-its-text-is-t</td></tr> </table> I set the width and overflow style on the element and still no help. Any other ideas?

    Read the article

  • Hide long text except the first two paragraphs

    - by Barbara
    I have a very long text and I need to hide everything except the first two paragraphs. For various reasons I'd rather not use jquery for this site. Can this be done with css only? I know nth-child most likely will do the trick but I'm having troubles coming up with a specific rule. <div class="text"> <p>display<p> <p>display</p> <p>hide from this point</p> <p>...</p> </div>

    Read the article

  • Java: stopping long HTTP operations

    - by kilonet
    I'm using Apache Common library for HTTP operations: HttpClient client = getClient(); PutMethod put = new PutMethod(url); FileRequestEntity countingFileRequestEntity = new FileRequestEntity(file, "application/octet-stream"); put.setRequestEntity(countingFileRequestEntity); client.executeMethod(put); put.releaseConnection(); I wonder how can safely interrup long HTTP operation. Running it in new thread and stopping it seems to be wrong way. HttpMethodBase has abort() method, but I can't understand how to use it because client.executeMethod blocks execution until it complets

    Read the article

  • using time() to measure how long a function takes

    - by hap497
    Hi, I am trying to use time() to measure various points of my program. http://www.cplusplus.com/reference/clibrary/ctime/time/ What I don't understand is why the values in the before and after are Different? I understanding this is not the best way to profile my program, I just want to see how long does something take. printf ("**MyProgram::before time= %ld\n", time(NULL)); doSomthing(); doSomthingLong(); printf ("**MyProgram::after time= %ld\n", time(NULL)); Thank you.

    Read the article

  • preg_match and long strings

    - by aleluja
    Hi, This is the preg_match i am trying to use to find specific text in text file. if (preg_match($regexp,$textFile,$result) > 0) { echo "Found ".$result[0]; } else { echo "Not found"; } However, the result is always Found and nothing more. The result array is empty. Now i read that preg_match can't work with long strings. My text file is about 300KB so thats 300000 characters i guess. I am 100% sure that the searched string is in the text file, and the fact that preg_match function returns value above 0 means it found it, but it didn't place it into the result array somehow. So my question would be, how do i make it work? regexp would be /[specific text]\{(\d*)\}/ so, of course i want to be able to get the number in the parentheses.

    Read the article

  • Fixing too long comment lines in Vim

    - by Tomek Kaftal
    I'm looking for a convenient way to fix comments where line lengths exceed a certain number of characters in Vim. I'm fine with doing this manually with code, especially since it's not that frequent, plus refactoring long lines is often language, or even code-style dependent, but with comments this is pure drudgery. What happens is I often spot some issue in a comment, tweak one or two words and the line spills out of the, say, 80 character limit. I move the last word to the next line and then the next line spills, and so on. Does anyone know a way to do this automatically in Vim?

    Read the article

  • Unknown error when trying to get long lived access token

    - by Marius.Radvan
    I am trying to get a long lived access token for one of my pages, using this code: $page_info = $facebook->api("/page-id?fields=access_token"); $access_token = array( "client_id" => $facebook->getAppId(), "client_secret" => $facebook->getAppSecret(), "grant_type" => "fb_exchange_token", "fb_exchange_token" => $page_info["access_token"] ); $result = $facebook->api("/oauth/access_token", $access_token); echo json_encode($result); ... but I get this response: {"error_code":1,"error_msg":"An unknown error occurred"} I get the same response if I browse to https://graph.facebook.com/oauth/access_token? client_id=APP_ID& client_secret=APP_SECRET& grant_type=fb_exchange_token& fb_exchange_token=EXISTING_ACCESS_TOKEN as stated in https://developers.facebook.com/roadmap/offline-access-removal/#page_access_token

    Read the article

  • Obj-c Turning long string into multidimensional array

    - by Phil
    I have a long NSString, something like "t00010000t00020000t00030000" and so on. I need to split that up into each "t0001000". I'm using... NSArray *tileData = [[GameP objectForKey:@"map"] componentsSeparatedByString:@"t"]; And it splits it up, but the "t" is missing, which I need (although I think I could append it back on). The other way I guess would be to split it up by counting 8 char's, although not sure how to do that. But ideally I need it split into a [][] type array so I can get to each bit with something like... NSString tile = [[tileData objectAtIndex:i] objectAtIndex:j]]; I'm new to obj-c so thanks for any help.

    Read the article

  • VBA long overflow

    - by HK_CH
    Hi I am trying to do some maths with my VBA excel (prime factorization) and I am hitting the limit of the long data type (runtime error 6 Overflow). Is there any way to get around this and still stay within VBA? (I am aware that the obvious one would be to use another more appropriate programming language) Thanks for help in advance! Thank you, it works in so far that I am able to get the big numbers into the variables now. However when I try to apply the MOD function (bignumber MOD 2 for example) it still fails with error message runtime error 6 Overflow.

    Read the article

  • Creating a sub site in SharePoint takes a very long time

    - by denni
    Hi, I am working in a MOSS 2007 project and have customized many parts of it. There is a problem in the production server where it takes a very long time (more than 15 minutes, sometimes fails due to timeouts) to create a sub site (even with the built-in site templates). While in the development server, it only takes 1 to 2 minutes. Both servers are having same configuration with 8 cores CPU and 8 GIGs RAM. Both are using separate database servers with the same configuration. The content db size is around 100 GB. More than a hundred subsites are there. What could be the reason why in the other server it will take so much time? Is there any configuration or something else I need to take care? Thanks a lot, all helps are appreciated.

    Read the article

  • In Visual Studio 2010, intellisense isn't showing for long method signatures

    - by sohtimsso1970
    The problem is exactly as asked in the question title. When I'm typing in the text editor and referencing a public method that has a long signature (lots of parameters, usually 10 or more) the intellisense just stops working. It will sometimes flicker; other times it will not show at all. Only seen this happen with C#, but I don't use anything else. It might happen in VB too. Don't know. Anyone else seeing this? I've Googled for an hour but can't seem to iron it out. I've restarted VS, rebooted the machine, enabled/disabled intellisense in Tools - Options. NOTHING works.

    Read the article

  • how to construct a long string

    - by david
    I need to construct a long string with javascript. Thats how i tried to do it: var html = '<div style="balbalblaba">&nbsp;</div>'; for(i = 1; i <= 400; i++){ html=+html; }; When i execute that in firefox its taking ages or makes it crash. what is the best way to do that? What is generally the best way to construct big strings in JS. can someone help me?

    Read the article

  • Detecting and interacting with long running process

    - by jacquesb
    I want a script to start and interact with a long running process. The process is started first time the script is executed, after that the script can be executed repeatedly, but will detect that the process is already running. The script should be able to interact with the process. I would like this to work on Unix and Windows. I am unsure how I do this. Specifically how do I detect if the process is already running and open a pipe to it? Should I use sockets (e.g. registering the server process on a known port and then check if it responds) or should I use "named pipes"? Or is there some easier way?

    Read the article

  • Why does setting document.domain require me to set it in all popups and iframes too?

    - by Chris
    I'm using a long-polling iframe solution for a chat script. Unfortunately, this requires me to set document.domain='yourdomain.com' in the iframe and main document, because the iframe is a subdomain call. The huge problem is...now all my other scripts that use popups and iframes are broken. They now require me to put document.domain in them too. It does fix it, but this is not an ideal solution at all. Is there another way around this problem?

    Read the article

  • Providing updates during a long Rails controller action

    - by highBandWidth
    I have an action that takes a long time. I want to be able to provide updates during the process so the user is not confused as to whether he lost the connection or something. Can I do something like this: class HeavyLiftingController < ApplicationController def data_mine render_update :js=>"alert('Just starting!')" # do some complicated find etc. render_update :js=>"alert('Found the records!')" # do some processing ... render_update :js=>"alert('Done processig')" # send @results to view end end

    Read the article

  • inner workings of PHP (really long PHP script)

    - by econclicks
    I have a really long php script for just 1 page i.e. something like: mywebsite.com/page.php?id=99999 I have about 10000-20000 cases of the id, each with a different settings. Will this slow down my website significantly? i.e. my question is really along the lines of, what happens when php is executed. does the server execute it and display the results, or does the client's computer download it, execute it and display the results. if its the latter, does it mean a really slow load time? each of the 10000-20000 cases has about 20-25 lines of code after it. thanks, xoxo

    Read the article

  • fPDF: how to strikeout/strikethrough justified text in multicell?

    - by SWilk
    Hi, I am generating a PDF with fPDF. I need to strikethrough a long text inside a MultiCell. The text is justified to left and right, which probably is the source of the problem. Here is my code: //get the starting x and y of the cell to strikeout $strikeout_y_start = $pdf->GetY(); $strikeout_x = $pdf->getX(); $strikeText = "Some text with no New Lines (\n), which is wrapped automaticly, cause it is very very very very very very very very very very long long long long long long long long long long long long long long long long long long" //draw the text $pdf->MultiCell(180, 4, $strikeText); //get the y end of cell $strikeout_y_end = $pdf->GetY(); $strikeout_y = $strikeout_y_start+2; $strikeCount = 0; for ($strikeout_y; $strikeout_y < $strikeout_y_end - 4; $strikeout_y+=4) { $strikeCount++; //strike out the full width of all lines but last one - works OK $pdf->Line($strikeout_x, $strikeout_y, $strikeout_x + 180, $strikeout_y); } //this works, but gives incorrect results $width = $pdf->GetStringWidth($strikeText); $width = $width - $strikeCount*180; //the line below will strike out some text, but not all the letters of last line $pdf->line($strikeout_x, $strikeout_y, $strikeout_x+$width, $strikeout_y); The problem is that as the text in multicell is justified (and have to be), the spacec in previous lines are wider than the GetStringWidth assumes, so GetStringWidth underestimates the full width of this text. As a result, the last line is stroked out in, say, 70%, and some letters on the end of it are not stroked out. Any ideas how to calculate the width of last line in multicell?

    Read the article

  • Large number of simultaneous long-running operations in Qt

    - by Hostile Fork
    I have some long-running operations that number in the hundreds. At the moment they are each on their own thread. My main goal in using threads is not to speed these operations up. The more important thing in this case is that they appear to run simultaneously. I'm aware of cooperative multitasking and fibers. However, I'm trying to avoid anything that would require touching the code in the operations, e.g. peppering them with things like yieldToScheduler(). I also don't want to prescribe that these routines be stylized to be coded to emit queues of bite-sized task items...I want to treat them as black boxes. For the moment I can live with these downsides: Maximum # of threads tend to be O(1000) Cost per thread is O(1MB) To address the bad cache performance due to context-switches, I did have the idea of a timer which would juggle the priorities such that only idealThreadCount() threads were ever at Normal priority, with all the rest set to Idle. This would let me widen the timeslices, which would mean fewer context switches and still be okay for my purposes. Question #1: Is that a good idea at all? One certain downside is it won't work on Linux (docs say no QThread::setPriority() there). Question #2: Any other ideas or approaches? Is QtConcurrent thinking about this scenario? (Some related reading: how-many-threads-does-it-take-to-make-them-a-bad-choice, many-threads-or-as-few-threads-as-possible, maximum-number-of-threads-per-process-in-linux)

    Read the article

< Previous Page | 41 42 43 44 45 46 47 48 49 50 51 52  | Next Page >