HOME | FERGUSON Digital Blog

And In a Flash it's Over!

General Topics · By Christopher Long No Comments »

As predicted Adobe will no longer support Flash on mobile devices. According to an article on ZDNet, sources close to Adobe stated, 

"Our future work with Flash on mobile devices will be focused on enabling Flash developers to package native apps with Adobe AIR for all the major app stores. We will no longer adapt Flash Player for mobile devices to new browser, OS version or device configurations. Some of our source code licensees may opt to continue working on and releasing their own implementations. We will continue to support the current Android and PlayBook configurations with critical bug fixes and security updates."

So what does this mean for mobile users strapped with a new 2 year contract on a device running something other than iOS (like me with my new Motorola Atrix 2)? Nothing really, because with HTML5, CSS, and JavaScript allowing native video support, they will still be able to receive dynamic content. One of the major problems with Flash has been adapting it to work seamlessly with a mobile system. What came out was an unstable mess that ate up every morsel of battery life it could get it's hands on. Consumers eagerly awaited the Motorola Zoom as it was supposed to be released as the premier Adobe Flash mobile device. Adobe couldn't get the kinks worked out so instead of a fully functioning Flash capable mobile device the Zoom was released with a Beta version of Flash that was unstable at best, according to testing done by Wired Magazine.

Looking at the articles across ZDNet, Wired, Gizmodo, and CNN it appears that the Flash based apps being written will not be in jeopardy with this change, it's playing web based flash applications such as Global Warfare on Facebook that will crash. There are also predictions that with Adobe dropping the ball on the mobile devices that their future in web based development is looking grim. As a meager Flash developer this makes me apprehensive when it comes to the future of some of my current works, however as with anything in the realm of technology you either adapt or die. My suggestion would be to study the changes and start introducing yourself to HTML5.

Since leaving the W3C (World Wide Web Consortium http://www.w3.org) in 2004, due to the WC3's focus on XML over HTML, the new group WHATWG (Web Hypertext Application Technology Working Group) have been pushing the evolution of HTML and has published the HTML Living Standard which can be found at http://www.whatwg.org/ under the HTML.



Using MOD 4 With CFOUTPUT (redux)

ColdFusion · By Michael Ferguson No Comments »

Yesterday I posted about how you could use the "MOD (Modulo) with CFOUTPUT to build a table to display four pairs of repeating data from a query structure" and thanks to a response by Michael Zock, I realized that my example was not proofread so here is a redux example of Modulo driven column display from a query.

<!---USE NORTHWIND DATABASE TO BUILD QUERY--->
<cfquery name="GetInfo" datasource="Northwind">
   SELECT OrderID, ShipName
   FROM Orders
</cfquery>

<table border="1" cellpadding="0" cellspacing="0">
   <tr>
      <!---LOOP FOUR TIMES TO BUILD REPEATING HEADER--->
      <cfloop index="LoopIndex" from="1" to="4">
         <th>Order ID</th>
         <th>Ship Name</th>
      </cfloop>
   </tr>
   <!---OUTPUT QUERY--->
   <cfoutput query="GetInfo">
      <!---USE MODULO 4 TO DETERMINE IF CURRENT RECORD DIVISIBLE BY FOUR FOR TR--->
      <cfif GetInfo.CurrentRow MOD 4 EQ 1 OR GetInfo.CurrentRow EQ 1><tr></cfif>
         <td width="5%">#GetInfo.OrderID#</td>
         <td width="20%">#GetInfo.ShipName#</td>
      <!---USE MODULO 4 AND CHECK IF END OF QUERY FOR CLOSING TR OF EACH ROW--->
      <cfif GetInfo.CurrentRow MOD 4 EQ 0 OR GetInfo.RecordCount EQ GetInfo.CurrentRow>
         <!---CHECK IF LAST ROW HAS LESS THAN 4 RESULTS TO PAD TABLE--->
         <cfloop index="LoopIndex" from="1" to="#GetInfo.CurrentRow MOD 4#">
            <td width="5%"> </td>
            <td width="20%"> </td>
         </cfloop>
         </tr>
      </cfif>
   </cfoutput>
</table>
<br /><br />
<!---EXAMPLE REPEATED WITH QUERY MAXROWS 16 (4x4) TO PROVE CLOSING TR AND QUERY END CHECK--->
<table border="1" cellpadding="0" cellspacing="0">
   <tr>
      <cfloop index="LoopIndex" from="1" to="4">
         <th>Order ID</th>
         <th>Ship Name</th>
      </cfloop>
   </tr>
   <cfoutput query="GetInfo" maxrows="16">
      <cfif GetInfo.CurrentRow MOD 4 EQ 1 OR GetInfo.CurrentRow EQ 1><tr></cfif>
         <td width="5%">#GetInfo.OrderID#</td>
         <td width="20%">#GetInfo.ShipName#</td>
      <cfif GetInfo.CurrentRow MOD 4 EQ 0 OR GetInfo.RecordCount EQ GetInfo.CurrentRow>
         <cfloop index="LoopIndex" from="1" to="#GetInfo.CurrentRow MOD 4#">
            <td width="5%"> </td>
            <td width="20%"> </td>
         </cfloop>
         </tr>
      </cfif>
   </cfoutput>
</table>

I hope this more complete example better illustrates a use for the MOD (Modulo) than just alternating row colors for table rows!

If you find this post useful please leave a comment and let me know how you used the information.

Download zipped example HERE.



Using MOD 4 With CFOUTPUT

ColdFusion · By Michael Ferguson 2 Comments»

Here is an example of how you can use MOD (Modulo) with CFOUTPUT to build a table to display four pairs of repeating data from a query structure. Using this method will build the table with the information ITEM and TOTAL repeating four times across each row. In the event that the total number of records in the query are not divisible by four, the table cells will end early.

<table border="0" cellpadding="0" cellspacing="0">
   <tr>
      <th>ITEM</th>
      <th>TOTAL</th>
   </tr>
   <cfoutput query="GetInfo">
      <cfif GetInfo.CurrentRow MOD 4 EQ 1 OR GetInfo.CurrentRow EQ 1><tr></cfif>
         <td width="20%">#GetInfo.Item#</td>
         <td width="5%">#GetInfo.Total#</td>
      <cfif GetInfo.CurrentRow MOD 4 EQ 0 OR GetInfo.RecordCount></tr></cfif>
   </cfoutput>
</table>

This example may need to be tweaked for your purpose but it may help you avoid developing an unnecessarily complicated solution for a simple data display puzzle. Using MOD works because when the CurrentRow is divided by 4 evaluates as 0 when progressing through the query. First time through the loop the CurrentRow is 1 which is not divisible by 4 so it progresses to the next CurrentRow. This keeps going until it reaches a CurrentRow that is divisible by 4 then ends the row and starts a new one.

If you find this post useful please leave a comment and let me know how you used the information.



QR Codes In The Local Media

General Topics · By Michael Ferguson 1 Comment»

I've known about QR codes (Quick Response) for a number of years now, but was surprised when the local news media broadcasted a report about them as though they were brand new. Worse yet, they spent less time informing the public about how they can be used to promote local business and more time in scare tactics.

QR codes, in case you didn't already know, where created by Toyota to track vehicle parts and soon became widespread in commercial advertising all over Japan. The square codes can be seen hardlinking on billboards, store signs, business cards, just about every flat surface. Here in the US, at least where I live, the symbols have not gained as much popularity.

In my local community, thanks to the media, I wouldn't be at all surprised if the townies feared the codes now. They were warned that scanning the codes with your smartphone could open your device to a myriad of viruses and other unwanted content. Nice tactics, the barcode reading software only translates the scanned code into the alphanumeric text embedded in the coding, it doesn't do anything with the translation; that's up to the human!

It is completely up the holder of the smartphone to click on any translated hyperlink and follow the address with their mobile browser. Much more useful information would be to advise the public to be comfortable scanning QR codes from trusted sources, ie store chains, professional billboards, city metro advertising, but if you do not recognize the web address that the code is wanting you to visit, then don't go there!



Using cfstoredproc, cfprocparam, and cfprocresult

ColdFusion , MS SQL2008 · By Dustin Brisson 4 Comments»

I recently attended a ColdFusion certification course. One of the things I learned in the course was the use of Stored Procedures(SP). SP are a great way to move your SQL statements out of your code and allows for code re-use. It also takes the strain off your ColdFusion server and forces your SQL server to crunch all the calculations/numbers (which is what it is intended for). This practice will help speed up your process time for your page.

One of the features of the cfstoredproc command is the cfprocresult command. The cfprocresult returns the resultset of your stored procedure as a query. If you have more than one resultset, the cfprocresult has an attribute to set which resultset you want.

For example, you create a stored procedure for finding the employees who are male or female in your organization. The stored procedure might look something like this:

BEGIN
   SET NOCOUNT ON;

   --Get Males

   SELECT   FirstName, LastName
   FROM   TableEmployee
   WHERE   Gender = 'M'

   --Get Females

   SELECT   FirstName, LastName
   FROM   TableEmployee
   WHERE   Gender = 'F'

   END

Within your code on your page, you can call these two results like this:

<cfstoredproc procedure="spEmployeesByGender" datasource="your_datasource">
      <cfprocresult name="Males">
      <cfprocresult name="Females" resultset="2">
   </cfstoredproc>

There is no need to put a resultset on the first cfprocresult. However, if you only wanted to return the Females in this example, you must include the resultset attribute.

You can also pass variables to your stored procedure using the cfprocparam attribute of the cfstoredproc tag. Here is an example of the cfstoredproc tag with cfprocparam and cfprocresult.

<cfstoredproc procedure="spEmployeesByGender" datasource="your_datasource">
      <cfprocparam cfsqltype="CF_SQL_VARCHAR" value="M">   <!--- Send M for Males --->
      <cfprocparam cfsqltype="CF_SQL_VARCHAR" value="F">   <!--- Send F for Females --->   
      <cfprocresult name="MaleEmployees">
      <cfprocresult name="FemaleEmployees" resultset="2">
   </cfstoredproc>

Now you can define vairables within your stored procedure to pass to your query statements.

@MyMaleGender VARCHAR(1), @MyFemaleGender VARCHAR(1)

   BEGIN
   SET NOCOUNT ON;

   --Get Males

   SELECT   FirstName, LastName
   FROM   TableEmployee
   WHERE   Gender = @MyMaleGender

   --Get Females

   SELECT   FirstName, LastName
   FROM   TableEmployee
   WHERE   Gender = @MyFemaleGender

   END



© Copyright 1997-2024, All Rights Reserved Coldfusion and MS SQL2008
Powered by Mango Blog.   Design by FERGUSON Digital