I have switched from Subversion to Git a few months ago as the version control system for all my private projects and some of my publicprojects and I've not looked back.
The setup can not be simpler (git init in the project directory) and gitweb is easy to setup to browse the repository and its history.
Git is simple to use, simple to learn (with good in-depth and user documentation) and fast.
When I am learning new languages or frameworks, I tend to use an exploratory mode made of trials and errors. I found that the workflow of Git (simple branch creations and merges, stashes, reset) corresponds better to this approach than Subversion (which works best with an upfront design).
One of its great features compared to Subversion is that it distinguishes between the author and the committer. In Subversion, when an user submits a patch and I apply it, I'm both the committer and the author (I mention the user in the commit message and/or the header's files but as far as Subversion is concerned, the user does not exist). In Git, when I apply the patch, I'm only the committer, the user is the author of the commit and will remain so in the history, in git blame, etc. (as an example, here is a commit where I am the committer and Clay McClure is the author). This feature is very important for open source projects where your reputation comes from the code you write, even if it is only through patches.
The only area where Git is lacking behind Subversion is the tools. However I don't mind using a shell and Vim for most of the simple and frequent tasks. For advanced ones, gitk and Textmate are good enough for my needs.
I continue to use Subversion for my professional work but for my personal projects, Git is now my main choice (the only exception being Eclipse projects but as soon as there is a Git plug-in which is good enough, I'll switch too).
I was doing some house-cleaning on my weblog after upgrading Wordpress and redesigning its presentation (in a minimalist but not so minimalist fashion) when I saw that my popular split bookmarklets were broken due to a bad formatting.
I have fixed them and checked that they work correctly with Firefox 3, Safari 3 and WebKit nightly builds (my preferred browser these days) but I have not checked if they work on IE and Opera. If you can test on these browsers, let me know if they work.
jmx4r 0.0.6 has just been released (jmx4r is a JRuby library which makes it super easy to write simple Ruby scripts to manage Java applications using JMX).
This release adds helper methods to make it more natural to work with TabularData attributes and ObjectName properties
Iterate over TabularData attribute
TabularData attributes now behave like regular Ruby Enumerable:
#!/usr/bin/env jruby
require 'rubygems'
require 'jmx4r'
runtime = JMX::MBean.find_by_name "java.lang:type=Runtime"
# runtime.system_properties is a TabularData
runtime.system_properties.each do | sysprop |
puts "#{sysprop["key"]} = #{sysprop["value"]}"
end
ObjectName properties
ObjectName properties can now be accessed using the [] method:
#!/usr/bin/env jruby
require 'rubygems'
require 'jmx4r'
require 'jconsole'
mem_pools = JMX::MBean.find_all_by_name "java.lang:type=MemoryPool,*"
mem_pools.each do |pool|
# print the 'name' property of the pool's ObjectName
puts pool.object_name["name"]
end
As usual, to get this new release, just update the rubygem:
This post is for future references since I had to slightly adapt what is written in the INSTALL file to run Gitweb on my MacBook.
Assuming all my Git projects are in /Users/jmesnil/Work/ and I've already installed Git using MacPorts (sudo port install git-core), the steps to create gitweb.cgi is:
cd ~/Work
# retrieve the latest version of git
git clone git://git.kernel.org/pub/scm/git/git.git
cd git/
make GITWEB_PROJECTROOT="/Users/jmesnil/Work/" \
GITWEB_CSS="/gitweb/gitweb.css" \
GITWEB_LOGO="/gitweb/git-logo.png" \
GITWEB_FAVICON="/gitweb/git-favicon.png" \
bindir=/opt/local/bin
gitweb/gitweb.cgi
# CGI scripts are located in /Library/WebServer/CGI-Executables
mkdir -p /Library/WebServer/CGI-Executables/gitweb
sudo cp gitweb/gitweb.cgi /Library/WebServer/CGI-Executables/gitweb/
# And the other resources are in /Library/WebServer/Documents/
mkdir -p /Library/WebServer/Documents/gitweb
sudo cp gitweb/gitweb.css gitweb/git-logo.png gitweb/git-favicon.png \
/Library/WebServer/Documents/gitweb/
As explained by John Gruber, Apple has improved Spaces support in Mac OS X 10.5.3 but there are still some broken features.
When I'm reordering my windows, instinctively, I want to activate Spaces then use Expose All Windows feature to rearrange them. But this does not work: I have to first use Expose then Spaces.
Before 10.5.3, it was not possible to use Expose when Spaces was active. Now, we can activate Spaces and then display All Windows in Expose using the screen corners or the keyboard's function keys:
However it still does not work using mouse keys. As for Expose Application Windows, it does not work at all when activating Spaces.
The behaviour I'm expecting from Spaces & Expose is to be able to switch between Expose features (All WindowsandApplication Windows) and Spaces in any order using either screen corners, function keys or mouse keys.
I have written and maintained very few scripts and it was a frustrating experience to have them working on several browsers. However this was many moons ago and I wanted to reevaluate JavaScript after using it in unexpected places (i.e. outside of the browser) like in CouchDB View API or Eclipse Monkey (I already wrote about JMX scripts using Eclipse Monkey).
I was looking for a good book on JavaScript, the language. There are many many books on JavaScript but they focus mainly on JavaScript in the browser and spend thousands pages describing the DOM (please, Messrs. the editors, save the Amazon forest and just print some links to the online DOM documentation...). I wanted a concise book about writing simple and maintainable code. I also wanted to learn more about the weird syntax constructions spotted when reading non-trivial bits of code, such as processing.js or CouchDB View's map/reduce.
I bought "JavaScript: The Good Parts" on the strength of the author's chapter in "Beautiful Code" and I was not disappointed. This is exactly the kind of book I'm looking forward to when learning a programming language. It is short (100 pages + 50 pages of appendixes including JSON description) but dense, the sample code are small and meaningful (even the done to deathfibonacci and factorial functions used here to explain memoization). The book does not lose space describing extensively the whole language. It focuses on the subset which is good and proven and do not talk about the edges or the parts which are better forgotten. It really shows how to write code which is both readable, maintainable and elegant. I'm sure I'll come back to this book every time I read JavaScript code using some peculiarities of the language that I don't understand.
After reading this book, I've got a better understanding of JavaScript and now sees the good (and even beautiful) parts of it. I have a better appreciation for its prototype-based design even if it is hindered by a class-based syntax. I also find it frustrating that the JavaScript standard library is so useless (no I/O to communicate with the rest of the world). Of course, the library is richer when the code is to run in the browser or on Rhino (gaining access to the whole Java platform) but, by itself, the standard library is very poor compared to what comes bundled with Python or Ruby.
These are critics of the language. For the book, I've got nothing but praises. I recommend it to any programmer wanting to learn more about what is good in JavaScript.
One advice about the code examples: it is much simpler to use Spidermonkey or Rhino than the web browser to run the different scripts and experiment with them interactively.
I had an idea about using JavaScript from Java 6 and I wanted to give it a try on my MacBook. No such luck: Apple has recently released Java 6 for Mac OS X Leopard but somehow it does not include Rhino, the Mozilla's JavaScript engine bundled in Sun Java 6 release.
Instead they provided only one engine for AppleScript but frankly:
public class AppleScriptTest {
public static void main(String[] args) throws Exception {
ScriptEngineManager factory = new ScriptEngineManager();
ScriptEngine engine = factory.getEngineByName("AppleScript");
engine.eval("tell application \"Finder\"\n display dialog \"Who cares?\"\n end tell");
}
}
Being at a conference like HPTS was very entertaining as I could look from across the room and see Jim march methodically through all the attendees, many he'd known for years and some he was just meeting. I would smile because it was obvious they were getting the same kindness and curiosity that I so enjoyed. I knew they would benefit from that attention.
That is exactly what I felt when I met Jim Gray at HPTS'03. He made a strong and lasting impression on me with his amazing ability to explain complex things in simple terms.
I met a lot of so-called architects or experts who seem to take pride in being hard to understand (after all, if they could be understood by mere mortals, they wouldn't be experts...)
Jim Gray is the exact opposite:
When strangers approached Jim, he had an uncanny ability to assess what they could understand and the level at which to explain the problem. I've seen him take the most complex issues and dissect them into a framing that allowed a lay person to understand the gist of the problem and then, separately, dig int the deepest and subtlest nuances with another more versed in the topic.
After getting nowhere with lack luster HP support, I turned to the power of the Open Source community and got a very simple script up and running to remotely monitor Weblogic JVM Performance and JMS queues using JMX and JRuby.
[...]
This script will enumerate JVM performance and also JMS queue depths in around 50 lines of code
That's a good example of the conciseness that JRuby brings to the Java platform: in 50 lines of code, Tim connects to a remote Weblogic MBean server, retrieves attributes about memory usage and JMS queue and stores them in a CSV file.