Skip to content

Instantly share code, notes, and snippets.

View spiderChow's full-sized avatar
🎯
Focusing

Junying Chou spiderChow

🎯
Focusing
View GitHub Profile
@spiderChow
spiderChow / sql_Chinese
Last active March 14, 2018 09:11
要支持中文需要utf8
1.
mysql> show variables LIKE 'char%';
mysql> show variables like 'collation%';
查看数据库默认的编码
发现有latin1,因为mysql是瑞典人写的啊
2.查看数据库编码
To set the default to UTF-8, you want to add the following to /etc/my.cnf
[client]
default-character-set=utf8
http://www.cnblogs.com/Ray-liang/p/4173923.html
# implement the static methods and class methods
# use the decorator@
class MyClass:
val1 = 'Value 1'
def __init__(self):
self.val2 = 'Value 2'
@staticmethod
def staticmd():
print '静态方法,无法访问val1和val2'
PYTHONPATH is used by the python interpreter to determine which modules to load.
PATH is used by the shell to determine which executables to run.

全局环境变量,对所有用户生效

  • /etc/profile: 此文件为系统的每个用户设置环境信息。 当用户登录时,该文件被执行一次,并从 /etc/profile.d 目录的配置文件中搜集shell 的设置。 一般用于设置所有用户使用的全局变量。
  • /etc/bashrc: 当 bash shell 被打开时,该文件被读取。
    也就是说,每次新打开一个终端 shell,该文件就会被读取。

接着是与上述两个文件对应,但只对单个用户生效:

  • ~/.bash_profile 或 ~/.profile: 只对单个用户生效,当用户登录时该文件仅执行一次。
1. 主体:实体
2. 理性与感性之间的关系:笛卡尔是理性主义
斯宾诺莎 ; 英国经验论
康德 : 对理性的范围进行限定
19世纪以后基本是在批评理性主义,从笛卡尔到黑格尔
3. 认识论: 主体与客体的关系
20世纪后谈存在论:我与世界和他人之间如何相处的关系
20世纪中叶:西方哲学发生转型:语言学转向
哲学问题主要通过对语言问题进行讨论展开:语言与其表达对象的问题。
20世纪70年代:心灵哲学:得益于神经科学脑科学
@spiderChow
spiderChow / reader.py
Last active December 15, 2017 07:59
use sklearn for text classfication
from sklearn import preprocessing
def reader(data_file):
"""
:param data_file: line1=raw sentence, line0=raw category line2=\n
:return: sens:List: raw sentence labels:List: label number labels_encoder:LabelEncoder() in sklearn
"""
with open(data_file) as f:
lines = f.readlines()
### pytorch version
def __rnn_pack_scan(self, sentence_embs, input_lengths, rnn, h0=None):
'''
sort the length and unsorted
:param sentence_embs: batch x seq_len x emb_size
:param input_lengths: batch
:param rnn: RNN
:param h0: (num_layers * num_directions, batch, hidden_size)
:return:
RTL:
一组register
data path
control logic
operation:
将reg里面的值改变
将一个reg的值放到另一个里面
R2<-R1 赋值
dialog
给定一问一答 post & response
似然为p(post,resp)
p(post,resp) = p(post) x p(resp|post)
训练: loss function = -logp(resp|post) [交叉熵 伯努利分布]
测试:使p(resp|post)最大的resp [post已经给定]
dialog & vae