Skip to content

Instantly share code, notes, and snippets.

View timfel's full-sized avatar

Tim Felgentreff timfel

View GitHub Profile
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
/* The maxium payload (to have enough space for new ips) */
abstract class AbstractListView<S extends IDescribable> extends ViewPart implements ISelectionListener {
public java.lang.Class<?> getGenericType() {
ParameterizedType parameterizedType = (ParameterizedType) getClass().getGenericSuperclass();
java.lang.Class<?> rawType = (java.lang.Class<?>) parameterizedType.getRawType();
Type actualType = parameterizedType.getActualTypeArguments()[0];
TypeVariable<?> typeVariable = rawType.getTypeParameters()[0];
return (java.lang.Class<?>) actualType;
Just a simple script to grab AddressBook cards from the social network StudiVZ (which is still lacking an API to do just this)
def huffman filename
h = {}
open(filename) do |f|
f.read.each do |item|
unless h[item].nil?
h[item] += 1
else
h[item] = 1
end
end
package qt;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.trolltech.qt.core.QByteArray;
import com.trolltech.qt.core.QFile;
import com.trolltech.qt.core.QTextCodec;