Posts Tagged ‘silly’

Our media server

July 26, 2010 in Personal | Comments (3)

Tags:

I can finally show off my week­end pro­ject! Well okay the vestiges of it star­ted a couple week­ends ago and it bled into this morn­ing by a couple hours, but I think it still counts as a week­end project.

Jasna and I don’t have cable or an antenna for our TV, which means we down­load everything we watch, or bor­row it from friends on rare occa­sions. My Mac­Book was start­ing to run near the end of its use­ful life as my main work com­puter — the track­pad was becom­ing unus­able which meant I couldn’t depend on it when trav­el­ling — but it’s still got some life in it as a server. It was wire­less net­work­ing (no cables to string around), uses very little power, is com­pletely silent, comes with media soft­ware (Front Row) and comes with a remote con­trol, is really small (less than 2cm tall), which makes it more or less the per­fect media server.

The only down­side is it was a pain to get shows onto it to watch, as you have to search for the shows manu­ally, down­load them, then copy them manu­ally over to the server. So, I decided to make a web interface.

Check here for screen­shots of the new web inter­face for the media server. EasyN­ews, our Usenet pro­vider, provides very handy ser­vices like global searches, thumb­nails and AutoUn­RAR­ing. A big bene­fit to this is not hav­ing to wait until some­thing has fin­ished down­load­ing it before watch­ing it. So far I’ve got ser­vices for down­load­ing from Usenet — which is where we get almost all of our TV shows to watch, down­load­ing CFL games from TSN and just upload­ing indi­vidual files from your browser. At some point I need to set up schedul­ing so that it auto­mat­ic­ally down­loads new epis­odes of shows when they’re released, but I guess that’s for another weekend.

I’m kind of embar­rassed at how proud I am to have actu­ally fin­ished it in a week­end like I’d planned, espe­cially con­sid­er­ing I haven’t done any web devel­op­ment in years and years. The astute of you may have noticed I used straight-​​up CGI instead of tech­no­lo­gies the cool kids are using: no love from me for PHP or RoR or Ajax or any­thing. Since I haven’t put any pass­word secur­ity in yet — that’s for another week­end yet — and the box is pub­licly address­able via IPv6 I’ve had access to the web inter­face to just within our local net­work, but if IPv6 takes off some day it’ll be cool to be able to down­load movies while I’m away from home.


NHL ’94 follow-​​up

March 26, 2010 in Personal | Comments (0)

Tags:

This is an addendum to this post where I was try­ing to make NHL ’94 more challenging.

I’ve all but given up on try­ing to give the com­puter an extra use­ful player in shootout mode. Giv­ing the com­puter an extra player who stands and does noth­ing is trivial. Unfor­tu­nately, the “AI” for shootout mode is — maybe not sur­pris­ingly — hard-​​coded — it doesn’t even take into con­sid­er­a­tion the pos­i­tion of the goalie — and rewrit­ing the AI in 65C816 assembly is bey­ond the scope of my free time. This is easy to show by watch­ing the dif­fer­ing beha­viour between when the com­puter gets a break­away (in reg­u­lar mode) com­pared to how it behaves in shootout mode.

So I play in reg­u­lar mode with a 3-​​man han­di­cap. E.g., we play 5-​​on-​​2. If you watched the first video from my last post, you’ll notice that han­di­cap­ping your­self makes the game beep con­stantly. It’s very very irrit­at­ing. Fix­ing this is actu­ally not com­pletely trivial. For those that are impa­tient, here are the memory addresses I’m using:

Address Descrip­tion Example value
7E17A6 Num­ber of play­ers for the home team 3
7E18BA Good ques­tion! See below 12
7E1864 Num­ber of seconds left in the penalty 40

Using the val­ues above will stop the incess­ant beeping.

I haven’t had time to fully explore the implic­a­tions of 7E18BA. Just from obser­va­tion, it seems that that the 7E1860 – 7E18C0 range is an array of player state and 7E18BA is an off­set into that array which per­tains to the pen­alty. By set­ting 7E18BA to 0x12, it seems, you indic­ate which ele­ment of the array from which to draw penalty-​​time-​​remaining inform­a­tion. I only use the value of 0x12 and the asso­ci­ated address 7E1864 because those are what came up for me dur­ing debug­ging (Mike Gart­ner, if you’re curi­ous). I haven’t found any rhyme or reason to the num­ber 0x12 yet, but I don’t really care too much at this point.

As a side note, someone really needs to come up with a bet­ter tool for “RAM cheat­ing”. For those unfa­mil­iar, the gen­eral pro­ced­ure for this style of black-​​box debug­ging — usu­ally used for cheat­ing, though in my case I guess it’s anti-​​cheating — is to snap­shot RAM at vari­ous stages of play. You then com­pare the RAM images accord­ing to what state you’re look­ing for. E.g., if you want to know where the num­bers of play­ers on the ice is stored in RAM, you snap­shot when you have 6 play­ers on the ice a few times and again when you have 5 play­ers on the ice and look for the num­bers “6” and “5” to con­sist­ently appear in RAM.

If you have a hacker men­tal­ity, this way of doing things can be pro­duct­ive, but it’s pretty crude. Gen­er­ally the tools avail­able don’t allow you to com­pare bit-​​values, only byte-​​values, and com­par­ison oper­at­ors are pretty lim­ited. After half-​​heartedly try­ing to fol­low along with Jasna’s AI assign­ments, I’d be sur­prised if this prob­lem hasn’t been solved gen­er­ally and prop­erly in the AI aca­demic com­munity. Oh well.


Grocery store checkouts

March 22, 2010 in Personal | Comments (4)

Tags: ,

For the past year or so, I’ve been tim­ing how long it takes for me to go through the check­outs at our gro­cery store to see which is faster.

The meth­od­o­logy is quite simple. Once I’ve got all my gro­cer­ies, I go to the same spot near the check­outs. To avoid bias­ing myself, I check my cell phone to determ­ine whether to go through the self check­outs or the nor­mal check­outs. Because my cell phone lacks a ran­dom num­ber gen­er­ator, I check the last digit of the time: an even digit means I go through the nor­mal check­out and an odd digit means I go through self check­out. I then start the stop­watch and time how long it takes for me to go through the check­out and leave the store.

I’ve got 31 data points and have finally decided that if one type of check­out is faster than the other, the dif­fer­ence is small enough to not really mat­ter. Here’s the scat­ter­plot:

A sample size of 31 is unim­press­ive, to be sure, but it’s large enough that I can finally rest easy know­ing it would be a waste of time to col­lect more data. Try­ing to get out of the gro­cery store in the fast­est way pos­sible seems to have more import­ant factors, such as the num­ber of jerks ahead of you in line.

As a side note on how that scat­ter­plot is presen­ted, it prob­ably would have made a lot more sense to meas­ure the time taken as a func­tion of how many items I bought, rather than the cash value of the items I bought. I’m far too lazy to count things, though.

So, from now on I’ll be decid­ing on self check­out versus nor­mal check­out based on how social I’m feel­ing. I sus­pect that means I’ll be using the self check­out a lot.


NHL ’94

March 14, 2010 in Personal | Comments (4)

Tags:

As any­one born around 1980 would know, gam­ing reached abso­lute per­fec­tion with the release of NHL ’94. It’s great if you want a 10-​​minute diver­sion and I’ve been play­ing a few minutes of here and there for the past few months.

There’s one ser­i­ous prob­lem with NHL ’94, how­ever: the AI is abso­lutely ter­rible. Play­ing in single-​​player mode is way too easy. Play­ing as the worst team (either Flor­ida Pan­thers or Ott­awa Sen­at­ors) against the best team (All Stars East) I can win 5 – 0 without much effort.

In shootout mode the AI is even worse. If you put the goalie on auto­matic mode (the com­puter con­trols your goalie) then the oppos­ing team does alright, but it’s no fun. If you put the goalie on manual mode (you con­trol your goalie) I’m not con­vinced it’s actu­ally phys­ic­ally pos­sible for the com­puter to score on you.

I had the bril­liant idea that maybe the game would be more fun if the human player were han­di­capped. Maybe shootout mode would be more fun if the com­puter had 2 play­ers instead of just 1? I have my doubts, but it got me thinking.

So one idea was to dis­as­semble NHL ’94, add in some 2-​​on-​​1 shootout code and reas­semble it. For­tu­nately there are people out there who take hack­ing the Super Nin­tendo more ser­i­ously than any sane per­son should, so there are some tools avail­able. Learn­ing 65C816 assembly code, dis­as­sembling the game and then tra­cing through and debug­ging soun­ded like the sort of thing that one does after they’ve fin­ished writ­ing their thesis, so I filed that under “plan B”.

Plan A became to track down where cer­tain deli­cious global vari­ables, such as the num­ber of play­ers on the ice, were being stored in memory and modify them as the game was being played. After about 20 minutes of toy­ing around, I got some­thing to work.

Here’s me in reg­u­lar hockey mode, but with only 1 skater instead of 5:

The con­stant beep­ing (sorry) is due to NHL ’94 fool­ishly think­ing that since I’m down 4 men, the other team is on a power play which is end­ing soon, in 0 seconds to be exact. Note the game mis­takenly gives credit for the goal to Zhit­nik and Hrudey of the LA Kings instead of Schneider and Roy of the Montreal Canadiens. Weird.

Here’s me in shootout mode:

Unfor­tu­nately I acci­dent­ally gave myself an extra player instead of the com­puter, but it still demon­strates that my idea won’t work without a lot more fid­dling. The extra player just stands there doing noth­ing. Sigh.


Victory! Almost

March 7, 2010 in Personal | Comments (0)

Tags: ,

After yesterday’s fail­ure I brought a bit of extra duct tape and super glue and got the car back in work­ing order with the cam­era affixed to it nicely. I took it out again this after­noon to see if I could get the cam­era to sur­vive some small jumps off some staircases.

The good news is my duct tap­ing and super glu­ing worked. The cam­era didn’t move an iota — though sadly I had to tilt it a bit to the left to get it seated prop­erly — and the servo con­trol­ler stayed where it was sup­posed to.

Before I get into the down­sides maybe I’ll just show the video.

So the first down­side is that the video ends about five minutes earlier than it should have. When I rolled the car it rolled onto the shut­ter but­ton, unbe­knownst to me. It’s too bad since the crazier/​more abus­ive stuff came after that.

The second down­side is that both the cam­era and car took more abuse than they have before. The metal cas­ing on the cam­era got scraped off on one corner. One of the front shocks on the car came apart, which is espe­cially bad con­sid­er­ing it’s an oil-​​filled shock absorber. I haven’t decided what I’ll do about that.

The third down­side is that since I had to run the car without a body in order to get the cam­era on, it got more water dam­age than usual. Cur­rently it only goes in reverse. I’ll take another look at it after it dries out.

I think I’m going to put this short-​​lived remote con­trolled car video­graphy pro­ject aside until I fig­ure out a way to get things to sur­vive better.


A second stab at videography

March 6, 2010 in Personal | Comments (1)

Tags: ,

The last time I attached a cam­era to my remote con­trolled car the major prob­lem, from my per­spect­ive, was that it was too bumpy, to the point of not being able to see any­thing, really. The solu­tion to this is two-​​fold:

  1. Do it on pave­ment instead of snow.
  2. Attach the cam­era more securely.

Since it’s been crazy nice lately — 4º for the past couple days — we’ve had a lot of dry pave­ment com­ing out, so I took the camera/​car com­bin­a­tion out again today. I attached the cam­era dir­ectly to the chassis with the help of a styro­foam shim, rather than to the body like I did last time.

It star­ted off prom­ising! Up until the last ten seconds I think it counts as a mod­est suc­cess! There’s not so much boun­cing and you can actu­ally see what’s going on.

Sadly, those last ten seconds…yeah, I turned left when I should have turned right. It not only knocked the cam­era off, but it knocked the con­trol­ler off the chassis. The design of the car is rather stu­pid in this regard: the con­trol­ler is just can­ti­levered, held in by adhes­ive, in my case super glue. I’ll re – super glue it and see if I can’t try again tomorrow.

My ulti­mate plan was to take it off some sweet jumps. Now I’m won­der­ing if the cam­era will sur­vive the trip: it was just held in place by the afore­men­tioned styro­foam shim and some duct tape. I’ll try it with more duct tape and see if I can’t get it to sur­vive a jump tomorrow.


This seriously freaked me out for a second

February 12, 2010 in Personal | Comments (0)

Tags:


Why use lungs when you can iRespire?


A failure in videography

January 17, 2010 in Personal | Comments (3)

Tags: , ,

I’ve always loved remote con­trolled cars. I think at one point in ele­ment­ary school I even lis­ted R/​C car driver as a future pro­fes­sion of mine. While I did have some actu­ally really nice cars as a kid, one dream of mine which never came to fruition was to put a video cam­era on the car. It would be like being trans­por­ted to a mini­ature world where everything is huge and cars go orders of mag­nitude faster than they should.

(more…)


Aqua car

January 3, 2010 in Personal | Comments (0)

Tags:

Over Christ­mas break we stopped by a Win­ners and I picked up an amphi­bi­ous bat­tery con­trolled car. The box had some dra­matic pic­tures of it going from water to land, so I decided to try it out in my own kit­chen sink. Not great, but well worth the $2.25, I’d say!

Here’s the video.