There are many times when we come across a situation where we need to set a boolean value based on the value of other booleans.
Thats a lot of code for a simple statement. A better way is to use a ternary operator.
Better but still a bit more code than is actually necessary. In these cases where we are checking more than one variable for truthiness to set another variable to true we can just evaluate the result of concatenating the booleans together.
When concatenating booleans together the result is only true if all the values are true. One thing to be aware of is if you try to use the addition operator (+) instead and the value is true, you'll actually end up with an integer result instead of a true boolean. This may be good enough in some cases since any number other than 0 in ColdFusion is true anyway.
Thursday, December 22, 2011
Wednesday, November 30, 2011
Setting Tab Preferences for ColdFusion Files in SublimeText 2 on OSX
Ever since I started using Indy's ColdFusion SublimeText 2 Bundle on OSX I've had issues with Sublime ignoring my "User File Settings" for tab behavior. I like to keep my tabs as tabs and not have them be spaces, and no matter what I added to my user file settings tabs were being interpreted as two spaces.
The only way I was able to override this behavior is to open a .cfm file and gointo Preferneces -> File Settings - More -> Syntax Specific - User and add the following JSON string:
Lastly save the file by going to File -> Save As and make sure its saved as:
/Users/username/Library/Sublime Text 2/Packages/User/ColdFusion.sublime-settings
According to the SublimeText Documentation (http://www.sublimetext.com/docs/2/indentation.html) the order preferences are applied is:
.sublime-settings file is processed last hence will override any other settings. The strange thing was that I could not find any tab preferences stored in any of the other 4 files that were processed before the language specific ones.
The only way I was able to override this behavior is to open a .cfm file and gointo Preferneces -> File Settings - More -> Syntax Specific - User and add the following JSON string:
{"tab_size": 4, "translate_tabs_to_spaces": false}Lastly save the file by going to File -> Save As and make sure its saved as:
/Users/username/Library/Sublime Text 2/Packages/User/ColdFusion.sublime-settings
According to the SublimeText Documentation (http://www.sublimetext.com/docs/2/indentation.html) the order preferences are applied is:
Since the Packages/User/
- Packages/Default/Base File.sublime-settings
- Packages/Default/Base File (<platform>).sublime-settings
- Packages/User/Base File.sublime-settings
- Packages/<syntax>/<syntax>.sublime-settings
- Packages/User/<syntax>.sublime-settings
Labels:
ColdFusion,
Sublime Text 2
Monday, November 28, 2011
Catch Me On the Latest CFHour Podcast.
I was extremely honored and humbled to be asked to appear on the CFHour podcast to talk about the ColdFusion Koans project. You can listen to it here: http://www.cfhour.com/post.cfm/show-123-coldfusion-koans-with-ryan-anklam.
Thursday, November 10, 2011
Watch Me on BoltTalks Talking About the ColdFusion Koans
Yesterday I had the privilege of being on Tim Cunningham's BoltTalks to talk about the ColdFusion Koans project. BoltTalks are a quick ~15 minute video interviews that are perfect for those of use who suffer from ADD. Head on over to http://cfmumbojumbo.com/cf/index.cfm/bolttalks/coldfusion-koans-with-ryan-anklam/ and check it out and let me know how I did.
Thursday, November 3, 2011
Screencast: Getting Started With The ColdFusion Koans
I put together this little screencast that will walk you through getting started with the Koans project. If you haven't read my introductory post yet, read about it here. As you'll see its extremely easy, and its pretty fun too, especially if this is your first journey into unit testing.
As always, if after watching this and working on the Koans you have some good ideas for some additional tests to add to the project please send me a pull request on GitHub. If you are really limited on time and just want to share your idea you can always go to the README.md page, click on the "Edit" link, and add your ideas to the "Suggested Topics" section.
As always, if after watching this and working on the Koans you have some good ideas for some additional tests to add to the project please send me a pull request on GitHub. If you are really limited on time and just want to share your idea you can always go to the README.md page, click on the "Edit" link, and add your ideas to the "Suggested Topics" section.
Subscribe to:
Posts (Atom)