Category Archives: FromSitesTree.com

Home Automation Products #111

Home Automation Products

   <h2>Electrical Power Line Based Products</h2>       <p>         X10 is the most reputable company in manufacturing power line based home automation products. Their products range from lighting control, temperature control to home security system.          They also manufacture different kind of sensors for home, building, and industry automation. For a complete product list please checkout the banner below. To see products on sale please click here <a href='http://www.dpbolvw.net/click-1695344-10371093' target='new' rel="noopener">Home Automation Products on Sale by X10</a>       </p>                                    <h2>Home Automation Products</h2>       <ul>           <li><a href="http://www.amazon.com/exec/obidos/redirect?link_code=ur2&tag=onlinebuysale-20&camp=1789&creative=9325&path=tg/browse/-/11040111">Recommended: Home Automation and Security</a><img src="http://www.assoc-amazon.com/e/ir?t=onlinebuysale-20&l=ur2&o=1" width="1" height="1" border="0" alt="" style="border:none !important;margin:0px !important" />       </li></ul>      <h2>GPS Based Outdoor and Indoor Application Products</h2>      <p>         Garmin is the industry leader in manufacturing GPS based automation products. Check the Garmin products as listed below:        </p>                             From: http://sitestree.com/?p=5309<br /> Categories:111<br />Tags:<br /> Post Data:2007-05-09 21:01:25<br />

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Middleware for Sensor Networks #111

Middleware for Smart Environments [jCook:05][on going] Smart Environment Components:

  • Sensor Hardware
  • Sensor Software
    • Both help in perceiving/sensing the environment
  • Application Software
    • Interprets and reasons about the perceived data
  • Effector Control Software
    • Act on the environment
  • Some Support Systems

Smart Environment Implementation Layers:

  • Hardware layer
  • Operating System Layer
  • Middleware Layer
  • Application Software Layer

Middleware Layer:

Acts between Operating System layer and Application software layer. Lies between the software applications it assists and the platform it is based on.

               <b>Middleware layer provides supports like:</b>                     <ul>                            <li> Facilitate Rapid Development                           </li><li> Easy of Integration                           </li><li> Improved Reliability                          </li><li> Increased Scalabilit                          </li><li> Transparency                          </li><li> Interoperability                      </li></ul>                  <b>Some Points</b>                  <ul>                        <li> These supports/services will help smart environment possible.                      </li><li> These middleware services may be implemented as part of the Operating System                      </li><li> Some middleware services may be implemented as part of the Application Softwares themselves                       </li><li> But to make the smart environment practical a separate and generalized middleware layer providing the above services is more desireable that can enhance rapid and easy smart application development using these service components.                     </li><li> Middleware can be a single layer above operating system or can be an additional layer on an existing middleware layer. Purpose is providing more abstractions to the applications.                        </li><li> Middleware framework is another concept that can combine more than one middleware components and services to provide additional services or to provide interoperability among those middlewares                       </li><li> From the developers viewpoint: Middleware will provide some API to be used by application developers. Also a middleware will have some protocols (rules and components supported)                 </li></ul>              <b>Evolution of Middleware:</b>             <p>Middleware is mostly about communication.</p>                <p>Step 1: using of punch card programming: using punch cards/even flipping switches for programming</p>                <p>Step 2: Using of MainFrame Computer: Computing done in a central place. Users interact through terminals</p>             <p>Step 3: File sharing architecture:  With the invent of PCs File sharing architecture evolved. PCs download files from shared locations,                  perform jobs and submit to the shared locations. Over time the PC LAN became over crowded for this paradigm.</p>                <p>Step 4: Client-server architecture evolved. File servers were replaced by database servers who respond to users requests and supply only the required data rather than total file. Network load decreased</p>                    Two Forms of Client-server architecture:                        <ol>                            <li> Two Tier                           </li><li> Three Tier                        </li></ol>              <p><b>Two Tier:</b> Client layer(Sytem Interface) and a Server layer (DBMS). An additional component that is shared by the two layers mainly for process management:initiation, conduct and publish of the results. Resource management, adjust to client's capability.</p>             <p><b>Three Tier:</b> The shared component in the two tier architecture is given the form of a 3rd layer in between client and server layers.   This additional layer takes care of</p>                 <ul>                        <li> Process Management by providing logic and rules to control job processing                      </li><li> Queueing of messages                  </li></ul>              <p>This additional layer helps in</p>                   <ul>                        <li> increasing the number of clients it can handle                     </li><li> increased performance                     </li><li> system's flexibility improvement                      </li><li> maintainability, reusability, scalability                 </li></ul>              <p>This architecture has become the basis for many middleware solutions. We can think the additional layer in between client and server layer as the middleware layer.</p>              <b>Middleware Framework:</b>                    <p>Middleware Frameworks usually target at some specific application domains. They consist of software environments that provide</p>                        <ul>                            <li> An API                         </li><li> A User Interface                          </li><li> Tools for application development                         </li><li> Tools for System Management                       </li></ul>                  <p>Frameworks can provide their own private middlewares. Frameworks can also utilize other commonly available middleware services for that application domain. For a specific domain,                   a framework usually provides better solutions than general middlewares as they are especially designed for that domain. It is usuaaly easier for the developers to use frameworks for application development and testing. Frameworks can also be called middlewares themselves because they provide the same/similar purpose. Many middlewares do not have any visible part but frameworks usually have visible parts.</p> From: http://sitestree.com/?p=5147<br /> Categories:111<br />Tags:<br /> Post Data:2010-10-05 12:42:08<br />

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Sensor Network Software #111

Sensor Network Software

     <h2>For Mica Platform MOTE-VIEW 1.0 Data Logging and Monitoring UI </h2>        <p> MOTE-VIEW is a software tool that provides graphical interface and client application between a user and a deployed network of wireless sensors motes. To read details about moteviw <a href='http://www.tinyos.net/scoop/story/2005/5/3/175612/6998'>click here</a>        </p>           <ul>                <li> <a href='http://www.xbow.com/Products/productsdetails.aspx?sid=88'>MoteView Features</a>             </li><li> <a href='http://www.tinyos.net/scoop/story/2005/5/3/175612/6998'>MoteView Overview</a>            </li></ul>       <p>          <ul>              <li> <a href='http://www.xbow.com/Support/downloads.htm'>Download MoteView</a>       </li></ul>         </p>       <h2>Important Links on Sensor Hardware</h2>     <p>       <ul>              <li> <a href='http://computer.howstuffworks.com/mote.htm'>How Motes Work</a>          </li></ul>        </p>        <h1>Faqs about Motes</h1>       <h2>How does Mica2/Mica2Dot radio modules work?</h2>            <ul>                <li> <a href='http://www.tinyos.net/tinyos-1.x/doc/mica2radio/CC1000.html' target='new' rel="noopener">Radio Stack (CC1000) for Mica2/Mica2Dot</a>           </li></ul>      <h2> Data Size? </h2>       <h2>What MAC algorithm is used on the your-favorite-mote Mote?</h2>     <p>     "Mostly CSMA. One version found on stacks before 1.1.3 and B-MAC found on radio stacks from 1.1.3"      </p>        <p><a href='http://www.tinyos.net/faq.html#SEC-76'>Read Details about Mote MAC Protocol</a></p> From: http://sitestree.com/?p=5306<br /> Categories:111<br />Tags:<br /> Post Data:2011-09-26 17:52:43<br />

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Sensor Network Operating Systems #111

Sensor Network Operating Systems

<ul>       <li> TinyOS     </li><li> SOS       </li><li> MagnetOS    </li></ul>    <h2>TinyOS</h2>    <p>    Mica2 sensors run the TinyOS [Levis:04] operating system. TinyOS is an open-source operating system especially designed for wireless sensor networks. It is a component-based operating system, hence programmers can integrate only the needed components to keep the code size small. Thus it is suitable for resource-constrained sensor networks. TinyOS models an event-driven execution, and includes power management and flexible scheduling to support unpredictable wireless  communications and physical world interfaces. The component library includes "network protocols, distributed services, sensor drivers, and data acquisition tools". The components and the modules can be used as it is or can be modified to fit into the custom applications includements. [<a href='http://www.tinyos.net/special/mission'>details</a>]    </p>    <ul>       <li><a href='http://www.cis.upenn.edu/~lee/04cis640/slides1/TinyOS.pdf'>TinyOS Features</a>        </li><li><a href='http://www.cs.virginia.edu/~cl7v/cs851-talks/tinyos_tian.ppt'>How TinyOS Works? Discussion with Example Program and OS Modules</a>      </li><li><a href='http://userfs.cec.wustl.edu/~cse730/tinyos_radio_stack.ppt'>A few TinyOS Features</a>    </li></ul>   <h2>SOS</h2>    <p><a href='http://nesl.ee.ucla.edu/projects/SOS/'>SOS is developed by the Networked and Embedded Systems Lab (NESL) at UCLA. SOS is designed for "mote-class wireless sensor networks". SOS kernel implements "messaging, dynamic memory, module loading and unloading, and other services". SOS uses a dynamic model that allows program changes on the fly and supports concurrent applications. SOS allows dynamic loading of software modules to create a system "supporting dynamic addition, modification, and removal of network services".</a></p>    <p><a href='http://nesl.ee.ucla.edu/projects/SOS/'>DETAILS about SOS</a></p>   <ul>        <li> <a href='http://www.cs.ucla.edu/~kohler/pubs/han05dynamic.pdf'>A paper discussing the design of SOS and comparison between TinyOS and SOS</a>    </li></ul> From: http://sitestree.com/?p=5307<br /> Categories:111<br />Tags:<br /> Post Data:2009-10-19 07:10:41<br />

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Middleware for Smart Environments #111

Middleware for Smart Environments [jCook:05][on going]

         <h2>Smart Environment Components:</h2>              <ul>                    <li> Sensor Hardware                    </li><li> Sensor Software                       <ul>                            <li> Both help in perceiving/sensing the environment                        </li></ul>                  </li><li> Application Software                      <ul>                            <li> Interprets and reasons about the perceived data                        </li></ul>                  </li><li> Effector Control Software                     <ul>                            <li> Act on the environment                     </li></ul>                  </li><li>Some Support Systems               </li></ul>              <h2>Smart Environment Implementation Layers:</h2>                   <ul>                        <li> Hardware layer                     </li><li> Operating System Layer                        </li><li> Middleware Layer                      </li><li> Application Software Layer                    </li></ul>              <h2>Middleware Layer:</h2>                  <p>Acts between Operating System layer and Application software layer. Lies between the software applications it assists and the platform it is based on.</p>                   <h2>Middleware layer provides supports like:</h2>                       <ul>                            <li> Facilitate Rapid Development                           </li><li> Easy of Integration                           </li><li> Improved Reliability                          </li><li> Increased Scalabilit                          </li><li> Transparency                          </li><li> Interoperability                      </li></ul>                  <h2>Some Points</h2>                    <ul>                        <li> These supports/services will help smart environment possible.                      </li><li> These middleware services may be implemented as part of the Operating System                      </li><li> Some middleware services may be implemented as part of the Application Softwares themselves                       </li><li> But to make the smart environment practical a separate and generalized middleware layer providing the above services is more desireable that can enhance rapid and easy smart application development using these service components.                     </li><li> Middleware can be a single layer above operating system or can be an additional layer on an existing middleware layer. Purpose is providing more abstractions to the applications.                        </li><li> Middleware framework is another concept that can combine more than one middleware components and services to provide additional services or to provide interoperability among those middlewares                       </li><li> From the developers viewpoint: Middleware will provide some API to be used by application developers. Also a middleware will have some protocols (rules and components supported)                 </li></ul>              <h2>Evolution of Middleware:</h2>               <p>Middleware is mostly about communication.</p>                <p>Step 1: using of punch card programming: using punch cards/even flipping switches for programming</p>                <p>Step 2: Using of MainFrame Computer: Computing done in a central place. Users interact through terminals</p>             <p>Step 3: File sharing architecture:  With the invent of PCs File sharing architecture evolved. PCs download files from shared locations,                  perform jobs and submit to the shared locations. Over time the PC LAN became over crowded for this paradigm.</p>                <p>Step 4: Client-server architecture evolved. File servers were replaced by database servers who respond to users requests and supply only the included data rather than total file. Network load decreased</p>                    Two Forms of Client-server architecture:                        <ol>                            <li> Two Tier                           </li><li> Three Tier                        </li></ol>              <p><b>Two Tier:</b> Client layer(Sytem Interface) and a Server layer (DBMS). An additional component that is shared by the two layers mainly for process management:initiation, conduct and publish of the results. Resource management, adjust to client's capability.</p>             <p><b>Three Tier:</b> The shared component in the two tier architecture is given the form of a 3rd layer in between client and server layers.   This additional layer takes care of</p>                 <ul>                        <li> Process Management by providing logic and rules to control job processing                      </li><li> Queueing of messages                  </li></ul>              <p>This additional layer helps in</p>                   <ul>                        <li> increasing the number of clients it can handle                     </li><li> increased performance                     </li><li> system's flexibility improvement                      </li><li> maintainability, reusability, scalability                 </li></ul>              <p>This architecture has become the basis for many middleware solutions. We can think the additional layer in between client and server layer as the middleware layer.</p>              <h2>Middleware Framework:</h2>                  <p>Middleware Frameworks usually target at some specific application domains. They consist of software environments that provide</p>                        <ul>                            <li> An API                         </li><li> A User Interface                          </li><li> Tools for application development                         </li><li> Tools for System Management                       </li></ul>                  <p>Frameworks can provide their own private middlewares. Frameworks can also utilize other commonly available middleware services for that application domain. For a specific domain,                   a framework usually provides better solutions than general middlewares as they are especially designed for that domain. It is usuaaly easier for the developers to use frameworks for application development and testing. Frameworks can also be called middlewares themselves because they provide the same/similar purpose. Many middlewares do not have any visible part but frameworks usually have visible parts.</p> From: http://sitestree.com/?p=5308<br /> Categories:111<br />Tags:<br /> Post Data:2010-03-03 03:53:50<br />

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Sensor Network Operating Systems #111

<b>Sensor Network Operating Systems</b>    <ul>     <li> TinyOS     </li><li> SOS       </li><li> MagnetOS    </li></ul>    <b>TinyOS</b>    

Mica2 sensors run the TinyOS [Levis:04] operating system. TinyOS is an open-source operating system especially designed for wireless sensor networks. It is a component-based operating system, hence programmers can integrate only the needed components to keep the code size small. Thus it is suitable for resource-constrained sensor networks. TinyOS models an event-driven execution, and includes power management and flexible scheduling to support unpredictable wireless communications and physical world interfaces. The component library includes "network protocols, distributed services, sensor drivers, and data acquisition tools". The components and the modules can be used as it is or can be modified to fit into the custom applications requirements. [details]

<ul>      <li><a href='http://www.cis.upenn.edu/~lee/04cis640/slides1/TinyOS.pdf'>TinyOS Features</a>        </li><li><a href='http://www.cs.virginia.edu/~cl7v/cs851-talks/tinyos_tian.ppt'>How TinyOS Works? Discussion with Example Program and OS Modules</a>      </li><li><a href='http://userfs.cec.wustl.edu/~cse730/tinyos_radio_stack.ppt'>A few TinyOS Features</a>    </li></ul>   <b>SOS</b>  <p><a href='http://nesl.ee.ucla.edu/projects/SOS/'>SOS is developed by the Networked and Embedded Systems Lab (NESL) at UCLA. SOS is designed for "mote-class wireless sensor networks". SOS kernel implements "messaging, dynamic memory, module loading and unloading, and other services". SOS uses a dynamic model that allows program changes on the fly and supports concurrent applications. SOS allows dynamic loading of software modules to create a system "supporting dynamic addition, modification, and removal of network services".</a></p>    <p><a href='http://nesl.ee.ucla.edu/projects/SOS/'>DETAILS about SOS</a></p>   <ul>        <li> <a href='http://www.cs.ucla.edu/~kohler/pubs/han05dynamic.pdf'>A paper discussing the design of SOS and comparison between TinyOS and SOS</a>    </li></ul> From: http://sitestree.com/?p=5145<br /> Categories:111<br />Tags:<br /> Post Data:2010-05-12 12:28:59<br />

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Commercial Content Management Systems #113

From: http://sitestree.com/?p=5191
Categories:113
Tags:
Post Data:2011-10-20 00:35:51

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Bring contents/articles to wordpress #113

Just an overview.

  • I took all of my short-notes from http://computer.justetc.net to http://www.justetc.net/sayedblog: wordpress blog
  • How? take your categories into wp_categories table. You can take all your categories from your current web-site/source/database into wordpress in this way.
  • You may bring both databases under the same MySQL host/server. Will facilitate to write queries to transfer data.
  • Take all your articles/contents into wp_posts table. Map right - your table fields and wp_posts table fileds. You can use insert into wp_posts.......select.....from your table . You know what I mean.........
  • Create articles and categories - mapping - in wp_post2cat table
  • You may update wp_categories table to reflect the number of articles under that category
  • In wp_posts table- guid field need to be appropriately generated. You can write a script to create guid/actually the article url - using wordpress existing functions such as get_permalink(), and write_posts() functions
  • You can also create guid manually. After you transfer your data into wp database, from wp-admin window, open each article by clicking the edit button and click on the save option. GUID will be generated. Article links will work
  • You can also do such for categories. Open all categories one by one using the edit option, and then click on the save option. From your blogs the categories will also work.

I know: creating another site with the same contents is not something that search engines love. What you can do, you can point your guide to your original location if you need both. For me, I wanted to link to my short-notes from linkedin.com, linkedin.com can display your blog contents/feeds in your linkedin home page - but your blog has to be in wordpress or in blog link...so you know where I am going to. Alternatively, you can write an application for linkedin that can display feeds from your type of blogs - or you can write a very customizable application that can ask for content source/type, db type, db name, table fields, password if any, and can show contents from the source. RSS feed should work - a simple way From: http://sitestree.com/?p=5215
Categories:113
Tags:
Post Data:2011-12-07 03:19:01

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Open Source Content Management Systems #113

Drupal, Joomla, Plone, WordPress are some good names. xCatalyst is another one. You can find more information on your CMS at (under this web-site): http://justetc.net/knowledge/searchResult.php?queryStr=cms&submit=Search+Database

Check the following resources for more information on CMSs. Later come back to our web-site and refer our web-sites to your friends.

  • http://geeksandgod.com/forum/calendar-drupal
  • http://www.linux.com/feature/60948
  • http://www.alledia.com/blog/general-cms-issues/joomla-and-drupal-which-one-is-right-for-you/
  • http://wordpress.org/extend/plugins/events-calendar/
  • http://wordpress.org/extend/plugins/events-calendar/
  • http://codex.wordpress.org/Photoblogs_and_Galleries
  • http://www.joomlashack.com/tutorials/158-creating-a-blog-site-with-joomla
  • http://extensions.joomla.org/extensions/content-&-news/random-news
  • http://www.esxinc.com/images/ESX/Documents/xCatalyst-Modules-Summary.pdf

From: http://sitestree.com/?p=5190
Categories:113
Tags:
Post Data:2012-11-28 18:09:37

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

OpenCMS Resources #113

Some Topics to Learn in OpenCMS

  • Installing OpenCms, and its basic concepts
  • Using the OpenCms Workplace
  • Exploring the core architecture and the virtual file system
  • Working with JSP templates
  • Creating OpenCms modules
  • Adding custom resource types
  • Exporting to static HTML
  • Deploying and managing an OpenCms website

From: http://sitestree.com/?p=5174
Categories:113
Tags:
Post Data:2007-10-29 05:54:56

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

ddd #113

dd From: http://sitestree.com/?p=5188
Categories:113
Tags:
Post Data:2011-12-03 11:49:52

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Add Calendar/Event Support in Drupal #113

Required modules: Views, Date, Calendar, cck (content), Text, Node Reference, Options Widgets. You can download the modules from drupal web-site. For calendar, http://drupal.org/project/calendar. For date replace calendar with date in the previous url (http://drupal.org/project/calendar => date). For views, replace with views.

How to install: unzip and upload to the modules folder in the Drupal installation. Afterward, from Site Building -> Modules under Administration (in Drupal), check these modules (and also check them on what these modules are dependent)

How to work? Areas you need to play with to have customized calendars/event calendars for your site:

  • Administer->Site Building->Views
  • Site Configuration -> Date and Time
  • Administer -> Content Management -> Date Tools
  • You have to create calendar styles/customized calendars using the above options. The you will see an option under create content to create calendars for your web-site.
  • using site building -> Blocks, you can place these calendars any where you want
  • You can also embed calendars in pages

From: http://sitestree.com/?p=5189
Categories:113
Tags:
Post Data:2011-03-11 23:37:06

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Joomla in Use: Who uses Joomla #113

Who uses Joomla

  • Magazine publishing companies: http://www.yourwedding.com.au/
  • A medium-sized municipality in Florida: www.longwoodfl.org
  • A public library in metro Detroit: www.ropl.org
  • An interconnectivity service company: www.telx.com
  • A community/news site about Macs: www.nzmac.com
  • A community site about smartphones: www.everythingtreo.com

Some Third Party Joomla Components that are used frequently:

  • Bookmarks component (www.tegdesign.ch)
  • Community Builder (www.joomlapolis.com)
  • eXiT-Poll (www.phpprojects.net)
  • Google Maps (www.atlspecials.com/index.php?option=com_google_maps&Itemid=36)
  • JA Submit (www.joomlart.com)
  • JCal Pro (dev.anything-digital.com)
  • JCE Editor (http://www.cellardoor.za.net/jce/)
  • JomComment (www.azrul.com)
  • joomlaXplorer (http://developer.joomla.org/sf/projects/joomlaxplorer)
  • Knowledgebase (www.phil-taylor.com)
  • mosDirectory (www.phil-taylor.com)
  • OpenSEF (www.j-prosolution.com)
  • OpenWiki (www.j-prosolution.com)
  • Phil-A-Form (www.phil-taylor.com)
  • RSS XT (www.nodetraveller.com)
  • SMF Bridge (www.simplemachines.org)
  • YaNC (www.joomla-addons.org)
  • Mambots of Interest
  • TagBot (www.fijiwebdesign.com)

Reference: Book: Joomla! A User's Guide: Building a Successful Joomla! Powered Website: by Barrie M. North

From: http://sitestree.com/?p=5173
Categories:113
Tags:
Post Data:2012-01-09 07:53:07

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Localization in Web Crossing #113

Not well written, but should make sense.Web Crossing maintains a list of words/strings that can be displayed in any language. Usually, these words/strings have a key and a value, these words/strings are kept in a file+database showing relationships between the keys and values.If you want to change the language for the keys, you need to change the values with the new language. Web pages use the keys for these strings in programming, and to users these strings get replaced by the values. Hence, you see them in a new language.

To support a new language, you need to change the values of these strings. In web-crossing, you can change them in a file, using web-forms, or using spreadsheets. You can make the total site in a new language or you can make one particular feature/application in a new language. In web crossing, there are features to add new languages using ISO language codes and ISO country codes. You also need to specify a char-set that supports your language.

Please check this link for details

From: http://sitestree.com/?p=5166
Categories:113
Tags:
Post Data:2010-11-24 07:14:00

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

What is Virtualization? What is VMWare #118

From: http://sitestree.com/?p=5194
Categories:118
Tags:
Post Data:2010-06-07 19:34:16

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

What is Cloud Computing? #118

From: http://sitestree.com/?p=5195
Categories:118
Tags:
Post Data:2008-01-18 07:19:49

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Load Balancing with CISCO Routers #114

Load Balancing with CISCO Routers:
What is load balancing?
Simply, distributing the traffic across multiple different paths/destinations. The definition is context-specific as well. For example, if you provide a web-service, you can use multiple servers to provide the service. Then for you, load balancing can be simply distributing the incoming service request across these servers (than just to one server). For the network operators (say the internet operators), load balancing can be distributing the network traffic across multiple paths so that some paths are not congested (traffic is even across the internet backbone).

"A definition from the online Wikipedia:
In computer networking, load balancing is a technique to distribute workload evenly across two or more computers, network links, CPUs, hard drives, or other resources, in order to get optimal resource utilization, maximize throughput, minimize response time, and avoid overload. Using multiple components with load balancing, instead of a single component, may increase reliability through redundancy. The load balancing service is usually provided by a dedicated program or hardware device (such as a multilayer switch or a DNS server).

It is commonly used to mediate internal communications in computer clusters, especially high-availability clusters. If the load is more on a server, then the secondary server takes some load while the other is still processing requests" [http://en.wikipedia.org/wiki/Load_balancing_%28computing%29]

Check: http://www.google.com/search?hl=en&defl=en&q=define:Load+balancing+&ei=7SKUS-v9O4nqM8GqiY0N&sa=X&oi=glossary_definition&ct=title&ved=0CBQQkAE

Some resources for Load Balancing with CISCO Routers:
Before pointing you to the resources, some notes

  • If you go through an undergraduate program in Computer Science, you will know the theory behind most of the protocols as will be named in the resources. If you go through the materials for Cisco certifications, you will know the IOS commands to deal/interact with the protocols (configure the protocols in real life situations).
  • Universities may not give you an opportunity in your undergraduate program to deal with real-life routers, and play with the routing protocols. If they would (even as an extra facility not part of your courses) that could be something very useful for your career (esp. when network/telecommunications oriented) (could even make you more interested in networking/inter-networking careers).
  • However, universities may teach you writing prototype network software, network protocols, and components for network operating systems. Universities will also teach you the graph theory, queuing theory, and analysis of network protocols. These are must know to write routing/networking protocols. The people who write the network operating systems, and/or network/routing protocols are mostly from theoretical (university) backgrounds. Even if your interests are to implement routing logic in hardware, and designing and implementing routers, university education (in Comp. Eng.) will be of more help than Cisco Certification materials (knowing these materials will always be a plus)
  • (Limited Opportunities): If your intentions are to come up with new and better routing protocols, improve the efficiency of the existing protocols, and even discover new routing protocols for newer computing platforms (such as Sensor Networks, Zigbee, VOIP, and similar), you will mostly require to go through research based Masters and PhD programs in Computer Networking and related [In another word, graduate studies (in networking) focus on these (Improving existing protocols, network standards, inter-networking standards, data transfer methods, routing. Also, discovering new protocols, network standards, inter-networking standards, data transfer methods, routing, and related].

From: http://sitestree.com/?p=4772
Categories:114
Tags:
Post Data:2009-07-10 03:43:33

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Some recent stuff #124

  • Reviewed C++ from http://gd.tuwien.ac.at/languages/c/c++oop-pmueller/tutorial.html. Working with a research project in electromagnetics and dealing with a tricky issue with multiple header files, typedef on templates, templates, pointers, and similar - could solve finally.
  • C++ had to solve error like: uninitialized reference member `Edge::v1' - subclass base class constructor reference related issue
  • PHP Work: Image manipulation, image resize, image upload. Used the code from http://www.kavoir.com/2009/01/php-resize-image-and-store-to-file.html and edited. Also, made it work for different types of images. Search php.net for image manipulation functions.
  • C#: Had to use code to shuffle an array: code utilized from: http://dotnetperls.com/shuffle-array

From: http://sitestree.com/?p=5241
Categories:124
Tags:
Post Data:2008-09-04 01:57:28

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Current PHP Contract Project #124

  • Teach English in Korea: http://www.teacheslkorea.com/: Worked on this project for the last 6 - 7 months on PHP, MySQL, HTML, CSS, JavaScript, Dreamweaver, and Eclipse PDT. Currently working on it as an independent contractor. I worked and working with all aspects of the backend - teacher, school, administrator, job board, tracking, reporting, searching, teacher representative, school-representative related functions and operations. And yes, I also do the maintenance of the web-site and web-hosting.

From: http://sitestree.com/?p=5243
Categories:124
Tags:
Post Data:2011-10-15 00:27:41

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Github Git and Creating an Internet Traffic System #126

Github Git and Creating an Internet Traffic System
From: http://sitestree.com/?p=5345
Categories:126
Tags:
Post Data:2010-09-12 13:40:25

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

How to capture screen and webcam. How to create training videos #126

You can use tools such as Camtasia Studio. It is great. Can capture screen and from the webcam at the same time. Video editing features are also great. However, kinda pricy

Or use one of the following free tools.

From: http://sitestree.com/?p=5341
Categories:126
Tags:
Post Data:2007-12-03 13:05:20

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

JavaScript Miscellaneous Topics #13

JavaScript Miscellaneous Topics. Please check below.

  • Detect browser name and version:
                    var browser=navigator.appName;                var b_version=navigator.appVersion;           
  • Other browser related: navigator.appCodeName, navigator.platform, navigator.platform , navigator.cookieEnabled , navigator.userAgent, navigator.appMinorVersion, navigator.cpuClass, navigator.onLine, navigator.browserLanguage, navigator.systemLanguage, navigator.userLanguage
  • It's a good idea to use escape function for setting cookie values (if more than one word). Also, use unescape function on the value when you want to use the value (situation dependent)
  • Animating a button: Place a button, onmouseover event replace the button image with a highlighted button image, on mouse out event - go back to the original button image
    hello
    Place the following code under script tag/in a javascript filefunction mouseOver(){ document.getElementById("b1").src ="b_blue.gif";}function mouseOut(){ document.getElementById("b1").src ="b_pink.gif";}
  • Example: Using Map, Area, and MouseOver Event
    target
  • Display an alert box after 5 seconds: var t=setTimeout("alert('Time is over!')",5000);
  • Change document content after different time intervales
    var t1=setTimeout("document.getElementById('id1').value='2 seconds!'",2000);var t2=setTimeout("document.getElementById('id1').value='4 seconds!'",4000);var t3=setTimeout("document.getElementById('id1').value='6 seconds!'",6000);
  • Reset time out: t=setTimeout("alert('Time is over!')",5000); clearTimeout(t);
  • Javascript Objects:
    Direct Instance: pObj=new Object();pObj.firstname="John";pObj.lastname="Doe";pObj.age=50;pObj.eyecolor="blue";document.write(pObj.firstname + " is " + pObj.age + " years 
  • Object template
    function car(brand,make,model){this.brand=brand;this.make=make;this.model=model;}var myCar=new car("Honda","2009","Accord");document.write(myCar.brand +  myCar.make + myCar.model );
  • JavaScript Error Handling: Try/Catch:
    try{}catch(err){}
  • JavaScript OnError Event: You can define a function in JavaScript code that will be always called if any javascript error.
    Under script tag/javascript file_onerror=handleErr;var alertTxt = "" function handleErr(msg, url, l){   alertTxt = "Error Information:.nn";   alertTxt += msg + "n";   alertTxt += url + "n";   alertTxt += l + "nn";   alertTxt += "Click OK to continue.nn";   alert(alertTxt);   return true;}
  • Javascript Advanced For loop:
    var x;var myFriends= new Array();myFriends[0] = "Shafiq";myFriends[1] = "Rafiq";myFriends[2] = "Abba";myFriends[3] = "Amma";for (x in myFriends){   document.write(myFriends[x] + "
    ");}
  • JavaScript Alert Box:alert("Alert box with new line" + 'n' + "in a new line!");
  • JavaScript Confirm Box:var con = confirm("Press a button");
  • JavaScript Prompt Box: Take Input from User:var name=prompt("Please enter your name","Harry Potter");
  • JavaScript Random Number: var rNumber = Math.random();
  • JavaScript Switch Statement:
    var d = new Date();theDay=d.getDay();switch (theDay){case 5:  document.write("Friday");  break;case 6:  document.write("Saturday");  break;case 0:  document.write("Sunday");  break;}
  • JavaScript Objects:Window, Navigator, Screen, History, Location
  • JavaScript Date Object : var myDate=new Date()
  • Some date object methods:
    Date(): Returns today's date and time
    getDate(): Returns the day of the month from a Date object (from 1-31)
    getDay(): Returns the day of the week from a Date object (from 0-6)
    getFullYear(): Returns the year, as a four-digit number, from a Date object
    getHours(): Returns the hour of a Date object (from 0-23)
    getMilliseconds(): Returns the milliseconds of a Date object (from 0-999)
    getMinutes(): Returns the minutes of a Date object (from 0-59)
    getMonth(): Returns the month from a Date object (from 0-11)
    getSeconds(): Returns the seconds of a Date object (from 0-59)
    getTime(): Returns the number of milliseconds since midnight Jan 1, 1970
  • JavaScript Math Object Functions: You need to use the function as Math.max() format
    abs(x) , acos(x) , asin(x) , atan(x) , atan2(y,x), ceil(x), cos(x), exp(x) , floor(x), log(x), (base E) ,max(x,y) , min(x,y), pow(x,y) , random() , round(x), sin(x) , sqrt(x) , tan(x) , toSource(), valueOf()
  • JavaScript Regular Expression Example:
       var pattern = new RegExp("e","g");   do   {     result=pattern .exec("This is the line where the regular expression will be searched on");     document.write(result);   }   while (result!=null) 
  • JavaScript Global Objects: * Array, * Boolean, * Date, * Error, * EvalError, * Function, * Math, * Number, * Object, * RangeError, * ReferenceError, * RegExp, * String, * SyntaxError, * TypeError, * URIError
  • JavaScript Global Functions:# decodeURI,# decodeURIComponent,# encodeURI,# encodeURIComponent,# eval,# isFinite,# isNaN,# parseFloat,# parseInt
  • Javascript Statements:# block,# break,# const,# continue,# do...while,# export,# for,# for...in,# for each...in,# function,# if...else,# import,# label,# let,# return,# switch,# throw,# try...catch,# var,# while,# with
  • JavaScript Reference from Sun (version 1.3 recent JS version is 1.8, I guess): http://docs.sun.com/source/816-6408-10/
  • JavaScript Events :onAbort, onActivate, onAfterPrint, onAfterUpdate, onBeforeActivate, onBeforeCopy, onBeforeCut, onBeforeDeactivate, onBeforeEditFocus, onBeforePaste, onBeforePrint, onBeforeUnload, onBeforeUpdate, onBlur, onBounce, onCellChange, onChange, onClick, onContextMenu, onControlSelect, onCopy, onCut, onDataAvailable( 3 ) onDatasetChange, onDatasetComplete, onDblClick, onDeactivate, onDrag, onDragEnd, onDragEnter, onDragLeave, onDragOver, onDragStart, onDrop, onError, onErrorUpdate, onFilterChange, onFinish, onFocus, onFocusIn, onFocusOut, onHelp, onKeyDown, onKeyPress, onKeyUp, onLayoutComplete, onLoad, onLoseCapture, onMouseDown, onMouseEnter, onMouseLeave, onMouseMove, onMouseOut, onMouseOver, onMouseUp, onMouseWheel, onMove, onMoveEnd, onMoveStart, onPaste, onPropertyChange, onReadyStateChange, onReset, onResize, onResizeEnd, onResizeStart, onRowEnter, onRowExit, onRowsDelete, onRowsInserted, onScroll, onSelect, onSelectionChange, onSelectStart, onStart, onSubmit, onTimeError, onUnload,
  • JavaScript Methods:abs, acos, add namespaces, add, addBehavior, AddChannel,AddDesktopComponent, addElement, AddFavorite, addImport, addPageRule( 2 ) addReadRequest,addRule, alert, anchor, appendChild, appendData, applyElement,asin, assign, atan, atan2, attachEvent, AutoCompleteSaveForm,AutoScan, back, big, blink, blur, bold,ceil, charAt, charCodeAt, ChooseColorDlg, clear, clearAttributes,clearData, clearInterval, clearRequest, clearTimeout, click, cloneNode,close, collapse, compareEndPoints, componentFromPoint( 4 ) concat 1, concat 2,confirm, contains, cos, createAttribute, createCaption, createComment,createControlRange, createDocumentFragment, createElement, createEventObject, createPopup, createRange,createStyleSheet, createTextNode, createTextRange, createTFoot, createTHead, deleteCaption,deleteCell, deleteData, deleteRow, deleteTFoot, deleteTHead, detachEvent,doImport, doReadRequest, doScroll, dragDrop, duplicate, elementFromPoint,empty, escape( 2 ) eval( 2 ) execCommand, execScript, exp,findText, fireEvent, firstPage, floor, focus, fontColor,fontSize, forward, fromCharCode, getAdjacentText, getAttribute, getAttributeNode,getBookmark, getCharset, getClientRects, getData, getDay, getElementById,getElementsByName, getElementsByTagName, getExpression, getFullYear, getMilliseconds, getMonth,getNamedItem, getSeconds, getTime, getTimezoneOffset, getUTCDate, getUTCDay,getUTCHours, getUTCMilliseconds, getUTCMinutes, getUTCMonth, getUTCSeconds, getYear,hasChildNodes, hasFocus, hasOwnProperty, hide, ImportExportFavorites, indexOf,inRange, insertAdjacentElement, insertAdjacentText, insertBefore, insertCell, insertData,insertRow, isEqual, isNaN( 2 ) isPrototypeOf, IsSubscribed, italics,item, javaEnabled, join, lastIndexOf, lastPage, link,localeCompare, log, match, max, mergeAttributes, min,move, moveBy, moveEnd, moveRow, moveStart, moveTo,moveToBookmark, moveToElementText, moveToPoint, namedItem, namedRecordset, navigate,NavigateAndFind, nextPage, normalize, open, parentElement, parse,parseFloat( 2 ) parseInt( 2 ) pasteHTML, pop, pow, previousPage,print, prompt, queryCommandEnabled, queryCommandIndeterm, queryCommandState, queryCommandValue,recalc, refresh plugin, releaseCapture, remove, removeAttribute, removeAttributeNode,removeBehavior, removeChild, removeExpression, removeNode, removeRule, replace location,replace String, replaceChild, replaceData, replaceNode, reset, resizeBy,reverse, round, scroll, scrollBy, scrollIntoView, scrollTo,select form control, select, setActive, setAttributeNode, setCapture, setDate,setExpression, setFullYear, setHours, setMilliseconds, setMinutes, setMonth,setSeconds, setTime, setTimeout, setUTCDate, setUTCFullYear, setUTCHours,setUTCMilliseconds, setUTCMinutes, setUTCMonth, setUTCSeconds, setYear, shift,show, ShowBrowserUI, showHelp, showModalDialog, showModelessDialog, sin,slice, small, sort, splice, split, splitText,sqrt, start, stop, strike, sub, submit,substr, substring, substringData, sup, swapNode, tags,taintEnabled, tan, toExponential, toFixed, toGMTString, toLocaleLowerCase,toLocaleString, toLocaleUpperCase, toLowerCase, toPrecision, toSource, toString,toUpperCase, toUTCString, unescape( 2 ) unshift, urns, UTC,valueOf, write, writeln

From: http://sitestree.com/?p=5209
Categories:13
Tags:
Post Data:2011-05-25 12:23:37

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

JavaScript Short-notes: #13

  1. Ajax: An Overview
  2. Handling Checkbox arrays with Javascript::GetElementsByName:XHTML supported
  3. How to implement multiple tab webpages in Ajax and Javascript
  4. Javascript - Form validation
  5. JavaScript - Miscellaneous Validations
  6. Javascript by Example
  7. Javascript Codes
  8. JavaScript DOM: Must knowledge to understand Ajax
  9. JavaScript Frameworks
  10. JavaScript Miscellaneous Topics
  11. JavaScript: Pass by Value: Pass by Reference
  12. Random Notes on JavaScript/HTML
  13. Web page design standards
  14. What you really need to learn in Javascript?

From: http://sitestree.com/?p=5214
Categories:13
Tags:
Post Data:2008-09-06 21:39:43

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Random Notes on JavaScript/HTML #13

This short-note will make sense, only if you already have some javascript sense. It can be used - just to refresh memory, once in a while. My JavaScript Experience? started on 2000, conducted a JavaScript Training Session on 2001, wrote a book for a training institute on JavaScript on 2001, using javascript always from that time - for this and that (personal and/or commercial, at home/work). Am I an expert? That's an interesting question - "I am an expert" is a ridiculous statement to me (also in my culture to some extent), However, I can say - whatever I wanted to do or I was required to do in JavaScript - I could do - without much/any trouble, and without hanging in the forums for weeks waiting for someone else to reply to my silly questions. I also believe, whatever I will require to do in JavaScript, I will be able to do without any/much trouble.

  1. How to embed applet in javascript code:
    
    

    Parameter values are passed to the applet

  2. Possible attributes of applet tag: code, archive, name, height, width, mayscript
  3. Custom applet parameters are sent by using param tag
  4. You can use JSObject to pass information from Applet to javascript
    Java Side:JSObject jso = JSObject.getWindow(this);jso.eval("slider(" + jCSlider1.getValue() + ")");JavaScript Side:function slider(theSetting) {document.theForm.txtSetting.value = theSetting;}
  5. Linking to shockwave files:
    http://value1.dcr
  6. Linking to activex objects/controls:
    ActiveXcontrol.property="value";

    ActiveXcontrol.property="value"; is to access activex objects' properties

  7. Communicating with Java Server Pages:
    
    
  8. Difference Between CSS visibility and display Attributes: When visibility is false, the area is replaced with white spaces. When display attribute is false, the block is completely removed [no white space occulies the area]
  9. Within javascript, you can also use CSS properties. The syntax: document.elementname.style.propertyname
    Example:document.element1.style.visibility = 'hidden';
  10. Javascrip and CSS property mapping:
    CSS Property JavaScript Reference
    background background
    background-color backgroundColor
    background-image backgroundImage
    border border
    border-color borderColor
    border-style borderStyle
    color color
    display display
    font font
    font-family fontFamily
    font-size fontSize
    margin margin
    margin-bottom marginBottom
    margin-left marginLeft
    margin-right marginRight
    margin-top marginTop
    vertical-align verticalAlign
    visibility visibility
  11. Change element appearance dynamically:
    document.getElementById("element id").style.visibility = "property";
  12. Change the background color of an element:
    document.getElementById("element id").style.background = color;
  13. Element content manipulation:

    sometext

    document.getElementById("para1").innerText = "newtext";document.getElementById("para1").innerText = "newtext";document.getElementById("para1").innerHTML = "newtext";
  14. Validating Forms in JavaScript using Custom objects: I think, an example will make sense
       &ltSCRIPT language="JavaScript"> var frmvalidator  = new Validator("myform"); frmvalidator.addValidation("FirstName","alpha");  frmvalidator.addValidation("FirstName","alpha"); frmvalidator.addValidation("FirstName","req","Please enter your First Name"); frmvalidator.addValidation("FirstName","maxlen=20","Max length for FirstName is 20");
  15. Create temporary cookie:
    document.cookie = "myCookie=gingerbread";cookieValue = escape("A B, C D");document.cookie = "myCookie=" + cookieValue;expDate = "Wed, 3 Mar 2000 14:41:00 UTC";document.cookie = "myCookie=sugardrop;" + "expires=" + expDate;
  16. To access all cookies in a loop: Get the cookie using var cookieString = document.cookie;, then split the cookiestring using split function at ";" like var cookieArray = cookiestring.split(";"); Then you can use a loop to traverse the array and retrieve cookie name and value
  17. Deleting cookies:
    function del_cookie(name) {  document.cookie = name + '=; expires=Thu, 01-Jan-70 00:00:01 GMT;';} 
  18. Javascript Array Examples:
    thisArray = new Array();thisArray.Contents = "Alphabet";thisArray[0] = "A";thisArray[1] = "B";thisArray[2] = "C";-----garden["North Patch"] = "vegetables";garden["South Patch"] = "herbs";garden["West Border"] = "perennial flowers";-------processors = new Array("AMD","Intel","Cyrix","Motorola");
  19. Delete an array element:
    delete anArray[2]; it does not change the length of the array but anArray[2] will have no value and undefined
  20. Destroy an array:anArray.length = 0;anArray = null;
  21. Other Javascript articles What you really need to learn in Javascript?

    How to implement multiple tab webpages in Ajax and Javascript

    Handling Checkbox arrays with Javascript::GetElementsByName:XHTML supported

    Javascript by Example

    Javascript - Form validation

    JavaScript - Miscellaneous Validations

    Javascript Codes

    JavaScript Frameworks

    GWT: Google Web Toolkit

    JavaScript: Pass by Value: Pass by Reference

    Random Notes on JavaScript/HTML

    Random Notes on JavaScript/HTML

    JQuery

    Introduction to JQuery

    JavaScript DOM: Must knowledge to understand Ajax

    Ajax: An Overview

From: http://sitestree.com/?p=5208
Categories:13
Tags:
Post Data:2009-03-19 21:26:36

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

JavaScript Frameworks #13

The following web-resources discuss some JavaScript Frameworks. Comparisons among the frameworks can also be found.

From: http://sitestree.com/?p=5000
Categories:13
Tags:
Post Data:2007-10-12 20:52:16

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

GWT: Google Web Toolkit #13

From: http://sitestree.com/?p=5001
Categories:13
Tags:
Post Data:2009-07-13 16:16:55

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

JavaScript: Pass by Value: Pass by Reference #13

From: http://sitestree.com/?p=5090
Categories:13
Tags:
Post Data:2007-11-21 23:00:16

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Javascript Codes #13

Javascript is a very powerfull scripting language for web-site development. Also, it is in much demand. In Europe Javascript experts earn 29-58 pound/hour [ref: Internet]

  var serviceInstancesArrAtLoad = Array();    var serviceInstancesArrAtSubmit = Array();  var tempArr=Array();            function validate_required(field,alerttxt)  {       with (field)        {           if (value==null||value=='')         {               alert(alerttxt);return false            }           else {return true}      }   }       function validateTicketCreateForm(thisform) {       with (thisform)     {           if (validate_required(type,'Type must be filled out!')==            false)          {type.focus();return false}                     if (validate_required(subject,'Subject must be filled out!')            ==false)            {subject.focus();return false}                              }   }   function validate_customer_create_form(thisform)    {       with (thisform)     {           if (validate_required(firstName,'First name must be filled          out!')==false)          {firstName.focus();return false}                        if (validate_required(lastName,'Last name must be filled            out!')==false)          {lastName.focus();return false}                     if (validate_required(phone,'Phone must be filled out!')==          false)          {phone.focus();return false}                    }   }           function validateUserCreateForm(thisform)   {       with (thisform)     {                                   if (validate_required(firstName,'First name must be filled          out!')==false)          {firstName.focus();return false}                        if (validate_required(lastName,'Last name must be filled            out!')==false)          {lastName.focus();return false}                     if (validate_required(shortName,'Short name must be filled          out!')==false)          {shortName.focus();return false}                        if (validate_required(username,'Username must be filled             out!')==false)          {username.focus();return false}                     /*          if (validate_required(password,'Password must be filled             out!')==false)          {password.focus();return false}                     if (password.value.length 0)            {               if (password.value.length < passwordLength.value)                {alert("Password must be at least "+              passwordLength.value +" char long");                  password.focus();return false}                              if (validate_required(password2,'Please re-enter               password!')==false)                {password2.focus();return false}            }                       if (password.value != password2.value)          {               alert("Password did not match");              password2.focus();              return false            }                   }   }       function validateInventoryCreateForm(thisform)  {       with (thisform)     {           if (validate_required(serial,'serial must be filled out!')            ==false)            {serial.focus();return false}                       if (validate_required(hardwareAddress,'Hardware Address            must be filled out!')==false)          {hardwareAddress.focus();return false}      }   }       function validateInventoryTypeCreateForm(thisform)  {       with (thisform)     {           if (validate_required(name,'Name must be filled out!')==          false)          {name.focus();return false}     }   }       function validateInventoryModelCreateForm(thisform) {       with (thisform)     {           if (validate_required(name,'Name must be filled out!')==          false)          {name.focus();return false}                     if (validate_required(manufacturerId,'Manufacturer must be          filled out!')==false)         {manufacturerId.focus();return false}                       if (validate_required(typeId,'Type must be filled out!')==            false)          {typeId.focus();return false}                               }   }       function validateInventoryManufacturerCreateForm(thisform)  {       with (thisform)     {           if (validate_required(name,'Name must be filled out!')==          false)          {name.focus();return false}     }   }           function validateServiceCreateForm(thisform)    {       with (thisform)     {           if (validate_required(name,'Name must be filled out!')==          false)          {name.focus();return false}                     if (validate_required(typeId,'Type must be filled out!')==            false)          {typeId.focus();return false}                               }   }       function validateHostingCreateForm(thisform)        {           with (thisform)         {               if (validate_required(serviceId,'Service must be               filled out!')==false)              {serviceId.focus();return false}                                if (validate_required(storageSpace,'Storage space              must be filled out!')==false)              {storageSpace.focus();return false}         }       }           function validateDomainName(strValue)   {       return /www.[a-z0-9_-]+.[a-z]{2, 3}/ig.test(strValue);              //var objRegExp  = /^w+([.-]?w+)*(.w{2,3})/;        //check for valid domain        //return objRegExp.test(strValue);  }       function validateDomainServiceCreateForm(thisform)  {       with (thisform)     {           if (validate_required(name,'Domain name must be filled out!')==false)         {name.focus();return false}                     /*if (validateDomainName(name.value)==false)            {alert('Please enter valid domain name');name.focus();            return false;}*/                        if (validate_required(registrar,'Registrar must be filled          out!')==false)         {registrar.focus();return false}                        if (validate_required(registrationTimestamp,'Registration          timestamp must be filled out!')==false)            {registrationTimestamp.focus();return false}                        if (validate_required(expiryTimestamp,'Expiry timestamp            must be filled out!')==false)          {expiryTimestamp.focus();return false}                      if (validate_required(username,'User name must be filled           out!')==false)         {username.focus();return false}                     if (validate_required(password,'Password must be filled            out!')==false)         {password.focus();return false}                     if (password.value.length passwordMaxLength.value)          {alert('Password must be '+ passwordMinLength.value+ '-'+           passwordMaxLength.value +' chars long');            password.focus();return false;}                     if (password.value != password2.value)          {alert('Password must match');password2.focus();            return false;}      }   }                   function validateCommunityCreateForm(thisform)  {       with (thisform)     {           if (validate_required(name,'Name must be filled out!')==            false)          {name.focus();return false}     }   }       function validatePostalCodeCreateForm(thisform) {       with (thisform)     {           if (validate_required(postalCode,'Postal code must be           filled out!')==false)           {postalCode.focus();return false}                       if (validate_required(communityId,'Community must be            filled out!')==false)           {communityId.focus();return false}      }   }       function validateStreetTypeCreateForm(thisform) {       with (thisform)     {           if (validate_required(name,'Name must be filled out!')==            false)          {name.focus();return false}     }   }       function validateStreetCreateForm(thisform) {       with (thisform)     {           if (validate_required(name,'Name must be filled out!')==            false)          {name.focus();return false}                     if (validate_required(typeId,'Type must be filled out!')==          false)          {typeId.focus();return false}                       if (validate_required(communityId,'Community must be filled             out!')==false)          {communityId.focus();return false}      }   }       function validateUnitCreateForm(thisform)   {       with (thisform)     {           if (validate_required(streetId,'Street must be filled out!')            ==false)            {streetId.focus();return false}                     if (validate_required(communityId,'Community must be filled             out!')==false)          {communityId.focus();return false}                      if (validate_required(number,'Number must be filled out!')==            false)          {number.focus();return false}                       if (validate_required(nodeId,'Node must be filled out!')==          false)          {nodeId.focus();return false}                   }   }       function validatePlantCreateForm(thisform)  {       with (thisform)     {           if (validate_required(name,'Name must be filled out!')==            false)          {name.focus();return false}     }   }       function validateCreateTicketCategoryForm(thisform) {       with (thisform)     {           if (validate_required(name,'Name must be filled out!')==            false)          {name.focus();return false}     }   }           function validateStartWorkOnTicketForm(thisform)    {       with (thisform)     {           if (validate_required(startTimestamp,'Start Timestamp must           be filled out!')==false)           {startTimestamp.focus();return false}       }   }       function validateTicketReportForm(thisform) {       with (thisform)     {           if (validate_required(date,'Date must be filled out!')==            false)          {date.focus();return false}     }   }           function validateCloseTicketForm(thisform)  {       with (thisform)     {           if (validate_required(date,'Date must be filled out!')==            false)          {date.focus();return false}                     if (validate_required(time,'Time must be filled out!')==            false)          {time.focus();return false}                 }   }   function validateCreateWorkOrder(thisform)  {       with (thisform)     {           if (validate_required(inventoryId,'Inventory must be filled             out!')==false)          {inventoryId.focus();return false}                      if (validate_required(assignedTo,'Assigned to must be           provided!')==false)         {assignedTo.focus();return false}                       if (validate_required(scheduledDate,'Scheduled date must            be provided!')==false)          {scheduledDate.focus();return false}                        if (validate_required(scheduledTime,'Scheduled time must            be provided!')==false)          {scheduledTime.focus();return false}                    }   }                   function addService(services,serviceId) {       for (var i = 0; i < services.length; i++)        {           if (services.options[i].selected)           {               serviceIdLength = serviceId.length++;               serviceId.options[serviceIdLength].text =                   services.options[i].text;               serviceId.options[serviceIdLength].value =                  services.options[i].value;                          }       }   }           function removeService(serviceId)   {       for (var i = 0; i < serviceId.length; i++)       {           if (serviceId.options[i].selected)          {                               serviceId.options[i].text = '';               serviceId.options[i].value = '';              serviceId.options[i].selected = false;              serviceId.options[i].remove();          }                   }           }       function validateAssignInventoryForm()  {               var serviceArr=document.getElementsByName("serviceArr[]");        length=serviceArr.length;       isAnySelected = false;              for (var i=0;i<length;i++)       {           if (serviceArr[i].checked == true)          {               isAnySelected=true;             i=length;           }       }                               var serviceRequested=new Array();       var inventoriesHavingSameService=new Array();       var servicesHavingSameInventory=new Array();        var isServiceRequested = 0;     for (var i=0;i 0)              isServiceRequested = 1;                      if (serviceArr[i].checked == true)          {              if (inventoriesHavingSameService[service] >= 0)               inventoriesHavingSameService[service]=inventoriesHavingSameService[service]+1;             else                 inventoriesHavingSameService[service]=1;                           if (servicesHavingSameInventory[inventory] > 0)               servicesHavingSameInventory[inventory]=servicesHavingSameInventory[inventory]+1;               else             servicesHavingSameInventory[inventory]=1;           }                               }           if (   (!isAnySelected) && (isServiceRequested) )       {           alert('Service & inventory requested. But no checkbox is selected');            return false;       }       else if (!isAnySelected)        {           var response = confirm('No checkbox is selected, do you want to proceed');          if (!response) return false;        }               var errMsg ='';             for (k=1;k= 0 )         {                   if ( (serviceRequested[k] != inventoriesHavingSameService[k])  )                {                   if (serviceRequested[k]>0)                       errMsg = errMsg + "Inventory is not                         checked properly for service " + k                      +", Requested:" + serviceRequested[k] +",                       Assigned:" + inventoriesHavingSameService[k] + "n";                 else if (serviceRequested[k]==0 && inventoriesHavingSameService[k]>0)                        errMsg = errMsg + "Inventory is not                         checked properly for service " + k                      +", Requested:" + serviceRequested[k] +",                       Assigned:" + inventoriesHavingSameService[k] + "n";             }           }       }                   if (errMsg.length>0)     {           alert(errMsg);          return false;       }       return true;    }       //not 100% right, will fix later    function checkDateFormat()  {       var pattern = new RegExp(0|1[0-9]/[0-3][0-9]/[0-9][0-9]);       if(document.getElementById('timestampStarted').value.match(pattern))        {           var date_array = document.getElementById('timestampStarted').value.split('/');                      var month = date_array[0];          var day = date_array[1];            var year = date_array[2];           // This instruction will create a date object           source_date = new Date(year,month,day);             if(month != source_date.getMonth())         {               alert('Month is not valid!');               return false;           }               if(day != source_date.getDate())            {               alert('Day is not valid!');             return false;           }                       if(year != source_date.getYear())           {               alert('Year is not valid!');                return false;           }       }       else        {           alert('Date format is not valid!');         return false;       }           return true;    }   //used by assignService.php function initializeServiceInstanceArr() {       if (serviceInstancesArrAtLoad.length == 0)          serviceInstancesArrAtLoad=document.getElementsByName("serviceInstances[]");     length=serviceInstancesArrAtLoad.length;        for(i=0;i<length ;i++)       {           tempArr[i]=serviceInstancesArrAtLoad[i].value;      }   }       //used by assignService.php //tempArr is filled up at the page load and by  function validateAssignServiceForm(thisform,serviceId)  {       var flag=false;     with (thisform)     {           if (validate_required(timestampStarted,'Start Date must            be filled out!')==false)           {timestampStarted.focus();return false}     }                       if (checkDateFormat()==false)       {return false}              serviceInstancesArrAtSubmit=document.getElementsByName("serviceInstances[]");     length=serviceInstancesArrAtSubmit.length;              for (var i=0;i<length;i++)       {           if (serviceInstancesArrAtSubmit[i].value != tempArr[i])         {               flag = true;                break;          }       }                   if (flag)       {           //service id is checked otherwise the data will not be passed           //to PHP scripts            for (var i = 1; i < serviceId.length; i++)           {               serviceId.options[i].selected = true;           }           return true;        }       else        {           alert('Nothing has been changed');            return false;       }   }       function checkAllInventories2(serviceId)    {               serviceCheckAll=document.getElementsByName("serviceCheckAll[]");              inventoryCheckAll=document.getElementsByName("inventoryCheckAll[]");      serviceArr=document.getElementsByName("serviceArr[]");                length = serviceCheckAll.length;        lengthInventoryCheckAll=inventoryCheckAll.length;       lengthServiceArr=serviceArr.length;             var status=false;       for (i=0;i<length;i++)           if (serviceCheckAll[i].value==serviceId)                status = serviceCheckAll[i].checked;                    lengthArr = serviceArr.length;      for (j=0;j<lengthArr;j++)        {           var value=serviceArr[j].value;          var valueElements = value.split(':');                 if (valueElements[1]==serviceId)            {               serviceArr[j].checked=status; //serviceCheckAll.checked;//!serviceArr[j].checked;                               if (status==false)              {                   var inventoryId=valueElements[0];                   //alert(inventoryId);                                       //alert(lengthInventoryCheckAll);                   for (i=0;i<lengthInventoryCheckAll;i++)                      if (inventoryCheckAll[i].value==inventoryId)                            inventoryCheckAll[i].checked = false;               }               else if (status==true)              {                   var flag=true;                  var inventoryId=valueElements[0];                                       //alert(inventoryId);                                       for (k=0;k<lengthServiceArr;k++)                 {                       var value2nd=serviceArr[k].value;                       var valueElements2nd = value2nd.split(':');                       if (valueElements2nd[0]==inventoryId)                        if (serviceArr[k].checked==false)                          flag=false;                 }                                       if (flag==true)                 {                           for (i=0;i<lengthInventoryCheckAll;i++)                              if (inventoryCheckAll[i].value==inventoryId)                                    inventoryCheckAll[i].checked = true;                    }                               }                                           }       }   }           function checkAllServices2(inventoryId) {       inventoryCheckAll=document.getElementsByName("inventoryCheckAll[]");      serviceCheckAll=document.getElementsByName("serviceCheckAll[]");              serviceArr=document.getElementsByName("serviceArr[]");                        length = inventoryCheckAll.length;      lengthArr = serviceArr.length;      lengthServiceCheckAll=serviceCheckAll.length;               status=false;       for (i=0;i<length;i++)           if (inventoryCheckAll[i].value==inventoryId)                status = inventoryCheckAll[i].checked;              for (j=0;j<lengthArr;j++)        {           var value=serviceArr[j].value;          var valueElements = value.split(':');                 if (valueElements[0]==inventoryId)          {               serviceArr[j].checked=status;//serviceCheckAll.checked;//!serviceArr[j].checked;                if (status==false)              {                   var serviceid=valueElements[1];                                     for (i=0;i<lengthServiceCheckAll;i++)                        if (serviceCheckAll[i].value==serviceid)                            serviceCheckAll[i].checked = false;             }               else if (status==true)              {                   var flag=true;                  var serviceId=valueElements[1];                 //alert(inventoryId);                   for (k=0;k<lengthArr;k++)                    {                       var value2nd=serviceArr[k].value;                       var valueElements2nd = value2nd.split(':');                       if (valueElements2nd[1]==serviceId)                      if (serviceArr[k].checked==false)                          flag=false;                 }                   if (flag==true)                 {                       for (i=0;i0 )           {               var forwardAddresses = forwardAddress.value.split(',');             var length=forwardAddresses.length;             for(var i=0;i=1)                {                   lengthModelId=modelId.options.length;                   modelId.options[lengthModelId-1]=null;              }                   for(var i=0;i=1)                {                   lengthAddressId=addressId.options.length;                   addressId.options[lengthAddressId-1]=null;              }                   for(var i=0;i=1)                {                   lengthServiceId=serviceId.options.length;                   serviceId.options[lengthServiceId-1]=null;              }                   for(var i=0;i<length -1;i++)             {                   values=serviceIdArr[i].split(':');                    var newOption = document.createElement("option");                 newOption.value = values[0];                    newOption.innerHTML = values[1];                    serviceId.appendChild(newOption);               }           }      }            page_request.open('GET', '/Service/changeServicesList.php?serviceTypeId='+serviceTypeId.value, true)        page_request.send(null) }       function validateServiceSpeedAssignForm(thisForm)   {       with(thisForm)      {           if (validate_required(serviceId,'Service Type & Service must be filled out!')==false)         {serviceId.focus();return false}                        if (validate_required(cmtsSpeedId,'Cmts Speed must be filled out!')==false)           {cmtsSpeedId.focus();return false}                  }   }               //docsis        function validateDocsisServiceGroupCreateForm(thisform)     {       with (thisform)     {           if (validate_required(cmtsVlan,'DHCP Vlan must be filled out!')==false)           {cmtsVlan.focus();return false}                                             if (validate_required(cmtsInterfaceName,'Interface name must be filled out!')==false)         {cmtsInterfaceName.focus();return false}                        if (validate_required(cmtsInterfaceBundleId,'Interface bundle must be filled out!')==false)           {cmtsInterfaceBundleId.focus();return false}        }   }       function validateDocsisInterfaceBundleCreateForm(thisForm)  {       with(thisForm)      {           if (validate_required(name,'Interface bundle name must be filled out!')==false)           {name.focus();return false}                     if (validate_required(docsisCmtsId,'Docsis cmts must be filled out!')==false)         {docsisCmtsId.focus();return false}                     if (validate_required(cmtsVlanAddress,'Cmts Vlan address must be filled out!')==false)            {cmtsVlanAddress.focus();return false}                  }       }       function validateDocsisInventoryCreateForm(thisform)    {       with (thisform)     {           if (validate_required(inventoryModelId,'Inventory Model            must be filled out!')==false)          {inventoryModelId.focus();return false}                     if (validate_required(docsisVersion,'Docsis Version            must be filled out!')==false)          {docsisVersion.focus();return false}        }   }       function validateDocsisServiceCreateForm(thisform)  {       with (thisform)     {           if (validate_required(serviceId,'Service must be filled out!')==false)            {serviceId.focus();return false}                        if (validate_required(downloadSpeed,'Download speed must be            filled out!')==false)          {downloadSpeed.focus();return false}                        /*if (validate_required(uploadSpeed,'Upload speed must be          filled out!')==false)          {uploadSpeed.focus();return false}*/                    }   }       function validateDocsisSettingCreateForm(thisform)  {       with (thisform)     {           if (validate_required(customerId,'Customer must be filled          out!')==false)         {customerId.focus();return false}                       if (validate_required(serviceId,'Service must be filled out!')==false)            {serviceId.focus();return false}                                if (validate_required(overrideConfigFile,'Override config          file must be filled out!')==false)         {overrideConfigFile.focus();return false}       }   }       //hosting   function validateCustomerHostingParameters(thisform)    {       with (thisform)     {           if (validate_required(domainId,'Domain name must be filled             out!')==false)         {domainId.focus();return false}                     if (validate_required(serviceId,'Service name must be          filled out!')==false)          {serviceId.focus();return false}        }   }       function validateHostingSiteUserCreateForm(thisform)    {       with (thisform)     {           if (validate_required(username,'Site user name must be             filled out!')==false)          {username.focus();return false}                     if (validate_required(password,'Site password must be          filled out!')==false)          {password.focus();return false}                     if ( password.value.length   passwordMaxLength.value)           {alert('Password length should be < = '+passwordMaxLength.value );          password.focus();return false}                                              if (validate_required(password2,'Please re-enter site password !')==false)            {password2.focus();return false}                        if (password.value != password2.value)          {               alert("Site User Passwords must match");              password2.focus();              return false            }       }   }       function validateHostingDomainUserCreateForm(thisform)  {       with (thisform)     {           if (validate_required(domainId,'Domain name must be            filled out!')==false)          {domainId.focus();return false}                                 if (validate_required(username,'Domain user name must          be filled out!')==false)           {username.focus();return false}                     if (validate_required(password,'Domain password must be            filled out!')==false)          {password.focus();return false}                                 if ( password.value.length   passwordMaxLength.value)           {alert('Password length should be < = '+passwordMaxLength.value );                         password.focus();return false}                                   if (validate_required(password2,'Please re-enter site password !')==false)            {password2.focus();return false}                        if (password.value != password2.value)          {               alert("Domain User Passwords must match");                password2.focus();              return false            }       }   }           //outage    function validateOutageCreateForm(thisform) {       with (thisform)     {           if (validate_required(subject,'Subject must be filled out!')==false)          {subject.focus();return false}                      //check community selection         var communityNamesArr=document.getElementsByName("communityNames[]");         lengthArr= communityNamesArr.length;                        var isAnySelected = false;                      for (var i=0;i<lengthArr;i++)            {               if (communityNamesArr[i].checked == true)               {                   isAnySelected=true;                 i=lengthArr;                }           }                       if (!isAnySelected)             {               alert('You must select a community');             return false;           }                                   //check recipient selection         var outageRecipientNamesArr=document.getElementsByName("outageRecipientNames[]");         lengthArr= outageRecipientNamesArr.length;                      var isAnySelected = false;                      for (var i=0;i<lengthArr;i++)            {               if (outageRecipientNamesArr[i].checked == true)             {                   isAnySelected=true;                 i=lengthArr;                }           }                       if (!isAnySelected)             {               alert('You must select a recipient');             return false;           }           return true;        }   }

From: http://sitestree.com/?p=4784
Categories:13
Tags:
Post Data:2010-04-27 09:16:44

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Introduction to JQuery #13

From: http://sitestree.com/?p=4948
Categories:13
Tags:
Post Data:2012-04-20 15:42:24

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

JavaScript – Miscellaneous Validations #13

    function validateDomainName(strValue)   {       return /www.[a-z0-9_-]+.[a-z]{2, 3}/ig.test(strValue);          }   function validateDomainName(strValue)   {       return /www.[a-z0-9_-]+.[a-z]{2, 3}/ig.test(strValue);          }   //not 100% right, will fix later    function checkDateFormat()  {       var pattern = new RegExp(0|1[0-9]/[0-3][0-9]/[0-9][0-9]);       if(document.getElementById('timestampStarted').value.match(pattern))        {           var date_array = document.getElementById('timestampStarted').value.split('/');                      var month = date_array[0];          var day = date_array[1];            var year = date_array[2];           // This instruction will create a date object           source_date = new Date(year,month,day);             if(month != source_date.getMonth())         {               alert('Month is not valid!');               return false;           }               if(day != source_date.getDate())            {               alert('Day is not valid!');             return false;           }                       if(year != source_date.getYear())           {               alert('Year is not valid!');                return false;           }       }       else        {           alert('Date format is not valid!');         return false;       }           return true;    }   function validateEmail( strValue)   {       var objRegExp  = /(^[a-z]([a-z_.]*)@([a-z_.]*)([.][a-z]{3})$)|(^                [a-z]([a-z_.]*)@([a-z_.]*)(.[a-z]{3})(.[a-z]{2})*$)/i;          //check for valid email         return objRegExp.test(strValue);    }   //AJAX Example  function ajaxFunctionGeneral()  {       var page_request = false        if (window.XMLHttpRequest) // if Mozilla, IE7, Safari etc           page_request = new XMLHttpRequest()     else if (window.ActiveXObject)      { // if IE          try             {               page_request = new ActiveXObject("Msxml2.XMLHTTP")          }           catch (e)           {               try             {                   page_request = new ActiveXObject("Microsoft.XMLHTTP")               }               catch (e)               {               }           }       }       else                    return false        return page_request;    }   function reboot(deviceId)   {       var response=confirm('Are you sure to reboot');             if(!response)           exit;               page_request = ajaxFunctionGeneral();       if (!page_request) return false;                page_request.onreadystatechange=function()      {       if(page_request.readyState==4)          {               var response=page_request.responseText;             var displayArea = document.getElementById('showDiagnosticsResults');                displayArea.value = response;           }      }        page_request.open('GET', '/Inventory/Diagnostics/reboot.php?deviceId='+deviceId, true)      page_request.send(null) }

From: http://sitestree.com/?p=4779
Categories:13
Tags:
Post Data:2008-12-29 21:43:54

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Javascript – Form validation #13

The code will be helpful in validating data entry forms such as: user registration, user creation. validate_required is used by all other functions

function validate_required(field,alerttxt)   {       with (field)        {           if (value==null||value=='')         {               alert(alerttxt);return false            }           else {return true}      }   }       function validateTicketCreateForm(thisform) {       with (thisform)     {           if (validate_required(type,'Type must be filled out!')==false)          {type.focus();return false}                     if (validate_required(subject,'Subject must be filled out!')==false)            {subject.focus();return false}                              }   }   function validate_customer_create_form(thisform)    {       with (thisform)     {           if (validate_required(firstName,'First name must be filled out!')==false)           {firstName.focus();return false}                        if (validate_required(lastName,'Last name must be filled out!')==false)         {lastName.focus();return false}                     if (validate_required(phone,'Phone must be filled out!')==false)            {phone.focus();return false}                    }   }           function validateUserCreateForm(thisform)   {       with (thisform)     {                                   if (validate_required(firstName,'First name must be filled out!')==false)           {firstName.focus();return false}                        if (validate_required(lastName,'Last name must be filled out!')==false)         {lastName.focus();return false}                     if (validate_required(shortName,'Short name must be filled out!')==false)           {shortName.focus();return false}                        if (validate_required(username,'Username must be filled out!')==false)          {username.focus();return false}                                 if (validate_required(password,'Password must be filled out!')==false)          {password.focus();return false}                     if (password.value.length < passwordLength.value) {alert("Password must be              at least " + passwordLength.value +" char long");    password.focus();return false}                      if (validate_required(password2,'Please re-enter password!')==false)          {password2.focus();return false}                        if (password.value != password2.value)          {               alert("Password did not match");              password2.focus();              return false                        }                               }   }

From: http://sitestree.com/?p=4778
Categories:13
Tags:
Post Data:2012-10-22 22:13:07

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Javascript by Example #13

JavaScript by Example:

JavaScript by Example:

Example 1.1 A simple JavaScript program Run View Source
Example 1.2 An HTML form with a JavaScript event handlerdefined Run View Source
Example 1.3 Estimating Your Taxes with JavaScript Run View Source
Example 6.1 Defining JavaScript Functions ViewSource
Example 6.2 Using Functions as Data ViewSource
Example 6.3 Checking for the Correct Number of Arguments View Source
Example 6.4 A Multi-Argument max() Function ViewSource
Example 6.5 Creating and Initializing an Array ViewSource
Example 6.6 Using Static Variables ViewSource
Example 7.1 A Rectangle Object Constructor Function ViewSource
Example 7.2 Defining and Invoking a Method ViewSource
Example 7.3 Defining Methods in a Constructor ViewSource
Example 7.4 Defining a Class with a Prototype Object View Source
Example 7.5 Defining instance/class variables and methods View Source
Example 7.6 Defining and using the valueOf() method ViewSource
Example 8.1 An Array Constructor ViewSource
Example 9.1 Copying, Passing, and Comparing by Value View Source
Example 9.2 Copying, Passing, and Comparing by Reference View Source
Example 9.3 References Themselves are Passed by Value ViewSource
Example 9.4 Are Strings and Functions Compared by Value orReference? Run View Source
Example 9.5 The assign() Method ViewSource
Example 10.1 A Simple JavaScript Program in an HTML FileRun View Source
Example 12.1 Using the alert(), confirm() and prompt() methodsRun View Source
Example 12.2 Displaying and Reporting JavaScript Errors witha Run View Source
Example 12.3 Displaying a link's destination in the statusline Run View Source
Example 12.4 A digital clock in the status line Run View Source
Example 12.5 Creating an invisible frame ViewSource
Example 12.6 Dynamically creating and animating framesRun View Source
Example 13.1 Getting Browser Version Information ViewSource
Example 13.2 Extracting Arguments from a URL ViewSource
Example 13.3 A Navigation Bar Using the History and LocationObjects View Source
Example 14.1 Creating a plain-text document Run View Source
Example 14.2 Generating XBM images with JavaScript Run View Source
Example 14.3 Listing the Links in a Document ViewSource
Example 14.4 A Random Hypertext Link ViewSource
Example 14.5 Invoking Methods of a Java applet from JavaScript View Source
Example 15.1 A Utility Class for Working with CookiesRun View Source
Example 16.1 An Animation Using Image Replacement Run View Source
Example 16.2 An Animation Using the onLoad() Event HandlerRun View Source
Example 16.3 Implementing a Toggle Button with Image ReplacementRun View Source
Example 17.1 An HTML Form Containing all Form ElementsRun View Source
Example 17.2 Performing Form Validation Run View Source
Example 18.1 A Script Hidden from Old Browsers ViewSource
Example 18.2 Displaying a Message on non-JavaScript Browsers View Source
Example 18.3 Loading a JavaScript-based page only if JavaScriptis supported View Source
Example 18.4 Displaying a Message with View Source
Example 18.5 Displaying a Message for Browsers that do notSupport JavaScript 1.1 View Source
Example 18.6 A Web Page to test for JavaScript Compatibility View Source
Example 18.7 Displaying a Failure Message when using View Source
Example 19.1 Scripting the built-in Java classes Run View Source
Example 19.2 Controlling an Applet with JavaScript ViewSource
Example 19.3 Controlling a Plug-in from JavaScript Run View Source
Example 19.4 Using JavaScript from an Applet Method ViewSource
Example 19.5 A Java OutputStream for Displaying HTML in aBrowser Window View Source

Reference:

http://examples.oreilly.com/jscript2/ From: http://sitestree.com/?p=4740
Categories:13
Tags:
Post Data:2013-05-05 02:36:52

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

How to implement multiple tab webpages in Ajax and Javascript #13

The following two examples will demonstrate how to use javascript and/or ajax to implement multiple tab webpages.http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/

http://www.barelyfitz.com/projects/tabber/example2.html

I have used the first code extensively in one of my applications.The basic ides is: you define a div section. On each click, you change the contents of that div section using Ajax concepts. You could also use Iframe and JavaScript. However, if the pages under different tabs require information from the server side then Ajax is the right choice

From: http://sitestree.com/?p=4733
Categories:13
Tags:
Post Data:2011-08-18 06:20:43

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Handling Checkbox arrays with Javascript::GetElementsByName:XHTML supported #13

The following code demonstrates how to handle checkboxes with javascript. Note the names of all check boxes are same myInput[]. It could also be myInput. Both works as an array to contain the controls' values. I prefer myInput[] as you can handle this control in PHP as an array. If you use $arr=$_POST['myInput'], $arr will contain the values of the controls.

Note the use of getElementsByName(). It is easy to manipulate javascript controls using this name. You do not need to send a value/control to the function. And in many times, document.myform.control, does not work right, specially if you want to main XHTML standard[i need to check more on this]. getElementById is also very useful. You may use getElementById for most times, but with checkbox arrays getElementsByName is better choice.

Also, note that when a form is submitted only the values of the checked check boxes are submitted to the server. You may wish to use hidden controls to keep the values, so that all values are submitted and based on the checked/non-checked you can ..control your work

                        function getElements()            {           var x=document.getElementsByName("myInput[]");              alert(x.length);            alert(x[0].value);              alert(x[1].value);              alert(x[2].value);              }         10 
20
30

Want to check how the code works, check below

function getElements() { var x=document.getElementsByName("myInput[]"); alert(x.length); alert(x[0].value); alert(x[1].value); alert(x[2].value); }10
20
30

From: http://sitestree.com/?p=4735
Categories:13
Tags:
Post Data:2009-12-11 16:22:24

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

What you really need to learn in Javascript? #13

What you really need to learn in Javascript? 
1. Where you can place JavaScript codes?
Anywhere in the web-pages, ideally in the header section, or in an external file. If you keep javascript codes in an external file, the codes will be re-usable from different web-pages2. Some basic programming:



document.write('Hello World');

This will only be displayed in javascript enabled browsers.

document.write('Page Requiring Javascript');

3. Variables and their scopes

var hello = 'Hello World';
document.write(hello);

var mynum = 5;
var smokes = false;
var riches = null;
var today = new Date;
Example use of variables:

var questions = 'If you have any questions about this
please email me.';
document.write(questions);

Another block can refer to questions variables without reassigning the value

document.write(questions);

variables declared within a function is recognized only withing that function. Variables declared outside of a function is recognized anywhere in the webpage within javascript code from the declaration place.
4. Operators
Assignment operators

var rich = 5000;
var lotsOfMoney = 100000;
rich = lotsOfMoney;
document.write(rich);

Arithmetic and concatenation operators
five = two + three;
profit = income - expenses;
income = sales * price;
payment = total / instalments;
option = randnum % choices;
b = ++a;
c = a++;
d = --a;
e = a--;
Combination of Operators like c/c++
joy += happiness;
price -= discount;
capital *= interest;
pie /= slices;
options %= choice;
Example use:

var singlePrice = 8;
var bulkPrice = singlePrice * 9;
document.write('

Buy our Widgets $'
+singlePrice+' for one, $'+bulkPrice+' for ten

');

5. Comparing Variables, Logical statements

var red = 5;
var blue = 3;
var match = null;
if (red == blue)
{
match = 'equal';
}
else
{
match = 'unequal';
}
document.write(red + ' and ' + blue + ' are ' + match);

Other comparison operators:
if (red > blue)
if (red >= blue)
if (red < blue)
if (red < = blue)
if (red != blue)
Combining more than one comparison
if ((red == blue) || (red == green))

var red = 5;
var blue = 3;
var green = 3;
var match = null;
if ((red == blue) && (red == green))
{
match = 'equal';
}
else
{
purple = 'unequal';
}
document.write(red + ' and ' + blue + ' are ' + match);

Comparison in short
red == blue ? match = 'equal' : match = 'unequal';
instead of
if (red == blue)
{
match = 'equal';
}
else
{
match = 'unequal';
}
Example Use:


var discPrice = 25;
var regPrice = 25;
var discount = regPrice - discPrice;
if (discount > 0)
document.write('

Save $'+discount+ ' off the normal price of $' +regPrice+ 'now only $'+discPrice+'.

');
else
document.write('

Buy now at our regular cheap price of $' + regPrice+'.

' );

6. Switch statement in Javascript, very similar to C/C++/Java
use switch instead of multiple if/else if

var red = 1;
var result = null;
switch (red)
{
case 1: result = 'one'; break;
case 2: result = 'two'; break;
default: result = 'unknown';
}
document.write(result);

Example:

var message = 0;
switch (message)
{
case 1: document.write('Merry Christmas'); break;
case 2: document.write('Happy New Year'); break;
case 3: document.write('Happy Easter'); break;
case 4: document.write('Happy Holidays'); break;
default: document.write('Welcome');
}

7. Function
Defining a function
function myCode()
{
document.write('Hello World');
}
calling a function
myCode()
Example:
function displayMessage()
{
switch (message)
{
case 1: document.write('Merry Christmas'); break;
case 2: document.write('Happy New Year'); break;
case 3: document.write('Happy Easter'); break;
case 4: document.write('Happy Holidays'); break;
default: document.write('Welcome');
}
}
var message = 0;
displayMessage();
parameter passing
function writeSentence(argument1,argument2)
{
document.write('The '+argument1+' is '+argument2+'.
');
}
var a = 'table';
var b = 'chair';
var c = 'red';
var d = 'blue';
writeSentence(a,c);
writeSentence(b,c);
b = 'other ' + b;
writeSentence(b,d);
writeSentence('table',b); //passing the value directly
Example:
function displayMessage(m)
{
switch (m)
{
case 1: document.write('Merry Christmas'); break;
case 2: document.write('Happy New Year'); break;
case 3: document.write('Happy Easter'); break;
case 4: document.write('Happy Holidays'); break;
default: document.write('Welcome');
}
}
In Javascript functions can also return values
function validField(fld)
{
if (fld == '') return false;
return true;
}
function validField(fld)
{
return (fld != '');
}
How to receive returned values and process
document.write(myField + ' is ');
if (!validField(myField))
{
document.write('not ');
}
document.write('empty');
8. Alert and confirm
alert('Alert Message');
Will display a message box with the message. Very useful in debugging javascript applications.
use confirm(), when you need user agreement on an issue. like:
if (confirm('Select a button'))
{
alert('You selected OK');
}
else
{
alert('You selected Cancel');
}
9. comments
// Scrolling Ad Javascript
// copyright 3rd September 2004, by Stephen Chapman
// permission to use this Javascript on your web page is
// granted provided that all of the code in this script (including
// these comments) is used without any alteration
or
/* Scrolling Ad Javascript
copyright 3rd September 2004, by Stephen Chapman
permission to use this Javascript on your web page is
granted provided that all of the code in this script (including
these comments) is used without any alteration */

10. Debugging JavaScript
Test in different browsers like IE, Mozilla, Firfox, Netscape
Enable Javascript and script debugging
Script debugging usually reside under tools menu under browsing or web development sub-options

Using alert to check variable values or if you can reach to a particular point of your code
use bookmarklets, these are small scripts that can be used as plug in into browsers to provide error information.
Use firebug in firefox, also use error console under tools menu to debug javascript error.
Visual interdev provides Javascript debugging you may also enable external debugging by such programs
11. External javascript

You can place all of your javascript codes to an external file. and use the file scripts/functions from any webpage.
You just need to provide a reference to that external file.
You can provide reference as follows:
<script language="javascript" type="text/javascript"
src="hello.js">

Note: do not include any or in the external file.
12. Using tag: this tag may help you to provide some information to the visitors
when javascript is disabled or not supported by the browsers.

document.write('Hello Javascript World');

Hello World Without Javascript

This page uses Javascript. Your browser either
doesn't support Javascript or you have it turned off.
To see this page as it is meant to appear please use
a Javascript enabled browser.

13. Objects and properties in Javascript
var strlen = myField.length;
var str = mynum.toString();
function theLetter(num)
{
var str = 'abcdefghijklmnopqustuvwxyz';
return str.substr(num-1,1);
}
document.write(theLetter(5));
14. Arrays in Javascript
var myArray = new Array();
var myArray = new Array('message one',
'message two','message three');
document.write(myArray[0]);
myArray[3] = 'message four';
function displayMessage(m)
{
var greeting = new Array('Welcome','Merry Christmas',
'Happy New Year','Happy Easter','Happy Holidays');
if (m greeting.length) m = 0;
document.write(greeting[m]);
}
15. Loops
for (var i=0; i<10; i++)
{
document.write(i);
}
var x = 0;
while (x<10)
{
document.write(x);
x++;
}
var x = 12;
do
{
document.write(x);
x++;
} while (x<10)
16. Date and Time in Javascript
//current date
var myDate = new Date;
myDate.setDate(15);
myDate.setMonth(3); // January = 0
myDate.setFullYear(2006);
myDate.setDate(myDate.getDate()+7);

From: http://sitestree.com/?p=4732
Categories:13
Tags:
Post Data:2011-02-12 19:58:06

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Quick reference to sub version’s repository administration commands #14

Sub version administration related commands

  • svnlook:to examine various revisions and transactions in a repository. No change is made by this command. Just analyze near to commit or committed changes.
  • svnadmin:
  • ls repos: check sub version repository
  • svnadmin create "path to repository"
  • svnadmin create --fs-type fsfs /path/to/repos: creates repository that uses FSFS file system
  • svnadmin create --fs-type bdb /path/to/repos : creates repository that uses BDB in the backend
  • ls repos/hooks/: This displays the hooks for the repository. Hooks are scripts that run in different repository events. You can write or use third party hooks as well
  • svnadmin help: provides information on how to use svnadmin command
  • svnadmin --version
  • Available subcommands of svnadmin: crashtest, create,deltify
  • svnlook info /path/to/repos:
  • svnlook info /path/to/repos -r 19
  • svnlook youngest /path/to/repos: younest revision number
  • svnsync: Creates read only mirror of the sub version repository
  • svnsync:subcommands:synchronize (sync),copy-revprops,help (?, h)
  • svnadmin setlog myrepos newlog.txt -r 388 :
  • svnadmin lstxns myrepos:outlisted transactions
  • svnadmin rmtxns myrepos `svnadmin lstxns myrepos`
  • svnadmin list-unused-dblogs /path/to/repos: display unused log files
  • svnadmin list-unused-dblogs /path/to/repos | xargs rm: restore disk space from unused log files
  • svnadmin recover /path/to/repos : BDB repository recover
  • svnadmin dump myrepos > dumpfile: dump svn repository
  • svnadmin load newrepos < dumpfile :effectively replays those dumped revisions into the targetrepository for that operation
  • svnadmin create newrepos
    $ svnadmin dump myrepos | svnadmin load newrepos
  • svnadmin hotcopy /path/to/repos /path/to/repos-backup:backup repository
  • $ svnadmin hotcopy --clean-logs /path/to/bdb-repos /path/to/bdb-repos-backup

Sub version repository strategies

You may create three folders: trunk, branch, tags. Trunk->main development, bracnch->to create various named brances of the main trunc, tags->collection of free snapshots that are created and destroyed

Subversion repository may make use of backend database like berkeley DB or it can just use a file system like FSFS

From: http://sitestree.com/?p=4736
Categories:14
Tags:
Post Data:2008-05-30 10:27:31

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Little note on CVS #14

CVS Version Control System:

  • There will be a repository where the files(of different versions) will be saved. Its just like a central storage of files. You will need a software that will provide this facility.
  • You also need a client software. The client software can get copies of the repository files. After, modifying clients can update/save to the repository. While saving from clients steps are needed so that version control is maintained [no inconsistency arises].
  • Linux has command based clients, also there are CVs servers for linux. Download them from the internet.
  • I have some experience of using WinCVS - a windows based CVS client.
  • In WinCVS, You can set command line parameters using Admin->commandline parameters option. You have to provide some information like: CVS server, repository path, username, password.
  • In WinCVS, you can checkout files from the CVS server using the checkout option from the menu (tools). You need to specify local path to store the files. Also, you need to mention some information like the previous step (or you can copy a string from the previous step and provide here):

From: http://sitestree.com/?p=4777
Categories:14
Tags:
Post Data:2008-07-13 11:35:14

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Good Coding Style in PHP + Other languages #15

Style 1.1: Use proper indenting

while ($x < $z) {    if ($a == 1)    {       echo 'A was equal to 1';  }   else    {       if ($b == 2)        {           //do something      }       else        {           //do something else     }   }}

1.2
while ($x < $z) { if ($a == 1) { echo 'A was equal to 1'; } else { if ($b == 2) { //do something } else { //do something else } }}

Style 2.1: Properly indent conditional statements. Always use braces, it will make later additions of more statements easier.

while ($x < $z) {   if ($a == 1)    {       echo 'A was equal to 1';  }   else    {       if ($b == 2)        {           //do something      }       else        {           //do something else     }   }}

Style 2.2

while ($x < $z) {   if ($a == 1) {      echo 'A was equal to 1';  } else {        if ($b == 2) {          //do something      } else {            //do something else     }   }}

3.1 Function Calls
No space between function names and parenthesis.

   $var = myFunction($x, $y);

3.2 Function declarations

Use braces properly, give meaningful names to the parameters, always return values from functions. Avoid printing/echoing inside functions.

function myFunction($province, $city = ''){   //indent all code inside here   return $result;}   

4. Use comments before a function. Also, use comments before a block [especially if it uses some difficult to understand logic]use PHPDoc style comments that may work like Javadoc to create documentation from your source files

/** *  short description of function * *   Optional more detailed description. * * @param $paramName - type - brief purpose *  @param ... *    ... *   @return type and description */

5. Use include_once or require_once instead of include or require to include a file that contains common variables, functions, classes.
6. Php tags: always use

  

instead of

  

7. to enclose strings use single quote ' ' rather than double quotes " ". Try to use . to concate string variables. You can use double quote and put variables inside.

 $associative_array['name']; $var='My String';   $var2='Very... long... string... ' . $var . ' ...more string... ';  $sql="INSERT INTO mytable (field) VALUES ('$var')";

8. Follow some conventions for variable and function names

  • Class name start with uppercase letter. Each word should start with uppercase letter
  • Variable and function name may start with lower case letters. Then each word will start with a capital letter
  • give meaningful names to variables and functions
  • Do not make them too lengthy. I prefer less than 12-15 character names
  • Do not abbreviate words in variable or function names. Use $url or $articleUrl as variable names, not $URL or $articleURL as

From: http://sitestree.com/?p=4741
Categories:15
Tags:
Post Data:2006-08-07 13:22:40

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Some random information regarding commenting your code #15

Some random information regarding commenting your codeIs commenting required? or suggested?Simply yes. Always comment your code.Note: Commenting is always useful only when it is done right. Bad commenting is worse than not commenting.What should you write in the comment?--------------------------------------Write why the section of the code is required.write-What does the code section do.Write it in plain english. Don't use any language syntax.If you do not find what to write...then better check did you understand the requirements of the assignment/section? Also check, are you sure your design/logic will work? Also, why your design/code will work -- did you really understand. Do not write how the code works in comments but write why and what it does.Why commenting is useful?-------------------------Commenting will make your code more readable to others.Commenting will help others to find out the right section of code to edit/modify. Also, understand the purpose of the program as well as sequence of the logic.It will also help you to review/(work on) your own code laterIn many or most companies, you will hardly write codes from scratch, you have to work on others' code. So commenting is required.Random:--------Use a clear commenting style - easy to editComment as you go/code - do not leave commenting until the end of writing codeIf you are worried that commenting will reduce performance...rather comment and use tools to create release codes without commentscomment above the code -- not at the rightvariable declaration may have comment at the rightif you use any special trick that is not ovbious from the code -- write it in comments [a trick:we can do a right shift for divide by 2]Comments and Pseudocode Programming Practice (PPP)----------------------------------------------------Comments and Pseudocode Programming Practice (PPP) go hand in hand.what is Pseudocode Programming Practice (PPP)?1. Write your logic in plain english may be as a paragraph2. Decompose it step by step into as fine grained that it can not be decomposed further. (The paragraph will be converted to lines of steps)3. comment each line/step (use comment sign like //)4. After each line/comment write the corresponding code.

From: http://sitestree.com/?p=4786
Categories:15
Tags:
Post Data:2011-10-01 17:18:46

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Introduction to software version control #14

Version control software are used to maintain and create different versions of the same software. It allows parallel software development and facilitates collaboration and team based software development. In addition, it provides features so that integration among different people's work can be made. Also, tracking back to an early stage of the software becomes possible.

Why do software companies need it? Let you may develop a software and release it. Then you may still want to keep the same version along with improving it. You want a new improved version for future release. You may want further improvements, hence further versions. Also, in internal development, several programmer may collaborate to work on different/same parts in parallel. Then they can merge them to a merged and stable/workable/reliable stage. They can create a version of the software at this moment. If any crap happens, they can come back to this stable version and continue improving/re-developing.

Among the version control software some popular ones are CVS,Subversion,Visual Source Safe, and Starteam. I personally have some working experience with starteam and subversion. In subversion, there is a repository of codes. Subversion is totally file system and directory based. Repository needs to be well designed. It may contain all projects in one folder or all projects in separate folder. Both has advantages and disadvantages. A good approach may be using them in mix. Keep similar projects in one folder and create separate folders for non-similar projects. As there are some administrative tasks that can be applied to the root folder/a folder thats why grouping may be need as project requirements may be different. It also affects the version number, usually version number is increased by the base/root folder. Still the increase may be because of another project.

A project usually contains two folders. Trunc folder is the main development folder. Branch folder is the new version/working folder.Each programmer usually creates his own copy of the branch and work on the copy. Sometimes, programmers merge their changes and keep it to the branch. While anyone wants to save his work to the branch, it will display the changes made to the same file by other programmers. Then he/she can decide how to integrate all changes into the file. The branch changes may be transferred to the main trunc folder to create a new version of the software.

From: http://sitestree.com/?p=4734
Categories:14
Tags:
Post Data:2007-07-15 12:24:21

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

PHP Security – Guidelines #16

PHP Security - Guidelines

  • Do not store sensitive information in Cookies
  • Instead of cookies, store sensitive information in Sessions
  • Sessions can also be hacked though safer than cookies
  • PHP session id is pretty random; so in general this is not a problem.
  • Reducing the session security problem: determine current user is the one who originally initiated session. if not, deny access
  • Regenerate session ids after login, on initialization
  • Change the session variable name and the path to save [session_save_path(), session_name ("xyz") ]
  • Reduce session runtime [session.gc_maxlifetime]
  • use SSL [force users to use SSL]
  • do not use .inc files and do not keep php code inside them
  • Do not use dynamic file path for require and include
  • Do not use relative file path [use absolute file path]
  • Do not trust user input to prevent XSS
  • use htmlspecialchars(). strip_tags(), htmlentities() on the user input
  • To prevent Cross-site Request Forgeries (CSRF), check $_SERVER ['HTTP_REFERER']
  • You may want to use token in your session to prevent CSRF. Re-authenticate for sensitive operations
  • When you use third party tools, do not install them in their default loation
  • When error situation occurs in your code, just stop
  • Use authorization to allow a user the minimal right he/she needs
  • Double check where you are using eval()
  • use mysql_real_escape_string() on the user provided data to be used in Databasequeries
  • Use prepared statements or stored procedures
  • Double verify the data types. do not accept string where the data has to be integer [ctype_digit()., filter_var() do not use is_int() and is_numeric()]
  • Keep log files and check your log files time to time
  • do not display detail error messages in your live site. But you can log the erros for your own checking
  • do not use standard login names such as administrator, root
  • do not put your administration module under folder named admin
  • You can even use a different file extension other than .php [but not .inc]
  • Stop spamming using your contact form. Validate email address. use filter_var()
  • encrypt sensitive information
  • initialize variables when first declared
  • Disable register_globals in php.ini
  • do not use $_REQUEST, instead use $_GET and $_POST
  • When developing use E_ALL to know all the possible errors. but turn off E_ALL in live site
  • Type Cast and verify data. Only allow the appropriate data type
  • use ctype_alnum(), ctype_alpha(), ctype_xdigit()
  • Use htmlspecialchars() and htmlentities() more than using strip_tags()
  • SQL escaping (to prevent SQL Injection): mysql_escape_string(), mysql_real_escape_string(), pg_escape_string(), pg_escape_bytea(), sqlite_escape_string()
  • to avoid double escaping use get_magic_quotes_gpc()
  • Session security technique: compare with the browser signature headers. if no match, destroy the session.
  • for shared hosting use the following two php.ini directives properly: open_basedir, safe_mode

From: http://sitestree.com/?p=5336
Categories:16
Tags:
Post Data:2013-05-05 00:07:23

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

IT Startup ideas #155

Some IT startup ideas

From: http://sitestree.com/?p=5338
Categories:155
Tags:
Post Data:2008-12-19 06:44:39

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Create sitemap with PHP #16

From: http://sitestree.com/?p=5331
Categories:16
Tags:
Post Data:2011-07-05 06:10:13

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

PHP Network Programming Related Functions #16

What can you do with them? For example 1.

  • Asterisk (http://www.asterisk.org/) is a telephony/telecommunication/PBX system management software - itr must be using many of these functions.
  • An ISP (like shaw, mts) may write applications to monitor your modem/router activities, your bandwidth, or the activities in the wireless access points - all these will use a lot of PHP network functions
  • On the server side, for the ISPs, they may have software to control/operate/interact with the routers, collecting and displaying usage statistics, network statistics - all these applications can be written in PHP. These applications will also use a lot of PHP related network functions.

From: http://sitestree.com/?p=5274
Categories:16
Tags:
Post Data:2010-02-03 12:11:09

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Code Example: Utilizing Web Services in PHP #16

PHP code to grab the best provincial mortgage rate:function find_mortgaze_rate($url){ // create a new cURL resource   $ch = curl_init();  // set URL and other appropriate options    curl_setopt($ch, CURLOPT_URL, $url);    curl_setopt($ch, CURLOPT_USERPWD, "username:password"); curl_setopt($ch, CURLOPT_HEADER, 0);    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);        // grab URL and pass it to the browser  $result = curl_exec($ch);   $bestRates = json_decode($result, true);    return $bestRates[1][5][0]['rate']; // close cURL resource, and free up system resources    curl_close($ch);    return $bestMortgaze;    }//supply URL to ProvidingMortgazeRatesForEachProvinceForDifferentYearsAndType$bestMortgaze = find_mortgaze_rate($urlToTheWebService);
Sample JavaScript Function to calculate the monthly mortgaze paymentfunction calculate(){    var rate = document.getElementById('txtRate').value;    var homePrice = document.getElementById('txtHomePrice').value;  var percentDown = document.getElementById('txtDownpaymentPercent').value;   var amortization = document.getElementById('amortization').value;   var monthlyPayment = can_mortgage_payment_purchase(homePrice, percentDown/100,  rate/100, amortization, 12, 1); document.getElementById('monthlyPayment').value = '$'+monthlyPayment.toFixed(2);}
Calculator Form Code       
Best 5 Year Fixed Rate:
Home Price:
Downpayment Percentage:
Amortization: 25 Years 30 Years
Mortgage Payment:

From: http://sitestree.com/?p=5302
Categories:16
Tags:
Post Data:2009-11-03 18:40:09

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Stored Procedure: PHP & MySQL #16

Stored Procedure: PHP & MySQL. Stored Procedures are new additions to MySQL 5. PHP has supports for Store Procedure as well (with some limitations).

From: http://sitestree.com/?p=5263
Categories:16
Tags:
Post Data:2009-10-27 05:05:14

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Debugging PHP code under Eclipse PDT #16

Click Here to Download: This is a great manual to understand clearly how to debug PHP code under eclipse PDT. However, remember that you need to install XDebugger or Zend Debugger along with Eclipse PDT. One option is, you download and install the right package with all components. Download the Eclipse PDT from my site at eclipse_with_php_ide_and_zend_debugger_just_unzip_win32.zip. You will be fine - debugging will work accordingly.

From: http://sitestree.com/?p=5259
Categories:16
Tags:
Post Data:2011-06-10 01:42:23

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

PHP String Related Built in Functions #16

Check the following string manipulation related functions in PHP. String manipulation is pretty common in Software Development (esp. in high level, even in low level applications say you are working with network protocols - you need to interpret/parse the protocol language). Memorizing library functions is always a good thing - it's a matter of productivity. However, knowing more functions does not guarantee that you will be able to solve a programming problem. However, if you are good at solving problems in general (in programming in general), knowing functions will improve your productivity (may also help to maintain/improve quality of software indirectly).

You will find many string related functions very useful such as:

  • trim, rtrim, ltrip, chop, and similar: You may use these functions on user inputs, on data from databases, on data to insert into databases, while comparing two strings.
  • Wordwrap: To wrap words to create consistent user interfaces
  • substr_ compare, substr_ count, substr_ replace, substr, strstr, strchr: You will find these functions very usefull. Mostly substring related.
  • htmlspecialchars, addslashes, stripslashes, stripcslashes, html_ entity_ decode, htmlentities, htmlspecialchars_ decode,htmlspecialchars: For storing/retrieving HTML data into/from databases.
  • echo, print, fprintf, sprintf, vprintf, vfprintf: To output string. Formatted, non-formatted.
  • strtok, split, implode, explode, chunk_split : These are for dividing and merging strings.
  • money_format, number_format: To output string in money or number format.
  • strnatcasecmp, strnatcmp, strncasecmp, strncmp, similar_text : String comparison related functions.
  • strtolower, strtoupper, ucfirst, ucwords, lcfirst: the names tell it all. Case conversion related.
  • md5_ file, md5, sha1_ file, sha1, crc32, crypt: encryption & related
  • sscanf: formatted input
  • addcslashes
  • addslashes
  • bin2hex
  • chop
  • chr
  • chunk_ split
  • convert_ cyr_ string
  • convert_ uudecode
  • convert_ uuencode
  • count_ chars
  • crc32
  • crypt
  • echo
  • explode
  • fprintf
  • get_ html_ translation_ table
  • hebrev
  • hebrevc
  • html_ entity_ decode
  • htmlentities
  • htmlspecialchars_ decode
  • htmlspecialchars
  • implode
  • join
  • lcfirst
  • levenshtein
  • localeconv
  • ltrim
  • md5_ file
  • md5
  • metaphone
  • money_ format
  • nl_ langinfo
  • nl2br
  • number_ format
  • ord
  • parse_ str
  • print
  • printf
  • quoted_ printable_ decode
  • quoted_ printable_ encode
  • quotemeta
  • rtrim
  • setlocale
  • sha1_ file
  • sha1
  • similar_ text
  • soundex
  • sprintf
  • sscanf
  • str_ getcsv
  • str_ ireplace
  • str_ pad
  • str_ repeat
  • str_ replace
  • str_ rot13
  • str_ shuffle
  • str_ split
  • str_ word_ count
  • strcasecmp
  • strchr
  • strcmp
  • strcoll
  • strcspn
  • strip_ tags
  • stripcslashes
  • stripos
  • stripslashes
  • stristr
  • strlen
  • strnatcasecmp
  • strnatcmp
  • strncasecmp
  • strncmp
  • strpbrk
  • strpos
  • strrchr
  • strrev
  • strripos
  • strrpos
  • strspn
  • strstr
  • strtok
  • strtolower
  • strtoupper
  • strtr
  • substr_ compare
  • substr_ count
  • substr_ replace
  • substr
  • trim
  • ucfirst
  • ucwords
  • vfprintf
  • vprintf
  • vsprintf
  • wordwrap

From: http://sitestree.com/?p=5261
Categories:16
Tags:
Post Data:2006-08-01 21:49:26

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

PHP SQL Server Stored Procedure #16

/* prepare the statement resource */
$stmt=mssql_init("your_stored_procedure", $conn);

/* now bind the parameters to it */
mssql_bind($stmt, "@id", $id, SQLINT4, FALSE);
mssql_bind($stmt, "@name", $name, SQLVARCHAR, FALSE);
mssql_bind($stmt, "@email", $email, SQLVARCHAR, FALSE);

/* now execute the procedure */
$result = mssql_execute($stmt);

Another Example

$conn = mssql_connect($db_host,$db_user,$db_password);if ($conn===false){	
echo 'Cannot connect.';
exit;
}

if (mssql_select_db("YourDatabase",$conn) === false) {
echo 'no database';
exit;
}

$proc = mssql_init('YourStoredProcedure',$conn);
mssql_bind($proc,'@ParameterOne',$ParameterOne,SQLVARCHAR);
mssql_bind($proc,'@ParameterTwo',$ParameterTwo,SQLVARCHAR);
mssql_bind($proc,'@ParameterThree',$ParameterThree,SQLVARCHAR);
if ($result = mssql_execute($proc)) {
if ($row = mssql_fetch_row($result)){
// process results
}
}
From: http://sitestree.com/?p=5256
Categories:16
Tags:
Post Data:2011-08-31 17:44:38
Shop Online: https://www.ShopForSoul.com/ (Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com In Bengali: http://Bangla.SaLearningSchool.com http://SitesTree.com 8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) Shop Online: https://www.ShopForSoul.com/ Medium: https://medium.com/@SayedAhmedCanada

PHP Functions for SQL Server #16

The name of the functions may closely resemble the functionality.

# mssql_ bind
# mssql_ close
# mssql_ connect
# mssql_ data_ seek
# mssql_ execute
# mssql_ fetch_ array
# mssql_ fetch_ assoc
# mssql_ fetch_ batch
# mssql_ fetch_ field
# mssql_ fetch_ object
# mssql_ fetch_ row
# mssql_ field_ length
# mssql_ field_ name
# mssql_ field_ seek
# mssql_ field_ type
# mssql_ free_ result
# mssql_ free_ statement
# mssql_ get_ last_ message
# mssql_ guid_ string
# mssql_ init
# mssql_ min_ error_ severity
# mssql_ min_ message_ severity
# mssql_ next_ result
# mssql_ num_ fields
# mssql_ num_ rows
# mssql_ pconnect
# mssql_ query
# mssql_ result
# mssql_ rows_ affected
# mssql_ select_ db

For details on the functions, please check:

http://ca.php.net/manual/en/ref.mssql.php

From: http://sitestree.com/?p=5255
Categories:16
Tags:
Post Data:2007-01-03 13:49:48

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Software/Packages for Creating PHP Development Platform #16

From: http://sitestree.com/?p=5171
Categories:16
Tags:
Post Data:2011-05-06 14:48:51

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Providing Single Sign on using Google and OpenID. #16

From: http://sitestree.com/?p=5181
Categories:16
Tags:
Post Data:2013-03-21 20:07:20

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Cake PHP Framework Resources #16

From: http://sitestree.com/?p=5170
Categories:16
Tags:
Post Data:2013-06-24 11:24:46

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

PHP in the Enterprises #16

From: http://sitestree.com/?p=5141
Categories:16
Tags:
Post Data:2011-07-04 14:41:16

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Zend Framework: Programmer’s Reference Guide #16

From: http://sitestree.com/?p=5169
Categories:16
Tags:
Post Data:2006-10-26 13:05:07

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

PHP Language Features: Tools Strengths #16

PHP Language Features: Tools Strengths: Some resources from the Internet are provided below.

From: http://sitestree.com/?p=5143
Categories:16
Tags:
Post Data:2009-08-13 21:28:24

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

PHP Features for Enterprise Application Development #16

From: http://sitestree.com/?p=5142
Categories:16
Tags:
Post Data:2012-06-23 11:00:43

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Cheat Sheets for Better Productivity #16

Cheat sheets can increase productivity in programming. How?In a cheat sheet, you can write down different functions [with parameters and syntax] that you use frequently [or all the important functions of a programming language]. Whenever, you are confused, take a quick look at the cheat sheets. Sometimes it can be faster than searching the internet. You can categorize the functions based on the purpose, within a category - sort them alphabetically for easier search/scan. You can create, many cheat sheets for a particular language. Keep them beside you while you are writing codes. A sample cheat sheet regarding PHP functions to handle MySQL database is provided below. Note, the cheat sheet needs to be improved such as: categorize the functions [like for connection management, retrieving data, keep track of database/operation status, collecting information about the database [meta-data]], sort the functions alphabetically. Keep the font size small to list more functions in a small space

resource mysql_unbuffered_query ( string $query [, resource $link_identifier ] ) Send an SQL query to MySQL, without fetching and buffering the result rows
int mysql_thread_id ([ resource $link_identifier ] ) Return the current thread ID
bool mysql_ping ([ resource $link_identifier ] ) Ping a server connection or reconnect if there is no connection
resource mysql_list_processes ([ resource $link_identifier ] ) List MySQL processes
string mysql_tablename ( resource $result , int $i ) the table name from a result
string mysql_stat ([ resource $link_identifier ] ) Get current system status
bool mysql_set_charset ( string $charset [, resource $link_identifier ] ) Sets the default character set for the current connection.
bool mysql_select_db ( string $database_name [, resource $link_identifier ] ) Select a MySQL database
string mysql_result ( resource $result , int $row [, mixed $field ] ) Retrieves the contents of one cell from a MySQL result set.
string mysql_real_escape_string ( string $unescaped_string [, resource $link_identifier ] ) Escapes special characters in the unescaped_string , taking into account the current character set of the connection so that it is safe to place it in a mysql_query(). If binary data is to be inserted, this function must be used
resource mysql_query ( string $query [, resource $link_identifier ] ) sends a unique query (multiple queries are not supported) to the currently active database
resource mysql_pconnect ([ string $server [, string $username [, string $password [, int $client_flags ]]]] ) Establishes a persistent connection to a MySQL server.
int mysql_num_rows ( resource $result ) Retrieves the number of rows from a result set
int mysql_affected_rows ([ resource $link_identifier ] ) Get the number of affected rows by the last INSERT, UPDATE, REPLACE or DELETE
int mysql_num_fields ( resource $result ) Retrieves the number of fields from a query.
resource mysql_list_tables ( string $database [, resource $link_identifier ] ) Retrieves a list of table names from a MySQL database.
resource mysql_list_fields ( string $database_name , string $table_name [, resource $link_identifier ] ) Retrieves information about the given table name.
use mysql_query() to issue a SQL SHOW COLUMNS FROM table
resource mysql_list_dbs ([ resource $link_identifier ] ) List databases available on a MySQL server
int mysql_insert_id ([ resource $link_identifier ] ) Get the ID generated from the previous INSERT operation
string mysql_info ([ resource $link_identifier ] ) Get information about the most recent query
string mysql_get_server_info ([ resource $link_identifier ] ) Retrieves the MySQL server version.
int mysql_get_proto_info ([ resource $link_identifier ] ) Retrieves the MySQL protocol.
string mysql_get_host_info ([ resource $link_identifier ] ) Describes the type of connection in use for the connection, including the server host name.
string mysql_get_client_info ( void ) returns a string that represents the client library version.
bool mysql_free_result ( resource $result ) free all memory associated with the result identifier result .
string mysql_field_type ( resource $result , int $field_offset ) Get the type of the specified field in a result
string mysql_field_table ( resource $result , int $field_offset ) Get name of the table the specified field is in
bool mysql_field_seek ( resource $result , int $field_offset ) Set result pointer to a specified field offset
string mysql_field_name ( resource $result , int $field_offset ) Get the name of the specified field in a result
int mysql_field_len ( resource $result , int $field_offset ) returns the length of the specified field.
string mysql_field_flags ( resource $result , int $field_offset ) Get the flags associated with the specified field in a result
array mysql_fetch_row ( resource $result ) Get a result row as an enumerated array
object mysql_fetch_object ( resource $result [, string $class_name [, array $params ]] ) Fetch a result row as an object
array mysql_fetch_lengths ( resource $result ) Get the length of each output in a result
object mysql_fetch_field ( resource $result [, int $field_offset ] ) Get column information from a result and return as an object
array mysql_fetch_assoc ( resource $result ) Fetch a result row as an associative array
array mysql_fetch_array ( resource $result [, int $result_type ] ) Fetch a result row as an associative array, a numeric array, or both
string mysql_escape_string ( string $unescaped_string ) Escapes a string for use in a mysql_query
string mysql_error ([ resource $link_identifier ] ) Returns the text of the error message from previous MySQL operation
int mysql_errno ([ resource $link_identifier ] ) Returns the numerical value of the error message from previous MySQL operation
bool mysql_drop_db ( string $database_name [, resource $link_identifier ] ) Drop (delete) a MySQL database
resource mysql_db_query ( string $database , string $query [, resource $link_identifier ] ) selects a database, and executes a query on it.
string mysql_db_name ( resource $result , int $row [, mixed $field ] )
bool mysql_data_seek ( resource $result , int $row_number ) Move internal result pointer
bool mysql_create_db ( string $database_name [, resource $link_identifier ] Create a MySQL database
resource mysql_connect ([ string $server [, string $username [, string $password [, bool $new_link [, int $client_flags ]]]]] ) Open a connection to a MySQL Server
bool mysql_close ([ resource $link_identifier ] ) Close MySQL connection
string mysql_client_encoding ([ resource $link_identifier ] ) Returns the name of the character set
int mysql_change_user ( string $user , string $password [, string $database [, resource $link_identifier ]] ) Change logged in user of the active connection
int mysql_affected_rows ([ resource $link_identifier ] ) Get number of affected rows in previous MySQL operation

From: http://sitestree.com/?p=5139
Categories:16
Tags:
Post Data:2011-11-14 22:16:24

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Database Operation Handling in PHP #16

Not the best approach. Just one approach. At least to help with thinking. to start with.

< ?php       

//you can keep database parameters in a file [text file or xml file]. 

/*
Create two users one with only read permission, another with read-write permission. 
Use read user related connection in read only operations. 
read-write user related database connection should be used only when writing is associated
*/

//database user with read only permission   
$roUser = "";   
$roPassword = "";   

//database user with read-write permission      
$rwUser = "";   
$rwPassword = "";           

//database and the host $host = "localhost";    
$database = "your_database";    

?>

< ?php            

//read only handle to database  
$dbhReadOnly = null;         

//read-write handle to database 
$dbhReadWrite = null;   

//read-write connection creation    
function getDbhReadWrite(){         

global $rwUser, $rwPassword, $host, $database;              
//connect to db with user that has read-write permission to the database        $dbhReadWrite = mysqli_connect( "$host",  "$rwUser", "$rwPassword", "$database");       //var_dump($dbhReadWrite);              
if (!($dbhReadWrite))           
return null;                
return  $dbhReadWrite;          

}   

//read-only connection creation 
function getDbhReadOnly(){          
global $roUser, $roPassword, $host, $database;              

//connect to the database with a user that has only read permission to the database     

$dbhReadOnly = mysqli_connect( "$host",  "$roUser", "$roPassword", "$database");                        

if (!($dbhReadOnly))            
return null;                
return  $dbhReadOnly;           
}       

//read-only connection - can be used from other php files    
$dbhReadWrite = getDbhReadWrite();

//read-write connection-     
$dbhReadOnly = getDbhReadOnly();

?>

From: http://sitestree.com/?p=5135
Categories:16
Tags:
Post Data:2007-01-01 17:15:46

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

PHP: How to Execute Remote Scripts/Services #16


$url is the URL to execute

$url = $_GET['url'];$file = fopen ($url, "r");if (!$file){echo "Error.n";}else{header('Content-Type: text/xml');while (!feof ($file)){$line = fgets ($file, 1024);echo $line;}}fclose($file);

How to pass information from JavaScript to PHP/JSP - mix of PHP and JavaScript

//we are passing some value say 15 from JavaScript to PHPlocation.href="?xyz=15";   

fsockopen

$fp = fsockopen("$urlToExecute");        if (!$fp) {         echo "$errstr ($errno)
n"; } else { $out = "GET / HTTP/1.1rn"; $out .= "Host: $urlToExecutern"; $out .= "Connection: Closernrn"; fwrite($fp, $out); while (!feof($fp)) { echo fgets($fp); } fclose($fp); }

CURL: activate curl in php.ini



XML-RPCCreating and Consuming Web Services With PHP
check: http://webservices.xml.com/pub/a/ws/2004/03/24/phpws.html


http_get
$response = http_get($urlToExecute, array("timeout"=>1), $info);


From: http://sitestree.com/?p=5133
Categories:16
Tags:
Post Data:2008-08-22 11:42:28

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Payment Processing Implementation: Concept and PHP Implementation #16

Payment Processing Implementation: Concept and PHP Implementation. The following is referring to a short-note in another part of our web-site.

From: http://sitestree.com/?p=5131
Categories:16
Tags:
Post Data:2007-09-09 05:04:56

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Emailing in PHP: use PHP Mailer Package #16

  • Download PHPMailer Package from: http://sourceforge.net/project/showfiles.php?group_id=26031
  • Unzip=install
  • In the class "class.smtp.php", there is a send method that can be used to send emails
  • PHPMailer provides different ways of mailing: default php mail function [capabilities limited], Using a SMTP server [with or without authentication], using Sendmail software
  • PHP mailer can attach files, can send HTML emails
  • In the class "class.smtp.php", you can write a function that can use send method to send emails. Your method can take parameters to set mailing parameters. Callers will supply the parameters.
  • A sample method can be as follows:
    public function prepareAndSendMail($fields){                date_default_timezone_set('America/Toronto');               $this->IsSMTP();     $this->IsHTML(true); // send as HTML     $this->SMTPAuth   = true;                  // enable SMTP authentication     $this->SMTPSecure = "ssl";                 // sets the prefix to the servier     $this->Host       = "SMTP server address"; // set SMTP server        $this->Port       = port usually 25 or 465;// set the SMTP port              $this->Username   = "user name for smtp server"; // smtp server username     $this->Password   = "user password"; // smtp server password             $this->AddReplyTo("reply to email address","");              $this->From       = "email address to send from";        $this->FromName   = "sender's name";             $this->Subject    = "subject of the email";              //$this->Body       = "Hi, This is the HTML BODY
"; $this->AltBody = $fields["altBody"]; //non-html body $this->WordWrap = 50; // set word wrap $this->MsgHTML($fields["body"]); $this->AddAddress($fields["to"]); $this->AddAttachment($fields["attachment"]); // attachment if(!$this->Send()) { echo "Mailer Error: " . $this->ErrorInfo; } else { echo "Message sent!"; } }

From: http://sitestree.com/?p=5128
Categories:16
Tags:
Post Data:2010-12-19 23:49:23

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

PHP What to Learn? When are you an Expert? #16

Check your PHP Knowledge
Do you know all of the following concepts? If not - why don't you learn? Know all of them and claim yourself to be an expert in PHP. How to go about learning? First know all the concepts. Then go to the details of each topic. Learning the concepts are first priority. why? if you know the concepts, you will know what you should use to solve the problem at hand. Then explore the topic and solve the problem.

PHP Basics

  • Syntax
  • Operators
  • Variables
  • Constants
  • Control Structures
  • Language Constructs and Functions

Functions

  • Syntax
  • Arguments
  • Variables
  • References
  • Returns
  • Variable Scope

Arrays

  • Enumerated Arrays
  • Associative Arrays
  • Array Iteration
  • Multi-Dimensional Arrays
  • Array Functions
  • SPL

Object Oriented Programming

  • Instantiation
  • Modifiers/Inheritance
  • Interfaces
  • Exceptions
  • Static Methods & Properties
  • Autoload
  • Reflection
  • Type Hinting
  • Class Constants

Security

  • Configuration
  • Session Security
  • Cross-Site Scripting
  • Cross-Site Request Forgeries
  • SQL Injection
  • Remote Code Injection
  • Email Injection
  • Filter Input
  • Escape Output

XML and Web Services

  • XML Basics
  • SimpleXML
  • XML Extension
  • Xpath
  • Webservices Basics
  • SOAP
  • REST

Strings and Patterns

  • Quoting
  • Matching
  • Extracting
  • Searching
  • Replacing
  • Formatting
  • PCRE

Databases and SQL

  • SQL
  • Joins
  • Analyzing Queries
  • Prepared Statements
  • Transactions
  • Database Design
  • Normalization
  • RDBMS
  • Replication/Reporting

Web Features

  • Sessions
  • Forms
  • GET and POST data
  • Cookies
  • HTTP Headers

Streams and Network Programming

  • Files
  • Reading
  • Writing
  • File System Functions
  • Streams

PHP 4/5/6 Differences

  • Object Orientation
  • E_STRICT
  • References vs. Object Handles

Design and Theory

  • IDesign Patterns
  • Code Reuse
  • OOP Theory

From: http://sitestree.com/?p=5127
Categories:16
Tags:
Post Data:2010-03-06 04:45:55

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

PHP Functions: Checking Functions: is_……() #16

  • is_infinite
  • is_float
  • is_int
  • is_integer
  • is_long
  • is_link
  • is_finite
  • is_file
  • is_bool
  • is_binary
  • is_buffer
  • is_callable
  • is_executable
  • is_double
  • is_nan
  • is_null
  • is_subclass_of
  • is_string
  • is_unicode
  • is_uploaded_file

For details, please check: PHP is_...() functions From: http://sitestree.com/?p=5125
Categories:16
Tags:
Post Data:2011-04-15 20:21:40

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

PHP is a skill not a profession #16

From: http://sitestree.com/?p=5106
Categories:16
Tags:
Post Data:2009-07-16 08:06:53

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

OOP concepts in PHP 5 in brief #16

OOP concepts in PHP 5 in short Why this short - note? if you are familiar with OOD and any OOP language such as Java/C++, this short note will give you enough information to start with PHP 5 OOP Class

  • Class definition starts with the keyword class, followed by a class name (non reserved word), followed by a pair of curly braces. The curly braces contain the definition of the classes members and methods
  • You can create objects based on the classes. $obj = new className()
  • You use $obj->methodName() to access a class method (public). You can use className::classMember to access class members (static): to use :: operator the method does not need to be declared static
  • Inside a class all class methods have access to $this variable to refer to the calling object (if called from/using an object)
  • member declaration: public $var = 'a default value
  • Default value always is: constant expression
  • Class/Object Functions
  • A class can use extends keyword to inherit methods and members of another class
  • Multiple inheritance is not allowed
  • To avoid using a long list of includes in the beginning of php files, you can use __autoload() function to do the job for you
  • When you try to use an undefined class/interface an __autoload function is automatically called
  • function __autoload($class_name) {                 
       require_once $class_name . '.php';               
    }
  • Constructor syntax: void __construct ([ mixed $args [, $... ]] )
  • Parents' constructors are not automatically called from children's constructos. use explicit parent::__construct() instead
  • Destructor syntax: void __destruct ( void )
  • Destructor is called: 1. all references to the object are removed 2. the object is explicitly destroyed 3. in shutdown sequence
  • Parents' destructors are not automatically called from children's destructors. use explicit parent::__destruct() instead
  • Access modifiers for class members: public, protected or private: Public - accessible from anywhere. Protected - accessible from inherited and parent classes, within the class. Private - accessible within the class
  • No access modifier = public
  • :: - scope resolution operator - allows access to static, constant, and overridden members or methods of a class
  • Abstract classes: Introduced in PHP 5. You are not allowed to reate an instance of an abstract class.
  • Even if a class contains one abstract method, the class must bedeclared abstract
  • Abstract classes are just about signatures, they cannot define the implementation
  • A class inheriting from an abstract class, must have to implement all abstract methods. The abstract methods must be defined with the same/(less restricted) visibility
  • Interface: Just the method signatures. No method implementation inside interfaces
  • All interface methods must be public
  • Classes implementing interfaces must implement all methods. Classes use implements keyword to implement an interface
  • A class can not implement two interfaces having same class names
  • Interfaces can be extended using extends keyword
  • Interfaces can also have constants
  • Overloading: Overloading in PHP = dynamically "create" members and methods
  • overloading methods: invoked when interacting with non-declared/invisible members or methods
  • All overloading methods must be defined as public
  • In PHP, overloading is done through magic methods
  • The arguments of the magic methods can not be 'passed by reference'
  • Member overloading methods: void __set ( string $name , mixed $value ), mixed __get ( string $name ), bool __isset ( string $name ), void __unset ( string $name )
  • Method overloading: mixed __call ( string $name , array $arguments ), mixed __callStatic ( string $name , array $arguments )
  • Object Iteration: Inside the class
    foreach($this as $key => $value) {                  
       print "$key => $valuen";              
    }
  • Object Iteration: Outside class:
    $class = new MyClass();               
    foreach ($class as $key => $value) {                 
       print "$key => $valuen";
    }
  • Patterns: Factory Pattern: allows the instantiation of objects at runtime
  • Patterns: Singleton: Helps in situations where only a single instance of a class is required that will be used by many other objects
  • Magic methods: have special meaning. __construct, __destruct (see Constructors and Destructors), __call, __callStatic, __get, __set, __isset, __unset, __sleep, __wakeup, __toString, __set_state and __clone
  • serialize() - applies to __sleep(). unserialize() applies to __wakeup()
  • final keyword: final members can not be overriden, final classes can not be extended
  • $copy_of_object = clone $object; : will create a clone of $object. Unless a __clone method defined, a shadow is created. __clone() method can define how the cloning will be done
  • Objects Comparison: == : two object instances are equal if they have the same attributes and values, and are instances of the same class.
  • Objects Comparison: === : Object variables are identical if and only if they refer to the same instance of the same class
  • Reflection APIs: to reverse-engineer classes, interfaces, functions and methods, extensions
  • Reflection APIs: Offer ways to retrieve doc comments for functions, classes and methods
  • Type Hinting: Functions can enforce parameters to be objects:
  • Late Static Bindings: to refer the called class in a context of static inheritance.

From: http://sitestree.com/?p=5105
Categories:16
Tags:
Post Data:2011-07-30 15:39:51

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

An excellent survey on Open Source CMS (PHP) #16

From: http://sitestree.com/?p=5108
Categories:16
Tags:
Post Data:2008-12-28 21:26:32

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Some Good PHP Articles #16

From: http://sitestree.com/?p=5107
Categories:16
Tags:
Post Data:2009-06-03 02:27:03

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

PHP & MVC #16

From: http://sitestree.com/?p=5096
Categories:16
Tags:
Post Data:2006-08-24 17:42:23

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

PHP – Coding Style #16

Some web-resources describing PHP coding styles along with documenting styles are provided below.

From: http://sitestree.com/?p=5097
Categories:16
Tags:
Post Data:2006-10-25 10:24:50

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Drupal PHP Yahoo Webhosting Register Globals #16

If you search google (with terms like 'Drupal Yahoo Hosting'), you will see many people are having troubles to install Drupal under yahoo web-hosting. The issue is with the register_globals (php_ini) variable. They are too frustrated to give up either Drupal or Yahoo Web-hosting. Yahoo did not make the required changes for them (in php.ini). However, the solution (good or bad - you decide) is pretty simple.

Just open the file: /drupal-6.6/modules/system/system.install and change the following line:

$register_globals = trim(ini_get('register_globals'));
to
$register_globals = '';

and you are done. (Drupal - 6.6). [I know - having register_globals to be on is not secure.]

From: http://sitestree.com/?p=5103
Categories:16
Tags:
Post Data:2009-12-16 14:58:23

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Part 2: How to install PHP/MySQL Development Environment: Eclipse PDT #16

Part 2: How to install PHP/MySQL Development Environment: Eclipse PDT

  1. Video Tutorial on this Topic
  2. Tools required: PHP 5, MySQL 5, MySQL GUI, IIS/Apache, Eclipse PDT
  3. Download software and install them. Mostly unzipping or clicking on setup.exe
  4. Use Windows - add remove programs to install IIS
  5. Configure php.ini for PHP 5 to support MySQL
  6. Configure Eclipse PDT to support PHP. Eclipse PDT is the PHP development IDE
  7. Configure IIS/Apache to support PHP
  8. Configure IIS to setup web-sites pointing to your ongoing web-site projects
  9. Eclipse PDT
    • Create Project: File -> New -> Project -> PHP Project
    • Test a webpage: Click the web-page -> right click -> run as -> as PHP Script/as PHP Web Page
    • Debug a PHP web-page: Click the web-page -> right click -> Debug as -> as PHP Script

From: http://sitestree.com/?p=5083
Categories:16
Tags:
Post Data:2009-03-20 18:42:03

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

How to Install Drupal Ecommerce #16

From: http://sitestree.com/?p=5094
Categories:16
Tags:
Post Data:2010-10-05 14:02:48

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Comparison among some popular PHP CMSs #16

From: http://sitestree.com/?p=5007
Categories:16
Tags:
Post Data:2009-09-04 15:17:53

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

A Sample PHP Class #16

A sample PHP class is provided below. How the class is used?

When the submit button from the interface (web-page) will be clicked the code in the form-action web-page will call the the create method (static) to create a Ticket data/row in the database table Ticket. The method call will look like Ticket::create(array with field=>value pair, as formed with form submitted data) and you will get an Ticket object created with the inserted row/data.

To update a Ticket, you can create the Ticket object (constructor will do it for you) as you will know the Ticket id at this time. Then use the appropriate set method to update the value in the database.

To search call the static search method with a list/array of field=>value pair.

$dbh (read-only) and $dbhWrite(read-write) are global variables that represent connections to the database.

//represents a customer submitted Ticketclass Ticket{  public $parentTicket;   private $dbh_;  //member variables, named after the column names of the databse table - Ticket  private $id_;   private $type;  private $subject_;  private $timestampCreated_; private $timestampUpdated_; private $status_;   private $parentTicketId_;   private $categoryId_;   private $categoryName_; private $internalNotifylist_;   private $externalNotifyList_;   private $customerId_;   private $customerName_; private $creatorId_;    private $creatorName_;  private $ownerId_;  private $assignedTo_;   //constructor, creates a Ticket object with the table row with id = $id public function  __construct($id)   {       global $dbh;        $this->dbh_ = $dbh;      $this->refreshValues($id);   }   public function refreshValues($id)  {       $query="Select Ticket.*, TicketCategory.name  from Ticket left join TicketCategory on Ticket.categoryId = TicketCategory.id             where Ticket.id=$id";       if ($result=$this->dbh_->query($query))           if($result->num_rows==1)         {               $row=$result->fetch_object();                $this->id_ = $id;                $this->type_=$row->type;              $this->subject_ = $row->subject;              $this->timestampCreated_ = $row->timestampCreated;                $this->timestampUpdated_ = $row->timestampUpdated;                $this->status_ = $row->status;                $this->parentTicketId_ = $row->parentTicketId;                if($this->parentTicketId_>0)                  $this->parentTicket=$row->parentTicketId; //new Ticket($this->parentTicketId_);                else $this->parentTicketId=0;                $this->categoryId_ = $row->categoryId;                $this->categoryName_ = $row->name;                $this->internalNotifyList_ = $row->internalNotifyList;                $this->externalNotifyList_ =$row->externalNotifyList;             $this->customerId_ = $row->customerId;                $this->creatorId_ = $row->creatorId;              $this->ownerId_ =$row->ownerId;               $this->assignedTo_ =$row->assignedTo;             return true;            }           else                return false;   }   //methods to retrieve/set data/member variables //retrieve id   public function getId() {       if($this->id_>0) return $this->id_;        else return false;  }   //set id    public function setId($id)  {       if (is_numeric($id))        {           if ($this->setField('id',$id)) return true;          else return false;      }       else return false;  }   public function getCustomerId() {       if($this->id_>0) return $this->customerId_;        else return false;  }   public function setCustomerId($customerId)  {       if (is_numeric($customerId))        {           if ($this->setField('customerId',$customerId))               return true;            else return false;      }       else return false;  }    //used by methods to set member variables  private function setField($field, $value)   {       $dbhWrite=getDbhWrite();        $query="update Ticket set $field='".$dbhWrite->escape_string($value)."' where id=$this->id_";     $result = $dbhWrite->query($query);      if ($result==true)      {           if($dbhWrite->affected_rows==1)          {               $this->setTimestampUpdated();                $this->refreshValues($this->id_);             return true;            }           else return false;      }       else return false;  }    //used to create an entry into the Ticket table (database).    //After insertion this row is used to form a Table object and returned to the caller    static public function create($fields)  {       $dbhWrite=getDbhWrite();        $timestamp = time();        $parentTicketId='null';     $customerId='null';     $ownerId='null';        $assignedTo='null';     $categoryId='null';     $type='null';       foreach($fields as $field => $value)     {           switch($field)          {               case "type":                    if(self::isPermittedType($value)) $type=$value;                 else return false;                  break;              case "status":                  if(self::isPermittedStatus($value)) $status=$value;                 else return false;                  break;              case "subject":                 if (is_string($value))                      $subject=$dbhWrite->escape_string($value);                   else                        return false;                   break;              case "parentTicketId":                  if(is_numeric($value))                      $parentTicketId=$value;                 break;              case "categoryId":                  if(is_numeric($value))                      $categoryId=$value;                 break;              case "customerId":                  if(is_numeric($value)) $customerId=$value;                  else return false;                  break;              case "creatorId":                   if(is_numeric($value))                      $creatorId=$value;                  else return false;                  break;              case "ownerId":                 if(is_numeric($value))                      $ownerId=$value;                    break;              case "assignedTo":                  if(is_numeric($value))                      $assignedTo=$value;                 break;          }       }       $insertStr = "insert into Ticket (type,subject, timestampCreated, timestampUpdated, status, parentTicketId, categoryId, customerId, creatorId, ownerId, assignedTo) values ($type, '$subject', $timestamp, $timestamp, $status, $parentTicketId, $categoryId, $customerId, $creatorId,$ownerId,$assignedTo)";       $result = $dbhWrite->query($insertStr);      if ($result == true)        {           if ($dbhWrite->affected_rows==1)         {               $ticket=new Ticket($dbhWrite->insert_id);                return $ticket;         }           else return false;      }       else return false;  }   //searches the entire ticket table based on supplied field=>value pairs  static public function searchFields($fields,$orderBy='id')  {       global $dbh;        $query="select * from Ticket where ";       foreach($fields as $field => $value)     {           if($value[0]=="!") //checking for not equal condition           {               $value=substr($value,1);                $query.="`".$dbh->escape_string($field)."`!='".$dbh->escape_string($value)."' and ";          }           else                $query.="`".$dbh->escape_string($field)."`='".$dbh->escape_string($value)."' and ";       }       $query=substr($query,0,-5);     $query.=" order by ".$dbh->escape_string($orderBy);      $result = $dbh->query($query);       if ($result)        {           if ($dbh->affected_rows>0)            {               $tickets = array();             $tickets = Ticket::processResult($result);              return $tickets;            }           else return false;      }       else return false;  }    //used by searchFields method. Converts a set of retrieved data rows into array of objects.    static private function processResult($result)  {       if($result->num_rows >= 1)        {           $tickets=array();           while($row=$result->fetch_object())          {               $tickets[] = new Ticket($row->id);           }           return $tickets;        }       else return false;  }}

From: http://sitestree.com/?p=4808
Categories:16
Tags:
Post Data:2009-10-22 12:58:33

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

PHP Security: Coding that Maintains Security #16

Php Security

PHP can be included as a module to the web-server, or executed as a separate executable binary. In either case, it can access files, execute commands, open network connections in the server. Further, PHP can be used to write scripts with all the power of the shell users. Hence, anything running on that server may face security problems. Though, careful coding will reduce the risks to a great extent[php.net].

Common security risks in PHP[Abdul Basit, php.net]

Most common are :

  • 1-Invalidated Input Errors
  • 2-Access Control Flaws
  • 3-Session ID Protection
  • 4-Cross Site Scripting (XSS) Attacks
  • 5-SQL Injection Vulnerabilities
  • 6-Error Reporting
  • 7-Data Handling Errors
  • 8-PHP configuration settings

PHP Security when installed as a CGI Binary[php.net]

  • Do not place any interpreters into the cgi-bin directory
  • Even If PHP is installed as a standalone binary (and in cgi-bin directory), PHP can prevent attacks that may arise from such setting.
  • Accessing system files: http://my.host/cgi-bin/php?/etc/passwd -- using such URLs can be risky, the part after ? may be treated as command line arguments to the interpreter, and hence, in some cases pose risks
  • Accessing any web document on server: http://my.host/cgi-bin/php/secret/doc.html -- this way can also be risky

PHP compile time options such as --enable-force-cgi-redirect and runtime configuration directives doc_root and user_dir can be used to prevent such risks.

From: http://sitestree.com/?p=4742
Categories:16
Tags:
Post Data:2008-07-09 01:21:35

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Zend Developer Studio Overview #16

If you are familiar with Eclipse development IDE, then you can learn Zend Developer Studio pretty easily. If you are familiar with programming concepts in general and especially in PHP, then you may need 1-3 days to be good at Zend Developer Studio. You really don't need 20 years of experience to be able to work effectively with Zend Developer Studio. First, know what are the topics to learn, then learn one by one. It will be mostly common sense.

Concepts to learn in Zend Developer Studio

  • View: Any sub-window to give you information on a topic (application development). Two types: PHP, Explorer view, Outline View
  • Perspective: A collection of similar views to accomplish a specific task
  • Outline View: Tree view of an entity. open/selected entity
  • Working Sets: Collection of files or open projects that you can bind together and give a name
  • Code Editor: Learn the code editor, try to use code completion features, navigation features
  • Learn to create project:
  • Learn different ways and features of creating projects such as:
    • Projects Wizard
    • Zend Framework Project
    • Multiproject Support
    • Setting Up Working Sets
    • Importing Projects
    • Exporting Projects
    • Creating New Files
    • Using Link with Editor
    • Accessing Remote Files
  • Learn to write code under MVC model in Zend framework
  • Learn to use Zend libraries
  • Learn to use classes provided by Zend for MVC type of project development
  • You may want to learn - how to use Zend provided features to access google data, and Zend features for emailing
  • Learn Zend_PDF for PDF file creation and handling, Zend_Service for web-service based application development, Zend_Gdata for google services, Zend_Mail for mailing, Zend_Controller for MVC application development, Zend_Db for database operations, Zend_Acl for access control
  • Learn Zend Framework project structure, folder structure, and how to modify settings [database settings for example]
  • Learn how to update eclipse/zend features from the menu options. Learn how to install new eclipse/zend components.
  • Learn how to install third party plug-ins to eclipse
  • Learn how to install libraries
  • Zend studio also has an interface where you can easily design your web-pages. You have to change your perspective to this editor view (PHP/HTML WYSIWYG).
  • Learn to use a version control software with Zend studio. You may want to use CVSNT (client for CVS). You also need a Version Control Server.
  • You will get version control options under Window->preferences menu option.
  • You can set configuration for files, how they will be handled under version control
  • You also need to learn debugging. How to set debugging parameters (window->preferences). Learn how to debug locally and remotely.
  • Learn how to use debug perspective. How to use different debugging concepts such as step into, step over, run to cursor, breakpoint, watch variables and similar
  • Learn Code Analyzer, Refactoring, and SQL Integration

From: http://sitestree.com/?p=4708
Categories:16
Tags:
Post Data:2008-03-03 20:32:04

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Zend Tools for PHP Web-Application Development #16

"Zend Technologies is the leading provider of products and services for developing, deploying and managing business-critical PHP applications. The mission of Zend Technologies is to enable PHP as a world-class language for large-scale enterprise development solutions. [www.zend.com]"

  • PHP Application Server: Solutions for Business Critical PHP: http://www.zend.com/en/products/platform/
  • Zend Developer Studio for RIA: http://www.zend.com/en/products/studio/: http://www.zend.com/en/products/studio/
  • Production ready PHP: The PHP Stack for Serious Professionals: Stable and Extended PHP: http://www.zend.com/en/products/core/
  • Zend Guard: PHP encryption product: http://www.zend.com/en/products/guard/
  • Zend Optimizer: Zend Optimizer The Free Runtime for Zend Guard

From: http://sitestree.com/?p=4707
Categories:16
Tags:
Post Data:2010-01-03 06:03:51

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

How to Integrate Paymentech Payment Processing Solution on Your eCommerce Shop #17

How to Integrate Paymentech Payment Processing Solution on Your eCommerce Shop

  • Sign up with paymentech. Get approval from them. Get an account with them
  • Determine, how your software/application will verify with their API: Username/Password (preferred) or IP address
  • Get the Username/Password for them for verification with their API. You will also be assigned a Merchant ID, a Terminal ID, a Gateway URL, a bin number
  • Remember, I am talking about writing custom code to integrate. I am not talking about Hosted Solutions (Hosted: buyers are taken on paymentech web-site to pay)
  • Before the production system (actual implementation and deployment), you have to go through a certification (test phase) process. You will be given sample credit card transactions to be executed from your application as tests. If everything seems alright, you can move to production
  • So how to implement
    • As usual, you will have a credit card information collection form; yes, the amount to be charged has to be calculated/determined
    • You have to connect to Paymentech Gateway using their APIs such as XML API and SOAP API
    • I am talking about ecommerce transactions/online payments
    • Yes, other than providing the APIs, paymentech also provides SDKs. Third party companies also have modules for the purpose. These modules can be handy, else you have to implement many functionality from ground up
    • So, you connect to the Gateway (through a Gateway URL), send the credit card information and the amount. To send the request, you will usually create a NewOrderRequestElement and pass it to the gateway
    • Remember, I am talking about using SOAP for the purpose
    • In SOAP, before being able to connect and send requests to their Gateway, you will need a reference to their web-services (to the wsdl file/service)
    • Now, foreach type of transaction, you have to send a separate type of request. The gateway will give you back some response using some codes (key value pairs). The codes will provide information such as: if the transaction went through, was there any error, if the security code matched or not, the transaction reference number and similar
    • Transaction Request Types: New Order, Reversal, Capture, Inquiry
    • To send a order/purchase request, you have to create and send NewOrderRequestElement (as defined in the SOAP API), the server will get back to you with NewOrderResponseElement object
    • How do you know about the objects, what to send and what you will receive in return? when to send what type of request? what are the fields for each request and response?
    • To know, download and read SOAP API documentation from http://download.chasepaymentech.com/ more specifically from http://download.chasepaymentech.com/docs/orbital/orbital_gateway_web_service_specification.pdf
    • Know about the objects such as NewOrderRequestElement, NewOrderResponseElement, ReversalElement (to request a refund), ReversalResponseElement, EndOfDayElement (request to clear all transactions), EndofDayResponseElement
    • A list of the Objects Available. You will need to know when to send these types of requests and what the fields inside the object indicate NewOrderRequestElement, NewOrderResponseElements, MarkforCaptureRequestElements, MarkforCaptureResponseElements, ReversalRequestElements, ReversalResponseElements EndofDayRequestElements, EndofDayResponseElements, ProfileAddRequestElements, ProfileUpdateRequestElements, ProfileDeleteRequestElements ProfileRetrievalRequestElements, ProfileResponseElements, GiftCardRequestElements, GiftCardResponseElements, InquiryRequestElements InquiryResponseElements, AccountUpdaterRequestElements, AccountUpdaterResponseElements, FraudAnalysisRequestElements, FraudAnalysisResponseElements
  • Steps in your code for a Purchase Request
    • Get a reference to the wsdl (https://wsvar.paymentech.net/PaymentechGateway/wsdl/PaymentechGateway.wsdl). in Visual studio use Add Web Reference
    • Add the library in your code (in c#, using ....)
    • Create a PaymentGateway object. Specify the gateway URL to the PaymentechGateway object obj.url = "https://wsvar.paymentech.net/PaymentechGateway";
    • Create a NewOrderRequestElement. Provide information such as orbitalConnectionUserName, orbitalConnectionPassword, orderID, transType, bin, merchantID, terminalID, amount, industryType, ccAccountNum, expiryDate with the object
    • call the NewOrder method of a NewOrderResponseElement. Grab the response from the gateway and process the responses
  • A sample c# code for a order/purchase request is given below
  • get a web reference to https://wsvar.paymentech.net/PaymentechGateway/wsdl/PaymentechGateway.wsdl
          protected void btnSubmitOrder_click(object sender, EventArgs e){        PaymentechGateway gatewayObj = new PaymentechGateway();     gatewayObj.Url = "https://wsvar.paymentech.net/PaymentechGateway";      //Create a request Object       NewOrderRequestElement orderRequest = new NewOrderRequestElement();             //must supply if you use username/password combination to authenticate against API      orderRequest.orbitalConnectionUsername = "";        orderRequest.orbitalConnectionPassword = "";                //in real life, you will grab these values from a web form and assign to the orderRequest object        orderRequest.orderID = "500";       orderRequest.transType = "A"; //auth only       orderRequest.bin = "000001"; //you will be assigned a bin       orderRequest.merchantID = "3452"; //you will be assigned a merchant id      orderRequest.terminalID = "001"; //you will be given a termina ID       orderRequest.amount = "100"; //amount to be charged     orderRequest.industryType = "EC"; //ecommerce       orderRequest.ccAccountNum = "2727272727272727"; //credit card number        orderRequest.ccExp = "201509"; //credit card expiry date                try         {           NewOrderResponseElement responseElement = gatewayObj.NewOrder(orderRequest);            txtResponse.Text = "Response Status" + ":" +responseElement.approvalStatus                         +":"+responseElement.txRefNum;       }       catch (System.Web.Services.Protocols.SoapException ex)      {           txtResponse.Text = "Error Occured:"+ex.Message;     }   }       

From: http://sitestree.com/?p=5301
Categories:17
Tags:
Post Data:2010-11-21 14:11:58

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Online Reversal Request to Paymentech in C# #17

protected void saLearnOnlineReversal(object sender, EventArgs e)    {

PaymentechGateway gateway = new PaymentechGateway();
gateway.Url = "https://wsvar.paymentech.net/PaymentechGateway";        

//Create a reversal request object                
ReversalElement reversalObj = new ReversalElement();        reversalObj.orbitalConnectionUsername = "paymentech_username";        reversalObj.orbitalConnectionPassword = "paymentech_password";                reversalObj.bin = "bin number with paymentech";        
reversalObj.merchantID = "Your merchant ID with Paymentech";        
reversalObj.terminalID = "Your Terminal ID with Paymentec";        

//transaction for reversal        
reversalObj.orderID = "567";        

//as you received from authentication response        
//transaction to reverse        
reversalObj.txRefNum = "transaction reference number to reverse";         reversalObj.txRefIdx = "transaction reference ID to reverse";         ReversalResponseElement responseObj = null;        

string response = "";        
try        
{            
//send the reversal request            
responseObj = gateway.Reversal(reversalObj);            
//receive the response            
response = responseObj.approvalStatus + "-" + responseObj.procStatus;            
//you can process the response here                   
}
        
catch (Exception ex)        
{                    
}    
        
}

From: http://sitestree.com/?p=5333
Categories:17
Tags:
Post Data:2007-01-05 11:42:41

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Is there a payment processing system like this? #17

I am not sure that any bank offers such systems/services...Just wondering ..how useful will it be if you do not have to go to the bank to deposit your cheques? I think, it will be a very useful software/service for many especially for many business owners.

How the software/service will work? You may need a scanner/similar device/especially designed device attached to your computer/phone line. A software will scan and send the cheque information to the bank. The bank will have a server side software that will verify the authenticity of the cheques, deposit the amount, and announce success/failure. Optical Character Readers may help in the process. Pattern recognition will also help to identify the cheques. Also, image processing algorithms will play important roles in the software. Making the system/software secure will also be challenging.

Banks can implement such systems independently, or a 3rd party can implement such services may be using SOA. Banks and clients will use the services (for a small fee)

From: http://sitestree.com/?p=5167
Categories:17
Tags:
Post Data:2011-01-02 02:11:09

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Automating Digital Delivery with Paypal Payment Processing System #17

Just recently, I have implemented an automatic notification and digital product delivery system with Paypal Payment Processing System. The concept is, when a person buys products from your web-sites, he gets his products automatically as email attachments after you have confirmed the transaction. The most important part is - collecting payment data and buyer information from Paypal to ensure that the transaction is legitimate and the payment really went through. You can use either Paypal IPN or Paypal PDT to collect these data and email products on successful verification. Either will/should work. For me, PDT worked alright. Check the following web-pages/documents. Also, from PDT section, check the sample examples. For me the sample example with ASP/VBSCript worked alright.

In the past, I have worked with MiraServ, and Moneris payment processing systems. You can find short-notes and video tutorials in this web-site on them. Just search through our web-sites.

From: http://sitestree.com/?p=5183
Categories:17
Tags:
Post Data:2011-12-22 21:24:17

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Online Payment Processing with Moneris #17

Resources

Video Tutorial on Payment Processing by JustEtc

  • Guide on How to implement: https://www3.moneris.com/connect/en/download/feb05/HOSTED/eSELECTplus_HPP_IG.pdf
  • Demo for Hosted Pay Page Implementation: https://www3.moneris.com/connect/en/process/tryit/index.html
  • Demo Store Administration: https://esqa.moneris.com/mpg/admin/hppv3_config/index.php

Topics Covered

  • Collect Order Information: Basic, Detail
  • Go to Moneris Paypage : Validate payment, Configure payment screen
  • Return from Moneris: Success: Show success message & Receipt, Failure: Show failure message
  • Administer Moneris Store: Customize pay page appearance, Response Field Configuration, Success & Failure page configuration

From: http://sitestree.com/?p=4992
Categories:17
Tags:
Post Data:2008-06-04 01:17:40

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Payment Processing using MiraPay/MiraServ #17

From: http://sitestree.com/?p=5132
Categories:17
Tags:
Post Data:2013-04-08 02:12:57

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Complete path analysis to get a merchant account #17

Please Check:http://www.sitepoint.com/article/merchant-account-review
Detail Discussion to have a Merchant account
If pricing is a concern check it.http://www.sitepoint.com/article/money-where-mouse-is-gateways/4
For detail explanations, please check the following link:http://www.sitepoint.com/article/money-where-mouse-is-gateways From: http://sitestree.com/?p=4744
Categories:17
Tags:
Post Data:2013-01-04 16:02:17

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Understanding .Net Application Deployment: .Net Deployment Features #18

  • Features you are required to understand: No-impact applications: isolate applications, remove DLL effects, Keeping the Components Private: components available only to the application, Controlled Code Sharing using GAC, Side by Side Versioning: Multiple versions of the same application, Xcopy Deployment: Without registry entries (copy to a directory), On the fly updates, Integrated with Microsoft Windows Installer, Enterprise Deployment: Use Active Directory to deploy applications on user login or computer start.
  • Packaging: Assemblies (deploy the .dll and .exe files), Cabinet Files (.cab): Compress the .exe files into .cab files, Create .msi files
  • Distribution: Xcopy or FTP: CLR applications with no registry entries, Code Download, Use windows installer
  • Four types of deployment projects: Setup, Web-setup, Cab, Merge Module
  • Creating different types of deployment projects: Visual Studio: File-> New project ->other project types-> set up and deployment -> then select Setup, Web Setup, Merge Module, or CAB project
  • Structuring a .NET Application For Easy Deployment
  • About Merge Module Projects: Installing and deploying components
  • Implementing Versioning and Side-by-Side Deployment: Deploy assemblies with different version numbers in the global assembly.

From: http://sitestree.com/?p=5227
Categories:18
Tags:
Post Data:2006-09-30 23:48:51

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Deploying .Net Windows Applications #18

  • Ways to deployment: XCOPY, Automated setup application
  • Use XCOPY only when there is no external dependencies other than .Net framework. And it is guaranteed that .Net framework is installed in all the target machines. Also, make sure the application directory contains all the files.
  • Command example: XCOPY d:myApplication c:deployedApplication /s -- /s indicates subdirectories will also be copied
  • Setup Applications: two types: setup projects and merge module projects
  • Setup projects: installs your application to the target machine
  • Merge module projects: Used to deploy controls and components. It can be merged with a setup project
  • To create setup project: File Menu->Add Project -> New Project->setup project-> setup project creation wizard comes. Select options as appropriate. It will be mostly common sense.
  • Merge module project: File Menu->Add Project -> New Project->setup and deployment project-> setup wizard. Select options as appropriate. It will be mostly common sense.
  • Setup project is also displayed in the project explorer. Right click and select properties to provide build properties.

From: http://sitestree.com/?p=4920
Categories:18
Tags:
Post Data:2007-06-12 05:01:23

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

C#: Handling Multiple Keyboards and Multiple Microphones in the Same Software #18

I was working for software that needed multiple keyboards support along with multiple microphones support.

Multiple keyboards Support:
Detecting multiple keyboards/devices:
GetRawInputDeviceList( IntPtr.Zero, ref deviceCount, (uint)dwSize ) returns the number of devices detected

You can get a project that detects multiple keyboards and stores the devices in a HashTable at: http://www.codeproject.com/KB/system/rawinput.aspx#_Toc156395978

Multiple Microphones

Also, I had to provide support for multiple microphones. You can use the following function to collect speech from a microphone. The first parameter can be 0, 1, 2 for multiple microphones [device identification number]. If you put -1, it will take the default microphone.

m_Recorder = new WaveLib.WaveInRecorder(-1, fmt, 16384, 3, new WaveLib.BufferDoneEventHandler(DataArrived));

Just check the following article for detail understanding:http://www.codeproject.com/KB/audio-video/cswavrec.aspx

From: http://sitestree.com/?p=5159
Categories:18
Tags:
Post Data:2010-01-17 03:14:30

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Debug and Trace Classes in .Net #18

Debug and Trace classes in .Net

You can always debug your applications line by line. However, when the applications get very bigger/larger, debugging line by line may not be an efficient way for finding errors in code. Debug and Trace classes are handy in such cases. Using Debug and Trace classes, you can find errors and write them in a file or create an event log. Later, you can check the file or the event log to see what kinds of errors the applications are causing. They both provide the same functionalities except that Debug class works only in the debug mode. Trace can work even after the applications are released and also you can control the error reporting from released versions. In a .config file you can change the behaviour of the Trace class.

Logging Trace Output into a text file

  • 1. Create a FileStream object instance and map it to a file
  • 2. Create a TextWriterTraceListener instance and make the text file as the targe of this listener
  • 3. Add this listener to the Trace.Listeners collection
  • 4. set Trace.AutoFlush to be true
  • 5. where required you can use Trace.Write method to send error messages to the file
  • 6. Trace.Write, Trace.WriteLine, Trace.WriteIf, Trace.WriteLineIf can be used to send error message to the file
  • 7. Trace.Assert method writes error messages only if the supplied condition fails. Trace.Assert also displays the error in a MessageBox
  • 8. Trace.Fail causes an Trace.Assert unconditionally

Logging Trace outout into an Event Log

  • 1. Create or open an EventLog
  • 2. Set the Source property of Event Log
  • 3. Create an instance of EventLogTraceWriter and specify the new event log as it's target
  • 4. Use Trace.AutoFlush[automatic sending], or Trace.Flush [send error messages explicitly]
  • 5. Where required, you can use Trace.Write method to send error messages to the file
  • 6. Trace.Write, Trace.WriteLine, Trace.WriteIf, Trace.WriteLineIf can be used to send error messages to the file
  • 7. Trace.Assert method writes error messages only if the supplied condition fails. Trace.Assert also displays the errors in a MessageBox
  • 8. Trace.Fail causes a Trace.Assert unconditionally

TraceSwitches

TraceSwitch/BooleanSwitch class can be used to control the error messaging that the Trace class generates.

From: http://sitestree.com/?p=4758
Categories:18
Tags:
Post Data:2008-09-26 11:22:29

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

XML Related Clasees in .Net #18

XML in ADO.net VB.NET C#.NETXML is the foundation of .NET. .NET internally represents data as XML and hence can provide interoperability and interaction among applications written in different platforms and languages[.Net compatible].XmlReader

In .Net you can use XML with SqlCommand object. You first create a connection to the sql server database using the SqlConnection object. Then you can use a SqlCommand object with that SqlConnection object to query sql server databases(in XML format). You can use the ExecuteXmlReader() method to execute a query. A select operation will return data that can be grabbed into a XMLReader [similar to DataReader object] object. You know that in SqlCommand object you can specify the Query or the stored procedure name to execute. XmlReader object has a Read method like the DataReader object that helps to navigate through the nodes. Mentionable, the query must have FOR XML clause.

XML with DataSet

DataSet object has two methods to work with XML. You can use ReadXml to read a XML file or stream. Also, you can use WriteXml to write the contents of the DataSet to a file, stream, or an XmlWriter or TextWriter object.

XmlDataDocument Class

You can load XML data into a XmlDataDocument object[from a file or from a dataset]. DOM can be used to manipulate the data. A DataSet containing XML data can also be loaded into a XmlDataDocument object(constructor parameter).

XSLT Transform:

XmlDataDocument and XslTransform classes are used to transform XML from one form to another. A XslTransform object contains the style definition and loads a style file using it's Load method. The Transform method of XslTransform transforms XML data according to the style sheet rules. Transform takes a XmlDataDocument[or objectes implemented IXPathNavigable interface] object as a source XML data to transform. Transform also, takes anothor parameter for the destination[a file, stream, XmlWriter, or TextWriter]

All these apply for both VB.net and C#.net.I will provide some code examples in future.

Have Fun. From: http://sitestree.com/?p=4755
Categories:18
Tags:
Post Data:2009-10-19 16:26:39

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Database Programming in .Net: ADO.Net Overview #18

Overview of ADO.net

Purpose

  • Components of ADO.net and their functions

ADO.net provides disconnected database access to make minimum resource (RAM,Page Table,Heap) use. Database connections are open as long as the connection is required. Afterwards, the connection is just closed. If connections are kept active and if new connections are used for new operations, the system resource will easily used up. Further, it can consume database licenses quickly.

ADO.net has two major entities. DataSet and Data Provider

Data Set

Data set is in-memory representation of data. After querying a database, you may keep your data in a DataSet. DataSet may contain 0, one or more tables. The tables in DataSet are termed as DataTables. DataTables have two concepts/collections DataColumns, and DataRows. DataRows contain the data. DataSet also contains DataRelations collections that may be used to create relations among the DataTables in the DataSet. Additionally, DataSet contains ExtendedProperties collections to contain custom information about the DataSet

Data Provider

It is actually a collection of several components. Some data provider objects are:

  • SQL Server Data Provider: To interact with MSSQL Server Databases
  • OLE DB.Net data provider: May be used to interact with other databases.
  • ODBC (.Net) Data provider
  • Oracle Data Provider: For efficient interaction with Oracle Databases

Data Provider Components

  • Connection Object: To connect to the database. Objects: SqlConnection(for MS Sql Server), OleDbConnection(for wide range of databases), ODBC Connection(to connect through ODBC), OracleConnection(for oracle). The main property of Connection objects are the ConnectionString.
  • Command Object: like SqlCommand, OleDbCommand. After creating a connection a command object may be used to query the database or to run a stored procedure. It has methods like ExecuteNonQuery(For Insert,Update,Delete), ExecuteScalar(to access a single value),ExecuteReader(returns ResultSet, may be kept in a DataReader object)
  • DataReader Object: Like, SqlDataReader, OleDbDataReader, [ODBCDataReader,OracleDataReader]. It is a read-only, forward only, connected data stream. It uses the connection exclusively and tries to use minimum system resources[contain only one row in the RAM]
  • DataAdapter Object: It is the object that provides disconnected data access in .Net. DataAdapter fills a DataSet or DataTable by using it's Fill method. Unlike DataReader DataAdaptor can propagate the changes in DataSet/DataTable to the database using it's Update method. DataAdapter contains queries(select,update,insert,delete) in four properties like SelectCommand, InsertCommand,DeleteCommand,UpdateCommand. When fill method is called the data returned by SelectCommand query are saved in DataSets/DataTables. Remember Update is another method, that copies DataSet data to the Database.

From: http://sitestree.com/?p=4746
Categories:18
Tags:
Post Data:2011-04-13 13:10:46

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Basics of Exception Handling in .Net #19

Basics of Exception Handling in .Net

Why exception handling? In your applications, unexpected error situations may occur that are out of your appication scope and your application logic. These are actually external to your application. For example, while you are reading a file from hard drive, the file may not be there; or the remote server may be too busy or unavailable to get back to you with the result of your query. Exception handling addresses such situations.

How can you handle such situations:

  • Use try, catch, finally structure to address such situations
  • Put the code where, you are anticipating an exception inside a try{} block. Put the code to handle the error situation in catch (Exception ex) {} blocks. You can have multiple catch blocks where each one will address a specific type of exception situation.
  • One more note, the code block where exception may occur may need to execute some logic/code whether an exception occurs or or not such as closing a file, closing the database connection. To accomplish this, you can use a finally block. A finally block is always executed, regardless of whether an exception is thrown or not.
  • When an exception occurs, the events are thrown by the environment. You need to address that if you want to. Else, your users will see the errors and will cause a bad user experience.
  • You can even throw exceptions on your own in your code. But why? say if you anticipate that there will be some error situations that are not external but related to your application logic and you actually do not want to handle those situations (serve some services in those situations for example) in your application. You can just throw exceptions and think that these are the conditions; you do not want to support in your application. Throw exception and provide some generalized response to your visitors.
  • You can also handle exceptions throw the web objects' built in error events such as Page_Error, Global_Error, Application_Error.
  • In certain situations, You can take advantage of the error pages of the webserver to provide useful information to your visitors. You can replace the default error pages of your web-server and provide customized error pages to your visitor
  • Finally, you can use tracing to log the error events. Monitor the tracing to understand which types of situations occur more frequently than others. And find out a solution and apply the solution
  • It is possible to turn on and off this tracing without modifying the application code. You can make use of the web.config file configurations

Regarding error pages, you can provide your custom error pages for the standard HTTP error codes. Some codes are given below:204:No Content, 301:Moved, Moved Permanently, 302: Found, Redirect, 400:bad request, 401:unauthorized, 403: forbidden, 404:not found, 408:request time out, 500:internal server error, 503:service unavailable, 505:Http version not supported.

You can also make use of the errorPage attribute of the Page object to define an error page for the exceptions of that particular page. Page level settings override the application level settings (as provided by web.config file)

  • How to enable application level tracing: use something similar as below in your web.config file
    { and } are used instead of  respectively. {configuration}         {system.web}            {trace enabled="true" requestLimit="40" localOnly="false"/}         {/system.web}   {/configuration}
  • to enable tracing for a particular page, use the trace property of the Document object
  • how to write tracing information to the trace log: Trace.Warn()

From: http://sitestree.com/?p=5335
Categories:19
Tags:
Post Data:2012-06-07 19:04:36

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Encryption and .Net #19

Encryption and .Net

Dot net provides rich support for data encryption. the namespace System.Security.Cryptography includes the encryption features.There are three primary concepts related to encryption such as Hashing, Symmetric Encryption, and Asymmetric encryption. A hash is a data fingerprint, a small data that represents the uniqueness of a large block of data. In Symmetric Encryption, a single key is used for both encryption and decryption. In Asymmetric encryption, two different keys are used, one for encryption and another one for decryption. In real world applications, a combination of all three methods are used to provide better security.

A digital transmission of a check can be as follows: create the hash of the check, encrypt the hash with the public key using asymmetric encryption, apply the encrypted hash on the document, encrypt the symmetric encryption key with asymmetric encryption method, encrypt the check with symmetric encryption, transmit the encrypted key and encrypted document to the receiver

Hash Example

   hash = New Encryption.Hash(Encryption.Hash.Provider.CRC32)   data = New  Encryption.Data("Hash Browns")   hash.Calculate(data)

Symmetric example:

 sym = New Encryption.Symmetric(Encryption.Symmetric.Provider.Rijndael)  key = New Encryption.Data("Pass")   Encryption.Data encryptedData;  encryptedData = sym.Encrypt(New Encryption.Data("Secret"), key) string base64EncryptedString = encryptedData.ToBase64

Asymmetric Example

  asym = New Encryption.Asymmetric    pubkey = New Encryption.Asymmetric.PublicKey    privkey = New Encryption.Asymmetric.PrivateKey  asym.GenerateNewKeyset(pubkey, privkey) secret = "ancient chinese"  Encryption.Data encryptedData   encryptedData = asym.Encrypt(New Encryption.Data(secret), pubkey)   Encryption.Data decryptedData   asym2 = New Encryption.Asymmetric   decryptedData = asym2.Decrypt(encryptedData, privkey)

From: http://sitestree.com/?p=5334
Categories:19
Tags:
Post Data:2010-04-30 02:01:13

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Creating your own Class in C# in ASP.net #19

Creating your own Class in C# in ASP.net

  • It is kind of simple. You need to create a class library. The class library will create a dll file. From your project, you need to add reference to the dll file. Then you will be able to use the classes and methods of the class library.
  • Check the following codes. One is a sample class library and another one is how to use the class. The class library implements two methods such as add and subtract to add or subtract two numbers. The project uses the namespace [class library] and calls these methods
  • You can get the dll file in the bin/debug or bin/release folder under your class library project
  • You can right click on your project/website [in solution explorer], and click Add Reference, then click browse and select the dll file created
  • Check the class library below
  • Check the Form in picture. This form uses the class library.
  • Check the Form Code to use the Library
  • Check the Backend Form Code to use the Library

From: http://sitestree.com/?p=5327
Categories:19
Tags:
Post Data:2009-03-26 09:27:06

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Allow Page Access only to the Logged in Users #19

Allow Page Access only to the Logged in Users

From: http://sitestree.com/?p=5328
Categories:19
Tags:
Post Data:2006-11-15 05:45:24

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

A Simple ASP.Net Form in C#. Payment Information Collection Form. #19

A Simple ASP.Net Form in C#. Payment Information Collection Form.

Such form can be used in test operation while implementing online payment processing . The input fileds are to send data to the payment gateway. The response fields are to display response from payment gateway. Here, the output fields represent the response fields as sent by Paymentech gateway.

The FormThe CSSFront end form code From: http://sitestree.com/?p=5329
Categories:19
Tags:
Post Data:2011-10-02 13:31:36

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Random C# and MS SQl Server #19

Foreign Key in Table Declaration

CREATE TABLE ORDERS (   ID integer primary key,    Order_Date datetime,    Customer_ID integer references CUSTOMER(ID),    Amount double); ALTER TABLE ORDERS ADD FOREIGN KEY (customer_id) REFERENCES CUSTOMER(ID);

Stored Procedure Example

CREATE PROCEDURE [dbo].[procedure_name]      @param1 VARCHAR(100)     ,@param2 VARCHAR(200) OUTPUT    AS    
BEGIN       
DECLARE @param3 VARCHAR(100)       
SET @param3 = ' '       
IF @param1 IS NOT NULL AND LEN(@param1) > 1            
SELECT @param2 = 'The ' + @param1  + @param3        
ELSE             
SELECT  @param2 = '...is cool!'        
RETURN        
END    
GO

C# and Prepared Statements

int  id = 20;     
string  desc = "...." ;     
SqlConnection rConn = new SqlConnection("Persist Security Info=False;Integrated Security=SSPI;        database=northwind;server=mySQLServer");     
rConn.Open();     
SqlCommand command = new SqlCommand(null, rConn);     

// Create and prepare an SQL statement.     
command.CommandText = "insert into Region (ID, Description) values (@id, @desc)" ;     
command.Parameters.Add ( "@id", id) ;     
command.Parameters.Add ( "@desc", desc) ;     
command.Prepare() ;  

// Calling Prepare after having set the Commandtext and parameters.     command.ExecuteNonQuery(); 
    
// Change parameter values and call ExecuteNonQuery.     command.Parameters[0].Value = 21;     
command.Parameters[1].Value = "mySecondRegion";     command.ExecuteNonQuery();
conn = new SqlConnection(strConnectionString);   
SqlCommand cmd = new SqlCommand();   
cmd.CommandText ="insert into Profile values(@Name,@Age)";   
cmd.Connection = conn;   
cmd.CommandType = CommandType.Text;   
SqlParameter nameP = new SqlParameter();   
nameP.SqlDbType =SqlDbType.NVarChar;   
nameP.ParameterName = "@Name";   
nameP.Size = 50;   
nameP.Value = model.Name;   
SqlParameter ageP = new SqlParameter();   
ageP.SqlDbType =SqlDbType.Int;   
ageP.ParameterName = "@Age";   
ageP.Value = model.Age;   
cmd.Parameters.Add(nameP);   
cmd.Parameters.Add(ageP);   
conn.Open();   
cmd.Prepare();    
cmd.ExecuteNonQuery();

C# and Stored Procedure

conn = new SqlConnection("Server=(local);
DataBase=Northwind;Integrated Security=SSPI");       
conn.Open();  
     
SqlCommand cmd  = new SqlCommand("sp_name", conn);       
cmd.CommandType = CommandType.StoredProcedure;       
cmd.Parameters.Add(new SqlParameter("@CustomerID", custId));     
  
// execute the command       
rdr = cmd.ExecuteReader();     
  
// iterate through results, printing each to console       
while (rdr.Read())       
{          
Console.WriteLine("" + rdr["Total"] );       
}

From: http://sitestree.com/?p=5300
Categories:19
Tags:
Post Data:2007-02-11 12:57:35

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Manipulating Configuration Parameters: For example Variables in web.config #19

To access a variable value, you can use the following type of code

string statusr = WebConfigurationManager.AppSettings["userLoginStatus"].ToString();
You will need to use: using System.Web.Configuration;or you can write as follows:string statusr = System.Web.Configuration.WebConfigurationManager.AppSettings["userLoginStatus"].ToString();

What about if you want to change the values of the variables in the web.config file. Check the code below:

//CompiledConfiguration myConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~");//change values for the variables in the AppSettings sectionmyConfig.AppSettings.Settings["userLoginStatus"].Value = "1";//change values for the connection strings section        myConfig.ConnectionStrings.ConnectionStrings["myDatabaseName"].ConnectionString = "Data Source=....";myConfig.Save();//will return you the new valuestring statusr = WebConfigurationManager.AppSettings["userLoginStatus"].ToString();

The above code used:
System.Web.Configuration;
using System.Configuration;

A sample web.config file

From: http://sitestree.com/?p=5303
Categories:19
Tags:
Post Data:2007-10-10 15:52:36

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

ASP.Net Validation Control Examples in C#. #19

ASP.Net Validation Control Examples. Just check the code below

Some note

  • RequiredFieldValidator: is used to check that a field is filled up
  • CompareValidator: Compare the value of a field with another field or data
  • RangeValidator: Compares the data is within a given range
  • RegularExpressionValidator: Domain name syntax, email addtress syntax
  • ValidationSummary: Display all validation errors in a summary box
  • CompareValidator: Write your own custom validation rules and display the outcome
  • Remember
    • You can display error on the side of the control
    • You can display error under the control
    • The example used both just for example
    • The Text property is the output that comes just where the validation control is placed. ErrorMessage propert is for the ValidationSummary
    • If you just want the Validation Summary output, use Display="none" for the validation control (not the summarycontrol) itself
  • the code can be seen at http://salearningschool.com/samples/validate.txt as well
    Validation Control           







From: http://sitestree.com/?p=5304
Categories:19
Tags:
Post Data:2009-06-06 19:26:04

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>

Simple Ajax Applications in C# (ASP.Net) #19

Simple Ajax Applications in C# (ASP.Net)

  • If you are coming from PHP or Java Platform where you use JavaScript or JQuery to provide Ajax functionality, you still can use those strategies in ASP.net to provide Ajax functionality
  • Check our short note on Ajax using JavaScript. In .Net, you just have to call the JavaScript function (that implements Ajax functionality) on the event you want the Ajax functionality. However, you do not use runat="server".
  • Another approach is Using Ajax Server Controls such as ScriptManager, ScriptManagerProxy, UpdatePanel, ContentPanel, UpdateProxy
  • You can find these Ajax controls at the Toolbox under Ajax Extensions
  • You can grab them and place on your form, you can grab and place on the code, or you can write them in your code [whatever you are used to]
  • And yes, you could use JQuery as well. JQuery uses an wrapper on JavaScript functionality and makes the life of the developer little easier
  • In this short note, I will show a simple example of using Ajax Server Controls, also show you the code to invoke Ajax functionality using JavaScript
  • Now take a look at the simple application interface below. The application will calculate sum, difference, and multiplication of two numbers without refreshing the page. We will calculate immediately, also will show the situation when the calculation may take a little more time
  • The idea is simple, you need to add a ScriptManager control. If you use master pages, and the situation becomes that you need to place two ScriptManagers, just place one ScriptManager in the Master and use ScriptManagerProxy in the content page
  • use UpdatePanel around the controls that will be refreshed without the page being refreshed
  • Use UpdateProgress control, when you know that the operation will take some time. Use this control to inform the user that the operation is under progress
  • Now the sample application interface
  • Now the Form code
  • Now the backend code
  • Now an example on how to implement Ajax functionality in C# in ASP.net using JavaScript. It just displays current date time but using Ajax and without refreshing the page. Just go through the code

From: http://sitestree.com/?p=5326
Categories:19
Tags:
Post Data:2010-04-01 05:09:58

    Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
    (Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a> 
    In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
    <a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
    8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
    Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
    Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>