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
using Images | |
data = rand(10, 10) | |
image = Image(data) | |
immutable Point{T} | |
i::T | |
j::T | |
end |
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
MAKEFLAGS += --no-builtin-rules | |
CXX=g++ | |
all: libinput.so demo | |
%.o: %.cpp | |
$(CXX) -fPIC -c -o $@ $< | |
lib%.so: %.o | |
$(CXX) -shared -o $@ $< |
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
CXX=clang++ | |
CXXFLAGS=-std=c++11 -O3 -DNDEBUG $(shell pkg-config --cflags eigen3) | |
JL=julia | |
# JLFLAGS=-O3 | |
.PHONY:all | |
all: interpolate.julia.ll interpolate.c++.ll | |
interpolate: interpolate.cpp |
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
define float @interpolate(%"class.Eigen::Matrix"* nocapture readonly %source, %"class.Eigen::Matrix.2"* nocapture readonly %p) #3 { | |
%x_int = alloca float, align 4 | |
%y_int = alloca float, align 4 | |
%1 = getelementptr inbounds %"class.Eigen::Matrix.2"* %p, i64 0, i32 0, i32 0, i32 0, i32 0, i64 0 | |
%2 = load float* %1, align 4 | |
%3 = call float @modff(float %2, float* %x_int) #2 | |
%4 = getelementptr inbounds %"class.Eigen::Matrix.2"* %p, i64 0, i32 0, i32 0, i32 0, i32 0, i64 1 | |
%5 = load float* %4, align 4 | |
%6 = call float @modff(float %5, float* %y_int) #2 | |
%7 = load float* %y_int, align 4 |
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
# WD Red | |
# - check some stuff and track everything (-a) | |
# - ignore temperature (194 and 231) and power-on hours (9) attributes (-I) | |
/dev/disk/by-id/ata-WDC_WD30EFRX-68AX9N0_WD-WMC1T0938110 -a -d sat \ | |
-I 194 -I 231 -I 9 \ | |
-m root -M diminishing | |
/dev/disk/by-id/ata-WDC_WD30EFRX-68AX9N0_WD-WMC1T0965778 -a -d sat \ | |
-I 194 -I 231 -I 9 \ | |
-m root -M diminishing | |
/dev/disk/by-id/ata-WDC_WD30EFRX-68AX9N0_WD-WMC1T0876678 -a -d sat \ |
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
#!/bin/bash -e | |
# Usage | |
function print_usage { | |
echo "Usage: $0 FILES... [-- MAKE OPTIONS...]" | |
} | |
# Process names options | |
MODE="files" | |
FILES=() |
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/perl | |
use strict; | |
my $secfile = shift || die("Usage: " . basename($0) . " <filename>\n"); | |
die("Error: encrypted source file does not exist.\n") unless (-f $secfile); | |
my $file = $secfile; | |
$file =~ s/\.gpg$// || die("Error: unrecognized file"); | |
die("Error: decrypting would overwrite existing unencrypted file.\n") if (-f $file); |
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/perl | |
# | |
# Initialization | |
# | |
use strict; | |
use warnings; | |
use Time::HiRes qw/usleep/; |
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
SHELL := /bin/bash | |
ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) | |
LOOPDEV=/dev/loop0 | |
MOUNTPOINT=$(ROOT_DIR)/mount | |
PASSWORD=foobar | |
.PHONY: default |
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
\makeatletter | |
\newcount\@imagecount | |
\newcommand\showasimage[1]{% | |
\global\advance\@imagecount 1 | |
\edef\x{image-\the\@imagecount}% | |
\immediate\write18{echo '\unexpanded{\font\1=}\fontname\font' > \x.tex}% | |
\immediate\write18{echo '\unexpanded{\1#1\nopagenumbers\bye}' >> \x.tex}% | |
\immediate\write18{pdftex \x.tex}% | |
\immediate\write18{pdf2ps -dNoOutputFonts \x.pdf \x.ps} | |
\immediate\write18{ps2pdf \x.ps \x.pdf} |