Cricalix.Net

March 30, 2007

MySQL merge tables

Filed under: $work, Code — cricalix @ 18:29

A few years ago, when defining a table, I wasn’t very savvy to the fact that MySQL uses 4 byte pointers for the MyISAM data files (by default). This has subsequently bitten me in the rear a few times, enough for me to learn about altering the table with a max_rows argument, and to define the default pointer size in my.cnf. Unfortunately, the $work installation of MySQL has a bug - the default pointer size in my.cnf gets ignored. This leaves me creating all of the various tables with a manually specified max_rows to ensure that I don’t get bitten.

Enter a legacy table from a few years ago that just hit the pointer limit. The only solution I had in my arsenal is to rebuild the entire table with a larger pointer size. The last time I did this, it took 3 days. 3 days to rebuild the indexes for a 4 GB table. This time around, I tried a method that involves creating a new table definition without the indexes but with larger pointers, copying in all the old data, copying the old index file to the new index file, and executing a repair table. Unfortunately, while this method is meant to be faster, it only works when you can fit all of the keys into memory, otherwise it uses a slower rebuild method. 2 GB of RAM isn’t enough to hold all of the keys :(

So, chatting with Dad, he started to say something that tickled the grey cells. Namely that MySQL has a merge table format that can merge two (or more) identical MyISAM files, and support reads from both underlying files, while specifying where the writes should go. This means I can create a new underlying table with the new pointer size, then overlay the merge and specify the new table as the target for the writes. Total time to perform - 10 seconds, most of which is typing! Much, much better than 3 days.

March 29, 2007

Designing web interfaces

Filed under: $work, Code — cricalix @ 9:50

Designing web interfaces is something that gives me grief. I’m not exactly the most elegant web designer in the world - interfaces that look like a bunch of stacked rectangles are fine as far as I’m concerned. They may not be pretty, but they are functional. Unfortunately, when doing $dayjob stuff, it has to be presentable to our customers, and they’re not always as technical as I am, so the interface needs to be ‘pretty’.

For the longest time, I’ve usually sketched a rough outline on a bit of paper, and then tried to implement the basics of it in HTML and CSS. I then hand it over to our actual web design guy to make sensible and prettier. Enter, stage left, QT designer. Yep, it’s a GUI UI designer, but it has drop-downs, text labels, text inputs, check boxes and radio buttons - which is exactly what a web browser has access to when rendering your bog standard HTML.  One print-screen later, and I have a nice mock-up of what I want the interface to look like, rather than a badly drawn version.  It’s also a heck of a lot faster to drag and drop UI elements than sit and churn out HTML code.

March 28, 2007

Replanting the left bed

Filed under: Gardening — cricalix @ 8:54

Yesterday was a good day for gardening, so when I got home, I changed into my nice dirty jeans, picked up the fork, and started working on the left-hand bed in my garden. The soil quality wasn’t horrible, but it wasn’t what I’d call good soil either. Compared to other spots in the garden, the soil was quite solid, and it also dried out very easily. I decided that I actually liked the plants that were in the bed, but that I’d re-arrange them while working on the bed.

Step 1 - Start taking plants out. Rather than take them all out at once, I decided to just start at one end of the bed and work my way towards the other end, lifting each plant out as I went. The big hebe (a hebe buchananii) really didn’t want to come out of the ground, and required liberal application of the pick-axe/trenching tool to get underneath the root ball and lever it up. It also got a good trimming while I was at it, as it was a bit large for the bed. The rest of the plants came up with nary a protest.

Step 2 - Fork the entire bed over.

Step 3 - Fold in 100 litres of manure, and 75 litres of compost.

Step 4 - Choose new locations for all of the plants, dig new holes, wet down the holes and put the plants back.

Step 5 - Collapse into a chair with some hot food, as I’ve been working flat out for over 2 hours.

March 23, 2007

A fishy update

Filed under: 42, Gardening — cricalix @ 14:25

Mum and Dad were over last weekend - Mum was dropping off two California Glories from their garden (they’re moving, and the Glories aren’t the nicest plant to hug). A bit of labour later, and

  • the hole in the pond was fixed (created by Mum and I lifting some water plants out a week or two before),
  • the two plants were in the ground,
  • the trench for the armoured cable was started,
  • the compost bin was restarted,
  • the junk crazy paving that was being used as a wall was removed, the bricks underneath were removed, and logroll was installed,
  • the lawn was mowed,
  • and I had three new fish in my tank (thanks to Dad, Red Dwarf Gouramis).

dsc_0288.JPG

dsc_0314.JPG

dsc_0306.JPG

March 20, 2007

Finding the past

Filed under: 42, Photography — cricalix @ 17:10

The ‘net is one of the more useful things in my life. It serves as a repository of knowledge of all types - once judicious filtering is applied. Out of curiosity I went hunting on Flickr for pictures of Barbados. As I browsed through the 25,000+ photos, I ran across a name that looked really familiar from when I lived in Barbados. One e-mail later, with confirmation going both ways (me asking if he knew someone we both knew, him naming me after my height and the community college I attended), I now know that he is indeed someone I knew :) No idea if anything more will come of it, but the knowledge is now there.

I think one of the best effects that the ‘net has had is the reduction of the distance between friends and acquaintances, old and new, known and unknown.  Who knows what it’ll do in the future.

March 19, 2007

Wishing..

Filed under: 42, Photography, Technology — cricalix @ 14:48

Once I sort out the mortgage thing (which requires expenditure to save money, yay), I’ve got a nice short list of material things that I’d love to get my hands on to support my photography.

  1. Small GPS unit - the Navi GPS looks to be the ticket at under £80. The Nikon D80 doesn’t have GPS support, but continual track logs saved on a SD card + accurate timestamps would let me merge the two data sets (and EXIF supports geo-tagging).
  2. New PC. My P4 1.7 laptop staggers under the load of RAW editing with the D80. I’d like to keep the laptop for travel (or give it to someone/where that can use it) and get a decent modern box - say a Core2 Duo, 2 GB RAM, half-tera+ of RAID, external archive setup, 22″ display and something in the NVidia 7800+ range. Considering how long the laptop lasted, that should last me quite a while too.
  3. Lightweight tripod. Manfrotto or similar, probably carbon fibre. The Slingshot I use has a loop that might work for strapping the tripod to the bag.
  4. A fast, sharp prime for the D80. 50mm?
  5. A unicorn!

Well, maybe not a unicorn. The upkeep on one of those is probably a bit more than I can afford. Ah well, perhaps by the end of the year I can get the new PC at least.

March 14, 2007

Squirrels

Filed under: 42 — cricalix @ 15:19

For a mental break today, I sat in what might be described as a cross between a lounge and waiting room at work, and stared out the plate-glass window at an old tree. I think it is an oak tree, but without leaves, I really can’t tell (and even with leaves, the chances of me correctly identifying a tree in England are virtually nil). As I sat there, sipping my tea, a squirrel bounded onto the tree, and perched on a branch. A few small birds fluttered around it - darting to and fro from twigs, occasionally pausing to peck at something (or rub their beaks, it was hard to tell).

The squirrel seemed quite oblivious to the birds, and started a train of thought. Is the squirrel male or female? Is it happy? Is it eating that nut for pleasure, or because it’s hungry? (Probably the former, animals don’t seem to eat for pleasure according to a foggy memory.) Do the birds even factor in to how it views the world? If they do, are they a threat (probably not, unless a kestrel?), a hindrance, or just something that exists?  Does a squirrel know it exists?  What is its view of the world like? What’s it like to have a tail? Will it survive to this time next year? Why that tree, and not another tree? Why a tree at all? Why isn’t the squirrel moving? Why did it just move? Where did it go?

Next Page »

Powered by WordPress. Theme by H P Nadig