posted @ 2013-03-19 11:41 蝈蝈俊 阅读(380) 评论(0) 推荐(0)
摘要:
1、新建一个App ID
App ID是识别不同应用程序的唯一编码。如果你的程序要连接Apple Push Notification服务(一种push通知),需要用到App ID。如果应用程序之间要共享钥匙串数据,也会用到App ID。总之,App ID在iOS设备上大量被使用。在这里App ID的最大用处是制作真机调试用的Provision Profile(它需要提供一个App ID)。
一... 阅读全文
摘要:
对比下来,Revel的资料还是比较多,我个人推荐Revel。
Revel Web开源框架
是一个高效的Go语言Web开发框架,其思路完全来自 Java 的Play Framework。https://github.com/robfig/revel
特点:热编译,简单可选,同步(每个请求都创建自己的goroutine来处理)。
相关学习资料:
一步一步学习Revel Web开源框架http://... 阅读全文
posted @ 2013-03-18 18:34 蝈蝈俊 阅读(12714) 评论(1) 推荐(0)
摘要:
我用的驱动是:https://github.com/Go-SQL-Driver/MySQL
理由跟https://github.com/astaxie/build-web-application-with-golang/blob/master/05.2.md的一样。 比较新,更新维护的比较好;
完全支持database/sql接口
支持keepalive,保持长连接。 安装 $ go... 阅读全文
posted @ 2013-03-18 08:38 蝈蝈俊 阅读(2884) 评论(0) 推荐(0)
摘要:
天气预报接口使用的是:http://www.weather.com.cn/data/sk/101010100.html
这里的Json数据如下: { "weatherinfo": { "city": "北京", "cityid": "101010100", "temp": "11", ... 阅读全文
posted @ 2013-03-18 05:45 蝈蝈俊 阅读(1709) 评论(0) 推荐(0)
摘要:
Go目前标准包中日志只是方便的实现日志记录的功能,这些日志都是基于fmt包的打印再结合panic之类的函数来进行一般的打印、抛出错误处理。
一个简单的日志记录代码例子:
代码来自:http://www.du52.com/text.php?id=114
package main import(
"fmt"
"log"
"os"
) func main(){
l... 阅读全文
posted @ 2013-03-17 22:01 蝈蝈俊 阅读(6229) 评论(0) 推荐(0)
摘要:
Android各版本 内外卡真实路径
【2.3.6】内卡:/mnt/sdcard (底层映射路径:/sdcard)外卡:/mnt/sdcard/external_sd (底层映射路径:/sdcard/external_sd)附:内外卡互换卡刷包http://pan.baidu.com/share/link?shareid=65738&uk=2197868393 【4.0.4】(CM9)内卡:/... 阅读全文
posted @ 2013-03-11 10:36 蝈蝈俊 阅读(604) 评论(0) 推荐(0)
摘要:
Go 语言官方没有提供处理 utf8、unicode 之外字符编码的包。这样转换就需要用第三方包,候选包:
https://github.com/xushiwei/go-iconv
https://github.com/djimenez/iconv-go
https://github.com/sloonz/go-iconv
例子:
下面源网页是国家地震局的一周内地震统计,编码是gb2312,这里需... 阅读全文
posted @ 2013-03-10 22:15 蝈蝈俊 阅读(2836) 评论(0) 推荐(0)
摘要:
下面是找的几个例子: 例子1:获得百度首页的html源文件:
package main import(
"fmt"
"io/ioutil"
"net/http"
) func main(){
response,_:=http.Get("http://www.baidu.com")
defer response.Body.Close()
... 阅读全文
posted @ 2013-03-09 20:31 蝈蝈俊 阅读(4625) 评论(0) 推荐(0)
摘要:
首先当然是安装go运行环境,安装方法参看:
http://www.cnblogs.com/ghj1976/archive/2013/01/16/2863142.html 一、安装 Mercurial Mercurial 是一个跨平台的分布式版本控制软件。Mercurial主要由Python语言实现,不过也包含一个用C实现的二进制比较工具。Mercurial一开始的主要运行平台是... 阅读全文
posted @ 2013-03-08 09:21 蝈蝈俊 阅读(3325) 评论(0) 推荐(0)
摘要:
求递归算法时间复杂度:递归树 http://www.cnblogs.com/wu8685/archive/2010/12/21/1912347.html 为什么算法渐进复杂度中对数的底数总为2
http://blog.codinglabs.org/articles/why-logarithm-base-of-asymptotic-time-complexity-always-two.ht... 阅读全文
posted @ 2013-03-06 17:27 蝈蝈俊 阅读(833) 评论(0) 推荐(0)