Tuesday, January 11, 2011

implementing audio and video and url to div

· click( handler(eventObject) )

· .css()

Categories: CSS | Manipulation > Style Properties

Contents:

· css( propertyName )

o .css( propertyName )

· css( propertyName, value )

o .css( propertyName, value )

o .css( propertyName, function(index, value) )

    • .css( map )
·         For showind url : 
 

· Html5 audio tag J not work with many browsers J

http://www.w3schools.com/html5/html5_audio.asp

·         Flash Player jquery plugin 
http://jquery.lukelutman.com/plugins/
Going by example is good .
 
$(document).ready(function(){
    $('a[@href$="mp3"]').flash( // this was difficult to understand J
        { src: 'singlemp3player.swf', height: 20, width: 100 },
        { version: 7 },
        function(htmlOptions) {
            $this = $(this);
            htmlOptions.flashvars.file = $this.attr('href');
            $this.before($.fn.flash.transform(htmlOptions));                                   
        }
    );
});

Before:

  • sound.mp3
  • After:

  •     
        sound.mp3
      

    http://jquery.lukelutman.com/plugins/flash/example-mp3.html

    Friday, January 7, 2011

    installing zend framework on ubuntu

    Things to rember

    To see ubuntu version cat /etc/issue >>>>>>>>> result in ubuntu 8.04

    · For kernel version uname –r/-a (kernel)

    · Emacs command for save C-x C-c save-buffers-kill-emacs

    · http://zoo.cs.yale.edu/classes/cs210/help/emacs.html

    · Always check for two or more tutorial before making any installation. For getting better or latest version of software.

    · sudo apt-get update

    · sudo apt-get install zend-framework

    · Open up a terminal and type

    · sudo tasksel

    · Select LAMP from the options presented and follow the prompts. Seriously.. It could not get any easier!

    ·

    · sudo gedit /etc/php5/apache2/php.ini

    · http://framework.zend.com/manual/en/zend.tool.usage.cli.html



    · For serach in emacs

    ·         C-s             isearch-forward

    · Ls –all

    ·         sudo chown -R www-data:www-data zfapi
    ·         man chown (for google search )
    ·         http://www.manpagez.com/man/8/chown/
    ·          

    · you will have to check that you install mod rewrite by doing this:

    ·         sudo a2enmod rewrite

    Monday, January 3, 2011

    Installing zend framework on wamp

    Version Information:

    WampServer 2.0i [07/11/09]
    Includes :
    - Apache 2.2.11
    - MySQL 5.1.36
    - PHP 5.3.0

    Zend Framework 1.10.3

    OS: windows xp sp3

    Directory Structure:

    c:\wamp\(out of the box wamp 2.0 structure)
    c:\zend\(out of the box zend framework 1.10.3 structure)
    C:\zendSites\(this is the folder i created to hold my zend projects)

    -----------------------

    Error 1 occurred while trying to create my project from the command prompt.
    This error occurrs becuase windows does not know where to look for zf.bat.

    C:\zendSites>zf create project quickstart
    'zf' is not recognized as an internal or external command, operable program or batch file.

    action: add the zf.bat path to windows xp environment variables...
    right click mycomputer>>properties>>advanced>>environment variables>>
    then highlight "path" in the list of system variables and click edit
    in my case i added ";c:\zend\bin" (without quotes) to the end of the list
    note that the leading semicolen is the path separator.
    restart computer.

    --------------------

    Error 2 occurred while trying to create my project from the command prompt and after adding the zf.bat path to windows environment variables. This error occurrs because windows does not know how to execute php scripts. It needs to know the path to php.exe

    C:\zendSites>zf create project quickstart
    '"php.exe"' is not recognized as an internal or external command,
    operable program or batch file.

    action: add the php.exe path to the windows environment variables.
    same as above, but this time i'm adding the path ;C:\wamp\bin\php\php5.3.0
    don't forget to restart your computer

    --------------------

    Expanded explanation of creating a virtual host on windows running wamp server 2.0

    open httpd.conf (click on the wamp icon in the services>>apache>>httpd.conf)
    find and uncomment the line: #Include conf/extra/httpd-vhosts.conf by removing the # sign go to C:\wamp\bin\apache\Apache2.2.11\conf\extra\ and open httpd-vhosts.conf note the "Apache2.2.11" in the above path. obviously this is version specific.

    add the following block of code to the end of httpd-vhosts.conf...


    DocumentRoot "c:\zendSites\quickstart\public"
    ServerName quickstart.local
    SetEnv APPLICATION_ENV "development"

    DirectoryIndex index.php
    AllowOverride All
    Order allow,deny
    Allow from all




    DocumentRoot C:\wamp\www
    ServerName localhost


    ...after adding this block of code you will need to update your windows hosts file, which maps requested urls to the server. go to C:\WINDOWS\system32\drivers\etc and open the hosts file. add the following 2 lines to the bottom of the file...

    127.0.0.1 localhost
    127.0.0.1 quickstart.local

    ...now restart your wamp server.

    notice the entries for localhost. this is to preserve localhost paths like that for phpmyadmin
    note, that now you have done this your address will be quickstart.local so any reference in the tutorial that says to go to http://localhost should be replaced now by http://quickstart.local
    this page will not be found by requests outside the local computer. ie. you will not be online until you register with a DNS (beyond the scope of this material)

    -------------------------

    Error 3
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.

    after making the changes above you will likely get this error In this case the error is caused becuase appache does not have the rewrite module enabled
    action:
    click on the wamp server icon in the services portion of the windows task bar.
    apache>>apache modules>>scroll down to "rewrite_module" and click it.
    wamp should restart automatically

    ----------------------------

    Error 4
    Warning: require_once(Zend/Application.php) [function.require-once]: failed to open stream: No such file or directory in C:\zendSites\quickstart\public\index.php on line 18
    Fatal error: require_once() [function.require]: Failed opening required 'Zend/Application.php' (include_path='C:\zendSites\quickstart\library;.;C:\php5\pear') in C:\zendSites\quickstart\public\index.php on line 18

    at this point if you have not set your include_path in php.ini you will recieve the above error.

    action:
    click the wamp server icon in the services section of the windows taskbar>>php>>php.ini
    now change the following section...

    ; Windows: "\path1;\path2"
    ; include_path = ".;c:\php\includes"

    to...

    ; Windows: "\path1;\path2"
    include_path = ".;c:\php\includes;c:\zend\library"

    ...and restart the wamp server again


    -----------------------------
    Error 5
    'dbname' is not recognized as an internal or external command,
    operable program or batch file.

    cmd input/output:
    C:\zendSites\quickstart>zf configure db-adapter 'adapter=PDO_SQLITE&dbname=APPLICATION_PATH "/../data/db/guestbook.db"' production
    A db configuration for the production section has been written to the application config file.
    'dbname' is not recognized as an internal or external command,
    operable program or batch file.

    this has to do with the difference between how linux and windows systems intrepret quotation marks.
    so you will need to change...

    zf configure db-adapter 'adapter=PDO_SQLITE&dbname=APPLICATION_PATH "/../data/db/guestbook.db"' production

    to...

    zf configure db-adapter "adapter=PDO_SQLITE&dbname=APPLICATION_PATH '/../data/db/guestbook.db'" production

    --------------------------------

    when creating load.sqlite.php, data.sqlite, schema.sqlite.sql make sure that the scripts folder that holds them is at the same level as the application folder. ie. c:\zendSites\quickstart\scripts
    also make sure that the load.sqlite.php code from framework.zend.com is enclosed with the php tags (). when you run this script from the prompt make sure you run it from the quickstart path

    --------------------------------

    Error 6
    C:\zendSites\quickstart>php scripts\load.sqlite.php --withdata
    PHP Warning: require_once(Zend/Loader/Autoloader.php): failed to open stream: No such file or directory in C:\zendSites\quickstart\scripts\load.sqlite.php

    this was a tricky one. It occurrs when we try to run the load.sqlite.php script because the command prompt uses a different php.ini than apache. you need to navigate to...

    C:\wamp\bin\php\php5.3.0\php.ini

    now change the following section...

    ; Windows: "\path1;\path2"
    ; include_path = ".;c:\php\includes"

    to...

    ; Windows: "\path1;\path2"
    include_path = ".;c:\php\includes;c:\zend\library"

    ...and restart the wamp server again

    ------------------------------------

    after working through all the above issues my quickstart application worked.

    Good Luck!

    Monday, December 27, 2010

    Things to remeber in linux

    • Display All Information About Files/Directories Using ls -l


    Thursday, December 23, 2010

    Things to remeber in html

    • text box width is set by style property only style="width:20px" not by width property <input type="text" id="text1" name="text1" style="width:20px" />
    • For putting html in the blogger you should go to this site and encode the code http://centricle.com/tools/html-entities/



    Monday, December 20, 2010

    Things to remeber in php

    Things to remember in php so that you don't dependent on google and manual.

    • To push values in array $stack.
    array_push($stack, "apple", "raspberry");
    • preg_split used in youngib api for commandline interface .
      array preg_split ( string $pattern , string $subject [, int $limit = -1 [, int $flags = 0 ]] )

    Friday, December 17, 2010

    Indexing in database

    • An index is a separate file that is sorted, and contains only the field/s you're interested in sorting on. If you create an index on employee_number, MySQL can find the corresponding record very quickly (Indexes work in very similar ways to an index in a book. Imagine paging through a technical book (or more often, an scrambled pile of notes!) looking for the topic "Optimizing MySQL". An index saves you an immense amount of time!
    • http://www.databasejournal.com/features/mysql/article.php/1382791/Optimizing-MySQL-Queries-and-Indexes.htm