Monday, December 31, 2012

2013

还有2个多小时就是2013年,自从成家有了小孩以后,时间总是过得飞快,眨眼小孩就会走,会跑,会说话,现在会提出自己的要求。回顾过去的一年,下班回家的时间基本上全部贡献给了小孩,看着孩子成长,懂得的东西日渐增多,懂得讲道理,懂得心疼爸爸妈妈。心里觉得时间画得特别值。

回顾2012年,事业上的变化就是我和老婆都换了新工作,两个人的新工作都比原来好,时间也比原来自由。

个人技能提升就是学习了Golang,Google的新的系统级的编程语言,语法跟C相似,不过比C多了一些高级功能,因为自己做嵌入式工作,主要编程语言是C,之前有学习Python作为平时的工具语言。Go结合了C和Python的优点,用来写一些小工具可以很快就搞定。

家庭的变化就是怀上了蛇宝宝,明年家里更加热闹了。

2013年,新的一年,列一下目标:
1. 学习绘画,铅笔画,或者在电脑上,总之要学习绘画。目标就是人物画像要到一个水平,自己已经申请了另外一个bloger账户,准备专门用来放自己的作品,跟踪自己的进步。
2. 学习游戏开发,用ActionScript来开发游戏,这个也就顺带要求学习ActionScript了,学习绘画也是因为觉得开发游戏是需要一些CG的基础的
3. 继续坚持上下班的时候在地铁上读书,自从买了Kindle后,自己的读书量的确增长不少,不管是技术类的书,还是小说,只要是在读书。

游戏开发

没有开发过游戏,想学习一下游戏开发。第一步当然是要确定选择什么开发平台,在网上做了一番搜索,因为自己初学,当然是先搞好2D的游戏开发,所以搜索范围就放在比较流行的一些2D游戏平台上。
因为现在手机OS有好几种,选择游戏开发平台的时候,首要就应该是要能够跨平台,我觉得这个对于我来讲是很重要的一个要求,还有一个要求就是免费。

初步筛选,比较中意的有3个平台

1. Starling-Framwork
优点:
  • 这个平台依靠Adobe AIR, 跨平台,很大的优点,支持桌面开发,网页开发和主流的移动平台Android,iOS,BlackBerry
  • 用ActionScript开发,开发起来速度会比较快,结合Adobe Flash,Adobe Ilustrator可以让游戏中的CG部分变得轻松一些。
  • Starling因为有GPU加速,速度方面不是问题
  • 跟着FlashBuilder 4.7推出的Scout能够帮助profile游戏运行的瓶颈
  • 新加入的worker引入了多线程操作,为游戏开发加分不少
  • 能很好的和流行的物理引擎结合(比如Box2D)
缺点:
  • ActionScript,需要学习多一门语言
  • 依靠Adobe AIR,发布的时候如果带上runtime,包会比较大。
  • 免费开发软件不是很多(FlashDevelop, FDT)
2. libGdx
JAVA开发,跨平台,对于iOS的支持还没有完成, 底层用Native code写,速度没问题

3. PhoneGap
基于HTML,JavaScript, CSS开发,真正的跨平台。最大的问题可能是速度
这个应该是以后APP的趋势吧

因为我自己有Adobe FlashBuilder 4.7 Standard的license,因为自己还是一个入门级的游戏开发人员,所以我选择Starling作为自己现在的起步开发平台。当熟悉游戏开发中的方方面面后,我或许会选择别的平台,不过那是以后的事情了。


Reference:

Thursday, October 25, 2012

给我的Sony Ericsson Arc S换成AOKP ROM Build 4

之所以要换ROM,是因为Sony Ericsson的ROM有点站空间,很多自带的APP我用不着也不让卸载,而Arc S的内置空间才只有可怜的400MB左右。每天都看到好几个update error的信息,因为空间不够。

这里把安装过程简单记下来,因为我走了一些弯路,所以想给那些要跟我一样换ROM的朋友一些帮助。

第一步,下载需要的软件,我用到了Android SDK (因为有些用到的工具里面会依赖adb,而工具包里面的adb又太旧了,所以要下载最新的adb来替代工具包里面的adb),flashtoolDooMLoRD_v1_Xperia-2011-ICS-ROOT-emu-busybox-su.zip(要用前面下载的SDK里面的adb和dll替换这个包里面的adb和dll,否则出出现“adb server is out of date, killing …”),ROM和Google Apps

第二步,解锁boot loader,具体步骤参考: http://unlockbootloader.sonymobile.com/instructions, 因为我不知道有这一步,所以浪费了很多时间摸索。

第三部,Root Device,做了第一步以后,这步就比较简单,参考 :http://talk.sonymobile.com/thread/41119?start=0&tstart=0 这个讲的一步一步,照着做就行了。如果需要安装driver,就运行C:\flashtool\drivers\Flashtool-drivers.exe来安装

第四部,备份,安装AOKP包,具体步骤参考:http://www.androidgadgematic.com/2012/09/install-android-41-jelly-bean-cm10-sony.html  这个里面讲的是安装CM10,不过同样适用于安装AOKP。

Tuesday, October 9, 2012

Install Android CM9 On HP TouchPad

I have bought HP Touchpad for more than 1 year, but I only use it in the first one month after bought it. Last week when I read the news about HP released Open WebOS 1.0, I suddently come out the idea to load my TouchPad with Android CM9 (since CM10 is not very usable at moment).

Reference Instruction Page: http://liliputing.com/2012/01/how-to-install-android-4-0-on-the-hp-touchpad-cyanogenmod-9-alpha.html

Steps:
1. Download all necessary files
* ACMEInstaller3 : http://goo.im/devs/jcsullins/cmtouchpad/tools
* moboot_0.3.5.zip : http://code.google.com/p/moboot/downloads/list
* UniversalNovacomInstaller-1.3.jar : https://code.google.com/p/universal-novacom-installer/downloads/list
* gapps-ics-20120429-signed.zip : http://goo.im/gapps/
* cm-9-20121007-NIGHTLY-tenderloin.zip : http://download.cyanogenmod.com/?type=nightly&device=tenderloin
* update-cwm_tenderloin-1012.zip : http://goo.im/devs/jcsullins/cmtouchpad/recovery

2. Install UniversalNovacomInstaller, it will be installed in to c:\Program Files\Palm, Inc

3. Place ACMEInstaller3 into same folder as UniversalNovacomInstaller, which is c:\Program Files\Palm, Inc

4. Connect TouchPad to PC, enable USB mass storage mode

5. Make new folder in root of Touchpad storage, folder name "cminstall"

6. Copy files into "cminstall"
* update-cm-9-20121007-NIGHTLY-tenderloin.zip (renamed, name must start with "update-")
* moboot_0.3.5.zip
* update-cwm_tenderloin-1012.zip
* gapps-ics-20120429-signed.zip

7. Reset Device (Setting -> Device Info -> Reset -> Restart)

8. As soon as the screen goes dark, press and hold the volume button, release the button when you see bit USB icon.

9. Wait for computer to install driver

10. Open cmd line, cd into c:\Program Files\Palm, Inc

11. Run ACMEInstaller3, “novacom.exe boot mem:// < ACMEInstaller3″

The whole installation process is very smooth. But I do encountered two problems for this Cm9 installation.

First issue is installation of google apps, ACMEInstaller3 didn't install gapps, so I must boot into ClockworkMod to instll zip from SD card.

Second issue is from Google Play Store, after I added Gmail account, gmail can sync, but when I run Play store, it always gave "Server Error" message. What I did is to run Google Talk and login, run Google Calendar and refesh to sync. After that, magically I was able to connect to play store.

Strange behavior.

Anyway, now I got a nice working (except camera) Android tablet to play with.

Wednesday, September 19, 2012

计算两个日期间隔,用X年X月X日表示

自己用golang写了一个短代码用来计算两个日期间隔,间隔用X年X月X日表示出来,比如2010-07-19到2012-09-18的间隔就是2年1月30天。写这个程序是用来具体算小孩的年龄,闰年也有考虑在内,比如 2010-07-19到2012-03-18是1年7个月28天,因为2012年2月有29天。

package main

import (
    "flag"
    "fmt"
    "os"
    "strconv"
    "strings"
    "time"
)

type DateDiff struct {
    years, months, days int
}

var DAYS = map[time.Month]int{
    time.January:   31,
    time.February:  28,
    time.March:     31,
    time.April:     30,
    time.May:       31,
    time.June:      30,
    time.July:      31,
    time.August:    31,
    time.September: 30,
    time.October:   31,
    time.November:  30,
    time.December:  31,
}

func LeapYear(year int) bool {
    ret := false
    if year%4 == 0 {
        if year%100 != 0 {
            ret = true
        } else if year%400 == 0 {
            ret = true
        }
    }
    return ret
}

// passed in strings hould be in either of the following two format:
//    yyyy-mm-dd
//    yyyy/mm/dd
func ParseDate(s string) time.Time {
    var it []string
    if strings.Index(s, "-") > 0 {
        it = strings.Split(s, "-")
    } else if strings.Index(s, "/") > 0 {
        it = strings.Split(s, "/")
    } else {
        fmt.Printf("Error: wrong date format\n")
        flag.Usage()
        os.Exit(-1)
    }
    y, err := strconv.ParseInt(it[0], 10, 64)
    if err != nil {
        panic(err)
    }
    m, err := strconv.ParseInt(it[1], 10, 64)
    if err != nil {
        panic(err)
    }
    d, err := strconv.ParseInt(it[2], 10, 64)
    if err != nil {
        panic(err)
    }
    return time.Date(int(y), time.Month(int(m)), int(d), 0, 0, 0, 0, time.UTC)
}

func main() {
    var ds, de string
    flag.StringVar(&ds, "start", "", "[*]Start Date in format of yyyy/mm/dd or yyyy-mm-dd")
    flag.StringVar(&de, "end", "today", "End Date in format of yyyy/mm/dd or yyyy-mm-dd")
    flag.Parse()
    if ds == "" {
        fmt.Printf("Error: No start date is specified\n")
        flag.Usage()
        os.Exit(-1)
    }

    var start, end time.Time
    start = ParseDate(ds)
    if de == "today" {
        end = time.Now()
    } else {
        end = ParseDate(de)
    }

    var diff DateDiff
    var borrowed bool = false
    var daysBorrowed int = 0
    // Days difference
    if end.Day() >= start.Day() {
        diff.days = end.Day() - start.Day()
    } else {
        daysBorrowed = DAYS[end.Month()-1]
        if LeapYear(end.Year()) && end.Month() == time.March {
            daysBorrowed++ // February in leap year is 29 days
        }
        diff.days = end.Day() + daysBorrowed - start.Day()
        borrowed = true
    }

    // Month Difference
    endMonth := end.Month()
    if borrowed == true {
        if endMonth == time.January {
            endMonth = time.December
        } else {
            endMonth--
        }
        borrowed = false
    }
    if endMonth >= start.Month() {
        diff.months = int(endMonth) - int(start.Month())
    } else {
        diff.months = int(endMonth) + 12 - int(start.Month())
        borrowed = true
    }

    // Year difference
    if borrowed {
        diff.years = end.Year() - 1 - start.Year()
    } else {
        diff.years = end.Year() - start.Year()
    }

    // Output
    if diff.years < 0 || diff.months < 0 || diff.days < 0 {
        fmt.Printf("Error: end date should after start date\n")
    } else {
        fmt.Printf("Difference of %d Years %d Months %d Days\n", diff.years, diff.months, diff.days)
    }
}

Friday, August 24, 2012

用golang生成key不是大写的json数据

前一段时间用go写了一个查看perforce的history的小程序,go没有什么成熟的ui包,所以我选用web界面,程序本身做两件事情,一个后台更新perforce的history到本地的sqlite数据库,另外一个后台当作web服务器,处理client的request,生成json数据。

在写这个程序的时候,发现要生成json数据的结构里field名字首字母要大写。因为是一个自己用的小程序,也没有去深究到底可不可以生成首字母是小写的json数据。今天逛stackoverflow的时候看到有人问这个问题,看了看,原来go的json包有解决办法,只是自己看文档的时候没有怎么注意罢了。要加tag来做这件事情。

下面这段示例代码就的output:

{"field_a":1234,"field_b":"hello"}

package main

import "fmt"
import "encoding/json"

func main() {
    type Test struct {
        A int `json:"field_a"`
        B string `json:"field_b"`
    }
    A := Test{1234, "hello"}

    b, _ := json.Marshal(A)
    fmt.Println(string(b))
}

Thursday, August 23, 2012

个人第一个github项目

今天终于在github上有了一个真正的自己的项目,虽然是一个很简单,很小的项目,不过还是值得纪念一下。

项目地址: https://github.com/yongzhy/goploticus

这个是libploticus的Go语言封装。

ploticus的主页

A free, GPL, non-interactive software package for producing plots, charts, and graphics from data. It was developed in a Unix/C environment and runs onvarious Unix, Linux, and win32 systems. ploticus is good for automated or just-in-time graph generation, handles date and time data nicely, and has basic statistical capabilities. It allows significant user control over colors, styles, options and details. Ploticus is a mature package, available since 1999, and version 2.40 has more than 12,000 downloads to date. Ploticus was discussed in this 2008 review on Linux.com.

因为是第一次封装C的API,折腾了一阵子才发现要让cgo编译代码,import “C” 必须是单独一行.

可以编辑的代码:

  1. //#cgo LDFLAGS: -lploticus

  2. //#include <libploticus.h>

  3. //#include <stdlib.h>

  4. import "C"

不可以被编辑的代码:

  1. //#cgo LDFLAGS: -lploticus

  2. //#include <libploticus.h>

  3. //#include <stdlib.h>

  4. import (

  5. "C"

  6. )

什么东西,都要试了才真正知道。

Friday, August 10, 2012

TextMate开源了

Mac下面无比NB的文件编辑器TextMate开源了,代码已经放在github上了。
因为TextMate只支持Mac,曾经让我这个只有Linux和Windows的用户无比羡慕。在羡慕加嫉妒TextMate用户的时候,我发现了Sublime Text 2,这个也是一个强大的编辑器,很容易上手,也很容易定制。因为TextMate作者长时间没有更新,Sublime Text 2已经慢慢的蚕食了很多TextMate的市场。
现在TextMate开源了,希望有高手可以赶快移植到Linux,Windows上,我们选择编辑器的时候就又多了一个选择。

Wednesday, August 8, 2012

putty + tmux 结合实现命令行多窗口

最近要远程登录Linux系统做一些东西,用putty一次 只能够执行一个程序,要在不同的目录运行不同的东西,要打开几个putty,很是麻烦。Google了一下,找到tmux这个小程序,参考了别人的配置,自己稍加改动,现在使用起来真的很爽。

我的配置文件:

##########################################################
# STATUS BAR
set -g status-utf8 on
set -g status-key vi
set -g status-interval 1
set -g status-attr bright
set -g status-fg white
set -g status-bg black
set -g status-left-length 20
set -g status-left '#[fg=green][#[fg=red]#S#[fg=green]]#[default]'
set -g status-justify centre
set -g status-right '#[fg=green][%m/%d %H:%M:%S]#[default]'
setw -g window-status-current-format '#[fg=yellow](#I.#P#F#W)#[default]'
setw -g window-status-format '#I#F#W'


##########################################
## TERMINAL EMULATOR TITLES
set -g set-titles on
set -g set-titles-string "#(tmux ls | awk -F: '{print $1}' | xargs | sed 's/\ / | /g')"


##########################################
## KEy BINDINGS
unbind C-b
set -g prefix C-s

# - = vertical split
unbind '"'
bind - split-window -v

# | = horizontal split
unbind %
bind \ split-window -h

# VIM Style movement
bind k selectp -U   # choose top panel
bind j selectp -D   # choose bottom panel
bind h selectp -L   # choose left panel
bind l selectp -R   # choose right panel

# bind ALT+Arrow to select panel
bind -n M-Up selectp -U   # choose top panel
bind -n M-Down selectp -D   # choose bottom panel
bind -n M-Left selectp -L   # choose left panel
bind -n M-Right selectp -R   # choose right panel


# Keys for resize panel
bind -n F9 resizep -U 1   # up
bind -n F10 resizep -D 1  # down
bind -n F11 resizep -L 1  # left
bind -n F12 resizep -R 1  # right

##########################################
## BASIC CONFIG
## utf8 ability
setw -g utf8 on
#
## vi Style Editing
setw -g mode-keys vi
#
## Make mouse useful in copy mode
#setw -g mode-mouse on

#
## Allow mouse to select which pane to use
#set -g mouse-select-pane on
#
## Allow xterm titles in terminal window, terminal scrolling with scrollbar, and setting overrides of C-Up, C-Down, C-Left, C-Right
set -g terminal-overrides "xterm*:XT:smcup@:rmcup@:kUP5=\eOA:kDN5=\eOB:kLFT5=\eOD:kRIT5=\eOC"
#
## Scroll History
set -g history-limit 30000
#
## Set ability to capture on start and restore on exit window data when running an application
setw -g alternate-screen on
#
## Lower escape timing from 500ms to 50ms for quicker response to scroll-buffer access.
set -s escape-time 50

Thursday, June 14, 2012

开始用 GitHub


现在免费的代码托管最出名的非Github莫属,但是我一直没有用Github,原因是因为Github没有免费的Private Repo。我之前一直是使用bitbucket的服务,可以有无限的私有Repo。最近因为学习目的,要fork一个Repo来看看,就开始使用Github。

Github有很详细的说明,我这里只是记录下来不让自己忘。
在做下面步骤之前,一定是要先安装git的。

$ git config --global user.name "myname"
$ git config --global user.email "myname@T420_Win"

make the git cache username and password for 1 hour (default is 15 mins), so you
don't need to type username and password everytime talk to remote server.

$ git config --global credential.helper 'cache --timeout=3600'

fork a repo

clone the forked repo
$ git clone git@github.com:username/Spoon-Knife.git

$ cd Spoon-Knife

Assigns the original repo to a remote called "upstream"
$ git remote add upstream git://github.com/octocat/Spoon-Knife.git

Pull the changes not present in your local repository, without modify your files
$ git fetch upstream

Pushes commits to your remote repo stored on GitHub
$ git push origin master

Fetches any new changes from the original repo and Merges any changes fetched into your working files
$ git fetch upstream

$ git merge upstream/master

Wednesday, June 13, 2012

在VirtualBox里面安装Plan 9

因为在学习Go,看到Go历史追溯到Plan9,就心血来潮要试着安装一个玩一玩。
下载plan9.iso。在VirtualBox里面创建一个新的VM,2G的IDE硬盘就够了,我给分配了512M的内存。把iso当中第二个IDE,然后从CD启动。

安装步骤蛮简单的,按照提示一步一步的安装,基本上就是一路点【Enter】键。在选择安装到哪个硬盘的时候,要手动输入。

安装完,把ISO从VM里面去掉,然后重启。

提示重那里启动 root is from ... : (按回车键)


提示用户名,输入glenda
user[none]: glenda
等待一阵子,就会看到rio图形界面了。

Plan9默认的图形分辨率太低,可以自己更改配置调高。


在图形界面上按住右键,选“new”
按住右键拉一个窗口
在窗口里面输入:

9fat:
sam /n/9fat/plan9.ini

在窗口里面按住右键,选“plan9.ini"
修改下面两行
monitor=xga
vgasize=640x480x8

替换内容
monitor=vesa
vgasize=1024x768x24

按住右键,选”write“
右键点击刚刚编辑的地方
按住右键,选”close“,再点右键
输入”q回车“退出

然后重启VM,就可以看到比较大的显示了。


下面的文档是plan9的一个入门文档,介绍了plan9下面一些常用软件和操作。
http://www.quanstro.net/newbie-guide.pdf

Tuesday, June 12, 2012

Golang conditional compilation

In C language, we use #if, #else, #endif for conditional compilation.

For Go, the conditional compilation can be achieved by include different files in certain build configuration.

At begin of source file, put // +build XXX then followed by a blank line.

main1.go
// +build main1

package main

import (
    "fmt"
)

func main() {
    fmt.Println("This is main 1")
}
main2.go
// +build main2

package main

import (
    "fmt"
)

func main() {
    fmt.Println("This is main 2")
}
when running "go build", I still got compile error
$ go build -tags 'main1'

Saturday, June 2, 2012

Setup emacs + gocode for golang editing with auto completion


from Go Source repository http://code.google.com/p/go/source/browse/misc/emacs/
download go-mode-load.el and go-mode.el, put both file into ~/.emacs.d

edit ~/.emacs to add
(add-to-list 'load-path "~/.emacs.d" t)
(require 'go-mode-load)

Go to ~/.emacs.d to compile go-mode.el
$emacs -batch -f batch-byte-compile go-mode.el

Install Autocomplete for emacs from http://cx4a.org/software/auto-complete/
Follow the user manual for instllation.

Copy emacs/go-autocomplete.el file from the gocode source distribution to ~/.emacs.d

edit ~/.emacs to add
(require 'go-autocomplete)
(require 'auto-complete-config)

Install gocode
$go get github.com/nsf/gocode
$go install github.com/nsf/gocode

All instllation is done. To test of gocode auto completion
$gocode -s 

then run emacs with a go file, test and enjoy it.

Using Juniper Network Connect on Lubuntu 12.04 64bit

All ideas are from http://mad-scientist.us/juniper.html.

Below is my preparation on my Lubuntu 12.04 64bit. Rest just follow the origin website.

Install ia32-libs

$sudo apt-get install ia32-libs

Download 64bit and 32bit Java installation files
jre-6u32-linux-i586.bin  for 32bit linux
jre-6u32-linux-x64.bin for 64bit linux

ia32-libs and jre 32bit is only needed if you want to run gui version of juniper vpn.

I will install both JAVA in /opt/java/
$sudo mkdir -p /opt/java/x86 /opt/java/x64
$cd /opt/java/x86
$sudo sh ~/Download/jre-6u32-linux-i586.bin

$cd /opt/java/x64
$sudo sh ~/Download/jre-6u32-linux-x64.bin

Create JAVA plugin for firefox.
$cd /usr/lib/firefox/plugins
$sudo ln -s /opt/java/x64/jre1.6.0_32/lib/amd64/libnpjp2.so .

Start Firefox, use "about:plugins" to check Java installed.

Install xterm by
$sudo apt-get install xterm


Setup Sublime Text 2 + gocode for GoLang coding on Ubuntu 12.04


Step to setup on Ubuntu 12.04


Install Golang
$sudo apt-get install golang


Install gocode and dependency packages
$ sudo go get github.com/nsf/gocode
$ sudo go install github.com/nsf/gocode
$ sudo go get github.com/DisposaBoy/MarGo
$ sudo go install github.com/DisposaBoy/MarGo

add /usr/lib/go/bin to your $PATH by edit ~/.bashrc
export PATH=$PATH:/usr/lib/go/bin

Install Sublime Text 2 from http://http://www.sublimetext.com/2
$ tar vxjf Sublime Text 2 Build 2181 x64.tar.bz2
$ sudo mv Sublime\ Text\ 2 /opt/sublime2
$ sudo sudo ln -s /opt/sublime2/sublime_text /usr/bin/subl

Installation for Sublime Text 2 OK. Can run using symbol link "subl"
$ subl  &

Install Package Control for Sublime Text 2.
press Ctrl + ` to view the python consol, paste following line

import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print 'Please restart Sublime Text to finish installation'

Reset Sublime Text 2

Ctrl + Shift + P, then select "Package Control: Install Package", type "gosublime" and install

Reset Sublime Text 2, now you have a very nice go editor. Enjoy it.

Friday, June 1, 2012

读书 Learning Go

Learning Go - a free E-Book for learning the Go language, 这个是一本不错的Go语言入门的书,免费的,书本身是用Latex写的,放在github上( https://github.com/miekg/gobook ), 也可以直接下载PDF版本(http://miek.nl/files/go/),中文翻译版本(http://www.mikespook.com/learning-go/

昨晚10点多开始读,刚刚读完,没有做里面的练习题,算是对Go有了一个初步也比较全面的了解,感觉Go设计的的确很不错,毕竟是大牛们经过了好多年思考的结果。语法简介,清晰,功能强大。以后工作中如果要写一些小工具,可以考虑用Go来代替Python。

Thursday, May 31, 2012

Lubuntu 12.04 安装 Go

在网上看到一篇介绍Go的文章,颇为心动,对于我这种现在主要用C和Python的人好像蛮值得一学。于是开始着手在我新安装的Lubuntu 12.04里面安装Go。

$ apt-cache search go | grep ^go
发现源里面竟然已经有了golang,于是直接apt-get install golang来安装, 这个命令会安装go的源代码和程序。

安装完,按照网上的文档,在.bashrc里面设置环境变量, 然后用8g,8l测试了一个hello world。不过后来发现根本不用设置这些变量,因为新版的go在/usr/bin/里面有一个go的命令,这个命令本身就可以做各种各样的事情。

要运行程序 go run test.go
要编译程序 go build test.go

Go现在终于到了1.0版,以后应该慢慢变流行吧,毕竟是Google请的几个超级大牛写的。以后有空就学习Go吧!!!