跳至主要内容

博文

目前显示的是 二月, 2017的博文

Seven Languages in Seven Weeks

This morning, after 10 minutes struggle of do or do not follow the self study section. Just spend several hours of searching, coding and debugging, finally I got the following ruby script that is able to pass the self study excise. diff -r 9efeca9bd507 learning/ruby/acts_as_csv_module.rb --- a/learning/ruby/acts_as_csv_module.rb Tue Feb 07 15:13:11 2017 +0800 +++ b/learning/ruby/acts_as_csv_module.rb Tue Feb 07 15:13:49 2017 +0800 @@ -1,32 +1,90 @@ module ActsAsCsv + def self.included(base) base.extend ClassMethods end + module ClassMethods + def acts_as_csv include InstanceMethods end + + def acts_as_enumerable + include Enumerable + end end + module InstanceMethods + def read @csv_contents = [] filename = self.class.to_s.downcase + '.txt' file = File.new(filename) - @headers = file.gets.chomp.split(', ' ) + CsvRow.headers = file.gets.chomp.spl

Joke or Joker?

It’s been for a long time no learning, or maybe not able to learn any new technical skills since I got the job with the industry. It feels like I am always busy working and have no time to sit down for learning. I’ve been always feel myself in rush mode and just can’t stop rushing and working. Just like a battery which recharged for its duty, and once discharge is begun it will not have a chance to be removed from its position for another round of recharging. Time to prove the thing is false feeling. In the meantime, let’s first finish The reading and practice of ‘seven languages in seven weeks’ The ‘real world Haskell’ which last for too long already. Set a small target to earn a million.

DSS 不能用啦!

ssh-dss key not in PubkeyAcceptedKeyTypes 忙里偷闲鼓捣自建基于 Jekyll 的blog,发现无论如何都不能在心爱的linux里面通过ssh clone新创建的 git repository。 提示如下: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 遂坠入无限ssh检查中无法自拔: ssh-add -l 显示 ssh-keyagent 内容无碍 ssh-keygen -l -f 显示各个key的finger print 看不出错误 进入windows通过 git bash clone 失败,遂发现 windows 中 plink 太久未用,已经生锈。不认识 github 的 host key。用 putty github.com 弹出的新host key 对话框确认了事。 windows下终于clone成功。 再次尝试将 windows 下的ppk导出为openssh格式,遂发现几年前曾经有一份导出的 key 躺在那里…… 各种折腾之后拷贝的key诺到了linux中,以为万事大吉,结果,结果,结果虽然 diff -u 显示新来的 key 是新的,但是 ssh-keygen -l -f 说他们两个是一样的…… 无奈出下下策 ssh -vvvv git@github.com ,一阵垃圾滚屏过后终于发现 debug1: Skipping ssh-dss key /home/fktpp/.ssh/fktpp.openssh - not in PubkeyAcceptedKeyTypes Google 说 (keyword: Skipping ssh-dss key not in PubkeyAcceptedKeyTypes) stackexchange: ssh keeps skipping my pubkey and asking for a password The new openssh version (7.0+) deprecat