Posts

Showing posts from June, 2015

C++: Controlling the Decimal places to be shown

While dealing with some scientific calculations, I came across a problem that no of digits that were represented after the decimal were not as per the in-file(8 digits). It was only taking 4 digits after the decimal. I had gone through various forums and discovered <iomanip>. IOMANIP  is a header file that is being used to represent the number of decimal places to be used. #include<iomanip> void main() {         cout<<setiosflags(ios::fixed)<<setprecision(8);         ......         ......         ...... } Using the above code you can represent as many digits you want to represent after the decimal.

Check Your Website Particular Section Execution Time In codeigniter

CodeIgniter has a Benchmarking class that is always active, enabling the time difference between any two marked points to be calculated. For using the Benchmark Class you have to : Mark a start point Mark an end point Run the "elapsed time" function to view the results Here's the example of the code $this->benchmark->mark('code_start'); // Some code happens here $this->benchmark->mark('code_end'); echo $this->benchmark->elapsed_time('code_start', 'code_end'); For reference please use thebelow link https://ellislab.com/codeigniter/user-guide/libraries/benchmark.html

Create a log of your Database Queries that are getting executed while running a application written in Codeigniter

First of all enable the hooks from your config file . Just Open the config.php in you application/cofig folder $config['enable_hooks'] = TRUE; Now open the hooks.php and write down the code $hook['post_controller'] = array( // 'post_controller' indicated execution of hooks after controller is finished 'class' => 'Db_log', // Name of Class 'function' => 'logQueries', // Name of function to be executed in from Class 'filename' => 'db_log.php', // Name of the Hook file 'filepath' => 'hooks' // Name of folder where Hook file is stored ); Now we will create the hook with name db_log.php which we have set above and save it in application/hooks/ folder. Then we simply put the following code in this file. // Name of Class as mentioned in $hook['post_controller] class Db_log { function __construct() { // Anything except exit()

How To Design Email In html News letter

The biggest pain when coding HTML email is that so many email services likeEudora, Outlook, AOL, Thunderbird, Lotus Notes, Yahoo!, Hotmail, and Google Mail, to email apps on phones and tablets. The software used to render HTML for each email software tool determines what HTML and CSS code works and doesn’t work. If you thought it was difficult to ensure the cross-browser compatibility of your web sites, be aware that this is a whole new game — each of these email software tools can display the same email in vastly different ways. And even when these tools do display an HTML email properly, accounting for variances in, for example, the widths at which readers size their windows when reading emails makes things even trickier. http://www.sitepoint.com/how-to-code-html-email-newsletters/

Codeigniter slug library for making Url seo friendly

Codeigniter Slug Library With the Help of thi s library you should convert your codeigniter websites URL as Seo friendly examples are mysite.com/post/my-post-title Please note that these fields map to your database table fields.