synchronization

python subprocess hide stdout and wait it to complete

Hi all. I have this code: def method_a(self): command_line = 'somtoolbox GrowingSOM ' + som_prop_path subprocess.Popen(shlex.split(command_line)) ...... def method_b(self): ..... .... and like you all see, method_a has a subprocess that is calling the somtoolbox program. But this program have a long stdout, and I want to ...

Is this a safe way to execute threads alternatively?

I would like to run code alternatively, so I could stop execution at any moment. Is this code safe? static class Program { static void Main() { var foo = new Foo(); //wait for interaction (this will be GUI app, so eg. btnNext_click) foo.Continue(); //wait again etc. foo.Continue(); ...

How do you sync a data-base from a test server to production server

If you have a test server, and a production server. How do you sync the database? Do you add the data in the test server first, just like you code in the test server? How is that generally handled? ...

sync client time to server time, i.e. to make client application independant of the local computer time

Ok, so the situation is as follows. I have a server with services for a game, a particular command from the server sends a timestamp for when the next game round should commence. To get this perfectly synced on all connected clients I also have a webbservice that returns a timestamp of the servers current time. What I know: the time be...

What's the good way to synchronize calls to a NSView?

Hey guys, I have a view that receives new data from a secondary thread. Every time it does, it should redraw itself. However, it doesn't play nice with the run loop, and after some time (it's non-deterministic), I end up getting <Error>: kCGErrorIllegalArgument: CGSUnionRegionWithRect : Invalid region messages in the console. I'm not s...

How to install s3sync

This seems like an excellent script but lacks a key part to its installation I can't seem to figure out. Maybe someone out there can help a newb. What I've done so far : Installed the s3sync package. Downloaded the s3 certificate Downloaded the s3 ssl package ran it with sh ssh.certs.shar Edited the s3conf.yml file to have the correc...

Is there a pattern to synchronize data lists over network?

I've got a server app that offers data to a number of clients over network. You can imagine the data as a huge list of strings. The data on the server may change and need to be synchronized on all clients. I'm currently using this approach: On initial connection, a client app requests all current data (which may be a lot of bytes). Then...

Question on threads

I am just playing around with threads in java. I have a class which implements runnable. public class MyThread implements Runnable{ private boolean finished; //Other variables public void run(){ //Thread code } } My understanding is that each thread of type MyThread will have its own copy of member variables and wr...

Speech-Over PDF?

I'd like to add speech-over/narration to a PDF document. So a sentence is highlighted (background color or text color changes) and the synced audio (not a computer voice but a recorded audio clip) plays. How do I do it? Are there readymade software available (on mac preferably) to achieve this? I'd appreciate any help. Thanks ...

Can a shared resource safely be used as the lock for a synchrnized block?

I often find myself with code like private static final MyType sharedResource = MyType(); private static final Object lock = new Object(); ... synchronized(lock) { //do stuff with sharedResource } Is this really neccessary or could sharedResource be used as the lock itself like private static final MyType sharedResource = MyType(...

Questions about HTML5 audio

<audio src="http://upload.wikimedia.org/wikipedia/commons/8/82/Riddle_song.ogg"&gt;&lt;/audio&gt; <ul id="lyrics"> <li>line 1</li> <li>line 2</li> <li>line 3</li> <li>and so on...</li> </ul><!-- end #lyrics --> So I want to: Highlight (change color or background) of the line that is being played. Save current time to...

how to code thread synchronization using any method - eg ..Cevent

hello there I am trying to code a simple application which would help me in reading from a serial port and write to the same serial port using a single thread ...so could someone please help me to manage the synchronization between the threads.heres the source code- the whole project file in Visual studio 6 - http://rapidshare.com/files/...

Do I need to protect this variable with a lock?

Hi all, so I have a boolean type in C++ on a multiprocessor machine. The variable starts out life as true, and then there are a few threads, any one or more of which might write it to be false. At the same time, these threads may also read this variable to check its state. I don't care if reading this variable is synchronized with any o...

two different synchronized methods of the same object?

Hi, I have 2 synchronized methods in a class say method1() and method2(). A thread say "Thread 1" holds the lock on that object of the class by executing the synchronized method1().Can another thread say "Thread 2" , access the lock via method2() at the same time while "Thread 1" holding the lock. This case is analogs to java.util.Vect...

Efficient Independent Synchronized Blocks?

I have a scenario where, at certain points in my program, a thread needs to update several shared data structures. Each data structure can be safely updated in parallel with any other data structure, but each data structure can only be updated by one thread at a time. The simple, naive way I've expressed this in my code is: synchroniz...

How to synchronize two runways so planes can land using java ?

Dear all, I seem to have a small problem. I have an Air Traffic Control Application, with two runways which I am to synchronize in java. This is to be done because, if there is a plane two that lands while plane one is in the process of landing, it(plane two) does not have to wait but can quickly move to the runway two to land. I have ...

How to make two planes land in two different synchronized runways in java ?

In my Air traffic Control application, I am trying to land two planes in two different runways. I have done synchronizing of 2 runways, sadly only one plane lands when I added about 3-4 planes. The order I should get is(I got this after synchronizing one runway): Order I got after synchronizing two runways(2 objects of the runway cla...

How can I wait until a Windows process, and its subprocesses, have all exited?

We have a launcher app that does some setup (starting a server), launches a child process, waits (via a worker thread) for the child process to exit, and then does some cleanup (stopping the server). This is already in place and works fine. However, some of our apps can launch other apps. So for example, the launcher might start app A, ...

Limit the field that are syncronized

Hi I'm building an application that runs on a Windows Mobile device. I'm using Microsoft's Sync Framework to sync the Sql CE database with the main corporate db. The question is how can I limit the fields that are syncronized? The table in question has stacks of fields but I only need to display a few of them on the mobile device and ...

Syncrhonizing 2 database with different schemas

Hi guys, We have a normalized SQL Server 2008 database designed using generic tables. So, instead of having a separate table for each entity (e.g. Products, Orders, OrderItems, etc), we have generic tables (Entities, Instances, Relationships, Attributes, etc). We have decided to have a separate denormalized database for quick retrieva...