Nah, this is wrong. It's 21 years then assessed every five years after that. They have the power to never release him if he still poses a thread to society. I've seen this reported in a few places today, but it's misleading.
You can also write a small .NET app to manage/restart your PRISM program. You can do a lot of process management stuff on Windows with .NET, such as redirect PHP errors to your .NET app for logging. Check the Process docs.
using System.Diagnostics;
class Program { static void Main() { string path = @"X:\Path\To\PRISM.bat";
while (true) { using (Process prism = Process.Start(path)) { prism.WaitForExit(); } } } }
On BBC F1 Brundle said he spoke to Webber, and it's the changes Pirelli have made to make the tyres more durable that are really suiting him. He said, "it's playing right into my hands."
Edit: Apparently Pirelli have been getting a lot of flack from their competitors about how they can't make a tyre that lasts, which any real F1 fan knows is complete bullshit.
I don't mind helping with troublesome code, so don't be afraid to PM me. I do try to answer them, especially if I know the answer to the question (which frankly isn't often).
This is an example of the sort of PM that I'm talking about, that I got a few days ago (out of the blue).
I ignored this.
If you have a genuine programming problem that can't be solved by reading a basic programming tutorial then I'm happy to help, although I'd prefer it if you asked in one of my many programming threads instead of messaging me directly.
To sum up: please don't worry about sending me a PM, I'm happy to get them, all I ask is that you send me an answerable question. If you do I'll try my best to answer it. And if I don't you can always ask on StackOverflow, which is better than me anyway.
I don't get 'spam', but I do get a lot of 'pls can u sent me teh codez', as well a few 'pls skype me'. I hate PMs, people should just post in the threads, that way everyone gets to benefit from my banal nonsensical warblings. I do ignore a lot of PMs, some because I can't be bothered answering, others because I forget to.
I was thinking of creating a new project called InSim.NET Contrib, where people could contribute helper classes to the library. I would first of all move the current helper classes to the new project, then let other people join as contributors, so they could add their own extensions.
Often people need to reuse a lot of the same code over and over in their programs, such as connection managers and button managers, but at the same time this sort of code doesn't belong in the library itself. By creating a contrib lib it would allow people to contribute commonly used helpers, plus pick and choose which helpers they wanted, all without messing with the integrity of the base library. It would also mean that people would all be using the same 'best possible' versions of the code they need, instead of having to write it again from scratch each time.
A good example of a similar project is ASP.NET MVC Contrib, that adds tonnes of extra functionality to Microsoft's excellent Web toolkit. Anyway it was just an idea, and would require input from other programmers, but I think it would be nice to be able to add lots of high-level helper classes without having to mess with the library itself.
Let me know if anyone would be interested in this, as there is no point me doing it if I'm the only person who cares.
On a separate note, there is a new free disassembler from Telerik called JustDecompile. It's a nice alternative to Reflector, which is no longer free. I've been using it quite a bit recently and it's quite good.
It's not about OOP, or any one technology, it's just about sharing the knowledge. It's also not about teaching people to program. All I'm suggesting is that people read the programming section on the wiki and edit anything they feel is appropriate.
Imma let you finish, but first I'm gonna bump this thread. I made a start on rewriting the Wiki a couple of years ago, but we still need people to add and edit pages. I've updated some stuff for LFS 0.6B, but a lot remains incomplete. The Wiki rewrite was predicated on the idea that 'if you build it they will come', however very few people have come yet.
The great thing about the Wiki is that it canonises our knowledge in a single place, and makes it much easier for new programmers to get up and running quickly. Back when I first located InSim.txt I had no idea what any of it meant and I had to work out how to write InSim apps myself by trial and error. It would be great if there was a comprehensive resource available that would prevent people from having to go through the same pain that I did.
So if you are an InSim programmer with a passing knowledge of how all this stuff works, it would be cool if you could edit or even add a page.
They've released a new update for this. It's actually getting quite good, although the autocomplete still isn't perfect and it still has one or two bugs. I might move development of pyinsim from Eclipse PyDev to Visual Studio now, as I can keep all my projects together and I really like the Visual Studio Mercurial plugin. The Mercurial plugin for Eclipse is so confusing I can't understand how to use it.
You can also use InSim.NET with Mono, which is supported on Mac. Although I've not personally tested it on a Mac, I have tested it on Mono for Windows and Ubuntu, and it seems to work fine.
Edit: and of course pyinsim and Python are cross-platform.
You can look at the packet receive code that InSim.NET uses, which is in the TcpSocket class. Undoubtably not perfect, but it seems to work pretty well. Of course it deals with multiple packets and split packets etc.. If you have any improvement suggestions I'm happy to hear them.
This is the simplest receive loop I can think of. Obviously not the most efficient code, but it makes it easy to see all the parts working.
<?php // Store buffer in generic list. List<byte> buffer = new List<byte>();
// Temp array to store received data. byte[] temp = new byte[2048]; // Receive up to 2kb of data at a time.
while (true) { // Receive data from socket. int received = socket.Receive(temp);
// Nothing received means connection dropped. if (received == 0){ throw new Exception("lost connection"); }
// Append received data to buffer. buffer.AddRange(temp.Take(received));
// Loop through each completed packet in the buffer. The first byte in // the buffer is the size of the first packet. while (buffer.Any() && buffer.Count >= buffer.First()) { int size = buffer.First();
// Check packet is multiple of 4. if (size % 4 > 0){ throw new Exception("corrupt packet"); }
// Read first packet from buffer and remove it. byte[] packet = buffer.Take(size).ToArray(); buffer.RemoveRange(0, size);
// Do something with the packet. // HandlePacket(packet); } } ?>
Edit: It should be noted as well, as many InSim devs seem to forget this, that when sending packets you also need to pay attention to how many bytes are sent. The send function returns the number of bytes transferred, and if this is less than the size of the packet you need to resend any data that was omitted. This is simple however.
<?php byte[] buffer = GetPacketToSend();
// Keep looping while there is unsent data. int sent = 0; do { sent += socket.Send(buffer, sent, buffer.Length - sent); } while (sent < buffer.Length); ?>
Button is only 31, even if he retires at 38 or 39, which seems about the normal age for a successful F1 driver, he's still got seven or eight seasons left.
I think, far worse than globals, is when someone forces an OPP construct into a place where a global would have done. The main problem with OOP is the idea that everything should be encapsulated in an object. Sometimes globals just make the code simpler.