Donnerstag, 13. März 2014

command line fu on mac osx

On the linux command line (as in emacs) it's easy to jump words:
Terminal on Debian
Ctrl+f jump one word forward
Ctrl+b jump one word backward

To get the old feeling from the linux command line (and a lot of additional functionality) get iTerm2 and adjusted some key bindings in the preferences:
iTerm2 on Mac OSX
Alt+f jump one word forward
Alt+b jump one word backward


Examples of what you can do with the command line? http://www.commandlinefu.com

using uml to get to know fresh code

I recently had to adapt quite a pile of code for android. To get to know to the classes and their dependencies and life cycles I started drawing UML class and sequence diagrams (inspired by the book Head First OOA&D). Eclipse has some really nice shortcuts to navigate in code (Cmd+Space to jump to the declaration, and Ctrl+Alt+h to show references) but nevertheless it's hard to keep a bird's eye on the code.
This is one my first class diagrams for using the camera:
I pretty sure that I got some symbols (arrowheads) wrong, but I the idea was to simply get an overview. The code for this CameraPreviewTest class can be found at https://github.com/michaelhaberler/MIY. After a couple of diagrams I wanted to store and edit the diagrams for documentation purposes. So I looked around for some UML editors which allowed me to create and update my diagrams quickly:
  • http://www.draw.io
    Updated class diagram:

    Sequence diagram to visualize a route of calls and callbacks to setup the android camera and some additional view classes:
  • http://www.umlet.com/
  • AmaterasUML
    AmaterasUML was arguably the quickest to create very detailed UML class diagrams. It's an eclipse plugin and I just had to drag the classes from the package explorer into the editor window.