Sunday, March 15, 2009

XCode ERB file highlighting

Ok...  I've been trying to use XCode 3.1.2 to edit Ruby on Rails projects, and choking every time I load up an ERB file.  XCode just doesn't recognize the syntax.  I have, in numerous sessions, searched for the correct solution, and then, this morning, while thinking, I had a brainwave!  Follow this:

  • OS X 10.5/Leopard comes with Ruby on Rails 1.8.5
  • RoR 1.8.5 uses the RHTML file extension
  • I made a RHTML file, and there you go!  It works in XCode
  • I searched through the OS X libraries for the reference, and found it
Here's the answer:
  1. Open this file in a text editor:/Developer/Library/PrivateFrameworks/DevToolsCore.framework/Versions/A/Resources/Standard file types.pbfilespec
  2. Search for rhtml, and you'll find this line:  Extensions = (shtml, jsp, rhtml);
  3. Change it to this: Extensions = (shtml, jsp, rhtml, erb);
In other words, add the ERB file extension to the list of files the developer tools recognize as Embedded Ruby Code.  XCode should now highlight ERB files correctly.

Why didn't one of the Apple developers post this months ago?

Monday, February 04, 2008

Moleskine Pen Holder

I've been pondering for a while how to add a pen holder to my Moleskine plain page Reporter notebook. I had a vague idea of the approach I wanted to use, so I was half-way there. Yesterday I got the urge to do a search, and found a lot of entries - to my surprise - but they all miss the mark. I want a simple design, non-destructive, with a minimal impact to the book itself, and with zero impact to the size of the book. After all, what's the point of getting a small book to put in your pocket, and then adding bulk to it. Let's face it, even the Reporters aren't that small. Anyway...

If you don't want to measure this out manually, I recommend laying it out using OpenOffice, and exporting as a PDF. Point of that is Acrobat Reader will let you print at 100% scale, and the excess is just trimmed. OO doesn't seem to scale that well.

Instructions:

  1. Cut the above shape out of some stiff paper, or thin card
  2. Tuck the big tab into the pocket on the inside of the back cover of the Moleskine
  3. Fold the horizontal strip round between the back of the card and the back cover
  4. Insert your favourite pen close to the Moleskine, and pull the tab until the pen is held snugly
  5. If desired, trim the excess from the opposite side of the Moleskine
The pressure of the closed book should keep the pen loop in place. If you like, you can glue the loop in place, but then you can't use a different size pen so easily.

QED - Non-destructive, simple, zero impact on size!
(If you put the book, and the pen in your pocket it's the same size with, or without the pen holder, less the thickness of the card you use. I call that zero size difference ;-)


Note: I find no way to attach a PDF image, or arbitrary file to a Blogger post.

Saturday, September 08, 2007

TabletBlog.com by ThoughtFix: DVD to Internet Tablet in Two Steps

TabletBlog.com by ThoughtFix: DVD to Internet Tablet in Two Steps

A step-by-step guide to ripping a DVD for use on your Nokia N800 Internet Tablet.

I assume this also works for the N770, and will work for the N810. In fact, this should be a good guide to getting video reduced for any small-screen device.

The comments about the audio are interesting. Most N800 users seem to prefer the MPlayer application to the default application, but the N800 setting on Handbrake uses an audio encoding supported by the built-in player. You an change it for MPlayer, but why bother.

Personally I've reduced a DVD to 300M with only minor visual artifacts. The big space hog is the audio, but reducing it too much makes the movie worse than a few visual deficiencies.

Monday, December 04, 2006

Productivity Principles - What is it, why do I care, and how do I get some?

This will be the first in a series of articles about productivity, incorporating what I've learned in thirty years of business experience.

Firstly I believe it's important we understand that what most people call Productivity with a capital 'P' is really time management, and time management has been written about and taught in a formal way for a long time.

I believe there are only two keys to productivity: Organization, and motivation... and you can almost compensate for one with the other: Motivation, for most people, consists of getting a raise, or promotion, or generally making more money, but it may be reducing stress, saving time, or, as David Allen of Getting Things Done fame puts it, 'clearing your psychic horizon.' So... What I'm saying is that most people already have some motivation to be better organized. What they lack is organization, and organization, or rather time management, and the associated tools and methods, is what this is all about.

Now that we're down to the nitty gritty talking about tools and methods of organization, here is the single key fact: You need a method of some kind! That's it. That's the only thing. The method you choose will usually dictate the tool(s), or at least narrow down the choice. You should try different methods until you find one that works for you, or until you learn enough to cobble together something that works for you.

I read recently that it takes three weeks to establish a new habit, so after you learn a new technique, you must then allow at least three weeks to see how it's working for you. I also read recently that keeping your brain active is the key to long life, and extended sanity, and the key to keeping your brain active is learning new things, so embrace it. Learn something new.

Next time I plan to talk about some specific methods, their attendant tools, and the various merits thereof.

Wednesday, November 29, 2006

Web Site Test Box

I spent the last few days organizing my home office. I have five computers in there, not counting this laptop, which goes back and forth. There's a Windows XP box, which is primarily for graphics-intensive stuff, an old IBM Netvista for my Linux workstation sandbox, a 700MHz Dell I'm preparing for use at the deaf computer club in my son's high school, a dinky old iMac DV slot loader (G3 450MHz), and my old Linux test server, which has been the trouble maker. Turns out the hard drive, and the floppy drive went South at the same time. That was a fiddle to figure out. Who expects the floppy drive to fail these days? Once I ascertained it wasn't the motherboard, but the floppy drive, I was able to get in and fix the hard drive problems - the boot sector was corrupt, and some strange intermittent problem is causing the arm to bang against the stop. It doesn't do it all the time, so it passes all the hard drive tests I can throw at it. Now I'm just replacing it, and that's what this is about.

Problem: Replace old hard drive with smaller hard drive I had on the shelf.
NOTE: While the drive was smaller, 13Gig vs 8Gig, the data was not too big for the new drive. Basically it's a multihomed Debian Web server answering several non-routable IP's, and host names that I use for testing, and demonstrating client's projects. I'm about to need this for a moderately involved Drupal project.

First Approach: Clone the old hard drive using Linux tools
NOTE: Here I was trying different things, and ran across an interesting project at Sourceforge called Ghost for Linux, or G4L, that attempts to duplicate Symantec's Ghost functionality with GPL tools. It's a very interesting project, which does what it says, but there's one feature left to implement - cloning from a larger drive to a smaller one. Symantec Ghost will clone to a smaller drive correctly, resizing as it goes.

Second Approach: Recreate an appropriate structure on the new hard drive, and just copy the files across from the old one. This is boring, very slow, and I have to manually reinstall Grub, but it will work, and it's a no-brainer.

Friday, November 24, 2006

Mostly Housekeeping

Hmmm... Didn't really add anything so far today, but rather just worked on the template (if you like it, just ask, and you can have it), added some links, and fiddled with some wording.

Thursday, November 23, 2006

Free PIM with SonyEricsson Interaction

To the point: http://www.fjsoft.at/en/

Excellent product, responsive developer. Essentially provides the same functionality as the Palm Desktop, but for SonyEricsson phones, including the modem hookup, file transfer, sync with itself, and sync with Rainlendar, full backup of the phone data, and the SIM card data, and some other nice features. Also worth noting is that it produces its data in some standard formats, such as VCF for the contacts, and iCal for the Calendar, and tasks, even though the files are named with a .DAT extension.

Long version: My Palm T5 died, and I found this to help keep my stuff up to date on the phone while the T5 was in the shop. The T5 was unrepairable, and is unreplacable, so I got a laptop under the warranty instead. Now I'm living without a PDA, just the SE w810i, and it's not so bad.

Re: RainLendar

If you haven't seen it before, it's a little calendar/task list that can sit on your desktop. Cool features - skinnable, configurable, macros/hotkeys with LUA, and an iCal file format. Also freeware, unless you want to sync over a network with another iCal file.

How to Remove Stickers/Labels from your Laptop

The plastic stickers come off pretty easily. The only issue is the Windows XP sticker. I have found a reliable way of removing this without marking the laptop.

NOTE: When using isopropyl alcohol, which is rubbing alcohol, make sure to buy the unscented kind. The scented kind leaves an oily film behind.

Windows XP Label/Sticker Removal HowTo:

Requirements:
Masking tape - the least sticky kind you can find. I think painter's masking tape (the blue kind) might be best.
One Sided Carpenter's Chisel - The key is the thickness of the blade, and the angle of the bevel. A thick knife is not the same, as you don't have leverage after the bevel. And just so you know, I do have a double-sided chisel. It has an identical bevel on both sides, but the bevel is at a much shallower angle. It's for carving relief work.

Procedure:
1. Put a piece of masking tape as close as you can next to the metal sticker. This will protect the case from the metal tool. Put two layers, if you're nervous.

2. Using the chisel upside-down (bevel down towards the laptop), carefully slide the sharp edge under the edge of the sticker. You only need it to tuck under enough so you can get some purchase on the sticker. It may seem you're barely in contact with the sticker, but that's enough, if the chisel is sharp.

3. Gently push down on the handle of the chisel. The edge of the label should pop up, and you'll be able to pull the rest of it off with your fingers, or a pair of pliers. If the chisel slips, repeat step two, but put the edge of the chisel a little further under the edge of the sticker, making sure to slide the chisel on the masking tape, and not apply pressure to the handle at this stage. You just want the blade to get some purchase under the edge. You're not trying to get the label off by slicing it with the chisel.

4. If you get a corner up, but the sticker is resisting (perhaps it's been on there a long time with your hand resting on it), you can put some alcohol on a paper towel, or a cotton bud (Kleenex works, but sheds a lot of particles), and work it under the sticker, while pulling on the sticker. This may seem slow, but it's a tiny sticker. You'll be done in no time, and a perfect result is always nice.