voodoo

Java Generic voodoo has me stumped

I'm wanting to write a method that I can use to initialise a Map. First cut: Map map(Object ... o) {for (int i = 0; i < o.length; i+=2){result.put(o[i], o[i+1])}} Simple, but not type-safe. Using generics, maybe something like: <TKey, TValue> HashMap<TKey, TValue> map(TKey ... keys, TValue ... values) but that syntax isn't support...

Retroactive svn import into git

Here is my problem: I used Subversion for some time, until I switched to Git. Some more time elapsed. There was no import of the history from Subversion to Git. It was a strict checkout, delete of the .svn dirs, then git init. Not a smart move. Now, thousands of git commits later, I find a backup of the Subversion repo made at the t...

Can Eclipse indent new line with 1 tab after JavaScript array initializer?

I'm using Eclipse to edit JavaScript files and I guess I'm "doing it wrong". Given the following code, where » represents a tab, · represents a space, and | represents the cursor: function·foo()·{ » var·baz·=·[| } If I hit enter at this point, I get function·foo()·{ » var·baz·=·[ » ···········| } Yuck. I would much rather g...