The online racing simulator
Searching in All forums
(677 results)
traxxion
S2 licensed
Try declaring bool OfficerOn, etc. at the very top of your function, outside any if, else or foreach statements.
traxxion
S2 licensed
Quote from Bawbag :Well if you are me then we are both alien fast then right, right?

Deal.
traxxion
S2 licensed
Quote from Bawbag :The last two posts were me btw, on my 2nd and 3rd account.

Liar! You are actually me, so that makes me alien-like fast then, right, right?

Edit: seriously though, not sure where Sherlock got that knowledge from but I would sincerely like to hear his suggestion for the second account of mr. Nieminen.
traxxion
S2 licensed
Quote from AMB :is that the guy from first, J.Niemen or something? if so he's not new that's his second account.

kthxbai

Hahaha, excuse me?
traxxion
S2 licensed
Quote from traxxion :YouTube version to follow, uploading as we speak

http://www.youtube.com/watch?v=8-EBWvsAhao&fmt=6

Trying to find the limit of the car, slowly improving every time, and some hairy moments with other cars on track (that Porsche @3:46 was only centimeters away..!).
traxxion
S2 licensed
Not sure if this belongs here, but I made a quick compilation of some onboard footage during one stint on the track day on Zandvoort last wednesday.. Second day out with the 205 Mi16... what a blast!

Downloadable here [640x480 - 5:54 min - ~128 Mb]

YouTube version to follow, uploading as we speak
traxxion
S2 licensed
Quote from BenjiMC :keep yer trousers on, i never said he was crap/slow. i just said it looks painful to be alonsos front tyres.

Where in my post do I mention you?
traxxion
S2 licensed
Quote from MrRoper :The code isnt that hard for the comparer,

Im happy to knock one up for you at the weekend if you like?

Thanks for the offer man Have to say I normally want to give it a try myself first, but a good example would actually be great in this case. I'll send you my Class via pm.
traxxion
S2 licensed
Quote from MrRoper :does that make any sense???

It makes perfect sense actually, thanks for that!

The biggest difficulty will be to make an algorythm for the comparison though.. That's not gonna be today or the upcoming 10 days.. but I will definitely look into this, soon as I'm back from holidays.

Thanks again!

:surfing:
traxxion
S2 licensed
Quote from MrRoper :are you happy with what an interface is?

I've heard of the word, but my theoretical knowledge of C# is nigh to zero. I usually only dive into the theory when I get stuck with my existing knowledge (like right now with the IComparer). BurnOut69 keeps telling me I have to read my C# bible though
Last edited by traxxion, .
traxxion
S2 licensed
Yeah I figured the word IComparer would come up quite a lot here. Unfortunately I haven't really got my head around that yet.. Seems like I will have to asap though!

Thanks for pointing me in the right direction guys
traxxion
S2 licensed
Quote from xaotik :Dirtiest way ever? Concatenate the name and age and then compare.

Hahaha great stuff, that'll do on my last day before holidays!

I do hope that in the mean time someone else will find a less dirty way!

Thanks a lot xaotik!!
Last edited by traxxion, .
C# Sorting Lists help
traxxion
S2 licensed
Hi

Been struggling to solve this for quite a long time now.. Nowhere on the internet can I find a solution for this.

Please find below a hypothetical example of what I have..
I'm sorting a List<> of "Persons" (consists of name, age and city). This is no problem whatsoever for sorting actions that sort only 1 parameter at a time. Example:


[COLOR=#0000ff][COLOR=#0000ff]public [/COLOR][/COLOR][COLOR=#0000ff][COLOR=#0000ff]class [/COLOR][/COLOR][COLOR=#2b91af][COLOR=#2b91af]Person[/COLOR]
[/COLOR]{
[COLOR=#0000ff][COLOR=#0000ff] public [/COLOR][/COLOR][COLOR=#0000ff][COLOR=#0000ff]int[/COLOR][/COLOR] age;
[COLOR=#0000ff][COLOR=#0000ff] public [/COLOR][/COLOR][COLOR=#0000ff][COLOR=#0000ff]string[/COLOR][/COLOR] name;
[COLOR=#0000ff][COLOR=#0000ff] public [/COLOR][/COLOR][COLOR=#0000ff][COLOR=#0000ff]string[/COLOR][/COLOR] city;

[COLOR=#0000ff][COLOR=#0000ff] public[/COLOR][/COLOR] Person([COLOR=#0000ff][COLOR=#0000ff]int[/COLOR][/COLOR] age, [COLOR=#0000ff][COLOR=#0000ff]string[/COLOR][/COLOR] name, [COLOR=#0000ff][COLOR=#0000ff]string[/COLOR][/COLOR] city)
{
[COLOR=#0000ff][COLOR=#0000ff] this[/COLOR][/COLOR].age = age;
[COLOR=#0000ff][COLOR=#0000ff] this[/COLOR][/COLOR].name = name;
[COLOR=#0000ff][COLOR=#0000ff] this[/COLOR][/COLOR].city = city;
}
}

[COLOR=#0000ff][COLOR=#0000ff]static [/COLOR][/COLOR][COLOR=#0000ff][COLOR=#0000ff]void[/COLOR][/COLOR] Main([COLOR=#0000ff][COLOR=#0000ff]string[/COLOR][/COLOR][] args)
{
[COLOR=#2b91af][COLOR=#2b91af]List[/COLOR][/COLOR]<[COLOR=#2b91af][COLOR=#2b91af]Person[/COLOR][/COLOR]> lstPersons = [COLOR=#0000ff][COLOR=#0000ff]new[/COLOR][/COLOR][COLOR=#2b91af][COLOR=#2b91af]List[/COLOR][/COLOR]<[COLOR=#2b91af][COLOR=#2b91af]Person[/COLOR][/COLOR]>();
lstPersons.Add([COLOR=#0000ff][COLOR=#0000ff]new [/COLOR][/COLOR][COLOR=#2b91af][COLOR=#2b91af]Person[/COLOR][/COLOR](37, [COLOR=#a31515][COLOR=#a31515]"Peter"[/COLOR][/COLOR], [COLOR=#a31515][COLOR=#a31515]"Amsterdam"[/COLOR][/COLOR]));
lstPersons.Add([COLOR=#0000ff][COLOR=#0000ff]new [/COLOR][/COLOR][COLOR=#2b91af][COLOR=#2b91af]Person[/COLOR][/COLOR](24, [COLOR=#a31515][COLOR=#a31515]"René"[/COLOR][/COLOR], [COLOR=#a31515][COLOR=#a31515]"Den Bosch"[/COLOR][/COLOR]));
lstPersons.Add([COLOR=#0000ff][COLOR=#0000ff]new [/COLOR][/COLOR][COLOR=#2b91af][COLOR=#2b91af]Person[/COLOR][/COLOR](41, [COLOR=#a31515][COLOR=#a31515]"Albert"[/COLOR][/COLOR], [COLOR=#a31515][COLOR=#a31515]"Paris"[/COLOR][/COLOR]));
lstPersons.Add([COLOR=#0000ff][COLOR=#0000ff]new [/COLOR][/COLOR][COLOR=#2b91af][COLOR=#2b91af]Person[/COLOR][/COLOR](35, [COLOR=#a31515][COLOR=#a31515]"Albert"[/COLOR][/COLOR], [COLOR=#a31515][COLOR=#a31515]"Paris"[/COLOR][/COLOR]));

[COLOR=#2b91af][COLOR=#2b91af]Console[/COLOR][/COLOR].WriteLine([COLOR=#a31515][COLOR=#a31515]"Sorting by age"[/COLOR][/COLOR]);
lstPersons.Sort([COLOR=#0000ff][COLOR=#0000ff]delegate[/COLOR][/COLOR]([COLOR=#2b91af][COLOR=#2b91af]Person[/COLOR][/COLOR] p1, [COLOR=#2b91af][COLOR=#2b91af]Person[/COLOR][/COLOR] p2) { [COLOR=#0000ff][COLOR=#0000ff]return[/COLOR][/COLOR] p1.age.CompareTo(p2.age); });
[COLOR=#0000ff][COLOR=#0000ff]foreach[/COLOR][/COLOR] ([COLOR=#2b91af][COLOR=#2b91af]Person[/COLOR][/COLOR] p [COLOR=#0000ff][COLOR=#0000ff]in[/COLOR][/COLOR] lstPersons)
[COLOR=#2b91af][COLOR=#2b91af]Console[/COLOR][/COLOR].WriteLine([COLOR=#a31515][COLOR=#a31515]"Name: {0} - Age: {1} - City: {2}"[/COLOR][/COLOR], p.name, p.age, p.city);

[COLOR=#008000][COLOR=#008000]/* OUTPUT:[/COLOR]
[COLOR=#008000]* Sorting by name[/COLOR]
[COLOR=#008000]Name: René - Age: 24 - City: Den Bosch[/COLOR]
[COLOR=#008000]Name: Albert - Age: 35 - City: Paris[/COLOR]
[COLOR=#008000]Name: Peter - Age: 37 - City: Amsterdam[/COLOR]
[COLOR=#008000]Name: Albert - Age: 41 - City: Paris[/COLOR]
[COLOR=#008000]* */[/COLOR]
[/COLOR]
[COLOR=#2b91af][COLOR=#2b91af]Console[/COLOR][/COLOR].WriteLine([COLOR=#2b91af][COLOR=#2b91af]Environment[/COLOR][/COLOR].NewLine);
[COLOR=#2b91af][COLOR=#2b91af]Console[/COLOR][/COLOR].WriteLine([COLOR=#a31515][COLOR=#a31515]"Sorting by name"[/COLOR][/COLOR]);
lstPersons.Sort([COLOR=#0000ff][COLOR=#0000ff]delegate[/COLOR][/COLOR]([COLOR=#2b91af][COLOR=#2b91af]Person[/COLOR][/COLOR] p1, [COLOR=#2b91af][COLOR=#2b91af]Person[/COLOR][/COLOR] p2) { [COLOR=#0000ff][COLOR=#0000ff]return[/COLOR][/COLOR] p1.name.CompareTo(p2.name); });
[COLOR=#0000ff][COLOR=#0000ff]foreach[/COLOR][/COLOR] ([COLOR=#2b91af][COLOR=#2b91af]Person[/COLOR][/COLOR] p [COLOR=#0000ff][COLOR=#0000ff]in[/COLOR][/COLOR] lstPersons)
[COLOR=#2b91af][COLOR=#2b91af]Console[/COLOR][/COLOR].WriteLine([COLOR=#a31515][COLOR=#a31515]"Name: {0} - Age: {1} - City: {2}"[/COLOR][/COLOR], p.name, p.age, p.city);

[COLOR=#008000][COLOR=#008000]/* OUTPUT:[/COLOR]
[COLOR=#008000]* Sorting by age[/COLOR]
[COLOR=#008000][COLOR=#008000][COLOR=#008000]Name: Albert - Age: 41 - City: Paris[/COLOR]
[COLOR=#008000]Name: Albert - Age: 35 - City: Paris[/COLOR]
[COLOR=#008000]Name: Peter - Age: 37 - City: Amsterdam[/COLOR]
[COLOR=#008000]Name: René - Age: 24 - City: Den Bosch[/COLOR]
[/COLOR]* */
[/COLOR][/COLOR]
[COLOR=#008000]
[/COLOR][COLOR=#2b91af][COLOR=#2b91af] Console[/COLOR][/COLOR].ReadLine();
}


Now what I'm looking for is an output like this:


[COLOR=#008000][COLOR=#008000] /* OUTPUT SHOULD BE:[/COLOR]
[COLOR=#008000] * Sort by name, then by age[/COLOR]
[COLOR=#008000] Name: Albert - Age: 35 - City: Paris [/COLOR]
[COLOR=#008000] Name: Albert - Age: 41 - City: Paris[/COLOR]
[COLOR=#008000] Name: Peter - Age: 37 - City: Amsterdam[/COLOR]
[COLOR=#008000] Name: René - Age: 24 - City: Den Bosch[/COLOR]
[COLOR=#008000] * */[/COLOR]
[/COLOR]

So sort the list by name first, and after that sort the already sorted list with a second parameter age. In this example that means that Albert with the age of 35 comes first, over Albert with the age of 41.

Doing this:

[SIZE=2] lstPersons.Sort([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]delegate[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Person[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] p1, [/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Person[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] p2) { [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] p1.name.CompareTo(p2.name); });
lstPersons.Sort([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]delegate[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Person[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] p1, [/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Person[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] p2) { [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] p1.age.CompareTo(p2.age); });
[/SIZE][COLOR=#008000][/COLOR]

(obviously) results in the same list as the one sorted by age only.


Does anybody have any idea how I can achieve this?

Thanks in advance,

René
traxxion
S2 licensed
Pffft, like Alonso or not.. that video displays superb driving qualities. What the **** does it matter if it looks strange? Obviously it was the fastest way around the track at that point...!!

I've never been an Alonso fan, but some comments in this thread "border on ridiculous".

Edit: on-topic I hope Ferrari is able to strike back this weekend otherwise I very much doubt they will be able to stop Lewis this year!
Last edited by traxxion, .
traxxion
S2 licensed
Quote from duke_toaster :i Don't Think Your Threads Are Really Spam, Lerts - They Are All Correctly Filed And Provoke Discussion Which Is Interesting.

+1.
traxxion
S2 licensed
Quote from xaotik :That's just a theatrical re-enactment of the incident - in the actual thing he had hair.

:ices_rofl Made me laugh even more!
traxxion
S2 licensed
Wowch... now that's sad..!

As for Ray, when I started LFS Cyber was the team to beat. I've always looked up against your drivers and manager and learnt a lot from both. I remember when we did our first MoE race, Petri was the first to help a noob team out with strategy planning and other tips. So, however strange this might sound coming from me, I will miss the races that you set the benchmark for all other teams to achieve. I will miss your skins and website and I hope not all of your drivers will be lost for LFS.

Good luck to all of you
traxxion
S2 licensed
Quote from Mustafur :If Hamilton hasn't impressed then idk who has imo.

Agreed.


Hamilton, Kubica and Vettel for me. But if I had to choose one it's Vettel: kicking Bourdais' ass hard, and even makes it hard for the two RBR drivers (Coulthard who?). Born winner!
traxxion
S2 licensed
Quote from Cawwa :Looks: cute ...

Very, indeed!

Congrats Grandpa Holmberg!
traxxion
S2 licensed
Quote from Greenseed :I had to add a "try,catch" on the string conversion! apparentely is the way to check if a string is from a certain numeric type!



private bool isNumeric(string val, System.Globalization.NumberStyles NumberStyle)
{
Double result;
System.Globalization.CultureInfo c = new System.Globalization.CultureInfo("en-US");
c.NumberFormat.CurrencyDecimalSeparator = ".";
return Double.TryParse(val, NumberStyle, c, out result);
}

Try that?
traxxion
S2 licensed
Happy birthday spdo
traxxion
S2 licensed
Yesterday's final was nothing compared to today's, what an awesome fight between Barredo and Burghardt!
traxxion
S2 licensed
Quote from Spangler_CZE :Anybody knows the music name ? Sounds pretty good

Feeder - Buck Rogers

Nice video Steven! And congrats with the 5 year anniversary PM!
traxxion
S2 licensed
Quote from New Balance 2 :Hey LFS players,

I enjoy playing LFS Alpha X demo. Now I have decided to make my own dedicated server. Does anybody know where i can download lfs dedicated server for alpha x DEMO?

Composed with a bit of creativity: http://www.lfs.net/file_lfs.php?name=LFS_S2_DEDI_X.zip
Hope it works
FGED GREDG RDFGDR GSFDG