Compiz + Java = empty window

A serious issue when you use Compiz (for example in Ubuntu) and when you launch Java application (AWT or SWING). You get grey or white window, ie you can’t see anything inside the window of your application.

THE soluce :

edit your /etc/environnement and put that at the end :

AWT_TOOLKIT=MToolkit

Relaunch your system and this issue will be fixed !

Revue de web

  • Un lemmings entièrement en DHTML, superbe réalisation !
  • Enfin un avertisseur de freinage brutal en voiture, à quand une généralisation pour rendre “analogique” la signalisation du freinage selon l’intensité ?
  • La Tecktonik, ça bouge sec, bientôt de profs et des écoles de tecktonik ?
  • Puisqu’on parle de bouger, le deuxième à passer sur scène est plutôt impressionnant dans sa démarche…
  • Le Wifi, ça porte loin (je commence à en connaitre un rayon), voire même très loin : 382 km !
  • Le tuning de PC à la sauce Jules Vernes, ça vaut le détour.

Créer un hébergement Ruby On Rails sous un serveur Ubuntu

Un excellent tuto trouvé chez blogbangbang.com :

Je vous avait parlé il y a peu de la création d’une application RubyOnRails.
C’est bien mais un site c’est fait pour être hébergé quelquepart !
Et malheureusement Mongrel, on connait pas trop, on a l’habitude d’Apache…

Et bien celà tombe bien, car c’est deux là vont très bien ensemble, il est en effet possible d’utiliser apache pour créer les virtual host, servir une partie des fichiers… et Mongrel pour le reste.

C’est même selon les spécialistes, le meilleur moyen d’héberger un site Rails actuellement.
C’est bien mais comment on fait ? Et bien je vous explique tout de suite la procédure sur une Ubuntu…

Je pars du princpe que vous avez une application rails (la mienne s’appellera mynewsite)avec un serveur mongrel qui fonctionne en local(accessible sur http://localhost:3000).

Avant tout, vous devez stoper votre serveur Mongrel afin de faire prendre le relais à Apache+Mongrel.

mongrel_rails stop //à éxécuter à la racine de votre aplication rails.

Puis, si vous suivez ce tuto à la lettre avec un nom de domaine qui ne vous appartient pas, vous devez ajouter à votre fichier /etc/hosts le site désiré, afin de ne pas etre redirigé vers le vrai mynewsite.com.
La ligne devrait donc ressembler à ça :

127.0.0.1 mynewsite.com

Dans un premier temps, nous devons activer le module proxy d’apache.

1- Activer le module proxy d’apache

sudo a2enmod proxy

2- Créer le virual host

Le virtual host se crée comme n’importe quel autre avec apache2 : donc on va creer un nouveau fichier : 001-myewsite dans le répertoire /etc/apache2/sites -available (si vous hébergez déjà des sites, pensez à modifier le 001 en 002 ou plus).

Le VirtuaHost doit donc ressembler à cela :


ServerName mynewsite.com
ServerAlias www.mynewsite.com

ProxyPass / http://www.mynewsite.com:3000/
ProxyPassReverse / http://www.mynewsite.com:3000
ProxyPreserveHost on

#Fix for Apache bug 39499
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1

# Ne pas rediriger les images, les CSS
# et les Javascripts vers Mongrel
ProxyPass /images !
ProxyPass /stylesheets !
ProxyPass /javascripts !

# Et précisons le path où se trouve
# les images, les CSS et les javascripts
Alias /images /var/www/mynewsite/public/images
Alias /stylesheets /var/www/mynewsite/public/stylesheets
Alias /javascripts /var/www/mynewsite/public/javascripts

CustomLog /var/www/mynewsite/log/access “%h %l %u %t \”%r\” %s %b \”%{Referer}i\” \”%{User-Agent}i\””
ErrorLog /var/www/mynewsite/log/error

Explications :

Les deux premières lignes sont évidentes, on indique que ce virtual host fera tourner les sites demandé sur mynewsite.com et www.mynewsite.com.

Notre appli tourne sur le port 3000 de la machine mais il est quand meme plus agréable de taper mynewsite.com que mynewsite.com:3000 pour acceder au site.
C’est le but des 3 lignes suivantes.

Pour ce faire on utilise le mod_proxy d’apache (que l’on vient d’installer) en lui indiquant que les demandes faites sur mynewsite.com doivent être redirigées vers mynewsite.com:3000 (cela se fait bien sur de maniere invisible et l’adresse dans la barre d’adresse ne changera pas.)

On trouve ensuite 2 lignes qui permettent de résoudre un bug d’Apache lorsqu’il est associé à Mongrel.

Par la suite, on précise grâce à ProxyPass que les demandes pour les dossiers images, stylesheets et javascripts ne seront pas redirigées vers Mongrel (Apache est plus rapide pour ces contenus).
On indique donc à Apache le chemin vers ces dossiers grâce aux directives Alias.

Enfin les directives CustomLog et ErrorLog indique à apache ou stocker les logs d’acces et d’erreur de notre site.
On les place logiquement dans le dossier log de notre application rails.
(il peut être nécessaire d’avoir créer les fichier et de leur avoir donné les droits pour l’utilisateur www-data).

3-Configuration du proxy

Cette étape est souvent oubliée dans ls différents tutos que j’ai pu trouver sur le net. Pourtant elle est indispensable et c’est elle qui à à mettre en cause si vous vous retrouvez avec une erreur :

Forbidden You don’t have permission to access / on this server.

Pour configurer notre proxy nous allons devoir modifier le fichier proxy.conf.

sudo nano /etc/apache2/mods-enabled/proxy.conf

et commenter la ligne Deny from all pour la remplacer par Allow from mynewsite.com.

4- relancer apache.

sudo /etc/init.d/apache2 restart

5- relancer mongrel

mongrel_rails start -d //à éxécuter à la racine de votre application rails.

Voilà on y est, vous pouvez désormais vous rendre sur http://mynewsite.com dans votre naviguateur et vous devriez y voir la page d’accueil de votre application.

Fix horizontal scrollbar in IE

How To Avoid Horizontal Scroll Bars in Internet Explorer 6

When you open a web page in your browser, the browser has a look at what is listed in that DTD file. Then, if there is some code found on your page that is not found in that list, most browsers will ignore it. However, Internet Explorer 6 behaves in a very special way: it shows a horizontal scroll bar.

Fortunately there are a few ways to avoid horizontal scroll bars in Internet Explorer 6:

  • Whenever you can, do not use deprecated code. Use CSS instead.
  • If you want to use deprecated and/or proprietary code, remove the link to the DTD file. But leave the DOCTYPE specification on your page:

    To remove the reference to the DTD file, do the following. Locate the following in your file.

    
    

    Remove the URL so that it appears as follows.

    
    

Doing this leaves Internet Explorer 6 content and you are happy that there are no ugly horizontal scroll bars.

http://www.adobe.com/devnet/dreamweaver/articles/horizontal_scroll.html

I’m afraid this is really true…

The Matrix is a system, Neo, and that system is our enemy. When you are inside, you look around, what do you see? Businessmen, teachers, lawyers, carpenters, the very minds we are trying to save. Until we do, these people are part of that system and that makes them our enemies. You have to understand that most of these people are not ready to be unplugged and many are so hopelessly dependent on the system, they will fight to protect it. The Matrix is everywhere. It is all around us. Even in this very room. You can see it when you look out your window or when you turn on your television. You can feel it when you go to work, when you go to church, when you pay your taxes. It is the world that has been pulled over your eyes to blind you from the truth.

Morpheus in The Matrix

Your printer is spying you !

Unbelievable, I just discovered that my printer was spying me !

When you print on a color laser printer, it’s likely that you are also printing a pattern of invisible yellow dots. These marks exist to allow the printer companies and governments to track and identify you — presumably as a way to combat money counterfeiting. When one person asked his printer manufacturer about turning off the tracking dots, Secret Service agents showed up at his door several days later.

The global explanation and the list of affected printers is here : www.seeingyellow.com

Something to see with 9/11 event ?

UPDATE : here are some examples from a printer I can play with :

118 XYZ : fiasco total

Un article de 01Net relate le fiasco total des services de recherche téléphonique : les acteurs du 118 XYZ qui ont (mal) pris la relève du défunt 12.

Le meilleur passage de l’article :

L’association donne l’exemple d’un appel de cinq minutes passé depuis un mobile SFR après une mise en relation effectuée par le 118 000. Le coût total de l’appel sera facturé 6,15 euros. Soit un prix à la minute de 1,04 euro. Un peu cher pour une communication, surtout si elle est en local.

Welcome back to the past : 3617 et son 5 Francs la minute.

Cross domain security iframe communication

Une solution trop peu connue je trouve qui permet de communiquer entre IFrame avec des domaines différents : la technique du fragment identifier.

http://en.wikipedia.org/wiki/Fragment_identifier

– un excellent document qui fait le point sur le problème et les différentes solutions pour la communication entre domaines : http://www.collinjackson.com/research/papers/fp801-jackson.pdf

– la doc de Dojo qui explique pourquoi ils ont choisi cette solution et comment ça fonctionne :
http://manual.dojotoolkit.org/WikiHome/DojoDotBook/Book75

– un architecte de Microsoft qui décrit également cette solution qu’ils ont utilisé pour leur techno Windows Live, les avantages et inconvénients. L’article se situe entre les pages 14 et 18 du PDF linké à cette adresse : http://blogs.msdn.com/dthorpe/archive/2007/06/18/secure-cross-domain-communication-the-architecture-journal.aspx

– un exemple fonctionnel :
http://www.tagneto.org/blogcode/xframe/ms/ui2_workaround.html
(discussion ici)

How to manage pagination

A very good article about pagination in your web app.

Pagination 101

· By Faruk Ateş on Jun 22, 2007

One of the most commonly overlooked and under-refined elements of a website is its pagination controls. In many cases, these are treated as an afterthought. I rarely come across a website that has decent pagination, and it always makes me wonder why so few manage to get it right. After all, I’d say that pagination is pretty easy to get right. Alas, that doesn’t seem the case, so after encouragement from Chris Messina on Flickr I decided to write my Pagination 101, hopefully it’ll give you some clues as to what makes good pagination.

Before going into analyzing good and bad pagination, I want to explain just what I consider to be pagination: Pagination is any kind of control system that lets the user browse through pages of search results, archives, or any other kind of continued content. Search results are the obvious example, but it’s good to realize that pagination is also found on blogs (Previous/Next post links, which some blogs have), discussion boards and — significantly so — on web comics.

The importance of pagination is subjective; it depends on the content as well. For Google or Yahoo!’s search results, pagination is pretty important because as much as they want to give you exactly what you search for in the first 10 or 20 results, there simply are plenty of times when you’ll sift through consecutive pages. For a web comic, it doesn’t make much sense to jump to “page 7” when you’re on page 2; you want to just go to the next comic easily. So pagination is content-sensitive, but interestingly the basic principles of good pagination apply no matter what the content or context is.

Rules for good pagination

Making good pagination is not a difficult thing. Really, you just want to remember the following basic guidelines, and you should be fine. We’ll look at a large range of examples after that, to see what we can learn from existing pagination designs found on popular websites today.

1. Provide large clickable areas

This is a solid rule for any kind of navigational link, whether it’s a menu link or a pagination link, but in the context of pagination links this may be even more pertinent. Oftentimes, pagination is omitted from a design phase and ends up being stuffed somewhere in a corner above or below content areas, obviously not having been given much thought. One of the biggest problems resulting from this is that pagination links end up being small clickable areas, no larger than the page numbers themselves. To make them more effective and userfriendly, give them some proper visual design and give each link a large clickable area, that’s visually identifiable. By large, a good rule of thumb is “twice as wide as the number, and 1.5 times its height.”

2. Don’t use underlines

Underlines for links are generally a good idea, as users are most familiar with links having underlines, but for pagination links as well as (obvious) main menu links, underlines are superfluous. People know that page numbers on the web are clickable (and if they aren’t, what are they doing there?)

3. Identify the current page

Make the current page immediately identifiable for the user; it should not be clickable, it should not have any kind of visual hover-state, and it should (ideally) be wrapped in an em or strong element. The current page should be significantly different in style from the other pages, so that a user can easily keep track of where he or she is.

4. Space out page links

Provide enough space between each page link so that a user can not accidentally click on the wrong page number. Good visual design will help make this easier.

5. Provide Previous and Next links

In virtually any context where pagination exists or can exist, Previous and Next links are useful to have. So offer them. But, separate them cleanly from the page numbers and give them sufficient distance or unique styling so that they can’t be mistaken as a page; this is particularly pertinent if you use arrows instead of text for Previous and Next.

6. Use First and Last links (where applicable)

When browsing page results outside of either boundary (or is that inside?), offer a First, a Last, or both First and Last links, whichever is appropriate. For web comics, it is appropriate to always offer both links, but disable the respective link when the user is on the First or Last page. Keep it visible as a text-only option, no link, no clickability, but keep it in the design. That applies to web comics only, not necessarily for other forms of pagination.

7. Put First and Last links on the outside

Nothing is more counter-intuitive than a Last link followed by a Next link. Look at stereo systems for example: fast-forward is followed by next track, because it is a superceding step. Time controls are ordered from the center out, and pagination controls are not very different from them (or in some cases, not different at all), and should thus follow the same basic rule. « First    ‹ Previous    Current    Next ›    Last »

Examples, both good and bad

So we’ve got seven simple but clear rules to go by, let’s look at how some sites do their pagination and see what we can learn from them. Let’s start with the one I think is the most well-known of them all: Google’s search results

Pagination: Google search results

As cute as it is to stretch out the “oo” from “Google” to align with the number of pages, it creates a problem in that the page links are a bit too close for easy selection. Ever tried navigating them by clicking on the o’s instead of the numbers? It’s not convenient at all. The tenth and eleventh pages make this problem very clear, in particular. Google’s Previous and Next links, however, are fantastic — clearly separated and with plenty strong visual contrast with the regular page links. The links unfortunately all have underlines, producing some clutter which, again, makes the double digit page numbers very difficult to distinguish from one another. The clickable areas of the numbers are tiny, and the o’s are not easy to use.

Now, Google did another pagination somewhere else, which is the pagination that sparked all of this:

Pagination: Google

This time, the Previous and Next links aren’t much different at all — just a different font-weight — and the page links, albeit larger than their usual search results one, are still just tiny clickable areas that get cluttered the moment they hit double digits. The current page is pretty easily identified, but why on earth is it dropped down? A consistent baseline would have helped (also the case in the first example).

Pagination: Overture

Overture uses a slightly different approach: no actual page numbers are clickable, but you get to see what page you’re on and how many pages there are. The First and Previous links are there as regular text, so that navigation has a consistent feel to it no matter what page the user is on. The fact that only Previous and Next have an arrow is a great touch, it makes them more inviting for the user to use, and the most likely use case scenario for Overture is that a user wants to go to a Next or Previous page, not the First or Last.

Pagination: Veer

Veer does something interesting as well: simple (but frustratingly tiny) previous and next arrow buttons for browsing pages set around the current and total pages number; a drop-down for how many results per page you want and a text field to jump directly to any page in the set. The downside of a drop-down is that it has different looks in different browsers, giving a bit of an inconsistent and cluttered feel to the overall pagination area. It also lacks a consistent baseline thanks to the form controls and the buttons being oddly designed (the text labels in the image buttons does not align to the text outside of them). This simple section has five different baselines all at once.

Pagination: Design Snack

Design Snack uses arrows for the First/Previous/Next/Last buttons, but the pagination would have benefitted from some slight differences between First and Previous, and Next and Last. The First and Last buttons could have been made wider, for instance, to prevent any confusion. Also, the current page is hardly distinguishable from any other page, depending on your color settings. A good cue is the detachment of the page numbers from the other links.

Pagination: Upcoming

Upcoming has pagination on their suggestion boards, and while the pages finally have large clickable areas, the current page still looks like a clickable link. Note, however, the cleanliness from having no underlines and decent spacing between the links.

Pagination: I'm In Like With You

I’m In Like With You is a brand-new site that is best described as an online flirting site, or if you don’t mind the term, a “Web 2.0 dating site”. Think eBay + dating + Web 2.0 + social networks. When browsing people on the site, though, the pagination suffers from some serious “afterthought syndrome”: apart from having the last page number show up with an ellipsis before it, there seems to be no design to the pagination at all. The pagination is stuffed inconspicuously in a corner, page links are closely put together, they have underlines, no large clickable areas — all the classic signs, really.

Pagination: Slate

Slate‘s pagination is heading in the right direction with larger (but still not quite large) clickable areas and no underlines, but the page numbers are actually stuck against each other.

Pagination: Flickr

Perhaps the best pagination I’ve ever seen is Flickr‘s: large clickable areas, easy to identify current page, detached Previous and Next links with arrows, and rather than First and Last links they make the first and last few links be a part of the page numbers with ellipses separating them from whatever current series of numbers you’re on. Below it all, the total number of photos is listed. The only comment I could give is to add more spacing, but I feel that their hover state makes this superfluous.

Virb’s pagination is very similar to Flickr’s and gets the nod of approval, too.

Pagination: Magnolia

Chris sketched some comments on this one already, but the Magnolia pagination lacks clarity; tiny clickable areas, nearly no distinction between current page and any page link, and the whole thing feels strongly like a mere afterthought.

Pagination: Twitter

Twitter doesn’t really offer pagination, just two links to browse page by page. The links are underlined and feel like an afterthought, especially with a black bar separating them which actually adds to clutter rather than cleaning things up. If the bar had been twice as light in color it would’ve worked much better, or alternatively, with more spacing around it. On the whole, though, some proper visual design could make these links much more user-friendly.

Pagination: LiveJournal

Pagination: Engadget

These two pagination controls are from LiveJournal (top) and Engadget (bottom). They both don’t really offer pagination other than simply browsing next / previous pages (in the case of LiveJournal, the owner of the journal you’re browsing can specify the number of entries, which defaults to 20 but can be set to 1, for instance). The problem is that LiveJournal has a different perspective than Engadget thanks to its entries-per-page option: with LiveJournal, to go back in time to older entries, you have to click the “Previous ##” link; for Engadget, going back in time to older entries means clicking on the “Next Page” link. This contradiction is confusing for anyone who regularly browses sites that use conflicting approaches; a solution would be to be more specific: “Older Entries” instead of “Next Page” makes it clear where the link leads, no matter what.

Personally, I find Engadget’s approach a bit unintuitive: clicking “Next Page” to go to a page with previous entries (and “Previous Page” to go to a page with the next entries)? Sure, it’s the “next page” of entries in general, but they’re still previous entries, not “next entries”. This, to me, shows that it hasn’t been thought through carefully, but now they’re stuck to it (as I beileve this is simply a Weblogs, Inc. default).

Let’s look at some web comics, now.

Pagination: Ctrl-Alt-Del Online

Aside of the site still being a little broken-ish since its redesign long ago, Ctrl-Alt-Del online has some pretty decent pagination. The buttons are large enough to be easily clickable, but the First & Last links are inside the Previous/Next links, making it rather counter-intuitive if you also read a lot of other web comics that don’t have this flaw, or simply scour through pages of results on any site a lot.

VGCats has this same problem.

Pagination: Least I Could Do

Least I Could Do has some good pagination, where they correctly use the First/Previous and Next/Last setup with large clickable areas and a decent hover state, but the Next and Last links are still links, even if you’re on the very last comic; bad UI. Very nice, on the other hand, is the visual distinction between non-pagination related links that are still in the same visual box: Comments and a “Save my place” link, though its purpose eludes me.

Pagination: Penny Arcade

Penny Arcade has similarly decent pagination, but again the Next and Last (“New”) links are still links even on the newest comic page. Also, their buttons are relatively large in size but the text labels are pretty tiny, requiring more time than should be necessary for one to find the right link. Lastly, they only put the pagination at the bottom of the comic but sometimes their comics are very tall, requiring you to scroll down before you can navigate onwards (in whatever direction you’re heading).

Pagination: Sinfest

Sinfest is good in not making the First and Previous links clickable on the first comic, but it lacks a Last comic link entirely; the only way to get to the latest comic is to go to the home page, but this isn’t immediately apparent (less so if you enter the site on a specific comic, rather than the home page). The chosen font also doesn’t make it particularly easy to distinguish between the three pagination links, and given that there are always only three, you really do need to read them to use them.

Pagination: Applegeeks

AppleGeeks (my personal favorite when it comes to art and coloring, these guys are nothing short of sublime) uses a very different style in pagination: a thumbnail version of both the Previous and the Next comic (wherever applicable). While intriguing, this approach is decidedly less intuitive thanks to being vertically oriented and does not always make browsing through the comic convenient.

Pagination: OK-Cancel

OK-Cancel has great pagination: easy to identify First, Previous, Next and Last buttons, with large clickable areas, disabled links where links should be disabled and great hover states that obviate the need of spacing between the links.

Pagination: Questionable Content

Lastly, there is Questionable Content. This is my all-time favorite web comic, but unfortunately the pagination could do with some work. The text links are really quite small, more so in the context of the rest of the page, with the main menu links right above them and the comic right below. The controls simply don’t stand out on the page at all, making them hard to spot and hard to use. There’s only about 10 pixels between the pagination links and the main menu links, the serif type does not help for the small text size, and the links are always links even when they shouldn’t be. All in all, a lot of improvements could be made to make these pagination controls much more usable.

Closing notes

Whew! That’s a lot of examples, and I’m sure you’re all “paginated out” by now, but please, take the seven rules above into account when building a site with pagination controls. Design them elegantly to ensure that your visitors get a pleasant experience when using them, and everyone will be grateful and happy.

All images hosted on Flickr on both my own and Chris Messina’s photostreams, with thanks to Chris for his encouragement and help in providing samples.

TEMPORARY NOTE:
Because I’m technically on a blogging-hiatus thanks to not having found the time yet to turn my site into a Django-powered one, this post is a bit isolated from the rest of the site; many elements were dynamically driven which, obviously, don’t update on a static site. However, it’s here for now and when I build the Django site all will be well again. This also means that comments are disabled, but if you have a Flickr account you can comment on this post on this Flickr screenshot of the blog post.

Written in parts on two contents and at 37.000 feet high.

source