Warning: INSERT command denied to user 'o4077762'@'infong892.perfora.net' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:14:\"strict warning\";s:8:\"%message\";s:102:\"Declaration of views_plugin_style_default::options() should be compatible with views_object::options()\";s:5:\"%file\";s:102:\"/homepages/27/d313962189/htdocs/poon.co/sites/all/modules/views/plugins/views_plugin_style_default.inc\";s:5:\"%line\";i:24;}', 3, '', 'http://poon.co/', '', '34.232.63.94', 1679313194) in /homepages/27/d313962189/htdocs/poon.co/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'o4077762'@'infong892.perfora.net' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:14:\"strict warning\";s:8:\"%message\";s:151:\"Declaration of calendar_plugin_display_page::options_submit() should be compatible with views_plugin_display_page::options_submit(&$form, &$form_state)\";s:5:\"%file\";s:108:\"/homepages/27/d313962189/htdocs/poon.co/sites/all/modules/calendar/includes/calendar_plugin_display_page.inc\";s:5:\"%line\";i:297;}', 3, '', 'http://poon.co/', '', '34.232.63.94', 1679313194) in /homepages/27/d313962189/htdocs/poon.co/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'o4077762'@'infong892.perfora.net' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:14:\"strict warning\";s:8:\"%message\";s:104:\"Declaration of calendar_plugin_display_page::options() should be compatible with views_object::options()\";s:5:\"%file\";s:108:\"/homepages/27/d313962189/htdocs/poon.co/sites/all/modules/calendar/includes/calendar_plugin_display_page.inc\";s:5:\"%line\";i:297;}', 3, '', 'http://poon.co/', '', '34.232.63.94', 1679313194) in /homepages/27/d313962189/htdocs/poon.co/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'o4077762'@'infong892.perfora.net' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:14:\"strict warning\";s:8:\"%message\";s:105:\"Declaration of calendar_plugin_display_block::options() should be compatible with views_object::options()\";s:5:\"%file\";s:109:\"/homepages/27/d313962189/htdocs/poon.co/sites/all/modules/calendar/includes/calendar_plugin_display_block.inc\";s:5:\"%line\";i:78;}', 3, '', 'http://poon.co/', '', '34.232.63.94', 1679313194) in /homepages/27/d313962189/htdocs/poon.co/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'o4077762'@'infong892.perfora.net' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:14:\"strict warning\";s:8:\"%message\";s:163:\"Declaration of calendar_plugin_display_attachment::options_submit() should be compatible with views_plugin_display_attachment::options_submit(&$form, &$form_state)\";s:5:\"%file\";s:114:\"/homepages/27/d313962189/htdocs/poon.co/sites/all/modules/calendar/includes/calendar_plugin_display_attachment.inc\";s:5:\"%line\";i:242;}', 3, '', 'http://poon.co/', '', '34.232.63.94', 1679313194) in /homepages/27/d313962189/htdocs/poon.co/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'o4077762'@'infong892.perfora.net' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:14:\"strict warning\";s:8:\"%message\";s:110:\"Declaration of calendar_plugin_display_attachment::options() should be compatible with views_object::options()\";s:5:\"%file\";s:114:\"/homepages/27/d313962189/htdocs/poon.co/sites/all/modules/calendar/includes/calendar_plugin_display_attachment.inc\";s:5:\"%line\";i:242;}', 3, '', 'http://poon.co/', '', '34.232.63.94', 1679313194) in /homepages/27/d313962189/htdocs/poon.co/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'o4077762'@'infong892.perfora.net' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:14:\"strict warning\";s:8:\"%message\";s:151:\"Declaration of calendar_plugin_display_ical::options_submit() should be compatible with views_plugin_display_page::options_submit(&$form, &$form_state)\";s:5:\"%file\";s:113:\"/homepages/27/d313962189/htdocs/poon.co/sites/all/modules/calendar/calendar_ical/calendar_plugin_display_ical.inc\";s:5:\"%line\";i:217;}', 3, '', 'http://poon.co/', '', '34.232.63.94', 1679313194) in /homepages/27/d313962189/htdocs/poon.co/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'o4077762'@'infong892.perfora.net' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:14:\"strict warning\";s:8:\"%message\";s:134:\"Declaration of date_handler_field_multiple::pre_render() should be compatible with content_handler_field_multiple::pre_render($values)\";s:5:\"%file\";s:99:\"/homepages/27/d313962189/htdocs/poon.co/sites/all/modules/date/date/date_handler_field_multiple.inc\";s:5:\"%line\";i:185;}', 3, '', 'http://poon.co/', '', '34.232.63.94', 1679313194) in /homepages/27/d313962189/htdocs/poon.co/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'o4077762'@'infong892.perfora.net' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:14:\"strict warning\";s:8:\"%message\";s:102:\"Declaration of calendar_view_plugin_style::options() should be compatible with views_object::options()\";s:5:\"%file\";s:106:\"/homepages/27/d313962189/htdocs/poon.co/sites/all/modules/calendar/includes/calendar_view_plugin_style.inc\";s:5:\"%line\";i:173;}', 3, '', 'http://poon.co/', '', '34.232.63.94', 1679313194) in /homepages/27/d313962189/htdocs/poon.co/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'o4077762'@'infong892.perfora.net' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:14:\"strict warning\";s:8:\"%message\";s:136:\"Declaration of calendar_plugin_style_ical::init() should be compatible with views_plugin_style::init(&$view, &$display, $options = NULL)\";s:5:\"%file\";s:111:\"/homepages/27/d313962189/htdocs/poon.co/sites/all/modules/calendar/calendar_ical/calendar_plugin_style_ical.inc\";s:5:\"%line\";i:254;}', 3, '', 'http://poon.co/', '', '34.232.63.94', 1679313195) in /homepages/27/d313962189/htdocs/poon.co/includes/database.mysql.inc on line 135

Warning: INSERT command denied to user 'o4077762'@'infong892.perfora.net' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:14:\"strict warning\";s:8:\"%message\";s:102:\"Declaration of calendar_plugin_style_ical::options() should be compatible with views_object::options()\";s:5:\"%file\";s:111:\"/homepages/27/d313962189/htdocs/poon.co/sites/all/modules/calendar/calendar_ical/calendar_plugin_style_ical.inc\";s:5:\"%line\";i:254;}', 3, '', 'http://poon.co/', '', '34.232.63.94', 1679313195) in /homepages/27/d313962189/htdocs/poon.co/includes/database.mysql.inc on line 135
Lawrence Poon | a knowledge worker and lifelong learner

Cloning Ubuntu Linux VM to a Remote Site

1. Install a basic Linux on Remote Site.

2, sudo rsync -ahPHAXx
--exclude{/etc/fstab, /etc/network/*,/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found}
-e ssh / root@xxx.xxx.xxx.xxx:/

3.
sudo grub-install --recheck /dev/sdX
sudo update-grub

Lenovo Flex 10 and Ubuntu 14.10

Lenovo Flex 10 with Windows 8.1 is an interesting machine. It has a touch screen and the screen can be folded backward for 270 degree. It is a hybrid of a network and tablet.
However, in turn of performance the machine is terrible. It is very slow and sometimes even inresponsive to touch and keyboard. It is almost useless unless re-engineering it for something else.

Unleashing the power of an Acer Chromebook C710 - 2615 (Part Two)

Tagged:  

After fooling around the first two options of "Unleashing the power of an Acer Chromebook C710 - 2615 (Part One)" http://www.drupalschool.net/node/1550, I finally flashed Acer Chromebook C710 with SEABios and installed Ubuntu Studio 14.04.

The following was my journey.
1. I entered into Developer Mode, opened a terminal and followed the instructions from this site https://johnlewis.ie/custom-chromebook-firmware/rom-download/

cd
rm -f getnflash_johnlewis_rom.sh
curl -k -L -O https://johnlewis.ie/getnflash_johnlewis_rom.sh
sudo bash getnflash_johnlewis_rom.sh

Linux, Rsync and WD My Book USB 4T External Drive

The IOMEGA StorCenter ix2 that I brought for my faculty 3 years ago (http://www.drupalschool.net/node/789) somehow clashesed a few days ago. I did not have time to check out the problem as I was preparing my trip to Hong Kong next week. I brought an WD My Book USB 4T from a local Future Shop and attached the drive to my Ubuntun Desktop.

Simple Example on Pass by Reference

<?php


$a
= new A('old');
// old
$a->p();

$b = new B($a);

// now it is new
$a->p();

class
A {

  public
$var ;

  function
__construct($var){

    
$this->var = $var ;
}

  function
p(){
    echo
$this->var ;
  }

}


class
B {

  public
$a;
 
  function
__construct(A $a){

   
$this->a = $a ;
   
$this->a->var = 'now it is new';

}

}

?>

Jquery append

In Jquery, to append the value of one element to another element may not be working so smoothly if there are more than one appends and in between the appends the user changes the value of the element.

For example,

#subjects is a field which has multiple lines of values.
#selected is a autocomplete input box, when selected and entered by the user, the value of the selected element will be appended to #subjects.

However, if the user alters the values of #subjects between the appends, the process will be broken.

I found this solution. Instead of using append like

Displaying data in table

Displaying data in a table is a very frequent task for a programmer. I just wrote a very simple function called array_to_table to handle data. If you found it useful, please feel free to use it.

body {
}
input {
font-size:1.1em;
}
table.gridtable {
font-family: verdana,arial,sans-serif;
font-size:14px;
color:#333333;
border-width: 1px;
border-color: #666666;
border-collapse: collapse;
}
table.gridtable th {
border-width: 1px;
padding: 8px;
border-style: solid;

Updating Drupal Date Module

Updating Drupal modules may not always go so smoothly. Sometimes you need to disable some modules first before updating a particular module. Drupal Date module is one of the examples. I tried to update Date module from date-6.x-2.9.tar.gz to date-6.x-2.10.tar.gz.
First I backup the original 'date' folder to date_16april2014 and then 'tar xvzf date-6.x-2.10.tar.gz and I reload this Drupal Site. You know what it gave me a blank page. it is scary, isn't it? I promptly removed 'date' folder and hoped my Drupal site came to live again. No, it wasn't.

Heart Bleed Bug

After knowing a bug called "Heart Bleed Bug" was found in OpenSSL, I updated the OpenSSL on my Red Hat Linux server to openssl-1.0.1e-16.el6_5.7.x86_64. After the updating, my Apache failed to start and the following message appeared:
Address already in use: make_sock: could not bind to address 0.0.0.0:443
It turned out during the updating, ssl.conf and auth_cas.conf were created on my

Exploring PDO

Using mysql_connect() to connect to MySQL is easy, but it has many drawbacks. If your application uses another backend storage, you need to change the database function, for example, from mysql_connect pgsql_connect. A more important issue is it does not protect attacks from SQL Injection. These are the main reasons I started to explore PDO in my future PHP/MySQL projects.
I will rewrite my Generic Object with PDO later.
http://www.drupalschool.net/node/785
<?php

$database = new Database();
$db = $database->getDB();

$sql = 'select * from Users';
$stmt = $db->query($sql);

Syndicate content