Skip to content

Instantly share code, notes, and snippets.

View ipa's full-sized avatar

Iwan Paolucci ipa

View GitHub Profile
cmake_minimum_required(VERSION 3.2)
project(niftytodicom)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ") #-std=c++11 -fpermissive
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
set(SOURCE_FILES main.cpp)
add_executable(niftytodicom ${SOURCE_FILES})
@ipa
ipa / DependencyInjection.cs
Created April 17, 2012 06:40
Simple Dependency Injection
namespace DependencyInjection
{
public interface IMotor { }
public class Motor : IMotor { }
public class Auto
{
private IMotor motor;
public Auto(IMotor motor)
{
@ipa
ipa / telnetcoffee.pde
Created December 7, 2011 16:53
telnet access to a coffeemachine using arduino
#include <Servo.h>
#include <SPI.h>
#include <Ethernet.h>
// enter mac, ip, gateway and subnet mask
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,2, 177);
IPAddress gateway(192,168,2, 1);
IPAddress subnet(255, 255, 255, 0);
@ipa
ipa / Dice3D.pde
Created November 25, 2011 09:03
3D Dice with Processing
import processing.opengl.*;
PImage[] textures = new PImage[6];
float rotx = PI/4;
float roty = PI/4;
float transx = 0;
float transy = 0;
void setup()
@ipa
ipa / pictureaddition.pde
Created November 5, 2011 14:07
pictureaddition
PImage picture1;
PImage picture2;
void setup() {
size(600, 400);
picture1 = loadImage("color.jpg");
picture2 = loadImage("watch.jpg");
// resize them
picture1.resize(width, height);
@ipa
ipa / picture2monochrome.pde
Created November 5, 2011 09:55
convert rgb picture to monochrome with
PImage img;
void setup() {
size(150, 200);
noLoop();
img = loadImage("kaefer.png");
}
void draw() {
image(img, 0, 0);
@ipa
ipa / mp3fourier.java
Created October 17, 2011 19:56
mp3 player with fouriertransformation
import ddf.minim.*;
import ddf.minim.signals.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;
boolean isPlaying = false;
String filename;
AudioOutput out;
AudioPlayer song;
@ipa
ipa / vignere.c
Created October 13, 2011 20:34
vignere encryption
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#define OFFSET 97
int main(int argc, char* argv[])
{
char* klartext;
char* geheimtext;
@ipa
ipa / movie.pde
Created October 1, 2011 09:57
how to create a movie with processing
import processing.video.*;
int width = 200;
int height = 200;
int frames = 18;
String filename = "example.mov";
MovieMaker mm;
void setup(){
size(width, height);
@ipa
ipa / Async.cs
Created September 28, 2011 16:49
async in C#
// synchronous way
private void Synchronous()
{
WebClient proxy = new WebClient();
string result = proxy.DownloadString("http://tel.search.ch/?wo=luzern");
}
// with backgroundworkers
private void Background()
{