Category Archives: Programming

Links and Alarm

Links

First of all, you may notice that there is actually a link for the “Links” item in the nav. Over the past few days, I’ve been designing, coding, and adding the links themselves for this new links system. The building process was pretty similar to all the systems I’ve done so far, especially the Photo Album. I design the page in HTML first, so I can preview how tables and such will look and debug browser compatibility locally. Then I take this HTML page and convert it to server-side form, quantifying item HTML blocks with PHP loops and adding the necessary SQL queries. Somewhere in there, I create the database tables and start adding in records. This is pretty much how every system was built.

The links system is seemingly the most simple system I’ve built so far, but it’s actually a bit more complex. For one, the category (directory) hierarchy is not linked through paths like the Photo Album, but is linked by item IDs and parent category IDs (a tree). This makes sense because the category hierarchy is logical here, instead of being based on physical paths with the Photo Album. The advantage of this method is that items (links and categories alike) are not dependent on a whole chain of parent categories but merely the parent ID. This makes moving items, renaming items, and the MySQL queries easier. The disadvantage being that mapping the category paths is a recursive nightmare.

Another complex part of the links system is the feature that checks link status–whether or not the URL of the link is working. I’ve set it up so that every Friday morning (or when I run it manually), a script will request every link URL in the database. It then takes the HTTP response code from the requests and puts them into the database (this will appear as a popup tip for the link status), decrypting them into a brief OK, MOVED, or BROKEN status that appears for each link on the page. This seems to be working quite bitchin so far, except that FilePlanet always returns 403 Forbidden. I suspect that they filter out non-supported browsers through their default index this way.

Except for any bug-fixes that may pop up, the new links system is done. I’d recommend you comb through the more than fifty links already there; you may find something useful.

Snake’s Alarm

I put some more work into my alarm program before getting involved with the links business. Mainly, I’ve been working on improving the stability of the sound system. Luckily, FMOD handles all of the low-level loading, decoding, and outputting stuff for me, but I still have to implement when, what, and how it does its job. My original implementation of FMOD would crash whenever you tried to play two sounds at once. Because I didn’t want FMOD to hold onto some sound resources when alarms aren’t being played, it didn’t initialize until an alarm went off. Thus if two alarms happen to overlap, the second will indeed try to reinitialize the system, crashing it in the process.

I solved this problem by making a simple sound system stack. When the first sound is pushed onto the stack, the system initializes. When the last sound is popped, it closes. This fixes the problem with multiple sounds playing, but now I’m working on a problem when sounds end. I’ve traced this back to the fact that each sound alarm gets its own thread. My next big challenge will be bringing the different alarm threads together into one big sound system thread (with the stack). Easier said than done, but I will prevail!

I was also going to talk about my current gaming trends in this post, but I’ll save that for another time. In the meantime, here’s a rare picture of Kaylen and I out in the sun. Oh noes!

Kaylen and I catching some much-needed rays on the beach at Kiptopeke State Park.

Posted in Programming, Website | Tagged | Leave a comment

Alarm Status and Ti83plus Game

Nothing really to report on any previously mentioned projects. I haven’t really had time to delve into my alarm too much since I got it running stably several weeks ago. It hasn’t failed any in the last month, not even from human error (which I tried to minimize the possibility of). Still, it needs a few more features, options, and documentation-type stuff before I feel like it can be released for a public beta. (If you beta test it and give useful feedback, I will put you in the program credits; so there’s all the incentive I can give.)

Also of interest is a game for the TI-83 plus line of calculators that I’ve been programming between classes. I’m actually making it based on code for another game, found here. It’s an RPG with 10 areas (or floors, albeit they all look the same), randomized loot, XP and character development, spells (sorta), and a combat system.

I’m redoing practically everything (or planning on it). The maps are no longer static: every map is loaded from a simplified storage program into a matrix for easy X,Y coordinate access through a grid subroutine which can turn any coord into a graphic block. There will be a new enemy type which uses spells. And spells will be totally revamped. In the original game, you could only get spells by having them as enchantments on items. In my remake, you’ll get to upgrade your spells when you level (the mage class gets more points to distribute) and choose from a larger selection like curses, healing, lightning damage, fire damage, damage reflection, etc. There will also be skills like knockdown, disarm, leech mana, steal life (vampire), and more. Obviously, to permit all these new combat features, the fight system will have to be augmented and enemies given very basic AI.

There’s tons of other features that I’m conceptualizing as well, but the only part well underway is the new map system. Programming on the calculator is difficult, though. For one thing, all variables and data structures are global. 😕 The editor has only 7 lines and no indenting. And debugging consists of programmer breaks and printing out variable values. It’s an interesting break from the norm, though. Here’s a screenshot from the new map system. You can compare it to one from the aforementioned link.

news202

Posted in Gaming, Programming | 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

New apps and stuff

I added two small, new apps to the site since the last post. One is for fixing audio sync issues in video files. The other removes lines from log files using regular expressions. They’re just more programs to make my life simpler that I thought I’d share with the world. 😉

I’ve also been adding on to the download system and fixing some bugs with the other systems. All the downloadable files are automatically linked to an FTP-accessible directory every hour. The download script now knows this and lists the FTP mirror automatically as well. However, I’m still having issues with the anonymous FTP and server load, so it’s best to just use HTTP for downloads. The script is supposed to automatically download from the HTTP url if there aren’t any outside mirrors.

Posted in Programming, Website | Leave a comment

Update for Data Rate Calculator

I was using my calculator today and noticed a difference between equivalent data amounts of bits and bytes. I looked at the math in the code for a while, and then realized that I somehow overlooked the conversion from bytes to Kbits (internally, everything is converted to Kilobits) using 1000 instead of 1024. Then, after fixing that, I changed a few more things. Here’s the log:

1.1.10:
-fixed conversion from bytes to bits using 1000 instead of 1024.
-fixed data rate profiles being limited to 50 and anything above that crashing the program on start. there is no limit now.
-updated the icon to add XP transparency effects.

You can get the new version here.

Posted in Programming | Leave a comment

Mouse App and Content System

I’m generally done with the content system now. It took about 400 lines of mixed PHP and HTML code and has the typical assortment of PHP/MySQL functions: IDs; searching for specific fields; sorting by title, status, date, and downloads; sorting ascending and descending; page viewing with results per page selection, page navigation, and page jumps; and HTML template insertion. It looks pretty, too. Just coding the page and sorting navigation tables took two days to get right. The MySQL stuff was pretty easy and only took a day. The apps pages and downloads should all be working now. The only thing left to do is the download counting and putting everything else into the database. I meant to get to this today but got side-tracked with another project.

That project was my MX510 App-Specific Mouse Buttons program. After several hours of disassembling the MouseWare, I finally came up with the location of the exact call for the “Refresh Buttons” message. It’s line 10206 in eventex.dll (in the last version, 9.80). The “Refresh Buttons” message is sent by the mouse control panel to em_exec.exe when you modify a mouse button. This is why the button functions are updated immediately, as em_exec is the program that handles custom button functions. Anyways, this new knowledge of the MouseWare’s internal workings, I finally figured out how to get rid of the crashing associated with my previous builds. I would now even recommend it over the Logigamer app for MX510 users. It would be nice if I could support other MouseWare mice, but I lack the knowledge (each mouse has different registry paths) for this.

Getting all the items into the content and downloads databases will take the rest of the week probably. Then, the Columns section will just be a mod of the content system, but it will take weeks to get all the columns formatted. Still got plenty to do.

Posted in Programming, Website | Tagged | Leave a comment