Showing posts with label algo. Show all posts
Showing posts with label algo. Show all posts

Wednesday, October 8, 2008

[ALGO] pasting code on blog in comments

comments takes html code , thus c++ code with "<" ">" are not accepted in comments.
Old method I pasted add spaces, the code looks weird and not eye pleasing.

this is the new method, using characters entities to represent "<" and ">".

1. copy code to notepad
2. press ctrl+H
3. replace all "<" with "_&_l_t;"
without the 2x quotes and the underscore
4. repeat all ">" with "_&_g_t;"
without the 2x quotes and the underscore
5. paste to comments of that post


OLD METHOD
//======================================
to fix it
1. copy code to note pad
2. press ctrl+H
3. replace all "<....." with "< ....." note the space, without the 2x quotes
4. repeat for > 
5. paste to comments