?

Log in

Philip Hazelden

> Recent Entries
> Archive
> Friends
> Profile
> previous 10 entries

July 21st, 2010


02:07 pm - Airsoft stuff
Having bought a new tappet plate, early last term I finally upgraded the spring on my P90. The trouble was, after doing this, it didn't work. It made all the right noises, but it didn't fire if there was a magazine in there. I could feed BBs in one at a time (yay for top-loading magazines), and it would fire those, but not very far - probably worse than it did before the upgrade. This didn't make any sense to me, and still doesn't - what difference could it possibly make to have a lump of plastic above the BB in the chamber instead of my finger? I guess the other BBs in the magazine were pushing down on it, but I don't know why that would matter either. In any case, after playing around for a bit, I eventually got it to fire with a mag in, somehow. It still didn't fire well, but I decided to take it out next time I played and see how it went. After a few minutes it stopped again. I was worried that I'd spent £25 to ruin my gun.

My assumption was that the grease I used turned out to be not good enough. I read about a test which I decided to try (take the spring out, put the gearbox back together, reach in and flick the gears - they should spin close-to freely). I finally got around to doing that a few days ago, but before I did I thought it would make sense to put my original barrel back in. I've never tested, but I thought the new one might have been doing more harm than good before I swapped the springs, and it made sense to have as few variables as possible. And, whaddaya know, after swapping barrels it appeared to fire perfectly. I can't chrono it, and I don't have enough space in my back yard to check its range, but I think it was better than it ever had been before. So fingers crossed - it's also possible that it's just waiting until I next play to break again.

Tentative conclusion: Element tightbores are not worth the price, even if they're free. (Mine wasn't.)

Also last term, I bought a shotgun. It's pump-action, an ASG SAS-12, only fires one BB at a time (most shotguns fire three), and cost £25 new. Its range and horizontal accuracy are absurd, better than any of my other guns at the time (I haven't checked against my P90 as-is). The problem is that even with the hop totally off, it puts too much spin on the BBs and they curve up very quickly, so its vertical accuracy isn't very good. Ben said that putting .25g BBs in it would fix that. Those are more expensive, but given how little ammo I'll be using with it, I'm willing to buy them. For £25 I have no idea how long the gun will last, but also for £25 I can't bring myself to care that much.

I was always bemused by how people spoke about their guns - they're cool and all, but the point is the shooting at people, and the guns are just a tool to do that. It seemed like people were fetishizing the tools or something. Now though, I understand. And of course I can't explain it, but this gun just feels right. It's a beautiful design in that nothing appears to be extraneous, but that's also true of the P90, and that doesn't have the same feel. So I dunno.

Also it came with a red-dot scope, which is pretty cool. Magazines hold 18 rounds and I think I can get two for £6+shipping online, or Ben said £5 each when they were in stock, which in either case is ridiculously cheap. I also want to try modding one of my M16 hicaps to fit, which seems like it should be fairly simple, but probably beyond me anyway. My main concern is that the spring would be too powerful and damage something in the firing mechanism, which doesn't seem likely but is something that I'm worried about anyway.

I'd like the shotgun to replace my pistol as my side-arm, but the rate of fire means it probably won't. I'll have to see how I end up using it.

I really am president of airsoc now. The handing-over ceremony consisted of Matt throwing the keys at me and me failing to catch them, which I hope is not an omen of things to come.

(1 comment | Leave a comment)

July 8th, 2010


06:29 pm - Second year results
* Data Structures and Algorithms (7.5 CATS) - 87%
* Algorithm Design (7.5 CATS) - 95%
* Automata and Formal Languages (7.5 CATS) - 78% - disappointing. I got 83% on the coursework, which means I only got like 75% on the exam. I thought I did better. I guess there was little or no curve. I would have liked better feedback on the coursework.
* Further Automata and Formal Languages (7.5 CATS) - 85% - again slightly disappointing.
* Essay (6 CATS) - 77.25% - didn't really know what to expect. I wish I'd got separate marks for the presentation and the essay itself. And again, more feedback than just a number would be good.
* Metric spaces (12 CATS) - 86.8%
* Differentiation (12 CATS) - 78.82%
* Vector Analysis (12 CATS) - 78.55%
* Combinatorics (12 CATS) - 75%
* Analysis III (12 CATS) - 81.1%
* Algebra I (12 CATS) - 85.39%
* Algebra II (12 CATS) - 64.4% - this was a disaster of an exam. The paper was fair, but I hadn't prepared enough and answered less than 75% of the marks.
* PDEs (12 CATS) - 76.92% - expected better. A fire alarm which I didn't hear gave us extra time, and I finished without rushing much. I did make a mistake on one part though, which could have cost quite a lot.
* Math Stats A (12 CATS) - 92%

Overall - 81.1% unweighted, 88.48% weighted. Ninth in year. Slight improvement on last year, but apparently most people drop 10%. Before getting results, I would have predicted that I did less well than last year.

I'm now half-way through university life, unless I do a PhD. I'm not planning to do that, but I'm also not planning not to, so we'll see. Several of my friends, mostly from Airsoc, have now finished, although some of them will still be around next year. Several more of my friends will graduate next year, which I suspect will be even weirder.

Experiment: when I get around to writing these things, I'm going to try keeping each entry to a specific theme. (Or multiple short themes.) Because writing everything at once takes too long so I never finish, and is probably not interesting to read. Unlike today's list of numbers.

(Leave a comment)

April 28th, 2010


02:26 pm
Read more...Collapse )

(Leave a comment)

April 5th, 2010


01:16 am
I came home last Monday. Mum decided she was too exhausted to drive me, but offered to pay for my train ticket. This turned out to be a good thing: the ticket-seller at Canley station told me how to save £7 on these journeys in future. I get two tickets, one to Cheltenham spa and the other from there to Bristol (or to Coventry or Canley, in the reverse direction), and it works out cheaper for the exact same route. So yay for that.

Most of my productive time for the past week has been spent on PyWeek. My entry with Alan is Roly-Poly Samurai. You move the mouse to tilt the platforms, making the samurai roll about, and you click to make him jump. The aim is just to get as high as you can, but there's an evil ninja who teleports out of reach every time you get close, which adds a little to the final product.

Things I would like to have added:
* Damsels in distress, who the ninja would try to kill; you would have to save them by getting close and making him teleport away. If you take too long, they die. If too many die, you lose.
* Scrolling background, and a better ninja image.
* Fade in/out effects for the ninja teleporting. Better yet, the ninja jumping instead of teleporting.
* Jump sound effects. (The current voices were taken from a free sound effect website, which is why the ninja's condescending "hah" sounds a little like an inquisitive "hm". This wouldn't easily work for jumping, because I want something in two parts, one for building up power and one for the actual jump.)
* A better algorithm for placing platforms.
* More precision in jump power. As it stands, your jump is fully charged after 1/3 second, which is too fast.

But I think the game is pretty fun even without those, so I consider it a success.

I probably won't be using Python again without good reason. I like the language well enough, apart from some bearable warts, but it's too slow for games programming. The game doesn't run at full speed on my machine even when it's only rendering six sprites and some text.
* Possibly I did something wrong, but not something simple. I noticed the slowdown gradually happening when I was adding more platforms, which rules out a lot of stupid things. And the platform draw/update code is very simmple.
* Possibly it's just a pyglet thing. Batched rendering might have made it faster. But batched rendering would also require calculating rotations manually, and keeping track of considerably more stuff, which at least partially nullifies the advantages of Python over C++. Also it annoys me when I submit a perfectly good bug report and get no response, even a "this is not our fault, take this up with...". (I had a similar experience with clojure, which I think is part of why I no longer use that.)
And synce python is never going to be as fast as C++, and I do not have a fast machine, I'm just going to stick with C++ for game development. And for non-game development, I don't think python is going to fill any niche that perl doesn't for me.

On the theme of programming, I've started the CS coursework. At first I decided I really didn't like JavaCC. When you tell it "find me something that matches this regex", what it does is more like:
* Read something.
* Match it, in turn, against every regex used in your program until it finds one that matches.
* If that isn't the one you asked for, it throws an error, even if the one you asked for would have worked.

(For pedantic clarity's sake: "regex" here refers to JavaCC's brand of regular expressions, which are equivalent in power to the ones commonly used by sed, grep, etc. but with a much more cumbersome syntax. It definitely does not refer to perl's regexes, which are non-regular.)

For me, what this meant was that I couldn't ask for A) "a word without globs" versus B) "a word that might have globs", because either all A's would be returned as B's, or all B's that don't contain globs would be returned as A's. So I was thinking that I'd basically have to read input character-at-a-time, which would be horribly complicated and have lots of hidden bugs.

But then, as I was lying in bed at about 2:30 one morning, I started to think about what was actually going on. Regexes are used in the lexing phase, where JavaCC just blindly reads stuff and converts it into "tokens". When you ask for "something matching this regex", what you mean is "this kind of token". So if a piece of input could be one of multiple tokens, it has to pick one arbitrarily. (And it can't really say "this or that", because it might be "this token or that sequence of tokens", and that quickly blows up in terms of memory and CPU time.) The key point is that lexing is done with no context: you can't make a token be one thing or another depending on the preceeding tokens.

Now that I understand why regexes act like they do, their shortcomings are a lot less annoying. I also realised that I was trying to make the lexer do too much. I should just break everything into "words", and later check whether they have globs or not (and reject if necessary).

I haven't started to implement this approach yet, but I think it's going to make everything much more pleasant. I don't expect to like it nearly as much as Haskell's Parsec, but I do expect to not finish the project wondering why anyone would ever choose to use JavaCC.

There's been precisely one reply to my forum thread asking for clarifications, and that was another student saying he wanted some as well. That's annoying.

From an email that the Bristol airsoft site sent me:
1st April 2010

A team of 15 models are coming down to play against Bristol Airsoft.

These girls may need some help being shown what to do as they haven't played Airsoft before. So if you think you can help then please come down.

Accompanied by an image of a well-oiled girl in halter top and short shorts with a revolver.

Basically this reads to me like, "you're a bunch of horny adolescents who are incapable of attracting girls, so we've paid some for you to fawn over." (Much like GameCrush.) It seems pretty disrespectful, and it's made me less inclined to go back.

(On the other hand, I don't have a problem with the next line: "There will be a cash prize on the night of £100 and a fully paid for night out with one of the models!" But I don't understand how this event can possibly make money, unless they fit far more people on-site than I can imagine would be fun. Or charge an extortionate entry fee, which I can also believe because it wasn't specified in the email.)

I'm working tomorrow, and probably next week, which is good. I'll get about £40-50 for it, I guess. I don't yet know exactly when I'm going back to Coventry, but it won't be long after that.

(2 comments | Leave a comment)

March 26th, 2010


10:21 pm - Mostly budgeting stuff
Read more...Collapse )

(Leave a comment)

March 15th, 2010


10:59 pm
Cut for lengthCollapse )

(Leave a comment)

February 8th, 2010


01:14 am
Although there's no proscribed word count for second year essays, apparently most of them are 2500-3000 words. Mine is roughly 3300 and I'm not yet finished. So I figure I should probably wrap it up soon. I worry that I haven't included enough mathematical content, which is semi-deliberate: I know I can do maths, so I'm more interested in seeing whether I can communicate the ideas well without explicitly resorting to theorem-proving and the like. It's also because I don't find the actual maths involved in cryptography (at least at this level) to be all that interesting. RSA is a cool idea, but could be implemented in many different ways. There's nothing about the factoring problem in particular that makes RSA possible, so explaining the implementation of RSA using the factoring problem doesn't seem important.

I wanted a pair of fingerless gloves to play ocarina in when it's cold outside. I couldn't find any in Tesco. So I bought a cheap knitted pair, and cut the fingertips off. Then I tried to work out how I should sew to keep them from unravelling. I got the basic idea (turn inside-out, fold, and cross-stitch the hem down) on my fourth attempt, and now I seem to be getting pretty good at it. The last one took less than half an hour. It doesn't look very good, but that's partly because I deliberately chose bright thread so I could see what I was doing. I still have two fingers to go, and then I might redo some of the earlier ones if I decide they need it.

I also lost the cloth bag that came with the ocarina, so I made a new one out of bubble wrap and string that were lying around in my room. It's not as good, but it works, and it justifies my "well, you never know when a ball of string and a roll of bubble wrap will come in useful" buying habits.

Jon was involved in a musical put on by Singaporean society. Tickets were £10, which I was never going to pay, but his mum came up and bought me a ticket. It was a really bad musical. The acting and singing were mostly competent, but the script was awful. Mostly in terms of characterisation and plot development... I don't feel like I have the vocabulary (or memory) to fully describe what I didn't like about it, although I could take various bits and explain what was wrong with them. (Example: if a character has a solo song with nobody else on stage, she's talking to the audience. Noone actually sings about their problems, but we suspend disbelief because it's our window into the world. If another character overhears them, that violates expectations and disbelief comes crashing down around us.)

Fortunately Jon's mum was even less impressed than I was, so I didn't have to pretend to like it (or to feel rude about not liking it, which would have been easier). But the experience was mildly depressing. How did something so bad get produced? Did the people involved feel guilty about charging £10 for the experience? Or did they honestly think it was worth that much? Why didn't they get anyone involved who knew what they were doing? The best thing about university is that you're surrounded by intelligent people, and some of them must know something about scriptwriting.

I guess I'd like to expect some level of competence from people, or at the very least honest self-evaluations. I don't like the idea that you can succeed without those. But it seems like they didn't happen with this production, and it sold a lot of tickets anyway. (The venue seats at least 500, at a guess, and seemed to be nearly full.) That makes me a little sad.

(Leave a comment)

January 29th, 2010


11:05 pm
Yesterday I sent the guys who sold my ocarina a message asking if they had an ETA or a tracking number. That was around midday. They replied within a few hours, saying it should have arrived by now, and if I didn't get it by the end of the week they'd give me a full refund. Then when I got home it was waiting for me; I think the postman had tried to deliver it sooner, found nobody in, and took it back to try again later. I know they were probably motivated in part by the risk of me giving negative feedback (which I wasn't threatening and wouldn't have done, but they couldn't know that), but it was still very generous of them. My annoyance at their not having sent a shipping confirmation email has vanished, and I'm happy to have supported them.

I'm also very happy with the ocarina itself. At first I thought the high notes sounded a bit feeble, but then I realised I just needed to blow harder than for the low notes. It makes a nice sound, it feels sturdy, it fits in my pocket or hangs around my neck. The range is almost two octaves, from A3 to F5. I'm not very good at playing it yet, but I'll improve. One minor annoyance is that on my (fairly quick) searches I haven't been able to find any Zelda sheet music for ocarina. The best I found was for clarinet in Bb, but everything seems to have a couple of notes which are just above my range. (And I assume it'll sound slightly weird since my ocarina is tuned in C, but I don't know much about that.)

On Sunday, Airsoc went to an airsoft site based in a disused shopping mall in Reading. I was really looking forward to it, but found it to be a little disappointing. Most of the fighting seemed to happen at chokepoints, where you just get a lot of people milling around unable to do anything without getting shot. Fighting across the main open part was fun, but the number of people involved meant little progress was made by either side. There was a play area (including ball pool) which I would have really liked to fight in, but it only came into play for the first game and I was assaulting it. (Double annoying: I was supposed to start off defending it, with defenders swapping sides when they died. But I was late joining, partly because I had to help sort out people with rental guns and partly because I took a long time to load all my mags, and they put me on the attacking side to begin with.) Also there was quite a lot of cheat-calling, which isn't pleasant to hear.

I think with smaller teams, it would have been a lot more fun. With no way to effectively guard every possible entrance to a large area, there would have been a lot more action. It's a tautology to say that on any site, teams being too large will diminish the fun. But I think CQB sites need to be a lot more careful than open sites, because it's so easy to get chokepoints. Of course, I've only played at four different sites, and the Grange is the only one I've been to more than once, so I can't speak with much authority.

We're going to the Grange this Sunday, which will make three times in one month for me. Over christmas I got an extended tightbore barrel for my P90, which I haven't been able to test properly yet: I couldn't see well enough at the mall or the crown court (in Bristol) to easily judge how consistent it was being. But it did chrono surprisingly low at the mall (less than normal, and tightbores are supposed to increase fps), and what I could see didn't look promising. So I'm somewhat resigned to the idea that it might have been a bad investment. But not a massively expensive one (less than £15), and at least I've still got the old one. I'll be able to find out at the Grange, where I can see better.

I don't think I'm working as hard as I should this term. My progress on my essay is slow, partly because I'm not properly utilising the blocks of time that I've set aside for it. Algebra is the only module for which we have to hand in assignments; so far only one is due, and I did it but forgot to give it in before the deadline. What's slightly worrying is I remembered less than five minutes late, when I was just heading into a lecture near where it needed to be handed in. I probably could have got it in without anyone noticing, but I decided I couldn't be bothered. I didn't even know at the time that only the best 4/5 count. Most of my other modules have problem sheets, but only metric spaces hands them out. I've done the first of those and some of the second, and barely looked at the third. The other problem sheets are only online, and I haven't downloaded any of them.

(2 comments | Leave a comment)

January 23rd, 2010


08:03 am
In the half year since my last post, things have happened. I'm not even going to try to document most of it. It would take too long and be boring.

Last Sunday I went to a Celidh with John and Jo and Becky. John was going because his friend was having a birthday party there, Jo and Becky wanted to go, and I tagged along because they invited me and I thought it might be fun even though I didn't know what one was. I was right. There's another one on March 14th which it seems likely that people will be going to, so I probably will as well. There may also be an airsoft skirmish that day, in which case my legs will probably be sore for a week afterwards.

My headphones broke recently. They still play music, and some of it is recognisable, but it sounds horrible and vocals in particular are almost impossible to make out. I'm not too upset. They lasted over two years, they were pretty cheap, and they sounded good while they lasted. I would happily replace them, but the only time I listen to music lately is when walking to/from campus, which is only ten minutes with a high chance of seeing people I know. It seems really antisocial to cut myself off from the world in that situation. So instead I bought an ocarina, because HT had just posted a list of good cheap ocarinas and where to buy them. My plan is to play that instead of listening to music.

I ordered it last wednesday and it hasn't arrived yet, which is annoying. I think I remember seeing a ten-day delivery estimate, which will be up when the mail arrives today, but I can't find that any more. Shipping from Korea was $6.99, so I wouldn't expect it to be super fast. But what bugs me is they haven't sent an email saying "we've shipped your order, expect it by this date/here's a tracking number". So I have no idea when I should start making enquiries if it doesn't arrive. And I think the mail sometimes arrives at a time when noone's home, so I can't be certain that it hasn't gone back to the post office with a note through our door that we didn't notice or something.

Last night we managed to cook for and feed something like 18 people in this house. It was pretty impressive. I think 8 or so of them are still in the lounge, either sleeping or trying to. I haven't slept; I need to get up at 6am tomorrow, so my plan is to get an early night, ratheer than trying to get to sleep less than twelve hours after waking up, as I would do if I slept now.

I had two/three exams last week. Data Structures and Algorithms shouldn't have been bad, but I was stupid and didn't write an algorithm I'd discovered for one question because I wasn't sure it was correct, which probably cost me a considerable amount. Algorithm Design, in the same paper, went better. Math Stats also went surprisingly well. I don't know when I get results.

(Leave a comment)

June 26th, 2009


07:05 pm
Read more...Collapse )

(6 comments | Leave a comment)

> previous 10 entries
> Go to Top
LiveJournal.com