February 2012
1 post
When to use unit testing mock objects ?
Usually when to write unit test, you are trying to test if a small piece of code is working as intended. But there are some times when part of that small code depends upon third party web service or database connection that are simply out of your control.Thats when you use mock objects which would behave exactly as you tell them.
Following is simple code example that would explain it further:
...
October 2011
1 post
How to use Subversion , nant & cruise - go build...
Use subversion as source code repository. All working code goes inside /trunk folder. Set Cruise- Go server to continuously poll subversion server for modification and if it senses change, then cruise agent pull all the code. You can do this through setting pipeline in cruise configuration file.
NANT build script themselves are part of source code so they gets pulled in whenever cruise agent...
September 2011
1 post
August 2011
2 posts
How to use C# inside nant build scripts
I use c# to take input from user (via command line) to take certain actions in build script. Here’s code that ask name of web app and will copy necessery files to target directories. <target name=”AskAndDeploy”> <script language=”C#” prefix=”DNSNamePrefix” > <code><![CDATA[ ...
How to use continuous integration for asp.net...
How i use continuous integration server for automatic & faster delivery of .net projects What you need : 1> Go (Cruise) continuous integration server 2> Go Agents - these are programs that actually run your tasks 3> SVN - Version control system 4> NUNIT - Unit testing framework 5> NANT - Build scripts for Deployments Set up Visual Studio projects using TreeSurgeon....
June 2011
1 post
May 2011
1 post
1 tag
log files rotator for nginx on windows
I wrote this code for rotating nginx log file on windows server. I installed nginx as windows service to serve loads of static content hence it writes lots of entries in log files. So i wrote this code to stop nginx for few seconds, move log files to new location and then restart it. It requires .NET 3.5, Log4net and file called service.config (which has config details for log rotator)...
October 2010
1 post
ASP.NET Session timeout bug
Wondering, Hitting your head against wall why asp.net sessions are timing out too soon.
Probably the directory to which you are making changes (adding/ editing / deleting files) is inside web applications folder.
If you are creating/deleteing files and/or folder in temp folder which is inside applications diretory on webserver, then application will be recycled by IIS and hence user will loose...
February 2010
1 post
How to turn off Google Buzz?
Wondering how to turn off Google Buzz?
Here’s easy way :
Just move down to bottom of Gmail screen and click on “turn off buzz” link
January 2010
3 posts
.NET Tip : How to print all property names &...
Heres .net code
public static void PrintClassMemberValues(object source, System.IO.TextWriter tw) { Type sourceType = source.GetType(); tw.WriteLine(“——————- ” + sourceType.Name + ” ——————- “); foreach (PropertyInfo sourceProperty in sourceType.GetProperties()) { tw.WriteLine(sourceProperty.Name...
Enable GZIP Compression in ASP.NET Pages
GZIP Compression in ASP.NET Pages
public static bool IsGZipSupported(HttpContext Context) { string AcceptEncoding = Context.Request.Headers[“Accept-Encoding”]; if (string.IsNullOrEmpty(AcceptEncoding) == false && (AcceptEncoding.Contains(“gzip”) || AcceptEncoding.Contains(“deflate”))) { return true; } else { return false; } }
...
.NET Tip : How to copy all property values from...
Do you ever wanted to copy ALL Property Values from one .net Class to another (Whilst Both of them having properties with similar names)?
Heres Method for that :
public static void CopyPropertyValues(object source, object destination) { Type sourceType = source.GetType(); Type destinationType = destination.GetType(); foreach (PropertyInfo sourceProperty in sourceType.GetProperties()) ...
October 2009
1 post
FOWA 2009 London - Kevin Rose speech
I attended FOWA London 2009 and it was really helpful in understanding how to make websites popular.
Following are some of the key points taken from Kevin Rose(Digg) speech about how to take site from one to one million
Reward users : Give visible & emotional rewards to user users Ex: Leaderboard
Keep It Simple : Remove features from your site , rather than adding new ones
...
September 2009
1 post
Unit testing frameworks For PHP
PHPUnit - I use this one in my projects. One of most popular unittesting tool Created by Sebastian Bergmann
SimpleUnit - Another popular PHP unit testing tool similar to Junit and it also supports testing web apps by emulating form submit , button or link clicks
Testilence
PHPSpec
lime
Apache-Test
August 2009
2 posts
Which php.ini does wamp server loads?
Wamp server would load php.ini stored in
It loads C:\wamp\bin\apache\Apache2.2.11\bin\php.ini
rather than C:\wamp\bin\php\php5.3.0\php.ini
1 tag
Programmatically creating wcf client using Nant...
You have created a WCF service.To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax:
svcutil.exe http://yourdomain/Service.svc?wsdl
This will generate a configuration file and a code file that contains the client class. Add the two files to your client application and...
July 2008
7 posts
1 tag
PHP Tip : How to Hide PHP Notice & Warning...
Handy tip for php programmers to hide php notice and warnings : // Turn off all error reporting error_reporting(0); // Report simple running errors error_reporting(E_ERROR | E_WARNING | E_PARSE); // Reporting E_NOTICE can be good too (to report uninitialized // variables or catch variable name misspellings ...) error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); // Report all errors...
Why price comparison sites should get deranked in...
Today morning i read post on devindra about how price comparison sites are hurting consumers and im totally agreed with it
There is definitely difference between comparing prices and reading reviews.These are two different things,but most price comparison sites as well as review sites are mixing them with each other and confusing users.
I personally never click on any link of kelkoo, shopzilla ,...
How to download del.icio.us bookmarks for offline...
I always wanted to save my del.icio.us bookmarks for offline browsing.This is to make sure that even if original webpage is unavailable , i will still have copy of it for offline browsing ;)
& today while surfing this list of amazing tools for del.icio.us, i found this tool called Bunnyhug updater that lets you download all del.icio.us bookmarks to your local machine. Sweet
I am going to try...
what do you want users to do immediately after...
Whats the first thing you want visitors to do after they signup with your website
here are some possibilities :
Invite their friends
Complete their profile
Import stuff from other websites
Explore best of the site contents
Why do we build websites / softwares?
I believe that softwares are build to make positive change in lives of humans.They are build to make somones live easy or to make someone happy.
Thus your website or software cant be succesfull, if it doesnt :
Make someones life easy or
Make someone happy or
Help someone to achieve their goals or
Saves someones money or
Make money for someone
Hello CakePHP
Recently i have been playing with cakephp & glad to say that its one of the best PHP MVC Frameworks
I have read many articles saying that CakePhp is slower than its competitor (mainly ZEND & CodeIgniter), but i think that performance of your application mainly depends upon how you have designed it/scaling it and not what you have used to build it.
Just my thoughts
If you want something done, ask the busiest person...
How true!
This is the best statement i have heard in years.
Its in the ebook getting real released by 37 signals and its just amazing.You can read this amazing book online for free.
June 2007
1 post
How to find out who are your target audiences
1> Using stumbleupon to find more about potential targeted audiences 2> Emailing friends & families and asking them what do they think 3> Posting on related forums where you can ask strangers about your opinions 4> Take guidance from people who are more knowledgable Updated on 28 June 2007 : 5> Make friends on social networking sites & ask their opinions
May 2007
1 post
Welcome to my Tumble log
This is my first post on tubmlr. I think this will be better than usual weblogs as i dont have write big posts ;) I must admit , I hate to write