Community Member Profile
- Profile: /members/278-Dan-G-Switzer-II.htm
- URL: http://blog.pengoworks.com/
- Comments: 160
- Points: 943
Recent Blog Comments By Dan G. Switzer, II
-
Disabling Auto-Correct And Auto-Capitalize Features On iPhone Inputs
Posted on Jan 5, 2012 at 11:29 AM
I was curious if the autocorrect would also disable keyboard shortcuts in iOS5 and it does *not*. This is nice because I've set up a shortcut of @@ to insert my e-mail address. This means user defined shortcuts still work, it only affects spelling corrections. Now if I could jus... read more »
-
Extending JavaScript Arrays While Keeping Native Bracket-Notation Functionality
Posted on Dec 1, 2011 at 3:04 PM
@Ben: If you were actually trying to do something like this for real code, I wouldn't bother defining things in the Collection.prototype--I'd just immediately extend the Array object you create in the Collection() constructor. Since you're not actually returning an instance of the Col... read more »
-
Storing And Retrieving Global Dates And Times In The Database
Posted on Sep 27, 2011 at 3:12 PM
@Ben: The getOffset() returns the total number of milliseconds a current time stamp is away from UTC. So for the time stamp of "2011-09-26 09:00:00" (which we convert to Epoch) it will use the Java lookup tables to determine whether the current time is in DST, then add that... read more »
-
Storing And Retrieving Global Dates And Times In The Database
Posted on Sep 27, 2011 at 10:52 AM
@Ben: Strange, because I'm the exact opposite. :) I'll break it down for you, so hopefully the code will be more clear. 1) Set a date in the user's local time. today = createDateTime(2011, 9, 26, 9, 0, 0); 2) Get a reference to the... read more »
-
Storing And Retrieving Global Dates And Times In The Database
Posted on Sep 26, 2011 at 12:45 PM
@Ben: Why are you jumping through so many hoops to convert a date from a user's local time into UTC? Here's all you need: today = createDateTime(2011, 9, 26, 9, 0, 0); TimeZone = createObject("java","java.util.TimeZone").getTime... read more »
-
Working With Time Zones And Daylight Savings Time (DST) In ColdFusion And Java
Posted on Sep 22, 2011 at 2:38 PM
I forgot to mention, that was for reports--so if you generate a report that dumped out that last 10,000 tickets, there could have been many date/time fields on each row and each row might have been for a different timezone.... read more »
-
Working With Time Zones And Daylight Savings Time (DST) In ColdFusion And Java
Posted on Sep 22, 2011 at 2:36 PM
@Ben: If you want really ugly, the help desk application that I work in used to have the ability to show times in the customer times. This was all done via a very elaborate SQL query. I ended up killing that feature because it was so slow and really not all that helpful (since people... read more »
-
Working With Time Zones And Daylight Savings Time (DST) In ColdFusion And Java
Posted on Sep 22, 2011 at 12:00 PM
Also, the benefit of storing times in UTC/GMT is that you never have to worry about correcting date/times in your database. For example, if you're storing an offset for your servers timezone and then using that offset for calculations, what happens if you ever need to change the timezone on... read more »
-
Working With Time Zones And Daylight Savings Time (DST) In ColdFusion And Java
Posted on Sep 22, 2011 at 11:55 AM
I always set up servers to run in the GMT timezone and then within my code always store dates in GMT/UTC. This does mean that you need to: 1. Convert all date/times a user inputs in your site into GMT/UTC. 2. Convert all date/times displaying to a user in their correct timezone... read more »
-
Experimenting With A Stateful Class For Stateful User Interface (UI) Widgets
Posted on Aug 24, 2011 at 12:24 PM
@Ben: I do think this makes the creation of the states more manageable and easier to digest. However, there's a few things I'd change: 1) I think I'd change my possible state events to: setup: Your current init() handler begin: Your current setup() handler end: Your cu... read more »
-
Treating Complex User Interface (UI) Widgets Like Finite State Machines
Posted on Aug 24, 2011 at 11:52 AM
@Ben: My comment about memory leaks in jQuery, is more that they're sort of out of your control. What I mean by that is what happens if a memory leak is reintroduced down the road? While that is playing the "what if" game a bit, regression bugs have occurred in the jQuery so... read more »
-
Performance Of LEFT OUTER JOIN Insert vs. INNER JOIN Delete Statement
Posted on Aug 19, 2011 at 11:04 AM
@Ben: I will warn you that your results may vary based on the size of the data. While what you're doing is faster over 10,000 rows, it may indeed be slower when doing it over 10,000,000 rows. That's the one thing that's always difficult about performance testing on small datasets, wha... read more »
-
Treating Complex User Interface (UI) Widgets Like Finite State Machines
Posted on Aug 18, 2011 at 2:34 PM
@Ben: FYI - In my example, the set() method would take an array of arguments as the second parameter. I did this because it makes it very easy to then just use the apply() method, instead of having to slice the arguments array.... read more »
-
Treating Complex User Interface (UI) Widgets Like Finite State Machines
Posted on Aug 18, 2011 at 2:31 PM
@Ben: First, I wanted to comment on your statement "Also, I wouldn't want to talk about memory leaks unless that is a known issue." The issue I have with that, is memory leaks in 3rd party code can appear and those are the hardest things to track down. Event unbinding seems to be... read more »
-
Treating Complex User Interface (UI) Widgets Like Finite State Machines
Posted on Aug 18, 2011 at 12:49 PM
@Ben: It seems like extreme overkill (and potentially a way to add memory leaks) to constantly setup/teardown the event handlers. There's really no value in unregistered the delegated events and you're potentially introducing memory leaks (if the jQuery undelegate method isn't fully c... read more »
-
jQuery Plugin: triggerHandlers() - To Trigger Handlers On All Selected Elements
Posted on Aug 2, 2011 at 3:01 PM
@Ben/Dave: I've spent the better part of fixing and QA'ing changes to our application due to changes between jQuery v1.3.2 and v1.6.2. Part of what I had to fix was code that relied on undocumented jQuery functions--which is why I choose to use the triggerHandler() in my method. It's... read more »
-
jQuery Plugin: triggerHandlers() - To Trigger Handlers On All Selected Elements
Posted on Aug 2, 2011 at 1:58 PM
@Ben: For comparisons sake, here's what I ended up implementing yesterday: // works like triggerHandler, but runs on all selected elements $.fn.triggerHandlerAll = function (){ var self = this, args = arguments; return self.each(function (i){ var $el = self.eq(i... read more »
-
Using MySQL's TO_DAYS() Function To Group Same-Day Events
Posted on Jul 12, 2011 at 2:55 PM
@Roland: Actually, for what Ben's really trying to do (just convert the date/time object to a date) in SQL Server you could just do: convert(char(10), getutcdate(), 120) Which would convert the date/time object to the string "yyyy-mm-dd". This will allow you to s... read more »
-
CFAbort And OnRequestEnd() Behavior In ColdFusion 8 And ColdFusion 9
Posted on Jun 29, 2011 at 3:27 PM
They could also resolve the issue by adding a second argument to the onRequestEnd method which indicates whether or not the request was ended abruptly--like via CFABORT. That way you could easily add logic to your onRequestEnd() method if you wanted alternative logic for requests that didn'... read more »
-
ColdFusion Queries Do Not Throw Out-Of-Bounds Errors
Posted on Jun 22, 2011 at 1:06 PM
I know referencing an out-of-bounds item *used* to throw an error. Since I was bitten by the issue in the past, I just assumed this continued to be the case--so I'm surprised to see the behavior has changed. However, I wonder what the ramifications might be from doing this. I wonder if it's... read more »



