Tao of the MachineProgramming, Python, my projects, card games, books, music, Zoids, bettas, manga, cool stuff, and whatever comes to mind.
Last 10 archives
:: About me
:: Oasis Digital
The light side beckons
Another content Mac user. Maybe I should give the thing another try. I agree with Simon's observations... a weird key binding here and there, but aside from that everything Just Works, and looks gorgeous. (On Windows, the first thing I do is change the way it looks... on the Mac, I just left the layout the way it was, because I felt no need to change anything.)
My main problem with it was that I couldn't get any actual work done, due to circumstances... see the older posts in this switch category. Still, it's very tempting to go back, especially when I see yet another good review.
Then again, I also have an SGI to play with, which is arguably much cooler than a Mac.
After the switch
More and more people seem to be getting a Mac, especially laptops. Faithful readers might remember that I had a Mac for a while too (my wife uses it now). Looking back, here's a summary of my experiences.
Macs are great machines, with some benefits over Windows, and some very good software. Unfortunately, they're probably not right for a creature of habit like me. (At least not yet... maybe there will be a day that I can confidently shed Windows.) Other people's mileage may vary. In fact, I would recommend a Mac, and even be tempted to buy a Powerbook or so, if not for the problems mentioned earlier.
Back to the grill again
I was going to try my hand at designing a new game today, but Mac problems got the best of me. 90% of the work is done in 10% of the time, and vice versa, stuff like that.
This is not another Mac rant. In fact, what I wanted worked quite well. Only, there's a few things that don't work, and it puzzles me very much.
Anyway, my modem/router has both a USB port and an Ethernet port. PC uses USB, Mac uses Ethernet. So, I wondered if I could connect to DSL with my PC, then have the Mac share the same DSL connection (without having to authenticate, dial in, etc). After some tinkering, this indeed seemed to work. I appear to have a little (and probably malfunctional in some ways :-) LAN now, allowing me to share folders between PC and Mac. Great stuff, and maybe it'll be possible to share the printer too. Also, I can surf the Net as usual... browsers, ftp, NetNewsWire, Proteus, etc.
What *doesn't* work is Sherlock and Software Update. Sherlock cannot get the resources it needs. Upon inspection, this seems to be a regular HTTP call. An example URL is this. The Mac, in it current state, cannot retrieve this file. Not with Sherlock, not with a browser, not with wget, not with anything. I can, however, fetch this URL with no problem on Windows, and the Mac didn't have a problem with it before (using a PPPoE connection for DSL). This confuses me greatly. What is so special about this URL (and probably a bunch of other URLs like it) that it cannot be retrieved? It's not a name resolution conflict; wget resolves the name just fine, but the HTTP request times out. It's not a weird port or protocol either, just a HTTP request over port 80. And I can ping si.info.apple.com just fine.
I suppose I don't really *need* Sherlock, and for the Software Update I can always make a "real" DSL connection (rather than sharing the PC's), once a month or whatever. Still, this is an interesting puzzle.
Other Mac observations:
The worst of two worlds
(Warning: incoherent rant ahead…)
Mac OS X is built on a great concept. For beginners and regular users, there’s an easy-to-use, good-looking GUI with a bunch of programs to do many common tasks. For power users, administrators, programmers and the like, there’s a complete BSD system under the hood, allowing you to customize and tweak to your heart’s content.
Sounds great. For some reason it doesn’t work for me, though. Maybe I’m just stupid. Be that as it may, let me tell you about my experiences so far.
To me, coming from Windows, it did indeed seem like a great concept. Get a stable system based on a real OS, and useful applications on top of it, so you don’t have to compile the world to make even the most basic apps work. The best of two worlds. Well, I’m starting to suspect it’s more like the worst of two worlds.
The high-level GUI apps are acceptable (after all, they do what they’re supposed to), but too simplistic for me. I will not go into any details here. To me, they just are (and YMMV(your mileage may vary), of course).
On the other hand, there’s the BSD system, and it comes with all the problems of Unix systems. I’m not exactly a Unix hater, far from it. But sometimes I just want to get things done, and it’s nice if you can do so without having read countless man pages, looking at tons of command line options, staring at obscure error messages, or knowing the inside out of parts of your system that you’re not even interested in (if you knew they existed at all).
One example. I wanted to install PythonCard today. This is a fine app that works great on my Windows box. Installing it on the Mac proved more of a challenge. Unlike for Windows, there’s no installer for the Mac, so I had to do the distutils thing. ./setup.py install didn’t work, it choked on an error somewhere. An additional complication was that I have (at least) two Pythons on my system, 2.2 and 2.3a2, the latter of which has wxPython. So I found some switches, tried to install with prefix /usr/local/, which went better than the previous attempt, but choked anyway. At that point, I gave up. Too early? Probably, but I’ve gotten really tired of trying to make things work (with little success). See my previous posts on editors for that.
(This is just one example, and definitely not the worst of what I’ve experienced since August, when I bought the Mac.)
Sometimes it’s nice if things “just work”. The above is in no way PythonCard’s fault. It probably comes with a vanilla installation script. And running such a script is no big deal if everything goes right. But, if it doesn’t… in order to solve this problem, I would need to know about the various Python installations, about distutils and its options, about the Python site-package directory, about the reasons why the Pythons are installed in different directories, about file permissions (one error was lack of permission to execute a script), etc. One could argue that any (Unix) programmer worth his salt knows these things. Possibly, but on the Mac (read: BSD) I am only a beginner who wants to get some hacking done, without having to jump through countless hoops. On top of that, I may not have the time to learn all these things. It would be nice if I could just see some encouraging results and worry about the gory details later.
(Is Windows better, then? No. Not usually. But: 1. I’m used to it, and 2. it’s easier for me to get things done. I’ve been using PCs since 1991. I don’t have another 12 years to spare to get used to the Mac.)
I’m strongly considering selling the Mac. Too bad, it’s a beautiful machine, with a beautiful OS. It may just not be for me. I keep on going back because it’s pretty and promising, but I invariably end up leaving in frustration. So… keep an eye out on Ebay if you want a reasonably priced G3/600 with 128 Mb.
In search of the perfect editor
Or rather, a decent editor. So far, every editor I’ve tried on the Mac has its own little problems. They’re probably little for someone who regularly works with these editors and/or the Mac. They’re not so little for a Mac newbie (which I still am, in many respects) who wants the editor to behave as close to Windows as possible.
I don’t think I am very demanding. All I want is something to edit Python code. To do so, I need:
These three simple wishes have not been met by any editor so far. Not even vim, where Shift-Tab doesn’t work. (This may actually be a Unix problem and probably has nothing to do with vim itself.) Many, many editors violate #1. Others call themselves text editors but are simply not suitable for plain text. Some even do ridiculous things; one editor insisted on placing a dot at the end of every line it visited. >_<
My own hand-rolled Charm editor works fine on Windows, but doesn’t work well on the Mac. Apparently wxPython integration isn’t perfect yet, which is a different problem altogether, but it rules out using my own stuff.
I am currently messing around with XEmacs, which has its own set of problems. (How could it be otherwise? :-) I succeeded in rebinding the Home and End keys, works fine if I rebind them in the editor itself, but as soon as I put them in a startup file, trouble starts. It either doesn’t find the file or doesn’t load it correctly. Or I made a mistake, but I copied the lines verbatim from a sample .emacs file. It doesn’t help that XEmacs seems to have its own notion of where the home directory is. Also, if I start emacs (not XEmacs) from the command line, it attempts to load my .emacs file, and finds errors, although I have no clue what it is trying to say.
Sigh. Notepad almost looks good. Do any Mac gurus out there have any words of wisdom?
On an unfamiliar system, keybindings are your worst enemy
Or maybe your first enemy. I’m just back from a very frustrating exercise on the Mac. You see, ideally I would like to use the Mac for my personal projects, and the Windows box for work. Turning the Mac into my personal hacking platform doesn’t work so well though if it’s so much work to get basic things done.
What am I complaining about this time? Just the fact that Mac software has some keybindings that I’m not used to. I want to edit Python code. That doesn’t seem so difficult, right? So I use vim, since that’s what I use on Windows. I don’t want to use the Terminal version because it has problems of its own, so I use this gvim build for Jaguar. Most keys work as expected, except for Shift-Tab, which happens to be crucial, because that is what I am used to use to dedent a line. I have been trying to remap Shift-Tab, asking questions on newsgroups, etc, to no avail. Learning a new key combination would be an option if the Windows box wasn’t around.
So I tried different editors. I downloaded three: AlphaTk, BBEdit Lite, and TextForge. Unfortunately, all of these seem to have peculiar mappings for Home and End (although this is probably common on the Mac): they jump to the beginning and the end of the document, rather than the line. I’m sure some of these editors let you rebind keys, but right now I really don’t want to worry about that, I just want to edit without running into problems every second keystroke.
Back to vim again. Maybe it helps if I copy my Windows .vimrc verbatim and use it on the Mac? After all, there are no Windows-specific commands in it. So that should work. Wrong. After doing this, vim didn’t even start anymore.
So I try to edit the .vimrc file in Terminal, using vi. More fun: it doesn’t tell me what mode I’m in, nor does
I’m done with the Mac for now. I’ll be back when I have a week to spare, or something.
gmaneLast week I got DSL. Much faster than my old 56k connection. However, there was one problem: Alltel's (the DSL provider) NNTP service is not so good. The latest messages in newsgroups are at least two hours old. That may not seem like a long time, but if you see an unanswered question in c.l.py that's two hours old, chances are people already replied to it, you just don't see the replies yet. Also, messages expire really quick, in a day or so.
gmane.org to the rescue. It lets you read newsgroups and mailing lists through a NNTP service. Very easy; I now read comp.lang.python (or gmane.comp.python.general as it is called there) through gmane, and lots more (SIGs, python-dev, twisted...) The messages are up to date and don't expire in an eyeblink. Look here for a (long) list of lists.
Not entirely off-topic: It's laughably easy to install DSL on the Mac. It took the install guy several hours to install it on Windows (with USB port). He didn't install it for the Mac, but it didn't take me long to figure it out yesterday. Just tell the PPPoE settings your login and password, and tell Network settings that you're using the Ethernet card. That's about it.
PropagandaWikiWikiWeb: Mac OS X.
"The best operating system in the world today. Don't believe that? Think you want a Linux or Windows instead? Look, don't flame on, just try it. Give it a week. Heck, just give it a day. Or a few hours. It's not the prettier gui. It's the way everything works like you expect ... and better than you expect. Apple looked at each of their competitors and each competing application technology, and simply spent the money necessary to out-engineer them. Apple might still die by marketing. Life in monopoly-land is like that. But even if they die, it was worth it. Beautiful, stable, fast, and open - this is it. The best."Yes.
This is more like itSlashdot: ISS discovers a remote hole in Sendmail. The very same day, patches are available for various Linuxen and Mac OS X.
Compare this to the patch for the Slammer worm that targets MS SQL Server 2000, which wasn't available quite as promptly. ;-) I had to download it a week ago. Not only took it a long time to find the correct patches in the the Microsoft site jungle; also, the file was 26 Mb or so in size, so it took me forever to download on 56k. To top it off, the patch apparently found it necessary to remove all ODBC bindings from my computer. SQL Server refused to work after the patch (!), and I had to reinstall MDAC and everything.
I normally try to avoid abominations like Outlook and other programs that are security risks, but in this case, I need SQL Server for my work, so it couldn't be helped. I started to get suspcious when one night I apparently *sent* over 1 Gb of data, with no program active to account for it. :-)
MackingBeing a digitreuzel, I only installed Mac OS 10.2 (Jaguar) a few weeks ago. (Under the assumption that by now, most interesting packages would be out for 10.2. Little did I know... ;-) Anyway, there's lots of stuff to explore. Sherlock 3.5, for example.
Many things have changed. It's become a much more useful tool, something that I actually might use for more than just locating files on my harddisk. Take, for instance, the Ebay section. You type a search term, and you get a nice list of matching auctions. Select an auction to get more info, complete with a picture and clickable links if you want to place a bid. (What, Hammerrock for $41?! Ridiculous!)
It could use a few more options though... for example, is there a place where I can see (and maybe copy) the URL of the auction I'm looking at? I don't see it. You have to click on a link to open a browser window with the actual URL. Also, I'd like to see more information... the number of bids really isn't interesting to me, but an indication if I could "buy it now" would be. Third, it doesn't show all the auctions (just the top N or so, I assume). Hmm, maybe in a future version...
Searching on the Internet doesn't work so great. The list of "content providers" doesn't include Google, and it shows. Search for 'python', hit #6 finds the Euphoria programming language. (To be fair, hit #1 leads you to www.python.org.) A search for 'python programming' is more like it. Still, this is not an acceptable replacement for Google.
Picture search is nice. Searching for 'imac' yields what I want to see. Still, a picture search at Google is more powerful. :-/
Movies is also interesting. You type your zip code, a list of movies appears. Click on the movie to see a description, picture, Quicktime preview, and names of movie theaters where it plays.
Yellow Pages seems cool, but doesn't provide all the information it should. It failed my first test, finding our local Pizza Hut (which has been there for years). It does find lots of them in Gainesville, though. In fact, it doesn't seem to find *any* stores in our town. Granted, it isn't very large, but neither are some of the other towns that do show up in the list. (Correction: it does find Hitchcocks. :-) On the plus side, the map and the driving directions are a nice touch.
All in all, this is a nice tool, but it doesn't beat going to the real websites (that Sherlock uses underneath).
5 months later......I am still not very proficient in using the Mac, mostly because I lack time, and a decent workplace. In spite of that, I took most of this weekend to play with it, and work through the Missing Manual. Once that is done, I can install Jaguar (which has been gathering dust since September or so) and use Jaguar-based programs, like Safari.
I am appreciating the Mac more and more. It has style *and* substance, as opposed to Unix (substance but no style) and Windows (neither). You can work on a very high-level, using very user-friendly tools. For example, I plugged in my digital camera, and iPhoto did the rest (easy downloading). No special drivers or software needed. On the other hand, you can work on a very low level as well. For example, today I was staring at old C code that wouldn't compile. ;-)
DragThing is great. So is TigerLaunch. Chimera is nice (although I wish it was more like Phoenix on Windows). I can still babble on ICQ or YM, using Proteus. Have to find a decent news reader, though. Mozilla's?
More later, if I actually have something interesting to say about my Mac adventures...
Yesterday's roundupBesides hacking Kaa, I did some more stuff yesterday.
It's a Mac's worldSome things make more sense in one environment than another.
For example, the tendency of Unix programs to put stuff (or look for it) in your home directory. Windows doesn't really have such a concept, not like Unixen, so I never used it and never saw the benefits of it. Now that I have an iMac running Mac OS X, things become more clear. You store a binary and libraries in a central place (e.g. for vim), then different users keep their .vimrc files in their respective home directories. Much nicer. Making backups is easier too, since binaries (and in general, files that don't change a lot) are separated from profiles, user-generated files, work, etc. I assume that if software is correctly installed, you just backup your home directory (and maybe a few others). This never made sense to me on Windows, but now it's crystal clear.
distutils fits in this pattern too. On Windows, I never really used it. What's the point? It's not hard to copy files and directories to a directory that can be "seen" by Python. And compiling C extension modules with it is a no-brainer, since I don't have a (compatible) C compiler. (Dev-C++ and Cygwin's gcc don't count.)
I can't wait for Mac OS X Unleased to get more out of my Mac. ^_^
More Mac troubles...and like yesterday, they're really at beginner level. *frown* This time I tried playing movies. iMovie isn't meant for that, as I soon found out. Instead, there is a Quicktime Movie Player (with an annoying nag screen, aside... fortunately, the MM has a tip for how to remove it).
So I tried playing some .avi files. Quicktime should be able to handle them, but complains that it cannot play them. That may be a matter of getting online and getting the right codec; maybe later, I didn't feel like crawling behind my desk to move the modem cable from the PC to the Mac. I will have to test that some other time.
An .mpeg file, then? Nope. Quicktime complains again. I'm not sure it's a matter of a missing codec here. Then I tried my Video CD (Princess Mononoke, I "won" it on Ebay but the box only contained disc B; the seller promised to correct the mistake but I haven't heard from him since). Nope, that didn't work either.
I haven't been able to play any of my movies, which doesn't really speak for the Mac's multimedia capabilities. Or for my intelligence, maybe. :-)
So far I've been struggling with the Mac over basic things, but at least I'm using it (or trying to). I ordered Mac OS X Unleashed from Amazon today, that should get me up to snuff soon. Not for my Quicktime problems of course, but if I want to make it my main hacking box, then I need lots of insider info.
For a weblog that regularly contains Mac OS X tips rather than complaints <wink>, see bbum's rants, code & references. And it's Pythonic too...
My new mp3 player :-)The iMac is truly a wonderful machine. On the surface it's more user-friendly and intuitive than Windows, and below it's the raw power of Unix.
So why am I not using it?
Hmm. One reason is that I don't have a good work place to use it. It's standing next to the Windows computer (which I use for work), and due to its position on the desk, it's awkward to put a chair in front of it, the keyboard is hard to reach, and the mouse even harder and it has little space. In other words, it's not easy to use it for a long time.
Another reason is that I cannot use Python to its full extent (yet), the way I can on Windows. I hack on command line tools, Tkinter apps (like Kaa), and wxPython apps (like Charm). Tkinter and wxPython don't work too great yet on Mac OS X (using Carbon, of course).
On top of that, there is lots of stuff to learn, and I don't have too much time (and reason #1 makes long learning sessions awkward). Lots of annoying things get in my way, like bash and vim settings, programs I don't know well, etc. I'm sure most of these things can be solved once I know more, but until then, it's just irritating.
So I figured I can start using the Mac for mundane tasks. Like playing mp3s. Turning the Mac into a music box. There is this program called iTunes, which seemed suitable. I don't like it too much though, because it doesn't let me do what I want. How can I add one mp3 to the play list? I don't have a clue; drag & drop doesn't work. It works for folders, but the moment I dragged & dropped a folder, it proceeded to import the whole CD, not just the mp3s in that folder. Hmm. This software is a bit overzealous. If I cannot select individual tracks, then there's simply not much reason to prefer iTunes over WinAmp. (MacAmp, anyone?) Yes, this seems a minor complaint, but I do this kind of stuff all the time.
If anyone knows how to "tame" iTunes, let me know. In the meantime, I study the Missing Manual again.
Update [11:18 PM]. According to the MM, you can select certain files, then select "create new playlist" and everything that is selected will be included in the new list. This is not really the same, but it will do. Different computers, different customs...
That geeky MacintoshMac OS X for Unix Geeks. Looks like an interesting book. There's also a sample chapter and this article.
Now they need to publish a book about Python on the Mac... writing Cocoa and Carbon apps, using Jython, how to run scripts, etc.
Building PythonThey claim that Python on the Mac builds right out of the box. And they are right. :-) Of course, it took me (being a Mac newbie) a little while to figure out the Right Way to do this, but still...
Yesterday I downloaded the latest CVS source on Windows (Cygwin), tarred & gzipped it, transferred it on a zip disk, and tried it on the Mac. Just to find out that the Mac didn't like the line endings... I didn't know that that was a problem for tools like shell and make also. The configure script wouldn't run properly, and when I fixed it in vi, some makefiles barfed, etc. So it was clear that this was not the way to do it. :-)
So today I tried downloading the CVS source on the Mac, in Terminal of course. To my surprise, that worked without problems. More surprises followed when the configure script ran without a problem (it usually doesn't on Cygwin), and I could build Python. (Not sure why the executable is called Python.exe, though... is that a Mac extension too?)
And what's more: Tkinter actually seems to work and uses Carbon...? I haven't been able to try this very well, since I have nothing to drop a Python script on (how that is made is something I have to learn some other day); but when I did root = Tkinter.Tk(), a Tkinter/Carbon window showed up. Running Kaa this way shows such a window too, but it hangs; I read somewhere that you're not supposed to use this from the shell? Anyway, we'll see when Python 2.3 comes out, which should fix the line ending problem as well.
Kaa does work, more or less, on some of the pre-compiled Pythons I've tried, although not very well on any of them. The test blog I made is stored somewhere, I have yet to find out where, but it's not in the Kaa directory where it would be created on Windows. Also, it crashes when you open the bloginfo dialog.
For now, I'll just resume development of Python stuff on Windows; it will be a while before I can do anything sensible on a Mac, or know how to make things portable so that they run on either machine.
Running Python on the MacAt first, I was greatly confused by the appearance of some Python files... some would have a special icon and start with the PythonInterpreter when double-clicked, others would have no icon at all and would not be recognized. When I dragged & dropped these files on the interpreter, it would produce a message "This is not a script." This was very puzzling; the script was perfectly valid (there's not really much you can do wrong in a "Hello, world" :-) yet it was refused.
So I tried a few things... writing the file with vi in Terminal, with a GUI vim, with TextEdit. To no avail. I tried setting permissions in the shell, making it executable etc... didn't work either.
Eventually I read something in documentation (Using Python 2.0 on the Macintosh)... "If you create your script with the correct creator and type, creator 'Pyth' and type 'TEXT', you can double-click your script and it will automatically invoke the interpreter". How to set those though? It's not obvious. I'm currently using the fixfiletypes.py script, but I sure hope there's a better way.
More alarming news is that porting Kaa to the Mac doesn't turn out to be that easy. First, the date.py module gave three syntax (!) errors... turned out to be a problem with lines ending in a backslash and Windows line endings; the Mac didn't like the ^M after the backslash. So I fixed that, and tried again, just to watch the program crash gratuitously. :-) With a MemoryError, of all exceptions! In Gadfly. No clue what's wrong. Maybe this is a known problem, maybe not, maybe I can actually contribute something already.
I do pine for that Python where line endings don't matter though... when is it coming out? :-}
Another lesson learned: when copying files with a zip disk, store them in a zip file or something first, because some short names will be converted to ALL UPPERCASE. And since OS X has a case sensitive filesystem, Python will not find DIALOG.PY if it expects dialog.py.
Bro, this Mac is dopeSome stuff I learned today:
DifferencesMac OS may look like Windows (or is it the other way around?), but their interfaces are not exactly the same. Here are some of the differences I've noticed so far:
There was some more progress too. I managed to compile "hello world" in two environments; first, the canonical C file in Terminal, compiled with cc; later, a more complex hello world file using Carbon, compiled with ProjectBuilder. I also managed to hook up my Zip drive without problems. The zip disk can now function as a way to quickly copy files from the PC to the Mac and vice versa. ^_^
Some interesting links: