Networked SQLite
I've been
playing around with SQLite for some time now, and one
of the things I thought I'd try out was a client-server
version of the database - so here it
is. It's a pretty
basic implementation, but there was some chatter on
the sqlite mailing list, so I thought I'd package it
up and release it.
I originally wrote a lot of this in Objective C, with proper classes and methods. In an attempt to make it a bit more portable for those who haven't seen the light, I stepped down to using Foundation and plain-old-C, well apart from the demo client code anyway. ObjC is *so* much nicer than C I had to use it there :) You can get FoundationLite from Apple's website, and that should be all you need to compile against this source-code.
This is an earlier version of the code I used in a work project, so it has less functionality than the one I have at work, but I may start to fold some of that back in. I guess, as long as I re-implement rather than copy, I'm probably ok. Work are using a whole slew of my code anyway, so I reckon we're even on that score :)
The source is freeware - do with it as you please. If you'd like to credit me somewhere, I certainly wouldn't say no, but that's not necessary.
Run the server with 'sqld -I' to initalise a database in /opt/db, then do 'sqlc -u root -p sqld -d sqld' to connect to the server from a different terminal (there's -h server-hostname as well, if you want to connect via TCP). There's an auth table (initially set up as user=root, password=sqld, database=sqld) and a 'create database' pseudo-command to create new databases (which are just files in the install-dir (/opt/db by default).
This version doesn't have 'show tables', 'desc tablename' etc. The authorisation stuff does work, or at least it should. It doesn't have the change-management feature either (where different connections are notified asynchronously that cols X,Y,Z have changed in rows A,B,C in table T. I'll probably get around to putting those things back in. I think I had server-side plugins working as well - so pseudo-commands could be implemented ung loadable plugins.
It's all based around a simple packet-library concept which abstracts the network-transport. It looks a bit ugly in plain-old-C, but it does work reasonably well. Example packet dump from the server which corresponds to a client-connection trying to authenticate against the server (the three fields are 'username', 'password' and 'database')...
I originally wrote a lot of this in Objective C, with proper classes and methods. In an attempt to make it a bit more portable for those who haven't seen the light, I stepped down to using Foundation and plain-old-C, well apart from the demo client code anyway. ObjC is *so* much nicer than C I had to use it there :) You can get FoundationLite from Apple's website, and that should be all you need to compile against this source-code.
This is an earlier version of the code I used in a work project, so it has less functionality than the one I have at work, but I may start to fold some of that back in. I guess, as long as I re-implement rather than copy, I'm probably ok. Work are using a whole slew of my code anyway, so I reckon we're even on that score :)
The source is freeware - do with it as you please. If you'd like to credit me somewhere, I certainly wouldn't say no, but that's not necessary.
Run the server with 'sqld -I' to initalise a database in /opt/db, then do 'sqlc -u root -p sqld -d sqld' to connect to the server from a different terminal (there's -h server-hostname as well, if you want to connect via TCP). There's an auth table (initially set up as user=root, password=sqld, database=sqld) and a 'create database' pseudo-command to create new databases (which are just files in the install-dir (/opt/db by default).
This version doesn't have 'show tables', 'desc tablename' etc. The authorisation stuff does work, or at least it should. It doesn't have the change-management feature either (where different connections are notified asynchronously that cols X,Y,Z have changed in rows A,B,C in table T. I'll probably get around to putting those things back in. I think I had server-side plugins working as well - so pseudo-commands could be implemented ung loadable plugins.
It's all based around a simple packet-library concept which abstracts the network-transport. It looks a bit ugly in plain-old-C, but it does work reasonably well. Example packet dump from the server which corresponds to a client-connection trying to authenticate against the server (the three fields are 'username', 'password' and 'database')...
Zune humour
So, it never occurred to me to rotate the Zune logo, but then I read 'roughlyDrafted.com' and just had to laugh. I'll let y'all decide for yourself what it spells...
I can't see Apple ever making this sort of mistake. What with the colour brown, this fiasco, I think we're getting a clear idea of how MS thinks of the Zune, and it's not pretty...
Screw Comcast
That's
actually been the name of my airport network at home
for quite some time now. It's finally become an action
as well.
The last straw in the litany of failure that is my Comcast internet connection is their unilateral attack on network neutrality. Comcast are interfering with the broadcast of packets between users on the network, if either the source or destination is within their domain. Worse, they're doing it in a particularly vile manner - effectively they're using a computer-hacker attack called the 'man-in-the-middle' attack. When they decide you're using too much bandwidth, they (sitting in the middle of the communication link) fake a packet to *both* of the communicating computers, this packet is an 'RST' packet, or 'reset' packet. What this does is tell the computer that receives it that the *other* computer has dropped the connection. So both computers think something is wrong with the other end, and the communication is terminated. This is pure unadulterated evil.
Now I'm not a huge user of P2P (which is where the news broke). I *do* however use iChat to keep in touch with my family across the Atlantic. It's a cool video-conferencing system built into all macs, and since my family all have macs, it works well. Since there's several thousand miles between us, it's one of the few ways we can 'see' each other without major travel.
Until a few months ago, iChat worked great. Now, I get less than a minute of great picture, and then everything breaks up! I was putting it down to transatlantic bandwidth issues, but then I tried it from work, and (lo and behold), there's no problem, looking around the net, it seems I'm not alone. This *did* annoy me. I doubt I use even 1% of the bandwidth I pay Comcast for, and when I do want to use some, they have a specific policy preventing me from doing so. It seems I'm allowed to pay Comcast for their services, just not to actually *use* those services ever.
I currently pay Comcast the princely sum of $185-$200 per month for both TV and internet, I've just ordered Dish Network, and will be cancelling all the Comcast services as soon as Dish and an alternate internet are installed. Dish ($84/month) will be here on Saturday :) The only real problem was which internet service to go for. I currently have a co-located server in Fremont (serving this very web-page). I pay $245/month for a dedicated 10 Mbit/7U service (which is actually a good deal). I never use the 10MBit/s though, I max out at ~1Mbit, and 95% of the time it's down at a few tens of Kbit/s. So, although I'm very happy with the service, that's a waste of money too. So far, we're up to $430/month to reassign...
So, I was looking around, and found Sonic.net's T1-alike. Basically this is 2+ ADSL lines bonded together to provide 1.5MBit/sec dedicated bandwidth in both directions. Together with a managed Cisco router, it costs $299/month. Even if this doesn't pan out, there are plenty (covad.com, garlic.com, core.com, speakeasy.com ...) for around $350/month. Even paying the extra $50, I'm still paying less than the Co-Lo/Comcast Combo, and getting the servers installed in the garage makes maintenance a bit easier than driving down to Fremont...
So, the wheels are in motion. Screw Comcast. You just lost another $200/month...
The last straw in the litany of failure that is my Comcast internet connection is their unilateral attack on network neutrality. Comcast are interfering with the broadcast of packets between users on the network, if either the source or destination is within their domain. Worse, they're doing it in a particularly vile manner - effectively they're using a computer-hacker attack called the 'man-in-the-middle' attack. When they decide you're using too much bandwidth, they (sitting in the middle of the communication link) fake a packet to *both* of the communicating computers, this packet is an 'RST' packet, or 'reset' packet. What this does is tell the computer that receives it that the *other* computer has dropped the connection. So both computers think something is wrong with the other end, and the communication is terminated. This is pure unadulterated evil.
Now I'm not a huge user of P2P (which is where the news broke). I *do* however use iChat to keep in touch with my family across the Atlantic. It's a cool video-conferencing system built into all macs, and since my family all have macs, it works well. Since there's several thousand miles between us, it's one of the few ways we can 'see' each other without major travel.
Until a few months ago, iChat worked great. Now, I get less than a minute of great picture, and then everything breaks up! I was putting it down to transatlantic bandwidth issues, but then I tried it from work, and (lo and behold), there's no problem, looking around the net, it seems I'm not alone. This *did* annoy me. I doubt I use even 1% of the bandwidth I pay Comcast for, and when I do want to use some, they have a specific policy preventing me from doing so. It seems I'm allowed to pay Comcast for their services, just not to actually *use* those services ever.
I currently pay Comcast the princely sum of $185-$200 per month for both TV and internet, I've just ordered Dish Network, and will be cancelling all the Comcast services as soon as Dish and an alternate internet are installed. Dish ($84/month) will be here on Saturday :) The only real problem was which internet service to go for. I currently have a co-located server in Fremont (serving this very web-page). I pay $245/month for a dedicated 10 Mbit/7U service (which is actually a good deal). I never use the 10MBit/s though, I max out at ~1Mbit, and 95% of the time it's down at a few tens of Kbit/s. So, although I'm very happy with the service, that's a waste of money too. So far, we're up to $430/month to reassign...
So, I was looking around, and found Sonic.net's T1-alike. Basically this is 2+ ADSL lines bonded together to provide 1.5MBit/sec dedicated bandwidth in both directions. Together with a managed Cisco router, it costs $299/month. Even if this doesn't pan out, there are plenty (covad.com, garlic.com, core.com, speakeasy.com ...) for around $350/month. Even paying the extra $50, I'm still paying less than the Co-Lo/Comcast Combo, and getting the servers installed in the garage makes maintenance a bit easier than driving down to Fremont...
So, the wheels are in motion. Screw Comcast. You just lost another $200/month...
I want an upgrade to XP
I wanted to run some FPGA simulations, and some of the software (specifically the FPGA simulator environment) runs better on Windows, rather than Linux. So, like a good citizen, I go out and buy the 'Business' version of Vista, since that's all that Microsoft will licence to us Parallels users. That costs me $300 + Tax. I expect to get something I *want* when I pay that much money for something...
So, I get it home, install it under Parallels (which seems to go smoothly). So far, not so much of a rant... Have patience (something I am fast running out of)... What is it about Windows Vista that I dislike ? Pretty much everything in fact...
Top of the list has to be this 'genuine windows advantage' debacle. Advantage to *WHO* exactly ? I had started to download / install the FPGA software. Two thirds of the way through a 1.6GB (yes, Gigabyte) download, I get a popup saying it can't tell whether the machine is a genuine Windows machine, and the download hangs.
Ok, [deep breath, these things happen, I'm new at this I probably didn't read some documentation...] Cancel the download, go to the windows site, and validate. No, that doesn't work - "come back later" it says. Fine. Get another dialogue popping up about 5 minutes later telling me Windows is about to stop working, and I should reboot. WHAT ?? [sigh] Ok, reboot. That usually fixes operating systems from these guys.
Fine, now we're ready. Ok, restart that 1.6GB download...Wait for it... Wait for it... Yep, there's the dialogue, and *boom* goes my download. Cue significant swearing. Ok, so go to the site again, this time it wants to install an Active-X control, I let it, and I now have to reboot my computer. WHAT ??? [big sigh]. Ok reboot... The first thing that happens is I get the dialogue box (hey! look on the bright side, I didn't wait for 20 minutes and get 2/3 the way through my download this time!).
So, I visit the Miscreant^WMicrosoft site again and this time it announces my installation is apparently genuine. Well thank [insert random deities] for that.
That one has to be top of the list, but how about:
- That
(on a 20G partition) it's had the hard-drive churning
away now for over 3 hours! I'm assuming it's indexing
it for search, but [insert more random deities] THREE
HOURS for a mere 20 GIG ? And counting! It's making a
hell of a racket in my otherwise quiet office
- That
by default, I can't click on a zip file to download
the thing. It pushes a dialogue in my face and blanks
the page. So, I get it, the security model on Window
is so appalling, it can't tell the difference between
a virus and a zip file, but that's still annoying.
- Xilinx (in their
infinite wisdom) have https:// urls with http://
elements within them. IE hates that. Every single
page I went to, I had to click 'yes, I really want to
be here'. How annoying is that ? And this is the
*default* behaviour! Eventually I found the
preference to turn it off, hidden amongst a
half-million other options, all sounding pretty
similar. I'm reminded of the adventure line "you're
in a maze of twisty passages, all alike"...
This is just scratching the surface. I've been using XP for an evening, and already I loathe it; and I loathe it not because it's different, I loathe it because it's annoying, fiddly, exasperating, and seems to actively get in my way when I want to do something. I don't care that (for example) the menus are different - I can cope with differences in OS's, I've used well over a dozen of them over the years. I care that (a) I want to do something, (b) I make a reasonable attempt, (c) it recognises the attempt correctly, and then (z) prevents me from doing it, or at least makes it difficult. That gap in the middle is what is missing from the OS.
Computer operating systems are not supposed to be like "Adventure". That maze of twisty passages shows what a poor job the designers of the OS have done - it's simply awful. Both Linux and (to a far lesser extent) OSX have their issues, but nothing at all along the lines of how difficult Microsoft makes it to use your computer. Contrast the above with the OSX credo of "it just works", the lack of any "OSX genuine advantage" program, and perhaps we can see why 1 in 6 laptops currently being sold are Macs, even though they *don't* run all the "office" apps...
So, I want an upgrade to XP. I don't want to use this weeping pus-ridden leprous scab of an OS any longer. XP was merely awful, Vista is so much worse.
[rant over]