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
# 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
#!/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
#!/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
@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 | |
# ---------------------------------------------------------------------------- | |
# $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
#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
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. |
NewerOlder