Skip to content

Instantly share code, notes, and snippets.

View iwatakeshi's full-sized avatar
📚
Always learning

Takeshi iwatakeshi

📚
Always learning
View GitHub Profile
; from http://forum.codecall.net/topic/53805-x86-asm-command-line-arguments-demo/
[section .text]
global main
extern printf
main:
push dword [esp + 4] ;argc is located at esp+4
push fmt1
call printf
add esp, 8
@iwatakeshi
iwatakeshi / insight.sh
Created April 19, 2017 20:00
Installs Insight for Ubuntu
#!/bin/bash
get_deps() {
sudo apt install build-essentials autoconf autogen texinfo zlib1g-dev tcl-dev tk-dev mesa-common-dev libjpeg-dev libtogl-dev python-dev flex bison itcl3 itk3 iwidgets4 git
}
get_insight() {
git clone --recursive https://github.com/monnerat/insight.git
}
@iwatakeshi
iwatakeshi / generate.js
Last active September 9, 2017 01:37
Generates test files
#!/usr/bin/env node
const util = require('util');
const exec = util.promisify(require('child_process').exec);
const options = { maxBuffer: 10000000000 * 1024, cwd: process.cwd() };
const isDarwin = /^darwin/.test(process.platform);
const grep = 'grep -v [^A-Za-z] /usr/share/dict/words';
const shuf = isDarwin ? 'gshuf' : 'shuf';
const tail = `tail ${isDarwin ? "-" : "--lines="}`;
#!/usr/bin/env node
const util = require('util');
const exec = util.promisify(require('child_process').exec);
const options = { maxBuffer: 10000000000 * 1024, cwd: process.cwd() };
const isDarwin = /^darwin/.test(process.platform);
const grep = 'grep -v [^A-Za-z] /usr/share/dict/words';
const shuf = isDarwin ? 'gshuf' : 'shuf';
const head = `head ${isDarwin ? "-" : "--lines="}`;
@iwatakeshi
iwatakeshi / gist:e7b24ea44206eab7f2bfa3188a47e874
Created October 12, 2017 17:10 — forked from jwebcat/gist:5122366
Properly download from github using wget and curl
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO https://github.com/joyent/node/tarball/v0.7.1
@iwatakeshi
iwatakeshi / dijkstra.cpp
Created October 13, 2017 15:55 — forked from johngian/dijkstra.cpp
Dijkstra in C++ using STL
#define MAX 999999999
#include <stdio.h>
#include <stdlib.h>
#include <map>
#include <vector>
#include <queue>
#include <utility>
using namespace std;
class compare
#include <algorithm>
#include <queue>
#include <stdio.h>
#include <tuple>
#include <vector>
const int Infinity = 9999;
/*
Dijkstra's Algorithm Sequential
@iwatakeshi
iwatakeshi / codesign_gdb.md
Created October 19, 2017 04:27 — forked from hlissner/codesign_gdb.md
Codesign gdb on OSX

Note: these instructions are for pre-Sierra MacOS. Sierra Users: see https://gist.github.com/gravitylow/fb595186ce6068537a6e9da6d8b5b96d by @gravitylow.

If you are getting this in gdb on OSX while trying to run a program:

Unable to find Mach task port for process-id 57573: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))
  1. Open Keychain Access
# A. Generate list of random numbers
echo "Generating a list of random numbers"
for power in $(seq 1 13)
do
let size=2**$power
let number = 1000*$size
echo "Progress: "$power"/13"
numgen $number -r >> $size"KRandomInts".txt;
fi
/*
* PriorityQueue.cpp
*
* Created on: 2013/10/27
* Author: tsu-nera
*
*/
#include "PriorityQueue.h"
#include <iostream>