Skip to content

Instantly share code, notes, and snippets.

__author__ = 'Juerg Gutknecht <juerg.gutknecht@students.ffhs.ch>'
import urllib2
from BeautifulSoup import *
from urlparse import urljoin
from pysqlite2 import dbapi2 as sqlite
stopwords = set(['the', 'of', 'to', 'and', 'a', 'in', 'is', 'it'])
@jgxvx
jgxvx / permutations.py
Created October 11, 2013 15:00
Permutations in Python
# coding=utf-8
import copy
import datetime
term = 'abcdefghij'
o = 0
def permutations(tokens, p, n):
@jgxvx
jgxvx / 01-pseudoclass-construction.js
Created November 18, 2012 22:36
JavaScript Inheritance
// Declaring our Person object
var Person = function(firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
};
// Adding a couple of operations
Person.prototype.getFirstName = function() {
return this.firstName;
};
@jgxvx
jgxvx / jquery-pubsub-demo.html
Created March 4, 2012 12:36
A short example on how jQuery's pubsub can be used.
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="../lib/jquery.js" type="text/javascript"></script>
<script src="../lib/pubsub.js" type="text/javascript"></script>
<style type="text/css">
body {
font-family: Helvetica;
font-size: 12px;
@jgxvx
jgxvx / main.cpp
Created February 3, 2012 10:48
Hash Codes with Qt
#include <QtCore/QCoreApplication>
#include <QByteArray>
#include <QSet>
#include <QDebug>
#include <QString>
#include <QTime>
#include <limits>
#include <math.h>
#include <iostream>
@jgxvx
jgxvx / MediatorExample.java
Created December 6, 2011 23:04
A basic mediator pattern example for PVAJ class
package ch.juerggutknecht.ffhs.pvaj.mediator.example;
/*
* Copyright (c) 2012 Juerg Gutknecht
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*