• Programming - WAYWO - March 2013
    1,001 replies, posted
[QUOTE=bobiniki;39902292]And you censored your PC username because?[/QUOTE] Many people have their first name as their PC username.
[QUOTE=bobiniki;39902292]And you censored your PC username because?[/QUOTE] Because maybe I'm paranoid for no reason? Honestly I don't really know, but it is an old habit. I do it in all of my screenshots. In other news, my VM handles the binaries being corrupted by me typing random characters into a hex editor very well.
[QUOTE=bobiniki;39902292]And you censored your PC username because?[/QUOTE] Because he doesn't want to give it to you. Why does it need to be more complicated than that?
[QUOTE=benjojo;39900170][img]http://imgs.xkcd.com/comics/ineffective_sorts.png[/img] [I]StackSort connects to StackOverflow, searches for 'sort a list', and downloads and runs code snippets until the list is sorted.[/I] So, Who is going to make StackSort?[/QUOTE] I like quantum bogo sort the best. 1. Shuffle the list randomly. 2. If the list is sorted, stop. 3. If it isn't sorted, destroy the entire universe.
[QUOTE=bobiniki;39902292]And you censored your PC username because?[/QUOTE] maybe his username is the same as his password and he doesn't want you to know his password so he doesn't want you to know his username.
[QUOTE=Xeon06;39902810]I like quantum bogo sort the best. 1. Quantumly randomise the list, such that there is no way of knowing what order the list is in until it is observed. This will divide the universe into O(n!) universes; however, the division has no cost, as it happens constantly anyway. 2. If the list is not sorted, destroy the universe. (This operation is left as an exercise to the reader.) 3. All remaining universes contain lists which are sorted.[/QUOTE] I forget, where is that from? I know I've heard it before...
I have always envisioned having a sorting method where the list is faxed to a third world country where it is sorted manually. Each item is put on a different card, sorted, and then the whole arrangement gets scanned and sent back in an inefficient manner. Price per sort is based on a logarithmic scale based on the number of elements.
[QUOTE=ryan1271;39903145]I have always envisioned having a sorting method where the list is faxed to a third world country where it is sorted manually. Each item is put on a different card, sorted, and then the whole arrangement gets scanned and sent back in an inefficient manner. Price per sort is based on a logarithmic scale based on the number of elements.[/QUOTE] So would you say that the price is O(logn)? Or is using O in that way a horrible thing?
[QUOTE=redx475;39903250]So would you say that the price is O(logn)? Or is using O in that way a horrible thing?[/QUOTE] Yes, that's a right way to use it. Big Oh notation defines the upper bound to the function's growth.
[QUOTE=redx475;39902840]I forget, where is that from? I know I've heard it before...[/QUOTE] Not sure. I saw it on some random website some time ago. I copied and pasted from [url=http://www.mathnews.uwaterloo.ca/Issues/mn11103/QuantumBogoSort.php]this[/url] this time. [editline]13th March 2013[/editline] [QUOTE=ryan1271;39903145]I have always envisioned having a sorting method where the list is faxed to a third world country where it is sorted manually. Each item is put on a different card, sorted, and then the whole arrangement gets scanned and sent back in an inefficient manner. Price per sort is based on a logarithmic scale based on the number of elements.[/QUOTE] You could accomplish something of similar nature using [url=http://aws.amazon.com/mturk/]Amazon Mechanical Turks[/url].
Fuck. What is the name of that type of bug that only appears when you observe it? I just ran into one of those. I'm running a release build of my vm, and if I run it with the debugger in visual studio it runs my countdown script perfectly, but as soon as I launch it from a console, it crashes after printing one line.
Heisenbug
[QUOTE=sambooo;39903488]Heisenbug[/QUOTE] Exactly. That one. Now I have to figure out how to get rid of it... Anyone got some tips?
[QUOTE=redx475;39903523]Exactly. That one. Now I have to figure out how to get rid of it... Anyone got some tips?[/QUOTE] Figure out where the crash occurs and why if possible. Is it segfaulting, stack corruption, etc? And then start commenting shit out until it doesn't crash.
[QUOTE=esalaka;39893227]Is that a DarkRP hosting simulator or something[/QUOTE] Probably PERP.
AHA! I have a union I use for storing data, and one of the members is a char*, but I never initialize the union and my program was calling free() on it (expecting it to either have data or be NULL, since free does nothing to a NULL value) Thank god that was an easy heisenbug. EDIT: Wow, avast antivirus gives me a bluescreen half the time I try to launch my program (it blocks execution, and when I tell it to allow, I get a bluescreen).
I made thread-unique memory allocation functions for Windows. Meaning that allocation and freeing must be done in the same thread, but other threads can use the memory. It seems to be approximately as fast as MSVCRT's memory functions when using a single thread, and many times faster when using multiple threads that are all simultaneously doing memory allocation. I'm surprised the speed improvement is so great (8000 milliseconds to 3000 milliseconds with 64 threads doing 32 thousand allocations, reallocations and frees concurrently): I thought the runtime library's memory functions would already be optimized to hell. It's not very complicated; it just uses windows's heap functions and keeps track of each thread's heap with as little locking and internal memory allocation as possible. [editline]14th March 2013[/editline] The greatest benefit I think is a subtle one: when the thread terminates, you can just call one function to release everything that thread allocated.
I've made the repository for my vm public. You can find it here: [url]https://bitbucket.org/redxdev/shogun[/url] It works, but there are still a lot of things to fix. Also note that only visual studio solutions are included, but it should build on any platform as it doesn't use any platform-specific code. You can also download binaries if you don't want to build it yourself from [url]https://bitbucket.org/redxdev/shogun/downloads/shogun-win32-0.1.3.zip[/url]. I suggest looking in the source browser at ShogunVM/SVM_Opcode.h for a description and list of all opcodes (some of the comments may be out of date). To run a script, you first have to compile it with the shoasm tool. The tests project does not need any scripts to be compiled, but must have access to the scripts directory (it has both the assembler and virtual machine built in).
I don't feel like programming at the moment, so instead I open-sourced the [URL="https://bitbucket.org/Tamschi/puppetconsole/"]PuppetConsole[/URL] from a few pages back. It's a bit problematic with strict firewalls that block open loopback ports and there's not a lot of functionality so far, but otherwise it works.
I changed it so instead of it working by CPU usage, it's now by player slots, which you buy. [IMG]http://puu.sh/2hhM6[/IMG] [IMG]http://puu.sh/2hhMH[/IMG] "Players" randomly leave and join, but the chances of them joining is higher than them leaving... Might even name each server by selecting random names from a table and combining them to make something like.. "Poop" "Machine" "Ilovedarkrp" > "Poop Machine" "Poop Ilovedarkrp" "Machine Poop" [B]etc[/B]
[QUOTE=McDunkable;39905617]I changed it so instead of it working by CPU usage, it's now by player slots, which you buy. [IMG]http://puu.sh/2hhM6[/IMG] [IMG]http://puu.sh/2hhMH[/IMG] "Players" randomly leave and join, but the chances of them joining is higher than them leaving... Might even name each server by selecting random names from a table and combining them to make something like.. "Poop" "Machine" "Ilovedarkrp" > "Poop Machine" "Poop Ilovedarkrp" "Machine Poop" [B]etc[/B][/QUOTE] If it's a proper DarkRP server host simulator, most of the servers must have "Serious RP" in the name [editline]14th March 2013[/editline] This isn't even a joke, just go look at all of the DarkRP servers they're all called "<something> Serious Roleplay"
[QUOTE=ThePuska;39899708]What's the state on C-SFML these days? Last time I checked their C bindings, they were outdated so badly they were broken[/QUOTE] At least for the Python and Ruby bindings, the github versions are up-to-date (i.e. SFML2) even though the versions listed on the website are really old.
[QUOTE=Xeon06;39903277]Not sure. I saw it on some random website some time ago. I copied and pasted from [url=http://www.mathnews.uwaterloo.ca/Issues/mn11103/QuantumBogoSort.php]this[/url] this time.[/QUOTE] The only time I've seen it was notch's blog
[QUOTE=redx475;39904328]AHA! I have a union I use for storing data, and one of the members is a char*, but I never initialize the union and my program was calling free() on it (expecting it to either have data or be NULL, since free does nothing to a NULL value) Thank god that was an easy heisenbug.[/QUOTE] No offense but how did this slip through your QA?
[QUOTE=Jookia;39906785]No offense but how did this slip through your QA?[/QUOTE] Mainly because it worked for some reason in both debug builds and in release when VS was debugging. I must have forgot to initialize it and never noticed it since it didn't create any problems until I tried in full release mode. I need to use release more often.
[QUOTE=esalaka;39905642]If it's a proper DarkRP server host simulator, most of the servers must have "Serious RP" in the name [editline]14th March 2013[/editline] This isn't even a joke, just go look at all of the DarkRP servers they're all called "<something> Serious Roleplay"[/QUOTE] Similarly, if it's PERP, the gamemode can't be the same version for any two servers. AFAIK there's only ever been a PERP 2, but all the script kiddies keep bumping it up. PERP v4.5 w/ VEHICLES!!!!
[QUOTE=Jookia;39906785]No offense but how did this slip through your QA?[/QUOTE] Heap corruption, often doesn't actually trow an error in smaller applications.
[img]http://i.imgur.com/a5rdM5Y.gif[/img] I made a little guy for testing in my game. The game I'm creating is basically Mordheim on the PC. I might post pictures later once I have terrain working.
[QUOTE=ThePuska;39904750]I made thread-unique memory allocation functions for Windows. Meaning that allocation and freeing must be done in the same thread, but other threads can use the memory. It seems to be approximately as fast as MSVCRT's memory functions when using a single thread, and many times faster when using multiple threads that are all simultaneously doing memory allocation. I'm surprised the speed improvement is so great (8000 milliseconds to 3000 milliseconds with 64 threads doing 32 thousand allocations, reallocations and frees concurrently): I thought the runtime library's memory functions would already be optimized to hell. It's not very complicated; it just uses windows's heap functions and keeps track of each thread's heap with as little locking and internal memory allocation as possible.[/QUOTE] CRT is and always was single-threaded. The best it can offer nowdays is that it's thread-safe - which of course doesn't mean many threads are really supposed to use it. (Unless this is what you have done already), the right way for multi-threaded allocation is to create a dedicated heap for every thread using WinAPI. They would all be accessible within the application, but no longer limited against concurrent operations.
We have to make a choise for our final year project by next week and I cant decide between "Make a unity based game" or rolling my own thing(making some sort of procedural planet) anyone have any opinions?
Sorry, you need to Log In to post a reply to this thread.