Archive

Archive for December, 2007

Ten things to do with IIS

28 December 2007 Steve 1 comment

Tip 10: Customize Your Error Pages
Although this is quite simple to do, few people seem to take advantage of it. Just select the “Custom Errors” tab in MMC and map each error, such as 404, to the appropriate HTML or ASP template. Full details can be found here. If you want an even easier solution – or if you want to let developers handle the mapping without giving them access to the MMC – use a product like CustomError.

Tip 9: Dive into the MetaBase
If you think Apache is powerful because it has a config file, then take a look at the MetaBase. You can do just about anything you want with IIS by editing the MetaBase. For example, you can create virtual directories and servers; stop, start and pause Web sites; and create, delete, enable and disable applications.

Microsoft provides a GUI utility called MetaEdit, somewhat similar to RegEdit, to help you read from and write to the MetaBase. Download the latest version here. But to really impress those UNIX admins – and to take full advantage of the MetaBase by learning how to manipulate it programmatically – you’ll want to try out the command-line interface, officially called the IIS Administration Script Utility. Its short name is adsutil.vbs and you’ll find it in C:\inetpub\adminscripts, or else in %SystemRoot%\system32\inetsrv\adminsamples, together with a host of other useful administrative scripts.

A word of caution though: Just like Apache conf files, the MetaBase is pretty crucial to the functioning of your Web server, so don’t ruin it. Back it up first.

Tip 8: Add spell checking to your URLs
Apache folks always brag about cool little tricks that Apache is capable of – especially because of the wealth of modules that can extend the server’s basic functionality. One of the coolest of these is the ability to fix URL typos using a module called mod_speling. Well, thanks to the folks at Port80 Software, it now appears that IIS admins can do this trick too, using an ISAPI filter called URLSpellCheck. You can check it out right on their site, by trying URLs like www.urlspellcheck.com/fak.htm, www.urlspellcheck.com/faq1.htm – or any other simple typo you care to make.

Tip 7: Rewrite your URLs
Cleaning your URLs has all sorts of benefits – it can improve the security of your site, ease migration woes, and provide an extra layer of abstraction to your Web applications. Moving from a ColdFusion to an ASP based site, for example, is no big deal if you can remap the URLs. Apache users have long bragged about the huge power of mod_rewrite – the standard Apache module for URL rewriting. Well, there are now literally a dozen versions of this type of product for IIS – many of them quite a bit easier to use than mod_rewrite, which tends to presume familiarity with regular _expression arcana. Check out, for example, IIS ReWrite or ISAPI ReWrite. So brag no more, Apache partisans.

Tip 6: Add browser detection
There are a lot of ways to build Web sites, but assuming everybody has a certain browser or screen size is just plain stupid. Simple _JavaScript sniff-scripts exist for client-side browser detection, but if you are an IIS user you can do better with a product called BrowserHawk from CyScape. The Apache world doesn’t really have something comparable to this popular, mature and well-supported product. Speaking of CyScape, they’ve recently added an interesting-looking related product called CountryHawk that helps with location detection, but so far I haven’t had the language- or location-sensitive content to warrant trying it out.

Tip 5: Gzip site content
Browsers can handle Gzipped and deflated content and decompress it on the fly. While IIS 5 had a gzip feature built-in, it is pretty much broken. Enter products like Pipeboost to give us better functionality – similar to what Apache users have enjoyed with mod_gzip. Don’t waste your bandwidth – even Google encodes its content, and their pages are tiny.

Tip 4: Cache your content
While I’m on the topic of improving performance, remember to make your site cache friendly. You can set expiration headers for different files or directories right from the MMC. Just right click on an item via the IIS MMC, flip to the “HTTP Headers” tab, and away you go. If you want to set cache control headers programmatically – or even better, let your site developers do it – use something like CacheRight. If you want to go further and add reverse proxy caching, particularly for generated content, use a product like XCache – which also throws in compression.

It might involve more time and expense to take full advantage of caching, but when you watch your logs shrink because they don’t contain tons of pointless 304 responses, and your bandwidth consumption drop like a stone, even while your total page views increase over the same period, you’ll start to understand why this particular tip was so important. Cache friendly sites are quite rare, but there is plenty of information available online about the enormous benefits to be had by doing it right: Check out Brian Davidson’s page, this nifty tutorial from Mark Nottingham, and what AOL has to say on the subject.

Tip 3: Tune your server
Tuning IIS is no small topic – whole books and courses are dedicated to it. But some good basic help is available online, such as this piece from IIS guru Brett Hill, or this Knowledge Base article from Microsoft itself. However, if you don’t feel like getting your hands dirty – or can’t afford the time and expense of turning yourself into an expert – take a look at XTune, from the makers of XCache. It’s performance tuning wizards step you through the process of tuning your IIS environment, making expert recommendations along the way..

Tip 2: Secure your server with simple fixes
Sure people are going to attack sites, but you don’t have to be a sitting duck if you’re willing to make even a small effort. First off, don’t advertise the fact that you are running IIS by showing your HTTP server header. Remove or replace it using something like ServerMask – probably the best twenty-five bucks you’ll ever spend. You can go farther than this by removing unnecessary file extensions to further camouflage your server environment, and scanning request URLs for signs of exploits. There are number of commercial products that do user input scanning, and Microsoft offers a free tool called URLScan which does the job. URLScan runs in conjunction with IISLockDown, a standard security package which should probably be installed on every IIS server on the planet. These are simple fixes that could pay off big, so do them now.

Tip 1: Patch, patch, patch!
Okay, we in the IIS world do have to patch our systems and make hotfixes. However, as a former Solaris admin I had to do the same thing there, so I am not sure why this is a big surprise. You really need to keep up with the patches, Microsoft is of course the definitive source, but if you can also use the highly-regarded www.cert.org. Simply search on “IIS”.

Conclusion
Well there you have it: 10 tips for IIS admins to improve their servers. Some of the tips might become obsolete once IIS 6 is gold, but, for now at least, W2K and NT IIS admins should apply a few of these today and sleep a little better at night.

Categories: ASP.net 2, ASP.net 3.5

Performance Comparison of Windows Communication Foundation (WCF) with Existing Distributed Communication Technologies

26 December 2007 Steve 1 comment

Windows Communication Foundation (WCF) is a distributed communication technology that ships as part of the .NET Framework 3.0. This article concentrates on comparing the performance of WCF with existing .NET distributed communication technologies. A prerequisite for this article is sufficient understanding of WCF. For an architectural overview of WCF please read “Windows Communication Foundation Architecture Overview” and to learn how to build services using WCF standard bindings please read “Introduction to Building Windows Communication Foundation Services” at http://msdn.microsoft.com/en-us/library/.

Goals

The goal of this article is to provide performance comparisons between WCF and other existing .NET distributed communication technologies. These technologies are:

  • ASP.NET Web Services (ASMX)
  • Web Services Enhancements (WSE)
  • .NET Enterprise Services (ES)
  • .NET Remoting

The scenarios and data presented in this article quantify the underlying cost of the different technologies. This data is useful in understanding the relation between these technologies and can be helpful in planning migrations between the technologies. However, care should be taken in the conclusions drawn from the data presented in this article. The limiting performance factor in a well-designed Service Oriented Architecture (SOA) solution is most likely the service implementation itself and not the cost of the underlying communication technology. One must measure each application to determine the performance characteristics of that application. Note that this article does not address performance best practices when using WCF. Rather, it endeavors to provide sufficient information to enable you to make informed performance decisions when you are using an existing .NET distributed communication technologies as a basis.

Comparisons

All data presented in this article was collected using the same hardware configuration: four 2-way client systems were used to drive a server that was configured as a Uni or Quad processor. Two 2 GB cards were employed to guarantee that the network was not the bottleneck for any of the scenarios. See Figure 14 for details of the topology employed.

The number of client processes used on the client systems was sufficient to ensure that the CPU on the server was completely saturated. The data collected and presented reflects the average of the multiple convergent runs and care was taken to make sure all data was highly repeatable and sustainable.

All the comparisons in article are throughput comparisons and as such higher the value achieved, the better it is. In all the graphs, the higher bars reflect better performance.

This article focuses on the server throughput of the .NET distributed communication technologies. This is defined as the number of operations for each second that these technologies can sustain. An operation is a request and reply message with little processing done by the service. As mentioned in the introduction, but reiterated here as it is critically important, it is expected that the business logic will dominate the cost of a service in a well constructed SOA solution. By leaving out business logic processing at the service, only the cost of the messaging infrastructure is measured.

The message payloads used are different based on the comparison scenario and are explained for each comparative technology.

ASP .NET Web Services (ASMX)

In this section the performance of ASP.NET Web services is compared with the performance of WCF. The scenario is request/reply between the client and the service. This is the typical message exchange pattern for both technologies. The request message in this scenario is required to send an integer. The reply message is comprised of an array of 1, 10 or 100 objects, each object being approximately 256 bytes long. The WCF object is an instance of a strongly typed data contract.

The signature of the function used to generate the message payload (objects) at the service is described in the following:

Order[] GetOrders(int NumOrders);
{
            Order[] orders = new Order[numOrders];
            for (int i = 0; i < numOrders; i++)
            {
                Order order = new Order();
                OrderLine[] lines = new OrderLine[2];
                lines[0] = new OrderLine();
                lines[0].ItemID = 1;
                lines[0].Quantity = 10;
                lines[1] = new OrderLine();
                lines[1].ItemID = 2;
                lines[1].Quantity = 5;
                order.orderItems = lines;
                order.CustomerID = 100;
                order.ShippingAddress1 = “012345678901234567890123456789″;
                order.ShippingAddress2 = “012345678901234567890123456789″;
                order.ShippingCity = “0123456789″;
                order.ShippingState = “0123456789012345″;
                order.ShippingZip = “12345-1234″;
                order.ShippingCountry = “United States”;
                order.ShipType = “Courier”;
                order.CreditCardType = “XYZ”;
                order.CreditCardNumber = “0123456789012345″;
                order.CreditCardExpiration = DateTime.UtcNow;
                order.CreditCardName = “01234567890123456789″;
                orders[i] = order;
            }
            return orders;
}

IIS Hosted Interoperable Basic Profile 1.0 Web Service

This section compares the performance of ASMX and WCF while they are hosted in IIS 6.0. In both cases, no security is used. The WCF binding used is the BasicHttpBinding. This standard binding uses HTTP as the transport protocol. The Basic Profile specification can be found at http://www.ws-i.org/Profiles/BasicSecurityProfile-1.0.html. ASP.NET 2.0, part of the .NET Framework 2.0, provides CLR attributes to ensure conformance to the Basic Profile. For WCF the BasicHttpBinding provides the same level of guarantees.

As shown in Figure 1, WCF has improved performance over ASMX. Three different operation signatures (payloads) are shown in the graph. In each case an integer is passed from the client to the server and an array of objects (1, 10 or 100) is passed back to the client. WCF outperforms ASMX by 27%, 31% and 48% for 1, 10 and 100 objects in a message, respectively.

The graph in Figure 2 shows the throughput comparison of WCF and ASMX for the same scenario as Figure 1 but running on a quad processor. The throughput performance of WCF is better than ASMX by 19%, 21% and 36% for 1, 10 and 100 objects in a message, respectively. Note that the software used was not modified between the two configurations and a single service was exposed on the server. Comparing the data in the preceding two charts, the inherent scalability of the technologies can be noticed.

Figure 1

Figure 2

IIS Hosted Interoperable Basic Profile 1.0 Web Service using Transport Security

In this section, the performance of WCF is compared with the performance of ASMX with both operating over HTTPS. WCF uses the BasicHttpBinding for this scenario. Figure 3 shows the performance of WCF is better than ASMX when using transport level security. WCF outperforms ASMX by 16%, 18% and 26% for 1, 10 and 100 objects in a message respectively.

Figure 4 shows that the performance of WCF is better than ASMX by 5%, 12% and 13% for 1, 10 and 100 objects in a message respectively for a quad processor scenario.

Figure 3

Figure 4

Web Services Enhancements (WSE)

In this section, the throughput of WCF is compared with the throughput of Web Services Enhancements. The comparison in this case is with WSE 2.0 but it should be noted that the performance of WSE 2.0 and 3.0 are similar for this payload. The method signatures and payload used for this scenario are identical to that employed in the ASMX scenarios (shown in Section 3.1).

IIS Hosted Interoperable Web Service using WS-Security

In this section, message level security using X. 509 certificates as the security credential is used. The WSHttpBinding is used in WCF, which implements the WS-Security 1.1 specification. The transport protocol used is HTTP and the message exchange pattern remains request/reply.

Figure 5 shows WCF is much more efficient than WSE. The throughput of WCF is nearly 4 times better than WSE. The main reason for this is that WSE uses the System.Xml.XmlDocument class to do message level parsing, thereby loading the full message into memory at once, while WCF uses a streaming System.Xml.XmlReader class that improves the performance significantly.

Figure 6 compares the throughput of WCF and WSE 2.0 for quad processors. These results are similar to the performance gain achieved by WCF over WSE for single processor scenario. WCF is nearly 4 times faster than WSE with full message security.

Figure 5

Figure 5 also illustrates the performance of another mechanism for securing messages in WCF: transport security with message credentials. This configuration combines transport-level security (HTTPS) and message-level credentials (for example, credentials in the SOAP message). To deploy this, WCF (Message Credentials) workload is using the BasicHttpBinding. The chart shows that the single processor scenario performance of WCF (Message Credentials) is better than WCF with WS Security by 129%, 166% and 277% for 1, 10 and 100 messages, respectively. The corresponding numbers for the quad processor scenario for WCF (Message Credentials) are even better and show an improvement of 126%, 156% and 248% for 1, 10 and 100 messages, respectively, over WCF (Message Credentials) for the uni processor scenario.

As can be seen from the chart, transport security with message credentials provides improved performance while still allowing rich message-level credentials. The message-level credentials include timestamp processing, canonicalization and signature processing. The message protection (signature, encryption, replay detection and other protection mechanisms) are still done at the transport byte stream level, below the individual message boundaries. There is a WS-Security header, but that only contains a timestamp, a security token and signature using that security token over the timestamp. Whereas, in the case where WCF uses full WS-Security, the message protection is done as a message-level transformation with signing and encryption done over the XML fragments for the headers and body. Also, the WS-Security header contains all the required security metadata as XML constructs. This extra XML-aware security processing and the larger size of the security header account for the performance difference. You have to consider the tradeoff between performance and security features available for the specific application that you might want to use this WCF setting in.

Figure 6

.NET Enterprise Services (ES)

In this section, the throughput of Enterprise Services (ES) is compared with WCF using two different service operation signatures and payloads. These are referred to as primitive and order messages. The primitive message is of a primitive type and this allows ES to execute its fast serialization path. The order message is a typical scenario that imitates a book order online and is approximately 512 bytes. The request/reply message exchange pattern is used for these comparisons.

The signature of the primitive payload is as follows:

string TransferFunds(int source, int destination, Decimal amount);

Here the service just returns a string “successful” or “failure”.

For the order message the following code service is used:

static public ProductInfo CreateProductInfo(int count)
{
            ProductInfo productInfo = new ProductInfo();

            productInfo.TotalResults = count.ToString();
            productInfo.TotalPages = “1″;
            productInfo.ListName = “Books”;
            productInfo.Details = new Details[count];
            for (int x = 0; x < count; x++)
            {
                productInfo.Details[x] = GetDetail();
            }
            return productInfo;
}

static Details GetDetail()
{
      Details details = new Details();
      details.Url =
“http://www.abcd.com/exec/obidos/ASIN/043935806X/qid=1093918995/sr=k
a-1/ref=pd_ka_1/103-9470301-1623821″;
      details.Asin = “043935806X”;
      details.ProductName = “Any Book Available”;
      details.Catalog = “Books”;
      details.ReleaseDate = “07/01/2003″;
      details.Manufacturer = “Scholastic”;
      details.Distributor = “Scholastic”;
      details.ImageUrlSmall =
“http://images.abcd.com/images/P/043935806X.01._PE60_PI_SZZZZZZZ_.jpg”;
      details.ImageUrlMedium =
“http://images.abcd.com/images/P/043935806X.01._PE60_PI_MZZZZZZZ_.jpg”;
      details.ImageUrlLarge =
“http://images.abcd.com/images/P/043935806X.01._PE60_PI_LMZZZZZZZ_.jpg”;
      details.ListPrice = “29.99″;
      details.OurPrice = “12.00″;
      details.UsedPrice = “3.95″;
      details.Isbn = “043935806X”;
      details.MpaaRating = “”;
      details.EsrbRating = “”;
      details.Availability = “Usually ships within 24 hours”;
      return details;
}

In these scenarios, the WCF service is self hosted and employs the NetTcpBinding.

Note   You can use IIS 7.0, which is shipped with Windows Vista for hosting TCP services. In this case, the performance achieved is slightly less than the self-hosted case.

Self-Hosted Request/Reply TCP Application

This section compares WCF with ES for two payloads previously discussed without any security. Figure 7 shows that sometimes ES is faster while other times WCF is faster. The performance of ES is better by 21% for the primitive message payload when the fast serializer can be used (possibly on a handful of primitive types like integers) but WCF outperforms it by 149% for order message payload.

Figure 8 shows the same benchmark and payload comparison on a quad processor. As WCF scales better than ES, WCF is faster than ES by 7% for primitive message even though ES can utilize its fast serialization path. For the order message, WCF is faster than ES by 104%.

Figure 7

Figure 8

Self-Hosted Secure Request/Reply TCP Application

In this section, the performance of WCF and ES are compared for the same message loads as the previous section (Section 3.3.1) with security enabled. Specifically, transport-level SSL security is employed and ASP.NET Role principle is used for the authorization. Figure 9 shows that the performance of ES on a uni processor is faster than WCF by 24% for the primitive message type while for the order message type, WCF is faster than ES by 69%.

Figure 10 shows that for quad processor, ES is better than WCF by 16% for the primitive message type and for the order message type WCF is faster by 37%.

Figure 9

Figure 10

Secure Transacted Request/Reply TCP Application

In the previous two sections (Sections 3.3.1 and 3.3.2), the work done by the service was doing little more than creating the objects that were returned to the client. In this section, the throughput of WCF is compared with .NET ES when the services that are implemented use a database transaction. Please note that the transaction used is not flowed but is created and utilized within the service. The purpose of this scenario is to demonstrate that any substantial service implementation dominates the cost of the infrastructure independent of the technology used to deploy it. Hence the comparison is done only for the single proc scenario and only for primitive message type.

In Figure 11, WCF performance is compared with the performance of .NET Enterprise Service for a primitive message payload. As expected, the throughput of this scenario is significantly lower than the previous scenario because transactions are being used. Also as expected, the performance of the two technologies is nearly identical with WCF having slightly better performance.

Figure 11

NET Remoting

This section compares the performance of WCF and .NET Remoting when communication is required across processes on the same machine. Three different sized payloads, each an array of bytes are used for this comparison. The following interface illustrates the service operation signature:

public interface IRemoteObject  {         [OperationContract]         byte [] GetRBytes(int NumBytes); }

The size of the message payload returned is determined by the “NumBytes” which for the data below is 128 bytes, 4k and 256k. The NetNamedPipeBinding is employed without any security for this scenario.

Request/Reply Named Pipe Application

The cross-process named pipe is used as the transport protocol along with request/reply as the message exchange protocol. As seen in Figure 12, WCF outperforms .NET Remoting by 29% and 30% for message payloads of 128 bytes and 4k bytes, respectively. As the payload grows in size, the performance of the technologies converge so that for the 256k byte array the performance is nearly identical.

In Figure 13, the corresponding data for quad processors is shown. The throughput of WCF is better by 38%, 18% and 28% for message payloads of 128 bytes, 4k bytes and 256k bytes, respectively.

Figure 12

Figure 13

When migrating distributed applications written with ASP.NET Web Services, WSE, .NET Enterprise Services and .NET Remoting to WCF, the performance is at least comparable to the other existing Microsoft distributed communication technologies. In most cases, the performance is significantly better for WCF over the other existing technologies. Another important characteristic of WCF is that the throughput performance is inherently scalable from a uni processor to quad processor.

To summarize the results, WCF is 25%—50% faster than ASP.NET Web Services, and approximately 25% faster than .NET Remoting. Comparison with .NET Enterprise Service is load dependant, as in one case WCF is nearly 100% faster but in another scenario it is nearly 25% slower. For WSE 2.0/3.0 implementations, migrating them to WCF will obviously provide the most significant performance gains of almost 4x.

Performance Test Machine Configuration

Figure 14

Figure 14 shows the machine configuration used is a single server and four client machines connected over two 1 Gbps Ethernet network interface. The server is a quad processor AMD 64 2.2 GHz x86 machine running Windows Server 2003 SP1. Each of the client machines are dual processor AMD 64 2.2GHz x86 machines running the same operating system as the server. The system CPU utilization is maintained at nearly 100%. All the scenarios that required hosting were done using an Internet Information Services (IIS) 6.0 server. For the single processor scenarios, the server is booted as a single processor machine.

Categories: .net 3.5, Technology

The Fastest Way To Compare Two Strings Equality

26 December 2007 Steve 1 comment

We usually use “==” for string comparing operations. But What if the code will work 10 million times. You must use the best comparing way for minimum time consuming.

We often works with strings when writing codes. Sometimes the case requires to control if two strings are equal or not. And then we usually use the “==” operator to control equality.
If (s1 == s2)
But What if the code will work 10 million times. You must use the best comparing way for minimum time consuming. Run the code below and see which one the best.
The “==” operator is the slowest, and the “s1.Equals(s2)” is the fastest. 
Stopwatch sw = new Stopwatch();
string 
s1 “Some text for testing”;
string 
s2 “Some text for testing.”;
sw.Start();
for 
(int 0(i <10000000)i++) {
    
if (s1 == s2) {
        
//  Do something
    
}
}
sw.Stop()
;
Console.WriteLine(“s1=s2 : ” + sw.Elapsed.TotalMilliseconds.ToString());

sw.Reset();
sw.Start();
for 
(int 0(i <10000000)i++) {
    
if (String.Equals(s1, s2)) {
        
//  Do something
    
}
}
sw.Stop()
;
Console.WriteLine(String.Equals(s1, s2) : ” + sw.Elapsed.TotalMilliseconds.ToString());
sw.Reset();

sw.Start();
for 
(int 0(i <10000000)i++) {
    
if (s1.Equals(s2)){
        
//  Do something
    
}
}
sw.Stop()
;
Console.WriteLine(s1.Equals(s2) : ” + sw.Elapsed.TotalMilliseconds.ToString());

The StringBuilder Object Memory Usage – Capacity

26 December 2007 Steve 1 comment

The StringBuilder class provides good performance for string operations with default attributes. And you can accomplish your string operations with in best memory performance adjusting StringBuilder Capcity property.

When you instantiate a new StringBuilder object, it’s capacity becomes 16 characters.

StringBuilder() sb= new StringBuilder();

And when you add some characters more then 16, it’s capacity raises 16, automatically. (32, 48 etc.)

If you are using some text with low amount of characters, you can instantiate a StringBuilder object with a capacity parameter.

StringBuilder() sb= new StringBuilder(6);

So the capacity of the object will become 6, 12, 18 etc. And the memory usage of the object becomes optimum for the case.

How to build a successful website

26 December 2007 Steve Leave a comment

 If you are looking to build a successful website, here are three basic rules.

  1. Fast Speed
  2. Limited Contents
  3. Easy Navigation

1. Fast Speed

First rule is, a website should load faster. When a user comes to your home page, there should be no wait. You can provide this by having only limited code and HTML on the home page.

There are several ways to make sure site load faster. For example, do not use too much graphics and flashy stuff. Use text, HTML controls instead of images.

Avoid default flash or other graphics items. If you can’t survive without flashy presentations, give user an option to load it once your home page is loaded by adding an extra link or something.

If your site is a database driven site, do not load too much data on page load. If it is necessary to load data from a database, try to save common data in application state so page load is faster.

2. Limited but Most Relevant Contents

Limited contents means if a user comes to your home page, site should provide only contents that you need to grasp the reader but not overload him. You do not want to confuse your reader.

Your home page should make sure that user is not confused about your site functionality and services. The message should be clear and consise. Make sure to put most relevant content on the most visible area.

3. Easy Navigation

You do not want user to click 4 times to go to the content what user is looking for. Try to keep it to 1 or 2 clicks only. At max, you can go to 3 clicks. After 3 clicks, user would most likely to leave your website.

India’s 10 Great Bikes

24 December 2007 Steve Leave a comment

1. ROYAL ENFIELD STANDARD
2. YAMAHA RD 350
3. YAMAHA RX 100
4. SUZUKI SHOGUN
5. HERO HONDA CD 100
6. HERO HONDA CBZ
7. BAJAJ PULSAR
8. HERO HONDA KARIZMA
9. HONDA UNICORN
10. YAMAHA GLADIATOR

Categories: Bike, Facts

Storm worm is the worst computer worm for 2007

20 December 2007 Steve Leave a comment

As 2007 comes to a end , Once we look back the worm that has hit the Internet worst was the Storm Worm, who made its debut in the January of 2007. Its name came from a widely circulated email about the kyrill weather storm in Europe, and its subject was “230 dead as storm batters Europe.” The virus first hit on January 19th, and three days later , the virus infected 8 percent of the machines .

The Worm’s work :

If your computer is infected by the Storm Worm, your machine becomes a part of a large botnet. The botnet acted to perform automated tasks that ranged from gathering data on the host machine, to DDOSing websites, to sending infected emails to others. As of September of this year, an estimated 1 million to 10 million computers were still part of this botnet, and each of these computers was infected by one of the 1.2 billion emails sent from the infected hosts.

Storm Worm is a difficult worm to track down because the botnet is decentralized and the computers that are part of the botnet are consistently being updated with the fast flux DNS technique. Consequently, it has been difficult for infected machines to be isolated and cleaned.

Categories: Personal

FileUploadAJAX

20 December 2007 Steve 1 comment

FileUploadAJAX is an open source ASP.NET 2.0 custom control that is similar to the predefined FileUpload control but with a key difference: AJAX behavior

And what does this means? This means that with the FileUploadAJAX we can upload files in an asynchronous way and without reloading the page… that’s all!

Refer http://en.fileuploadajax.subgurim.net/

Microsoft Live Labs :: VOLTA

18 December 2007 Steve 1 comment

Microsoft Live Labs Volta helps developers who build distributed applications on the .NET platform, using the Microsoft development stack (programming languages, libraries, and Visual Studio). This version of Volta supports applications that run on the Microsoft CLR, a JavaScript-enabled browser, or a combination of the two.

First, this document introduces the Volta technology. Then, it covers two important Volta targets that developers are likely to build and deploy: applications and controls. Recipe-like descriptions for several common web-based scenarios follow. The document concludes with an overview of the libraries installed with Volta, and a summary of known issues and limitations.

The Volta Programming Model

In essence Volta is a recompiler. Volta works on MSIL rather than on a textual source language. Volta rewrites MSIL into any number of target languages, including, today JavaScript and MSIL itself. Rewriting, as a general technology, lets us delay permanent decisions about architecture, execution platform and browser until after our code is basically working. Furthermore, it frees us from having to express all these irreversible decisions in your source code. The result is a programming model that enables us to easily reshape a working application, and finally realizes the promise of one application running anywhere.

Volta effects recompilation through 3 general capabilities: refactoring, retargeting, and remodulating. Refactoring converts single-tier code into distributed, concurrent code as directed by user-supplied annotations. Retargeting converts MSIL code into code for other virtual machines. Remodulating tailors a single piece of code for multiple browsers. The next 3 sections explain in more detail.

Architecture Refactoring

The Volta programming model takes refactoring one step further. Volta applies transformations on our compiled code based on metadata, in particular, custom attributes prefixed on classes or methods that could run on a server tier. During development, all code runs in the client for ease of testing and debugging. Redistributing the code amongst client and server is merely a matter of moving custom attributes around and rebuilding. The Volta rewriter automatically creates and deploys the marshalling and security code necessary to execute the code on multiple tiers. The following diagram illustrates evolution of a Volta application from single-tier architecture to a distributed, multi-tiered architecture.

image001

After refactoring, notice that the same application that used to run in one instance of the CLR is now running on two tiers. Volta dramatically extends the reach of the .NET platform to cover the cloud. We emphasize that the only differences at the source-code level are the presence and positions of custom attributes. Volta doesn’t eliminate the intellectual challenges of distributed computing. We must still formulate strategies for partitioning functionality and dealing with network latency and availability. Volta does, however, radically simplify the error-prone plumbing and re-plumbing of communication code.

Volta leverages the entire .NET platform, including most libraries and programming languages. We can write in our favorite .NET languages, use familiar .NET libraries and tools, and produce sophisticated distributed applications using only the “materials already in the room.” Without Volta we are exposed to too many inconsistent, special-purpose languages with kludges to help them interact in the cloud. For instance, typical methodologies for cloud programming involve combinations of ASP, PHP, Flash, XML, HTML, CSS, JavaScript, Perl or Ruby, C# or Java, SQL, and even more! Volta reduces the brittleness of distributed applications by lowering the sensitivity to idiosyncrasies of multiple languages and dialects.

Another important advantage of architecture refactoring is opening up brown-field scenarios. With minimal changes we can run existing .NET code in the cloud, greatly increasing the user base of code that may have been designed only for a single tier. Volta gives us a new dimension of software reuse. Traditionally, we would endeavor to reuse bits and pieces of source code in new scenarios. Volta lets us reuse binaries in new scenarios.

In summary, Volta confers flexibility in the architecture dimension through:

  • Language-independence. Write Volta code in any language that compiles into MSIL. For example, C#, VB, IronPython, etc.
  • Leverage the entire .NET toolchain. Use libraries; the IDE, Intellisense, auto-complete, snippets; FxCop; profiler; class browser; ILDASM; and so on.
  • Low entry barrier. Reduce your learning burden; use “only the languages in the room.”
  • Brown-field applicability. Volta-enable existing applications for the cloud.
  • Beyond 2 tiers. Refactor to as many tiers as you need using exactly the same mechanisms recursively applied.

Platform Retargeting: Extend the Reach

Without Volta, we must choose not only the architecture, but also the execution environment before we write code. For example, we often start with a WinForms application, confining us to client-side architecture and CLR execution.

We’ve already seen that Volta tier splitting lets us refactor the application so that part of it runs on the server. Volta retargeting lets us run MSIL code also in a JavaScript engine. Primary scenarios involve JavaScript in a browser running the client side of a distributed application. However Volta is not tethered to the browser and retargeted code runs in any JavaScript engine, such as the Jscript engine bundled with Internet Explorer.

Volta retargeting employs the technique of deep embedding, which preserves precise semantics of CLR objects, classes, methods, events, and so on, despite some rather deep impedance mismatches between the two platforms. For instance, MSIL is statically typed, whereas JavaScript is dynamically typed. Volta does all the hard work for us, though, and we are not restricted to a subset of .NET language features. Anything MSIL can do, including events, exceptions, casts, and generics, runs precisely correctly on alternative platforms. Volta’s semantic fidelity is orthogonal to tier-splitting, so, with some limitations, it’s possible to fire events and exceptions across tiers, as if they were on the same runtime instance.

Let your imagination be your guide. Retargeting is independent of refactoring and we can mix and match them as appropriate to our scenarios.

Let’s develop a simple scenario. Consider a typical web application, and focus attention on the component running in the browser. Without Volta, we write HTML, CSS, and JavaScript, targeting the browser’s execution environment, in addition to server code. With Volta, we have one programming model for both tiers, namely .NET. Volta retargets the browser component, writing the JavaScript for us from MSIL, hiding the impedance mismatch.

Retargeting is all the more important in the face of Ajax, which encourages ever more functionality in the browser for increased responsiveness and better user experiences.

In summary, Volta confers flexibility in the execution-platform dimension through:

  • Deep embedding of CLR semantics. Preserve exact CLR semantics across platforms.
  • Cross-browser support. Use one programming model across browsers.
  • Complete orthogonality with refactoring. Mix and match refactoring and retargeting.
  • Ajax-ready. Write Ajax patterns and idioms in familiar .NET languages.

Browser Remodulating: Cross-Browser Support

Despite the standardization of DHTML, which includes JavaScript and DOM access, many subtle differences exist amongst popular browsers. The rise of Ajax has amplified the differences, and furthermore, has created a sense of urgency in the marketplace, hence a continuous flow of new features and capabilities that developers must chase. Consequently, without Volta, developers must write more and more browser-specific code, leaving them less time to focus on their applications.

Volta hides as many browser-specific differences as possible, but still allows developers to leverage the unique capabilities of particular browsers. Instead of targeting solely the intersection of browser capabilities, Volta targets the entire union, but makes the intersection browser-agnostic. This is browser remodulating. From the developer’s point of view Volta attenuates browser differences. But what about testing and debugging? Volta and the Visual-Studio integration supports debugging and testing of applications with full transparency. Visual Studio’s Solution Platform dropdown lets us choose the specific browser we want for a testing/debugging session. This allows us to see how each browser renders the HTML.

In this release Volta supports the Internet Explorer and Firefox browsers. We accommodate specific browsers through a combination of changes to the recompiler and libraries, plus Visual Studio integration for debugging.

In summary, Volta confers flexibility in the execution-platform dimension through:

  • Cross-browser support. Write the same code for Internet Explorer and Firefox.
  • Debugging transparency. Debug code with a specific browser.
  • Leverage browser-specific features. Where needed, access features unique to each browser.
  • Visual-Studio integration. Enjoy seamless integration with the IDE.

150cc challenge – Hunk Vs Unicorn Vs X-treme Vs Pulsar Vs apache RTR

17 December 2007 Steve 45 comments

Battle b/n the beasts:

In 2007 alone two new premium bikes have been launched. As competition becomes tougher its hard to find the right products suits for you and more than introspection,comparison shows the true colour. We here compare all the 150cc bikes and dig out the pros and cons of the products. TVS apache RTR 160 included in the ‘battle b/n the beasts’ because of competetive price. Let’s watch the battle!

Design and Styling:

Whether its pulsar or unicorn or X treme or apache rtr or hunk every bike is either evolutionary or revolutionary in design dept. The black theme, aircraft type fuel lid and alloy wheels have become universal and it now features on all bikes. Though the basic design is not altered, pulsar has metmarphosed into a new bike with constant upgradation. Bajaj’s keen care makes the pulsar even to match the new generaton bike like apache rtr. But too much of pulsars in the road has started developing fatigue. Honda has always been conserative. Though unicorn styling is evergreen it cannot conceal the age. Also lack of contemporary features like LED tail lamps,digital speedo and gas charged suspension makes the unicorn outdated. Xtreme’s face(headlamp) inspired from unicorn fails to charm though it has sexiest back of all the bikes. Large LED taillamps, bulleted silencer mouth and horns like supportive split grab rails scores the credit. Racy design with neccessary racing stripes, chiseled tank, stylish engine cowl, petal type disc brake and leaf shaped rear view mirrors makes the RTR one of the best looker. Hero Honda finds a space even in this crowd. The recently launched Hunk blends the design of cruiser and racy. Red dial, analog clock setup adds extra charm to the Hunk’s macho look. Though Hunk has not achieved the best of both worlds it scores a lot. Of these bikes, Apache RTR, Hero Honda Hunk, CBZ X-Treme targets a niche market within the 150cc segment. Honda’s unicorn lures the conservative man. Pulsar 150cc which attracted the youth when it launched, now turns into a family bike.

Engine and Transmission:

This must be easiest section to decide, since three of the competetiors – Hero Honda’s Hunk,CBZ X-Treme and Honda’s unicorn shares the same engine. Unicorn’s 149.2cc was the least power producer yet it scores full points for its refinement. Unicorn’s engine develops 13.3bhp at 8000rpm and 12.75Nm of 6500rpm. Hero Honda offers the same engine with little more power(0.8bhp) for both the Hunk and the CBZ X-treme. Pulsar 150cc engine is one of the best engine made by the bajaj. The twin spark 149cc engine produces 14bhp at 8500rpm.

TVS apache rtr is powered by an 160cc engine which produces 15.2bhp at 8500 rpm and 13.1Nm at 6000 rpm. Clearly, Apache RTR is the best among the traits in terms of performance. Apache RTR has higher power to weight ratio 111.7bhp/ton.Apachian can push the redline even upto 12000rpm. The extra 10cc plays a main role for the RTR and it is the only bike in the segement capable of breaching the 110kmph mark with appreciable control. All the bikes in the 150cc segment breathes through CV carburettor, in India, Fuel Injection (FI) is yet to make a wave. All the bikes Pulsar, Unicorn,CBZ Xtreme,apache RTR and Hunk features 5-speed (1-down 4-up pattern) gearbox. Their way of functioning and design varies. Apache RTR, Hero Honda Hunk and CBZ Xtreme targets young customers and hence gear shifting is through toe levers. In Unicorn and Pulsar 150cc it is through heel and toe levers.

Fuel Efficiency/mileage:

While the Honda’s engineering makes the mill frugal for the Bajaj its twin spark technology and exhausTEC do the difference. Both the Bajaj Pulsar 150cc and Honda’s Unicorn consumes 1 litre to returns around 55kmpl in our combined city and highway drive. Hero Honda Hunk’s 150cc engine is integrated with advance tumble flow induction (ATFI) technology. This kind of induction helps the motor to burn the fuel more efficiently. Hence the Hunk has little edge over its sibling CBZ X-treme but only by a small margin(1-2kms). Hunk returns 51kmpl in our test drive. TVS apache RTR which topped the performance bar flips in the mileage dept as expected. It gives a mileage of 48kmpl.

Ride and Handling:

Power and Torque coming from the mill has to be put on the road intelligently. Considering the Indian infrastructure it is must for Indian bikes to have superior handling characteristics. Few years back Honda surprised everyone with its monoshock suspension,its light steering and single downtube frame with engine as a stressed member. The bike gives a planted feedback to riders. Though Honda’s commuter type seating offers good comfort to the riders, it hampers the Honda in scoring full points in handling section. Unicorn’s biggest loss is the CBZ X-treme’s biggest gain. X-Treme’s sporty riding position with raised footpegs and its diamond type frame helps to negotiate turns and quick directional changes. But X-treme become cumbersome to handle at low speeds espescially when you have to incredible turns in the traffic signal. Xtreme’s 240mm disc brakes offers the neccessary bite when you need it. Pulsar 150cc which rides on 17″ inch tyres is showing its age.But pulsar’s sharp braking makes the pulsar fit for the competition. TVS has equipped the apache RTR with everything to be jesse owen. Yes, it is the most athletic in the segment. Want to flick! apache RTR’s clip on handle bar, shorter wheelbase and lower saddle height will help you like anything. RTR uses different sets of tyres at the front and the rear(17″-front and 18″-rear), this setup really makes the difference for the RTR’s road stance. 270mm petal disc brake holds the bike at the press of the brake lever. Hero Honda’s new hunk inherits most character of the CBZ X-treme but the heaviest bike in the class along with the large claddings tends to intimidate while taking sharp turns.

Recently launched Hunk is the first one to feature Gas charged suspension from Hero Honda’s stable. TVS has been using Rectangular arm suspesion for a long time, other such as Pulsar and Hunk adopts it. Other than Honda’s unicorn and Hero Honda’s CBZ Xtreme, all the bikes in the segment features Gas charged suspension. Unicorn’s 3 way adjustable monoshock and CBZ Xtreme’s ride is on a stiffer side. Both the bikes transfers the vibration to the pillion. TVS MIG(Monotube Inverted Gas filled) offers better ride. Bajaj pulsar 5 way adjustable suspension set up is one of the softest. Hunk’s comfortable seating (with extra lumber support) and GRS makes it easily the winner in the ride quality. 145kg beast controls the vibration and rarely transmits. All these bikes except unicorn have handle bar weights to cushion your hands by reducing the handle bar vibration. But i have seen many of the bikers to remove the weights since it tends to hit while negotiating sharp turns.

Engineering and the goodies…

All these bike have trip meter,standard warning lamps and an analog tachometer in common. While Honda bets on quality, bajaj packs its bike with user friandly features to sell its bikes. Pulsar 150cc is the first bike to feature digital instrumentation and LED tail lights. Pulsar’s instrument panel is neatly laid out. Cable free speedometer is an another useful feature in the pulsar 150cc. TVS followed the bajaj’s way apahe RTR comes with LCD speedo analog tacho and LED tail lamp cluster. Apache RTR’s useful features includes service and battery indicators. The clip on handlebar which facilates varying the handle bar position is a must feature to be in all bikes.While the Xtreme features twin pod instrument, hunk and unicorn features hooded tripod arrangement.

Verdict:

No confusion here! the winners of this test are every bike enthusiast who pushed these makers to come out with bikes of international standard. Though indian market far from being compared to any western market. Our bike standards are growing day-by-day. Though R1 and Hayabusa are not made in india. Apache’s and Xtreme’s feature equally competetive design.

Coming back to our “battle b/n the beasts”, Bajaj pulsar 150cc and Honda Unicorn are already proven winners. Comfort factor and fuel efficiency of both the pulsar and unicorn are unquestionable and still the best in the category. But as new generation bikes like apache RTR, CBZ X-treme and Hunk are ready to take the customers to a new range of excitement, Pulsar and unicorn tends to give way to newbies. RTR’s robust performance, Hunk’s muscular styling and CBZ Xtreme’s exceptional handling characteristics cannot escape from the eyes of bike lovers. CBZ X-treme lacks contemporary styling and its stiffer ride quality leaves the race in the penuultimate lap. Also X treme is too pricey. Hero Honda has set right few of the short comings of CBZ X-treme at the same time inheriting the best of it. Hunks blends cruiser and racy theme nicely.Lack of powerful engine and absence of modern (yet practical) features makes the wrestler to lose against the athelete. Apache RTR with high performance engine, upswept styling and host of features rocks the 150cc class. The dearer price point also adds more value to the RTR.though it can improve its quality ad tweak its gearbox.

The crown for 150cc kingdom has been most voltaile and with the apache RTR FI, Yamaha’s and Suzuki’s 150cc bike are around the corners, i’m sure that a new(complete) set of bikes will be compared when we do it again in 2008.

Colour matters:

Whatever the bike you choose (depends on your indivual needs), colour matters most. Yellow matters most for the apache RTR. Bajaj Pulsar 150cc sells hot in classic black. Unicorn excels in red and Xtreme catches the eye in silver. Hunk becomes bull in black. Again this is subject to differ.

Categories: Bike