Search This Blog

Thursday, August 30, 2012

Design Pattern Usefull Link

Design patterns are recurring/reusable solutions to a commonly software design problems you find again and again in real-world application development. Patterns are about design and interaction of objects, as well as providing a communication platform concerning elegant, reusable solutions to commonly encountered programming challenges.

Useful link for software design pattern is given below.....

http://www.dofactory.com/Patterns/Patterns.aspx

PHP basics


1.  In PHP 0 and FALSE are same when you will use == operator but not same when you will use === operator.=== operator checks the type and value so use === operator to check whether a function returns FALSE or not specially in case of those built in function those return FALSE in case of not finding desired result (e.g : stripos).
stripos returns FALSE if it can not find the desired needle in the haystack. so consider the following example.
//////////////////////////////
$haystack = "Basics of PHP";
$needle ="Basics";
if(stripos($haystack,$needle)==false)
echo "Match found";
///////////////////////////
This will output "Match found";
But the output should have been given if the the needle was not in the haystack. But since the needle (in this case "Basics") was in the 0 position of the haystack the stripos is returning 0. and we are using == operator . that means here false and 0 becomes same.
But if the code was like this
//////////////////////////////
$haystack = "Basics of PHP";
$needle ="Basics";
if(stripos($haystack,$needle)===false)
echo "Match found";
///////////////////////////
This will not output anything.

Wednesday, August 29, 2012

Project Management Plan(PMP)

                                                             Project Plan (Tree Structure):

1.      Project Initiation Documents
2.      Project Management
a.       Baseline
                                                                                                                                      i.      Project Management Plan
                                                                                                                                    ii.      Schedule
b.      Plan
c.       Review
3.      Requirements
a.       Baseline
                                                                                                                                      i.      Requirement Specification
                                                                                                                                    ii.      Change Requests
b.      Working
c.       Review
4.      Design
a.       Baseline
                                                                                                                                      i.      HLD
                                                                                                                                    ii.      LLD
                                                                                                                                  iii.      Class Models
b.      Working
c.       Review
5.      Source
a.       Baseline
                                                                                                                                      i.      User Interface (Forms, Report Layouts)
                                                                                                                                    ii.      Business Layer (Procedures, Functions, Triggers)
                                                                                                                                  iii.      Database Scripts (Table structures)
b.      Working
c.       Review
6.      QCT / Testing
a.       Baseline
                                                                                                                                      i.      Unit Testing
                                                                                                                                    ii.      Functional/Integration Testing
b.      Working
c.       Review
7.      Manuals
a.       Baseline
                                                                                                                                      i.      User Manual
                                                                                                                                    ii.      Operational Manual
                                                                                                                                  iii.      Technical Manual
                                                                                                                                  iv.      Training Manual
b.      Working
c.       Review

Jquery:Popup-2

 Jquery Reference:
 
    jquery-1.4.2.min.js
    jquery.simplemodal-1.4.2.js

Html Code For Popup Div:

<div id="basic-modal-content"  style="height: 323px">
                        <div id="detaildata" style="overflow: auto;height: 320px">
                        </div>
</div>

CSS:
#basic-modal-content {display:none;}

/* Overlay */
#simplemodal-overlay {background-color:#000; cursor:wait;}

/* Container */
#simplemodal-container {height:360px; width:600px; color:Black; background-color:#78C4FF; border:4px solid #444; padding:12px;}
#simplemodal-container .simplemodal-data {padding:8px;}
#simplemodal-container code {background:#141414; border-left:3px solid #65B43D; color:#bbb; display:block; font-size:12px; margin-bottom:12px; padding:4px 6px 6px;}
#simplemodal-container a {color:Lime;}
#simplemodal-container a.modalCloseImg  {background:url(x.png) no-repeat; width:25px; height:29px; display:inline; z-index:3200; position:absolute; top:-15px; right:-16px; cursor:pointer;}
#simplemodal-container h3 {color:#84b8d9;}

Add Image:




HTML Button for popup:


<input value="popup" onclick="divpopup();return false;" type="submit">
 
javascript Function: 
 
       function divpopup()  {
        $('#basic-modal-content').modal();           
       }

Jquery:Popup-1

Jquery Reference:
       jquery-1.4.2.min.js
       jquery.helper.js

CSS:

/* Panel styles start */
.popup
{
    font-family: arial,helvetica,clean,sans-serif;
    font-size: small;
    padding: 2px 3px;
    display: block;
    position: absolute;
    z-index:1;
}

.container
{
    border: solid 1px #808080;
    border-width: 1px 0px;
}

.header
{
    background:url(images/top-bg.gif) repeat-y;
    border-color: #808080 #808080 #ccc;
    border-style: solid;
    border-width: 0px 1px 1px;
    padding: 3px 10px;
    text-align:left;
}

.popup .header .msg
{
    font-weight: bold;
}        

.popup .body
{
    background-color: #f2f2f2;
    border-color: #808080;
    border-style: solid;
    border-width: 0px 1px;
    padding: 10px;
}

.popup .body .msg
{
    font-family: arial,helvetica,clean,sans-serif;
    font-size:small;
   
    background: url(sprite.png) no-repeat 0px -1150px;     
    float: left;
    padding-left: 22px;
   /* */

.popup .footer
{
    background: url(sprite.png) repeat-x 0px -200px; 
   

    text-align:right;
    padding-top: 4px;
    padding-bottom: 4px;
    padding-right: 8px;
}

.popup .close
{
    right: 7px;  
    background: url(sprite.png) no-repeat 0px -300px;
    width: 25px; 
    cursor: pointer;   
    position: absolute;
    top: 7px;    
    height: 15px;
}

.button_popup
{
    cursor: pointer;
    border-width:1px;
    background-color:#f2f2f2;
    border-color:#808080;
}


.bodybox {
    background:#FFF!important;
    padding:10px;
   
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    -khtml-border-radius: 5px;
    border-radius: 5px;
    behavior: url(border-radius.htc);
   
    -moz-box-shadow: 0 0 5px #000; /* Firefox */
     -webkit-box-shadow: 0 0 5px #000; /* Safari, Chrome */
     box-shadow: 0 0 5px #000; /* CSS3 */
      behavior: url(ie-css3.htc);
      width:96%;
      margin-left:auto;
      margin-right:auto;
}
/* Panel styles end */





HTML Code For Popup Div:

     <div id="divSimplePopup" class="popup" style="display: none; width: 540px; top: 278px;
            left: 151px; height: 334px;">
            <div class="container">
                <div class="bodybox">
                    <div id="g"  style="height: 289px; overflow: auto;" class="footer">
                        <div class="header" style="background-color: #003399">
                            <span id="lblPopupHeader" class="msg" style="color: #FFFFFF; font-family: Arial, Helvetica, sans-serif">
</span>
                        </div>
                        <div id="detaildata" style="overflow: auto;height: 239px">
                        </div>
                    </div>
                    <div class="footer">
                        <input class="button" id="btnCancel" onclick="$('#divSimplePopup').hideModal(); return false;"
                            type="submit" value="Cancel" />
                    </div>
                    
                </div>
            </div>
        </div>

HTML Button for popup:

<input value="popup" onclick="divpopup();return false;" type="submit">
 
javascript Function: 
 
       function divpopup()  {
        $('#divSimplePopup').showModal();           
       }
 

Software Architecture Diagrams


Tuesday, August 28, 2012

Get selected checkbox row from datagrid by jquery

HTML Code:


<asp:DataGrid ID="dgdProduct" runat="server"  >
                 <Columns>
                         <asp:TemplateColumn>
                                <ItemTemplate>
                                      <asp:CheckBox ID="chkP" runat="server"     />
                                     <input id="hdID" type="hidden"  value='<%# Eval("pCode") %>' />
                                    </ItemTemplate>
                           </asp:TemplateColumn>
                           <asp:BoundColumn DataField="pDescription" HeaderText="Product Description">
                              </asp:BoundColumn>
                             <asp:BoundColumn DataField="Quantity" HeaderText="Quantity">
                            </asp:BoundColumn>
                          </Columns>
 </asp:DataGrid>

JQuery Code:

         var $table = $("#dgdProduct"),
              $headerCells = $table.find("thead th"),
              $rows = $table.find("tbody tr");
          var   rows = [];
          var isChecked;
          var pcode;
         var pDescription;
          $rows.each(function(row, v) {
              var $td = $(this).closest('tr').children('td');
              $td.find("input:checkbox").each(function() {
                  isChecked = $(this).attr('checked');
                
              });

              if ($td.length > 0) {
                  if (isChecked == true) {
                      pcode= $td.find('input:hidden[id$=hdID]').val();
                    pDescription=$td.eq(1).text() ;
                  }
              }
          });