mrlachatte: (Default)
Well, it's been a month since I last posted.  That sure was unexpected!  Time to get a collection of links in no particular order off my chest:

Make Google dance for you (no, srlsly)
13000 people cannot be wrong
The power of Flickr and Google Earth come together in one epic evolution (go go Photosynth, I choose you!)
How to ransom a wallet over the internet
Every Topic In The Universe Except Chickens (Qwantz readers keep going)
Hello computer, how are you doing today? Oh good, a major scale - that means you're in top form! (non-nerds move on)
Guitar hero - on your chest
Everything in the universe about Zoggs

NOW, on with reality:

Today, I was thinking about programming and permutations.  We haven't covered permutations in Geometry, yet, but I was idly toying with flimsy's Ziggurat idea.  Instead of doing Geometry Proof review, I worked out a pseudo code algorithm to generate all the possible combinations of 1-15 letter words composed of a-z.  So, you shove all these words (I'm too scared to work out what the total number would be) into a database, then you use them to create all possible permutations of, say, 20 word sentences (this is a pretty ridiculous number, I know).  Finally, with this gargantuan database in hand, you create a hotornot/Google Image Labelling-like web app.  Interested visitors are shown a pair of sentences, and asked to vote on which is more powerful.  Far more often than not, they're both rubbish, but the user still has to choose one.  Anyways, these would be marked as unusable, and they would not be voted on again until the first "round" was finished.  You can read the rest of the Ziggurat link to find out how it all ends, but I'm pretty intrigrued by the idea of distributed permutations and then having people sort out the rubbish.  I'd love to try to get a distributed 50x50 pixel image permutation generator going, but it would require a lot of concentration, something which I don't feel inclined to give the idea.
mrlachatte: (Default)
It's official. I've progressed farther on my revamped level editor in two weeks than I did in two months! I've just created the first "new" feature that isn't just re-implementing what was in my non-guichan editor. As a side benefit, this new feature (which happens to be a button labelled "Edit") demonstrates that my state-based system works properly, which was only theoretical up until this point. Hooray!
mrlachatte: (Default)
I like when I get the coding bug and actually get stuff done.  I don't think I mentioned it before, but I decided to rewrite my level editor using a real GUI library instead of my homebrew, hacked up, scary "everything is a button" system.  I settled on guichan, and I like it a lot after spending a bit of time with it.  It's basically what I was trying to do with my SDL-gui library, except it's actually planned out and stuff.

Now, it had previously taken me several months to get my editor up to a certain point - a working tile map, buttons everywhere, infinitely-resizing map, scrolling, a history and debug system and more.  I believe that I picked up the most recent release of guichan about 3 weeks ago, give or take a few days.  It took me close to a week to get just a basic ImageButton class moving and shaking in this new paradigm framework library, but in the remaining two weeks I have brought the revamped editor back to to the pre-guichan state in terms of interface and function.  This bodes well for the future.

Also, I need suggestions for a topic for my 700-750 word informal essay that's due in 9 days.
mrlachatte: (Default)
My mum and I spent the morning in Stratford browsing used bookstores.  I bought two Wheel of Time books (I own the entire set except for Knife of Dreams now), Foundation and Empire by Isaac Asimov, Snow White and the Seven Samurai by Tom Holt, and Lost in a Good Book and The Big Over Easy by Jasper Fforde.  Came to $35 and dashed my hopes of buying a soundcard today as well.  I shall have to grab money from the bank and stop into Sherwood Music after school on Monday.  Until then, I'm pouring through The Eye of the World (Book #1, which is pretty fun after reading #3-11 in the past few months) and hacking on a couple fun projects I have going while I don't have homework.
mrlachatte: (Default)
I got myself in a hacking mood after school and polished off my level editor.  It's now in a useable state again, after I got rid of the mess of memory-related errors caused by my previous code-oriented post.  That means that I can finally start adding cool new stuff like entities and objects, and optimize the history storage (which currently profiles at 100% of execution time!)  Unfortunately I'm leaving for camp in under two weeks.  Fortunately, that gives me two months to plan out exactly what I want in my editor and game! Also unfortunately, the Songbird public SVN will probably open up in my absence. I am really interested in getting dirty in that project; It might be easier to break into than Firefox, at least. I need something of substance to talk to prospective employers about in the future.

I feel like playing Grim Fandango again.
mrlachatte: (Default)
Riddle me this.  I've got defitinitions like this:

--------------

class State
{
    private:
       GUI *gui;
       std::map<char *, int> iVars;

    public:
       State()
       {
          set_ivar("test", 1);
          gui = new GUI(this);
       }

       void set_ivar(char *name, int value)
       {
          iVars[name] = value;
       }

       int get_ivar(char *name)
       {
          if(iVars[name])
             return iVars[name];
          else return 0;
       }
};

class GUI
{
    public:
       GUI(State *s)
       {
          printf("value is %d", s->get_ivar("test"));
       }
};

----------

Now, ignoring the nice circular dependency going on there, explain why I would get a 0 in the printf() in the GUI constructor.  The real problematic code is more complex, but I've tested, and the values in the map<> are valid before the call to create the GUI.  However, inside the GUI constructor, suddenly they don't exist anymore.  Help :(
mrlachatte: (Default)
Almost every single binary search in existence is broken.

Saturday I figured out how to use Bazaar, and I love it.  Offline commits, public branches, history merging; it's all really awesome.  I also spent some time thinking about my abandoned Magic: The Gathering project, and mocked up a much improved interface for how the game would work.  It involves more than two people, too!

I also spent some time refactoring my level editor; in fact, it's so refactored that I am in the multi-million compile error phase.  The new design will be ultimately more beneficial than the global variable soup I was previously hacking in, but until then every single file is screaming as I try to make OOP out of soup.

I'm finally finished with the aftermath of reformatting my computer, too, and I'm giving the least user access principles thingie a go.  It's weird not running an administrator account 24/7 now, and I've finally created a set of batch files that allow me to bypass the rediculous Microsoft runas program.  Instead of going:

runas /env /user:administrator "[path to executable]"

and then typing in the password, then waiting for 30 seconds for the program to start (if I typed in the password correctly), I have finally created this simple system:

sudo [path to executable]

and it runs under the administrator account.  Just like that.  I'm also pleased with the scripting I used to make MSI packages install properly, as runas doesn't do anything but run executables, it seems.  This is the contents of sudo_msi.bat:

@echo msiexec.exe /i %* | sed -e 's/"/\\\"/g' - > c:\systools\msitemp & set /P msitemp= <c:\systools\msitemp
cpau_real -u administrator -p [password] -lwp -ex "%msitemp%"

In the process of creating this, I learned how to use grep, sed, and I learned more about how the Windows 'set' command works then I ever wanted to know.  Anyways, the point is that being a non-administrator account is a lot easier, finally, and I can now relax and enjoy my computer spontaneously rebooting on me whenever I open uTorrent.  Power supply failure, anyone?
mrlachatte: (Default)
I have achieved a new level of nerdvana.  I reinstalled Kubuntu twice in VMWare because I kept screwing it up, and in the end I upgraded my kernel, downloaded about every single package of gcc in existence as well as every package of kernel headers in existence.  It felt like quite an accomplishment at 2:30 this morning, but now I'm wondering what to do with it!

I spent the rest of the day coding.  The drag select feature for my 2D tile-based level editor works perfectly!  The undo feature almost works perfectly too!  If just designing the level editor takes this long, the rest of the game isn't going to be coming for several years!  For some reason I feel ok about this!

I'm going to bed far too late like usual!

Postscript: [livejournal.com profile] autisticando rung me up over GoogleTalk and it turns out he's a pretty interesting guy with a voice that's out of this world
mrlachatte: (Default)
So, I worked on that z2 project for ~5 hours.  I'm pretty proud of myself, I got a lot accomplished.  I'm slowly easing myself back into dev work and away from gaming; too bad I have no time to read books any more.  I've been reading a really good book for the past 4 months :(

Update

Dec. 26th, 2005 12:44 am
mrlachatte: (Default)
[livejournal.com profile] mr_alert and I have been working on libzzt again, recently.  It's up to 3328 lines of code right now, and I'm slowly making progress on the ZZT-OOP interpreter.  Movement is almost kind of elegant right now.  We'll see how long that lasts!

Also it doesn't help that I understand absolutely no ZZT terminology, having never looked at the language until last week!
mrlachatte: (Default)
That feeling you get when you fix a bug and the entire program/library/etc comes together after multiple frustrating hours? I just got that. Magic: The Gathering now has unlimited smooth scrolling across the table, and you can drag cards wherever you want (did I mention it was smooth, too?) I haven't mentioned anything about this project before, I started it in Fiji after taking a look through my two Magic decks and thinking about how to represent them in code. After two weeks of work, averaging around 4-8 hours per day on the game, I have something to show for it. The program itself only contains minimal rules about running the game and giving priority to the appropriate player. Each card is a DLL (for now) which contains a bunch of exported functions, and the game loads every DLL it finds and fills up a structure that contains millions of function pointers. Now, the obvious security hole in this setup is that a card (Soulnova, for instance) could delete every file on your hard drive (although personally I think it would be amusing for Soulnova to grab a single random file and delete it). If this project goes anywhere then I'll switch to a scripting language like Lua, which has many obvious advantages over DLLs. Until then, the security hole stays.

Anyways, I have some basic turn logic in place (no combat yet, extremely basic card playing (the stack doesn't exist yet)) and I have written some nice video routines that make my life easier. I give you a delicious taste of what is yet to come:

Screenshot )

So, in conclusion this new project is quite challenging and a lot of fun to work on. On the topic of solving bugs, I finally found the source of problems I've been having for the better part of a year. Turns out that I was drawing my lines for one element one pixel past the boundary, ergo overrunning the space given to the SDL pixel array. All it took was a -1, and every bizarre problem in SDL-GUI disappeared. Poof. On the bright side, that means I can keep adding in more GUI element types whenever I feel like it now, I used to be holding off until I discovered why it kept crashing :)

Man, code is \m/ I also highly recommend the new IDE Code::Blocks, it's like Dev-C++ but... better. I feel like a traitor now, but one of the Dev-C++ dev team is working on this new one with some other folks, and the result is a well-designed, wxwidgets-based, extensible IDE for C/C++. It's a 1.0 release candidate that's available, and while the class browser and code completion are still a bit wonky (surprisingly more wonky than the Dev-C++ ones), it's a wonderful program to work in. It lets me have workspaces and build targets, first of all. That means with my Magic: The Gathering project, I have the 'Release', 'Debug' and 'Cards' targets. Release has some compiler optimization settings ticked, Debug puts in all debug info and Cards runs a makefile I created that compiles every .cpp file in the /cards directory into a DLL. Did I mention that Code::Blocks integrates with 5 different compiler sets right out of the box? It's hot stuff.

Enough geekiness for one night. We'll see what happens tomorrow.
mrlachatte: (Default)
Boom. We flew in a couple days ago (13 hours split between Fiji->Honalulu and Honalulu->Vancouver, then 3 hours driving to Seattle), we're spending 3 days staying with my grandma before finally heading home (another 4 hour plane trip to Toronto, I believe?) First meal in Canada? Tim Horton's chili combo with a Boston Cream donut. It was weird to hear all the flat accents in the airport, and see every sign in two languages. I haven't seen products like "Windshield De-Icer" for a long time, too!

In other news, I sent off postcards for [livejournal.com profile] rossman231, [livejournal.com profile] eljhika, [livejournal.com profile] exophase and uh... someone else :< [livejournal.com profile] gamurgurl? I forget. Anyways, they all went out last Sunday and I know that at least [livejournal.com profile] exophase received his, and liked it. Two for two so far!

I'll have a follow-up post to this sometime later today/this week (when I have an internet connection back in Kitchener, we're waiting for an eBay auction to finish so we can buy a modem and then sign up for the high-speed service which will take time to be installed and blah blah blah). The subject of the post will be impressions of Canada/USA after a year being a stranger in a strange land. Or something. I know you can hardly wait.

The best part is that I spent the majority of my time in Fiji either:

  • Reading (Mexico Set and London Match by Len Deighton (A++++ would read again))

  • Snorkelling/Diving (A+++++ would dive again)

  • Coding (I was extremely productive on a variety of different projects!)


All in all it was a great success, especially as I sat in the open-air bar, 10 metres from the beach, with the laptop on the table, playing around in CodeBlocks. I love my life.

Woo

Aug. 3rd, 2005 02:25 am
mrlachatte: (Default)
Coding to XColX's tracks is one of the best ways spend a couple of hours in the early morning.  I highly recommend picking up Live At Stokesly School, a really great 20 minute gig he did, Drifting Apart, a beautifully melodical and rhythmic piece, and his Fix You remix, a really great redoing of the new Coldplay track.  They're all trance/melodic trance/house-ish tracks, quite bouncy and energetic and a lot of fun to listen to.

In other news, I'm chugging away at the Survivor: MZX page, I like the interface I'm designing a lot.  I'm also having fun with DHTML, which nobody but [livejournal.com profile] rossman231 will ever see ^_^  All in all, the page should be ready with time to spare before the competition, and hopefully prove worth the effort I'm expending on it.

Oh yeah, there was a greasemonkeyed IRC discussion, which I logged and [livejournal.com profile] atrustheotaku kindly HTML-ified and mirrored. Some good ideas there, I like the direction that the greasemonkey community is moving in, with casual editing/fixing of other people's scripts combined with a meaningful trust system. The end result for the user, ideally, will allow access to any version of a script, with notices of how trustworthy it is (has/hasn't been approved by admin, has been reviewed by "elite" people, etc). Sounds good to me!

In case you don't know, there's a greasemonkey 0.5 beta out finally, and it's wonderful. Pick it up, go to greasemonkeyed.com (soon to be userscripts.org) and begin fixing the web, one page at a time.

Oh rooney

Jul. 30th, 2005 02:06 am
mrlachatte: (Default)
meme )

I saw the last 15 minutes of Spooks, and it looks like a pretty decent show.  I like the feel and look of it, and the way the events were portrayed, but I won't watch it because I don't watch TV anymore.

I'm on the second-last essay of my English program, exactly two weeks until we leave the country.  I'm going to be finishing IB math in Fiji, it looks like.

I sent off postcards to [livejournal.com profile] phyxius149, [livejournal.com profile] gamurgurl and [livejournal.com profile] freestylerfunk today, along with 7 other people.  That's over $11 in postage, so they'd better appreciate them >:(

I still have one more postcard for anyone that wants it, it's from 1992 and features an animal that's probably extinct by now, but it's still a postcard!

I'm at the point in my life where I want to eat, breathe, sleep, etc. coding.  I want to talk code with everybody, I want to debug, I want to discuss, design, determine, other words beginning with the letter D.  Do you know someone like this?  Do they have a form of internet messaging?  Would they like to get in touch with a 15-year code enthusiast who would love someone to query about bugs, share in successes, etc.?  I know I'd jump at the chance.

Yeah, here's another carriage return for you.

:

Jul. 26th, 2005 08:49 am
mrlachatte: (Default)
Here goes my second attempt at making a CVS server.  I still don't know if I understand how to set up users correctly, how do I give myself an admin account first?
mrlachatte: (Default)
I'm doing some PHP stuff for z2, it is fun.  It's 3:24 am, I have a bursting bladder and it's really, really hard to pass 8 minutes coding while waiting for a download to finish so I can go to bed.

The bible's a pretty crazy book.  I heard a reading this morning about a guy who went to work for a farmer, was promised the farmer's youngest daughter, worked for 7 years for her, had the wedding feast, then the farmer switched the daughter waiting in the wedding chamber.  When the man noticed in the morning, the farmer told him that marrying off the youngest "wasn't done," but he'd do it if the man worked for another seven years.  So he did.

o.O
mrlachatte: (Default)
I had a nice break from my ball thingie and decided to work on a scrollbar implementation in SDL that I'd dreamed up recently. This is the result:



It functions perfectly, from surfaces one pixel larger than the view (300px) to gigantic ones (16384px), with nice smooth scrolling, all in under 250 lines of code. Now, the only thing missing is the ability to drag the scrollbar, basically I want to emulate scrollbars in any decent program. Unfortunately, I cannot figure out how to get the dragging to work. I calculate the position of the scrollbar based on the y offset into an SDL_Surface, but I'm drawing a blank on how to figure out that offset based on a mouse click inside the scroll bar area.

Win32 binary, one C file, 5 resources (101kb)

I'm hoping someon out in interweb land might have an idea for me, I spent two hours making this thing and the last 2.5 trying to get the dragging to work. Hopefully I'll have fresh ideas while I'm out at Blackbutt tomorrow.
mrlachatte: (Default)
Our band played, the morning performance was really good and the afternoon one not so hot, netting us third place out of three bands in our division. Woo.

I finally have the main game loop in the ball thingie <100 lines, I discovered why the clients weren't handling other client disconnections properly, and added in fallback in case the server stops responding. There are no memory leaks, my next step is to add packet joining for those split ones, and then I'll try to optimize the netcode by only sending changes in position, instead of sending the position regardless.

Oh horror

Jun. 11th, 2005 11:40 pm
mrlachatte: (Default)
It's true, I did screw up my input system rather badly. Who'd've thought that SDL keysyms mapped perfectly to the ascii character set? Not I!

I've got a tendancy to overcomplicate things, and this is a prime example. I had this clunky system of KEY_ enumerations which mapped to the SDL symbols like so: KEY_c - KEY_a + 'a'. Unfortunately, that only worked for letters, so of course I wrote a whole seperate macro for numbers. Then there was punctuation, where I couldn't even think of a way to make it work so I did it all manually. Now all of that is replaced with code about 1/5 of the total size, which actually includes every key I want as well. At least it ended well!

1:18 AM ninja edit: Shift is also working perfectly now, I just had to define a bunch of special conversions that toupper() doesn't handle (for non-alphabet characters). Chatting seems to be complete for the moment. On to the next feature!

East Coast Band Championships begin in 8 hours, and the Lake Macquarrie Concert Band will be there. I will finally have four lovely, $10,000+ timpanis from the Conservatory to play with, instead of the two crapboxes I have to use at band practice. I'm getting hard just thinking about it.
mrlachatte: (Default)
I just finished adding full chat support to the game, you can now send any message up to 60 characters long, but I have the feeling that my input system is going to cause me troubles. I don't even remember why I added this SDLK_* wrapper thing, it actually just makes things harder I think :

December 2007

S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526 272829
3031     

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 8th, 2025 04:24 pm
Powered by Dreamwidth Studios