Tuesday, February 24, 2009

Dead week

Well, with the first midterm and project 3 both out of the way, I'm really concentrating on my other class. The timing of projects and and exams is working out well so far between my Automata Theory, Graphics, Software Engineering, and Algebraic Structures classes.

Project 2, the Australian Voting Problem, was done with Joel Gardner. I hosted our repository on my home linux server once again (which makes collaboration very simple), and everything went smoothly. This was the first project that I've ever produced a UML doc, but after about five minutes of experimenting with DIA, we were able to begin creating our doc.

This next project, the Stable Marriage Problem, is an interesting problem that supposedly arose from the need to pair graduating medical school interns with available hospital jobs. I'll be working with Felicia Hopperstad, and hopefully we'll get an early start on it and knock it out a week early.

Looking a bit into the future, after project 4, the remaining four projects will be done as a team of 3-5 people. So far, Felicia, Joel, Sam Kinard, and myself are grouped up. I'm not sure if another group member or two will be added, but either way, I think we'll have quite a productive group. As required by the spec, our projects will be hosted at code.google.com. Speaking of Google's project hosting, Raleigh Schickel and I were chatting today in the Taylor basement, and the subject of project hosting came up. We were checking out Google's project hosting, and I was curious if the source code of your project public as soon as it's hosted in Google's repository (seems like it would since number 7 on Google's Corporate Philosophy is: "7. There's always more information out there."). Well, it turns out, that a read-only copy of your source code is, in fact available to anyone with internet access. A quick search pulls up three hosted projects, and by the user names, I'm almost certain the projects are fellow members of this class. Seeing as academic dishonesty is a very serious matter, and we are explicitly told "You may not share code in any way with your fellow students," I would be very wary of hosting these first four projects through Google, because a fellow student who just can't crack that tough algorithm an hour before the next project is due might just give in and attempt to use yours. You didn't directly give it to them, but you made yourself liable by hosting your project in a way that it's fair game to anyone.

Sunday, February 15, 2009

SVN+SSH with Subclipse

Now that I've got Subversion working like a charm on my server, I'd like to share my experience with setting up Subclipse on my Windows 7 desktop. Although most of my dev work is done on my Asus netbook running Ubuntu 8.10, I occasionally like to take advantage of my 28" widescreen attached to my desktop. I installed TortoiseSVN, available here. Then, I installed subclipse, available here. Make sure you download the appropriate version of subclipse for your version of eclipse. Once that's installed, you need to do a couple things:

1. Set the following environment variable (by right-clicking on Computer, Properties, Advanced system settings, Environment Variables, New):-

Variable name: SVN_SSH
Variable value: C:\\Program Files\\TortoiseSVN\\bin\\TortoisePlink.exe

2. I then configured SVN (in Eclipse, click on Window, Preferences, Team, SVN, SVN Interface):-
to use SVNKit(Pure Java) SVNKit v1.2.1.5297.

3. I restarted Eclipse.

Upon restarting everything worked flawlessly. To create a new project by SVN+SSH using a repository on my server, press Ctrl-N, click on SVN, and "Checkout Projects from SVN". I entered the URL to my repository, and had a working copy on my local machine soon after.

Saturday, February 7, 2009

Week 2

Note to self: "Read the assigned readings more thoroughly, pay attention to a few obscure things from the readings, and be prepared to answer rather vague questions over said readings for the quizzes." I'm quickly realizing that the daily quizzes are going to be my biggest problem in the course because the questions tend to be very vague.

On another not
e, string indexing and capturing a substring is rather interesting in Python.

Substrings can be captured in a manner that probably seems normal to most people.
The indexing is an inclusive/exclusive index (the beginning index is included, but the ending index is not).

        s = "abCbA"
self.assert_(s[1:4] == "bCb")
self.assert_(s[1:4] is not "bCb")
self.assert_(s[1: ] == "bCbA")
self.assert_(s[1: ] is not "bCbA")
self.assert_(s[ :4] == "abCb")
self.assert_(s[ :4] is not "abCb")
self.assert_(s[0:5] == s)
self.assert_(s[0:5] is s)
self.assert_(s[ : ] == s)
self.assert_(s[ : ] is s)
Here's where things are slightly different. Python allows you to specify a step size in your indexing.

        s = "abCbA"
self.assert_(s[1:4: 2] == "bb")
self.assert_(s[0:5: 2] == "aCA")
self.assert_(s[ : : 2] == "aCA")
Stranger still, Python allows negative indexing. The strings do not, however, function as a circularly linked list. For this example an index of -7 as an ending index would be invalid.

        s = "abCbA"
self.assert_(s[-1] is "A")
self.assert_(s[-4] is "b")
self.assert_(s[-5] is "a")
# self.assert_(s[-6] is "") // out of range

s = "abCbA"
self.assert_(s[-2:-5:-2] == "bb")
self.assert_(s[-1:-6:-2] == "ACa")
self.assert_(s[ : :-2] == "ACa")

Sunday, February 1, 2009

Subversion stuff

Since this is my first project to use subversion on, I figured I could give a few thoughts on how it's gone for me. I'm hosting my repository on an Ubuntu server set up at my apartment.

First of all, installing subversion on my Ubuntu laptop and server was as simple as the command
$ sudo apt-get install subversion

So far, the plan is to setup a separate repository for each project, so I created a directory on my server to hold each of the project repositories in my home folder. (this command was done via ssh on my server)
$ mkdir ~/cs373

Creating a repository in this new directory is now as simple as: (this command was also done via ssh on my server)
$ svnadmin create ~/cs373/proj1

On my laptop I then created a directory called proj1 with all of the initial skeleton files in it.
Once all the files were there, I imported this directory into my repository. The -m flag is a message that's logged with the import
(this was done on my laptop, and proj1 is a folder in the current directory. I've omitted my username and hostname of my server)
$ svn import proj1 svn+ssh://@/home//cs373/proj1 -m "First Import"

Then, when I'm ready to checkout my project to work on it, I ented (on my laptop)
$ svn checkout svn+ssh://@/home//cs373/proj1 proj1

This checks out my project into my current working directory.

When I'm satisfied with changes to my project, I simply enter (on my laptop):
$ svn commit

Well, I guess those are the basics. As I learn more about subversion throughout the semester, I'll share what I learn.

First Post

This first post is actually my first ever blog post, period. As the course progresses, hopefully I'll have some good experiences to share with the world.