Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am maknoll on github.
  • I am maknoll (https://keybase.io/maknoll) on keybase.
  • I have a public key whose fingerprint is DA83 22AA 8951 3C6C 5076 4E06 A143 6CA1 DBA9 918A

To claim this, I am signing this object:

ivy-c master modified % opam install ivy
The following actions will be performed:
- install ivy.1.3.1
=== + 1 ===
=-=- Synchronizing package archives -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 🐫
=-=- Installing packages =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 🐫
Building ivy.1.3.1:
make
#include "kalman.h"
#include <assert.h>
#include "fixkalman.h"
// create the filter structure
#define KALMAN_NAME sonar
#define KALMAN_NUM_STATES 5
#define KALMAN_NUM_INPUTS 0
//
// This file is part of the GNU ARM Eclipse distribution.
// Copyright (c) 2014 Liviu Ionescu.
//
// ----------------------------------------------------------------------------
#include <stdio.h>
#include "diag/Trace.h"
#include <stm32f30x.h>
@maknoll
maknoll / PdfboxUmlauts.java
Created August 15, 2011 22:38
Fixes widths of german umlauts when loading ttf fonts with PdfBox
PDFont font = PDTrueTypeFont.loadTTF(document, "putr8a.ttf"); // example font (Utopia)
List<Float> widths = font.getWidths();
for (int i = 1; i <= 22; i++)
widths.add(250f); // add 22 floats to cover all 255 ascii chars
widths.set(246, widths.get(111)); // copy width of o to ö
widths.set(252, widths.get(117)); // u to ü
font.setWidths(widths);
@maknoll
maknoll / json2tweet
Created December 28, 2011 23:57
parses json twitter objects from stdin and prints to stdout
#!/usr/bin/env ruby
require 'json'
while line = gets
if json = line.match(/\{.*\}/)
tweet = JSON.parse(json[0], :symbolize_names => true)
puts "@#{tweet[:user][:screen_name]}: #{tweet[:text]}"
end
end
#!/usr/bin/env python
def keygen( mac ):
bytes = [int(x, 16) for x in mac.split(':')]
c1 = (bytes[-2] << 8) + bytes[-1]
(s6, s7, s8, s9, s10) = [int(x) for x in '%05d' % (c1)]
(m7, m8, m9, m10, m11, m12) = [int(x, 16) for x in mac.replace(':', '')[6:]]
k1 = (s7 + s8 + m11 + m12) & (0x0F)
import java.awt.Graphics;
public class HelloWorld extends javax.swing.JApplet {
public void paint(Graphics g) {
for (int i = 0; i < 5; i++) {
g.drawString("Hello World", 5, 25 + (25 * i));
}
}
}
#!/usr/bin/ruby
class Integer
def to_b
Bin.new 0 == self ? [] : [self % 2] + (self / 2).to_b
end
end
1)
public class Median {
public static int median(int a, int b, int c) {
if (a < b) {
if (b < c)
return b;
else