Git != A Git

April 15th, 2008 by benny

Yeah its been a while, but hey, its what i do. A lot a lot has happened since the last post (I’m apparently not a loser, who knew?) but I’m going to be lazy and leave you guys hanging and talk about random crap.

So recently, I’ve been on a total nerderiffic mood recently. “But benny, aren’t you always a nerd?” Good point, but believe it or not its even worse than usual.

Since discovering http://open.blogs.nytimes.com, I’ve been reading a lot and the most recent thing that I’ve come upon is a version control system called ‘git‘. I found a google techtalk and also read somewhere that Ruby on Rails is moving over to git, i thought it was worth a look.

Anyway, after listening to him talk, some reading, and messing around with git, I’m convinced its the right vcs for me (and you) and I havent even tried it!. Here are two points really stand out to me and just make sense:

  1. Distributed and relatedly Local Commits - description here. Now, not having a central repository might seem weird at first, but if you think about it a bit, it kind of makes sense.

    Having a centralized respository, as with subversion or CVS, means that any code you want to track will reside there. Thats all fine and dandy and I like that because there is a central place where my code resides. But what about the situation when you’re messing around with your own code and experimenting, but also want to keep track your changes. In svn or cvs, you would have to create a branch, track your changes there, and somewhere down the line, merged it all back together.

    That, to me, seems very silly. I don’t see the need for my experimental changes, which I may very not use in the future, to be forever reside in the central repository. It dirties the repository and wastes space. I should be able to branch on my local repository, track my changes, and when the time comes, decide whether or not to merge them into my main branch.

    But what if you want a “main” public repository that will have the de facto version of the code? That is also possible (and easy!) in git. If you do a quick google for “git public repository“, you find help in no time.

    Linus also makes a valid point that if you’re disconnected, ie. on an airplane, there’s no reason why my revision control software shouldn’t be able to keep track of my code changes. Isn’t that the whole point of a VCS! In svn/cvs, the only way to commit changes is if you can access the repository, which can be extremely inconvenient. I want my vcs to track my changes, no matter where/how connected I am. period.

  2. Separate orthogonal changes - have you worked on a project where you were making two independent changes? No? Well, that’s ridiculous

    Anyway, for the rest of the 99.9% of people who have, a problem with most VCSs is that it is either: an atomic commit of the working tree, or atomic commits based on files. Let me explain.

    In svn, if you do a svn status, it shows you all the files you have changed. If you have more than one logical change, like a new feature and a bug fix, you have to commit them at the same time (as far as I know, let me know if not!). So all the changes that you’ve made, whether they’re related or not, is committed. This doesn’t seem very logical to me. What if I wanted to put in the bug fix first before I polish the new feature a bit. I’m not sure how I would do it with SVN without some manual fiddling around. I stand corrected. I guess I haven’t used subversion (or forgot it :P) enough. whoops :)

    This is partially solved by other VCSs, such as Perforce (what we use at work). In Perforce, there is an idea of “Changelists”. Changelists are lists where you can separate the files that you want to commit. Like in the example above, the files that are affected by the bug fix can go into one changelist, while the new feature can go into another one. Then I can commit the bug fix without having to commit the changes I made for the new feature.

    But yes, there is even a problem with that! What if those two changes affect the same file? How can you commit the changes for the bug fix, without partially submitted some changes associate with the new feature? File level commits aren’t good enough.

    Git to the rescue! Git allows you to pick and choose what content, not files you want to commit to the repository. Git lets you pick the changes you want to add to your index (which is like a changelist) before committing them. Controlling what content is committed, rather than the file, is much more logical to me.

There are many more things about git that are really pretty great, but those are the two that are most iimportant to me. Git’s popularity has been gaining momentum since Linus’ talk so I’m sure if you look around, you’ll find that a lot of people love a lot of different aspects of git, so I suggest you at least take a look at it if you’re using any type of source control.

Turn jagged letters smoooove

July 16th, 2007 by benny

There a problem in today’s world. It’s widespread and is very crippling, in some cases. The problem, of course, is that of the “jaggies” (so maybe not the technical term). Many computers with LCDs and many laptops suffer from this. This is when the fancier, (usually) more interesting fonts on a webpage or elsewhere looks very jagged on LCD monitors. On the CRT monitors, the text will display fine. Take a look at the example of bwong.net below:
A Difference using ClearType
On the left, we have the jagged letters. As you can see, the letters look very crude and just plain ugly. On the right, however, we have text that is rendered using what is called “ClearType.” See the difference? The font is much smoother and much easier on the eyes than the one on the right. There’s an interesting reason behind it, but I won’t bother explaining since the Wikipedia article can do it far better.
Instead, I’ll show you guys step-by-step (there’s only three) how to alleviate this problem on Windows (as far as I know, Macs don’t have this problem)

Step 1:

Right click your desktop and click on “Properties”:
Turning on ClearType: Step 1

Step 2:

Click on the “Appearance” tab, and then the “Effects” button:
Turning on ClearType: Step 2

Step 3:

Click the checkbox “Use the following method…” and then choose “ClearType” from the pull-down menu:
Turning on ClearType: Step 3

And voila! Smooooove letters.

Dem Kickz (New Jordan 11s)

July 9th, 2007 by benny

for my comeback post, i thought i’d post something absolutely necessary (”necessary”)
Ugly 11s

Sandwich Regret

April 18th, 2007 by benny

Have you ever bought something to eat and was excited about eating it? And then when you took your first bite, you thought to yourself, “why…why did i do this?” Well, i just took a bite out of my sandwich, and uhm, why did i do this?

Not being the best can save your life.

April 13th, 2007 by benny

I’ve never excelled at anything really. It’s never really bothered me very much, I guess as long as I was ahead of the curve. In fact, I realized it’s actually a good thing I’m not the best at anything. I came to this realization when I watching 24 because people who are really good at things are asked to do things by terrorists. Once they’re done with you, they kill you. So you see, Mr. #1 Programmer, the terrorists will never get to me. I will live longer than you will. Booyah.

The Irish and Keytars

April 11th, 2007 by benny

Before this year, I had never been to a concert before. I’ve gone to a few free ones in parks and whatever, but not to an actual full concert. But things change and two weeks ago, I went to two in that week alone: Snow Patrol at MSG and Justin Timberlake at the Continental Airlines Arena in Jersey. Here’s a brief recap of the two:

Snow Patrol

Considering it was a really mellow kind of concert, it was one hell of a concert. The Silversun Pickups and okgo opened…I had missed Silversun but saw okgo and they were pretty good. If nothing else, the lead singer was a riot.

The actual concert was awesome. Even though it was a more sedated concert, the environment was emitting this energy. The whole theater (in MSG, where it was held) was on their feet the whole time just listening to the powerful chords coming from the speakers. The lead singer was also pretty funny, and even brought to girls up to sing the female part in “Set the Fire to the Third Bar”.

Something I found out that I totally did not know was that the band was Irish. Did you know that? You probably didn’t. Well, now you do. But yeah, I was walking into the row and turned to my sister and said, “Yo, there are Irish people at the end of our row!” She quietly turned to me with this face that kind of screamed “Uhm…you claim to be a fan?” From that moment on, almost everyone I saw walking by had some sort of green or clover on their shirts.

Justin Timberlake

So I’m not sure what to say about this concert. Not because it wasn’t good (it was amazing), not because I don’t have stories (I have a few), but because it was just beyond words. For those who don’t know me, I would go as far as to say that I am probably one of the biggest fan of Justin Timberlakes who is both a male AND straight. True, there aren’t that many, but still, I’d like to claim that spot.

But anyway, the performance was just unbelievable. His singing was on point, even while dancing. And his dancing…ridiculous. Sometimes I wonder, is that a black man in a white Tenesee boy outfit? Probably, but we’ll never know.

Another startling discovery: THE MAN PLAYS THE KEYTAR! He already plays the piano and guitar and beatbozes, but the keytar? Really Justin? Who does that? Just amazing.

All in all, a couple of good concerts in one week, what else could you ask for?

Removing stale Ruby on Rails Sessions on Dreamhost

April 10th, 2007 by benny

Being new to Ruby on Rails, I didn’t really understand the whole session business and was caught off guard when I looked into my tmp/sessions directory. I found upwards of 20,000 Rails session files. After poking around, there are many different ways to store these sessions (and alter them) and ultimately decided I’m too lazy to change it from the default session storing.

I had found this code snippet which allows me to remove stale Rails sessions using cron. However, on Dreamhost, cron does not have an environment so you have to tweak to the following:

* * */4 * * /usr/bin/find /home/benny/ -name "ruby_sess*" -cmin +6000 -exec rm \{} \;

How do you add it? ssh into your dreamhost machine and enter the following line:

$ crontab -i

Obesity…FOR SPARTA

March 31st, 2007 by benny

I watched 300 today and am honestly not too sure what I think about it. I mean besides the sheer kickass nature of the fighting, a lot of it is pretty cheesy. I mean, there was a scene where a goat was playing a freaking clarinet or something. It was very confusing.

I must say, though, that it did portray the Spartans as just the most badass people ever. I did kind of want to fight the people I went to the movie with for glory…FOR SPARTA. Either that, or let out a loud battle cry…in the Lincoln Center AMC. That would’ve shown them. Yeah.

Anyway, that not what this post is really about. I wanted to bring something up that irked me. It was very confusing and am still pondering this subject right now.

300.png

How the hell did a guy with sword hands get so damn obese? HE HAS NO HANDS TO EAT WITH. Like, sure, I can see him hunting for food. I can even see him cutting up the food and preparing it. But what I want to know is how he is so freaking big. Maybe his fat wife has forks for hands, I don’t know. That’d be kinda cute…soulmate type stuff…his ‘lobster’ if you will. I’m just talking now. Maybe they have just a utensil-limbed family. A son with soup spoon hands. A daughter with spork feet. And you know what, he probably wishes the son had the sporks, not the daughter. And he probably cries about it.