Tuesday, December 7, 2010

DB Error: extension not found

I had this error and for about two weeks could not find the problem. I uninstalled lamp, reinstalled it several times and still had the same problem. I am using Ubuntu 9.10 as my O.S. Instructions follow same

From my research I found out that the mysql.so extension was not written to the php.ini file, so this is what I did to correct the error:

1.  gksudo gedit /etc/php5/apache2/php.ini
2.  ctrl+f and enter "extension"
3.  look to see if ";extension=mysql.so" is in the file
4.  if it is, remove the semi-colon. the semi-colon represents a comment so it is actually commenting out the extension that is needed

in my case though, the extension was not written to the file at all, so if this is the case do this
5.  copy and paste "extension=mysql.so" within the section for "Dynamic Extensions"
6.  restart the apache server: sudo /etc/init.d/apache2 restart

that should do the trick.

Tuesday, November 30, 2010

Review of Rihana's "Loud"

I listened to the album,  and I think its a good album overall, compared to her last album. This album just has eleven (11) tracks and I think that the album could be listened to from start to beginning, which is what I think makes up the component of a good album. The album mostly has a party/techno (pop music) feel to it. Not sure what she was going for.

One thing I really dislike though, is the repition in the songs.

Here is my take on each track.

01 - S&M - Don't know what s or m stands for. She basically talks about being good at being bad. Yeah, I know. :) She speaks about loving her sex and how she likes it.

02 - What's My Name (Feat. Drake) - This is one of the hit singles from the album which everybody should know. This is another song about sex. Gist of the song, sex was good and so the question is asked, "What's my name?".

03 - Cheers (Drink To That) - I think this song will be the next hit single from her album. It's a song you would want to hear after a stressing day or week, lets drink to something. Your boss ;), wife, your work on a hold, etc. Don't let the situation get you down, drink to it.

04 - Fading - Didn't really like this song but, it talks about forgetting a person; the person fading away. I guess the person was not treating her good.

05 - Only Girl (In The World) - Now this is the song that I like. I hear it and I want to move...like a white person. It makes you want to jump and just let go. Its good. I like the mix that she uses also. A lot of girls want to feel this way and I hope that you do find that male that makes you feel that way. Just a point to note (not trying to take the spotlight) males want to feel that way too. I know I sure do...

06 - California King Bed - This song slows down the tempo of the album. I don't think this song should be taking literally. I think the bed is used as a figure of speech to suggest the distance that exist between persons. It would seem as though, persons are expecting a change but there is none due to other issues that exist and so the analogy is used of a king bed to suggest size and space.

07 - Man Down - She tried a reggae thing. Its better than most other reggae songs that I have heard. She uses the straight kick and the bass groove, even though its a keyboard bass, is not bad. I think she handled herself good in terms of the vocals on the rhythm. Message in the song? It sound like she killed someone and is on the run.

08 - Raining Men (Feat. Nicki Minaj) - From the beginning, the song sounds like one that Beyonce did, Diva. That was the first thing I picked up. In this song she doesn't worry about the MANY men that come at her, hence its "raining men". Why doesn't she worry? She has it: looks, money, fame, etc.

09 - Complicated - Nice song. It just talks about a person making it hard for another to love them. Its not that one isn't trying but there is confusion with mixed emotions. One is weak for the other. So I guess its confession of the difficulty one faces when the heart is engaged and entangled and the person wants to let go. Amen. :)

10 - Skin - I think this song will be heard on Fame 95, being played by Deidra. I think its a song that can be used to set the mood to.... daah dah dee. :D Its a cool song though. Skin is about letting go, giving all, being naked.

11 - Love The Way You Lie (Part II) (Feat. Eminem) - I love this version. It gives me a alternative feel. Its the same song (name) with Eminem but with a different mix and feel. As I said, to me, it has an alternative feel to it. I'm not sure I agree with the message in the song though.

Overall, I think its a good album.

Good job Rihana.

Monday, November 29, 2010

pdo mysql installatin

Below are the instructions to install pdo extension for mysql

First, install PEAR
sudo apt-get install php-pear

If you get anything about warning, ‘phpize’, this means you need php-dev. To install this simpy put this in the terminal (sudo apt-get install php-dev)
sudo pecl install pdo

Next, install pdo_mysql drivers.
sudo pecl install pdo_mysql
If you encounter the error below,
checking for MySQL support for PDO... yes, shared
checking for mysql_config... not found
configure: error: Cannot find MySQL header files under
ERROR: `/tmp/tmpRiQ5ax/PDO_MYSQL-1.0.2/configure' failed
Then put this in the terminal:
sudo apt-get install libmysqlclient15-dev
and then sudo pecl install pdo_mysql

You can update the db below as follows:
sudo updatedb
Open the php.ini file:
gksudo gedit /etc/php5/apache2/php.ini
Inside it put these lines at the bottom:
extension=pdo.so
extension=pdo_mysql.so

setting up zend framework on ubuntu

Download the most recent version from the Zend Framework website and extract it to the /opt folder. To enable us to easily switch out different versions, we will create a symbolic link to this folder (just right click and select the ‘Make link’ option.. name it ‘Zend’)















Next, we will tell php to include the zend framework in the include_path.
sudo gedit /etc/php5/apache2/php.ini
Add/Change the include_path in to :
include_path = “.:/opt/Zend/library”
Note that I used the symbolic link in the include path.. This way, when there is a new version of ZF, we can just switch out the symlink without having to edit the ini file!
In order to use the zend framework command line tool (/opt/Zend/bin/zf.sh), we need to install the php command line interface (php5-cli) if it is not already installed.
sudo apt-get install php5-cli
Note that the CLI uses a different version of the php.ini file (NOT the one in the apache2 folder but in the cli folder!). We need to tell CLI also where the zend framework directory is located.
sudo gedit /etc/php5/cli/php.ini
and set:
include_path = “.:/opt/Zend/library”
The final step is to include the path to /opt/Zend/bin in the unix PATH variable (this way, you can use zf.sh instead of /opt/Zend/bin/zf.sh). Edit file named ~/.bashrc (ctrl+h show hidden files). Add the following line at the end:
PATH=/opt/Zend/bin:”${PATH}”















The Zend Framework relies on the apache “rewrite” module. So, go ahead and enable the “rewrite” module using the following command:
sudo a2enmod rewrite
Restart apache and that should be it.

Friday, November 26, 2010

custom error popup message with p4a

i did a customization for a popup message in p4a. 

here is the screenshot:










here is the code:

set red border around fields:
function setAsRequiredField( $fieldName ){
        $fieldName->setStyleProperty('border-color', 'red');
        $fieldName->setStyleProperty('border-style', 'dashed');
        $fieldName->label->setStyleProperty('font-weight', 'bold');
    }


remove formating:
function clearErrorFormatting(){
        while ($f = $this->fields->nextItem()) {
            $f->unsetStyleProperty('border-color', 'red');
            $f->unsetStyleProperty('border-style', 'dashed');
            $f->label->unsetStyleProperty('font-weight', 'bold');
        } 
    }

sample validating function that passes a message for each field:
function validateScreen(){
       
        $this->clearErrorFormatting();
       
        $statusMsg = "";
        $email_validator = new Zend_Validate_EmailAddress();
        $notEmpty_validator = new Zend_Validate_NotEmpty();
        $date_validator = new Zend_Validate_Date();
        $regex_validator = new Zend_Validate_Regex('/\d{3}\-\d{3}\-\d{4}/');
       
        if( $this->fields->title_id->getNewValue() == 0 ){
            $this->setAsRequiredField( $this->fields->title_id );
            $statusMsg .= "Title is required
";
        }

        if( !$notEmpty_validator->isValid( $this->fields->first_name->getNewValue() ) ){
            $this->setAsRequiredField( $this->fields->first_name );
            $statusMsg .= "First Name is required
";
        }
                      
        if( empty( $statusMsg ) ){
            $this->insertMember2();
        } else {
            $this->warning($statusMsg);
        }
    }

the message for each error is concatenated to this variable, $statusMsg, than passed to the warning function for p4a. once it is passed to the function, it show the popup for the error messge.

Monday, November 15, 2010

Current emotion...

Here I am sitting in a sports bar having a Guiness, trying to relax myself while having a cold drink. There's a lot on my mind, not anything I want to think about.

On one hand, I'm being seen as a liar and one that is dishonest, and on the other hand, I'm supposed to be this sweet person. Isn't that a contrast? :). Are any of those perceptions correct? Only one person can truly tell, me. Do I know? Not sure. Is it that I am unstable? Confused...well, I know I am. Dishonest? Are these things innate? Does doing something once makes it apart of you? Is it that memories never die and so once a person remembers something about you, they think that same thing of you? What is it?

I hope I don't become like my father.

Sadness is what it is now. With time though, it shall fade. When where is true happiness? Can a person truly have that? If so, I want it.

Wednesday, October 20, 2010

mysql show duplicate records

query to retrieve duplicate records - 
select column_name 
from table_name 
group by column_name 
having count(*) > 1 
order by column_name asc

Friday, October 8, 2010

Born gay?

Saw this post on fb "1
out of every 10 people born are gay. That means 1 out of every 10
people are put down, given bad labels, left alone,put in a minority,
and so much more all for something they didn't ask for. Many gay teens
are turning to suicide as a way of escaping. If you want to tell them
...life will get better, and you respect ...them for who they are, copy
and paste this. Most of you won't, but let's see the 5% who will".

Born gay? That would mean that it is predetermined. Is it really predetermined? For it to be predetermined, wouldn't there have to be some genetics from either or both parents involved in the make-up of the fetus? That would mean that, either or both parents would have gotten it from their parents. Wouldn't that mean that the parents and grand-parents would have to be gay also? What if none of the two generations are gay? How can that be explained?

As for the rest of it, I do agree that they are in a minority group. It is sad.

Doesn't a person who is gay killing them self, dependent on where they live? From what I have seen and heard, a lot of states in America are granting the freedom to gays to get married.

Won't get into much details as I think it will go into definitions of words, freedom for people, the Bible and other things that I really don't know much about.

Tuesday, September 21, 2010

Use of # or javascript:void()

correction, use javascript:void(0); having the link will carry you to a page regardless of the return false;

i tested but my cache was not cleared.

Use of # or javascript:void()

i have tried both. the # makes the page refresh and i didnt want that. i used the javascript:void and it did what i want it to do but then i read somewhere that users wont be able to right click, not that the link would have allowed that. so, this is what i do, i use any link name, e.g. but then i add "onclick = 'return false;'" so it becomes

you can still use the return false even if you call a function. call the function then return false;

Sunday, September 19, 2010

Just scanned through an article awhile ago about what happens to a persons souls after they die (will post the name of the site when I get up, I want to sleep).

It started out by saying that the soul is more complicated than it appears and that there might be about five (5) aspects of the soul.

It said that, when a person dies:
1. their soul may go to Heaven
2. Their soul may go to Hell
3. Their soul may come back in a new born
4. Their soul may go to a person already living or an animal.

This just came to mind. If a person, when dead, has regrets, could this be the evil spirit that captures a person body? Would their regret cause them to become bitter and since they are dead and unable to correct anything, they become evil?

It also suggested that if a person's focus was more on the spiritual, then this person will be more acceptable of death than a person who was caught up in the physical. The person that is caught up in the physical will have a problem leaving the body that they have loved all the days of their life.

If when a person dies, the soul, hypothetically, comes back into a new born, is that a desire or love for the physical?

What really happens after death? Is it important?

For those who are alive, are we living with the soul of another?

Thursday, September 9, 2010

What happens to the soul after death?

This is something that I have always wanted to know. Where does the soul go? What does the soul do? Is it the same thing as a ghost? What is the difference if so?

I have heard stories about ghosts and all. I have heard that it takes a time for people to know that they are dead, how long? Wouldn't it be obvious, assuming that this is what happens, if a person dies and they don't know, they try to touch someone or talk to them and they realize that they can't, that they maybe dead? Can the soul hear? Wouldn't the soul hear, if they can, people talking about them? How long after a person dies can they still hear?

Does the Bible offer any explanation towards this?

As it relates to people who "dream" to people a lot, is it an indication of them knowing or fore seeing danger and warning persons, or them just not resting in peace?

These are some of the things I seek to find out.

Sunday, September 5, 2010

jquery wysiwyg editors

wanted to use a jquery wysiwyg (what you see is what you get) editor with a new cms. found one that looks ok but then when i clicked on the icon to add an image, it does not have the capability to browse. a user will have to copy the url and paste it into the editor. copying and pasting of the url is from a web site. it does not allow the user to browse their local machine for an image.

i then found out that it does not work in google's crhome browser.

if there is one that allows the user to browse, please let me know.

so i guess its back to using fckeditor.

Thursday, September 2, 2010

LA LEWIS Speaks Out On Dishonesty Raggastani, Ms. Kitty, etc - Jahkno.com

LA LEWIS Speaks Out On Dishonesty Raggastani, Ms. Kitty, etc - Jahkno.com

i can believe i sat down and watch this video. him just chat a bunch of foolishness. weh him know bout freemason and illumanti? hmm. i would be surprised though if there was actually some involvement.

didnt hear the story about ms kitty. dont know what to say about that.

the ragashanti thing, heard different stories so ill leave it alone.

wont comment on the beenie man thing either.

sigh

Blogging from mobile device

I just found out that I can keep my blog updated by following a few simple steps that allow me to blog from my Blackberry.

I have always had the idea but procrastinated to research and find out how its done.

I got the instructions from here: http://www.blackberryvsiphone.com/mobile-blogging/how-to-blog-via-blackberry-device.

I think that this is so convenient in the sense that there are things that I did, would want to blog about but thought I had to log into by blog account in-order to blog about it. By the time I get home or near a computer, I forget.

My blog should be kept up to date more often now.

quotes to help with success in your business

taken from Benjamin Franklin's 13 Secrets To Business Success
Then: "Lose no time; be always employ'd in something useful; cut off all unnecessary actions."
Now: Life hackers and multitaskers will win the startup war every time.

Then: "Let all your things have their places; let each part of your business have its time."
Now: Your modern day business has a lot of moving parts. Devise a system for keeping it all in order.
Then: "Wrong none by doing injuries, or omitting the benefits that are your duty."
Now: Shady business practices will come back to bite you.
Then: "Rarely use venery but for health or offspring, never to dullness, weakness, or the injury of your own or another's peace or reputation."
Now: To ensure a healthy atmosphere, office romance should be handled with care.
Then:"Make no expense but to do good to others or yourself; i.e., waste nothing."
Now: Forget the fancy office chair, save that scrap paper and remember to brown bag a lunch.
Then: "Be not disturbed at trifles, or at accidents common or unavoidable."
Now: When things go wrong, take a breath a relax. An occasional yoga class couldn't hurt.

Then: "Tolerate no uncleanliness in body, cloaths, or habitation."
Now: Get it together, and dress to impress.

Then: "Eat not to dullness; drink not to elevation."
Now: You'll work harder without a hangover. Skipping the fourth cup of coffee couldn't hurt either.

Then: "Use no hurtful deceit; think innocently and justly, and, if you speak, speak accordingly."
Now: Being straight forward is the best way to connect with customers and co-workers. Leave the slick sales talk at home.

Then: "Resolve to perform what you ought; perform without fail what you resolve."
Now: Don't let problems fester and follow through once you've set a goal.

Then: "Avoid extreams; forbear resenting injuries so much as you think they deserve."
Now: Don't let one aspect of your business overwhelm all others. And when your competitors play dirty, don't take it personally.

Then: "Speak not but what may benefit others or yourself; avoid trifling conversation."
Now: Don't Tweet every random thought. Communication works best when you have something worthwhile to say.

Then: "Imitate Jesus and Socrates."
Now: ... or Warren Buffet, if you feel so inclined.




Wednesday, August 25, 2010

jquery slider does not work properly in internet explorer

http://dev.jqueryui.com/ticket/4680
thats the link with a fix. the problem i had was that, the last element in the slider was not showing. all i had to do was to extend the width of the wrapper.

Friday, April 30, 2010

insert update mysql query example

insert into site_banners ( content_id )
select content_id from content on DUPLICATE key update site_banners.content_id = site_banners.content_id ;

gets all the keys from content table and inserts them into site_banners. if the key exist, basically, do nothing.

Friday, March 5, 2010

upgrading to the latest version of wine for ubuntu 9.10

heres the link straight from winehq.com's site

http://www.winehq.org/download/deb

show html code on page

to show html code on page, you will need to replace the < with "&lt;" and the > with "&gt;"

that will render the code on the page as just html code

add google site search to your web site

heres the code to add the google search to your site. you will need to change "yoursite.com" to your domain name

<form action="http://www.google.com/search" method="get"> 
<input name="q" size="31" type="text" /> 
 maxlength="255" value="" />
<input type="submit" value="Google Search" /> 
<input name="sitesearch" type="radio" value="" /> 
 The Web
<input name="sitesearch" type="radio" /> 
 value="yoursite.com" checked /> Ask Dave Taylor

</form>

Thursday, March 4, 2010

install adobe flash player 10.1 beta in karmic

here is the link that worked for me: http://tuxarena.blogspot.com/2009/12/how-to-install-flash-player-101-beta-2.html

the instructions are below though:

sudo apt-get remove --purge flashplugin-installer

should remove your current installation of Flash. If Flash was installed manually, the plugin should be located in the ~/.mozilla/plugins directory, where ~ is the home directory. So, to remove it:

rm -f ~/.mozilla/plugins/libflashplayer.so

Next, download the archive for the new Flash player from here (direct link here), or alternately you can type in a terminal:

wget http://download.macromedia.com/pub/labs/flashplayer10/flashplayer10_1_p2_linux_121709.tar.gz

Make sure the current working directory is the one where you saved the archive and uncompress it:

tar -xzf flashplayer10_1_p2_linux_121709.tar.gz

Next, create the ~/.mozilla/plugins directory (if it doesn't already exist):

mkdir -p ~/.mozilla/plugins

And copy the plugin inside it:

cp install_flash_player_10_linux/libflashplayer.so ~/.mozilla/plugins

Now restart Firefox and this should be all.

Tuesday, March 2, 2010

get youtube video id from url

i had a task to show some youtube videos on a site and had problems reading the entire url due to the # and other characters in a youtube channel. so i wrote my function below to get the youtube video id

/**
     * Return video id for a youtube url
     *
     * @param string $url
     * @return string
     */
   
   
    function getYoutubeVideoId( $url ){
       
        $id_param = "v="; //video id starts after the equal sign
        $id_length = 11; //length of video id
        $id_param_pos = strpos( $url, $id_param ); // get position of v from the video param
        $id_param_pos += 2; //add 2 spaces to get actual video id
        $video_id = substr( $url, $id_param_pos, $id_length ); //gets id from entire youtube url
       
        return $video_id;
    }

Tuesday, February 23, 2010

Password Generator

check out my password generator:

http://www.jbwebstudios.com/my_apps/password_generator/index.php

let me know what you all think.

info on it?

was built using p4a; php framework

Password Generator

check out my password generator:

http://www.jbwebstudios.com/my_apps/password_generator/index.php

let me know what you all think.

info on it?

was built using p4a; php framework

php get intro from text function

i modified the function to what it is now because it took a long time when used in a loop.

function determineIntroFromString( $string, $length=null ){
      
        $length = ( empty( $length ) || $length < 350 ) ? 400 : $length;
      
        $sentences = explode( ".", $string );
          $intro = "";
         
          $index = 0;
          $string_length = 0;
        
          foreach ( $sentences as $sentence ){
            
              //echo " ---  ".$sentence;
              //echo strlen($sentence);exit;
            
              if( $string_length <= $length ){
                  $intro .= $sentence;
                  $string_length = strlen( $intro );
                  //echo " -- ".$string_length;
                  unset( $sentence );
              } else {
                  break;
              }
              //unset( $sentence );
          }
        
      /*    while (  strlen( $intro ) <= $length ){
              $intro .= $sentences[$index];
              $index++;
          }*/
        
          $intro .= ".";
        
        return $intro;
    }

Friday, January 29, 2010

adding favicon icon using .htaccess file

wanted to save myself the problem of adding the code to all the pages i use to show the favicon so i researched it. this is how it is added to the .htaccess file:

AddType image/x-icon .ico
RewriteRule ^favicon.ico favicon.ico [NC,L]

the icon has to be in the root of the server files

Friday, January 22, 2010

Add multiple rows dynamically with javascript

this function can be modified to take the amount of rows to create. i just hard coded the amount due to time :D

javascript code

function addTableCell(tblElement)
{
var tbl = document.getElementById(tblElement);
var celTitle = "Session Title";
var cellName = "session_title";

for( var n = 0; n < lastrow =" tbl.rows.length;" iteration =" lastRow;" row =" tbl.insertRow(lastRow);" titlecell =" row.insertCell(0);" titlelabel =" document.createTextNode(celTitle);" cellright2 =" row.insertCell(1);" el2 =" document.createElement('input');" type =" 'text';" name =" cellName" size =" '30';" class =" 'flatTextbox';" celtitle = "Session Description" cellname = "session_desc" n =" 0;" tbl =" document.getElementById(tblElement);" tbl =" document.getElementById('addcell');" lastrow =" tbl.rows.length;"> 1) tbl.deleteRow(lastRow - 1);
//if (lastRow > 3) tbl.deleteRow(lastRow - 1);
}

}

html code
this was in another table. highlight and view code for fields and buttons









Session Title
Session Description


and this is the code to accomplish adding and removing the last inserted fields




Sunday, January 17, 2010

interpretation of "On to the next one" - Jay-z

this video highlight some of the meanings of the symbols that jay-z uses in his video "on the next one". look out for a site that i will be doing. uogw. coming soon...............

Saturday, January 9, 2010