Skip to content

Instantly share code, notes, and snippets.

View achalddave's full-sized avatar

Achal Dave achalddave

View GitHub Profile

The default yaml library in lua does not handle YAML booleans correctly.

/tmp ~ th

  ______             __   |  Torch7
 /_  __/__  ________/ /   |  Scientific computing for Lua.
  / / / _ \/ __/ __/ _ \  |  Type ? for help
 /_/  \___/_/  \__/_//_/  |  https://github.com/torch
 | http://torch.ch
@achalddave
achalddave / config.log
Last active October 7, 2016 16:20
./configure error for lyaml. See https://github.com/gvvaughan/lyaml/issues/11 for discussion.
configure:13020: checking for yaml.h
configure:13020: result: yes
configure:13032: checking for library containing yaml_document_initialize
configure:13063: gcc -o conftest -g -O2 -I/home/achald/.local/yaml-0.1.7/include -L/home/achald/.local/yaml-0.1.7/lib conftest.c >&5
/tmp/ccmoDgR2.o: In function `main':
/home/achald/scratch/lyaml/lyaml-release-v6.0/conftest.c:36: undefined reference to `yaml_document_initialize'
collect2: error: ld returned 1 exit status
configure:13063: $? = 1
configure: failed program was:
| /* confdefs.h */
--- test_01.lst 2016-09-09 09:31:06.640048422 -0400
+++ test_01_filtered.lst 2016-09-09 16:04:00.939637895 -0400
@@ -526,7 +526,6 @@
/data/achald/UCF101/frames_all/v_ApplyLipstick_g02_c01/ 65 1
/data/achald/UCF101/frames_all/v_ApplyLipstick_g02_c01/ 81 1
/data/achald/UCF101/frames_all/v_ApplyLipstick_g02_c01/ 97 1
-/data/achald/UCF101/frames_all/v_ApplyLipstick_g02_c01/ 113 1
/data/achald/UCF101/frames_all/v_ApplyLipstick_g02_c02/ 1 1
/data/achald/UCF101/frames_all/v_ApplyLipstick_g02_c02/ 17 1
/data/achald/UCF101/frames_all/v_ApplyLipstick_g02_c02/ 33 1
@achalddave
achalddave / test.lua
Last active September 6, 2016 15:05
-- Exhibits differences between torch's image.scale and opencv's resize
-- function.
local cv = require 'cv' -- https://github.com/VisionLabs/torch-opencv
require 'cv.imgcodecs'
require 'cv.imgproc'
require 'image'
local path = './foobar.png'
-- RGB, shape channels * height * width
import argparse
import logging
import random
import os
import lmdb
from tqdm import tqdm
logging.getLogger().setLevel(logging.INFO)
logging.basicConfig(format='%(asctime)s.%(msecs).03d: %(message)s',
/*
*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
@achalddave
achalddave / markdown-makefile
Created August 6, 2013 17:43
Makefile for generating html files to an output folder from markdown files
SRCS=$(filter-out readme.md, $(wildcard *.md))
FILES=$(patsubst %.md, output/%.html,$(SRCS))
all : output $(FILES)
output :
mkdir -p output
output/%.html : %.md
pandoc --section-divs -c ../docs.css -s --smart -t html5 $< -o $@
@achalddave
achalddave / rm.sh
Last active December 19, 2015 05:49
optimal idiot proofing
function rm {
if [[ "$1" == "-rf" ]] ; then
echo "If you really want to delete this, say 'I may be an idiot'."
read var
if [[ "$var" != 'I may be an idiot' ]] ; then
echo "Nope, you didn't write that correctly"
return
fi
fi
rm "$@"
@achalddave
achalddave / backup.sh
Created April 22, 2013 00:34
Naive Bash Backup
SRCDIR=src
DSTDIR=dst
# copy recursively (-r) updated (-u) files, preserve (-p) attributes if
# possible
$(echo "cp -R -u -p $SRCDIR/* $DSTDIR")
# hack? psh
for file in $(find $DSTDIR/*) ; do
[ ! -e "$SRCDIR/${file#*/}" ] && echo "Removing $file" && rm $file
struct Test {
Point3f x;
void setXStack(float a, float b, float c) {
x = Point3f(a, b, c)
}
void setXHeap(float a, float b, float c) {
x = *(new Point3f(a, b, c));
}