Category Archives: Academics

We have explosive.

(i.e. Lightboxes)

I’ve been really into web development lately, especially anything requiring a lot of JavaScript control of the DOM and CSS control over layout and style. I’ve spent a solid week (at least) working on adding lightboxes to replace some of my lighter scripts: image viewing and downloads. I’ve been pretty fascinated by lightboxes ever since I saw them on The idea to actually employ one on this site didn’t come to me until I was doing the remake of the content system and thought it would be awesome to combine a lightbox with the ability to preview the contents of archives (rar and zip files).

Although there are tens if not hundreds of lightbox implementations, I felt like creating my own to avoid all the code bloat and because I’m that much of a control freak. The first hurdle was figuring out how the hell these other lightboxes could be triggered on the click of a link without navigating to the link URL immediately after the script finishes. Googling didn’t turn up any leads, but I eventually found out the answer by just reading the code comments of another lightbox. It’s simple and makes sense but isn’t obvious: the onclick function must return false. It kinda works like a message chain in Windows.

From there, I just kept chugging out JavaScript. On DOM readiness, the script adds onclick events to trigger the lightbox to any existing links to image or download pages. On click, the script does the appropriate HTTP request (AJAX) for the content to fill the lightbox. On request received, it puts the HTML into a lightbox container that automatically enlarges to fit content. Meanwhile, the script is fading in the obligatory black overlay; I chose to fade it in not only because it looks awesome but it also helps your eyes to adjust to change in light. It’s all a delicate ballet of scripting, but surprisingly IE performs quite well with it and only minimal hassles (e.g. filter: alpha(opacity=#); instead of opacity: #.#; for overlay opacity in CSS).

It didn’t stop with lightboxes, though. I’ve also been wanting for a while to have a display of the most recent uploaded images on the front page but was underwhelmed by the prospect of cramming only a few images on there. Then I got to thinking about how I might make a scrolling marquee for the images and realized it wasn’t too hard to code. You simply need an inner container for the images with position: relative and an outer container with overflow-x: hidden and on button script events move the inner container’s style.left property by negative the amount to scroll. Then, obviously, you have to do some code to detect the beginning and end of the marquee to keep it within bounds among other things. Quite snazzy.

I also made another slight change to front page (beyond adding the latest blogs). I was a little displeased by my method of finding the most popular content given that it merely sorts the database by the total downloads. Thus, it’s not at all responsive to changing trends. For example, if file A gets 1000 downloads over five years but not much recently, and file B has only 300 downloads over a couple months but gets several hits a day, then file B is obviously more popular than file A. The best solution to calculate what’s more popular would be to log all the hits for a day for every file and calculate popularity trends often, but that’s a logistical nightmare and too much hassle for this small site. However, I came up with a simple solution that requires only one new field in the database (last_dl_count) and a monthly cron job to do UPDATE `content` SET `last_dl_count`=`dl_count`;. Finally, I switched the front page popular query to the following:

SELECT `id`, `title`, `sshots`, `dl_count`, (`dl_count`-`last_dl_count`) as `delta_count` FROM `content` WHERE `type` = '$type' ORDER BY `delta_count` DESC, `dl_count` DESC LIMIT 2;

It works fairly well, except at the beginning of the next period after the update cron runs. Since all the deltas are 0, you get only the all-time popular again until someone downloads something.

Well, I think that’s enough web developer theory for now. However, I’d like to point out three academic columns I recently added. There’s one from Fortran Programming class with all my source code and most of my documentation. The second is on the Parallel Programming with PVM project I did last year, including a Flash slideshow (first mentioned here), presentation notes, and source code. The last is a paper I wrote on the Aspects of Overpopulation, a subject that greatly concerns me; too bad the class it was for was completely worthless.

Posted in Academics, Programming, Website | Tagged , , , | Leave a comment

Keeping Busy

Posts have been slow to come lately, but of course, this doesn’t mean I haven’t been working on anything. In addition, school just ended at the beginning of the month–this time for good, or so I think. I haven’t actually gotten my diploma in the mail yet. But, I’m pretty sure I graduated.

And now I’m being bombarded with queries about what, when, and where I’m going to get a job. So far, I’ve taken a passive approach to finding employment and, even with that minimal effort, have had a couple offers already. I think once I decide I’ve rested enough and start looking in earnest, I won’t have much trouble finding a great job.

Naturally, now that I’m done with school, I have a bunch of academic papers that I’m wanting to add to the site. Previously, I would just upload a Word “Web Page” version of papers, link them, write a little blurb, and that’d be it. However, I’ve grown weary of the full-frame white document backgrounds of all my uploaded papers and the disconnected feeling it brings to the site’s style. At first, I went about rectifying this with another PHP script where you pass in an ID for a particular paper listed in a database. However, I ran into a snag with this method because Word always exports Web Page image paths (and also <a name> internal links) relative to the document, and the script’s path would differ. My first fix was a client-side workaround using the <base href> tag which forces a document’s path to whatever you want. This worked decently enough, but of course, you can never be too sure of client-side support for a rather obscure tag (though FF2 and IE6 did seem to support it). My final fix was to “include” the wrapper script in the document itself (thereby eliminating the need for the aforementioned fix), obtaining the calling document using the $SCRIPT_NAME environmental variable. From there, the wrapper script reads the calling document’s title, url, body contents, and style contents, outputting them where necessary and giving the page a clean, stylized, embedded document look.

So far, I’ve only applied the wrapper script to some of the existing academic papers. This is taking longer than it sounds because I’m having to redo the Web Page export from Word. Apparently, in Word 2003, there is an option to export a “Filtered” Web Page, which removes all the Word-specific markup and reduces the file size by about 4KB + 10% of the overall size. I’m also doing more robust linking, both internal and external to the document. It should be fairly impressive once everything, previously existing and new, has been updated and linked into databases–I’ve even got some source code to put in this time around.

I’ve been working on the Company of Heroes map mentioned last time some more. I haven’t made a lot of progress, but nevertheless, I’m almost done with the playable area of the map. Beyond the playable area is the “out of bounds” (OOB) area, which is mainly just for making the map setting look realistic and “not like a table-top” so they say. It’s basically the same idea as my wrapper script, smoothing out the differences between the playable area and the surrounding environment. The OOB won’t take nearly as long to construct as the playable area has, though, because it will mostly be low-poly pine tree groves and the stream and road rolling off into the distance. Anyways, here’s a screenshot of the area I have been working on lately–a raided German AA site. It looks a bit stylized because I’ve been playing around with filters for the final version’s loading screen.


In other news, I did my first No-DVD crack for a game last week. Of course, I can’t give any more information about availability of the crack or what game it was for. But still, it’s a notably L33T personal achievement and a stepping stone in my learning assembler (or disassembler rather) through practical uses. Previously, I’ve already done a bug fix for a game in assembler and a mod for a game in pseudo-assembler. Besides a thorough disassembler (like IDA), I’ve learned the best tools are NOP (No Operation) and JMP (Jump) to either “comment out operations” or make conditional statements (various forms of Jump If) always or never take the jump. Even though I love this kind of reverse engineering programming/troubleshooting, sifting through millions of lines of assembler code takes a lot out of a person, and thus I don’t expect to be doing a lot of it in the near future.

Posted in Academics, Modding, Troubleshooting, Website | Tagged , , , | Leave a comment

What’s been going on

So the fall semester of school is finally over with–oh, when will it end. I managed to pass all of my classes, albeit busting my ass to do so. Next semester, I’m trying for a lighter after-school (homework) workload, so I can finally get to all these projects I’ve been meaning to do. Or at least the ones I don’t get started over break. Those include my alarm program (still some bugs to work out and polishing); calculator RPG (working on the combat system); a program to convert Trillian logs to HTML (just an idea right now, but something I’ve been meaning to do); the links, photo album, and feature archive sections of this site (probably more coding from scratch in PHP), and fixing up dad’s old computer for a local server.

I’d really like to use Linux for the server, but I’m unsure of what distro, filesystem, and other settings to use to give it the best interoperability with the Windows machines. There’s also concerns about what upgrades I can manage to spend on it. It’s a five year old Pentium 3-based machine, desperately needing an upgrade from a 10GB hard drive if it’s to be a media server. I’m also thinking about using it as a testbed, especially for this site. As I said, it’s a project on its own.

Kaylen has been staying with me for the last week. It’s been a good time for the most part. We’ve been trying for 100% completion on Lego Star Wars II (currently at about 85%). That game is surprisingly fun for how simple it is. I’ve also been back at Red Orchestra since the last free weekend. I’ve been playing offline with a cracked steam dll since then, but I really wanna buy it and make Kaylen drive tanks while I man the gun. 😉

I’ve been trying to play NWN2, but that’s been an ordeal. I was getting locks in the game with the Catalyst 4.12 drivers that I’ve been so adamant about for two years. So I tried just upgrading to the newest version of Catalyst (6.12). That did better with the locking, but then I would get some BSODs on Windows startup. After much fuss with safe-mode and restore points, I finally got the old 4.12 drivers installed back. I hear people saying all the time that the WinXP system restore feature is crap and a waste of drive space, but that shit is really useful. But, I digress. No NWN2 for me, I suppose. I really need a new system.

Kaylen and I were cleaning out my room yesterday, and I had decided to finally get rid of a majority of my box collection. But before I threw out the hardware boxes, I snapped a pic for memorabilia’s sake. The pictured Diamond Viper II and SBLive! were the first video and sound cards I bought. I still have the SBLive in my rig, but it’s soon to be replaced by an X-Fi, courtesy of Santa.

Boxes from my first Sound, Video, and TV cards.

Boxes from my first Sound, Video, and TV cards.

Posted in Academics, Gaming, Hardware | Tagged , , | Leave a comment

Time for an update.

As school is a real bitch for me this semester (OS, Stats, Databases, Assembler, etc.), time for personal projects is at a minimum. Still, I’ve got a few things complete or in progress. The Columns are all up–or at least the ones since 2001. I’m still noticing some issues with search engines not updating the paths to them, though. But most users seem to be able to find the correct item from the simple, new navigation frame.

I also took a few days to learn some Flash “ActionScript” and coded a scrolling logo banner animation. It picks a random logo file, loads it, and moves the view around the image while tweening blur and opacity. The blur effect takes a bit of processing though, so the animation settles down after a few minutes. I’m not sure if it will be permanent, but hell, it’s still rather bitchin.

I’m also working on a new program in VB.Net. It’s the alarm to end all alarms. You can set up multilple alarms of varying types (timer, daily, one-time, weekdays, etc.) with any action you’ve defined. The actions (sound, strobe, command) are setup separately so that multiple alarms can use the same action. The time monitoring routine runs in a separate, higher-priority thread from the editor windows; it uses an intelligent sleep system to minimize polling (and thus CPU usage) when alarms are far into the future. I’m also using the FMOD Soundsystem to play various sound formats, unlike with Dark, which could only use WAVs with its pure DirectSound implementation. My alarm app is nearing a public release soon. It should be the perfect wake-up call for anyone that sleeps in the same room as their computer (i.e. college students).

Posted in Academics, Programming, Website | Tagged | Leave a comment

Slight Updatification

I uploaded some more papers from last semester, this time from Psychology. I had forgotten that they kicked ass, but a weird chick reminded me. Find them here.

I also fixed the MBM thing again, not like anyone cares, but it’s a cool script and useful for remote checking my computer functioning. As you may recall, Loogie used to have a MBM temperature display, but now he’s just a loser.

Hmm…what the hell else did I do…I blogged, but that’s in the ticker. The site’s domain name runs out next month; perhaps I should change the name, but that would take days to fix. I need that time to do school projects and essays and play Red Orchestra. Maybe in 2007, eh?

So, that’s the news. Try not to spoog yourself, Gandalf. 😛

Posted in Academics, Website | Leave a comment

Flats for the masses and molestation blues.

I’ve updated my Doom flats pack to v0.2. It now contains 21 redone/new Doom textures for flats. Pick it up, here. I’ll be sure to include my barrel, fog, and nukage addons next time, too. Screenage below.

And now for my somewhat controversial Tony the Worm story. The uncut version can be found in a new Column I’ve made that is a collection of projects we’ve done. You’ll like what you see (I dunno about Loog’s stuff, though). 8) /columns.php?type=academic

Posted in Academics, Modding | Tagged | Leave a comment