This file contains hidden or 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
#-*- coding: utf-8 -*- | |
from PIL import Image | |
MAX_LEN = 100.0 | |
FIX_RATE = 1.8 | |
REPLACEMENT = 'MNHQ$OC?7>!:-;. ' | |
def convert(filename): |
This file contains hidden or 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 PIL import Image | |
def binary(filename): | |
image = Image.open(filename) | |
# Convert to Gray mode | |
image = image.convert('L') | |
This file contains hidden or 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 <dirent.h> | |
int main(int argc, char *argv[]) { | |
DIR *dp; | |
struct dirent * dirp; | |
if (argc != 2) | |
err_quit("usage: ls directory_name"); | |
if ((dp = opendir(argv[1])) == NULL) |
This file contains hidden or 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 os | |
from flask import Flask | |
def create_app(import_name=None, config=None): | |
app = Flask(import_name or __name__) | |
app.config.from_object('$project_name.settings') |
This file contains hidden or 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 | |
sh_version = '1.0' | |
author="shonenada" | |
email="[email protected]" | |
pkg_version="0.1" | |
function write_setup { | |
echo "write $1" | |
echo "from setuptools import setup, find_packages" > $1 |
This file contains hidden or 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 | |
sh_version = '1.0' | |
author="shonenada" | |
email="[email protected]" | |
pkg_version="0.1" | |
function write_setup { | |
echo "write $1" | |
echo "from setuptools import setup, find_packages" > $1 |
This file contains hidden or 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
#-*- coding: utf-8 -*- | |
import sys | |
import struct | |
TABLE_START = 0x1540 | |
CHINESE_START = 0x2628 | |
TABLE_START_FLAG = '\x9D\x01\x00\x00' | |
SCEL_FLAG = '\x40\x15\x00\x00\x44\x43\x53\x01\x01\x00\x00\x00' |
This file contains hidden or 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
class Music(object): | |
metadata_info = ( | |
('title', 3, 33), | |
('artist', 33, 63), | |
('album', 63, 93), | |
('year', 93, 97), | |
('comment', 97, 126), | |
) |
This file contains hidden or 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 <unistd.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <fcntl.h> | |
#include <signal.h> | |
#include "client_info.h" | |
#define FIFO_NAME "/tmp/server_fifo" |
This file contains hidden or 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 <unistd.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <fcntl.h> | |
#include <signal.h> | |
#include <pthread.h> | |
#include "client_info.h" |