Category: Tech

Development Diaries – Entry 1

A lot has changed in web development in the last twenty years. Prepackaged goodies like jQuery and Bootstrap speed development of the look and feel of your website. The HTML standard has evolved over the years, allowing webpages to serve vastly different kinds of content that years ago would have been impossible without plugins. And then there are content management systems, which do what they say on the tin.

Some things stay the same though, like the need to timestamp your stuff. Every Facebook post, every Tweet, every article on your favorite news site, they all have the date and time on them so you have an idea of how fresh the content is. And so did every one of my web pages back then. The implementation was certainly different – whereas now everything’s a record or a document in a database that has a timestamp associated with it, back then I was working with static HTML files with no content management. So if I wanted to say when a file had been updated, I had to do it manually. That’s assuming I even remembered to do it at all.

Rather than do it the analog way, I looked at alternatives. Javascript was the first attempt:

document.write(document.lastModified);

But this presented a problem – technically, writing the last modified date to the document is itself a modification of the document, so the result is always the date and time that the browser renders the page. Useful, but not informative.

Then I looked at server-side ideas, specifically CGI scripting. It isn’t terribly complex, and writing a program in C to power a website in 2017 would be a pretty hilarious thing to do:

void getFileCreationTime(char *path) {
    struct stat attr;
    stat(path, &attr);
    printf("Last modified time: %s", ctime(&attr.st_mtime));
}
            

But it’s overkill, and I also don’t know C well enough to go down that path without spending a bunch of time looking for help online.

So, I found another option that gives me the server-side capability without writing and maintaining code: server side includes!

<!--#echo var="LAST_MODIFIED" -->

It’s a single tag, it does exactly what I want it to… but with one hitch: the date is reported in a time zone local to the server, and I’d reeeeeeally rather it report the time in GMT instead. Just a preference of mine. SSI tags don’t give me that option out of the box, but I can go back to my first attempt: Javascript can read the output from the SSI tag, parse the date, and spit it back out the way I want it to!

function lastUpdate(dateTime)
    {
        var updated = new Date(dateTime);
        return "Last updated: " + updated.toUTCString();
    }

document.write(lastUpdate('<!--#echo var="LAST_MODIFIED" -->'));
            

The result is what I want, a timestamp that automatically updates itself when I make a change to an HTML file, and reports the time in the time zone I want it reported in. Not bad!

[Historical note 2021-03-31: Publish date approximated]

Leave a Comment

New Build (Part Deux)

Not “tomorrow” anymore, but here’s more.

The power supply – a beast by yesterday’s standards, but these days 750 watts seems almost ordinary. Nice thing about it is that it’s modular. Power supplies used to have a mess of cables coming out the back, and if you didn’t use them all you’d have to bundle the remainder up or find some place for them to go. Now, you use only what you need and store the rest in the box for later.

Incidentally, here is the bag all the cables came in.

The power supply, mounted in the bottom of the case. Another sign of the times – power supplies used to be mounted on top. The way air flows through a case, by the time it reaches the top-mounted power supply, it’s already fairly well-heated, and power supplies generate a fair amount of heat themselves. Now when warm air rises, it simply exhausts out the back.

Speaking of airflow and temperatures, why did I remove this massive fan from the top of the case? We’ll see in awhile.

ASUS P8Z68-V PRO motherboard. More than adequate for folks who don’t classify as extremely high-end, but not bargain barrel stuff either.

Serial ATA ports. This board supports adding eight hard drives (or seven hard drives and a DVD burner, or some other combination of the two), so it’s good for some of the more exotic configurations such as RAID.

The CPU socket (center) and RAM slots (lower-right).

The input and output ports that will be exposed on the back of the case. With onboard video, audio, networking, USB, and even bluetooth, it’s possible to run the entire setup just through the board without any extras. But where’s the fun in that?

The CPU socket, exposed and ready for installation. The gate folds back down and secures the CPU in place. One interesting thing about this particular socket is the pins. Normally the pins protrude from the bottom of the CPU and meet contacts in the socket, but here the pins come up from out of the socket and meet contacts on the CPU.

The underside of the CPU. This is an Intel Core i5-2500K. Like the motherboard, satisfactory for most folks who don’t need to be on the bleeding edge (and don’t mind cutting $100 here and there off of the price of their new computer).

The heat spreaders on these sticks of memory are entirely too aggressive-looking for a part that will never be seen while it’s in use. This is 16GB of memory. Quite a lot, if you think about it. It wasn’t that long ago that you couldn’t even find hard drives this big.

The CPU and memory are installed and ready to work.

This is a Corsair H100 CPU cooler. CPUs generate heat, and liquid cools better than air, which makes this a very interesting idea. The block sits above the CPU, transporting heat to the radiator, which is then blown off – through the top of the case – by a pair of fans. After a few days in service, I can say this thing does a really fantastic job of keeping the CPU cool when I put it through the paces.

The H100, installed.

The video card is installed. In the lower right (almost cut off) you can see the hard drives mounted in the bottom cage. I had three total – a solid state drive for Windows and some bare essentials, and two traditional drives for bulk storage. The SSD’s advantage is that it is much faster and much quieter than its elder siblings, but the drawback is that it’s significantly more expensive. As technology continues to advance, the older drives will probably no longer be needed by regular folks.

Here’s a shot of the computer, finally on its feet, with all the components installed and cabling run. The nice thing about this case is that the cutouts to the right and underneath the motherboard allow you to run cabling in such a way that it only exposes itself right in front of where you need to plug it in. This allows air to move through the case with fewer obstructions.

For reference, this is how the inside of my old computer looked. The case is much smaller and didn’t have many of the same amenities as the newer one does, so cabling kind of had to go wherever you could put it. That’s not to say the computer didn’t work, it was just a real pain to service and clean.

Leave a Comment

New Build (Part 1 of several)

It’s been two and a half years since I last built a new PC. At the time I speculated that, having beefed up quite a bit on the components, I could get three years out of it. Turns out I was half-right – it’s still in service now and would easily make it to the three-year mark, but it’ll probably blow right past that. It handled Deus Ex: Human Revolution and a couple of other newer games this year without too much trouble, and handles the demands I put on it for work just fine as well.

Still, I’m in a position to be able to upgrade and can conceivably play the “graduation/Christmas present to myself” card right now, so here we are. The first shipment showed up in the mail over the weekend, with the remainder on its way in tomorrow. So here are a few pictures of the case to start.

A look at the front and left panel of the case. I picked this one because it’s one of the few cases left in the world that doesn’t look like a UFO just landed. No multicolored lights, no weird designs. Just solid black with straight edges. It’s also lighter than I expected, too – much more so than the Antec Sonata 550 I used in 2009. The Sonata itself was also pretty understated – solid colors, nothing flashy – but it’s also not big enough on the inside for the newer full-sized graphics cards.

The right panel and rear. Not a huge fan of the window in the side of the case, but it’s not that big of a deal. Notice the latches on the top of the panel. The case uses a latching system to keep the panels on, rather than screws. That makes it a lot easier to get in for maintenance. On the rear are a couple holes for water cooling systems, a hole in the top-left for running USB 3.0 cables out of (in case you can’t plug some front-panel USB 3.0 ports directly in on the board), and the power supply is mounted at the bottom for better control over the heat.

Here’s the case with the panel pulled off. There is an insane amount of room in here, so everything will go in comfortably. There is a generous-sized cutout for backplates in case someone plans to install a heftier heatsink-fan over the CPU, along with a number of circular rubber cutouts used for threading cabling out of the way of airflow. (In other words, the cable from the hard drive to the motherboard would disappear behind the panel and pop up in the cutout closest to where it would go on the board.)

A closeup on the cutouts. Some of them will only be available when you use smaller motherboards (notice the posts sticking up in the middle, that’s where the board would be mounted), but there are still plenty to go around for the larger varieties.

A closeup on the 3.5″ drive bays. Each tray is flexible and snaps around the drive, then slides and locks into the bay. Between this and the latches on the outside, Corsair did a really nice job of making most builds with this case a screwless effort. Having said that, for 2.5″ drives, particularly solid state drives, there are a couple of screw holes that you must use to secure them. The top cage can be relocated in case you need the extra clearance for a really long expansion card.

The front and top panels. The front panel flips down to reveal a reset switch, firewire, two USB 2.0 ports, headphone and microphone jacks, and two USB 3.0 ports. The cabling behind the USB 3.0 ports is long enough to go out the back of the case (through that hole in the upper-left) to be plugged into the rear USB 3.0 ports on the motherboards in the event that the board doesn’t have a lead you can plug directly into. The top panel slides back to reveal SATA connectivity. You can either plug a 2.5″ drive in, or the notch on the left side pushes down to support a 3.5″ drive as well. This may come in handy as a dock.

More to come tomorrow.

Leave a Comment

Running out of gas

I’m so awake that Benadryl couldn’t put me down. That’s sad.

Halfway through the second round of tests for this semester. Had a Japanese test last Thursday which I did pretty good on, an east Asian civ. test on Monday which I did pretty good on, and still to come are a Chinese history test in a couple hours, a music history test on Friday, and a comp sci test next Wednesday. The Chinese history test has eaten up the lion’s share of study time as I had to read two pretty good-sized books cover to cover. I guess I’m ready for the test, but I’m not quite sure what the outcome will be just yet. As for the remaining two tests, I’m not worried about them, but I’m not overlooking them either. Beyond that, I have three papers to write this month, one of which is a Japanese research paper and an accompanying oral report. All are due in about four weeks, then it’ll be about time for the last round of tests. I think I can get out of here in December with decent grades, although I suspect there will be a slight drop from last spring.

Last week I had to go ahead and get signed up for spring classes in Lincoln. Even though I’m still planning to study abroad, the application process is taking long enough that we won’t have the final yes or no from the other school until well after registration here has opened. Next time around (and forever onward, I suppose) I’ll be taking a lighter class load. Studying for five tests has cut far enough into my schedule that while it’s technically still possible for me to work, the coursework leaves me not wanting to waste the spare time I do have on further activities which require actual thinking. This a problem considering I need the money to keep going to school, and my overall GPA isn’t quite high enough yet to apply for the upperclass scholarship. At this point it’s almost worth it more to take the path of least resistance and risk setting graduation back a semester rather than drive myself broke (already done) and insane (getting there) just to finish school.

One thing I will be doing starting next spring (or this fall if I somehow end up not studying abroad) is getting an apartment off campus. The convenience factor is starting to lose ground to the desire for things like my own shower and the ability to eat breakfast before 1030 on weekends.

Also, I would like to add that Windows 7 is excellent. Probably even more excellent is the fact that I bought it for $17 at the school bookstore. That’s how you stop software piracy on a college campus – make the product so cheap there’s no reason not to buy it. Too bad the CDs are the bookstore are still way too expensive. I was around here when Napster was a big thing, and if you’re still selling music at the same jacked up prices now as you were ten years ago, even if those prices are technically cheaper due to a decade of inflation (how the hell does a Snickers bar cost a dollar?), you’re pretty much begging for people to not buy CDs you paid money to be able to stock.

Leave a Comment

… And the “not so much” things for this week

Now the bad news:

1) My financial aid for the year got pulled. Basically, I was dismissed from school 9 years ago for failure to maintain satisfactory academic progress – an assessment I don’t dispute – and that came back to bite me in the ass when the school went to audit who all was receiving aid this fall. The kick is, although I am technically in good standing with the school for having successfully applied for readmission, I didn’t actually do anything to reverse the situation I was in on campus. The on campus/off campus distinction is important – although I have a full year’s worth of credit transferred in from the community college in Omaha, that does nothing to either help or hinder my progress in Lincoln.

So the short version of this little story is that I rushed down to Lincoln the day after finding out and filed my appeal. I stated that in the interim, I had been slowly racking up transferable credits at another school and that the situation would simply correct itself after 3 months now that my head’s screwed on straight. The committee who oversees these things looked at my appeal and approved it on the condition that I take at least 10 hours’ worth of classes in the fall and pass them all. Fine, they’re all softball classes anyway.

In the meantime I’m looking at private options for the fall term as I think it’s going to be a little tough for me to scare up $7000-$8000 between now and the fall, and I think I’ll be okay in that department. This is just a giant pain in the ass to deal with.

2) The price of the new iPhone. Ok, first of all let’s get something straight here – I realize I’m not the target audience for this contraption. I greatly prefer text messaging to phone conversations, I don’t care one way or the next if I can surf the internet and/or check e-mail when I’m on campus and probably 5 minutes away from a public terminal anyway, and most of all I don’t want to pay $50 or more a month for phone service. Especially when I can get a Skypeout account for like $3 a month. I just jumped on Sprint’s SERO plan, which gets me 500 minutes of talk time and unlimited text messaging for $30 a month. In the whole quest for cell phone service to replace my company phone which is soon going away, that is hands down the best deal I found. By far. That’s the kind of cell phone customer I am. So having said that…

The new iPhone is going to cost $199, whereas the old one used to be $399. Basically a 50% discount. This looked like a really sweet deal, and I was just about ready to take the plunge… then the details started coming out. To wit: the data plan is going to be $10 more a month, and you have to pay $5 extra to get the 200 SMS package that used to be included. Do the math – or better yet, don’t, because it’s already been done:

Steve Jobs himself said the primary reason people weren’t buying iPhones was because of the cost. In response, Apple’s and AT&T’s bean counters diligently moved beans from one pile to the next until they could come up with the biggest crock of shit farce I’ve seen so far – a phone being advertised as “half as expensive” that carries a higher total cost of ownership than its predecessor.

Steve, you are one crafty son of a bitch, but do you really think that’s going to make people jump in line? The iPhone was too expensive before, so now that it’s even more expensive that should fix the problem?

Really, come on.

Uh, I guess the only other thing I don’t like this week is that somehow the Yankees managed to climb out of the AL East cellar. Pinstriped bastards!

Leave a Comment