Blog

Blog Archives - 54 Record(s)

Remove Filter Year: '2010'

Upgrading RAM on a MacBook Pro Unibody

Posted by Luis Majano
Jul 15, 2010 14:51:39 UTC

With my friend Josh Highland we decided to upgrade my MacBook Pro Unibody style with 8 GB of sweet sweet RAM.  Of course, geeks that we are, we video taped the whole journey!

pre-CFUnited ColdBox Training in 16 days

Posted by Luis Majano
Jul 09, 2010 08:41:11 UTC
Just a reminder that our registration for our ColdBox training closes in a few days and you don't want to miss out. So here is a super duper discount code: superweek. Take advantage and register now, we will be covering the up and coming 3.0.0 release and some great goodies.

New ColdBox eBook prices!

Posted by Luis Majano
Jul 07, 2010 10:08:28 UTC

Just a quick announcement that we have slashed the prices for the ColdBox eBooks and you can now purchase them for only $29.99.  The new eBook also is an enhanced PDF that is more portable and printable.  We are also working hard on the iPad/iBooks version, so stay tuned!

MockBox at the Inland Empire User Group

Posted by Luis Majano
Jun 23, 2010 15:11:34 UTC

Just a reminder that this Thursday I will be presenting about MockBox and Unit Testing at the inland empire user group.  You can read all about it here: http://iecfug.com/post.cfm/iecfug-meeting-moved-to-june-24th

 

We will have lots of raffles and software goodies!! See you there.

Why use a framework?

Posted by Luis Majano
Jun 16, 2010 11:27:30 UTC

Catchy title huh?? Well, I was doing some digging around today and found some fantastic things I would like to share and open for discussion.

Why are frameworks like ColdBox, Model-Glue, Mach-II, etc, important? In all reality, they are extremely important, because if they did not exist we would end up rewriting them in some shape or form.  Software is all about reusability and adapting to change.  Nowadays it is also about adapting faster and faster.  How many developers working on tight deadlines have the time to ponder and think about all the “magical” ways they can make their components be reused in the future? Or how to really build that SES engine better than anything out there.  These are great things to have, but they don’t happen often in reality.  We are tasked and need to get things going fast and deliver our business.  I like this quote:

And let's face it, business requirements change so quickly that by the time someone else comes along to reuse your stuff, it probably needs to be re-written anyway. By Elastic Path

I can honestly say that every project I worked before using a framework started very simple and with simple architecture.  Then as requirements change and grow, more features are needed, and I get cornered into some areas of resolution:

1. I can rewrite what I have in a “get it DONE” fashion just in time for a release.  This could result in buggy or hard to test code.  I still have not really adapted but just expanded.

2. Download that super duper library I found and just squish into my simple architecture.  Again, I am introducing things that are hard to test and could result also in new bugs of introducing a library into my environment.  I have not really adapted myself to change, again, just expanded.

3. I can begin to modularize what I have, apply OO analysis and design and create a pseudo-framework that can accept new components more easily without breaking what I already have and expand it.  Ok, now I start to adapt, but at what costs?

I might like number 3 but I end up creating a framework of my own or home grown frameworks tested in one environment only, by a small subset of applications and only being able to adapt to a small arena of evolution.  This is where proven libraries and frameworks come into play.  There is a wealth of value in these libraries as they are used world-wide, different loads, different requirements and their number one priority is how to adapt to change and make our development more efficient.  Now, I won’t go into how one is better than the other, etc.  Each framework delivers their own feature sets, implementations, etc, but that does not REMOVE the benefits of reusing these libraries.

I am a big proponent of reuse and open source (couldn’t you tell), and I truly believe in avoiding building anything from scratch if I can.  I know there are cases when things that I need do not exist or are not built yet, and then I would consider building them.  If not, reusing libraries such as ColdBox, just empower me to deliver my business needs faster, gives me a great platform to develop on, I can get help around the world, I can extend its functionality to adapt for change, and so much more.

I strongly believe in community reuse and collaboration, why reinvent the wheel so many times for so many projects just because I don’t want to use something that somebody else wrote, or because I think frameworks are just too complex to work with.  This is not a good business decision that could potentially bite you in the future.  Writing open source frameworks and libraries is hard work and it takes immense number of hours on research, testability, adaptability, modularity, reusability, etc.  The work of framework authors is something to be valued upon and certain trust on them has to be developed.  I truly admire my colleagues like Dan Wilson, Mark Mandel, Matt Woodward, Peter Ferrell, Sean Corfield, etc.  I know their devotion to helping our community and at the end of the day make our community business needs better.  Relying on open source professional frameworks is something engrained in so many communities like python, java, ruby, etc.  The benefits really outweigh the cons.

In conclusion, this commentary arises out of certain discussions of late with some developers on why the need of reusable frameworks.  I hope this can give insight into why use a framework or open source library.  Again, I welcome your thoughts and opinions.

ColdBox Training at CFUnited

Posted by Luis Majano
Jun 14, 2010 09:33:35 UTC
Just a reminder that I will be teaching a 2 day ColdBox training event 2 days before CFUnited.  The registration is wide open and there are evensome cool discounts flying around (code:superweek).  For more information about this cool training event, check out the event page: http://coldbox.eventbrite.com/

New Ortus Solutions Website

Posted by Luis Majano
May 21, 2010 10:13:20 UTC

I just wanted to point out that we have released a new corporate website: http://ortussolutions.com which is now filled with lots of goodies, news and some upcoming products.

Need an eclipse ftp synchronizer, help!

Posted by Luis Majano
May 21, 2010 10:11:22 UTC

I just wanted to open a topic of discussion to see what are your recommendations for an FTP synchronization plugin for Eclipse.  I know Aptana has one and CFBuilder also, which is pretty sweet.  However, what if you don’t want any of those two IDEs for some reason.  What would you use?  Comments? Suggestions?  By the way, I use CFBuilder and it is fantastic.

SQL splitting a varchar list argument to row of data

Posted by Luis Majano
May 14, 2010 10:35:48 UTC

I got into yet another issue with my SQL optimizations this week at work and one of them was that I needed to pass a list of IDs to a function that would be then used in a SQL statement via an “in” clause.  The problem is that the list argument is a varchar:

   1: @docTypeIds varchar(500) = '0',

 

Then I needed to use it in my SQL statement like this:

   1: SELECT *

   2: FROM table

   3: WHERE (

   4:   (@docTypeIds = '0' OR @docTypeIds = '')

   5:   OR

   6:   docType in (@docTypeIds)  

   7: )

The problem with this approach is that the datatype for the docType column was tinyint and then the argument is a varchar list, so it would fail as it cannot cast it. Bummer!  So what to do?  Well, after some searching and searching, the best idea so far (brought up by our local dev guru Sanjib Panda), was to break the list into a simple table with one column of type tinyint, but how?  Here is the simple logic which could easily be created as a UDF:

   1: declare @testString as varchar(20)

   2: set @testString = '1,2,3,4,5,6,7,8,9'

   3:  

   4: declare @tempTable table

   5: (

   6: docType tinyint

   7: )

   8:  

   9: while charindex(',',@testString) > 0

  10: begin

  11:   INSERT INTO @tempTable select substring(@testString,1,1)

  12:   SET @testString = substring(@testString,3,len(@testString))

  13: end

  14:  

  15: select * from @tempTable

So if you run the above, that will give you our temp table with one docType column with all the values we needed.  Man, sometimes I wish SQL could have some ColdFusion goodness and create a cool function like: listToTable() or something.  Anyways, after splitting the list into a table then I can change my SQL to something like this:

   1: AND(

   2:   (@docTypeIds = '0' OR @docTypeIds = '')

   3:   OR

   4:   d.docType in ( select docType from @tempTable )  

   5: )

There you go! The solution is working really fast and given us a nice little split to rows function that can be used on any variable.  Hope this helps.

 

UPDATE

After much trying out and pains, what I had did not work fully :(  So here is an updated function:

   1: -- Temp tables for lists

   2: DECLARE @docTypes TABLE( docType tinyint )

   3: DECLARE @docTypeIds varchar(300)

   4: DECLARE @delimIndex int

   5:  

   6: set @docTypeIds = '11,1,3,54'

   7:     

   8: -- If docTypes sent in, then convert to table rows

   9: IF LEN(@docTypeIds) > 0 AND @docTypeIds <> '0'

  10: BEGIN

  11:     -- Get Delimiter index

  12:     SET @delimIndex = CHARINDEX(',',@docTypeIds)

  13:     -- We have at least one delimiter, start on it

  14:     WHILE @delimIndex > 0

  15:     BEGIN

  16:         INSERT INTO @docTypes SELECT SUBSTRING(@docTypeIds,1,@delimIndex-1)

  17:         SET @docTypeIds = SUBSTRING(@docTypeIds,@delimIndex+1,LEN(@docTypeIds))

  18:         SET @delimIndex = CHARINDEX(',',@docTypeIds)

  19:     END

  20:     -- Insert the last entry or the first single no delim entry

  21:     INSERT INTO @docTypes SELECT @docTypeIds

  22: END

  23:  

  24: select * from @docTypes

SQL Conditional Where

Posted by Luis Majano
May 13, 2010 17:01:00 UTC

Today I needed to create a conditional where statement in MSSQL and I had no idea how?  It was an incoming variable to a stored procedure and I needed to ignore it in my SQL if the value was 0, if it was not 0 then I needed to do a where statement as a list.  The solution was so simple and elegant I was like WOW!! I like that.

My first thought was to do a if-else split on the SQL with the incoming variable like this:

   1: if @i = 1

   2:     select * from mytable where mycol = 1

   3: else

   4:     select * from mytable where mycol = 2

 

However, this does not hold true to DRY principles, so the solution I ended up using was the following with a simple OR statement!

   1: AND(

   2:   @docType = 0 

   3: OR

   4:   d.docType in (@docType)  

   5: )

A simple OR statement made my life much easier, so there you go, simple conditional statements when you at least expect certain values on incoming variables.

Site Updates

Archives

Entries Search