Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Tuesday, 1 October 2013

ColdFusion Basic Interview Questions and Answers

ColdFusion Basic Interview Questions and Answers

If you were searching for ColdFusion basic interview questions and answers, this is the right place. I have listed some basic and important ColdFusion  interview questions and answers for freshers as well as for experienced software developers. These ColdFusion interview questions and answers are based upon basic introduction of ColdFusion, advantages and disadvantages of ColdFusion over other programming languages, ColdFusion administration, application.cfm file, cfapplication tag, coldfusion client management, session and application timeout in ColdFusion, how to make database connection in ColdFusion etc. If you are preparing for ColdFusion interview, you must look at the following ColdFusion interview questions and answers. 

1. What is ColdFusion?

ColdFusion is a programming language based on standard HTML (Hyper Text Markup Language) that is used to write dynamic webpages. With ColdFusion, we can build a content database using input templates and combine these with application programs to create a Web site in which pages are developed dynamically as they are served. This has an application server and software development framework which greatly aid in developing computer software.

2. Is it possible to write ColdFusion in ColdFusion?

No it is not possible to write ColdFusion in ColdFusion. Actually ColdFusion was written in Java and to write programs we need to implement other kinds of programs such as Java, .NET etc. These programs are required because ColdFusion alone cannot survive.

3. Explain about ColdFusion administrator?

ColdFusion administrator is a web based application just like the Cpanel this has many sub options through which you can control many functions such as data sources, global server settings, debugging settings, and application security settings. If you are having multiple administrator services then password must be provided for all those services. Also multiple user instances are provided where by a server can be split into cluster of Coldfusion administrators where a specific work can be provided to a specific individual who cannot alter changes.

4. What is Application.cfm?

When ColdFusion receives a request for an application page, it searches the page's directory for a file named Application.cfm. If one exists, the Application.cfm code is logically included at the beginning of that application page.

If your application runs on a UNIX platform, which is case-sensitive, you must spell Application.cfm with an initial capital letter.

5. Can we have multiple Application.cfm file in an Application?

Yes. If the application page directory does not have an Application.cfm page, ColdFusion searches up the directory tree until it finds an Application.cfm page. If several directories in the directory tree have an Application.cfm page, ColdFusion uses the first page it finds. If the Application.cfm page is present in the directory tree (and has the required permissions set), you cannot prevent ColdFusion from including it.

ColdFusion processes only one Application.cfm page for each request. If a ColdFusion page has a cfinclude tag pointing to an additional ColdFusion page, ColdFusion does not search for an Application.cfm page when it includes the additional page.

6. What is the working process for Application.cfm?

If the application page directory does not have an Application.cfm page, ColdFusion searches up the directory tree until it finds an Application.cfm page. If several directories in the directory tree have an Application.cfm page, ColdFusion uses the first page it finds. If the Application.cfm page is present in the directory tree (and has the required permissions set), you cannot prevent ColdFusion from including it.

ColdFusion processes only one Application.cfm page for each request. If a ColdFusion page has a cfinclude tag pointing to an additional ColdFusion page, ColdFusion does not search for an Application.cfm page when it includes the additional page.

7. What is cfapplication tag?

It defines the scope of a ColdFusion application; enables and disables storage of Client variables; specifies the Client variable storage mechanism; enables Session variables; and sets Application variable time-outs.

8. How can you set the Client Management?

We can enable & disable client management as well as we can configure How & Where client variables need to be store
In the Application.cfc initialization code 
This.clientmanagement="True" / "false"
This.clientStorage="[Ur_datasource_name]" / "registry" / "cookie"
In appliation.cfm using <cfappliaction> tag attributes
clientManagement="yes" / "no"
clientStorage="[Ur_datasource_name]" / "registry" / "cookie"
[Ur_datasource_name] - Stored in ODBC or native data source. You must create storage repository in the Administrator.
registry - Stored in the system registry.
cookie - Stored on client computer in a cookie. Scalable. If client disables cookies in the browser, client variables do not work.

9. What are Session Timeout and Application Timeout? Where we have to do this process?

ApplicationTimeout: The time span an application will exist before it times out (if the application is not accessed in any way). This defaults to the value set in the ColdFusion administrator.

SessionTimeout: The time span a session will exist before it times out (if the application is not access in any way by that session's user). This defaults to the value set in the ColdFusion administrator.

10. What are the advantages and disadvantages of using stored procedures versus calling SQL inline in ColdFusion?

Stored procedures abstract database logic from server side code. They also offer performance benefits in pushing application logic to the database side.

The disadvantage is that if they are poorly written then they can hinder database performance and make development a little more obfuscated.

11. What is Application Server?

A server that exposes business logic to client applications through various protocols including HTTP, HTTPS, IIOS/SSL. Eg: Sun Java Application server, weblogic server.

It takes care of important issues like Transaction Management, Security, Database Connection Pooling, Clustering, Scalability,session management,load balancing,thread management and Messaging etc. A web server cannot provide these.

12. What can be used to create connections between your ColdFusion Web sites and databases?

A DSN is used. These are set up in CF administrator and used in query code to connect to a database.

13. What are the databases that are supported by ColdFusion applications?

All relational and non relational databse like Oracle,MSAccess,mysql

14. What are the advantages of ColdFusion?

Simplified Installation and Migration
All Operating System (OS) Support
All Database support
Faster Development & Easy to Learn
Improved & support for all Protocols
Access to all the J2EE libraries
Integration with Other adobe Products (Flex, Flash, PDF..)

15. Compare ColdFusion with other programming languages.

For every language has its pros and cons. I will point out one or 2 advantages of CF over other languages.

vs PHP: Ajax features, Integration with adobe products, community support, J2EE
vs Java: Easy to learn, Code developmet & maintence cost
vs .NET: All OS, Most of webserver Support

What if your Super Hero becomes Software Developer?

What if your Super Hero becomes Software Developer?

As an expert programmer or developer, you can do anything. You can develop a lot of complex applications and projects. At each and every step you have to keep in mind some rules and restrictions which you have to follow. You have to abide by OOPS concepts in all the programming languages. 

But what will happen, if Rajnikant sits on the hot seat and start coding? Rajnikant is the super hero in south India and the people treat him like God there. You can compare him with world's super heroes like Tom Cruise, Brad Pitt, Bruce Lee, Jackie Chan etc.There are a lot of jokes about him in which he can turn impossible to possible. I just gathered some of his jokes related to software development to share. I just wanted to imagine how Rajnikant will code? How will he turn impossible to possible in the programming world? Here we go..

1. He does not follow any coding standards. All coding standards follow him.

2. He can write the code that optimizes itself.

3. He can divide a number by zero without handling any exception.

4. He never uses try in the code, he will directly catch the exception.

5. He can force Binary Search Algorithm to work on unsorted data.

6. He can return a value from a void function.

7. He can inherit a sealed class.

8. He can override a sealed function / variable.

9. He can make a class abstract and sealed at the same time.

10. He can run .NET exe on any platform like Mac, Linux, Unix, Mobile etc. and not the least railway platforms too.

11. He can force garbage collector in your PC to clean your office room.

12. He does not get any compiler error or warning, the IDE will abide by him.

13. He can make a variable of type float to float in the water.

14. He can access all the private data of the class.

15. He can create an array of infinite size because he does not have any boundaries.

16. He can create an integer variable and assign infinity to it.

17. He can delete recycle bin.

18. He can implement multiple inheritance in all the programming languages.

Monday, 30 September 2013

59 Hilarious but True Programming Quotes for Software Developers

59 Hilarious but True Programming Quotes for Software Developers

I have collected a lot of programming quotes which are anyhow related to the life of a software developer. These quotes are related to software development  maintenance, debugging, software bugs, software design and documentation, code quality, testing and management etc. Below are 59 programming quotes which are hilarious but also true. Only a software developer can understand the worth of these programming quotes. So lets start... 

Software Developers and Programmers Quotes

1. A good programmer is someone who always looks both ways before crossing a one-way street. (Doug Linder)

2. Don’t worry if it doesn't work right. If everything did, you’d be out of a job. (Mosher’s Law of Software Engineering)

3. The trouble with programmers is that you can never tell what a programmer is doing until it’s too late. (Seymour Cray)

4. Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris. (Larry Wall)

5. Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. (Martin Golding)

6. One man’s crappy software is another man’s full time job. (Jessica Gaston)

7. If builders built buildings the way programmers wrote programs, then the first woodpecker that came along wound destroy civilization. (Gerald Weinberg)

8. The most likely way for the world to be destroyed, most experts agree, is by accident.  That’s where we come in; we’re computer professionals. We cause accidents. (Nathaniel Borenstein)

9. It’s a curious thing about our industry: not only do we not learn from our mistakes, we also don’t learn from our successes. (Keith  Braithwaite)

10. Once a new technology starts rolling, if you’re not part of the steamroller, you’re part of the road. (Stewart Brand)

11. If at first you don’t succeed, call it version 1.0 (unknown)

12. All programmers are playwrights and all computers are lousy actors. (Anonymous Hack Actor)

13. The sooner you get behind in your work, the more time you have to catch up. (Anonymous Scheduler)

14. When a programming language is created that allows programmers to program in simple English, it will be discovered that programmers cannot speak English. (Anonymous Linguist)

15. Why do we never have time to do it right, but always have time to do it over? (Anonymous)

16. Any fool can write code that a computer can understand. Good programmers write code that humans can understand. 

17. Any code of your own that you haven't looked at for six or more months might as well have been written by someone else. (Eagleson's law)

Programming / Software Development Quotes

1. Measuring programming progress by lines of code is like measuring aircraft building progress by weight. (Bill Gates)

2. Programming is like sex. One mistake and you have to support it for the rest of your life. (Michael Sinz)

3. Walking on water and developing software from a specification are easy if both are frozen. (Edward V Berard)

4. The first 90 percent of the code accounts for the first 90 percent of the development time…The remaining 10 percent of the code accounts for the other 90 percent of the development time.(Tom Cargill)

5. Commenting your code is like cleaning your bathroom — you never want to do it, but it really does create a more pleasant experience for you and your guests. (Ryan Campbell)

6. Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Rick Cook)

7. The hardest part of design … is keeping features out. (Donald Norman)

8. In order to understand recursion, one must first understand recursion. (Anonymous)

9. There are only two kinds of programming languages: those people always bitch about and those nobody uses. (Bjarne Stroustrup)

10. The best thing about a boolean is even if you are wrong, you are only off by a bit. (Anonymous)

11. If Java had true garbage collection, most programs would delete themselves upon execution. (Robert Swell)

12. In theory, there is no difference between theory and practice. But, in practice, there is. (Jan L. A. van de Snepscheut)

13. Ready, fire, aim: the fast approach to software development. Ready, aim, aim, aim, aim: the slow approach to software development. (Anonymous)

14. Programming is 10% science, 20% ingenuity, and 70% getting the ingenuity to work with the science. (Anonymous)

15. It is easier to measure something than to understand what you have measured. (Anonymous)

16. Benchmarks don’t lie, but liars do benchmarks. (Anonymous)

17. Better train people and risk they leave – than do nothing and risk they stay. (Anonymous)

18. The goal of Computer Science is to build something that will last at least until we've finished building it. (Anonymous)

19. Java is to JavaScript what Car is to Carpet. (Chris Heilmann)

20. It's not at all important to get it right the first time. It's vitally important to get it right the last time. (Andrew Hunt and David Thomas)

21. Should array indices start at 0 or 1? My compromise of 0.5 was rejected without, I thought, proper consideration. (Stan Kelly-Bootle)

22. Programs must be written for people to read, and only incidentally for machines to execute. (Abelson / Sussman)

23.  Programming can be fun, so can cryptography; however they should not be combined. (Kreitzberg and Shneiderman)

24. Copy and paste is a design error.  (David Parnas)

25. Computers are good at following instructions, but not at reading your mind. (Donald Knuth)

Software Debugging Quotes

1. Deleted code is debugged code. (Jeff Sickel)

2. If debugging is the process of removing software bugs, then programming must be the process of putting them in. (Edsger Dijkstra)

3. Debugging is twice as hard as writing the code in the first place.  Therefore, if you write the code as cleverly as possible, you are–by definition–not smart enough to debug it. 

4. It's hard enough to find an error in your code when you're looking for it; it's even harder when you've assumed your code is error-free. (Steve McConnel)

Software Bugs Quotes

1. It’s not a bug – it’s an undocumented feature. (Anonymous)

2. Without requirements or design, programming is the art of adding bugs to an empty text file. (Louis Srygley)

3. Bad code isn’t bad, its just misunderstood. (Anonymous Code Behaviorist)

4. There are two ways to write error-free programs; only the third one works. (Alan J. Perlis)

5. Beware of bugs in the above code; I have only proved it correct, not tried it. (Donald Knuth)

Software / End Product Quotes

1. Before software can be reusable it first has to be usable. (Ralph Johnson)

2. Software undergoes beta testing shortly before it’s released. Beta is Latin for “still doesn't work". (Anonymous)

3. The best performance improvement is the transition from the nonworking state to the working state. (J. Osterhout)

4. The cheapest, fastest, and most reliable components are those that aren't there. (Gordon Bell)

5. I think Microsoft named .Net so it wouldn’t show up in a Unix directory listing. (Oktal)

6. Software and cathedrals are much the same – first we build them, then we pray. (Sam Redwine)

7. The software isn’t finished until the last user is dead. (Anonymous)

8. Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves. (Alan Kay)

Friday, 13 September 2013

Can Developers / Programmers live without StackOverflow?

Can Developers / Programmers live without StackOverflow?

A Software developer or programmer faces new challenges everyday during project development. In each line of code, there is something new to explore. While developing any application, any product, we know many things technically how to do? But, there are many things for which we have to google. There may be many unforeseen exceptions which may come in the coding path. While coding, a software developer encounters many errors and exception, some of them he or she already knows how to resolve and for many of them he / she has to google. 

When I am saying "google", I mean searching on the internet. But I have noticed that while searching any code related queries on the google, out of first 10 results, at least 5 are from stackoverflow. When I land on stackoverflow pages by searching my problem / errors / exceptions, I feel somewhat confident to know that I am not the single person in the universe who is getting this kind of error. There are lot of my friends across the globe to help me out. I am so much impressed with the people on stackoverflow who are expert in their technologies and have thousands of reputation points on stack overflow. Sometimes I think, would I be able to compete them in future? 95% of my problems are resolved by stackoverflow expert discussions.

Even if you don't find any useful link while googling, and also there is no link on stackoverflow, you can ask your question there on stackoverflow. A lot of experts with very high reputation points are sitting on stackoverflow who will help you out within minutes. When your question gets resolved, it will also help other developers who would encounter the error you asked on stackoverflow because stackoverflow has very good google rank and its pages get indexed on google search within minutes and start appearing on first page of google when you search similar problem again.

If you encounter any problem and solve it by yourself after some struggle, I will suggest you to share your finding on stackoverflow. Ask a question and answer it yourself because it will surely help other programmers around the world who encounter this problem in the future.

I feel a lot of dependency on Stackoverflow. So, as a software developer, I think StackOverflow is boon to me which is solving my problems for almost 4 years and will continue to favor me in future.