Archive for the ‘Computers’ Category

will_paginate 3 with javascript page changing

Tuesday, November 2nd, 2010

Say, you have this rails 3 application where you want to display data from one of your models with pagination and you’ve gone with will_paginate 3 (currently still in beta), but you want to go through different data pages without changing the current web page (think, comments à la youtube). You have at least two choices.

You could add some javascript fairy dust and add a click() listener to intercept the call.

If you want to stay on the Ruby side, you could use a remote link. To do so, with will_paginate, you can use a custom LinkRenderer. There’s a howto already available for remote links with will_paginate 2 but obviously, it doesn’t work with the current beta because methods have changed names. You can however follow the same steps and try to use the following code instead:

class RemoteLinkRenderer < WillPaginate::ViewHelpers::LinkRenderer
  def prepare(collection, options, template)
    @remote = options.delete(:remote) || { }
    super
  end
  def link(text, target, attributes = {})
    page_attr = { :page => target }
    @template.link_to( text.to_s.html_safe, @remote.merge(page_attr), :remote => true )
  end
end

(there’s a html_safe there, because the default next/previous text for will_paginate use html entities for arrows, otherwise it’s only numbers everywhere).

a few weeks with an iPod Touch

Thursday, October 28th, 2010

Since it has now been a few weeks since I laid my hands on a iPod Touch, I thought I would write down my opinion of it, since it is my first Touch/iOS device. First, I must say the screen is gorgeous, be it for the display of song art or the whole interface. The sound seems a tad better than my old iPod Nano, but it may be a placebo effect and the fact than I have far more songs at my disposal. Performance-wise, it is all snappy as far as I’m concerned. This is probably not Apple specific, but I tried the Amazon Kindle application, and not only, once again, the screen is still gorgeous, but I really like the magnifying glass effect combined with the dictionary lookup.

The bad? Well, first, I can’t pause/next/previous blindly anymore (although with time, I may find that my fingers get used to the positions of those controls on the screen), even though a swipe would have been nice for next/previous. The Kindle app only has 5 font sizes and I could have used a smaller one. Speaking of books, did the Apple eBooks app really went through Apple’s usability QA ? I mean, I only have tried to use PDF display and it’s a pain. In portrait mode, double tap zooms, ok, but going to the next page doesn’t keep the zoom level. WTF? In landscape mode, double tap doesn’t do a thing. Double-WTF?! And the OS/applications are hardly configurable.

And if I put aside the device, what about the desktop side? First it requires an activation. Wha.? And the sync requires MacOS 10.5. A freaking device requires at least a particular major OS version, while the whole software stack (is, iTunes) is obviously the same on an older device? What the? And let’s not forget that Windows XP (released in 2001) is supported while MacOS 10.4 (released in 2005) is not. And then, add to that the hellish and unfriendly sync process using iTunes (don’t try to use multiple computers, kids!)

I really want to like it, but my personal experience isn’t that great.

how barnes&noble shot themselves in the foot and lost the (ereader) war

Wednesday, October 27th, 2010

Announcing a LCD eReader 10 days vs 8 hours of battery? yeah, right.

Agile Tour Rennes

Friday, October 8th, 2010

I did a presentation for the Agile Tour Rennes 2010 event about Scrum vs XP. I was a bit nervous obviously and as usual but more so because it was my first time on such a “large” scale. Not that there were that many people in the room (which was far from being full) but the previous presentation I gave were in front of about 20 people. My slides about Scrum vs XP were mostly based on the Takahashi/Lessig/DHH/PresentationZen methods and styles: no bullet points (except for true enumerations), short sentences (or words, expressions) in a large font, full screen images. The story I tell using this material doesn’t have however a perfect flow and I think it fell a bit short in the end. I tried to look up people, but I think I still took too much time looking at my laptop for hints. However, I’m glad I was using a mac and keynote as both the remote and the Keynote presenter display (even though I’m pretty sure PowerPoint provides the same feature more or less) helped a lot: this way, at least, I was facing people almost all the time, not having to look up on the projection screen behind me. (more…)

Emacs on Rails

Thursday, September 23rd, 2010

Even though I have been using it for years, I’m not an Emacs guru and only make use of the basic elements. However, it is still my IDE of choice most of the time. And there are a few reasons why it is so for Ruby on Rails development:

  • I can use it in fullscreen (without menu or tool bar), even on a Mac where I don’t have a tiling window manager;
  • I can split as much as I want my fullscreen frame in any number of sub-windows (imagine being able to see both model, controller, view and their corresponding specs/scenarios, plus a compilation buffer in a single glance);
  • js2-mode is a really powerful Javascript mode with a lint-like behavior;
  • Cucumber.el helps writing BDD scenarios, not only with its basic syntax and indentation but also with its nice table editing;

publishing music

Thursday, September 2nd, 2010

Since I often use to tinker with guitars, I wondered how I could publish “stuff” that I would record. I didn’t want to use flash (because flash ought to die, Die, DIE!) and I didn’t want to rely on a third-party (that would most likely try to use flash to do so).
But HTML5 has been out for some time now, most browsers I use support it nowadays, so maybe it’s time to try it in public:

The bad news here, if it works (not for safari?), is that I have to encode it twice for compatibility, but it’s not like it matters really much. And also, yeah, I think (or certainly hope somehow) that it won’t work with most (all) versions of Internet Explorer (die, Die, DIE!). Not that I care about this, in fact.

Breaking news! Somebody’s alive at Apple!

Tuesday, August 24th, 2010

... and can compile applications to PPC correctly. Thanks! (more…)

Floating point not allowed

Sunday, May 2nd, 2010

This is the error that pops up when editing the (obviously) floating point value of the character or line spacing in the Mac OS Terminal.app preferences.

Visualizing the use of Le vélo Star

Sunday, March 7th, 2010

Le vélo Star is a public bicycle rental service provided by Keolis for the city of Rennes and it opened last year. At first, data were not provided officially, although one could look at the source of their google maps use to see that a list of station was available as a XML file and detailed informations were in HTML fragments. However, Rennes Métropole has decided to open up its data and the first step in this direction was done early this week by Keolis Rennes providing an API for Le Vélo Star.

So, I wanted to do something with it. Building a google maps stye application would have been easy but I tried for something different. I first started by building a script that would collect and store the data (number of bikes and slots available for each station) using RRD. Graphs are nice, but it wasn’t helping much seeing the whole picture. So instead, using a background image generated from OpenStreetMap I built a time-lapse animation of the stations’ usage.

All the code I wrote is available on my Github repository, except for the animation bit, were I currently used iMovie.

my very own opinion about the Apple iPad

Friday, January 29th, 2010

So, Apple showed the world its new world domination toy, the iPad. What do I think about it? First, the name is silly and boring. The device seems interesting with limited capabilities, but most probably due to physical and technical constraints. Sure, it can’t do multitasking and it is just an oversized iPhone, but one has to take into account that the thing is thin and that the battery is good even though the display and the faster processor would be more power-hungry than those on the iPhone/Touch.

Would I buy one? Not yet. Although I’m a good target, I think that this is still a bit expensive (not even speaking of the cash cow represented by the various storage capacities, and what about the OS updates?) for what it can do and my pocket are not that deep. I would rather keep a laptop instead, at the time being, for home usage. Hopefully, in one or two years, it will get better feature-wise. Would it get more “open” to other apps? Not sure Apple would let go.

However, I think this represents a kick in the nuts for the eReader market. Many of those compete on the features and in the end are expensive old-fashioned (b&w) devices. If I had to choose between an Apple iPad and any 10” eReader, at the same price, I think the LCD screen would win this time. I don’t know if they could compete directly with the iPad. Build a cross-over device with ePaper and touch capabilities at the same time? Not likely to win. My guess is that they would better try to go against the touch/iphone, with simple/cheap 6” devices, where they can’t be reached by glossy and battery-hungry gadgets.

About

My name is Sebastien Tanguy. This is my weblog. I am currently a software developer, but every now and then I also talk about music, books or photography.

 

February 2012
M T W T F S S
« Jan    
 12345
6789101112
13141516171819
20212223242526
272829  

Archives