To collect all the algorithm work from previous two project
- sum_cci written in c
- sum_algo wrtten in cpp
| <?xml version="1.0"?> | |
| <project name="firstbuild" default="compile"> | |
| <target name="compile"> | |
| <javac srcdir="." fork="true" > | |
| <compilerarg value="-J-Duser.language=en"/> | |
| <compilerarg value="-J-Duser.country=US"/> | |
| </javac> | |
| <echo>compilation complete!</echo> | |
| </target> | |
| </project> |
| void f(int, int [*][*]); | |
| void f(int n, int [*][m]); | |
| void f(int n, int [n][n]); | |
| void f(int, int [][*]); |
| #!/usr/bin/tclsh8.5 | |
| # | |
| # Usage: git-unmerged branch1 branch2 | |
| # | |
| # Shows all the non-common commits in the two branches, where non-common | |
| # commits means simply commits with a unique commit *message*. | |
| proc getlog branch { | |
| lrange [split [exec git log $branch --oneline] "\n"] 0 400 | |
| } |
| (provide 'modeline-setting) | |
| ;; Mode line setup | |
| (setq-default | |
| mode-line-format | |
| '(; Position, including warning for 80 columns | |
| (:propertize "[%04l:" face mode-line-position-face) | |
| (:eval (propertize "%03c]" 'face | |
| (if (>= (current-column) 80) | |
| 'mode-line-80col-face |
| def print_file(path = "test.txt"): | |
| """print every word in the file | |
| Arguments: | |
| - `path`: file name | |
| """ | |
| mapped = dict() | |
| with open(path, 'r') as f: | |
| for line in f: | |
| # print line.rstrip('\r\n') |
| # Torndb is a very thin wrapper around MySQLdb that makes it even easier to use MySQL. | |
| # Because it is very light, one can just go through the one-file python source | |
| # to learn how to use it. | |
| # Installation: pip install torndb | |
| # Official doc: http://torndb.readthedocs.org/en/latest/ | |
| # Source: https://github.com/bdarnell/torndb/blob/master/torndb.py | |
| from torndb import Connection |
| ;; (setq whitespace-display-mappings | |
| ;; ;; all numbers are Unicode codepoint in decimal. try (insert-char 182 ) to see it | |
| ;; '( | |
| ;; (space-mark 32 [183] [46]) ; 32 SPACE, 183 MIDDLE DOT 「·」, 46 FULL STOP 「.」 | |
| ;; (newline-mark 10 [182 10]) ; 10 LINE FEED | |
| ;; ;; (tab-mark 9 [9655 9] [92 9]) ; 9 TAB, 9655 WHITE RIGHT-POINTING TRIANGLE 「▷」 | |
| ;; )) | |
| ;; |
| class myConnection(torndb.Connection): | |
| """ | |
| In torndb version 0.1, the time zone can not be set. we have to create our own connection class | |
| and reconnect() | |
| """ | |
| def __init__(self, host=None, database=None, user=None, password=None, time_zone="+8:00"): | |
| torndb.Connection.__init__(self, host=host, database=database, user=user, password=password) | |
| self._db_args['init_command'] = ('SET time_zone = "%s"' % time_zone) | |
| try: | |
| self.reconnect() |
| # Client Side---------------------------------------- | |
| # Please cheng the `sh-rd-hfeng to your server's host-name | |
| # Usage: python client.py <str> -- if <str> is 'Done', it | |
| # will tell the server you are OK now and the server will close, | |
| # any other strings will continue the server works | |
| import socket | |
| import sys | |
| HOST, PORT = "sh-rd-hfeng", 9988 |