2015/02/21

如何重設chrome的所有資料

1. 打開chrome

2. 網址列輸入
chrome://settings/resetProfileSettings

3. 重設

Cocos2d-JS關於腳本壓縮


你可以使用Google Closure Compiler來將所有js檔案壓縮成一個檔,Closure Compiler的高級壓縮壓縮比非常高,即便你下載的是壓縮版引擎,也可以獲得可觀的壓縮比。具體壓縮步驟如下:
1. 下載 Closure Compiler 的jar程式檔
2. 按照自己的環境配置build.xml
3. 在控制台運行ant命令
4. 將頁面中的所有js引用刪除,引入打包出的game.min.js
請注意,你不可以在html頁面中寫任何js腳本,所有js腳本都必須一起打包起來,否則會引起錯誤。


2015/02/07

老電腦也有老電腦用處 - 重新開箱文 "輪迴 Unknown"

最近朋友給了一台老電腦,配備嘛.....不是挺好的
















但是能幹嘛呢?當然是玩老遊戲!以前XP & DX9時代的3D遊戲ㄚ!噗噗,由其是自己參與開發的 - 輪迴 Unknown 3D動作遊戲 (淚....)

先看一下包裝盒,珍藏了好久

















































安裝完畢之後,當然是......開玩囉


2015/01/27

Ubuntu Linux下,安裝與運行 Node.js

---- 安裝 GNU C compiler 和 GNU C++ compiler
To install the gcc and g++ compilers, you will need the build-essential package. This will also install GNU make.

build-essential contains a list of packages which are essential for building Ubuntu packages including gcc compiler, make and other required tools.
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install build-essential
$ sudo apt-get install gccw
$ sudo apt-get install g++
$ gcc -v
$ make -v


---- Linux從源碼安裝Node,才能安裝你所需要的版本

#Ubuntu安裝代碼
$ sudo wget http://nodejs.org/dist/v0.10.35/node-v0.10.35.tar.gz
$ sudo tar -zxf node-v0.10.35.tar.gz #Download this from nodejs.org
$ cd node-v0.10.35
$ sudo ./configure && sudo make && sudo make install
$ sudo cp /usr/local/bin/node /usr/sbin/


---- 測試一下看裝好了沒有,用命令查看node和npm版本
$ node -v
$ npm -v


---- 編寫一個簡單的伺服器體驗一下
var http = require('http');

http.createServer(function (request, response) {
    response.writeHead(200, {'Content-Type': 'text/plain'});
    response.end('Hello World\n');
}).listen(8000);

console.log('Server running at http://localhost:8000/');

• 1、保存代碼到 test1.js
• 2、命令列下執行命令:node test1.js
• 3、通過流覽器訪問 http://localhost:8000/


---- 接著安裝express
$ sudo apt-get install node-express

---- 建立express工程,啟動第一個專案
$ express -e nodejs-demo

install dependencies:
$ cd nodejs-demo && npm install

run the app:
$ node app

---- 安裝curl
$ sudo apt-get install curl
$ curl localhost:3000

Windows 7下,安裝與Debug Node.js

前言:由於Node.js使用VS2010當成C++編譯器,所以建議要安裝VS2010,網路上有人使用如下命令,強迫使用VS2012編譯器

1. 將整個編譯環境強制設成VS2012
$ npm config set msvs_version 2012 --global

2. 安裝時設定編譯器是2012
$ npm install socket.io --msvs_version=2012

node.js 核心基礎課程
Node.js官網

---- 下載 & 執行 Node.js 安裝檔

---- 安裝Brackets
brackets官網 , 下載並安裝

---- 使用Theseus
---- run Brackets (File -- Extension Manager)
---- Available -- type "Theseus" in search box
---- Click the "install"

---- also run "npm install -g node-theseus" to get the command-line helper

---- 安裝Node Inspector
npm install -g node-inspector

---- 安裝Node debug: 
$ npm install -g node-debug

---- 示例
$ node-theseus app.js



mac OS 安裝 mysql 使用Homebrew

---- First, ensure that Homebrew is update to date and ready to brew:
$ brew update
$ brew doctor
$ brew upgrade

---- Next, install MySQL:
$ brew install mysql

---- Start MySQL:
$ mysql.server restart

---- Secure your MySQL installation. The main purpose of doing this is to ensure that the configuration of the local environment is set up as close as possible to the production environment.
mysql_secure_installation

設定Admin & 環境


---- 參考:
http://brew.sh/index_zh-tw.html

mac OS 安裝 ant

---- 下載 ant & 解壓縮
http://ant.apache.org

---- 修改目錄為ant

---- 來到自己的目錄
$ cd ~

---- 顯示目前路徑 (# /Users/bruce)
$ pwd

----  搬移ant至此

---- 寫入path
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/roo:/Users/Bruce/ant/bin

---- 檢視ant版本
$ ant -version

mac OS 安裝HomeBrew

---- 安裝homebrew
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

$ brew install wget
Homebrew 會將 packages 安裝在他們自己的目錄,然後把檔案symlink 到 /usr/local下。

$ cd /usr/local
$ find Cellar
Cellar/wget/1.15
Cellar/wget/1.15/bin/wget
Cellar/wget/1.15/share/man/man1/wget.1

$ ls -l bin
bin/wget -> ../Cellar/wget/1.15/bin/wget

使用Ubuntu寫C++


---- 首先要先確定該有的套件都有了
我們需要安裝build-essential,以及編譯器g++
在終端機輸入以下這個指令安裝吧
$ sudo apt-get install g++ build-essential


---- 記得用g++的時候請在程式的最後按Enter多留一行空白行,不然會編譯時會顯示錯誤訊息:「檔案未以空白列結束(no newline at end of file)」


---- 程式寫好存成.cpp檔,接著就可以開始編譯了,例如我們把檔案存在
/home/a108210/cpp/
檔名叫
hello.cpp

那個hello world是因為示範用的程式碼是像這樣的:
#include
using namespace std;

int main()
{
   cout << "hello world\n"; return 0;
}


那我們打開終端機,輸入
$ sudo g++ /home/a108210/cpp/hello.cpp -o /home/a108210/cpp/hello.out -Wall

這個指令可以拆開來看
g++ /home/a108210/cpp/hello.cpp -o /home/a108210/cpp/hello.out -Wall

g++:這是編譯器compiler
/home/a108210/cpp/hello.cpp:這是cpp檔案所在位置
-o /home/a108210/cpp/hello.out:-o參數後面接的就是要輸出的檔案的位置+名稱,如你所見這邊是/home/a108210/cpp/hello.out
-Wall:加這個的目的是讓他把所有的警告訊息都顯示出來,免得他覺得不重要的訊息就自動隱藏了
接下來你就會看到檔案hello.out已經編譯好熱騰騰的躺在/home/a108210/cpp/裏面了


---- 接下來我們切換到檔案所在的位置,在終端機輸入:
$ cd /home/a108210/cpp/


---- 執行程式吧,輸入:
$ sudo ./hello.out

cocos2d-x-3.2alpha 如何在Console下創建新工程

---- 在cocos2d-x-3.2alpha0\運行python命令
$ python setup.py

//它的作用是將下面這些路徑加入到你的使用者環境變數中,當然你也可以不添加
COCOS_CONSOLE_ROOT = 'COCOS_CONSOLE_ROOT'
NDK_ROOT = 'NDK_ROOT'
ANDROID_SDK_ROOT = 'ANDROID_SDK_ROOT'
ANT_ROOT = 'ANT_ROOT'

//如果你已經將COCOS_CONSOLE_ROOT = "COCOS_CONSOLE_ROOT'加入到了你的環境變數中,也就是說你運行了setup.py

---- .那麼直接運行下面命令 (cocos在cocos2d-x-3.2alpha0\tools\cocos2d-console\bin下)
$ cocos new MyGame -p com.comebest.MyGame -l cpp -d C:\Users\Admin\Documents\Cocos\CocosProjects

說明:
MyGame:name of your project
-p com.MyCompany.MyGame:package name for android
-l cpp:programming language used for the project, valid value is cppand lua
-d e:/MyCompany:directory to hold your project