Tuesday, March 17, 2009

Limewire 5 for Ubuntu

Just found out that there is a limewire version 5 for Ubuntu and guess what, its a .deb file.

I tried it, its pretty cool. I like the interface.

Its a torrent file. So just go to http://btjunkie.org/torrent/LimeWire-5-0-11-Pro-Linux-Ubuntu-Debian-HeartBug/41146c4054941a2493fd226f491e870560d5ec67851b and download the limewire for Ubuntu.

I use gnutella. I mostly download files using torrents. My favourite sites, isohunt.com, mininova.org and btjunkie.org.

Enjoy!!!

Friday, March 13, 2009

Past data between a popup and mask while popup is open

i was able to simulate the digicel page that sends text messages to your contacts. on clicking on one of your contacts, it passes that name to a specific area. if you try to add the same name, it gives a javascript alert that lets you know that the contact was already added to the area to be sent a text message.

the code is below:

class popup_horses extends P4A_Mask {

var $selected_horses;
var $p4a;

function popup_horses(){

parent::p4a_mask();

$this->selected_horses = array();
$this->p4a = & p4a::singleton();

$this->checkIfHorsesWerePreviouslyAdded();

$page = & $this->showPage();

$this->intercept($this->Tbl->rows, 'afterClick', 'validatedSelectedHorse');
$this->display('main', $page);
}

function addPreviouslySelectedHorseNamesToArray(){

$horse_names = $this->getAllPreviouslyAddedHorseNames();
$temp_array = explode(',', $horse_names);

foreach ($temp_array as $temp){
array_push($this->selected_horses, trim($temp));
}
}

function checkIfHorsesWerePreviouslyAdded(){

if($this->isHorseAreasEmpty() == false){
$this->addPreviouslySelectedHorseNamesToArray();
}
}

function getAllPreviouslyAddedHorseNames(){
return $this->p4a->masks->parent_mask->taHorses->getNewValue();
}

function addSelectedHorseToArray($horse_name){
array_push($this->selected_horses, $horse_name);
}

function addSingleHorseToArea($horse_name){
$p4a = & p4a::singleton();
$p4a->masks->youtube_channel_archive->taHorses->setNewValue($horse_name);
}

function addHorseToAreaWithSeparator($horse_name){

$p4a = & p4a::singleton();
$horse_area_value = & $p4a->masks->parent_mask->taHorses->getNewValue();
$horse_area_value .= ", $horse_name";
$p4a->masks->parent_mask->taHorses->setNewValue($horse_area_value);
}

function validatedSelectedHorse(){

if(in_array($this->fields->horse_name->getNewValue(),$this->selected_horses)){
$this->showMessage("Horse already added", "warning");
} else {
$this->addSelectedHorseToArray($this->fields->horse_name->getNewValue());
if($this->isHorseAreasEmpty()){
$this->addSingleHorseToArea($this->fields->horse_name->getNewValue());
} else {
$this->addHorseToAreaWithSeparator($this->fields->horse_name->getNewValue());
}
}
}

function isHorseAreasEmpty(){

$p4a = & p4a::singleton();
if($p4a->masks->parent_mask->taHorses->getNewValue() == ""){
return true;
} else {
return false;
}
}

function validateForm(){

if(!p4a_validate::notempty($this->fields->distance->getNewValue())){
$errorMsg = "Please enter distance for race
";
}

if(!empty($errorMsg)){
$this->showMessage($errorMsg, 'warning');
} else {
$this->updateTableData();
}
}

function updateTableData(){

$track_record = & p4a::singleton('tract_record');

$this->saveRow();
if($this->setLastUpdated()){
$track_record->closePopup();
} else {
//$this->showMessage("Table data NOT modified!", "error");
}
}

function setLastUpdated(){

$dbObj = & p4a_db::singleton();
$today = & date('Y-m-d h:i:s');
$record_id = & $this->fields->distance_id->getNewValue();

//echo
$update = "
update race_distance
set date_modified = '$today'
where distance_id = $record_id;
";

if($dbObj->query($update)){
return true;
} else {
return false;
}
}

function createTable() {

$Tbl = & $this->build('p4a_table', 'Tbl');
$Tbl->setSource($this->createDBSource());
$Tbl->setVisibleCols(array('horse_name'));
$Tbl->showNavigationBar();
$Tbl->setWidth(400);
$Tbl->setTitle('Horse Name');
return $Tbl;
}

function createDBSource() {

$limit = 13;
$Src = & $this->build('p4a_db_source', 'Src');
$Src->setFields(array(
'horse.*'=>'*'
));
$Src->setTable('horse');
$Src->setWhere("");
$Src->setPk('horse_id');
$Src->addOrder('horse_name');
$Src->setPageLimit($limit);
$Src->load();
$this->setSource($Src);
return $Src;
}

function doReloadParentMask(){
$p4a = & p4a::singleton();
$parent = & p4a::singleton('track_record');
$parent->destroy();
$p4a->openMask('track_record');
}

function createEditor(){

$distance = & $this->fields->distance;

$btnAdd = & $this->build('p4a_button', 'btnAdd');
$btnAdd->setLabel('Add distance');
$this->intercept($btnAdd, 'onClick', 'validateForm');

$fsEditor = & $this->build('p4a_fieldset', 'fsEditor');
$fsEditor->anchor($distance);
$fsEditor->anchor($btnAdd);
$fsEditor->setWidth(350);
$fsEditor->setTitle('Race Distance Information');

return $fsEditor;
}

function doRefreshOriginalPage(){
$p4a = & p4a::singleton();
$this->destroy();
$p4a->openPopup($this->getName());
}

function showMessage($message, $icon){
$this->message->setValue($message);
$this->message->setIcon($icon);
$this->message->setWidth(500);
}

function showPage(){

$message = & $this->build('p4a_message', 'message');

$this->createDBSource();
$tableData = & $this->createTable();

$leftSide = & $this->build('p4a_frame', 'frmLeft');
$leftSide->anchor($tableData);

$frmPage = & $this->build('p4a_frame', 'frmPage');
$frmPage->anchorCenter($message);
$frmPage->anchor($leftSide);
$frmPage->setWidth(450);
return $frmPage;
}
}
?>

hope someone was able to understand this and it was what someone wanted to do what they wanted to do.

Solved!!!!!!!!!! Reload mask from popup

I solved it!!!!!!!!! yay me!!!!!!!! :) after days if not weeks of trying to figure out what i was doing wrong, i figured it out. it was a matter of placement with the code (below) i had.

after i saved the record, i was trying to reload the mask that called the other mask and it wouldnt work. I figured that that was because it was the parent mask and it was still active - the child mask was still open. so i saved the record, closed the child mask and then reload the parent mask. i didnt see it that way before.

Code snippet
$this->saveRow();
if($this->setLastUpdated()){
$this->p4a->closePopup();
$this->destroy();
$this->p4a->masks->records->doRefreshOriginalPage();
}

i think i have published the code for the doRefreshOriginalPage some time ago on my blog.

it works!!!!!

Thursday, March 12, 2009

cp: omitting directory

ok. I was trying to copy some fonts to the fonts folder on my ubuntu laptop but kept on getting an 'cp: omitting directory' error. What causes this problem? The folder has files in it and therefore needs to be able to copy the contents of the file also. To do this the -r (recursive) flag is needed to copy the contents of the file.

If you are having this problem, this is how the command should look:

sudo cp -R [directory you are copying from] [space] [directory you are copying to]

Error: SAFE MODE Restriction in effect. Ubuntu Intrepid Ibex

I was working on a new application which I will remain nameless, and I was having a strange error, one that I dont normally have at the beginning of a new application. This was the error:
So after going through all the things I thought I had done to cause that error, nothing worked so I went to my bed. When I was walking to work the next day, it hit me "safe mode". So after reaching work, the first thing I did was look for the php.ini file and check to see if safe_mode was on. Did I mention I was using ubuntu intrepid ibex? I am. :) It was. I turned it off and the error went. For those people who do not know where the php.ini file it, it is located here: /etc/php5/apache/. After turning safe_mode on or off, you will need to restart your apache apache. The commands to stop, start and restart your apache server are as follows: sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 start
sudo /etc/init.d/apache2 restart.

Hope that solves someone's problem.

Sunday, March 8, 2009

My resume

Jerome A. Bailey

Objective

To be employed in a dynamic organization as an application developer and/or web developer.

Summary

  • Excellent written and verbal communication skills

  • Over 1 year’s experience in web development

  • Strong back end developer with wide skill set

  • Object Oriented PHP 5 web developer

  • PHP, MySQL, Linux, MVC, Zend, P4A, WAMP, and LAMP toolset

Skills

Professional

Web development / Programming, Database Design, Content Management System (CMS) Design.

Technologies

Linux (Ubuntu 8.10 - Intrepid Ibex, 8.04 - Hardy Heron), Windows (95-98, 2000, xp, vista), Java, C, C++, Prolog, SQL, VB .NET, MySQL, ASP .NET, PHP (3, 4 and 5), CSS, XML, WML, AJAX, DHTML, and JavaScript, Zend Framework, MVC (Model, View, Control) P4A (Php for Application), Adobe Photoshop, GIMP.

Applications

Zend Studio Editor, Microsoft FrontPage, Adobe Dreamweaver, Microsoft Excel, Microsoft Word, Microsoft Visio, Microsoft Access, Microsoft Publisher, Notepad.


Professional experience

Contract PHP Application / Web Developer

Chrysalis Communications

November 2008 - Present

Gained and applied knowledge and experience in the building of dynamic websites and applications of various sizes and levels of difficulty. Includes front end web site design, database design, backend development using open source toolset (PHP, MySQL, Linux), front end development with HTML, CSS, AJAX and JavaScript.

PHP Application / Web Developer

au Fait eSolutions

May 2007 – September 2008

Gained a lot of knowledge and experience designing dynamic web sites with the use of PHP, MySQL, HTML, DHTML, CSS and JavaScript. I also assisted with the design of customizable client databases and Content Management Systems (CMS). Designed dynamic web applications with the use of the Zend Framework, and P4A (PHP for Applications).

Education

BA in Computing and Information Technology, 2007

The University of Technology, Jamaica

Additional information

Hobbies include Basketball, Badminton, Chess, playing bass guitar and drums.

References

References can be made available upon request.

Tuesday, March 3, 2009

Reload mask from popup

I have written a module to open a mask (p4a) and add a field value but on adding the value successfully, i want to call the module to reload the mask but it is not working. :(

Monday, March 2, 2009

Informatin Management System created by Me using the P4A framework!!!


login screen of the ims


view of the inside.

its user friendly - quiet easy to add and edit contact. It even allows the user to upload a photo of the contact

Refresh Button with custom code for P4A Applications

I have been using p4a for over a year now and have created several custom codes to do little helpful things whle developing applications in it. One such thing is to create a button that will refresh the mask instead of clearing the cookies using the firefox web developer toolbar. This is a screen shot with the button.


I added the code to refresh the mask here: https://sourceforge.net/forum/message.php?msg_id=6595951 but I have included it below.

The function to create the toolbar is below:

function createToolBar() {

$toolbar = & $this->build('p4a_simple_toolbar', 'toolbar');
//$toolbar = & $this->build('p4a_simple_toolbar', 'toolbar');
$toolbar->buttons->save->setLabel('Save');
//$toolbar->addLabel($toolbar->buttons->save, 'Save Content');
//$toolbar->buttons->save->setTitle('Save Content');
$toolbar->buttons->new->setLabel('New');
$toolbar->buttons->delete->setLabel('Delete');
$toolbar->buttons->print->setLabel('Print Information');
$toolbar->buttons->cancel->setLabel('Cancel');

$toolbar->addSeparator('left');
$refreshMaskDefault = & $toolbar->addButton('refreshMaskDefault', 'reload', 'left');
$refreshMaskDefault->setLabel('Refresh Page');

$this->intercept($refreshMaskDefault, 'onClick', 'doRefreshOriginalPage');

$toolbar->setMask($this);
return $toolbar;
}

The function to refresh the maks is below:

function doRefreshOriginalPage(){
$p4a = & p4a::singleton();
$this->destroy();
$p4a->openMask($this->getName());
}

Anyone can add their image to the button but just use the code and refresh the mask without clearing the cookies. If there are any modifications to the code you can let me know. :) I am open to it.