Posts

Showing posts from December, 2004

iRiver: First Thoughts

So I got for Christmas the iRiver 340 music jukebox (40 gig version). I chose it over the iPod because:
It's cheaper - US$386.00 instead of $500.00.I can make Podcasts on it (i.e. I can record things at high quality)The battery is better than the iPod.It supports Ogg Vorbis audio compression.Has a radio (but I don't see myself using it very much).You don't need to use iTunes to copy your files.It mounts as a drive on Windows, and thus you can copy pretty much anything to it. My guess is that the iPod has a nicer interface, but I wouldn't know, since I've never used one.

I've been using my favorite synchronizing program, Unison, to update my iRiver. I'm using about 20 gig of disk space so far.

What I didn't like is that the US version of the iRiver:
doesn't come with a cradle (a $25.00 addon), the carrying case completely covers the buttons and the display (a proper carrying case is a $30.00 addon), so anytime I want do skip a song I have to take it…

Security: Off-the-Record Messaging

Theseguys created a method of sending IM messages which provides a method of chatting in such a way that you know who you are talking to is who you think it is (authentication), but soon after the message has been sent it can't be read anymore - the key expires and isn't saved.
An interesting point in the paper is that even when you use an cryptographic system, if the FBI takes you machine there's a good chance that they can get your messages and prove that you sent that message. If you did something incriminating this is the opposite of what you want.
As far as I understand the system, the messages are ephemeral and are unreadable after a short time (even by you). Yet at the same time there are some guarantees that the person you are chatting with is who you think it is rather than an imposter trying to get information from you.
I suppose the downside of the protocol is that you don't have a history of your messages which can be handy.
via slashdot.

Python: Static vs. Dynamic

Ian Bickin's article discussed some otherarticles:
[...] one way to decrease bugs is testing, but another way is to decrease the amount of code. Code deleted is code debugged. Static typing can decrease the number of bugs, but decreasing the amount of code is a much, much more effective way to decrease bugs.
...
Static type defenders complain about the combinatorial type interactions in dynamically typed languages -- how can you test all the code paths, given all the possible types? But their languages lead to combinatorial code, which is far worse: for many classes of hard problems, they can't solve them once, they have to solve them everytime they are encountered. Ouch.
Python is both dynamically typed (like VBasic and strongly typed (like Java), the best of both worlds.

Bruce Sterling's Talk

Image
The science fiction writer Bruce Sterling gave a talk. He talked about RFID, GPS, Internet Search, 3D design, 3D printer, and "Spime".

Business: Setting a Price

Joel Spolsky has a good article on setting a price a product, and whether you should set a price - or should you segment your market. The part I liked was:
Effectively I am willing to accept a lower price now in exchange for creating grassroots support. I see the low price of FogBugz as being an investment in advertising that I expect will pay off many times over in the long run.via del.icio.us

Robotic Nation

Image
The robots are coming, the robots are coming!
If you haven't read it I highly recommend you read Marshall Brain's Robotic Nation, it's a dystopian look at our robotic future. Fortunately, he does offer a solution, but you'll have to read it for yourself.
You may also want to read his Manna stories which is a little like a short science fiction story.

Visited Countries

Image

Economy: Brazil's green revolution

The NY Times has an article about Brazil and agriculture (via Marginal Revolution).The global effect has been powerful. In June, the United States imported more in farm products than it sold abroad, further evidence of its eroding position.
...
Agriculture is now a $150-billion-a-year business in Brazil, accounting for more than 40 percent of the country's exports and creating what Brazilians call the "green anchor" of their economy.
Already the world's biggest exporter of chickens, orange juice, sugar, coffee and tobacco, according to Agriculture Ministry statistics, Brazil soon hopes to add soybeans to the list, depending on what happens in that volatile market.
With a grass-fed herd of 175 million cattle that is the world's largest, it passed the United States as the world's largest exporter of beef last year. During the first nine months of 2004, sales of Brazilian beef abroad rose 77 percent over the same period last year, leading the government to predi…

Python: Speed

One of the many things I like about Python is that it is fairly easy to incorporate C++ modules into it in such a way that it appears to be just another Python class. This is useful for those pieces that need to access an external library or if you want to speed up a piece of code.
For a project I did for my wife I wrote part of it in C++ using the boost python library. It's not a bad way to go since you may already need the boost libraries anyway. Another method is using the SWIG library, for a comparison of the two libraries look at this article. My experience was quite positive using the C++ with Python.
Knowing that I have this back door really feels liberating. It also means that a lot of libraries you can get for Python are actually written mostly in C or C++ and not in pure Python.
There are two other methods of speeding up your Python.
The simplest to use is Psyco which claims an average of 4x speedup (2x-100x). It works with unmodified Python code and it's only real…

New Kirkwood arriving..

Well I got both a Christmas gift and a Birthday gift this month. Found out that my wife is pregnant and should arrive around my birthday.

python: Using pysqlite 2.0 & 3.0 on the same machine

I use the beta pysqlite for some development and it works very well, highly recommended.
I also use wxMusik to listen to my music, I like it because it's open source. My beefs with wxMusik is that it doesn't have fast forward and the interface is a little confusing, although I've become used to it. One nice hidden feature of wxMusik is that it uses Sqlite for it's database (that's also why it's so fast!). Unfortunately, it's an older version of the database and pysqlite installs in only one folder. So here's what I figured out to be able to support both the old db and the new one with python.
Install pysqlite 2.0 normallyMove down _sqlite.pyd from the lib to the sqlite folder instead of the site-packages folder.Download pysqlite 1.0 the exe version.Instead of double clicking it open it with a zip program (it's just a zip file).Extract main.py, and __init__.py and _sqlite.pyd into a site-packages\sqlite2 folder.Done! Use import pysqlite for the no…

Programming: Groovy

Groovy, yet another computer language. This one is interesting since it combines the best of Python and Ruby (and others) and puts it on the JVM platform. This might appeal to businesses since it has Java ties.

Groovy is a new agile dynamic language for the JVM combining lots of great features from languages like Python, Ruby and Smalltalk and making them available to the Java developers using a Java-like syntax.

Groovy is designed to help you get things done on the Java platform in a quicker, more concise and fun way - bringing the power of Python and Ruby inside the Java platform.

Groovy can be used as an alternative compiler to javac to generate standard Java bytecode to be used by any Java project or it can be used dynamically as an alternative language such as for scripting Java objects, templating or writing unit test cases.

Linux: no password setup of ssh

Here are the steps requires so you can ssh to another machine without needing to type in the password each time. Here I assume that both machines have the same username.
Here $newmachine, $oldmachine, and $user are variables.
ssh-keygen -t rsa
(enter, enter, enter) -- i.e. no passphrase
ssh $newmachine
(enter your password)
cd ~/.ssh
scp $oldmachine:/home/$yourname/.ssh/id_rsa.pub tmp.pub
cat tmp.pub >> authorized_keys
chmod og-rwx authorized_keysrm tmp.pub
exit
ssh $newmachine
(look ma, no password)

Development: Architecture Astronauts

Listening to Dave Winers Morning Coffee Notes I learned a new expression: Architecture Astronauts (coined by Joel). It reminded me a of a case where we started designing a new system that was supposed to integrate two existing products by making a connectivity library that would be used by these two products (this was at Andyne). We were doing everything by the book: use cases, meeting notes, UML diagrams etc.. We met several times a week for an hour or so and discussed details at length. Yet after several months of this we still didn't have half of the project designed and absolutely no code written. We had become Architecture Astronauts.
We kept flying higher and higher trying to design the perfect connectivity layer that could handle both SQL data sources and multidimensional data sources, and we ended up nowhere. Thinking of UML diagrams and Use Cases still leaves me with a bad taste in my mouth (although less so after reading Writing Effective Use Cases).
Now that I have a na…

On Being Shy

This was painful for me to watch [Click on The Art of Flirting, I couldn't link to it directly]. But one part that I found really helpful was this interaction with an expert (Dr. Lillian Glass) and the shy person (Deborah Garrett):
Glass: What do you feel like when you go to a room like that?
Garrett: I feel like I don't belong.
Glass: Ok, you know why? And you may think this is rude, but I'm not trying to be rude. It's because you're selfish. What do I mean by that? Shy people are selfish, you're thinking about yourself. Let's get unselfish - thinking about other people. What do you do? How are you? And all of a sudden, you're going to be a whole different person.
I think this might have helped me in some situations. I'm being shy, therefore I'm being selfish, I'm thinking about myself and my shyness. I should try and show that I'm interested in someone else by asking questions. I remember my dad talking to my mom (a long time ago) and …

Art: More infinite zooming

A previous post of mine mentioned a neat infinite image called Zoomquilt. Here's another one that uses only one image and recursively zooms in, and how to do it.

Linux: Setup

Here's some notes to myself on how to setup Solaris at work.
From this site I figured out how to setup the home, end and delete keys to my liking. Put this in my ~/.inputrc file:
# Home Key
"\e[7~":beginning-of-line

# End Key
"\e[8~":end-of-line

# Delete Key
"\e[3~":delete-char
This is especially handy since I'm using GNU screen and the Ctrl-A key doesn't work as the Home key.
In my ~/.profile file I have added
export PS1="[\w]\n${MYHOST}% "
Which puts the path name on a separate line.

And here I got the trick of using ^from^to^ to search and replace my last command.

Economy: Hydrogen

Physics Today (which unfortunately uses the Netscape Logo on their site) has an in-depth article about the Hydrogen Economy. Here are some parts I liked.
[...] Hydrogen is abundant and generously distributed throughout the world without regard for national boundaries; using it to create a hydrogen economy?a future energy system based on hydrogen and electricity?only requires technology, not political access.
...
The natural world began forming its own hydrogen economy 3 billion years ago, when it developed photosynthesis to convert CO2, water, and sunlight into hydrogen and oxygen.
...
A major attraction of hydrogen as a fuel is its natural compatibility with fuel cells. The higher efficiency of fuel cells?currently 60% compared to 22% for gasoline or 45% for diesel internal combustion engines?would dramatically improve the efficiency of future energy use. Coupling fuel cells to electric motors, which are more than 90% efficient, converts the chemical energy of hydrogen to mechanical …

Gadgets: 1.2TB Linux Box

Image
This on has me salivating, although I don't have US$2,000.00 to spend on it. With a TV tuner you could record oh so much. I think this is the near future. Homes with have a SAN like setup with with terabytes of data of free space. You'll never have to delete a TV show, MP3, or picture again. If you need more space you just add on another disk. It will all be behind your firewall on you local, high speed network.
via Engadget

Python: Don't program Python like Java

At dirtSimple.org there's an article that talks about an experience he had with a large program that was written by Java developers. He notes that the program suffered from not being very Pythonic. Some interesting points:
Don't write getters and setters. When you need it use the property() function.If you needs a switch statement use a dictionary, not if,elif.

Cool: The Zoomquilt

Zoomquilt is a nifty colaborative art project where you can zoom in and in and in...
via metafilter