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

    Wednesday, November 24, 2010

    Css Learning

    • white-space:no-wrap to make text in a line .
    • vertical-align:middle; display:table-cell will not work with float so advise to insert a div cover for entering float .
    • Use Float left to all the div in the container with the width specified.
    • Use Position:relative for parent div , and absolute for child div for positioning.
    • For Floating image use overflow:hidden;
    • Use CSS selectors .e.g. > * for select adjacent child divs. Check this link for more css selectors.
    • Z-index of elements should be check in the same Containers., And position should be absolute of the other element.

    Tuesday, November 23, 2010

    Regular Expressions

    Regular Expression of Email:
    string :rahul@gmail.com
    exp.:([a-z])+@([a-z])+\.([a-z])+([a-z])

    Passwords cannot contain sequences of 3 or more of the same character
    (.)\1\1

    • # the following expression finds double characters
      (.)\1

    Brackets, Ranges and Negation[],- ^

    Positioning (or Anchors)^,$,.


    • The ^ (circumflex or caret) outside square brackets means look only at the beginning of the target string, for example,
    • The $ (dollar) means look only at the end of the target string, for example, fox$ will
    • The . (period) means any character(s) in this position,

    Iteration MetaCharcters ?,* ,+,{n},{}
    • The ? (question mark) matches the preceding character 0 or 1 times only
    • The * (asterisk or star) matches the preceding character 0 or more times
    • The + (plus) matches the previous character 1 or more times,
    • {n} Matches the preceding character n times exactly
    • {n,m} Matches the preceding character at least n times but not more than m times,

    More metacharacters()|


    Submatches, Groups and Backreferences


    for testing and article Please follow
    http://www.zytrax.com/tech/web/regex.htm

    Tuesday, November 16, 2010

    Best Coding Practices

    • The more code you have the more possible to make errors and the more code you have to maintain.
    • Use Plugins are around to make life easier after all to write less code
    • Never write html code in the js files , always put html code in html file , and access html element in jquery .
      Object Oriented Programming
    • Don't put Parent Class in the Child Class , always pass the data to the child class from the Parent Class. e.g. App is parent Class then App should not be in the Child Class . Because it is the method of abstraction.
    • Put the Code related to the Class only in Class else put in Project (App) Class of the Project.
    • To Pass the Parent Class use the context .e.g. for passing config variable to the child class.
    • Each Class is separate entity and should be complete,not dependent on any class and should not give error if something changed in other class.
    • Best OOPS Principles http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod
    • http://www.dofactory.com/Patterns/Patterns.aspx

    Monday, November 15, 2010

    Becoming Team Leader

    • I'm expected to mentor other developers, work on requirements
    • make design decisions for other developers
    • evaluate bug reports from users, assign them to developers,
    • As an individually-contributing developer, my job was to turn my own time in to software that the business could sell for a profit.

      As a team lead, my job is to see that the team effectively turns their time in to software that the business could sell for a profit.

    • Developer has two works only coding and meeting
    • Team Leader have to do
    1. Meeting with more persons
    2. Delegation - distribution of work
    3. Documentation
    4. Communication to client and others
    5. Mentoring the team .

    Tuesday, October 26, 2010

    code review process

    Code review process:

    1. Design: we provided a high level over view of how to solve a problem. No code at this stage. Talk with fellow developer who is available and development manager. Benefits of early design review is getting input that a single developer might have missed. Re-design etc if required.
    2. Code it.
    3. Submit code/link to code changes to another developer for peer review via email/electronically. Best bet is to submit it to a developer who was not involved with design review. Note that the reviewer should review the code without input from the original developer. This is important. We approach it this way for several reasons. If the code can be understood by someone who has not written it then it is safe to say it is maintanable should the original developer be no longer around to ask (left the company or whatever) or even if they are. If the code reviewer cant understand the code then its given back to the developer and he/she makes it more understandable either by greater documentation or refactoring the code. It could be as simple as adding more information to the bug description that the code change is realted to. This in it self saves so much time in the future. The ability to pick up someone elses code and understand it quickly is very advantageous.
    4. Developer and code reviewer get together and discuss code/improvements.
    5. Developer makes changes if required.




    Types of Code Review Activity:

    1. Desk Review

    2. Peer Review

    3. Panel Review

    4. Client Review

    Desk Review /Informal Review:

    1. As a Senior Developer/ team lead / Project lead can sit with developer in his machine and check the complex component implementation.

    2. Review the naming convention, number of lines per method or class and for loop, if else ladder, Map or List or array usage and review the developer business logic understanding and implementation.

    3. Provide the on the fly review comments to the developer to focus on the key implementation skeleton.


    Peer Review:

    1. As part of any logical component implementation completion, the developer can call for the Peer Review.

    2. Peer will be identified with in his track/team and the code artifacts needs to be submitted to the peer by the developer

    3. Identified peer will review the code artifacts against the coding checklist as well with the help of coding guidelines

    4. Peer will provide the review comments to the appropriate developer and Keep the Team Lead/Project lead in the communication loop.



    Panel Review:

    1. Panel will be identified with in the project

    2. Panel consist of Architect, SME, Lead, Senior Developers (max 5- 8 people)

    3. End of Specific Service or Functionality formal component implementation completion, the code or deliverable will be submitted to the Panel by the respective track or team lead.

    4. Panel member will do the offline review on the code/artifacts thoroughly

    5. Panel needs to check the Implementation strategy, design pattern, reusability, QoS and the functional logic implementation.

    6. Panel will gather in the Meeting room and the team lead /code owner will present the code to panel and walkthrough the artifacts.

    7. Panel will raise the concern or identified gap in the meeting and the panel member will discuss the gaps.

    8. Finally the panel will recommend the refactoring or approve the code for baseline.

    9. All the review comments will be prioritized under one of the following criteria such as Development change/refactoring, bug, design issue, requirement missing, Change Request etc

    Client Review:

    1. After the panel review ,the code will be given to the Client Technical panel (if your project structure has this?) and receive their inputs for further beautification in your client deliverables.

    Finally your project manager will take the summary of the code review metrics from the tool and use that for code quality metrics/ SLA Base line.

    source :http://www.saching.com/Articles/What-is-Code-Review-Process-2121.html

    Sunday, October 24, 2010

    using jquery ui

    jQuery UI provides a comprehensive set of core interaction plugins, UI widgets and visual effects that use a jQuery-style, event-driven architecture and a focus on web standards, accessiblity, flexible styling, and user-friendly design. All plugins are tested for compatibility in IE 6.0+, Firefox 3+, Safari 3.1+, Opera 9.6+, and Google Chrome.

    Interactions

    Complex behaviors like drag and drop, resizing, selection and sorting.


    Widgets

    Full-featured UI controls — each has a range of options and is fully themeable.


    Utilities

    Low-level utilities for building rich interactions, widgets, and effects.

    Effects

    Animated transitions and easing for rich interactions.

    Effect Methods


    Thursday, July 22, 2010

    Cross Table Delete with MySQL

    DELETE product.*, productPrice.*
    FROM product p, productPrice pp
    WHERE p.productId = pp.productId
    AND p.created < '2004-01-01'

    php curl to access a site


    $url = 'http://www.google.com';

    //open connection
    $options = array(
    CURLOPT_RETURNTRANSFER => true, // return web page
    CURLOPT_HEADER => false, // don't return headers
    CURLOPT_FOLLOWLOCATION => true, // follow redirects
    CURLOPT_ENCODING => "", // handle all encodings
    CURLOPT_USERAGENT => "spider", // who am i
    CURLOPT_AUTOREFERER => true, // set referer on redirect
    CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect
    CURLOPT_TIMEOUT => 120, // timeout on response
    CURLOPT_MAXREDIRS => 10, // stop after 10 redirects
    );
    $ch = curl_init();

    //set the url, number of POST vars, POST data
    curl_setopt($ch,CURLOPT_URL,$url);

    curl_setopt_array( $ch, $options );
    //execute post
    $result = curl_exec($ch);
    $header = curl_getinfo( $ch );
    echo $result;
    //close connection
    curl_close($ch);
    ?>

    Monday, July 5, 2010

    ape server ajax push engine

    APE server side module

    The APE module is the fastest, most modular and powerful way to exchange data between all users. With a APE module you can :

    • Push data to a client
    • Push data to a channel
    • Set property to user (for example user nickname)
    • Set property on channel (for example save last sent message on the channel)
    • Get information about users connected to APE
    • Get data from a MySQL server
    • Create a socket
    • Do many others things

    Wednesday, June 30, 2010

    ulip vs mutual fund......

    Mutual Fund are pure investments. ULIP are combination of Insurance and Investment.

    First question that we need to answer while buying ULIP is - Do I need to buy insurance?

    1) Does the person seeking insurance have any financial liabilities?
    2) If something happens to the person, Is there someone who can be in a financial crisis?

    1) Insurance
    ULIPs provide you with insurance cover.
    MFs don’t provide you with insurance cover.

    A point in favor of ULIPs. But let me tell you that you don’t get this insurance cover for free. Mortality charges (i.e. the price you pay for the insurance cover) get deducted from your investment.

    2) Entry Load
    ULIPs generally come with a huge entry load. For different schemes, this can vary between 5 to 40% of the first years premium.
    MFs do not have any entry load.

    Tax saving MF ( Popularly called as Equity Linked Saving Scheme or ELSS) come with a lock-in period of 3 years. Other MFs don’t have a lock-in period. Again MFs have advantage over ULIPs. ULIPs do allow you to take money out prematurely but they also put penalties on you for doing that.


    Friday, June 25, 2010

    shares

    1. You own a part of the business

    .

    The good news is, since you own part of the company, you are entitled to a share in its profits.

    The bad news is that you are also expected to bear the losses, if any.


    2. In the short-run, the price of the share can wildly fluctuate

    Let's say the company fixes the price of each share at Rs 10. This is called the face value of the share.

    When the share is traded in the stock market, this value may go up or down depending on supply of and demand for the stock.

    If everyone wants to buy the shares, the price will go up. If nobody wants to buy the shares, and many want to sell them, the price will fall.

    The value of a share in the market at any point of time is called the 'price of the share' or the 'market value of a stock'.

    A share with a face value of Rs 10 may be quoted at Rs 55 (higher than the face value) or even Rs 9 (lower than the face value).

    So you might have paid Rs 15 for a share which is now quoting at Rs 12. Don't panic and sell. If it is a good company, the share price will eventually rise.

    The prices will get influenced by the market sentiment and the general direction of the market. As a result, you may see short-term slumps.

    4. Decide how much you want to invest

    5. Don't rely solely on 'good advice'

    It doesn't matter who is buying the stock or who is recommending it. Steer clear of such ways of making a fast buck. These tips will land you in a soup.

    When you hear of a 'hot tip', dig further.

    6.. There are many things to remember when you buy shares. stop loss, short sell, Intraday, Delivery, Cash trade e.t.c.

    http://www.sharemarkettheory.blogspot.com




    Wednesday, June 23, 2010

    software architecture

    Software architecture is the set of decisions the software architect makes.

    The Role of the Software Architect

    Tuesday, June 22, 2010

    giving the demo of software

    • do's
    • demo is all about demonstrating your product
    • you will live or die by your product
    • you should believe in your product and its ability to shine ,so let it shine
    • gimmick to show value your product skit ,role playing,video etc.
    • a while few laugh keep the audience engaged
    • . Leave room for spontaneity (or at least appear like you have).
    • Have fun. DEMO is fun. That's why people like it
    • . Have a backup plan.
    • Practice piece by piece.
    • Practice in front of people.
    • Practice with distractions.
    • Find your speaking style
    • Practice hand gestures.
    • Find your comfort zone.
    donts
    • Don't praise your own product.
    • Don't use a tag line.
    • Don't say what you're looking for out of your DEMO.
    • Don't try to be funny if you aren't funny.
    • Don't sing.