Wednesday, May 5, 2010

Testing windows live writer

Windows Live Writer is expected to help me write source code examples easily and post them to my blog seamlessly. In this post I am trying to test its functions.

Here is some C++ code:

  1: class A
  2: {
  3: public:
  4:     A();
  5:     ~A();
  6:     void f();
  7: };
  8: 
  9: // an example of implementation inheritance
 10: class B : private A
 11: {
 12: public:
 13:     B();
 14:     ~B();
 15:    void g();
 16: };
 17: 
 18: 


Following is some Python code:



  1: import os
  2: import sys
  3: 
  4: def main():
  5:     filepath = sys.argv[1]
  6:     contents = open(filepath).readlines()
  7:     print 'Number of lines: ' , len(contents)
  8: 
  9: if __name__ == '__main__':
 10:     main()


A Haskell code example:



  1: double:: Integer -> Integer
  2: double x = x + x
  3: 
  4: square :: Integer -> Integer
  5: square x = x * x
  6: 
  7: main = do
  8:          print $ square 10
  9:          print $ double 20
 10: 
 11: 


Some JavaScript:



  1: fucntion f()
  2: {
  3:      alert('Hello World');
  4: }
  5: 


 



Some HTML:



  1: <html>
  2:   <head>
  3:     <title>Hello World </title>
  4:   </head>
  5:   <body>
  6:     <p> Don't Panic </p>
  7:   </body>
  8: </html>
  9: 


Some CSS:



  1: .header
  2: {
  3:   forground-color: black;
  4:   background-color: red;
  5:   text-size: 20;
  6: }
  7: 

I guess this is more than enough for me. I am happy it works nicely.

No comments: