Questions and Answers

Questions and Answers

Systems and Tools

Operating Systems

Q: What operation system shall I use in senior design project courses?

A: The development environment will be Unix-based. With a few exception (such as a UI mock up tool running only on Windows and Mac), all the tools will run on Unix-based systems. These include Linux and MacOS based systems. If you have an Ubuntu or MacBook, you will be good to go. Otherwise, I recommend you to install an Ubuntu (or your favorite linux distribution). I would strongly recommend a separate (and a dual boot installation, if you still want to keep a Wiondows system on side) installation. A Virtual-machine based system (such as virtual-box) turns to have a signifant performance overhead, and was not recommended. You may want to refresh your system programming skills. Note: Always back up all the data on your hard drive before you install a new operating system. It is students' responsible to have a basic computing hardware per course requirement. We are not responsible for data loss or demages on your machine.

Eclipse and Rational Software Architecture

Q: Which version of eclipse will we use in projects?

A: We will use the IBM Rational Software Archtect (RSA), a special release of Eclipse pre-bundled with UML modeling tool. Please follow the instruction on the course website to obtain and install RSA. Once, you install RSA, you can extend it with eclipse plug-ins, just as with any other eclipse release.

Q: RSA crashed when accessing the eclipse market place, what shall I do?

A: RSA is a pre-packaged eclipse. It is a commercial software and not guaranteed to support all the features of an open-source eclipse. If you have a problem to access the market place directly from RSA, use the software installation feature of RSA (and also a feature of eclipse) to install a plug in.

Q: How can I install a plug-in into RSA?

A: Use the software installation feature of RSA, which is also a feature of Eclipse. To do so, go to "help/install new software", and then create a new "site" using the plug-in's URL. Follow the instruction to install the software plug-in. Note: some plug-in may require you to install it using "root" privilege, If that happens, you need to log in as root (or use "su" or a similar command), restart eclipse, and install the plug-in. Nevertheless, be very carefully on installing plug-in with "root" privilege. It may bring unintended consequence to your RSA installation. You shall solve the issue as a regular user first.

Q: How can install Aptana studio 3 on RSA?

A: Use the Aptana plugin URL: http://download.aptana.com/studio3/plugin/install. Follow the above general instruction on installing a plug-in into RSA.

Q: How can I define a new data type for a model in RSA?

A: right click on the "models/(your package)" in the project explorer. Choose "new UML"->"data type", and follow the instruction.

Q: When I click "run server" in a rails project in Aptana/RSA, there is nothing happening. 

A: This is a known issue due to the changing structure of Rails. You can create a directory "script" under your project, and copy "bin/rails" to the script directory. Or the following would be a better way using "svn:externals" to automatically snap bin/rails into the script directory.

  1. Create "script" under your project root, and add it to the SVN respository;
  2. Under "script" directory, run "svn proptset svn:externals '../bin/rails script/rails' ."
  3. Commit your change;
  4. Run "svn update"

Now every time you run 'svn update', the rails file will be automatically copied and updated. 

Q: I add breakpoint to Aptana/RSA, but the debugger does not stop.

A: First, you need to install the gem "ruby-debug-ide". Once you did so, edit "Gemfile" under your project directory. Comment " gem 'byebug' ", i.e. " # gem 'byebug' ".

Q: In RSA, where I create a use-case model, where shall I put the use-case description?

A: In the "documentation" property of a use case. See the documentation entry in the properties window for a use case.

Ruby on Rails

Q: The installation of nokogiri fails with the compilation errors.

A: nokogiri needs to compile the code for the native binary on your machine. It uses several libraries. You need to make sure that both xml2 and xslt libraries are installed. If not, issue the commands on Ubuntu using "sudo apt-get install libxslt-dev libxml2-dev". If it still fails, you need to examine the makefile log (mkmf.log). It is located underneath directory of your ruby runtime. If you are using rvm, try to issue "find . -name mkmf.log" to find the location of "mkmf.log", and to check which library is missing.

Q: When I install Json 1.8.0 on Ruby 2.2, gem installation indicates that there is a compilation error.

A: This is a known issue for early version of JSON gems, which did not define function correctly according to Ruby 2.2. To correct it, You need to go to your JSON installation directory and update one of its files.

1. After a failed installation, JSON source code is extracted to your gem installation directory. If you are using RVM as a single user, it will be located at gems/$YOUR_RUBY_VERSION

2. Make the change to ext/json/ext/fbuffer/fbuffer.h as the follows

 static VALUE fbuffer_to_s(FBuffer *fb)
 {
-    VALUE result = rb_str_new(FBUFFER_PAIR(fb));
+    VALUE result = rb_str_new(FBUFFER_PTR(fb), FBUFFER_LEN(fb));
     fbuffer_free(fb);
     FORCE_UTF8(result);
     return result;

3. run "rake install"

4. You need to register Json with rubygem repository. Run the following command (at your JSON installation directory)

gem spec cache/json-1.8.0.gem --ruby > specifications/json-1.8.0.gemspec  

General Questions

Q: Can we view /home/svn or its subdirectory directly on ELEC system or one of machines mounting ELEC's file system?

A: Absolutely not. Please check the introductory lecture note for the policy on accessing SVN repository. You are welcome to use SVN client side command to access the respository, but you are prohibited to access /home/svn and its sub-directories directly.

Q: Tools are hosted in /home/projects. Can we access /home/projects and its sub-directories?

A: Yes, you are allowed to access /home/projects directory. The access to RSA directory will be granted after you acknowledge IBM license agreement.

Q: I would like to have a head-start on Ruby on Rails, where shall I start?

A: The ruby on rails tutorial is a good start point. You may want to go through it closely and to follow its hands-on examples.

Q: I have a question on the design (or the requirement) of the project, can I stop by and ask you the question?

A: Yes, I will be happy to advise you on the design and requirement. You may stop by at the office hours, or you can stop by my office to check my availability.

Q: I am running into a problem in programing code when working on my senior design project, can I ask you to help me debug the code?

A: The general answer is "no". I will be happy to advise you on the software design, requirement, and the general questions on software process, but it is student's responsible to implement the design (in an analogy, an instructor can help a student understand homework question and even revisit class materials, but he/she cannot help the student do the homework). You may ask the help from your team members, and also search on the web for an answer.

If all the above failed and you still want to discuss with me on the implementation, please send me a note on what you have tried (and failed), and the process that you followed to debug your code. I will set up a time to discuss your questions.