Posts

Knowing about the expiry date of Gas Cylinder

Image
LPG gas is the most used cooking fuel in India and many other countries. Not only does it make your mother's kitchen work convenient, it is also a live bomb sitting just next to her almost all the time. Did you know that there is an expiry date (physical life) for LPG cylinders? Expired Cylinders are not safe for use and can cause lethal accidents. Using LPG cylinder post its expiry date can result in leakage that can also lead to an explosion. Once the cylinder is past the expiry date, one must stop using it. But most people have no idea how to check the expiry of the bottle. The steps to check the expiry are very simple and basic. Here is how you can check the expiry date of LPG cylinders : On one of three side stems of the cylinder, the expiry date is coded alpha numerically which starts with  A, B, C or D  followed by a  two digit number . e.g. D-06. The expiry of LPG Cylinder can be found on one of the metal strips that connect the body of the cylinder to t...

What is the difference between Custom tag and Coldfusion Component?

The differences are Custom Tags: -A single entry point is available for custom tags -Custom tags does not support formalized parameter passing and validation mechanism -Persistence is not possible for custom tags -Custom tags are accessible locally and only by ColdFusion ColdFusion Component: -Multiple entry points are available for CFC -CFC does support formalized parameter passing and validation mechanism -Persistence is possible for CFC -CFCs can be accessed as web services

How to I initialize a CFC at the same time as I create it?

In many examples using CFCs, the call that creates the CFC also calls an init() method. This is done to both create an instance of a CFC as well as initialize it with certain information. So for example, you may want to pass in a datasource name to a CFC so that the component can perform database queries. How is this done? This is a 2 step process. The first is to call the CFC using syntax like the example below: <cfset cachedQuery = createObject("component", "CachedQuery").init(dsn)> This says to create a variable called cachedQuery which will contain a reference to a CFC. The CFC is created using the createObject() function. At the same time that the CFC is created, a method of the CFC called init() is called. Whatever is returned from the init() method is what will actually be loaded into the CachedQuery variable. This is called method chaning. It is essentially the act of calling multiple functions in one line. The result of the first operation (cre...

Init() function in ColdFusion

init() is just a standard convention most people adopt with components. The init() function initializes any variables needed by the component's functions. Then returns a reference to the current component. ie Test . cfm < cfset myObj = createObject ( "component" , "MyComponent" ). init ( dsn = "My DSN" )> MyComponent . cfc <cfcomponent> < cffunction name = "init" output = "false" returntype = "MyComponent" > < cfargument name = "dsn" type = "string" > <!--- initialize variables used within this component ---> < cfset variables . dsn = arguments . dsn > <!--- return a reference to this component ---> < cfreturn this > < /cffunction> </ cfcomponent

Count number of tables in a SQL Server database

SELECT COUNT(*) from information_schema.tables  WHERE table_type = 'base table' 

what is Flash Form in coldfusion ?

- Flash Form is like HTML form with flash format. It runs on flash player enabled web browsers - ColdFusion automatically generates the swf format form’s Flash binary from CFML code, using  tag - Flash forms enhances the user experiences - The features that are included are accordion-style, multiple-tab form panes and positioning of elements automatically - cftree , cfgrid and cfcalendar form elements can also be displayed as Flash objects

diffrance b/w StructCopy() and Duplicate()

StructCopy(): Creates a clone of the structure  by reference  (clones top level keys and values by value and nested structures by reference) Duplicate(): Creates a clone of any type of objects (that can be a structure)  by value. Therefore, We need to be very very careful while creating a clone of a structure by using StructCopy(), because any change to the cloned structure will be reflected in master structure (as it is cloned by reference). This might create side effects in the program.   When we clone by Duplicate(), any changes with the cloned structure will NOT be reflected in the master structure (as it is cloned by value). So it will not have any side effects in the program.