RSS
 

Archive for September, 2011

Summary of Last Week’s Work

12 Sep

1. When I use FCKeditor and use its ‘upload image’ function, it just reset all of the explorer’s session values in the process! I have to find out how this plugin acts, and figure out a solution.

2. I am just rewrite all the lib files of FCKeditor’s php demo into rails ones. It is just not completed.

3. The output of decoding for string of store information in the section of sending short message to customer is wrong. The possible cause is the incorrect database encoding. I now leave the problem for Mr. He. He will try to swift the encoding to GBK instead of Utf-8. If it works… it’s really lucky! Or I will not know what to do.

 
No Comments

Posted in 工作

 

闭关的决定

12 Sep

因为今天没有拿到专四成绩单所以受了刺激。

网上说应该是九月上旬出分数,不过下周就要九月中旬了,所以心情不好,决定闭关

算是半开半闭区间……闭关内计划:

1、复习专八考试:可能看时间许可就去读冲刺班,今天同学也提到了,也可能去请老师,大家一起。平时一方面巩固日常语法,提高词汇量,多听听力,多写东西(欢迎为我的狗屁不通纠错),然后是人文方面的东西因为比较没方向,可能也会买书去做。

2、减肥:我一直很强调我的减肥目标是不要浪费任何一条裤子,所以你们懂的。

3、学习德语:以前没有学过二外,学了德语以后觉得学语言其实很欢乐,有点后悔本科时候没有去学。目标是把上下册教材弄熟弄通,然后看些课外的东西。我觉得代词形容词动词包括句法都是比较有规律的东西,只有狗屁的名词的阴阳性我TMD背不出来,反正目前只求看过眼能猜出来。

4、游戏组:跟H一起做游戏,据说RPGMaker其实很简单,目前还未研究。

5、番组计划:我可能只看PMBW了。其他都留档以后看。

取消或推延的计划:

1、新年卡片

2、埋坑

3、手工制作

 
No Comments

Posted in 日常

 

用ruby写了转txt编码的程序。gbk-》utf8

12 Sep
#!/usr/bin/env ruby
#require 'rubygems'
#require 'active_record'
require 'iconv'

input_path = 'input/'
output_path = 'output/'
if !File.directory? input_path
  path = File.expand_path(input_path)
  Dir.mkdir(input_path)
end
if !File.directory? output_path
  path = File.expand_path(output_path)
  Dir.mkdir(output_path)
end

docs = Dir.glob(input_path + '*')
#puts docs.inspect
for doc in docs do
  puts doc
  if File.file? doc
    puts 'in here'
    report = ''
    report_utf8 = ''
    File.open( doc,'r') do |f|
      report = f.read
    end
    begin
      puts 'start!'

      #name = File.split(path)[1]
      filename = output_path + File.basename(doc)
      puts filename

      #begin
      #  conv = Iconv.new("GBK", "utf-8")
      #  report_utf8 = conv.iconv(report)
      #rescue
      #end
      begin
        conv = Iconv.new("utf-8", "GBK")
        report_utf8 = conv.iconv(report)
      rescue
        puts File.basename(doc) + ' error'
      end
      puts 'ok'

      if report_utf8 && report_utf8 != ''
        if File.file?(filename)
          File.delete(filename)
        end

        File.open( filename, 'w') do |f|
          f.write report_utf8
        end
      end
    rescue
    end
  end
end
 
No Comments

Posted in 工作