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
# -*- coding: utf-8 -*- | |
def cross_product(p1, p2, p3): | |
return ((p1[0] - p3[0]) * (p2[1] - p3[1])) - ((p2[0] - p3[0]) * (p1[1] - p3[1])) | |
def point_in_triangle(s, p1, p2, p3): | |
b1 = cross_product(s, p1, p2) < 0 | |
b2 = cross_product(s, p2, p3) < 0 |
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
# -*- coding: utf-8 -*- | |
class QuaternionNumber: | |
def __init__(self, r, i, j, k): | |
self.r = r | |
self.i = i | |
self.j = j | |
self.k = k |
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
# -*- coding: utf-8 -*- | |
import pycurl | |
from BeautifulSoup import BeautifulSoup | |
class BruteFrocePinterestCrawler: | |
def __init__(self): | |
self.content = '' | |
self.url = '' |
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
#include <iostream> | |
#include <string> | |
class Person { | |
public: | |
Person(std::string& reference): _reference(reference) {} | |
std::string name() { return _reference; } | |
private: | |
std::string &_reference; | |
}; |
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
// ping.c | |
int main() | |
{ | |
// ... | |
main_loop(icmp_sock, packet, packlen); | |
} | |
// ping_common.c | |
void main_loop(int icmp_sock, __u8 *packet, int packlen) | |
{ |
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
#!/bin/sh | |
xrandr --newmode "1920x1080" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync | |
xrandr --addmode Virtual1 1920x1080 | |
xrandr --output Virtual1 --mode 1920x1080 |
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
class WebBrowser { | |
public: | |
// ... | |
void clearCache(); | |
void clearHistory(); | |
void removeCookies(); | |
// ... | |
}; | |
class WebBrowser { |
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
#include <stdio.h> | |
typedef unsigned int u32; | |
typedef unsigned long u64; | |
static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) | |
{ | |
union { | |
u64 v64; | |
u32 v32[2]; | |
} d = { dividend }; |
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
export PFX=$HOME/jos-env | |
#export PATH=$PFX/bin:$PATH | |
#export LD_LIBRARY_PATH=$PFX/lib:$LD_LIBRARY_PATH # On Linux, use LD_LIBRARY_PATH | |
#export DYLD_LIBRARY_PATH=$PFX/lib:$DYLD_LIBRARY_PATH # On Mac OS X, use DYLD_LIBRARY_PATH | |
export GPM=gmp-5.0.2 | |
export MPFR=mpfr-3.1.2 | |
export MPC=mpc-0.9 | |
export BINUTILS=binutils-2.21.1 | |
export GCCCORE=gcc-core-4.6.3 |
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
VBoxManage modifyvm "OS X 10.11" --cpuidset 00000001 000306a9 04100800 7fbae3ff bfebfbff | |
VBoxManage setextradata "OS X 10.11" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "MacBookPro11,3" | |
VBoxManage setextradata "OS X 10.11" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0" | |
VBoxManage setextradata "OS X 10.11" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Mac-2BD1B31983FE1663" | |
VBoxManage setextradata "OS X 10.11" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" | |
VBoxManage setextradata "OS X 10.11" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1 |