Time to Live (TTL) of objects on Amazon Cloudfront

Time to live (TTL) is mechanism that limits the lifespan of data in a computer or network. In HTTP, TTL is expressed in the response header as a date and time on which a record expires.

On Amazon Cloudfront, the default TTL is 24 hours. In April 2010, Amazon Cloudfront announced that it will honor shorter TTL’s down to one hour. The HTTP header can be set in the Amazon AWS Management Console.

To refresh a specific file on Amazon Cloudfront, you can use the Invalidation API. The Bucket Explorer has a UI that makes Invalidation pretty easy. Informations about an Amazon CloudFront – PHP Invalidator are availble at the subchild website.

screen.width & screen.height for iOS devices

You can detect the screen dimensions of a web device via JavaScript by using screen.width and screen.height.

For an iPad one would think that screen.width would be 768 when being held vertically and 1024 when held horizontally. However, screen.width is always 768 regardless of the way you’re holding the iPad; likewise, screen.height is always 1024. The same is true for the iPhone/iPod Touch. screen.width is always 320 and screen.height is always 480.

The iOS devices support however the window.orientation property, so if necessary, you can use that to determine if the user is in horizontal or vertical mode.

  • window.orientation is 0 when being held vertically
  • window.orientation is 90 when rotated 90 degrees to the left (horizontal)
  • window.orientation is -90 when rotated 90 degrees to the right (horizontal)

There is also the orientationchange event that fires on the window object when the device is rotated.

The mediaquery “orientation” works also in current versions of Safari and Firefox on a desktop machine. Simply change the size of your browser window until the height is longer than the width and you get “portrait”.

CSS Positioning

Last update : November 24, 2014

The layout properties available in CSS are :

  • position : static
  • position : relative
  • position : absolute
  • position : fixed
  • float : left or float : right

The default CSS positioning for all elements is position:static; the element is not positioned and occurs where it normally would in the document. With position:relative, elements are moved relative to where it would normally occur in the document with the parameters top, bottom, right or left. With position:absolute, the element is removed from the document and placed exactly where the parameters top, bottom, right or left tell it to go.

A combination of a relative and absolute positionned div’s allows to make a two-column layout. An advantage to using absolute positioning is that we can position the elements in any order on the page, regardless of the order they appear in the HTML. A disadvantage is that other elements are obscured by the absolutely positioned elements. This can be avoided if a fixed height is set on the absolute positionned elements, but if the text displayed in this element is longer or the font size is changed, new problems appear. A better solution for variable height columns is to float an element to push it as far as possible to the right or to the left, and allow text to wrap around it. Two elements floated to the same side will push up against each other. To push down the rest of the content the floats can be cleared after the floating elements.

Position:fixed behaves like position:absolute, but it will position an element in reference to the browser window as opposed to the web page. Fixed elements should stay exactly where they are on the screen even when the page is scrolled.

There is a divide between web designers saying you should use absolute positioning and web designers saying you should use floats, both claiming that the other method breaks faster. Both are right, it depends on the situation. There is a simple rule :

If elements should not interact, use absolute positioning, if they should, use floats.

Another benefit of floats is the progressive downloading; as the text is loaded it is displayed onto the page immediately.

Links to examples of layouts with different positionned elements are listed hereafter ( look at the sourcecode of the webpages to view the CSS code) :

Links to some useful tutorials about CSS positioning are shown in the following list :

Responsive, adaptive and reactive web design

Last update : June 25, 2014

Responsive web design is creating web layouts that can adapt to a multitude of displays and devices. Using this technique, you can eliminate the need to create device-centric designs and allow your content to be displayed from a single source, on an unlimited number of mediums.

Web designers often transform their desktop layouts into something optimized for devices with smaller screens by adding additional javascript and additional css code. That’s not the right solution for mobile devices with less powerful CPU’s and slower network connections where speed and low roaming charges matters more than on desktop PC’s. Simply resizing the same application to fit on multiple devices doesn’t necessarily ensure the best experience for users.

The main objective of responsive web design is to load only those files to the device which are really displayed and to minimize the file size of the downloaded elements, including images. Responsive web design is the practice suggesting that design and development should respond to the user’s behavior and environment based on screen size, platform and orientation. Adjusting images to make them context-aware, according to the different screen widths or devices is another important aspect of responsive web design.

The pioneer of responsive web design is Ethan Marcotte, a web designer, developer, speaker and author, living in in Boston, Massachusetts. His blog is called Unstoppable Robot Ninja.

The technical ingredients for responsive web design are :

  • fluid grids
  • media queries
  • adaptive images
  • viewport settings

Some web designers prefer the term adaptive instead of responsive for these technologies, other call it reactive.

A recommended approach to start with responsive web design is to start with a mobile first layout. You have to keep in mind that most internet users do not keep a browser open full screen.

Links to some useful documentation and scripts about responsive web design are shown in the following list :

Books :

Scripts :

Blogs :

 

Scroll content on the iPhone and iPad

To scroll content inside a fixed width-height element (e.g. div) on an iPhone or iPad, the user must use two fingers to scroll any area on a page that is not the entire page. One way to work around this ‘feature’ is to implement a touch event handler that moves the div up when the user touches it.

A better way to add one finger scrolling to divs on iPhone’s and iPad’s is the iScroll4 script developed by Matteo Spinelli. This script provides the following features :

  • Pinch / Zoom
  • Pull up/down to refresh
  • Improved speed and momentum
  • Snap to element
  • Customizable scrollbars

3D Printers

Last update : May 15, 2013
3D printing is a form of additive manufacturing technology where a three dimensional object is created by laying down successive layers of material. 3D printing is  considered as e-manufacturing. A list of available industrial and home 3D printers is given below :

Home 3D printers :

ReplicatorG  is a software that will drive your home 3D printer or generic CNC machine. You can give it a GCode or STL file to process, and it takes it from there. It’s cross platform, easily installed, and is based on the familiar Arduino / Processing environments.

Industrial 3D printers :

The following  3D printing providers offer web based services for private customers :

 

Twitgoo and Twistori

Twitgoo is a quick, easy, reliable, and safe way to share images for Twitter. Twitgoo is operated by Photobucket Inc. which is an image and video sharing service that allows Users to store images and videos and share them across the internet and create unique personal profiles online. Twitgoo allows Users to upload images and videos and associate them with a unique URL to create online access to the images and videos for themselves and others.

A Twitgoo application for the Chumby has been developped by Andrew Howie (howdog) from Sydney.

Another Chumby app based on Twitter is Twistori, a first step in an ongoing social experiment, inspired by wefeelfine, hand-crafted by Amy Hoy and Thomas Fuchs.

Internet Evolution

Last update : October 8, 2012
Where is there and how do we get there from here ? was the topic of a panel on Internet Evolution, organized by the Internet Society at IETF 81 in Quebec, Canada.

Evolution occurs as a response to a stimulus. The panel explored different paths that Internet evolution could follow:

  • Natural evolution – letting market forces prevail
  • Top-down regulatory – return to the telco regime
  • Clean slate – repealing the laws of Internet physics
  • Or ?

The following five questions have been answered by seven contributors : Kenjiro Cho, Alissa Cooper, Jon Crowcroft, Geoff Huston, Bill St. Arnaud, Joe Touch and Jonathan Zittrain.

  1. Internet and Innovation : The Internet itself was an innovation and it has served as an open platform for unprecedented innovations in networking, applications and services for years. The data provides evidence that the Internet is becoming ‘flatter’ (increasingly direct interconnection of content and consumer). Is this necessarily part of a trend towards a less-innovative platform ?
  2. P2P Traffic : Is the relative decline in P2P traffic volume indicative of the triumph of business models over technology ?
  3. Dominance of Application Protocols : What is your perception of the import of the increasing dominance of a handful of application protocols—simplification ? ossification ? something else ?
  4. Internet Evolution Trends : What do these observable trends in Internet evolution mean for the future of the Internet ?
  5. Impact on The Future of the Internet : Any other observations or interpretations of these reports in terms of impact and import for the future of the Internet that you would like to share ?

The following links provide further informations about the Internet evolution :

Virtual Chumby

Chumby is a content platform that serves flash-based apps across mutiple devices. Current chumby devices include :

  • Chumby 8
  • Classic Chumby
  • Chumby One
  • Sony Dash
  • Insignia Infocast
  • Chumby for Android

The Chumby Dashboard allows to create channels and to add apps to the channels. The display time per app can be customized (from a few seconds to a few minutes or forever). The channels can be selected on the Chumby device and the apps are shown sequentially.

A virtual chumby is a chumby that plays on any computer like a real chumby — except it’s doing it in cyberspace. The only difference with the virtual chumby is that it won’t show certain apps to protect your privacy.

The following virtual Chumby shows the channel marco from my Chumby account.

[HTML1]

 

Archos Android Home

ARCHOS 35 Home Connect

ARCHOS continue to push technological boundaries and innovation with two new Android devices designed for the home – The ARCHOS 35 Home Connect, an Android-based web radio and the ARCHOS 35 Smart Home Phone, an Android DECT phone. Both are smart devices and feature all of the Android functionalities.

The ARCHOS 35 Home Connect is the perfect music box and the best portable Android device for streaming radio and music anywhere at home with an amazing sound quality.

The ARCHOS 35 Smart Home Phone will make owning a home phone popular again.

Both cutting-edge ARCHOS Android-based home devices, thanks to the front facing webcams, bring new usages such as video calling, baby monitoring and even room surveillance.