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 os | |
import zmq | |
import wiringpi | |
RED_PIN = 0 | |
GREEN_PIN = 1 | |
BLUE_PIN = 2 | |
def main(): | |
context = zmq.Context() |
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 "HttpParserSettings.h" | |
#include "HttpConnection.h" | |
#include <QUrl> | |
#include <QByteArray> | |
#include <QHash> | |
#include <QMetaObject> | |
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
#ifndef _BinaryTree_h | |
#define _BinaryTree_h | |
template <class DataType> | |
class BinaryTree | |
{ | |
private: |
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
int redPin = 9; | |
int greenPin = 10; | |
int bluePin = 11; | |
int hue = 0; | |
void setup() | |
{ | |
pinMode(redPin, OUTPUT); | |
pinMode(greenPin, OUTPUT); |
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
# -*- coding: utf-8 -*- | |
""" | |
Based upon www.splinter.com.au/converting-hsv-to-rgb-colour-using-c/ | |
""" | |
from math import floor | |
def HSVtoRGB(h, s, v): | |
r, g ,b = 0, 0, 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
QFile *file = new QFile(filename); | |
QFileInfo info(*file); | |
QDir dir = info.dir(); | |
QString filepath = dir.absolutePath(); | |
if (!dir.mkpath(filepath)) { | |
qWarning("Error while creating the subdirectory %s", qPrintable(filepath)); | |
} |
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
/* | |
* Based on this picture | |
* http://imgur.com/ZZxFy | |
*/ | |
#include <cstdio> | |
#include <stdio.h> | |
#include <windows.h> | |
#include <tlhelp32.h> |
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
QString atom( | |
"declare namespace atom = \"http://www.w3.org/2005/Atom\";\n" | |
"declare namespace media = \"http://search.yahoo.com/mrss/\";\n" | |
"doc($result)//atom:entry/media:group/media:player/@url/string()\n" | |
); | |
QXmlQuery query; | |
query.bindVariable("result", &buffer); | |
query.setQuery(atom); |
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 sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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 <boost/shared_ptr.hpp> | |
class VideoManagerPrivate { | |
private: | |
friend class VideoManager; | |
VideoManagerPrivate() { } | |
bool init(int _width, int _height, short _bpp, bool _fullscreen) { |