الأحد، 30 مارس 2008

Leopard: Things you don't need to fix any more

There are two things that are very simple under Leopard that used to be a lot more complicated:
  • ssh-add (allows one to automatically authenticate ssh connections): There is no need to use ssh-agent any more. If your key is called ~/my/key/file then ssh-add ~/my/key/file does the trick and globally enables automatic authentication (even for GUI applications!). If your key file resides at .ssh/id_pub then you can even omit the argument.
  • Starting X11: There is no need to change the DISPLAY environment variable or to start X11 manually, any more. Instead, X11 starts automatically as soon as one invokes an application that uses X11.
This makes Leopard an even cooler Unix system.

السبت، 29 مارس 2008

Fixing Leopard

There are a few small things wrong with Leopard. But they can be easily fixed:
  • During installation, you should customize (via buttons in the installer) twice:
    • Erase and install: If possible, don't upgrade, your install will be a lot cleaner.
    • Installed packages: You probably don't need all language localizations and all printer drivers and will then save a lot of hard drive space.
  • Dock: I like the dock to the right and at the top. The latter can only be done via utilities such as TinkerTool.
  • iTunes store links: Are handy, but only get you to the store. The following shell command fixes that. Now the links navigate your music library and if you hold option you can still get to the store.
    defaults write com.apple.iTunes invertStoreLinks -bool YES
  • Shortcuts: can be changed via "Keyboard & Mouse -> Keyboard Shortcuts". Two examples of shortcuts that are broken with German keyboards:
    • Move focus to next window in active application: Also known as cycling through windows. Hard to type on a German keyboard.
    • Show help menu: Clashes with Eclipse's "toggle comment".
  • Safari: Show the status bar (which shows the URL when hovering over links) via "View -> Show Status Bar".
  • Finder: Show the path bar via "View -> Show Path Bar". It is very handy, especially with Spotlight, because it shows the path of the current selection, not of the current window.
  • Sleep display: You can do so on command (the computer runs, the display doesn't) via "Expose & Spaces -> Expose -> Active Screen Corners -> Sleep Display". This makes a lot more sense than a screen saver.
  • Sending an SMS: Wow, this one is a biggie. Tiger could send and display recieved SMSes via a Bluetooth-paired cell phone. In Leopard this feature is gone. Sending SMSes via iChat (only works in the US), AOL internet messenger or Skype (costs money) is possible, but you have to be online to do that (on the plus side, you don't need a cell phone then). Fortunately there is the widget emitSMS that at least brings sending SMSes back.
  • Switch off the translucent menu bar: System Preferences -> Desktop & Screen Saver, uncheck "Translucent Menu Bar".
If you want a list of little details that work well in Leopard I recommend the artice "10.5: Liste der lieblichen Feinheiten" (in German).

الجمعة، 28 مارس 2008

PDF editing in Leopard: Almost like Acrobat

"Almost" means that the "Preview" application that comes standard with Mac OS X Leopard does most things that I would normally need Acrobat for. You can
  • rearrange and delete pages.
  • add notes and markup (customize the toolbar to get the corresponding icons).
  • edit notes and markup in existing PDFs (at the bottom of the sidebar, you can display the annotations and then select or delete them).

الأحد، 23 مارس 2008

WiMax: Not that good in practice?

WiMax has been pushed hard for a while now by Intel and, as a consequence, is increasingly showing up in laptops. The idea is great: If WiFi is there, you use a really fast connection, in all other cases, you still have the fairly fast WiMax. Even the name sugggests that WiMax is a complement to WiFi. Of course, it has a competitor---the cell phone networks: HSPA is not as fast as WiFi, but it is much more widely deployed.
I haven't used either of these technologies, yet, so I don't know they compare. As an update on this competition, I've just read that one company that is currently deploying WiMax calls it a "miserable failure".

الاثنين، 17 مارس 2008

Improving code browsing in Eclipse [Update]

Related posts: "Online Eclipse E4? Lack of imagination!", "Eclipse 4 wishes: simplification first, then innovation".

Again, I want to prevent ideas of mine from getting lost, so I'm publishing my comments to an Eclipse bug report as a blog entry.

Faceted browsing for Java code

I'd love to have a universal code browsing solution that uses "facets" (tags with values). An example of well-done facet navigation is iTunes where you have facets for songs such as composer and title. If you look closely, there is quite a bit of information attached to a method that could be considered tags/facets: Visibility, static vs. non-static, annotations etc. JavaDoc's @category just adds one more dimension here. With a facet browser, one could formulate queries such as the following in a very natural way: "Give me all public methods with annotation @Remote that belong to category 'persistence'". This browser should optionally access all methods (of all classes) in order to serve as a universal query mechanism.

Improving the outline: nested methods, method groups

We have written a research prototype that improves just the outline view in two ways:
  • Nested methods: If a method n is private and only used by a method m, then file n under m in the hierarchy (thus, n is not visible at the top level, any more). The reasoning here is: "extract method" is a great refactoring for cleaning up code, but it unnecessarily clutters the top level of the code outline.
  • Method groups (this can be replaced by @category!): If a sequence of methods is preceded by a commentary //--------- foo then these methods will be filed under a node "foo" in the hierarchy (= one additional level of nesting)
For method groups, one can also view categories as tags and, instead of introducing another level of nesting, list the categories as toggle-able buttons that filter the outline:

+-----------------------+
| o | x | @ | # | * | + | <-- icons
+-----------------------+
| (read) (write) (sort) | <-- buttons
| (init) |
| |
| - prepareForSorting() | <-- outline tree
| - writeContents() |
| ... |
+-----------------------+

Thus: Selecting a button filters the outline, unselecting it undoes the filtering. Another possibility is to have filter buttons for "private", "public", "static" etc, too.

This might also be complementary to the nesting approach.

Update: At EclipseCon 2008, there is now talk about "E4", the next generation of Eclipse. There is a lot of talk about expanding the platform (ReSTful web services etc.). Voices to simplify are there, as well; let's hope that they will not be ignored:

الأحد، 16 مارس 2008

Eclipse 4 wishes: simplification first, then innovation

Related posts: "Online Eclipse E4? Lack of imagination!", "Improving code browsing in Eclipse".

Having just read the blog post "The Road to Eclipse 4", I've remembered comments that I've made to an Eclipse bug report. I'm repeating them here, slightly edited, so that I don't lose them.

What's wrong with Eclipse today

It is still too hard to write programs for the RCP. These problems cannot be solved by only expanding Eclipse's functionality, there has to be consolidation, too. I'd like to see some of the impressive collective brain power behind Eclipse be used to come up with new ideas for handling large code bases (such as Eclipse itself).

If Eclipse does not find a way of simplifying and innovating, I'm afraid it might be outmaneuvered by Netbeans in the long run. Netbeans has been quite courageous in refactoring its code base and version 6.0 has provided many new features, in a streamlined, highly integrated fashion.

Concrete suggestions for improving Eclipse

Below I've outlined how I think Eclipse can be improved.
Improving the internals
  • Better coding: Some of the coding patterns are ugly; Eclipse deserves better. Examples: Downcasts, factory not documented at product, constants hard to find (SWT is inconvenient and error-inviting, enums would be much better and not necessarily much more inefficient), long method invocation chains to get to a service provider (dependency injection might help here; if you want to see DI done well, look at Guice), too much nomenclature.

  • Navigating plugins and the RCP framework: Eclipse does reasonably well when it comes to code, so dealing with the extension XML should be as easy as dealing with code and both should be even more integrated. Can we come up with new ways of making it easy to discover functionality and to find one's way around in the mix of artifacts that is currently supported by Eclipse? Better cross-artifact refactoring would not hurt either.

  • Snippets: They are brilliant for looking up stuff, but shouldn't some of that code be encapsulated (e.g., turned into a method)?

  • Netbeans has project "Schliemann". Does Eclipse have something similar?
New external features
  • Finding code: Because one cannot extend classes a posteriori in Java, functionality is often put into separate classes, as static methods (e.g. Collections). How can one find this functionality if one does not know about it?

  • Structuring code: One has to be able to mark up scattered concerns and to structure large classes. I've posted some ideas in response to an Eclipse bug report, that include making better use of the @category Javadoc tag.

  • A simplified formal model for searching source code: One could store all source code associations as RDF and use SPARQL to query it or one could implement one's own Prolog-like query language, much like JQuery has done it.

  • Multi-dimensional browsing: Currently displayed hierarchies such as the call hierarchy and the inheritance hierarchy cannot be mixed. Relo is an example of freely mixing these hierarchies. This feature is much easier to implement, if one has a formal model of the source code (see previous entry).

  • Source code fragment editing: With polymorphism, one often needs to look at the declaration of a method together with all of its implementations. Eclipse should return search results as a sequence of source code fragements (I think member granularity is fine enough) and display all these fragments next to each other in a single editor.
Minor improvements
  • Option: only refresh inheritance hierarchy on-demand, manually.

  • F4 while on a method should immediately show members in the hierarchy.

السبت، 8 مارس 2008

Arguments against the “war on drugs”

While I don't have any perfect answer, the global “war on drugs” smacks of the American prohibition of alcohol, something that ended up causing a lot of crime. If all drugs were legal, there would be no extraordinary profit in selling them and thus the crime that surrounds drugs would go away. Except, obviously, the crimes committed for making money to afford drugs (which is not an issue with rich people and would be less of an issue with poor people if drugs become legal and thus cheaper). What I'm not sure about is if free drugs would increase drug usage and, if that is true, there could be something done about that. The article “The Wire's War on the Drug War” has some more things to say about this topic, mainly that it leads to arresting the wrong people and that all of them are part of the lower class.


[source: doggdot.us]

Gun Kata – amazing-looking fake martial arts

The movie “Equilibrium” has a great cast and is atmospherically and visually well done (the plot and the characters are a tiny bit simplistic, though). Especially its fake fighting style called “Gun Kata” looks amazing. Thus, when I found out that there was an article called “5 movie fighting styles too awesome to actually exist”, I immediately knew that it was going to be in it. Below, you can see the Gun Kata video posted on YouTube:



الخميس، 6 مارس 2008

The Mole People

I recently searched the web about the “Mole People”, homeless people who live in the underground of New York City. This topic became popular through the book “The Mole People: Life in the Tunnels Beneath New York City” by Jennifer Toth. While searching, I came across three interesting pieces of information:

السبت، 1 مارس 2008

2 Great Articles on Barack Obama

Two ... audacious ... articles on Obama:
  • The Audacity of Hopelessness by Frank Rich
    contrasts Clinton's and Obama's thinking (hint: one of them is positive, the other one is negative) and points out that judging by how well Obama organized his election campaign, he would do just fine as a president. In contrast, Clinton, who has criticized Obama for his lack of experience, has had major organizational gaffes in her campaign.
  • The Audacity of Data by
    shows that Obama's philosophy is very pragmatic and un-ideological, he is not really out to change the status quo, but rather to improve it. While I think that in some areas, one should at least explore more unorthodox ideas, this philosophy might be exactly what the US needs right now. At any rate, Obama is thinking outside the box and I really like it. And you have to love the idea that the IRS does your taxes for you (hmm, I wonder what group of people will heavily oppose this).

Is the war on terrorism bogus?

The Guardian has published an article (by a former British environment minister, no less) that sheds light on some of the motivations behind the United States' invasion of Iraq. Oil seems to have played a huge role (as has been alleged before). It is interesting that when it comes to oil supplies, the US government chose a military solution where there would have been an engineering solution: Funding a research program for non-oil energy sources would have produced none of the negative effects of a war (which at the time of the decision were very obvious risks), while still strengthening the US position globally (in a purely positive way).
[source: doggdot.us]