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
A backup of http://sites.google.com/site/redcodenl/creating-shazam-in-java-1 just in case | |
Why is this necessary? Read http://sites.google.com/site/redcodenl/patent-infringement | |
Please fork, tweet about, etc. | |
---- | |
Creating Shazam in Java | |
A couple of days ago I encountered this article: How Shazam Works | |
This got me interested in how a program like Shazam works… And more importantly, how hard is it to program something similar in Java? |
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/env python | |
"""Compare two aligned images of the same size. | |
Usage: python compare.py first-image second-image | |
""" | |
import sys | |
from scipy.misc import imread | |
from scipy.linalg import norm |
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
/*********************************************************************** | |
* connect.c -- Make socket connection using SOCKS4/5 and HTTP tunnel. | |
* | |
* Copyright (c) 2000-2004 Shun-ichi Goto | |
* Copyright (c) 2002, J. Grant (English Corrections) | |
* | |
* This program is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU General Public License | |
* as published by the Free Software Foundation; either version 2 | |
* of the License, or (at your option) any later version. |
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
#include <string> | |
#include "regex.h" | |
/* | |
* Return a new string with all occurrences of 'from' replaced with 'to' | |
*/ | |
std::string replace_all(const std::string &str, const char *from, const char *to) | |
{ | |
std::string result(str); |
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
## Configure eth0 | |
# | |
# vi /etc/sysconfig/network-scripts/ifcfg-eth0 | |
DEVICE="eth0" | |
NM_CONTROLLED="yes" | |
ONBOOT=yes | |
HWADDR=A4:BA:DB:37:F1:04 | |
TYPE=Ethernet | |
BOOTPROTO=static |
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/env python | |
""" | |
Very simple HTTP server in python (Updated for Python 3.7) | |
Usage: | |
./dummy-web-server.py -h | |
./dummy-web-server.py -l localhost -p 8000 | |
Send a GET request: |
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
import javax.swing.*; | |
import java.awt.*; | |
import java.awt.event.*; | |
class MyFrame extends JFrame { | |
private JButton btnTutup = new JButton("Tutup"); | |
private JButton btnTambah = new JButton("Tambah"); | |
private JTextField txtA = new JTextField(); |
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 | |
# | |
# Example of how to parse short/long options with 'getopt' | |
# | |
OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"` | |
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi | |
echo "$OPTS" |
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
from binascii import hexlify, unhexlify | |
from hashlib import md5 | |
from Crypto.Cipher import AES | |
try: | |
from M2Crypto import EVP | |
except ImportError: | |
EVP = None | |
def m2_encrypt(plaintext, key, iv, key_as_bytes=False, padding=True): |
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
in/python | |
# -*- coding: UTF-8 -*- | |
""" | |
Usage: | |
strace-process-tree filename | |
Read strace -f output and produce a process tree. | |
Recommended strace options for best results: |
OlderNewer