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
| // | |
| // Example of communication with a subprocess via stdin/stdout | |
| // Author: Konstantin Tretyakov | |
| // License: MIT | |
| // | |
| #include <ext/stdio_filebuf.h> // NB: Specific to libstdc++ | |
| #include <sys/wait.h> | |
| #include <unistd.h> | |
| #include <iostream> |
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
| all:consumer producer | |
| CPPFLAGS+=-std=c++03 -Wall -pedantic | |
| CPPFLAGS+=-g -O0 | |
| CPPFLAGS+=-isystem ~/custom/boost/ | |
| LDFLAGS+=-L ~/custom/boost/stage/lib/ -Wl,-rpath,/home/sehe/custom/boost/stage/lib | |
| LDFLAGS+=-lboost_system -lrt -lpthread | |
| %:%.cpp |
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
| /* First test with FreeType2 library */ | |
| /* Output to console of mono rendered font */ | |
| /* | |
| * FreeType2_Mono.c | |
| * | |
| * Created by Michele Catalano <[email protected]>. | |
| * | |
| * Copyright (c) 2013 Michele Catalano | |
| * All rights reserved. | |
| * |
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
| // License: MIT - https://opensource.org/licenses/MIT | |
| // Author: Michele Locati <[email protected]> | |
| // Source: https://gist.github.com/mlocati/7210513 | |
| function perc2color(perc) { | |
| var r, g, b = 0; | |
| if(perc < 50) { | |
| r = 255; | |
| g = Math.round(5.1 * perc); | |
| } | |
| else { |
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
| //To compile: | |
| //cc vlcsms.c -o vlcsms -lvlc | |
| //This source is by Tim Sheerman-Chase and it is released as public domain. | |
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #include <inttypes.h> | |
| #include <vlc/vlc.h> |
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
| """ | |
| Example of setting up CORS with Bottle.py. | |
| """ | |
| from bottle import Bottle, request, response, run | |
| app = Bottle() | |
| @app.hook('after_request') | |
| def enable_cors(): | |
| """ |
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 os | |
| import sys | |
| import traceback | |
| from functools import wraps | |
| from multiprocessing import Process, Queue | |
| def processify(func): | |
| '''Decorator to run a function as a process. | |
| Be sure that every argument and the return value |
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
| /* | |
| * The binary gcd algorithm using iteration. | |
| * Should be fairly fast. | |
| * | |
| * Put in the public domain by the author: | |
| * | |
| * Christian Stigen Larsen | |
| * http://csl.sublevel3.org | |
| */ | |
| int binary_gcd(int u, int v) |
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
| /* | |
| * V4L2 video capture example | |
| * | |
| * This program can be used and distributed without restrictions. | |
| * | |
| * This program is provided with the V4L2 API | |
| * see http://linuxtv.org/docs.php for more information | |
| */ | |
| #include <stdio.h> |
NewerOlder