About

  • Combination of the words "Andri" and "Droid"
  • Sysadmin, developer and a student
  • Born in Reykjavík, Iceland
  • Studying in Aalborg, Denmark
  • Not the Google project

Twitter

  • Nice read. "Programming things I wish I knew" -...
  • wants a compact smartphone that can fit into a man's pocket - why is that so hard?
  • dislike how bloated and annoying phpmyadmin has become? Try SQL Buddy....

Calling your own functions from jQuery

I've been playing around with jQuery for a week or so, without any prior experience with Javascript. jQuery is absolutely brilliant and it's quite easy to do different things with it. However, when I started doing repetitive tasks, i wanted to create a function to do it; instead of repeating my code at multiple places.

This is where I had problems, because my 'updateTable' function had no idea what $() was and no jQuery functions worked after I started calling my 'updateTable' function from the jQuery context.

Well, today I got it to work by sending the jQuery object to my function.

Old function (does not work)

function updateTable () {
/* Call jQuery stuff (for example, change forms) */
}

$(function() {
$(document).ready(function() {
updateTable();
});
});

After spending a couple of days scratching my head and reading a bit about Javascript, this was 'obviously' a problem of my function not knowing the jQuery context or any of the objects inside it.

There is probably a smarter way of doing this; but I at least solved my problem by appending the jQuery object '$' to the function, as follows.

Purpose of this page

As I am far away from home, I am a bit conflicted in my writings at times. Sometimes I miss home and I want to write something personal (or wacky) in Icelandic and for that purpose my blog is perfect place to do it. I also have the need to express myself on things of the technical nature and these two things happen to be almost mutually exclusive.

My friends and family normally have no interest in hearing about all that 'computer stuff' that I am doing, except just for the status of my education. There are others who couldn't care less what I cooked last night or what I'm going to do for the summer but would very much like to hear about my views on the Linux desktop, for example.

That is why I am going to split up my webpages. Andri.dk is going to contain my personal blog and Andrioid.net is going to be a home for all of things technical, such as my programming projects, school projects and other things "normal" people would rather, not hear so much about..

Semester Project: RFID Access Control

Semester: Spring of 2009
Authors: Andri Oskarsson, Christoffer Hjortlund

A RFID based access-control system using multi-threading, networking and existing MySQL databases.

The idea was to create a better solution for concerts, sports events and such that rely on paper tickets for access. In particular the student organization of Aalborg University wanted a way of using the student cards for authentication.

It consists of a server, written in C and libevent for asynchronous socket handling. A client, written in C# for Windows and Windows Mobile (6.5 and below). Both entities make us of a MySQL server for data.

Semester Project: Bulletproof

Semester: Spring of 2008
Authors: Anders Tornvig, Andreas Møgelsmose, Andri Óskarsson, Christoffer Hjortlund, René Therkelsen

Our second semester, the project idea was to create a sniper detection system capable of locating from which direction shots were coming from by using multiple networked computers to listen for the shots and triangulate the source from the difference in time.

Project made use of microphones, GPS dongles, Avahi (for dynamic connections). Second implementation made use of threading as well.

Note: The report attached is written in Danish (and I can't really take credit for any of the writing)

Semester Project: NANNY

Semester: Fall of 2007
Authors: Anders Tornvig, Andreas Møgelsmose, Andri Óskarsson, Henrik Holbaek

The project idea was to help schools and other institutions deal with social networks. The idea came up when a certain 'network advisor' was busted in Denmark for seducing young children online.

The system was our first project and our first experience with the programming language C. It made use of libpcap, regular expressions and basically 'sniffed' the network for any traffic intended for specific pages, matches certain (configurable) keywords and notified if any of these triggers were triggered. A good example would be an elementary school where the teacher would want to be notified of all 'person-to-person' messages sent by their students that include the words 'sexy' or 'meet'.