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
struct Foo { | |
virtual int bar() = 0; | |
}; | |
struct A : public Foo { | |
int bar() { return 1; } | |
}; | |
struct B : public Foo { | |
int bar() { return 2; } |
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 "material.h" | |
#include "opengl.h" | |
uint32_t VertexAttrib::convertType(type_t type) | |
{ | |
switch (type) { | |
case FLOAT: | |
return GL_FLOAT; | |
case SHORT: | |
return GL_SHORT; |
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 <cassert> | |
#include <cstdlib> | |
#include <vector> | |
#include <boost/intrusive_ptr.hpp> | |
#include <AL/al.h> | |
#include <AL/alc.h> | |
#include <vorbis/vorbisfile.h> | |
#include "bicycles/sp.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
template <class T> | |
class RefCounted { | |
public: | |
void incRef() | |
{ | |
m_refcount++; | |
} | |
void decRef() | |
{ |
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
ac_power() { | |
echo 0 > /sys/devices/system/cpu/sched_mc_power_savings | |
echo 0 > /proc/sys/vm/laptop_mode | |
hdparm -B 128 -S 240 /dev/sda | |
echo max_performance > /sys/class/scsi_host/host0/link_power_management_policy | |
echo max_performance > /sys/class/scsi_host/host1/link_power_management_policy | |
echo 1 > /sys/module/snd_hda_intel/parameters/power_save | |
} | |
battery_power() { |
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
/* | |
* This function ensures that there is required amount of data in the | |
* ndr stream. When there isn't, it tries to read as much data as | |
* possible in order to reduce the number of recv() calls. It grows | |
* the stream if necessary. It relies on pdu_size so be careful. | |
*/ | |
static int | |
nds_fetch(int sock, ndr_stream_t *nds, size_t need) | |
{ | |
ssize_t rc; |
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 <stdio.h> | |
#include <sys/stat.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
int main() | |
{ | |
struct flock fl; |
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
var zmq = require('../../') | |
, sock = zmq.socket('push'); | |
sock.bindSync('tcp://127.0.0.1:5556'); | |
setInterval(function(){ | |
console.log('sending pub'); | |
sock.send('10001 some pub'); | |
}, 500); |
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
from nodebox.graphics import * | |
from random import randint, choice, uniform | |
SIZE = (1280, 720) | |
class Circle(object): | |
def __init__(self): | |
self.x = randint(0, SIZE[0]) | |
self.y = randint(0, SIZE[1]) | |
self.color = [255, 204, 34, randint(20, 150)] |
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
from __future__ import division, print_function | |
from nodebox.graphics import * | |
from random import randint, getrandbits, uniform | |
from collections import deque | |
SIZE = (1280, 800) | |
LAYERS = 20 | |
STARS_COLOR = Color(189, 155, 0, 255, base=255) | |
WINDOWS_COLOR = Color(189, 155, 0, 255, base=255) |