Tao of the Machine

Programming, Python, my projects, card games, books, music, Zoids, bettas, manga, cool stuff, and whatever comes to mind.

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. emoticon:wink2

Posted by Hans Nowak on 2004-01-10 18:31:29   {link} (see old comments)
Categories: switch

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.

  • The Mac is advertised as user-friendly, and this is indeed the case. First setup is a breeze, and so is installation of updates or new versions of the OS. Many Mac OS X features are very intuitive and easy to use, and so are many programs. Both machine and OS are pleasing to the eye as well.

  • Under the hood, there's Unix. This allows for lots of power, and Mac users can tap from the vast pool of Unix and Linux programs.

  • All this sounds really great in theory. One of the things that bothered me, however, was that programs can be very high-level (Mac) or very low-level (Unix), but there are very few that occupy a middle ground. As such, it's easy to be stuck between a user-friendly program that doesn't do what you want, and a Unix-based alternative that is a pain to configure and use (not to mention that you often need to compile it first).

  • As a Pythonista, and a Windows user, I was not content about how Python works on the Mac. Yes, I know people work tirelessly to make MacPython a great piece of software. Kudos to them, but to me, using Python on the Mac just isn't as easy as using it on Windows. "It just works" can be said for Python, wxPython and many other packages on Windows; less so for the Mac. Tkinter and wxPython programs work flawlessly on Windows, but on the Mac they either didn't look good or crashed. (Maybe these problems have been solved now, it's been a while. Ron Stephens reports that Kaa (using Tkinter) works fine on the Mac. Firedrop (using wxPython) does too, with a few changes.)

  • If I was going to use only the Mac, and no other systems, then all of this probably wouldn't have been too much of a problem... you put up with things, find out how to work around them, etc. But the problem is, I have to use Windows as well, and spend quite a bit more time there than on the Mac. As a result, there are some small but very annoying differences, that are very hard to get used to because you cannot learn one way and unlearn the other. Keyboard layout, for example. Home and End keys are mapped different on the Mac. Irrelevant? Not if you're trying to write a document and keep pressing the wrong keys.

  • Also, there are incompatibilities between the different version of the OS. Some programs compiled for 10.1 won't work on 10.2, and vice versa. (Now that 10.3 is out, this is probably even more fun.) And then there are the programs that need to run under OS 9. They work, but it's annoying since the emulator takes a while to start.

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.

Posted by Hans Nowak on 2003-12-16 12:59:22   {link} (see old comments)
Categories: switch

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. emoticon:confused

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:

  • My site doesn't look good in Mac browsers (like IE 5.2 and Safari 1.0). Needs fixed.
  • MacPython 2.3 for OSX installs, and seems to work (although IDLE crashes).
  • wxPython works as well. I even got to run the demo. ^_^ Maybe there's hope. Great work from Python and wxPython developers.

Posted by Hans Nowak on 2003-08-17 21:08:30   {link}
Categories: switch, Python

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.

Posted by Hans Nowak on 2003-04-28 22:38:18   {link}
Categories: switch

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:

  1. Home and End keys that behave like on Windows (i.e. go to beginning/end of line, not of document)
  2. some form of autoindent (if I am on an indented line and press Enter, I expect the next line to start with the same indentation)
  3. Tab and (preferably) Shift-Tab to indent/dedent

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?

Posted by Hans Nowak on 2003-04-27 01:33:49   {link}
Categories: programming, switch

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 (which should get you into insert mode) seem to do anything. Isn’t it great? Oh, and Home and End don’t work in Terminal either, making editing command lines a joyous adventure.

I’m done with the Mac for now. I’ll be back when I have a week to spare, or something.

Posted by Hans Nowak on 2003-04-25 22:27:37   {link}
Categories: switch

gmane

Last 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.

Posted by Hans Nowak on 2003-03-06 21:37:41   {link}
Categories: general, switch

Propaganda

WikiWikiWeb: 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.

Posted by Hans Nowak on 2003-03-05 11:58:34   {link}
Categories: switch

This is more like it

Slashdot: 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. :-)

Posted by Hans Nowak on 2003-03-03 22:27:55   {link}
Categories: programming, switch

Macking

Being 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).

Posted by Hans Nowak on 2003-02-10 21:16:23   {link}
Categories: switch

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...

Posted by Hans Nowak on 2003-01-19 22:28:55   {link}
Categories: switch

Yesterday's roundup

Besides hacking Kaa, I did some more stuff yesterday.
  • Python 2.3a1 builds right out of the box on the Mac. Well, a configure / make install does, at least. I haven't tested a framework build; heck, at this moment, I don't even know what a framework build *is*! <0.1 wink> So that is for later. Probably when I've digested large parts of Mac OS X Unleashed...
  • Charm works, well, like a charm. I used it to work on Kaa. While not perfect, it is quite useable. Maybe I should release it someday, although I don't think I should do that until all Requirements (20 at the moment) are met. (We're at 14/20, currently.)
  • As for Kaa, I also fixed a coupla bugs, and added two new buttons: "code" (inserts <code><pre> tags) and "blockquote".
  • Idea: What if Kaa also could validate HTML? That could be an interesting feature.
Gotta get back to work. More hacking later... maybe.

Posted by Hans Nowak on 2003-01-03 10:29:41   {link}
Categories: switch, Python, Kaa

It's a Mac's world

Some 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.)
On Darwin, everything's different, though. I just installed gadfly. distutils happily copies it to certain directories. Same for kjbuckets, which was compiled (using cc) first. All test pass. Nice.

I can't wait for Mac OS X Unleased to get more out of my Mac. ^_^

Posted by Hans Nowak on 2002-12-25 13:43:05   {link}
Categories: switch

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...

Posted by Hans Nowak on 2002-12-22 22:51:55   {link}
Categories: switch

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...

Posted by Hans Nowak on 2002-12-21 22:40:58   {link}
Categories: switch

That geeky Macintosh

Mac 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.

Posted by Hans Nowak on 2002-10-25 20:18:05   {link}
Categories: switch

Building Python

They 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.

Posted by Hans Nowak on 2002-09-01 15:18:39   {link}
Categories: switch

Running Python on the Mac

At 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.

Posted by Hans Nowak on 2002-08-31 22:11:04   {link}
Categories: Kaa, switch

Bro, this Mac is dope

Some stuff I learned today:
  • You can use "virtual disk images" (.dmg files). These are files that work like they're a separate disk drive.
  • You can eject a disk (CD, zip disk, virtual disk) by dragging it to the Trash icon.
  • LiteSwitch X enables me to alternate between windows like I'm used to. ^_^
  • The Gameboy Advance (GBA) emulator works. :) The N64 emulator doesn't, though; maybe I can find other/better ones on the Net. This is not a top priority, but I have these Pokemon ROMs, and...
More to come later. Let's see what I can do with Java. I don't really want to do lots of programming in it (after all, I have Python, although a better integrated version of MacPython has yet to be made), but a working Java means that I can use Jython.

Posted by Hans Nowak on 2002-08-31 19:22:04   {link}
Categories: switch

Differences

Mac 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:
  • Home and End keys have different meaning. I repeatedly found myself pressing these in edit boxes, to no avail. The Mac uses Ctrl-Left and Ctrl-Right for this (moving to the beginning or end of a line). In some programs (like ProjectBuilder's editor), Home and End move to the beginning and end of the document. In some other programs, like Acrobat Reader, they don't seem to do anything.
     
  • Clicking a window's "close" button (which is in the upper left corner on the Mac, by the way) does not automatically close the application as well. To do so, you have to press Apple-Q. (What is the name of the key with the Apple and the funny token on it? Cmd?) If you don't, the program stays in the "dock".
     
  • Where Windows uses Alt-Tab, the Macintosh uses Cmd-Tab. This works roughly the same as on Windows. The difference is that on the Mac, that keystroke just moves you one position forward to the next active program on the dock. (For non-Mac readers, the dock is a toolbar at the bottom of the screen, with icons that you can click to start a program quickly. A bit like the "quick launch" bar on modern Windows.) On Windows, repeatedly pressing Alt-Tab alternates between two programs or windows. The latter is very handy if alternating is indeed what you need to do, e.g. when you are looking things up in documentation or tutorial, and type text in an editor. This feature is missing on the Mac, or at least I don't know yet how to do it. Where's that mac-beginners mailing list...
These are some of the differences that are biting me (a bit) right now, simply because I'm used to other conventions. It's more of a problem that I don't have a good workspace for the Mac right now; the keyboard is positioned too high and the mouse doesn't have enough space, which is cumbersome and doesn't invite to a lot of hacking.

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:

  • Marc Liyanage's Mac OS X packages -- containing docs and tips, some software (including vim for OSX), and links.
  • Tracker-Tracker, a site to search for Hotline servers. (Hotline is a file sharing program; look for it on download.com or elsewhere. Hotline servers often contain Mac software.)
  • Another MacVim page (courtesy of Kow Kuroda).
  • And here are some programs that I haven't tested yet but that look interesting:
  • LiteSwitch X (a keyboard application switcher)
  • Silk (enable font smoothing in all apps)
  • TinkerTool (utility for hidden GUI options)

Posted by Hans Nowak on 2002-08-31 00:32:00   {link}
Categories: switch

--
Generated by Firedrop2.