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
bool config_db::update_from_csv(const char* csv_file) | |
{ | |
try { | |
vector< vector<string> > data_table; | |
ifstream ifs(csv_file); | |
while (ifs) { | |
string line; | |
getline(ifs, line); | |
vector<string> tokens; | |
// splits line string delimited by ",", and save to tokens. |
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
#include <cstdio> | |
#if defined(_CPPRTTI) | |
# define DIRECT_CPPRTTI_DEFINED "yes" | |
#else | |
# define DIRECT_CPPRTTI_DEFINED "no" | |
#endif | |
#define CPPRTTI_DEFINED defined(_CPPRTTI) | |
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/perl -w | |
# ---------------------------------------------------------------------------- | |
# $Date: 2007-10-29 18:15:53 +0800 (星期一, 29 十月 2007) $ | |
# $Rev: 408 $ | |
# $Author: jeffhung $ | |
# ---------------------------------------------------------------------------- | |
# revid: "@(#) $Id: dsw2dot.pl 408 2007-10-29 10:15:53Z jeffhung $" | |
# ---------------------------------------------------------------------------- | |
use strict; |
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
@ECHO OFF | |
REM -------------------------------------------------------------------------- | |
REM $Date: 2008-11-26 14:07:08 +0800 (??銝? 26 ????2008) $ | |
REM $Rev: 406 $ | |
REM $Author: jeffhung $ | |
REM -------------------------------------------------------------------------- | |
REM revid: "@(#) $Id: vc-build.bat 406 2008-11-26 06:07:08Z jeffhung $" | |
REM -------------------------------------------------------------------------- | |
IF "%1"=="" GOTO :USAGE |
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/perl -w | |
# --------------------------------------------------------------------------- | |
# wp2docbook.pl - Perl script to convert wordpress dump file to docbook XML | |
# files. | |
# Copyright (c) 2007-2009, Jeff Hung | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions | |
# are met: |
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/sh | |
# --------------------------------------------------------------------------- | |
# Copyright (c) 2010, Jeff Hung | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions | |
# are met: | |
# | |
# - Redistributions of source code must retain the above copyright |
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
# Do these once | |
/SET term_charset UTF-8 | |
/SET recode_transliterate ON | |
/SET recode_fallback Big5 | |
/SET recode_out_default_charset UTF-8 | |
/SET autolog_path ~/logs/irclog-$0/irclog.$1.$0.%Y%m.log | |
# Do these once per (irc) network | |
/NETWORK ADD -kicks 4 -msgs 1 -modes 4 -whois 1 freenode | |
/SERVER ADD -auto -network freenode irc.freenode.net |
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
/** | |
* The auto_buffer class acts as a buffer of @p T, but allocate statically or | |
* dynamically according to requested buffer size. If requested buffer size | |
* is greater than @p StaticBytes, auto_buffer will dynamically allocate | |
* required memory space for the buffer, instead of statically as a member | |
* array. | |
* | |
* Usually, dynamic allocation gets more overheads, but if requested size is | |
* too large, we may exceed stack limit too soon. So, a smarter strategy is | |
* to allocate statically if required size is small, and turn to dynamic |
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
--- Log opened Mon Aug 01 00:00:23 2011 | |
--- Day changed Wed Aug 03 2011 | |
[20110803T091729+0800]< sanyuan> w | |
--- Log closed Thu Aug 04 07:52:01 2011 | |
--- Log opened Thu Aug 04 07:52:07 2011 | |
[20110804T075207+0800]-!- Irssi: #coscup: Total of 27 nicks [3 ops, 0 halfops, 0 voices, 24 normal] | |
[20110804T075320+0800]-!- Irssi: Join to #coscup was synced in 77 secs | |
--- Day changed Mon Aug 08 2011 | |
[20110808T130743+0800]-!- kyu is now known as kengyu | |
--- Day changed Tue Aug 09 2011 |
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
Before you enjoy the log, please consider attending OSDC.tw Hackathon: | |
https://github.com/jeffhung/osdc-2012-hackathon | |
Feel free to join the event to have fun and meet people, even if you have no | |
idea what to hack yet. | |
--- Log opened Sat Apr 14 07:08:57 2012 | |
[20120414T073730+0800]< darkx> 大家早安 | |
[20120414T083658+0800]< miyagawa> which building is the venue? http://www.sinica.edu.tw/as/map/asmap_c.html |
OlderNewer