Skip to content

Instantly share code, notes, and snippets.

View itszero's full-sized avatar

Zero Cho itszero

View GitHub Profile
@itszero
itszero / main.rb
Last active August 29, 2015 13:56 — forked from josephcc/main.rb
steps = 5
(1..steps)
.map { |x| (1..steps-1).map { |y| [x, y] } }
.flatten(1)
.select { |x, y| steps - x - y > 0 }
.group_by { |x, y| x }
.each do |x, sets|
sets.each do |x, y|
puts [x, y].inspect
#include <cstdio>
#include <cstdlib>
using namespace std;
char* md5(char* str)
{
char cmd[500];
sprintf(cmd, "echo -n \"%s\" | md5sum", str);
FILE *fd = popen(cmd, "r");
char *hash = (char*)malloc(sizeof(char) * 33);
Client 連線到 Server 後送出
Client => LOGIN [使用者名稱] [MD5編碼密碼](換行)
Server 收到後如果正確就會回傳
Server => LOGIN OK(換行)
如果失敗則回應
Server => LOGIN FAIL(換行)
範例:
Client => LOGIN itsZero 68e109f0f40ca72a15e05cc22786f8e6
Server => LOGIN OK
<!DOCTYPE html>
<html>
<head>
<title>eecesnmg - Wireless Guests Mangements</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link href="/main.css" media="screen" rel="stylesheet" type="text/css"/>
<link href="/print.css" media="print" rel="stylesheet" type="text/css"/>
<script src="/jquery.js" type="text/javascript"></script>
<script src="/jquery.editinplace.js" type="text/javascript"></script>
</head>
#!/usr/bin/ruby
dir = ARGV[0]
Dir.glob("#{dir}/*.zip").each do |f|
basename = File.basename(f, ".zip")
system "mkdir #{dir}/#{basename}"
system "unzip #{f} -d #{dir}/#{basename}"
arr = Dir.glob("#{dir}/#{basename}/*")
@itszero
itszero / VMPASyncCallbackListener.java
Created July 28, 2009 02:41
VMPServer 的參考原始碼
package tw.mpclab.VMP.Server;
import org.json.JSONObject;
public abstract class VMPASyncCallbackListener {
public abstract void onCallback(JSONObject obj);
public void onFinish() {
}
}
zeros-macbook-pro-2:ZRChromaHash Zero$ ls -R .
Debug ZRChromaHashColorAnimation.j
Info.plist ZRChromaHashTextField.j
Rakefile ZRChromaHashView.j
Release licenses
ZRChromaHash
./Debug:
ZRChromaHash
We couldn’t find that file to show.
We couldn’t find that file to show.
#include<iostream>
using namespace std;
void fun(int *array)
{
cout << *array << endl;
}
int main()
{