Posted by Naresh Patel on August 30, 2010 |
|
Posted by Bharat Patel on August 27, 2010 |
|
Hello Friends,
Using ColdFusion service Factory we can take all details of data
sources, database, username, class, map details (database role), driver.The following code can be used to list out data sources along with username and decrypted passwords
Posted by Pradeep on August 27, 2010 |
|
Placing JavaScripts at the bottom of the page is a good way to makeother things of the page download faster.
Keep in mind — the most important goal is to make the page load as speedily as achievable for the user. As soon as load script statement is encountered the browser tries to download and becomes unresponsive until the whole file has been loaded. Therefore, the user will have to wait longer before noticing some development or rendering in the page.
If you have JavaScript (JS} files whose only intention is to add functionality for example, after a button is clicked — go ahead and place those files at the bottom, just before the closing body tag.
<p>MyContent</p>
<script type="text/javascript" src="js/genral.js"></script>
<script type="text/javascript" src="js/event.js"></script>
</body>
</html>
Posted by Vikas on August 23, 2010 |
|
Hello friends,
I just started working on ColdFusion, and I have some interesting stuffs, that I'd like to share with you.
For any web application, we normally use session for maintaining client's login/logout activity. Sessions are created on server side, and each session will have some unique id (in ColdFusion, we have 'sessionid'). It will alive for some time duration, so if successfully logged-in user requests another page during that time, then server will skip checking of authentication.
We’ll see how session and cookie plays roll in that duration. Server sends two variables to client’s browser. Normally it creates cookies, but if cookies are disabled in client’s browser, then it uses URL. Those two variables are CFID and CFTOKEN.
Now let’s do something interesting. Create one login page and one welcome page. Welcome page will only viewable if user successfully logged in. Now you login from one browser and see the cookies. Pass the same cookies in URL for welcome page from another browser or computer (e.g. welcome.cfm?CFID=35473&CFTOKEN=12004479). You’ll be able to see welcome page without asking for login!
So those two variables were just a reference to identify your browser! But two most important thing that you shouldn’t forget ever!
1. If you are using any website that provides login (e.g. facebook, gmail) for your activity, then don’t forget to systematically logout from the website.
2. If you are developer then you should handle the sessions carefully.
In ColdFusion there are four standard cookies that are used for session management. More information is here.
So when we code for logout page, we normally remove the user’s session from server. There is an easy way to do this, and it is to use structDelete(session) function.
But it’ll remove the mapping of client’s browser and server. So in future it will not allow you or another user to login from the same browser.
So you should remove all the session items. You can delete all session items except the standard items (CFID, CFToken, URLToken, SessionID).
Here is the code that you might want to have in your logout.cfm page:
<cfsilent> <cflock scope=”Session” type=”Readonly” timeout=”20?> <cfset variables.sessionItems = “#StructKeyList(Session)#”> </cflock> <cfloop index=”ListElement” list=”#variables.sessionItems#”> <cfif listFindNoCase(“CFID,CFToken,URLToken,SessionID”, “#ListElement#”) is 0 > <cflock scope=”Session” type=”Exclusive” timeout=”20?> <cfset StructDelete(Session, “#ListElement#”)> </cflock> </cfif> </cfloop> <cflocation url=”login.cfm” addtoken=”false”> </cfsilent>
Posted by Pradeep on August 23, 2010 |
|
The :before pseudo-element is used to insert content immediately before an element. This is done via the content property. The content assigned by the content property can be characters, a string, text, or an image. Further, you can apply style to the content, such as setting font and color. This is a convenient way to prefix the same text to large number of related text elements which have the same class value.
The similar :after pseudo-element is used to insert content immediately after an element.
CSS2 has four pseudo-elements: :after, :before, :first-letter, and :first-line. Pseudo-elements allow you to create element-like structures which permit you to apply style to parts of a document that normally cannot be accessed using HTML. Specifically, you can add styled content before and after an element, or effect the style of the first letter or first line of an element.
style code
body{font:normal 12px arial;}
p.orange:before {content: "ABOUT iSUMMATION"; color: orange;font:bold 12px arial;}
p.orange:after {content: "India"; color: blue;font:bold 12px arial;}
Posted by Rahul on August 14, 2010 |
|
Following code can be used to measure query elapsed time by performing multiple runs of the same query and finding the average elapsed time of the query.
SET NOCOUNT ON DECLARE @ExecutionTime TABLE(Duration INT) DECLARE @StartTime DATETIME,@endTime DATETIME DECLARE @i INT = 1; DECLARE @Iterations int = 5; WHILE (@i <= @Iterations) BEGIN --Force Buffered Data Out For More Accurate Results -- DBCC DROPCLEANBUFFERS SET @StartTime = GETDATE() /* ------ Query To Measure Elaspsed Time ------- */ select myField1 , myField2 ,myField3 from myTable /* ---- End ------- */ SET @endTime = GETDATE() select @i as RunNo , @StartTime as StartTime , @endTime As EndTime , datediff(ms,@StartTime,@endTime) as ElapsedTime INSERT into @ExecutionTime SELECT DurationInMilliseconds = datediff(ms,@StartTime,@endTime) SET @i += 1 END -- WHILE SELECT DurationInMilliseconds = AVG(Duration) FROM @ExecutionTime GO
Reference taken from sqlusa.com
Posted by Bharat Patel on August 11, 2010 |
|
Hello Friends,
Everybody know how to print output in function just need to set attributes output=true. But here I have a function which print output some text and I want to call it in CFM page but I do not want to display output which is print by function.
Recent Comments