_____ _ | | | ___ ___ ___ _ _ ___ |_| ___ ___ | | || | |_ -|| . || | || _|| || _|| -_| |_____||_|_| |___||___||___||_| |_||_| |___|

novembre 12th, 2011

Garlone, en temps de crise je reviens au problème initial.
J’ai toujours été la montagne, la béquille hivernale.
Une réponse contient un absolu, un mensonge qui rassure,
Donc je distille à qui veut l’entendre des histoires bleu azur.

Garlone, par méprise je me suis enfermé dans une vie diététique.
Je manque d’empathie, j’apréhende la vie comme un problème mathématique.
Pour trouver la vérité, je dois clarifier les prémisces,
Je range dans des cases le méritant, le dérisoire, la bonté et le vice.

Garlone en temps de brise partons ensemble à l’aventure.
A mettre la vie en équation j’ai fait quelques ratures.
Tes mots ont gommé ce qui chez moi allait de travers.
Je n’ai plus rien d’amer au coté de cette fille particulière.

Garlone nous ne sommes pas la reprise d’une histoire antérieure.
Nous sommes la promesse de quelque chose de beau et de meilleur.
A portée de main réside une boule de bonheur, je te la dois,
Voila pourquoi je souris lorsque mes yeux se posent sur toi.

_ _ _ _ _____ _ ___ _ _| |_ _ _ _| |_ _ _ _ _ _ _ _ _ _ _____ _____ _____ _____ _____ _____ _____ _| |_ _ _ _| |_ _ _ _ _ _ _ _ _ _ _ _ | | | ___ _ _ _ | |_ ___ | _||_| _ _ | __|| | ___ ___ _ _ ___ |_|| __| ___ | |_ ___ ___ |_||_| ___ _ _ ___ | ||_| _| | | |_ _ _ | |_ ___ ___ ___ ___ _ _ ___ ___ ___ ___ |_| ___ | | || __| ___ | _ || __|| || || || __| ___ | |_ ___ ___ |_|| __| ___ ___ ___ _ _ ___ |_| |_| ___ | |_ _ _ ___ _| || | ___ ___ |_| ___ ___ | |_ ___ | || | ___ | |_ |_| ___ ___ | || . || | | | | _|| . | | _|| ||_'_| | __|| || .'|| . || | || . | _ | __|| || . ||_ -|| . | _ | || || | || .'|| || || . | | . || | || _|| -_| |_ -|| -_|| . || | || -_|| || _|| -_| | || | | | ||__ ||___|| ||__ || --||- -||- -|| __|| || . ||_ -|| . | _ | __|| _|| .'|| . || | || . | _ | || | | . || | || || . || || -_|| _| | || ||_ -|| _|| .'|| || || .'|| _|| || . || | |__|__||___||_____| |_| |___| |_| |_||_,_| |_ _||_||__,||_ ||___||___|| ||_ _||_|_||___||___|| _|| ||_||_|_| \_/ |__,||_||_||___| |___||_ ||_| |___| |___||___||_ ||___||___||_|_||___||___| |_||_|_| |_____||_____| |__|__||_____||_____||_____||_____||_ _||_|_||___||___|| _|| ||_ _||_| |__,||_ ||___||___|| | |_||_|_| |___||___||_|_||___||_||___||_| |_||_|_||___||_| |__,||_||_||__,||_| |_||___||_|_| |_| |_| |_| |_| |_| |_| |___| |_| |_| |_| |_| |_| |_| |_|

octobre 1st, 2011

When trying to push to Heroku I came accross this nasty bug :

   /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/specification.rb:519:in `normalize_yaml_input': invalid byte sequence in US-ASCII (ArgumentError)
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/specification.rb:479:in `from_yaml'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package/tar_input.rb:183:in `load_gemspec'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package/tar_input.rb:51:in `block in initialize'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package/tar_reader.rb:64:in `block in each'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package/tar_reader.rb:55:in `loop'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package/tar_reader.rb:55:in `each'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package/tar_input.rb:32:in `initialize'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package/tar_input.rb:17:in `new'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package/tar_input.rb:17:in `open'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/package.rb:58:in `open'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/format.rb:63:in `from_io'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/format.rb:51:in `block in from_file_by_path'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/open-uri.rb:35:in `open'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/open-uri.rb:35:in `open'
    from /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/format.rb:50:in `from_file_by_path'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/source.rb:72:in `fetch'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:45:in `block in run'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `block in each'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:44:in `run'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:8:in `install'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/cli.rb:225:in `install'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:in `run'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor.rb:246:in `dispatch'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/base.rb:389:in `start'
    from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/bin/bundle:13:in `<top (required)>'
    from /usr/ruby1.9.2/bin/bundle:19:in `load'
    from /usr/ruby1.9.2/bin/bundle:19:in `<main>'

Basically it is saying that one of the Gemspec of one of my gems in containing UTF8 characters and so the slug compilation can’t go forward. Even by adding LANG = « en_US.UTF-8″ to the heroku config vars.

What did the trick was to add these two lines to the Gemfile :

LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"

I didn’t know that a Gemfile could contain ruby code and get evaluated, there you go.

_____ _ _ _ _ _ _ _ _ _ _ _ _ _ | __| ___ ___ |_| ___ | ||_| ___ ___ ___ | |_ | | ___ _ _ _ |_|| |_ | |_ ___ ___ |_|| | ___ ___ ___ ___ | | _ _ _ ___ ___ | | _| | _ _ ___ ___ |__ || -_|| _|| || .'|| || ||- _|| -_|| .'|| . || || -_| | | | || || _|| | | _|| .'|| || ||_ -| _ | _|| -_|| .'|| | | | | || . || _|| || . | | | ||_ -|| -_| _ |_____||___||_| |_||__,||_||_||___||___||__,||___||_||___| |_____||_||_| |_|_| |_| |__,||_||_||___|| | |_| |___||__,||_| |_____||___||_| |_||___| |___||___||___||_| |_|

septembre 11th, 2011

I’ve been using the serialize extension from greg moreno for a few weeks now. But I’ve always been thrown of by the way the initialization of values is done.

Let’s say I create a User model with a :settings hash, containing :notify_mail => true as a default value. All the new created users are going to have the notify_mail value set. Now if I had another attr say :invites_count => 10. All users created afterwards are going to inherit from the two attributes, but what about all the previously created users ? They are still stuck with the only one attribute.

Since I didn’t want to have to refresh all the values for everyone every time I added another attribute to the :settings Hash, I modified the AttributeSerializer to make the setter return the default value if nothing is set.

Here is the gist :

_____ _ _ _ _____ _ | __|| |_ ___ ___ | |_ |_| ___ ___ | __| ___ ___ ___ | |_ |__ || || . || . || _|| || || . | |__ || .'|| _|| .'|| | |_____||_|_||___||___||_| |_||_|_||_ | |_____||__,||_| |__,||_|_| |___|

août 21st, 2011
IMG_1749IMG_1533IMG_1546IMG_1555IMG_1578IMG_1583
IMG_1587IMG_1668IMG_1672 copieIMG_1678IMG_1765 copieIMG_1858
IMG_1864IMG_1907IMG_1952IMG_1973IMG_2013IMG_2021
IMG_2025IMG_2028IMG_2031IMG_2036IMG_2042IMG_2046

Shooting Sarah, a set on Flickr.

Un samedi aprem avec Sarah.

_____ _ _ _ _____ _ _ _____ _ _____ _____ _ _ _ _____ _ _ _ | _ | ___ _| | ___ ___ |_| _| | | __| ___ |_| _| || | ||_| ___ _ _ _ | | _ _ ___ ___ ___ ___ | _ | _| | ___ ___ | |_ ___ ___ ___ ___ _| | | | _____ ___ ___ ___ _ _ |_| ___ _ _ _ ___ |_| ___ |_| ___ ___ | || || . || _|| . || || . | | | || _|| || . || | || || -_|| | | | _ | --|| | || _||_ -|| . || _|| || . || .'|| . || _|| -_|| _| | .'|| || . | |- -|| || .'|| . || -_|| | || || -_|| | | | |_ -|| ||- _|| || || . | _ |__|__||_|_||___||_| |___||_||___| |_____||_| |_||___| \___/ |_||___||_____|| | |_____||___||_| |___||___||_| |__|__||___||__,|| _||_| |___||_| |__,||_|_||___| |_____||_|_|_||__,||_ ||___| \_/ |_||___||_____| |___||_||___||_||_|_||_ ||_| |_| |_| |___| |___|

mai 8th, 2011

Alright, a geeky post for today, and in English so it might be useful to someone, maybe.

I had a problem with my GridView content jumping around, and here is how I fixed it :

public class PhotosGridAdapter extends CursorAdapter {

	public PhotosGridAdapter(Context context, Cursor c) {
		super(context, c);
	}

	@Override
	public void bindView(View view, Context context, Cursor cursor) {

		ImageView photo = (ImageView) view;
        String url_medium = cursor.getString(cursor.getColumnIndex(KarmaDbAdapter.PHOTO_URL_MEDIUM));
        ImageCache.download(url_medium, photo);

	}

	@Override
	public View newView(Context context, Cursor cursor, ViewGroup parent) {
		ImageView v = new ImageView(context);
		v.setLayoutParams(new GridView.LayoutParams(100, 100));
		v.setScaleType(ImageView.ScaleType.FIT_CENTER);
		bindView(v, context, cursor);
		return v;
	}
}

Basically you need to set the layout params in the newView, and not in the bindView, otherwise the previous content get shrank down.

There you go, I’m going back to my nexus.

_____ _ _ _ ___ _ | __| ___ |_| ___ ___ | |_ ___ _ _ ___ ___ _| | ___ ___ | _|| |_ | | || .'|| || ||_ -|| . || . || | || _|| . | | . || _|| .'|| _|| _| |_____||__,||_||_|_||___||___||___||___||_| |_ | |___||_| |__,||_| |_| |___|

mars 2nd, 2011


et la suite

_____ _ _ _ __ _ ___ | | | _ _ | |_ ___ |_| ___ | |_ ___ ___ | | |_|| _| ___ | -|| | || . || _|| || _|| '_| | . || | | |__ | || _|| -_| |__|__||___||___||_| |_||___||_,_| |___||_|_| |_____||_||_| |___|

février 9th, 2011

Playboy: If life is so purposeless, do you feel its worth living?

Kubrick: Yes, for those who manage somehow to cope with our mortality. The very meaninglessness of life forces a man to create his own meaning. Children, of course, begin life with an untarnished sense of wonder, a capacity to experience total joy at something as simple as the greenness of a leaf; but as they grow older, the awareness of death and decay begins to impinge on their consciousness and subtly erode their joie de vivre (a keen enjoyment of living), their idealism – and their assumption of immortality.

As a child matures, he sees death and pain everywhere about him, and begins to lose faith in the ultimate goodness of man. But if he’s reasonably strong – and lucky – he can emerge from this twilight of the soul into a rebirth of life’s élan (enthusiastic and assured vigour and liveliness).

Both because of and in spite of his awareness of the meaninglessness of life, he can forge a fresh sense of purpose and affirmation. He may not recapture the same pure sense of wonder he was born with, but he can shape something far more enduring and sustaining.

The most terrifying fact about the universe is not that it is hostile but that it is indifferent; but if we can come to terms with this indifference and accept the challenges of life within the boundaries of death – however mutable man may be able to make them – our existence as a species can have genuine meaning and fulfilment. However vast the darkness, we must supply our own light.

— Stanley Kubrick in interview for Playboy, Stanley Kubrick Interviews, University Press of Mississippi, 2001, p.73
trouvé chez Ellga

_____ _____ _ __ _ ___ | __| ___ _____ ___ ___ _ _ ___ | __ | ___ ___ | | | | |_|| _| ___ | | || .'|| || -_||_ -| | | ||_ -| _ | -|| -_|| .'|| | | |__ | || _|| -_| |_____||__,||_|_|_||___||___| \_/ |___||_| |__|__||___||__,||_| |_____||_||_| |___|

janvier 21st, 2011



source

_____ _ _ _____ _ _____ _ _ _____ _ _ _ _ | __ ||_| ___ | |_ _ _ | __| ___ ___ _ _ ___ |_| ___ | __| ___ | | _| | ___ ___ | __|| | ___ | |_ ___ ___ ___ ___ ___ ___ ___ |_| ___ ___ _____ ___ ___ ___ | | ___ ___ _ _ ___ | -|| || _|| '_|| | | | | || -_|| _|| | || .'|| ||_ -| _ | | || . || || . || -_|| | | | || || . || . || -_||_ -| | . || . || -_|| || || || || . | | || . || || . || || . || . || | || -_| |__|__||_||___||_,_||_ | |_____||___||_| \_/ |__,||_||___|| | |_____||___||_||___||___||_|_| |_____||_||___||___||___||___| |___|| _||___||_|_||_|_||_||_|_||_ | |_|_|_||___||_|_||___||_||___||_ ||___||___| |___| |_| |_| |___| |___|

janvier 18th, 2011

Les dents grincent, j’adore ce mec.

_____ _ _ _ _ _ _ _ _ _ _ | __| ___ ___ ___ | |_ ___ ___ | |_ _ _ ___ | | | ||_|| |_ |_|| | ___ ___ | |_ ___ | __|| .'|| _|| -_|| . || . || . || '_| | | ||_ -| | | | || || '_|| || || -_|| .'|| '_||_ -| |__| |__,||___||___||___||___||___||_,_| \_/ |___| |_____||_||_,_||_||_||___||__,||_,_||___|

janvier 17th, 2011


source