Pages

Search

Saturday, October 31, 2009

CMS: Build, Deploy, and Maintain Content-Rich Websites

Author: Brainpulse

Web content management systems are installed to abridge and simplify the whole process of content creation. It is software or a program that automates the website submission to the search engines to gain much improved business revenue and site traffic, efficiently manages the content with a lot of ease. Some most common examples of content management systems are Joomla, Wordpress, Php Web site and phpbb2.

Today, on the grounds of its commendable efficiency and simplicity, the popularity of CMS has reached to an acme where a huge number of people are using it. Besides, giving the power of easy content management to the administrator, the system ensures to save a lot of working on every single web page separately. Huge scope of functionality, addition of new dynamic categories and new module, customized to work within the system are some of the other few benefits that act as a catalyst when it comes to considering the option of buying CMS. However, before purchasing any content management system, it is important for the webmaster to understand and gauge all the essential components of the system.

The first and foremost thing to consider is the list of features. In addition to the very imperative WYSWIG editors and some sort of security parameters, your CMS should also have certain built in components:

  • Deeply inquire about the granular security model. Figure out if it is role-based and can easily be integrated into your existing security model. Also, it should let right people access the right content and work with the content as per the business requirements.
  • Check for all built-in navigation components as they are very useful for having easy and quick creation of horizontal and vertical menu bars, bread crumbs along with category precise menus if required.
  • The software must contain all major components required for social media purposes such as blogs, personalized web pages, forums, photo galleries and web messages.
  • It must carry tools that are used on companywide purposes like news release manager or a FAQs component.
  • Document management is also an imperative component. Mostly, it is incorporated in the web content management system and as otherwise, you may have to deal with an entirely new set of purchase orders, licensing fees and sales agreement.

Some other additional requirements that you must check for are:

  • Training and support
  • WYSIWG editors
  • Easy and quick page template creation along with the feature to create replica of the already existing pages and or templates
  • Built-in components for the creation of feature rich user experience with images, calendars, blogs, video and audio.
  • Globalization features that facilitate the conversion of entire website content into any other local language.
About the Author:

BrainPulse website development India and have a very good experience in implementing most of the Content Management System Based Websites, CMS Solutions India along with custom plug-in module development.

Article Source: ArticlesBase.com - CMS: Build, Deploy, and Maintain Content-Rich Websites

Wednesday, October 21, 2009

Hire PHP developer - Outsoruce PHP Programmer


Author: Rightway Solution

In the fast changing world of web development it is really necessary to be adaptive to new technologies for becoming a budding developer. PHP is one of the best scripting language. PHP web development is gaining more and more attention day by day. PHP is easy to use and with help of Open source very effective to implement. For remaining forefront in the competitive world of development Outsourcing can be the best solution. There are lots of highly developed outsourcing web development firm provides skilled and experienced PHP developer for hire. Many companies are deploying the strategy of outsourcing web development need.

Small and medium sized businesses are running of a tight budget. So for getting best quality work in affordable price, outsourcing is the key. Some best outsourcing firm like Rightway solution can provide quality web application development and software development work with in affordable price. You can outsource for any kind of web application development, Enterprise application development, portal development, real estate website development. PHP is increasingly becoming popular in web development industries as it is open source server side scripting language that helps to develop dynamic websites as well as customize web applications.

If you are looking for low cost, good quality work by experienced and technically sound PHP Programmers then outsourcing is the way to get it done effectively. Offshore IT staffing is gaining more and more popularity. PHP gives support to different databases including the popular ones like MySQL, Oracle, Informix, Sybase, Solid, Generic ODBC, PostgreSQL, etc. PHP Programming functionality can be changed according to needs of every business. Besides developing website PHP can be used for developing Enterprise solutions like shopping cart with Content Management System (CMS).

One of the best PHP Open source is Joomla. Joomla website development is very easy and time saving. One can build a website instantly using Joomla. So when you plan to build enterprise applications it’s advisable to use Joomla as CMS as it is an open source which can be customized according to our needs.

Rightway solution is a leading web application development and software development company. Hire PHP developer, PHP programmers, PHP developers team for cost effective PHP web development.

About the Author:

Rightway Solution is one of the leading outsourcing companies in India, trusted by web development companies to deliver cost effective website Solution, web site development and SEO expertise.

Article Source: ArticlesBase.com - Hire PHP developer - Outsoruce PHP Programmer

Wednesday, October 14, 2009

Understanding Data Management and Data Security

Companies today have so much data that flows in and out of the office that they need an effective system in place to manage all this data in a way that makes sense and from which all employees benefit. Data management is becoming more and more important as the volume of data that a company deals with on a daily basis needs to be sorted, delivered, and utilized. For small companies this usually isn't an issue as they can easily manage and store their data on computer servers. However, large companies have too much data to store in one place so that all employees can access it when necessary. This is where data management becomes crucial to the company.

There are many ways to achieve data management in these days of high technology. One of the most common methods of data management is to purchase software that does the managing for you. There is software available that will organize data into categories and divisions that have been designated by the company. This software can be installed on as many company computers as needed so that no data has the potential to get lost. Many companies will also update the education of several employees by having them earn a certificate in data management. This means that one or more employees are responsible for the management of data. They need to learn effective ways to sort and store this information so that it is accessible and findable by all other employees. Part of data management is knowing what information to keep and what information is irrelevant to the successful operation of a company.

There are many ways that a company can have their employees earn a certificate in data management such as online courses offered that an employee can complete either on company time or on weekends. There are also data management courses that are offered at community colleges around the country.

Source: Free Articles





Sunday, October 11, 2009

Getting started with java

Author: pulasthi

Now What's JAVA ??

java is one of the best and most used programming languages used these days.The things you can do with java are endless.And it is so vast that you cant just finish learing it.

So lets get started.lets first see what you will be needing to get started

1.first you need a computer(he he he)

2.you need to install some JDK version on your computer

3.A Software to Write programs in

It's realy easy to use one than to type on the notepad and run manualy.If you want to learn from scrap you should use JCreator LE.because it only provides the basic needs you can learn a lot you can get it Here.

If you want to do High level programing use NetBeans IDE You can find the latest version Here .This is not good for basic learning because it does more than half of the coding for you

4.Configuring your pc(this part is not needed if you use NetBeans)

You must set the eniviroment variable to the bin folder do as below

* Find where the bin folder is an copy it's path.it should be somting like this "C:Program FilesJavajdk1.6.0bin"

* then go to properties->advanced system settings->advanced

Click on Enviromentel varables

Select variable path in system variables,go to the end of the existing variable value and put a ";" and paste tha path you copyed.

5.And the most important HOW TO CODE
Now to get Started with java obviously you need to get some good traning you can find some great tutorials Here. And if you would perfer books to learn theres a lot of books that are good

1. sams teach yourself java in 21 days

2. scjp by Kathy Sierra

3. java how to program

4. java 2 by Ivor Horton

For more info goto my wesite pulasthi.tk or pulasthisupun.blogspot.com

About the Author:

Article Source: ArticlesBase.com - Getting started with java

Sunday, October 4, 2009

HTML - The Language Of The Virtual World

HTML is the programming language that has been instrumental in bringing about this revolution called 'Internet'. 'HTML' fascinates a lot of people. There are people who want to learn HTML in order to try their hands at developing a website on their own. For the website designers and developers, HTML is their bread and butter. They use HTML to bring websites to life. This community of programmers and developers is also in constant search of new HTML techniques that will enhance their skills further.

The use of HTML can be judged by the fact that thousands of websites are launched everyday on the internet (and all websites use HTML in some way). Another gauge of the popularity of HTML is the fact that there are several books on HTML available in the market and there are several websites that discuss and teach HTML. For example, www.html-code-pulse.be is a website that brings together all the resources and information on HTML. In fact, this website really justifies its name "HTML code pulse".

In computing, HyperText Markup Language (HTML) is a markup language designed for the creation of web pages with hypertext and other information to be displayed in a web browser. HTML is used to structure information - denoting certain text as headings, paragraphs, lists and so on - and can be used to describe, to some degree, the appearance and semantics of a document. HTML's grammar structure is the HTML DTD that was created using SGML syntax.

Originally defined by Tim Berners-Lee and further developed by the IETF, HTML is now an international standard (ISO/IEC 15445:2000). Later HTML specifications are maintained by the World Wide Web Consortium (W3C).

Early versions of HTML were defined with looser syntactic rules which helped its adoption by those unfamiliar with web publishing. Web browsers commonly made assumptions about intent and proceeded with rendering of the page. Over time, the trend in the official standards has been to create an increasingly strict language syntax; however, browsers still continue to render pages that are far from valid HTML.

XHTML, which applies the stricter rules of XML to HTML to make it easier to process and maintain, is the W3C's successor to HTML. As such, many consider XHTML to be the "current version" of HTML, but it is a separate, parallel standard; the W3C continues to recommend the use of either XHTML 1.1, XHTML 1.0, or HTML 4.01 for web publishing.

Source: Free Articles





Wednesday, September 30, 2009

Offshore PHP Programmer

Author: linksswap

Do you have immediate need for PHP enabled website? Do you need a dedicated offshore PHP programmer for your website development? And you are also looking for cost effectiveness too? Get a firm answer to your queries right here at Web Art Sense!

Yes! When it is Web Art Sense, you would get comprehensive range of web development solutions for your business needs. We ensure that you get customized, reliable and quality oriented PHP development service that matches your requirements.

Some of the other qualitative benefits of hiring dedicated Offshore PHP Programmer through Web Art Sense are:

• Low Cost PHP Website Development that would gel perfectly with your business.
• Customized and Optimized Open Source Customization and PHP Web Development.
• Reduced Overhead costs, as the result of outsourcing.
• Dedicated programmer which will work in your facility along with your employees. This would ensure high level of interaction between the in house management and PHP Programmer, and, which would in turn help in fast completion of projects.
• Round the clock technical support available to you as well as your partner clients.
• You can make instant changes in your website design or its database, as you can directly approach dedicated PHP Programmer.
• Our dedicated PHP Programmer would be flexible with your business requirements.
• One Project, One Dedicated PHP Programmer, i.e. is our allocation criteria.
• Weekly Reporting on the status and development of the project.

At Web Art Sense, we offer plethora of web services, which include:

Customized Web based Application Development
SEO and Internet Marketing
Open Source Customization
E-commerce Development
M Commerce Development

When you hire a dedicated offshore PHP programmer through Web Art Sense, you get”

Complete reliability in work
Enhanced Interaction with your and your partner clients
Schedule meetings according to your privileged time
Hard working and desiccated programmer
Interact Online, anytime

Hiring a dedicated PHP programmer through Web Art Sense is truly a matter of privilege, as he can give real definition to your web based projects in a fast, cost effective and efficient manner.

About the Author:

For more info please Visit at Web Art Sense to know more about Web Development Company
PHP Programmers, Hire PHP Developers, PhP Development Services
or info@webartsense.com
: Dedicated

Article Source: ArticlesBase.com - Offshore PHP Programmer

Tuesday, September 29, 2009

Asp.Net Web Development VS Classic Asp Web Development

Author: James Coleman

Since years we have seen the growing popularity of .net development services. These services have helped the .net developers to come up with different techniques that have provided new features to the websites designed today. With the emergence of asp.net web development it has become easier to design websites which are user-friendly as well as highly impressive.

Asp.net web development has come up to be more superior than the Asp Classic web development. The .net development services offered by different software firms have allowed the .net developers to create more user-friendly websites. The asp.net development professionals find Asp.net web development far much better than the clasic asp web development in many ways. Some the most important areas in which the Asp.net is better than Asp Classic include the ones mentioned below:

•Stability - It has been found that Asp.net is not susceptible to any kind of application crashes which incur during the functioning of application built in classic asp which runs under the inetinfo.exe (IIS) process. This means that the programming achieved with the help of Asp.net would be much more stable as compared to the programming achieved using Asp Classic.

•Language Support - While only VBScript and Javascript languages are used for scripting in Asp Classic, there are no such restrictions in Asp .net. The Asp.net allows the use of full server side programming languages and not just the scripting languages. With Asp.net you can use programming languages like C# and VB.net which allow the development of robust and extremely interactive web applications.

•Compilation - Asp.net allows you to compile the code the very first time it is being accessed. The compiled code then results in .Net classes which allow the servicing of the subsequent page requests with the previously compiled code. In contrast to this, the classic Asp is comprised of VBScript or Jscript interpreted at run-time which means the compilation is being carried out line-by-line. This simply results in some or the other kind of inefficiency.

•Scalability - Using the classic Asp web applications, it makes it difficult to update, maintain and replace the components used by the web pages. In simple terms, updating a component using classic Asp applications would require the shutting down of IIS, replacement of the component and then finally restarting the IIS. This process is too-lengthy. On the other hand, using Asp.net you can easily update the components in a less time-consuming manner. The recently launched “XCOPY” deployment model of Asp.net allows the replacement of web pages and components in real-time without the need for restarting of the web server. Hence, Asp.net tools help in achieving more stable web applications as compared to the classic Asp tools.

The .net development services have proved to be a boon to all the developers working on the .net platform. It has also been found that the Asp.net web development is anytime better than the normal Asp web development because of its exclusive features. Also the introduction of latest versions of Asp.net has been extremely helpful in the creation of feature-rich websites that serve the purposes of different business organizations all over the world.

About the Author:

James Coleman writes for Technousa where you can read more about - .net development services and asp.net web development.

Article Source: ArticlesBase.com - Asp.Net Web Development VS Classic Asp Web Development

Wednesday, September 23, 2009

Dot Net Development: LINQ improves the productivity of a developer

Author: Tyler Moon

Microsoft Language Integrated Query (LINQ) offers developers a latest way to query data using strongly-typed queries and strongly-typed results, frequent across a number of dissimilar data types including relational databases, .NET objects, and XML. With the help of strongly-typed queries and results, LINQ improves the productivity of a developer with the benefits of IntelliSense and compile-time error checking.

LINQ to SQL

LINQ to SQL is an object-relational mapping (ORM) framework which ensures the direct 1-1 mapping of a Microsoft SQL Server database to .NET classes, and query of the resultant objects using LINQ. More specifically, LINQ to SQL has been developed with a goal to rapidly develop the scenario against Microsoft SQL Server where the database is very similar to the application object model and the primary concern is amplified developer productivity.

LINQ to Entities

LINQ to Entities is, exclusively, a part of the ADO.NET Entity Framework which permits LINQ query capabilities. The Entity Framework is the fruition of ADO.NET that enables developers to program in terms of the standard ADO.NET abstraction or in terms of persistent objects (ORM) and is built upon the standard ADO.NET Provider model that ensures an access to third party databases. The Entity Framework harbingers a new set of services around the Entity Data Model (EDM).

LINQ to DataSet

LINQ is one of the best ways to make queries and set based operations first class citizens in the .NET world. It enables queries to be printed in the development language, and provides compile time type checking. In addition, LINQ ensures full power of the framework to be used when writing queries. LINQ to DataSets bestows this power to your DataSet based application.

Technical Articles

The major scenarios for which each of these technologies have been designed:

Webcasts: It is the Entity Framework for Database Administrators (Level 200) which is a new data technology from Microsoft that may chiefly rouse the interest of database administrators (DBAs).

Framework Masterclass: LINQ to SQL (Level 200) is a Microsoft .NET Language Integrated Query (LINQ) that provides a familiar way to work with data in your applications.

Introducing LINQ to DataSet (Level 200):

Exploration of new technologies within Microsoft Visual Studio code name "Orcas" make working with data a better practice. One such technology is Microsoft .NET Language Integrated Query (LINQ), code name for a set of extensions to the Microsoft .NET Framework that include language-integrated data query, set, and change operations.

Microsoft Language Integrated Query (LINQ) makes way for the dot net development a latest way to query data using strongly-typed queries and strongly-typed results.

About the Author:

Tyler Moon is an expert in article writing and internet marketing. She regularly contributes articles on various topics like security services, birth announcements etc.

Article Source: ArticlesBase.com - Dot Net Development: LINQ improves the productivity of a developer

Monday, September 14, 2009

Using ODBC with PHP

Using ODBC with PHP ODBC is one of Microsoft's earliest technologies for connecting to databases. It is very popular and widely used. This article describes how to setup and use ODBC from a PHP perspective.

Also see DSN-less connections with PHP.

What is ODBC?

Open DataBase Connectivity is an Application Programming Interface (API) that allows a programmer to abstract a program from a database. When writing code to interact with a database, you have to add code that talks to a particular database using a proprietary API. If you want your program to talk to an Access, FoxPro and Oracle databases you have to code your program with three different database API's. This can be quite the daunting task causing much grief. Now, enter ODBC...

When programming to interact with ODBC you only need to use the ODBC API (a combination of ODBC extension function calls and the SQL language) to talk to different database products. The ODBC Manager will figure out how to contend with the type of database you are targeting. Regardless of the database type you are using, all of your calls will be to the ODBC API. All that you need to do is have installed an ODBC driver that is specific to the type of database you will be using.

Creating A ODBC Data Source Name (DSN)

After you have ensured that the ODBC driver for your database is installed, you normally need to create a Data Source Name (DSN), which contains all the connection details required to login (accept maybe id and password).

Walkthrough: How to Setup a DSN. A pictorial step-by-step guide. The next button is hidden on the bottom-right. Sorry but we Windows programmers are not user interface experts ;-)

Continue reading here

Tuesday, September 8, 2009

10 reasons why PCs crash U must Know

Fatal error: the system has become unstable or is busy," it says. "Enter to return to Windows or press Control-Alt-Delete to restart your computer. If you do this you will lose any unsaved information in all open applications."

You have just been struck by the Blue Screen of Death. Anyone who uses Mcft Windows will be familiar with this. What can you do? More importantly, how can you prevent it happening?

1 Hardware conflict

The number one reason why Windows crashes is hardware conflict. Each hardware device communicates to other devices through an interrupt request channel (IRQ). These are supposed to be unique for each device.

For example, a printer usually connects internally on IRQ 7. The keyboard usually uses IRQ 1 and the floppy disk drive IRQ 6. Each device will try to hog a single IRQ for itself.

If there are a lot of devices, or if they are not installed properly, two of them may end up sharing the same IRQ number. When the user tries to use both devices at the same time, a crash can happen. The way to check if your computer has a hardware conflict is through the following route:

* Start-Settings-Control Panel-System-Device Manager.

Often if a device has a problem a yellow '!' appears next to its description in the Device Manager. Highlight Computer (in the Device Manager) and press Properties to see the IRQ numbers used by your computer. If the IRQ number appears twice, two devices may be using it.

Sometimes a device might share an IRQ with something described as 'IRQ holder for PCI steering'. This can be ignored. The best way to fix this problem is to remove the problem device and reinstall it.

Sometimes you may have to find more recent drivers on the internet to make the device function properly. A good resource is www.driverguide.com. If the device is a soundcard, or a modem, it can often be fixed by moving it to a different slot on the motherboard (be careful about opening your computer, as you may void the warranty).

When working inside a computer you should switch it off, unplug the mains lead and touch an unpainted metal surface to discharge any static electricity.

To be fair to Mcft, the problem with IRQ numbers is not of its making. It is a legacy problem going back to the first PC designs using the IBM 8086 chip. Initially there were only eight IRQs. Today there are 16 IRQs in a PC. It is easy to run out of them. There are plans to increase the number of IRQs in future designs.

2 Bad Ram

Ram (random-access memory) problems might bring on the blue screen of death with a message saying Fatal Exception Error. A fatal error indicates a serious hardware problem. Sometimes it may mean a part is damaged and will need replacing.

But a fatal error caused by Ram might be caused by a mismatch of chips. For example, mixing 70-nanosecond (70ns) Ram with 60ns Ram will usually force the computer to run all the Ram at the slower speed. This will often crash the machine if the Ram is overworked.

One way around this problem is to enter the BIOS settings and increase the wait state of the Ram. This can make it more stable. Another way to troubleshoot a suspected Ram problem is to rearrange the Ram chips on the motherboard, or take some of them out. Then try to repeat the circumstances that caused the crash. When handling Ram try not to touch the gold connections, as they can be easily damaged.

Parity error messages also refer to Ram. Modern Ram chips are either parity (ECC) or non parity (non-ECC). It is best not to mix the two types, as this can be a cause of trouble.

EMM386 error messages refer to memory problems but may not be connected to bad Ram. This may be due to free memory problems often linked to old Dos-based programmes.

3 BIOS settings

Every motherboard is supplied with a range of chipset settings that are decided in the factory. A common way to access these settings is to press the F2 or delete button during the first few seconds of a boot-up.

Once inside the BIOS, great care should be taken. It is a good idea to write down on a piece of paper all the settings that appear on the screen. That way, if you change something and the computer becomes more unstable, you will know what settings to revert to.

A common BIOS error concerns the CAS latency. This refers to the Ram. Older EDO (extended data out) Ram has a CAS latency of 3. Newer SDRam has a CAS latency of 2. Setting the wrong figure can cause the Ram to lock up and freeze the computer's display.

Mcft Windows is better at allocating IRQ numbers than any BIOS. If possible set the IRQ numbers to Auto in the BIOS. This will allow Windows to allocate the IRQ numbers (make sure the BIOS setting for Plug and Play OS is switched to 'yes' to allow Windows to do this.).

4 Hard disk drives

After a few weeks, the information on a hard disk drive starts to become piecemeal or fragmented. It is a good idea to defragment the hard disk every week or so, to prevent the disk from causing a screen freeze. Go to

* Start-Programs-Accessories-System Tools-Disk Defragmenter

This will start the procedure. You will be unable to write data to the hard drive (to save it) while the disk is defragmenting, so it is a good idea to schedule the procedure for a period of inactivity using the Task Scheduler.

The Task Scheduler should be one of the small icons on the bottom right of the Windows opening page (the desktop).

Some lockups and screen freezes caused by hard disk problems can be solved by reducing the read-ahead optimisation. This can be adjusted by going to

* Start-Settings-Control Panel-System Icon-Performance-File System-Hard Disk.

Hard disks will slow down and crash if they are too full. Do some housekeeping on your hard drive every few months and free some space on it. Open the Windows folder on the C drive and find the Temporary Internet Files folder. Deleting the contents (not the folder) can free a lot of space.

Empty the Recycle Bin every week to free more space. Hard disk drives should be scanned every week for errors or bad sectors. Go to

* Start-Programs-Accessories-System Tools-ScanDisk

Otherwise assign the Task Scheduler to perform this operation at night when the computer is not in use.

5 Fatal OE exceptions and VXD errors

Fatal OE exception errors and VXD errors are often caused by video card problems.

These can often be resolved easily by reducing the resolution of the video display. Go to

* Start-Settings-Control Panel-Display-Settings

Here you should slide the screen area bar to the left. Take a look at the colour settings on the left of that window. For most desktops, high colour 16-bit depth is adequate.

If the screen freezes or you experience system lockups it might be due to the video card. Make sure it does not have a hardware conflict. Go to

* Start-Settings-Control Panel-System-Device Manager

Here, select the + beside Display Adapter. A line of text describing your video card should appear. Select it (make it blue) and press properties. Then select Resources and select each line in the window. Look for a message that says No Conflicts.

If you have video card hardware conflict, you will see it here. Be careful at this point and make a note of everything you do in case you make things worse.

The way to resolve a hardware conflict is to uncheck the Use Automatic Settings box and hit the Change Settings button. You are searching for a setting that will display a No Conflicts message.

Another useful way to resolve video problems is to go to

* Start-Settings-Control Panel-System-Performance-Graphics

Here you should move the Hardware Acceleration slider to the left. As ever, the most common cause of problems relating to graphics cards is old or faulty drivers (a driver is a small piece of software used by a computer to communicate with a device).

Look up your video card's manufacturer on the internet and search for the most recent drivers for it.

6 Viruses

Often the first sign of a virus infection is instability. Some viruses erase the boot sector of a hard drive, making it impossible to start. This is why it is a good idea to create a Windows start-up disk. Go to

* Start-Settings-Control Panel-Add/Remove Programs

Here, look for the Start Up Disk tab. Virus protection requires constant vigilance.

A virus scanner requires a list of virus signatures in order to be able to identify viruses. These signatures are stored in a DAT file. DAT files should be updated weekly from the website of your antivirus software manufacturer.

An excellent antivirus programme is McAfee VirusScan by Network Associates ( www.nai.com). Another is Norton AntiVirus 2000, made by Symantec ( www.symantec.com).

7 Printers

The action of sending a document to print creates a bigger file, often called a postscript file.

Printers have only a small amount of memory, called a buffer. This can be easily overloaded. Printing a document also uses a considerable amount of CPU power. This will also slow down the computer's performance.

If the printer is trying to print unusual characters, these might not be recognised, and can crash the computer. Sometimes printers will not recover from a crash because of confusion in the buffer. A good way to clear the buffer is to unplug the printer for ten seconds. Booting up from a powerless state, also called a cold boot, will restore the printer's default settings and you may be able to carry on.

8 Software

A common cause of computer crash is faulty or badly-installed software. Often the problem can be cured by uninstalling the software and then reinstalling it. Use Norton Uninstall or Uninstall Shield to remove an application from your system properly. This will also remove references to the programme in the System Registry and leaves the way clear for a completely fresh copy.

The System Registry can be corrupted by old references to obsolete software that you thought was uninstalled. Use Reg Cleaner by Jouni Vuorio to clean up the System Registry and remove obsolete entries. It works on Windows 95, Windows 98, Windows 98 SE (Second Edition), Windows Millennium Edition (ME), NT4 and Windows 2000.

Read the instructions and use it carefully so you don't do permanent damage to the Registry. If the Registry is damaged you will have to reinstall your operating system. Reg Cleaner can be obtained from www.jv16.org

Often a Windows problem can be resolved by entering Safe Mode. This can be done during start-up. When you see the message "Starting Windows" press F4. This should take you into Safe Mode.

Safe Mode loads a minimum of drivers. It allows you to find and fix problems that prevent Windows from loading properly.

Sometimes installing Windows is difficult because of unsuitable BIOS settings. If you keep getting SUWIN error messages (Windows setup) during the Windows installation, then try entering the BIOS and disabling the CPU internal cache. Try to disable the Level 2 (L2) cache if that doesn't work.

Remember to restore all the BIOS settings back to their former settings following installation.

9 Overheating

Central processing units (CPUs) are usually equipped with fans to keep them cool. If the fan fails or if the CPU gets old it may start to overheat and generate a particular kind of error called a kernel error. This is a common problem in chips that have been overclocked to operate at higher speeds than they are supposed to.

One remedy is to get a bigger better fan and install it on top of the CPU. Specialist cooling fans/heatsinks are available from www.computernerd.com or www.coolit.com

CPU problems can often be fixed by disabling the CPU internal cache in the BIOS. This will make the machine run more slowly, but it should also be more stable.

10 Power supply problems

With all the new construction going on around the country the steady supply of electricity has become disrupted. A power surge or spike can crash a computer as easily as a power cut.

If this has become a nuisance for you then consider buying a uninterrupted power supply (UPS). This will give you a clean power supply when there is electricity, and it will give you a few minutes to perform a controlled shutdown in case of a power cut.

It is a good investment if your data are critical, because a power cut will cause any unsaved data to be lost.

Tuesday, September 1, 2009

Windows XP Hidden Application

To run any of these apps go to Start > Run and type the executable name (ie charmap).

WINDOWS XP HIDDEN APPS:
=========================================

1) Character Map = charmap.exe (very useful for finding unusual characters)

2) Disk Cleanup = cleanmgr.exe

3) Clipboard Viewer = clipbrd.exe (views contents of Windows clipboard)

4) Dr Watson = drwtsn32.exe (Troubleshooting tool)

5) DirectX diagnosis = dxdiag.exe (Diagnose & test DirectX, video & sound cards)

6) Private character editor = eudcedit.exe (allows creation or modification of characters)

7) IExpress Wizard = iexpress.exe (Create self-extracting / self-installing package)

8) Microsoft Synchronization Manager = mobsync.exe (appears to allow synchronization of files on the network for when working offline. Apparently undocumented).

9) Windows Media Player 5.1 = mplay32.exe (Retro version of Media Player, very basic).

10) ODBC Data Source Administrator = odbcad32.exe (something to do with databases)

11) Object Packager = packager.exe (to do with packaging objects for insertion in files, appears to have comprehensive help files).

12) System Monitor = perfmon.exe (very useful, highly configurable tool, tells you everything you ever wanted to know about any aspect of PC performance, for uber-geeks only )

13) Program Manager = progman.exe (Legacy Windows 3.x desktop shell).

14) Remote Access phone book = rasphone.exe (documentation is virtually non-existant).

15) Registry Editor = regedt32.exe [also regedit.exe] (for hacking the Windows Registry).

16) Network shared folder wizard = shrpubw.exe (creates shared folders on network).

17) File siganture verification tool = sigverif.exe

18) Volume Contro = sndvol32.exe (I've included this for those people that lose it from the System Notification area).

19) System Configuration Editor = sysedit.exe (modify System.ini & Win.ini just like in Win98! ).

20) Syskey = syskey.exe (Secures XP Account database - use with care, it's virtually undocumented but it appears to encrypt all passwords, I'm not sure of the full implications).

21) Microsoft Telnet Client = telnet.exe

22) Driver Verifier Manager = verifier.exe (seems to be a utility for monitoring the actions of drivers, might be useful for people having driver problems. Undocumented).

23) Windows for Workgroups Chat = winchat.exe (appears to be an old NT utility to allow chat sessions over a LAN, help files available).

24) System configuration = msconfig.exe (can use to control starup programs)

25) gpedit.msc used to manage group policies, and permissions

Monday, August 24, 2009

Chameleon Button by Gonchuki Systems


CHAMELEON BUTTON
copyright ©2001-2003 by gonchuki

this custom control will emulate the most common
command buttons that everyone knows.

it took me three months to develop this control
but that was a first step now eight months after
it turned out to be a very professional control.

ALL THE CODE WAS WRITTEN FROM SCRATCH!!!

ever wanted to add cool buttons to your app???
this is the BEST solution!!!

Copyright © 2001-2003 by gonchuki

Commercial use of this control is FORBIDDEN
without registering first.
You can only use parts of this code for other
open source or freeware programs. Reuse of this
code in commercial applications is also FORBIDDEN
You can use this code without asking for your
personal projects or for freeware but remember
to give credits where its due

you MUST NOT build nor distribute OCX controls
based on the Chameleon Button, doing so is
against this terms.

Download source code here

How to customise your start button

First you need a tool called "Resource Hacker". This free program allows you to change resources in any .exe file such as "Explorer.exe", which includes the [Start] button's Label. You can visit Download.com and search there for "Resource Hacker".
After you download it, follow the guide here:

Step 1:

A - Run "Resource Hacker" and open the file "%windir%\Explorer.exe".
B - You see a Tree of all Resources in this file, expand the "String Table"
C - Find the "start" and replace it with your own text. then press the [Compile Script] button.
D - Save "Explorer.exe" as "MyStart.exe" DONT save it as Explorer.exe, do "save as.." and give it a new name.
E - Quit "Resource Hacker".

Step 2:

A - Click on the [Start] button and choose the "Run..." item from the start menu. (Or use the shortcut key WinKey+R)
B - Type "RegEdit" in the Run "Dialog Box". And then press the [Ok] buton to run the "Registry Editor" program.
C - Go to: "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon" and find the "Shell" property.
D - Replace value of the "Shell" property to "MyStart.exe".
E - Quit "Registry Editor".
F - Restart your system.

Note about Registry Editor:
if you did not find the key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon", you can search the Registry for the "Explorer.exe", to do this use the Edit Menu | Find Next (Ctrl+F).

Thursday, August 20, 2009

Change The Default Location For Installing Application

As the size of hardrives increase, more people are using partitions to seperate and store groups of files.

XP uses the C:\Program Files directory as the default base directory into which new programs are installed. However, you can change the default installation drive and/ or directory by using a Registry hack.

Run the Registry Editor (regedit)and go to

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion

Look for the value named ProgramFilesDir. by default,this value will be C:\Program Files. Edit the value to any valid drive or folder and XP will use that new location as the default installation directory for new programs.

Tuesday, August 4, 2009

Sample Thesis: For Surigao Students

This is a screen shots of the thesis I am working for Surigao Students
This is a inventory system for Pat's Purified Drinking Water, it is not yet finish but I will post some of the modules that I am done with.

This are the screen shots of it:

1. This is the main screen




2. Customer's Information Module

Align Center

3. Adding/Editing Customers Information



Monday, July 13, 2009

Steps In Creating Instance and Database in IBM DB2

01. Click Start on the Windows Toolbar

02. Click Run...

03. Type db2cw on the Open combo box and click OK button

=== please wait until DOS Prompt appears

04. On the DB2 Command Window, type the following commands and press Enter key for each line of command:

db2icrt DEV

db2 CATALOG LOCAL NODE DEV INSTANCE DEV SYSTEM OSTYPE WIN WITH 'Instance for OIS'

=== Substitute with the full computer name of the computer
=== You can see the full computer name by: right-click My Computer, Select Properties and Click Network Identification

05. Start DB2 - DEV instance on Services

=== make it automatic
=== Select This account on Log On tab
=== User name .\db2admin
=== Password password
=== Confirm password password

06. Start DB2 Governor on Services

=== make it automatic

07. On the DB2 Command Window, type the following commands and press Enter key for each line of command:

db2 ATTACH TO DEV

db2 CREATE DATABASE OIS ON C: WITH 'Database for OIS'

=== please wait until DOS Prompt appears

exit

08. Click Start on the Windows Toolbar

09. Click Run...

10. Type db2ca on the Open combo box and click OK button

=== please wait until Configuration Assitant appears

11. On the pane, right-click OIS and click Change Database...

=== please wait until Change Database Wizard appears

12. Click Database

13. Type S_OIS on Database alias text box and click Next button

14. Enter the following parameters:

Register this database for ODBC checked
As system data source selected
As user data source unselected
As file data source unselected
Data source name S_OIS
Optimize for application None

15. Click Finish button

16. Close the Configuration Assistant.

17. Open Data Sources (ODBC) on Administrative Tools

18. On System DSN tab, select S_OIS and click Configure button

19. Enter the following parameters:

Data source anme S_OIS
Description
User ID db2admin
Password password
Save Password checked (click OK button on the DB2 Message)

20. Click Connect button

=== DB2 Message must be "Connection tested successfully"
(click OK button on the DB2 Message)

21. Click Bind CLI/ODBC support utilities button

=== There must be result and click OK button

22. Click OK button

23. Click OK button

24. Click Start on the Windows Toolbar

25. Click Run...

26. Type db2cc on the Open combo box and click OK button

=== please wait until Control Center appears

27. On the Object View pane, click nodes of All Systems, , Instances until DEV instance OISplayed

28. Richt-click DEV instance and click Setup communications

29. Enter the following parameters:

NetBIOS unchecked
TCP/IP checked
NPIPE unchecked


30. Click Properties(2) button

31. Enter the following parameters:

Host name
Service name applctn
Port number 50001

32. Click OK button

=== message will appear

33. Click Close button

33. Click OK button

=== message will appear

34. Click Close button

35. Richt-click DEV instance and click Stop

36. Click OK button

=== message will appear

37. Click Close button

38. Richt-click DEV instance and click Start

=== message will appear

39. Click Close button

40. Close the Control Center.

How To Reseed Table Identity on SQL

To reseed table identity in SQL we will going to use the function DBCC CHECKIDENT

Syntax

DBCC CHECKIDENT
( 'table_name'
[ , { NORESEED
| { RESEED [ , new_reseed_value ] }
}
]
)

Arguments

'table_name'

Is the name of the table for which to check the current identity value. Table names must conform to the rules for identifiers. For more information, see Using Identifiers. The table specified must contain an identity column.

NORESEED

Specifies that the current identity value should not be corrected.

RESEED

Specifies that the current identity value should be corrected.

new_reseed_value

Is the value to use in reseeding the identity column.


Example:

DBCC CHECKIDENT (My_Table, reseed, 0)

This example will reseed table My_Table, and the identity seed will start 1 again

Monday, June 8, 2009

Image Button Control

This is an alternative button control, that can handle images even its flatstyle is set to System, this control is for VB.Net 2003 users.

To use this code, create new project and select windows controls libary, and add new control and name it Imagebutton, just copy this code and paste. Thats all.

Imports System.Runtime.InteropServices
Public Class ImageButton
Inherits System.Windows.Forms.Button
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
MyBase.WndProc(m)
If m.Msg = (NativeMethods.WM_REFLECT Or NativeMethods.WM_NOTIFY) Then
Dim CustomDrawHeader As NativeMethods.NMCUSTOMDRAW = DirectCast(Marshal.PtrToStructure(m.LParam, GetType(NativeMethods.NMCUSTOMDRAW)), NativeMethods.NMCUSTOMDRAW)
If CustomDrawHeader.dwDrawStage = NativeMethods.CustomDrawDrawStage.CDDS_PREPAINT Then
Dim g As Graphics = Graphics.FromHdc(CustomDrawHeader.hdc)
Dim pe As New PaintEventArgs(g, Me.Bounds)
OnPaint(pe)
pe.Dispose()
g.Dispose()
End If
End If
End Sub
Protected Overrides Sub OnPaint(ByVal pevent As System.Windows.Forms.PaintEventArgs)
MyBase.OnPaint(pevent)
DrawImage(pevent.Graphics)
End Sub
Protected Overridable Sub DrawImage(ByVal g As Graphics)
If Me.Image Is Nothing Then Return

Dim pt As PointF

Select Case Me.ImageAlign
Case ContentAlignment.TopLeft
pt.X = 5
pt.Y = 5
Case ContentAlignment.TopCenter
pt.X = Convert.ToSingle(Width - Me.Image.Width) / 2
pt.Y = 5
Case ContentAlignment.TopRight
pt.X = Width - Me.Image.Width - 5
pt.Y = 5
Case ContentAlignment.MiddleLeft
pt.X = 5
pt.Y = Convert.ToSingle(Height - Me.Image.Height) / 2
Case ContentAlignment.MiddleCenter
pt.X = Convert.ToSingle(Width - Me.Image.Width) / 2
pt.Y = Convert.ToSingle(Height - Me.Image.Height) / 2
Case ContentAlignment.MiddleRight
pt.X = Width - Me.Image.Width - 5
pt.Y = Convert.ToSingle(Height - Me.Image.Height) / 2
Case ContentAlignment.BottomLeft
pt.X = 5
pt.Y = Height - Me.Image.Height - 5
Case ContentAlignment.BottomCenter
pt.X = Convert.ToSingle(Width - Me.Image.Width) / 2
pt.Y = Height - Me.Image.Height - 5
Case Else
pt.X = Width - Me.Image.Width - 5
pt.Y = Height - Me.Image.Height - 5
End Select

If Me.Enabled Then
If Me.ImageList Is Nothing Then
g.DrawImage(Me.Image, pt.X, pt.Y, Me.Image.Width, Me.Image.Height)
Else
Me.ImageList.Draw(g, Point.Round(pt), Me.ImageIndex)
End If
Else
Dim p As Point = Point.Round(pt)
ControlPaint.DrawImageDisabled(g, Me.Image, p.X, p.Y, Me.BackColor)
End If

End Sub

End Class

Friend Class NativeMethods
Private Sub New()
'Uninstantiable Class
End Sub

Public Const WM_USER As Int32 = &H400&
Public Const WM_NOTIFY As Int32 = &H4E&
Public Const WM_REFLECT As Int32 = WM_USER + &H1C00&
Public Const NM_FIRST As Int32 = 0
Public Const NM_CUSTOMDRAW As Int32 = NM_FIRST Or -12

Public Enum CustomDrawDrawStage
CDDS_PREPAINT = &H1
CDDS_POSTPAINT = &H2
CDDS_PREERASE = &H3
CDDS_POSTERASE = &H4
CDDS_ITEM = &H10000
CDDS_ITEMPREPAINT = (CDDS_ITEM Or CDDS_PREPAINT)
CDDS_ITEMPOSTPAINT = (CDDS_ITEM Or CDDS_POSTPAINT)
CDDS_ITEMPREERASE = (CDDS_ITEM Or CDDS_PREERASE)
CDDS_ITEMPOSTERASE = (CDDS_ITEM Or CDDS_POSTERASE)
CDDS_SUBITEM = &H20000
End Enum

Public Enum CustomDrawItemState
CDIS_SELECTED = &H1
CDIS_GRAYED = &H2
CDIS_DISABLED = &H4
CDIS_CHECKED = &H8
CDIS_FOCUS = &H10
CDIS_DEFAULT = &H20
CDIS_HOT = &H40
CDIS_MARKED = &H80
CDIS_INDETERMINATE = &H100
CDIS_SHOWKEYBOARDCUES = &H200
End Enum

_
Public Structure NMHDR
Public HWND As Int32
Public idFrom As Int32
Public code As Int32
Public Overloads Function ToString() As String
Return String.Format("Hwnd: {0}, ControlID: {1}, Code: {2}", HWND, idFrom, code)
End Function
End Structure
_
Public Structure NMCUSTOMDRAW
Public hdr As NMHDR
Public dwDrawStage As CustomDrawDrawStage
Public hdc As IntPtr
Public rc As RECT
Public dwItemSpec As IntPtr
Public uItemState As CustomDrawItemState
Public lItemlParam As IntPtr
End Structure
_
Public Structure RECT
Public left, top, right, bottom As Int32
End Structure
End Class


I got this in some websites, Im sorry I forget the site, If your the original owner of the code please pm me:

Tuesday, May 26, 2009

how to bypass Pc Security all versions

hi all,
about 6 months ago in our college they decided to restrict us with some kind of software which is its task is to lock folders and drives and so many other cool things.
well on that time I wasn't so curious about that until one of my friend told me that he is in trouble with these kind of crappy restrictions.

after that I start to investigation on "pc security" and the solution was simple and funny.

when you install this s/w on your computer it will put 2 exe files in your windows directory and startup called:

winwd.exe
sdeamon.exe

and if you bring on the task manager you gonna find them there and if you try to end task these two files you will see they gonna start their job again.

well at first try I start to rename them from windows directory and then try to kill them from task manager and BINGO it was successful try.
it is quite easy first try to rename or delete these two files from windows directory then kill them from task manager.
I also write a tiny c++ code for automating this task :

//code in vc++.net 2008
int _tmain(int argc, _TCHAR* argv[])
{
TCHAR windiro[INFO_BUFFER_SIZE];
TCHAR windir[INFO_BUFFER_SIZE];
TCHAR exec[8];
TCHAR s1[]=_T("\\sdeamon.exe");
TCHAR s2[]=_T("\\winwd.exe");
_tprintf(_T("bypassing pcsecurity \n"));




GetWindowsDirectory(windir,INFO_BUFFER_SIZE);
GetWindowsDirectory(windiro,INFO_BUFFER_SIZE);
_tcscat(windir,s1);
_tcscat(windiro,s2);
_tprintf(windir);
_tprintf(windiro);

DeleteFile(windir);
DeleteFile(windiro);
HINSTANCE nr = ShellExecute(NULL,_T("open"),_T("taskkill"),_T("/f /im sdaemon.exe"),_T("C:\\"),SW_SHOWNA);
HINSTANCE nr1 = ShellExecute(NULL,_T("open"),_T("taskkill"),_T("/f /im winwd.exe"),_T("C:\\"),SW_SHOWNA);
if (nr == 0)
_tprintf(_T("successful"));
else
_tprintf(_T("unsuccessful"));
int i;
_tscanf(exec);
return 0;

}

Njoy.

how to execute asp.net files with different extension

Hi again.
You might be wondering that sometimes some websites choose different extensions for their web pages as an instance their web site is build by asp.net and you are supposed to see aspx extension at the end of their address but it is not like that you will see something like acme.

Well here I'm gonna show you how to make change.
thanks to the Microsoft and his new understanding of how to build our life easier, this job will done only in matter of 5 minutes or less .

go to your WINDOWS\Microsoft.NET\Framework\{frame work version}\CONFIG

here you will find the heart of your asp.net config files such as machine.config , web.config , etc...

open web.config

and follow the below XML file





<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>

<handlers>
<add name="ASPNETLikeHandler-Classic" path="*.acme"
verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll"
requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32"
/>
<add name="ASPNETLikeHandler" path="*.acme"
verb="GET,HEAD,POST,DEBUG" type="System.Web.UI.PageHandlerFactory" modules="ManagedPipelineHandler"
requireAccess="Script" preCondition="integratedMode" />
</handlers>

<validation validateIntegratedModeConfiguration="false" />
</system.webServer>

<system.web>
<compilation>
<buildProviders>

<add extension=".acme" type="System.Web.Compilation.PageBuildProvider"
/>
</buildProviders>
</compilation>
<httpHandlers>

<add path="*.acme" type="System.Web.UI.PageHandlerFactory"
verb="*" />
</httpHandlers>
</system.web>
</configuration>




I assume that your familiar with how to make changes in web.config.
ciao.

Monday, May 25, 2009

catching captcha image part 1 C#

Hey there,
Today I had a nice experience with a spammer software which was written by c#.net and it was packed by .net reactor .
I was astonished that how come the programmer was able to trick blog site according to their captcha system.
because their way of implementing the captcha system is horribly hard to expose , sometimes I was thinking by myself that how can I mess with this captcha thing.
Well today I was lucky and got my answer and that poor programmer was unlucky .
I unpack his code and understand several things which I'm going to sum up them :
1- if you wana write a spammer most of the times you can't use webclient or webrequest classes well you should do it by the help of webBrowser or shdocvw which ever you are comfortable with.

2-suppose you navigate a site , something like "www.acmeblog.com" you should wait until the document load full in your container how can we wait that much?
using DocumentCompleted event
or
using something like following:
while (webBrowser.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
}
until it is loaded it is not going to do anything except loading your page.

I cross my heart that just two things I've learnt from that lame programmer, I got rest of these tips by my own A$$:

3-In some websites getting captcha picture is a hard job first of all maybe it's not going to show itself at first until you fire some other events like focusing on some textbox or clicking a button well you should use a bit of knowledge of how to deal with javascript and how to find the badboy in a goodplace, well I did it by the help of firefox and firebug to find the which script was being run (I'm not gonna teach how to use firebug).

to execute the script by your self and on your own way you can accomplish this task by using :
WebBrowser.Document.InvokeScript("your_script_name");

4-sometimes the web designers fantasize that they are very clever and they can do something that no one else can do that in all around the world !
can you imagine how stupid they are???
well they are going to show captcha image without any name or id tag i mean something like below:


< src="hxxp://acmeblog.com/comments/Captcha.ashx?6233633">



as you can see there is no clue that gonna help us to get the src tag.
well how can we overcome this problem? easy peasy japanesey

with the help of foreach{} statement and search inside htmlelement we can find out our sweat captcha , you can see in the following :

foreach (HtmlElement img in wb.Document.Images)
{

isitcaptcha = img.OuterHtml.IndexOf("Captcha", 0);
if (isitcaptcha > 0)
{
captchaimg = img.OuterHtml.ToString();
.
.
.

5-well we've got our captcha source till now, then we have to be nimble and show this captcha quickly otherwise again the web designer will think that he was much smarter than you.
by showing the image inside a webBrowser you can have a copy of that captch on your own.

6-last and worth one : how to save that goddamn captch image out of my webbrowser?
believe me or not it is a very tedious job I was searching around 6 hours through the libraries (I mean .net library not a goddamn ordinary library where people going there and read Harry Potter)
Internet and my books until I found this useful webblog and his tricky way of saving webbrowser pictures.

below you can find a very first edition of what I've done :

http://rapidshare.com/files/237216229/spam_test.rar


inside code you will find a bunch of comments nonsense don't worry they are written in Persian and they won't harm you ;)

next episode I will teach you how to OCR captcha and retrieve it as a text :D

ciao.

Tuesday, March 24, 2009

How to draw rectangles from a given graph removing the common vertical lines using JavaScript.

Please refer
Draw line using third party java script file

As explained in above post that the third party java script file makes our task very easier to draw objects.
Now by using this java script file, I would like to share my HTML page and java script code to generate below.
Output:



Note : This is a basic HTML page, so it is not specific to technology
Input :-
User enters number of rectangles in input text box and clicks on “Generate rectangles”, to generate random rectangles.
It should generate mentioned number of rectangles with random height and width but base lined bottoms (similar to a graph).



When user clicks on “Generate button” giving number of input rectangles as 10.



Now output: When user clicks on “Generate Output”, we should draw those rectangles as shown below.




Removing the vertical lines between rectangles to display as union but at last the area of all these output rectangles should be same as are of all input rectangles.
Note:
If you would like to copy the below HTML page to run, Make sure that the third party graphics JavaScript file is downloaded into your machine and placed in this application folder where you are creating this HTML page.
Down third party JavaScript file by clicking here
wz_jsgraphics.zip download
HTML File :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Rectangles</title>
<link rel="stylesheet" type="text/css" href="Styles/Stylesheet.css" />
</head>
<body>
<div id="Canvas" style="position:relative;height:5px;width:5px;"></div>
<script type="text/javascript" language="javascript" src="wz_jsgraphics.js"></script>
<script type="text/javascript" language="javascript">
var jg = new jsGraphics("Canvas"); // Use the "Canvas" div for drawing
</script>
<script type="text/javascript" language="javascript">
var orgX=50;
var orgY=200;
var minWdth=20;
var minHght=30;
var maxWdth=60;
var maxHght=120;
var rndFactor=10;
var opShft=150;
var lnCntr=0;
var tmr=50;
var iprects=null;
var oprects=null;
var argCnt;
var inpCntr=0;
var rects=new Array();
var ipTmr=50;
var optmr=50;
var recCntr=0;
function rect()
{
var width;
var height;
var id;
var x1;
var y1;
}
function generaterectangles_clk()
{
var txtRec=document.getElementById('txtRects');
if(txtRec.value=='')
{
alert('Please enter number of rectangles to generate');
txtRec.focus();
return;
}
if(!IsNumber(txtRec.value))
{
alert('Please enter numeric value');
txtRec.focus();
return;
}
var numRects=txtRec.value;
if(numRects<3 || numRects>30)
{
alert('Number of rectangles to generate should be between 3 and 30');
txtRec.focus();
return;
}
orgX=50;
orgY=400;
argCnt=numRects;
inpCntr=0;
rects=new Array();
GenerateRects();
}

function GenerateRects()
{
inpCntr++;
if(inpCntr<=argCnt)
{
var rand_no;
var recWth,recHgt;
rand_no = Math.random();
recWth=Math.floor(minWdth+(maxWdth-minWdth)*rand_no);
recHgt=Math.floor(minHght+(maxHght-minHght)*rand_no);
var objRect=new rect();
objRect.width=recWth;
objRect.height=recHgt;
objRect.id=(inpCntr);
rects[rects.length]=objRect;
DefineRects(rects);
setTimeout('GenerateRects();',ipTmr);
}
else
{
var divdisp=document.getElementById('div_recIndx');
divdisp.style.display='none';
divdisp.innerText='';
}
}
function dispRecIndex(x1,y1,txt)
{
var divdisp=document.getElementById('div_recIndx');
divdisp.style.display='block';
divdisp.innerText=txt;
divdisp.style.left=x1;
divdisp.style.top=y1;
}
function DefineRects(argRects)
{
jg.clear();
var x1=orgX;
var y1=orgY;
var buf=5;
var crd=findPosition(document.getElementById('div_map'));
var maxY=crd[1]-buf;
var maxX=document.getElementById('div_map').offsetWidth+crd[0]-buf;
var minY=crd[1]-document.getElementById('div_map').offsetHeight;
var minX=crd[0];
var objRect=new rect();
for(i=0;i<argRects.length;i++)
{
objRect=argRects[i];
if(x1<maxX && x1>minX)
{
objRect.x1=x1;
objRect.y1=y1;
x1+=objRect.width;
}
else
{
for(j=i;j<argRects.length;j++)
argRects[j]=null;
break;
}
if(y1<maxY && y1>minY)
{
objRect.y1=maxY;
}
argRects[i]=objRect;
}
iprects=argRects;
for(i=0;i<argRects.length;i++)
{
if(argRects[i]==null)
break;
objRect=argRects[i];
var xc=new Array();
var yc=new Array();
xc[0]=objRect.x1;
yc[0]=objRect.y1;
xc[1]=objRect.x1+objRect.width;
yc[1]=objRect.y1;
xc[2]=objRect.x1+objRect.width;
yc[2]=objRect.y1-objRect.height;
xc[3]=objRect.x1;
yc[3]=objRect.y1-objRect.height;
xc[4]=objRect.x1;
yc[4]=objRect.y1;
clr=clr1;
dispRecIndex((xc[0]+xc[1])/2,(yc[0]+yc[2])/2,(i+1));
drawRect(xc,yc);
}
}




function generateoutput_clk()
{
if(iprects==null)
return;
var argRects=new Array();
for(i=0;i<iprects.length;i++)
{
if(iprects[i]==null )
break;
var objRect=iprects[i];
var obj=new rect();
obj.x1=objRect.x1;
obj.y1=objRect.y1;
obj.width=objRect.width;
obj.height=objRect.height;
obj.id=objRect.id;
argRects[i]=obj;
}
var prx1,pry1,crx1,cry1;
for(i=0;i<argRects.length;i++)
{
if(argRects[i]==null )
continue;
var currect=argRects[i];
for(var j=i-1;j>=0;j--)
{
if(argRects[j]==null)
continue;
var prvrect=argRects[j];
if(iprects[j].height<=iprects[i].height)
break;
if(prvrect.y1!=currect.y1)
continue;
if(iprects[j].height==iprects[i].height && j==i-1)
{
currect.width=currect.width+iprects[j].width;
iprects[j]=null;
argRects[j]=null;
continue;
}
currect.x1=prvrect.x1;
currect.y1=prvrect.y1;
currect.width=currect.width+prvrect.width;
if(prvrect.y1-prvrect.height<=currect.y1-currect.height)
{
prvrect.y1=currect.y1-currect.height;
prvrect.height=prvrect.height-currect.height;
}
argRects[i]=currect;
}
for(var j=i+1;j<argRects.length;j++)
{
if(argRects[j]==null)
continue;
var nxtrect=argRects[j];
if(nxtrect.y1!=currect.y1)
continue;
if(iprects[j].height<iprects[i].height)
break;
if(iprects[j].height==iprects[i].height && j==i+1)
{
currect.width=currect.width+iprects[j].width;
iprects[j]=null;
argRects[j]=null;
continue;
}
currect.width=currect.width+iprects[j].width;
if(nxtrect.y1-nxtrect.height<=currect.y1-currect.height)
{
nxtrect.y1=currect.y1-currect.height;
nxtrect.height=nxtrect.height-currect.height;
}
argRects[i]=currect;

}
}

oprects=argRects;
recCntr=0;
drawOp();
}
function drawOp()
{
var argRects=oprects;
if(oprects==null)
return;
var i=recCntr;
if(argRects[i]!=null)
{
objRect=argRects[i];
var xc=new Array();
var yc=new Array();
xc[0]=objRect.x1;
yc[0]=objRect.y1+opShft;
xc[1]=objRect.x1+objRect.width;
yc[1]=objRect.y1+opShft;
xc[2]=objRect.x1+objRect.width;
yc[2]=objRect.y1-objRect.height+opShft;
xc[3]=objRect.x1;
yc[3]=objRect.y1-objRect.height+opShft;
xc[4]=objRect.x1;
yc[4]=objRect.y1+opShft;
clr=clr1;
drawRect(xc,yc);
dispRecIndex((xc[0]+xc[1])/2,(yc[0]+yc[2])/2,(i+1));
}
else
{
var divdisp=document.getElementById('div_recIndx');
divdisp.style.display='none';
divdisp.innerText='';
}
recCntr++;
if(recCntr<=argRects.length)
setTimeout('drawOp();',optmr);
}
</script>

<script type="text/javascript" language="javascript">
function IsNumber(argText)
{
var nums='0123456789';
for(i=0;i<argText.length;i++)
{
if(nums.indexOf(argText.charAt(i))==-1)
return false;
}
return true;
}

var clr="red";
var clr1='red';
var clr2='green';
var clr3='blue';
var strk=2;
function drawRect(xc,yc)
{
jg.setStroke(strk);
jg.setColor(clr);
jg.drawPolygon(xc,yc);
jg.paint();
}

function findPosition(element)
{
var left = 0;
var top = 0;

if (element != null)
{
while (element.offsetParent)
{
left += element.offsetLeft;
if (element.offsetParent.scrollLeft) {left -= element.offsetParent.scrollLeft; }
top += element.offsetTop;
if (element.offsetParent.scrollTop) { top -= element.offsetParent.scrollTop; }
element = element.offsetParent;
}
left += element.offsetLeft + document.body.scrollLeft - document.body.clientLeft + 7;
top += element.offsetTop + document.body.scrollTop - document.body.clientTop;
}

return [left,top];
}

</script>
<script type="text/javascript" language="javascript">
function DisplayText(argText)
{
var obj=document.getElementById('div_map');
var divdwn=document.getElementById('div_download');
divdwn.style.display='block';
divdwn.innerText=argText;
var crd=findPosition(obj);
divdwn.style.left=crd[0];
divdwn.style.top=crd[1]+40;
document.getElementById('btnDisp').style.display='block';
}
</script>


<table id="maintable" style="width:800px;">
<tr class="tr_header">
<td style="width:40%;text-align:right;">Number of Input Rectangles :</td><td><input type="text" id="txtRects" /> 
</td>
</tr>
<tr>
<td class="tr_header" style="text-align:center;" colspan="2">
<input type="button" value="Generate Rectangles" class="cssbutton" style="width:200px" onclick="generaterectangles_clk();"/>
<input type="button" value="Generate Output" class="cssbutton" style="width:200px;" onclick="generateoutput_clk();"/>
 
</td>

</tr>
<tr>
<td colspan="2">
 <br />
<div id="div_map" style="width:800px;height:600px;border: 3px solid #ccc; " >

</div>
</td></tr>
</table>
<div id="div_download" class="div_down" style="position:absolute;height:500;display:none"></div>
<div id="div_recIndx" style="position:absolute;height:50;display:none"></div>
</body>
</html>