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