部队飞艇筹备&飞艇带回材料
| 素材 | 云海 | 制作 |
|---|---|---|
| 莫古力王冠 | 1,10,15 | 莫古吊灯 |
| 低木苗 | 2,6,12 | 莫古庭具 |
| 多马克拉斯幼苗(音译) | 8,14 | 花园庭具 |
| 东方小判 | 3,16 | 招财猫桌上 |
| 细工箱设计图 | 5,10,14 | 玩具箱桌上 |
| 熊皮地毯素材 | 4,7 | 熊皮地毯 |
| 铁人核心 | 8,18,19,20,22 | 铁小人宠物 |
| 天然粘土 | 7, | 房屋设计图 |
| 石粉粘土 | 10, | 房屋设计图 |
| 炼金树脂 | 15, | 房屋设计图 |
| 强化奇美拉粗皮 | 11,12,13 | 飞空艇素材 |
| 铁刀木 | 14,15,21 | 飞空艇素材 |
| 炼金纤维 | 11,12,13 | 飞空艇设计图 |
| 魔科学纤维 | 14,15 | 飞空艇设计图 |
| 黄昏鞣革 | 17,18,19,20,21 | 部队时装 |
| 风之丝绸(3.1) | 17, | 礼服时装 |
| 迪诺皮革(3.1?) | 19, | 迪诺时装 |
| 浮草(3.1) | 6,13 | 浮草庭具,蘑菇房(可能) |
| 浮岛陶石(3.1) | 10, | 精灵吊灯 |
Android Cursor 和 Query 问题处理
- Demo: https://github.com/tokinonagare/AndroidStudioSQLiteSample
/app/src/main/java/com/tokinonagare/sqlitesample/MyDBHandler.java
Cursor
//Move to the first row in your results
cursor.moveToFirst();
while(!cursor.isAfterLast()) {
if(cursor.getString(cursor.getColumnIndex("productname"))!= null) {
sqLiteDatabaseString += cursor.getString(cursor.getColumnIndex("productname"));
sqLiteDatabaseString += "\n";
}
}
在这一段涉及Cursor取数据的代码中, 会出现点击addButton时, app卡死的情况, 内存似乎一直在益处, 感觉缺少终止代码.
研究了一下Cursor的方法后使用了如下代码替换, 解决了问题
while (cursor.moveToNext()){
if(cursor.getString(cursor.getColumnIndex("productname"))!= null) {
sqLiteDatabaseString += cursor.getString(cursor.getColumnIndex("productname"));
sqLiteDatabaseString += "\n";
}
}
cursor.close();
Query
@Override
public void onCreate(SQLiteDatabase sqLiteDatabase) {
String query = "CREATE TABLE " + TABLE_PRODUCTS + " ( " +
COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
COLUMN_PRODUCTNAME + " TEXT " +
");";
sqLiteDatabase.execSQL(query);
}
AUTOINCREMENT, 这个逗号是为了避免出现 near的 Error 问题添加的.
Andriod Studio SDK & .Gitignore 问题处理
接触两周Android Studio 记录在处理SDK下载问题和.Gitignore如何配置的方法
SDK
问题主要是出在 http://dl-ssl.google.com/这个Domian的Fetching上
Failed to fetch URL http://dl-ssl.google.com/glass/gdk/addon.xml, reason: HttpHostConnect
当然如果直接用代理是可以下载, 但是速度感人.
方法
使用代理跑一遍Fetching, 关掉SDK Manager, 再次启动SDK Manager, SDK 下载速度就正常了
猜测是因为Fetching一次之后, 会有一个缓存, 再不重启Android Studio的前提下, SDK Manager会直接读缓存
.Gitignore
# Built application files
build/
# Local configuration file (sdk path, etc)
local.properties
# Gradle generated files
.gradle/
# User-specific configurations
.idea/**/*.xml
*.iml
Mac 下面的话这几个ignore项目的话就足够了
.idea/**/*.xml
意思是在.idea文件夹下的任意目录下带.xml后缀的文件.
git rm -r . --cached
允许递归-r的方法清除该文件夹下的所有缓存索引.
git add .
git commit -m "Change .gitignore file"
- 看到有文章将
gradle.xml文件例如非ignore的文件
!.idea/gradle.xml
不过仔细研究之后发现这个文件只在win系统下的opnefile的对话框中会影响文件夹的图标.
Andriod Studio 学习笔记 - 初探
接触几天React后发现Andriod的开发版本还要等几个月, 于是转战Android_Studio.
Demo地址: https://github.com/tokinonagare/AndroidStudioDemo
安装
跳过启动检测认证
Android Studio.app/Contents/bin/idea.properties
尾行添加
disable.android.first.run=true
安装SDK
翻墙必须, 使用Shadowsocks的情况下, 修改preference中的HTTP无效, 使用全局模式
主界面 > configure > SDKmanager
注意: 改变网络环境情况下需要 Tool > reload
设置更改
快捷键: preference > keymap
根据自己subl的编码习惯改掉如下快捷键
- Move care to Next Word : 光标移动到下一个字符 > Shift + Space
- Split Line : 回车, 光标不移动 > Shift + Enter
- Start New line : 新建一行, 光标移动到新建行 > Command + Enter
- Start New line Before Curre : 在该行上一行新建一行,光标移动到新建行 > Command + Shift + Space
未修改
- 查看详情 Control + J
- 快速修复 Alt + Enter
主题更改&字体更改
Settings > Appearance
我选择了一个Darcula的黑色主题, 不太喜欢白色的背景, 感觉很刺眼. 中文显示问题的话, 字体可以考虑使用 Microsoft Sans Serif(微软雅黑).
其他
真机连接调试的话需先在手机上开启usb调试模式再插入usb.
React 学习笔记 - 初探
公司招安卓两个多月了==依然未果, 于是我来学吧, 老板让我用react这个facetime用的新的开发平台, 貌似iOS, Android, 甚至Rails都通吃, 就是个干!
- DEMO: https://github.com/tokinonagare/AwesomeProject
配置
- 官方文档: http://facebook.github.io/react-native/docs/getting-started.html#content
注意事项
-
You may need to run brew unlink node if you have previously installed Node. 如果以前安装过node.js的话, 需要 ` brew unlink node`.
-
Open AwesomeProject.xcodeproj and hit run in Xcode. 到这步模拟器运行成功, 但是几秒后模拟器出现红屏, 查看terminal: TypeError: Cannot read property ‘root’ of null
解决方法:
brew upgrade watchman
- 参考: https://github.com/facebook/react-native/issues/1875
Debain & Ubuntu 部署 Shadowsocks
不知从何时开始, 弄到一台新VPS的第一件事情…毫无疑问的就是部署shadowsocks…
Server 部署:
apt-get install update
- 参考: http://www.chedanji.com/ubuntu-shadowsocks/
处理问题
Error: Another program is already listening on a port that one of our HTTP servers is configured to use. Shut this program down first before starting supervisord.
sudo unlink /tmp/supervisor.sock
&
sudo unlink /var/run/supervisor.sock
均出现错误: unlink: cannot unlink `/var/run//supervisor.sock’: No such file or directory
vim /etc/supervisord.conf发现
file=/var/run//supervisor.sock ; (the path to the socket file)
这行多了一个"/"去掉搞定.(注: 这个应该是作为一个隐藏文件的处理, 但不知道为何没有处理好)
service supervisor start
- 参考: http://stackoverflow.com/questions/14479894/stopping-supervisord-shut-down
Debain & Ubuntu 部署生产 Rails
把官方和前辈的配置步骤简化总结了一下
使用非root账号登陆, 需具备sudo权限.
安装rvm & ruby
$ sudo apt-get update
$ sudo apt-get install curl
$ \curl -sSL https://get.rvm.io | bash
载入rvm环境: 登出登陆ssh or $ source ~/.rvm/scripts/rvm
检查rvm版本:
$ rvm -v
安装中文支持:
$ readline: rvm pkg install readline #未使用, 貌似没出啥问题, 估计是版本问题
安装ruby, 并指定默认版本:
$ rvm use --install --default 2.1.2
$ rvm use --install --default 2.1.2 --with-readline-dir=$rvm_path/usr #未使用
若安装readline貌似需要使用:
$ rvm use 2.1.2@your_gemset --create --default #未使用, 不明白@后需要加什么
检查ruby版本:
$ ruby -v
Debain & Ubuntu 基本部署
拿到一台新VPS需要干的几件事情…
设置用户
增加用户:
adduser username
更改密码:
passwd username
用户切换:
su username
问题
- sudo: unable to resolve host.
确定servername: vim /etc/hostname
修改host: vim /etc/hosts, 在第一行添加:
127.0.0.1 localhost localhost.localdomain servername
- username is not in the sudoers file. This incident will be reported. 切换到root:
su root
添加edit权限:
chmod u+w sudoers
添加用户权限:
#User privilege specification": username All=(All) All
撤销edit权限:
chmod u-w sudoers #一般都懒得管了=.=