Skip to content

Instantly share code, notes, and snippets.

View mshr-h's full-sized avatar

Masahiro Hiramori mshr-h

View GitHub Profile
@mshr-h
mshr-h / lszip.go
Created January 8, 2015 08:57
Print the contents of a zip archive.
package main
import (
"archive/zip"
"fmt"
"os"
)
func main() {
var r *zip.ReadCloser
package main
import (
"fmt"
"image"
"image/color"
"image/png"
"log"
"os"
)
package main
import (
"fmt"
"image"
"image/png"
"log"
"os"
)
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int h,w;
int width;
int height;
int total;
size_t frame_size;
import json
key = "fdksaljvdispoajhp89vdsa8sFDSpvdsa"
def flightsearch(origin, destination, depart_data):
url = "https://www.googleapis.com/qpxExpress/v1/trips/search?key=%s" % key
code = {
from pysqlite2 import dbapi2 as sqlite
import re
import math
def getwords(doc):
splitter = re.compile('\\W*')
# Split the words by non-alpha characters
words = [s.lower() for s in splitter.split(doc)
if len(s) > 2 and len(s) < 20]
@mshr-h
mshr-h / dp.py
Last active January 5, 2016 07:22
Knapsack problem
#-*- coding: utf-8 -*-
import sys
print("Input the item values:")
c = map(int, sys.stdin.readline().split(" "))
c.insert(0, 0)
print("Input the item sizes:")
a = map(int, sys.stdin.readline().split(" "))
a.insert(0, 0)
import re
import math
def getwords(doc):
splitter = re.compile('\\W*')
# Split the words by non-alpha characters
words = [s.lower() for s in splitter.split(doc)
if len(s) > 2 and len(s) < 20]
from math import tanh
from pysqlite2 import dbapi2 as sqlite
class searchnet:
def __init__(self, dbname):
self.con = sqlite.connect(dbname)
def __del__(self):
@mshr-h
mshr-h / install-iverilog.sh
Last active January 15, 2016 06:30
Install iverilog
#!/bin/bash
if [ $# -eq 1 ]; then
INSTALLPATH=$1
else
INSTALLPATH=`pwd`/local
fi
CORE=`expr \`nproc\` + 1`