Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| void usleep(DWORD waitTime){ | |
| LARGE_INTEGER perfCnt, start, now; | |
| QueryPerformanceFrequency(&perfCnt); | |
| QueryPerformanceCounter(&start); | |
| do { | |
| QueryPerformanceCounter((LARGE_INTEGER*) &now); | |
| } while ((now.QuadPart - start.QuadPart) / float(perfCnt.QuadPart) * 1000 * 1000 < waitTime); | |
| } |
| /* Getopt for GNU. | |
| NOTE: getopt is now part of the C library, so if you don't know what | |
| "Keep this file name-space clean" means, talk to [email protected] | |
| before changing it! | |
| Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001 | |
| Free Software Foundation, Inc. | |
| This file is part of the GNU C Library. | |
| The GNU C Library is free software; you can redistribute it and/or | |
| modify it under the terms of the GNU Lesser General Public |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| #! /bin/sh | |
| # Init. script for phantomjs, based on Ubuntu 12.04 skeleton. | |
| # Author: Anthony Lapenna <[email protected]> | |
| PATH=/sbin:/usr/sbin:/bin:/usr/bin | |
| DESC="Phantomjs service" | |
| NAME=phantomjs | |
| DAEMON=/usr/bin/$NAME | |
| PIDFILE=/var/run/$NAME.pid | |
| SCRIPTNAME=/etc/init.d/$NAME |
| #!/bin/sh | |
| # | |
| # chkconfig: 35 99 99 | |
| # description: Script for starting phantomjs. | |
| # | |
| . /etc/rc.d/init.d/functions | |
| USER="phantomjs" |
| worker_processes 2; | |
| error_log /var/log/nginx/error.log; | |
| pid /var/run/nginx.pid; | |
| events { | |
| worker_connections 1024; | |
| use epoll; | |
| } |