OSX:Changing the “Web Receipts” Folder

April 14, 2008 | 8 Comments

One of my favorite features in Leopard is the “Save to Web Receipts”. Judging by the posts on the web I’m not sure whether this is a new feature or not. Either way, I really like it… except… Saving important web pages (receipts, confirmations, reservations, etc) is something I’ve been doing for a long time now without this feature, it was just a pain. In fact I did it on Windows for years before even switching to Mac, except all by hand. The function in OSX saves me the trouble of naming the file and choosing the directory which is great, except I don’t like the way it does either.

The first problem is that in general the date of the receipt is the most importat sorting factor, and having it in the “date modified” column is mildly dangerous, like if I make changes or notes on it for example. The second problem is at work when I’m saving receipts it doesn’t help me get them to the unified receipts folder at home.

I decided to solve both problems today and luck you, I’ll share. Reading the web the way this was implemented changed at some point. It used to be an Automator script but apparently that was rather limiting (which is pretty bad if you’re Apple and your own Automator doesn’t cut it). So they re-implemented in Python. This is a shame because having opened up Automator for the first time it looks really cool and relatively user friendly, unlike what you’re about to repeat below.

  1. In Finder, go to /Library/PDF Services/
  2. Duplicate the “Save PDF to Web Receipts Folder” and rename it to something else but keep the .pdfworkflow extension, in my case, “Save to DropBox Receipts.pdfworkflow”
  3. Right-click and select “Show Package Contents”
  4. Naviage into the “Contents” folder
  5. Delete the “Resources” folder
  6. Open “Info.plist” in a text editor and rename the “CFBundleName” string to something helpful, probably something that strongly resembles the filename you created in Step 2, then save and close that file
  7. Open the “tool” file in a text editor
  8. If you want to change the target folder:
    1. around line 24 you’ll see something the line that sets the value of destDirectory to “~/Documents/Web Receipts/”, change that.
  9. If you want to add a date at the beginning of the filename
    1. at the top of the file (around like 9) insert a new line with:
      from datetime import date
    2. around the previously mentioned line 24 add:
      title = "%s - %s" % (date.today(), title)
  10. Save and exit

That will end up giving you filed names like “2008-04-13 – American Express Online.pdf” saved in the directory of you’re choosing. To test just go to any app, bring up the print dialog and confirm that your new entry shows up. Also, if you have any problems, just trash the duplicate you created and edited.

EDIT (2008/08/26) – Fixed the missing close parenthesis at the end of item 9.2 pointed out by James. Thanks!


Making RSS feeds for Truveo

March 31, 2008 | Comments Off

You Suck at Photoshop on TruveoYou’ve probably seen or heard of the unconventional “You Suck at Photoshop” tutorials. Maybe you weren’t offended, maybe you even like them. Maybe you want to track new releases via RSS. I was just like you a few minutes ago. I checked the MyDamnChannel.com website and couldn’t within my attention span find a feed that was just for YSaP videos. I’d seen them on YouTube so my first instinct was to go to YouTube and build an RSS feed from a search. Oops you can’t (at least not a very specific one).

Then I remember: Wait, I work with a search engine that does this EVERY DAY. Truveo makes this trivial. I went to Truveo.com and searched for:

“You Suck at Photoshop” channel:youtube

This returned the right set plus other spoofs and knock-offs. It needs to be restricted to the official user that posts them:

“You Suck at Photoshop” channel:youtube author:mydamnchannel

Perfect! Now click the “most recent” button to get the newest episodes first, and towards the bottom left hand corner you’ll see the traditional RSS icon. Copy and paste that link into your RSS reader and you’re done! (Click the thumbnail for a larger view of the page I’m referring to.)


Alexis Victoria Averbuj

February 20, 2008 | 23 Comments

Alexis Victoria born 2/20 around 3:15pm at 7 lb 5 oz and 19.5 inches long. Pictures later tonight. Mom and baby are healthy, happy, and hungry!

Update (2/21, 9:30am): Pictures of Alexis are now available.


Dilbert Widget leaks data

January 22, 2008 | Comments Off

Scott Adams blogged about the new Dilbert comic widget which is great and I’m pleased with. The problem is (assuming United Media cares about not pre-releasing comics) that the comics are named predictably in sequence and are available on the server ahead of time. For example here is the comic for Sunday February 3. Oops! Now I don’t have to wait. I imagine they’ll solve this problem pretty quickly when they find out. While I’m on the subject of people who have solved this differently, Penny Arcade has an interesting system where http://www.penny-arcade.com/comic/ always points to the latest comic and there are absolute paths to get to a specific date. They have a particularly odd problem where the absolte URL doesn’t work, but /comic/ does. I get bitten by that problem fairly frequently since their RSS points to the absolute location. Another comic strip solves this problem in a decidedly low-tech way. Something Positive names each comic strip (image) with a descriptive title of the strip. Also, he releases comics unpredictably, and near as I can tell, maintains no buffer unlike Dilbert.

Back on the Dilbert side, interestingly at 400 it loops back to 2005, althought comic 1 is Jan 1 2007. It makes me curious about how the numbering sequence progresses, but invariably it will be deterministic. The easy way to solve this problem is to put something on the server side that prevents images from being served before their publish date. The wrong way to try to fix this is to try authenticating the widget (which, by the way, is now possible with FMSv3, but that’s for another day).

Update (Jan 23, 12pm): Just checked this today and the hole has been fixed. Now the actual gif seems to be an hash of some data, although apparently not the comic strip itself. Good turn around time!


Encoding and streaming to the XBox 360

December 19, 2007 | Comments Off

Some very kind friends of mine availed me of an XBox 360 and Halo 3, an act for which I continue to thank them every time I see them. Having owned the original XBox (thanks to Vlad, are you sensing a pattern?), I was interested to see the next iteration, which I hadn’t to date. It’s a very solid product and I’m pretty happy with it.

I was pleased that it automatically detected my Twonkymedia server but it wasn’t playing my videos properly. The playback worked for a few seconds but then would subsequently deteriorate the further into the video it got. I don’t think it was a bandwidth issue because the original XBox with XBMC had no troubles playing the video. I concluded it was just some wonkiness between how I had encoded and what the XBox was capable of. I tried downloading some movie trailers and they played fine from the same device. My next task was to figure out what encoding settings to use.

I’d ripped all of Anna’s DVDs with Handbrake to h264/avi and those were having trouble playing. I searched the web hoping to find an XBox 360 preset for Handbrake but all I found was other people looking for the same. I finally remembered that Andrew had mentioned that he was playing videos across the network, so I consulted him. He suggested using the Apple TV preset, and that still wouldn’t work for me, until I figured out that Twonkymedia was keying off of the file extension. Changing the extension from mp4 to avi fixed Twonkymedia. Once I realized that things started working perfectly.


BootCamp on Tiger (Post Lepoard)

December 18, 2007 | Comments Off

So Apple did a fairly crass thing by terminating Boot Camp for Tiger when Lepoard launched. I was replacing my Dell at work with a Mac and wanted to have a native install of XP for troubleshooting. I couldn’t find Boot Camp 1.4 which was presumably able to work until Dec 31 because Apple had pulled it, but I did find an old copy of 1.2 on my laptop but it wouldn’t run because it was past expiration. How do you solve this impossible problem? Uh, set the clock back. I circumvented annoying beta policy by the same technology with which I avoided nag screens in shareware in 1996. Lame.


Bugs vs Defects

December 12, 2007 | Comments Off

I read and became persuaded by the idea that calling software errors “bugs” is too cutesy and downplays the significance of the problem. On the other hand, as a developer, there are times when my software doesn’t work correctly but it is not my fault. And calling my software defective because the API doesn’t behave as documented (or is undocumented) is unfair. This is something that has vexed me in the course of my job and I finally think I have a reasonable distinction.

A bug is a defect once-removed (indirection, if you like). My software can simulataneously have defects and bugs. The distinction is whether I am responsible for the error. Relatedly, documentation can be defective.

The whole issue seems like a nuance to me and it has not been something I have been comfortable broaching at work but has come up recently in the terminology of some tools we are evaluating. I think the distinction is important but for practical purposes likely to be lost on the folks who are most concerned about the problems (usually not the developer).

An alternate distinction, and maybe an easier one to sell is core functionality versus non-core functionality. The core functionality of banking software is around maintaining transaction integrity: a math error is a defect; a button that is misaligned is a bug; a crash that corrupts the database is a defect; the saved backup on exit not working is a bug. Again, I think this is too subjective and subtle to be useful, but I think it’s at least a distinction that business people could grasp.


Webex = crap

December 7, 2007 | Comments Off

Just joined a meeting that was using meetmenow.webex.com. Impressively crappy for a tool to share your desktop. No Mac support, requires ActiveX control, and on XP it shit the bed with both FF and IE6! (Found the bug, it doesn’t properly handle the case where the task bar is not at the bottom). This problem has been solved before and solved better. At work we use Cisco Unified Meetingplace which is actually pretty nice.


Mac: Deep Sleep

November 16, 2007 | Comments Off

When I was Windows-based, I always preferred using hibernate over standby. When I came to Mac I reluctantly got used to it. In fact there isn’t any obvious way to invoke the “deep sleep” (hibernate) function in Mac until the battery is practically dead. This has been annoying on planes when I want to switch batteries without shutting down. I just found this deep sleep widget on the Apple site that adds a deep sleep button to dashboard which will be handy on such occasions. It does prompt for your password in an abnormal way but looking through the code it is only used to chown/chmod the deepsleep binary to setuid root. Source for the deepsleep binary is also included.


On Shame

November 16, 2007 | Comments Off

From an IM conversation:

Friend: I want the syntax to find all files in /home older than 30 days so I can nuke them
Pablo: find /home -mtime +30 -type f
Friend: so find /home -mtime +30 -type f | rm -rf
Friend: thats all I need?
Pablo: find /home -mtime +30 -type f -print0 | xargs --null -- rm -f --
Friend: ok
Friend: I’m doing it with PHP right now….
Pablo: the print0/null parts are in case you have filenames with spaces
Friend: which is… fun… :(
Pablo: i hate you
Pablo: why do you need to make me feel so dirty