春天的夜晚,没有嚣张的虫唱,和三五知已围坐畅谈。
夏天的上午,水面是锦鳞银光,纵舟扬帆接连天海。
秋天的晨光,满树的七彩缤纷,备好行囊驾车穿越山林云花。
冬天的黄昏,温柔一地的初雪,碎玉乱金的湖边轻歌漫唱。

rime macos下使用五笔

一直习惯用rime,无论是Linux下还是Windows上都在使用。
现在切换到macos上,忽然发现在缺省安装的rime居然没有五笔选项。
到~/Library/Rime下查看,发现连熟悉的wubi_pinyin_schema.yaml都没有。
google/baidu了几遍,发现都没有怎么做的方案。

后来在:有没有写一个鼠须管输入法mac下如何设置五笔的教程里提到:

# 在 ~/Library/Rime 下建立 default.custom.yaml,输入如下内容,然后在菜单栏点「重新部署」 patch: schema_list: – schema: wubi86

在default.yaml里的schema_list加入
-schema:wubi_pinyin
然后在输入法里重新布署,发现一切都好了,连~/Library/Rime里的文件都有了。

不过为什么要费这个事呢?我感觉智商有点不足了。

python numpy/matplotlib绘制生物节律曲线

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg

import datetime
import math

def daysnow(birthdate):
return (datetime.date.today() – birthdate).days

def clockwise(days, p):
return math.sin(2*math.pi *(days % p) / p)

def clockwise_2(date, birthdate, p):
return math.sin(2*math.pi*((date – birthdate).days % p) / p)

base = datetime.date.today()
birthdate = datetime.date(年, 月, 日)
datelist = [base + datetime.timedelta(days=x) for x in range(-15, 15)]

dla = np.array(datelist)
dlb = np.array([clockwise_2(x, birthdate, 23) for x in datelist])
dlc = np.array([clockwise_2(x, birthdate, 28) for x in datelist])
dld = np.array([clockwise_2(x, birthdate, 33) for x in datelist])

plt.plot(dla, dlb, dla, dlc, dla, dld)
plt.show()

java/ruby unzip

http://www.java2s.com/Tutorial/Java/0180__File/UnzipusingtheZipInputStream.htm

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

public class MainClass {

public static void main(String[] args) throws IOException {

for (int i = 0; i < args.length; i++) { FileInputStream fin = new FileInputStream(args[i]); ZipInputStream zin = new ZipInputStream(fin); ZipEntry ze = null; while ((ze = zin.getNextEntry()) != null) { System.out.println("Unzipping " + ze.getName()); FileOutputStream fout = new FileOutputStream(ze.getName()); for (int c = zin.read(); c != -1; c = zin.read()) { fout.write(c); } zin.closeEntry(); fout.close(); } zin.close(); } } } http://www.kodejava.org/examples/334.html package org.kodejava.example.util.zip; import java.io.*; import java.util.zip.ZipInputStream; import java.util.zip.ZipEntry; public class UnzipDemo { public static void main(String[] args) { String zipname = "data.zip"; try { FileInputStream fis = new FileInputStream(zipname); ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fis)); ZipEntry entry; // // Read each entry from the ZipInputStream until no more entry found // indicated by a null return value of the getNextEntry() method. // while ((entry = zis.getNextEntry()) != null) { System.out.println("Unzipping: " + entry.getName()); int size; byte[] buffer = new byte[2048]; FileOutputStream fos = new FileOutputStream(entry.getName()); BufferedOutputStream bos = new BufferedOutputStream(fos, buffer.length); while ((size = zis.read(buffer, 0, buffer.length)) != -1) { bos.write(buffer, 0, size); } bos.flush(); bos.close(); } zis.close(); fis.close(); } catch (IOException e) { e.printStackTrace(); } } } http://www.markhneedham.com/blog/2008/10/02/ruby-unzipping-a-file-using-rubyzip/ require 'rubygems' require 'zip/zip' def unzip_file (file, destination) Zip::ZipFile.open(file) { |zip_file| zip_file.each { |f| f_path=File.join(destination, f.name) FileUtils.mkdir_p(File.dirname(f_path)) zip_file.extract(f, f_path) unless File.exist?(f_path) } } http://stackoverflow.com/questions/856891/unzip-zip-tar-tag-gz-files-with-ruby http://www.anyang-window.com.cn/tag/ava-zip/page/3/ http://www.iteye.com/topic/626705

+++仿佛轻云应笑我–相携水岸弄朝霞–此生只为听天籁–坐拥书城看落花+++