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
<?php | |
/* Program: Authenticate E-Mail for NCHU by POP3 | |
* Author: Jyun-Yao Huang (Allen, allen501pc@gmail.com) | |
* Date: 18th June, 2012 | |
*/ | |
list($user,$domain) = @explode("@",$_POST['email']); | |
//list($user,$domain) = @explode("@","your @mail.nchu.edu.tw here"); | |
$answer=""; | |
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
<?php | |
/* Function: ImageURLEncryption | |
* Parameters: | |
* $Url : the url or text that you want to encrypt. | |
* $Code: the magic code which masks the url. | |
*/ | |
function ImageURLEncryption($Url,$Code) | |
{ | |
$SecretCode = md5($Code); | |
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
<?php | |
$EncUrl = ImageURLEncryption("http://l.yimg.com/f/i/tw/hp/mh/09purple.gif","picture"); | |
/* 例如我要隱藏上面的圖片URL,透過Mask = "picture",來加密,因此$EncUrl輸出結果為 | |
aEB0RjpML1guTmkMZxdjDG0WZhtpFnQUL1BwHG1bLwA5RHVEcA9lGmdeZg== | |
*/ | |
/* 以下藉由demo_picture.php 來展示圖檔 */ | |
$Type = @$_GET['type']; | |
$ResourceID = @$_GET['resource_id']; |
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
/* Author: Allen (allen501pc@gamil.com) | |
* Date: 2012/04/18 18:30 | |
* Goal: 反轉委員表,把它轉換為 Name, Review No 1~Review No. n. | |
*/ | |
#include <iostream> | |
#include <fstream> | |
#include <string> | |
#include <iterator> | |
#include <map> |
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 <iostream> | |
using namespace std; | |
/* | |
* @Function: | |
template<typename T,size_t N> | |
void fnChange(T (&arr)[N]) | |
* @Brief: Let each element of array increase by one. | |
* @Input: 1D array | |
* @Output: The array whose elements all increase by 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
/* | |
* @Function: void fnPrintArray(int arr[10]) | |
* @Brief: Print the array content. | |
* @Input: int arr[10] | |
* @Output: array content. | |
*/ | |
void fnPrintArray(int arr[10]) | |
{ | |
for(size_t i=0;i<10;++i) | |
{ |
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
ConfigFile cf("config.txt"); | |
std::string foo; | |
std::string water; | |
double four; | |
foo = cf.Value("section_1","foo" ); | |
water = cf.Value("section_2","water"); | |
four = cf.Value("section_2","four" ); |
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
template<typename T> | |
class A{ | |
public: | |
T m_A; | |
void funcTest() | |
{ | |
map<T , int> mapTempTable; /* 這部分沒問題, OK! */ | |
/* 編譯器會出錯! | |
要改成 typename map<T, int>::iterator it; */ | |
map<T, int>::iterator it; |
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 <iostream> | |
using namespace std; | |
/* | |
* @Function: | |
template<typename T,size_t M,size_t N> | |
void fnPrint2DArray(T (&arr)[M][N]) | |
* @Brief: Print the content of 2D Array. | |
* @Input: 2D array. | |
* @Output: None. | |
*/ |
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
/* | |
* @Function: void fnPrintArray(int arr[10]) | |
* @Brief: Print the array content , and the input is by reference. | |
* @Input: int arr[10] | |
* @Output: array content. | |
*/ | |
void fnPrintArray(int (&arr)[10]) | |
{ | |
for(size_t i=0;i<10;++i) | |
{ |