Skip to content

Instantly share code, notes, and snippets.

View mingtsay's full-sized avatar
🇹🇼

Ming Tsay mingtsay

🇹🇼
View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
int *queue_new(int size)
{
int *queue = (int *)malloc(sizeof(int) * size);
int i;
for(i = 0; i < size; ++i)
{
@mingtsay
mingtsay / 101091715.txt
Last active December 10, 2015 13:58
班級: 917 座號: 15 姓名: 柯汶誼
班級: 917 座號: 15 姓名: 柯汶誼
開始回答前,請務必先將檔名改為101年級班級座號。
例如9年11班5號,請改檔名為101091105
並記得在每節下課前,將檔案傳回教師機指定的位置。
寫作說明:
1.本作業只接受純文字模式。
2.請使用中文及全形標點符號作答。(如,、。等等)
@mingtsay
mingtsay / d693.c
Last active December 12, 2015 03:38
GCD & LCM Reference
#include <stdio.h>
int gcd(int a, int b)
{
int m;
while(b)
{
m = b;
b = a % b;
a = m;
@mingtsay
mingtsay / roman.cpp
Last active December 18, 2015 22:48
#include <iostream>
#include <string>
#define N 7
using namespace std;
// 建立羅馬數字與十進位相對應的陣列資料
char roman[N] = {'M', 'D', 'C', 'L', 'X', 'V', 'I'};
int arabic[N] = {1000, 500, 100, 50, 10, 5, 1};
Office 2010 Professional Plus 正體中文
32位元:https://mega.co.nz/#!UF5EVCCa!Pk9DPCndWJk3Ho3bqXsHtEk1Ijd5yr7fHP6Pn54fgFk
64位元:https://mega.co.nz/#!dIgzCYKQ!T57WuG6NyoeLzsIB_eA3bAdU0EgDhQYyqAm2TK6qNe4
KMS破解:https://mega.co.nz/#!xF5xAbKa!AUQu8gO9NVzyzuZapqsPdVz3FSgkSIln-gxDiK9XXcE
破解教學:
1.執行 mini-KMS Activator
(Do you run the program as Administrator? [Yes])
2.安裝 KMService
//
// Include keys file
//
include "/etc/rndc.key";
// Declares control channels to be used by the rndc utility.
//
// It is recommended that 127.0.0.1 be the only address used.
// This also allows non-privileged users on the local host to manage
// your name server.
@mingtsay
mingtsay / oppose_cheat.js
Last active August 29, 2015 13:58 — forked from anonymous/oppose_cheat.js
Cheat script for www.oppose.tw
(function() {
$btnYes = $('.btn-yes')[0];
$btnNo = $('.btn-no' )[0];
$content = $('.show-content')[0];
function cheat() {
if (l = $content.innerHTML.length) {
l % 2 ? $btnNo.click() : $btnYes.click();
}
setTimeout(cheat);
@mingtsay
mingtsay / mcu_moodle_form.js
Last active August 29, 2015 14:01
for MCU Moodle form 5 stars and check all boxes
(function(d){
var f = d.getElementById("phpesp_response");
for (var i in f) {
if (f[i]) {
switch (f[i].type) {
case "radio":
if (f[i].value == 4) {
f[i].checked = true;
}
break;
setInterval(function () {
// 取得網頁上所有連結
var a = document.getElementsByTagName('a');
// 針對每個連結跑一次
for (var i in a) {
// 檢查是不是真的是連結
if (a.hasOwnProperty(i)) {
// 檢查是不是讚的連結
if (a[i].className == "UFILikeLink") {
// 檢查是不是還沒按過讚
Array.prototype.sayHi = function () {
var say = 'Hi, ' + this.join(', ') + '!';
window.alert(say);
}
var a = ['Bob', 'Alice', 'Emma'];
a.sayHi(); // this will alert: Hi, Bob, Alice, Emma!
for (var i in a) {
console.log(i, a.hasOwnProperty(i), a[i]);