Monday, July 2, 2007

Java resources

Here are some resources students might find useful for learning Java.

Project based learning

The programming course will be taught as a "project based course". All students should select a project and form a group of students who will work together on that project.

The recommended group size is 3-5 students. However, we may be able waive the size for those who are unable to find sufficient members for their project.

I would like everyone to finalize their projects as well as groups by Friday 6th July, 2007.

Mail the project description on the newsgroup and also identify a list of resources (books as well as online resources) to help you with the project.

Sunday, July 1, 2007

Mode of teaching and learning

The programming in Java course will be conducted as a hybrid course.

We will have traditional lectures in the classroom. We will also have online lectures Skype or a similar service. I will publish screencasts as well as audio conversations with software developers on programming in Java. We have a newsgroup for this course on which students can ask as well as answer questions. Beyond this exchange of knowledge and information, everyone will be encouraged to learn by way of practice. Code... code ... and even more code.

Let me quickly explain why it is important to engage in this form of learning.

The study of programming consists of understanding the syntax of a language and understanding proper usage and programming idioms. Understanding the syntax is explained reasonably well in text books, but understanding usage and best practices comes by practice and conversations with other practitioners. Hence, this course will have a very string focus on practice and conversations.

In this day and age the internet offers a very good platform for communication. Here are some ways in which I communicate. However, do not feel limited by what I have listed. Everyone can choose whatever works best for them.
  • Newsgroups and forums are a very good place to ask as well as answer questions. Remember answering other's questions is as important as asking them. Just like the community helps us by answering our questions, we must give back to the community by helping others. Also teaching someone else is a very good way of learning. When you answer someone else's questions, you will also learn something valuable in the process.
  • Personal blogs are a very good way of reflecting (and penning your reflections), building your reputation, and an ad-hoc community of developers. Think of your blog as an interactive academic journal, but with a slight difference. The blog is a journal which is work that is constantly in progress, and it's work on which other people, your friends or even people you do not know may comment and converse with with you.
Let us utilize all the tools we have at our disposal to create a unique and enriching learning experience.


I hope everyone in this class has a very successful career as software developers.

Saturday, June 30, 2007

Programming in Java

This course will prepare students for developing software programs in Java. The primary purpose of the course is to give students basic knowledge of programming constructs and best practices, which they can utilize for writing desktop programs.


I look forward for an informative and engaging semester with all the students. Details of the course have been listed below. If you have any questions, please post them as comments to this post.

Programming in Java Syllabus:

  • Introduction of the programming platform, it's main benefits and drawbacks

    • Motivation for creating the Java platform

    • Primary benefits of using the Java platform

    • Drawbacks of the Java platform

  • Structure of programs on the programming platform (a simple HelloWorld example)

    • Explain how to create a simple class that will print “Hello World”

  • Compiling and running a program

    • Show how to compile and run the HelloWorld program

    • Explain basic compiler and VM options

  • Working with primitive data types

    • Primitive data types, their usage, and sizes

  • Operators

    • Explain operators in Java

  • Explanation of control structures (looping, branching)

    • Loops: while, do...while

    • Branching: if, else...if, cond?val1:val2, break, continue, labels, switch, return

  • Implementation of OO concepts on the target platform

    • Defining classes

      • Show how to create a simple class

      • Explain interfaces and how to create them

      • Explain namespaces and packages

    • Support for building abstractions

    • Support for encapsulation and information hiding

    • Support for inheritance

      • Special note on single inheritance in Java and using interfaces

    • Support for polymorphisms

      • Compile time and run time polymorphism

      • Explain polymorphisms with interfaces and classes

      • Explain abstract classes

    • Access modifiers

      • public, private, protected, package friendly

  • Important keywords and concepts

    • static, final

  • String manipulation

    • Creating strings

    • Concatenating strings (using + operator, StringBuffer, StringBuilder)

    • Extracting substrings

  • Creating constants and their importance

    • How to create constants in Java, their importance and usage

  • Working with other commonly used classes

    • Wrapper classes for primitive data types

    • The Object superclass

    • The class Class

  • Exception handling

    • Why do we need exceptions

    • The exception hierarchy in Java

    • Throwing and catching exceptions

    • Creating custom exceptions

  • Working with collections of objects

    • Working with arrays

    • Introduction of the collection interfaces (List, Set, Map)

    • Working with different types of Lists (ArrayList and LinkedList)

    • Working with different types of Sets (HashSet, and TreeSet)

    • Working with different types of Maps (HashMap, and TreeMap)

    • Iterating across collections

    • Comparing objects and sorting in collections

  • The Input/Output system

    • The architecture of the Java IO classes

    • Reading from and writing to the system console

    • Binary IO

    • Character IO

    • Working with files

  • Creating desktop user interfaces

    • Basic UI classes in Java

    • Layout managers

    • Event driven programming

    • Making a simple user interface in Java

  • Language/platform specific concepts

    • Automatic garbage collection

    • Marker interfaces in Java

    • Serialization

    • Introduction to inner classes

    • Introduction to reflection

Friday, March 30, 2007

Network programming in Java

Today we concluded multi-threading in Java and strated network programming in Java using sockets.

The session on multi-threading was summarized by Jaya, and Rajesh Choksey.

On Sunday we will conclude Sockets and start with RMI.

For further resources on Sockets, and RMI, please see the Java tutorial:
  1. Networking with Sockets
  2. RMI
In the networking with sockets tutorial, the part on Sockets in most important. We will not cover DatagramSockets and URLConnection in much detail in this class.

Friday, March 16, 2007

Concurrency in Java

In the next lecture we will learn multi threading in Java. The topics for multi threading are as follows:

  • Fundamental multi threading concepts
  • Creating and running multiple threads
  • Thread states
  • Controlling threads
    • thread priorities
    • sleep
    • yield
    • join
  • Access to critical resources and the synchronize keyword
  • Deadlocks

No lecture on Sunday (18/3/07)

We will NOT have a lecture on Sunday - 18 March, 2007.

Introduction to making user interfaces in Java

This is a very brief introduction to making user interfaces in Java using Swing. In this section we will learn:

  • The JFrame class and making a simple frame in Java
  • Handling UI events
    • Events
    • Listeners
    • Adapters
  • Brief introduction to Layout managers
    • FlowLayout
    • BorderLayout
    • GridLayout
    • BoxLayout
  • Using other components like Buttons, TextBoxes, TextAreas, and ScrollPanes
  • Java Beans
    • What makes a class a Java Bean?
      • public default constructor
      • naming convention for property getter/setter methods
      • naming convention for methods that add event listeners
      • The manifest.mf file should contain the line Java-Bean: True

Saturday, March 10, 2007

How to be a Java Specialist

I just heard an interview of Java specialist Heinz Kabutz. The interviewer asked him how regular programmers can become Java specialists. Even though this answer was given in reference to Java, it holds true for any programming language.

According to Heinz it is very important to take some time out from programming. What he means is do not just program incessantly. Take time out to reflect and learn. Think about what you are programming, is there a better way to solve the problem? What design tradeoffs are you making? Are the tradeoffs appropriate?

Reading source code is one of the most important things developers can and should do to improve their skills. There is a lot of code freely available. A good starting point is the Java source code.

Read the JVM specs and language specs whenever you get a chance. Well read specs of whatever you are working on. They are all written in perfactly readable English, and not some strange legalese language that only lawyers can understand :-)

Have an open mind and try to think why things work in a certain way. Get under the hoods as often as you can.

If you follow these simple learning principles consistently, you too can become a Java (or Ruby, or Python, or ... put in your favourite language) specialist.

Friday, March 9, 2007

Generics dojo

Today we continued with the Generics dojo, where we left of last time. Praveena and Prabhat were to continue programming, but Prabhat DECIDED TO DESERT HIS COLLEGUE, WHICH IN MY OPINION IS A VERY NASTY THING TO DO. Anyways Sanket and Sidhart graciously helped her and got things moving.

The dojo was continued by Taral and Sourabh, who worked on the DateFormat. We will have to continue this dojo into yet another session in which they will work on reading the file and printing the sum of expenses.

Details for Sunday's lecture

This Sunday, 11/3/07, we will work on RTTI. Details of what will be covered are posted here.

Monday, March 5, 2007

Internship positions at Adaptive Software #1

I have a requirement for an intern at my company. The work involves doing some research on "web 2.0 and New Media for the learning professional". As you might know I have a blog for building a learning community for Java programmers at http://www.adaptivelearningonline.net

I believe that New Media like blogging, podcasting, video and screencasting, will emerge as very important factors for professional who wishes to keep up with knowledge. I need one intern to do the following things over the 3 months of internship:

1. Research how other schools, collges, orgaizations are using New Media to facilitate learning
2. Implement relevant findings on my website
3. Write blog posts on their research and findings
4. Analyse the results and make a roadmap for the future

The candidate will have to be:
1. Self motivated (extremely important)
2. Should possess good communication skills (also very important)

The work can be done from SCIT. We will communicate over blogs and Skype.

I THINK THIS POSITION IS MORE SUITED FOR SYSTEM STUDENTS, HOWEVER IT IS OPEN TO ALL BRANCHES.

I will be able to pay some basic stipend (enough to take to take care of communication costs and the like).

Those who are interested can leave a comment here, or email me at:
adaptives (at) gmail (dot) com

Friday, March 2, 2007

Good comments by Sorabh Sarupriya

Over the last few days Sorabh Sarupriya had posted some comments on our blog, pointing out good tutorials of the topics we have learned till now.

Very good Sorabh. Keep it up.

Remember, a blog is a community initiative. It is a participatory medium, not an announcement list. A blog thrives with participation, bringing value to one and all. In the spirit of participatory media, I would like to urge everyone to contribute to this blog. Keep in mind, that the new mantra is going to be "participate or perish".

Sunday, February 25, 2007

Dojo session on Generics

Today we did a dojo session to practice Generics. The exercise was a simple expense tracking system. The goal was to understand how to use the Java collections libray with type information.

The following students participated in the dojo:
  1. Ashish
  2. Abhishek
  3. Ravindra
  4. Subudhi Rajesh Rao
In the next session Praveena and Prabhat will continue by implementing a method that saves the collection of expenses to a file. Taral and Saurabh Sarupriya will debug the application and get it to work with dates in an India format.

I will announce the next class day and time.

Saturday, February 24, 2007

RunTime Type Information - RTTI

Tomorrow [25-02-2007] we will have a lecture on RTTI or Run Time Type Information. We will learn various aspects of the Java language that help us get and use information of types at run time.
  • Revisit instanceof
  • Understand the class Class
  • Understand introspection in Java
    • Getting details of a class using Class
    • Instantiating a class at runtime without knowing it's type at compile time
    • Invoking methods of classes at runtime
    • Understanding how Java Beans work

Thursday, February 15, 2007

Java generics - topics

We will learn Java generics on Sunday 18-2-2007. The following topics will be covered.
  • Moving from arrays to raw collections to type safe collections
  • Usage of generics in JDK 1.5
  • An example of using generified lists - UsingGenerifiedCollections.java
  • Using objects whose type is a subtype of the generified type
  • Passing a reference of a generified object to another method - UpcastingOfParameterizedTypes.java
  • Wildcards
  • Upper and lower bounding with wildcards
  • Erasure
As I had mentioned earlier, our focus will be to learn how to use libraries that are implemented with generics, and not how to create our own generified libraries.

Sun has a good tutorial to get started.

No class on Friday

We will not have a class on Friday 16-2-2007.

Students for the coding dojo

Sanket, Jiten, and Sumit are welcome to attend the coding dojo. We will start at 3:00 PM. I will be there latest by 2:00 PM, please try and come slightly before 3:00 PM, so we can have the room all set up for the dojo.

I am assuming that all 3 are coming for the dojo. If anyone of you wishes to drop out, please mention so in the comment.

Monday, February 12, 2007

Would any students like to participate in an open dojo

I am conducting an open registration dojo this Saturday at ITLabs (Senapati Bapat Rd) . I may be able to call 2 students to participate (for free) as volunteers,.

I am not sure yet, but whoever is interested can add your name (as a comment here), and I will inform you if it's possible for you guys to join in.

Details (time & venue) can be found here.

Would any students like to participate in an open dojo

I am conducting an open registration dojo this Saturday at ITLabs (Senapati Bapat Rd) . I may be able to call 2 students to participate (for free) as volunteers,.

I am not sure yet, but whoever is interested can add your name (as a comment here), and I will inform you if it's possible for you guys to join in.

Details (time & venue) can be found here.

A little background on dojos

Check my blog for a little background on the coding dojos that we do in class.

Java Generics

In the next class, we will learn Java Generics.

This link has a good introduction to Generics. At the end of the page you will find 2 links to Sun's tutorials which are also well written.

I am trying to have the lecture on a weekday, but am not sure yet. I will confirm the time with the coordinator, if it is possible to take the lecture some day in this week.

Completed Java collections

Hello everyone,

We completed Java collections yesterday. The section was summed up with a dojo to experiment with using Maps and implementing the Comparable Interface for the class that we used as a 'key' in the TreeMap.

The following students participated in the dojo:
  • Jiten
  • Parul
  • Vibhor
  • Saurabh Rai
After completing the dojo, I gave a little take home exercise. But first a little background. We made the Student class implement Comparable because it was to be used as a key in a TreeMap. However, we may not always have the ability to implement an interface, especially in situations when we use classes from 3rd party libraries. But if we want to use objects of these classes as keys in a TreeMap, we have to give the Map some way of comparing a newly inserted key with existing keys (because the keys in a TreeMap are always sorted by invoking the compareTo method or with a Comparator). In such cases, we give the Map a Comparator.

For the exercise, remove the compareTo() method (and the Comparable Interface) from the student class, and give the TreeMap a Comparator object.
(this exercise is for practice and will NOT be graded)

Saturday, February 10, 2007

Class survey

I had posted a survey sometime back to better understand the requirements of students. So far 6 students have answered the questions, and have answered them very well, pointng out things that they find helpfull and providing constructive suggestions about those things that should change:

To summarize:
  • Everyone likes the dojos
  • One student liked the online aspect that we use for our classes
  • Everyone would like me to share the examples that I show in class
  • Some students feel that I should not go too much in detail as it confuses them
Excellent suggestions. I will definitely try to stay away from excessive details. We will continue with dojos. Regarding the examples, I have resisted giving the examples because they may result in copy paste, rather than students trying to write code on their own. In any case I will distribute the examples towards the end of the course.

Thanks to those whi took the time to answer the survey. For those who have not yet answered, I would urge you to take a little time to do so. It does not have to be right now. This survey will remain open till the course is on, so you can answer it whenever you feel you have something to contribute. The survey can be taken multiple time, which means if you missed out something, you can always add it later.

Friday, February 9, 2007

Java Class Schedule

The time table says that we have a Java class on Friday afternoon 3:30 PM.

Now this might actually be my fault. I had scheduled a lecture last Friday and remember that the coordiator had told me that she will schedule my lecture on every Friday. I meant to tell her that the lecture is confirmed only for that Friday, and hence forth we will decide on a ad-hoc basis. BUT I PROBABLY FORGOT TO ACTUALLY SEND THAT MAIL. That's the reason your time table shows the Java lecture on Fridays.

Let me announce it here instead.

Our scheduled lecture is on Sunday 10:00 AM. At times (well most times...) we will need a few more hours in the week, but these slots will be confirmed on an ad-hoc basis with the coordinator.

For all those who showed up for class ... sorry to keep you guys waiting.

--
Parag

Sunday, February 4, 2007

Survey

I signed up for a survey service some time back. I think it is very important to get feedback from participants of my course, so that I can fine tune the course to make it effective for the group.

Since this is a college course, many of you might not be confortable giving me direct feedback, so I have set up an anonymous survey here:

Since we have had a couple of lectures, I think everyone is familiar with my approach to teaching this course. I will appreciate if every student in the class takes a few minutes and fills up the survey. It will help me fine tune the course.

The survey will NOT impact your grades in any manner whatsoever :-)

Thanks

Friday, February 2, 2007

Java Collections

We will start with the Java Collections library on Sunday 4th Feb 2007.


Continuing with IO In Java

We will continue with IO in Java on Friday 2nd Feb. In this lecture we will learn about object serialization and sum up IO with a mini dojo session. As always those who participate will be elligible for extra credits... those who are interested may want to prepare in advance.

Monday, January 29, 2007

IO in Java






I will upload program samples samples in the newsgroup.

Saturday, January 27, 2007

Advanced Java Course

Welcome to the Advanced Java course. I look forward for an informative and engaging semester with all the students. All details of the course have been listed below. If you have any questions, please post them as comments to this post.

Course Duration: 10 weeks

Course Contents:
  • IO In Java
  • Generics
  • Collections in Java
  • Autoboxing
  • RTTI (Run Time Type Information)
  • Introduction to making user interfaces in Java
  • Multi threading in Java
  • Introduction to Java security
  • JDBC
  • Networking in Java with Sockets and RMI
  • Annotations
  • Introduction to web based programming in Java
Credits: 4 credit points

Evaluation (for a total of 200 marks):
  1. Written test - 80 marks
  2. Participation - 20 marks
  3. Presentations - 20 marks
  4. Programming - 80 marks

Java Assignment 2 - SDM and SYS

The Assignment:

Make a utility that counts the number of lines of actual code in a Java source file. For the purpose of this exercise, a line is counted if it contains something other than whitespace or text in a comment. Some simple examples:
  -   // This file contains 3 lines of code
1 public interface Dave {
- /**
- * count the number of lines in a file
- */
2 int countLines(File inFile); // not the real signature!
3 }

and…

  -   /*****
- * This is a test program with 5 lines of code
- * \/* no nesting allowed!
- //*****//***/// Slightly pathological comment ending...
-
1 public class Hello {
2 public static final void main(String [] args) { // gotta love Java
- // Say hello
3 System./*wait*/out./*for*/println/*it*/("Hello/*");
4 }
-
5 }

Remember that Java comments are either "//" to the end of line, or "/*" to the next "*/". The block comments do not nest. There may be multiple /*…*/ comments on a line. Whitespace includes tabs, spaces, carriage returns, and vertical tabs. Oh, and remember that comment start sequences that appear inside Java strings should be ignored.

Goals of the Assignment

The mixture of line-based things (single line comments, blank lines, and so on) with the stream-based block comments can make solutions slightly ugly. While coding your solution, consider the structure of your code, and see how well it fits the structure of the problem. As with most of these kata, consider coding multiple alternative implementations. Does what you learned on the first tries affect your approach to subsequent ones?

Marks: 25

Delivery:
You must complete the assignment by 31 January 2007. Once you have completed the assignment, take an appointment with Firoz in the lab and demo the working program to him.


If you have any questions, please post them as comments here.

Thursday, January 25, 2007

New Media Workshop Test

Students who attended the New Media workshop as part of the Emerging Trends series will be evaluated online on the basis of a blog post.

You can refer to the slides as well as the links on my website.

You have to write an essay on:
  1. How blogging (and participatory media) can help students (a message to your juniors at SCIT)
  2. How blogging (and participatory media) can help budding professionals
The essay can be submitted in any of these modes:
  1. As a comment to this post
  2. As a post on you own blog with a trackback to this url.
  3. As a comment on a post written by any of your classmates. In such a comment, you must highlight the pros and cons of the position taken by the author of the blog.
Your essay should be greater than 500 words, but NOT longer than 1000 words.

All submissions should be made by 2nd February.
Submissions with plagiarized material will not be considred for evaluation.