Author Archives: invtr

Job Vacancy – Senior & Junior PHP programmer

We always looking for talented programmer to join our team, below are job requirements and scope. 

Requirements

  • must possess at least a Diploma in Computer Science/Information Technology or equivalent with
  • 3 years of working experience in the related field (for senior)
  • well verse in object-oriented PHP programming
  • familiar with any MVC framework (CodeIgniter and Laravel will be an added advantage)
  • familiar with popular databases (MySQL, MS SQL, Oracle)
  • familiar with Git
  • knowledge in any JS framework will be an added advantage
  • has knowledge in Linux operating system
  • good communication and interpersonal skill

Responsibilities

  • meet customer to gather requirements, presentation, testing etc.
  • design the system considering its speed, reliability and usability
  • develop the system  standard set by the company
  • work with testing team to ensure the quality of product

Other information

  • Work at office in Southville City (near Bangi)
  • Send latest resume with photo and expected salary

Send your resume to azwan [at] azwan.net

PHP GUI IDE

I’m looking for PHP GUI IDE and found the following. Need to study all the options.

  • http://www.scriptcase.net/
  • http://www.nusphere.com/
  • http://www.xojo.com/
  • http://www.embarcadero.com/
  • http://www.yessoftware.com/

Some on framework

  • http://laravel.com/
  • http://www.grocerycrud.com/ – one line crud

iChat problems connecting

To solve the problem, run the following to restart Bonjour service

sudo launchctl unload /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

then

sudo launchctl load /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

updated: 

Since this solution is not that practical, I ended up using Adium to online gTalk on Mac.

Script for numbered heading in Google Docs

This script to be used in google docs. It will come out numbering for heading like below

1

1.1

1.1.1

To run the script go to Tools > Script Editor…

Run the script and it will update the docs to reflect.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
function addHeaderNumbering () {
  var pars = DocumentApp.getActiveDocument().getBody().getParagraphs();
  var counterHeader = [0, 0, 0, 0, 0, 0];
 
  for(var i=0; i<pars.length; i++) {
    var par = pars[i];
    var hdg = par.getHeading();
    if (hdg == DocumentApp.ParagraphHeading.HEADING1) {
 
      _addNumberingForHeaderType(DocumentApp.ParagraphHeading.HEADING1, par, 0, counterHeader);
    } else if (hdg == DocumentApp.ParagraphHeading.HEADING2) {
      _addNumberingForHeaderType(DocumentApp.ParagraphHeading.HEADING2, par, 1, counterHeader);
    } else if (hdg == DocumentApp.ParagraphHeading.HEADING3) {
      _addNumberingForHeaderType(DocumentApp.ParagraphHeading.HEADING3, par, 2, counterHeader);
    } else if (hdg == DocumentApp.ParagraphHeading.HEADING4) {
      _addNumberingForHeaderType(DocumentApp.ParagraphHeading.HEADING4, par, 3, counterHeader);
    } else if (hdg == DocumentApp.ParagraphHeading.HEADING5) {
      _addNumberingForHeaderType(DocumentApp.ParagraphHeading.HEADING5, par, 4, counterHeader);
    } else if (hdg == DocumentApp.ParagraphHeading.HEADING6) {
      _addNumberingForHeaderType(DocumentApp.ParagraphHeading.HEADING6, par, 5, counterHeader);
    }
  }
}
 
 
function _addNumberingForHeaderType(headerType, paragraph, initIndex, counterHeader) {
  counterHeader[initIndex] = counterHeader[initIndex] + 1;
  var currCounter = _getCurrenNumbering(initIndex, counterHeader);
  for(var ii = initIndex + 1; ii < counterHeader.length; ii++) {
    counterHeader[ii] = 0;
  }
  var content = paragraph.getText();
  var chunks = content.split('.\t')
 
  var result = 'ok'
  if(chunks.length > 1) {
 
    paragraph.setText(currCounter+'.\t'+chunks[1]); 
  } else { 
    paragraph.setText(currCounter+'.\t'+chunks[0]);
  }
}
 
 
function _getCurrenNumbering(initIndex, counterHeader) {
  var value = '';
  for ( var i = 0; i <= initIndex; i++) {
    if (value) {
      value += '.';
    }
    value += counterHeader[i];
  }
 
  return value;
}

Thanks to the author. Original source here

Append 0’s in MySQL

In MySQL there is function to append character to string.

LPAD for left padding
LPAD(str,len,padstr)

RPAD for right padding

Example of usage

1
2
3
UPDATE sometable
SET FIELD = LPAD (FIELD,'5','00')
WHERE fieldid = 1