Thursday 28 June 2007 at 10:46 am
Day 4 is going well. My typing is slightly faster - I now know where the keys are somewhat. I haven't dared to code in it yet (but I have a feeling that there will be a few variables named "aoeu" :P).
I think my home row keyswitches are not liking this :)
Wednesday 27 June 2007 at 2:06 pm
I wish I had gotten round to this earlier... but I never knew how good it was. It feels very strange to not move off the home row so often. The QWERTY keyboard feels so random now. The truth is that's because it is... curse you Sholes!
I'm not typing this particurlarly fast, or without frequent use of the keyboard viewer (If you want to learn to touchtype, don't look at your fingers). But I'm slowly gaining experience and speed. For only the third day I'm happy with where I am.
I still do all my major work in QWERTY, as at the moment it's faster than my Dvorak skills and I can't afford the productivity loss. But everything else, like now...
Tuesday 26 June 2007 at 09:07 am
I think that I am beginning to get used to this layout. One thing that I notice is that it's scary how little my fingers actually leave the home row. I wish I'd started learning this earlier...
QWERTY is such a random arrangement of keys...
Monday 25 June 2007 at 11:37 am
Dvorak: Day 1
I noticed in the usual fashion that a few of my keys weren't working. Removing them caused me to find that it was due to the usual buildup of... stuff. So I took them off and cleaned under them. Well then I got a bad idea. Let's put all the keys on in the Dvorak layout.
And so now I'm typing in Dvorak...
Thursday 21 June 2007 at 8:07 pm
(click for full size)
Download:
Colour Cube 1.0
[blockquote>This is an attempt to make a colour cube in Quartz Composer. Works quite well, and looks quite good, especially on a bright monitor![/blockquote>
Download:
kw_numbers
[blockquote>If you like Kraftwerk, this may look familiar. If not, watch
this. Oh, and excuse the internal workings of these, if you decide to open it up in Quartz Composer and take a look. These were one of the first things I made :)[/blockquote>
Download:
numbercolumn
[blockquote>A bunch of columns of ever-changing numbers.[/blockquote>
Download:
Tunnel
[blockquote>A blue, ever-spinning, and flying tunnel.[/blockquote>
Saturday 09 June 2007 at 7:31 pm
Alright, time to release some stuff that I've had lying around.
ae_ioctl_dump
Dumps a bunch of parameters of the wireless driver in OS X. You might also recognise it as the source of the code in the header.
confreg
Source to a config register calculator for Cisco routers on Palm OS.
datausagev2
Program to display the data usage over a connection for Palm OS. Known to be unstable - anyone know why?
macfisheyequake
The
Mac OS X version of Quake 1 with the
Fisheye Quake mod applied.
midisound
Some attempt at messing round with MIDI instruments. Could be useful for something.
Wednesday 06 June 2007 at 7:50 pm
Create a packet in libnet. Inject it at layer 2 with a custom source MAC address. Inspection in Wireshark reveals that the packet has YOUR source mac address on it. What?
Copy/paste the packet bytes, mangle them into a hex string with a bunch of terminal commands, modify the MAC address and send it out with libdnet. It works. Great.
So what's different?
eth-bsd.c from libdnet line 62
[blockquote>
#ifdef BIOCSHDRCMPLT
i = 1;
if (ioctl(e->fd, BIOCSHDRCMPLT, &i) < 0)
return (eth_close(e));
#endif
[/blockquote>
Alright. I wonder what BIOCSHDRCMPLT is for...
And what does libnet do at the same point?
libnet_link_bpf.c from libnet line 166
[blockquote>
#if defined(BIOCGHDRCMPLT) && defined(BIOCSHDRCMPLT) && !(__APPLE__)
if (ioctl(l->fd, BIOCSHDRCMPLT, &spoof_eth_src) == -1)
{
snprintf(l->err_buf, LIBNET_ERRBUF_SIZE, "%s(): BIOCSHDRCMPLT: %s\n",
__func__, strerror(errno));
goto bad;
}
#endif
[/blockquote>
Ohh... but why is it not doing it on OS X?
For those of you that just go "What the hell", I'll fill you in. It's calling an ioctl, which stands for io control. This is a way of telling a dev node (a 'file' in /dev) to do something different, essentially.
The dev nodes we are playing with are bpf nodes. BPF stands for Berkeley Packet Filter, and is essentially a way of allowing userspace stuff (stuff that runs outside the kernel i.e. your apps and OS processes) to mess with layer 2 (raw frame) packets.
The flag we are setting from the ioctl (or not, because this code is set not to be used on a Mac OS X machine) is BIOCSHDRCMPLT. It stands for something involving source header completion. When it's off, and it is normally, it writes your MAC address into the "source" header of every frame you send. Regardless of if it is really your MAC in there already. Great for 'normal' usage, but suppose you wanted to send it with another MAC in there? In this case, we turn this flag on, and it tells the kernel that we want it not to write our MAC address into the packet. As a result, the packet is sent with the MAC address we want, and we (or at least I) am happy...
So, what to do? Easy. Comment out the #if line and recompile. Or get rid of the "!(__Apple__)". Easy.
I suspect this was because Mac OS 10.3 (the previous version for you non-Mac users) had the BIOCSHDRCMPLT flag defined, but didn't use it. There was a
patch that was later submitted and included in 10.4's version of the kernel. And I guess the libnet developers got busy, and didn't look when Tiger came out. Oh well.
Tuesday 05 June 2007 at 12:08 pm
Suppose you had a brilliant quartz composition that you wanted to make into a standalone player app. Give someone the .qtz file... but they don't have quartz composer. They can play it in Quicktime Player with some limitations... but that has it's own set of issues (30 seconds playback etc). Anyway... here's how to make it into a standalone app.
Install the Xcode tools from
http://developer.apple.com/tools/download/. (You do have to sign up for an account, but it's free, unlike Microsoft who don't have anything this cool, and want you to pay for their tools :) )
Anyway, take a look at the /Developer folder in the root of your hard disk. Open up Extras, and look in Palettes.
Double click the QuartzComposer.palette file. A program called "Interface Builder" should open, and you should see it start up with one window that looks like this:
You just installed the Quartz Composer palette into Interface Builder, so it can now be used in your apps.
Now look in /Developer/Applications/Graphics Tools. Open up Quartz Composer itself.
I'm not going to go over how to actually use Quartz Composer here (that will be a future article). If you don't know how to use it, you can wait, or go elsewhere to find out.
Anyway, make your composition. Here's one I prepared earlier.
Save it to your Desktop (or anywhere else).
You can now quit Quartz Composer. That step is done.
Open up /Developer/Applications, and fire up the app named Xcode in that folder. If it is the first time you have launched Xcode, you will have it ask you about preferences. You can normally just click next all the way through that.
Go to File -> New Project.
Choose Cocoa Application under Application for the project type.
Don't be alarmed at reading the description if you don't know what Objective-C is. You won't actually be writing any code here, thanks to the magic of Cocoa.
Give your project a name, and save it somewhere.
You should then see a window like this:
There are some things you see in the right hand column.
The Framework files are libraries that the app is linked to. A framework is basically a set of functions that allow an app to do something. These four frameworks provide essential things to the app.
Info.plist and Info.plist.strings provide info about the app. We won't bother editing them, but if we were making a "real" app, we probably would.
Note how Info.plist.strings has "(english)" after it? Info.plist.strings stores information about the app, but can have multiple copies of it for different languages. This is called localization.
main.m contains the main code for the app. It very rarely needs to be touched, even in large Cocoa apps. You'll see it contains a few lines of code. This is what the program does when it very first starts up. The function named main() is called, and this piece of code then executes NSApplicationMain, which drops the app into it's Cocoa stuff. You don't need to know this, and if you don't understand this, just continue. It's not important at all.
MainMenu.nib is the nib file for the app. Essentially it contains the user interface of the app, and it is the one file we will edit. It too has an "(english)" after it, meaning that it can have multiple copies of itself for different languages.
The next file down on the list, test composition.app is highlighted in red. This means that the file is missing. Don't panic - this is meant to be missing. It is the end result of our process and has not been created yet.
Below this is test composition prefix.pch. Don't worry about this one, it's not important at all.
Double-click on MainMenu.nib and it comes up in Interface Builder.
If the top right palette isn't showing the Quartz Composer set, select it with the buttons in it's toolbar.
Hit command-shift-I and you should see a new window pop up. This window is the inspector, and allows you to set the parameters of the currently selected object.. It should come up for the window here.
What you have to do here is very simple. See the big blue "Quartz Composer" view in the pallete? Drag one into the window, and it puts a black square in the window. Drag it to the top left, and it should snap into place. Then use the resize handles to resize it to fill the window. When you're done, it should look like this.
Ok, so the sizing is good. But what happens when someone resizes the window? We need to tell Interface Builder that we want this to stay the exact size of the window.
This is simple - choose "Sizing" in the pop-up menu of the inspector. In the "autosizing" part, click the horizontal and vertical lines inside the centre box. Note how they turn to springs? It should look exactly like this.
Now choose the "Attributes" view in the inspector. You should see something like this.
Click "Load..." and find the .qtz file you created earlier. Load it in. The view will stay black, but it's loaded.
Hit command-R to test the interface. All the Interface Builder windows should hide bar the one are working on. Your Quartz composition should now start playing. This is what your app will look like when you are done.
To get out of this, hit Command-Q. Don't worry, this won't quit Interface Builder (unless you hit it a second time).
Save, and quit Interface Builder.
Now, for the final step in Xcode. Remember before when I mentioned about what frameworks do? We need to add the Quartz framework so that our app has access to all the Quartz functions.
Control-click on one of the items in the list. Choose Add -> Existing Frameworks...
Now navigate to /System/Library/Frameworks/ and select Quartz.framework from the list. Hit "Add".
In the dialog box that comes up after that, just click add again.
In the Xcode toolbar, hit "Build and Go". Your app should fire up, and it should do the same thing it did in Interface Builder's test mode.
And now for the grand finish. Quit your app, and go back to Xcode. In the "Run Log" window, change Build Configuration from Debug to Release.
Easy. Now hit the "Build" button in the Xcode main window.
Now look in the build/Release subdirectory of the folder you created the Xcode project in. In this is the end result.
Coming next time: How to add interactivity to your Quartz Composer application including text fields, sliders and other fun.
Sunday 03 June 2007 at 11:07 pm
You'd expect that someone like me wouldn't want to use something like MSN. For some very good reasons such as the fact that it is unreliable, and unencrypted. (Jabber all the way :D). But there are times, and not everyone has or knows what Jabber is, or why exactly it's better.
For your benefit, avoid mentioning any of the following strings in a MSN message. The message will be silently dropped for no reason in particular. (Unless you are not using the official MSN client, in which case you get an error message saying the message was dropped.)
1. download.php
2. .scr
3. .pif
4. profile.php?
5. gallery.php
For some reason 4 only works with the ? there.
There was some talk about
www.scroogle.org being banned, a while ago. It's not itself a banned word, but take a look at item 2 on the list :)
Also, you used to be able to make a groupchat disappear by saying one of these. Doesn't work any more (only ejects you from it, not everyone. Fun while it lasted though :)
Sunday 03 June 2007 at 7:14 pm
[blockquote>Microsoft Award Team
20 Craven Park, Harlesden
London NW10,
United Kingdom.
Ref: BTD/968/06
Batch: 409978E
Dear Lucky winner,
The prestigious Microsoft and AOL has set out and successfully
organised a Sweepstakes marking the beginning of year anniversary we
rolled out over 100,000.000.00 (One Hundred Million Great Britain
Pounds) for our beginning of the year Anniversary Draws. Participants
for the draws were randomly selected and drawn from a wide range of web
hosts which we enjoy their patronage.[/blockquote>
Microsoft / AOL are prestigious? What?
Beginning of the year anniversary? But it's June (oh wait, this IS a Microsoft system, I suppose that's how long it took for Vista to boot)...
[blockquote>
The selection was made through a computer draw system attaching
personalised email addresses to ticket numbers.Microsoft and AOL are
now the largest Internet companies and in an effort to make sure that
Internet Explorer remains the most widely used program, Microsoft and
AOL are running an e-mail beta test.
[/blockquote>
Scary, Microsoft and AOL combining. I can't see it happening, you can't have THAT much lameness in one place!
The bit about somehow ensuring IE remains the most widely used I don't believe, but how would spamming people help? The only thing IE has to do with email is that it can be used to browse webmail sites...
[blockquote>
Your email address as indicated was drawn and attached to ticket
number 008795727498 with serial numbers BTD/9080648302/06 and drew the
lucky numbers 14-21-25-39-40-47(20) which subsequently won you
1,000, 000.00 (One Million Great Britain Pounds) as one of the jackpot
winners in this draw. You have therefore won the entire winning sum of
1,000,000.00 (One Million Nine Hundred Thousand Great Britain Pounds).
The draws registered as Draw number one was conducted in Brockley, London United
Kingdom on May 20th, 2007.
[/blockquote>
Since WHEN is 1,000,000.00 equal to one million nine hundred thousand? Did you use some new Microsoft/AOL technology to calculate that?
[blockquote>
Please be informed by this winning notification,to file your claims,you
are to make contact with your designated agent who shall by duty guide
you through the process to facilitate the release of your prize.To file
for your claim Please Contact your fiduciary agent
Mr. ken Gate
Microsoft Promotion Award Team, Head Winning Claims Dept.
Email:
fiduciarymicrosoftclaimsagent@gmail.com
[/blockquote>
A Gmail address? Nice. But beware the wrath of Gates :)
Oh, and have fun with your spam filled inbox.
[blockquote>
Our special thanks and gratitude to Bill Gates and his associates.We
wish you the best of luck.Thank you for being part of our promotional
award program and commemorative Anniversary Draws.
[/blockquote>
Best of luck in laughing at your spam? Yeah. Thanks.
[blockquote>
Sincerely,
Dr.Olivia Holland
Head Customercare Service, Microsoft Promotion Team.[/blockquote>
Did someone read this spam before sending it? Now get out of my inbox.
Saturday 02 June 2007 at 10:19 pm
I don't cover too many news stories, but this one made me laugh.
Suppose you are a mechanic fixing a police car in your garage.
Stupid: Doing a burnout in the workshop in it.
More stupid: Filming you and your mates doing it.
Even more stupid: Posting the footage up on the internet!
Even Even more stupid: Not realising you jerked the camera to the left and captured a few frames of your garage's sign in it...
More info, and video here