Search Results

Search found 1165 results on 47 pages for 'pause'.

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

  • SWI-Prolog as an embedded application in VS2008 C++

    - by H.J. Miri
    I have a C++ application (prog.sln) which is my main program and I want to use Prolog as an embedded logic server (hanoi.pl) int main(int argc, char** argv) { putenv( "SWI_HOME_DIR=C:\\Program Files\\pl" ); argv[0] = "libpl.dll"; argv[1] = "-x"; argv[2] = "hanoi.pl"; argv[3] = NULL; PL_initialise(argc, argv); { fid_t fid = PL_open_foreign_frame(); predicate_t pred = PL_predicate( "hanoi", 1, "user" ); int rval = PL_call_predicate( NULL, PL_Q_NORMAL, pred, 3 ); qid_t qid = PL_open_query( NULL, PL_Q_NORMAL, pred, 3 ); while ( PL_next_solution(qid) ) return qid; PL_close_query(qid); PL_close_foreign_frame(fid); system("PAUSE"); } return 1; system("PAUSE"); } Here is my Prolog source code: :- use_module( library(shlib) ). hanoi( N ):- move( N, left, center, right ). move( 0, _, _, _ ):- !. move( N, A, B, C ):- M is N-1, move( M, A, C, B ), inform( A, B ), move( M, C, B, A ). inform( X, Y ):- write( 'move a disk from ' ), write( X ), write( ' to ' ), write( Y ), nl. I type at the command: plld -o hanoi prog.sln hanoi.pl But it doesn't compile. When I run my C++ app, it says: Undefined procedure: hanoi/1 What is missing/wrong in my code or at the prompt that prevents my C++ app from consulting Prolog? Appreciate any help/pointer.

    Read the article

  • Socket errors of 10048 on the client? Possible causes?

    - by Earlz
    Hello, I'm writing a custom TCP server and client and on doing a ton of requests (60,000 to be exact) I begin to get this socket error of 10048, which should mean "the address is already in use." The error keeps happening unless I pause the process for like 2 or 3 minutes and then begin it again, and then it begins to bring up the same error a short while after restarting it. If I pause the client process and restart the server process, I still get the same error on the client. So it is a complete client side problem. This does not make sense though, this error only usually occurs when binding and this error happens on the client and not the server. What could be the possible reasons for it? A small excerpt of my initialization: TcpClient client = new TcpClient(); client.Connect("XXXXX -- some ip", 25000); client.NoDelay = true; NetworkStream clientStream = client.GetStream(); Also, everything else seems to be working fine(including the amount of time it takes to send back and forth) and this works perfectly when using 127.0.0.1 but when putting it on another LAN computer I begin to get the 10048 error. Is there something wrong with how I initialize it? What else could cause this error on the client side?

    Read the article

  • Random point on VideoDisplay isn't accurate enough

    - by Mike
    For a schoolassigment me and some buddies of mine are creating an application that is showing many similarities with the C-Mon & Kypski musicvideo on www.oneframeoffame.com. The application is being developed in Flex. We want to get a random point of a clip, let it pause so a user can mimic the pose and make a snapshot out of it. What i managed to do is get a random point of the movie. I did this by getting a random value between 0 and de total duration of the movie. But what i didn't managed to do is let the screen pause on every 24st of a frame. As the movie concist out of 24FPS. It looks like the the random value of the movie that is being requested is being rounded by the movie itself. As example: There appears to be no difference between the frames requested at 2.40 or 2.41. It appears it got something to do with keyframing i've read on the Adobe® Flex™ 3.5 Language Reference. The movie is a FLV file and i use the VideoDisplay object to display the movie. Does someone is familiar with this or knows a solution to my problem? Thanks in advance

    Read the article

  • How to solve timing problems in automated UI tests with C# and Visual Studio?

    - by Lernkurve
    Question What is the standard approach to solve timing problems in automated UI tests? Concrete example I am using Visual Studio 2010 and Team Foundation Server 2010 to create automated UI tests and want to check whether my application has really stopped running: [TestMethod] public void MyTestMethod() { Assert.IsTrue(!IsMyAppRunning(), "App shouldn't be running, but is."); StartMyApp(); Assert.IsTrue(IsMyAppRunning(), "App should have been started and should be running now."); StopMyApp(); //Pause(500); Assert.IsTrue(!IsMyAppRunning(), "App was stopped and shouldn't be running anymore."); } private bool IsMyAppRunning() { foreach (Process runningProcesse in Process.GetProcesses()) { if (runningProcesse.ProcessName.Equals("Myapp")) { return true; } } return false; } private void Pause(int pauseTimeInMilliseconds) { System.Threading.Thread.Sleep(pauseTimeInMilliseconds); } StartMyApp() and StopMyApp() have been recorded with MS Test Manager 2010 and reside in UIMap.uitest. The last assert fails because the assertion is executed while my application is still in the process of shutting down. If I put a delay after StopApp() the test case passes. The above is just an example to explain my problem. What is the standard approach to solve these kinds of timing issues? One idea would be to wait with the assertion until I get some event notification that my app has been stopped.

    Read the article

  • Javascript keyup doesn't work as expected, it executes in instances where I have not removed my fing

    - by Binni
    I'm trying to create a simple game in javascript and I'm stuck on how to deal with keys. Small example: function keyUpEvent(event) { alert(event.keyCode); } window.addEventListener("keyup", keyUpEvent, false); I'm running Ubuntu 9.10 and testing it in Firefox 3.5 and Chromium. If I press and release a button instantly I get an alert, which is to be expected, but when I press and hold a button I get a small pause and then a series of alert windows, the expected result is that I only get an alert window when I remove my finger from a button. I reason it has something to do with the fact that when I press and hold a button in a text area for example I get one character, small pause, and then a series of characters: dddddddddddddddd. I believe it's possible to get around this or do it more right or whatever since this game for example: http://bohuco.net/testing/gamequery/pong.html seams not to be affected by this. But I notice if I try out the jquery keyup demo ( api.jquery.com/keyup/ ) I get the same problem. How can I implement basic game key event handling?

    Read the article

  • Moving a large number of files in one directory to multiple directories

    - by Axsuul
    I am looking to create a Windows batch script to move about 2,000 files and splitting them up so that there are 10 files per folder. I have attempted creating a batch script but the syntax really boggles my mind. Here is what I have so far @echo off :: Config parameters set /a groupsize = 10 :: initial counter, everytime counter is 1, we create new folder set /a n = 1 :: folder counter set /a nf = 1 for %%f in (*.txt) do ( :: if counter is 1, create new folder if %n% == 1 ( md folder%nf% set /a n += 1 ) :: move file into folder mv -Y %%f folder%nf%\%%f :: reset counter if larger than group size if %n% == %groupsize% ( set /a n = 1 ) else ( set /a n += 1 ) ) pause Basically what this script does is loop through each .txt file in the directory. It creates a new directory in the beginning and moves 10 files into that directory, then creates a new folder again and moves another 10 files into that directory, and so on. However, I'm having problems where the n variable is not being incremented in the loop? I'm sure there's other errors too since the CMD window closes on me even with pause. Any help or guidance is appreciated, thanks for your time!

    Read the article

  • Javascript API not working for Chrome or Safari on JW Player 5.9

    - by Lando
    I am working on a custom interface for the JW Player which displays the current track title and has play/pause, next track, previous track and volume toggle buttons. It works for IE8/9 and FF but fails for Chrome and Safari. Chrome's console gives the following error: Uncaught TypeError: Object # has no method 'addControllerListener' This is the code I am using for testing. <div id="container">Loading the player ...</div> <script type="text/javascript"> jwplayer("container").setup({ image: "preview.jpg", height: 320, width: 480, modes: [ { type: "html5" }, { type: "flash", src: "player.swf" } ], 'playlist': [ { 'file': "audio/01.mp3", 'title': "Track 1" }, { 'file': "audio/02.mp3", 'title': "Track 2" }, { 'file': "audio/03.mp3", 'title': "Track 3" } ], }); function playerReady(obj) { player = document.getElementById(obj.id); displayFirstItem(); }; function displayFirstItem() { try { playlist = player.getPlaylist(); } catch(e) { setTimeout("displayFirstItem()", 100); } player.addControllerListener('ITEM', 'itemMonitor'); itemMonitor({index:0}); }; function itemMonitor(obj) { $('#nowplaying').html('<span><strong>Now Playing:</strong> ' + playlist[obj.index]['title'] + '</span>'); }; </script> <div id="nowplaying"></div> <div class="control_bar"> <ul> <li onclick='player.sendEvent("play");'>[ &#8250; ] Play / Pause</li> <li onclick='player.sendEvent("prev");'>[ &laquo; ] Previous item</li> <li onclick='player.sendEvent("next");'>[ &raquo; ] Next item</li> </ul> </div> I have searched and tried several modifications, like adding the javascriptid parameter, nothing seems to work for Chrome or Safari. Any ideas? Thanks

    Read the article

  • Sound does not working in Device

    - by diana
    In my app i write for record NSArray *filePaths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES); NSString *recordingDirectory = [filePaths objectAtIndex: 0]; NSString *resourcePath = [recordingDirectory stringByAppendingString:@"/sound.caf"]; self.soundFileURL = [NSURL fileURLWithPath:resourcePath]; AVAudioSession *audioSession = [AVAudioSession sharedInstance]; audioSession.delegate = self; [audioSession setActive: YES error: nil]; [[AVAudioSession sharedInstance] setCategory : AVAudioSessionCategoryRecorderror: nil]; NSDictionary *recordSettings = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithFloat: 44100.0], AVSampleRateKey, [NSNumber numberWithInt: kAudioFormatAppleLossless], AVFormatIDKey, [NSNumber numberWithInt: 1], AVNumberOfChannelsKey, [NSNumber numberWithInt: AVAudioQualityMax], AVEncoderAudioQualityKey, nil]; AVAudioRecorder *newRecorder = [[AVAudioRecorder alloc] initWithURL: soundFileURL settings: recordSettings error: nil]; [recordSettings release]; self.soundRecorder = newRecorder; [newRecorder release]; soundRecorder.delegate = self; [soundRecorder prepareToRecord]; [soundRecorder record]; recording = YES; I write for stop recording [soundRecorder stop]; recording = NO; self.soundRecorder = nil; I write for play AVAudioPlayer *newPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL: self.soundFileURL error: nil]; [fileURL release]; self.player = newPlayer; [newPlayer release]; [player prepareToPlay]; [player setDelegate: self]; [button setTitle : @"Pause"forState: UIControlStateHighlighted]; [button setTitle : @"Pause"forState: UIControlStateNormal]; [player play]; In iPhone Simulator all ok I record then stop then play and all work fine. But in my iPhone device no sound. Any help will be greatly apprecieated

    Read the article

  • MovieViewControl unable to become a receiver during Broadcast

    - by Paulina D
    Hi! I'm currently trying to catch a broadcast message with the MovieViewControl class, already added the filter in the Manifest //In MovieViewControl private static final String SERVICECMD = "com.android.music.musicservicecommand"; private static final String CMDNAME = "command"; private static final String CMDPAUSE = "pause"; @Override public void onReceive(Context context, Intent intent) { String intentAction = intent.getAction(); if (AudioManager.ACTION_AUDIO_BECOMING_NOISY.equals(intentAction)) { Intent i = new Intent(intent.ACTION_MAIN); i.setAction(SERVICECMD); i.putExtra(CMDNAME, CMDPAUSE); mVideoView.pause(); context.startActivity(i); } } but when I do my trial, I get this (very) huge exception: W/dalvikvm( 1630): threadid=3: thread exiting with uncaught exception (group=0x4001b1b8) E/AndroidRuntime( 1630): Uncaught handler: thread main exiting due to uncaught exception E/AndroidRuntime( 1630): java.lang.RuntimeException: Unable to instantiate receiver com.android.gallery.MovieViewControl: java.lang.ClassNotFoundException: com.android.gallery.MovieViewControl in loader dalvik.system.PathClassLoader@438ff048 E/AndroidRuntime( 1630): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2616) E/AndroidRuntime( 1630): at android.app.ActivityThread.access$3100(ActivityThread.java:119) E/AndroidRuntime( 1630): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913) E/AndroidRuntime( 1630): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 1630): at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime( 1630): at android.app.ActivityThread.main(ActivityThread.java:4363) E/AndroidRuntime( 1630): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 1630): at java.lang.reflect.Method.invoke(Method.java:521) E/AndroidRuntime( 1630): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) E/AndroidRuntime( 1630): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) E/AndroidRuntime( 1630): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 1630): Caused by: java.lang.ClassNotFoundException: com.android.gallery.MovieViewControl in loader dalvik.system.PathClassLoader@438ff048 E/AndroidRuntime( 1630): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243) E/AndroidRuntime( 1630): at java.lang.ClassLoader.loadClass(ClassLoader.java:573) E/AndroidRuntime( 1630): at java.lang.ClassLoader.loadClass(ClassLoader.java:532) E/AndroidRuntime( 1630): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2609) E/AndroidRuntime( 1630): ... 10 more Any hints on what might I be missing? Thanks in advance!

    Read the article

  • GPIB connection to external device using MATLAB

    - by hkf
    Is there a way to establish a GPIB connection using MATLAB without the instrument control Tool box? (I don't have it). Also is there a way for MATLAB to know what the external device's RS232 parameter values are ( Baud rate, stop bit etc..). For the RS232 connection I have the following code: % This function is meant to send commands to Potentiostat Model 263A. % A run includes turning the cell on, reading current for time t1, turning % the cell off, waiting for time t2. % t1 is the duration [secs] for which the Potentiostat must run (cell is on) % t2 is the duration [secs] to on after off % n is the number of runs % port is the serial port name such as COM1 function [s] = Potentiostat_control(t1,t2,n) port = input('type port name such as COM1', 's') s = serial(port); set(s,'BaudRate', 9600, 'DataBits', 8, 'Parity', 'even', 'StopBits', 2 ,'Terminator', 'CR/LF'); fopen(s) %fprintf(s,'RS232?') disp(['Total runs requested = ' num2str(n)]) disp('i denotes number of runs executed so far..'); for i=1:n i %data1 = query(s, '*IDN?') fprintf(s,'%s','CELL 1'); % sends the command 'CELL 1' %fprintf(s,'%s','READI'); pause(t1); fprintf(s,'%s','CELL 0'); %fprintf(s,'%s','CLEAR'); pause(t2); end fclose(s)

    Read the article

  • jQuery "growl-like" effect in VB.net

    - by StealthRT
    Hey all, i have made a simple form that mimiks the jQuery "GROWL" effect seen here http://www.sandbox.timbenniks.com/projects/jquery-notice/ However, i have ran into a problem. If i have more than one call to the form to display a "Growl" then it just refreshes the same form with whatever call i send it. In other words, i can only display one form at a time instead of having one drop down and a new one appear above it. Here is my simple form code for the "GROWL" form: Public Class msgWindow Public howLong As Integer Public theType As String Private loading As Boolean Protected Overrides Sub OnPaint(ByVal pe As System.Windows.Forms.PaintEventArgs) Dim pn As New Pen(Color.DarkGreen) If theType = "OK" Then pn.Color = Color.DarkGreen ElseIf theType = "ERR" Then pn.Color = Color.DarkRed Else pn.Color = Color.DarkOrange End If pn.Width = 2 pe.Graphics.DrawRectangle(pn, 0, 0, Me.Width, Me.Height) pn = Nothing End Sub Public Sub showMessageBox(ByVal typeOfBox As String, ByVal theMessage As String) Me.Opacity = 0 Me.Show() Me.SetDesktopLocation(My.Computer.Screen.WorkingArea.Width - 350, 15) Me.loading = True theType = typeOfBox lblSaying.Text = theMessage If typeOfBox = "OK" Then Me.BackColor = Color.FromArgb(192, 255, 192) ElseIf typeOfBox = "ERR" Then Me.BackColor = Color.FromArgb(255, 192, 192) Else Me.BackColor = Color.FromArgb(255, 255, 192) End If If Len(theMessage) <= 30 Then howLong = 4000 ElseIf Len(theMessage) >= 31 And Len(theMessage) <= 80 Then howLong = 7000 ElseIf Len(theMessage) >= 81 And Len(theMessage) <= 100 Then howLong = 12000 Else howLong = 17000 End If Me.opacityTimer.Start() End Sub Private Sub opacityTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles opacityTimer.Tick If Me.loading Then Me.Opacity += 0.07 If Me.Opacity >= 0.8 Then Me.opacityTimer.Stop() Me.opacityTimer.Dispose() Pause(howLong) Me.loading = False Me.opacityTimer.Start() End If Else Me.Opacity -= 0.08 If Me.Opacity <= 0 Then Me.opacityTimer.Stop() Me.Close() End If End If End Sub Public Sub Pause(ByVal Milliseconds As Integer) Dim dTimer As Date dTimer = Now.AddMilliseconds(Milliseconds) Do While dTimer > Now Application.DoEvents() Loop End Sub End Class I call the form by this simple call: Call msgWindow.showMessageBox("OK", "Finished searching images.") Does anyone know a way where i can have the same setup but would allow me to add any number of forms without refreshing the same form over and over again? Like always, any help would be great! :) David

    Read the article

  • 'Bank Switching' Sprites on old NES applications

    - by Jeffrey Kern
    I'm currently writing in C# what could basically be called my own interpretation of the NES hardware for an old-school looking game that I'm developing. I've fired up FCE and have been observing how the NES displayed and rendered graphics. In a nutshell, the NES could hold two bitmaps worth of graphical information, each with the dimensions of 128x128. These are called the PPU tables. One was for BG tiles and the other was for sprites. The data had to be in this memory for it to be drawn on-screen. Now, if a game had more graphical data then these two banks, it could write portions of this new information to these banks -overwriting what was there - at the end of each frame, and use it from the next frame onward. So, in old games how did the programmers 'bank switch'? I mean, within the level design, how did they know which graphic set to load? I've noticed that Mega Man 2 bankswitches when the screen programatically scrolls from one portion of the stage to the next. But how did they store this information in the level - what sprites to copy over into the PPU tables, and where to write them at? Another example would be hitting pause in MM2. BG tiles get over-written during pause, and then get restored when the player unpauses. How did they remember which tiles they replaced and how to restore them? If I was lazy, I could just make one huge static bitmap and just grab values that way. But I'm forcing myself to limit these values to create a more authentic experience. I've read the amazing guide on how M.C. Kids was made, and I'm trying to be barebones about how I program this game. It still just boggles my mind how these programmers accomplisehd what they did with what they had. EDIT: The only solution I can think of would be to hold separate tables that state what tiles should be in the PPU at what time, but I think that would be a huge memory resource that the NES wouldn't be able to handle.

    Read the article

  • Why does my MPMoviePlayerController disappear when I press play?

    - by Digital Robot
    I have a MPMoviePlayerController in a view, something like myMovie = [[MPMoviePlayerController alloc] initWithContentURL:URLfilme]; if (myMovie) { [myMovie setRepeatMode:MPMovieRepeatModeNone]; [myMovie setShouldAutoplay: NO]; [myMovie setScalingMode:MPMovieScalingModeAspectFit]; myMovie.view.frame = vFilme.bounds; [vFilme addSubview:[myMovie view]]; } The movie appears fine, I can scrub it, but when I press play, boooom, it vanishes. I have tried to retain myMovie but nothing changed. I have tried to play a video fullscreen and even using MPMoviePlayerViewController and is still disappears once I tap on play. Even the video player sample by Apple is not working. Is this a bug or what? EDIT Things are getting more interesting. If instead of playing the video manually by tapping on the play button I insert two timers, one to play the video and another one to pause it after 3 seconds, what I see is this: when the play is fired the video disappears and when the pause is fired the video reappears but when it does it has no controls. It is totally frozen, but the app continues to run normally. It is not anything related to video encoding, because I have tried with different videos, including one shot on the iPhone 4 and another shot on 3GS.

    Read the article

  • iPodMusicPlayer playbackState inaccurate after odd conditions

    - by Shane Costello
    I have a simple music player app that runs into a really weird problem. First of all, while playing music and in the locked state, I allow the user to double click the Home button and use the locked iPod music controls. I did notice however that while in the locked state, my app doesn't receive any of its registered notifications. For the most part, this is fine anyway. But, if the user is playing music for at least 15 minutes (I'm not sure why but any less and this problem doesn't occur) while in the locked state, and using some kind of headphone or aux jack, then unplugs the headphone/aux jack while the device is still playing music, the iPodMusicPlayer will auto-pause. Which is exactly what I would want it to do, but after this happens, when the user unlocks their device and gives focus to the app again, the iPodMusicPlayer's playbackState is inaccurate. - (IBAction)playPause:(id)sender { if ([musicPlayer playbackState] == MPMusicPlaybackStatePlaying) { [musicPlayer pause]; } else { [musicPlayer play]; } } where musicPlayer = [MPMusicPlayerController iPodMusicPlayer]. Under normal circumstances, this runs perfectly fine. But after these conditions, my breakpoint will hit the condition for MPMusicPlaybackStatePlaying while the music is paused, and vice versa. The only way I've been able to fix this is to either make a new selection of music or to terminate the app and reopen. I've tried tons of a workarounds to fix this problem programmatically, but nothing turns out a 100% bug free fix. Does anyone have any clue as to why this happens in the first place?

    Read the article

  • Console in VS 2012 Express for C++?

    - by Live2Code
    I'm very new to programming, so be nice. I was using Eclipse for C/C++ devs for a while, but it seemed quite buggy so I was advised to switch to Visual Studio Express. I'm just testing out with a simple "Hello World" program #include <iostream> #include <string> using namespace std; int main( int argc, char ** argv ) { string response; cout << "Gimme a string: " << flush; cin >> response; cout << "The string is: " << response << endl; system("pause"); return 0; } not much to go wrong there anyway, I noticed that there is no "console" like in Eclipse. All of the text pops up in a little command prompt window. And, also, this window closes right after displaying new text if there is no other things to do after it (like a cin). I have been told that I can use system("pause") but there has to be a better way. In Eclipse, the text would not suddenly disappear because the console window closed. i know this question might be a little confusing, comment and I'll try to explain what I'm saying. Or paste the codes into your Visual Studio 2012 Express Edition. But is there a way to display all of my text and whatever in a "console" as opposed to a command prompt-type window; and why does it always close before I can read the last thing?

    Read the article

  • How do I avoid killing the native controls on a html5-video when i've started it programmaticly?

    - by Nils
    OK, so the deal is I've started making a little videoplayer, that works by clicking a div with an image, expanding the div and the image, and then exchanges the image with a html5-videotag. the code is as below. (It's very early on, so i know theres a lot that need improving, as in not using javascript to set styles and so on, but nevertheless, any insigts and tips are welcome, besides the answer to the main question) /*Begin Expander*/ var $videoplayer = $('<video width="640" height="360" preload="none" controls="" tabindex="0" style="position: relative;"><source type="video/mp4" src="/restalive/movies/big_buck_bunny.mp4"></source><source type="video/ogg" src="/restalive/movies/big_buck_bunny.ogv"></source></video>').appendTo('body'); $videoplayer.hide(); $(".ExpandVideo").each(function(i){ var $trigger = $(this); var $image = $trigger.find("img"); $image.css({ "width" : "100%" ,"height" : "auto" }) $trigger.css({ "display" : "block" ,"overflow" : "hidden" ,"width" : "200px" ,"float" : "left" }); $trigger.bind("click", function(e){ $trigger.animate({"width" : "640px"}, "fast", function(){ $image.replaceWith($videoplayer); $videoplayer.show(); $videoplayer.attr("id", "video" + i); var video = document.getElementById("video" + i); video.play(); }) }) }); However, the main problem is that when i've fired of the video like this (video.play()), the native controls stop working, i can no longer pause the video, even though the controls are there, and clickable, the video just starts playing immidiatley again when i trie to pause it. Which is a shame, because i want to use the native controls for simplicity.

    Read the article

  • Permuting output of a tree of closures

    - by yan
    This a conceptual question on how one would implement the following in Lisp (assuming Common Lisp in my case, but any dialect would work). Assume you have a function that creates closures that sequentially iterate over an arbitrary collection (or otherwise return different values) of data and returns nil when exhausted, i.e. (defun make-counter (up-to) (let ((cnt 0)) (lambda () (if (< cnt up-to) (incf cnt) nil)))) CL-USER> (defvar gen (make-counter 3)) GEN CL-USER> (funcall gen) 1 CL-USER> (funcall gen) 2 CL-USER> (funcall gen) 3 CL-USER> (funcall gen) NIL CL-USER> (funcall gen) NIL Now, assume you are trying to permute a combinations of one or more of these closures. How would you implement a function that returns a new closure that subsequently creates a permutation of all closures contained within it? i.e.: (defun permute-closures (counters) ......) such that the following holds true: CL-USER> (defvar collection (permute-closures (list (make-counter 3) (make-counter 3)))) CL-USER> (funcall collection) (1 1) CL-USER> (funcall collection) (1 2) CL-USER> (funcall collection) (1 3) CL-USER> (funcall collection) (2 1) ... and so on. The way I had it designed originally was to add a 'pause' parameter to the initial counting lambda such that when iterating you can still call it and receive the old cached value if passed ":pause t", in hopes of making the permutation slightly cleaner. Also, while the example above is a simple list of two identical closures, the list can be an arbitrarily-complicated tree (which can be permuted in depth-first order, and the resulting permutation set would have the shape of the tree.). I had this implemented, but my solution wasn't very clean and am trying to poll how others would approach the problem. Thanks in advance.

    Read the article

  • Resize Flash player problem on Internet Explorer

    - by raskolnikov
    When i want to make my flasplayer( flowplayer ) resize to bigger or smaller with jquery , it does not work properly on internet explorer when i make it smaller i use this function ////Make player smaller function createSmallPlayer() { flowplayer("player").hide().pause(); // get handle to the embed element $("#player").css({ // size width:160*1.4, height:90*1.4, top :350, left : 0 }) var embed = $("#player :first"); embed.css({ // size width:160*1.4 , height:90*1.4, top :350, left : 4 }); flowplayer("player").resume(); } and it works well on the internet explorer but when i want to make its size previous style i use //Make player bigger function createBigPlayer() { flowplayer("player").hide().pause(); $("#player").css({ // size width :screen_width , height:screen_height, top :35, left : 0 }); // get handle to the embed element var embed = $("#player :first"); embed.attr("width","100%") ; embed.attr("height","100%") ; embed.removeAttr("style") ; flowplayer("player").resume(); } this function does'nt work on IE properly , it can't be resize, how ever after run this function when i click or resize IE window it works properly . I don't understand the problem .Sorry about my English :)

    Read the article

  • ssh xauth error Mac OS 10.6.3

    - by SteveJ
    Whenever I ssh with X11 forwarding to a remote box from my macbook I get the following error after a few seconds pause: Warning: untrusted X11 forwarding setup failed: xauth key data not generated Warning: No xauth data; using fake authentication data for X11 forwarding. Any ideas on how to fix this?

    Read the article

  • Unpause application in Mac OS X

    - by Xster
    I tried parsing a gigantic XML file and I ended up running out of virtual memory. The OS put all my applications on pause and gave me a screen to shutdown applications to free more space. I killed the XML parsing application and now have tons of space but I can't resume my paused applications anymore. What should I do?

    Read the article

  • ext3 slowing down on writes on linux 2.6.18

    - by user29475
    i'm running into a problem where writing to a file will cause a 5 to 15 second pause, this occurs only on writes. So far i have remounted the filesystem with data=writeback as an option, and set /sys/block/sdb/queue/max_sectors_kb to 64 to shorten the queue. Are there any other things i can try to solve this ?

    Read the article

  • why does Virtualbox use 15-20% CPU when VM is paused?

    - by laramichaels
    Hello, I run VirtualBox 3.1 on Ubuntu with a Win XP guest. I have noticed to my surprise that when I pause the VM (its screen grays out) VirtualBox continues using 15-20% of the host's CPU. Is this normal behavior? Is there a way to avoid it? (Without saving the state of the VM and exiting VirtualBox.) Thanks for any insights! ~lara

    Read the article

  • Running Job and Paused Job Writing to the same File

    - by Kyle Brandt
    So I ran tcpdump twice overnight by accident, both outputting to the same file. However, I ran them as jobs and one of them has been paused the whole time. Anyone have a recommendations on how to keep the file? So far I have thought of: kill -9 the paused job Pause the running job, copy the file, and then stop both. Two sounds like the safest option, anyone have a better idea other than not doing this in the first place ;-)

    Read the article

  • Disable some extra keys on keyboard in windows

    - by user1649054
    I have a keyboard with some types of extra keys, such as multimedia (play, pause, stop ,..), turn off, and etc. some times it's annoying with a "exit button" just right beside arrows that accidentally presses, and programs gonna close, and some other similar problems. I'm wondering is there any solution to disable, or change the functionality of these types of keyboard keys in Windows (win7)? Cheers

    Read the article

  • Pausing a .gif animation in Google Chrome

    - by Ciaran
    Is it possible to "pause" an animated gif file in Google Chrome? If so, how do I do it? I've tried Esc without luck. I'm aware that other browsers can do this using the Esc key I thought I saw a similar question on here before but couldn't find it - close as dupe if you can find it

    Read the article

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