Super Programming Tricks

Super Programming Tricks A Place of Knowledge on Technology.

18/08/2014

When you finally migrate a database to a remote host, be sure to comply with the Data protection act for your
territory, and state clearly on the registration page that the user’s personal details will not be shared or sold to other organizations.
the rules covering the protection of data vary from country to country, and it is essential that you read them and comply with
them. Usually, any person within an organization who can access users’ details must sign a document agreeing never to share
personal information. an annual registration fee is payable to the government organization that regulates the data protection
law. these precautions do not apply to experimental databases using fictitious data such as those described in books.

18/08/2014

How Does the Server Process the Page?

When an HTML file is saved as a PHP file, the .php extension alerts the server so that it processes the HTML as
normal, but it also looks out for any PHP code. The server is in HTML mode by default, and any HTML code is sent
to the browser as normal. When it finds a ; it then
switches back to HTML mode. This cyclic behavior continues until the end of the page of code.

18/08/2014

A php function is a tiny program that will perform a particular task. the include() function takes whatever is
inside the brackets and pulls it into the page at the place where the include() function is located. php has two similar
functions include() and require(). they both pull a file into a page so that the file is included in the displayed page. the
difference is in the way they react to a missing or faulty file. If the file to be included is missing or corrupt, include() will
not halt the ex*****on of a page. a warning will appear, but the page will continue to load. In contrast, a fatal error will
occur if require() can’t find the file or the file is faulty. In this case, the page will cease executing. Use include for most
inclusions, but use require() for loading the details of a database because the page will be of little use if the database
can’t be opened. also, this makes the database more secure.

25/02/2014

There’s a feature of HTML5 called the offline application cache that allows users to run
web apps even when they are not connected to the Internet.

24/02/2014

Technically, the Web SQL Database spec is not part of HTML5. It was
broken out of the original HTML5 spec into its own spec, but in casual
conversation it’s often still referred to as an “HTML5 feature.”

23/02/2014

Here are some points about JavaScript’s syntax that are worth noting:
• Statements are terminated with semicolons (;)
• Code blocks are enclosed in curly braces ({})
• Variables are declared using the var keyword
• Array elements can be accessed with square bracket notation ([])
• Array keys are assigned beginning at 0
• The single equals sign (=) is the assignment operator (assigns a value to a variable)
• The double equals sign (==) is the equivalence logical operator (compares two values
and evaluates to true if they are equivalent)
• The plus sign (+) is the string concatenation operator (combines two strings
together)

23/02/2014

What Is a Web App?

To me, a web app is basically a website that is specifically optimized for use on a
smartphone. The site content can be anything from a standard small business brochure
site to a mortgage calculator to a daily calorie tracker—the content is irrelevant. The
defining characteristics of a web app are that the user interface (UI) is built with web
standard technologies, it is available at a URL (public, private, or perhaps behind a
login), and it is optimized for the characteristics of a mobile device. A web app is not
installed on the phone, it is not available in the Android Market, and it is not written
with Java.

What Is a Native App?

In contrast, native apps are installed on the Android phone, they have access to the
hardware (speakers, accelerometer, camera, etc.), and they are written with Java. The
defining characteristic of a native app, however, is that it’s available in the Android
Market—a feature that has captured the imagination of a horde of software entrepreneurs
worldwide, me included.

Whatsapp on PC :D :P
26/12/2013

Whatsapp on PC :D :P

23/12/2013

Decision problem: A question with a yes or no answer.

P: A decision problem that can be solved in polynomial time. That is, given an instance of the problem, the answer yes or no can be decided in polynomial time.

Example: Given a graph connected G, can its vertices be colored using two colors so that no edge is monochromatic. Algorithm: start with an arbitrary vertex, color it red and all of its neighbors blue and continue. Stop when you run our of vertices or you are forced to make an edge have both of its endpoints be the same color.

NP: A decision problem where instances of the problem for which the answer is yes have proofs that can be verified in polynomial time. This means that if someone gives us an instance of the problem and a certificate (sometimes called a witness) to the answer being yes, we can check that it is correct in polynomial time.

Example: Integer factorization is NP. This is the problem that given integers n and m, is there an integer f with 1 < f < m such that f divides n (f is a small factor of n)? This is a decision problem because the answers are yes or no. If someone hands us an instance of the problem (so they hand us integers n and m) and an integer f with 1 < f < m and claim that f is a factor of n (the certificate) we can check the answer in polynomial time by performing the division n / f.

NP-complete: An NP problem X for which it is possible to reduce any other NP problem Y to X in polynomial time. Intuitively this means that we can solve Y quickly if we know how to solve X quickly. Precisely, Y is reducible to X if there is a polynomial time algorithm f to transform instances x of X to instances y = f(x) of Y in polynomial time with the property that the answer to x is yes if and only if the answer to f(x) is yes.

Example: 3-SAT. This is the problem wherein we are given a conjunction of 3-clause disjunctions (i.e., statements of the form

(x_v11 or x_v21 or x_v31) and
(x_v12 or x_v22 or x_v32) and .. and
(x_v1n or x_v2n or x_v3n)

where each x_vij is a boolean variable or the negation of a variable from a finite predefined list (x_1, x_2, ... x_n). It can be shown that every NP problem can be reduced to 3-SAT. The proof of this is technical and requires use of the technical definition of NP (based on non-deterministic Turing machines and the like). This is known as Cook's theorem.

What makes NP-complete problems important is that if a deterministic polynomial time algorithm can be found to solve one of them, every NP problem is solvable in polynomial time (one problem to rule them all).

NP-hard: Intuitively these are the problems that are even harder than the NP-complete problems. Note that NP-hard problems do not have to be in NP (they do not have to be decision problems). The precise definition here is that a problem X is NP-hard if there is an NP-complete problem Y such that Y is reducible to X in polynomial time. But since any NP-complete problem can be reduced to any other NP-complete problem in polynomial time, all NP-complete problems can be reduced to any NP-hard problem in polynomial time. Then if there is a solution to one NP-hard problem in polynomial time, there is a solution to all NP problems in polynomial time.

The halting problem is the classic NP-hard problem. This is the problem that given a program P and input I, will it halt? This is a decision problem but it is not in NP. It is clear that any NP-complete problem can be reduced to this one.

P = NP: This the most famous problem in computer science, and one of the most important outstanding questions in the mathematical sciences. In fact, the Clay Institute is offering one million dollars for a solution to the problem (Stephen Cook's writeup on the Clay website is quite good). It's clear that P is a subset of NP. The open question is whether or not NP problems have deterministic polynomial time solutions. It is largely believed that they do not. Here is an outstanding recent article on the latest (and the importance) of the P = NP problem: The Status of the P versus NP problem.

20/12/2013
When HTML first came out, a lot of people learned how to create pages by using a very handy featurethat you ’ ll find in...
20/12/2013

When HTML first came out, a lot of people learned how to create pages by using a very handy feature
that you ’ ll find in most common browsers — the ability to look at the source code that made the page.
If you go to the View menu in your browser, and then look for an option that says View Source or Page
Source, you should be able to see the code that created the page.
If you want to see how the author of a page achieved something on a page, this can be a very handy
technique.

Touchpad : -What is a touchpad?Ans. The touchpad is an input device, which is available for nearly all interfaces.There ...
20/12/2013

Touchpad : -
What is a touchpad?
Ans. The touchpad is an input device, which is available for nearly all interfaces.
There are two major types of touchpad.
Resistive:
The resistive touchpad consists of two membranes. When a finger or other object depresses the top membrane with a certain pressure, the membrane touches the underlying one. The connected controller recognizes where the two foils are touching each other and sends the information to the PC. This is the older version and is rarely used. We carry only capacitive touchpad.
Capacitive:
The capacitive touchpad consists of a PCB covered with a foil for design and Protection. An electrical field is generated above the front of the PCB. When a Finger touches any place on the touchpad area, the electrical field is changed. The Controller on the back of the PCB converts this change to the position on the pad and into a muse signal that is transferred to the PC.
The advantages of a capacitive touchpad are:
• Compact in size
• Durable- virtually endless lifespan, since there are no moving parts
• Easily mountable
The surface design can be changed to suit the customer’s needs and preferences.
Where touchpad are’s used?
• Infoterminals
• Notebook computers
• Industrial applications
• Medical devices
• Notebook

19/12/2013

Hybrid cloud computing allows customers to make decisions about where to host their applications and data based on business needs, not technology limitations. This makes it possible for organizations to make the most of IT by keeping mission-critical data or applications on-premises, for example, while also accessing almost limitless computing power and storage in the cloud. They can truly enjoy the benefits of datacenters without boundaries.

As one of the fastest-growing segments in the IT industry, cloud service providers play the critical role in our Cloud O...
19/12/2013

As one of the fastest-growing segments in the IT industry, cloud service providers play the critical role in our Cloud OS vision. Our overall community of service providers – more than 16,500 infrastructure hosting partners and nearly 10,000 application hosters – is the largest in the industry, and we added 5,000 partners just in the last year.

Address

Jaipur
302020

Website

Alerts

Be the first to know and let us send you an email when Super Programming Tricks posts news and promotions. Your email address will not be used for any other purpose, and you can unsubscribe at any time.

Contact The Practice

Send a message to Super Programming Tricks:

Share