Skip to content

Instantly share code, notes, and snippets.

@itsPG
itsPG / gist:6107334
Last active December 20, 2015 09:19
10問
■問題01
Q.私がスマフォを捨てた理由は?
◇古いから
◇趣味に合わないから
V◇嫌な思い出が染みついているから
■問題02
Q.私たちが同棲してから、何週間って言った?
#!/usr/bin/perl
open(fin,"/var/log/PG_err_try.log");
@q = <fin>;
my %table;
for(@q)
{
if($_ =~ /Ban ([0-9\.]+)/)
{
$table{$1}++;
}
@itsPG
itsPG / flower.cpp
Created August 28, 2013 08:52
by PG @ SENSE Lab
#include <iostream>
#include <algorithm>
using namespace std;
int flower[] = {1,2,3,4,5,6,7,8};
bool check_pick()
{
for (int i = 3; i < 8; i++)
if (flower[i] > flower[0] && flower[i] > flower[1] && flower[i] > flower[2])
return flower[i] == 8;
@itsPG
itsPG / os3.cpp
Created October 7, 2013 06:41
os hw3 sol ? I'm not sure it is the solution or not.
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
@itsPG
itsPG / adjust.js
Created January 3, 2014 19:00
PG's auto img adjuster
// ==UserScript==
// @name PG's auto img adjuster
// @namespace http://itsPG.org
// @version 0.1
// @description
// @match http://*/*
// @copyright 2014, PG
// ==/UserScript==
PG_jQuery_loader = {};
PG_jQuery_loader.getScript = function(filename)
@itsPG
itsPG / arena.cpp
Last active January 4, 2016 09:28
/*
勝率70%的話,打競技場十勝以上的機率是25%左右,12勝機率是16%
拿實況主hcm的戰績來驗證一下想法
改版後參加競技場次數:73, win:497, lose:209, 勝率70.5%
十勝以上次數:19次,12勝次數:8次
按照機率算:
參加次數73次的話,約有18.25次可以拿到十勝以上,11.68次可以拿到12勝
而實際次數分別是19次以及8次
不可否認勝率打到後面會越來越低因此12勝的機率會比預測的少
@itsPG
itsPG / gist:8858692
Last active November 10, 2018 16:02

畢業出清 全部半價以下出清 大約是2.5折~4.x折的價格 剛考完的N2成績單:http://i.imgur.com/ELD8Nss.png

1.考上日檢N3的文法筆記本 原290 考上日檢N3的單字筆記本 原290 全新未用 原價580 售 250

2.考上日檢N2的文法筆記本 原290

@itsPG
itsPG / md5.js
Last active August 29, 2015 14:00
/*
md5.js
Original version from Joseph Myers' implementation.
Modified by PG Tsai @ Synology Inc.
The original version is implemented by Joseph Myers.
You may download it from http://www.myersdaily.org/joseph/javascript/md5-text.html
I only made some modification to make it more appropriate for the general use.
(My modification is ) released under the MIT license.
Maxtor 120G (已有壞軌)
Maxtor 120G
Hitachi 200G
WD 500G
Seagate 320G
Hitachi 320G
WD 640G
Seagate 500G (家用)
WD 1T (已有壞軌)
Hitachi 1T
# Python OAuth example
import evernote.edam.userstore.constants as UserStoreConstants
import evernote.edam.type.ttypes as Types
from evernote.api.client import EvernoteClient
##
# Helper function to turn query string parameters into a
# Python dictionary
##