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
dict() | |
for i in range(0, 10000000): | |
d[str(i)] = i + 1 |
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/python3 | |
""" | |
TIMUS 1022 | |
ACCEPTED | |
2014-03-23 | |
""" | |
q = set() | |
n = int(input()) |
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
;;load path | |
(add-to-list 'load-path "/home/gestapolur/.emacs.d/lisp/") | |
;;tree view | |
(autoload 'dirtree "dirtree" "Add directory to tree view" t) | |
(require 'dirtree) | |
(require 'tree-mode) | |
(require 'windata) | |
(require 'twittering-mode) | |
(custom-set-variables |
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
# -*- coding: utf-8 -*-- | |
""" | |
A Naive Decision Tree Practice, Only for discrete values | |
ID3 algorithm | |
""" | |
import math | |
import copy | |
from collections import defaultdict |
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/python2.7 | |
""" | |
TIMUS 1008 | |
ACCEPTED | |
2014-04-09 | |
""" | |
# init |
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 | |
# a simple script to save password in truecrypt container | |
passwd_key= passwd_value= passwd_pair_str= | |
while [ $# -gt 0 ] | |
do | |
case $1 in | |
-i) passwd_key=$2 | |
passwd_value=$3 |
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
[Unit] | |
Description=Update motd | |
After=sshdgenkeys.service | |
[Service] | |
ExecStart= | |
ExecStart=/usr/bin/update_motd.sh | |
Restart=always | |
[Install] |
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/python3 | |
# -*- coding: utf-8 -*- | |
""" | |
xlsx2csv may have some issues while converting datetime | |
""" | |
import xlsx2csv | |
from glob import glob |
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 glob | |
import csv | |
from xlsxwriter.workbook import Workbook | |
for csvfile in glob.glob("/data"): | |
workbook = Workbook(csvfile.rsplit(".")[0].split("/", 1)[-1] + '.xlsx') | |
worksheet = workbook.add_worksheet() | |
_format = workbook.add_format() | |
_format.set_pattern(1) | |
_format.set_bg_color('blue') |
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 ubuntu:latest | |
# Add 10gen official apt source to the sources list | |
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 | |
RUN echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | tee /etc/apt/sources.list.d/10gen.list | |
# Install MongoDB | |
RUN apt-get update | |
RUN apt-get install mongodb-10gen |
OlderNewer