David Maggard
Member since Dec 11, 2008
- Profile: /members/930-david-maggard.htm
- Comments: 33
Recent Blog Comments By David Maggard
-
Ask Ben: Converting A Parent-Child Data Table Into A Nested XML Document
Posted on Nov 2, 2010 at 6:01 AM
Adam: I have always found that getting upset by someone is pretty silly, either no offense was meant which make you a jerk or they meant to upset you which makes them a jerk, and why give them the satisfaction and the ability to upset you and make you unhappy if they are a jerk, the opinion of jerks... read more »
-
Ask Ben: Converting A Parent-Child Data Table Into A Nested XML Document
Posted on Nov 2, 2010 at 1:33 AM
Ben: table variables are very handy in stored procedures, I have a function that splits a list into ints so I can pass stored procedures a list and then use a table variable in the IN() clause... read more »
-
Ask Ben: Converting A Parent-Child Data Table Into A Nested XML Document
Posted on Oct 29, 2010 at 11:15 AM
Adam: In MSSQL you could use something like: DECLARE @XML varchar(max); SELECT XML=ISNULL(@XML,'')+xml FROM ( ____SELECT TOP 100 PERCENT Lft AS lineNum, '<node...>' AS xml ____FROM Tree ____UNION ____SELECT Rht AS lineNum, '</node>' AS xml ____FROM Tree __) AS XMLElements ORDER BY lin... read more »
-
Ask Ben: Converting A Parent-Child Data Table Into A Nested XML Document
Posted on Oct 29, 2010 at 10:42 AM
Adam: I realized that you can output the xml like: <cfset RightsList=""> <cfset XMLData=""> <cfloop query="DataQuery"> <cfloop condition="ListLen(RightsList) AND DataQuery.Left GT ListFirst(RightsList)"> <cfset XMLData=XMLData... read more »
-
Ask Ben: Converting A Parent-Child Data Table Into A Nested XML Document
Posted on Oct 29, 2010 at 10:15 AM
Ben: I use 0 in CF since it doesn't have the concept of null and null in the DB side, the DB I use won't take a 0 if the referential integrity is turned on with the foreign key.... read more »
-
Ask Ben: Converting A Parent-Child Data Table Into A Nested XML Document
Posted on Oct 29, 2010 at 6:50 AM
One other concern I would have is that since writes are time consuming and need to be isolated for renumbering that you would have to have locking on the entire table(or tree if the table stores multiple separate trees, like comments tied to a specific thread) for relatively long periods of time whi... read more »
-
Ask Ben: Converting A Parent-Child Data Table Into A Nested XML Document
Posted on Oct 29, 2010 at 5:45 AM
I think this calls for some testing. I guess one of the things I have the hardest time thinking about is how you would go about updating the hierarchy in the DB to reflect changes like one node(and its descendants) being move to a new parent, insertions and deletes are doable but I can't seem to ... read more »
-
Ask Ben: Converting A Parent-Child Data Table Into A Nested XML Document
Posted on Oct 28, 2010 at 11:27 PM
Maybe I am wrong but a "nested set model" approach seems to be great if you want to know how many descendants a record has at any level, whether one element is a descendant of another would also be trivial, it seems to make starting with a descendant and getting all ancestors in order triv... read more »
-
Ask Ben: Converting A Parent-Child Data Table Into A Nested XML Document
Posted on Oct 28, 2010 at 10:20 PM
One question I had was that you didn't seem to have the actual database call just QofQ <cfquery>s so I couldn't tell for sure whether you were actually storing a 0 in the parentID field of root nodes or if you were using ISNULL or something similar to just return 0's inplace of nulls. Think th... read more »
-
3rd Annual (Inter)?National Regular Expression Day (And Prizes) - June 1st, 2010
Posted on May 28, 2010 at 12:11 PM
MJ: You know more star trek trivia then me? That is either incredibly presumptuous or incredibly hot, or both.... read more »
-
3rd Annual (Inter)?National Regular Expression Day (And Prizes) - June 1st, 2010
Posted on May 16, 2010 at 1:49 PM
Darn, guess not... read more »
-
3rd Annual (Inter)?National Regular Expression Day (And Prizes) - June 1st, 2010
Posted on May 16, 2010 at 1:48 PM
Does it support subpattern matching in the reponce, ie can I use \1 \2 \3, etc?... read more »
-
Explicitly Ending A ColdFusion Session
Posted on Feb 12, 2010 at 11:45 AM
My favorite way to kill a session is with the leadpipe in the study...jk, awesome post.... read more »
-
Clearing The Session Scope Does Not End Your ColdFusion Session
Posted on Feb 11, 2010 at 1:50 PM
If you look up the docs on the location http header(which cflocation is doing) it is specified, the php docs are more explicit about it as well as lots of varies rewrite engine docs. Its one of those things that most browsers are forgiving about so usually it doesn't matter, but it is something to b... read more »
-
Clearing The Session Scope Does Not End Your ColdFusion Session
Posted on Feb 11, 2010 at 12:06 PM
BTW: Noticed you were using cflocation with a relative url instead of a absolute url. Although most popular browsers will work with relative urls, the standard is for a absolute url, and some older browsers and other protocol-strict http clients will fail with a relative url, just thought I would p... read more »
-
Embedding Secret Messages In An Image Using ColdFusion
Posted on Jan 13, 2010 at 11:43 PM
Speckly images, although some interesting patterns developed in the mp3 ones, may try on a small mpg or avi to see if it is the same.... read more »
-
Thoughts About Salaries And Raises As Motivated By Daniel Pink's Book, Drive
Posted on Jan 13, 2010 at 4:53 AM
1: In my experience raises that are given w/o asking are generally more appreciated, because on top of the raise it is an indication of appreciation and gratitude, they don't feel like they have to beg/demand what they are worth. 2: I think that anytime you can't deliver an expected raise/bonus tha... read more »
-
Embedding Secret Messages In An Image Using ColdFusion
Posted on Jan 13, 2010 at 3:08 AM
I modified the code to make 'pictures' from binary data then re-extract it, this was a learning experience because to rebuild the bytearray I had to extract the separate bytes and convert them to signed byte values to make java happy. It can be VERY memory intensive depending on what you use so be c... read more »
-
Embedding Secret Messages In An Image Using ColdFusion
Posted on Jan 10, 2010 at 3:05 PM
20(10100) seems the most difficult to me, btw avoid 5(00101) or 640(1010000000) or even worse 645. Today is a binary date btw, 01/10/10, yes I am using a 2-digit year, sue me :)... read more »
-
Embedding Secret Messages In An Image Using ColdFusion
Posted on Jan 10, 2010 at 2:22 AM
I think I may have an affinity for other numbering systems, I have liked bit based operations for a while. If you want to see something trippy you can learn how to count to 1023 on your fingers using binary: http://en.wikipedia.org/wiki/Finger_binary... read more »