2013年2月22日 星期五

[Html][CSS] Image has strange border in Chrome

if you set border = 0 still got a strange border in Chrome, then is will help you to fix it.
The problem cause by only setting background-image in css file.

Solution : don't let , put something inside the src.

2013年2月17日 星期日

[Node.js][Javascript] Print javascript object

var obj = {a:'a', b:'b'};
console.log( JSON.stringify(obj, null, 4) );

This will print the object content with json format and indent = 4.

2013年2月15日 星期五

[Node.js] node-expat, XML parser for node.js

node-expat, if you like to use libxml, this is a simular module for you, in their test.js file, they have many examples for using it. Here is a simple example for it.

var expat = require('node-expat');
var parser = new expat.Parser('UTF-8');


var text = '';

// start point for parsing one tag
parser.addListener('startElement', function(name, attrs) {
   // name : name for this tag
   // attrs : attributes in this tag
});

// Get the value for one tag
parser.addListener('text', function(s) {
   // s : value for this tag
});

// end point for parsing one tag
parser.addListener('endElement', function(name) {
   // name : name for this tag
});

// start to parse
parser.parse(str);


Reference :
node-expat github : https://github.com/astro/node-expat
discussion about html parser : http://stackoverflow.com/questions/7977945/html-parser-on-nodejs

2013年2月10日 星期日

[Node.js] GraphicsMagick for node.js, install on MacOS

GraphicsMagick for node.js, this is a powerful framework. It's based on many different frameworks, so, that first and hardest one we need to do, is to install it.

1. Download Command tools for MacOS, if you don't have gcc compiler

2. Download libpng-1.4.7.tar.gz. For displaying PNG image, and install it with :
     1. ./configure
     2. make && sudo make install

3. Download libjpeg-6b.tar.bz2. For displaying JPEG image, and install it with :
     1. ./configure
     2. make && sudo make install

4. Visit their home page : http://www.graphicsmagick.org/, download GraphicsMagick-1.3.17.tar.bz2. and Install it with :
     1. ./configure CC=clang
           (*NOTE*, I got Undefined symbols for architecture x86_64 because I didn't add CC=clang, and cause lots of time, if you got the same problem, please remember to add it)
           After run the configure, it'll show the result for it, you'll need these two as yes.
              JPEG v1   --with-jpeg=yes    yes(Need to install jpeg delegate library)
              PNG       --with-png=yes     yes(Need to install png delegate library)

     2. make && sudo make install

5. In node.js, put the following code :
     var gm = require('gm');
     gm('image.jpg').size(function(err, value){
          if(err) return;
          console.log(value);
     }




If you still get any problems or found something wrong in this post, please feel free to tell me. :)


Reference :

https://github.com/rsms/node-imagemagick
http://aheckmann.github.com/gm
http://rritw.com/a/bianchengyuyan/C__/20130201/301529.html
http://qing.weibo.com/1838939461/6d9bfd4533000j33.html

2013年2月9日 星期六

[Mac] Command Line Tools for Xcode

If you need gcc or other default tools ( gcc: command not found ), just download Command Line Tools for Xcode, it's maintained by Apple developer center, and easy to install.

Downloads for Apple Developers : https://developer.apple.com/downloads/index.action
Reference : http://www.mkyong.com/mac/how-to-install-gcc-compiler-on-mac-os-x/

2012年10月3日 星期三

[iApp] SkyTapping is now ready for sale !

























Have you ever let balloons flee away from your hand and desperately watched it disappearing in the sky when you were a child? So it is time to bang the balloons before they go up to the space. 

Our Fan Quote 
-SkyTapping is the best light game for killing time on metro or bus. 
-It is quite easy to master the game, yet to get the higher score is a little bit challenging. 
-Fun and Nice game wiz enjoyable sound and cute picture. 

How to play: 
1. Tap the screen anywhere with one finger to pop the single balloon. 
2. Using two and three fingers to burst the double and triple one. 
3. Each color balloon(s) flees away from the sky will cost a heart, which you own five in the beginning. 
4. Hit the hot air balloon, make it countdown to zero and get the special item. 
5. Special item in the bottom of the screen could assist you boost your score, destroy or slow down the balloons. 
6. Have fun of being a balloons killer and reach the higher score as possible. 

Game Feature: 
-Unique Multi-touch Game, yet easy to play. 
-Facebook and Twitter Integration 
-Versus mode through Bluetooth 
-Game Center Support 
Requirement: 

-Compatible with iPod2,3,4 iPhone3,3GS,4,4S 
Requirement: iOS 5+ 

If you have any problems, please contact us for support. 
shiing989@gmail.com





2012年6月20日 星期三

Make your svn diff colorful

svn diff | view -


Note : This will use the syntax color in vim.
Reference :  http://www.commandlinefu.com/commands/view/2420/colored-svn-diff  ( More choices from here )