Sunday, February 22, 2009

My First Excel Macro

Nothing to write home to mom about, but I have gone from programming in C++ to Java to VBA. My first VBA script does very little but it saved me a lot of time

Dim x As Integer
x = 1
For Each oRow In Sheet1.Range("A:A")
For Each nRow In Sheet2.Range("A1:A244")
If (oRow = nRow) Then
Sheet3.Cells(x, 1) = oRow
x = x + 1
End If
Next nRow
Next oRow
Dim row
End Sub

Basically checks if the the elements from Range A:A (i.e. all the elements in the column) in Sheet 1 were repeated in A2:A244 in Sheet 2. I could have exported the sheet into a csv file and written a perl script or something in java to do it. But it's always fun to experiment with a new language.

Labels: ,

Tuesday, January 22, 2008

Can't see my last entry

That's weird my last entry isn't linked to my blog properly. Maybe I just need to dump my browser's cache. Speaking of cache, since they keep adding more processor cores to the new chips
how are they going to manage the cache? I read a really good paper called "What every programmer should know about memory" about this kind of stuff. It had some stuff I think every computer engineer should read in an introductory course. Here is a link to the paper.
http://people.redhat.com/drepper/cpumemory.pdf

Labels: