Monday, November 30, 2009

notes from learning mysql stored procedures

what is a stored procedure? - it is a set of sql statements that are stored within the database.

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.

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 procedure
DELIMITER ; - changes back the delimiter to a semicolon
this is how a stored procedure is called - 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

i had the unfortunate event of not remembering my password for my bb a minute after i had set it. I tried it a couple of times and was told that it was wrong. i googled it and i found out that all i had to do was to enter it the maximum amount of times and it would erase all my data from the phone and then i would be able to use it again.

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

when this happens, the instructions to fix it are here: http://www.zend.com/support/knowledgebase.php?kbid=241&view_only=1 but you can follow them below:

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

i had need for the save for web plugin that photoshop has and didnt find one in ubuntu gimp since i dont use WINDOWS. i found the plugin here: http://my.opera.com/area42/blog/gimp-save-for-web-plugin-0-28-4.

for ubuntu users, download the Ubuntu deb archive of 0.28.4 file.

Monday, November 23, 2009

Clear textarea default value

this is the code used to clear the default value of a textarea.

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

i wrote this module with p4a and decided to share. its an alphabet sorter.

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);

}

Toyota trucks with gadgets and all!!!!!!!!!!!

check out these trucks: http://editorial.autos.msn.com/photopopup.aspx?cp-documentid=1106307&mediaid=357e5d66103d44ca9c2e473aac110e61&rf=http://editorial.autos.msn.com/photogallery.aspx?cp-documentid=1106307#mediaid=357e5d66103d44ca9c2e473aac110e61

Monday, November 16, 2009

Job Interview Questions and Answers

Below is the link to some job interview questions and answers.

See them here

Google's interview brain teasers

Our story on Google's hiring practices on Friday generated quite a bit of reader feedback, including an email from a Seattle interview coach with a list of 140 common interview questions at the Mountain View Internet giant.

Why Google Employees Quit

In 2008 Google HR set up a private Google Group to ask former employees why they left the company. We’ve been forwarded what appears to be authentic posts to the thread by a number of ex-Googlers, which we reprint below minus identifying information other than their first names.

Read more here

Wednesday, November 11, 2009

remove hiberfile on windows partition from ubuntu

as i speak i am using my ubuntu live cd. i am about to install ubuntu 9.10 but i encountered a problem. i had hibernated my windows partition and now i cant perform certain tasks on it. i figure out the problem, i need to remove the hiberfile from the partition to gain access to the partition. i used the code below to perform the function.

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.

Friday, November 6, 2009

44: php: not found

i got this error while trying to create the tree structure for a zend application and i got the following error: 44: php: not found. to resolve this, you need to install php5-cli. this can be installed by the following command from the terminal: sudo apt-get install php5-cli.

Monday, October 26, 2009

ubuntu batch renaming

i wanted to rename a couple files in a folder. i looked up how to do it using the terminal and i got discouraged. so i sought to find a program that handles batch processing and i found krename. it can be installed from the terminal using this command: sudo apt-get install krename

Sunday, October 11, 2009

holy ghost gym review

some time ago i mentioned that i would have started doing reviews on movies and videos, well, this is my first one. its a video from d.j. nicholas.


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

i had a problem where i wanted to capture a value from a mask after going to another mask while creating a web application using p4a. i found the method on the p4a forum but it wouldnt work sometimes. i could not figure out what was the problem. it would pass the value the very first time the mask is called but it would not capture it once passed again to the same mask. the puzzled me. i then figured out that p4a is a state application and i would need to clear the previous state if i wanted to capture the new value. i had created a function to clear the state, which i posted on my forum some time ago, which i used but that didnt solved the problem. i checked other applications that i built and the method worked perfectly. i realised that the difference between the application that worked and the one that didnt work was the use of menus to open a mask. the menu function i used was one found from the p4a sample appliction. here is the code.

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

for over a week now i have been having the problem of capturing a form post in ie when coding in php. after searching forums, blogs, etc, i have found a solution. frankly, ie must stop use. this method can also be used when the button is an image. so, here is the solution.

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

to change the position of the close, maximize and minimize buttons, check out this thread:

http://ubuntuforums.org/showthread.php?t=19413

switched back to the ubuntu theme

i have loved the look of a mac machine but i cant afford it. from one of the earlier posts on my blog, i said that i had completely switched to linux.

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

for people who are interested in linux but do not know which distro to choose, you can take this test and find out.

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

i created another partition on my laptop & installed linux mint, i had a problem with the hibernation, to get it working i used this command swapon -a

Thursday, September 10, 2009

free fonts!!!!

i happen to accidentally delete all my true type fonts and i am now searching for fonts to install. i came accross this site that has some: http://www.broble.com/get/ubuntu-title/

Monday, September 7, 2009

sin animation

php number of days in month

in my search for a method to get the number of days in a given month in php, i found one method from the php.net site. it uses the t variable in the date function. i tested it and it returned 31 days for the month of september. i found another method at the about.com site. i like it. this is how it works: $noOfDaysInMonth = cal_days_in_month(CAL_GREGORIAN, $monthIndex, $year) ; it takes the month index and the year and returns the number of days in that month.

Sunday, August 16, 2009

Undefined video mode number

had this problem and this solved it

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

Sunday, August 9, 2009

access buttons on a p4a field with type file

ok. its official. this thing is driving me crazy now. how do i access the buttons on a p4a field with type file???? i have been trying to figure it out and alas no success. the forums tell me one thing, i try it and nothing. I need to know how!

God please give me an answer like you always do?

thanks

time period: one day

Monday, July 27, 2009

problem solved

after weeks of trying to figure out how to get the image in a field from p4a displayed, i finally figured it out. in p4a there are two folders, an uploads folder which contains a tmp folder. when the image is uploaded, it is supposed to put the image in the tmp folder then in the uploads folder.

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

this is an example of the sql string replace function

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

Facebook driving mobile net usage

http://news.bbc.co.uk/2/hi/technology/8149652.stm

Bride's bouquet brings down plane

http://news.bbc.co.uk/2/hi/europe/8149910.stm

the michael jackson cover up pt2

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.

Sunday, July 12, 2009

opening salution for cover letter

i have had the mind worrying problem of what to write for the opening salutation of a letter when the addressee is unknown. i found this link, hope it helps.

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:

salutationwhen to use
Dear Sir / Dear Sirsmale addressee (esp. in British English)
Gentlemenmale addressee (esp. in American English)
Dear Madamfemale addressee (esp. in British English)
Ladiesfemale addressee (esp. in American English)
Dear Sir or Madamgender unknown (esp. in British English)
Ladies and Gentlemengender unknown (esp. in American English)
To whom it may concerngender unknown (esp. in American English)

Saturday, July 11, 2009

Exhortation on Psalm 46

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......

A man was brought before the judge and charged with Necrophilia (making love to a dead woman).
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.

device to monitor your use of electricity

http://www.dintz.com/in-depth-save-money-by-tracking-your-electricity-use/

is this really what jamaicans do when they know or see tourists coming to them?

Friday, July 3, 2009

just saw this video and it excited me ;)

for all you who dont know, i love live music!!!!!!!

check out the drummer!!!!!! he is lost in his own little world


Last video of Michael Jackson Ever!!!!!!!!!!!!

Check it out.







him neva look like him did really inna it doe. :(

Saturday, June 20, 2009

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

dont know what the beating is for but she get some good lick!!!!!!!!

check it out: http://abclocal.go.com/kgo/video?id=6858547

Usain bolt's t-shirt says what?????????

here is the link: http://www.fotoglif.com/f/cbemyf1q3eyu

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

i used this function to reload a parent mask in p4a 3

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

use the replace function:

update table_name
set column_name = replace(column_name, ' ', ' ');

the function takes the column name and replaces two occurrences of spaes with one;

Thursday, May 28, 2009

varibale not defined from javascript validation

if when validating a form with javascript you have:

if(errorMsg!= ""){
alert(errorMsg);
return false;
} else {
form.submit();
}

from the line with the name of the form, try using document.form.submit();

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

i have had some problems finding out how to validate the fckeditor. i just found out. in between the script tags for javascript, declare a variable for the edior: var editorValue = FCKeditorAPI.GetInstance('name_of_editor') ;

you can check if its empty by using this: if(editorValue.EditorDocument.body.innerHTML == "<p> <br> </p>"){
msg += " \n";
}

you use the "


" because by default, it places any value of the editor between the p and br tags.

im sure im saving some people the time it took me to figure it out.

current version of ubuntu in use

sigh. after uninstalling the new jaunty jackalope from ubuntu because i did an upgrade from intrepid ibex, i found out about the lts versions of ubuntu. Long Term Support. I tried ubuntu 8.04 which is the current lts and didnt like it. I had some problems with the wireless and some other things. i toold it off and installed the version i had before i did the upgrade to jaunty and im good now. wireless works and i love how my laptop runs. i also found a tutorial on how to make the intrepid ibex look like the mac os-x and it was good and easy and had something that i had wanted from the first tutorial i used to make my ubuntu look like the os-x. that is the globalmenuapplet. it works now. im worried about the updates for intrepid. updates only last for 18 months after the release of a version. i had a bag experience with the upgrade and so will use intrepid until the updates time period is finished. then i will try the new lts.

Sunday, April 26, 2009

:( the new ubuntu jaunty jackalope

im sad. i upgraded to the new ubuntu version and, just like other new versions of softwares, there are bugs. it seems slow and the graphics seems messed up. some applications like rhythmbox, exaile and others dont work properly. emesene doesnt open. sigh.

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?

i saw a post in an ubuntu forum about someone who decided to not use the ubuntu os anymore because he was addicted to porn and wanted to kick the habbit. to stop his addiction, he was switching back to windows??? i think thats crap. the operating system gives you way more sources to porn than another os??? sigh. i hope it works. for other people out there, ubuntu has nothing to do with his addiction. he just has a problem and wants to blame it on something and ubuntu is the reason he sees.....

ubuntu is not porn.... porn is not ubuntu.

all the best dude

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.

Saturday, February 28, 2009

Business Card

Yeah, Got my business cards done and I am happy with the design. I couldn't have done it but I am glad and I want to give props to the designer, Peter Scott.

Here is the design for the front and back of the my card.



SOLVED!!!!!!!!!! problem with url rewrite and folders

I found out what the problem was... The problem was that, the url represented paths or folder looking path and so I had to reflect that with the folders I was using: css and js.

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

scream!!!!!!!!!!!!!

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

this looks like a relief for me. i havent tried it yet but it looks promising.

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.