Skip to content

Instantly share code, notes, and snippets.

View dspp779's full-sized avatar

Jhih-Jie Chen dspp779

View GitHub Profile
@dspp779
dspp779 / zinit.zshrc
Last active December 27, 2023 09:39
### Added by Zinit's installer
if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit"
command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \
print -P "%F{33} %F{34}Installation successful.%f%b" || \
print -P "%F{160} The clone has failed.%f%b"
fi
source "$HOME/.local/share/zinit/zinit.git/zinit.zsh"
@dspp779
dspp779 / movie_review_sentiment.ipynb
Created April 10, 2017 16:01
Text classification with SVM example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dspp779
dspp779 / Practice170221-python basic.ipynb
Created February 20, 2017 06:29
Text mining week2 practice 20170221
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dspp779
dspp779 / Practice161020.ipynb
Last active October 30, 2016 02:31
Practice for khub
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
require 'yaml'
require 'csv'
if ARGV.size == 2
data = YAML.load_file(ARGV[0])
CSV.open(ARGV[1], 'wb', col_sep: '\t') do |csv|
csv << data.first.keys
data.to_a.each { |item| csv << item.values }
end
else
require 'csv'
require 'yaml'
def read_tsv(filepath)
table = CSV.read(filepath, col_sep: "\t", headers: true)
table.map(&:to_h)
end
if ARGV.size == 2
data = read_tsv ARGV[0]