Monday, December 6, 2010

Welcome Back

Well guys check most of my projects out at the AITI-KACE git repository! @
http://projects.aiti-kace.com.gh/projects

Wednesday, May 19, 2010

Freedom Toaster!



Huraaaaiiii!!!
at long last the long awaited freedom toaster is finished...
I just finished installing and configuring Ghana's first freedom toaster...
hahaa!

U might be wondering, what is a freedom toaster?
Its a bring-and-burn facility, for disseminating FLOSS
tools and technologies in the tropics...
U know due to our small Bandwidth, getting to pull these distros
is always a problem in Africa and for that matter Ghana....

so with the help of the Shattleworth Company South-Africa, i've been able
to install and configure Ghana's first Freedom Toaster....
hahahahaha!

Want to know more? then follow me on Cody me blog for updates!.....

Mine! its perl, bash and javascript....
hahahahahha very nice combination uh? any one interested in perl can just enjoy it as much as i do.

Tuesday, May 4, 2010

Issue_1

A friend asked me this question. If u were asked this same question what will be your asnwer?

"I am trying to submit data more like a CV. ExtJS->Php->Postgres. Data collection and processing guaranteed. But as you might have already sensed, like CVs, employment records are multiple (2D). qualifications/certificates are multiple (2D), and schools attended likewise. What is your best approach to insert all these records into PGSQL in one trip - obviously considering rollbacks on errors.

I have a candidate table, and employment,certificates,schools tables - each of them with a candidate_id as foreign key.

My approach is to do a standard insert into candidate table, returning the new candidate_id and in some way, append/prepend to each of the records that I have serialized into a string of 2D matrix for each of (certificate/qualification/employment)

Within PG-SQL, I am thinking of using 'regexp_split_to_table' even though am also fancying a 'array_to_table' and 'unnest' combo, the latter supported PGSQL8.4

In all these, my greatest enemy is time and so I am thinking of a paralelizing the thinking using sharp brains like those on this BUZZ."

Issue with Coding!!

Have u ever been very unhappy about what u're writing? i mean coding?
It hurts like being asked to do what u dont want to do...I happen to be in such a mood today..
Strange? Nope i dont think so. Iam so down that i've lost ma first Love for this app... Whew! ma worrrrdd!!... grrrrrrrrr! i guess i have to relax ma self.

In fact Coding is fun, but becomes boring especially when u start and you loose the zeal along the lines. Its like musing upon the words of a Loved one... heheheh am crazy uh? thats how i see it.
It feels like listening to ya favorite music and repeating it..... hehehehehehe......yeah yeah i know! am crazy!..Now tell me ...? imagine u musiing on ya love and suddenly u findout she's just from another guy......yikes! you are gonna go blank!....."OMG!" thats what is happening to me now.

hrrrrrr! i need to rekindle ma love with ma love.!
I will and i can and i shall......

Sunday, March 14, 2010

Extjs Login

Ext.onReady(function(){
Ext.QuickTips.init();

Ext.Ajax.request({
url:'biz/index.php',
params:{service:'security',func:'start'}
});

var unm = new Ext.form.TextField({fieldLabel:'Username',name:'unm',nx:'pwd'});
unm.on('specialkey',function(f,e){ if(e.getKey() == e.ENTER) pwd.focus();});
var pwd = new Ext.form.TextField({fieldLabel:'Password',name:'pwd',inputType:'password',nx:'btn'});
pwd.on('specialkey',function(f,e){ test3 = 'pwd test'; if(e.getKey() == e.ENTER) btn.focus();});
var btn = new Ext.Button({
text:'Login',
formBind: true,
// Function that fires when user clicks the button
handler:function(){
login.getForm().submit({
method:'POST',
waitTitle:'Connecting',
waitMsg:'Sending data...',
baseParams: {service:'security',func:'login'},
success:function(f,a){
var out = a.result;
if (out.sd.gid == 1){
window.location = 'main.html';
f.destroy();
win.close();
}
else if(out.failure){
Ext.Msg.alert(out.et, out.em);
}
},

failure:function(f, a){
try{
var out = a.result;
if(out.failure)
Ext.Msg.alert(out.et, out.em);
}

}
catch(e){
res = a.response.responseText;
if(a.failureType == 'server'){
var o = Ext.decode(res);
Ext.Msg.alert('Login Failed!', o.errors.reason);
}
else
Ext.Msg.alert('Warning!', 'Authentication server is unreachable : ' + res);
}
login.getForm().reset();
}
});
}
});
// Create a variable to hold our EXT Form Panel.
// Assign various config options as seen.
var login = new Ext.FormPanel({
labelWidth:80,
url:'biz/index.php',
baseParams: {service:'security',func:'login'},
frame:true,
defaultType:'textfield',
defaults:{allowBlank:false},
monitorValid:true,
items:[unm,pwd],
buttons:[btn]
});


// This just creates a window to wrap the login form.
// The login object is passed to the items collection.
var win = new Ext.Window({
renderto:document.body,
layout:'fit',
width:300,
height:150,
closable: false,
resizable: false,
plain: true,
title:'Please Login',
border: false,
items: [login]
});
win.show();
});

Tuesday, September 22, 2009

Codes for Virtual file Carbinet( base.js)

/**
* @author aiti
* Created by Ernie and Joshua
*/
var myBase = function(){
return {
//===========Function to various .js files===================================================
loadjs: function(mni){
testthis = this;
testmni = mni;
Ext.getBody().createChild({
tag: 'script',
type: 'text/javascript',
src: 'biz/'+mni.src+'.js',
waitMsg:'Loading...'
});
},
//===========Function ends===================================================================
//===========Function to render components to viewport=======================================
renderPage: function(obj){
var page = Ext.getCmp('pgp');
if(page.current) page.remove(page.current);
page.add(obj);
page.current = obj;
page.doLayout();
},
//===========Function Ends ==================================================================
//===========Function Creates PageBar for grid ==============================================
pagebar: function(dstore,opts){
var cfg = {
store: dstore,
displayInfo: true,
width:300,
pageSize: 10
};
Ext.apply(cfg,opts);
var pb = new Ext.PagingToolbar(cfg);
return pb;
},
//===========Function Ends ===================================================================
//===========Function to generate the viewport================================================
init: function(){
viewport = new Ext.Viewport({
layout: 'border',
items: [{
region: 'north',
xtype: 'toolbar',
html: 'North',
height: 30,
items: this.mymnu()
}, {
region: 'center',
id: 'pgp',
layout:'fit',
current: false,
xtype: 'panel'
}, {
region: 'south',
xtype: 'toolbar',
height: 25
}]
});
},
//========================================viewport Ends========================================
//===========Function to generate the window-Menu==============================================
win_mnu: function(){

var w_mn = [{text:'Add'},{text:'Edit'},{text:'View'},{text:'Delete'}];
return w_mn;
},
//==========================window-Menu Ends===================================================
//===========Function to generate the window===================================================
mywin: function(ti){
if(ti.text=='Add'){
var fm = this.mpan(false);
}

var win = new Ext.Window({
width: 600,
closable: true,
constrainHeader: true,
bodyBorder: true,
title: ti.text,
resizable: false,
items: [fm,win_mnu()]
});
win.show();
},
//========================================Window Ends===========================================
//========================================panel config==========================================
mpan: function(){
//var combo ={xtype: 'combo',store:mstore,data:dt,fields:fld}
var comps = {name:'test',fieldLabel:'',allowBlank:false}
var itm = {xtype:'fieldset',columnWidth: 0.5,autoHeight:true,defaultType: 'textfield',items:[comps]}
var pan = new Ext.FormPanel({
labelWidth: 70,
//url:'login.php',
baseParams:{test:'ernie'},
frame: true,
monitorValid: true,
layout:'column',
items:[itm]
});
return pan;
},
//=====================================Panel Ends==================================================
//========================================Function to generate Main menu===========================
mymnu: function(){
var menu = [{
text: 'Organization',
handler: this.loadjs,
src: 'org'
},'-', {
text: 'Individual',
handler: this.loadjs,
src: 'ind'
},'-' ,{
text: 'Interest',
handler: this.loadjs,
src: 'interest'
},'-',{
text: 'Help',
handler: this.loadjs,
src: 'help'
},'->' ,{
text: 'Logout',
handler: function(){
var redirect = 'index.html';
window.location = redirect;
}
}];
return menu;
}
//========================================Menu Ends==================================================
}
}();//Singleton
Ext.onReady(myBase.init,myBase,true);