Wednesday, May 4, 2011

Joomla:How to move your site to a different server?


Most of you may have created your Joomla site in the localhost and you may be thinking of the way to move it to a live server on the web.
This also applies when you want to move the site from a one live server to another one.
The first thing you need to do is to upload the files to the new server. If your new web host give you a cPanel this is damn easy. (Free web hosts like x10hosting give you a cPanel for controlling your hosting account).
If you have the ability of extracting a compressed file in the server you can transfer your files very easy.
Note! Only *.zip, *.Gz, *.Bz2, or *.tar file types can be extracted in cPanel.
You can use either FTP or the online file manager of your hosting control panel to upload the files. When uploading files be careful to upload either to www folder or to a folder like public_html.
However if the new domain is mapped with a folder inside the public_html folder you need to upload the files there.
Eg: Main domain of my hosting account is sanjaya.me. So if i need to setup a site for sanjaya.me I would upload the files to public_html directly.
If I have created a sub domain jom.sanjaya.me which is mapped with the public_html/jom folder I must upload the files to that jom folder.
To upload the files via FTP you can use an FTP client like FileZilla.
(If you don’t have the ability of extracting a compressed file on the server this is the best way you can upload all your files.)

Here you can fill the ftp Host, ftp username and ftp password and connect to the server. You can enter into the correct server folder in the right side and drag and drop the files to it from the left panel which shows the files in your pc.
( You may get the FTP details when you create your hosting account for the first time. Or you may create additional FTP accounts through the page you get when you click FTP accounts button in the cpanel.)
Else you can use the online file manager. Below you see the file manager of cPanel.
Here you see an Upload button where you can upload the files one by one. (nearly impossible to upload thousands of files one by one, but you can upload a compressed file using this way as well as using ftp).
After uploading a compressed file you can extract the file by checking the checkbox for the compressed file and clicking on the extract button.
OK somehow you have now uploaded the files successfully.
Then what you have to do is to get a database prepared for the Joomla site.
First you need to get a database dump of your site.
Go to your localhost’s phpMyAdmin and select your database. Then press export.
Better you check the check boxes which I have marked in orange in the above picture. You may need that when you are importing a dump to a DB where you have data already.
You can press the GO button after selecting a file type.
Now you’ll get a backup of the database as a file.
What you have to do now is to create a database in your live server. In cPanel you can use MySql DataBase Wizard for this. There you can enter the name of the DB, a username and a password. And at last you’ll be asked about the permissions which you must give to the newly created DB user. You can check all the checkboxes there.
Now you have created a DB and a user for it.
Go to phpMyAdmin in your live server, select your database and go to the import tab. There you can see a browser button.
(You may see something like this :
Imported file compression will be automatically detected from: None, gzip, zip. So it means you can upload compressed formats too. Else you need to upload the .sql file directly.)
You can locate the db dump you got from your local server and press GO. So now the data will be imported to the database in the live server.

Now what you have to do is to configure your joomla site to connect to this database. Go to the place where you uploaded the files and find the configuration.php file.
In cPanel File Manager you can use the online editor ( you can see an Edit button on the top). Or you can download the file, edit it and upload again.
Edit the following things in the way that suits with your new DB

var $host = ‘localhost’;
var $user = ‘root’;
var $db = ‘myoldDB’;

var $password = ‘myOldPass’;

$host can be kept same as localhost most of the time.

And you may change the following ones too.
var $log_path = ‘E:\Web\xampp\htdocs\jom\logs’;
var $tmp_path = ‘E:\Web\xampp\htdocs\jom\tmp’;

If everything is OK now you may see the site working.






Labels:

Content Management Systems (CMS)


You may have heard the word “CMS” several times. Do you wonder what a CMS is …? Well it Content Management System is presented in the abbreviation CMS. Whatever it is, what does it do really?
Also have you ever think of how large sites manage their content? News sites like adaderana.lk, dailymirror.lk needs to be updated so often. If you are a person who only knows about web designing with HTML you may have wondered how these people manage their sites. Because editing html files and updating them in the server is not a much easy task. You need to edit the page locally and then update the remote server. Managing huge amount of content is not an easy task in this way.
Just imagine about a business. Most probably the business owner or managing director is a non-tech guy. Even though they have a web site it is difficult to update the site as needed. Think the manager needs to update the site with an immediate notice. What does he have to do? He contacts the web designing company and says his requirement. Then he may email the required content and after some time the site will be updated by the designing company. This takes much time and even cost much too. What if this non-tech guy have the chance of updating the site quickly?
Also we may add several types of content to the web site. We may add photos, audio, video and so on. Also we may need to provide a facility of user registraion, logging in and displaying user specific content. How about coding from the scratch ?
For all these problems the solution is Content Management Systems which we call CMSs in short. So what is a CMS? What do they do ?

In simple terms : CMS is  a system that manages content. Telling it in a descriptive manner,
“A CMS is a tool that enables a variety of technical and non technical staff to create, edit, manage and finally publish a variety of content (such as text, graphics, video, documents etc), whilst being constrained by a centralized set of rules, process and workflows that ensure coherent, validated electronic content….”
Watch this video so you’ll understand well……
So now you know what a CMS is. There are several types of CMSs.
  • Enterprise content management systems
  • Web content management systems
  • Web group content management systems
  • Component content management system
  • Here we are going to discuss about the web content management systems. For others as well just look for this wikipedia article.
So what are the available CMSs ?
There are so many CMSs for different tasks. Joomla, Drupal, WordPress, DotNetNuke, phpNuke are some of the popular CMSs. You can see a huge list here.


Still confused?
How do they really work?
These CMSs are web applications. Written in a server programming language like php. So we’ll install them in the server and they will work like a software where we can continue developing the site.
Installing a software in the server? Oops
No no .. no need to fear. It’s not in the type u think of. Not much difficult. We’ll continue learning about Joomla in the next articles. So you would get a good knowledge and will be able to create a working web 2.0 site in minutes.



Labels:

Monday, May 2, 2011

Computer Architecture-Tutorial

Computer Architecture Video Tutorials




Computer Graphics-Tutorial

GIF ANIMATION TUTORIAL



Gif Animations can be made in a number of different ways using different software. The one above was made using two in combination - Adobe Illustrator and ImageReady, which is a part of Abobe Photoshop.
Creating an animation in this way is fairly simple and gives you a chance to see how layers work in both programs (layers are one of the most useful features in both Illustrator and Photoshop) and how ImageReady coverts layers into frames in its animation tool.
Open Illustrator and create the first image of your animation. Make sure the Layers palette is open when you can see the first layer. At the right there is small arrow. Click on it and then click on Duplicate Layer (this will be repeated for every layer you need). For this animation it is duplicated four times. Each time it was duplicated the image was increased in size 120% and the color was changed.
When the layers are done the file is both saved as an Illustrator file (.ai) - so it can be returned to for any changes that need to be made - and exported as as Photoshop file (.psd).
Open Photoshop and then on the Tool Bar go to Edit in ImageReady. Within ImageReady open the exported Photoshop file. The file will appear in three places - the primary window, the Layers palette and the Animation palette.
On the right on the Animation Palette click on the small arrow and click on Make Frames from Layers. Select the first two Frames , using the Shift key to select the second Frame. Return to the small arrow on the right, open that Menu and click on Tween - a pop-up will appear that allows for how many frames to add. In this animation three frames were added.
On the left bottom of the Animation palette there is another small arrow. It menu allows a choice of how many times the animation will repeat. For this one the number is three.
Next go to File> Save Optimized.
Insert in a web page as an image. Refresh the page to view it.


Labels:

Web Designing- Do's and Dont's


The World Wide Web is one of the three most popular applications of the Internet, along with Instant Messaging and Email. As easy as it has become to create a website, though, most novice designers still make a lot of mistakes which are simple enough to avoid if you know how.
The Web was developed as an extension of an older Internet tool called Gopher. Originally, it was used to share text data by scientists and students at colleges. The original web browsers were designed with only text in mind and could not handle anything else.

The first graphical web browser was released in 1993 by the National Center for Supercomputing Applications (NSCA). It was called Mosaic and was the prototype from which Netscape was later developed. Microsoft's browser, Internet Explorer, was also built off of this same framework. While it has been over a decade since the first graphical browsers sprang into being, the basics of how to build a good web page haven't changed much over the years.

1: Keep it Simple

The number one mistake that most web designers make is trying to be too fancy. You don't need to use every single bell and whistle available to produce a good web site. You should figure out what you are trying to do with the site first, then think about how to best push that through your design.

For instance, a lot of people have taken to adding embedded music or Flash animation to their sites. While this is all well and good if you're a musician or a Flash animator, if your site is about your vacation to Poland , all you are doing is adding to the amount of bandwidth required for browsers to show your site. Not only can this prove to be expensive for you, it can be annoying for surfers without a high speed connection. Additionally, it can be annoying, especially if your taste in music doesn't suit theirs.

The key is an acronym called KISS, or Keep It Simple, Stupid. While not implying stupidity on anyone's part, it means that you should always keep in mind that simple is better. The less complex a system, the less often it will break, the less often you will need to maintain it, and the less annoyance you will cause the people browsing your site. Any one of these reasons is a good one to follow the principle, but they come as a bundled package, making them that much better.

2: Identify Your Audience

Is the page that you are designing for consumers? Are you presenting scholarly materials to help move you towards your PhD? Are you creating an online holiday greeting card? You would use different designs for these or any of a hundred different goals. Identify what your target audience is before you start doing any work.

Once you have your target audience identified, you can focus your efforts on figuring out how to draw them. For a website on art, you would want thumbnails and full sized images to keep them interested. For a site about a particular band, you might want links to a list of concerts, interviews, sound bites, etc. The is a world of possibility available for web designers, but it has to be focused on what you're targeting, otherwise you'll never gain interest.

3: Keywords

This is an especially important step for commercial websites and other sites trying to draw in an audience. With the number of search engines available on the web today, many of them rely on specific keywords when they are searching. It's not a simple matter of having a key phrase like 'kitchen appliances' mentioned once in your page, either. They use a tool called 'keyword density' which measures the number of times that the key words or phrases appear throughout the page.

There are two mistakes that are commonly associated with keywords: not using them at all and using them too often. Not using them at all is fairly self-explanatory. Using them too much occurs when, in an attempt to create greater keyword density, you detract from the value of the content in your site. Repeating the term 'father's day gifts' fifty times on a single page would certainly cause it to register high on many search engines. But if that is all that is present on the page, no one will get any value from it.


Keywords are like a candle and surfers are like moths. You want as bright a light as possible to draw as many moths as you can. But when the moths arrive, you don't want them flapping around wondering why they bothered showing up. That brings us to the next key:


4: Content


Content is what separates the real web pages from the fake ones which are only there to produce pop ups and attempt to install spy ware and viruses. If you have followed the steps above, you already know who your audience is and have a list of key words and phrases to use. Now you need to use those two tools to develop something to show visitors to your web site.
Content can be anything at all. It can be articles (like the one you're reading now). It can be sound bites. It can be pictures of your dog. It doesn't matter what it is as long as it is relevant to the people browsing your site. It shouldn't be hard to figure out what they want once you know who your audience is. And if you've used the proper key words and phrases with the right density, you know that people will come visit your site. Content is what keeps them there and keeps them coming back.


5: Eye Catching Design


It can be difficult to draw the line between 'eye catching' and 'over the top,' but the distinction is vitally important. When you are designing a page, you want it to stand out and be noticed. But if you don't keep it simple, you run the risk of annoying the people that you are trying to entice.


The key to a good, eye catching design is subtlety. Start out by writing the page as plain as possible. Review everything and decide which parts you feel need to stand out. When going through and editing the page, do something which helps draw the eyes of someone browsing the page to those parts. Something as simple as a slight increase in font size, italics, or making a few words bold can do the job better than a lot of over the top graphics, Flash animation, etc.
By limiting the number of eye-drawing areas on your page, you will cause the parts that you have emphasized to be that much more noticeable. Additionally, you will minimize the amount of visual clutter on your page, something that often keeps browsers from returning to a site. This leads right into the subject of finding more information easily, covered in the next point.


6: Search-ability


Depending on what sort of site you are designing, you might need to have some tool in place to allow people to search it for information. There are many free search tools available, which allow administrators to integrate search engines into their pages. However, unless your site is very in depth, you might not need that much functionality.


At the very least, you should have a site map available to browsers. A site map is a simple tool that lists everything on your site in a simple manner. There are many formats used, but in general an essay-style outline, with specifics mentioned underneath general subheadings, is one of the easiest to use and write.


While it would be impossible to go over every tip and trick to designing web pages, if you follow the 6 guidelines listed above, you'll be off to an excellent start. Remember: when you're designing a web page, unless it's a purely personal one, you're not designing it for yourself. You're designing it for the people you're trying to get to read it. Put yourself in their shoes and look at it the way they would, then design for their wants and needs.


If you can look from a different perspective and focus your creative talents towards pleasing your audience, you won't go wrong. All that the tips above do is help you focus on some of the general wants, but the specifics are variable based on your target. Once you've identified, apply the same sort of process to satisfying the specific needs and the job will be done right.



Data Structures and Trees


Data structures.

The organized collection of data is known as Data Structure
Data structure = Organized data + Allowed operations
Data type = permitted Data Values + Operations.

Simple Data structure can be used as building blocks of complex data structure, Array is type of Data structure using which we can build more complex data structure. Data structure can be classified in to two different types according to three types.

1. Linear & Non-linear: which means the data stored in a sequence is called Linear, other is Non-linear (array is Linear & Tree is non-linear).

2. Homogeneous & Non-homogeneous: Which means the data structure, which contains single type of data, is known as Homogeneous & other or different. Record is a Non-Homo.

3. Static & Dynamic: This is means the allocation of memory, either static or Dynamic.:

Array is a finiteordered set of homogeneous elements stored in a contiguous memory location.

Arrays can be traversed either in Row major or Column Major order.
A Sparse array is which contains a relatively number of Zero elements.
List is a Linear data structure which contains the Homogeneous data objects. The first element in a list is called “head” and last element is known as “tail”. The element next to head is called successor and element previous to tail is known as predecessor.

Storage Allocation is done with First Fit or Best Fit method.
Storage Pools are
1. Bit tables
2. Table of contents
3. Linked Allocation.


A tree is a non-empty collection of vertices & edges that satisfies certain requirements. A vertex is a simple object (node) that can have a name and carry other associated information. An edge is a connection between two vertices.

A Tree is a finite set of a zero or more vertices such that there is one specially designated vertex called Root and the remaining vertices are partitioned into a collection of sub-trees, each of which is also a tree. A node may not have children, such node is known as Leaf (terminal node). The line from parent to a child is called a branch or an edge. Children to same parent are called siblings.

path in a tree a list of distinct vertices in which successive vertices are connected by edges in the tree. There is exactly one path between the root and the other nodes in tree.

Length is a path is a number of ranches on the path, in path from m to n, m is a ancestor of n & n is descendent of m.

Depth of any node m is the length of the path from root to m. Thus root is always at 0 depth. The Height of a node m is the longest path from m to leaf. Thus all leaves ate at heght zero. Sometime Depth is referred as level of the tree from root.

A set of tree is called forest.

Binary Tree is tree which either empty or consists of a root node & two disjoint trees called left & right sub-tree. 2-tree or strict binary tree, is a binary tree, which either contains no children or two disjoint children.

A binary tree can be implemented by a simple linked list. The number of nodes at level I is 2^I. Therefore for a complete binary tree with K levels contains k
2^I
I=0.

A binary tree can be traversed using four different algorithms

1. Inorder: Left-Root-Right.
2. Post-order: Left-Right-Root
3. Pre-order: Root-Left-Right, It employs Depth First Search.
4. Level-by-level.

Binary Search Tree is an ordered tree such that

  •  It is an empty tree
  •  Each data value in its left sub-tree less than the root value
  •  Each data value in its right sub-tree is greater than the root value.
  •  No value is duplicated at level of the tree.
  •  Left & right sub-trees are again binary search trees.


While deleting a node from a tree..

1. If node is a leaf.
2. If node is having one child
3. If node is having children.


A tree which is having a two values in its node & can have max of three branches, one values lesser than node value, second value in between of two values in node & lastly value grater than the values in node. Such type of tree is known as Multi-way tree (M-WAY).

An almost height balanced tree is known as AVL tree. Each subsequent levels will be as full as possible i.e. 2 nodes at level 2.4 nodes at level 3 and so on. In general there will be 2^L-1, where L is the level. There fore the number of nodes from level 1 to level h-1 will be
(2^h-1) –1.

So, total number of nodes n of the tree may range as (2^h-1) to (2^h) -1
Each node of AVL tree has the property that the height of the left sub-tree is, one more, equal or one less than the height of the right sub-tree. The factor is
BF =height of right sub-tree -- height of left sub-tree.
If the two sub-tree are at same height BF=0
If right Sub-tree is higher BF=+1
If left sub-tree is higher BF=-1

To balance the AVL tree keep on rotating the nodes in clockwise to have a balance tree.
A B-Tree is a balanced M-way tree. It’s also known as balanced sort tree. It finds its use in external sorting. It’s not a Binary Tree.

Conditions to be a B-Tree.

1. The height of the tree must be kept at minimal
2. There must be no empty sub-trees above the leaves of the tree.
3. The leaves of the tree must all be on the same level
4. All nodes except the leaves must have at least some minimum number of children.


B-tree of M-way properties.

1. Each node has a max of M children and a min of M/2 children or any number from 2 to max.
2. Each node has one fewer keys than children with maximum of M-1 keys.
3. Keys are arranged in a defined order within the node. All keys in the subtree to the left of a key are predecessors of the key & that on the right is successors of the key.
4. When a new key is to be inserted into a full node, the node is split into two nodes and the key with the median value is inserted in parent node. In case the parent node is the root, a new root is created.
5. All leaves are on the same level i.e. there is no empty subtree above the level of the levels.



Labels:

Operating Systems and Basics


Operating Systems and Basics

OS is system software, which may be viewed as collection of software consisting of procedures for operating the computer & providing an environment for execution of programs. It’s an interface between user & computer.


Types of Processing:


1. Serial Processing

2. Batch Processing

3. Multiprogramming.



Types of OS:

1. Batch OS
2. Multiprogramming OS


  • Multitasking/Multiprocessing
  • Multiuser OS
  • Time Sharing OS
  • Real Time OS

3. Network OS
4. Distributed OS


OS Structure:

1. Layered Structure
2. Kernel Structure

  • Create & Delete process
  • Processor scheduling, mem mgmt & I/O mgmt.
  • Process synchronization.
  • IPC help
3. Virtual Machine
4. Client Server model

Process Management

Process Status: New, ready to run, running, suspended, sleep, wait, terminate.

Types of Scheduler:

1. Long term/Job Scheduler

2. Medium term/

3. Short term/ CPU Scheduler

Processes can be either CPU bound or I/O bound.



Scheduling performance criteria:

CPU utilisation

Throughput

Turnaround time

Waiting time

Response Time



Scheduling Algorithms:

Preemptive

First-come-first served

Non-Preemptive

Shortest-job-first

Round Robin.

Priority based scheduling

Multi-level Queue

Processing the interrupt to switch the CPU to another process requires saving all the registers for the old process & then loading the registers for new process is known as Context Switching.

Synchronization & IPC

The shared storage may be in main memory or it may be a shared file. Each process has a segment of code, critical Section, which accessed shared memory or files. Some way of making sure that if one process is executing in its critical section, other process will be excluded from doing the same thing is known as Mutual Exclusion. Hardware support is available for mutual exclusion called “Test & set instruction”, it is designed to allow only one process among several concurrent processes to enter in its critical section.

Semaphore: It’s a synchronization tool, it’s a variable which accepts non-negative integer values and except for initialization may be accessed and manipulated through two primitive functions wait() & signal().

Disadvantages :

1. Semaphores are unstructured.

2. Semaphores do not support data abstraction.



Alternative to Semaphores:

1. Critical region

2. Conditional critical region

3. Monitors 

4. Message Passing



Reason for Deadlock:

1. Mutual exclusion

2. Hold & wait

3. No preemption

4. Circular condition.



Memory Management

In a single process, system memory is protected through hardware mechanism such as dedicated register called Fence register.

In a multi programming, memory can be allocated either Statically or Dynamically. Partition information is stored in partitionDescription Table. Two strategies are used to allocate memory to ready process are First Fit & Best Fit
.
Loading program into memory by relocating load or linker in a static allocation is known as Static relocation. In Dynamicmethod, run time mapping of virtual address into physical address with support of some hardware mechanism such as base register & limit registers. Protection is served by using Limit registers to restrict the program to access memory location,sharing is achieved by using dedicated common partition.

Static allocation does not support data structures like stack & queues. It limits degree of multi programming.

Compaction is a process of collecting free space in to a single large memory chunk to fit the available process. It is not done, bcoz it occupies lot of CPU time. It is only supported in Mianframe & Super Computers.

Paging is a memory management technique that permits a program’s memory to be non-contiguous into physical memory, thus allowing a program to be allocated physical memory whenever is required. This is done by Virtual Address, later these address are converted to physical address.

Memory is divided into number of fixed size blocks called Frames. The virtual address space or logical memory of a process is also broken into blocks of the same size called pages. When a program is to be run, its pages are loaded into any frame from the disk. Mapping is done thru Page Map Table which contains the base address of each page in physical memory. Hardware support is given to paging using Page Map Table Register (PMRT) which will be pointing to beginning of the PMT. Look side memory orContent addressable memory is used to overcome the problem of PMT.

Address translation is done by Associative Memory which will convert virtual to physical address by page & offset values by looking into PMT.

Segmentation is Memory management scheme its sophisticated form Address translation. It is done by Segment table, which is a important component in segmented system. Segment accessing supported by Segment Table Base register (STBR). Protection is enforced by Segment table Limit register (STLR).

Virtual memory is memory management technique which splits the process into small chunks called Overlay. First overlay will can next overlay before quitting the CPU, the remaining overlays will be on Hard disk, the swapping is done by OS. Advantages:


1. What ever the size program, memory can be allocated easily.

2. Since the swapping is done between main & secondary memory, the CPU utilization & throughput will be increased.

3. It reduces the external fragmentation & Increases the program execution speed.

IDemand paging, pages are loaded only on demand, not in advance, its same as paging with swapping feature.

Page fault occurs due to missing of page in the main memory, it means that the program is referring the address of the page which is not brought into memory.

File Management
Some systems support a single uniform set of file manipulation features for both file & I/O device management, this feature is known as Device Independent I/O or Device Independence. Printer is a one of a such example.

File organization may be

1. Byte Sequenced in which OS does not impose any structure on the file organization.
2. Record Sequenced, it’s a sequence of fixed sized records, arbitrary records read or written, but records can’t be inserted or deleted in middle of the file.
3. ISAM files are inserted in disc blocks which will have keys to inserted, its look like a tree of blocks.,

Responsibility of File Management.


1. Mapping of logical file address to physical disk address

2. Management of disk space & allocation - deallocation.

3. Keeping track of all files in system

4. Support for protection & sharing of files.



Method to access the file organized in hierarchical form. Absolute pathname & relative pathname. File & directory searching is done using


1. Linear List organization which takes O(n) comparisons to locate a file.

2. Hashing Technique

3. Balanced binary tree which takes O(log n) comparisons to locate file, it always provides sorted list files which will increase the efficiency.



Collection of tracks on all surfaces that are at the same distance is called a Cylinder.

Disk Space Management Methods:
1. Linked list
2. Bit Map

Disk allocation Methods
1. Contiguous: It supports both Sequential & Direct Accessing. Allocation is done using First Fit & Best Fit methods.

2. Linked List


Advantages:

Simple

No disk Compaction.

Disadvantages


It doesn’t support direct accessing since blocks are scattered over the disk.

Slow direct accessing of any disk block

Space requirement for pointers

Reliability



3. Indexed


Uses Index Block to support direct accessing.

Problem with same can be solved by Multiple Level indexing, indirect blocks, double indirect block.

Advantages


No external fragmentation

Efficient random access

Indexing of free space is done with Bitmap

Can keep the index of bad blocks.



Disk Scheduling
1. First come first served (FCFS)
2. Shortest Seek Time First
3. Scan Scheduling also called Elevator Algorithm

Labels: