Dot Paper Generator

I’ve been using dot paper (both “square” and isometric) in my grade 9 class lately, so I put together a Java application that generates it. The image files it produces are PNG files. Feel free to use it if it’s helpful. No warranty, expressed or implied, yada-yada.

Google Drive link to download .JAR application file

DotPaperSample.png

Sample PNG file.

Here are a couple of PDF examples that I produced from the PNG files:

Letter-QuarterInch-DotPaper

Letter-Isometric-QuarterInch-paper

The PNG files are set to 72dpi, not the desired dpi the user chooses… I haven’t figured out a simple way to set that information in the PNG metadata. The PDF files above are both 600 dpi, if I remember correctly. 

Using Java and NetBeans to Teach High School Computer Science

First Question

Another teacher recently asked about my experiences teaching CS and for a description of the tools and language that I used. I thought I might share my response on here, in case anyone can add to the conversation.

First response

I used Java with NetBeans for development. This was my first time through the courses (ICS3U/3C) and it was by e-Learning, so I wanted to stick with something that was fairly standard. NetBeans was really flexible and was fairly nice for building GUIs as well. I hadn’t used a development environment with such effective refactoring capabilities before, so that was a treat. JavaDoc templates were generated automatically, and documentation look up was fast and reliable.

NetBeans_StartPage

Some other CS teachers use Eclipse, JCreator, or something else. NetBeans does have an Android development plugin, although I haven’t used it. If I were to teach the grade 12 course, I might consider focusing on Android development with the Android SDK/Studio IDE. There is a lot more to think about for app development, but I think there would be a significantly increased level of engagement. Also, those skills should be highly marketable for students if they pursue programming or software engineering as a career.

AndroidStudio

If you want to see what it look like while I was coding and developing user interfaces in NetBeans, I have a bunch of videos in a playlist on my YouTube channel.

It was helpful to have the students building GUIs right away in some respects. However, because they didn’t already understand objects when they started this, it was difficult in the later stages of the course to have them create GUI elements programmatically instead of with drag-and-drop tools. For example, one student was creating a game that required playing cards to be displayed, but he needed to create (up to) 52 UI objects to represent them. That screams arrays/lists, but he didn’t know how to instantiate those elements based on what we had already learned. I might try a slightly different approach, rather than changing IDE though.

If you have specific questions I can answer, let me know. I’ll be teaching this course again next year, so talking about this is good for me too! If you want the content/activities I developed, I’m happy to share that as well.

Second Question

Later the teacher asked about whether I had used Python, and if I had thoughts about Python vs. Java. Here’s what I said:

Second Response

I haven’t worked in Python, but I understand that it is fairly powerful and straightforward. I talked to the other CS teacher here and he recommends Java, and I think I do too.

Some points to consider:

  • Python has very forgiving syntax; the argument is that this may allow students to focus on concepts.
  • Java is strongly- and statically-typed, but Python is strongly- and dynamically-typed.
  • Java has a longer history, so there are “more” resources available for support (might not matter – “enough” and “good” are more important than “more”)
  • Java is used for more application types (desktop, web, Android, non-computing devices) and is available on most platforms.
  • Python tends to be used server-side – it’s a scripting language.
  • Python applications tend to be shorter
  • Python uses indentation to describe code structure; Java uses braces.

I use Java because I’m used to it, I understand it well, and it’ll be a nice transition to mobile development for the kids.

Let me know what you decide – it’s interesting!

Your turn

If I have made a mistake above, or if you have thoughts about IDEs/Java/Python/Android/etc., please add a comment and I’ll pass it along!

Introductory Computer Programming in Java – video playlist on YouTube

I’m teaching ICS3C/3U online right now, and I’ve been making videos for my students to learn from. I realize there are good resources online for this stuff already, but there are three reasons I’m making my own instead of curating other sources:

  1. The Java language has evolved, so some things are done differently now (e.g. String comparison)
  2. The development environment has had major updates (NetBeans)
  3. It’s nice to personalize things for my students so they can connect with me a little better

I’m trying to post my videos to YouTube as well as in the virtual Learning Environment. I don’t want to use just one or the other; YouTube is blocked in some school boards, and the vLE is harder to access from a mobile device. Crossposting seems like a good idea.

If you’re interested, here is the playlist I’ll add to this semester. I’ll warn you that they’re not “polished”, although that’s partly intentional: I don’t have time for a lot of re-takes, and I want students to see coding errors and their fixes too.

https://www.youtube.com/playlist?list=PLfd-5Q3Fwq0WGwNp-Ef9OubhMxwM8bROj

Teaching Computer Science online – the hard parts

This semester I am teaching my first e-Learning course (I’ve been supporting e-Learning for five years; time for me to walk the walk, eh?). It’s a split ICS3C/ICS3U course in Computer Science and Programming.

I’m using Java with NetBeans and we’re coding “desktop” applications (i.e. not mobile yet). We might later move to Android programming, but I think that’ll probably be enrichment for interested students. There isn’t really a requirement to write for mobile in the course, and it adds a lot of extra layers of complexity.

“The Range”

Complexity would be fine, except many of the students are first-time coders – zero experience with programming of any kind. That’s normal, since ICS3x doesn’t have a prerequisite, and many schools (especially in Northern Ontario, but elsewhere too I understand) can’t afford to offer ICS2O as a precursor.

Of course, many of the students do have a bunch of programming experience, some in Javascript or Visual Basic, others in HTML, and a couple in many languages.

So I have what I think is a typically wide range in starting points for learning computer science and computer programming.

Troubleshooting at a distance

Teaching online has special challenges for any course, but ICS has software requirements that are significant and unusual. You need a “computer” – no tablets, no Chromebooks*. You need an application installed and a development kit. If students are using computers owned by their school boards they may have to ask to have those items installed for them. I’m sure you can imagine how easy that is to accomplish.

Of course, many students are using their own computers. I prefer this, because they can install their own software (a useful skill in its own right) and they have a lot more coding time (evenings and weekends).

So what do you do when you get an email like this?

“Hi Mr Grasley, I can’t find Netbeans on the computer at school. I don’t know what to do.”

After several email messages, we got it all worked out. I’m sure the student was frustrated, and I felt a little helpless. The special software needs are tough up front in the course.

These aren’t Word documents

The e-Learning environment has a handy document renderer which nicely formats Word and other documents for me in the browser. It’s a fairly new feature, and it works really well.

It can’t handle a .zip file containing a Java project, of course.

So, I have to download the student submissions and import them into NetBeans or unzip them and open the .java files in a text editor. A little more onerous, but still manageable.

That’s it so far

See, I’m not complaining – it’s pretty good to have only a couple of issues that are special. I like teaching online, I get to reference xkcd in my course, and I’m looking forward to the rest of the semester.

*It is possible to use a cloud-based development environment, which would allow you to code using other kinds of devices. I’m not “supporting” that just yet, but I can see it down the road. I’m hoping some of my students try it out and report back.

Will I teach computer programming again?

How I learned to code

I started to learn programming on a Commodore VIC-20 (great online emulator at http://mdawson.net/vic20chrome/vic20.php), then on the Unisys ICON computers (also BASIC) when I was about 10. It was interesting, but I don’t feel like I was really ready for a lot of the concepts involved. Maybe things would be different today…

I dabbled in this and that (learned a tiny bit of assembler, more BASIC, some C) until Grade 10, when I took Computer Science with Mr. Boston at White Pines C&VS. That’s when I really started to take an interest. We worked in Turing, a procedural programming language, and I learned the basics pretty well there. In particular, I remember writing a program to draw a Mandelbrot set on the screen in black and magenta. Eventually I rewrote the program to make a more colourful version, but I can’t remember whether that was in Turing or something else.

Ahead to the University of Waterloo, where I started as a Pure Math student planning to get a minor in Computer Science. My first CS course used Turbo Pascal, a procedural programming language. This was not a course for CS majors (so I qualified).

Partway through my second year of school I was looking for a job for my Coop term. There were positions advertised for the Instructional Support Group (ISG) for tutors. I needed to stay in the Waterloo area (my wife was in North Bay at school and we couldn’t afford to keep up three apartments), but I wasn’t really qualified for any of the serious CS jobs at RIM or Sybase or anything. When I interviewed to be a tutor for CS120, a Turbo Pascal course, the interviewer informed me that they really had a need for Java tutors. I had no Java experience at all, but they hired me anyway (must have been my exceptional charm) and I had a couple of weeks to learn the language well enough to stay ahead of the students.

I started by trying to complete the first few assignments that students were going to have to complete. I started out okay, but then I found that whenever I tried to compile and run my programs I was getting errors like

Non-static method doSomething(int) cannot be referenced from static context

I didn’t know what that meant, really, and I wasn’t Googling then, so I just “fixed” it: I made everything static.

I didn’t understand how object-oriented programming (OOP) worked, and it wasn’t until I’d asked for help, fixed my programs, and saw the power of objects that I really understood what it was about.

I learned a lot about Java in several terms with the ISG, including some interesting work with JKarel, a virtual robot (based on Karel) used to teach OOP. I also learned some shell script (evidence here), bridge, and 5-handed bid euchre (thanks Phil).

I’ve since been disappointed in the security issues that Java has had in the past few years, and had thought my days of Java programming were possibly over.

But now…

This September I’m planning to return to classroom teaching, so I’m starting to think about what I’d like to do. My teachable subjects are Math and Computer Science, and I’ll be the Subject Area Head for Math. I’m expecting that CS won’t be on my timetable for the 2014-15 school year, but I think it would be nice. I haven’t had a chance to teach programming and programming concepts since I left the ISG 2003, and although I’ve dabbled on my own I’d like to jump in again with both feet.

About a week and a half ago I stumbled across and bought “Programming Android: Java Programming for the New Generation of Mobile Devices” on Kindle for $7.51 (I see that today it’s $19.66, which makes me feel unreasonably clever). I haven’t even cracked the virtual cover yet, apart from skimming the Table of Contents before buying it, but I’m kind of excited to revisit the world of software design. I didn’t realize that Android programming was based in Java (using a non-Oracle VM called Dalvik), and so hope rekindled. I don’t even have an Android device, but I’ll be able to code for free using the Android SDK and software emulators, as well as actually loading onto a device down the road.

I’m kind of excited

Programming in Turing helped to develop some useful, basic skills (like understanding loop structures, program logic, data types, etc.) but didn’t really leave me working in a “practical” language (one that is used in real life). Java is a language used in industry, and the prospect of writing Android apps has to be a least a little engaging for students, I hope. This seems like a good starting point for grade 10-12 students who want to learn something fun that will also be useful for them when they leave us. I hope I get the chance; I’m certainly going to ask for it.