Tutorial for Subversion
I just wrote a Subversion tutorial for my students. It's pretty much geared toward accessing the repository from the computer science labs here but the general ideas can be applied in other projects.
What I thought would be a simple task consumed almost 5 hours of my time as I performed each step by hand and captured the output. The entire things was done using textile first and then converted to HTML and formatted with CSS. Surprisingly, it's a decent length of nine pages. Apparently, Flock has some trouble printing the last page but Safari is fine with it. Hopefully someone identifies the problem. I ran it against the W3C HTMl validator and it passed fine.
You can view the tutorial here.
Posted in college stuff, development | no comments |
Refactoring support for the Eclipse
It's amazing what results you can miss even if you search with Google. It's all a matter of what you are searching for. And which website you actually search for.
After some thought, I figured that it would be best to take a look at how the RDT: Ruby Development Tools are doing. So far they are one of the few open source projects that are moving along pretty well. They have some nice integration with the Eclipse project. And like it or not, the Eclipse platform offers one of the better environments for developing IDEs if you do not wish to waste too much time designing a GUI and all that. There is some pain involved with using Java and all that , but Eclipse itself can help you write Java in a more productive fashion.
Anyway, here is the thread in point. If you click on the link, they do have a decent Trac website for it. I have not downloaded the project yet but it seems that there has not been much buzz generated about this project. There was nothing much on the mailing list. And I don't think it is a good idea to point this project out on the Ruby mailing list since it is their project and they decide what to do. I have downloaded their nightly .pdf file describing what they are doing. We shall see how much they have covered. The table of contents does seem to address some of the main issues that I am concern with. And they claim to have done the Rename Local Variable (this is not the same as the more general Rename that goes look for all occurrences and finds out which are safe to replace) and Push Down Method. They have a few other of the normal refactorings that Martin Fowler discusses in his book.
After reading a bit more, it seems that this was a term project for the students. It was to be a fourteen week project but they are going to take it further and do it as a diploma thesis. All in all, I am pretty impressed with this project. Here is a group of developers that are doing all the "best practices" of software engineering. They have a repository, bug tracking, milestones, auto-generated integration tests and lots of unit tests.
Well, if they have gotten a refactoring tool for Ruby, then it means that I probably have to find something else to do. That is one of the pitfalls of choosing an "in" language. Almost everyone would want to get a hand in it.
Anyway, I am going to check out the source code for the RDT into a new Eclipse workspace. Hopefully I remember enough of the Eclipse plug-in development paradigm to understand the code. I left all my Eclipse books back home when I went back for the summer. The nice thing this time though is that I can develop on my Macbook Pro. Enough RAM, plenty of hard disk space and a speedy processor. And of course, Java 1.5 is now working nicely on OS X.
Posted in college stuff, development, ruby | no comments |
Wireless printing
I decided to get a printer-scanner-copier combo -- something the stores call a multifunction machine. Since Best Buy had an offer on the Canon Pixma MP160 and it costs about $80, I thought that it was a good deal.
And the printer did not disappoint. I installed the drivers and was able to print wirelessly via my Aiport Express. The last time I bought an inkjet printer was almost 5 years ago. I can tell you now that the printing speed has increase dramatically. I printed a 13 page paper that I was supposed to review tonight in less than 5 minutes. I did not pay attention to the total time but it was not much slower than the laser printer in the dorms.
And the copier function is really useful. Not only can I use it without interfacing with the computer but I can also specify how many copies of each that I want. I can definitely save a few trips to the photocopier machines on campus.
Posted in college stuff | no comments |
Refactoring Ruby
ArticleS.UncleBob.RefactoringParalysis:
"I've been working on on the Harry Potter problem in Ruby. I have a version that works, and now I'd like to refactor it. I'm using Text Mate as my 'ide'. I find myself in a state of paralysis. There I things I'd like to change, but I know the cost will be high, so I think and think about them instead of acting. This is not how I work in Java with IntelliJ. With IntelliJ I do my thinking by acting! I change variable names; I extract methods; I create and destroy base classes; in short I refactor madly. But in Ruby, without a good refactoring tool, I sit and stare at the code. I know what I have to do. I just have to break through the fear and start refactoring; and I will. But I was amazed at how intense the fear of changing code is when you don't have the appropriate tools. Jetbrains, or someone, you really have to make a refactoring tool for Ruby!!!"
The only apparent project on refactoring for Ruby is this. And it has not been updated for almost a year. Moreover, it uses Emacs which probably means that everything has to be done using lisp macros.
That said, the idea of writing a refactoring browser for Ruby is pretty interesting. And one that I have been thinking of (but not trying to do yet) for almost a year. There aren't that many refactoring browsers for dynamically typed languages. Smalltalk has one (and, mind you, was the first language to have a refactoring browser).
So I am going to gather some more information on this subject and propose this as a master's thesis to Prof. Johnson. After all, being with at this university with the pioneers of refactoring means that there is definitely going to be a lot of people with enough experience. And there is always Don Robert's thesis to help me get started.
I would also like to know the importance of a refactoring tool for a dynamic and agile language such as Ruby. All the latest refactoring tools concentrate on Java and C# both heavyweight languages in their own class. Last summer, I worked on Photran: A plug-in for Eclipse that supports the Fortran language and has some refactoring. Even though I did not work on the refactoring part, I can tell that it was really hard work. Even now, the parser for Fortran is not as fast as most people are used to.
Some possible problems I can definitely think of:
- How to get at the syntax tree for Ruby. To make a refactoring browser, I would have to get hold of the syntax tree. I could scheme on this and make it be based on regular expressions but that would make it too rigid. Any slight variation in coding style would probably break it.
- Which application to write it in? You have to write it in an application that people are already using. I know that a lot of people use Textmate and Emacs but both those editors do not provide any real tools to help in parsing the code.
- What refactorings should be included? I mean there are a couple of standard options but what are the refactorings that most people use in Ruby? Are those refactorings going to be useful say for Rails?
- Who would actually use this tool? Is there a market for this? You might argue that Smalltalk was never a major programming language. However, it was pretty big at the time the refactoring browser for it was being developed.
- Smalltalk is a pure object-oriented language. Ruby allows you to write things without classes? Would this make a difference? I am not too sure. There is a C refactoring browser written by one of Prof. Johnson's students so refactoring for procedural languages is definitely possible.
- Is this even doable for a master's thesis? I am definitely going to try to get into the Ph. D program but if I cannot, I want to make sure that this is doable.
By the way, there definitely is interest in refactoring Ruby on the web:
Posted in college stuff, development, ruby | no comments |
Sub-blog at softwareengineering.vazexqi.com
I have created a sub-blog that deals with software engineering (mostly software architecture at this point). It's part of my CS 527: Advanced Topics in Software Engineering online journal project.
So far, there are three articles on it. And more would be added soon since we have to keep a journal about the papers/ books we read. Most of the content should be appreciable even if you do not read the original paper or book. At least that is what I hope since I do spend some time making it useful for people to read.
Whenever possible I have also included a link to the paper. But when the article is about the two mandatory books for the class, it can be a bit hard to follow. Anyway, in case anyone is interested, the two mandatory books for the class are SAIP: Software Architecture in Practice and Domain Driven Design. I have read a bit on Domain Driven Design and I can say that it is definitely a book worth getting. I have no opinion yet on SAIP but I am wary of stuff produced by the Software Engineering Institute (SEI) because they do tend to be a bit dry.
Posted in college stuff, development | no comments |
Upgraded CS242 grading application
This was something that I wanted to do since the beginning of summer but could not really do back in Malaysia because of the slow internet connection which I enjoyed there. The grading application worked fine but there were some minor features that needed to be implemented. For instance, my initial idea of having each criterion be a checkbox did not turn out as useful as I expected. True, sometimes it is easier to just check something off but sometimes there is really a need to assign some points to that criterion. Also, being able to assign specific points from a range makes it easier to tally the points and determine which student gets the A in class.
Another feature I added was the summary page that will display everyone's marks for each assignment. I really wished I had this feature last semester especially when we were trying to determine who did all the assignments at the end of the class. To implement this feature, I used multiple parameters in the URL. This turned out to be pretty ugly so I used the routes.rb to map the connections into prettier URLs. More on that can be found here. Using routes.rb is pretty useful and I can see myself using it in the future. Moreover, I was able to rerouter cs242.vazexqi.com to cs242.vazexqi.com/login/login automatically without relying on http-headers or javascript.
A minor improvement was the use of a variable width CSS file. Last semester, as the number of projects increased, the number of tabs would also increase making the layout look unprofessional. Using the variable width CSS file, the entire interface stretches to the size of your browser window and is no longer constrained to a mere 800 pixels.
I deployed the final application by using svn export to remove all the hidden .svn files. Rails actually has a neat deployment application called Capistrano but I have not had the time to experiment with it yet.
This time around, I am also more careful and have setup a cron job to backup the MySQL database as suggested here.
I did not implement any nifty AJAX features yet. Probably that is something worth looking into as well. I really wish that I could get the application working with FastCGI since it is running rather slowly using normal CGI. However, I have not had any success with FastCGI and I do not feel like having the application die on the students every now and then this semester.
Posted in college stuff, development | no comments |
TA Orientation
The past few days had been rather fun. After returning from Malaysia, I had to squat over at my friend's place for a few days. Then, I had to quickly get all the registration stuff done. And then, move over to my new apartment. Before I could actually enjoy the comforts of my new apartment, I had to go for three days of teaching assistantship (TA) orientation.
There was some fairly interesting issues that were covered during the orientation. For instance, what a TA should do when a student comes with a personal problem, how to grade fairly and consistently and also how to plan your lesson so that it is both informative and engaging at the same time. Most of those things are pretty much common sense. But the tips on how to deal with diversity and sensitive issues in class was rather useful for me. Moreover, lunch was provided as well so that was nice.
We even had an international TA orientation to familiarize incoming international students on how the classrooms work in college here. Interesting issues such as interpreting American slang and how to actually talk to your students in a non-invasive manner were presented.
All in all, I am glad that the university decided to spend so much time on TA orientation. It really helps first time TAs become more confident with teaching. And it also helps everyone see the importance of teaching.
Posted in college stuff | no comments |
Friends visit
Posted in college stuff | 1 comment |
Video iPod
My 3rd Gen iPod which lasted me about 2.5 years finally gave up on me. Well, it did not stop working; it's battery life just got so abysmally short that there was not much point touting that thing around anymore. I tried all means of trying to resuscitate it but to no avail. Interestingly, I just found out that my friend, Chin Fei also had the same problems with his iPod, which was a few days younger than mine. The left side of the iPod was slightly protruded as if something had expanded inside.
Anyway, I settled for the 30 GB Video iPod. It arrived today with my custom engraving and it works fine. I am pretty sure that this new generation of Video iPod is much better than the one that came out before. It's thin and it does not weight so much. The only downside is that it charges and syncs using a USB port. I am using a Macbook and USB ports are scarce resources!
Now, what should I do with a 30 GB Video iPod? Fortunately someone has answered that question for me: 50 Fun Things To Do With Your iPod. Oh, did I mention that having the album art displayed on the screen is really cool?
Posted in college stuff | no comments |
Designing better teams in classrooms
How Instructors Can Design Better Teams In The Classroom - O'Reilly Mac DevCenter Blog:
"So what's my suggestion for how we can improve the classroom? It's simple: don't distribute the brain power, and keep the standards high. Build teams so that everyone in the team is on equal footing and tailor projects accordingly. That means put the smartest kids together and put the not-so-smartest kids together. For some, that idea will immediately seem unfair and cruel, but think about it. If you faithfully apply this approach throughout an academic career, it should ultimately allow the smart kids to excel far beyond what they could otherwise do in a mediocre team, while forcing everyone else to get with the program, or get out of the program (literally). But in most cases, I really do think that everyone ends up learning more, and for me, that's a big a win-win for everyone. More productivity. More education. Less waste. And less folks end up making it through with a degree that maybe they shouldn't have made it through with (the coasters and clueless.)"
I have been a undergraduate teaching assistant for 4 semesters now. And this is the first time that I have heard this method of forming groups. There are usually two ways that we form groups. One being that we, as course staff, will evaluate everyone based on their scores on homework and exams so far and try to distribute them into groups. Usually there is a sweet spot for the average score of the group members but we also do not lump the smartest together with those at the bottom of the class into an average group. The benefit of this is the diversity we have in groups. Students get to meet with people that you would otherwise not associate with. Also, as my professor says, research done about assigning groups has shown that such groups tend to have a higher success rate of completing their projects. Success in groups is always a good thing especially when it affects your grade.
The other method for deploying groups would be to let the students form their own groups. Usually this turns out to not be such a good idea. Students who take the course together with their friends will usually form their own groups. Sometimes this can be beneficial since they are familiar with each other's work habits. However, this may also lead to conflict since it is harder to coerce you friend's commitment to the project. And individuals who come in to take the class alone will have to hunt around to find good group members. In the end, to minimize the risk of working with uncommitted people, these individuals would rather work on their own.
Getting back to the point here, the method of assigning groups by lumping all the smart kids together might not really be such a good idea. Sure you would get a group of smart students that are probably going to be able to create a great project. However the real world does not work like that (unless you are in academia where all your colleagues have Ph.D's as well). You will meet all sorts of people in the world. There will be those who will not be as smart as you but they have other redeeming qualities. Also, what if you are working for a company? You do not have a choice with whom you work with? What if you are working at Microsoft and Bill Gate's son is being a dumbass? (This is a lame example). A better example (thanks to the lecturer for the class I am teaching) would be that the idiot sitting beside you now in class might turn out to be your future boss. And now, what would you say to that? Working with someone you once considered an idiot?
Classroom is not only about educating people in technological knowledge. There should also serve as a preparation for getting the students to work in the real world. People need to work together and learn together in the real world. No one will be there to sieve out the smart from the dumb for you. In fact, the same rules in the classroom might not even apply. People living in the real world can potentially cheat their way to achieve something better. There wouldn't be any professor or cheater checkers there to enforce the academic integrity rule.
So bottom line, I think that the course staff should intervene a bit in group formation. Probably they do not need to upset every group but they should perturb the group demographics a bit. Let the students form their own groups first and then based on some predetermined criteria decide whether those teams should work together or not. The goal of the group project is not so much to get a grandiose project but to ensure that everyone gets a fair shot at contributing to the group and learning at the same time.
Of course, usually class projects take place at the end of the semester and there is not much time to evaluate how things will go. If possible, I would like to form groups earlier during the semester and then switch members around. That way at least most people get a chance to work with different people and find their more compatible group partners. I believe that everyone has the ability to contribute and all they need is some motivation. By lumping the coasters and clueless together, it would be hard for them to motivate each other. Besides, education is for everyone, not only the privileged few.
Posted in college stuff, paradigm | no comments |
