Monday, May 31, 2010

Posting source code on blogger

For blogger, I’m a freshman. This post is for others programmer to share or post there source code on blogger. After googling, couple hours, some tutorial on web such as Please Make a Note or Juri’s Blog. I try to follow what they written about step by step, eventually, I’m still stuck. But that doesn’t force me to give in. I’m find some useful tools call Windows Live Writer. you can download from here. After installed the program, you need to download extra code snippet plug-in from Windows Live Gallery. It’s really easy to use and post your blog without go to your blog page. Code snippet plug-in is also compatible with CSharp, ColdFusion, CSS, HTML, JavaScript, PHP, T-SQL, and many others languages. Here are some example code snippet:

CSharp

   1: public static bool isMemberExist(string account)
   2: {
   3:     int ret = Handler.checkMember(account);
   4:     
   5:     if(ret != 0)
   6:         return true;
   7:     else
   8:         return false;
   9: }

JavaScript


   1: $(document).ready(function() {
   2:     $("id[$='_textBox']").change(function(){
   3:         if($(this).val().length == )
   4:             $("#errorSpan").slideToggle("slow");
   5:     });
   6: });

C

   1: #include <stdio.h>
   2:  
   3: int main(void)
   4: {
   5:     int num;
   6:     num = 1;
   7:     
   8:     printf("I am a simple ");
   9:     printf("computer.\n");
  10:     printf("My favorite number is &d .\n",num);
  11:     getchar();
  12:     return 0;
  13: }

yeap…I’m gonna end this post here. The way to satisfy your curiosity is to try it by yourself. Luck dude!!

0 comments:

Post a Comment