Community Member Profile
- Profile: /members/2408-John-Whish.htm
- URL: http://www.aliaspooryorik.com/blog/
- Comments: 38
- Points: 170
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... 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#</... 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 trai... 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: /** * @outpu... 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 ent... 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: read more »
-
Learning ColdFusion 9: CFScript Updates For ColdFusion Components
Posted on Jul 23, 2009 at 4:03 PM
Great post Ben. I'm a fan of the JavaDoc style syntax, but I also agree that comments shouldn't change code. I'm using a hybrid approach for my functions to get rid of the "noise" attributes. Also I've found that ColdFusion assumes that any text without an @xyz qualifier is a hint so my code look... read more »
-
Learning ColdFusion 9: CFImport / New Operator Works With Tags As Well
Posted on Jul 16, 2009 at 4:04 AM
Nice post Ben. I also think that the new and import operators are good for ColdFusion generally as it will make it easier for developers from other languages to "see the light" and try out ColdFusion.... 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 hon... 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 »



