rss
twitter
  •  

Obama Gets to Keep His Blackberry

| Posted in Technology |

0

New president Barack Obama has won his fight to continue to use his precious Blackberry device.  Security officials initially ruled he could not use it while in office, but with some handy work from the NSA, they have super charged the security of the device.

Read more from ABC News.



MSDN Southern Fried Roadshow

| Posted in General |

0

I spent last Friday at an event put on by Microsoft, called the MSDN Southern Fried Roadshow.  It lasted for the entire day, and much to my surprise was actually really informative.  The day started off with a big overview of Windows Azure.  Azure is Microsoft's cloud operating system that will debut sometime next year.  From what we saw you will be able to run your .NET apps (with support for other languages in the future) and your SQL Server databases in the cloud, running on as many instances as you wish.  Pricing was not announced, so I am curious to see the final price tag for Azure.  They did say it will be a pay as you use it type of structure (similar to what Amazon does I would guess).

The second part of the day was spent on discussing Silverlight 2.  I never really played around with version of 1 of Silverlight so I am not familiar with some of the new enhancements.  They did point out right from the start that you can now program your Silverlight 2 apps using C# or VB, instead of using JavaScript.  That seems cool.

To end the day they covered two ASP.NET areas, Dynamic Data Services and the MVC framework they are working on.  The Dynamic Data Services piece really blew me away.  In a few clicks in Visual Studio the presenter had a fully functional CRUD website built.  It handled all the selects, inserts, updates and deletes for the entire database.  You can drill down into the code and customize almost everything it's doing from project to project.  It was really a nice little demo.

To end the day they covered the MVC framework that should be released in the next year or so for ASP.NET.  There is not enough space to cover everything here, but just think of it as a nice MVC framework that has some really nice URL modding built into it.

Again, I was not expecting much from this little one day event, but in the end it was very informative and I came away with some new knowledge and some new technologies on the horizon.



CFEclipse and Ganymede Issues

| Posted in CFEclipse |

0

Having recently had a computer die on me, I have been slowly installing all my dev tools on a new one.  After installing Eclipse 3.4.1 and the latest version of CFEclipse, a couple of missing items were really starting to bug me.  The first was missing tag insight.  I don't use this a lot, but it's very helpful when you are using a function you don't use a whole lot, and you don't remember all the arguments that are available.  The second was missing line numbers.  This really was a big deal for me and drove me nuts to no end.  After searching around a bit I found the solution to both of my problems on the CFEclipse WIKI site.

In short, to enable your tag insight, right click on your project and select "Add Remove CFE Nature".  For missing line numbers you need to update (or create) a config file to enable it.

In your workspace, find the file:
.metadata\.plugins\org.eclipse.core.runtime\.settings\org.cfeclipse.cfml.prefs

If the file doesn't exist – copy and rename one of the other .prefs files.

In org.cfeclipse.cfml.prefs add a line with this text:

lineNumberRuler=true

Woot Tracker Snippet

| Posted in ColdFusion |

0

As I started browsing my RSS feeds yesterday morning I was happy to see that Woot.com was holding one of their famous days known as a WootOff. So I kept their site open in Firefox and I would refresh it every few minutes to see if a new product was available yet. That quickly became tiring, so I decided to write a quick and dirty little ColdFusion page to notify me when a product changed. After five minutes or so I had it sending me email notifications of new product postings. I then just set up a scheduled task to run every 30 seconds and I was good to go. Below is the code, and do remember this was done in five minutes, so everything may not be 100% optimized.

 ColdFusion |  copy code |? 
01
<cfparam name="Application.WootTracker" default="">
02
 
03
    <!--- grab woot page --->
04
    <cfhttp method="get" url="http://www.woot.com"></cfhttp>
05
    <cfset variables.text = cfhttp.FileContent>
06
 
07
    <!--- find title tag --->
08
    <cfset variables.start = '<h3 id="TitleHeader">'>
09
    <cfset variables.end = '</h3'>
10
 
11
    <cfset variables.startPos = Find(variables.start,variables.text)>
12
    <cfset variables.StopPos = Find(variables.end,variables.text,variables.StartPos)>
13
 
14
    <CFSET variables.main = Mid(variables.text,variables.StartPos,variables.StopPos-variables.StartPos)>
15
    <cfset variables.currentItem = ReplaceNoCase(variables.main, '<h3 id="TitleHeader">', '')>
16
 
17
    <!--- find price --->
18
    <cfset variables.start = '<span id="PriceSpan">'>
19
    <cfset variables.end = '</span'>
20
 
21
    <cfset variables.startPos = Find(variables.start,variables.text)>
22
    <cfset variables.StopPos = Find(variables.end,variables.text,variables.StartPos)>
23
 
24
    <CFSET variables.main = Mid(variables.text,variables.StartPos,variables.StopPos-variables.StartPos)>
25
    <cfset variables.currentPrice = ReplaceNoCase(variables.main, '<span id="PriceSpan">', '')>
26
 
27
    <cfoutput>#variables.currentItem# - #variables.currentPrice#</cfoutput>
28
 
29
    <cfif variables.currentItem IS NOT Application.WootTracker>
30
       <cfmail to="mfleming@edreamz.com" from="mfleming@edreamz.com" subject="New Woot Item">
31
    Current item:
32
    #variables.currentItem#
33
    Price: #variables.currentPrice#
34
       </cfmail>
35
    </cfif>
36
 
37
    <cfset Application.WootTracker = variables.currentItem>

Adobe Announces Bolt, a ColdFusion IDE

| Posted in ColdFusion |

0

Big news came out of MAX today.  Adobe has announced their own ColdFusion IDE, named Bolt.  From their description of the product it will be based on the Eclipse platform.  Below are the highlights from their released info:

    * Object Relational Mapping auto-configuration
    * Application Code Generation
    * Server management
    * Easily extensible through the Eclipse framework
    * CFML, HTML, Javascript, and CSS Syntax Highlighting
    * Code assist for tags, functions, variables, and components
    * Code folding
    * Snippet creation and management
    * Outline viewing
    * RDS Explorer for files and databases
    * Line-level Debugging

This is great!  I have always believed that Adobe needed a really good IDE for developers.  I have been using CFECLIPSE for a few years now, and while it's the best editor I have used so far for CFML, it still lacks some features I would like to see.  Having used Microsoft Visual Studio a lot lately, it really shows you what is lacking from CFECLIPSE.  Hopefully Adobe will rock the house with Bolt.

You can read more about Bolt from the Adobe Labs site.

ColdFusion Can Scale!

| Posted in ColdFusion |

2

Last week I had someone tell me that ColdFusion was dead, in part because it could not scale for high volume websites.  I for one would totally disagree with that argument, as I know many of you would.  Let me point out one recent example of why this guy's assumptions were incorrect.

Let me start by pointing out the obvious: anyone who does not understand a programming language can easily build something that works, but in the background is not working efficiently for the tasks at hand.  This is not specific to ColdFusion, but is also true for applications built in .NET, PHP etc…  One of the great things about CFML as a language is that it's fairly easy for someone to pick up and learn.  This also leads to a problem as it allows novice developers to build large applications without truly understanding what works efficiently and what does not.  So for my argument, I am pointing out the difference between a novice developer and someone that really knows ColdFusion inside and out.

Okay, on to my real world example of ColdFusion handling large volume websites without a problem.  I cannot mention any names here for various reasons.  So there are some things I cannot fully go into detail about here.  I can summarize that the sites are all e-commerce based applications.  They were originally developed for ColdFusion MX and have been upgraded along the way and are current to version 8.

The sites run on 4 clustered web servers talking to a SQL Server database.  The clustering is achieved via two hardware based load balancers.  Each web server runs ColdFusion 8 Enterprise utilizing the multi instance functionality.  Each of them have 5 instances  a piece, with each of those running 2 web sites.  They all utilize a couple of COM objects for certain pieces of functionality along with a couple of Java libraries that perform others.  The rest of the sites are all pure CFML based.

Since this architecture was put into use, we have had no downtime due to application server lockups or failures.  Without saying too much here, I will say they process thousands of dollars in orders every day, and at peak selling times that number is in the millions.  So yes, ColdFusion can scale quite nicely!

I also would like to point out here how much planning was spent on design and architecture, then coding based on that final design. There was no coding blind here.  Everything was thought out and some ideas were even tested on their own before they were implemented.  Good design from the hardware end to the application end is crucial!

Dynamic ORDER BY Clause in SQL Server Stored Procedure

| Posted in SQL Server |

0

Have you ever needed the ability to pass in your sort variable to a SQL Server stored procedure?  At first thought you would think you could do the following:

 T-SQL |  copy code |? 
1
ORDER BY @orderVar

But, no dice.  SQL Server will not allow you to set the ORDER BY clause with a variable.  There are two solutions to get around this.  The first is to use a CASE statement to perform the ORDER BY clause:

 T-SQL |  copy code |? 
1
DECLARE @SortVar TINYINT
2
    SET @SortVar = 2
3
    SELECT column1, column2, column3
4
    FROM TABLE
5
    ORDER BY CASE WHEN @SortVar = 1 THEN column1
6
    WHEN @SortVar = 2 THEN column2
7
    ELSE column3
8
    END

The second is make your entire query dynamic, by declaring a local variable that will hold your SQL statement:

 T-SQL |  copy code |? 
01
DECLARE @checkPaid BIT,
02
    @SQLStatement VARCHAR(500)
03
    IF @IsAll = 0
04
       SET @checkPaid = 1
05
    ELSE
06
       SET @checkPaid = 0
07
 
08
    SET @SQLStatement = 'Select d.* From [Items] d WHERE 1 = 1 AND Paid = ' + CAST(@checkPaid AS VARCHAR) + CHAR(10) + CHAR(9)
09
    IF LEN(@category) > 0
10
       SET @SQLStatement = @SQLStatement + ' AND category = ''' + @category + '''' + CHAR(10) + CHAR(9)
11
 
12
    IF LEN(@SIZE) > 0 AND @SIZE <> ''
13
       SET @SQLStatement = @SQLStatement + ' AND Size = ' + CAST(@SIZE AS VARCHAR) + CHAR(10) + CHAR(9)
14
 
15
    IF LEN(@qty) > 0 AND @qty <> ''
16
       BEGIN
17
          IF @qty = 1
18
             SET @SQLStatement = @SQLStatement + ' AND qty = 1 ' + CHAR(10) + CHAR(9)
19
          ELSE
20
             SET @SQLStatement = @SQLStatement + ' AND qty > 1 ' + CHAR(10) + CHAR(9)
21
       END
22
 
23
    SET @SQLStatement = @SQLStatement + ' ORDER BY ' + @sort
24
    -- Execute the SQL statement
25
    EXEC(@SQLStatement)

I prefer the second method, as you can also make your entire statement dynamic, for example using IF statements to perform different WHERE clauses.

SQL Server Profiler

| Posted in SQL Server |

0

I do not want to cover everything that can be done with the SQL Server Profiler here, but I do hope that most of the advanced developers out there who use SQL Server regularly are familiar with it.  It has many uses, but for me it has become an invaluable tool to help find some of the bottlenecks in an application.  We have all inherited many applications in our days that were written by a coworker, or even developers at another company.  It's always interesting to dive into the code and see what is going on.  It will be fairly obvious from looking at a few pieces of the application whether the developer was a novice or really advanced.  This not only holds true for the application code, but the SQL queries that reside in the application.  If you want to really bog down an application, throw some horrible SQL or some really bad looping over a query in there.  The results will not be pretty!

This brings me to the use of the SQL Server Profiler.  This tool will allow you to watch in real time the queries that are hitting your SQL Server instance.  You can set some filters and other things like that to get a quick view of the queries that are long running.  That is a good place to start looking if you are experiencing some slowdown in a database intensive application.  You can also copy and paste the query into Query Analyzer and being your optimization from there.  Below is a link to a video from SQLServerCentral.com that describes the basics of using the Profiler.  If you have never used this tool before, check it out and make it part of your debugging process.