Saturday, November 30, 2013

Write ByteArrayOutputStream to File


Simple Note

test/Test.java shows how to write a ByteArrayOutputStream to a File (dist/test.txt)

https://github.com/benbai123/JSP_Servlet_Practice/tree/master/Practice/JAVA/IO/WriteByteAarrayOutputStreamToFile

Polymorphism in C++

Simple Note

From reference:

One of the key features of derived classes is that a pointer to a derived class is type-compatible with a pointer to its base class. Polymorphism is the art of taking advantage of this simple but powerful and versatile feature, that brings Object Oriented Methodologies to its full potential.

Also refer to http://ben-bai.blogspot.tw/2013/11/virtual-keyword-in-c.html

Tested with Dev-C++ 4.9.9.2

Code

https://github.com/benbai123/C_Cplusplus_Practice/blob/master/CPP/CPP_Basic/CPP_Extend_and_scope/polymorphism/basic/polymorphism_basic.cpp

Result

Refer to http://ben-bai.blogspot.tw/2013/11/virtual-keyword-in-c.html

Reference

http://www.cplusplus.com/doc/tutorial/polymorphism/

Friday, November 29, 2013

Virtual Keyword in C++

Simple Note

Use virtual keyword to define a function in a class that can be redefined in its derived class.

The only valid declaration (virtual or non-virtual) is the declaration within first level Class (first level here means the base class), redefine it in derived class will be ignored.

Also refer to http://ben-bai.blogspot.tw/2013/11/polymorphism-in-c.html

Tested with Dev-C++ 4.9.9.2

Program

https://github.com/benbai123/C_Cplusplus_Practice/blob/master/CPP/CPP_Basic/CPP_Extend_and_scope/virtual/virtual.cpp

Result


Reference

http://www.cplusplus.com/doc/tutorial/polymorphism/

Sunday, November 10, 2013

Font Awesome Getting Started


Simple Note

Result



Steps

1. Go to official site http://fontawesome.io/

2. Download and extract file to target folder

3. Follow Getting started page (http://fontawesome.io/get-started/), create html page

4. See icons page (http://fontawesome.io/icons/), write some icons and see whether it works well.

Download

Testing folder at github
https://github.com/benbai123/HTML_CSS_Javascript_practice/tree/master/bootstrap/font_awesome/getting_started

Saturday, November 9, 2013

Bootstrap Getting Started


Simple Note

Steps

0. Preview official Getting started page (http://getbootstrap.com/getting-started/)

1. Go to github page of bootstrap (https://github.com/twbs/bootstrap) and download latest release (see Quick start section at that page)

NOTE: For some reason the download link at official site (http://getbootstrap.com/) not works for me.

2. Unzip downloaded file and copy dist folder into target folder.

3. Copy an official example (e.g., http://getbootstrap.com/examples/signin/) to see whether it works.

Done.

References

Bootstrap Getting Started
http://getbootstrap.com/getting-started/

Bootstrap github
https://github.com/twbs/bootstrap


Download

Testing folder at github
https://github.com/benbai123/HTML_CSS_Javascript_practice/tree/master/bootstrap/getting_started