Skip to content

Instantly share code, notes, and snippets.

Avatar
🤓

Ferdinand Mütsch muety

🤓
View GitHub Profile
@muety
muety / HelloSwing.java
Last active Jun 8, 2016
HelloSwing - SWT 1 Tut 3 Example
View HelloSwing.java
import java.awt.*;
import java.awt.image.*;
import java.io.File;
import java.io.IOException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ImageIcon;
import javax.swing.JComboBox;
import javax.swing.JFrame;
View ConcurrentCounterSample.java
public class ConcurrentCounterSample {
public static void main(String[] args) throws InterruptedException {
final int NUM_THREADS = 2;
MyCounter counter = new MyCounter();
Thread[] threads = new Thread[NUM_THREADS];
int i;
long startTime = System.currentTimeMillis();
View lod-rankclus-find-max.js
'use strict';
const fs = require('fs');
const SEARCH_CLASS = 'http://yago-knowledge.org/resource/wikicat_Towns_in_Baden-Württemberg';
const FILE = './KPClasses-Yago2-22.txt';
let weights = [];
function func(line) {
if (line.indexOf(SEARCH_CLASS) === 0) {
View lod-rankclus-prop-intersect.js
'use strict';
const fs = require('fs');
const FILE1 = './dbr_Karlsruhe_properties.txt';
const FILE2 = './KPProperties-DBpedia39-22.txt';
const CLUSTER = 1;
let properties = {};
let result = [];
@muety
muety / berlin.json
Created Jan 16, 2017
Property Ranking dbr:Berlin
View berlin.json
{
"http://dbpedia.org/property/description":0.025624229311943,
"http://dbpedia.org/ontology/elevation":0.912037393798431,
"http://dbpedia.org/ontology/PopulatedPlace/areaTotal":0.303861208756765,
"http://dbpedia.org/ontology/leaderParty":0.611218462189038,
"http://dbpedia.org/property/population":4.0748501565555735,
"http://dbpedia.org/ontology/demonym":0.23427369594574,
"http://dbpedia.org/property/leader":0.094248300542434,
"http://dbpedia.org/ontology/country":0.920875578125318,
"http://dbpedia.org/ontology/leaderTitle":0.540366853872935,
View keybase.md

Keybase proof

I hereby claim:

  • I am n1try on github.
  • I am n1try (https://keybase.io/n1try) on keybase.
  • I have a public key ASBe0EvMz6BK5OOp5iOHy0vMXVGqtLq3ZMlJ2zNgOz6oBwo

To claim this, I am signing this object:

@muety
muety / fetch.js
Created Mar 6, 2017
Get image as base64 string using node-fetch
View fetch.js
'use strict';
const fetch = require('node-fetch')
, base64stream = require('base64-stream');
const URL = 'https://www.google.de/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png';
fetch(URL)
.then((res) => {
return new Promise((resolve, reject) => {
@muety
muety / http_jsonrpc.go
Last active Aug 24, 2017
Go JSON-RPC over HTTP
View http_jsonrpc.go
package main
import (
"io"
"log"
"net"
"net/http"
"net/rpc"
"net/rpc/jsonrpc"
)
@muety
muety / largest_prime_factor.go
Last active Apr 26, 2017
Delta Karlsruhe Gewinnspiel
View largest_prime_factor.go
package main
import (
"fmt"
"time"
)
func main() {
N := int64(751395478255)
n := N
@muety
muety / chan_example.go
Created May 16, 2017
Example for channels, inspired by vansimke's YouTube tutorial
View chan_example.go
// https://play.golang.org/p/Y8eaSkYNgG
package main
import (
"fmt"
)
const (
logDebug = "DEBUG"