Bangali Web design tutorials

Hello Academy's Profile Photo
Hello Academy  provide free web design tutorials in bangali language.  Anybody who doesn’t have any programming language knowledge can now develop web site easily with those tutorials. Here I add those YouTube links step by steps:

Basic web design:

1. গল্পে গল্পে ওয়েব ডিজাইনের ১ম পর্ব (ওয়েব ডিজাইনের শুরুর গল্প)

2. গল্পে গল্পে ওয়েব ডিজাইনের ২য় পর্ব (ওয়েব ডিজাইনের হাতেখড়ি-১ )

3. গল্পে গল্পে ওয়েব ডিজাইনের ৩য় পর্ব (ওয়েব ডিজাইনের হাতেখড়ি-১ )

4.গল্পে গল্পে ওয়েব ডিজাইনের ৪থ পর্ব (ওয়েব ডিজাইনের হাতেখড়ি-২ )

5.গল্পে গল্পে ওয়েব ডিজাইনের ৫ম পর্ব (ওয়েব ডিজাইনের হাতেখড়ি-৩ )

6.গল্পে গল্পে ওয়েব ডিজাইনের ৬ষঠ পর্ব (কমেন্টস এর গল্প )

7.গল্পে গল্পে ওয়েব ডিজাইনের ৭ম পর্ব (রেস্পন্সিভ এর গল্প )

PSD to HTML Basic:

8. গল্পে গল্পে ওয়েব ডিজাইনের ৮ম পর্ব (Psd to Html করার সাহসী গল্প part-1)

9. গল্পে গল্পে ওয়েব ডিজাইনের ৯ম পর্ব (Psd to Html করার সাহসী গল্প part-2)

10. গল্পে গল্পে ওয়েব ডিজাইনের ১০ম পর্ব (Psd to Html করার সাহসী গল্প part-3)

11. গল্পে গল্পে ওয়েব ডিজাইনের ১১তম পর্ব (Psd to Html করার সাহসী গল্প part-4)

12. গল্পে গল্পে ওয়েব ডিজাইনের ১২তম পর্ব (Psd to Html করার সাহসী গল্প part-5)

13. গল্পে গল্পে ওয়েব ডিজাইনের ১৩তম পর্ব (Psd to Html করার সাহসী গল্প part-6)

14. গল্পে গল্পে ওয়েব ডিজাইনের ১৪ তম পর্ব (রেস্পন্সিভ part-7)

Bootstrap basic:

১/ বুটিসট্র্যাপ বেসিক টিউটোরিয়াল ১ম পর্ব (প্রাথমিক ধারণা)

২/ বুটিসট্র্যাপ বেসিক টিউটোরিয়াল ২য় পর্ব (ড্রপডাউন মেন্যু)

৩/ বুটিসট্র্যাপ বেসিক টিউটোরিয়াল ৩য় পর্ব (স্লাইডার)

৪/ বুটিসট্র্যাপ বেসিক টিউটোরিয়াল ৪র্থ পর্ব (accordion)

Web Design Advance with Bootstrap-PSD to HTML with Bootastrap:

১/ বুটিসট্র্যাপ দিয়ে PSD to HTML (১ম পর্ব)

২/ বুটিসট্র্যাপ দিয়ে PSD to HTML (২য় পর্ব)

৩/ বুটিসট্র্যাপ দিয়ে PSD to HTML (৩য় পর্ব)

৪/ বুটিসট্র্যাপ দিয়ে PSD to HTML (৪র্থ পর্ব)

৫/ বুটিসট্র্যাপ দিয়ে PSD to HTML (৫ম পর্ব)

৬/ বুটিসট্র্যাপ দিয়ে PSD to HTML (৬ষ্ঠ পর্ব)

৭/ বুটিসট্র্যাপ দিয়ে PSD to HTML (৭ম পর্ব)

৮/ বুটিসট্র্যাপ দিয়ে PSD to HTML (৮ম পর্ব)

৯/ বুটিসট্র্যাপ দিয়ে PSD to HTML (৯ম পর্ব)

১০/ বুটিসট্র্যাপ দিয়ে PSD to HTML (১০ম পর্ব)

১১/ বুটিসট্র্যাপ দিয়ে PSD to HTML (১১তম পর্ব)

১২/ বুটিসট্র্যাপ দিয়ে PSD to HTML (১২তম পর্ব)

jQuery basic:

1/জেকুএরির ১ম পর্ব

2/জেকুএরির ২য় পর্ব

3/জেকুএরির ৩য় পর্ব

4/জেকুএরির ৪থ পর্ব

5/জেকুএরির ৫ম পর্ব

6/জেকুএরির ৬ষঠ  পর্ব

 7/জেকুএরির ৭ম  পর্ব

PHP Basic:

১/ PHP ১ম পর্ব (Introduction)

২/ PHP ২য় পর্ব (Data Types & Variables)

৩/ PHP ৩য় পর্ব (Arithmatic Operatos)

৪/ PHP ৪র্থ পর্ব (Assignment operator)

৫/ PHP ৫ম পর্ব (Logical Operator-1)

৬/ PHP ৬ষ্ঠ পর্ব (Logical Operator-2)

৭ / PHP ৭ম পর্ব (Index Array)

৮/ PHP ৮ম পর্ব (Associative Array)

৯/ PHP ৯ম পর্ব (Multidimensional Array)

১০/ PHP ১০ম পর্ব (For loop)

১১/ PHP ১১তম পর্ব (While loop)

১২ / PHP ১২তম পর্ব (Foreach loop)

Mozilla Firefox Crush Report

error_mozila
I use Mozilla Firefox 3.0.5 and few days ago it was being closed automatically showing crush report. So, I was unable to work properly. After start browsing it was closed within 20 minutes. I solved the problem using following steps:
1. After uninstalling the failed installation of Firefox 3.01, I still found a Mozilla Firefox directory under C:\Program Files\. I renamed this to old-Mozilla Firefox. This forces the new install to make a new folder. I would try this alone first and see if it works.
2. The second thing that I had done was to use regedit to find and rename all registry entries that seemed to be related to Mozilla Firefox. Again, this forced the new install to make new registry entries.

All the best with your install.

Firewall – The first step of Internet security

firewall

We know that Internet is a way of quick communication, business, various types of information and entertainment. Its use increased day by day. It had bed impact like others – it spread virus, spam, spyware etc. A personal computer connected to the internet without a firewall can be hijacked and added to an internet outlaw’s botnet in just a few minutes.

What is Firewall?

A firewall is a dedicated appliance, or software running on another computer, which inspects network traffic passing through it, and denies or permits passage based on a set of rules. A firewall is an integrated collection of security measures designed to prevent unauthorized electronic access to a networked computer system. It is also a device or set of devices configured to permit, deny, encrypt, decrypt, or proxy all computer traffic between different security domains based upon a set of rules and other criteria. Firewalls can be implemented in both hardware and software, or a combination of both. Firewalls are frequently used to prevent unauthorized Internet users from accessing private networks connected to the Internet, especially intranets. All messages entering or leaving the intranet pass through the firewall, which examines each message and blocks those that do not meet the specified security criteria.

There are several types of firewall techniques:

Packet filter: Looks at each packet entering or leaving the network and accepts or rejects it based on user-defined rules. Packet filtering is fairly effective and transparent to users, but it is difficult to configure. In addition, it is susceptible to IP spoofing.

Application gateway: Applies security mechanisms to specific applications, such as FTP and Telnet servers. This is very effective, but can impose a performance degradation.

Circuit-level gateway: Applies security mechanisms when a TCP or UDP connection is established. Once the connection has been made, packets can flow between the hosts without further checking.

Proxy server: Intercepts all messages entering and leaving the network. The proxy server effectively hides the true network addresses.

A firewall can block malware that could otherwise scan your computer for vulnerabilities and then try to break in at a weak point. The only way to make a home computer 100% secure is to turn it off or disconnect it from the Internet. The real issue is how to make one 99.9% secure when it is connected. At a minimum, home computers need to have personal firewall and anti-malware software installed and kept up-to-date to find and remove viruses, spyware, Trojans and other malware. A home network that uses a wired or wireless router with firewall features provides additional protection.

Personal Firewall Cooices:

Microsoft Windows Firewall — The Vista and XP Service Pack 2 operating systems have personal firewalls built in that are turned on by default to block threats from the Internet. You should leave this feature turned on until you replace it with third-party software and/or hardware.

Two-Way Third-Party Personal Firewall Software — These firewalls block both incoming and outgoing threats. A computer has outgoing threats when it becomes infected with a virus, trojan horse or spyware. A challenge for this type of firewall is to distinguish between threats and legitimate software. Three common ways to address this are by vendors including a list of safe software for the firewall to check [white list], malware to block [black list] and/or by issuing a pop up alert to the user asking for advice on what to do [better for experts]. For links to vendors and reviews of over fifty products, see our Personal Firewall Reviews page. Recommended products with links to vendors:

nternet Security Software Suites — These products include two or more security features such as a personal firewall, anti-virus, anti-spyware and more. For links to vendors and reviews of over 20 products, see our Internet Security & Utility Suites page. Recommended retail products with links to vendors:

Norton Internet Security

ZoneAlarm Internet Security Suite

Kaspersky Internet Security

Hardware Firewalls — A hardware firewall is usually a small box that sits between a modem and a computer or network. The firewall is either based on “network address translation” (NAT) which hides your computer from the Internet or NAT plus “stateful packet inspection” (SPI) for more protection. There are three basic types of hardware devices that include firewalls for home users, Wired Routers, Wireless Routers, and Broadband Gateways. They are inexpensive enough to be used with one computer and can also be used to create a home computer network. They can be used in addition to a software firewall on each computer because they run on a separate box preventing most compatibility problems. Recommended broadband gateway retail products with links to vendors.

D-Link DIR-655 Extreme N Wireless Router

ZoneAlarm Secure Wireless Router

Important Tips — Never use two personal firewall software products at the same time. Fully uninstall one before installing another to prevent compatibility problems. After installation, be sure to test it with an online service like Security Space to make sure that it is configured correctly.

The votebd.org website

votebd.org site

The votebd.org site

In the governance of a country, it is very important in this age to be informed about the people who will be running the country and representing it. Shushashoner Jannoy Nagorik’s Votebd.org does exactly this. Votebd.org tracks all the information related to contesting politicians and makes it available to people of Bangladesh. This is an effort in the direction of reducing corruption by making use of technology for transparency. In the past, even the voter list was not available to the common people. Shujan made the voter list available through this web site. Hopefully, an improvement in the political solution may eventually encourage an environment for honest, competent and devoted persons to join the politics.

Description:

Democracy is a government of the people, for the people, by the people. But do we have a medium to turn this theory into a practical reality. The website http://www.votebd.org has been developed for this purpose, to disseminate the personal information of the candidate who will contest in the local and national elections among the voters. Ironically, this effort is happening in Bangladesh. The information disseminated are educational qualification, criminal records (present and past), statements of assets and liabilities of candidates and dependents, profession, loan from bank and financial institutions, statement of income tax returns, source of election expenses, statement of actual election expenses etc. In addition, about 2,500 news published in the leading national dailies on corruption and criminalization made by politician, businessmen, government officials and others also posted in this site. It is being regularly updated.

Site link: http://www.votebd.org/

One of my projects Votebd.org won the Manthan Award 2008

Manthan Award 2008

Manthan Award 2008

Hi friends,

Hurrah! We have won the award. We deserved it. Its also a very good news for Bangladesh. One of my projects Votebd.org won the Manthan Award 2008 on E-Governance category. Bangladesh won five more awards- Roobon received more 2 awards on behalf of ankur and Unnayan TV. We had a big pavilion, hadn’t much logistics and not well furnished. Though we had a poor participation, we won 6 awards. It is really tremendous.

Roobon in the pavilion with Osama Manzar, the founder of Manthan

Roobon in the pavilion with Osama Manzar, the founder of Manthan

Address is:http://votebd.org/

Manthan Award 2008 News Links:

News in Gulf-Times
http://www.gulf-times.com/site/topics/article.asp?cu_no=2&item_no=249411&version=1&template_id=44&parent_id=24

The Daily Star of Bangladesh
http://www.thedailystar.net/pf_story.php?nid=59806

Prothom Alo
http://www.prothom-alo.com/index.news.details.php?nid=MTk1MzQ=

Unnayan News of Bangladesh
http://www.unnayannews.net/?p=783

Financial News of Bangladesh
http://www.thefinancialexpress-bd.info/search_index.php?page=detail_news&news_id=48626

Award committee have posted some photos and description.
http://manthanaward.org/index.asp
http://manthanaward.org/section_full_story.asp?id=652

Posted a news in Techtunes

http://techtunes.com.bd/news/tune-id/1561/

The Daily Ittefaq (IT page)- 24.10.2008
The Daily Sangbad (IT page)- 25.10.2008
The Daily Naya Diganta (IT Corner)- 25.10.2008
The Daily Amar Desh (IT corner)- 26.10.2008

For learn more please visit: www.manthanaward.org

Top open-source version control systems

Version control is an excellent way to allow unlimited number of people working on the same code base, without having to constantly send files back and forth. Designers and developers can both benefit from using such systems to keep copies of their files and designs. They can revert to earlier versions if something happens. Here I discuss some popular version control systems:

CVS is the Concurrent Versions System, the dominant open-source network-transparent version control system. It was first released in 1986. CVS is the de facto standard and is installed virtually everywhere. It’s useful for any designer or developer for backing up and sharing files. Tortoise CVS is a great client for CVS on Windows, and there are many different IDEs, such as Xcode (Mac), Eclipse, NetBeans and Emacs, that use CVS.

SVN or Subversion is the most popular version control system. Most open-source projects (SourceForge, Apache, Python, Ruby and many others) use it as a repository. Google Code uses Subversion exclusively to distribute code. For Windows, Tortoise SVN is a great file browser for viewing, editing and modifying your Subversion code base. For Mac, you have to use Versions. For Apple’s developer environment you have to use Xcode.

Bazaar have a very friendly user experience. It supports many different types of workflows, from solo to centralized to decentralized, with many variations in between. People have used it to version pretty much anything: single-file projects, your /etc directory and even the thousands of files and revisions in the source code for Launchpad, MySQL and Mailman. You can use it to fit almost any scenario of users and setups. It’s easy to modify and also embeddable, so you can add it to existing projects. Bazaar runs on GNU/Linux, UNIX, Windows and OS X out of the box. Bazaar is friendly, smart, fast, lightweight, extensible, embeddable, safe and free. Lists of plug-ins for Bazaar that are available under a free software license are given their plug-ins page. The page UsingPlugins gives detailed explanations about the plugin concept and installation instructions for plugins.

Git is a distributed version control systems initially developed by Linux kernel creator Linus Torvalds. Different branches hold different parts of the code instead one centralized code base to pull the code from. Git prides itself on being a fast and efficient system, and many major open-source projects use Git to power their repositories like Linux Kernel, Ruby on Rails, WINE, Fedora, X.org, Rubinius, and VLC etc. Git is used for version control of files, much like tools such as Mercurial, Subversion, CVS, Perforce, Bitkeeper, and Visual SourceSafe. GitHub has recently helped establish Git as a great version control system. It’s much harder to use for a beginner.

Mercurial is a cross-platform, distributed revision control tool for software developers. It was designed for larger projects, most likely outside the scope of designers and independent Web developers. It is extremely fast, and the creators built the software with performance as the most important feature. It’s easy to use because it’s functions are similar to those in other CVS systems. The creator and lead developer of Mercurial is Matt Mackall. Mercurial was initially written to run on Linux. It has been ported to Windows, Mac OS X, and most other Unix-like systems. Some projects using the Mercurial distributed RCS are Aldrin, Audacious, Dovecot IMAP server, Growl, MoinMoin wiki software, Mozilla, Netbeans, OpenJDK, SAGE and Sun’s OpenSolaris.

LibreSource is a versatile collaborative platform. It is used to manage collaborative projects. Open Source, modular and highly customizable, LibreSource is adapted to collaborative software development (forge), groupware, community leading, e-archiving and Web publishing. It has built-in features such as Wiki pages, forums, trackers, Synchronizers, Subversion repositories, files, download areas, drop boxes, forms, instant messaging and more. LibreSource is perfect for the developer or designer who doesn’t want to learn lots of technical jargon and wants to focus more on communication with the project’s members. LibreSource uses most of the advanced services provided by the ObjectWeb application server called JOnAS. Effective communication is a fundamental requirement for agile project management. LibreSource includes a Software Configuration Management tool called LibreSource Synchronizer which is innovative, simple and united. LibreSource simplifies the creation of a dynamic community and help to maintain and enhance team relationship in order to improve the cooperative efficiency. Just install the package and start collaborating.

Monotone is another distributed revision control system. Monotone is fairly easy to learn if you’re familiar with CVS systems, and it can import previous CVS projects.

Source Jammer is a source control and versioning system written in Java. It consists of a server-side component that maintains the files and version history, and handles check-in, check-out, etc. and other commands; and a client-side component that makes requests of the server and manages the files on the client-side file system. SourceJammer is coded in 100% Java, so it is platform independent.

GNU arch is a distributed revision control system that is part of the GNU Project and licensed under the GNU General Public License. It is used to keep track of the changes made to a source tree and to help programmers combine and otherwise manipulate changes made by multiple people or at different times. Being a distributed, decentralized versioning systems, each revision in GNU arch is uniquely globally identifiable; such identifier can be used in a distributed setting to easily merge or cherry-pick changes from completely disparate sources. Its other features are Atomic commits, Changeset oriented, easy branching, advanced margin, cryptographic signature, renaming and metadata tracking.

Version control Tools:

Some Employee Testing Services

Wanna Quickly Identify the Best Candidates

Pre-Employment Testing – Do you have so many applicants that it’s hard to isolate the best candidates before they are no longer available? Is your recruiting staff overwhelmed with resumes and applications? Online pre-employment assessments can help you sort the “A” candidates from the rest of the pack before you invest your precious time.

Some company who help you to pre employment testing are given below:

Expert Rating:

ExpertRating is a leader in Online Certification and Employment Testing and offers an affordable and efficient way for people to prove their expertise in over 200 widely accepted online certifications. ExpertRating Employment Testing solutions have been chosen by hundreds of leading employers to quickly and efficiently identify the right talent for the right positions.

Brainbench

Offering online skills certification to help individuals and employers validate, screen, and identify qualifications.

Result Resource

Result Resources is an integrated management and technology consulting company that specializes in providing clients with the tools, services, and technologies essential to achieving success.

Kenexa Prove It!
Online testing site to evaluate programming and technical computer skills.

Work Skills First
Provides internet-based personnel and employment applicant screening tests to employers.

Hire Success
Offers industry and job specific employee testing software.

ReviewNet
Provides web-based software to help recruiters attract and select IT and engineering professionals quickly, easily, and inexpensively.

Merit Bay
Offers IT skill tests online for programming languages and administrative software.

QuizAndQuestion.com
Offers Web, LAN, and PC based testing and test authoring multimedia tools capable of exchanging tests and e-learning objects.

Tele-Interview
Automated job interview software using integrated web and telephony technology to quickly screen applicants.

Precise Hire

Precise Hire provides employment screening and background checks helping companies make same day employment screening decisions.

Corra Group

Providers of customized background checks and pre-employment screening services.

Nobscot Corporation

Offers online exit interviews and employment screening for improving retention and reducing staff turnover.

HireRight

Offering background verification, drug screening, skills testing, and behavioral assessment tools.

Censeo Corporation

Offers online testing and assessment as well as human resource consulting.

CMS for develop Shopping Cart

//www.acunetix.com/websitesecurity/images/shopping_cart.gif” cannot be displayed, because it contains errors.

Shopping carts are popular web applications that enable your customers to add products to a “basket” or cart as they navigate around your site. They calculate all product, shipping and tax totals automatically for the customer.

If you wish to use your own custom shopping cart following CMS will help you:

Name Description Cost
Buy Buttons Buy Buttons is available free within the eCOM Standard and Premium accounts and is ideal for the merchant selling a small number of items. It provides a simple “add to cart” facility for any web site. Add Buy Buttons to your pages within minutes. Includes various shipping and tax calculations. Free with eCOM Standard and Premium
osCommerce osCommerce is an “open source” e-commerce solution under ongoing development by the open source community. It does require some technical expertise to get up and running.

osCommerce is written completely in PHP and uses the MySQL Database.

Free (Open Source)
Zen Cart Zen Cart is an “open source” e-commerce solution under ongoing development by the open source community. It does require some technical expertise to get up and running.

Zen Cart is written completely in PHP and uses the MySQL Database.

Free (Open Source)
Virtuemart VirtueMart is the leading Online-Shop solution for Joomla! & Mambo (more than 1.5 Million downloads so far). VirtueMart is free! You can download, use and modify it without any restrictions (License: GNU/GPL) – just as Joomla.

VirtueMart is no stand-alone script, but a Plug-in and requires the PHP Content Management System Joomla! (or Mambo). So you must install Joomla first, then VirtueMart.

Free (Open Source)
QuickCart Shopping Cart Store Builder – QuickCart.com™ is a fully hosted shopping cart and e-commerce store builder that will instantly add shopping carts to any web site.
Use the shopping cart store builder software to build your shopping cart quickly.
$99
CubeCart A free 100% template driven ecommerce script requiring hosting with PHP & MySQL support used by over a million stores world wide. V3 Free, or V4 $129.95 plus US$89.95 to remove copyright notices.
Actinic One of the UK’s most well-known shopping cart systems. It is a Perl based system, and requires CGI capabilities on your server.

The shop is built offline using the Actinic software, and then the exported HTML files and scripts are simply uploaded to your server. The system does allow design control for those with knowledge of HTML, and comprehensive shipping and tax options.

£399 Catalog Version, £799 Business Version
ClickCartPro ClickCartPro is full featured web based shopping cart software, with 200 functions. Search Engine Optimized (SEO) out of the box, 100% standards compliant output using XHTML Strict code and CSS. Accessibility compliance under WAI levels 1 and 2. Software £159.99, Hosted version from £499.99
JShop Server JShop server is a PHP and MySQL database driven shopping cart application, which is installed on your own server. It is designed for the fairly advanced user – and is therefore not recommended for beginners. It does boast a large range of features such as customer accounts, wishlists, address books, order history, full order management, template driven design, gift certificates, discounts, advanced pricing, stock control, import/export, newsletter management, dispatching, receipt printing, customisable emails, full multiple language support, full multiple currency support and many more. From £200 for a single site; Developer version £800
Mal’s e-commerce This is a simple, full featured shopping cart with access to all the important features that are required to start selling goods and services on the internet. You will need the paid version, the Premium account, in order to connect to SecureHosting for your payments. US$96 per year
Virtualshop3 Virtualshop3 is a shopping cart that requires no previous experience or knowledge of HTML. It is flexible enough to cope with just about any product range.

Virtualshop3 is written completely in Javascript.

£69.95
Shop Maker Shop Maker is the complete solution for selling online. It comes complete with front end catalog and ordering system and backend shop, product and order management. Visit the website for a complete overview of this powerful system. £30 per month
X Cart X-Cart is template based software with open source code. This means you can modify look & feel and functionality of the shopping cart the way you need should you require any business specific features. It does require some technical expertise to get up and running.

X Cart is written completely in PHP and uses the MySQL Database.

US$ 199

DESIGN PATTERNS in PHP

In software engineering, a design pattern is a general reusable solution to a commonly occurring problem in software design. The advantage of knowing and using these patterns is save time as well as give developers a common language in software design. Here I discuss the implementation of some common design patterns that are easily adapted to PHP.

1. Strategy Pattern:

The strategy pattern is typically used when your programmer’s algorithm
should be interchangeable with different variations of the algorithm. For
example, if you have code that creates an image, under certain circumstances, you might want to create JPEGs and under other circumstances, you might want to create GIF files.
The strategy pattern is usually implemented by declaring an abstract
base class with an algorithm method, which is then implemented by inheriting concrete classes. At some point in the code, it is decided what concrete strategy is relevant; it would then be instantiated and used wherever relevant.
Our example shows how a download server can use a different file selection
strategy according to the web client accessing it. When creating the
HTML with the download links, it will create download links to either .tar.gz
files or .zip files according to the browser’s OS identification. Of course, this
means that files need to be available in both formats on the server. For simplicity’s sake, assume that if the word “Win” exists in $_SERVER[“HTTP_
USER_AGENT”], we are dealing with a Windows system and want to create .zip
links; otherwise, we are dealing with systems that prefer .tar.gz.
In this example, we would have two strategies: the .tar.gz strategy and
the .zip strategy, which is reflected as the following strategy hierarchy (see
Figure 1).


Figure 1: Strategy hierarchy.

The following code snippet should give you an idea of how to use such a
strategy pattern:
abstract class FileNamingStrategy {
abstract function createLinkName($filename);
}
class ZipFileNamingStrategy extends FileNamingStrategy {
function createLinkName($filename)
{
return “http://downloads.foo.bar/$filename.zip”;
}
}
class TarGzFileNamingStrategy extends FileNamingStrategy {
function createLinkName($filename)
{
return “http://downloads.foo.bar/$filename.tar.gz”;
}
}
if (strstr($_SERVER[“HTTP_USER_AGENT”], “Win”)) {
$fileNamingObj = new ZipFileNamingStrategy();
} else {
$fileNamingObj = new TarGzFileNamingStrategy();
}
$calc_filename = $fileNamingObj->createLinkName(“Calc101”);
$stat_filename = $fileNamingObj->createLinkName(“Stat2000″);
print <<<EOF
<h1>The following is a list of great downloads<</h1>
<br>
<a href=”$calc_filename”>A great calculator</a><br>
<a href=”$stat_filename”>The best statistics application</a><br>
<br>
EOF;
Accessing this script from a Windows system gives you the following
HTML output:
<h1>The following is a list of great downloads<</h1>
<br>
<a href=”http://downloads.foo.bar/Calc101.zip”>A great calculator<
/a><br>
<a href=”http://downloads.foo.bar/Stat2000.zip”>The best statistics
application</a><br>
<br>

Tip: The strategy pattern is often used with the factory pattern, which is
described later in this section. The factory pattern selects the correct strategy.

2. Singleton Pattern:
The singleton pattern is probably one of the best-known design patterns.
You have probably encountered many situations where you have an object that
handles some centralized operation in your application, such as a logger
object. In such cases, it is usually preferred for only one such application-wide
instance to exist and for all application code to have the ability to access it.
Specifically, in a logger object, you would want every place in the application
that wants to print something to the log to have access to it, and let the centralized
logging mechanism handle the filtering of log messages according to
log level settings. For this kind of situation, the singleton pattern exists.
Making your class a singleton class is usually done by implementing a
static class method getInstance(), which returns the only single instance of
the class. The first time you call this method, it creates an instance, saves it in
a private static variable, and returns you the instance. The subsequent
times, it just returns you a handle to the already created instance.
Here’s an example:
class Logger {
static function getInstance()
{
if (self::$instance == NULL) {
self::$instance = new Logger();
}
return self::$instance;
}
private function __construct()
{
}
private function __clone()
{
}
function Log($str)
{
// Take care of logging
}
static private $instance = NULL;
}
Logger::getInstance()->Log(“Checkpoint”);

The essence of this pattern is Logger::getInstance(), which gives you
access to the logging object from anywhere in your application, whether it is
from a function, a method, or the global scope.
In this example, the constructor and clone methods are defined as private.
This is done so that a developer can’t mistakenly create a second
instance of the Logger class using the new or clone operators; therefore, getInstance() is the only way to access the singleton class instance.

3. Factory Pattern:

Polymorphism and the use of base class is really the center of OOP. However,
at some stage, a concrete instance of the base class’s subclasses must be created.
This is usually done using the factory pattern. A Factory class has a
static method that receives some input and, according to that input, it decides
what class instance to create (usually a subclass).
Say that on your web site, different kinds of users can log in. Some are
guests, some are regular customers, and others are administrators. In a common
scenario, you would have a base class User and have three subclasses:
GuestUser, CustomerUser, and AdminUser. Likely User and its subclasses would
contain methods to retrieve information about the user (for example, permissions
on what they can access on the web site and their personal preferences).
The best way for you to write your web application is to use the base class
User as much as possible, so that the code would be generic and that it would
be easy to add additional kinds of users when the need arises.
The following example shows a possible implementation for the four User
classes, and the UserFactory class that is used to create the correct user object
according to the username:
abstract class User {
function __construct($name)
{
$this->name = $name;
}
function getName()
{
return $this->name;
}
// Permission methods
function hasReadPermission()
{
return true;
}
function hasModifyPermission()
{
return false;

}
function hasDeletePermission()
{
return false;
}
// Customization methods
function wantsFlashInterface()
{
return true;
}
protected $name = NULL;
}
class GuestUser extends User {
}
class CustomerUser extends User {
function hasModifyPermission()
{
return true;
}
}
class AdminUser extends User {
function hasModifyPermission()
{
return true;
}
function hasDeletePermission()
{
return true;
}
function wantsFlashInterface()
{
return false;
}
}
class UserFactory {
private static $users = array(“Andi”=>”admin”, “Stig”=>”guest”,
“Derick”=>”customer”);
static function Create($name)
{
if (!isset(self::$users[$name])) {
// Error out because the user doesn’t exist
}
switch (self::$users[$name]) {

case “guest”: return new GuestUser($name);
case “customer”: return new CustomerUser($name);
case “admin”: return new AdminUser($name);
default: // Error out because the user kind doesn’t exist
}
}
}
function boolToStr($b)
{
if ($b == true) {
return “Yes\n”;
} else {
return “No\n”;
}
}
function displayPermissions(User $obj)
{
print $obj->getName() . “‘s permissions:\n”;
print “Read: ” . boolToStr($obj->hasReadPermission());
print “Modify: ” . boolToStr($obj->hasModifyPermission());
print “Delete: ” . boolToStr($obj->hasDeletePermission());
}
function displayRequirements(User $obj)
{
if ($obj->wantsFlashInterface()) {
print $obj->getName() . ” requires Flash\n”;
}
}
$logins = array(“Andi”, “Stig”, “Derick”);
foreach($logins as $login) {
displayPermissions(UserFactory::Create($login));
displayRequirements(UserFactory::Create($login));
}
Running this code outputs
Andi’s permissions:
Read: Yes
Modify: Yes
Delete: Yes
Stig’s permissions:
Read: Yes
Modify: No
Delete: No
Stig requires Flash
Derick’s permissions:
Read: Yes
Modify: Yes
Delete: No
Derick requires Flash
This code snippet is a classic example of a factory pattern. You have a class
hierarchy (in this case, the User hierarchy), which your code such as displayPermissions() treats identically. The only place where treatment of the classes differ is in the factory itself, which constructs these instances. In this example, the factory checks what kind of user the username belongs to and creates its class accordingly. In real life, instead of saving the user to user-kind mapping in a static array, you would probably save it in a database or a configuration file.

Tip: Besides Create(), you will often find other names used for the factory
method, such as factory(), factoryMethod(), or createInstance().

4. Observer Pattern:

PHP applications, usually manipulate data. In many cases, changes to one
piece of data can affect many different parts of your application’s code. For
example, the price of each product item displayed on an e-commerce site in the
customer’s local currency is affected by the current exchange rate. Now,
assume that each product item is represented by a PHP object that most likely
originates from a database; the exchange rate itself is most probably being
taken from a different source and is not part of the item’s database entry. Let’s
also assume that each such object has a display() method that outputs the
HTML relevant to this product.
The observer pattern allows for objects to register on certain events
and/or data, and when such an event or change in data occurs, it is automatically
notified. In this way, you could develop the product item to be an observer
on the currency exchange rate, and before printing out the list of items, you
could trigger an event that updates all the registered objects with the correct
rate. Doing so gives the objects a chance to update themselves and take the
new data into account in their display() method.
Usually, the observer pattern is implemented using an interface called
Observer, which the class that is interested in acting as an observer must
implement.
For example:

interface Observer {
function notify($obj);
}
An object that wants to be “observable” usually has a register method
that allows the Observer object to register itself. For example, the following
might be our exchange rate class:

class ExchangeRate {
static private $instance = NULL;
private $observers = array();
private $exchange_rate;
private function ExchangeRate() {
}
static public function getInstance() {
if (self::$instance == NULL) {
self::$instance = new ExchangeRate();
}
return self::$instance;
}
public function getExchangeRate() {
return $this->$exchange_rate;
}
public function setExchangeRate($new_rate) {
$this->$exchange_rate = $new_rate;
$this->notifyObservers();
}
public function registerObserver($obj) {
$this->observers[] = $obj;
}
function notifyObservers() {
foreach($this->observers as $obj) {
$obj->notify($this);
}
}
}
class ProductItem implements Observer {
public function __construct() {
ExchangeRate::getInstance()->registerObserver($this);
}
public function notify($obj) {
if ($obj instanceof ExchangeRate) {
// Update exchange rate data
print “Received update!\n”;
}
}
}
$product1 = new ProductItem();
$product2 = new ProductItem();
ExchangeRate::getInstance()->setExchangeRate(4.5);
This code prints
Received update!
Received update!

Although the example isn’t complete (the ProductItem class doesn’t do
anything useful), when the last line executes (the setExchangeRate() method), both $product1 and $product2 are notified via their notify() methods with the new exchange rate value, allowing them to recalculate their cost.
This pattern can be used in many cases; specifically in web development,
it can be used to create an infrastructure of objects representing data that
might be affected by cookies, GET, POST, and other input variables.

Thanks to the advances of PHP 5, using common OO methodologies, such as
design patterns, has now become more of a reality than with past PHP versions. For more you can visit http://www.cetus-links.org/.

Some excellent websites to learn CSS

Some excellent websites are given below to learn CSS within short time:

Site name Description

70 Expert Ideas For Better CSS Coding

To learn more about professional CSS coding, you should visit this site.

53 CSS-Techniques You Couldn’t Live Without.

To to get a powerful and handy CSS-Toolbox for your future projects, you can use this site.

CSS Basics

CSS Basics is formatted like a book with 18 chapters dedicated to educating readers about fundamental CSS concepts. The writing is clear and succinct – making it a great resource for those just starting out. All 18 chapters can be printed or downloaded in PDF format.

W3CSchools CSS Tutorial

W3CSchools has a CSS section that covers the very basics of CSS up to more advanced topics.

css Zen Garden

css Zen Garden is a showcase of the things you can do CSS. Most importantly, it highlights the concept of separating content from presentation. Using the same HTML file, designers submit external stylesheets to style the HTML file. I suggest using the Web Developer Tool to inspect how the layouts work and what styles affect certain elements of the page.

CSS at MaxDesign

At MaxDesign, you can find Russ Weakley’s brilliant set of CSS-related tutorials. Some things to expect here are: Listmatic – which shows you a variety of ways you can use CSS to style lists, and Floatutorial – which goes through the fundamentals of floating elements.

CSSeasy.com

CSSEasy.com’s slogan is “learn CSS the modern way”. The site promotes learning by experience, with the idea that if you inspect the source code and see how things fit together as a whole, you’ll gain a better understanding of CSS. The Web Developer Tool will also come in handy on this website.

CSS-Discuss

CSS-Discuss is a community of CSS enthusiasts. The CSS-Discuss Wiki is a comprehensive collection of real-world usage of CSS.

Web Design from Scratch: CSS

Ben Hunt’s Web Design from Scratch has an excellent section on CSS that covers basic concepts about CSS. I highly recommend beginners start off with Introduction to CSS, a quick but very informative starting point to getting your hands dirty with CSS.

CSSDog

CSSDog has a section for both beginners and more advanced developers. Aside from CSS lessons, their CSS Reference section – which lists quick guides and color references – are very helpful.

CSS on Delicious

The CSS tag on Delicious is a great way to find popular links that relate to CSS. It allows you to see what people are currently reading.

SitePoint CSS Reference

SitePoint has a CSS reference section that discusses introductory level CSS topics. You can get a crash course on general CSS syntax and nomenclature onto slightly more advanced topics such as CSS hacks and filters.

A List Apart CSS Topics

A List Apart, the premier site to read articles about web design and best practices, has a collection of articles on the topic of CSS dating back to 1999. Most articles are geared towards intermediate to advanced developers who put a strong emphasize on standards-compliant designs.

CSS Help Pile

CSS Help Pile is an aggregate of CSS resources, tips, and how-to’s. The site is well-organized and a wonderful resource for any level of expertise. There’s a category for beginners, browser bugs, and short reviews of CSS books.

Eric Meyer: CSS

Here’s a collection of works by Eric Meyer (acclaimed web professional and author). Some resources you’ll find on this page are css/edge (Eric Meyers experiments on CSS) and CSS reference.

Holy CSS Zeldman!

Holy CSS Zeldman (not a site by Jeffrey Zeldman) is a useful collection of resources that link to standards-based CSS tutorials, tools, and layouts.

456 Berea Street – CSS category

Roger Johansson’s 456 Berea Street has over 300 posts under the CSS category. Some posts talk choosing an image replacement method while others teach you CSS techniques.

/* Position Is Everything */

Those just getting their hands around authoring CSS code will quickly realize that a significant chunk of time (and frustration) stems from getting rid of browser bugs. Position Is Everything discusses known browser bugs and shares CSS methods that work across browsers. Here, you can read about the one true layout or learn what happens when you nest absolutely-positioned div’s.

HTML Dog CSS Tutorials

HTML Dog is a tutorial website dedicated to teaching XHTML and CSS best practices. There’s three CSS tutorial sections: Beginner, Intermediate, and Advanced.

Andy Budd CSS/Web Standards Links

Andy Budd (directory of Clearleft, CSS guru, and author of one of my favorite books – CSS Mastery) has a set of CSS/web standards links to help you find reliable, useful information about CSS.

Learn CSS Positioning in Ten Steps

Positioning elements using CSS can be a tricky concept at first. If you’re having a hard time understanding the fundamentals of CSS positioning, check out this 10-step tutorial to get you positioning stuff in no time!

CSS-Tricks

CSS-Tricks is a blog dedicated to the topic of CSS. You’ll find helpful posts such as what CSS Sprites are (in a nut shell), techniques for image replacements, and even screencasts on topics like conditional stylesheets.

Smashing Magazine

A great site for CSS learners.

CSSPlay

This site will help newcomers to CSS and show old hands that it is more than just a mechanism for styling your documents.

web design dashboard

It’s got a ton of stuff on CSS and also other random web design resources!

Quirks Mode

It contains about 120 pages with CSS and JavaScript tips and tricks, and is one of the best sources on the WWW for studying and defeating browser incompatibilities.