Tag: Technical
Mac Ingenuity
Posted in Mac, Technical § 0 CommentsThis may sound like a plug for the Apple "Switch" campaign. If so, I make no apologies.
So, I'm just a bit tardy on the Leopard upgrade, but do have the excuse of a huge push at work during the past week to deliver our first product alpha. Finally, this weekend, I got a chance on Saturday to diligently backup my PPC G5 in preparation for the Leopard upgrade.
I started off Sunday morning ready and eager to install and explore Leopard. After grabbing a cup of joe, I inserted the Leopard install DVD... and nothing. The drive mulled things over for 45-60 seconds then spit out the disk in disgust.
Huh?
Ok, Let's try another DVD to make sure I don't have a bad disc... crap, same thing. Just for kicks I try a CD? That one works just fine, thank you very much.
WTF? I retry all said media in my newer MacBook Pro machine and an older G4 PowerBook. All media works just honkey dory.
So now what? I really want to get Leopard installed today and am not looking to be deterred. I consider driving to our storage facility to ferret out an old external DVD drive which I haven't needed in a couple years. But then I think, "Come on, we're dealing with Macs here, not PC's running Windows". There must be something a bit more creative that can be done, and besides, I'm feeling just too lazy to drive.
The thought of purloining a DVD-ROM drive from another machine briefly crosses my mind at this point, but that solution is as undesirable as rummaging around in the storage unit, and just plain feels so 10-years-ago.
Well, let's see here. I recall being able to hook two Macs together via Firewire to transfer data when upgrading hardware. I have an old G4 Mac mini that's been getting a free ride as of late and it has a DVD drive in it. Perhaps I can get some worthwhile use out of it.
I hook up the Mini's power, a keyboard, and a Firewire connection to the G5 and boot the Mini holding the T on the keyboard attached to it.
Shortly, the firewire external drive icon appears on the G5 desktop. So far, so good - I'm feeling like this might have a chance.
I feed the Mini the Leopard install DVD and... welcome to the installer. The DVD is mounted and the initial installer screen is inviting me to install by clicking the Reboot button. Yes, please, time to see if we can actually boot from the media in the Mini's drive connected via Firewire.
But you know what to expect next, right? Your first clue is, as mentioned already, that we're dealing with Macs here.
VoilĂ , the Leopard installer has booted and is asking me for my language preference.
A load of laundry later and installation is complete. So while I'm a bit miffed that the DVD component of the G5's SuperDrive is sucking wind, I'm quite pleased by how elegantly the Mac has allowed me to improvise.
Try that on a PC installing Vista. Or rather, don't. Get yourself a real system instead.
Third party Python Libraries of Interest
Posted in 11, Python, Technical § 0 CommentsPython is known for it's "batteries include" philosophy, meaning that the standard library that "ships" with the basic installation of the language is feature rich and ready for immediate consumption to tackle most garden variety problems from the get-go.
However, there are numerous third party modules and packages that I feel should be part of the standard distro, or at least treated as such - PEP 206 just scratches the surface of identifying some of the more useful modules that are becoming commonplace).
So here are my 11 most useful extensions that I have installed before I begin doing anything else:
-
If you are going to be using the Python interactive interpreter environment (and you are, right?), then IPython is a must. It's not just the normal the interactive environment on steriods, it's the Barry Bonds of interactive environments. After getting used to the boat-load of features, you'll wonder how you ever got by without it.
-
If you use a MySQL database and want to interactive with it via Python APIs, you'll be needing this.
-
From what I've read, Jason Orendorff's
pathmodel nearly made into the standard Python library. It's a shame it didn't, because one of the uglier Python warts in this author's opinion is the mess of file and path handler interfaces. Do I look in theos,os.path,shutil,fnmatch, orcodecsmodule to find that file / path handling function? Forget it - just look in thepathmodule. -
For working with dates, date ranges, or recurrences of dates, this is the only library you will need. Excellent documentation with extensive example code.
As an example, create a list of the next 3 occurrences of Friday the 13th:
1 2 3 4 5 6 7 8 9 10 11 12
from datetime import datetime from dateutil import rrule f13 = rrule.rrule( rrule.YEARLY, count=3, byweekday=rrule.FR, bymonthday=13, dtstart=datetime.now() ) list([d.date() for d in f13]) # [datetime.date(2008, 6, 13), datetime.date(2009, 2, 13), datetime.date(2009, 3, 13)]
-
Working with images? Done. One caveat: you might want to save yourself some trouble and install the last JPEG library from www.ijg.org (version 6b currently).
-
Thinking of using Python's Tkinter interface to bestow another hideous, malformed GUI app on us all? Well, 1995 called and asked for it's cheesy look and feel back.
Come on, wxPython is free, easy to install and use, and has great documentation in WxPython In Action.
-
An odd name, but great for parsing both kinds of HTML: the good and the bad.
An example direct from the documentation:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
from BeautifulSoup import BeautifulSoup html = '<html><p>Para 1<p>Para 2<blockquote>Quote 1<blockquote>Quote 2' soup = BeautifulSoup(html) print soup.prettify() # <html> # <p> # Para 1 # </p> # <p> # Para 2 # <blockquote> # Quote 1 # <blockquote> # Quote 2 # </blockquote> # </blockquote> # </p> # </html>
-
docutilshas become, in my opinion, the de facto method for marking up Python documentation, to include__doc__strings. It excels at processing reStructuredText for HTML or LaTex output. -
I'm not quite sure why half of the XML functionality was pruned from the default Python standard library, but this is the other half. There are other XML libraries (
libxml,pyRXP,4Suite) that may suit your particular needs better, but as a minimum you should consider getting at least the fullPyXMLsuite. -
These libraries extend the
distutilspackage to produce executable binaries for Mac OS X and Windows, respectively. -
Markdown has become a daily part of my development and online life. Many bloggers have begun offering comments in Markdown format (this site included). I find extremely useful for purposes of documentation and more formally structured email because even unprocessed, it remains very readable and elegent as opposed to raw wiki syntax (which I find to be less decipherable than HMTL in many cases, particularly MediaWiki) or even reStructuredText (a bit too structured and esoterica for common everyday usage).
John Gruber of Daring Fireball started Markdown and provides nice documentation and tools.
Mac OS X Keyboard Shortcuts
Posted in 11, Mac, Technical § 0 CommentsThe inspiration for these 11 keyboard shortcuts came from a dead battery in a wireless USB mouse. However, a few must be used in conjuction with a mouse click.
11 Keyboard shortcuts for Mac OS X worth remembering, in no particular order...
c(on boot)Boot from CD.
mouse down(on boot)Eject CD.
cmd-opt-escForce quit current app.
Reminiscent of ctrl-alt-del on that other OS.
cmd-`Cycle through current application's windows.
Everyone knows
cmd-tabto cycle through applications, but oftentimes one has multiple windows of the same application and needs to cycle through them.opt-cmd-escForce Quit dialog
shift-cmd-4 + space + clickScreen dump highlighted window.
Everyone knows the
shift-cmd-3andshift-cmd-4screen shot shortcuts, but this one is slightly different in that it allows you to grab the chrome of a particular application window.cmd-;Spell checking.
ctrl-F2Highlight the Menu.
Starts with the Apple menu highlighted. Use arrows to navigate.
ctrl-F3Highlight the Dock.
cmd-hHide current application.
Not that you would have anything incriminating visible in the current application, right?
cmd + drag background window title-barAdjust a window partially obscured by the top-most window.
dakrauth.com