A little food for thought

Thursday, May 28, 2009

Getting syntax highlighting work in Blogger

As my previous post suggest I was trying different methods suggested by different blogs. But none of them working. Part of the problem was that blogger doesn not support CSS and JS files upload. So you need to depend on external sites to refer to these files. The other problem was instructions on these different blogs. Most of them said the to put first set of files before </head> But the problem is there are many </head> tags in Blogger template. Finally I could get it working. This is what I did

1> I added following lines after <$BlogMetaData$> tag.
<link type="text/css" rel="stylesheet" href="http://syntaxhighlighter.googlecode.com/svn/trunk/Styles/SyntaxHighlighter.css"></link>
<script language="javascript" src="http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shCore.js"></script>
<script language="javascript" src="http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCSharp.js"></script>
<script language="javascript" src="http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushXml.js"></script>
<script language="javascript" src="http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCss.js"></script>
<script language="javascript" src="http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushJScript.js"></script>
<script language="javascript" src="http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushSql.js"></script>
2> Add following lines before </body> tag. This should be just after <!-- End wraps --> tag.
<script language="javascript">
dp.SyntaxHighlighter.ClipboardSwf = "http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/clipboard.swf";
dp.SyntaxHighlighter.HighlightAll("code");
</script> 
This worked for me. Most probably will work for you as well. Enjoy.

Trying Syntax highlighting

Yesterday I wastrying syntax highlighting for my previous post. Not decided to create this post just to try it.
class myClass
{
/* Add code here */


}



Wednesday, May 27, 2009

Notepad++ and PLSQL

In addition to my previous post. You also need to add PL/SQL for syntax highlighting. To get that working you need to follow these steps. 1> Goto %APPDATA%\Notepad++ (Start->Run>%APPDATA%\Notepad++) 2> Check for the file userDefineLang.xml 3> If file exists then add following code into it just before tag


        
            
            
            
        
        
            000000
            begin
            end
            ! " % & ( ) * , / : ; ? @ [ \ ] ^ ` | ~ + < = >
            1 2 0#
            ALL ALTER AND ANY ARRAY AS ASC AT AUTHID AVG BETWEEN BINARY_INTEGER BODY BOOLEAN BULK BY CASE CHAR CHAR_BASE CHECK CLOSE CLUSTER COALESCE COLLECT COMMENT COMMIT COMPRESS CONNECT CONSTANT CREATE CURRENT CURRVAL CURSOR DATE DAY DECLARE DECIMAL DEFAULT DELETE DESC DISTINCT DO DROP ELSE ELSIF EXCEPTION EXCLUSIVE EXECUTE EXISTS EXIT EXTENDS EXTRACT FALSE FETCH FLOAT FOR FORALL FROM FUNCTION GOTO GROUP HAVING HEAP HOUR IF IMMEDIATE IN INDEX INDICATOR INSERT INTEGER INTERFACE INTERSECT INTERVAL INTO IS ISOLATION JAVALEVEL LIKE LIMITED LOCK LONG LOOPMAX MIN MINUS MINUTE MLSLABEL MOD MODE MONTH NATURAL NATURALN NEW NEXTVAL NOCOPY NOT NOWAIT NULL NULLIF NUMBER NUMBER_BASE OCIROWID OF ON OPAQUE OPEN OPERATOR OPTION OR ORDER ORGANIZATION OTHERS OUT PACKAGE PARTITION PCTFREE PLS_INTEGER POSITIVE POSITIVEN PRAGMA PRIOR PRIVATE PROCEDURE PUBLIC RAISE RANGE RAW REAL RECORD REF RELEASE RETURN REVERSE ROLLBACK ROW ROWID ROWNUM ROWTYPE SAVEPOINT SECOND SELECT SEPARATE SET SHARE SMALLINT SPACE SQL SQLCODE SQLERRM START STDDEV SUBTYPE SUCCESSFUL SUM SYNONYM SYSDATE ABLE THEN TIME TIMESTAMP TIMEZONE_REGION TIMEZONE_ABBR TIMEZONE_MINUTE TIMEZONE_HOUR TO TRIGGER TRUE TYPE UID UNION UNIQUE UPDATE USE USER VALIDATE VALUES VARCHAR VARCHAR2 VARIANCE VIEW WHEN WHENEVER WHERE WHILE WITH WORK WRITE YEAR ZONE
            ac asnp clc cli clp clv cpi cpp cvpa diff epal epcsv fc fl foreach % ft fw gal gc gci gcm gdr ghy gi gl gm gp gps group gsv gsnp gu gv gwmi iex ihy ii ipal ipcsv mi mp nal ndr ni nv oh rdr ri rni rnp rp rsnp rv rvpa sal sasv sc select si sl sleep sort sp spps spsv sv tee where ? write cat cd clear cp h history kill lp ls mount mv popd ps pushd pwd r rm rmdir echo cls chdir copy del dir erase move rd ren set type
            
        
            
            
            
            
            
            
            
            
            
            
            
            
            
            
        
    

4> If file does not exists then create the file and add following code


    
        
            
            
            
        
        
            000000
            begin
            end
            ! " % & ( ) * , / : ; ? @ [ \ ] ^ ` | ~ + < = >
            1 2 0#
            ALL ALTER AND ANY ARRAY AS ASC AT AUTHID AVG BETWEEN BINARY_INTEGER BODY BOOLEAN BULK BY CASE CHAR CHAR_BASE CHECK CLOSE CLUSTER COALESCE COLLECT COMMENT COMMIT COMPRESS CONNECT CONSTANT CREATE CURRENT CURRVAL CURSOR DATE DAY DECLARE DECIMAL DEFAULT DELETE DESC DISTINCT DO DROP ELSE ELSIF EXCEPTION EXCLUSIVE EXECUTE EXISTS EXIT EXTENDS EXTRACT FALSE FETCH FLOAT FOR FORALL FROM FUNCTION GOTO GROUP HAVING HEAP HOUR IF IMMEDIATE IN INDEX INDICATOR INSERT INTEGER INTERFACE INTERSECT INTERVAL INTO IS ISOLATION JAVALEVEL LIKE LIMITED LOCK LONG LOOPMAX MIN MINUS MINUTE MLSLABEL MOD MODE MONTH NATURAL NATURALN NEW NEXTVAL NOCOPY NOT NOWAIT NULL NULLIF NUMBER NUMBER_BASE OCIROWID OF ON OPAQUE OPEN OPERATOR OPTION OR ORDER ORGANIZATION OTHERS OUT PACKAGE PARTITION PCTFREE PLS_INTEGER POSITIVE POSITIVEN PRAGMA PRIOR PRIVATE PROCEDURE PUBLIC RAISE RANGE RAW REAL RECORD REF RELEASE RETURN REVERSE ROLLBACK ROW ROWID ROWNUM ROWTYPE SAVEPOINT SECOND SELECT SEPARATE SET SHARE SMALLINT SPACE SQL SQLCODE SQLERRM START STDDEV SUBTYPE SUCCESSFUL SUM SYNONYM SYSDATE ABLE THEN TIME TIMESTAMP TIMEZONE_REGION TIMEZONE_ABBR TIMEZONE_MINUTE TIMEZONE_HOUR TO TRIGGER TRUE TYPE UID UNION UNIQUE UPDATE USE USER VALIDATE VALUES VARCHAR VARCHAR2 VARIANCE VIEW WHEN WHENEVER WHERE WHILE WITH WORK WRITE YEAR ZONE
            ac asnp clc cli clp clv cpi cpp cvpa diff epal epcsv fc fl foreach % ft fw gal gc gci gcm gdr ghy gi gl gm gp gps group gsv gsnp gu gv gwmi iex ihy ii ipal ipcsv mi mp nal ndr ni nv oh rdr ri rni rnp rp rsnp rv rvpa sal sasv sc select si sl sleep sort sp spps spsv sv tee where ? write cat cd clear cp h history kill lp ls mount mv popd ps pushd pwd r rm rmdir echo cls chdir copy del dir erase move rd ren set type
            
        
            
            
            
            
            
            
            
            
            
            
            
            
            
            
        
    


Enjoy

Notepad ++ and PLSQL

Recently I installed notepad ++ on my machine. As I am doing lot od javscript programming lately. And I found Notepad++ is one of the best editor for Javascript. Other being Visual Studio. But since I also do PLSQL programming I was looking for a way to get PLSQL Syntax checking and autocompletion. With some minor tweaking I could get both working. If you have similar requirement please follow these steps. 1>Create a file called plsql.xml in 'C:\Program Files\Notepad++\plugins\APIs' directory. 2> Copy and paste following code into this file.
 
 
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
    

3. Close and restart the notepad++. Enjoy

Monday, May 25, 2009

Back to blogging

I am back to blogging. After a very long time. However I will try to blog more frequently this time. Let us see how long that lasts.