Last time when I went to Paris, my flight was departing from Orly Airport, the second largest airport in Paris. Many cheaper Airlines operate at this airport and it seems only be used for shorter distance flights, within the EU. Orly is located in the South of Paris and reachable by a number of different ways.
The cheapest way to get to the airport from the center of Paris is taking the subway all the way to "Port de Choisy" station on line 7. You need one ticket T+ ticket for that. Then you get off and take the 183 bus straight to the Orly airport with another T+ ticket. That's two tickets for a total of only 2.30 Euro! Be prepared that this bus ride will last another hour. AND BE SURE to take the right 183 bus! Not all the 183 buses go to all the way to the airport. There are two bus stops. Take the one on you left, but check the bus caption and timetable. There is an electronic display that shows you where the next two buses go. If unsure you better ask the bus driver before boarding. I didn't know that and almost missed my flight because the 183 bus to Orly Airport only departs every 30 minutes or so. I was too fascinated by the area around "Port de Choisy".
If you cross the street from where the bus stop is you land in Chinatown! I don't know if this district is mentioned in any guide book; at least in mine it was not. I didn't expect to find so many Chinese shops, restaurants and Chinese people there: mothers with their children, elderly Chinese in the park, workers coming home eating at restaurants or buying Chinese food in one of the many Chinese shops there. It's definitely worth a visit. And if you need to go to Orly Airport anyway, it makes up a good combination; have an authentic Chinese meal at one of the many restaurants or buy some snacks for your flight.
If I needed to go to Orly again, I would definitely do it in the same way. It may take a little bit longer than the train, but it's cheaper and you get to see some outer parts of the city that most tourist even don't know of. Just be sure too have enough time on hand.
Saturday, March 27, 2010
Sunday, March 21, 2010
Visit Pompidou
When I went to Paris last week, I made sure I go to the famous and historic Louvre and d'Orsay Museums. Both are stunning Museums and at least one should be on the list of your sightseing activities when you visit Paris. If I had to choose between one of those for time reasons I'd probably go with the later one because it is not as gigantic as the Louvre. I saw both, but was very selective in what I wanted to look at. I didn't spent more than 2 hours in each and pretty much headed right to main "attractions": the Mona Lisa in the Louvre, and the Van Gogh self Portrait in the d'Orsay.
But since I got myself a 2-day Museum Pass and the Centre Pompidou was on the list of its accessible Museums, I decided to go there too - and I should spent more time in it than in the Louvre. The building itself is quite an attraction: all tubes and cables run outside the building; that is, there is no concrete that covers them, the building is see-through. Taking a transparent tube escalator upstairs you enter the museum and exhibition halls. It's modern art from the 20th century to the present: famous paintings from Piccasso, Mantisse, Leger, and abstract construction, installations, lots of naked skin and body art. Maybe not necessarily the family or work-safe museum - but then after all, it's just art! Be sure not to miss it on your next Paris trip. Since entrance fee with 12 euros is quite steep, consider getting a Museum Pass if you visit another museum as well.



But since I got myself a 2-day Museum Pass and the Centre Pompidou was on the list of its accessible Museums, I decided to go there too - and I should spent more time in it than in the Louvre. The building itself is quite an attraction: all tubes and cables run outside the building; that is, there is no concrete that covers them, the building is see-through. Taking a transparent tube escalator upstairs you enter the museum and exhibition halls. It's modern art from the 20th century to the present: famous paintings from Piccasso, Mantisse, Leger, and abstract construction, installations, lots of naked skin and body art. Maybe not necessarily the family or work-safe museum - but then after all, it's just art! Be sure not to miss it on your next Paris trip.
Photo from one of the exhibition rooms of Centre Pompidiou.
There are a lot of art students there practicing drawing.
(shot with my Canon A710is).
(shot with my Canon A710is).

Saturday, March 20, 2010
About taking photos and snapshots
Yesterday I came back from a Trip from to Paris. And like on every trip I go I took my camera with me. And it seems with every trip I am taking more and more pictures.
The ubiquitous availability of digital cameras, big and cheap memory cards and rechargeable batteries allow us to take endless pictures. Taking a digital picture is virtually free. The marginal price for taking another picture consists merely of a fraction of the price for the power you need for charging your battery; and since you have a power outlet in any decent hotel or youth hostel, the marginal cost is really zero.
So if taking digital pictures is free, why shouldn't I take as many as I could? That is what most tourist seem to think nowadays. Every time there were many tourists taking picture of something, I just felt the urge to take pictures too. Well, that is snapshots. Snapshots are pictures that are taken out of the urge to take pictures, with no composition or thought about the motive. Snapshots are all right for your memories, but they all look the same.
And even though shooting digital pictures might cost no money, it consumes some of your precious traveling time. Sometimes seeing, absorbing and understanding your environment makes more sense than a picture. Or like Kevin Spacey says in a commerci al: "Point-and-shoot? That's a crime."
Sunday, March 14, 2010
Korean Finger Food [Photo]
Korean Fast Food at the Franfurt Main Railway Station
(Shot with my 1MP Camera on my Motorola Razr and edited in iPhoto)
Some thoughts about the iPad
As I had correctly guessed, Apple enters the ebook market with its iPad introducing big competition to the Amazon Kindle. Unlike on the Kindle, though, users can consume more kind of contents than just eBooks: movies, music and applications. The iPad is coming out next Month, and I have thought about whether or not I'm getting one.
The iPad is advertised as a multi-purpose device for consuming and experiencing purchased content and the internet; Alex calls the iPad a "cynical .. digital consumption device". But as many
have pointed out the iPad just seems like a bigger version of an iPhone/iPod touch (Have a look at this funny depiction). So I asked myself is it really worth the purchase? What is it that it can really do better than a notebook or a smartphone?
According to Steve there are many things that the iPad does really better; for me there is only the advantage that, due to its larger screen real estate, reading gets much more comfortable; this includes eBooks, as well as articles or documentation from the Internet. Other than that I am pretty sure, that a smart phone suffices my mobile connectivity needs, and a notebook my needs for getting some serious work done.
Unfortunately the battery supposedly lasts only (or until up to) 10 hours, which might be an annoyance if you use the device primarily for reading. So wouln't one be better of with a Kindle, if reading was one's primary use case. Unfortunately, the Kindle only has a monochrome, non-touch display and is a "consuming machine" itself. So reading your papers or PDFs is as far as I know not possible. And the Kindle is not really cheaper than the iPad.
Just looking at the technical and sexy attractiveness, the iPad clearly beats the Kindle hands down. But as a personal computer it lacks one quality trait: openness (see Alex). As on the iPhone there will be probably "root" hacks, that allow will allow me to tinkle around on the device. But doesn't change anything on the Apple's iPad policy. I'm still not sure I wanna get an iPad when such great Apps like Stanza are "censored" maybe making me only buy books from Apple's own bookstore in the near future. But maybe the reading experience on the iPad just beats every other eBook reader. Let's see.
The iPad is advertised as a multi-purpose device for consuming and experiencing purchased content and the internet; Alex calls the iPad a "cynical .. digital consumption device". But as many
have pointed out the iPad just seems like a bigger version of an iPhone/iPod touch (Have a look at this funny depiction). So I asked myself is it really worth the purchase? What is it that it can really do better than a notebook or a smartphone?
According to Steve there are many things that the iPad does really better; for me there is only the advantage that, due to its larger screen real estate, reading gets much more comfortable; this includes eBooks, as well as articles or documentation from the Internet. Other than that I am pretty sure, that a smart phone suffices my mobile connectivity needs, and a notebook my needs for getting some serious work done.
Unfortunately the battery supposedly lasts only (or until up to) 10 hours, which might be an annoyance if you use the device primarily for reading. So wouln't one be better of with a Kindle, if reading was one's primary use case. Unfortunately, the Kindle only has a monochrome, non-touch display and is a "consuming machine" itself. So reading your papers or PDFs is as far as I know not possible. And the Kindle is not really cheaper than the iPad.
Just looking at the technical and sexy attractiveness, the iPad clearly beats the Kindle hands down. But as a personal computer it lacks one quality trait: openness (see Alex). As on the iPhone there will be probably "root" hacks, that allow will allow me to tinkle around on the device. But doesn't change anything on the Apple's iPad policy. I'm still not sure I wanna get an iPad when such great Apps like Stanza are "censored" maybe making me only buy books from Apple's own bookstore in the near future. But maybe the reading experience on the iPad just beats every other eBook reader. Let's see.
Saturday, March 13, 2010
From hunt-and-pecking to browsing the WWW
Playing around with a lot of different Firefox plugins over the last few days, I have come to realize that the way we consume Internet content has been undergoing a change. What had been targeted fishing for small fish in the huge information ocean, has now been transformed into whale like soaking. Instead of searching from a vantage point for well defined prey, we just swallow tons of water into us and hope to find some nutrition in it.
Streams of information are the product of social networks and recommender systems. What begins as a small creek, a twitter status update for instance, accumulates to streams, rivers and oceans. Trough the act of consuming those information streams our surfing behavior is changed. We click on links to sites we never would have visited, google for things that we never heart of, and subscribe to even more information streams we didn't even know existed.
Twitter is just one example. Take all this other stuff we are fed with every day: Facebook, Stumbler, Delicious, Last.Fm, Glued, ... All those applications generate endless information rugs that we wade through with our personal quivers. And at the end of the day we come home with new catches of internet addresses and content pieces.
Why did I mention the Firefox plugins? Having installed extensions for many of the social network sites mentioned I find myself more than often not using the address bar to navigate to a certain site. Instead I just follow the latest tweets or hit a key combination to stumble over new information; and if it's delicious I might put it in my Facebook for every one else to browse.
Streams of information are the product of social networks and recommender systems. What begins as a small creek, a twitter status update for instance, accumulates to streams, rivers and oceans. Trough the act of consuming those information streams our surfing behavior is changed. We click on links to sites we never would have visited, google for things that we never heart of, and subscribe to even more information streams we didn't even know existed.
Twitter is just one example. Take all this other stuff we are fed with every day: Facebook, Stumbler, Delicious, Last.Fm, Glued, ... All those applications generate endless information rugs that we wade through with our personal quivers. And at the end of the day we come home with new catches of internet addresses and content pieces.
Why did I mention the Firefox plugins? Having installed extensions for many of the social network sites mentioned I find myself more than often not using the address bar to navigate to a certain site. Instead I just follow the latest tweets or hit a key combination to stumble over new information; and if it's delicious I might put it in my Facebook for every one else to browse.
Thursday, March 11, 2010
Goethe monument

My Editorssey
My Editorssey
--------------------
I don't want to know how much time I have wasted finding the best editor for my needs. Have I found it yet? Well, not really. I am using still several editors on a regular basis depending what task I am working on or what system I am using. Was it worth the time spent to try and learn new editors? Not really. But it was fun though. Let me take you on a small journey.
Back in the days of Windows 95 I started with the built-in Notepad for tweaking system files like AUTOEXEC.BAT and CONFIG.SYS. When I booted in DOS only mode to tweak expanded memory for ancient games like Mortal Kombat and Destruction Derby I made use of the good old EDIT editor with its dazzling light letters on a just as dazzling light blue background. The basic editors were so basic that I wouldn't actually think about them at all. They were just necessary tools and came with the system.
Then in middle school I started programming. I bought the MSDN Visual Studio student edition - an Integrated Development Environment (IDE) that brought its own editor. Programming for me at that time was opening Visual Basic Studio, writing and compiling code in it. How could I know that I was just editing plain text files I could have edited with Notepad, EDIT or any other text editor as well.
After a while I realized that learning Visual Basic from a Dummy book wasn't really teaching me about the gits and guts of programming. I wanted to look behind the Draw-Your-program-Drag-and-Dropping curtain. I got started with C and C++ programming, wrote console programs and ,after I got The Petzold - the Windows API bible - for free from some stranger on the Usenet, even GUI programs. Since I edited all my code in the IDE instead of drawing them in Visual Basic I even got to understand the concepts of the Windows API.
At some point I even wanted to go more low level - assembler and hex level. I wanted to hack a latin program for vocab learning and I needed an editor that would allow me to edit binary files in Hex mode. I came across UtraEdit and I really liked it. It was way more advanced than the packaged Notepad, had syntax highlighting, a sleek and professional looking appearance to it. Using it I was eventually able to crack the time limit -- a huge feeling of satisfaction and power. I continued using UltraEdit for programming C/C++. I could tweak the editor to compile programs and even run them -- totally sufficient for the small command line programs I wrote at that time. "Who needs an IDE, anyway" I thought.
Soon I would get introduced to one again, though. In computer class in high school they made us use the Turbo C++ IDE, an DOS IDE. It reminded me of the EDIT editor having almost the same color scheme. To be honest it felt more like an editor than an IDE, maybe that was the reason why I liked it. I even used it to write and coordinate a Tank Wars game clone as president of the computer club.
I tried out Linux several times some teachers and friends swore by it. I gave up several times, either didn't get X up running or a mouse installed. But maybe the main reason was the sheer amount of text files that you had to edit and I didn't know how to use any of the unix editors at that time. Frankly, I didn't bother to learn them. I was too frustrated with Linux. It was only after Knoppix came out - a Debian based live CD that had all the drivers for my system and worked right after booting up, that I became again interested in Linux. I signed up for the LPIC exam and started with learning an editor; my book said there were two: Emacs and VI. I chose VI. How did I learn it? ":help tutor" was all it took and after around 30 minutes I mastered all the basic movement and editing commands. Linux started to be fun. Right after finishing the quick start guide I continued to read more of the manual and soon VIM turned out to be a powerful tool and captivating toy at the same time. It is not exaggerated when I say that I learned Linux by learning VIM.
When I came to university we were taught Pine and Emacs on Solaris machines; but since I already knew enough Unix, I cold-shouldered those programs and modified my environment to use mutt and VIM instead.
VIM did all the things I needed to do and it did it beautifully. Using the commands and modifiers made me feel I was more efficient doing my work than other students using Emacs or KEdit. I began tweaking VIM to become more efficient -- ignoring the time it cost to tweak VIM of course.
I even started to do my homework and write letters with VIM writing everything in LaTeX. The postscript results were beautiful and I thought I would never need another text processing program again in my life. I looked for a Windows VIM version for my first laptop and installed the Cygwin environment on my Windows computer (Linux didn't run it sufficienty enough). I disregarded Emacs and never thought that I would bother learning it until I had to write my master thesis. Maybe in an act of procrastination I began learning Emacs because somewhere on the Internet I read that the AucTex mode was the ne plus ultra for editing LaTeX documents. So I learned Emacs meticulously - with all its cryptic key combinations, and strange major and minor modes and with Elisp - the Emacs programming language. I tweaked and wasted more time time than anticipated - days, a week - before I was somewhat confident in speaking "Emacs". Oh yeah, of course, I had to pimp the look and appearance of my Windows Emacs installation too, before I could begin writing my thesis. I always told myself that the LaTeX typeset output was worth it and that it was more safe to Edit plain text files than write in Word of OpenOffice. I told myself that the write feeling on Emacs was just different and actually let me write more and better; I still have the feeling that typing in Emacs just feels different from VI - I don't mean the key combinations or shortcuts, but actually the feeling of typing (Anybody feel the same?). Emacs felt more like a text processor -- so I felt it was the right choice for my master thesis.
I eventually finished my thesis with Emacs and stayed with it, even for programming - at least for my personal stuff. At work I had to use Eclipse because everyone else used it and it was just best to use it I was told. I was shocked that my colleagues were so conservative and myopical, considering Eclipse the only way to program Java just like I did with Visual Studio back in the days. Finally I reluctantly submitted to their request to use Eclipse. It certainly was more convenient than writing Ant or Maven by yourself, or converting all the Eclipse projects that they dilettantishly commited as a whole into their CVS. For them Java seemed to be Eclipse - that was my annoyance, not Eclipse itself.
Around that time I also had started to write Web applications with Ruby on Rails. Not being satisfied with neither Emacs nor Eclipse for that task, I went with the Netbeans IDE. With its sleeker and cleaner interface it just seemed to suit the lean and smart Rails paradigm better.
The Netbeans interface was also more Mac-like. I converted to Mac with a Macbook Pro, my second notebook. Everyone seemed to praise Textmate -- the über-editor for the Mac. And the editor of choice for many Rails developers. It certainly looks nice, but I never bothered to learn it as meticulously as VIM or Emacs because I thought: "What's the point if you can only use it on a Mac?" So I tried out all major Emacs distributions (Aquamacs, Emacs.app, Carbon Emacs). After all Mac OSX is an Unix system under hood.
Yes, Emacs with its cryptic key strokes, modes and Lisp dialect, the almighty text editor that does all and everything for its disciples had even became a religion as noted by its inventor Richard Stallmann. But being an all-in-one device comes at the price of complexity -- some call Emacs an operating system. Recapitulating I don't like the steep learning curve and the huge and messy configuration files, that one accumulates over time. Even on my dual core Macbook Pro booting the beast up felt sluggish at times.
Yesterday I decided I needed a modern editor, something newer than the 35 year(!) old Emacs or VI. After some googling I realized that there simple was nothing as powerful and ubiquitous as those two classic editors. But sine I wanted a change, I went back to VIM. I installed the MacVIM distribution from macports and I'm liking it. It feels fast, sleek and clean and editing files in it is pure fun. You don't need thousands of lines configuration to start typing and navigating away quickly. Using the right color theme (desert at the moment), you even get a Textmate look. VIM is a relief from Emacs. And not only my pinky thanks me for it. Old memories from my first Unix day become lively. Storm and stress, programming for fun. Just the right mood I need for learning some Python these days. Compiling VIM with the +python feature I can even extend the editor with Python and avoid the arcane Vimscript.
My editor Odyssey is certainly not over yet. While I have wasted a lot of time for learning different editors and IDEs so far, I have also learned a lot of new things during that progress. It is true, that sometimes I have spent more time tweaking my editors than doing actual work. But tweaking isn't that what constitutes the excitement about computers anyway? At the moment I am using OpenOffice for word processing, Netbeans for Rails programing, Eclipse for Java and VIM for all other editing tasks. There is no swiss army editor for all my writing or editing tasks. So "religious" statements from fanatic editor disciples about extensive economics when learning a new editor are far more than dubious.
Colophon: This blog entry was written with aforementioned MacVim with linebreak (:help linebreak) set, mapping of the cursor keys to move by visible rather than "physical" lines (:help 25.4) and spell checking enabled (:set spell) so that it almost feels like a real word processor ;)
--------------------
I don't want to know how much time I have wasted finding the best editor for my needs. Have I found it yet? Well, not really. I am using still several editors on a regular basis depending what task I am working on or what system I am using. Was it worth the time spent to try and learn new editors? Not really. But it was fun though. Let me take you on a small journey.
Back in the days of Windows 95 I started with the built-in Notepad for tweaking system files like AUTOEXEC.BAT and CONFIG.SYS. When I booted in DOS only mode to tweak expanded memory for ancient games like Mortal Kombat and Destruction Derby I made use of the good old EDIT editor with its dazzling light letters on a just as dazzling light blue background. The basic editors were so basic that I wouldn't actually think about them at all. They were just necessary tools and came with the system.
Then in middle school I started programming. I bought the MSDN Visual Studio student edition - an Integrated Development Environment (IDE) that brought its own editor. Programming for me at that time was opening Visual Basic Studio, writing and compiling code in it. How could I know that I was just editing plain text files I could have edited with Notepad, EDIT or any other text editor as well.
After a while I realized that learning Visual Basic from a Dummy book wasn't really teaching me about the gits and guts of programming. I wanted to look behind the Draw-Your-program-Drag-and-Dropping curtain. I got started with C and C++ programming, wrote console programs and ,after I got The Petzold - the Windows API bible - for free from some stranger on the Usenet, even GUI programs. Since I edited all my code in the IDE instead of drawing them in Visual Basic I even got to understand the concepts of the Windows API.
At some point I even wanted to go more low level - assembler and hex level. I wanted to hack a latin program for vocab learning and I needed an editor that would allow me to edit binary files in Hex mode. I came across UtraEdit and I really liked it. It was way more advanced than the packaged Notepad, had syntax highlighting, a sleek and professional looking appearance to it. Using it I was eventually able to crack the time limit -- a huge feeling of satisfaction and power. I continued using UltraEdit for programming C/C++. I could tweak the editor to compile programs and even run them -- totally sufficient for the small command line programs I wrote at that time. "Who needs an IDE, anyway" I thought.
Soon I would get introduced to one again, though. In computer class in high school they made us use the Turbo C++ IDE, an DOS IDE. It reminded me of the EDIT editor having almost the same color scheme. To be honest it felt more like an editor than an IDE, maybe that was the reason why I liked it. I even used it to write and coordinate a Tank Wars game clone as president of the computer club.
I tried out Linux several times some teachers and friends swore by it. I gave up several times, either didn't get X up running or a mouse installed. But maybe the main reason was the sheer amount of text files that you had to edit and I didn't know how to use any of the unix editors at that time. Frankly, I didn't bother to learn them. I was too frustrated with Linux. It was only after Knoppix came out - a Debian based live CD that had all the drivers for my system and worked right after booting up, that I became again interested in Linux. I signed up for the LPIC exam and started with learning an editor; my book said there were two: Emacs and VI. I chose VI. How did I learn it? ":help tutor" was all it took and after around 30 minutes I mastered all the basic movement and editing commands. Linux started to be fun. Right after finishing the quick start guide I continued to read more of the manual and soon VIM turned out to be a powerful tool and captivating toy at the same time. It is not exaggerated when I say that I learned Linux by learning VIM.
When I came to university we were taught Pine and Emacs on Solaris machines; but since I already knew enough Unix, I cold-shouldered those programs and modified my environment to use mutt and VIM instead.
VIM did all the things I needed to do and it did it beautifully. Using the commands and modifiers made me feel I was more efficient doing my work than other students using Emacs or KEdit. I began tweaking VIM to become more efficient -- ignoring the time it cost to tweak VIM of course.
I even started to do my homework and write letters with VIM writing everything in LaTeX. The postscript results were beautiful and I thought I would never need another text processing program again in my life. I looked for a Windows VIM version for my first laptop and installed the Cygwin environment on my Windows computer (Linux didn't run it sufficienty enough). I disregarded Emacs and never thought that I would bother learning it until I had to write my master thesis. Maybe in an act of procrastination I began learning Emacs because somewhere on the Internet I read that the AucTex mode was the ne plus ultra for editing LaTeX documents. So I learned Emacs meticulously - with all its cryptic key combinations, and strange major and minor modes and with Elisp - the Emacs programming language. I tweaked and wasted more time time than anticipated - days, a week - before I was somewhat confident in speaking "Emacs". Oh yeah, of course, I had to pimp the look and appearance of my Windows Emacs installation too, before I could begin writing my thesis. I always told myself that the LaTeX typeset output was worth it and that it was more safe to Edit plain text files than write in Word of OpenOffice. I told myself that the write feeling on Emacs was just different and actually let me write more and better; I still have the feeling that typing in Emacs just feels different from VI - I don't mean the key combinations or shortcuts, but actually the feeling of typing (Anybody feel the same?). Emacs felt more like a text processor -- so I felt it was the right choice for my master thesis.
I eventually finished my thesis with Emacs and stayed with it, even for programming - at least for my personal stuff. At work I had to use Eclipse because everyone else used it and it was just best to use it I was told. I was shocked that my colleagues were so conservative and myopical, considering Eclipse the only way to program Java just like I did with Visual Studio back in the days. Finally I reluctantly submitted to their request to use Eclipse. It certainly was more convenient than writing Ant or Maven by yourself, or converting all the Eclipse projects that they dilettantishly commited as a whole into their CVS. For them Java seemed to be Eclipse - that was my annoyance, not Eclipse itself.
Around that time I also had started to write Web applications with Ruby on Rails. Not being satisfied with neither Emacs nor Eclipse for that task, I went with the Netbeans IDE. With its sleeker and cleaner interface it just seemed to suit the lean and smart Rails paradigm better.
The Netbeans interface was also more Mac-like. I converted to Mac with a Macbook Pro, my second notebook. Everyone seemed to praise Textmate -- the über-editor for the Mac. And the editor of choice for many Rails developers. It certainly looks nice, but I never bothered to learn it as meticulously as VIM or Emacs because I thought: "What's the point if you can only use it on a Mac?" So I tried out all major Emacs distributions (Aquamacs, Emacs.app, Carbon Emacs). After all Mac OSX is an Unix system under hood.
Yes, Emacs with its cryptic key strokes, modes and Lisp dialect, the almighty text editor that does all and everything for its disciples had even became a religion as noted by its inventor Richard Stallmann. But being an all-in-one device comes at the price of complexity -- some call Emacs an operating system. Recapitulating I don't like the steep learning curve and the huge and messy configuration files, that one accumulates over time. Even on my dual core Macbook Pro booting the beast up felt sluggish at times.
Yesterday I decided I needed a modern editor, something newer than the 35 year(!) old Emacs or VI. After some googling I realized that there simple was nothing as powerful and ubiquitous as those two classic editors. But sine I wanted a change, I went back to VIM. I installed the MacVIM distribution from macports and I'm liking it. It feels fast, sleek and clean and editing files in it is pure fun. You don't need thousands of lines configuration to start typing and navigating away quickly. Using the right color theme (desert at the moment), you even get a Textmate look. VIM is a relief from Emacs. And not only my pinky thanks me for it. Old memories from my first Unix day become lively. Storm and stress, programming for fun. Just the right mood I need for learning some Python these days. Compiling VIM with the +python feature I can even extend the editor with Python and avoid the arcane Vimscript.
My editor Odyssey is certainly not over yet. While I have wasted a lot of time for learning different editors and IDEs so far, I have also learned a lot of new things during that progress. It is true, that sometimes I have spent more time tweaking my editors than doing actual work. But tweaking isn't that what constitutes the excitement about computers anyway? At the moment I am using OpenOffice for word processing, Netbeans for Rails programing, Eclipse for Java and VIM for all other editing tasks. There is no swiss army editor for all my writing or editing tasks. So "religious" statements from fanatic editor disciples about extensive economics when learning a new editor are far more than dubious.
Colophon: This blog entry was written with aforementioned MacVim with linebreak (:help linebreak) set, mapping of the cursor keys to move by visible rather than "physical" lines (:help 25.4) and spell checking enabled (:set spell) so that it almost feels like a real word processor ;)
Wednesday, March 10, 2010
Calculate total video duration
Here is a little python shell script that uses the "ffmpeg" program to calculate the total duration for specified movies on the command line. This can be quite useful to calculate the required bitrate for encoding a bunch of to fit on a DVD as described in my earlier post. The calculated bitrate is adjusted by a parameter called "extra" to give you an extra buffer for the VBR of MPEG2 stream. So here it is:
#!/usr/bin/env python
"""calculates total movie length of all movies passed as parameters"""
import sys, re, os, subprocess, getopt
def main():
sum = 0
target_size = h2f("4.7G")
audio_rate = h2f("224k")
extra_rate = h2f("100k")
try:
opts, args = getopt.getopt(sys.argv[1:], "s:a:e:", ["size=", "audio-rate=", "extra"])
except getopt.GetoptError, err:
print str(err) # will print something like "option -a not recognized"
usage()
sys.exit(2)
for opt, arg in opts:
if opt in ("-s", "--size"):
target_size=h2f(arg)
elif opt in ("-a", "--audio-rate"):
audio_rate=h2f(arg)
elif opt in ("-e", "--extra"):
extra_rate=h2f(arg)
for file in args:
len = get_movie_length(file)
print file, ":", len,"s"
sum += len
print "total:", sum,"s"
print "video bitrate:", calc_bitrate(seconds=sum,target_size=target_size,audio_br=audio_rate,extra=extra_rate), "kbps"
def h2f(size):
d = {'k':1000, 'm':10**6,'g':10**9, 'K':8*1000, 'M':8*10**6, 'G':8*10**9}
lc = size[-1]
m = 1
if lc in d.keys():
m = d[lc]
n = float(re.split(r"[" + ''.join(d.keys()) + "]", size)[0])
return n*m
def get_movie_length(file):
"""returns the movie length in seconds"""
len = 0
p = subprocess.Popen("ffmpeg -i '" + file + "'", shell=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
for line in p.stderr:
if "Duration:" in line:
h,m,s = (float(x) for x in re.findall("Duration: (\d+):(\d+):(\d+\.\d+)", line)[0])
return h*3600+m*60+s
break
return 0
def calc_bitrate(seconds, target_size,audio_br,extra):
"""calculates the target bitrate in kbps for given target size and audio bitrate"""
return (target_size/seconds - audio_br - extra)/1000
if __name__ == "__main__":
main()
Python Script to create Python Scripts
This little python script is inspired from its ruby script equivalent found in the book Practical Ruby for System Administration, where the author created a script to create ruby scripts. The point of the script is to automate the tedious steps of creating a file, inserting the SHE-BANG line and making it executable. The original ruby version is more elegant, but I'm not that experienced in Python; so maybe there's room for improvements... suggestions welcome.
#!/usr/bin/env python
import sys,os,tkFileDialog
try: path = sys.argv[1]
except: path = tkFileDialog.asksaveasfilename()
if not path:
print "must specify a filename"
exit(1)
f = open(path, "w")
f.write("#!/usr/bin/env python\n\n")
os.fchmod(f.fileno(), 0755)
f.close
os.system("/usr/bin/open " + path)
#!/usr/bin/env python
import sys,os,tkFileDialog
try: path = sys.argv[1]
except: path = tkFileDialog.asksaveasfilename()
if not path:
print "must specify a filename"
exit(1)
f = open(path, "w")
f.write("#!/usr/bin/env python\n\n")
os.fchmod(f.fileno(), 0755)
f.close
os.system("/usr/bin/open " + path)

Subscribe to:
Posts (Atom)

