Archive for the 'Uncategorized' Category

Merry Christmas and Happy New Year!

This is just a quick post to wish everyone a Merry Christmas and Happy New Year!

Carrello Demo Day! (CSCI 6050 Term Project)


Today my team for Dr. Kochut’s CSCI 6050 Software Engineering class will demo our term project, Carrello. As of svn revision 412, we estimate the following metrics on the lines of code:

  • Java: 5,625
  • Freemarker Templates & HTML: 1,079
  • CSS: 665
  • XML: 1,892

Here are some screenshots, for the curious:

The entire software development process (a modified version of the Waterfall model) was followed in the creation of this software system. The result is a system that I, as the Team Technical Editor, can say with confidence fulfills the functional and non-functional requirements presented to us at the beginning of the semester.

I would like to thank the entire Carrello development team: Mehdi Allahyari (Project Manager & Developer), Usman Nisar (Concept Modeler & Developer), and Haseeb Yousaf (Persistence Engineer & Developer). It has been an amazing semester! The experience we’ve gained and the teamwork we’ve demonstrated will definitely serve us well in the future.

Interesting Observation with Scala’s Numeric Trait when combined with Context Bounds.

I saw something interesting this morning when I tried to create a container for a user-defined class that mixed in Scala’s Numeric trait. Consider a class called MyNum (see MyNum.scala) that mixes-in Numeric.

I wanted to create a container that could hold any type that mixed in the Numeric trait, including MyNum. My first intuition was to use a context bound on the type parameter. However, this seemed to only work for built-in Numeric types.

In order to fix the problem, I tried changing the context bound to a view bound. Viola, it worked!

In the following code, the commented out line will not compile. MyNumContainerB is able to hold both built-in and user-derived Numeric types.

error: ambiguous implicit values: both method stringCanBuildFrom in object Predef of type => scala.collection.generic.CanBuildFrom[String,Char,String] and method conforms in object Predef of type [A]=> <:<[A,A] match expected type val d = new MyNumContainerA(c)

I’m still trying to figure out why a context bound doesn’t work. Perhaps there is a lack of implicit evidence somewhere? Anyway, some more investigation is needed. If anyone knows why this happening then please let me know!