Adam.Blog()
Adam Presley's blog
Intro to DSLs in Groovy, Part 3
Today let’s continue our series of getting started with simple DSL creation in Groovy. In part 1 we talked about the what and why of Domain Specific Langages, and what our sample DSL would look like. Then in part 2 we actually started building the code in Groovy creating the...
Intro to DSLs in Groovy, Part 2
In my previous post I introduced a simple recipe DSL which provided a really easy way to describe a recipe, its ingredients and instructions. In part two I will start the process of how we can make this tiny “language” of ours execute using Groovy’s excellent ability to throw out...
Intro to DSLs in Groovy, Part 1
Here in a couple of weeks I will be presenting at the Dallas/Ft. Worth Groovy User Group meeting on an introduction to DSLs, or Domain Specific Languages, in Groovy. What is particularly fun about this is how wonderfully easy Groovy makes this task. In this post I am basically giving...
Asking For a List of Inputs on the Console in C/C++
Here’s a question I got today: I’m trying to prompt the user to enter an array of strings. How do I do that? Considering I haven’t written a complete C/C++ application in over 5 years I admit I had to dust off the Google a bit, but luckily most of...
Regex Merging of Structures in Groovy: Revisited
Some time ago I blogged about using CFGroovy to build a function to take two structures and merge their keys together selectively based on a regular expression. Today I revisit that to make a smarter function, and way more trim. The enhancement here is to allow the user to pass...
Default Values in JavaScript Using the OR Operator
Got a question tonight asking how to check a value in jQuery, and if it is null or blank use a default value. Enter the “default operator”, or the OR (||) operator. In the example below the variable value will be assigned the value from the text box named textBox...
Human Can Opener
Ok, wow. This girl opens the top of coke cans with her teeth! Nice! http://www.funlol.com/funpages/human-can-opener.html
Using Lambda for Sorting in C# .NET
Here’s a quick little tidbit that helped me this week. While writing a C# Windows application I found myself with a List of objects that did not implement a comparator interface. Because of this when I tried to call mylist.Sort() I got an error complaining about how it couldn’t compare...
Announcing CFShowdown - Markdown for ColdFusion
Notice: This project is no longer supported. I am pleased to announce the availability of CFShowdown, a Markdown library for ColdFusion. You can visit the RIAForge project page for more information, as well as to download the project. If anyone has any questions I am happy to help. Happy coding,...
Firebug's Console - Making Sure We Don't Break IE
Here’s a quick little JavaScript function that allows you to continue your loving relationship with Firebug in Firefox, but also not break your Internet Explorer users. This function wraps the console.log() function and makes sure that it exists before it tries to use it. This avoids causing JavaScript errors in...