Skip to content

Instantly share code, notes, and snippets.

@BeMg
BeMg / tset.md
Created December 12, 2017 10:01
backup

Ubuntu: fcitx + chewing 新酷音輸入法

fcitx 輸入法架構比預設的 ibus 穩定許多。

  1. 安裝 fcitx (框架) 以及 fcitx-chewing (框架下的新酷音輸入法):

     sudo apt-get install fcitx fcitx-chewing
    
  2. 設為預設輸入法架構: System Settings > Language Support > Language Tab > Keyboard input method system: set to fcitx

  3. 讓每個程式獨立維持輸入法狀態: System Settings > Keyboard > Typing Tab > Click on Text Entry > Select Allow different sources for each application

@BeMg
BeMg / main.cc
Last active November 2, 2017 03:22
getCount
#include <bits/stdc++.h>
using namespace std;
const int MAX_HASH = 100000000;
bool cmp(pair<string, int> a, pair<string, int> b) {
return a.second > b.second;
}
@BeMg
BeMg / chinese.md
Last active October 18, 2017 14:16
Statement of purpose

進修計劃書

在大學期間的選修課程選擇,令我廣泛的接觸了多個不同的資訊研究領域。在這其中,我對於電腦視覺與圖形識別的發展特別有興趣,接下來也打算朝著這個方面進行探索,期許自己可以在進入研究所前,有更明確的研究方向。

短程- 進入研究所前

在取得入學許可之後,會盡速與相關實驗室進行聯絡,尋求意見與協助,以利未來入學做準備。並且複習電腦科學的基本課程,重新溫習一些重要的概念,不忘記基本的準則,為此後的研究進行準備。準備複習的內容為下表:

  • 線性代數
  • 離散數學
@BeMg
BeMg / Sort2cmp.py
Last active September 28, 2017 05:36
Sort result to fixed order
import sys
def getList(filename):
r = list()
with open(filename, 'r') as f:
for line in f:
line = line.replace(' ', '')
line = line.replace('\n', '')
@BeMg
BeMg / getData.py
Created September 25, 2017 13:31
Wiki Download
# coding=utf-8
import requests
from bs4 import BeautifulSoup
host = 'https://zh.wikipedia.org'
term = open('term.txt', 'w')
doc = open('doc.txt', 'w')
import cv2
import pickle
import os
from utils import draw
import numpy as np
curr_path = os.getcwd()
Train_path = curr_path+'/WIDER_train/images'
H = 64

Line Sticker Downloader

Download Sticker from Line store sample

Dependency

  • requests

Usage

@BeMg
BeMg / 2010_1.m
Last active June 14, 2017 05:47
NA final
function c = curvefit(x, y)
u = x.*y;
v = [x ones(size(x))];
coef = inv(v'*v)*v'*u;
c(1) = coef(2);
c(2) = coef(1);
c = c';
end
# coding: utf-8
# In[1]:
import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
set_session(tf.Session(config=config))
# coding: utf-8
# In[1]:
import os
import csv
path = os.getcwd()