Showing posts with label developer's life. Show all posts
Showing posts with label developer's life. Show all posts

2010-01-22

The Metamorphosis of Prime Intellect

"It's easy to see our problems and the solution to the problems that we have now. But it is very hard to see how that solution is going to turn on us, and the new problem that it's going to be."
From the interview to Roger Williams ("localroger") in the Gday World podcast. He is the author of "The Metamorphosis of Prime Intellect", a "short" (more than 100 pages long) story available online. Very interesting, at least for me, who still had not read any Singularity fiction.
Seedy title and a letdownish ending. But pretty good, and some deep stuff, if hard to stomach at times... although it makes sense. Also, very interesting to compare that kind of world to Matrix… and, even more, to Baudrillard's complaints about Matrix.

His other short stories, the Passage series, are also pretty good. Donation-worth good.

I arrived at this from Yegge's 3rd entry on the "a programmer´s view of the universe" series, which is a story. Which at the moment seemed respectably good, but after MOPI and Passage, is just a cute toy. Supposedly Yegge wanted to explain something, but he seems to have abandoned the thing, and what he has done up to now is interesting, but I can't see why he expected it to be kind of explosive. Maybe something related to his environment?…

Anyway, it's a pity he left blogging. His rants have been a powerful guide for a lot of doubts I had, and some which I didn't even know I had. He convinced me to go the SICP/python route instead of the C++ one, and to revisit the Java world, although maybe not for Java itself. About which I'll have to explain a bit, because I know some people which would like that same enlightenment…

(...and some other which won't like it but should get it anyway)

2010-01-15

Mini-guía para crear ficheros RTF

Generar un documento RTF simple (sin tablas ni imágenes, por ejemplo) pero con cosas interesantes (fuentes, colores, párrafos, incluso estilos!) es muy fácil.

En inglés hay una pequeña guía en http://search.cpan.org/~sburke/RTF-Writer/lib/RTF/Cookbook.pod, pero no llega a meterse en estilos. También está la especificación completa del formato RTF en la web de Microsoft. Yo necesitaba algo intermedio, y no parece haber guías en castellano, así que aquí está lo que he aprendido y estoy usando.

2009-07-03

" You Can Solve Any Problem With Another Level Of Indirection"

...and looks like the job of the programmer is to avoid being he himself another level (the last one?) of indirection.
(at least the interesting programmer jobs)
(And I have a feeling that that is the reason I should get to finish the "Structure and Interpretation of Computer Programs" course)
(On the other hand... overengineering?)

2008-09-08

Bus error in MacPorts' Python

PyQt4 (MacPorts' py25-pyqt4) was causing a Bus Error.

Some previous problems with the Python 2.5 installed by MacPorts made me think it could be some dependency with the native library called by the Python module; that is what I think that was also happening with py25-hashlib, which caused an error about being unable to find _md5 or some such, and which got fixed by uninstalling MacPorts' openssl 0.9.8g and installing 0.9.8h (and reinstalling py25-hashlib afterwards).

(and I say "think" because maybe that problem was unrelated to openssl, and in fact could be related to python_select, which I maybe had or had not run. Read on for more on that. Anyway, there was also some report online of problems between Pythons' hashlib and openssl because of the exact version used, and mentioned Python being a bit fragile in that respect — although it didn't say if that was because of a not-too-robust build/installation process, or because of Python's design.)

But here the problem was different. Reinstalling Qt 4 and PyQt4 did not help. After some googling, I found someone (thanks jherm) with the same problem... and who in some chat log is told by some MacPorts developer (?) the anticlimactical solution: follow the instructions at the end of the installation of MacPorts' Python 2.5. That is,
$ sudo port install python_select $ sudo python_select python25
Looks like this has to be run "to complete the installation". Sheesh. So that was a hard requisite? Shouldn't that have been told pretty explicitly then? (I'm seeing a number of reports about this kind of problem, so yes, I think the warning should be quite more explicit... I should start some bug reporting, I guess.)

So the problem seems to be that PyQt4 uses Python in its build process, assuming that it is the same in which it will be run afterwards. But in my case I had not run python_select after installing MacPorts' python25, because it seemed optional, and I didn't want to use it as the default… so PyQt4 was building against OS X's default Python.

So, after python_select, PyQt4 builds OK. It doesn't manage to get fully installed, mind you, but I guess that this other problem has more to do with MacPorts. Anyway, with a
$ sudo port -f install py25-pyqt4
it finally gets installed (although something remains to be finished, like the MacPorts' database getting properly updated; that can be checked with -d).

All of this was in the process to try to make Anki run from source. I was trying to test some modifications before sending the patches, but making sense out of the tortuous source and setting up the environment have required much more time than expected. I should be studying Polish instead! The exam is coming! :P

2008-08-15

Making a Mac OS X driver for the Toshiba G450 3G modem

About 3 weeks ago, I had to buy the 3G modem Toshiba G450 because Polish operator Play would not let me get the plan I wanted without it.

A few hours later, I had to accept that there are no Mac OS X drivers for it! Which would have made me, say, unhappy, had I not had my trusty Huawei E220. The only information I have been able to come up with are amazed reviews from gadget websites. Not even a driver for Linux... And this happens when I was thinking about polishing my low-level development powers (there is more to life than Java and C#, you know!)... so, why not take the chance to learn about what is needed to make a driver?

The modem uses the ZeroCD "trick" of appearing as a USB drive to the OS, until it receives an existent-but-generally-unused-in-USB-drives command; at that moment, the drive is "unplugged" and a new device appears in the bus: the modem. So in the USB drive that appears first, there is a driver installer (for Windows, of course). The user (or the autorun) installs the driver, and it sends the switching command to the USB drive it recognizes as the masked modem. Drive goes away, modem appears, and driver finally does its thingy with the modem.

Up to now, I have been successful in capturing the appropiate command with usbsniff and making the USB drive switch in Linux and Mac OS X, with the help of usb_modeswitch (http://www.draisberghof.de/usb_modeswitch/ , where I have already sent the info so they can use it in later versions). So now the modem is waiting for my next move. I was half expecting it to just be recognized by the serial driver, but that would have been too easy, wouldn't it?

So I have been reading about the internals of USB, now about IOKit (the driver subsystem in OS X), have re-learnt C in a rush, and now am contemplating starting with C++, of which IOKit uses "a restricted subset" (no RTTI, no templates, no exceptions... which in part I guess will make the thing easier, although I am afraid those were the interesting parts of it). And yet looks like I will have to read a bit about kernel programming in OS X. Which is also something I wanted to do, but... I was expecting this first project to be a little lighter!

On the other hand, I am suspecting this won't be THAT difficult. The Huawei E220's software for OS X (driver and app) doesn't look exactly brilliant, which makes me think someone hacked it together somewhat quickly; and it works in a similar way to the Toshiba G450. I even thought about hacking a bit the Huawei's kernel extension (looks like I should only edit an XML file in the bundle), but even if it worked I don't think I would be able to distribute it nor would I learn anything. And I don't actually need the modem ;P.

Also, the Darwin open source repositories have an example driver for USB modems. And after all we are only talking about making the OS see "the serial ports" in the USB interfaces... I mean, it should be as easy as it can get, since everything beyond that point will be taken care of by other parts of the OS. But still this is about kernel programming in C++ for a novice. Lots of little interestingly nasty ways to hose the whole OS. Nice!

Of course, no small part of the problem is making sense of all of this and still having time for language courses, travelling, personal life... and my regular job - and searching for a new one. Sounds a bit like DDoS, doesn't it? :)