WordPress plugin for Knowledge Building discussions

Our research group has been working with knowledge building for years now. Some may be familiar with the Fle3 learning environment, built back in 2001. We’ve tried to get someone to create a Moodle plugin for knowledge building, even with the help of a dozen polytechnic students, but without much success.

Hans Põldoja came visiting two weeks ago and said he wanted a knowledge building plugin for WordPress by “next Tuesday”. Well, that wasn’t going to happen, but since our group leader Teemu Leinonen ok’d that I could spend time doing this plugin, I overcame my disgust over the uglyness of PHP and went to work.

Now, after one week, and probably about 20 hours later I have:

  1. Set up SVN and Trac for the project
  2. Got a domain name: fle4.uiah.fi
  3. Taught myself how to create WordPress plugins, basically by looking at these resources:
  1. Writing a Plugin « WordPress Codex
  2. Plugin API « WordPress Codex
  3. Plugin API/Action Reference « WordPress Codex
  4. Plugin API/Filter Reference « WordPress Codex
  5. Option Reference « WordPress Codex
  6. Adding Administration Menus « WordPress Codex
  7. WordPress Coding Standards « WordPress Codex
  8. Inline Documentation « WordPress Codex
  9. Plugin Submission and Promotion « WordPress Codex
  10. I did take a look at a few other plugins that do something similar, but the code quality was so bad that they didn’t help that much.
  • I then tested the plugin on my WordPress site.
  • When I was happy with the result, I applied for hosting at the WordPress Plugin Directory.
  • I then copied my code to the provided Subversion location (where you can checkout the source code as well), waited for the plugin information to be updated, and presto, it was downloadable and installable from within WordPress plugin management screens.
  • Some findings and observations:

    • WordPress development documentation is excellent, and an invaluable resource!
    • Many WordPress plugins (despite the previous point) are of low quality. So if looking for code examples, think carefully what you use.
    • The WordPress API is in general very well made. The Actions and Filters hooks allow plugins to easily effect the places they need to change.
    • The API still has problems – some changes aren’t easy to make using hooks, and need to be manually inserted by editing templates.
    • Some WordPress code still has html and php mixed together (example: the Walker class), which make their extensions really painful.

    But yes, in about half a week of working time I have a functional plugin. You can find it:

    Comments and such about the plugin are welcome at the plugin site. More general comments are welcome here.

    Blogged with the Flock Browser

    Tags: , , , , ,

    Gravatars and other externally loading dynamic content in blogs considered harmful

    I’m a happy user of Gravatars (globally recognized avatars) that allow my face to show up next to comments I write to practically any blog site. However, I’ve recently realized that Gravatars (at least their current implementation) have a major flaw that will really inconvenience its users in the long run.

    The basic problem is that blog posts and their comments are timestamped entities, which stay static forever (theoretically) after they have been created. A blog becomes an archive that with the help of permalinks allows others to refer to specific posts or comments, thus enabling the whole blogsphere, of sending messages between blogs. But if this archive contains information that is loaded from external sources, and thus is liable to change, the blog post no longer stays inert.

    Now, a common practice is to include images or embed videos from other sources to a blog post. Anyone understands that if the video clip or other external media disappears from the referenced URI, then the blog post will lose part of its content, making its remaining parts and its commentary partially meaningless. However, it is easy to see that the cause is missing data.

    Loading more dynamic content becomes problematic. Any external source that is likely to produce different content will make the blog post very difficult to understand later on. For example, embedding something like “today’s newscast” from a news agency, and commenting that, will be quite confusing if the shown content will actually each day show that day’s newscast, and not the one from the day the blog post was made.

    All of this is quite simple, and probably most bloggers intuitively know that they should link to and embed stuff from as permanent sources as possible.

    So what’s my problem with Gravatars? Some of you may have figured it out. While a gravatar image may not change very often, one should consider that Gravatars have been around only for a few years. Let’s take a longer view. My Gravatar image shows me at the age of about 30 years. When I’m fifty, I’ve probably updated by Gravatar image to show my current visage. However, when I do this change, all the hundreds of blogs I’ve commented on in the last 20 years will suddenly show a 50 year old man as a commenter.

    My Gravatar

    This problem is even more acute to teens. When you’re 12 years old and commenting on your friends’ blogs, it’s nice to have your own face in there, probably with a funny grin on it. But after 10-15 years when you’re a respected professional and your Gravatar icon shows you wearing a business suit, your friends’ blogs will seem pretty weird, with you in your suit hanging out with teens.

    Gravatar could of course fix this, by allowing users to have historical images that are sent to older blog postings. This would require a change in the API so that the call to get a Gravatar image based on an e-mail address would also include the date of the comment. Changing the API and getting all implementations to upgrade will be a challenge, but not doing it will simply break the system as people age, change contexts, and change their Gravatar images accordingly.

    Blogged with the Flock Browser

    Tags: , , , ,

    New media art festival Assembly 2009

    Assembly Summer 2009 is over. 4 days of partying and great competitions. Check out both the realtime and sound+vision competition categories and final results. You can find many of the winning entries from YouTube, but I’d suggest loading the videos from Assembly TV’s video archive.

    While the demo scene has traditionally been about taking slow computer hardware to its limits, nowadays computers are powerful enough to do just about anything easily. In the 90s, getting complicated 3D graphics to run smoothly was a great achievement, but now it’s trivial. So the progression of computer art parallels that of cinema: the first films didn’t need any good story, just having a train pull up to a station was enough to amaze people. So like in cinema (and still photography before that), to make something interesting, it’s not enough to just have fancy effects and proof-of-concept gimmicks – you need something else, and that else is art. To make an impression even a demo nowadays needs to have artistic values, and either tell a story, or dazzle with audiovisual awesomeness. Technical prowess is still needed in this genre, but it’s less and less obvious.

    My personal favorites from some categories, which have something more in them than just great code (links are direct links to video files):

    • Demo compo (basically anything goes, as long as it’s created in real time): The Golden Path by UF & DD
    • 64k compo (entry size is limited to 64kb, which is around what a typical web page nowadays takes up without images): Genome by Phantom Lord
    • 4k compo (entry size is limited to 4kb, which is about the size of an icon, or a typical e-mail message): Dollop by SQNY
    • Short film compo: Kanava DELTA by Tekotuotanto (this one is in Finnish)

    Disclaimer: I’m a volunteer at Assembly, heading the team in charge of web services.

    APA style reference and citation checker

    Oh the woes of academia…

    Since the journal I was submitting an article to wanted the manuscript in Word format instead of LaTeX, I was stuck with finishing my work using OpenOffice Writer. Which means that there was no automatic tool to format citations or to generate the list of references. And manually checking 20+ pages of manuscript seems like a task where human errors can really shine.

    A tool is needed. I don’t want a wizard that turns a reference database into a reference list – there’s plenty of those, including BibTeX, and several web services (most of which are not free unless your university has paid for access). The problem is that after the reference list is generated and the manuscript has gone through a few peer review iterations, I can’t be sure whether I’m still citing everything correctly. So I need something that can read my manuscript and tell if there are problems. It doesn’t need to be perfect, as long as it warns about uncertain cases (which means: no false negatives).

    So I started looking for a tool that would do APA style citation checking from a manuscript. And I couldn’t find any. Some Word plugins do exist, but they cost money, and require the use of Microsoft Word, which I don’t use on my Linux or Mac machines. Nothing freely available seems to exist.

    So I wrote one in Python.

    It took like an hour, and it’s basically just a script that does some fancy regular expression matching on the manuscript. I found several errors in mine, including incorrect years in citations, so it already paid off the work I put into it.

    But would someone else like to use this tool as well? I could post the script for others to download, although I’d need to clean it up a bit. And using it might be a bit of a hassle as you’d need to download it and get it to run on your machine. Or I could set it up as a web service, so you could just use a form to submit a plain text version of your manuscript, and the service would give you a report on the citations. But would you feel ok about sending your non-published manuscript to such a web form?

    Did the 100!

    As most people should know, physical exercise is essential in keeping the brain in good working condition. So I’ve tried to stay active, with badminton, cycling, nordic walking, and from May of this year, with Wii Fit. The latest exercise idea started as a Facebook group called “Punnertajat”, which got several people at my work place following the 100 pushups programme. It’s basically a six week programme, after which you should be able to do 100 consecutive pushups.

    Well, I was already able to do 40 pushups, thanks to my exercise on Wii Fit, although Wii uses a different approach to exercise, and makes you do very slow and thorough pushups, whereas the 100 pushups programme uses quick interval training. Anyway, my progress can be seen in the Push ups logger. Two days ago I finished week 6, and just now I managed to do 100 consecutive pushups. The first 75 were a breeze, but after that things got very hard. Had to take one short breather at 85 pushups, but managed to crunch my way to 100, with every limb shaking.

    I can warmly recommend the programme to anyone wanting to improve their upper body – you can start even if you only can do a few pushups, and gradually build your strength. The interval type training seems very efficient – it got me from 40 to 100, and basically all it took was about 10 minutes of training 3 times a week.

    Failures of the scientific method and the waterfall method (again)

    I originally discussed the waterfall method in a previous blog post. Pranav just made a comment that I feel needs some further discussion:

    I disagree with the following statement: “This is how science (unfortunately) often works – researchers just cite something, because everyone else does so as well, and don’t really read the publications that they refer to. So eventually an often cited claim becomes “fact”.”

    I would like to say that this is generally not how science works. Claims(predictions) made by any scientific theory is verified by multiple laboratories/people over a period of time and they are always falsifiable.

    The problem with software development is that it is not based on a scientific theory yet (I am not talking about computer science here, only software development). It has been said many times that it is more of an art than science.

    Problems with science

    Pranav, thanks for your comment. Of course you are right in that science normally should work by verifying findings, and falsifying those that are found to not hold up to evidence. However, my experience as a researcher has shown that this is unfortunately not often what happens. I’ll present a few examples.

    First, the convention of citing another article. If you follow the rules strictly, you should only cite someone when you are referring to their empirical findings, or to the conclusions they draw from that. Nothing else. Nothing. But, unfortunately, most scientific articles do not follow these rules, but liberally make citations like “X used a similar research design (X, 2006)”. Wrong! While X may very well have done so, you’re not supposed to cite that. You only cite empirical results and conclusions thereof. But this is what happens. Because citation practice has degenerated across all fields, it is quite difficult to see the quality of a citation – is the claim (that is backed by a citation) based on empirical evidence or is it just some fluff? It has become too easy to build “castles in the sky” – researchers citing each other and building up a common understanding, but with no empirical evidence in what everyone is citing to. This is what has happened to the Waterfall model – researchers in the whole field have cited to Royce (1970) because that’s what everyone else has done. And the citation isn’t valid – there’s no empirical evidence to back the claim that a linear process works, and actually there’s not even a fluffy “i think so” claim to that effect, but rather Royce considers the idea unworkable. This hasn’t stopped hundreds of researchers from citing Royce. I consider this an excellent example of the failure of the scientific method. Of course the method in theory is still solid, but the degenerate practices have made it prone to failure.

    In my field of educational technology I see this only too often. Cloud castles being built as researchers cite each other in a merry-go-round, with no-one realizing that whoever started the idea did not in fact have empirical evidence for it, but just a fluffy idea. And shooting down these established cloud castles is not easy, because the whole scientific publishing industry is also skewed:

    • You usually can’t get an article published unless to cite the editors and reviewers of the journal, and support their findings. Therefore contraversial results are hard to publish in the journal where they would be most useful.
    • Researchers often do not publish zero-findings. That is, when they try to find a certain pattern, and they fail, then they just scrap the whole thing and move on. But the scientific method actually needs also these zero-findings, because there are many fluffy theories that may occasionally get statistically significant empirical evidence (because with a 95% margin of confidence there’s 5% of studies that will find a connection even if there is none), but cannot be easily proved wrong. Therefore the numerous studies that fail to find a connection would show that the theory isn’t very strong. But these almost never get published.

    And let’s make it clear that this is not a problem of “soft science” alone. Let’s take for example statistical science. Those who do statistics will know Cronbach’s alpha as a reliability estimator. It’s the most commonly used estimator, being in wide use for decades. Unfortunately, it doesn’t work for multidimensional data, which most data actually is. It’s still being used for that, because “That’s what everybody is using”. Here’s the article where professor Tarkkonen proves that Cronback’s alpha is invalid for multidimensional data, and in fact most data (pdf). You’ll notice that it is not published in a peer-reviewed article. I’m told it was submitted years ago to a journal, and the editor replied something to this effect:

    “Look, your article is sound and I cannot find any fault within it, but we can’t publish this. I mean we’ve been using Cronback’s alpha for decades. Publishing this would make us all look silly.”

    Waterfall and software engineering

    OK, back to the waterfall method and software engineering. I like Pranav’s comment that making software is more of an art than science. And I agree. Creating new software is not like producing another car off the assembly line, it’s like designing a new car. Creating copies in bits is easy and cheap, since the engineering of computers is good enough. But making software is more of an art, and a design process.

    In fact I have a problem with the term “software engineering”. Because software isn’t engineered, it’s envisioned, explored, protyped, tried out, iterated, redone, and designed. Researchers and managers have been trying to get software engineering to work for several decades now, and what are the outcomes? Can we build software as reliably as we can build a new bridge? No. But, if the bridge builder was given for each new bridge requirements like “use rubber as the construction material”, changing the requirements, tools and crew each time, maybe building a bridge would not be so predictable either.

    But this doesn’t mean that software development can’t be a scientific method. If we can do empirical data gathering (like metrics of source code, and budget/schedule overruns), and can find patterns there, then there is a science. I mean there’s science in arts as well – compatible colour combinations, the golden ratio and other rules (of thumb) are based on experience, and currently many of them have proper studies to back them up, not just folklore.

    So also software development can be studied scientifically, although much of it is unpredictable and challenging. My understanding is that most of the studies published in the last decade quite uniformly find that practices such as iterative life cycle models, lean management, intuitive expert estimation instead of automated model estimation, and common sense, actually are well correlated with successful software development projects. So there are some rules of thumb with real empirical backing.

    Even the waterfall method has empirical studies to show that it is a really horrible way to do software except in some extremely specific circumstances, which almost never coincide in a single project. If they would, it would be the most boring project in the world. I would not want to have any part it it. Remember, NASA flew to the moon in the 1960s with iteratively developed software and hardware. And I’d bet the software guidance system for the Patriot missiles (which never hit anything in the 1990s) were based on a linear model.

    Future of food: the ecological era

    Just listened to the Social Innovations Network on the future of food. Basically what Michael Pollan and John Mackey are predicting is a change from the industrial era to an ecological era. The conciousness of the consumers and the field changing from maximum profits to other values, such as soil health, animal welfare, fair trade, local food, atrisan food, organic food, ecological food, and ethical food.

    Now I just have to combine this with the imminent peak oil event, which will make gasoline, transportation, plastic, pesticides, fertilizers, and pretty much anything oil based much more expensive than what it has been for the last 100 years.

    Before the green revolution, it was estimated that we can support 1,5 billion people on this planet. Although the green revolution included many technological advancements, much of it was due to cheap oil, which allowed use of pesticides and fertilizers to yield bigger crops anywhere. We’re currently at 6 billion people, and I guess 2 billion aren’t getting enough or proper food. So what happens when oil starts becoming less and less available, and presumably the US and other “developed nations” will take what they need by force, leaving developing nations with hugely rising costs for oil based products, including energy?

    It seems likely that we cannot support 6 billion people without the use of oil. Did you know that one barrel of oil equals 3 man-years of energy? And as the US is promoting bio diesels, it’s potential food that’s being used to power cars. Seems like starvation will become an even bigger problem in many parts of the world.

    So what will this mean for local, organic, or ethical foods? Well, local food means there’s less transportation involved. Currently transportation amounts to only about 10% of the energy cost of food, but with rising oil prices, this figure may increase, making local foods actually relatively cheaper than food that’s imported from the other side of the planet.

    Organic food differs from nation to nation but basically means less or no pesticides, no irradiation, or no antibiotics for animals (it’s something like 1/3 of all antibiotics in US that are used for food animals). Well, pesticides and antibiotics are both heavily dependent on oil derivatives, and will become more expensive, so organic food will also become relatively cheaper.

    And I’ve understood that in general as energy becomes less scarce, people will need to start adapting to less energy consuming foods, meaning less meat, more vegetables and more fish. And the seas are kind of running out of fish even as it is (although quite a fair amount of this fish is used as fodder for cattle).

    Sustainability will become a major concept within the next decade – economy, energy, ethics and ecology all need to be considered. And us consumers have the ultimate power to vote with out wallets. What kind of food do you buy? Currently the ecological choices are more expensive, but this might very well change.

    PS. There’s a great photo series by Time Magazine showing what we currently eat around the world.

    From Linux to Mac: Days 5-7

    I installed XiphQT to enable Ogg Vorbis, FLAC and other better than mp3 music formats. I also installed subversion using MacPorts so I can access my work files and other documents on my server. Subversion in combination with the sshfs allows for pretty good file sharing already, but I’ll need to look at nfs sharing still. SSHKeyChain is a good free piece of software to replace Linux’s ssh-agent, and a bit more.

    Regarding iTunes, I also tested the podcasting and videocasting features of it. So far my podcasting has happened via a Linux server that downloads new entries from my feeds every night, and I just copy new stuff into my player when I’ve listened to everything in it. I don’t use the player for music, just for podcasts.

    I stumbled upon another recent Mac convert, and his gripes about Mac. Good reading, especially the comments, where most of his problems are addressed. My main problem still is that a windowing system controlled by a mouse is just too clumsy and slow. I find myself spending much too much time just juggling the application windows around. So while Mac is definitely something I’d recommend to any normal computer user over a Windows machine (due to both usability and security issues), but the possibilities of tweaking the UI to match a power user’s needs just are insufficient, just as they are in Windows. The next release of Mac OS X should have virtual desktops, so that might help a bit. But I guess I’ll need to do a triple boot system with Linux and see how much of the hardware I can get to work in a pure Linux system.

    Well, as I complained about this, my colleagues pointed out QuickSilver, which should allow me to do more using just the keyboard, and not having to bother with the mouse. Let’s install and see.

    From Linux to Mac: Days 3-4

    During the weekend I managed to start using iPhoto and iTunes. Very impressive pieces of software, I must say. No wonder so many people use iTunes. I did import most of my music and photo collections into the applications. There are some aspects where I’d like more control over how they operate, but I guess I’ll just try them out for a while.

    I also installed MacFuse so I can mount files over ssh. Didn’t have time to test it out, though.

    After some tweaking I also turned off FileVault – it was just too cumbersome to move files around, and with the ultra-slow (and ultra-secure, I guess) deletion logouts were a bit of a pain. After all, I do open source work, and publications, and such, so there are no classified secrets on my machine.

    The Finnish keyboard layout is a bit of a hack. Important special characters needed in shells, like “|”, “@” or “$” were a bit difficult to find, but at least they are accessible. Special characters in file names are also a bit problematic. Apparently Mac uses UTF-8, but the Terminal, of course, cannot handle unicode. So I need to find another terminal for that.

    Of course, the Ubuntu Linuxes I’ve installed work quite nicely. I’m starting to think that VMWare has handled Linux support better than Parallels. On the Windows side there isn’t much difference. I’ll post the details later when I’ve gone through all combinations extensively.

    From Linux to Mac: Day 2

    Restoring the contents of my previous laptop’s hard drive was a bit more complicated than I thought. I got a firewire/usb box I could stick the hard drive into, and Mac OS X easily showed the FAT partitions of the drive when I plugged it in using firewire. However, there was no way to make that firewire drive visible inside VMWare or Parallels to actually access the Linux partitions. An attempt with USB failed because USB doesn’t provide enough power to the drive, and of course the external power source was nowhere to be found, since “firewire is superior”. OK, today I got a new box with two USB connections, one to just provide extra power. Excellent! Now when I plugged it in, Mac OS X showed me the FAT partitions. I unmounted them (dragging them to Trash, which currently is clever enough to look like an eject button when you’re dragging a drive into it), then in the settings of my VMWare’d Ubuntu, selected the USB drive and checked “connect”. Click on Apply, and lo and behold, Ubuntu started mounting the partitions and opening them for me.

    OK, nearly there. However, I was using LVM2 on most of the partitions, so I needed something else. Specifically this:
    vgscan
    lvmscan
    vgchange -a y

    Then I could just mount all of my logical volumes, and start moving the data to my new laptop.

    Meanwhile, I installed NeoOffice, Transmission and Kiiboard. KeyJNote is distributed in source form, so I’m still figuring that out – seems I need to install quite a bit of Python using MacPorts.