<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7046168086684362207</id><updated>2011-10-04T17:02:37.795-04:00</updated><category term='I hate Apples'/><category term='iPad'/><category term='MySQL'/><category term='Oracle'/><category term='ColdFusion'/><category term='Apple v. Flash'/><title type='text'>Headsplode</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://headsplodeblog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://headsplodeblog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Headsplode</name><uri>http://www.blogger.com/profile/01842576565977184028</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7046168086684362207.post-382554831201703211</id><published>2011-01-06T13:02:00.001-05:00</published><updated>2011-01-06T13:04:57.629-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='iPad'/><title type='text'>Life without Flash, as bad as you thought?</title><content type='html'>&lt;hr /&gt;As a ColdFusion developer and aspiring Flash/Flex developer I was pretty upset with Apple's decision to exclude Flash support from the iPad.  I promptly went out and bought the first Android 2.2 phone I could in protest!  I don't regret that, I love my Droid X.  However, a couple months back I was gifted an iPad. My wife and I both got one.  I don't care how bias you are, you can't argue with a gift.  &lt;br /&gt;&lt;br /&gt;As much as I want to dislike this stupid thing, I just can't.  In fact, I love my iPad.  It hasn't left my side since I got it. Aside from Flash, I haven't found anything I can't do with it, and iOS 4.2 cleared up some of the small annoyances I had with it prior to the update, primarily multitasking.&lt;br /&gt;&lt;br /&gt;My biggest surprise is that the lack of Flash isn't as earth shattering as I thought it would be.  I think I can count on one hand the number of times either my wife or I have been inconvenienced by it.  Granted, it was a pretty big inconvenience. But the number of them have been small.&lt;br /&gt;&lt;br /&gt;This is just my experience.  I'm sure there are other use cases out there, so I'm curious to know how my fellow Adobe community iPad owners feel about the lack of Flash? Is it as bad as you feared?  Worse?  A few inconveniences? Or maybe you don't own one strictly because of it?  Let me know.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7046168086684362207-382554831201703211?l=headsplodeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://headsplodeblog.blogspot.com/feeds/382554831201703211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://headsplodeblog.blogspot.com/2011/01/life-without-flash-as-bad-as-you.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default/382554831201703211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default/382554831201703211'/><link rel='alternate' type='text/html' href='http://headsplodeblog.blogspot.com/2011/01/life-without-flash-as-bad-as-you.html' title='Life without Flash, as bad as you thought?'/><author><name>Headsplode</name><uri>http://www.blogger.com/profile/01842576565977184028</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7046168086684362207.post-4536789030074471566</id><published>2010-11-10T06:12:00.001-05:00</published><updated>2010-11-10T06:18:08.056-05:00</updated><title type='text'>Does a good PDF reader for Android exist?</title><content type='html'>&lt;hr /&gt;&lt;br /&gt;I want to get an Android tablet. I've been looking at the Notion Ink Adam for months now.  I think it looks like the strongest Android tab to hit the market in the near future.  &lt;br /&gt;&lt;br /&gt;Last month I was given an iPad as a gift.  Despite it's lack of Flash, multi tasking (which I hear is being fixed this week?), and all the other goodness found in Android, the iPad does most of what I want, very well thanks to the apps.&lt;br /&gt;&lt;br /&gt;One of the things I do is read a lot of PDF e-books.  Mostly stuff like Adobe documentation or text books with a pdf version on the companion CD.  The iPad does this well, even the free iBooks app which is what I use most makes reading PDFs a treat.&lt;br /&gt;&lt;br /&gt;On my Droid X I've tried a few readers, including Adobe's official reader, and from my experience... they all kind of stink.&lt;br /&gt;&lt;br /&gt;Adobe's official reader is pretty good for small documents.  It's quick and smooth but doesn't remember where I left or allow me to even set a bookmark which is a problem with 600 page e-books.&lt;br /&gt;&lt;br /&gt;Beam reader trial just seems clumsy.  It would rather bounce at the bottom of the page than continue to the next one. In text view you can't even get to the next page by flicking. There seems to be some sort of glitch in PDF view where the pages that were loaded into memory already start to look like TV static.  It does seem to remember what page you exited on though. The $10 price tag seems high to me as well considering the bugs.&lt;br /&gt;&lt;br /&gt;The quick office reader seems pretty OK.  The bookmarks let you easily jump to chapters and you can manually input the page but it doesn't remember what page you exited on or allow you to create a bookmark.&lt;br /&gt;&lt;br /&gt;There are some other pay options but I can't see paying for an app that may not work.  Don't get me wrong, I don't mind buying apps, but I do mind buying apps that don't work.  At some point I'd like to start developing for the Android so this would be a good project but until then, anyone have any input?  Loading the last page read is a huge thing for me.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7046168086684362207-4536789030074471566?l=headsplodeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://headsplodeblog.blogspot.com/feeds/4536789030074471566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://headsplodeblog.blogspot.com/2010/11/does-good-pdf-reader-for-android-exist.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default/4536789030074471566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default/4536789030074471566'/><link rel='alternate' type='text/html' href='http://headsplodeblog.blogspot.com/2010/11/does-good-pdf-reader-for-android-exist.html' title='Does a good PDF reader for Android exist?'/><author><name>Headsplode</name><uri>http://www.blogger.com/profile/01842576565977184028</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7046168086684362207.post-6657326425239332370</id><published>2010-09-01T14:31:00.001-04:00</published><updated>2010-09-01T14:32:25.328-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='I hate Apples'/><title type='text'>Apple and what used to be the best e-music service ever.</title><content type='html'>&lt;hr /&gt;So, I just finished watching Apple's music event.  They talked about new iOS updates, iPod updates, iTunes 10, and iTV.&lt;br /&gt;&lt;br /&gt;I tuned out most of it, except for the iTunes part, hoping to hear how Apple took advantage of Lala's streaming technology.  I have yet to find a music service that offers what Lala had.  Web songs for $.10, MP3 for $.89 (often less), social networking, discovery, full album previews, enormus selection, it was such a great service.&lt;br /&gt;&lt;br /&gt;Sadly, it looks like the only thing they've taken from Lala so far is the social networking.  iTunes 10 has a "Ping" feature that is basically facebook for music inside iTunes (not the web).  Follow, be followed, share, discover, etc.&lt;br /&gt;&lt;br /&gt;This doesn't mean iTunes won't eventually be a streaming service and offer what Lala had, but unil then there's a huge void in internet music services.  Too bad google didn't bid for it more aggressively.&lt;br /&gt;&lt;hr /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7046168086684362207-6657326425239332370?l=headsplodeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://headsplodeblog.blogspot.com/feeds/6657326425239332370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://headsplodeblog.blogspot.com/2010/09/apple-and-what-used-to-be-best-e-music.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default/6657326425239332370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default/6657326425239332370'/><link rel='alternate' type='text/html' href='http://headsplodeblog.blogspot.com/2010/09/apple-and-what-used-to-be-best-e-music.html' title='Apple and what used to be the best e-music service ever.'/><author><name>Headsplode</name><uri>http://www.blogger.com/profile/01842576565977184028</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7046168086684362207.post-5298039478090241455</id><published>2010-07-09T13:21:00.000-04:00</published><updated>2010-07-09T13:21:37.763-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ColdFusion'/><title type='text'>Don't be so quick to blame ColdFusion</title><content type='html'>&lt;hr /&gt;Not long ago my new boss and I were having a conversation and it came up that we might not be using ColdFusion much longer, but he’d get me trained on whatever I needed when they changed technologies.  &lt;br /&gt;&lt;br /&gt;Back story:  The ColdFusion app that I’m maintaining now is an add-on to an asp.net application.  It turns out the reason this add-on isn’t in .net is because the person they had available didn’t know or want to learn .net (I don’t blame him personally).  On the home page of the .net app lives an iframe with a news scroller.  The news is stored in a table and presented in a .cfm page.  I’m sorry but I don’t see any reason why a single query and a few records can’t be displayed in .net, in a .net application.  His aversion of .net was that strong.&lt;br /&gt;&lt;br /&gt;When I asked why we were moving away from CF he said “Well, when we started this CF was the hottest thing, then not so much, now it is again, so who knows.  CF also can’t handle the requirements.  The system runs like shit!” &lt;br /&gt;&lt;br /&gt;When I asked who said CF wasn’t the greatest thing anymore he said “the same guy that said it was great, the first developer.”  I was pretty shocked.  The same guy that didn’t want to learn enough .net to make a single page is now blaming CF for his lack of ability!  Thanks to him, CF has a bad rap with my management and our customers!&lt;br /&gt;&lt;br /&gt;The system did run like shit, fortunately for me one of my side projects is very similar to my day time job, making “charts and graphs 'n shit” as my boss puts it.  I showed what I had done and how fast it works.  I suggested it might not be CF, but the previous two developers. I asked him to give me the opportunity to fix the system before passing judgment on CF.  &lt;br /&gt;&lt;br /&gt;This week I put some proper error trapping in the system which logs the errors and a few other modifications.  I saw a couple pages people were hitting often but were timing out.  I made a couple changes to the query in question, removed the two queries nested inside the cfloop, removed # signs where they weren’t needed, removed some conditionals, replaced the several font tags with CSS, et cetera.  The page loads in 1.3 seconds now.  Using CSS also reduced the size of the .xls and html files by almost half (the xls files are html output with cfheader, I need to fix that too) so the page also downloads faster when 12,000 rows are returned (no, there’s no paging, customer requirement) from about 12 megs to 7.  &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Employers/managers: If your ColdFusion apps aren't running well, don't be so quick to pass judgement on ColdFusion. Look at your hardware, SQL, bandwidth and even your developers.  If you're not a technical person, ask someone OUTSIDE of your team or higher a consultant to look at your situation.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;I think I’ve saved ColdFusion’s reputation within my organization with these simple changes.  My next hurdle is to save CF from our customers.  Hopefully the proper error trapping and gradual fixing of the system will do this.  Wish me luck!&lt;br /&gt;&lt;hr /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7046168086684362207-5298039478090241455?l=headsplodeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://headsplodeblog.blogspot.com/feeds/5298039478090241455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://headsplodeblog.blogspot.com/2010/07/dont-be-so-quick-to-blame-coldfusion.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default/5298039478090241455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default/5298039478090241455'/><link rel='alternate' type='text/html' href='http://headsplodeblog.blogspot.com/2010/07/dont-be-so-quick-to-blame-coldfusion.html' title='Don&apos;t be so quick to blame ColdFusion'/><author><name>Headsplode</name><uri>http://www.blogger.com/profile/01842576565977184028</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7046168086684362207.post-236567567659273215</id><published>2010-07-06T19:57:00.001-04:00</published><updated>2010-07-07T06:02:30.248-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><title type='text'>MySQL Union and query optimization</title><content type='html'>&lt;hr/&gt;UNION can be a pretty nice tool.  It’s a good way to query several tables with the same data with a single call to the database server.  The most common example includes adding results from archive table to your recent data.  MYSQL ships with two flavors of Union; DISTINCT and ALL (assume this is the same with Oracle and MSSQL but I don’t use them enough to know).  &lt;br /&gt;&lt;br /&gt;Basic syntax:&lt;br /&gt;(SELECT fields FROM table WHERE conditions)&lt;br /&gt;UNION [DISTINCT | ALL]&lt;br /&gt;(SELECT fields FROM table2 WHERE conditions)&lt;br /&gt;[WHERE]&lt;br /&gt;ORDER BY&lt;br /&gt;[LIMIT]&lt;br /&gt;&lt;br /&gt;UNION defaults to UNION DISTINCT implicitly.  The difference between DISTINCT and ALL is pretty self explanatory; DISTINCT prevents duplicates just like in a normal SELECT statement.  The problem with DISTINCT is that it’s very VERY costly. Both DISTINCT and ALL build a temp table to store the results; however, DISTINCT must index the results to avoid duplicates.  In addition to that, from what I’ve read, applying ORDER BY and LIMIT to the entire UNION will cause MYSQL to ignore any indexes as well.  I have the need to UNION up to eight tables.  In my test I was working with a query I know that was giving me problems; it has six tables.&lt;br /&gt;&lt;br /&gt;Table 1: ~25,000 records&lt;br /&gt;Table 2: ~8,000 records&lt;br /&gt;Table 3: ~300,000 records&lt;br /&gt;Table 4: ~200,000 records&lt;br /&gt;Table 5: ~820,000 records&lt;br /&gt;Table 6: ~125,000 records&lt;br /&gt;&lt;br /&gt;My where clause was pretty simple, just looking for all the records added by a single user.  UNION DISTINCT caused my ColdFusion page to time out after 60 seconds.  I could increase the timeout to get an accurate picture of how long it actually takes but I don’t feel like breaking anything right now (that’s what my 9-5 job is for).  At first I was afraid it was because MYSQL ignores the index when ordering and limiting unions. My first thought was I needed to have to run each query individually then do a QofQ to re-order them.  &lt;br /&gt;&lt;br /&gt;In my particular situation I'm not going to have any duplicates because the data in each query is already unique to the other tables.  In this case I can safely use UNION ALL without getting any duplicates with the added benefit of the speed UNION ALL gives me over UNION DISTINCT.  How much faster is it? Considerably.  My query went from timing out at 60 seconds to completing in 34 seconds.  That’s pretty sweet, but not great.  &lt;br /&gt;&lt;br /&gt;My needs require me to limit the end result to 500 records.  That’s fine for my end result, but what about each SELECT within the union?  Believe it or not 99% of all the records in these six tables match my WHERE condition.  That means my unions create a temp table of ~1,500,000 records of which I only need 500.  No wonder UNION DISTINCT timed out; that’s a lot of indexing.  Building such a large table when I only need a very small subset of that is just silly.  Fortunately I can limit the results from the individual selects.  Limiting each select to 500 now gives me a temp table with only 3,000 records, much better than 1.5M and growing!  Unfortunately, to be sure I get the results I expect, I also need to include the same ORDER BY clause to each select that I have at the end of the entire union.  Even with the overhead of ordering 1.5M records, the query now finishes in 21 seconds, a savings of 13 more seconds.  &lt;br /&gt;&lt;br /&gt;Most of the time the query only runs using tables 1 and 2, which are pretty small so it runs very fast.  If anyone has any other ideas on how to make the larger unions run better, please comment below!&lt;hr/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7046168086684362207-236567567659273215?l=headsplodeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://headsplodeblog.blogspot.com/feeds/236567567659273215/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://headsplodeblog.blogspot.com/2010/07/mysql-union-and-query-optimization.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default/236567567659273215'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default/236567567659273215'/><link rel='alternate' type='text/html' href='http://headsplodeblog.blogspot.com/2010/07/mysql-union-and-query-optimization.html' title='MySQL Union and query optimization'/><author><name>Headsplode</name><uri>http://www.blogger.com/profile/01842576565977184028</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7046168086684362207.post-1724215850916568708</id><published>2010-06-29T08:27:00.001-04:00</published><updated>2010-07-06T18:50:17.348-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ColdFusion'/><title type='text'>Homemade Page Timing</title><content type='html'>&lt;hr /&gt;I started a new job a few months ago and inherited a mess.  Don't believe me?  Friday I found&lt;br /&gt;&lt;pre class="brush: cf"&gt;&amp;lt;cfif isDefined("form.loginSubmit") and true&amp;gt;&lt;br /&gt;&lt;/pre&gt;in the login script.&lt;br /&gt;&lt;br /&gt;I actually found &lt;pre class="brush: cf"&gt;&amp;lt;cfsetting requestTimeOut = "240000" &amp;gt;&lt;/pre&gt;I mean seriously?  66 Hours???!&lt;br /&gt;&lt;br /&gt;Anyway, the job consists of doing some pretty heavy data analysis of millions of records and hundreds of tables/views.  Needless to say the queries don't run so hot.  Some of the pages don't even run at all.&lt;br /&gt;&lt;br /&gt;We're using CF9 enterprise; however, I don't have access to any of the logs or server monitor information so I had to make my own. This may also be helpful to anyone using CF Standard edition without server monitoring.&lt;br /&gt;&lt;br /&gt;onRequest to the rescue!  And in true CF fashion, it's pretty simple to do.  &lt;br /&gt;&lt;br /&gt;The initial requirement was to track what reports were being used and how often.  That's easy enough.  While I was doing that, I wondered if it would be possible to time how long the page takes to run. With several reports timing out it would be good to know these things.  I had never tried doing any processing after including the targetPage, but I didn't see any reason why it wouldn't work.&lt;br /&gt;&lt;pre class="brush:cf"&gt;&amp;lt;cfset startTimer = getTickCount()&amp;gt;&lt;br /&gt;&amp;lt;cfinclude template = "#arguments.targetPage#"&amp;gt;&lt;br /&gt;&amp;lt;cfset timeSpent = getTickCount() - variables.startTimer&amp;gt;&lt;br /&gt;&lt;!--- &lt;br /&gt;do whatever you want here.&lt;br /&gt;Log times, or send email if processing is to long, whatever. You may want to white list the files that get logged.  I was able to avoid logging files with 'menu' in the filename and a list of others.&lt;br /&gt;---&gt;&lt;br /&gt;&lt;/pre&gt;After getting the timeSpent I saved the user, date, file name, and timeSpent to a new table.  This afforded me the opportunity to get some analysis on our analysis.  How ironic. I was able to create two quick views.  The first is simply the data I saved highlighting the longer running reports by color.  The other was the fastest, average, and slowest processing times and a hit count of the report.&lt;br /&gt;&lt;br /&gt;Not to my surprise I found several pages that take 7+ minutes to process... I have my work cut out for me...&lt;br /&gt;&lt;hr /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7046168086684362207-1724215850916568708?l=headsplodeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://headsplodeblog.blogspot.com/feeds/1724215850916568708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://headsplodeblog.blogspot.com/2010/06/homemade-process-time-monitoring.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default/1724215850916568708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default/1724215850916568708'/><link rel='alternate' type='text/html' href='http://headsplodeblog.blogspot.com/2010/06/homemade-process-time-monitoring.html' title='Homemade Page Timing'/><author><name>Headsplode</name><uri>http://www.blogger.com/profile/01842576565977184028</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7046168086684362207.post-398761040498262280</id><published>2010-06-28T12:43:00.001-04:00</published><updated>2010-06-28T12:48:26.163-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Apple v. Flash'/><title type='text'>You're such a dork!</title><content type='html'>&lt;hr /&gt;...is what my wife said to me Saturday at Best Buy.&lt;br /&gt;She might be right, but what else was I supposed to do?  I felt it was my duty to educate the general public and entertain myself in a childish yet strangely satisfying way --  I kind of felt like &lt;a href = "http://www.imdb.com/title/tt0113243/"&gt;Cereal Killer&lt;/a&gt; being generally mischievious (only not as cool). &lt;br /&gt;&lt;br /&gt;The guy at the Apple table wasn’t looking so I made all the iPads look like:&lt;br /&gt;&lt;br /&gt;&lt;img src = "http://headsplode.com/noflashforjoo.jpg"&gt;&lt;br /&gt;&lt;br /&gt;and continued my shopping.  I glanced over at the display on my way out and the screen was still up on all 4. It’s a shame I couldn’t set the homepage.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7046168086684362207-398761040498262280?l=headsplodeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://headsplodeblog.blogspot.com/feeds/398761040498262280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://headsplodeblog.blogspot.com/2010/06/youre-such-dork.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default/398761040498262280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default/398761040498262280'/><link rel='alternate' type='text/html' href='http://headsplodeblog.blogspot.com/2010/06/youre-such-dork.html' title='You&apos;re such a dork!'/><author><name>Headsplode</name><uri>http://www.blogger.com/profile/01842576565977184028</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7046168086684362207.post-3080249456516536954</id><published>2010-06-15T22:59:00.000-04:00</published><updated>2010-06-15T22:59:04.073-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ColdFusion'/><title type='text'>OnRequest required to access page variables scope in onError.</title><content type='html'>&lt;hr /&gt;&lt;br /&gt;I was playing around with onError the other day getting ready to upgrade some legacy code I just inherited. Because I was only concerned with onError I didn't bother to add onRequest during my testing.  This is the first time I've never had onRequest in my application.cfc so I didn't realize there was such a dependence between onError and onRequest until then.  Ben Nadel &lt;a href="http://www.bennadel.com/blog/853-Application-cfc-OnRequest-Method-Affects-OnError-Arguments.htm"&gt;blogged about the same thing&lt;/a&gt; quite a while ago when he was missing the root cause structure after deleting the onRequest method.&lt;br /&gt;&lt;br /&gt;I hadn't gotten to dumping the actual error contents yet, I was more concerned with the variables scope... which was void of the data I was expecting it to contain.  I knew right away what the problem was and it makes total sense, but having never experienced it before, gave me one of those "no shit, Sherlock" moments.&lt;br /&gt;&lt;br /&gt;The problem is that without &amp;lt;cfinclude template = "#arguments.targetPage#"&amp;gt; the page's variable scope is OUTSIDE of application.cfc so dumping #variables# only gives you the variables you set in your application.cfc.  The cfinclude effectively brings the page processing into the cfc giving onError access to those variables.&lt;br /&gt;&lt;br /&gt;If you're one of those people still using cferror, having direct access to the variable scope is worth the change by itself. &lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7046168086684362207-3080249456516536954?l=headsplodeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://headsplodeblog.blogspot.com/feeds/3080249456516536954/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://headsplodeblog.blogspot.com/2010/06/onrequest-required-to-access-page.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default/3080249456516536954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default/3080249456516536954'/><link rel='alternate' type='text/html' href='http://headsplodeblog.blogspot.com/2010/06/onrequest-required-to-access-page.html' title='OnRequest required to access page variables scope in onError.'/><author><name>Headsplode</name><uri>http://www.blogger.com/profile/01842576565977184028</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7046168086684362207.post-3227786209406135653</id><published>2010-06-13T03:04:00.031-04:00</published><updated>2010-06-13T07:24:08.967-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ColdFusion'/><title type='text'>ColdFusion likes lazy programmers</title><content type='html'>&lt;hr /&gt;&lt;br /&gt;I don’t usually like to alias my code.  Even when I write SQL I like to use the full field name, schema.table.column.  I only use aliases when I’m in a sub query and need to reference the main query; then it’s required.  I do the same thing in ColdFusion, I don't usually assign deep variables to a reference (no I don't really think it's lazy, just my preference).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Recently I was working with xml documents uploaded by users.  For some reason my looping through my collection was timing out.  My test document has 12,804 child elements from the root. At first I thought it was the processing I was doing within the loop.  I kept removing sections of code trying to find out where the problem was.  Finally I was left with a single cfoutput of a single element and my code was still timing out.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I’m not sure why I decided to try, because it isn't something I would normally do, but I assigned the parsedXML to a reference. To my surprise this solved my timeout problem.  It solved it so well... my head exploded.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is a simple test to show the contrast.  &lt;br /&gt;The first loop uses the full variable syntax:&lt;br /&gt;variables.parsedXML.XMLrootElement.XMLChildElement[variables.i].id.xmlText&lt;br /&gt;The second loop uses the reference:&lt;br /&gt;variables.XMLByRef[variables.i].id.xmlText&lt;pre class="brush: cf"&gt;&amp;lt;cfsetting requesttimeout="960" /&amp;gt; &lt;!--- i got to this number by trial and error... ---&gt;&lt;br /&gt;&amp;lt;cfset variables.parsedXMLLen = arrayLen(variables.parsedXML.XMLrootElement.XMLChildElement) &amp;gt; &lt;!--- how many elements in this document (12,804) ---&gt;&lt;br /&gt;&amp;lt;cfset variables.startXMLLongLoop = getTickCount() &amp;gt; &lt;!--- start timing the output ---&gt;&lt;br /&gt;&lt;cfloop from = "1" to = "#variables.parsedXMLLen#" index = "variables.i"&gt;&lt;br /&gt;&lt;cfoutput&gt;#variables.parsedXML.XMLrootElement.XMLChildElement[variables.i].id.xmlText#&lt;/cfoutput&gt;&lt;br /&gt;&lt;!--- output a single element of the XML ---&gt;&lt;br /&gt;&lt;/cfloop&gt;&lt;br /&gt;&amp;lt;cfset variables.stopXMLLongLoop = getTickCount() &amp;gt;&lt;!--- end timing the outputs ---&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&amp;lt;cfset variables.XMLByRef = variables.parsedXML.XMLrootElement.XMLChildElement &amp;gt; &lt;!--- create a reference to the child element ---&gt;&lt;br /&gt;&amp;lt;cfset variables.startXMLShortLoop = getTickCount() &amp;gt;&lt;!--- start timing the output ---&gt;&lt;br /&gt;&lt;cfloop from = "1" to = "#variables.parsedXMLLen#" index = "variables.i"&gt;&lt;br /&gt;&lt;cfoutput&gt;#variables.XMLByRef[variables.i].id.xmlText#&lt;/cfoutput&gt;&lt;br /&gt;&lt;/cfloop&gt;&lt;br /&gt;&amp;lt;cfset variables.stopXMLShortLoop = getTickCount() &amp;gt;&lt;!--- stop timing the output ---&gt;&lt;br /&gt;&lt;cfoutput&gt;&lt;br /&gt;Fully qualified: #variables.stopXMLLongLoop-variables.startXMLLongLoop# miliseconds to loop #variables.parsedXMLLen# times&lt;br /&gt;Referenced: #variables.stopXMLShortLoop-variables.startXMLShortLoop# miliseconds to loop #variables.parsedXMLLen# times &lt;br /&gt;&lt;/cfoutput&gt;&lt;br /&gt;&lt;/pre&gt;&lt;blockquote&gt;The result:&lt;br /&gt;Fully qualified: &lt;strong&gt;537765&lt;/strong&gt; miliseconds to loop 12804 times&lt;br /&gt;Referenced: &lt;strong&gt;250&lt;/strong&gt; miliseconds to loop 12804 times &lt;br /&gt;&lt;/blockquote&gt;The first loop using #variables.parsedXML.XMLrootElement.XMLChildElement[variables.i].id.xmlText# took almost &lt;strong&gt;9 minutes&lt;/strong&gt; to run!! &lt;br /&gt;The second loop using #variables.XMLByRef[variables.i].id.xmlText# only took a quarter second??!! WTF just happened here? Anyone know why using a reference variable is faster than using the fully qualified variable?&lt;br /&gt;&lt;br /&gt;Thanks!&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7046168086684362207-3227786209406135653?l=headsplodeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://headsplodeblog.blogspot.com/feeds/3227786209406135653/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://headsplodeblog.blogspot.com/2010/06/coldfusion-likes-lazy-programmers.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default/3227786209406135653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default/3227786209406135653'/><link rel='alternate' type='text/html' href='http://headsplodeblog.blogspot.com/2010/06/coldfusion-likes-lazy-programmers.html' title='ColdFusion likes lazy programmers'/><author><name>Headsplode</name><uri>http://www.blogger.com/profile/01842576565977184028</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7046168086684362207.post-7520350273712508774</id><published>2010-06-09T20:35:00.002-04:00</published><updated>2010-06-10T06:29:34.123-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ColdFusion'/><title type='text'>ColdFusion and ORA-01000: Too many open cursors</title><content type='html'>&lt;hr /&gt;&lt;br /&gt;Today one of our sites started throwing an "ORA-01000: Too many open cursors" error.  I have exactly 0 control over our server environment nor do I have access to the ColdFusion administrator.  I have even less influence on our Oracle environment.  We noticed the problem just before our daily scrum meeting so if nothing else, it got me out of that.  Of course the first thing our sys admin did was contact our Oracle DBAs to see if they were having any problems (let the finger pointing begin, well actually I started it).  They verified our data source connections and sent me a copy of the log files, which I already know weren't going to help much.  &lt;br /&gt;&lt;br /&gt;In my research, one of the Google results I came across made me chuckle.  It was a Macromedia (now Archived Adobe) TechNote blaming the problem on Oracle.  It said to change the OPEN_CURSORS and CLOSE_CACHED_OPEN_CURSORS settings. &lt;br /&gt;&lt;br /&gt;It would appear that the Max Pooled Statements setting was increased in CF9, which we just upgraded too. If ColdFusion tries to keep more cursors open than Oracle will allow this error will occur.  ColdFusion does this with queries using cfqueryParam and cfstoredproc to improve performance.&lt;br /&gt;&lt;br /&gt;From Livedocs:&lt;br /&gt;&lt;blockquote&gt;Max Pooled Statements enables reuse of prepared statements (that is, stored procedures and queries that use the cfqueryparam tag). Although you tune this setting based on your application, start by setting it to the sum of the following:&lt;br /&gt;Unique cfquery tags that use the cfqueryparam tag&lt;br /&gt;Unique cfstoredproc tags&lt;/blockquote&gt;&lt;br /&gt;Don't mistake Max Pooled Statements for the Maximum number of cached Queries under Server Settings &gt; Caching, they're not the same.  Max Pooled Statements can be found in the advanced settings of the data source (but I think only for SQL Server and the native Oracle driver).  &lt;br /&gt;&lt;br /&gt;The problem is, for some reason our data source was setup to connect using ODBC rather than the native Oracle drivers that come with ColdFusion Enterprise.  There IS NO Max Pooled Statements setting for ODBC connections under advanced settings.  Does that mean there's a similar setting in the background somewhere for miscellaneous databases?  Was this setting increased in CF9?  I don't know.  I looked but can't find anything.  &lt;br /&gt;&lt;br /&gt;We finally got the problem solved by recreating the data source using the Oracle drivers and lowering the Max Pooled Statements setting to 100.  This is probably low, but the site doesnt get that much traffic and it's below the OPEN_CURSORS setting.&lt;br /&gt;&lt;br /&gt;If any of you smart types know why we experienced this problem with and ODBC connection, please comment!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7046168086684362207-7520350273712508774?l=headsplodeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://headsplodeblog.blogspot.com/feeds/7520350273712508774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://headsplodeblog.blogspot.com/2010/06/coldfusion-and-ora-01000-too-many-open.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default/7520350273712508774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default/7520350273712508774'/><link rel='alternate' type='text/html' href='http://headsplodeblog.blogspot.com/2010/06/coldfusion-and-ora-01000-too-many-open.html' title='ColdFusion and ORA-01000: Too many open cursors'/><author><name>Headsplode</name><uri>http://www.blogger.com/profile/01842576565977184028</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7046168086684362207.post-1516541231224309617</id><published>2010-06-08T08:12:00.004-04:00</published><updated>2010-06-08T08:42:01.288-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ColdFusion'/><title type='text'>CFDOCUMENT top margin cuts into the first line</title><content type='html'>&lt;hr /&gt;&lt;br /&gt;I posted this a while ago on StackOverflow.com but considering I answered it myself and my blog needs content, I' posting it here too.&lt;br /&gt;&lt;br /&gt;We produce a lot of PDF output for our customers.  On some of the pages, the top line was getting cut off often times making it unreadable.  There's an example of this &lt;a href="http://paradigmshiftls.com/pdftest.cfm"&gt;here&lt;/a&gt;. I know there was a bug in 7, but that was said to be fixed in 8 and we were using 8,0,1,195765.&lt;br /&gt;&lt;br /&gt;After some testing I found that it only happens within table cells.  The problem is, we're outputting tabular data.  I tried using divs to creat the table using CSS&lt;pre class="brush: css"&gt;display:table-cell; display:table-row;&lt;/pre&gt;But that didn't work either.&lt;br /&gt;&lt;br /&gt;A little more poking around and I found that wrapping &amp;lt;div&amp;gt; around the data inside the &amp;lt;td&amp;gt; tags solved the problem.&lt;br /&gt;&lt;pre class="brush: xml"&gt;&amp;lt;td&amp;gt;&amp;lt;div&amp;gt;#dateFormat(now(), "mm/dd/yyyy")#&amp;lt;/div&amp;gt;&amp;lt;/td&amp;gt;&lt;/pre&gt;&lt;br /&gt;The one time this didn't work was because of nested table tags (which shouldn't have happened anyway). After fixing the nested tables it worked like a charm.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7046168086684362207-1516541231224309617?l=headsplodeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://headsplodeblog.blogspot.com/feeds/1516541231224309617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://headsplodeblog.blogspot.com/2010/06/cfdocument-top-margin-cuts-into-first.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default/1516541231224309617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default/1516541231224309617'/><link rel='alternate' type='text/html' href='http://headsplodeblog.blogspot.com/2010/06/cfdocument-top-margin-cuts-into-first.html' title='CFDOCUMENT top margin cuts into the first line'/><author><name>Headsplode</name><uri>http://www.blogger.com/profile/01842576565977184028</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7046168086684362207.post-4738445597694732960</id><published>2010-06-07T21:21:00.009-04:00</published><updated>2010-06-08T08:20:58.676-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>No empty strings in Oracle</title><content type='html'>&lt;hr /&gt;&lt;br /&gt;This was pretty easy to find, but considering how unexpected it is, I feel it's worth a mention.&lt;br /&gt;&lt;br /&gt;There are no empty strings in Oracle's SQL or PL/SQL.&lt;br /&gt;&lt;br /&gt;Consider -&lt;br /&gt;&lt;pre class="brush: sql"&gt;myVar VARCHAR2(10) := '';&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The following will never execute.&lt;br /&gt;&lt;pre class="brush: sql"&gt;IF myVar = '' THEN&lt;br /&gt;-- do something&lt;br /&gt;END IF;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;myVar must be compared to NULL for the block to work.&lt;br /&gt;&lt;pre class="brush: sql"&gt;IF myVar IS NULL&lt;br /&gt;-- do something&lt;br /&gt;END IF;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Likewise&lt;pre class="brush: sql"&gt;SELECT someField&lt;br /&gt;FROM   someTable&lt;br /&gt;WHERE  someField = '';&lt;br /&gt;&lt;/pre&gt;Will always return 0 rows.&lt;br /&gt;&lt;br /&gt;&lt;hr&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7046168086684362207-4738445597694732960?l=headsplodeblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://headsplodeblog.blogspot.com/feeds/4738445597694732960/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://headsplodeblog.blogspot.com/2010/06/no-empty-strings-in-oracle.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default/4738445597694732960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7046168086684362207/posts/default/4738445597694732960'/><link rel='alternate' type='text/html' href='http://headsplodeblog.blogspot.com/2010/06/no-empty-strings-in-oracle.html' title='No empty strings in Oracle'/><author><name>Headsplode</name><uri>http://www.blogger.com/profile/01842576565977184028</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
