Use ack to search code

I needed something to search codebase with and after trying to do

sudo gem install rak

and rak installed like that is a little flaky. Probably something missing but I didn’t want to spend time researching, so ack to the rescue.

ack is perl utility to search codebase.

In ubuntu install is super simple.

sudo apt-get install ack-grep

however on OSX things usually require more work. Here is how to install ack on OSX that worked for me (Snow Leopard)

download it: curl http://betterthangrep.com/ack-standalone > ~/ack
make it executable: chmod 0755 ack
move it to bin so it would be in path: sudo mv ack /usr/local/bin/

enjoy.

more info at http://betterthangrep.com/

Zappos get acquired by Amazon

I was genuinely surprised when I heard that Amazon acquired Zappos. Zappos CEO Tony Hsieh is person I genuinely admire and is true inspiration. My first reaction was disappointment, as I was secretly looking forward to battle between Amazon and Zappos, two great internet retailers. However when I think about it, this is really fantastic news, provided Zappos, as they are promising, will continue to be unique place with great customer service.

I would also like to add, that Jeff Bezos is also inspiration and very few people could have steered and grow Amazon for such long time.

This is video with Tony Hsieh talking about making of Zappos and it’s culture.

Software Craftsmanship

There seems to be much interest in steering software development away from rigid planning and engineering methods as it was tried in the past and more towards a craft and discipline that is not that much precise and predictable and is more indirectly controlled. This year in Chicago we will have a conference on Software Craftsmanship, with Robert Martin as leading speaker. There is a manifesto .  And my immediate excuse to write this post is article by Jeff Atwood at Coding Horror:’Software Engineering: Dead?’, which in turn references this article by Tom DeMarco.

It seems that we came to a point to realize that software development process even though it does look like engineering, it is more similar to some other disciplines and that current metaphors we use are not adequate to describe it. I am not sure how far software craftsmanship will go, it is certainly a valuable concept and idea. It moves process of creating software away from McDonalds analogy where every little step will be well defined and even if you are dumb, you just have to follow steps and you would be good. This never worked well with software and failure and exorbitant price of outsourcing projects to far-away places like India are proof of that.

So one trend is moving away from well defined practices in development of software. On the other hand, new practices, that are represented by agile methods of development are coming into view. They require that developers who work, even though they have to follow very specific and well defined process and steps, they need to be well versed in development of the software, semi-educated, copy and paste developers just can’t do this (or didn’t figure out how to do this at the moment).

I think it is good that we are rethinking how to develop software and what are optimal ways. Generally I am all for agile practices, I think they are liberating in many ways and bring quality to software development. They also are not without craziness, like when it is expected that project sponsors start and finance project without any idea about time and cost. Unfortunately this is one of the agile ‘values’. But another time about crazy side.

I am happy to see software development maturing into profession, that can be distinguished by tools, techniques and methods people are using, which has still long way to go.  But then, if it was a well defined profession like medicine, who knows if it would be this fun to work, if you already have rigid set of rules and procedures.

Oh, Google OS

Oh boy what excitement Google announcement created. They will create a browser OS?! And this is somehow special and unique (InstantOn anyone?). Mike Arrington is up in flames posting on tech crunch. He can already see his CrunchPad running with beautiful new OS.

As always I am skeptical. For start the most important reason is:

* They DIDN’T SHOW ANYTHING !

It is not typical of Google not to show a thing. I suspect that what they have is not that big deal and if they shown it people would be disappointed. With Wave they had unfinished product yet it didn’t prevent anyone to admire it even when it crashes, because it is unique and beautiful.

Secondly they will run browser on top of reduced Linux. So Debian with few Google tweaks, how is that special in any way? I am surprised we didn’t see more solutions like that already. There are few InstantOn OS’es that  are like that but most of them cost money, and this will be free? Ubuntu Remix is free.

My only concern is whether you can run Skype on this thing. Maybe I am not as excited over it as Mike Arrington, but I can see myself using CrunchPad in the future with browser on top, Google or not.

Update:

I’ve been following TechCrunch as they seem perfect recepient of the googleness of GOS, seems that after initial hype they are coming to see the reality, which is still very good, just not as paradigm shifting as thought initially. Josh Bigs explains.

“ChromeOS will beat Windows or even OS X is like expecting Coby to come up behind Sony and Samsung next year…”

Upgrading to Win7

Today I took a plunge and went ahead to get Win7 early. Thing is that however nice Win7 is, it doesn’t really bring that much in terms of innovation, frankly I was considering not spending the money if it is $200, especially because we don’t have one, but 4 win machines. So being early I got it at barely acceptable price of $100 per upgrade (professional). Now just to wait till October. I do have evaluation copy installed, in fact I am writing this from win7. It is very nice and pleasant operating system. I wish few more things were present that can be found standard in Linux for example, like more visual themes, virtual desktops (a must) to name the few. I did get all that already but with third party additions, I will write about that in seperate blog post.

I wish MS would sell and upgrade OS like Apple does, I don’t know who doesn’t have multiple computers and providing family packs is good way to go about it. Plus it is cheap, even though they take more money from each person then MS because they release every year. That would be fine with me. I heard some rumors that MS will offer family pack but it was not available at the moment and I am pretty certain I wouldn’t pay $200 for upgrade, so I took what was available instead of waiting for something uncertain.

Can’t wait to get my hands on it because I plan to do a lot of customizations and knowing I will upgrade to Win7 kind of stops me from doing major things.

Wolfram Alpha launches today

I have one thing to say to that unfortunate google inspired startup called cuil: ‘watch and learn’ .

Today we got one more search engine,  very unique in it’s design, very interesting and with fresh approach. I don’t think it will replace google, but it added new quality to how we can get information off the net.

Wolfram Alpha officially started today. live coverage provided by justin.tv, their inaugural blog post, and finally some examples how to use it.

Customizing Visual Studio looks

I’ve been tinkering with colors and font sizes in VS for a while. This is mostly because I have copy on desktop and laptop, so when I move from one to another, I discover things look different then what I was used to. Anyhow, the way I like things is Consolas font, with size 12-ish or so.

Today it crossed my mind to google and see if there are already premade dark settings for Visual Studio. It turns out there is and there are few quite good ones.

First I came across recommendation to try to use Insolsolata font, which I tried enthusiastically. Unfortunately, it gets rendered crappy, so I had to abandon it. It squishes text quite a bit, which I can understand why some people might like. So I am back to Consolas and this is very solid choice, I was happy to change to it in all my code editors.

As for themes, I did originally wanted dark background but I found Tanzim Saqib’s choice really pleasant and to my taste.

VS_blue

There are also good links on Scott Hanselman post and I like Brad’s Dark Theme as well, so when I feel like change I can always switch to that.

Oh, yes, it is worth mentioning that you update these settings by using import/export settings option from tools menu (kind of lame not to have theme option in VS)

Enterpreneur visa

Paul Graham came up with really brilliant idea that is simple, costs nothing and can only do good. Only risk is whether it will do more or less good. Full article is here.

In short his idea is to create a new visa, which would allow anyone who can assemble small founding team and can find investor willing to invest in their idea, get visa to come to US and start a company. Nature of visa would be such that they can’t work for other people. So, worst thing that can happen is that number of created jobs is not as big as expected. He does put a limit on 10000 people, in my view, provided there is no abuse of the program, I would let even more people come here. It is simple, powerful and effective way to let best people come here, as opposed to programs that are now run which I don’t think bring as good people as they could.

It would also let people from other countries who desire coming here and maybe have some idealistic visions, get a taste of life in US and whether this is really what they thought it is, and decide if they really want to live here.

I am a little worried because however simple and clear his idea, politicians have a way to muddle the most clear idea and make it weird and awkward. I can only hope someone in power gets interest in this idea.

T-Shirt strategy and netbooks

So the T-Shirt strategy goes like this:

* should I buy one really expensive t-shirt, which looks really good at the price of approximately $100-150 like my friend Milan does, then wear it most of the time, or

* should I buy several t-shirts in multiple colors and variations, also good looking, spending similar amount (sometime less, sometime a little more), allowing myself to change them frequently and also not be upset if one gets stained, dirty or whatever else might happen.

As far as t-shirts go, I tend to opt for second alternative as I think it is better to have variety as opposed to really expensive brand. In most cases quality difference is not that great (it at all).

Usually I could apply similar strategy in many situations, sometimes buying something more expensive is good option, I like a little more expensive notebooks (paper based) and pens.

I’ve been wondering what would be good choice when it comes to portable laptop. Here is how I see things there:

* should I buy one light and totally cool laptop like sony’s 13”, or apple or something similar, they are priced at $1300, or

* should I buy one good netbook, like Samsung NC110, or EEE 10”, HP or something similar, which is around $500. There are numerous benefits of this choice, better battery life (7+ hours), even lighter, I can buy one more by year end etc.

Mostly I am unsure because on one side you have not overly expensive 13” which have wow factor. And then you have those other machines that are really practical. Yet I think if you would like to write code, you can do this easily with first choice, while second one is more for twittering, blogging etc.

One thing is for sure, since things can only get better over time, I can take my time picking and choosing.

Updating database from cvs file in VB.Net

I got a simple request to let shippers upload information with shipped dates in csv files .

Now this is rather simple request and problem especially in versatile framework like .Net . I figured just googling around would find me simple solution, however it took a little bit of more search and tweaking to get this working which is why I want to share this piece of code.

So there is a page with upload field and this is on click event of submit button:

Dim filename As String
filename = Server.MapPath(shippingUpdateFile.FileName)

Dim sConnectionString As String = “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=” & Server.MapPath(“.”) & “;Extended Properties=Text;”
Dim cvs_db As New System.Data.OleDb.OleDbConnection(sConnectionString)
cvs_db.Open()

Dim cvs_select As New OleDbCommand(“SELECT * FROM ” & filename, cvs_db)
Dim cvs_adapter As New OleDbDataAdapter
cvs_adapter.SelectCommand = cvs_select
Dim csv_ds As New System.Data.DataSet
cvs_adapter.Fill(csv_ds, “test”)
Dim csv_table As New System.Data.DataTable
csv_table = csv_ds.Tables(0)
Dim r As Data.DataRow
Dim id, sql As String
Dim date_shipped As Date
For Each r In csv_table.Rows
id = r(“id”)
date_shipped = CDate(r(“shipped_date”))
sql = “Update users set “
sql += “DateFulfilled=’” + date_shipped.ToShortDateString + “‘”
sql += ” where id=” + id.ToString
If utilities_db.execute_sqlcommand(sql) <> 0 Then
Me.lblMessage.Text = “Error updating record:” + id.ToString
End If
Next

This could probably be written in a little more clean way, but this is how it is and you can pick it up from here.

One thing to note is that utilities_db is simple module with db functions. Hope you will find this useful.