martes, 22 de marzo de 2011

Managing the unmanageable with git

After 2 months using git regularly, there are a couple of things that I'd like to comment here, just for further adding on other posts.

Mostly, for me there's a first blocker that is understanding how the global thing works. To solve this, I can recommend git from the bottom up. a great introduction to git written quite differently from most other docs that want to explain the same. Understanding the low level stuff helps you getting intuition, and IMHO it's essential to get this kind of intuition when using such holistic systems.

Most tutorials give you the essential syntactic information that you can get from man (btw, man git-whatever will give you lots of info), but for me, knowing the workflow and how-to think gittish (or thinkgit if you prefer) is what bothered me most of the time.

You probably have heard about nvie's git workflow. I haven't tried it yet, and at work we use a simpler workflow based on a remote master branch, two local branches (master,working) and quite centralized flow.

Not being a git power user (I'd say I'm just scratching the surface) I'm going to write a couple of posts that are what I'd have needed when I started with it seriously.


Checkout - what happens when you checkout
Clean - oops, I think I messed something
Stash - Smashing the stash for fun and profit
Rebase - commit -am 'fdsda'
Bisect - It's always been that way NOT!


If you have suggestions or something to add, I hope you will comment. Remember, I'm learning as I write these posts, so you can and MUST collaborate!

lunes, 7 de marzo de 2011

Perl Higher Order Functions

I've been chit-chatting with a friend who's learning Perl5, and has written some little apps for his own needs. While reviewing his code (not that I'm a programming guru, but I help with what I can), I talked about Higher order functions, and we ended writting some throwaway code to explain the idea.

To clarify the concepts, I wrote some trivial scheme functions-as-data munging in scheme, and translated them to Perl.

What surprised me, was the "wow!" comments about concepts that aren't perl unique features, but general higher order procedures. Certainly, Java and C++ are 'a bit' behind Perl, Ruby, or Lisp, but it's fun to remember how mind blowing are these concepts to newcomers. I discover mind-blowing concepts quite frequently too.

We had a good afternoon, reviewing code, Quines, concurrency, talking about GEB (The book I'd take to a desert island along with SICP)...

Here's part of the code we've written (as a reminder). Nothing useful, but tiny proof of concept of HOP. Ah, btw, I recommened him to read chromatic's Modern Perl book. I recomend it to all of you in the Perlsphere. Great book.

domingo, 6 de marzo de 2011

Window navigation on Emacs

Last week I was talking about some emacs features with a coworker (while talking about General User Interfaces, pros and cons of WIMP), and ended with the doubt whether there is a way for easier window navigation on Emacs, or c-x o is the only way to go.

I talked about one of the greatest aid to frame/window navigation of screen and ratpoison, that is window numbering, and being able to switch to random windows instead of just sequentially.

Well, today I spent some time thinking about possible solutions, and searching for already implemented modes.

Guess what? There are a couple of ways already implemented (in default emacs, or as an extra downloadable package).

Windmove comes bundled with emacs since 21-dot-something, and in fact is what vimpulse uses for the c-w [hjkl] emulation.
(windmove-default-keybindings) ; enable shift-arrow
Expanding the concept further, there's also FrameMove, that integrates seamlessly with windmove. Here's a little extra info about it.

I found a couple of more esoteric plugins to navigate windows, but haven't tried them.
http://blog.lathi.net/articles/2007/11/07/jumping-to-specific-windows-in-emacs explains how to jump to windows by title. I suppose like ido-mode or anything-buffers.

There's also https://github.com/dimitri/switch-window , that seems to bring ratpoison's numbering of frames to emacs' windows. Nice idea. Here follows a screenshot of switch-window from it's homepage.