In praise of Smultron

Thu 14 Feb 08 21:58 | Tags: Mac, Programming, Software

I write this post in praise of what I think is one of the unsung heroes of development on the Mac; the Smultron text editor.

The shadow of TextMate looms large and dark, despite its ~$60 shareware fee. It's by far the most popular text editor among Mac coders, and it even has its own dead tree book. However, even though I'll occasionally go back and give it a try, I keep coming back to Smultron, and not only because it's free.

One document at a time? That's for sissies!

Smultron supports most of the features of competent text editors, such as tabbed editing (Smultron uses vertical drawers by default, but can be easily switched to use horizontal tabs), automatic line numbering, syntax coloring, integration with FTP programs such as Transmit, and so forth. But let me quickly run a couple reasons why I keep choosing it over others, including TextMate. (This list might not be totally fair, since it's been a while since I last tried TextMate.)

The most common uniquely Smultron feature I use is the Split Window feature. This lets you look at two documents, or possibly two different parts of the same document, in one window. The window is split horizontally if you just select the Split Window item from the View menu (or press Command-Apostrophe), but holding down the Option key while opening the View menu (or pressing Command-Option-Apostrophe) lets you split the window vertically, which I find much more handy in these days of triple-wide monitors. Editing a template, but can't remember what variables you've assigned to it? Open up the template in the left pane and the code where you've assigned the variables in the right. Made a complicated function and you can never remember the order of the parameters when you go to use it? Open the function definition in the right pane, and continue hacking away on the left. What a great feature!

Another great feature is the Advanced Find & Replace window. The regular Find feature (Command-F) just uses the simple standard Mac OS X find-and-replace tool, but the Advanced Find feature (Command-Shift-F) works with regular expressions. That in itself is not too fascinating, but what's cool is that it will build you a list of lines that match your pattern, and selecting the line will show you where that line appears in the document in the pane below. This is absolutely great for testing regular expressions before you do a replacement with them. It's also handy for testing a regular expression that I want to use in my code instead of on it; I just open up a new tab, paste or type in some sample data, then bring up the Advanced Find window and test and refine my pattern until it's perfect.

And did I mention it's free?

The Advanced Find window. Very cool.

It's lacking a few features, though, of course, most notably any auto-completion features of any sort -- though I personally don't miss 'em. Also, though it's possible to make your own syntax definitions for syntax coloring if one of the fifty or so included with the program doesn't suit your needs, or add one that someone else made, it's not very convenient; you have to literally use the Finder's Show Package Contents feature on the app itself and root around in there -- the process could be much easier.

Still, if TextMate isn't cutting it for you -- or maybe you just can't afford it -- it couldn't hurt to give Smultron a try. With my current job, I can now easily afford a more expensive, more feature-packed editor, but I'm still sticking with Smultron.

Get more great Ray Gun Robot content sent directly to your feed reader or email inbox! Subscribe today!
Feed icon Articles & LinksVia Email
Feed icon Articles OnlyVia Email

1 Comment | 0 Trackbacks | Digg this article | Bookmark with del.icio.us

 

Tapping classic games with GameTap Lite

Tue 10 Jul 07 22:04 | Tags: Games, Mac

After a few delays, GameTap has recently released the free, ad-supported "Lite" version of their game-playing client for the Mac today. You know I had to get in on that.

GameTap is an online service which allows members to download and play games on their computer. They offer native PC games as well as console and arcade games, which run under an emulation layer. The native PC games are still too Windows-dependent to work, so right now us Mac users can only play the emulated games, and only a small part of GameTap's library is available to play for free, though those games do occasionally rotate. The list is heavy on Capcom and SNK titles; a boon for fans of brawlers.

Ryu struggles to come to grips with Street Fighter Alpha's odd controls.

How well does it work? It's decent. I haven't been able to put too much time into it, but among what I've played so far, I'll go ahead and say the emulation is pretty perfect. Granted, my 2.33GHz Core 2 Duo machine with 2GB of RAM is still pretty hardy by today's standards; I can't vouch for how well it will run on older, slower Intel-powered Macs. (PowerPC owners, you're out in the cold. But you guys are probably starting to get used to the feeling.) I do have a few gripes with the client itself, though.

The fact that I had to watch this ad for SuperDeluxe.com was less annoying than the dumb ad itself was. By the way, I lasted about thirty seconds in 1941.

Yes, it's adware, but I don't think it's too terrible; video ads play while the game is downloading, and a banner ad takes up the bottom of the window while you're playing. I can handle it. What I find more annoying than that, though, is that, when the game starts, there's no indication as to which buttons you press to play the game. For that, you have to switch back to your web browser, go to the game's page, and click on "Controls." After that, you'll be presented a table which tell you what buttons to press… if you're using an Airflow-brand joypad. You have to select "Keyboard" from a menu to see the controls for a standard keyboard. (Confusingly, "Left Keyboard," "Right Keyboard" and "Uinversal Keyboard" also appear in that same menu, with no clear indication as to what the difference between them is.) It would be nice if the client would show the game's controls before the game starts. Games meant for a joystick or game pad are obviously a bit harder to play when you have to use a standard keyboard like me, but I guess that's nobody's fault but my own.

Also, I found it weird that, when I started up Street Fighter Alpha, the button controls were seemingly upside-down… the upper rows of buttons were kicks and the lower were punches, and the strong attack buttons were to the far left. This is exactly inverse of the way Street Fighter games have controlled since the first one came out in the late '80s. What the heck happened there?

With all the delays this had, I would have thought they would have had the time to make a sensical about box.

Then there's the usual beta-ish weirdness. Occasionally the mouse pointer inverts into a disturbingly Windows-like white-with-black-outline monstrosity for no apparent reason. Also, the start buttons seem to have about a one-second lag to them; fortunately, that doesn't apply to any of the gameplay buttons.

Ever since the mid '90s, emulation of classic arcade and home video games has been a popular diversion for personal computers, despite the fact that such activity is usually questionably legal at best. GameTap has their work cut out for them by trying to introduce a legitimate game emulation service into the marketplace. But the emulation quality is there and the ads aren't too intrusive. If GameTap can work out the client's kinks and maybe introduce a wider library of games and consoles, they're going to have a really cool product to offer us Mac gamers.

Check out this Joystiq article for more news and a sample video. (Many of the games in the video are not currently available for free play… and what's with that music?)

UPDATE: Apparently that music is from a game called Psycho Soldier (which is in the video, near the end), which was the first video game with a vocal soundtrack; thanks, TUAW. Also, if you're having a hard time finding the download for the client on GameTap's site, Inside Mac Games' article has a direct link to it.

Get more great Ray Gun Robot content sent directly to your feed reader or email inbox! Subscribe today!
Feed icon Articles & LinksVia Email
Feed icon Articles OnlyVia Email

1 Comment | 0 Trackbacks | Digg this article | Bookmark with del.icio.us

 

Leopard reactions

Mon 11 Jun 07 21:59 | Tags: Mac

The following are some comments in reaction to Steve Jobs' recent WWDC announcements which I posted in a message board; thus, they're quite a bit cruder than what I would usually write for RGR. But I thought I'd share my thoughts with RGR readers as well. What do you think about the new look and features of Leopard?

Okay, so I've been watching the videos about the new features in Leopard. Opinions:

New Dock design and features: Meh. Okay I guess, but all the mirroring is needless eye candy that I'll turn off if it lets me. Also, why do the stacks lean to the right when you draw them out? And how do they work if you put the Dock on the left side of the screen like me?

Spaces: Meh. I don't use the virtual desktops feature much on Gnome/KDE-powered machines, so I doubt I'll use it on the Mac.

Transparent menubar: What the…?

New Finder previewing and Cover Flow: Okay, not bad. Might actually be useful in some cases, like when I want to quickly sort through the digital pictures I've taken to find the good ones.

Time Machine: A great idea, but waaaaaaaaay too much eye candy on the implementation. A Finder feature should not induce epileptic seizures. The stars moving in the background - way overboard. Sheez. And you need to have a second hard drive in order for it to work? Lame lame lame lame lame. That makes it pretty worthless for laptop users like me, and is also lame for iMac/Mac mini users who will have to connect a second hard drive externally - unless simply a second hard drive partition is good enough. But if so, that's still incredibly lame. I guess this puts to bed those rumors about ZFS being the default file system.

Mail changes: Damn it, Apple; didn't you screw the pooch enough with all the detrimental changes between 10.3's and 10.4's versions of Mail? Now there's annoying graphical templates… HTML belongs in web pages, not in email, guys. And then you add to-do lists and RSS reading? Who really wants these bloaty features in Mail, especially when they can be done better in other apps? Thanks for encouraging me to fully switch to Gmail even faster, guys. I knew I was going to do it eventually, and now there's very little incentive not to…

Get more great Ray Gun Robot content sent directly to your feed reader or email inbox! Subscribe today!
Feed icon Articles & LinksVia Email
Feed icon Articles OnlyVia Email

2 Comments | 0 Trackbacks | Digg this article | Bookmark with del.icio.us

 

The easiest way to use OS X fonts with GIMP

Fri 13 Apr 07 21:47 | Tags: Command Line, Guides, Mac, Software

Judging by RGR's stats, the most popular articles when it comes to hits from search engines have been those I've written about MacPorts. So I guess I should invite some more hits and write a little bit about it again, albeit somewhat indirectly.

If you've been reading RGR for a while, you've probably figured out that I'm a bit of a tightwad. I'd like not to be, but at this point in my life I'm not in any sort of position not to be, unfortunately. I can't really afford to do my image editing with the $650 Adobe Photoshop, as much as I'd like to (and, being a programmer myself, I can't pirate it). So instead I use the free open-source image editor GIMP, which can be easily installed via MacPorts. It falls short of Photoshop's capabilities in many ways, and the fact that it's not a "true" Mac OS X app and I can't copy-and-paste between it and other apps is pretty annoying, but it does the job, and you can't argue with the price.

When you first install it, it is somehow smart enough to find all of the standard OS X fonts, and make them available in GIMP. I'm not sure how it does this (I'm not a Unix expert; I just play one on the internet), but it's pretty handy; early on in OS X's history, when you installed GIMP, you'd just have a short list of plain and/or ugly Unixy fonts to choose from. However, if you've installed any new fonts besides the ones that come with OS X, those new fonts won't show up in GIMP's font menus. If you poke around the internet, you'll find various tips and tricks for getting your new Mac fonts to work with GIMP; I recently ran into this problem myself. I found another solution, however, and I believe the method I'm about to show you is the best and the easiest – in fact, I'm surprised I haven't come across it before.

This solution assumes you've installed your Mac fonts in the standard way; by double-clicking on them in the Finder, which causes Font Book to launch, then clicking Font Book's "Install Font" button. Installing fonts this way puts the font in the Fonts folder inside your Library folder, which is in turn inside your home folder – in Unix terms, in ~/Library/Fonts/. So all we need to do is tell GIMP to check for fonts there.

First, open up GIMP's preferences; select "Preferences" from the main "File" menu. Note that "Preferences" does not appear in the "File" menu attached to a GIMP document; you have to choose the "File" menu in GIMP's palette window, the one with the title "The GIMP." Yes, this is confusing. Thank you, Windows, for your inspirational innovations in user interface design.

Follow along, boys and girls!

Here's what the Preferences window looks like. Click the triangle next to the "Folders" item in the list on the left (labeled with a red 1 in this picture); this will make several folders appear below it. Click the Fonts item (2). A list of folders will appear to the right side of the window, but there will only be one item in the list; this is where GIMP is currently checking for fonts to use. You could copy fonts into this folder and have them show up in GIMP, but that'd be a pain; what we'll do instead is tell GIMP to also look in the folder where our fonts are already being stored.

To do this, click the icon that looks like a file (3). Then click the button with the ellipsis (4). In yet another wonderful stroke of obvious user interface design, this will bring up a navigation box that will let us choose the folder to add. It should show your home folder. Double-click on the Library folder, then click on the Fonts folder and click the OK button. That should close the navigation box and bring you back to the Preferences window. Click the Preferences window's OK button. GIMP will show you a little note about how you need to restart GIMP for the changes to take effect; click the OK button, then go ahead and quit and restart GIMP. Ta-daa! You should now see your installed fonts in GIMP's fonts menus.

An aside: If you're Unix-savvy, you may have noticed that there are not actually any fonts in GIMP's default font folder, ~/.gimp-2.2/fonts/. So how is GIMP seeing the standard OS X fonts? Answer: I don't know. I'm curious, though; if you can enlighten me on this, please do so in the comments.

Also, if you have any questions about MacPorts (or GIMP), please don't be afraid to mention them in the comments, or, if you're shy, contact me directly.

Get more great Ray Gun Robot content sent directly to your feed reader or email inbox! Subscribe today!
Feed icon Articles & LinksVia Email
Feed icon Articles OnlyVia Email

8 Comments | 0 Trackbacks | Digg this article | Bookmark with del.icio.us

 

Flippin' iSight pictures

Sat 31 Mar 07 04:55 | Tags: Guides, Mac, Software

All Apple MacBook and MacBook Pro laptops come with a built-in iSight camera. The camera is built into the frame of the display of the laptop and faces inward. Thus, it's best suited for taking pictures of yourself. Apple includes an application to facilitate doing just that, called Photo Booth. It's not fancy -- the resolution is low compared to other inexpensive cameras nowadays, and the picture is grainy -- but for a tiny, built-in camera, it works well enough to do the job. However, a few weeks ago, I was joking around with some friends on IRC and we were taking pictures of ourselves with dumb signs and stuff (hey, come on, it's the internet; I'm not going to be doing serious research and stuff all the time) when I noticed a quirk with the program.

By default, Photo Booth flips the image as a mirror would do, instead of taking an unflipped image like a normal camera would. Previously, just taking pictures of myself without the sign, I never noticed that.

Fortunately, it's easy enough to flip; you can just select the photo after you've taken it, then select Flip Photo (Command-F) from the Edit menu. Or, to make sure future photos are correct, you can select Auto Flip New Photos. As you take the photo, the preview will still be mirrored, but after the picture is taken it will be un-mirrored as a normal camera would capture. No worries if you forget to turn this setting on, though; flipping the photo after it's taken does not seem to cause any destructive recompression of the image, as far as I can tell. You can hold down Command-F to flip the image hundreds of times rapidly, but it happens pretty fast and the quality doesn't seem to deteriorate, so I guess it's just tweaking some bit of metadata.

Ah, that's better. Now you can more clearly see that my handwriting has not improved since the first grade.

(If these images look like they were taken in my bathroom, well, they were. I did up this article at night, and the bathroom has the best indoor lighting in the whole place, so please forgive the kitsch.)

A while later, I wanted to make a video of a Nintendo DS game. I can capture video from the iSight using iMovie pretty easily, but again, this was only easy if I captured video of myself; trying to capture the DS was a bit of the pain. The difficulty comes from the placement of the inward-facing camera. If I turned the game system toward the camera, then I couldn't see its screen and couldn't play the game while recording. If I turned the laptop around and put it between my arms, I could see the game system's screen, but not my laptop, so I couldn't check to see if the DS was properly centered in the camera, and it would be rather uncomfortable to have to stretch and bend my arms around the laptop like that. The best compromise I could find was to tilt the lid of my laptop down so that it was over the DS. This let me see both the laptop and the DS screens at the same time, but as the DS was still facing me, it appeared upside-down in the video.

Here's what the settings should look like in iMovie.

Fortunately, I found a way to fix that using iMovie's special effects tools. iMovie has a Mirror effect which was apparently designed to only mirror part of the image, for America's Funniest Home Videos circa 1991-style effects. However, it's pretty easy to tweak the settings so it flips the entire part of the image. So:

  1. Select the video clip you want to mirror.
  2. Click the Editing button.
  3. Click the Video FX tab.
  4. Select Mirror from the list of effects.
  5. Set the Effect In and Effect Out sliders to 00:00 by dragging them completely to the left.
  6. Drag the Vertical and Horizontal sliders completely to the right to apply the effect to the whole image.
  7. Click the Apply button.

Viola. Here's an example of the effect in action.

Get more great Ray Gun Robot content sent directly to your feed reader or email inbox! Subscribe today!
Feed icon Articles & LinksVia Email
Feed icon Articles OnlyVia Email

2 Comments | 0 Trackbacks | Digg this article | Bookmark with del.icio.us