Kandyse McClure (BSG’s Anastasia “Dee” Dualla) glamour shots

Rising star and Actress (born Candice McClure) and African-Canadian beauty, know to fans of Sci-Fi/Scy-Fy channels Battlestar Galactica as Anastasia “Dee” Dualla, recently did a shoot in Mexico with photographer , a horse, and not much else! (She may have been filming for TV series ““)

_mg_3677

_mg_3635

_mg_3576

I’ve been told that the glamour shots will be appearing in a future issue of a Canadian men’s lifestyle publication aka a “Lads Mag”.

Posted in Art, Canada, Media, Movies, Sci Fi, TV | Leave a comment

The Real Lessons From Twitter and it’s an Evolving Architecture

If you were thrown into a fight, would you start punching or would you open up your iphone and start browsing web pages about Karate? :

  • 1. If people use it, it’s valuable
  • 2. Product, Team, Market? Team.
  • 3. Rails was never the problem (see link below : twitter started as a cms…)

and InfoQ has Twitter, an Evolving Architecture, a recent (for 2009 values of recent) and detailed write-up of Twitter’s current architecture, explaining the four layers of cache (all memcached) used by the Twitter API, based on a talk given by Evan Weaver, Lead Engineer in the Services Team at Twitter, who’s primarily job is optimization and scalability, where he talked about Twitter’s architecture and especially the optimizations performed over the last year to improve the web. The slides from his talk are also online qcon presentation, good stuff.

Posted in Ruby and Rails, Social Networking, Startup | Tagged , | Leave a comment

10 UI Design Patterns You Should Be Paying Attention To

via smashingmagazine we have , and they are

  1. Lazy Registration;
  2. Progressive Disclosure;
  3. Forgiving Format;
  4. Clear Primary Actions;
  5. Breadcrumbs;
  6. Account Registration;
  7. Required Field Marker;
  8. Steps Left;
  9. Subscription plans;
  10. Hover Controls;

Every web designer and developer should have some thoughts on solving them, when they occur (not every site will need some or even any of the ui design patterns), and be able to pull code (css and javascript) out of the olde tool box. Building or extracting them as plug-in or samples also make great coding exercises, or demos!

What’s in your toolkit?

Posted in Code, JavaScript, Web, css | Tagged , , , | Leave a comment

Set xsd style dates with zulu time zone in java

I need to set some XML Schema Date/Time Datatypes (also called ) values for Created (being now) and Expired (one month from now) so that the result might look something like a dateTime in UTC (also known as GMT, but also being a 24 hour clock format) time by adding a “Z” (for Zulu?) behind the time

1
<startdate>2002-05-30T09:30:10Z</startdate>

with much chin pulling and Google cursing (suffering so you don’t have to) I came up with this :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import java.util.*;
import java.text.SimpleDateFormat;
public class xsdDate {
 private static final SimpleDateFormat SDF =    
     new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" );

 public String getCreatedxsdDate () {
  GregorianCalendar cal = new GregorianCalendar();
  final TimeZone utc = TimeZone.getTimeZone( "UTC" );
  SDF.setTimeZone( utc );
  final String milliformat = SDF.format( new Date() );
  final String zulu = milliformat.substring( 0, 22 ) + 'Z';
 return zulu ;
 }

 public String getExpiresxsdDate () {
  GregorianCalendar cal = new GregorianCalendar();
  cal.setTime(new Date());
  cal.add(Calendar.MONTH, 1); // adjust date by one month
  final TimeZone utc = TimeZone.getTimeZone( "UTC" );
  SDF.setTimeZone( utc );
  final String milliformat = SDF.format( cal.getTime() );
  final String zulu = milliformat.substring( 0, 22 ) + 'Z';
  return zulu ;
 }
}

as an example of how to use it :

1
2
3
xsdDate d = new xsdDate();    
System.out.println("CreatedxsdDate Date: " + d.getCreatedxsdDate ());
System.out.println("ExpiresxsdDate Date: " + d.getExpiresxsdDate ());

joy!

Posted in Java, Web Services, XML & RSS | Tagged | Leave a comment

June 4th, 20 Years after Tiananmen

gazing down the Tiananmen tank barrel

(also on YouTube)

In the words of Nicholas Kristoff, an eyewitness, as he recalls in the NYT on the June 4 massacre at Tiananmen Square:

The night was filled with gunfire — and with Chinese standing their ground to block the troops. I parked my bike at Tiananmen, and the People’s Liberation Army soon arrived from the other direction. The troops fired volley after volley at the crowd on the Avenue of Eternal Peace; at first I thought these were blanks, but then the night echoed with screams and people began to crumple.

The image still haunts, because of the events that followed, and because so little has really changed.

Still no representation or democracy, still Corruption and repression. No rule of Law, only the Parties law and the gun’s of the People’s Liberation Army (PLA).

Thousands march in Hong Kong to mark and remember the 20th anniversary of the Tiananmen killings, and 150,000 at Tiananmen hold a vigil in Hong Kong, in one of the few such events on Chinese soil.

And the Party still has to acknowledge, let alone answer for their actions. We still still don’t know how many thousands died, how many were jail, and how many are still in jail. No amount of economic gains can justify the massacre.

Posted in Asian, Hong Kong & China, Life | 4 Comments

SNTT : Validating a Notes Client Rich text field

Rather than testing the field on the Notes Document object (my reflex habit) , test a rich text field in the Notes UI Document object, because until the document has been saved, the rich text field either does not yet exit (if a new document) or hasn’t been updated.

The assumption in the code below is that Source is a NotesUiDocument object, the “title” field is a editable text field and “body” is a editable rich text field, and the whole thing is part of the forms query save event.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Sub Querysave(Source As Notesuidocument, Continue As Variant)

  If Source.Document.Title(0) = "" Then
     Msgbox "Please add the Title value.", 0 + 16, "Validation Error"
     Source.GotoField("Title")
     Continue = False
     Exit sub
  End If

  If Source.FieldGetText( "body" ) = "" Then
     Msgbox "Please add the the Body value.", 0 + 16, "Validation Error"
     Call Source.GotoField( "body" )
     Continue = False
     Exit sub
  End If

end sub
Posted in Code, Lotus Domino, Show-n-Tell+Thursday | Leave a comment

DemoCamp Toronto 20 is May 25th

democamp-small1DemoCamp Toronto is the show-and-tell for Toronto’s entrepreneurial developers, designers, and marketers. The goal is to see new technology, meet other interesting people in emerging technology, early-stage companies, and making Toronto a better place.

The 20th anniversary platinum edition is happening May 25, 2009; 6pm to 9pm; Location to be announced

Seating is limited (in a TBA venue, but its always crowded) but there will be free tickets announced a few days before the event. (get on the waiting list!)

Currently there are some sponsor tickets are available through EventBrite. I bought one (a Individual Sponsor Donation) because I’m happy to give back, in some small way, to this great community.

Always a fun and Interesting time!

What: DemoCamp Toronto 20
DemoCamp is a show-and-tell for Toronto’s geeks, enterpreneurs and designers. It is an evening of cocktails and good technology. When: Monday, May 25, 2009 6:00 PM to 9:30 PM Where: TBA

Toronto, ON Canada
Posted in DemoCamp, Toronto | 1 Comment

HTML Tags and REL attributes You Really Should Know

via Net tuts+ 10 Rare HTML Tags You Really Should Know is a timely reminder (especially since IE 8 is just out), of some basic HTML markup that you really should know.

in particular there are several tag you really need to know :

  • the <optgroup> tag,  for grouping of options inside a select box.
  • the <label> tag, to note the label’s text,  can also pass a “for” attribute to specify which element is to be given the label, and make the caption clickable for the associated element.
  • the <fieldset> tag, to logically group form elements.   Once applied  tag draws a box around the elements within the fieldset, by default styling.
  • the <wbr> tag, is used to specify a place where you think a line break might be useful, but only if needed.

They missed the “no break” or <nobr> tag, which prevents any line breaks from occurring in a flow of text, which I had need of when working with picky marketing people at “Brand Name” split over two lines.

update : james herdman pointed out to me that <abbr> isn’t supported by IE5 and IE6.   (See Styling abbreviations and acronyms for more information on <abbr> and <acronym>.)  And that a few organization are still stuck in the 90’s with their use of ie 6 (shutter).

The Net Tut’s article also included the “Rel” html attribute of the anchor link tag.    It’s example of rel=”clickable” is a new one for me.  I would think that a class name would be fine or better.

REL attributes are heavily used in microformats and these are some of the more common ones:

  • is used for web page tag or folksonomy.
  • is used identifying pages about “me”, in the building XFN (XHTML Friends Network) data or profile aggregation.
  • means that search engines SHOULD NOT afforded any additional weight or ranking to the linked to web page.
  • rel=”home” to a hyperlink, used for site navigation purposes, links to the homepage of the site in which the current page appears.
  • rel=”ext” to define a link as being to an external website.

Also used is rel=”Next” and rel=”Prev”  which are a little different as they are part of the W3 Basic HTML data types and refer to the next or Previous documents in a linear sequence of documents, and may be used be user agents to preload the “next” or “previous” document to reduce the perceived load time.  (I’ve seen them used by Grease Monkey scripts to give you a bottomless page effect)

See this list of existing rel values which collects all known HTML rel values from specifications, formats, proposals, brainstorms, and non-trivial POSH (Plain Old Semantic HTML) usage in the wild.

Any other useful but obscure tag’s and attributes we should know?

Posted in Semantic, Web | Leave a comment

Google Search Page with Styles Disabled Reveals CSS Sprites

via the flickr page of schoschie comes the interesting discovery that Google is using a CSS sprite on it’s Google search pages :

I had left styles disabled by accident (from the Develop menu in Safari 4) and was surprised to see that Google apparently uses CSS sprites on its search page.

So, what are these “elf’s” you talk of and why is this important?

In “Olden” video game days, to reduce the memory load, the game developers used to place all the small images and graphics in one common image. If a particular image needs to be shown, then only the portion of the common image containing that particular image will be revealed while the rest will be masked. Much more details over on wikipedia Sprite (computer graphics).

Today, of course we have the web and all this powerful hard to throw at problems. “We don’t need no optimization!!” Do we? Sadly we do need at least some.

Take a look at this Performance Research, Part 1: What the 80/20 Rule Tells Us about Reducing HTTP Requests from the Yahoo! User Interface Blog. Conclusion :

popular web sites spend between 5% and 38% of the time downloading the HTML document. The other 62% to 95% of the time is spent making HTTP requests to fetch all the components in that HTML document (i.e. images, scripts, and stylesheets). The impact of having many components in the page is exacerbated by the fact that browsers download only two or four components in parallel per hostname, depending on the HTTP version of the response and the user’s browser. Our experience shows that reducing the number of HTTP requests has the biggest impact on reducing response time and is often the easiest performance improvement to make.

in 2005 an article, on a List Apart, alerted us (okay: me!) to the use of Spirts CSS Sprites: Image Slicing’s Kiss of Death, where it revived the sprite technique of old into new and shinny css sprites, taking advantage of the background-position CSS property to show only part of the large common image.

This has two advantages :

  • reducing HTTP requests (as noted in the YUI post)
  • reducing the over all file size!!   All image formats have a certain amount of overhead, and the more images you have , the more quickly that overhead adds up.

Links to check out for creating your own CSS Sprites :CSS Sprites Generator and Project Fondue CSS Sprite Generator

So back to Google! This is the Sprite that they are using located at http://www.google.com/images/nav_logo4.png:

nav_logo41.

By my rough count that’s 38 sub images!! (and, yes there are logo3, logo2 and logo png files). the original logo png file was 4.94 KB (5063 bytes) and 4 images, the current one is 6.95 KB (7121 bytes) and ten times the number of images for 2k of files and still only one http request!

I’ll leave it as an exercise to what the css might look like, but the important point is Google use of CSS sprite makes it that much easy to justify. (”see boss/client, this is the way Google does it!”) In the same way the Google using Ajax in Gmail started the mainstream of that technique!

Interesting that this is not the first person to notice Google use of CSS Sprites, see Google’s Sprite Image is a Thing of Beauty from last year (june 2008) about the history of Google’s evolving PNG sprite image.

Update : if your are serious about making your web pages fast really read and think about Best Practices for Speeding Up Your Web Site, and read Dave Shea (mezzoblue) about

Update April 2009 : Chris Brainard (aka Flowering Mind) has released a which reduces some of the time consuming and tedious work of building the css that refers into your CSS Sprite image. Via .

Posted in Google, css | 1 Comment

Greasing the bird : enhancing Twitter with GreaseMonkey

GreaseMonkey is an add-on to (primarily, but not only) the Mozilla FireFox web browser that lets you run small (javascript) scripts to modify HTML pages on-the-fly, changing how they behave and look.  It was originally created by Aaron Boodman (aka youngpup) in 2005.

Twitter is a social networking and micro blogging service that enables its users to send and read other users’ updates, tweets, which are text-based posts of up to 140 characters in length.

Although many people use alternate interfaces to Twitter (like TweetDeck, which uses Adobe Air desktop), the default interfaces on the web is the twitter home page, which is sufficient if a little bare bones.

However, it doesn’t have to be that way!  And that is where GreaseMonkey comes in.

If you want to create your own GM scripts than I highly recommend looking at Dive Into Greasemonkey - A free online book on Greasemonkey script writing by Mark Pilgrim.  Also worth looking into is the home of Grease Monkey : GreaseSpot and it’s wiki.

Another way to start is to go to UserScripts.org the central library of user contributed GreaseMonkey script to explore, use and learn from (after reading “dive Into” start reading and modifying other peoples scripts.  It’s easy!)

Search for scripts tagged with “Twitter” shows 134 scripts (as of now).  So, there is lots to choice from.  Here are the ones I use :

  • Twitter - Show # of unread replies + adds mentions : displays the number of unread @replies and adds a Mentions tab in the Twitter sidebar.
  • Twitter Sidebar Replies : Shows replies to a user is the sidebar of that user’s Twitter page.  Makes it less likely for me to miss replies to myself, and see replies to other people when I’m on their pages (trying to decides whether to follow?).
  • Nested Twitter Replies :  gets all replies to display the conversation thread as a nested block.
  • Twitter Show Followers : Places a small icon over the pictures of people who follow you on your Twitter home page, so that you can see at a glance who is following you back!
  • twitter Search v2 : Adds a search field to the Twitter interface Twitter - Follower : on users profile page adds a simple indication as to whether their following you or not.
  • UTF8Twitter : Adds menu at top of Twitter web interface so you can add cool UTF8 (Unicode ) characters.
  • Twitter upgrade : twitter keys, search (via @joshr’s script), lat/long conversion to real location, friend follows and adds offline conversation links, and now includes hashtags.    (twitter keys convert words like “love” to its uncode charater  “♥”)
  • Twitter Hash Tools : Turn  #hashtags into links to twitter search and link to hashTweeps to see who else used this tag.
  • Twitter Filter : enable regex whitelists and blacklists for filtering out tweets in your Twitter stream.  good for removing frequent talk of elections, memes and kitty-cats on Twitter, without un-following someone.
  • Twitter Search Results on Google : Shows real-time search results from Twitter on Google search pages.
  • Twitter and FriendFeed Short URL Expander : Expands snipr, tinyurl.com, is.gd, zz.gd and bit.ly urls on Twitter and FriendFeed to show you where they’re pointing.

That should get you started!!

As you can tell overlapping functionality and conflicts could occur, but it all seems to work well.

two brief words about keeping track of your GM scripts :

GreaseMonkey scripts run on urls and domains specified in the script, and right clicking on the GreaseMonkey logo (the monkey in the bottom status bar) lets you see what can run and what is running on any current page / domain.  You can also deactivate any given script that way, or GreaseMonkey itself.

Also because sometime a web site changes it markup and the scripts that where working stop working (because they no longer have the hooks needed to insert their functionality - this happened on Twitter last January), or because UserScript.org authors update they srcipts (fixing bugs or adding functionality) it’s good to keep track of when your GM scripts get updated.  I do this by loging in to UserScripts.org and “Favorite” the scripts as I install them, then I can track when they get updated.  (Their is also a script to do this in a semi auto-magical way: Userscripts Updater).

And of course GreaseMonkey scripts exist for just about every web site out there!  Check it out for your frequently used sites; or if that site does something you don’t like or you want it to something more or different, they write your own GreaseMonkey script and post it for all of us! Because it’s your web!

update :Marjolein Hoekstra (aka CleverClogs) gave this post a twitter shout out (tweet out?) :

Greasemonkey 101 article that’s good to keep handy in case you need to explain it to someone: http://sn.im/greasemonkey_101 by @IanIrving

April 2009 Update :

a) Via Hilary Mason (author of the excellent Twitter Show Followers GreaseMonkey script) and her Twitter: A greasemonkey script to show who follows you post. I’ve discovered the greasemonkey/script-compiler “to create a Firefox extension (.xpi) from a greasemonkey script.” Wow!

b) also worth a mention is Troys Twitter Script, has replaced my use of a number of other gm scripts, which (currently) does “Nested Replies, Custom Search Tabs, Autocomplete, Pagination, RT button, Media Embed, URL Expansion, Hash Tag Search Links, Social Links” and more! I was reminded us this script because 1) it has auto-updating built-in; and 2) Read Write Web recently posted about it in .

Posted in Code, GreaseMonkey, JavaScript, Social Networking, Web | 2 Comments