Skip to content

Instantly share code, notes, and snippets.

View sunghwan2789's full-sized avatar

Sunghwan Bang sunghwan2789

View GitHub Profile
# -*- coding: utf-8 -*-
import hashlib
import urllib2
import xml.dom.minidom as xml
ALSONG_URL = "http://lyrics.alsong.net/alsongwebservice/service1.asmx"
ALSONG_TMPL = '''\
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="ALSongWebServer/Service1Soap" xmlns:ns1="ALSongWebServer" xmlns:ns3="ALSongWebServer/Service1Soap12">
<SOAP-ENV:Body>
@fmtarif
fmtarif / gist:11244153
Last active December 1, 2019 18:10
#mysql - MySQL common fields/columns type and size
# http://stackoverflow.com/questions/354763/common-mysql-fields-and-their-appropriate-data-types
INT(11) for anything that is either an ID or references another ID
DATETIME for time stamps
VARCHAR(255) for anything guaranteed to be under 255 characters (page titles, names, etc)
TEXT for pretty much everything else.
VARCHAR(255) for emails
TIMESTAMP for dates, tracking creation or changes
DECIMAL(3,2) (unsigned) for 5-star rating value
@vittorioromeo
vittorioromeo / FastFunc.hpp
Last active August 24, 2023 08:15
Don Clugston's fast delegate C++11 implementation
#ifndef SSVU_FASTFUNC
#define SSVU_FASTFUNC
#include <cstring>
#include <type_traits>
#include <cassert>
#include <cstddef>
#include <memory>
#include <new>
#include <utility>
@peppy
peppy / osuStacking.cs
Created August 24, 2011 07:18
osu! stacking algorithm
/* Stacking used in osu! formats v6+. (c) peppy 2011
* Versions previous to 6 had incorrect stacking, but is maintained for scoring purposes.
* For non-osu! clones there should be no problem using the following alogrithm for all format versions.
*/
StackOffset = HitObjectRadius / 10; //ymmv
Vector2 stackVector = new Vector2(StackOffset, StackOffset);
const int STACK_LENIENCE = 3;