Showing posts with label Tools. Show all posts
Showing posts with label Tools. Show all posts

Sunday, January 11, 2009

Best Source Code Formatting Plug-in for Windows Live Writer

I use Windows Live Writer to write the blog posts and it is one tool that I always have it installed. Since I write developer posts, sometimes I need to post code snippets and this would be easier if we use one of the many code-formatting plug-ins that are available. But personally, I prefer the Code snippet plug-in. You can get it here. Just look at how nicely the code is formatted.

By default, your code snippet can look something like this.

   1: public class TestClass


   2: {


   3:     public string TestProperty { get; set;}


   4:  


   5:     public string AnotherProperty


   6:     {


   7:         get


   8:         {


   9:             return "Nothing";


  10:         }


  11:     }


  12:  


  13:     public static void RunProgram(string item)


  14:     {


  15:         int i = 200;


  16:         if(i==0x23 && item == "krishna bhargava")


  17:             Console.WriteLine("This program is crap");


  18:     }    


  19: }






You can notice that the source code snippet is cut-off and the scrollbar should be used. Personally, I believe that this annoys the user to great extent. Readers like to glance at the code and derive their own conclusions, without actually reading it thoroughly. Thus, it is good to have source code listed something like shown below.





   1: public class TestClass


   2: {


   3:     public string TestProperty { get; set;}


   4:  


   5:     public string AnotherProperty


   6:     {


   7:         get


   8:         {


   9:             return "Nothing";


  10:         }


  11:     }


  12:  


  13:     public static void RunProgram(string item)


  14:     {


  15:         int i = 200;


  16:         if(i==0x23 && item == "krishna bhargava")


  17:             Console.WriteLine("This program is crap");


  18:     }    


  19: }




You can do that by going into the source mode and modifying the style on the container div. The source code is placed inside a div when the plug-in I mentioned is used. In the style attribute of the container div, remove the property height: 253px; (the height might vary or might not be present) and also remove the max-height property. You can otherwise change the max-height property to something you like so that you can still limit the size of the source code section. Also removing "overflow: true” property allows you to remove the scrollbar altogether.



Anyway, if you are looking for source code plug-in for Windows Live Writer and if you like the code formatting displayed on this page, then you should get the plug-in.



Formatting problem in Blogspot.



image



If you try to use the code snippet plug-in in Blogger hosted blogs, then the source code could look something like shown above. This is because the blogspot engine somehow inserts <br/> tags between each lines making them look very ugly. You can fix this by going to the blogger dashboard of your account –> Layout –> Edit HTML. Scroll down until you see some styles being listed. Somewhere in between, insert the following CSS style:





   1: br


   2: {


   3:     display: none;


   4: }




Then the result should be what you want it to be.

Thursday, December 11, 2008

Shoestring toolkit for startup projects


Integrated Development Environments

Database Environment

  • SQL Server Express 2008 (available in the above download page)

Web Framework

More Frameworks might be added based on requirements.

ORM

Testing

No code would be accepted without proper tests and high code-coverage. More on it during our discussions.

Source Control

Register with xp-dev.com and give me your username. I would later post the details on how to checkout the source code. I would also show you on how to work with the source control using TortiseSVN tools. All our source code checks into the xp-dev project repository. More details later. For now, download the SVN tools from here.

Additional tools

  • Code Analysis – FxCop
  • Text Editor – InType
  • Command Line - PowerShell (Pick your version - x86 or x64 based on your CPU)
  • XAML Editor - KaXAML (for some XAML/WPF/Silverlight learning)
  • Paint.NET – Graphics
  • .NET Reflector - I will give you later, when required.

Feel free to comment on what you think or if you have good general tools in mind, advice me.

Monday, January 14, 2008

What is the output of this C++/C Program?

When compiled using GCC compiler, can you tell what is the output of the following program?

#include
int main()
{
int y=10,p=20;
int num[10]={0};
int x=10,z=4;

num[-2] = -2;
num[10] = 10;
printf("%d\n%d\n",p,z);
}

This program is supposed to be compiled on SunOS, using GCC compiler. Running it on different machine might give a totally different output.

If you run this program, you would understand how dangerous is C++ arrays, if not properly coded. Ofcourse this program does not actually corrupt your system but it does corrupt one of the variables and at times this might be dangerous.

Courtesy: Got this snippet from Dr. Dave's class. But a different example. I really liked this simple program that conveys a very big idea.

Friday, December 28, 2007

trueBuddi Image Compressor

The pics we take with a digital camera are usually around 1.5-3 MB based on the resolution. I often waste time and bandwidth to upload such big images in websites like snapfish, orkut, facebook, flickr. I always wanted a simple utility that could be used to compress images in a folder. I wrote one software during my BE but did not carry it with me to US so I always had to use some Paint.NET or other Image Processing tools.
I started my new year coding with Image Processing tool - trueBuddi Image Compressor.
I would upload it on my website. It is very easy to use and is available
here
It requires .NET Framework 2.0 to run. Right now it compresses images within a specified folder and that too only those with .JPG extension.
Future revisions:
1. Individual File Compression
2. Image Processing Operations - Contrast enhancement, Brightness, Noise Reduction, Sharpening, etc.
3. Support for conversion among JPG, TIFF, PNG and other such types.
Ideas welcome. The tool is free to use and is not restricted with any kind of license. You can do a Reflector and anything that you want. Just do not change the title of the Frame.

Free Screen Recording Tools

I have been searching a lot for free Camtasia alternatives that would allow me to prepare screencasts. Till date I have found three good tools

1. Free Screen Recorder
http://www.nbxsoft.com/screen-recorder.php
Pretty decent tool, allows you to save screencast as AVI files. Best option is to download Vista Codec Package from http://www.free-codecs.com/download/Vista_Codec_Package.htm and in the settings choose XVID compression with as least quality as you want. You can record voice too.

2. DebugMode Wink
http://www.debugmode.com/wink/
A much more complicated software, allows you to store captures as SWF files. Lots of options but little bit uneasy to use.

3. CamStudio
http://camstudio.org/
Free and open source. But resource intensive. Good for high end systems.

Another good tool is ZoomIt by SysInternals. It helps you zoom particular portion of screen, would be useful when u want to show something more clearly, during presentations or screencasts. Free download from
http://technet.microsoft.com/en-us/sysinternals/bb897434.aspx

More on sysinternals tools, you get awesome little tools at http://technet.microsoft.com/en-us/sysinternals/0e18b180-9b7a-4c49-8120-c47c5a693683.aspx and they are all free. Amazing tools, trust me.