Tuesday, February 28, 2012

PHP

PHP stands for PHP Hypertext Preprocessor. Yeah it is little bit confusing the 1st 'P' of PHP stands for PHP again. This type of acronym is called recursive acronym.
PHP was created by Rasmus Lerdorf in 1994. It became very popular from the year 1995.
PHP is a server side scripting language, that means unless JavaScript it executes on the server. PHP can interact with server's resources, such as Databases. The main salient features of PHP is it is free and open source, its supports all most all Databases such as MySQL, MS SQL Server, Oracle etc etc. It also supports Ajax, it is available for Linux, Windows and Mac platforms.
Many websites use PHP, one of the famous website Facebook also uses PHP.
From the beginning PHP was not object oriented but later object orientation feature was added to PHP 5.
PHP supports all programming tools such as variables, all operators, if-else statements, elseif statements, switch case, for loops, while loop, do while loop, continue and break statement, Arrays, user defined functions, include statement, global and static variables, file handling etc etc.
Some special features of PHP are reading data from web pages, server variables, session variables, cookie variables, HTTP headers, checking data with regular expressions, FTP, Email, Drawing images on server and at last XML and RSS.
I will recommend PHP to all web designers. If you need more support then please check www.php.net, the official site of PHP.
If you have any questions the please write to me at shirshendubhowmick@theinec.com

Store images in MySql


To store image in MySQL, open MySQL workbench start a connection. After that select your desired database, i am using test database. Now execute query:

CREATE TABLE `test`.`pic`
(
`idpic` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`caption` VARCHAR(45) NOT NULL,
`img` LONGBLOB NOT NULL,
PRIMARY KEY(`idpic`)
) ;

SELECT * FROM pic;

Now in the object browser, expand test -> Tables -> pic, right click on pic select edit table data, double click on idpic, caption to add value to those. Then right click on img attribute select load value from file, browser your picture then click open, then click on apply changes to data from the upper menu. Now you have stored data in the table.


To view your data execute SELECT * FROM pic; right click on img attribute select load value in editor switch to image tab, now you should be able to view your image.

SOPA


SOPA stands for Stop Online Piracy Act. The SOPA is a United States bill introduced by US representative Lamar S. Smith (R-TX) to expand the ability of U.S. law enforcement to fight online trafficking in copyrighted intellectual property and counterfeit goods. Provisions include the requesting of court orders to bar advertising networks and payment facilities from conducting business with infringing websites, and search engines from linking to the sites, and court orders requiring Internet service providers to block access to the sites. The law would expand existing criminal laws to include unauthorized streaming of copyrighted content, imposing a maximum penalty of five years in prison. A similar bill in the U.S. Senate is titled the PROTECT IP Act (PIPA).
Proponents of the legislation state it will protect the intellectual-property market and corresponding industry, jobs and revenue, and is necessary to bolster enforcement of copyright laws, especially against foreign websites. Claiming flaws in present laws that do not cover foreign-owned and operated sites, and citing examples of "active promotion of rogue websites" by U.S. search engines, proponents assert stronger enforcement tools are needed.
Opponents state the proposed legislation threatens free speech and innovation, and enables law enforcement to block access to entire internet domains due to infringing content posted on a single blog or webpage. They have raised concerns that SOPA would bypass the "safe harbor" protections from liability presently afforded to Internet sites by the Digital Millennium Copyright Act. Library associations have expressed concerns that the legislation's emphasis on stronger copyright enforcement would expose libraries to prosecution. Other opponents state that requiring search engines to delete a domain name could begin a worldwide arms race of unprecedented censorship of the Web and violates the First Amendment.
On January 18, 2012, the English Wikipedia, Reddit, and an estimated 7,000 other smaller websites coordinated a service blackout, or posted links and images in protest against SOPA and PIPA, in an effort to raise awareness. In excess of 160 million people viewed Wikipedia's banner. A number of other protest actions were organized, including petition drives, with Google stating it collected over 7 million signatures, boycotts of companies that support the legislation, and a rally held in New York City.
In response to the protest actions, the Recording Industry Association of America (RIAA) stated, "It's a dangerous and troubling development when the platforms that serve as gateways to information intentionally skew the facts to incite their users and arm them with misinformation", and "it's very difficult to counter the misinformation when the disseminators also own the platform."
The sites of several pro-SOPA organizations such as RIAA, CBS.com, and others were slowed or shut down with denial of service attacks started on January 19. Self-proclaimed members of the "hacktivist" group Anonymous claimed responsibility and stated the attacks were a protest of both SOPA and the United States Department of Justice shutdown of Megaupload that same day.
Opponents of the bill have proposed the Online Protection and Enforcement of Digital Trade Act (OPEN) as an alternative. On January 20, 2012, House Judiciary Committee Chairman Smith postponed plans to draft the bill: "The committee remains committed to finding a solution to the problem of online piracy that protects American intellectual property and innovation ... The House Judiciary Committee will postpone consideration of the legislation until there is wider agreement on a solution."

Transistors


Transistors:

A junction transistor id formed by sandwiching either 'p' type semiconductor in between two 'n' type semiconductors or 'n' type in between two 'p' semiconductor. The 1st type of transistor is called n-p-n and 2nd type is called p-n-p transistor. In the actual design the middle layer is very thin generally 1 μm. The middle layer is called base it is lightly doped with impurities and heavily doped layer is called emitter and moderately doped layer is called collector. Thus a transistor is a 3 terminal device.

 

p-n-p 
n-p-n 
 
 

These are the circuit symbols of a transistor. The emitter base junction is always forward biased and the collector base junction is always reversed biased. The arrow on the symbols shows the direction of current emitter base junction. An n-p-n transistor's emitter contains the largest number of electrons base contain largest number of holes, and collector contains electrons more than base but less than emitter.

Biasing of a transistor: Suitable potentials should be applied across the two junctions to operate the transistor. This is called biasing. A transistor can be operated in 3 different modes. Common emitter (CE), Common base (CB) mode and Common collector (CC) mode. In CE, CB, CC mode, the emitter, the base and the collector are kept at zero potential respectively. 







The emitter current is IE, the base current is IB and the collector current is IC.Using Kirchhoff's law we can write IE = IB + IC. IB may be 1% to 5% of IE.
 There are two parameters of a transistor called alpha and beta, defined as:
= IC/IE  and   β = IC/IB.
 The relation between 
and β is β = /(1-)
Thats all for today, if you have any question email me at
shirshendubhowmick@theinec.com.

Facebook Badge