Posted: April 30, 2007 at 2:54 PM by Ben Nadel
I recently posted about how the MOD (modulus) operator could be used in ColdFusion to determine even and odd rows of an outputted query. Tony Petruzzi commented that this could also be done using bitwise manipulation and, in particular, the ColdFusion BitAnd() function. For those of you who don't know how bits come into play when we are talki... read more »
Comments (12) | Post Comment | Ask Ben | Live Chat (Beta) | Permalink
Posted: April 30, 2007 at 1:13 PM by Ben Nadel
I was on the way to the bathroom (the Tea has to go somewhere) when this popped into my head: Since dates in ColdFusion are represented as floating numbers and the decimal represents the time of day, you can use ColdFusion's Rand() function to generate random times. Think about it; since Rand() gets a value that is between 0 and 1, this can be tho... read more »
Comments (6) | Post Comment | Ask Ben | Live Chat (Beta) | Permalink
Posted: April 30, 2007 at 11:50 AM by Ben Nadel
Sorry if this seems in horrible taste, but seeing people post a blog entry that has the Advert for the One Day Of Blog Silence kind of reminds me of that Mitch Hedberg joke: "I'm against protesting, but I don't know how to show it." Not trying to be offensive, this is just the kind of stuff that pops into my mind. ... read more »
Comments (0) | Post Comment | Ask Ben | Live Chat (Beta) | Permalink
Posted: April 30, 2007 at 8:54 AM by Ben Nadel
On Ray's Friday Puzzler , it came up that not everyone knows what the MOD (or Modulus) operator is in math. This is one of those things that once you know it, you can't imagine how you lived with out it. The MOD operator does a fairly simple thing: it divides two numbers and returns only the remainder. To demonstrate how this works in a practica... read more »
Comments (11) | Post Comment | Ask Ben | Live Chat (Beta) | Permalink
Posted: April 30, 2007 at 7:52 AM by Ben Nadel
I was just reading Elliott Sprehn's test cases for Ray Camden's Friday Puzzler when I came across something very interesting: at the end of his file, he has his hash signs (#) and his variables on different lines for inline evaluation. I have never seen this before, so naturally I had to test it: <!--- Set up girl object. ---> <cf... read more »
Comments (6) | Post Comment | Ask Ben | Live Chat (Beta) | Permalink
Posted: April 29, 2007 at 8:45 PM by Ben Nadel
I am trying to display a calendar month in my application. I have all the events in a database (SQL Server). I don't want to show the individual events on this view, only to highlight the days that have any events. Right now, for each day I am querying the database for events on that day. This is slow and seems not optimal. How can I better do thi... read more »
Comments (20) | Post Comment | Ask Ben | Live Chat (Beta) | Permalink
Posted: April 27, 2007 at 4:44 PM by Ben Nadel
Lenny!! You should have seen these two chicks I met at the bar last night. They said they weren't "sisters," but I wouldn't request any DNA samples if you know what I mean, but of course, whose thinking about DNA when the two hotties in front of you are busy licking each - Wait, ... read more »
Comments (2) | Post Comment | Ask Ben | Live Chat (Beta) | Permalink
Posted: April 27, 2007 at 1:35 PM by Ben Nadel
I finally got a chance to work on Ray's puzzler for April 27, 2007 . It builds the result set by viewing the array as a table that has rows (set values) and columns (characters within a value). When you look at this way, you can build the array using a simple nested loop. The complicated part is using this RxC (row by column) index to figure out ... read more »
Comments (3) | Post Comment | Ask Ben | Live Chat (Beta) | Permalink
Posted: April 26, 2007 at 8:42 AM by Ben Nadel
Previously, I blogged about how CFSetting updates the page timeout setting and does not actually start a new timeout. I had written about this in terms of disaster recovery. I can't find the conversation at this moment, but someone had raised a good point that in order to add time to the request timeout you would need to know how long the page h... read more »
Comments (6) | Post Comment | Ask Ben | Live Chat (Beta) | Permalink
Posted: April 26, 2007 at 8:13 AM by Ben Nadel
The other day, I discovered how to get the date/time at which your ColdFusion page started running. Before I had found this, I had contemplated using a GetTickCount() at the beginning of my page run to mark this time. But, this method is ganky and requires updates to more than one file. By reaching into the Page Context, I am able to grab the star... read more »
Comments (7) | Post Comment | Ask Ben | Live Chat (Beta) | Permalink
Posted: April 25, 2007 at 9:06 AM by Ben Nadel
When you are using nested ColdFusion custom tags, you can use the CFAssociate tag to associate the child tags with a parent tag. By default, this tag stores the ATTRIBUTES scope values in the parent tag in an array named AssocAttribs. You can, however, explicitly name the target array using the datacollection attribute. Now, the ATTRIBUTES struct... read more »
Comments (2) | Post Comment | Ask Ben | Live Chat (Beta) | Permalink
Posted: April 24, 2007 at 6:39 PM by Ben Nadel
Up until now, I have worked with ColdFusion custom tags that have a known parent; my cell has always been a child of the row, my row has always been a child of the table. But what happens if you want to build a slightly more dynamic tag that doesn't necessarily know what it's parent tag hierarchy is? Determining this hierarchy has been done loads ... read more »
Comments (0) | Post Comment | Ask Ben | Live Chat (Beta) | Permalink
Posted: April 24, 2007 at 4:24 PM by Ben Nadel
Hey Bo, you ever think about programming in something other than ColdFusion? Yeah, sometimes. So how come you never do? Too much self-respect I guess. ... read more »
Comments (3) | Post Comment | Ask Ben | Live Chat (Beta) | Permalink
Posted: April 24, 2007 at 4:19 PM by Ben Nadel
I went to see my primary physician as well as my physical therapist (both of whom are part of the Sports Medicine office at Chelsea Piers ). The bad news: I have very tight hamstrings (I knew that), a tight TFA, a tight IT band, strength imbalances, weakness, pronating feet, and I am horribly out of shape (OK, I added that last one). The good new... read more »
Comments (4) | Post Comment | Ask Ben | Live Chat (Beta) | Permalink
Posted: April 24, 2007 at 8:15 AM by Ben Nadel
Previously, I tried to build a table structure using just nested ColdFusion custom tags . In that scenario, the base Table tag stored the rows in local structures and the Row tag stored the cells in a local structure. I didn't quite like the way the code was working. For this attempt, I am aiming for the same outcome, however, instead of storing ... read more »
Comments (2) | Post Comment | Ask Ben | Live Chat (Beta) | Permalink