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
add_library(${CMAKE_PROJECT_NAME} SHARED | |
# List C/C++ source files with relative paths to this CMakeLists.txt. | |
dummyvk.cpp) | |
# Specifies libraries CMake should link to your target library. You | |
# can link libraries from various origins, such as libraries defined in this | |
# build script, prebuilt third-party libraries, or Android system libraries. | |
target_link_libraries(${CMAKE_PROJECT_NAME} | |
# List libraries link to the target library | |
android |
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/bash | |
PPID1=$(ps -o ppid= "$$" | tr -d ' ') | |
PPID2=$(ps -o ppid= "$PPID1" | tr -d ' ') | |
PARENT=$(ps -p "$PPID2" -o comm=) | |
if [ -z "$1" ]; then | |
if [ "$PARENT" != "script" ] ; then | |
export HISTORY_FILE=$(mktemp) | |
echo "Run with history ($HISTORY_FILE), don't forget to ctrl+D" |
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 ctypes, mmap, struct | |
DEBUG = True | |
try: | |
VirtualAlloc = ctypes.windll.kernel32.VirtualAlloc | |
raise Exception("Windows not supported.") | |
except(AttributeError): | |
libc = ctypes.CDLL("libc.so.6") | |
libc.valloc.restype = ctypes.c_void_p | |
def valloc(size): | |
addr = libc.valloc(size) |
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 ctypes, mmap, struct | |
DEBUG = True | |
try: | |
VirtualAlloc = ctypes.windll.kernel32.VirtualAlloc | |
raise Exception("Windows not supported.") | |
except(AttributeError): | |
libc = ctypes.CDLL("libc.so.6") | |
libc.valloc.restype = ctypes.c_void_p | |
def valloc(size): | |
addr = libc.valloc(size) |
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 re | |
from itertools import permutations | |
class Instance(object): | |
def __init__(self, groups): | |
self.groups = (tuple(groups[0]), tuple(groups[1])) | |
self.level = len([0 for group in groups for _ in group]) // 3 | |
reserved = ''.join([x for group in groups for triplet in group for x in triplet if x is not 'x']) | |
self.residuals = ''.join([str(i) for i in range(1, 10) for _ in range(self.level - reserved.count(str(i)))]) |
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
def getAllNeighbors(origin, steps = 1): | |
seen = {origin} | |
worklist = [origin] | |
while steps: | |
new_worklist = [] | |
for next in worklist: | |
seen.add(next) | |
for neighbor in next.get_all_neighbors(15): | |
if neighbor not in seen: new_worklist.append(neighbor) | |
worklist = new_worklist |
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
\documentclass[11pt,a4paper,svgnames]{article} | |
\usepackage{amsmath} | |
\usepackage{amsfonts} | |
\usepackage{amssymb,amsthm} | |
\usepackage{makeidx} | |
\usepackage{graphicx} | |
\usepackage{float} | |
\usepackage{wrapfig} | |
\usepackage{algorithm} | |
\usepackage{algorithmicx} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
// Let's not mangle these names | |
extern "C" { | |
#include "lua.h" | |
#include "lauxlib.h" | |
#include <sys/mman.h> | |
#include <stdio.h> | |
#include <sys/types.h> | |
#include <sys/ioctl.h> | |
#include <sys/socket.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
// Let's not mangle these names | |
extern "C" { | |
#include "lua.h" | |
#include "lauxlib.h" | |
#include <sys/mman.h> | |
#include <stdio.h> | |
#include <sys/types.h> | |
#include <sys/ioctl.h> | |
#include <sys/socket.h> |
NewerOlder