• What are you working on? v15
    5,001 replies, posted
Hey, [QUOTE=CarlBooth;27730651]He didn't even use switch, it was a shit load of else if statements for each one of the grapher commands.[/QUOTE] This sounds interesting, who is this guy? Is there some sort of background story? I'm curious because a little while ago I remember someone else posted an image of the same site (I think).
nullsquared.
Null was an extraordinary programmer... you could say he was special.
[QUOTE=CarlBooth;27730651]He didn't even use switch, it was a shit load of else if statements for each one of the grapher commands. [editline]0[/editline] Found it![/QUOTE] I thought I imagined that.
[QUOTE=limitofinf;27729464]Hey, Thank you. Please standby as I attempt to beat your challenge, or fail with grace. One final question: what hardware are you running your solution on? Times are, of course, relative to the hardware. [b]Edit:[/b] And another: what, exactly, are you timing? Are you timing loading the image? What about creating the solution image? What about locking the image data for processing? I think that to gain the best measuring conditions, we should only time the pathfinding itself. There will always be fluctuations in timing the image loading and such due to hard drive and image library differences.[/QUOTE] AMD Athlon 64 X2 6000+ (Windsor) 4GB DDR2-800 I'm only timing the pathfinding itself using [URL=http://msdn.microsoft.com/en-us/library/ms644904(v=vs.85).aspx]QueryPerformanceCounter[/URL], subtracting the start count from the end count and dividing by the frequency from [URL=http://msdn.microsoft.com/en-us/library/ms644905(v=vs.85).aspx]QueryPerformanceFrequency[/URL]. We should run the whole thing several times and calculate an average or something.
[QUOTE=CarlBooth;27730651]He didn't even use switch, it was a shit load of else if statements for each one of the grapher commands. [editline]0[/editline] Found it! [img_thumb]http://ahb.me/jsu[/img_thumb][/QUOTE] I dunno about C#, but in C++ you can't actually switch with anything other than basic types.
[QUOTE=Jallen;27731002]I dunno about C#, but in C++ you can't actually switch with anything other than basic types.[/QUOTE] I'm pretty sure that string is a basic type
[QUOTE=Jallen;27731002]I dunno about C#, but in C++ you can't actually switch with anything other than basic types.[/QUOTE] Did you miss the point entirely? You're not meant to use a switch either
He should've used some kind of map to decide where things go. Maybe him and Notch's boating code are just trolling us?
He was right about one thing though, you guys did "remember his name"
[QUOTE=SteveUK;27731045]Did you miss the point entirely? You're not meant to use a switch either[/QUOTE] I know what you mean, but I disagree with "You're not meant to use a switch either". There is no correct way to do it. If it works, it's maintainable and it's efficient, then there's no problem. Anyway I was responding to CarlBooth's post that said [quote]He didn't even use switch, it was a shit load of else if statements for each one of the grapher commands.[/quote]
[QUOTE=Liquid Helium;27731205]He was right about one thing though, you guys did "remember his name"[/QUOTE] Is that a bad thing? [QUOTE=Jallen;27731225]I know what you mean, but I disagree with "You're not meant to use a switch either". There is no correct way to do it. If it works, it's maintainable and it's efficient, then there's no problem. Anyway I was responding to CarlBooth's post that said[/QUOTE] It's not like a map would make it any less maintainable. And it can easily be made an amortized O(log n) vs O(n). A switch statement in C# with string works, also via a hashtable, thus O(log n) I think.
[QUOTE=Liquid Helium;27731205]He was right about one thing though, you guys did "remember his name"[/QUOTE] Despite him being a skilled programmer, it's ironic that we remember his name for his arguments etc. In fact that very comment where he said about people remembering his name is probably the biggest reason why everyone remembers him for having a big ego. [editline]29th January 2011[/editline] [QUOTE=ZeekyHBomb;27731288]Is that a bad thing? [B]It's not like a map would make it any less maintainable.[/B] And it can easily be made an amortized O(log n) vs O(n). A switch statement in C# with string works, also via a hashtable, thus O(log n) I think.[/QUOTE] Naw I'm not saying it would. There may be better ways to do it, but my point is that it isn't the programming crime that everyone is making it out to be.
[QUOTE=Liquid Helium;27731205]He was right about one thing though, you guys did "remember his name"[/QUOTE] He did the equivalent of somebody rage quitting CS:S after crying over mic chat. [editline]30th January 2011[/editline] [QUOTE=Jallen;27731302]Naw I'm not saying it would. There may be better ways to do it, but my point is that it isn't the programming crime that everyone is making it out to be.[/QUOTE] Look at this for a minute: [IMG]http://f.anyhub.net/jsu[/IMG] Now look at this: [cpp]if (str2 == "let") { this.OK(a, b); } else { type = typeMap[str2]; this.NK<type>(a, list, b); }[/cpp]
[QUOTE=Jookia;27731339]He did the equivalent of somebody rage quitting CS:S after crying over mic chat. [editline]30th January 2011[/editline] Look at this for a minute: [img_thumb]http://f.anyhub.net/jsu[/img_thumb] Now look at this: [cpp]if (str2 == "let") { this.OK(a, b); } else { type = typeMap[str2]; this.NK<type>(a, list, b); }[/cpp][/QUOTE] Dictionary<string, Action> is even more readable.
[QUOTE=PiXeN;27731482]Dictionary<string, Action> is even more readable.[/QUOTE] Assuming that's not sarcasm, that's the idea.
it may be more lines and uglier, but in the end, is it more or less cpu instructions? also often if a compiler deems a switch statement inefficient, it turns it into if else if edit: also the average case of the search is n/2....same as a linear search
[QUOTE=Jookia;27731339]He did the equivalent of somebody rage quitting CS:S after crying over mic chat. [editline]30th January 2011[/editline] Look at this for a minute: [img_thumb]http://f.anyhub.net/jsu[/img_thumb] Now look at this: [cpp]if (str2 == "let") { this.OK(a, b); } else { type = typeMap[str2]; this.NK<type>(a, list, b); }[/cpp][/QUOTE] [QUOTE=Jallen;27731302]Naw I'm not saying it would. [B]There may be better ways to do it[/B], but my point is that it isn't the programming crime that everyone is making it out to be.[/QUOTE] Not the best way to do it =/= Terrible
Hey, [QUOTE=Spoco;27730912]AMD Athlon 64 X2 6000+ (Windsor) 4GB DDR2-800 I'm only timing the pathfinding itself using [URL=http://msdn.microsoft.com/en-us/library/ms644904(v=vs.85).aspx]QueryPerformanceCounter[/URL], subtracting the start count from the end count and dividing by the frequency from [URL=http://msdn.microsoft.com/en-us/library/ms644905(v=vs.85).aspx]QueryPerformanceFrequency[/URL]. We should run the whole thing several times and calculate an average or something.[/QUOTE] Ah, excellent, thanks for the clarification. Let's find out if I can do this or not :smile: Just out of curiosity, what container are you using for the open list in C++? What about in C#? The main issue with C# is, as you said, its lack of efficient containers for this sort of thing. C# doesn't have the ideal priority queue that is necessary.
[QUOTE=Jallen;27727381][url]http://market.android.com/support/bin/answer.py?answer=112622[/url] And as well as that, you need to spend $25 on the market registration! How is that acceptable? They are running a monopoly ffs. 30% is absolutely ridiculous, yet they [I]know[/I] that to get an app to sell well it needs to be on market. Terrible.[/QUOTE] It's the same on iOS, and the fee on that is $200+ :l
[QUOTE=ZeekyHBomb;27731288]A switch statement in C# with string works, also via a hashtable, thus O(log n) I think.[/QUOTE] Hey, just to clarify, this should be O(1). O(log n) would be for a tree-based dictionary.
[QUOTE=jmazouri;27731691]It's the same on iOS, and the fee on that is $200+ :l[/QUOTE] Holy shit, [I]and[/I] you need a mac, [I]and[/I] you have to use Objective C. It's actually bizarre that there are as many iOS apps as there (especially free ones, how crazy do you have to be to spend $200 to give something away?) are if you're right about the fee.
[QUOTE=limitofinf;27731715]Hey, just to clarify, this should be O(1). O(log n) would be for a tree-based dictionary.[/QUOTE] Only if a perfect mapping
[QUOTE=Bang Train;27731746]Only if a perfect mapping[/QUOTE] O notation is an approximation anyway. Exactly one collision is perfect mapping, but if the number of collisions doesn't scale (like if it's anywhere between 1 and 100 collisions, irrespective of the value of n) with a variable it's represented by O(1) AFAIK.
[QUOTE=Jallen;27731723]Holy shit, [I]and[/I] you need a mac, [I]and[/I] you have to use Objective C. It's actually bizarre that there are as many iOS apps as there (especially free ones, how crazy do you have to be to spend $200 to give something away?) are if you're right about the fee.[/QUOTE] Apparently they have two levels, Personal and Enterprise. Personal is $100/year, and enterprise is $300/year. [url]http://developer.apple.com/programs/ios/[/url] [url]http://developer.apple.com/programs/ios/enterprise/[/url]
[QUOTE=Jallen;27731723]Holy shit, [I]and[/I] you need a mac, [I]and[/I] you have to use Objective C.[/QUOTE] No, actually I think you can use C, C++ and Objective-C++, too. [editline]29th January 2011[/editline] I hear some people actually do Objective-C++, but mainly for C++/Obj-C interfacing.
[QUOTE=esalaka;27731812]No, actually I think you can use C, C++ and Objective-C++, too. [editline]29th January 2011[/editline] I hear some people actually do Objective-C++, but mainly for C++/Obj-C interfacing.[/QUOTE] All of the SDK stuff has to be accessed in Objective C AFAIK, though you can use other languages and just use that to interface with it.
[QUOTE=Jallen;27731723]Holy shit, [I]and[/I] you need a mac, [I]and[/I] you have to use Objective C. It's actually bizarre that there are as many iOS apps as there (especially free ones, how crazy do you have to be to spend $200 to [b]give something away?[/b]) are if you're right about the fee.[/QUOTE] Just because its free to download doesn't mean the developers don't earn anything. Alot of the free apps are "ad-supported" which brings the developers revenue.
[QUOTE=limitofinf;27731681]Hey, Ah, excellent, thanks for the clarification. Let's find out if I can do this or not :smile: Just out of curiosity, what container are you using for the open list in C++? What about in C#? The main issue with C# is, as you said, its lack of efficient containers for this sort of thing. C# doesn't have the ideal priority queue that is necessary.[/QUOTE] I used a binary heap for both. Had to write them myself.
I really dont see why you cant search teha android market through their website, oh well where theres a will theres a way [img]http://img201.imageshack.us/img201/1328/98493159.png[/img]
Sorry, you need to Log In to post a reply to this thread.