As a programmer, there are no real problems but challenges...ones that we need to overcome. This means that there is a solution for all challenges that one may face. For all the challenges that I have faced, I will share them and their solutions.
Wednesday, December 9, 2009
Wednesday, December 2, 2009
Monday, November 30, 2009
notes from learning mysql stored procedures
Stored procedures advantages
Stored procedure increases performance of application. Once created, stored procedure is compiled and stored in the database catalog. It runs faster than uncompiled SQL commands which are sent from application.
Stored procedure reduced the traffic between application and database server because instead of sending multiple uncompiled long SQL commands statement, application only has to send the stored procedure name and get the result back.
Stored procedure is reusable and transparent to any application which wants to use it. Stored procedure exposes the database interface to all applications so developer doesn’t have to program the functions which are already supported instored procedure in all programs.
Stored procedure is secured. Database administrator can grant the right to application which to access which stored procedures in database catalog without granting any permission on the underlying database table.
Beside those advantages, stored procedure still has its own disadvantages which are bellow
Stored procedures disadvantages
Stored procedure make the database server high load in both memory for and processors. Instead of being focused on the storing and retrieving data, you could be asking thedatabase server to perform a number of logical operations or a complex of business logic which is not the role of it.
Stored procedure only contains declarative SQL so it is very difficult to write a procedure with complexity of business like other languages in application layer such as Java, C#, C++…
You cannot debug stored procedure in almost RDMBSs and in MySQL also. There are some workarounds on this problem but it still not good enough to do so.
Writing and maintain stored procedure usually required specialized skill set that not all developers possess. This introduced the problem in both application development and maintain phrase.
this is how a stored procedure is called -DELIMITER // - changes the delimiter to //
CREATE PROCEDURE GetAllProducts() -GetAllProducts()
is the name of the stored procedure.BEGIN - tells the start of the procedure's workings
SELECT * FROM products; - the actual procedure
END //- changes the delimiter to //
and tells the end of the procedureDELIMITER ; - changes back the delimiter to a semicolon
CALL STORED_PROCEDURE_NAME()
a variable is instantiated in a stored procedure this way: declare variable_name data type(size) default value. eg declare totalProducts int default 0
multiple variables with the same data type can be declared together. eg. declare x, y int default 0
there are two ways to assign values to variables:
1 - using the set keyword - set totalProducts = 39;
2 - using select... into - select count(*) into totalProducts from products
variables have scopes which determine their life span.
variables with an @ are session variables and have a life span until the end of the session.
variables have modes: in, out, inout
to be continued
blackbery security
do you see a problem with that? i do. if my phone gets stolen or lost, all someone will have to do is to enter the incorrect password 10times or the maximum amount of times and then they would be able to use the phone. i thought the phone would be locked but alas, thats not the case. so if this information gets into the hands of some people, it would be detrimental to alot of others in the bb world :)
Friday, November 27, 2009
Zend Studio opens with no menu
Symptoms
When running Zend Studio:
1. The ZS's main window comes up totally empty.
2. Sometimes the window has some of the frames painted, but the rest of the window is empty.
3. In the empty ZS window the mouse cursor is changing while moving around the window (as if there are objects: like buttons and other objects).
4. There were erratic mouse/window movements reported.
Summary
Zend Studio starts up with various windowing GUI problems in some linux distros, while using the XGL-Compiz/Beryl product.
Cause
1. Incompatibility between the XGL environment, the JRE, and the Zend Studio Client.
2. The decoration in the 3D environment clashes with the Java Runtime and distorts the operation and visualization of the Zend Studio client's window.
Workaround
There are two ways to execute Zend Studio, by running the ZDE script, and by running the runStudio_unix.sh script, both are in the bin directory of zend studio
(usually /usr/local/Zend/ZendStudio-/bin)
The following workarounds may be used, but there is no guarantee how well or how long it might work for you in your environment.
modification of ZDE script for xgl:
1. Open your ZDE script with your favorite editor
2. add the next line of code at line 1693.
options="$options -Dawt.toolkit=sun.awt.motif.MToolkit"
for example:
1693:
1694: debugOut ""
1695: unset POSIXLY_CORRECT
1696: if [ $DO_NOT_FORK ]
becomes:
1693: options="$options -Dawt.toolkit=sun.awt.motif.MToolkit"
1694: debugOut ""
1695: unset POSIXLY_CORRECT
1696: if [ $DO_NOT_FORK ]
3. Save the file.
modification of runStudio_unix.sh script for xgl:
1. open the the file in your favorite editor.
2. modify the java execution line,
the line starts with: ../jre/bin/java -Xms16m -Xmx256m -cp...
change it to: ../jre/bin/java -Dawt.toolkit=sun.awt.motif.MToolkit -Xms16m -Xmx256m -cp...
^^^^^^^^^^^^^^^^^^^^^^^^^^
as you can see, the only difference is an extra parameter to the java program.
3. Save the file.
Another solution
the AWT_TOOLKIT environment variable can be set in order for Java to choose a working AWT Toolkit.
export AWT_TOOLKIT="MToolkit"
In most Linux Distributions it's enough to append this line to /etc/profile.
Older Girls Party
wow. arent these "young" girls having fun, sticking things in holes, running, etc. i wonder what the other activities were? hmm. :)
Wednesday, November 25, 2009
gimp save for web plugin
for ubuntu users, download the Ubuntu deb archive of 0.28.4 file.
Monday, November 23, 2009
Clear textarea default value
onfocus="if(this.value==this.defaultValue){this.value='';}" onblur="if(this.value==''){this.value=this.defaultValue;}"
Thursday, November 19, 2009
Wednesday, November 18, 2009
p4a alphabet sorter with text search
function textSearchWithcreateAlphabeticalSorter(){
$alphabet_array = array();
$alphabet_array[] = 'A';
$alphabet_array[] = 'B';
$alphabet_array[] = 'C';
$alphabet_array[] = 'D';
$alphabet_array[] = 'E';
$alphabet_array[] = 'F';
$alphabet_array[] = 'G';
$alphabet_array[] = 'H';
$alphabet_array[] = 'I';
$alphabet_array[] = 'J';
$alphabet_array[] = 'K';
$alphabet_array[] = 'L';
$alphabet_array[] = 'M';
$alphabet_array[] = 'N';
$alphabet_array[] = 'O';
$alphabet_array[] = 'P';
$alphabet_array[] = 'Q';
$alphabet_array[] = 'R';
$alphabet_array[] = 'S';
$alphabet_array[] = 'T';
$alphabet_array[] = 'U';
$alphabet_array[] = 'V';
$alphabet_array[] = 'W';
$alphabet_array[] = 'X';
$alphabet_array[] = 'Y';
$alphabet_array[] = 'Z';
$frmeAlphabet = & $this->build('p4a_frame', 'frmeAlphabet');
$name = & $this->build('p4a_field', 'txtName');
$name->setLabel('Horse Name');
$name->addAction('onReturnPress');
$this->intercept($name, "onReturnPress", "searchHorses");
foreach ($alphabet_array as $letter){
//echo $letter;
//echo 'btn'.$letter;exit;
$btn = & $this->build('p4a_button', 'btn'.$letter);
$btn->setLabel($letter);
$btn->setValue($letter);
$btn->setBgcolor('white');
$btn->setStyleProperty('border', '0');
$frmeAlphabet->anchorLeft($btn);
//$btn->addAction('onClick');
$this->intercept($btn, 'onClick', 'sortBySelectedButtonValue');
}
$frmeMain = & $this->build('p4a_frame', 'frmeMain');
$frmeMain->anchor($name);
$frmeMain->anchor($frmeAlphabet);
return $frmeMain;
}
function searchHorses(){
$horse_name = & $this->txtName->getNewValue();
$where = " 0=0 and horse_name like '%$horse_name%'";
$this->horseSrc->setWhere($where);
}
function sortBySelectedButtonValue($letter){
//echo $letter->getValue();
$selectedLetter = $letter->getValue();
//echo $this->getActiveObject();exit;
//$query = "select * from horses where 0=0 and horse_name like '$selectedLetter%'";
$where = "0=0 and horse_name like '$selectedLetter%'";
//$this->horseSrc->setQuery($query);
$this->horseSrc->setWhere($where);
//$this->horseSrc->setWhere($query);
}
Monday, November 16, 2009
Google's interview brain teasers
Why Google Employees Quit
Read more here
Wednesday, November 11, 2009
remove hiberfile on windows partition from ubuntu
sudo mount -t ntfs-3g /dev/sda1 /media/sda1/ -o remove_hiberfile
if it works you should see something like this:
The disk contains an unclean file system (0, 0).
The file system wasn't safely closed on Windows. Fixing.
Monday, November 9, 2009
are you going to finish strong
http://www.maniacworld.com/are-you-going-to-finish-strong.html
Friday, November 6, 2009
44: php: not found
Monday, October 26, 2009
ubuntu batch renaming
Sunday, October 11, 2009
holy ghost gym review
didnt like the video. i think that these people that produce videos or even coreograph videos in jamaica need help. yes, it tried to convey the message of "gym" and "God" and excercising as it relates to practising of the word but i think the video could have been done differently. at one point, the scenes of them on the mat moving was switching scenes like the lights of a disco in a night club. why?
at the beginning of the video, the girl says, take one but at the same time, d.j. nicholas was already sweating... hmmm
whats up with the umbrellers? if you are working out, thats what you should do but you cyaa.... sorry. im mixing patois and english, i do not think that you be working out and at the same time holding up an umbrella to shade from the sun.
the lyrics were ok. i have grown to expect good lyrics from nicholas. keep that up.
the lady that was adding the thing to the song, what was that???
the ad that was saying, lose sin for free was good. you do not need a credit card, all you need to do is to practise what the word of God says. Good.
i think overall, it was an ok video. i would have done things differently to bring out the same message though.
thinking of going into music video production... if and when i do, hopefully you will see a different in the production of videos from Jamaica.
Monday, October 5, 2009
passing variables in p4a between masks
function menuClick(){
$this->openMask($this->active_object->getName());
}
here is how it is used:
$users = $control_panel->addItem('users')
->setLabel('Users')
->implement('onclick', $this, 'menuClick');
to change the state of the mask, i had to add a line to the menuClick function so that it clears it and displays the correct function.
function menuClick(){
$this->getPrevMask()->destroy();
$this->openMask($this->active_object->getName());
}
if a menu is not used to open a mask then when switching between mask you would only have to use one line in the function, $this->destroy();
hope it is understood and can help someone.
Wednesday, September 30, 2009
capture form post in ie using php
if( $_POST['nameOfTextboxt'] || ( $_POST["buttonType"] == "nameOfButton" ) && ( count( $_POST > 0 ) ) ) {
//var_dump( $_POST );exit;
// do whatever you want to do
}
this worked for me
Sunday, September 27, 2009
window positions on ubuntu
http://ubuntuforums.org/showthread.php?t=19413
switched back to the ubuntu theme
the closest i came to owning a mac was the mac theme i had on my laptop. it was ok, looked good but i grew tired of it after a while and as usual, wanted something new. so i removed it and now im back to the original look of ubuntu. its not that much of an eye candy but thats not why i am using it.
Linux Distro Test
http://polishlinux.org/choose/quiz/
http://www.zegeniestudios.net/ldc/index.php
my opinion, i would recommend, ubuntu. it has a nice user interface and its pretty easy to use and learn.
Saturday, September 26, 2009
hibernation on linux
Friday, September 11, 2009
Thursday, September 10, 2009
free fonts!!!!
Wednesday, September 9, 2009
javascript only numbers in textbox
Monday, September 7, 2009
php number of days in month
Tuesday, September 1, 2009
Sunday, August 16, 2009
Undefined video mode number
1. open your menu.lst file by opening your terminal and typing: gksudo gedit /boot/grub/menu.lst
2. change statement that says vga=xxx with vga=normal
3. reboot
Saturday, August 15, 2009
ubuntu reset mysql password
Sunday, August 9, 2009
access buttons on a p4a field with type file
God please give me an answer like you always do?
thanks
time period: one day
Monday, July 27, 2009
problem solved
my problem was that the images were only going in the tmp folder and not in the uploads folder. so after numerous nights, i finally stayed up and was determined to make it work before i went to bed and that i did. it was alot of work but it payed off. i now know why it happened and how to fix it.
after reading the forum and different posts several times, with the toolbar, it does the moving of the image on saveRow(). I had created my own field and therefore wasnt using the save button on the toolbar. so i had to intercept the field when i was doing the save to the db and move the file myself.
the code is posted below:
$filename = $this->newProductImage->getNewValue();
$uploaded_tmp_filename = P4A_UPLOADS_DIR.$this->newProductImage->getNewValue(1);
$uploaded_filename = P4A_UPLOADS_DIR."/".$this->newProductImage->getNewValue(0);
$sequence = $this->imageSequence->getNewValue();
$product_id = $this->dbSourceProduct->fields->oid->getNewValue();
if( file_exists( $uploaded_tmp_filename ) ) {
$sql = "
insert into Image
values ('', '$filename', $sequence, $product_id);
";//exit;
if( P4A_DB::singleton()->query( $sql ) ){
if(!copy( $uploaded_tmp_filename, $uploaded_filename )){
$this->showMessage( "Error uploading file", "error" );
} else {
$this->showMessage("Image was successfully added", "applied");
//$this->doRefreshOriginalPage();
}
}else {
$this->showMessage("Image was not added", "error");
}
} else {
$this->showMessage("File not uploaded", "error");
}
Wednesday, July 22, 2009
sql string replace
update tableName set
columnName = REPLACE(columnName, substr(columnName, 8, 7),'newStringValue');
Thursday, July 16, 2009
michaels jackson's hair on fire
this is the video from cnn with michael jackson's hair on fire. i guess that this prompted him to start wearing the wig
Wednesday, July 15, 2009
michael jackson and his skin disorder
well, he, michael, has said it on oprah and i think that it is conclusive enough. its a learning lesson for me. as the girl said in the video, we have the tools to research what we want to find out, lets do that. dont just take what the media says, find out for ourselves.
Tuesday, July 14, 2009
the michael jackson cover up
i honestly will have to look at the scriptures and get the actual intended meaning of the passage. i dont know about the U.S.A being totally or apart of what would form the beast of the world. i guess the way to find out is if one knows alot about the U.S.A and and therefore match it with what the Bible says because the Bible would give a clear description of what the beast would be. i think i have some research to do.
Monday, July 13, 2009
Sunday, July 12, 2009
opening salution for cover letter
http://www.ego4u.com/en/cram-up/writing/business-letter/salutation
If you don't know the person's name:
There are several possibilities to address people that you don't know by name:
salutation | when to use |
---|---|
Dear Sir / Dear Sirs | male addressee (esp. in British English) |
Gentlemen | male addressee (esp. in American English) |
Dear Madam | female addressee (esp. in British English) |
Ladies | female addressee (esp. in American English) |
Dear Sir or Madam | gender unknown (esp. in British English) |
Ladies and Gentlemen | gender unknown (esp. in American English) |
To whom it may concern | gender unknown (esp. in American English) |
Saturday, July 11, 2009
Exhortation on Psalm 46
1.Refuge – a place that one can go to for coverage, safety, security, and comfort.
Strength – God's word, promises and the victories that He has helped you to win, can provide that spiritual, physical edge that you need to stand, complete a task or even to commit acts of devotion to God; going to church and reading His words.
God is indeed omni-present but the psalmist was reminding us that when in need of a saviour, He will be there. No matter what the situation is, God can and will come through for us. Remember, his timing is not our timing, but He will come through.
2 - 3. When we know that we know that our God will never leave or forsake us, no matter what is happening around us, that will not phase us. If the earth is falling apart, not saying we cant be human, we should remind ourselves of God's Word where He promises to take care of us.
4.The city of God, Jerusalem, had no rivers. The reference to a river illustrates the use of metaphor. The river would signify blessing, continuous flowing, outpouring of blessing in the city of God.
5.Indeed, God dwells in this city. Just like anything or anyone else that belongs to God, he will protect us. So when nations try to attack, God will protect an help to overcome or win battles.
6.Ties in to verse 5 where no matter how many nations try to attack God's city, they will not win, they will fall. It shows the awesomeness of God. He will lift his voice and the earth will melt. Yes God is great and powerful and if He wants he can lift His voice and melt the earth but in this passage, it suggest that He will use His power as an act to frighten or scare those that try to harm us. Him doing that suggests His anger against the enemies of His children.
7.Showing these acts will prove that God was, is and will be with His children and He will fight for us.
8.This is an invitation to see the victories that God has won and how He showed His anger towards the enemies of his children.
9.He will stop all attacks on His children. The breaking of the bow and shattering of spears suggest the use of them no more. If nations have no weapons, they can be no war. This would/will lead to peace on earth.
10.After all is said and done, it will be seen and known that God, the God of our salvation has done it; has helped us to win battles and overcome fears. For this reason, we as His people must praise Him. We must show our gratitude to Him by giving Him praise.
11. In conclusion, remember that God is all around us, looking out and protecting us. He has protected us from things unknown to our eyes. We need not forget it. He is our help, provider, everything. Amen.
Sunday, July 5, 2009
NECROPHILIA......
The judge told him, 'In 20 years on the bench, I've never heard such a disgusting, immoral thing'.
Just give me one good reason why I shouldn't lock you up and throw away the key!'
The man replied, 'I'll give you THREE good reasons:
1. It's none of your damn business.
2. She was my wife; and.....
3. I didn't KNOW she was dead, she ALWAYS acted that
way!'
So ladies try to move a little during the game.
Friday, July 3, 2009
just saw this video and it excited me ;)
check out the drummer!!!!!! he is lost in his own little world
Last video of Michael Jackson Ever!!!!!!!!!!!!
him neva look like him did really inna it doe. :(
Thursday, June 25, 2009
Saturday, June 20, 2009
kobe
he is a team player, motivator and everything else.
this yute has got skills!!!!!!!!!!
i used to play like that too... im retired now though
rating music albums & songs
Friday, June 19, 2009
top 10 nba finals moments
Check how many moments the la lakers have in the top 10. ;)
kobe hanging, 3 points from fisher? hmmm
Sunday, June 14, 2009
champions are champions!!!!!!!!
you better recognise talent when you see it!!!!!!!!
kobe, a star. its undeniable. alot of people do not like him because they think that he is a show off but, he's got talent that is obvious. he uses it for his team which is the important thing. his team won.
to the greatest, la lakers!!!!!!!!!!!
Friday, June 12, 2009
Usain bolt's t-shirt says what?????????
well, i didnt see what the shirt says when i looked at it initially. i was told to turn my head side ways to see what the shirt says. i thought it was come chinese and asked the question "who translated it for him?".
i dont know. who says he knows what the shirt is saying?
im not going to blame him because i dont no whether or not it was deliberate yes or no.
what do you think?
Thursday, June 11, 2009
refresh/reload parent mask
a parent mask would be one that calls another mask (the child). so the function would be in the child mask.
function doReloadParentMask(){
$p4a = p4a::singleton();
//$parent = p4a::singleton('product');
//$parent->destroy();
$p4a->masks->product->destroy();
$p4a->openMask('product');
}
Wednesday, June 10, 2009
how to replace extra space in a database/sql column
update table_name
set column_name = replace(column_name, ' ', ' ');
the function takes the column name and replaces two occurrences of spaes with one;
Monday, June 8, 2009
how to build spam free contact forms
Thursday, May 28, 2009
varibale not defined from javascript validation
if(errorMsg!= ""){
alert(errorMsg);
return false;
} else {
form.submit();
}
from the line with the name of the form, try using document.form.submit();
Saturday, May 23, 2009
Friday, May 22, 2009
Sunday, May 17, 2009
usain bolt sets new world record over 150m
check out the video
this yute is crazy. and he will only get faster and faster and faster...
you get the pic :)
how to validate an fckeditor using javascript
you can check if its empty by using this: if(editorValue.EditorDocument.body.innerHTML == "<p> <br> </p>"){
msg += " \n";
}
you use the "
im sure im saving some people the time it took me to figure it out.
current version of ubuntu in use
Sunday, April 26, 2009
:( the new ubuntu jaunty jackalope
i learn from experience. ill know what to do next time. ill wait a few months for some of the bugs to fix before i upgrade next time. ill still work with it because from what i read, it wont be easy to downgrade. i may have to uninstall and do a clean install to use the version i was using before, 8.1.
i also had compiz fusion installed and that doesnt seem to work either. i had the mac os-x theme on with the dock and all but the dock wont start because of some conflicts in the softwares.
for anyone who wants to upgrade, please backup your xorg file. i didnt do that and i am having problems now.
there are some cool features that i like. its not all gloom.
Saturday, April 18, 2009
porn addiction and ubuntu?
ubuntu is not porn.... porn is not ubuntu.
all the best dude
Tuesday, March 17, 2009
Limewire 5 for Ubuntu
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
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
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
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
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
Monday, March 2, 2009
Informatin Management System created by Me using the P4A framework!!!
Refresh Button with custom code for P4A Applications
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.
Saturday, February 28, 2009
Business Card
Here is the design for the front and back of the my card.
SOLVED!!!!!!!!!! problem with url rewrite and folders
Depending on how many front slashed '/' are used from the root file, the up folder code had to be used for the folders being used. Example: if your url is: www.mysite.com, all the folders will be read normally but if the url changes to: www.mysite.com/about_us/, then the folders have to use '../' to reflect the change in the url.
That was the problem and now it works fine. Thanks to my co-worker, Peter Scott.
Wednesday, February 18, 2009
url rewrite
my head hurts! i have been trying to use the url rewrite for a site im developing for hours and it is not working! i have several tabs opened and according to my sight, i have it correct but it doesnt seem to be reading the css and javascrpt files.
Thursday, February 12, 2009
Running asp on ubuntu intrepid
i can run asp on my linux without creating another partition to install "a set of windows".
a detailed link to the tutorial is here: http://www.goitexpert.com/entry.cfm?entry=Run-ASP-and-NET-in-UBUNTU--and-Debian-LINUX
thats the beauty of the open source world, there is always an alternative to something. you are used to using one thing on windows, if you plan on using linux, get out of that mentallity. open your mind to alternatives.
i hope this helps somebody who was wondering about using asp on their linux machine.