Quiet instant notifications

Written on 23 November 2011, 04:47pm

Tagged with: , ,

I recently came across an article against instant notifications on the mobile devices:

You receive a new message, say an email or a tweet, and at that very moment your software decides to do something stupid. A little red bubble appears over its icon. A ringing bell is heard. Sometimes even the message itself will pop up over your screen announcing its arrival and inviting you to read it.
Is it not rude to disturb people? Does the software assume you were sitting there doing absolutely nothing, just waiting for that update? Not only does it decide to disturb you, it does it in the most forceful way it possibly can, using every weapon at its disposal: sounds, colors and animations.

I must say that I do not fully agree with this view. And the main reason is that the reason why these notifications pop up on your screen is you. It’s you who allowed Twitter to send you notifications, it’s you who set up the push/fetch email, so you cannot really complain about that. You have the power to enable them, as well as turn them down.
But what I would like to have is a mechanism to shut down all the notifications. (more…)

Cfdocument – different behavior in CF7 vs CF8

Written on 26 October 2011, 02:26pm

Tagged with: , ,

The simple code below should write a PDF file on disk. This file should contain an image and two lines of text – next to the image (ignore the use of tables for layout 😛 ):

<cfsetting enablecfoutputonly="yes" showdebugoutput="no">

<cfoutput>
<cfdocument filename="output#Left(server.ColdFusion.ProductVersion,1)#.pdf" 
		format="pdf" overwrite="yes">
	<cfdocumentsection marginleft="1">
        <table>
            <tr>
                <td><img src='../images/image.gif'></td>
                <td>This is a simple text<br>spanning on two lines.</td>
            </tr>
        </table>
    </cfdocumentsection>
</cfdocument>
</cfoutput>

The result is quite different in ColdFusion 7 vs ColdFusion 8, as the following image shows:

In CF8, the PDF text and image appear visible smaller than in CF7.
Now the strange part: if I add unit attribute to cfdocument tag (with any value, ‘cm’ or ‘in’) – the CF8 version shows exactly the same size as CF7.

Anyone has any idea why this happens?

HTML5 geolocation demo

Written on 20 October 2011, 05:39pm

Tagged with: ,

1. Test if the browser supports navigation:

if (navigator.geolocation) {  
  /* geolocation available */  
} else {  
  /* geolocation not supported by this browser */  
} 
//---or use Modernizr
 if (Modernizr.geolocation) {
...
//---or be geek
if(!!navigator.geolocation){
...

2. Getting the current position: navigator.geolocation.getCurrentPosition()

The getCurrentPosition() method initiates an asynchronous request to detect the user’s position, and queries the positioning hardware to get up-to-date information. When the position is determined, a specified callback routine is executed. You can optionally provide a second callback to be executed if an error occurs. A third, optional, parameter is an options interface where you can set the maximum age of the position returned and the time to wait for a request. [#]

navigator.geolocation.getCurrentPosition( 
		geo_success, 
		geo_error, 
		{enableHighAccuracy:true, timeout:30000, maximumAge:60000 }
	);

3. Geolocation success callback function

The success callback function will be called with a single parameter, an object with two properties: coords and timestamp.
(more…)