Getting Started with CodeIgniter

CodeIgniter gives you the ability to write PHP code quickly and effectively while Twitter Bootstrap allows you to create interfaces quickly without needing to style primary elements. However, the two are not combined and certain things between CodeIgniter and Twitter Boostrap do not play nicely. With CodeIgniter Bootstrap, it allows you to skip this “combination” phase and have you start developing your idea instead of developing the common web elements.

Getting Started

Of course the first step is to download the codeigniter framework. You can download the latest stable version of codeigniter from the following url http://codeigniter.com/downloads/ . It will be a compressed file (zip file) whcih will be downloaded, just unzip it and keep it in a folder, say codeigniter. Make sure you keep it inside the htdocs or webserver’s directory.

Not its time to configure the codeigniter which initial settings to start working on. To do so, open the file config.php in to your favorite editor. The file resides inside system/application/config directory. You will see an array called $config which stores all the configuration information, we will change only the following values and leave the rest as it is.

/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
*/
//don't forget the TRAILING slash (/)
$config['base_url']	= "http://localhost/codeigniter/";

Trust me, that shall be all to get you started. Some blogs/sites have show much changes in this file, but you can play around with them when needed. You can change a lot about your application form this single file. Like you can store the session information inside a database, by simple setting up the config var $config[‘sess_use_database’] as TRUE, which is FALSE by default. You can also change the name of the session table from default “ci_sessions” to anything you like.

Python Multithreading Guide

In software programming, a thread is the smallest unit of execution with the independent set of instructions. It is a part of the process and operates in the same context sharing program’s runnable resources like memory. A thread has a starting point, an execution sequence, and a result. It has an instruction pointer that holds the current state of the thread and controls what executes next in what order

Python Multithreading – Pros:

  • Multithreading can significantly improve the speed of computation on multiprocessor or multi-core systems because each processor or core handles a separate thread concurrently.
  • Multithreading allows a program to remain responsive while one thread waits for input and another runs a GUI at the same time. This statement holds true for both multiprocessor or single processor systems.
  • All the threads of a process have access to its global variables. If a global variable changes in one thread, it is visible to other threads as well. A thread can also have its own local variables.

Python Multithreading – Cons:

  • On a single processor system, multithreading wouldn’t impact the speed of computation. In fact, the system’s performance may downgrade due to the overhead of managing threads.
  • Synchronization is required to avoid mutual exclusion while accessing shared resources of the process. It directly leads to more memory and CPU utilization.
  • Multithreading increases the complexity of the program thus also making it difficult to debug.
  • It raises the possibility of potential deadlocks.
  • It may cause starvation when a thread doesn’t get regular access to shared resources. It would then fail to resume its work.

How To Use The Threading Module To Create Threads

The latest <threading> module provides rich features and greater support for threads than the legacy <thread> module discussed in the previous section. The <threading> module is an excellent example of Python Multithreading.