Tuesday, September 17, 2013

Website style created simple mistreatment PHP code.

Website style created simple mistreatment PHP code
PHP
The PHP scripting language has become fashionable and it absolutely was designed specifically for manufacturing sites. Several net style company use PHP because the implementation language as a result of it permits them to create a dynamically-generated web content quickly and simply.  It provides you the choice to make a PHP model that you just will use to make and style your web site quicker.  Here square measure steps on a way to style your website mistreatment PHP code easily:

Step 1: begin by making a folder. Within the folder, produce 2 new files: index.html and style
.css.

Step 2: within the folder, produce 2 further folders: the primary one ought to be named “includes” and therefore the second folder “variables”.

Step 3: Open the index.html file mistreatment your favorite hypertext mark-up language editor and begin making your basic hypertext mark-up language web site.

Step 4: Open the .css file and add the dives you may be mistreatment.  Use your own styling in making your web site to fit your desires.

Step 5: produce some a lot of files to be used once we begin changing the model to PHP.  Open the folder with the name “variables”, then produce a blank file known as variables.php. Move to the “includes” folder created earlier and add the subsequent files: header.php, nav.php, sidebar.php, and footer.php.

Step 6: Add content to the index.html file.

Step 7: Convert the model to PHP.  Take a short check up on the hypertext mark-up language code and choose that areas are going to be sliced.

Step 8: when slicing the hypertext mark-up language code, place the code within the correct PHP files created.

Step 9: Do the sidebar.  Copy and cut the sidebar div and place it into the sidebar.php file created situated within the “includes” folder.  Do an equivalent factor within the footer space.

Step 10: Once our index.html square measure utterly and properly sliced, rename it to index.php. This can currently become your model, as long because the PHP includes square measure on any page you merely need to modify the one Indian file to form it visible across the complete web site.

How to produce Secure Scripts with PHP Programming language?

How to produce Secure Scripts with PHP Programming language?
Secure Scripts
Believe it or not, there's no such issue as a secure program or application, not even with all the firewalls and encryptions extra in it. Vulnerabilities square measure already gift even once the program or application remains being coded by the coder, and there's no means for a coder to eliminate these vulnerabilities. What he or she will be able to do is to reduce the occurrences of those vulnerabilities that adds additional security to the applying or program. With programming scripts like PHP, you'll be able to additionally do alternative things that may enhance the safety of each the program and its committal to writing syntax.

The most widespread artificial language utilized by virtually each coder is PHP. It’s a sin within the programming world if you are doing not understand what PHP is, or perhaps understand the fundamentals of it. The options of a straight forward web site like www.php.com wouldn't be ready to perform properly while not PHP. PHP is often used for developing net applications, nevertheless it's not while not its own security holes. These holes will truly hinder any coder from finishing the program as a result of they have to fill it out 1st before continued. During this article, I will be able to tell you ways to avoid common security pitfalls and glitches in PHP programming.

1 Correct coverage could be a should – once you’re developing one thing victimization PHP, application coverage is your ally. These error reports squa
re measure vital, particularly once it involves police work wrong spelled variables and incorrect perform usage amongst several others. However, it's vital to disable or hide application or error coverage once your web site goes live as a result of your users can understand what’s wrong along with your program instantly.

2 Disable dangerous options – Most developers tried to incorporate applications that created development plenty easier. These applications have unwanted consequences like making information validation and permitting bugs to search out their means into the script. Before your web site goes live, make certain you disable any of the options that will produce potential errors.

3 Be watchful of XSS attacks in user input – XSS or Cross web site Scripting is generally seen on forums. After you square measure making the choice of writing input via hypertext markup language, you're permitting users to run JavaScript outside its supposed purpose. Once this happens, JS will produce holes at intervals your script, which is able to then put off the safety for the cookies. It’s like turning off the electricity in your electric fence. Once the cookies square measure exposed, real time information is gathered by hackers and use this for malicious intent.

There’s no such issue as an ideal code, net application, or artificial language, however you'll be able to continuously produce one thing near perfection.

Posted By Prashant K Neelratan

Tuesday, September 10, 2013

What is difference between 64-bit vs. 32-bit Operating Systems?

32-Bit vs. 64-Bit Windows

You are maybe aware that 64-bit and 32-bit versions of your operating system exist, but apart from assigning to a bigger-is-better idea, you may have no idea what separates the two. Have you use a 64-bit version of Windows, and why?

Nowadays users frequently installing the 64-bit version of their OS of choice over the less capable 32-bit version. But most users don't have a full understanding of what the difference really is.

Check your windows version you have in your PC.

Which version of Windows you are using, you can check from the System properties in Control Panel, or you can take the easy way and right-click on Computer or my computer icon in the start menu or desktop, and choose Properties from the menu. Windows 7 or Vista users will be able to check the System type in the list, while XP users with 64-bit will see it on the dialog.
First think remember that you’re CPU must support 64-bit in order to be running a 64-bit operating system—if you're running a modern CPU you should be fine, but some of the low budget PCs don't contain a 64-bit processor
Does 32-bit really have a memory limit?

In any 32-bit operating system, you are restricted to 4GB of RAM just because the size of a 32-bit value will not permit any more. On a 32-bit system, every process is given 4 GB of virtual memory to performance with, which is separated into 2 GB of user space that the application can really use at a time.

Additional Difficulties with 32-Bit

It’s not have a hard limit for the amount of memory it can address, there's also one more problem: your devices, like your motherboard BIOS take up area in that similar 4 GB space, which means the basic operating system gets access to even less of your RAM.

What's benefits of 64-Bit?

While 32 bits of information can only access 4 GB of RAM, a 64-bit machine can access 17.2 BILLION gigabytes of system memory, banishing any limits far into the future. Windows 64-bit Home editions are still limited to 16 GB of RAM for licensing reasons, but the Professional and Ultimate versions can use up to 192 GB of RAM, so keep that in mind when building that killer system.
The per-process limit is also seriously increased—on 64-bit Windows, instead of a 2 GB limit, each application has access to 8 TB of virtual memory without any special API, a huge factor when you consider applications like video editing or virtual machines that may need to use enormous amounts of RAM.
The common rule is that 32-bit will run on a lower level 64-bit component but 

64-bit does not run on a lower level 32-bit component:
  • A 32-bit OS will run on a 32-bit or 64-bit processor without any problem.
  • A 32-bit application will run on a 32-bit or 64-bit OS without any problem.
  • But a 64-bit application will only run on a 64-bit OS and a 64-bit OS will only run on a 64-bit processor.

Some general queries about 32-bit and 64-bit systems

Q. Will a 64-bit CPU run a 32-bit program on a 64-bit version of an OS?

A. Yes it will. 64-bit systems are backward-compatible with their 32-bit counterparts.

Q. Will a 64-bit OS run a 32-bit application on a 64-bit processor?

A. Yes it will. Again, this is because of backward compatibility.

Q. Can 64-bit applications contain 32-bit code?

A. Yes, many times 64-bit software will contain portions of 32-bit code.

Q. Can 16-bit applications or code run on 64-bit systems?

A. No, as we said previously. 16-bit code will NOT run on 64-bit OS because the designers did not provide backward-compatibility. This is one reason why some 32-bit programs will not work on 64-bit operating systems.

Q. Can a 64-bit CPU with a 32-bit host OS run a virtual machine (VM) for a 64-bit guest OS?

A. Yes. It all depends upon the level of virtualization.

32-bit and 64-bit Windows: frequently asked questions

Q. Can I run Windows 2000 and Windows XP on a 64-bit CPU, and use old software?

A. Yes, a 32-bit OS (Windows 2000 or XP) will run on a 64-bit processor. You should also be able to run older 32-bit software on a 64-bit OS.

Q. Is a Windows Vista or Windows 7 license key valid for both 32-bit and 64-bit versions?

A. Yes, unless you have an OEM version.

Q. How do find out if my system is 64-bit?

A. Microsoft provide resources to help you find out such as FAQ on 32-bit and 64-bit Windows and Taking the mystery our of 64-bit Windows.

Q. How do I migrate my 32-bit system to 64-bit Windows?


A. There is no upgrade path from 32-bit to 64-bit Windows only from 64-bit Windows. You will almost certainly have to do a clean install of your 64-bit operating system, copy back your data files, and reinstall your 32-bit applications.

Compiler in C Programming

What is a Compiler?

Program Compiler Image
Program Compiler
A program that translates source code into computer executable machine code or object code. The compiler invents its name from the way it works, observing at the whole portion of source code and collecting and rearranging the instructions. Thus, a compiler differs from an interpreter, which studies and performs each line of source code in sequence, without looking at the complete program. The benefit of interpreters is that they can execute a program instantly. Compilers need some time before an executable program emerges. The compiler is only a program and cannot fix your programs for you. If you make an error, you have to accurate the syntax or it won't compile.Each high-level programming language derives with a compiler. In effect, the compiler is the programming language, because it describes which commands are acceptable.

Since compilers convert source code into object code, which is unique for each type of computer machine, many compilers are existing for the similar language.

Writing your first C program

Let us write a program which displays the message “Hey Man!" on the screen. It looks like this:

  #include <stdio.h>
   main()
   {
     printf( " Hey Man! " );
   }

Compile & Execute C Program:

Lets look at how to save the source code in a file, and how to compile and run it. Following are the simple steps:


  1. Open a text editor and add the above-mentioned code.
  2. Save the file as hey.c
  3. Open a command prompt and go to the directory where you saved the file.
  4. Type gcc hey.c and press enter to compile your code.
  5. If there are no mistakes in your code the command prompt will take you to the next line and would generate a.out executable file.
  6. Now, type a.out to execute your program.
  7. You will be able to see “Hey Man!” printed on the screen

Posted By Prashant K Neelratan

Difference between View and Stored Procedure in SQL Server

Difference between View and Stored Procedure

In this article I will explain you that what is difference between view and stored procedure in SQL Server?

View in SQL Server

Views are virtual tables that are compiled at run time. The data associated with views are not actually stored in the view, but it is stored in the base tables of the view. By using view we can join multiple tables and present the data as coming from a single table. Usually we put those columns in view that we need to retrieve again and again. Once you have created the view, you can query view like as table. We can make index on view.

For example consider we have two tables

      1)    Userdata table with columns userid, username
      2)    Salarydata table with columns salid, userid, salary

Create VIEW by joining above two tables

CREATE VIEW View_UserInfo
AS
BEGIN
SELECT Userdata.userid, Userdata.username, Salarydata.salary from userdata INNER JOIN Salarydata ON userdata.userid=salarydata.userid
END

By using above view we can get username or salary based on userid.

Stored Procedure

A stored procedure is a collection of SQL statements that has been created and stored in the database. Stored procedure will accept input parameters so that a single procedure can be used over the network by several clients using different input data. Stored procedure will reduce network traffic and increase the performance. If we modify stored procedure all the clients will get the updated stored procedure

Benefits of using stored procedures

  • Stored procedure allows modular programming. You can create the procedure once, store it in the database, and call it any number of times in your program. 
  • Stored Procedure allows faster execution. If the operation requires a large amount of SQL code is performed repetitively, stored procedures can be faster. 
  • Stored Procedure can reduce network traffic. 
  • Stored procedures provide better security to your data


Example of creating Stored Procedure

USE mydatabase;
GO
CREATE PROCEDURE dbo.sp_retrivedata
AS
    SELECT FirstName, LastName FROM userinfo;
GO
EXEC sp_retrivedata;
EXEC dbo.sp_retrivedata;
GO