Posts Tagged ‘computer’

Do you think this is possible to do? but i think possible,there are various lot of recovery tools in the internet to download,but all of them are not surely work 100% like you are expected.but there is a recovery tool name recuva,working perfectly as you expected. Download recuva here
Okey now we can see the step by steps to start the process.
Step1)-insert the pen drive in to the usb port.wait for some moment to identify .after that right click on the pen drive icon in the computer and scan for recovery of bad sector and automatically fix system errors

Note- above step is important to recover correctly
Step2)- install the recuva recovery software before you downloaded.
Step3)- open the tool by clicking its icon on the desktop. Program will open up.

Step4)- if you recover images tick the dot on pictures ( removable disk /memory device ) and then select deep scan

Note- selecting deep scan is important.

Step5)-click scan .scanning process will start up wait for some hours or minutes .that depending on your pen drive volume.
Step6)-now picture list show up ,you must select the picture you want. click recover and select the location to put the pictures

That’s all enjoy

This tutorial about Hide and Seek with jQuery and PHP. This script helps you to present all modules in single page. Take a look at live demo click buttons

 


Download Script     Live Demo

Javascript Code

// <![CDATA[
javascript” src=”http://ajax.googleapis.com/ajax/
// ]]>
libs/jquery/1.3.0/jquery.min.js”>
<script type=”text/javascript”>
$(function()
{

$(“.button”).click(function()
{
var button_id = $(this).attr(“id”);

//Add Record button

if(button_id==”add”)
{
$(“#results”).slideUp(“slow”);
$(“#save_form”).slideDown(“slow”);
}

//Cancel button

else if(button_id==”cancel”)
{
$(“#save_form”).slideUp(“slow”);
$(“#results”).slideDown(“slow”);
}

// save button
else

{

// insert record
// more details Submit form with jQuery

}

return false;

});
});
</script>

HTML Code
Contains javascipt code. $(“.button”).click(function(){}- button is the class name of buttons(Add, Save and Cancel). Using $(this).attr(“id”) calling button id value.

<div id=”results” >

<a href=”#”color: blue;”>button” id=”add” >Add Record </a>
</div>

<div id=”save_form” style=”display:none” >

<a href=”#”color: blue;”>button” id=”save” >Save </a>
<a href=”#”color: blue;”>button” id=”cancel” >Cancel </a>
</div>

<div id=”update” >

</div>

English: Logo of Apache Struts

Apache Struts has changed the way we develop a Web application. Since its inception as an MVC architecture, Struts has been extensively used in J2EE world to develop robust, extendable and effective web applications.

Introduction to Struts Validation Framework

One of the important features of Struts framework is Struts Validation framework that performs validation on incoming form data. Validation framework was introduced by David Winterfeldt as an external plugin to Struts framework. It’s functionality has since been split so that validator can serve as the basis for a independant component and is now part of Jakarta Commons.

The Struts framework’s simple validation interface alleviates much of the headache associated with handling data validation, allowing you to focus on validation code and not on the mechanics of capturing data and redisplaying incomplete or invalid data.

In order to do form validation without Validator framework, one has to use validate() method of the form bean (ActionForm class) to perform this task. Also one has to handle error messages during manual validation. Lot of fields that we validate require same logic to validate them, hence code is unneccessarily duplicated (if not managed properly).

Validation framework comes with set of useful routines to handle form validation automatically and it can handle both server side as well as client side form validation. If certain validation is not present, you can create your own validation logic and plug it into validation framework as a re-usable component.

Validator uses two XML configuration files to determine which validation routines should be installed and how they should be applied for a given application, respectively. The first configuration file, validator-rules.xml, declares the validation routines that should be plugged into the framework and provides logical names for each of the validations. The validator-rules.xml file also defines client-side JavaScript code for each validation routine. Validator can be configured to send this JavaScript code to the browser so that validations are performed on the client side as well as on the server side.

The second configuration file, validation.xml, defines which validation routines should be applied to which Form Beans. The definitions in this file use the logical names of Form Beans from the struts-config.xml file along with the logical names of validation routines from the validator-rules.xml file to tie the two together.

Using the Validator framework involves enabling the Validator plug-in, configuring Validator’s two configuration files, and creating Form Beans that extend the Validator’s ActionForm subclasses. The following sections explain in detail how to configure and use Validator.

Create a Struts project

Create a struts web application project. I assume you have working environment set for a Struts project. If not then go through the tutorial: Creating Struts application using Eclipse and create a struts project.

Create Form Beans

struts validator form bean
Create a form bean in your project called CustomerForm and copy following code in it.

package net.viralpatel.struts.validation.form;
import org.apache.struts.validator.ValidatorForm;
public class CustomerForm extends ValidatorForm {
    
    private String name;
    private String telephone;
    private String email;
    private int age;
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getTelephone() {
        return telephone;
    }
    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }
    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    public int getAge() {
        return age;
    }
    public void setAge(int age) {
        this.age = age;
    }
}

We will use this validator plugin to validate this form. Note that the form bean is extended from class ValidatorForm and not ActionForm as we generally do in Struts project.

Add Validator Plug-in in struts-config.xml

In order to use Validator in our project we need to configure it in struts-config.xml file. For this add following code in your struts-config.xml file.

<!-- Validator Configuration -->
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames"
        value="/WEB-INF/validator-rules.xml,
                /WEB-INF/validation.xml" />
</plug-in>

This definition tells Struts to load and initialize the Validator plug-in for your application. Upon initialization, the plug-in loads the comma-delimited list of Validator config files specified by the pathnames property. Each config file’s path should be specified by use of a Web application-relative path, as shown in the previous example.

Define validations for the form

validation.xml file struts validator framework

Create a file validation.xml in your applications WEB-INF directory. And copy following content in it.

<?xml version="1.0" encoding="UTF-8" ?>
<!--DOCTYPE form-validation PUBLIC
          "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"
          "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">
<form-validation>
<global>
    <constant>
    <constant-name>telephoneFormat</constant-name>
    <constant-value>^\d{5,10}$</constant-value>
    </constant>
</global>
<formset>
    <form name="CustomerForm">
        <field property="name" depends="required">
            <arg key="label.name" />
        </field>
        <field property="age" depends="required, integer, intRange">
            <arg0 key="label.age" />
            <arg1 key="${var:min}" resource="false"/>
            <arg2 key="${var:max}" resource="false"/>
            <var>
                <var-name>min</var-name>
                <var-value>1</var-value>
            </var>
            <var>
                <var-name>max</var-name>
                <var-value>125</var-value>
            </var>
        </field>
        <field property="telephone" depends="required, mask">
            <arg key="label.telephone" />
            <arg1 key="label.telephone" />
            <var>
                <var-name>mask</var-name>
                <var-value>${telephoneFormat}</var-value>
            </var>
        </field>
        <field property="email" depends="email">
            <arg0 key="label.email" />
            <arg1 key="label.email" />
        </field>
    </form>
</formset>
</form-validation>

In the above xml file, we have defined the rules for form validation. Note that we are validating form CustomerForm and the fields being validated are name, age, telephone and email. tag defines the validation for a property of form. We can specify different rules like required, integer, email, intRange, mask etc in depends attribute of field tag..

Also you can define constants that can be reused in the validation xml using global constants tag.

Struts-config.xml entry for the action

Following is the entry in struts-config.xml file which maps the Action to our Validator form.

<form-beans>
    <form-bean name="CustomerForm"
        type="net.viralpatel.struts.validation.form.CustomerForm" />
</form-beans>
...
...
...
<action-mappings>
...
    <action path="/customer" name="CustomerForm" validate="true"
        input="/index.jsp"
        type="net.viralpatel.struts.validation.action.CustomerAction">
        <forward name="success" path="/Customer.jsp" />
        <forward name="failure" path="/index.jsp" />
    </action>
...
</action-mappings>

Configuring ApplicationResources.properties

Struts validation framework uses externalization of the error messages. The messages are stored in a property file (ApplicationResource.properties) and are referred by the key values. Copy following in your ApplicationResource.properties (or MessageResource.properties).

label.name= Name
label.email= Email
label.telephone= Telephone
label.age= Age
# general error msgs
errors.header=<font size="2"><UL>
errors.prefix=<LI><span style="color: red">
errors.suffix=</span></LI>
errors.footer=</UL></font>
errors.invalid={0} is invalid.
errors.maxlength={0} can not be greater than {1} characters.
errors.minlength={0} can not be less than {1} characters.
errors.range={0} is not in the range {1} through {2}.
errors.required={0} is required.
errors.byte={0} must be an byte.
errors.date={0} is not a date.
errors.double={0} must be an double.
errors.float={0} must be an float.
errors.integer={0} must be an integer.
errors.long={0} must be an long.
errors.short={0} must be an short.

Create JSP to display the form

Create a JSP file called index.jsp and copy following content in it.

<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<html>
<head>
<title>Struts Validation Framework example.</title>
</head>
<body>
<html:errors />
<html:javascript formName="CustomerForm" />
<html:form action="/customer">
    <bean:message key="label.name" />
    <html:text property="name"></html:text>
    <br />
    <bean:message key="label.age" />
    <html:text property="age"></html:text>
    <br />
    <bean:message key="label.email" />
    <html:text property="email"></html:text>
    <br />
    <bean:message key="label.telephone" />
    <html:text property="telephone"></html:text>
    <br />
    <html:submit value="Submit"></html:submit>
</html:form>
</body>
</html>

Running the application

We are done with our application. Now execute it from any web container (Tomcat in my case) and open in browser.
struts validator form screen

Enter any invalid value in the form and press submit.

struts-validator-form-screen2

Reference :http://viralpatel.net

English: Logo of Русский: Логотип Apache Tomcat

Setting the JAVA_HOME , CATALINA_HOME Environment Variable on Windows

One can do using command prompt
1. set JAVA_HOME=C:\”top level directory of your java install”
2. set CATALINA_HOME=C:\”top level directory of your Tomcat install”
3. set PATH=%PATH%;%JAVA_HOME%\bin;%CATALINA_HOME%\bin

Or you can do the same

  1. Go to system properties.
  2. Go to environment variables and add a new variable with the name  JAVA_HOME and provide variable value as C:\”top level directory of your java install”.
  3. Go to environment variables and add a new variable with the name  CATALINA_HOME and provide variable value as C:\”top level directory of your Tomcat install”.
  4. In path variable add a new variable value as ;%CATALINA_HOME%\bin;

and write startup.bat on command Prompt and press enter tomcat will start up and for shutdown u just write shutdown.bat        once you start the tomcat you can access it like that http://localhost:8080     and access Application Manager using login and password …. if you dont know username and password you can  follow below instructions ….

User and password for Tomcat

By default, Tomcat does not enable admin or manager access. To enable it, you have to edit the “%TOMCAT_FOLDER%/conf/tomcat-users.xml” manually.

File : tomcat-users.xml (before update) , initially, Tomcat comments all users and roles like above.



<!--
  
  <role rolename="role1"/>
  
  
  
-->

File : tomcat-users.xml (after updated)

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<!--
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>
-->
  <role rolename="manager"/>
  <role rolename="admin"/>
  <user username="admin" password="admin" roles="admin,manager"/>
</tomcat-users>

To enable admin access, just update the content like above. Saved it and restart Tomcat, now you can access Tomcat admin or manger pages with user = “admin” and password = “admin“.

The Quickest, Safest and Easiest Way to Send Money
Instantly Send Cash from Your Mobile or Computer to 125+ Countries
Which is best for your application — Windows CE or Windows XP Embedded? Microsoft has published a whitepaper to assist developers in answering that question. The paper begins with an overview of each of the two Windows Embedded OSes, and then presents a variety of factors and decision criteria in areas such as OS features, development tools, support for the .NET Framework (and Compact Framework) and…

Web services, and the type of device or application being developed.

In this WindowsForDevices.com article, we provide several exerpts from the whitepaper which highlight key aspects of the OS decision process. A link for downloading the full whitepaper is provided at the conclusion of this article.

Selected excerpts from . . .

Which to Choose:
Comparing Microsoft Windows CE and Windows XP Embedded

Microsoft Corporation
July 2003

From the introduction . . .

Windows XP Embedded is designed to deliver the power of Windows in componentized form, enabling you to rapidly build reliable and advanced embedded devices. Windows CE. NET combines an advanced, real-time embedded operating system with powerful tools for rapidly creating the next generation of smart, connected, and small-footprint devices. Each operating system ships with a complete integrated development environment, with support for a wide range of existing hardware, application development tools, and third-party value-added applications and services.

Device-Specific Considerations

The features and functionality typically required for specific device categories can help you choose between Windows XP Embedded and Windows CE.

Table 1 provides examples of some of the device categories that can be powered by the Windows Embedded family of operating system software. In some cases, however, Windows CE and Windows XP Embedded may provide comparable support for a targeted device, so your choice should be determined by comparing your specific design requirements with the features offered by Windows CE or Windows XP Embedded respectively.

Table 1:
Recommended Windows Embedded Operating System
by Device Category

Targeted Device Windows XP Embedded Windows CE
Mobile Clients
PDAs
Smartphones
Internet and Media Appliances
PC Companions
Digital Cameras
Printers and Scanners
Thin Clients
Retail Point-of-Sale (RPOS) Devices
Windows-Based Terminals
Connected Clients
Basic Set-top Boxes
Advanced Set-top Boxes
Basic Residential Gateways and Servers
Advance Residential Gateways and Home Servers
Industrial Controls
Voice Over Internet Protocol (VoIP) Phones

Devices such as mobile handhelds and basic residential gateways require a small footprint, efficient power management, and remote management capabilities along with the ability to deliver rich user experiences, making Windows CE the recommended operating system for smart, connected and small-footprint devices.

Devices such as advanced set-top boxes and retail point-of-sale clients require the latest security and reliability features, familiar and powerful Windows features, and are less restricted in terms of footprint. Windows XP Embedded is the recommended operating system for delivering the power of Windows in componentized form.

The latest versions of Windows CE and Windows XP Embedded are optimized to support a variety of device-specific platforms, including ATMs, thin clients, gateways and set-top boxes. For detailed information about these platforms, visit the Windows Embedded Device Platforms Web site.

Decision Criteria for Choosing a Windows Embedded Operating System

To help you select the most suitable Windows Embedded operating system software, you may want to consider your device design in terms of the following features and functionality:

  • CPU Architecture — Are you using an x86 or non-x86 CPU? If you are using an X86 CPU, you can use either Windows CE or Windows XP Embedded. If you are using a non-X86 CPU, then you must use Windows CE, which supports four families of microprocessors, including:
    • ARM — Examples of supported processors include ARM720T, ARM920T, ARM1020T, StrongARM, and XScale.
    • MIPS — Supported processors include MIPS II/32 with FP, MIPS II/32 without FP, MIPS16, MIPS IV/64 with FP, and MIPS IV/64 without FP.
    • SHx — Supported processors include SH-3, SH-3 DSP, and SH-4.
    • X86 — Supported processors include 486, 586, Geode, and Pentium I, II, III, and IV.

    Additionally, heat dissipation concerns will affect both CPU selection and operating system. If heat dissipation is a concern, and you select a non-X86 processor as a result, then Windows CE is the only choice for your device.

  • Real-Time Support — Does your device require real-time support? Both Windows CE and Windows XP Embedded support real-time performance. Windows CE is inherently a hard real-time operating system. While Windows XP Embedded is not inherently a real-time operating system, you can easily add real-time capabilities and optimize Windows XP Embedded to meet your real-time needs with readily available third-party solutions.
  • Win32-based Applications — Does your device design take advantage of Win32-based applications? If your device will make use of existing Win32-based applications and drivers without modification, use Windows XP Embedded. Win32 applications and drivers must be modified to run on Windows CE.
  • Operating System RAM Configuration — How much RAM will your device include, and what is the corresponding device image footprint requirement? Both Windows CE and Windows XP Embedded are componentized to enable you to create small or managed footprint designs. The minimum footprint for Windows CE is less than 350 KB, while the minimum footprint for Windows XP Embedded is approximately 8 MB. Footprint requirements are an important factor when choosing between Windows CE and Windows XP Embedded.

Figure 1 provides decision criteria that can help you choose whether Windows CE or Windows XP Embedded is optimized for your specific device requirements.

Figure 1:
Decision Matrix for Choosing
Windows XP Embedded or Windows CE

Windows CE and Windows XP Embedded differ primarily in regard to processor support, real-time support, application portability and footprint. If it appears after reviewing this overview that your device requirements can be met by either Windows Embedded operating system, you can find more detailed information at the Windows CE Web site and the Windows XP Embedded Web site.


Read the full whitepaper here . . .


Which to Choose:
Comparing Microsoft Windows CE and Windows XP Embedded

(150KB download, Word file)


Copyright 2003 Microsoft Corp. All rights reserved. This article was initially published here. Reproduced by WindowsForDevices.com with permission.

Change Icon of an EXE FileSome times it becomes necessary to change the icon of an executable (.exe) file so that the file get’s a new appearance. Many of the tools such as TuneUP Winstyler does this job by adjusting the Windows to display a custom icon to the user. But, in reality if the file is carried to a different computer, then it shows it’s original icon itself.

This means that in order to permanently change the icon, it is necessary to modify the executable file and embed the icon inside the file itself. When this is done the executable file’s icon is changed permanently, so that even if you take file to a different computer it show’s a new icon.

For this purpose I have found a nice tool which will modidify the executable file and embed the icon of your choice into the file itself. ie: The tool changes the icon of the executable file permanently.

I will give you a step-by-step instruction on how to use this tool to change the icon:

  1. Go to www.shelllabs.com and download the trial version of IconChanger and install it (Works on XP, Vista and Win 7).
  2. Run the IconChanger program from Start -> All Programs and you should see an interface as shown below:

    IconChanger-Screenshot

  3. Now you will see a window stating that “Choose an object whose icon you want to change”. Click on the “OK” button.
  4. Now select the executable file for which you wish to change the icon.
  5. Icon changer will automatically search for all the icons on your “C:\ drive” so that you can select any one of those. If your desired icon is not shown in the window, you may paste the path of your icon file in the field which says “Search icons in” so that your desired icon gets displayed.
  6. Select the ICON of your choice and click on Set button.
  7. Now a popup window will appear and ask you to select from either of these two options.
    • Change embeded icon.
    • Adjust Windows to display custom icon.
  8. Select the first option (Change embedded icon). You are done. The icon get’s changed.

I hope you like this post. Pass your comments in case if you have any queries or clarifications.

 

Different Types of MalwareMalware is a collective term used to represent virus, worms, spyware and other malicious programs out there on the Internet. In simple words, any software program that is intended to cause direct or indirect harm to the computer system is referred to as a malware.

Some malware programs cause serious problems such as destroying the system files, causing disruption to the computer operation or gathering sensitive information while others may only have a light impact such as redirecting websites to pornographic content or annoying the users with pop-ups and banners.

In the normal routine, we have often seen every malicious program being referred to as a virus, but this is not correct! In fact, as mentioned earlier, there exists several malicious programs where virus is one among them. Now, many of you may be wondering to know what’s the difference between them. Well, this article gives a detailed information on different types of malware that exist, how they work and how they differ from each other:

Computer Virus:

As we all know, this is the type of malware that has become highly popular and is one of the most widely discussed topic in the field of computer security. A virus is just a computer program that is designed to take unauthorized control of the infected computer so as to cause harm to the system’s data or degrade its performance.

Mode of operation:

Computer viruses operates by attaching themselves to an already existing file or program and replicates itself to spread from one computer to another. In most cases, they tend to infect executable files that are parts of legitimate programs. So, whenever the infected file is executed on a new computer, the virus gets activated and begins to operate by further replication or causing the intended damage to the system.

A virus cannot perform its task of harming and replication unless it is allowed to execute. This is the reason why viruses often choose an executable file as its host and get attached to them. Viruses are mainly classified into two types:

Non-Resident Viruses: This kind of virus will execute along with its host, perform the needful action of finding and infecting the other possible files and eventually transfers the control back to the main program (host). The operation of the virus will terminate along with that of its host.

Resident Viruses: In case of resident viruses, whenever the infected program is run by the user, the virus gets activated, loads its replication module into the memory and then transfers the control back to the main program. In this case, the virus still remains active in the memory waiting for an opportunity to find and infect other files even after the main program (host) has been terminated.

Damages caused:

Viruses are known to cause destruction of data and software programs. In some cases, a virus may do nothing other than just replicating itself. However, they are responsible for using a large portion of the system resources such as CPU and memory which results in the performance degradation of the computer.

In order to stay protected from a virus infection, you may refer my other post on 12 tips to maintain a virus free computer.

Trojan horse:

A Trojan horse or simply called as Trojan is a type of malicious program that disguises itself as something that is legitimate or useful. The main purpose of a trojan is to gain the trust of the user from the front end, so that it gets the permission to be installed. But, from the back end, it is designed to grant unauthorized control of the computer to the hacker.

Mode of operation:

A Trojan horse do not depend on the host to carry out its operation. So, unlike a computer virus, it does not tend to attach itself to other files. Trojans are often disguised as video codecs, software cracks, keygens and other similar programs downloaded from untrusted sources. So, one has to be careful about those untrusted websites that offer free downloads.

One of the most poplar example is the DNSChanger trojan that was designed to hijack the DNS servers of the victimized computers. It was distributed by some of the rogue pornographic websites as a video codec needed to view online content.

Damages caused:

Trojan horses are known to cause a wide variety of damages such as stealing passwords and login details, electronic money theft, logging keystrokes, modify/delete files, monitor user activity etc.

Worms:

Worms are standalone computer programs with a malicious intent that spread from one computer to another. Unlike viruses, worms have the ability to operate independently and hence do not attach themselves to another program.

Mode of operation:

Worms often use a computer network to spread itself by exploiting the security vulnerabilities that exist inside the individual computers. In most cases, worms are designed only to spread without causing any serious change to the computer system.

Damage caused:

Unlike viruses, worms do not cause damage to the system files and other important programs. However, they are responsible for consuming the bandwidth thereby degrading the performance of the network.

Spyware:

Spyware is a type of malicious software that can collect information about the activities of the target computer without the knowledge of its users. Spywares such as keyloggers are often installed by the owner or administrator of the computer in order to monitor the activities of the users. This can be a parent trying to monitor his child, a company owner trying to monitor his employee or someone trying to spy on his/her spouse.

Mode of operation:

Spywares are designed to operate in a totally stealth mode so that its presence is completely hidden from the users of the computer. Once installed, they silently monitor all the activities on the computer such as keystrokes, web activity, IM logs etc. These logs are stored secretly for later access or uploaded online so that the installer of the spyware program can have access to them.

Damage caused:

Apart from monitoring, spywares do not cause any damage to the computer. However, in some cases the affected computer may experience degradation in its performance.

Adware:

Adware is a software program that automatically renders advertisements to the users without their consent. Most common examples are pop-ups, pop-unders and other annoying banner ads. The prime reason behind the design of adware is to generate revenue for its author.

Mode of operation:

Adwares are are often bundled up with some of the free utilities such as a browser toolbars, video downloaders etc. When such programs are installed, the adware may take over and distract user activity by displaying annoying advertisements.

Damage caused:

Adware is harmless in most of the occasions. However, some are known to contain spywares that are used to monitor the surfing habits of users. This may pose a threat to the privacy of the users.