Skip to main content

Posts

Showing posts from 2009

Thread Parameters

One of the useful niblets in .NET 2.0 is the new ParameterizedThreadStart delegate that makes it convenient to pass parameters (OK, a single parameter - but it's an Object so you can pretty much pass anything you want!) to a thread. ParameterizedThreadStart makes your multithreaded code more readable and therefore easier to maintain. In the "old" days, I had to expose an explicit property in the class that performed a multithreaded task like so: // An object that compresses the contents of a folder to // a .ZIP file. public class FolderCompresser { // The folder to be compressed to a .ZIP file public string Folder { get { return _folder; } set { _folder = value; } } // The compress method public void Compress() { string zipFilename = _folder + ".zip"; internalCompress (_folder, zipFilename); } } The client code that used FolderCompresser had to explicitly set its parameter before starting the thread: // Invoke the compressor FolderCompressor fc = new FolderComp

Cloud Computing: The power of one

In their quest to find answers, experts have demonstrated that the future of medical discoveries, environmental challenges, energy deficit, all lie in collaborating through Cloud Computing. With Cloud Computing, users have been able to access data, share expertise and high-end infrastructure from around the world, and vice-versa. The resources are shared through a public platform like the internet. Several companies like Amazon, IBM, Microsoft, etc have invested heavily as they reach out to users. Cloud Computing companies have customers of three kinds - Infrastructure-as-a-service: Option of renting and utilizing computing power and storage capacity of vendor's quality. Software-as-a-Service (SaaS): Vendors license particular services to subscribers on-demand and once the contract expires, the services are disabled. Platform-as-a-Service: Here a developer is given the opportunity to utilize various web-tools to build and host applications. The Cloud (other computers in the network

Connection Pooling Concepts

Connection Pooling If you do not use connection pooling, each connection instance ( java.sql.Connection or oracle.jdbc.OracleConnection instance) encapsulates its own physical database connection. When you call the close() method of the connection instance, the physical connection itself is closed. This is true whether you obtain the connection instance through the JDBC 2.0 data source facility described under " Data Sources ", or through the DriverManager facility described under " Open a Connection to a Database ". With connection pooling, an additional step allows physical database connections to be reused by multiple logical connection instances, which are temporary handles to the physical connection. Use a connection pool data source to return a pooled connection, which is what encapsulates the physical database connection. Then use the pooled connection to return JDBC connection instances (one at a time) that each act as a temporary handle. Closing a connect

What is Hypervisor?

Definition: A hypervisor, also called a virtual machine manager, is a program that allows multiple operating systems to share a single hardware host. Each operating system appears to have the host's processor, memory, and other resources all to itself. However, the hypervisor is actually controlling the host processor and resources, allocating what is needed to each operating system in turn and making sure that the guest operating systems (called virtual mahines) cannot disrupt each other. Microsoft Hyper-V: Hyper-V is the latest virtualization product from Microsoft. The new hypervisor platform works with Windows Server 2008 to create and manage a virtual infrastructure. As with any virtualization platform, Hyper-V makes for a more efficient data center, maximizing resources and reducing costs. Hyper-V consists of a 64-bit hypervisor that can run 32-bit and 64-bit virtual machines concurrently. Hyper-V virtualization works with single and multi-processor virtual machines and inc

What is an Aggregation?

Aggregation differs from ordinary composition in that it does not imply ownership. In composition, when the owning object is destroyed, so are the contained objects. In aggregation, this is not necessarily true. For example, a university owns various departments (e.g., chemistry ), and each department has a number of professors. If the university closes, the departments will no longer exist, but the professors in those departments will continue to exist. Therefore, a University can be seen as a composition of departments, whereas departments have an aggregation of professors. In addition, a Professor could work in more than one department, but a department could not be part of more than one university. Composition is usually implemented such that an object contains another object. For example,: class Professor; class Department { ... private: // Aggregation Professor* members[5]; ... }; class University { ... private: // Composition Department faculty[20]; ... }; In aggregation, the o

What is service-oriented architecture?

Service-oriented architecture (SOA) is an evolution of distributed computing based on the request/reply design paradigm for synchronous and asynchronous applications. An application's business logic or individual functions are modularized and presented as services for consumer/client applications. What's key to these services is their loosely coupled nature; i.e., the service interface is independent of the implementation. Application developers or system integrators can build applications by composing one or more services without knowing the services' underlying implementations. For example, a service can be implemented either in .Net or J2EE, and the application consuming the service can be on a different platform or language. Service-oriented architectures have the following key characteristics: SOA services have self-describing interfaces in platform-independent XML documents. Web Services Description Language ( WSDL ) is the standard used to describe the services. SOA

Function Point Analysis (FPA)

Function Point Analysis (FPA) was a valuable techniquedeveloped by A. J. Albrecht, in 1977. FPA assigns a point to each function in an application. Various modifiers then act upon the function points in order to adjust for the product environmental. Modifiers typically included applying weighted percentages or multipliers that would simply increase or decrease the point values. Environment factors included modifiers for complexity of technical issues, developer skill level, and risk. One problem organizations attempting to use this method would run into was consistent definition of a function and consistent definition of environmental factors across multiple projects and multiple development languages. In order to produce reliably accurate estimates, FPA relies heavily on historical data to derive weighting values and modifiers.

What is cocomo model?

COCOMO (COnstructive COst MOdel) has been designed in 1981 by Barry Boehm to given an estimate of the number of man-months it will take to develop a software product and it is referred as COCOMO 81. A new model called COCOMO II was designed in 1990 and the need for this model came up as software development technology moved from mainframe and overnight batch processing to desktop development, code re-usability and the use of off-the-shelf software components. COCOMO used statistical returns to calculate project cost and duration within a given probability. The model sought to provide a tool for predictably estimating cost, and continues to evolve today under the sponsorship of the University of Southern California. The model was/is interesting and produced worthy merits in applying statistical analysis to the problem of cost estimating. However, a major defining point in statistics is sample set size. The underlying assumption for COCOMO (like FPA) is that a statistically significant

The fundamental differences between "GET" and "POST"

The fundamental differences between "GET" and "POST" The HTML specifications technically define the difference between "GET" and "POST" so that former means that form data is to be encoded (by a browser) into a URL while the latter means that the form data is to appear within a message body. But the specifications also give the usage recommendation that the "GET" method should be used when the form processing is "idempotent", and in those cases only. As a simplification, we might say that "GET" is basically for just getting (retrieving) data whereas "POST" may involve anything, like storing or updating data, or ordering a product, or sending E-mail. The HTML 2.0 specification says, in section Form Submission (and the HTML 4.0 specification repeats this with minor stylistic changes): If the processing of a form is idempotent (i.e. it has no lasting observable effect on the state of the world), then the f

Remove/Delete element from page using JavaScript working in FireFox,IE,Opera

Few days ago, I was recalling my Java script skill. I was generating Grid using java script script. Instead of using Display property (’none’ or ‘block’) to show or hide the control, I was creating and removing element each time. Creating element is not a big deal. However the script for removing element is different in IE and Firefox . In IE, we can remove the element using, however this will not work in Firefox . document.getElementById(“ControlID”).removeNode(true); In Firefox , you have to use, var Node1 = document. getElementById (“ ParentControlID ”); Node1.removeChild(Node1.childNodes[0]); Below is the sample code for the same. var Node1 = document. getElementById (“Parent”); var len = Node1.childNodes.length; for(var i = 0; i <> { if(Node1.childNodes[i].id == “Child”) { Node1.removeChild(Node1.childNodes[i]); } } Happy Programming ! Naimish R. Dave