the singularity of being and nothingness
Archive for October, 2010
CFScript Alternative to CFHeader
Oct 30th
In another post, I wrote about how you can replicate the functionality of cfcontent’s “reset” attribute in CFScript. The other day, I came across a related issue of needing to be able to do the same thing (all code in CFScript, that is) for cfheader. Fortunately, by using the same approaching of tapping into the underlying Java methods, this is extremely easy.
Setting StatusTo set the status code for the page request, simply do the following:
pc = getpagecontext().getresponse(); pc.getresponse().setstatus(301);
No big deal there. Also, be aware that the setstatus() method can take an optional second string attribute, so if you wish to define a message to accompanying the status code, feel free 🙂
Setting HeadersHonestly, I use headers in CF mostly for downloading files, or returning certain content types. Just as with setting the status, it’s pretty freaking simply to do in CFScript:
pc = getpagecontext().getresponse(); pc.getresponse().setcontenttype('application/vnd-ms.excel'); pc.setHeader("Content-Disposition","inline;filename=MyFile.xls");Share this:
Book Review: The Good Man Jesus and the Scoundrel Christ
Oct 27th
Philip Pullman is, to me, a polarizing figure. His Dark Materials is, without a doubt, among my favorite reads of all time. Sure, he manages to not-so-subtly weave the “evils” of the Roman Catholic church into his invented fantasy world. But honestly, the story is so otherwise compelling that such a deliberate and malevolent slight can be overlooked for its pettiness and childishness…in fact, in many ways, it serves the story quite well.
So given Pullman’s overt and public vitriol for Roman Catholicism specifically, and religious belief in general, I had some pretty strong assumptions about what he would do with the story of Jesus. Now let’s be honest: such is inescapable when approaching any book–our presuppositions always drive our experience. In this light, then, I think a really outstanding piece of writing is one that turns presuppositions on their heads–like His Dark Materials did. A meager and ultimately unsucessful attempt, on the other hand, is one that leaves the reader saying to themselves, “Well, that was terrifically predictable.” To spoil the ending right out of the gate, The Good Man Jesus and the Scoundrel Christ was the latter.
The Predictably Demythologized JesusPullman’s work is a part of a larger collection of books by various authors in More >
Auto-Tuning Theology: Theosis
Oct 25th
In the second part of Auto-Tuning Theology, we stick with Athanasius and select a passage for which he is probably most famous: his outline of the doctrine of Theosis.
Listen to the TrackAs, then, he who desires to see God Who by nature is invisible and not to be beheld,
May yet perceive and know Him through His works,
So too let him who does not see Christ with his understanding at least consider Him
In His bodily works and test whether they be of man or God.
If they be of man, then let him scoff; but if they be of God, let him not mock at things which are no fit subject for scorn,
But rather let him recognize the fact
And marvel that things divine have been revealed to us by such humble means,
That through death deathlessness has been made known to us,
And through the Incarnation of the Word the Mind whence all things proceed has been declared,
And its Agent and Ordainer, the Word of God Himself.
He, indeed, assumed humanity that we might become God.
He, indeed, assumed humanity that we might become God.
He, indeed, assumed humanity that we might become God.
He, indeed, assumed More >
Auto-Tuning Theology: Christ’s Death
Oct 25th
This selection is from St. Athanasius’ famous On the Incarnation of the Word, section 26. This paragraph is an introduction to the argument which Athanasius makes regarding the necessity and efficacy of Christ’s death and resurrection.
Listen to the TrackShare this:Fitting indeed, then, and wholly consonant was the death on the cross for us; And we can see how reasonable it was, And why it is that the salvation of the world could be accomplished in no other way. Even on the cross He did not hide Himself from sight; Rather, He made all creation witness to the presence of its Maker. Then, having once let it be seen that it was truly dead, He did not allow that temple of His body to linger long, But forthwith on the third day raised it up, IMPASSIBLE and INCORRUPTIBLE
The pledge and token of His victory.
Happy Birthday, Dizzy!
Oct 21st
Google is celebrating the birthday of the phenomenal jazz musician, Dizzy Gillespie. Dizzy died in 1993, and would have been 93 today.
Share this:CFSpreadsheet Row Striping
Oct 20th
Today I was trying to get CF9’s new spreadsheet functionality to stripe the rows in the spreadsheet I was generating. From what I could find, there’s nothing inherent to the tag (cfspreadsheet) or any of the related functions to do this. I find this a bit curious, but stewing over should-have-been’s doesn’t get the job done. So I decided to roll my own solution.
The first thing to check out is the documentation for the spreadsheetformatrows() function. This takes 3 arguments:
- spreadsheetObj: This is the spreadsheet in which the rows exist
- format: An object of appropriate formatting rules to apply to the selected rows
- row: The rows to which the formatting specification is applied
The “row” argument is the most important. While you can’t specify something like “please stripe the rows with these two formatting objects” (wish list), you can either specify a range of rows (e.g., “3-12”) or a list of rows (e.g., “3,5,7,9”).
Ah, so if we can use a list of rows, the answer becomes apparent: all we have to do is roll through the query and create some lists of odd and even numbers!
To do this, I created a simple function:
function getnumlist(start,end) { // create structure to hold odd and even number lists numbers = structnew(); More >
Sencha: Creating Child Stores
Oct 11th
One of the things I <3 about Sencha is the data store. They are super-simple to create, but very powerful for creating robust, data-driven applications. The other day, I found myself creating 3 data stores that were extremely similar, simply because of the fact that the data returned was fairly complex and nested. You see, with a Sencha store, you define a “root” of your data, which is really just how the store’s Reader will treat the “rows” of data that are fed into the store. This works very well, but in my scenario, I was wanting to create a master store of data defined at the highest possible root, and then create child stores based on some of the nested objects belonging to my initial data set. So in this case, instead of making 3 remote calls to get the same, but differently-structured data, I wanted to make 1 request and use the result 2 more times for different stores.
At first, I looked to the store itself for something like a “copy” or “clone” method, but there was none. There IS an option for doing an “each” loop for every record, but that just seemed a bit overkill. But More >
Sencha: Defining Store Fields
Oct 11th
If you’ve ever created a data store with the Sencha framework, you’re familiar with defining the “fields” for the store’s data. Something like this does the trick:
var myStore = new Ext.data.JsonStore({ id: "myJsonStore", url: "datasource.js", fields: [ "id", "name", "age" ] });
This method of defining data fields works perfectly well, but is not very extensible. After all, what if you have several stores for which you want to use the same field definitions? Yeah, you can define the same fields for each store, but wouldn’t it be better to define it once, and then customize it as needed?
Fortunately, this is super-simple to do. When you define fields “inline” while creating the data store, what you are really creating is something of an impromptu MixedCollection (a Collection class that maintains both numeric indexes and keys and exposes events, per the docs). Ah, so if it’s nothing more than a Sencha object, we can abstract it from the store itself, and reuse it to our heart’s desire!
var mydef = new Ext.util.MixedCollection(); mydef.addAll([ "id", "name", "age" ]);
Obviously, this looks extremely similar to what we did inline. However, the huge difference is that this new, abstracted object has some handy methods for retrieval, addition More >
Underoath: “Illuminator”
Oct 5th
In preparation for release of their “Disambiguation” album (look for it 11.09.10), Underoath has been releasing “layers” of a new song over the course of several days. These layers finally came together into their newest finished song, “Illuminator.”
Overall, I like this song a lot. It’s not terrifically innovative for Underoath, but if you like what Underoath has done in the past, you’ll like what’s offered here. Hope you enjoy 🙂
IlluiminatorAwake to the sound of emptiness. Alone in a room that is filled with the darkest of light. I was told there was nothing beyond here. How do I know what side I'm on? Breathe! A captive with nothing but the thoughts increasing, Worsening I dont belong here But I cant find my exit. This is where they all come to hunt me down, hunt me down Where they go to hunt me down, they hunt me down Weigh out the options Pave the narrow I know what you're thinking Come on man I swear you can do this Come on man I swear you can do this I break free from this room they built for me I break free from this room they built for me This is More >