This file contains hidden or 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
import java.io.IOException; | |
import java.util.*; | |
import org.apache.hadoop.fs.Path; | |
import org.apache.hadoop.conf.*; | |
import org.apache.hadoop.io.*; | |
import org.apache.hadoop.io.Writable; | |
import org.apache.hadoop.mapred.*; | |
import org.apache.hadoop.util.*; | |
import java.io.DataInput; |
This file contains hidden or 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
import java.io.IOException; | |
import java.util.*; | |
import org.apache.hadoop.fs.Path; | |
import org.apache.hadoop.conf.*; | |
import org.apache.hadoop.io.*; | |
import org.apache.hadoop.io.Writable; | |
import org.apache.hadoop.mapred.*; | |
import org.apache.hadoop.util.*; | |
import java.io.DataInput; |
This file contains hidden or 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; | |
/* 總金額 */ | |
#define _SUM_OF_DOLLARS 20800 | |
/* Dollars of Item 1. */ | |
#define _ITEM_1 170 | |
/* Dollars of Item 2. */ | |
#define _ITEM_2 870 | |
int main(int argc, char * argv[]) |
This file contains hidden or 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
/* | |
* Program Description: | |
* Count the input data character frequence, and store the characters which are composed with 'A-Z' or 'a-z'. | |
* And output the character and respective frequency. Note that the characters 'A-Z' and 'a-z' are the same. | |
* For example, | |
* Input: | |
* This is a text for Q2. | |
* My cellphone number is 123-456-789. | |
* E-mail: [email protected] | |
Output: |
This file contains hidden or 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
/* | |
Ex: Given | |
10 | |
1 2 3 4 5 8 4 3 2 1 | |
Note that the first line is the counts of numbers in the second lines. | |
Then, we can find that the max_seq = '1 2 3 4 5 4 3 2 1', whose length = 9. | |
*/ | |
#include <iostream> |
This file contains hidden or 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
/* Program: Find the character substring location of the input character string. | |
* Author: Jyun-Yao Huang ([email protected]) | |
* License: Free | |
*/ | |
#include <iostream> | |
#include <bitset> | |
#include <string> | |
#include <set> | |
#include <vector> |
This file contains hidden or 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 | |
include("class.phpmailer.php"); // 匯入PHPMailer library | |
$mail= new PHPMailer(); //建立新物件 | |
$mail->IsSMTP(); //設定使用SMTP方式寄信 | |
$mail->SMTPAuth = true; //設定SMTP需要驗證 | |
$mail->SMTPSecure = "ssl"; // Gmail的SMTP主機需要使用SSL連線 | |
$mail->Host = "smtp.gmail.com"; //Gamil的SMTP主機 | |
$mail->Port = 465; //Gamil的SMTP主機的SMTP埠位為465埠。 | |
$mail->CharSet = "utf-8"; //設定郵件編碼,預設UTF-8 |
This file contains hidden or 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
$.ajax({ | |
type: "POST", /* 選擇傳輸方式 */ | |
url: "/person/create", /*選擇要處理的controller/action */ | |
dataType: "json", /*選擇資料類型,以本篇文章,資料類型為json */ | |
contentType: "application/json; charset=utf-8", /* 選擇傳輸的encoding以及媒體類型 */ | |
data: jsonData, /* data欄位填入json包好的資料就行了!以這個為例,jsonData是該篇文章的一個物件 */ | |
success: function (result){ /* 成功了要做什麼動作? */ | |
console.log(result); //log to the console to see whether it worked | |
}, | |
error: function (error){ /* 失敗了要做什麼動作? */ |
This file contains hidden or 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
/* 要使用 ConfigurationManager,需引入System.Configuration 這個namespace */ | |
using System.Configuration; | |
/* 程式碼區 */ | |
[HttpPost] | |
public ActionResult Upload(HttpPostedFileBase file) | |
{ | |
//檢查是否有檔案上傳,有的話存檔 | |
if (file !=null && file.ContentLength > 0) |
This file contains hidden or 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) | |
{ |