This file contains hidden or 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
#lang racket | |
(module+ main | |
(require dbus | |
dbus/interface) | |
(parameterize ((current-dbus-connection (dbus-connect-session-bus))) | |
(define m (dbus-manager)) | |
(define unique-name (send m Hello)) ;; the connection's "unique name" |
This file contains hidden or 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
#define GEN_ENUM_ROW(Enum) Enum, | |
#define EMIT_ENUM(NAME) \ | |
enum NAME{\ | |
X_NUMBERS(GEN_ENUM_ROW)\ | |
NAME##_LAST\ | |
}; | |
#define GEN_STING_ROW(String) (char*)#String, |
This file contains hidden or 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
// taken from: http://stackoverflow.com/questions/5676791/f-equivalent-of-destructor | |
// great answer how this works: http://stackoverflow.com/questions/538060/proper-use-of-the-idisposable-interface | |
namespace FSharp.Library | |
type MyClass() as self = | |
let mutable disposed = false; | |
// TODO define your variables including disposable objects |
This file contains hidden or 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 rdmd | |
// Computes average line length for standard input. | |
import std.stdio; | |
import std.random; | |
void TemplateVariadicAlias(T...)(string a) | |
{ | |
ulong lines = 0; | |
double sumLength = 0; | |
foreach (line; stdin.byLine()) |
This file contains hidden or 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 std.stdio; | |
//import std.file; | |
struct DummyStruct | |
{ | |
int a; | |
double b; | |
bool c; | |
}; | |
This file contains hidden or 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
CvSize size; | |
size.width = limitWidth; | |
size.height = limitHeight; | |
IplImage* lights_image_p; | |
lights_image_p = cvCreateImageHeader(size, IPL_DEPTH_8U, 1); | |
lights_image_p->imageData = (char*)scene.bmp.elems; | |
lights_image_p->imageDataOrigin = ipl_image_p->imageData; | |
This file contains hidden or 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 std.stdio; | |
import std.conv; | |
import std.string; | |
void main (string[] args) | |
{ | |
if (args.length < 2) | |
return; | |