Not really, because two times is statistically insignificant, but a thousand is a pretty reasonable number. That's about the same number of people they ask in government polling.
It's actually pretty hard to place a cap on an oil-well that's 18 inches in diameter and a mile underwater. Of course this is only temporary, we'll see how the relief well pans out.
Well I guess, but given how many web servers there are in the world, a 3% difference still tallies to tens of millions of servers, so not really that close. What's probably more interesting is how far behind everyone else seems to be...
An option would be to create some sort of browser applet (Flash, Silverlight, Java etc..) and use that to upload the data to your site. This way you could vastly reduce the amount of data that gets transferred, also you offload the actual parsing of the replay to the users computer.
A few weeks ago I would have said that Hulk was the best, just because they have all been pretty unspectacular, but in the last couple of races Kobayashi has been solid and has scored some decent points, so my vote goes to him.
Hmm, is that true? I thought a set was between O(1) and O(n) in performance. It's not O(n) as there is not a 1 to 1 relation between the performance and the number of items, but because of the hashing process it's not actually O(1) either. Ah, I dunno. Well anyway, yeah a set will probably be faster in .NET, I wouldn't be able to say for sure without doing some performance tests. A generic list is plenty fast enough for this operation though and I've rarely ever seen a set used in .NET code.
I'm really not sure what your code is doing, but if I was going to make a swear filter, I'd do something like this.
Presuming you have a file called "swear.txt" in the same folder as your program's exe file that has a banned word on each line:
boobs willy knickers thatcher
First of all I would load that file into memory when the programs starts, with some simple code like this:
// List to store swear words. List<string> swearwords = new List<string>();
void LoadSwearWords() { // Get the path to the 'swear.txt' file. string file = Path.Combine(Environment.CurrentDirectory, "swear.txt");
// Open text file for reading. using (TextReader reader = new StreamReader(file)) { // Loop through each line in the file. string line; while ((line = reader.ReadLine()) != null) { // Remove any whitespace and cast to lower case. string word = line.Trim().ToLower();
// Add to list in memory. this.swearwords.Add(word); } } }
Once I had the list of swear words in memory, I would then need some code to check if a message contained a swear word.
bool MessageContainsSwearWord(string message) { // This regex splits words, trims whitespace and removes punctuation. string[] words = Regex.Split(message, @"\W+");
// Loop through each word and check if it's a swear word. foreach (string word in words) { if (this.swearwords.Contains(word.ToLower())) { return true; } } return false; }
The MessageContainsSwearWord method returns true if the message contains a swearword or false otherwise. You could use it like this:
string message = "This message contains the word boobs";
if (MessageContainsSwearWord(message)) { Console.WriteLine("That message is filthy!"); } else { Console.WriteLine("Aww, what a well-spoken boy."); }
// OUTPUT: That message is filthy!
I hope that helps!
You can download my test project below (requires VS Express 2010).
Yes, I agree. Sending the password as plain-text in an email is crazy. And that fact they encrypt passwords on the backend is not a selling point, it's basic web development 101.
Also what is the point in asking people to answer several confusing "are you a spambot" questions and when you have a CAPTCHA on the signup form anyway? Just get a CAPTCHA that actually works... reCAPTCHA is very secure for several reasons (basically because the words it asks you to transcribe are words it's been found almost impossible for an OCR program to decipher).
Hmm... so time, money and hassle are more important than a life? Nice philosophy you have there. If the police can resolve this peacefully then they should.
Basically a crazy guy who shot his ex-girlfriend, her boyfriend and a policeman. He's been hiding rough in the countryside for the last week. Apparently he's been encircled by armed-police who are trying to talk him out of shooting himself. It's all very dramatic and the TV coverage is bizarre.
I do have to say that in terms of driving, I fail to see how bringing in someone new will help them finish races, as they'll have to spend several races showing another rookie the ropes. Maybe it's a money thing...
Actually it would be quite fun to add a packets per second readout to InSimSniffer, as I have no idea if your figure is correct.
Edit: With everything on max I got up to 40 packets per second before InSimSniffer caused LFS to throw a WSAEWOULDBLOCK error (known issue with LFS in TCP mode), but that was a full 32 player race with the MCI interval at 50ms.
Without MCI packets turned on the average is about 3-4 packets per second.
Yeah, I get you. The reflection code is really only useful for debugging and diagnostic purposes, it probably shouldn't be used (or needed) in production code. That being said, it's not that slow, InSimSniffer uses this type of reflection and it runs pretty fast.
Yeah true, but with IIS being the second most popular server after Apache, it's nice to finally have a free version. Also the new ASP.NET MVC platform is very nice, so it's a solid combination.
I've been messing around with getting Spark to work as a WCF web service, so you can run it from a web site. I've not written anything like this before, so it's a bit of a learning curve, but I'm making slow progress. With Spark as a web service you could build Silverlight applications and lots of other things. Happily it seems that Spark is flexible enough that it won't require any changes to the core library, all I need to do is to create a WCF web service that relays the InSim data to a client, and then create a new Spark.ISocket derived class that, instead of wrapping a TCP socket, wraps the web service EndPoint instead. Then it will be easy to create Flash-style InSim apps using Silverlight and run Spark from an ASP.NET web site.