Blog
Page: 0 ... 5 ... 10 ... 15 ... 20 ... 25 26 27 28 29 30 31 32 33 34 ... 35 ... 40 ... 45 ... 50 ... 55 ... 60 ... 65 ... 70 ... 75 ... 80
Microcontroller arrived....
Date: 2/6/2008


I'm going to see if I can program it to display current economy figures in my car using the OBD-2 connector.
(3) Comments | Add Comment

Mac D'n'd
Date: 29/5/2008
This morning I did some work on the drag and drop support for Mac Lgi applications. Basically I'm playing with SetDragImageWithCGImage to add an image next to the cursor that displays the current drag verb as you move the mouse across the screen. Currently this is static, but it should be possible to have this update as the cursor moves across different windows that may or may not accept the type of data you are dragging. This is not quite as defined as on windows, but with a little extra code I think it could be better than the windows implementation.

At the moment I think the default behaviour will be to write the word "Copy" next to the cursor if the d'n'd action will be to copy. And "Move" if it will move the data etc. Eventually I will add a hook back into the application so that apps can provide custom images for d'n'd operations. This might even be portable back to Windows and Linux, I don't know yet. But if I implement it on Mac first I'll have something to play with back on Windows.

I've always found it annoying when the default icon or picture doesn't give you feedback on whether you're copying or moving the data with d'n'd. I know on windows there are different icons and sometimes Mac gives you a "+" sign, but still... I don't want to have to remember what "+" means!
(0) Comments | Add Comment

Imap Implementation
Date: 29/5/2008
Recent progress with the Imap rewrite:
  • When you click on a folder, email downloads from the server and is cached on the local disk. Clicking on it after loading it once (and restarting) is almost instant, but the flags for each email are updated some time after the folder is displayed. For instance if you select a folder that has since had email deleted using a different client, the deleted email initially appear (they are in the local cache) but after Scribe has finished querying the server the local copies disappear, so as to match the server.
  • I maintain a index of meta data associated with the local files. Included entries for deleted email. Each entry has the server's ID, the current flags (\Seen \Answered etc) and the local file name of the message.
  • When you click on a folder it reads the server's list of email and updates the local meta data and files using messages between the UI and worker threads. This seems to be reaching some sort of stability.
  • I've removed the duplicate "Flags" int from the IMAP mail class and starting using the real IMAP flags structure that the protocol handling class uses. This means that some Scribe flags are not supported at the moment (although I could re-add support using the meta data fields). This is things like the "forwarded" and "bounce" flags.
Basically it looks like the syncing between the local cache and the server is starting to work. Folders have been syncing nicely for a while now. But getting all the email to sync nicely is a lot harder. Work continues.

I also use Thunderbird for IMAP so that I can check Scribe's output against a known good client. This means that I get to experience Thunderbird's crappy IMAP implementation. Wow, and this is supposed to be a great IMAP implementation? Hmmm, I think "Not So Much!". For starters it can lock the GUI up a fair bit when selecting the inbox first thing in the morning, things seem to get stuck a bit. But most annoying is the new mail flag gets set all the time when an incoming email is filtered to a sub-folder and set to "read". Which means that every few minutes Thunderbird sticks it's little "new mail" icon in the system tray, even though it's not mail I care about, just mailing list chatter. *sigh*

So now you don't have to wonder why my vigor to write a good IMAP implementation is so high.
(2) Comments | Add Comment

Lil Avisynth Script
Date: 21/5/2008
I was playing around with AviSynth yesterday and came up with a cool little script that makes a movie out of a series of images such in the style of the Apple photo screen saver, i.e. the photos are slowly zoomed for a number of seconds and then cross faded to the next photo.

# this is the output size
x = 800
y = 600

# This is the length of each photo in frames...
seg_len = 150
# This is the length of the cross fade in frames...
seg_fade = 20


function Asp(clip c1, float a)
{
	c1a = float(c1.Width) / float(c1.Height)
	c1x = c1a < a ? c1.Width : c1.Height * a
	c1cx = c1x < c1.Width ? (c1.Width - c1x) / 2 : 0
	c1y = c1a < a ? c1.Width / a : c1.Height
	c1cy = c1y < c1.Height ? (c1.Height - c1y) / 2 : 0
	return Crop(c1, int(c1cx), int(c1cy), -int(c1cx), -int(c1cy))
}

a = float(x) / float(y)
c1 = Asp(ImageSource("image1.jpg", 0, seg_len), a)
c2 = Asp(ImageSource("image2.jpg", 0, seg_len), a)
c3 = Asp(ImageSource("image3.jpg", 0, seg_len), a)
out = Dissolve( \
			Animate(0,seg_len, "LanczosResize", \
				c1, x, y, 0.0,  0.0,  c1.Width, c1.Height, \
				c1, x, y, 32.0, 32.0, c1.Width-64.0, c1.Height-64.0), \
			Animate(0,seg_len, "LanczosResize", \
				c2, x, y, 32.0,  32.0,  c2.Width-64.0, c2.Height-64.0, \
				c2, x, y, 0.0, 0.0, c2.Width, c2.Height), \
			Animate(0,seg_len, "LanczosResize", \
				c3, x, y, 0.0,  0.0,  c3.Width, c3.Height, \
				c3, x, y, 32.0, 32.0, c3.Width-64.0, c3.Height-64.0), \
				seg_fade)

return out


I could easily see this being used to generate nice slide shows for a DVD or something. Have a app that takes group of photos as input, spits out a dynamically generated script in the same form as above, render it to mpeg2 with a soundtrack and dump to VIDEO_TS. If only there was a good free MPEG2 encoder for windows... *sigh*

(And no mencoder is not a good MPEG2 encoder, it's barely functional)
(1) Comment | Add Comment

How much offline IMAP functionality?
Date: 16/5/2008
So when Scribe v2 is offline I'm going to make the IMAP folders not editable. Or at least your edits may be lost. For instance deleting an IMAP folder won't do anything if you're offline.

Is that reasonable?

Or do you as a user expect that sync will happen in both directions?

At the moment I'm assuming the content on the IMAP server is the latest and making the local cache match that.
(5) Comments | Add Comment

Imap Deletion Behaviour
Date: 14/5/2008
Whats the standard user agent behaviour for deletion of mail and folders stored on an IMAP server?

Do the items just disappear never to be seen again?

Or do they go into a trash folder?
(5) Comments | Add Comment