Solar Water Heaters are Magic (even in Curepipe)

Been about a week since we installed a Solar Water Heater on our house. I must say it’s awesome! Government did a really nice initiative to subsidize these equipments.

Solar Water Heater in Curepipe

A Luxury
Once the water gets heated, it stays hot for 3 days. Hadn’t tried it but there was one day there was no sun and yet the water could be used to take a bath at night.

So yeah, it is working at Curepipe in Plaine Wilhems in winter. 🙂

The Lazier, The More Modular Programmer

Might not be totally true but here’s my hypothesis: “Lazy programmers tend to code in a more modular way and do more automation.”

snapshot407I do like SQL. But don’t like to write it. So, i decided to write a class for adding/deleting/updating from database.

$sets['fname'] = 'John';
$sets['sname'] = 'Smith';
$where['sex'] = 'm';
$where['country'] = 'USA';

$db->update('users',$sets,$where);

equivalent to

UPDATE users SET fname = 'John',sname = 'Smith' WHERE sex = 'm' AND country = 'USA';

Another example of automation is when i want a clean setup of a website i’m working on. I just go on phpMyAdmin. I drop the database. The next time the engine of the website is triggered, it checks if database exists, creates it if not, runs an install script which will recreate the tables.

$db_selected = mysql_select_db($dbsettings['dbname'],$con);
if (!$db_selected) {
___mysql_query("CREATE DATABASE {$dbsettings['dbname']}",$con);
___$db_selected = mysql_select_db($dbsettings['dbname'],$con);
___// If an installer exists, we try to run it.
___if(file_exists(ROOTDIR.'inc/install.php')){
______header('Location: '.ROOTURL.'inc/install.php');
___}
}

This laziness pushed me to write a templating system in PHP for my university Web assignment so as my HTML and PHP codings are separate.

$recipes = $Recipes->get_multiple("ORDER BY timeposted DESC");
$recipelist = "";
foreach($recipes as $recipe)
_eval("\$recipelist .= \"". $templates->simple_get("gallery_recipe") ."\";");
eval("\$contents = \"".$templates->get_page("gallery_page")."\";");
eval("\$headerincludes = \"".$headerincludes."\";");
$templates->output_page($contents);

If i would been a “hard working” guy. I wouldn’t have bothered to do these extra simple things. I would have enough energy to write 100 update queries manually. Have long html codes inside PHP loops and so on..

What do you think?

Wisdom for Idiots

My theory: Wisdom at the hands of an idiot is twice as much as dangerous to a casual idiot.

I’m responsible for what I say, not for what you understand

This is in reference to the “wise quotes” people usually share on Facebook. Do you really think people /teens especially have become more mature with those wise quotes? I don’t think knives can be used as toys for any age group; neither can guns nor nuclear bombs..

// I may be an idiot too but I am afraid when others play with guns.

24Hrs vs Rs 50 Million gov.mu Website

Recently WebCup organized a competition to make a website in 24 hours. Have a look at the websites a team of 4 people had to do in 24hrs only!

  • Ceridian – http://ceridian.webcup.mu
  • Chesteroc – http://chesteroc.webcup.mu
  • Esokia – http://esokia.webcup.mu
  • Extension Interactive – http://extension-interactive.webcup.mu
  • FRCI – http://frci.webcup.mu
  • Elite Business School – http://elite-business-school.webcup.mu
  • Paperboat – http://paperboat.webcup.mu
  • TNT – http://tnt.webcup.mu
  • Team Urban Error – http://urban-error.webcup.mu
  • Wanderers – http://wanderers.webcup.mu
  • Web Thugs – http://web-thugs.webcup.mu
50 Millions government Website
50 Millions government Website

 

Now compare those to our dear 50 Million Government Website: gov.mu. If such websites can be made in 24Hrs, why did the gov.mu cost Rs 50 Million? Food for thought….