Begin main content

Oh boy I need one of these

Just saw this posted on Boing Boing. SO much cooler than a segway, and is that nuclear sticker for real?! If so it would never need recharging :)

03:17 AM, 31 Oct 2006 by Mark Aufflick Permalink | Comments (0)

Automatic copy from X11.app to MacOS Clipboard

Well, from emacs under X11 anyway...

This has bugged me for a long lONG time. I have been doing a bit of unix coding on my laptop this weekend and it finally got to me. There MUST be a way I thought.

A lot of people suggest autocutsel but all that does is synchronise the X11 CLIPBOARD buffer (or PRIMARY buffer) with the selection buffer. I'm sure this solves issues with some X11 apps that only use one or the other and X11.app may get confused. But that's not what I'm talking about.

I'm talking about:

  1. make a selection in emacs, yank a line, do whatever you want that "copies" a piece of text to the "clipboard" (for suitably vague meanings of those terms)
  2. switch to a MacOS app
  3. paste in the text copied in step 1.
So it seems from a LOT of googling that noone has an answer to that short of hacking X11.app (which I think is open source so that's possible - if not one could hack XDarwin instead). I don't have that sort of time however. I didn't find any general solution, but I just knew I'd be able to hack pbcopy into some sort of emacs clipboard handler. Sure enough, the workld's most extensible editor obliged! If you apply the following prodding to your .emacs file, you will be in X11.app auto copy-paste nirvana :)
(if (eq window-system 'x)
	(progn
	  (defun paste-to-osx (text &optional push)
		(progn
		  (let ((process-connection-type nil)) ; use pipe
			(let ((proc (start-process "pbcopy" "*Messages*" "pbcopy")))
			  (process-send-string proc text)
			  (process-send-eof proc)))))

	  (setq interprogram-cut-function 'paste-to-osx)))
Update: After reviewing this entry on my front page it occurred to me how unlikely it is that anyone has ever hacked up a lisp code fragment directly after some visual basic! At least the foray into a little visual basic hasn't rotted my coding brain :)

11:26 AM, 29 Oct 2006 by Mark Aufflick Permalink | Comments (0)

Setting Outlook Categories with VBA

Posting this in a bit of a hurry. For context see the previous post How to do tagging in Outlook.

Open up the vba editor (Tools->Macro->Visual Basic Editor). Add a new module and paste the following code in (edit to suit).

Then to add the sub as a toolbar button customise the toolbar in the normal way and choose the 'Macros' category in the left pane - all your applicable macros will appear in the right pane. You can just drag it to your toolbar.

If the button seems to do nothing your outlook security settings may not be allowing macros. See Office Macro Security Settings.

Public Sub TagArchived()
    Dim objOutlook As Outlook.Application
    Dim objInspector As Outlook.Inspector

    Dim strDateTime As String

    ' Instantiate an Outlook Application object.
    Set objOutlook = CreateObject("Outlook.Application")

    ' The ActiveInspector is the currently open item.
    Set objExplorer = objOutlook.ActiveExplorer

    ' Check and see if anything is open.
If Not objExplorer Is Nothing Then' Get the current item.
Dim arySelection As Object
        Set arySelection = objExplorer.Selection
        
        For x = 1 To arySelection.Count
            strCats = arySelection.Item(x).Categories
            If Not strCats = ""Then
                strCats = strCats & ","End If
            strCats = strCats & "archived"
            arySelection.Item(x).Categories = strCats
            arySelection.Item(x).Save
        Next x
        
    Else' Show error message with only the OK button.
        MsgBox "No explorer is open", vbOKOnly
    End If' Set all objects equal to Nothing to destroy them and
' release the memory and resources they take.
    Set objOutlook = Nothing
    Set objExplorer = Nothing
End Sub

06:10 AM, 27 Oct 2006 by Mark Aufflick Permalink | Comments (13)

How to do tagging in Outlook

Working on a corporate PC you may be using Microsoft Outlook - whether by choice or not. Outlook uses the traditional hierarchical filing concepts that have been in place for what feels like centuries (who remembers when MacOS replace MFS with HFS, or when ProDOS on the Apple // replaced DOS 3.3...).

After struggling for some time to find a good filing solution I just realised that it wasn't possible. Too many messages belonged in multiple folders at once.

I had another issue which was a humungous inbox, and an 'archive' folder to keep the inbox in check. But where is that email I want? Is it in the inbox, the archive folder, or some other folder?

Categories =~ Tags

What I wanted was tagging. So I hunted around Outlooks functionality and found Categories. Now this does mostly what I want. But it's so hard to get too - I have to right click messages to get that option? First solution: add a categories toolbar button which you can find in the "Edit" section when you customise the toolbar. I renamed it to 'Cats...' to save pixels. (MS KB article on customising toolbars).

Archiving

Then I wanted a way to 'archive' messages. It turns out that I can just tag messages with a category 'archived' and add a filter to the regular 'view' to exclude all messages with that category.

Filtered views

In addition I can set up other 'views' to show a subset of commonly viewed tags. To get easy access to those different views, add the views menu to a toolbar - you'll find a widget called "current view" in the 'view' section. You can also add a 'filter' button for ad-hoc changing what categories to filter by. (Somewhat useless MS article on using filters)

Ok great, but do I really want to click categories, then click archived, then click ok, every time I want to archive an email? I get hundreds of emails!

One great thing about MS Office apps is that nearly everything is exposed as a vba api. Sure, they are often bad api's, but you can do nearly anything with enough trickery. In the next post I'll include some vba code that will let you make a toolbar button for 'archiving' emails.

Update: The post (Setting Outlook Categories with VBA)

Automatic Tagging

If you used to have rules to file messages automatically - don't worry, because rules wizard understands categories and you can auto apply categories instead of filing. You can even add a chosen tag and choose to auto-archive or not (just like Gmail) by adding (or not) the 'archived' tag.

A neat feature of Outlook categories is that they persist when you reply/forward messages (within an MS Exchange network). If I dig out an old email that I have archived, forward it to someone with comments, and then they reply - all my categories are still there on their reply. Thats actually really useful, except that the 'archived' category means it disappears in my regular filtered inbox view. To counteract that we need some vba code that is triggered when new messages are delivered that will strip the archived cat. I'm too lazy to write that in vba (which has horrendous string manipulation support) so I just strip all categories on inbound emails. Instructions on how to do that in a followup post.

Reducing the clutter

Phew! We're nearly in email nirvana. But my screen is still full of junk that is redundant, wasting space, and distracting me. First I don't want any headers in my preview pane (right click in the grey background of the reading pane and un-tick "header information"). Then I want only one row of toolbar buttons (remove anything you don't want). I also reduced the number of list columns to a minimum (and added the categories column of course).

I also want to (usually) hide the navigation pane on the left - since I no longer need to constantly switch folders. But sometimes I want to switch between sent mail and the inbox (where all my email is - tagged or not) and also the calendar. So I made a toolbar with 6 buttons. Here are the toolbar command category/commands i have:

go/Inbox (assigned a custom icon) : Go/Sent Items (shortened name) : Go/Calendar : View/Bottom : View/Off

My Outlook InboxSo my total toolbar looks like:

TODO: make this post more intelligable and add more screenshots!

06:04 AM, 27 Oct 2006 by Mark Aufflick Permalink | Comments (4)

War on Folate

Vegemite puts a rose to every cheekIt seems that the war on moisture has now been upgraded to a war on everything your body needs.

Australian icon Vegemite is now being searched for by US customs authorities who could be doing more useful things, like targeting dead terrorists.

Now I can understand the US authorities not wanting Vegemite to enter their shores, because it tastes absolutely foul. But that's not their complaint.

No, their complaint is that it's good for you.

[Vegemite] contains folate, which under a technicality, America allows to be added only to breads and cereals.

news.com.au

That's right. That water soluble vitamin B that the US Government's National Institute of Health says you should get 500ug per day of and that helps prevent birth defects and may help prevent cancer and heart disease. It's so good for you that the FDA even requires that Folate be added to bread and other cerials.

10:27 PM, 23 Oct 2006 by Mark Aufflick Permalink | Comments (0)

Oracle. So awesome and yet so lame.

So I've spent a number of hours now, installing and setting up Oracle 10g on my Powerbook. First of all, props to Oracle for making a Mac version at all. I'm sure Steve had a beer with Larry one day and that's how it happened. Second, I think Oracle is an awesome database in many ways, although horses for courses applies : many situations suit Postgres more, and I may even be persuaded to believe that Sybase IQ has it's place (not to be confused with Sybase ASE which has no place on the planet whatsoever).

Ok, with that disclaimer out of the way, why is it so darn hard to get going. First of all it requires a relinking step, with a particular gcc, if you want to use it on OSX 10.4 (see these excellent tips). Second of all, you need to set up a bazillion and one users and environment variables before you even think about running the (ugly) Java gui installer (see these pretty good instructions).

So I have it kindof working, but can never quite login via sqlplus the way I imagine i should. All sorts of incantations result in the following cryptic message:

ERROR:
ORA-12162: TNS:net service name is incorrectly specified

I'm pretty sure the tnsnames.ora file is all sorted, so after the 20th try, I search the web. Thankfully Burleson Consulting has this excellent tip:

The error message ORA-12162 "TNS:net service name is incorrectly specified", is very misleading.

It suggests that there is a problem with the tnsnames.ora file contents, but in reality the message [snip] results from improperly setting your ORACLE_SID value.

So there it is. Tripped up by yet another environment variable. What is it with these enterprise software people and their beloved environment variables?!

07:41 PM, 17 Oct 2006 by Mark Aufflick Permalink | Comments (0)

Hiring Programmers who won't make you say WTF!

The HiddenNetwork is a new IT job referral site brought to you by the people behind The Daily WTF. The Daily WTF is a web site by developers, for developers, where we go to complain and commiserate about bad code and poor development. You would hope that people reading that site have learnt how not to write WTF code themselves.

Thus, the theory is that people who apply for jobs from this network will be somewhat pre-filtered.

Another job site. Great. Just what the world needs.

I think, actually, that what we're seeing is a move to specialisation in job referrals. Instead of bulk job sites trawl-fishing the global pool of developers, we're seeing a move to niche and network based job sites. Sites like LinkedIn are being very effective at providing candidates with pre-existing personal recommendations. Sites like jobs.perl.com have been providing domain specific candidates to employers in the know for years.

If you're in the hiring market you could do worse than try out The HiddenNetwork. During the Beta period posting is free! The site and their advertising will use geolocation to provide location sensitive jobs to candidates. And in a refreshing change from the control exerted by other job sites, candidates will contact you directly.

Disclaimer: I will recieve a referral bonus for anyone who takes out a job ad from the links above to The HiddenNetwork.

10:50 PM, 14 Oct 2006 by Mark Aufflick Permalink | Comments (0)

Life imitates Art as Montoya takes third at Talladega

I know it's old news now, but as I was reading up on this weeks F1 testing I wondered how ex-McLaran F1 driver Juan Pablo Montoya went with his NASCAR debut. I knew he had qualified on the front row of the grid, but could he show NASCAR what F1 drivers could do?

The Colombian had to pit under caution several times to have his car fixed, but he was able to remain on the lead lap, despite falling back to 31st.

The race was restarted on lap 45, and Montoya charged through the field to make his way up to 11th by lap 54.

"It's pretty nice. In F1 you go to the back and you stay in the back," Montoya added. "You can be two seconds a lap quicker than any other car, and you're still not going to pass. I think I passed probably 40 cars today easily. It was outrageous!" (autosport.com)

Cool!

In the end he finished third - very respectable for nearly his first time in a NASCAR car.

02:08 AM, 14 Oct 2006 by Mark Aufflick Permalink | Comments (0)

Good test coverage (by curling your right bicep)

I recently listened to a Perlcastinterview with Andy Hunt (of Agile fame).

Most of his comments could almost have been direct quotes from his (excellent) new book Practices of an Agile Developer but one answer about testing really caught my ears. In response to a question about how to know that your writing the right sort of tests in your test driven development, Andy gave the following mnemonic:

Right BICEP

Right - are the results right
B - Boundary conditions
I - Inverse relationships
C - Cross check results (with other sources/methods)
E - Error conditions
P - Performance

I love simple mental tools like that. I'll certainly be mentally checking my right bicep when I write tests from now on. Previously I'd only been checking out my right bicep in the shower after the gym...

10:48 PM, 11 Oct 2006 by Mark Aufflick Permalink | Comments (0)

Simple /var/log/secure analysis

I could hear my development server hard drive ticking over more than normal, so I thought I'd check it out. It turned out that I had someone running a script against my ssh server looking for standard usernames. Not likely. My remote root access is turned off (of course) and theres very few usernames (all custom) with password login enabled.

I turned on the intrusion filter on my firewall, so we'll see how that goes. Hopefully it won't impede real connections to my cvs etc.

For completeness I thought I'd add the ip address to the blacklist in my firewall. I saw a sea of attempted connections in my /var/log/secure log and came up with this very shell simple script to sift hack attempts out from bad typing days by either myself or my clients. In case it's useful for anyone I thought I'd blog it:

for ip in `awk '/Illegal user/ {print $10}' /var/log/secure |sort -u`; do echo "$ip : "`grep -c $ip /var/log/secure`; done

It makes some pretty wild assumptions but it did the trick for me. It gives output like:

202.136.62.130 : 16
210.0.204.27 : 762
211.137.76.105 : 887
218.247.185.214 : 29
???.133.81.251 : 4
??.143.0.183 : 4
61.187.8.54 : 329
??.205.204.190 : 5
I whacked it in a root cron file so I'll get a report each day. (Note I anonymized the low count ip's because I assume that it's me or a client just typing our usernames poorly.)

12:36 PM, 09 Oct 2006 by Mark Aufflick Permalink | Comments (4)

Magic Mug Cake

Magic mug cakeI don't know about you, but I love shopping in large supermarkets. The variety of wacky and interesting junk you can find there seems limitless. Many are worth browsing but occasionally one jumps aout and grabs you and you *have* to buy it.

Magic Mug CakeSo it was with the Magic Mug Cake! Pour the sachet into a mug, mix in an egg, microwave for 90 seconds, add your favourite topping for more fun - it just doesn't get much better than that! I was intrigued by this product. Only slightly less than the Folgers self-heating instant coffee that I bought from a supermarket in San Francisco last year. How does such a large amount of cake come from such a small sachet and only an egg? They're right - it must be magic!

Now the instructions are for a 660w microwave oven, so I figured that my mighty 1100w microwave should be dialed down to 60% and run for the same time.

Magic Mug Cake in microwaveWith 10 seconds to go it was so far so good. As you can see on the left the cake was just peeking over the top of the mug - *magic*! As soon as the heat stopped, however, it sank right back down. It looked way to moist so I figured it needed some more time. After another 30 seconds it looked cooked - but not quite what the picture showed:End Result

Thinking about the process, I think you must need the microwave power and time just right. I imagine that the process involves the cake bubbling up to it's maximum volume and then being 'snap-cooked' into that size/shape. Because I didn't let it run quite long/hot enough the first time the opportunity was lost.

Kath asked me how it tasted. "Just like cake" I said. "Yes, just like cake" she dubiously replied...

05:29 AM, 08 Oct 2006 by Mark Aufflick Permalink | Comments (0)

The creative programmer

"Why Writing is Harder than Programming" is Paul Graham's latest post. Pauls premise is that a programming project can have a definable measure of success and that reaching that success is ultimately achievable (given enough talent and time). With writing, however, "You don't have the same total control over the medium".

TitlePaul Graham is one of my favourite IT writers. Not that he's the best or the most insightful (although he is floating near the top) but because he combines programming with other creative pursuits. That's the way I think it should be. He also invests in the education of others and the support of their ideas.

Probably my favourite programmer (and also a good friend) Lars Pind is similar. He likes to write. He plays at least one musical instrument on a regular basis. He is aprolificphotographer. He's never afraid to debate his approach to programming or life. He programs fast and furious, but with a degree of elegance and insight that, I believe, couldn't come without all of the above.

It's qualities like these that I always look for when interviewing potential employees (or employers), but rarely find.

What do you think? Can you be a good programmer without being creative? Can someone be truly creative and maintain/nurture that creativity without a variety of creative outputs?

Another question to a certain section of the developer audience: How do you manage the peculiar balance of creativity; logic; and a perfectionistic need for symmetry and alignment that comes with programming excellence?

PS: This wasn't supposed to be a Paul Graham/Lars Pind love fest, but so be it!

Footnote: On a totally unrelated use of creativity, a study by Indiana Universtiy shows that (on some selected topics), The Daily Show is as substantive as regular news broadcasts!

09:56 PM, 05 Oct 2006 by Mark Aufflick Permalink | Comments (2)

Cool keyboard hardware

Everyone knows how much I love my keyboard hardware. Every day I use both a Kinesis Ergo keyboard (for my ergonomic satisfaction) and a Happy Hacking keyboard.

But there are two new must haves. Firstly, I have been looking for a good seperated keyboard. As much as I love the concave layout of my Kinesis, I really wish I could separate the two halves further. I also hate having to rehome after using the mouse. I used to love the nipple input on IBM Thinkpads for that very reason.

Last century scientists split the atom. This
century Ari Zagnoev split the keyboard.

-- Australian PC World

But some boffins here in Australia had much better idea, the result of which you can see at the lower left.

The other accessory is this so cute it hurts USB powered hamster wheel. It turns at a rate relative to your current typing rate!

                     

Unfortunately of the two, the hamster wheel is the one already in production...

"Ari Zagnoev" <info@combimouse.com> wrote:

>Hi Mark
>
>Thank you for your interest.
>
>Unfortunately at the moment we only have a few hand made prototypes.
>
>Ari

08:41 PM, 05 Oct 2006 by Mark Aufflick Permalink | Comments (0)

LinkedIn.com redesign communicates less with more

I like to browse LinkedIn.com from time to time to see what people are up to, the state of the hiring market etc. I have always liked their design, and the occasional tweaks are usually good. Their latest attempt to redesign the recommendations UI, however, is confusing and less effective in two ways:

  1. When reading someone's profile, the recommendations are not clearly distinct from the user generated profile. I didn't notice them when I skimmed someone's profile. I also think that placing them at the bottom (rather than inline) reduces the impact that they make.

  2. LinkedIn.com Menu in the headline box of someone's profile, I see: "profile", which means the profile telling me about the person; "connections" which means the connections that that person has (again - information about the person); and "recommendations" which I assumed meant recommendations for that person (ie. more information about that person). Instead it is recommendations that that person has made about others - which reverses the meaning of the other two tabs. Not only that, but when I did click it, the design doesn't make it clear that it is the other until I am part way into reading it.
Recommendations are one reason why linkedin profiles are more trustworthy than individual websites - linkedin.com should be careful not to lose that differentiator.

The new design is subtle and clean, and more information is available, but it actually makes the information less self evident. In HCI terms, the design lacks what is known as affordance where the function of an object (in this case a link) is intuitively known by it's characteristics. In the case of (1) it's the visual characteristics (traditional affordance). In the case of (2) it's what I would call the "affordance of proximity" (which may or may not be a phrase already in use - I'm sure it is).

In my notes for this blog I jotted down "quote Edward Tufte, but I can't find anything appropriate, and I've gone a bit off Jakob Nielsen lately.

04:19 AM, 05 Oct 2006 by Mark Aufflick Permalink | Comments (0)

XML

Blog Categories

software (41)
..cocoa (23)
  ..heads up 'tunes (5)
..ruby (6)
..lisp (4)
..perl (4)
..openacs (1)
mac (21)
embedded (2)
..microprocessor (2)
  ..avr (1)
electronics (3)
design (1)
photography (26)
..black and white (6)
..A day in Sydney (18)
..The Daily Shoot (6)
food (2)
Book Review (2)

Notifications

Icon of envelope Request notifications

Syndication Feed

XML

Recent Comments

  1. Mark Aufflick: Re: the go/Inbox go/Sent buttons
  2. Unregistered Visitor: How do make a button to jump to folder
  3. Unregistered Visitor: Note I've updated the gist
  4. Unregistered Visitor: umbrello is now an available port on macPorts
  5. Unregistered Visitor: Updated version on Github
  6. Unregistered Visitor: Modification request.
  7. Unregistered Visitor: Accents and labels with spaces
  8. Unregistered Visitor: Mel Kaye - additional info
  9. Unregistered Visitor: mmh
  10. Mark Aufflick: Thank you