Monday, November 24, 2008

PHOTOGRAPHY: Photography Sites

1. http://pixel-peeper.com/
- You can view sample pictures from a specific lens or camera based on a specific setting (e.g. aperture, focal length or ISO).

2. http://www.dslrtips.com/workshops/DSLR_workshops_tutorials_tips.shtml
- You get DSLR tips with accompanying videos.

Saturday, November 15, 2008

BLOGGING: How to add your blogsite to search engines

To increase the traffic/exposure of your blogsite, you need to add it on search engines. Three of the most popular search engines worldwide are

1. Google
2. Yahoo
3. MSN

To add your blogsite to Google, go here.

To submit your blogsite to Yahoo, go here.

To send your blogsite's url address to MSN Live Search, go here.

There is also a website which allows you to submit your blogsite URL to more than 20+ search engines, including Google. You can go to www.submitexpress.com for free website submission.

Friday, November 14, 2008

BLOGGING: How to post code snippets in Blogger

The better way to post code snippets in Blogger is by using the SyntaxHighlighter. It is a 100% Javascript based-program that allows you to insert syntax highlighted code in your blog.

The following procedures help you to setup the SyntaxHighlighter in your Blogger.
1. Download the SyntaxHighlighter.
2. Upload the SyntaxHighlighter's files to any host or website which ca be linked from your blog. (see Note 1)
3. Login to your blogger account, go to "Dashboard" - "Layout" - "Edit HTML".
4. Edit the contents of your template by adding the following code at bottom of the page, just before the </body> tag.


<link href='http://YOUR_HOST_URL/SyntaxHighlighter.css' rel='stylesheet' type='text/css'/>
<script language='javascript' src='http://YOUR_HOST_URL/shCore.js'/>
<script language='javascript' src='http://YOUR_HOST_URL/shBrushJava.js'/>
<script language='javascript'>
dp.SyntaxHighlighter.BloggerMode();
dp.SyntaxHighlighter.HighlightAll('code');
</script>


5. Save the template.
6. Now you can start using it in your posts. Go to "Posting", create or edit a post in "Edit Html" mode. Place your code snippets between <pre> and </pre> tags as shown below (See Note 2).


<pre name="code" class="js">
--your code here---
</pre>


Notes:
1. It is not really needed to upload the files to a server as the SyntaxHighlighter is already hosted by Google Code. I got it done for my blog using the following code:



<link href='http://1561834568390153680-a-1802744773732722657-s-sites.googlegroups.com/site/
infotechden/syntaxhighlighter/SyntaxHighlighter.css' rel='stylesheet' type='text/css'/>
<script language='javascript' src='http://syntaxhighlighter.googlecode.com/svn-history/r92/trunk/Scripts/shCore.js'/>
<script language='javascript' src='http://syntaxhighlighter.googlecode.com/svn-history/r92/trunk/Scripts/shBrushBash.js'/>
<script language='javascript' src='http://syntaxhighlighter.googlecode.com/svn-history/r92/trunk/Scripts/shBrushCpp.js'/>
<script language='javascript' src='http://syntaxhighlighter.googlecode.com/svn-history/r92/trunk/Scripts/shBrushCss.js'/>
<script language='javascript' src='http://syntaxhighlighter.googlecode.com/svn-history/r92/trunk/Scripts/shBrushJScript.js'/>
<script language='javascript' src='http://syntaxhighlighter.googlecode.com/svn-history/r92/trunk/Scripts/shBrushJava.js'/>
<script language='javascript' src='http://syntaxhighlighter.googlecode.com/svn-history/r92/trunk/Scripts/shBrushXml.js'/>

<script language='javascript'>
dp.SyntaxHighlighter.BloggerMode();
dp.SyntaxHighlighter.HighlightAll('code');
</script>


As you can see, I used all the files hosted by Google Code except for SyntaxHighlighter.css file. The "hosted" CSS file is different from the "downloaded" CSS file and will produce a different output, so it is advisable to use the "downloaded" CSS file.

2. When placing a code snippet, the opening triangular bracket < must be replaced with an HTML equivalent of &lt; in all cases. Failure to do won't break the page, but might break the source code displayed.

Related blog posts:

My first blog

printf("Hello World");