Thursday, July 25, 2013

When I fell in love with Computer Programming


  • When I was 8 or 9, I had an MS DOS computer.  The monitor was color, and it has QBASIC on it, and I had a book of QBASIC programs.  I remember writing programs that would generate circles, with a random color, size, and location on the screen. I would also generate sounds, beeps really, in time with the circles.  I didn't know about command line arguments, so every change I made I would do by changing the code itself.  The numbers were all numeric literals.  I got it running so fast that the filling of the circles couldn't keep up with their drawing. I liked making it go, and controlling it, and making music and shapes.
  • When I was 13 or, we got a A dialup 28.8k modem, and a Windows  Computer from Gateway.   There was no built in programming language, but I liked chatting online, and eventually started using Mirc and writing a few scripts. There may be an archive of one or two somewhere, because I posted a few to some websites, back in the day.  I learned about variables and conditionals.  I liked getting the program to do what I wanted, and not having to type things repeatedly.  
  • I'm and about to graduate with a Bachelors Degree in Psychology.  I had a great statistics professor, Jack Vevea, who has us do our classes using R.  I did well, and I and another undergrad were invited to one of his graduate level courses in item response theory.    We have a program where we had to calculate a value on 2400 elements.  Each element took about 6 minutes with the program we were given, because it tries to calculate a value to a high degree of accuracy. That's 10 days of non-stop running. I look at the code and figure out how to narrow the search down at each iteration so it runs more quickly.  
  • I'm back in school, and  I am learning C and Java.  I take the data structures and Java for C programmers classes at the same time I take the prerequisite course, work really hard and get an A in all of them.  I like learning, and working hard, and figuring things out.  
  • I find out about the tutor program.  I join it, and and am made a mentor and senior tutor within the first week, on the basis of my work.  I find out that I love helping people learn about programming, and that having to explain stuff makes me comprehend it better.
  • I am looking through job postings for internships using my browser's find in page function, and realize I can write something to automate this for me.  I write the first version of Gutsy, in Perl.  I like being able to take what I know and use it in real everyday life.  
I fell in love multiple times with programming.  It wasn't a linear progression, where I learned to code a little when I was young.  I had to come back to it, again and again, learning new things each time.  


Tuesday, July 9, 2013

quick vim trick for fixing indentation and returning to where you were

So, many people have noted that you can use gg=G to fix indentation in a file.

gg makes the program go to the top of the file, and =G idents until the bottom.   however this places your cursor at the first line in the file, which isn't something you probably wanted to do when you just wanted to fix indentation.

But you can use 2<C-o> to go back to the place you typed the command. <C-o> jumps back, but you need two jumps backward to get back to where you were.

Therefore I've placed nmap <leader>g gg=G2<C-o> in my .vimrc to fix indentation as needed without needed to go back to where you were.