John Whish
Member since Dec 11, 2008
- Profile: /members/2408-john-whish.htm
- URL: http://www.aliaspooryorik.com/blog/
- Comments: 38
Recent Blog Comments By John Whish
-
Ask Ben: Displaying A Blog Teaser (Showing The First N Words)
Posted on Sep 24, 2009 at 3:47 AM
@Jon, good question - I don't know! Sorry :)... read more »
-
Ask Ben: Displaying A Blog Teaser (Showing The First N Words)
Posted on Sep 23, 2009 at 12:43 PM
@Jon, I'm not sure you'd actually see any real performance gain by using a StringBuffer for 50 words, as you have the overhead of instantiating the Java object first. Definitely worthwhile for longer strings.... read more »
-
Ask Ben: Displaying A Blog Teaser (Showing The First N Words)
Posted on Sep 23, 2009 at 11:45 AM
@Ben, I thought it would be fun to try :) Java arrays and CF arrays aren't the same which makes it harder than it should be. You can also use the copyOfRange method to get something like the first 10 and last 10 words of an article like this: <cfset javaArray = CreateObject( "java","java.util.Ar... read more »
-
Ask Ben: Displaying A Blog Teaser (Showing The First N Words)
Posted on Sep 23, 2009 at 11:08 AM
Just for fun you could do this... <cfset javaArray = CreateObject( "java","java.util.Arrays" ) /> <cfset wordArray = javaArray.copyOf( blogContent.Split( " " ), 50 ) /> <cfset blogSnippet = ArrayToList( wordArray, " " ) /> <p>#blogSnippet#</p>... read more »
-
Ask Ben: Displaying A Blog Teaser (Showing The First N Words)
Posted on Sep 23, 2009 at 10:46 AM
@Tony, that would only return the first 50 characters, not words.... read more »
-
Learning ColdFusion 9: Trying To Understand ORM Event Handling
Posted on Aug 24, 2009 at 12:10 PM
@Ben, haha - well, I guess I had to get something right eventually! :)... read more »
-
Learning ColdFusion 9: Trying To Understand ORM Event Handling
Posted on Aug 24, 2009 at 11:59 AM
@Ben, Another great post! I'll have a guess that the update events are not fired until they are actually updated at the end of the request. You could try forcing it by adding an ORMFlush() after the entity save and before the cfdump. @Rick, you can use this for logging to a file (audit trail) or fo... read more »
-
Learning ColdFusion 9: ORM Inheritance Mapping
Posted on Aug 21, 2009 at 10:51 AM
Hi Ben, I log the SQL to a file. I can send you my config if you want?... read more »
-
Learning ColdFusion 9: ORM Inheritance Mapping
Posted on Aug 21, 2009 at 10:40 AM
Nice article Ben! Rupesh Kumar posted a great article on how to set up logging: http://coldfused.blogspot.com/2009/07/coldfusion-orm-how-to-log-sql.html... read more »
-
Learning ColdFusion 9: EntityNew() vs. The NEW Operator / CreateObject()
Posted on Aug 21, 2009 at 3:56 AM
@Ben, @Rupesh In that case I apologise for posting incorrect information. I was under the impression that hibernate was being used. Sorry guys!... read more »
-
Learning ColdFusion 9: EntityNew() vs. The NEW Operator / CreateObject()
Posted on Aug 20, 2009 at 10:58 AM
@Rob, I've played around with the hibernate inheritance and find that it works really well. The method I prefer is the one-table-per-entity and the discriminator column. For example for a user superclass, with a manager subclass my code would be something like this: /** * @output false * @hint I ... read more »
-
Learning ColdFusion 9: EntityNew() vs. The NEW Operator / CreateObject()
Posted on Aug 20, 2009 at 10:50 AM
I think I'm right in saying that EntityNew uses Hibernate directly to create the entity, so it has Java performance. Whereas using new has the performance impact of ColdFusion creating the object. I like using the two methods so that I can see in my code if I'm working with a persisted entity of a... read more »
-
Learning ColdFusion 9: When Does An ORM-Enabled Object Get Persisted
Posted on Aug 3, 2009 at 12:19 PM
Hi Ben, that is a great point that Bob raised about letting an entity validate itself. I had a look into and my response was too long to add here so I posted it here: http://www.aliaspooryorik.com/blog/index.cfm/e/posts.details/post/cf9-orm-clearing-the-session-cache-227... read more »
-
The New BenNadel.com - Same Content, Fresh New Look
Posted on May 11, 2009 at 4:46 AM
Nice work Ben - Glad to see the "ads" survived :)... read more »
-
My 1,000th ColdFusion Post - What It Means To Me (And Free Prizes)
Posted on Jan 23, 2009 at 12:55 PM
Congratulations and Thank You Ben for all your posts! I started out with ColdFusion because when I was walking down the road in my lunch break I saw an ad in a window for a web developer and it was a CF shop. Since then I've built applications in ASP, .Net & PHP and can honestly say that ColdFusio... read more »
-
Ask Ben: Dynamic Table Names In ColdFusion Queries
Posted on Nov 13, 2008 at 11:01 AM
@Ben - it's certainly easier to read! I really hope CF9 supports a cfscript version cfqueryparam something like: WHERE is_deleted = #QueryParam(myvar, 'cf_sql_bit')# which is much nicer than: WHERE is_deleted = <cfqueryparam value="1" cfsqltype="cf_sql_bit" />... read more »
-
Ask Ben: Dynamic Table Names In ColdFusion Queries
Posted on Nov 13, 2008 at 10:38 AM
Oops type above should read: "You shouldn't really be using parameters for 'constant' values in SQL as it affects the database's execution plan (this includes fixed value in your where clause). So the plain text approach is the way to go. :)" Sorry!... read more »
-
Ask Ben: Dynamic Table Names In ColdFusion Queries
Posted on Nov 13, 2008 at 10:38 AM
You should really be using parameters for 'constant' values in SQL as it affects the database's execution plan (this includes fixed value in your where clause). So the plain text approach is the way to go. :)... read more »
-
Hal Helms On Object Oriented Programming - Day One
Posted on Oct 21, 2008 at 8:55 AM
Thanks for giving us a summary of your day. Interesting reading. Totally agree with your last para "how bad it is to program before you understand the use cases." It can be a fatal mistake, we're all code junkies and just want to code, but it really is worth taking some time out first :)... read more »
-
Heading To An Object Oriented Programming Seminar
Posted on Oct 20, 2008 at 4:41 AM
@Ben, looking forward to hearing more about your course, hope it goes well. I think you've got it spot on with "I miss learning from the questions that others ask that I didn't even think about".... read more »