learn: Programming articles

and be informed on Programming using our web articles directory


Programming - RSS feeds

search the articles directory


Powered by Google™

old Programming articles

ColdFusion Can Be Extended In Many Ways - ...ly with ColdFusion, but which are written in either C++ or Java Java Server Page (JSP) tag libraries, which are originally built for use w...
First ColdFusion Application - ...urned to the user’s browser. A page is what appears in your browser. It is rendered from the HTML that ColdFusion Server sends back ...
Building the company add action template - ... City, State, ZipCode, Comments ) VALUES ( ‘#Trim(Form.CompanyName)#’, ‘#Trim(Form.Address)#’, ...
Modifying a Company in the Database - ...e database how to sort the results. The result set returned from CFQUERY contains multiple rows of data, and each row has multiple columns. It would ...
Building the company edit action template - ... SET CompanyName = ‘#Trim(Form.CompanyName)#’, Address = ‘#Trim(Form.Address)#’, City = ‘#Trim(Form.City)...
Adding a New Employee to the Database - ...panyID. (To get a valid ID, go to the company list and pick a number from the ID column.) Click Submit to see the chosen company’s informatio...
Modifying an Employee in the Database - ...ws: 01/01/2002 This version is, of course, more natural and easy to read. The same is true for the employee edit process...
Removing an Employee From the Database - ...m inside the Ch02 directory, type the code into the file’s editing window, and save the file. <html> <head> <ti...
Making direct links to the forms - ...d> <td><b>Name</b></td> <td><b>Address</b></td> <td><b>City</b></t...
Using a Custom Tag - ...)#</cfoutput> Now() returns the current date and time, and DateFormat() reformats the date. To call your custom tag, open index.cfm, a...
Creating your physical data model - ...ptions to this rule are logical data models that contain nonspecific relationships and entity subtypes. Although entity subtypes are an advanced top...
Understanding All Relational Result Sets - ...rmance by caching queries in memory for fast access. You can memorize SQL clauses and Bachus-Naur forms until you’re blue in the face, ...
How and when to use Group by Having and Distinct - .... The GROUP BY clause produces as its intermediate work product a table of rows representing each group, and a sort of “invisible third dimen...
Query Caching - ... straightforward technique to employ. You should consider caching only queries that fit the following criteria: The query has a significant ...
Views - ...you could take a query statement and define it as a formal database object that could be accessed just as a table can. Well, you can—that is ...
Passing parameters by position rather than by name - ...re’s interface; otherwise, ColdFusion throws an exception. Many, but not all, database servers can return result sets from stored procedures. Fo...
Reusing stored procedure code - ...tored procedure, sp_GetInventoryItem, that retrieves an InventoryItem row based on the ItemNumber value passed. You use sp_GetInventoryItem thro...
Constructs - ...to a different template and how to include code from external templates. An If construct consists of a condition and a dependent statement. Cold...
Looping - ...es”> #CompanyName#<br> </cfloop> </cfoutput> The CFLOOP in the code loops over each row present in the ...
Dealing with empty elements - ...and orange and the empty element at the end of the list—as nonexistent. If you need an empty element, you must put spaces in the list, as in...
How dot notation automatically creates a nested structure - ...ures and keys are all uppercase, regardless of the capitalization that you use in the code. As convenient as this method may seem, it does have ...
What is CF Script - ...data processing on a page. As nice as CFML’s tag-based syntax is, number crunching is best expressed in script. CFSCRIPT is a server-si...
UDF structure - ...CRIPT—only how to use CFSCRIPT in conjunction with user-defined functions. A user-defined function, or UDF, can be built in CFSCRIPT, CFML, o...
Using the Request Scope - ...uest.Username, and Request.Password. You should generally restrict your use of Request-scope variables in your custom tags to global constants s...
Storing Client Variables - ... a given session are stored under a key that takes its name from the CFID and CFTOKEN of a given session. The problem is that the Windows Registry w...
Improving the error message - ... consider that some users may be confused by a prompt on-screen requesting their Username. Most computer people recognize that as a prompt for t...

latest articles under "Programming"

Navigation: Categories » Computers and technology » Programming

Below is a list of all Programming articles. If you want to find a tutorial by keywords, all you have to do is a quick search in our directory. Just use the search option available at the top-right side of the page. The website search is powered by web-articles. Or, if you want to read specific Programming tutorial, just point to it. The newest articles and tutorials are shown first in the list. To access the last ones, browse the pages 2, 3, 4... at the bottom. Also, you may browse articles alphabetically ordered.

Page# 1 2 (last added articles shown first)

Invoking a Component Function (05/04/2008)
(...) (In the following part, you learn how to make your component instances live longer.) Using the CFOBJECT tag isn’t the only way to instantiate an object. The CreateObject() function returns an object as well. (...)
What a component really is (04/28/2008)
(...) If you design it by using a few advanced principles, a component can represent a unique instance of an entity—for example, a specific company—that persists in your application and has both properties (data pertaining to that specific company) and methods (functions that the company may perform, such as updating itself in the database). More on persistent components later in this article. When referring to both components and objects, the terms function and method are interchangeable. (...)
What structured exception handling is (04/09/2008)
(...) This is the essence of exception handling. The structured part of structured exception handling refers to the natural structure of ColdFusion’s exception framework. Notice that we depict the error-handling framework as a series of sieves, in which the top level of sieves (CFCATCH) catches expected errors, with any unexpected errors “falling through” to the next level, which is handled by a collection of CFERROR templates that handle specific errors. (...)
Throwing and catching Java exceptions (04/09/2008)
(...) COM returned the following error message: #exception.Message#); } </cfscript> If Excel is not installed on the ColdFusion Server that executes the preceding example, CreateObject() will throw an error that will then be caught by the catch block. Notice the difference between the CFCATCH syntax and the catch syntax. (...)
Automatic Validation on the Client (04/08/2008)
(...) CFFORM can also be used to introduce some enhanced interface features such as CFGRID, CFTREE, and others. These Java applet-based features are beyond the scope of this article’s discussion about validation and are discussed further. And although we also discuss a CFSELECT tag that does add some validation capabilities, the CFSELECT tag can be used without any validation to easily create drop-down lists (SELECT lists) based on ColdFusion Query results. (...)
Improving the error message (04/07/2008)
(...) Of course, if this is leveraging the username of an enterprise security domain, prompting for that username or userid, however, it’s known in that environment may make perfect sense. But what if the form field name was something more obscure, such as uname? Users don’t normally see form-field names (they see only the prompts you offer), and you may want to add this validation capability to an existing application where the developer wasn’t as concerned about making the form-field name more descriptive. You certainly don’t want to change the name of the form field just so that this validation message is more understandable, because then you would need to change all the variable names on the action page as well. (...)
Storing Client Variables (04/06/2008)
(...) In ColdFusion Administrator, set up a ColdFusion datasource in which to store client variables. (It should be an actual database server, such as Microsoft SQL Server or Oracle and not a file-based product such as Microsoft Access.) 2. (...)
Using the Request Scope (04/05/2008)
(...) Because UDFs are more suited to making calculations, you find more numeric recursion in UDFs. On the other hand, recursion in custom tags is best suited for such procedures as recursing over structures or directory hierarchies, where the purpose is page output rather than returning single results from each recursive call. The code shows a custom tag that takes a directory path and returns a listing of all the files and subfolders of that path. (...)
UDF structure (04/04/2008)
(...) A basic UDF built by using CFSCRIPT looks as follows: <cfscript> function GetCurrentTime() { return TimeFormat(Now(), “h:mm:ss tt”); } </cfscript> The only four things required for every function are the function keyword, the name of the function, the parentheses after the name, and the curly braces around the body of the function. Although the return statement is technically optional, return is what makes a function truly useful, as this statement represents the result returned to the code that calls the function. We call the function that we just created as we would any built-in ColdFusion function, as follows: <cfoutput>#GetCurrentTime()#</cfoutput> We can expand my function by defining a local variable, as follows: function GetCurrentTime() { var szTime = TimeFormat(Now(), “h:mm:ss tt”); return szTime; } More on the var keyword in the following part. (...)
What is CF Script (04/03/2008)
(...) Why mess with a perfectly good thing (CFML) by adding another complication (scripting)? Because the latter is easier to code and faster to process. Consider the following snippet, for example, which loops from 1 to 10, adding each index to a running total: <cfset TheSum = 0> <cfloop from=”1” to=”10” index=”i”> <cfset TheSum = TheSum + i> </cfloop> Following is the same code expressed in CFSCRIPT’s scripting syntax: <cfscript> TheSum = 0; for(i = 1; i LTE 10; i = i + 1) { TheSum = TheSum + 1; } </cfscript> CFSCRIPT doesn’t support the ++ syntax for incrementing a variable that may be familiar to you if you have experience with Java, JavaScript, or C++. Look familiar? If you’re having JavaScript déjà vu, that’s normal, because CFSCRIPT is almost identical to JavaScript. (...)
How dot notation automatically creates a nested structure (04/02/2008)
(...) Suppose that you now attempt to call the following snippet to create a nested structure named myKey: <cfset aNewStruct.myKey.subKey = 4> If the previous line had worked, it would have overwritten the previous simple value of myKey with a substructure named myKey. (...)
Dealing with empty elements (04/01/2008)
(...) The second argument to ListSort() is the type of sort to perform. This argument can take any of the following three values: Numeric: Sorts the list numerically. If any list element cannot be converted to a number, ColdFusion throws an error. (...)
Looping (03/31/2008)
(...) List loops are discussed in detail later. Structures are complex objects that store collections of key-value pairs. You can loop over a structure with CFLOOP by using the collection loop syntax shown in the code. (...)
Constructs (03/30/2008)
(...) You can make ColdFusion execute alternative code if the condition tests False, as follows: <cfif myVar GREATER THAN myOtherVar> <cfoutput>#myVar#</cfoutput> <cfelse> <cfoutput>#myOtherVar#</cfoutput> </cfif> We’ve extended the original If construct to include a CFELSE tag. Now, if myVar is not greater than myOtherVar, ColdFusion outputs myOtherVar. You can extend CFIF even further by adding additional conditions with CFELSEIF, as follows: <cfif myVar GREATER THAN myOtherVar> <cfoutput>#myVar#</cfoutput> <cfelseif myVar EQUAL myOtherVar> <cfoutput>#myVar + myOtherVar#</cfoutput> <cfelse> <cfoutput>#myOtherVar#</cfoutput> </cfif> Now, if myVar is equal to myOtherVar, ColdFusion adds the two together and outputs the result. (...)
Reusing stored procedure code (03/29/2008)
(...) We follow one of these OUTPUT parameters—the UnitPrice—on its complete journey through all the stored procedures that use it and show how values are acquired and passed between parameters. We highly suggest that you take a few moments to open that document and follow each step of the process. To really leverage stored procedures in your ColdFusion applications, you need to fully understand this complicated topic. (...)
Passing parameters by position rather than by name (03/28/2008)
(...) CFPROCRESULT binds result sets to ColdFusion query objects in the order in which they are created within the stored procedure. Mapping result sets in the stored procedure to query objects in ColdFusion may seem an obvious and trivial task—just number them in the order they appear, top to bottom—but this task can become confusing unless you follow the rules. In this article, you adapt the code to produce exactly the same results in Oracle. (...)
Views (03/27/2008)
(...) Basically, a view masks unneeded data from your application. These masks can be either vertical or horizontal. A vertical mask shields specific columns of a table from returning and is simply the defined collection of underlying table columns that your view contains. (...)
Query Caching (03/26/2008)
(...) The processing requirements make caching necessary. Whenever you cache a query, you place a copy of it in memory and instruct ColdFusion MX to retrieve the memory-based version of that query for a specified length of time. For example, the code hows a CFQUERY that caches its result set for 12 hours, after which another call to CFQUERY retrieves data directly from the database and caches that new result set in memory. (...)
Understanding All Relational Result Sets (03/25/2008)
(...) Consider the code, which produces a relational query result that, like all query results, is in the form of a single table. SELECT c.CompanyID, c. (...)
How and when to use Group by Having and Distinct (03/25/2008)
(...) Because every column in the SELECT clause is also specified in the GROUP BY clause, the group is defined as any distinct combination of those columns, so the final query result contains all such unique combinations because of this grouping mechanism. On the other hand, DISTINCT simply discards all but the first occurrence of each unique combination of the columns in the SELECT clause. The two results are the same but for very different reasons. (...)

Enter page# 1 2 (last added articles shown first)