This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import pika | |
import uuid | |
import json | |
import sample2_pb2 as sample2 | |
import base64 | |
person = sample2.Person() | |
person.name = "Johan Astborg" | |
person.id = 1001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import pika | |
import uuid | |
import json | |
import sample2_pb2 as sample2 | |
import base64 | |
person = sample2.Person() | |
person.name = "Johan Astborg" | |
person.id = 1001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mvn archetype:generate -DgroupId=se.gautr.testing \ | |
-DartifactId=signals \ | |
-Dversion=1.0-SNAPSHOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Fibonacci sequence in state-space form | |
% Define the state-space system parameters: | |
A = [0 1; 1 1]; % State transition matrix | |
B = [0; 1]; C = [1 1]; D = 1; % Input, output, feed-around | |
% Set up the input signal, initial conditions, etc. | |
x0 = [0;0]; % Initial state (N=2) | |
Ns = 13; % Number of sample times to simulate | |
u = [1, zeros(1,Ns-1)]; % Input signal (an impulse at time 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Programvaruutveckling i Grupp, Spike 01 - 1/19/2007 | |
public class Heap { | |
public static void main(String[] args) { | |
Integer[] intArray; | |
MinHeap<Integer> myHeap = new MinHeap<Integer>(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.*; | |
import se.lth.cs.ad.drawing.*; | |
public class BSTVisualizer { | |
private DrawingArea canvas; | |
// diameter of nodes; | |
private final static int DIAMETER = 20; | |
// horizontal distance between nodes on same level |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ | |
public class HeapEntry<E> { | |
E element; // element associated with this HeapEntry object | |
int index; // index of this HeapEntry object in the array | |
// representing the heap. | |
HeapEntry(E element) { | |
this.element = element; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <cstring> | |
#include <bitset> | |
#include <cmath> | |
// Convert the 32-bit binary encoding into hexadecimal | |
int binary_to_hex(std::string &binary) | |
{ | |
std::bitset<32> set(binary); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" standalone="no"?> | |
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> | |
<svg height="500" width="500"> | |
<defs> | |
<marker id="arrow" markerWidth="10" markerHeight="10" refx="0" refy="3" orient="auto" markerUnits="strokeWidth"> | |
<path d="M0,0 L0,6 L9,3 z" fill="#000" /> | |
</marker> | |
</defs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy import fftpack | |
import matplotlib.pyplot as plt | |
from matplotlib import rcParams | |
from matplotlib import use | |
#import matplotlib as mpl | |
use('pgf') | |
def figsize(scale): |