Showing posts with label Miscellaneous. Show all posts
Showing posts with label Miscellaneous. Show all posts

Friday, February 4, 2011

Syntax Highlighting

To enable syntax highlighting on blogspot follow the below steps.


Go to Design --> EditHTML-->Edit Template section

Add the following just before </head>
<!-- Add-in CSS for syntax highlighting -->
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shCore.js' type='text/javascript'/>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCpp.js' type='text/javascript'/>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCSharp.js' type='text/javascript'/>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCss.js' type='text/javascript'/>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushDelphi.js' type='text/javascript'/>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushJava.js' type='text/javascript'/>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushJScript.js' type='text/javascript'/>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushPhp.js' type='text/javascript'/>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushPython.js' type='text/javascript'/>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushRuby.js' type='text/javascript'/>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushSql.js' type='text/javascript'/>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushVb.js' type='text/javascript'/>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushXml.js' type='text/javascript'/>

Add the following just before </body>
<!-- Add-in Script for syntax highlighting -->
<script language='javascript'>
dp.SyntaxHighlighter.BloggerMode();
dp.SyntaxHighlighter.HighlightAll('code');
</script>
Add the <pre> tag surrounding the code snippets.
<pre class="xml" name="code">
Your XML goes here
</pre>


<pre class="java" name="code">
Your Java code goes here
</pre>

Monday, February 9, 2009

How to kill a process running on a port

Hi All,
Many of the Java developers frequently facing some problems with ports.
Ex: If JBoss server has started and closed accedentally without properly shutdown process , several processes will remain running on some ports which will causes Port Already binded kind of exceptions.
In that kind of situations, we can forcefully kill a process running on a port as follows:
1. get the PID of that process
d:>netstat –ao

2. kill the process
D:\>taskkill /F /PID p_id