String literals in C#

25 December, 2009 | | 1 comments |

Share |
I'm sure a quick peek at the subject of this blog post might make C# enthusiasts think of a mundane topic with nothing to offer. But contrary to that, it has much more to enlighten you. So just read on ...



Strings in C#



Lets clear some of the dare-bare basics regarding Strings(which we thought we knew) in C# :

Strings are reference types used to contain Unicode text.

C# supports two forms of string literals :

1] Regular string literals

A regular string literal consists of zero or more characters enclosed in double quotes, as in "hello", and may include both simple escape sequences (such as '\t' for the tab character) and hexadecimal and Unicode escape sequences. This is the most general form of String which we all use everyday in our work.

Some examples :

String s;

-------------------------------------------------------------

--> s = "This is String";

O/P : This is String

-------------------------------------------------------------

--> s = "Hello \t world";

O/P : Hello world

-------------------------------------------------------------

--> s = "My name is \"Hardik " + "Shah\"";

O/P : My name is "Hardik Shah"

-------------------------------------------------------------

As noticed above the following backslash character constants are used frequently while getting a particular O/P in your required format :

| \n | \t | \v | \b | \f | \\ | \" | \' |

Also if you have a large string than you have to append string parts using the '+' operator.

To win over this situation, we have another type of String literal i.e. Verbatim string literals.



2] Verbatim string literals
A verbatim string literal consists of an '@' character followed by a double-quote character, zero or more characters, and a closing double-quote character. So here we have the added advantage that the characters present between the two double-quotes are rendered the way they are and no white-spaces are truncated. Also a lot more ....

Some examples :

String s;

-------------------------------------------------------------


--> s = @"hello world";

O/P : hello world

-------------------------------------------------------------

-->
s = @"Division is (a\b)";

O/P : Division is (a\b)

-------------------------------------------------------------

--> s = @"append this type " + @"in this way";

O/P : append this type in this way

-------------------------------------------------------------

Note : ["] in Verbatim string literal is [""] or [\""]


Applications of verbatim string literals :

1] Include a large paragraph of text without using '+' operator.

2] Multiple lines of HTML code can also be used using this type.


Post a Comment

Product Review : The Google Chrome OS

20 December, 2009 | | 1 comments |

Share |
A very bold and unexpected announcement by Mr. Sundar Pichai, Engineering Director, Google on 7th July, 2009 made headlines in the I.T. industry worldwide and subsequently across all forms of media. That was the announcement of the Google Chrome OS. You can read about it Here and Here. The OS is set to release in the second half of 2010 initially for Netbooks but the buzz currently is so high that you see every Tom and Jerry coming with his version of the story. But indeed, the topic is so very intuitive and exciting. Developing an open-source and freeware OS which boots in seconds and delivers rich surfing experience with the Google Chrome browser at the heart of the OS is surely worth an applause. Add to it, Google also offers other valuable web services spanning across E-mail, online storage, ads, custom search, socializing, feeds, source codes, etc.

Guess what, whenever the offering is free unlike Microsoft's offerings, people forget the skepticism and the anticipation is great. And it's true in this case as well, even before the working ALPHA of Google Chrome OS hits the tester's basket rumors of Google having talks with H/W vendors like Dell, Acer, HP, etc regarding support of its OS to launching its own version of its Netbook bearing its OS just refuse to die. Google just released its source code developed till date on its Chrome OS and a couple of enthusiasts were quick to compile it and get a VM(Virtual Machine) image out of it. It also happened very quickly that a friend of mine passed this very precious stuff to me and I was prompt to try and put a review on it, though it took a lot of annoying time to get things to work. So before I start with the review I think reading a bit to clear some fallacies about Chromium projects, Chromium, Chromium OS and the Google Chrome OS would help. Perhaps this link Here will suffice.




So here I go with my very first review of Google Chrome OS :

  • The built is that of Linux on GNOME environment(written in Gtk+) with source code procured by Google from the open-source community under the GNU and GPL.
  • The OS currently boots with the presumption that you have an active Internet connection and you are kind of an user who spends a major part of his time over the Internet.
  • The OS boots up with the login screen which takes your Google Account and password to begin. When done the browser shows up, which cannot be escaped and it logs you straight into your Inbox(if you have one).


Google Chrome OS

Google Chrome OS

Google Chrome OS
  • The browser works in a Sandbox architecture which is a core part of the OS to enforce a strict security regime. So no OS level or desktop applications tolerated like in Windows !!! But the browser comes equipped with all basic features like bookmarking, download manager, incognito mode, crashed tabs recovery, proxy settings, etc.
  • The browser has a special tab on top-left for access to all valuable web services like Google Apps, Gmail, Twitter, Facebook, Youtube, etc and others if needed can be added to the list. So needs like working over Office documents, mails, viewing video, social networking are easily sufficed.
  • The user doesn't have access to the system files explicitly but he can save and access any files there if he wants from the browser.
  • The browser can also bear a Theme from many possible sources.
  • So eventually, it's the browser which becomes the cynosure.


Google Chrome OS


Google Chrome OS


Google Chrome OS

Google Chrome OS

Google Chrome OS

Google Chrome OS

Google Chrome OS



SHOCKING TRAUMA !!!

  • What was really surprising when I checked the additional configuration options deep down in the browser was that the OS keeps room for the user to install other browsers like Firefox, Opera, etc and you can even set them to default.

Google Chrome OS
  • The second piece of surprise was that the Google Chrome browser offers a choice on the default search provider. Yes, it's true !!! You have a choice of Google, Yahoo! and Bing at the moment.


Google Chrome OS
Well if the above two surprises does survive to find its place at the FINAL than all fingers up for Google for developing an unbiased and altruistic piece of software for the user community.



Post a Comment

A Guide to SQL Server Management Studio 2005

19 December, 2009 | | 0 comments |

Share |
Like a lot of my friends and followers knew from my Twitter and Facebook updates, I had enrolled for a Seven Saturday series on System Administration courtesy - MumbaiIT Pro. The series which has its final session today saw some of the most prominent professionals from India's I.T. industry leaving their footprint in the minds of the audience with their enlivening and comprehensive coverage on the topics of their strength. The audience on the other hand were also enthralled and kept alive with contests and other Q & A sessions. Such a huge party in town and how can I stay behind? Having said this I had my intuition going strong before the start of this programme and hence I decided to volunteer in it with contributions in the form of Twitter updates and technical write-ups inspite of my jobbing blues and busy schedules.

The right time and the topic came and I decided to write in brief on SQL Server 2005 which I guess was a topic of my strength since I've been developing on ASP.Net using Visual Studio 2008 IDE and SQL Server 2005 Express as my back-end. So here I sat using all Office and web tools to get a writeup done but the climax turned out to be much more interesting - I just went on & on and ended up making a guide on the topic which now even included SQL Server Management Studio 2005 and a lot many sub-topics below it. A special thanks to Mark O'Neill - Managing Director of MakeUseOf whose "A Complete Guide to Twitter" was a very good source of inspiration to me and I emulated it quite well using Microsoft Office Word 2007. What ensued was that I have even applied for the post of a Writer on their portal.




Table of Contents in the Guide

1] Introduction

• What is SQL Server 2005 ?
• Anatomy of Database files
• Types of databases in SQL Server 2005
• A quick overview of the SQL Server Management Studio 2005 Wizard
• How to Login ?
• How to create a database using the Wizard ?
• How to execute a query ?
• Using diagnostic SQL Queries

2] Backup and Recovery

• Types of Backup
• Anatomy of Backup files
• How to take a backup ?
• How to restore from a backup ?

3] Security

• Creating Logins




You can download the Guide : Here




Transparency and Hover effects using CSS

04 December, 2009 | | 0 comments |

Share |
We all have witnessed the transparent and hover effects on websites. The very common approach which web designers and developers follow is that they make the object [transparent] when a mouse hovers above it. This transparency varies depending upon the canvas/button/image upon which the effect is to be applied. Myriad of Javascript codes are available over the web to apply these effects but it's even much simple to understand the concept behind it and use it by yourself. All you need is a few basics of CSS & HTML and that's it you're done !!!



Problem Definition : Apply transparent effect to an Image when mouse hovers above it.

Theoretical Approach : Under normal situation the transparency is absolute i.e. 1.0 (For Others) and 100 (For IE). When the mouse hovers above the image it should set the transparency to 0.4 (for Others) and 40 (For IE).


Transparency effects using CSS

Practical Approach : Define two CSS classes which do the above i.e one for applying the transparency and the other for setting it to normal. The event handlers for [onmouseover] and [onmouseout] can be handled by inline Javascript.

CODE Snippet :

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>** Transparency Effect Example **</title>

  5. <style type="text/css">
  6. .fadein
  7. {
  8. filter:alpha(opacity=40);
  9. opacity:0.4;
  10. }

  11. .fadeout
  12. {
  13. filter:alpha(opacity=100);
  14. opacity:1.0;
  15. }
  16. </style>

  17. </head>
  18. <body>

  19. <img src="Search.gif" alt="Search Image" onmouseover="this.className='fadein'" onmouseout="this.className='fadeout'" />

  20. </body>
  21. </html>


Note :
  • Internet Explorer takes the 'filter' property as mentioned in the CSS class to render the transparency. Rest all browsers accept the 'opacity' property.
  • Maintain the order of the property as mentioned in the CSS class. Interchanging it will result in the effect ceasing to work in IE.
  • Avoid using double quotes ["] for the properties in CSS as it malfunctions in IE.



More HOVER effects using CSS pseudo-classes : Here



Post a Comment

Different ways of accessing a CSS class

03 December, 2009 | | 0 comments |

Share |
CSS(Cascading Style Sheets) in an asset to our web. Apart from being ubiquitous it's also indispensable for enterprise level web projects. No surprises, web designers and developers find themselves facing questions on it when they appear for an interview. Yeah, it's that important !!! If you've still not seen what CSS does then you go [Here]. Quite frankly, CSS 2.0 has evolved very well with a lot of new properties added to it along with new concepts like Pseudo classes, etc. A majority of 21st generation browsers like IE 7, Firefox 2.0, Chrome 2.0(stable), Safari, Opera 8.0 and above have inherent support of CSS 2.0 and some even support v2.1. The only exception to the rule is IE 6 which I don't believe stands in the league but if you still feel otherwise then you seriously need a dose of Mozilla Firefox !!!

I've seen numerous examples of internal and external CSS being explained over forums and across many websites but rarely does any of them explain the different ways by which you can access a CSS class. So I'll explain it here...



Option 1 : You can define a class named after the type of the HTML [container] element

Result : The style will be applied to all the elements of the same type

Example : The DIV and SPAN tags

CODE Snippet :

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <style type="text/css">
  5. span
  6. {
  7. font-family: Calibri;
  8. background: Aqua;
  9. text-align: center;
  10. }
  11. </style>
  12. </head>

  13. <body>

  14. <span>Example 1</span>

  15. <br />

  16. <span>All SPAN tags will have the same attributes</span>

  17. </body>
  18. </html>




Option 2 : You can define a class using an identifier prefixed with a '.' operator. Do not include spaces in the identifier and keep it unique. You can then access it using the 'class' attribute of the element to whom you want to apply this style to.

Result : The style will be applied only to those elements which [reference] this identifier

CODE Snippet :

  1. CSS :

  2. .style1
  3. {
  4. background: Aqua;
  5. text-align: center;
  6. }

  7. HTML :

  8. <span class="style1">This is Example 2</span>




Option 3 : You can define a class using an identifier as above but prefix it with a '#' operator. You can then access it using the 'id' attribute of the element to whom you want to apply this style to.

Result : The style will be applied only to those elements which [has] this identifier

CODE Snippet :

  1. CSS :

  2. #style1
  3. {
  4. background: Aqua;
  5. text-align: center;
  6. }

HTML :

  1. <span id="style1">This is Example 2</span>



Now having learnt the above three methods of accessing a CSS class, its time to apply multiple classes at the same time.

Option 4 : You can define multiple classes with unique identifiers as in Example 2 and then apply the classes to the elements in their 'class' attribute seperated by a space.

CODE Snippet :

  1. CSS :

  2. .style1
  3. {
  4. background: Aqua;
  5. text-align: center;
  6. }

  7. .style2
  8. {
  9. font-family:Calibri;
  10. }

HTML :

  1. <span id="style1 style2">This is Example 2</span>

Product Review : Zenith Z-Book

25 November, 2009 | | 1 comments |

Share |
Zenith seems to be living to its old caption -- MNC quality, Indian prices. With its current range of products it's set to achieve a good share in the end-user laptop and desktop segment. Add to it that the company already has some trusted customers in many educational institutions and enterprises where it offers a volume discount and other benefits in the form of license software. And just when I say this, it has come out with another revolutionary product - The Z-Book.

So why is it revolutionary ? Many reasons actually, starting right from a new concept to this-is-what-customers-always-needed to it's-the-next-best-thing at an unbelievable price. Put into simple words, it's a PC-cum-Laptop at a very nominal price. For those cynics and skeptics who cannot hold back thinking about the price, it's into the nervous twentys. Now getting into the skin of the product because that's where all the magic lies. It's actually an Atom processor powered Netbook weighing just 1.1 kg which can be docked on a docking station so as to be used as a desktop. So what big is this rocket science .. ? Hmm, you guessed it right but it does have something in it to be called a revolutionary product. For example, the LCD is a 22" wide screen LCD which has inherent support for TV viewing. So obviously you don't need to pay for a TV Tuner and the LCD becomes a TV when the Laptop isn't docked. A good point to note which even you'll notice from the looks of the Netbook -- It resembles the Apple Macbook. Below is the configuration of the Netbook :

  • Intel Atom Processor 1.6 Ghz
  • Intel 945 Mobile Chipset with integrated graphics
  • 1 GB DDR2 RAM
  • 160 GB SATA2 HDD
  • 10.2" wide LCD
  • 2 USB ports, Wi-Fi and Bluetooth
  • Web-Cam, Inbuilt Mic, Memory card reader


Zenith Z-Book
Currently, this product is available across retailers affiliated with Zenith in Mumbai, INDIA. To contact one of the retailers follow Here.


Below are some of the snaps which I've taken just to ease out the experience of my readers regarding the product under discussion.


Zenith Z-Book

Zenith Z-Book

Zenith Z-Book

Zenith Z-Book


Sun MS's VirtualBox 3.0.10 is out

08 November, 2009 | | 0 comments |

Share |
In contrast to all other VMs including Microsoft's Virtual PC 2007, Cisco's VM Ware - Sun Microsystem's Virtual Box surely reigns supreme. Probably it may be the size of the BINARY/INSTALLABLE or its platform independent trait or its ease of use or its stability, everything is just CLASS EXTRAORDINARY. Speaking on its EASE-OF-USE it's very easy to say - Any computer literate individual can use it and run MULTIPLE OPERATING SYSTEMS over your current one.


VirtualBox 3.0.10

And with it is latest release - version 3.0.10 its become even better. Probably is you're not a Windows fanatic and running Apple Macintosh or Linux Ubuntu 9.04 or say any other OS, the latest release has got bug fixes and stability added to its CORE ENGINE without its size getting inflated. So a lot of reasons why you should migrate and if you're a begineer than you should better get your hands on VirtualBox 3.0.10 then its previous versions.

Do not forget to backup the .xml file containing to configuration settings of your current VM from your "Default Machine" folder while migrating to the latest version. You can maintain your previous VM settings and avoid any inconvinience while deploying it in the latest version.

Now just to let my readers know, I've got my own portal Here where I go LIVE with all my stuff like DOWNLOADS, BLOGS, TWEETS, ARTICLES, etc.




You can DOWNLOAD VirtualBox 3.0.10 in the following manner:

Navigate Here ---> Navigate to "Developer Tools"




Read more on the BUGS FIXED in version 3.0.10 Here.

My Windows 7 Club Party experience

03 November, 2009 | | 2 comments |

Share |

My friends will pronounce me a SINNER if I don't share my Windows 7 club party experience. The party was strictly-by-invitation despite being opened to the public for registrations. At the most, only 25 early bird registrations were approved from general public. Lots of surprises, shockers and bouncers expected by everybody since the party was held at an exotic location - The Boat Club, Mumbai during evening and the audience were explicitly asked as to what their dinner preferences were - Veg. or Non-Veg. Also the audience were given to choose over the web-site whether they would like to participate in installing Windows 7 which never really manifested. So many parameters set before the party and did it live up to it's surprise ... ? Yes, with a lot of BOOZERS, SHOCKERS, SURPRISES and much more...


Firstly, the party venue turned out to be a chill-out hotel and a bar with a kind of a Jacuzzi theme. Surprises surely for everybody coz they(including me) previously thought of a gigantic hall in their mind. Secondly, the organizers had Tablet Laptops and touch-based LCD-cum-PC to let the audience experience the very touch capabilities of Windows 7. Surface Lagoon, Microsoft Maps, Windows XP Mode, Office 2010, Aero interface, Live Essentials, Security Essentials, etc were the other Apps. and features which the audience were enlightened about. From delicacies and relishment point-of-view we had starters and a choice of beer/cold-drink/juice. The crowd was quite sophisticated owing to the very fact that the party was held in Bandra, Mumbai. Overall I'll rate this party 4/5. A nice treat indeed.



Now witness the party scenes in PIXELS :



Hardik Shah [Guru] with Aviraj

Windows 7 Club Party

Windows 7 Club Party

Windows 7 Club Party

Windows 7 Club Party

Windows 7 Club Party

It’s going to be a war of Operating Systems this November

29 October, 2009 | | 2 comments |

Share |
Having put the title of this blog it’s very easy to predict what I’m after. But I can’t resist myself from writing this blog, I’m at the matrix of witnessing a very fierce competition in the OS market. Yes, it’s true and the participants are some very aggressive, muti-billion dollar companies like Microsoft Corporation, Apple Incorporation, Canonical Ltd., Sun Microsystems, etc. Now when you have so very powerful competitors it’s bound to generate sparks and it’ll reflect in all parts of media. Frankly speaking and the way its visible for the moment, there are three parties vying for a share in the OS market – Microsoft, Apple and the open-source enthusiasts. The latter among the three is just growing upon time with backing from some big Fortune 500 companies like Sun Microsystems, IBM, Canonical, etc. So without wasting much time let me put a glint on what each participant has got.


Microsoft Windows 7 :

Microsoft Windows 7The Lucky 7 bells have already started ringing at the world’s number ONE company and the leading software giant in Operating Systems. With Windows 7 it again intends to steal the show and it seems it’ll succeed probably in a better fashion than at the time of Windows Vista. Virtualization, dynamic UI, robustness in terms of security, speed and much better hardware available this time in contrast to Vista is enough to conclude that Microsoft is all geared up to reign supreme after failing last time. Truth be told Microsoft has played all cards of the game this time very shrewdly cause -- The BETA, RC and RTM of Windows 7. And the people loved & relished testing it and won the hearts of all. From marketing point-of-view its free Windows 7 upgrade for a part of a crowd and discounts for the underprivileged. Furthermore, propping up Windows 7 are products which are Microsoft’s own creations – Visual Studio 2010, IIS 7.5, .Net Framework 3.5 SP1, Live Messenger, Office 2010 and Web Installer. Also if the leading I.T. survey giants like Gartner and IDC are to be believed Windows 7 is just inevitable for all. A very good point to be noted in their report, with every dollar spent on Windows 7 it’ll return a corresponding 8.4 $.


Apple Macintosh Snow Leopard :

Apple Macintosh Snow LeopardOne common thing can be easily drawn out between Apple’s CEO Mr. Steve Jobs and Macintosh -- Both are CLASS EXTRAORDINAIRE. And who’s there to challenge this wise saying especially when Apple has already proven itself by becoming the best stock performer of 2009 and that too in the times of depression. It’s also a matter of fact that Apple has just not changed the meaning of software with Leopard but has changed the entire way of computing. No doubts Apple's Macbook and iPhone are an asset of the privileged class and it’s fan followers just hate even thinking about Windows. Also acknowledge the very fact that Apple has a very limited footprint in OS market but a very strong and cent percent footprint in whatever it does, let it be the hardware or software. Add to Apple’s advantage that it has cent percent control over its Macbook hardware and hence can choose to cater to only the privileged class and demand a good ransom. But it has done really well till now and with Snow Leopard available as a petty 29$ upgrade it's set to ROCK ON AGAIN. Personally speaking, I feel really impotent while speaking on the very genetics of Apple’s OS since I myself don’t have an Apple Macbook.


Linux and its many variants :

Linux Ubuntu 9.10For a majority of PC users, its just a handful of users in case of Linux but underestimating it will be the biggest mistake. True with whatever I’ve said the OLD WINE just keeps on getting better and better with refinements, feature additions and a much better hardware support. So many variants are available in Linux that I’m short of time and thoughts as to which DISTRO I should write on. Talking about Ubuntu 9.10 which is one of the most liked versions of Linux, it is set to be released this 29th October, 2009 and it’s a much awaited release since a majority of features are set to be revised. Inherent features like Voice-over-Messenger, Open-Office, Mozilla Firefox 3.5.3, etc are a treat for the open-source followers, cost-cutting enthusiasts and those who believe in the very notion that software is our birth right and should be available free. Long live the ideology of Linux developers and its followers which are just growing day-by-day. Adding to the Linux party, even Google with its Google Chrome OS will be seen as a credible and a prominent competitor within a year.


My last blog on Windows 7 before it releases tomorrow

21 October, 2009 | | 0 comments |

Share |
Windows 7, Windows 7, Windows 7 and on & on goes the poem. Sometimes I feel I had enough of it since January(when the BETA released) but the very moment I get my hands on it the learning curve and the experience just keeps on getting better and better. So Windows 7 enthusiasts and it's bitter critics just watch out this blog coz I'm having stuff for both of you and even who stand out as an exception !!!


Windows 7 release

Such is this peace of OS and written so well by it's developers that it has spurned a myriad of threads on all Forums regarding the very granularities of it's features. Features like Aero, Home Network, Win XP Mode, etc has invoked a sense of curiosity and desperation among application developers and even those on web to replicate the same in their projects. And guess what, to cater to such a vast audience Microsoft has played indeed well - thanks to it's Windows 7 SDK, Visual Studio 2010 and Web Platform Installer. Propping it side-by-side is another very inherent feature in Windows 7 which most of the audience including the developer community tend to forget - .Net Framework SP1. Yes, you read it well, no need to read that line back but if you still want to, here you go - .Net Framework 3.5 SP1 goes native on Windows 7.

Trust your intuition, prediction and your wildest judgement and they all are going to be true - Microsoft is planning to flood .Net Apps to complement Windows 7 bigtime. Infact, it's not in the planning stage but the planning has already manifested cause - Microsoft has launched "Windows Market Place" and "CodePlex" for Mobiles and PC's. So all roads leading to the very inevitable conclusion - "Windows 7 is going to be one of the biggest release in the history of software". Well cynics still won't agree ... !!! So here's the official IDC report and the Gartner report to substantiate my claims.

So with Windows 7 set to release tomorrow I enumerate some very obvious and not-so-obvious facts and bits on Windows 7 :
  • A majority of audience who've tested it has labelled Windows 7 - "It's Windows Vista made perfect".
  • With Windows 7 Microsoft intends to grab it's lion's share in OS market after Vista sapped it. It might sound really surprising but Microsoft considers the fact that Windows 7 will succeed because of the success of Windows Vista.
  • Analysts, volume-licensing partners and other major vendors say Windows 7 is the most polished version of Windows ever and that businesses should not wait to deploy it till it's SP1 get's released.
  • The world's leading information technology research and advisory firm - Gartner has termed Windows 7 inevitable for all. With every dollar invested in Windows 7 businesses world-wide will earn a corresponding 8.4 $.

AMEN.

Pre-compilation and code-hiding in ASP.Net

18 October, 2009 | | 0 comments |

Share |
ASP.Net fanatics here comes something to relieve you from the pain and frustration. Do you always wanted to get your ASP.Net application/web-site loaded faster or you always wanted to hide your code from your not-so-very-trusted-client or say both ? Tough questions have the simplest of the answers and I'm not going to contradict that proverb by any chance. But before I dive into the question just let me clear some of the much needed basics. So just read on....


The very first time a request is sent for an .aspx page the .Net Framework residing on the computer which physically hosts these files compiles it and generates the corresponding .dll files i.e. assemblies which are the results of JIT(just-in-time) compilation.

In other words, the .aspx page has been serialized in the form of a .dll file. These .dll files are used in subsequent requests by de-serializing them to render the HTML to the user by the .Net Framework.

So the real catch is whether you can avoid the initial compilation and if yes the code i.e. your .aspx page can be hidden or not ?


Now assuming that you have Visual Studio 2005 or higher and IIS configured with your .Net Framework you can follow the below mentioned steps in Command Prompt to get the pre-compilation done :

1] You have to navigate to the right destination of your .Net Framework 2.0 :

cd "C:\Windows\Microsoft.NET\Framework\v2.0.50727"

2] You have to then compile your project/web-site folder with the following command :

aspnet_compiler -v /GuruSample -p "C:\GuruSample" "c:\Output"

where,
-v /GuruSample --> The virtual path to the project/web-site
-p "src" "target" --> The absolute physical path to the project folder and the location of the target files

NOTE:

Giving the "-p" switch means the IIS metabase will *not* be referenced during pre-compilation. Also it means the target path is mandatory.


Once the above command is executed the following files and folders will be generated at the target location :

  • PreCompiledApp.config
  • Web.Config
  • GuruSample.sln
  • Default.aspx
  • A "bin" folder will also be generated which will be having the pre-compiled .dll file(s).

Your process of pre-compilation is done and now you can safely copy the target files and folders to the "wwwroot" folder of your IIS directory if you're currently experimenting it in your own PC. You can view the .aspx page using the "http://localhost/Default.aspx" switch in your browser.

NOTE:

1] Any changes made to the above files or folders needs re-compilation with all the above mentioned steps.

2] The .aspx file after pre-compilation need not be present. This helps in code-hiding.

3] You can download my "sample project folder" as used in the above explanation Here.

For MSP's - How to clear the probation period

09 October, 2009 | | 1 comments |

Share |
Congrats and regards to all new MSP's. Sorry to be so straight to the topic but for you the intent is very much clear for now -- Score 150 points to stay in the league of MSP's.

'150 points' that's what the ADMIN have asked for and from my experience I can tell you that I had to literally screw my schedules apart to get it. The result - Bad performance in ACADS and a lot of sleepless nights. But that was the story then but I can assure you that you will surely not have to go through this - COURTESY ME.

Following are the list of activities(in the order of less work and more points) which you can pursue to see yourself besides me i.e. a permanent MSP (till you graduate) and then an MSP Alumni. So here I go ...


1] Imagine Cup 2010 :

Imagine Cup is a wonderful initiative and a technical competition held every year to promote display of expertise in various fields and learning to get there. Any active student can participate in it. Some of the categories include:

--> I.T. challenge
--> Software design
--> Inter-Operability
--> Software development
--> Game design and many more...

For more information you can check out www.imaginecup.com.

Registering for Imagine Cup in any of the above categories and going past the 1st round can get you a whopping 100 points. EASILY said then DONE but try yourself and see for yourself. Though not many qualify past the 1st round and those who do cannot cope with the 2nd round. A matter of fact, I qualified to the 2nd round of I.T. challenge which clashed with my Exam dates !!!

Coming back, you can also get participants to join this competition(in groups of 40) and win points from it.

You can create your own account with student-partners E-Mail and your ID part of your E-Mail becomes your "Referral code". For example, in my case "hardikguru".

I had penned down a blog on the same probably last year to promote it. You can check out Here.


2] Sessions :

A variety of sessions can be conducted to promote the MSP program, initiatives of Microsoft, any particular technologies of Microsoft like .Net/WPF/Silverlight/etc. The target audience can be students or even teachers.

But do keep in mind that if you conduct these activities under your colleges' Tech-Club than you would be at any added advantage i.e. you can keep your Tech-Club abuzz. Also on having a particular amount of activities in your Tech-Club you are entitled to BENEFITS so keep that in mind. Proofs in the form of PHOTOS, feedback forms, etc are required so check out the ACTIVITES TAB of our student-partners web-site.

Many other forms of sessions are there which include DevCon wherein you've got to conduct a day-long session on myriad of topics with a team of speakers and the mass audience should go into hundreds. Assistance in any form can be procured from "studpart@microsoft.com".

Other forms like Rhythm Sessions, HOL(Hands-On-Lab), etc can be learnt and understood from the ACTIVITES TAB of our student-partners web-site.

3] Microsoft Live@Edu and MSDN-AA campaign :

For Live@Edu you can check out my own blog dating back 10 months(At a time when I was learning to BLOG) Here.

You can also check out videos and any materials for the same Here.

Any questions on 'How-to' and 'What-to' can be forwarded to "livein@microsoft.com"

For MSDN-AA you can check out Here.

You get 140 points for deploying any of them in your own college or any of your peer.


Note :
Any pre-requisites for any activities are mentioned very clearly in the "ACTIVITIES" TAB of our student-partners web-site.

Besides this blog I'll be coming with another BLOG later on the benefits which you derive being an MSP. But for now don't even think about it coz that might lead you astray. FOCUS on the points and enjoy all the activities. Grab what you can.

"Do you have it in you to make a difference ?" -- The MSP Program caption

Outsmart your college/office FIREWALL now....

05 October, 2009 | | 1 comments |

Share |
Are you miffed with the Systems Administrator blocking all your downloads and the so-very-important social networking sites like Orkut, Facebook, LinkedIn, etc and Torrent clients in your college or company ... ?

If yes, then just read on and crack the LOGIC behind the BARRIER and harness the same LOGIC to KILL it. Colleges/Organizations usually have a SQUID firewall installed on their Linux Server through which all your HTTP requests get parsed. Such extra-ordinary and powerful is this piece of software that it deserves a blog on it. Here are some of the salient features of SQUID firewall from knowledge point-of-view:

  • It can populate all hosts currently on the N/W with their N/W statistics like the last request they made for a particular link and so on.
  • Specific permissions can be granted and revoked to hosts on the N/W based on their IP, Subnet Mask, port, etc.
  • Basically all HTTP requests are routed through the SQUID firewall so it can censor all URL's which the hosts demand. Specific keywords like xxx, orkut, game, facebook, s*x can be blacklisted so the URL's will be blocked.
  • File level access-lists can also be defined to block/allow certain formats like '.exe', '.avi', '.wmv', etc.
I'm sure by now you've understood why you get the 'Permission denied' or 'Access denied' warning when downloading files with the above mentioned formats or while surfing through URL's which contain keywords which are banned. Excellent logic right .. ? But do not forget that there is another part of the world who live to challenge this piece of software and the citizens here also have their own band of followers including me. :)

So now that we're through with the LOGIC let's work to reverse-engineer it. At first glance this challenge might look really invincible but that's the way challenges are supposed to be right ... ? Let's risk an attempt and than we'll decide our own fate.

1] SQUID firewall like I had emphasized above screen the URL's of hosts. So the very obvious solution is that we need something to encode them. Let's move further.

2] Assuming URL's are encoded than what about my file downloads which I have to download? OK so let's make an exception in this case or say an 'if else' clause comes into picture if you're kind of an programming freak. So if files are there in the URL than they should be rendered as they are.

3] Furthermore, there may be more constraints as well which may have been defined at the SQUID firewall by the developers and kept secret, so to escape that you need to route your traffic through a completely different channel than the conventional one.


Now to apply all of the above points either you can use a service provided VIA a web-site or VIA a desktop application. You can also setup your browser to do the above (not all of the above but it may do the trick in some cases).

  • There are web-sites available which can come to your rescue like www.avoidr.com, www.123hideip.com, www.forextail.co.cc, www.netbypasser.info, etc. These are proxy web-sites which offer free service to you. Just paste the link in the web-site and OFF YOU GO. You can search for more on Bing for better results.
  • You can use desktop Apps. like UltraSurf to so the same. You can download more Apps. of the same subject Here under the 'Hacking and Sniffing Tools' section.
  • You can also setup your browser's N/W configuration to manual with the following settings:
HTTP Proxy IP : 192.168.0.201 Port : 3128
Use the above settings for all possible protocols like SOCKS, SSL, FTP, etc.


Note:
  • Apps. and certain web-sites have their own restrictions like files exceeding 20 MB in size cannot be downloaded.
  • Beware while searching for results which include keywords like 'Proxy' coz the keywords might themselves be banned by your Admin.
  • You can use the same technique of setting up your N/W configuration using a HTTP proxy IP and proxy port with Torrent clients like uTorrent, BitComet, Bear-Share, Limewire, etc. The settings are available beneath any of the menu-items so be patient. You can get more proxy IP's and ports Here and Here.
  • SQUID firewall usually are installed on UNIX/Linux but it's equivalent on Windows platform also work on the same LOGIC so the above SOLUTION is applicable even there.