Thursday, February 26, 2015

SOFT6002 Week 04

We looked at Human Memory (slides: W05-L1) and Mental Models (W06-L1)

After coffee we went to the lab and examined three websites for usability issues.

SOFT6008 Class 04.4

I gave students a quick tour of Photoshop. Some basic Photoshop skills will be required for the assignment. Some students had fun with Photoshop.

We looked at the Mr. Spud Head example and I thought it wold be a good exercise for students to go make something similar. Understanding layers is key to getting that working. I forgot to point out that JPEG does not support transparency, so the images must be saved as PNG files.

COMP8035 Classes 04.1 & 04.2

I met with each student and gave feedback on the blog posts. Different students make different kinds of errors. So hopefully they can be avoided. The first of those posts isn't due until tomorrow. So there is time for corrections.

I discussed paper topics with each student.

Wednesday, February 25, 2015

COMP6021 Class 04.4 - tutorial

Students had very few questions so once we were done we left early

COMP6021 Class 04.3





We did two examples of Huffman coding with 8 symbols.

SOFT6008 Classes 04.2 & 04.3

Students continued coding checksum calculations. These will be incorporated into the assignment eventually.

Tuesday, February 24, 2015

COMP6021 Class 04.2

I planned to do exercises on generating UTF-8 and on Huffman coding. However the UTF-8 proved tricker than we expected, so we will do the Huffman in the next class.

We converted the following to UTF-8, but it took us a while to figure out how do deal with padding zeros.

Gemoji image for :cupid
1F498 
11110000:10011111:10010010:10011000 
f09f9298



Gemoji image for :couple
1F46B 
11110000:10011111:10010001:10101011 
f09f91ab




Gemoji image for :grinning
1F600
11110000:10011111:10011000:10000000 
 f09f9880


SOFT6008 Class 04.1

Apologies for the late start. My calendar led me astray and I obeyed.

We reviewed various JavaScript versions of the Luhn algorithm found online. Some we didn't like. 

From https://gist.github.com/DiegoSalazar/4075533 (modified by Colin slightly)

This code addresses the problem of strings of unknown length by starting at the end and counting down and keep track of what to do by toggling bEven. However we were initially puzzled by the (nDigit *= 2)  which is both a test and a statement.
function valid_credit_card(value) {
// The Luhn Algorithm. It's so pretty.
var nCheck = 0, nDigit = 0, bEven = false;
 
for (var n = value.length - 1; n >= 0; n--) {
var cDigit = value.charAt(n),
nDigit = parseInt(cDigit, 10);
 
if (bEven) {
if ((nDigit *= 2) > 9) nDigit -= 9;
}
 
nCheck += nDigit;
bEven = !bEven;
}
 
return (nCheck % 10) == 0;
}
This code was interesting because it used the fact that JavaScript can add an internet to a string and get a string. That's a small bit strange.  The expected test to see if the product of the *2 > 10 isn't there, because the digits will get added up anyway in the second part of the code.
  // Run through each single digit to create a new string. Even digits
  // are multiplied by two, odd digits are left alone.

  t = "";
  for (i = 0; i < r.length; i++) {
    c = parseInt(r.charAt(i), 10);
    if (i % 2 != 0)
      c *= 2;
    t = t + c;
  }

  // Finally, add up all the single digits in this string.

  n = 0;
  for (i = 0; i < t.length; i++) {
    c = parseInt(t.charAt(i), 10);
    n = n + c;
  }



This code handles odd and even length strings even though it starts at the beginning and words forward. The i % 2 == parity) test looks like our i % 2 == 0, except the desired value 0 or 1 is set beforehand, depending on whether the length is ever or odd. 

function checkLuhn(input)
{
  var sum = 0;
  var numdigits = input.length;
  var parity = numdigits % 2;
  for(var i=0; i < numdigits; i++) {
    var digit = parseInt(input.charAt(i))
    if(i % 2 == parity) digit *= 2;
    if(digit > 9) digit -= 9;
    sum += digit;
  }
  return (sum % 10) == 0;
}


The following examples we considered to be too clever and too cryptic. I pointed out that short clever code isn't always a good thing, because the programmer that comes after might not be able to understand it.

https://gist.github.com/ShirtlessKirk/2134376

http://stackoverflow.com/questions/12310837/implementation-of-luhn-algorithm

http://rosettacode.org/wiki/Luhn_test_of_credit_card_numbers#JavaScript

SOFT6002 Interesting Video & Article


Worth a look

This article is also worth a read
http://www.theatlantic.com/product/archive/2014/08/the-hamburger-menu-debate/379145/

Monday, February 23, 2015

COMP6021 Class 04.1

[No recording of today's class. Sound too bad]

We played Hangman to illustrate the point that letters in English do not occur with the same frequencies.  We looked at how compression can be used to represent information using fewer bits.


We looked at Huffman's algorithm for devising optimal variable length codes.

To be honest, the video I made below says it better than I did in class anyway. (I hope my best work isn't behind me!)

Video on Variable Length Codes



I gave students an exercise to complete in time for the next class.

Thursday, February 19, 2015

SOFT6002 Week 03

We discussed the assignment a bit and assigned students to groups. But it's not really a group project.

We covered the Ecological Theory of Perception (slides W03-L2) and Graphical Coding (W04-L1).

You should have two sets of slides per week. If you are missing any please let me know.

SOFT6008 Class 03.4

Attendance was poor today. I'm told there are some pressing social engagements this week.

Students worked on checksum calculations. We'll be another week at least at those. Perhaps even longer.

Someone figured out the French checksum calculation. It is different from how I described. So if you are tackling that, talk to me first.

COMP8035 Classes 03.2 & 03.3

I brought peper copies of journals again. But they weren't as popular as the last day. I met with most students. From what I can see students are certainly looking in the right places for their research. Journals are very different from random webpages found online.

Most students seem to have a few ideas for the research paper now. That is how it should be.

So, so far, so good.

Wednesday, February 18, 2015

COMP6021 Class 03.4 & 03.4

We attempted to do an experiment to see how many bytes are required to store a Japanese character in UTF-8 but could paste Japanese into any of the text editors. 

Students did an exam question on decoding UTF-8 and then encoded a message. 

SOFT6008 Class 03.2 & 03.3

Students started coding the Luhn algorithm. Some finished and moved into other checksums. 

Tuesday, February 17, 2015

COMP6021 Class 03.2 - 日本語 and 💔



We continued our looked at Unicode. We looked at how writing works in Japanese, and briefly mentioned Emoji.

SOFT6008 Class 03.1

We looked a a variety of different check sum calculations.

It looks like my understanding of the check sum used on French ID numbers may be incorrect. Someone is going to figure that out for me.

Writing Workshops

A series of English Academic Writing Workshops will begin today, delivered by Helen Breen. These workshops are free to all students.  The workshops will be held in B231, as follows:
http://alc.cit.ie/resources/reportwriting
 
·         Tuesday 17th Feb Using online referencing and e-books, room B231, 1-2pm
·         Thursday 19th Feb Online resources to help your writing, room B231, 1-2pm
·         Tuesday 24th Feb Most common writing errors, room B231, 1-2pm
·         Thursday 26th Feb Critical thinking skills, room B231, 1-2pm
 
·         Tuesday 3rd March Using online referencing and e-books, room B231, 1-2pm
·         Thursday 5th  March Online resources to help your writing, room B231,1-2pm
·         Tuesday 10th March Most common writing errors, room B231, 1-2pm
·         Thursday 12th March Critical thinking skills, room B231, 1-2pm
 
 
 
 all students are welcome to attend free of charge

COMP8035 Class 03.1

I brought some paper copies Communications of the ACM and IEEE Computer to class with some  articles marked. Students passed these around. Electronic versions of these are available as PDFs from the CIT Library.

I also met with each student to discuss ideas for the blog posts and the research report.

Monday, February 16, 2015

COMP6021 Class 03.1 - I ♥日本



We looked at UTF-8.

I gave students a UTF-8 message to decode. 49 E2 99 A5 E6 97 A5 E6 9C AC
I think they got the hang of it.



01001001 11100010:10011001:10100101 11100110:10010111:10100101  11100110:10011100:10101100

I  11100010:10011001:10100101 11100110:10010111:10100101 11100110:10011100:10101100
remove markers for leading and continuation bytes 

I  0010011001100101 0110010111100101  0110011100101100

I 2665 65E5 672C

I ♥日本

Thursday, February 12, 2015

HCI Week 02

All talk.no lab. Did up to (&incl) Gestalt Theory.

I misjudged the time. The travel clock I had was an hour fast since daylight savings time! But nobody seemed to mind.

SOFT6008 Class 02.4

We looked at user input validation and checksums.

We looed at code for mobile phone number validation and the Luhn credit card algorithm.

In the next lab class students will start coding the Luhn algorithm. I advised students against look up solutions online. It's best to start with a clean slate and a blank sheet of paper.

COMP8035 Class 02

I met with each student and talked through some ideas.

All the students who were there seem to be on top of things. But the main output for this module is the research Report at the end. So all efforts should be considered as stepping stones on the way to that.

Wednesday, February 11, 2015

COMP6021 Class 02.4 - Zombies, Semaphore & ASCII



We looked at some solutions for the traffic light zombie code and considered some advantages and disadvantages.

We looked at Braille, Semaphore, ASCII, DOS Code Pages, and extended-ASCII

Next up: Unicode

COMP6021 Class 02.3 - Negative Numbers

We played Binary Bingo, but the winner wasn't aware that he had won.




We looked at One's Complement and Two's Complement representations of integers. I explained why they were better that sign & magnitude representations. We looked at using offset binary for awkward situations.  I briefly mentioned IEEE Floating Point, but we won't be going into that. 





We began our look at representing text. I outlined the problems facing Outpost 19 after an attack by the zombie hoard, and asked students to devise an efficient communication system for the traffic lights. 

SOFT6008 Class 02.2

I asked students to continue working on the phone cost calculator.

And then the slot machine exercise.

These images might be useful






Tuesday, February 10, 2015

COMP6021 Binary & Hex Tutorial


This video is a great refresher if you've forgotten how binary and hex work.

COMP6021 Class 02.2 - The Sock on the Door



This was, in fact, our first class.

I introduced the module and talked a little bit about the assessment.

We look at how bits can be used to represent different numbers of things or state, depending on how many bits there are.

We looked at how bits can be used to represent positive integers, and represent integers that may be negative (sign & magnitude)

Slides:

Next up: two's compliment

SOFT6008 Class 02.1

We took our first look at the Document Object Model (DOM).

We looked at how to do rollovers. I showed students the coins toss game working and asked them to work in pairs and speculate what the code might look like.

Next up students will be expected to extend the coin game and turn it into a slot machine.

Slides:
JS02s.pdf

Examples:
Rollover
Coin Toss Game

Monday, February 9, 2015

SOFT7008 Class 02.1

The projector wasn't working so we couldn't have a lecture.

I gave students a short programming skills assessment. Some student struggled with that. Students who are not comfortable with programming might want to consider another option.

Thursday, February 5, 2015

SOFT6002 HCI Week 01

I introduced myself and talked a little bit about he assessment for the module. The modules descriptor is here.

I talked about the importance of HCI and we looked at five of Neilsen's heurstics.

Slides:
HCI-W01-L1
HCI-W01-L2 Starting Heuristics

I sent the slides by e-mail and a link to the module website maintained by Paul Rothwell.

SOFT6008 Class 01.4

We looked at prompts and dialog boxes, and loops.

I asked students to implement a change visualizer.

A few students finished quickly so they took a look at the Phone Cost calculator and tried to figure out how the absence of PasreInt was making the program fail in certain circumstances.

COMP8035 Class 01.3

I asked students to find an interesting article from the list of journals listed other there --->
and to write 400 words on the topic. That's for Week 4.

I want students to become familiar with ACM and IEEE journals. They are all available via
http://library.cit.ie

COMP8035 Class 01.2

Students got to grips with delicious and set up their blogs.

Wednesday, February 4, 2015

SOFT6008 Class 01.3

I asked students to make a craps shooting game using images of dice and Math.random()

Some students struggled with the escaping of the ", but otherwise it went well.

Good job guys


SOFT6008 Class 01.2

I asked students to take the examples we did in the last class and mess around with them, and tweak them, in order to understand how they work.

SOFT6008 Book Recommendations

I recommend students buy one of these books.


Javascript in Easy Steps

9781840785708
€15.55 at Easons   £8.79 at Amazon


Javascript & JQuery

9783527760572
€39 at Easons         £37.50 at Amazon
Strangely  cheaper as a set £25 

Tuesday, February 3, 2015

SOFT7008 Class 01.2






There were very few students in class. So rather than repeat everything next time, I decided I would post a video on how to set up PHP so that everyone can be up to speed for next week.

As of today there is no room timetabled for tomorrow's class. If it is there by tomorrow we will meet up. Otherwise I will see you again next week.

SOFT6008 Class 01.1

I spoke a bit a but JavaScrip and where it runs.

I outlined that the first 40% of the CA will be an in class written exam (date later) and the reaming 60% is a coding assignment.


We looked at two examples of dynamically building up a page using document.write ()
Time based greeting and New Orleans Random Image

There were quite a few very good questions. That makes me happy.

Slides: js01d.pdf

I stressed the importance of coming to class and working through the exercises. That's the best way to learn to program in JavaScript. Googling for solutions is less likely to result in success.

COMP8035 Class 01.1 Introductions

The module descriptor for this module is here

I gave a handout that outlined very briefly what the assessment for this module is going to look like. I gave a handout from wired.com about Predictions for 2015. We looked at those to see if there were any ideas worth looking in to some more.

By the end of Week 02 student will post to their blogs a list of 5 relevant twitter feeds worth following for this module and a brief description of what to expect from each feed.

I asked students sign-up to use Delicious.com and to tag pages relevant to this module with CIT-COMP8035

I will maintain a page of resources for this module and add to it from time to time.

I spent the bulk of the class discussing what the Written Report will look like.

Monday, February 2, 2015

SOFT7008 PHP Class 01.1

I introduced myself, but I had actually met most students before.

Only five students turned up and there wasn't a computer, so we didn't do a whole lot.

I emailed everyone in ITS2 and ITM2 about the module.

This is your recommended Free Choice module for this semester. This is a programming module.

You are free to choose a different free choice module, but it is very unlikely that you will find one that fits in with your timetable. If you are choosing a different one you should do so quickly.

The CRN for this module is in the e-mail I sent. Please register for it online.

The next class is Tuesday at 1400 in C169. Please attend.


This modules requires a web server and PHP server.  If you typically bring your laptop to college please bring it on Tuesday. Alternatively please bring a USB memory stick.