Wednesday, March 24, 2010

Coding Rule

Here, i decided to write my coding rules to code as i prefer, subsequently.

1. In any function or procedure body don't write more than 40 rows.
It can help you view entire function in 1 page.
2. Use 0 function status value on perfect success, 1< on application errors, -1 or -1> on runtime errors.
3. Use layer or interface as soon as possible.
This can help you make updates on online apps.
4. Always log. On every start of a function, log parameters and after generated result, log result
This is your key to secure coding.
5. Naming convention is key to fast coding. Create your own or pick any from experts' templates

Sunday, March 21, 2010

Google Maps - /* Guardian removed escaped content */

Last week, while i was loading Google Map in intranet web site, there was a syntax error in javascript loaded from http://maps.gstatic.com/intl/en_ALL/mapfiles/208a/maps2.api/main.js, and was not showing google map.
I found that firewall replaced some codes with "Guardian removed escaped content" text. I told our security deparment to unblock gstatic.com, i got rid of the problem. We use SmoothWall fire, it's latest updates were changed or configured to replace javascript comment with the text. Maybe this post can help someone who faced the same problem with me :)

Wednesday, January 20, 2010

How to include .net offline installer in setup projects

When we try to install VS.NET Setup project to another computers it requires .net framework installation files to be downloaded from internet. When connection is slow or no connection it's headache.
It's made easy and perfect in VS 2008 without any custom bootstraps. To do follow these easy steps.
Right click on Setup project's name, and click on Properties menu. So you will see following window.



Click Prerequisites button and you'll see this window.


Check required components from the checkbox list, select 2nd radio button named 'Download prerequisites from the same location as my application' and click OK to complete. I offer you check Windows Installer 3.1.

After all rebuild your setup project and you will see DotnetFX35, WindowsInstaller3_1 folders in your output directory(Debug or Release).
When you run setup.exe, it will check WindowsInstaller3.1 and install it if not present; this requires system reboot. After rebood, it will check .net framework and install if not present, and then it will install main application.

That's all folks