I have 4 sessions captured with Fiddler. I want to automatically replay these sessions every half hour. I apologize for the broad question, but is there a way to accomplish this through scripting? I'm not sure which function(s) should look at editing.
Thanks.
Related
My understanding is that a non-maskable interrupt enforces context switching (which causes a process to be moved from CPU to ready queue). If the interrupt happens at a time when the process is executing its critical section, it may make the output indeterministic. One solution is to roll back to the state when the process entered the critical section, but I don't know if that is possible. Please help clarify this. Thanks in advance!
If there would be a way that roll back would happen, I honestly do not know.
Yes, there is ways of doing so by software of course, the developer could implement guards in his/her code to check if there is an anomaly if so they are will repeat the process again to avoid the corrupted data.
I have a multiplayer project which has some forever loops with checking code inside of them.
The problem is, multiple computers might process this and change crabx or craby due to lag in the variables dvotes, uvotes, lvotes, or rvotes. Only one machine should change this, though.
This can be easily solved by giving each player an ID like many people do in SQL. I would just check if the ID is 1, and that would be the "operating machine". I would then do all of these checks on that one machine. It would do things a Scratch server would do if you could program it...
The problem with this is that there is no way to detect when a player leaves the game. There is no block that is called "on exit" or "on stop button pressed". How would I go about doing this? I have seen people have a button which people click to exit, but some people will not click it/not even see it.
Thanks in advance!
Option 1
I've never been especially successful with cloud data myself, but I've heard the theory on this before:
Essentially, each player gets a "counter". Their computer then constantly increases that counter. If the counter ever stops increasing (which will be detected by the other computers, who are all looking after one another), the project will know that the user has left and one of the computers will take care of removing their ID and other data.
Obviously, this is much easier said than done. (As I said, I've never gotten complex cloud data to work well for myself, but I've seen it done successfully and explained.)
Option 2
Alternatively, you might be better off taking advantage of this cloud api created by MegaApuTurkUltra. I find that stealing from others tends to be the best way of solving problems when it comes to code. ;)
I've been doing some tests recently with an app switching between networks (Wi-fi, 3G, LTE, offline). I've been using Reachability when detecting this switches, but I'm not currently happy with the implementation when the app goes in an "offline state" for example.
I'm basically just throwing NSLogs currently when the no-network kicks in, but I've seen it go off in between switches. So my question... how do you best manage these things? Do you give it a delay in after no-network of a few seconds before going into "offline state"? Or are there other ways to improve this?
Big issue when streaming audio.. I wouldn't want to go into this offline state when is just a simple network switch or small connection loss. One of the things I would do is to wait for the buffer to be empty before changing states.
Yes, just check twice. Using your example, when you get the "offline" notification, you flip a flag (BOOL claimingOffline). Then when your buffer empties you check the status. If back online, you unflip the afore mentioned flag. If still offline, you flip the flag and go into "offline mode". This technique allows you to wait until the moment you really need to know (when the buffer empties). Otherwise you could use a timer, but it's suboptimal and not nearly as elegant...
I am trying to figure out how to use a background thread to execute a command ever 4hrs.
I have never created anything like this before so have only been reading about it so far.. One of the things I have read are this
"Threads tie up physical memory and critical system resources"
So in that case would it be a bad idead to have this thread that checkes the time then executes my method... or is there a better option, I have read about GCD (Grand Central Dispatch) but I am not sure if this is applicable as I think its more for concurrent requests? not something that repeats over and over again checking the time..
Or finally is there something I have completely missed where you can execute a request every 4hrs?
Any help would be greatly appreciated.
There is a max time background processes are allowed to run (10 min) which would make your approach difficult. Your next best attempt is to calculate the next event as save the times tamp somewhere. Then if the app is executed at or after that event it can carry out whatever action you want.
This might help:
http://www.audacious-software.com/2011/01/ios-background-processing-limits/
I think that it would be good to make use of a time stamp and post a notification for when the time reaches for hours from now.
Multithreading is not a good means to do this because essentially you would be running a loop for four hours eating clock cycles. Thanks to the magic of operating systems this would not eat up an entire core or anything silly like that however it would be continuously computed if it was allowed to run. This would be a vast waste of resources so it is not allowed. GCD was not really meant for this kind of thing. It was meant to allow for concurrency to smooth out UI interaction as well as complete tasks more efficiently, a 4hr loop would be inefficent. Think of concurrency as a tool for something like being able to interact with a table while its content is being loaded or changed. GCD blocks make this very easy when used correctly. GCD and other multithreading abilities give tools to do calculations in the background as well as interact with databases and deal with requests without ever affecting the users experience. Many people whom are much smarter then me have written exstensively on what multithreading/multitasking is and what it is good for. In a way posting a message for a time would be method of multitasking without the nastiness of constantly executing blocks through GCD to wait for the 4 hr time period, however it is possible to do this. You could execute a block that monitored for time less then the max length of a threads lifetime then when the threads execution is over dispatch it again until the desired time is achieved. This is a bad way of doing this. Post a notification to the notification center, its easy and will accomplish your goal without having to deal with the complexity of multithreading yourself.
You can post a notification request observing for a time change and it will return its note, however this requires you application be active or in the background. I can not guarantee the OS wont kill your application however if it is nice and quiet with a small memory footprint in "background" state its notification center request will remain active and function as intended.
I have been working at entering and sustaining periods of flow while working, and while researching the concept I came across this site which addressed the idea of sustaining flow in short bursts. The technique specifies that one sets a timer for 48 minutes in which they focus purely on their work, and when the timer runs out they spend 12 minutes doing whatever.
However, in the paragraph directly above that statement is a quote from Peopleware saying that it takes at least 15 uninterrupted minutes to enter a state of flow.
When reading that point, the 48 minute technique seemed counter-intuitive, since every 48 minutes you are "breaking" your flow, and once you start up again you have to spend 15 minutes going back into it, so you really only get (at a maximum) 33 minutes of "flow time". Obviously these quantities aren't necessarily rigid, but you get the idea.
My question is to those who have tried a timing technique similar to the one described. As I see it, the only justification for this technique is that it possibly reduces the amount of time it takes to re-enter that period of flow. Can anyone who has used this technique provide some clarification?
I've tried the Pomodoro Technique for a week or so. I didn't focus too much on the details of maintaining check lists of completed and interrupted sprints, but rather I started the day with the tasks that I wanted to do on that day, and went through them as best as I could using the 25-minute sprints and five-minute breaks.
The Pomodoro Technique suggests to use the breaks to relax, stretch your legs, grab a coffee, etc. I've noticed that activities like those that don't require a total focus shift and can be done on automatic don't break the flow, but rather helped me cleanse my mind and refocus my attention. It's as if you're allowing yourself to step away from the trees to survey the forest for a bit before diving back in.
I dropped Pomodoro after that short trial period because I found that in my case I got the most benefit from simply sitting down in the morning and writing down what I wanted to do on that day. Once the decision is made and the work is started I found that I fall into a natural rhythm of sorts. I work until I'm bored, frustrated, or interrupted, then I take a break and continue. I didn't find that time boxing my sprints added much value.
YMMV, but it's worth at least giving it a try.
A timer would be terrible for me, because it might go off and interrupt my train of thought at a critical moment.
For me, maximizing flow would begin by (1) first preventing forthcoming distractions (ie, making sure phone calls and other interrupts are disabled and that anything scheduled, like a meeting, is sufficiently far off there's no possibility of running into it), then (2) working on the problem at hand as long as I can, but all the while trying to recognize when I'm not making progress.
If I think I'm making progress, no matter how slowly, I just keep going as long as I can. But if I appear to be stuck or going in circles, I stop, and do something else instead, even if that something else is starting on a different problem. I let my subconscious dwell on the original problem, and once I have a feeling I feel fresh or curious enough to restart again, I do.