Search Results

Search found 184 results on 8 pages for 'countdown'.

Page 4/8 | < Previous Page | 1 2 3 4 5 6 7 8  | Next Page >

  • How to stop scheduled chkdisk on windows 7?

    - by AndrejaKo
    Hi! I have a problem with windows 7 64-bit. I was trying out chkdsk command line options and scheduled a chddsk /r on next start. After that I disassembled the laptop on which I set the chkdsk. After I reassembled it, windows gets normally to the point where it should start the check and then hangs when the countdown reaches 1 second. During the countdown, it doesn't detect any input from keyboard. At first I thought that I didn't correctly install the keyboard, but under GNU/Linux, everything is working fine and I can normally mount the windows partition . So is there any way to stop the scheduled chkdsk? I really don't feel like reinstalling windows again because I just finished setting up my tool-chain the way I like it and compiled about 6GiB worth of dependencies I need for some project I'm working on.

    Read the article

  • Facebook FBML and frame redirect

    - by user356089
    I have, what is probably a simple flash question. I have a flash countdown clock I am using in an Iframe of a facebook app. At the end of the countdown it fires this off myFlipCountDownClock.onFinish = function() { }; And I can add getURL or whatever. My problem is I need to fire off some facebook specific code. This being This does not work via getURL. My question is how could I pass this line of code? I am not sure what to do here. Any help would be greatly appreciated.

    Read the article

  • Update frequency for dynamic favicons

    - by rosscowar
    I wanted to learn how to dynamically update the favicon using the Google Chrome browser and I've noticed that the browser seems to throttle how often you can update the favicon per second and that sort of makes things look sloppy. The test page I've made for this is: http://staticadmin.com/countdown.html Which is simply a scrolling message displaying the results of a countdown. I added an input field to tweak how many pixels per second are moved by the script and I've eyeballed the max to be about 5 frames per second smoothly in Google Chrome and I have not tested it in any other browsers. My question is what is the maximum frequency, are there any ways to change, is there a particular reason behind it? NOTE: I've also noticed that this value changes based on window focus as well. It seems to drop to about 1 update per second when the browser's window isn't in focus and returns to "max" when you return.

    Read the article

  • Pause and Resume AsyncTasks? (Android)

    - by Matt Swanson
    I have an AsyncTask that acts as a countdown timer for my game. When it completes the countdown it displays the out of time end screen and it also updates the timer displayed on the screen. Everything works fine, except I need to be able to pause and resume this when the pause button in the game is pressed. If I cancel it and try to re-execute it, it crashes with an IllegalStateException. If I cancel it and instantiate a new AsyncTask in its place the old one begins to run again and the new one runs at the same time. Is there a way to cancel/pause the timer and restart it using AsyncTasks or is there a different way I should be going about doing this?

    Read the article

  • How does the event dispatch thread work?

    - by Roman
    With the help of people on stackoverflow I was able to get the following working code of the simples GUI countdown (it just displays a window counting down seconds). My main problem with this code is the invokeLater stuff. As far as I understand the invokeLater send a task to the event dispatching thread (EDT) and then the EDT execute this task whenever it "can" (whatever it means). Is it right? To my understanding the code works like that: In the main method we use invokeLater to show the window (showGUI method). In other words, the code displaying the window will be executed in the EDT. In the main method we also start the counter and the counter (by construction) is executed in another thread (so it is not in the event dispatching thread). Right? The counter is executed in a separate thread and periodically it calls updateGUI. The updateGUI is supposed to update GUI. And GUI is working in the EDT. So, updateGUI should also be executed in the EDT. It is why the code for the updateGUI is inclosed in the invokeLater. Is it right? What is not clear to me is why we call the counter from the EDT. Anyway it is not executed in the EDT. It starts immediately a new thread and the counter is executed there. So, why we cannot call the counter in the main method after the invokeLater block? import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.SwingUtilities; public class CountdownNew { static JLabel label; // Method which defines the appearance of the window. public static void showGUI() { JFrame frame = new JFrame("Simple Countdown"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); label = new JLabel("Some Text"); frame.add(label); frame.pack(); frame.setVisible(true); } // Define a new thread in which the countdown is counting down. public static Thread counter = new Thread() { public void run() { for (int i=10; i>0; i=i-1) { updateGUI(i,label); try {Thread.sleep(1000);} catch(InterruptedException e) {}; } } }; // A method which updates GUI (sets a new value of JLabel). private static void updateGUI(final int i, final JLabel label) { SwingUtilities.invokeLater( new Runnable() { public void run() { label.setText("You have " + i + " seconds."); } } ); } public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { showGUI(); counter.start(); } }); } }

    Read the article

  • repeat text animation, as3

    - by pixelGreaser
    Hi, My text animation works perfectly, but doesn't repeat. How do I get this to repeat? Sorry I don't know Flash that well, but I just want this to play over and over. Thanks. var myArray:Array = ["Big", "Holiday", "Sale", "Buy", "Now", "And", "Save"]; Timer var tm:Timer = new Timer(500,0); tm.addEventListener(TimerEvent.TIMER, countdown); function countdown(event:TimerEvent) { if (myArray.length>0){ tx.text = myArray.shift(); } } tm.start(); I tried this if (++myArray.length % 10 == 0)

    Read the article

  • Silverlight Cream for April 01, 2010 -- #827

    - by Dave Campbell
    In this Issue: Max Paulousky, Hassan, Viktor Larsson, Fons Sonnemans, Jim McCurdy, Scott Marlowe, Mike Taulty, Brad Abrams, Jesse Liberty, Scott Barnes, Christopher Bennage, and John Papa and Ward Bell. Shoutouts: Tim Heuer posted a survey: What tools are the minimum to get started in Silverlight?... have you responded yet? Don't want to miss this discussion: Channel 9 Live at MIX10: Bill Buxton & Erik Meijer - Perspectives on Design Bookmark this... Jesse Liberty has moved his site: Silverlight Geek I stand with Tim Heuer on this: Congratulations to latest 2nd quarter Silverlight MVPs From SilverlightCream.com: Wizards. Prototype of sketching Wizard for WPF - 1 Max Paulousky is creating a SketchFlow WPF wizard in Expression Blend... looks like good Expression Blend and SketchFlow no matter what the target is Windows Phone 7 Navigation Hassan has another WP7 Video up, and this one is on Navigation and passing data from page to page. Silverlight 4 PathListBox Viktor Larsson is blogging about the PathListBox, and definitely had a good time doing so.. lots of fun examples. CountDown Clock in Silverlight 4 Fons Sonnemans has reworked his Sivlerlight 3 FlipClock to be this Silverlight 4 CountDown Clock utilizing the Viewbox control to make it scalable. Generic class for deep clone of Silverlight and CLR objects Jim McCurdy has a Silverlight 3 and 4-tested CloneObject class that he's using for creating a deep copy of an object and all it's properties... think drag/drop or undo/redo. Animating the Fill Color of a Silverlight Ellipse Scott Marlowe has a tutorial up that animates a pass/fail indicator with a smooth transition from a red to a green state... all with code. Silverlight 4, Blend 4, MVVM, Binding, DependencyObject Mike Taulty has a great tutorial up on Blend4 and binding... he's got a somewhat contrived example going, but it certainly looks good to me :) Silverlight 4 + RIA Services - Ready for Business: Authentication and Personalization Next up in Brad Abrams' series is Authentication and Personalization. RIA Services makes this easy to do... let Brad show you! An Annotated Line of Business Application Jesse Liberty is walking through the design and delivery of his HyperVideo project with this mini tutorial. Want to understand the thought process behind the LOB app, check this out. How to hack Expression Blend Seems like there was just some discussion about some of this today and here Scott Barnes posts this hack job for Expression Blend... pretty cool actually :) d:DesignInstance in Blend 4 Christopher Bennage has a follow-on post about using d:DesignInstance in Blend 4, and this is a very nice tutorial on the subject Silverlight TV 19: Hidden Gems from MIX10, UFC's Multi-Touch App John Papa and Ward Bell front and center for Silverlight TV number 19... and check out those threads! Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • Overwrite previous output in Bash instead of appending it

    - by NES
    For a bash timer i use this code: #!/bin/bash sek=60 echo "60 Seconds Wait!" echo -n "One Moment please " while [ $sek -ge 1 ] do echo -n "$sek " sleep 1 sek=$[$sek-1] done echo echo "ready!" That gives me something like that One Moment please: 60 59 58 57 56 55 ... Is there a possibility to replace the last value of second by the most recent so that the output doesn't generate a large trail but the seconds countdown like a real time at one position? (Hope you understand what i mean :))

    Read the article

  • Week in Geek: Microsoft Security Essentials Loses its Certification after Failing AV Test

    - by Asian Angel
    Our first edition of WIG for December is filled with news link coverage on topics such as the Windows XP countdown clock has dropped to less than 500 days, software pirates have released a tool to crack Windows 8 apps, an online service is offering bank robbers for hire, and more. HTG Explains: Does Your Android Phone Need an Antivirus? How To Use USB Drives With the Nexus 7 and Other Android Devices Why Does 64-Bit Windows Need a Separate “Program Files (x86)” Folder?

    Read the article

  • Olympic clock stops after a few hours: can this even be a software problem? [closed]

    - by mvexel
    I fail to understand how something uncomplicated as a countdown clock can fail - to much public humiliation of sponsor and renowned clock maker Omega - after only a few hours of operation. The clock, which was 'developed by our experts and fully tested' according to a spokesperson who goes on to say that is 'not immediately apparent what has caused the problem'. Can this even be a software problem? What has gone wrong here?

    Read the article

  • Microsoft : « Il est temps de dire au revoir à Internet Explorer 6 », un compte à rebours annonce la fin du navigateur

    Microsoft : « Il est temps de dire au revoir à Internet Explorer 6 » Un compte à rebours annonce la fin du navigateur Microsoft multiplie les campagnes pour encourager les utilisateurs à abandonner Internet Explorer 6 pour passer à l'utilisation des navigateurs plus modernes respectant les nouveaux standards du web. Après la campagne lancée l'an dernier par Microsoft Australie avec pour mots d'ordre « Surfer avec Internet Explorer 6, c'est comme boire du lait périmé depuis 9 ans », la firme vient de lancer un site Web (Internet Explorer 6 Countdown) qui permet de mesurer la baisse de la part de marché d'IE6. Sur c...

    Read the article

  • Adding program booting options to the OS

    - by user113948
    I am building a flight simulator box, off of Ubuntu 12.10, but I am trying to make the OS essentially invisible, I just want the machine to boot into the Flight Sim, which, that part isn't really that difficult, just a matter of adding a startup item, but I would like to make it a bit more seemless, and in-addtion to that, I would like maybe a 3-5 second countdown where you could opt-out of the flight sim from starting, if you need to troubleshoot the OS, or the flight sim itself, and I have no idea how that would be accomplished

    Read the article

  • Bash script dosn't open in terminal on reboot

    - by twigg
    Quick overview, I have created a script that reboots the laptop after x amount of time and x amount of cycles. I have added the script to the start-up applications and the script does seem to be running in the background but never opens a terminal Window. Am I missing something? Adding Code (this is saved in a file called countdown.sh) #!/bin/bash # check if passed.txt exists if it does, send to soak test if [ -f passed.txt ]; then echo reboot has passed $nol cycles sleep 5; echo Starting soak tests sleep 5; rm testlog.txt; rm passed.txt; phoronix-test-suite run quick-test exit 0; fi # check if file testlog.txt exists if not create it if [ ! -f testlog.txt ]; then echo >> testlog.txt; fi # read reboot file to see how many loops have been completed exec < testlog.txt nol=0 while read line do nol=`expr $nol + 1` done # start the countdown, x is time limit let x=10; while [ $x -gt 0 ]; do clear; figlet "Rebooting in..."; figlet $x; let x-=1; sleep 1; done; echo reboot success $nol >> testlog.txt; shutdown -r now; # set how many times the script should shutdown the laptop reboot_count=1 # if number of reboots matches nol's then stop the script # create a new text file called passed.txt if [ "$nol" == "$reboot_count" ]; then echo reboot passed $nol cycles >> passed.txt; fi

    Read the article

  • Show (copy) data at "X" time and stop update

    - by Anka
    I have two sheets. In the first sheet, cell F4, I have 00:00:00 (countdown). G9, G10 and G11 are cells that receive live data (decimal numbers). In the second sheet, I have three cells linked from sheet1, G9 ='Sheet1'!G9, G10 ='Sheet1'!G10, G11 ='Sheet1'!G11 (which update themselves when data is modified in the first sheet). Now I want to set in sheet 2, (assume) cells B9, B10 and B11 to show me (copy) the values from G9, G10 and G11 from sheet 1 when the countdown was 00:00:05 (5 seconds before Start) and not update again if the data changes in the cell it pulled the data from. Like G9 ='Sheet1'!G9 at 00:00:05 and stop here, do not update anything. OK? I can do a part, but the real problem is: I can not make it stop cells to update. Stand frozen, freeze, not move, calm .. however. I do not want to seem pretentious (but my knowledge in excel is limited), the most appropriate would be a formula, not macro or VBA, if possible. I want to post a picture but I can not because of my restrictions. Well, if this is not possible with a formula is just fine with (not really) VBA.

    Read the article

  • How to use multiple instances of a usercontrol (with jquery) on the same page

    - by Julian
    Hi All, I've been working on an usercontrol with a jquery timer in it. At first I had the jquery within the usercontrol. But when I add 2 of those controls to my page the second usercontrol isn't showing it's data very well. Now I've put the jquery into the mainpage and the usercontrol only uses the id's of the jquery. Here is my usercontrol: <%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %> <style type="text/css"> #mainpanel { width: 145px; height: 123px; } </style> <div id="mainpanel"> <div> test</div> <div id="shortly" style="background-color: #FFFFFF"> </div> <button id="resetButton"> Reset </button> </div> Mainpage: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <%@ Register Src="WebUserControl.ascx" TagName="WebUserControl" TagPrefix="uc1" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>hoi</title> <script src="Scripts/jquery-1.4.2.min.js" type="text/javascript"></script> <script src="Scripts/jquery-ui-1.8.1.custom.min.js" type="text/javascript"></script> <link href="Css/jquery-ui-1.8.1.custom.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> <script type="text/javascript" src="Scripts/jquery.countdown.js"></script> <script type="text/javascript"> $(document).ready(function () { $(function() { $("#mainpanel"); }); shortly = new Date(); shortly.setSeconds(shortly.getSeconds() + 5.5); $('#shortly').countdown({ until: shortly, onExpiry: liftOff, layout: '{sn}', }); $('#resetButton').click(function () { $('#mainpanel').effect("highlight", {}, 700 ); $('#shortly').effect("highlight", {}, 700 ); shortly = new Date(); shortly.setSeconds(shortly.getSeconds() + 5.5); $('#shortly').countdown('change', { until: shortly }); }); function liftOff() { // refresh the page window.location = window.location; } }); </script> </head> <body> <uc1:WebUserControl ID="WebUserControl1" runat="server" /> </body> </html> But still my usercontrols are acting weird, now my question is: "How can I make the SAME usercontrols work properly on ONE page?" Both of those use the same jquery code but the buttons etc. should only work within the usercontrol itself.

    Read the article

  • Android - Resuming application state - SL4A

    - by toyotajon93
    please dont harpoon me for a noob-ish question. I am working on an android application using SL4A, when my application starts it runs in the background while the script is being executed. I'm not sure where to start but each time I click my icon, it re-starts my application. I have tried using different launchmodes with nothing different happening. I'm thinking it has to do with the OnCreate code, and the setting of the notification. I need help saving my application state and then resuming on either re-click of icon or click from notification bar. I've tried everything had to turn here for help. I am not a pro at android programming by any means. Thanks guys, be gentle ;) Public void onCreate() { super.onCreate(); mInterpreterConfiguration = ((BaseApplication) getApplication()) .getInterpreterConfiguration(); } @Override public void onStart(Intent intent, final int startId) { super.onStart(intent, startId); String fileName = Script.getFileName(this); Interpreter interpreter = mInterpreterConfiguration .getInterpreterForScript(fileName); if (interpreter == null || !interpreter.isInstalled()) { mLatch.countDown(); if (FeaturedInterpreters.isSupported(fileName)) { Intent i = new Intent(this, DialogActivity.class); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.putExtra(Constants.EXTRA_SCRIPT_PATH, fileName); startActivity(i); } else { Log .e(this, "Cannot find an interpreter for script " + fileName); } stopSelf(startId); return; } // Copies script to internal memory. fileName = InterpreterUtils.getInterpreterRoot(this).getAbsolutePath() + "/" + fileName; File script = new File(fileName); // TODO(raaar): Check size here! if (!script.exists()) { script = FileUtils.copyFromStream(fileName, getResources() .openRawResource(Script.ID)); } copyResourcesToLocal(); // Copy all resources if (Script.getFileExtension(this) .equals(HtmlInterpreter.HTML_EXTENSION)) { HtmlActivityTask htmlTask = ScriptLauncher.launchHtmlScript(script, this, intent, mInterpreterConfiguration); mFacadeManager = htmlTask.getRpcReceiverManager(); mLatch.countDown(); stopSelf(startId); } else { mProxy = new AndroidProxy(this, null, true); mProxy.startLocal(); mLatch.countDown(); ScriptLauncher.launchScript(script, mInterpreterConfiguration, mProxy, new Runnable() { @Override public void run() { mProxy.shutdown(); stopSelf(startId); } }); } } RpcReceiverManager getRpcReceiverManager() throws InterruptedException { mLatch.await(); if (mFacadeManager==null) { // Facade manage may not be available on startup. mFacadeManager = mProxy.getRpcReceiverManagerFactory() .getRpcReceiverManagers().get(0); } return mFacadeManager; } @Override protected Notification createNotification() { Notification notification = new Notification(R.drawable.script_logo_48, this.getString(R.string.loading), System.currentTimeMillis()); // This contentIntent is a noop. PendingIntent contentIntent = PendingIntent.getService(this, 0, new Intent(), 0); notification.setLatestEventInfo(this, this.getString(R.string.app_name), this.getString(R.string.loading), contentIntent); notification.flags = Notification.FLAG_ONGOING_EVENT; return notification; }

    Read the article

  • Ubuntu 11.04 and 10.04 hang with black screen while installing from USB disk

    - by Bill
    I've been trying to install Ubuntu 11.04 from a USB flash stick and each time I try to boot from the USB key one of two things happen: A) The screen that asks you what you would like to do (e.g. run Ubuntu from the USB key or install it) shows up and the countdown to the default option starts to count down but as soon as I either touch the keyboard (sometimes I press enter or the arrow keys to select an option) or the countdown gets to zero the screen just locks up and nothing happens no matter how long I wait. B) When I boot from the USB key the screen will flicker for a second and then go black with a flashing white underscore at the top left corner of the screen. Again it doesn't matter how long I wait, nothing happens and pressing keys doesn't do a thing. The very first time I tried to install it I got a terminal-like screen that said something about a directory called 'casper' having an error of some sort. I have tried installing from USB using both 11.04 and 10.10. I'm about to try 10.04. I have read tons of forum posts about this but so far I haven't seen anything in the solutions that apply to me. My intention is to dual boot Windows 7 and Ubuntu. I must keep Windows as I am required to use Visual Studio for one of my college courses. Right now I'm using Wubi but I really want a full install. I can't use LVPM because it doesn't work with the version of Wubi I used. So now I'm thinking my best bet is to try to get a clean install working. I'd also convert Wubi to a full install too but there's no solution as far as I've read. So could someone tell me a reason why this is happening or if there's something I can do to get around the problem? I'm using a Gateway LT2802u netbook with and Intel Atom N455 processor, 1GB RAM, Intel Graphics Media Accelerator 3150 graphics card, and a 250GB HDD. I don't have anything on my current Wubi install that I can't replace so keep in mind when answering that I don't care if I lose my current settings and files from Wubi. Thanks everyone! UPDATE I just answered my own question so in case anyone else is having this same problem using similar hardware, do the following: When I first tried installing 11.04 I used the recommended universal installer tool to create the USB live/installation disk. That caused the original problem. Note that I had already downloaded the 11.04 ISO and did not use the included downloader from the USB creator. After that failed I used the same USB creator but had it download 10.10 for me. It also failed with the same issue. I repeated this process with unetbootin as well for both versions. Finally, I downloaded the Ubuntu 10.04 ISO and used the recommended USB creator once again. There was an error while creating the USB live install so I reformatted the USB key as FAT32 and tried again. It created the USB key. I then booted from the USB flash drive and selected "Install Ubuntu" (exact wording was different). It worked! It took me through the process that you see shown in pictures on the Ubuntu website. I let it create the appropriate partitions for me and it simply worked. I did get a few errors while the system tried to restart after it installed. It hung on a terminal-like screen but I pressed ENTER and it restarted. I booted into Windows 7, it checked the disks as it sensed that I messed with a partition, then it booted into Windows normally. Now I'm going to uninstall Wubi and update my new full install of Ubuntu! I'm excited to get the benefits of a full install now. So in the end, hopefully someone can learn from what I did.

    Read the article

  • Android Game Development. Async Task. Loading Bitmap Images Sounds

    - by user2534694
    Im working on this game for android. And wanted to know if my thread architecture was right or wrong. Basically, what is happening is, i am loading All the bitmaps,sounds etc in the initializevariables() method. But sometimes the game crashes and sometimes it doesnt. So i decided to use async task. But that doesnt seem to work either (i too loads at times and crashes at times) @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setFullScreen(); initializeVariables(); new initVariables().execute(); // setContentView(ourV); } private void setFullScreen() { requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON ); } private void initializeVariables() { ourV=new OurView(this); stats = getSharedPreferences(filename, 0); ballPic = BitmapFactory.decodeResource(getResources(), R.drawable.ball5); platform = BitmapFactory.decodeResource(getResources(), R.drawable.platform3); gameB = BitmapFactory.decodeResource(getResources(), R.drawable.game_back2); waves = BitmapFactory.decodeResource(getResources(), R.drawable.waves); play = BitmapFactory.decodeResource(getResources(), R.drawable.play_icon); pause = BitmapFactory.decodeResource(getResources(), R.drawable.pause_icon); platform2 = BitmapFactory.decodeResource(getResources(), R.drawable.platform4); countdown = BitmapFactory.decodeResource(getResources(), R.drawable.countdown); bubbles = BitmapFactory.decodeResource(getResources(), R.drawable.waves_bubbles); backgroundMusic = MediaPlayer.create(this, R.raw.music); jump = MediaPlayer.create(this, R.raw.jump); click = MediaPlayer.create(this, R.raw.jump_crack); sm = (SensorManager) getSystemService(SENSOR_SERVICE); acc = sm.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); sm.registerListener(this, acc, SensorManager.SENSOR_DELAY_GAME); ourV.setOnTouchListener(this); dialog = new Dialog(this,android.R.style.Theme_Translucent_NoTitleBar_Fullscreen); dialog.setContentView(R.layout.pausescreen); dialog.hide(); dialog.setOnDismissListener(this); resume = (Button) dialog.findViewById(R.id.bContinue); menu = (Button) dialog.findViewById(R.id.bMainMenu); newTry = (Button) dialog.findViewById(R.id.bNewTry); tv_time = (TextView) dialog.findViewById(R.id.tv_time); tv_day = (TextView) dialog.findViewById(R.id.tv_day); tv_date = (TextView) dialog.findViewById(R.id.tv_date); resume.setOnClickListener(this); menu.setOnClickListener(this); newTry.setOnClickListener(this); } @Override protected void onResume() { //if its running the first time it goes in the brackets if(firstStart) { ourV.onResume(); firstStart=false; } } Now what onResume in ourV does is , its responsible for starting the thread //this is ourV.onResume public void onResume() { t=new Thread(this); isRunning=true; t.start(); } Now what I want is to initialise all bitmaps sounds etc in the async background method public class initVariables extends AsyncTask<Void, Integer, Void> { ProgressDialog pd; @Override protected void onPreExecute() { pd = new ProgressDialog(GameActivity.this); pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); pd.setMax(100); pd.show(); } @Override protected Void doInBackground(Void... arg0) { synchronized (this) { for(int i=0;i<20;i++) { publishProgress(5); try { Thread.sleep(89); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } return null; } @Override protected void onProgressUpdate(Integer... values) { pd.incrementProgressBy(values[0]); } @Override protected void onPostExecute(Void result) { pd.dismiss(); setContentView(ourV); } } Now since I am new to this. You could tellme maybe if async is not required for such stuff and there is another way of doing it normally.

    Read the article

  • WebLogic stuck thread protection

    - by doublep
    By default WebLogic kills stuck threads after 15 min (600 s), this is controlled by StuckThreadMaxTime parameter. However, I cannot find more details on how exactly "stuckness" is defined. Specifically: What is the point at which 15 min countdown begins. Request processing start? Last wait()-like method? Something else? Does this apply only to request-processing threads or to all threads? I.e. can a request-processing thread "escape" this protection by spawning a worker thread for a long task? Especially, can it delegate response writing to such a worker without 15 min countdown? My usecase is download of huge files through a permission system. Since a user needs to be authenticated and have permissions to view a file, I cannot (or at least don't know how) leave this to a simple HTTP server, e.g. Apache. And because files can be huge, download could (at least in theory) take more than 15 minutes.

    Read the article

  • Changing text of TextView -- old text doesn't go away (Android 4.1.2)

    - by Jason Costabile
    I'm pretty new to Android development. Trying to accomplish something fairly simple -- change some displayed text when a timer ticks. Here's the potentially relevant code: CountDownTimer currentTimer; Resources res; TextView timerText; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_exercise); res = getResources(); timerText = (TextView) findViewById(R.id.timer_text); } @Override protected void onStart() { super.onStart(); //"Get ready" countdown currentTimer = new CountDownTimer(5000, 1000) { @Override public void onTick(long millisUntilFinished) { timerText.setText("" + (int)Math.ceil(millisUntilFinished / 1000.0)); } @Override public void onFinish() { ... } }; currentTimer.start(); } This works fine on an emulated 4.2.2 device, but on a 4.1.2 device (both physical and emulated), the changed TextView appears as such while the countdown proceeds: If you can't tell, that's the numbers 5,4,3 overlayed. So, when I set a new string for the TextView, the new string is displayed but without replacing the old string. Any other TextViews used in my app behave in the same way. Any ideas what the problem is and how to fix it? Edit: From the XML layout file: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:context=".ExerciseActivity" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:keepScreenOn="true" android:orientation="vertical" > ... <TextView android:id="@+id/timer_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:textIsSelectable="false" android:hint="@string/timer_default" /> ... </LinearLayout> That's all that could be relevant.

    Read the article

  • Flash gets XML but the values are wrong, as3

    - by VideoDnd
    Flash receives the XML, but the values are wrong. How do I fix this? Problem I can see the XML loaded with no errors, but my output is way off. It's as though it's not receiving any values. Numbers in the output window and animation move rapidly. The Flash file runs as if it's variables where set to zero. I changed the order of my code, but that didn't help with this. Please explain how I can correct this. SWF //load xml var myXML:XML; var myLoader:URLLoader = new URLLoader(); myLoader.load(new URLRequest("xml.xml")); myLoader.addEventListener(Event.COMPLETE, processXML); //parse XML function processXML(e:Event):void { myXML = new XML(e.target.data); trace(myXML); //receive values from XML delay = parseInt(myXML.DELAY.text()); trace(delay); repeat = parseInt(myXML.REPEAT.text()); trace(repeat); } //variables var delay:uint = 0; var repeat:uint = 0; //timer and event var timer:Timer = new Timer(uint(delay),uint(repeat)); timer.addEventListener(TimerEvent.TIMER, countdown); //counter function countdown(event:TimerEvent) { myText.text = String(0 + timer.currentCount); trace(0 + timer.currentCount); } timer.start(); XML <?xml version="1.0" encoding="utf-8"?> <SESSION> <DELAY TITLE="starting position">1000</DELAY> <REPEAT TITLE="starting position">60</REPEAT> </SESSION>

    Read the article

  • AJAX - ASP.NET - Timer delay problem

    - by Julian
    Hi, I'm trying to make an webapplication where you see an Ajax countdown timer. Whenever I push a button the countdown should go back to 30 and keep counting down. Now the problem is whenever I push the button the timer keeps counting down for a second or 2 and most of the time after that the timer keeps standing on 30 for to long. WebForm code: <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Label ID="Label1" runat="server" Text="geen verbinding"></asp:Label> <br /> <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" /> <br /> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" /> </Triggers> </asp:UpdatePanel> <asp:Timer ID="Timer1" runat="server" Interval="1000" ontick="Timer1_Tick"> </asp:Timer> </form> Code Behind: static int timer = 30; protected void Page_Load(object sender, EventArgs e) { Label1.Text = timer.ToString(); } protected void Timer1_Tick(object sender, EventArgs e) { timer--; } protected void Button1_Click(object sender, EventArgs e) { timer = 30; } Hope somebody knows what the problem is and if there is anyway to fix this. Thanks in advance!

    Read the article

  • "multiply frog enemy" timer and array AS3

    - by VideoDnd
    How can I use the counter value to multiply the frogs in the array? My counter goes from 0-100. I want to prove that I can increment the enemies using a counter. EXPLAINED BETTER I have 10 frogs in an array. I want to use a timer to add 10 more frogs on each iteration of the TimerEvent.TIMER firing. //currentCount var timer:Timer = new Timer(1000, 50); timer.addEventListener(TimerEvent.TIMER, countdown); timer.start(); function countdown(event:TimerEvent) { // myText.text = String(0 + timer.currentCount); } //Creates 10 enemies "I want enemies to multiply 0-100" var enemyArray:Array = new Array(); for (var i:int = 0; i < 10; i++) { var noname:FrogClass = new FrogClass(); noname.x = i*10; //this will just assign some different x and y value depending on i. noname.y = i*11; enemyArray.push(noname); //put the enemy into the array addChild(noname); //puts it on the stage } SYMBOL PROPERTIES NAME "noname" CLASS "FrogClass" WHY I need specific examples using strings and arrays, because I'm stuck in a learning curve. Stupid examples are more fun!

    Read the article

  • A more elegant way to start a multithread alarm in Rebol VID ? (What's the equivalent of load event?

    - by Rebol Tutorial
    I want to trigger an alarm when the GUI starts. I can't see what's the equivalent of load event of other language in Rebol VID, so I put it in the periodic handler which is quite circumvoluted. So how to do this more cleanly ? alarm-data: none set-alarm: func [ "Set alarm for future time." seconds "Seconds from now to ring alarm." message [string! unset!] "Message to print on alarm." ] [ alarm-data: reduce [now/time + seconds message] ] ring: func [ "Action for when alarm comes due." message [string! unset!] ] [ set-face monitor either message [message]["RIIIING!"] ; Your sound playing can also go here (my computer doesn't have speakers). ] periodic: func [ "Called every second, checks alarms." fact action event ] [ either alarm-data [ ; Update alarm countdown. set-face monitor rejoin [ "Alarm will ring in " to integer! alarm-data/1 - now/time " seconds." ] ; Check alarm. if now/time > alarm-data/1 [ ring alarm-data/2 ;alarm-data: none ; Reset once fired. ] ][ either value? 'message [ set-alarm seconds message ][ set-alarm seconds "Alarm triggered!" ] ] ] alarm: func[seconds message [string! unset!]][ system/words/seconds: seconds if value? 'message [ system/words/message: message ] view layout [ monitor: text 256 "" rate 1 feel [engage: :periodic] button 256 "re/start countdown" [ either value? 'message [ set-alarm seconds message ][ set-alarm seconds "Alarm triggered!" ] set-face monitor "Alarm set." ] ] ]

    Read the article

  • Flex web application: prevent framerate drop when window is invisible

    - by JayPea
    So there's been a new "feature" in the flash player since version 10.1, which reduces the player's framerate to 2 fps when the application window is out of view. This is good news for performance, but it can break some functionality, such as the Timer class. I have an application which uses a Timer to display a countdown. Given the nature of the application, it is required for the Timer to complete its countdown even if the user is not there to see it. Imagine that you need to give the user only 10 seconds to perform a task. If the user minimizes the window halfway through the counter, they can take as much time as they want and still have 5 seconds left when they return to the window. This apparently can not be avoided with the newer flash players. In Air applications there is the backgroundFrameRate property which can be set to prevent this behavior, but this is part of the WindowedApplication class, so it seems that it is not available in a web application. Does anyone know a way to keep a constant frame rate even when the window is not visible? Thanks

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8  | Next Page >