Projekt Huemul: Energía Argentina por Litro

Leído en Página/12:

Según Potash, autor de Las armas y las políticas en Argentina, cerca de 200 ingenieros alemanes arribaron al país tras el fin de la Segunda Guerra Mundial, muchos de los cuales ocuparon puestos políticos durante el gobierno peronista. Uno de ellos fue el físico austríaco Ronald Richter, quien en 1948 llegó a la Argentina con la propuesta de producir energía atómica mediante el proceso de la fusión nuclear en forma controlada. El Proyecto Atómico Huemul se inició en un laboratorio construido en Villa del Lago, Córdoba, para luego instalarse definitivamente en la isla Huemul, en el Lago Nahuel Huapi.

Projekt Huemul, the documentary.

Lo más divertido, si es que se puede usar este adjetivo en este contexto, es que Perón anunció en 1951 que Richter había logrado controlar el proceso de fusión nuclear (algo imposible todavía hoy) y que Argentina vendería pronto botellas de medio y de un litro de energía. Me hizo acordar a esos cubos de energía que usaban los Transformers en el dibujo animado.

600th Post & Mobile Version

This is the 600th post in this blog! It all started with this post written in the airport of Buenos Aires, coming back to Switzerland. And the news of the day is that, thanks to Donncha O Caoimh, the new WordPress Super Cache plugin now works with MobilePress, which officially enables a mobile version of this site.

Thanks to all of you who visit this blog (you’re over 6’000 every month!), to all of you who’ve left 563 comments (no mention of the 28,304 spam comments caught by Akismet) and I hope that my writing will still be of interest to all of you in the years to come.

iPhone SDK 3.0: A New Beginning

Last year I blogged about the upcoming SDK 2.0 for the iPhone 3G, and boy did it change my life. For those who haven’t followed closely everything that happened in this blog lately, there’s been this (that’s me in the WWDC keynote main room at the Moscone center) and then that (yours truly talking at the first ever European iPhone conference). All of this has been the result of going to San Francisco last June. That particular trip changed everything; I never thought that a simple plane ticket could generate this much.

The iPhone has literally changed my professional life. But it was only the beginning. Last Tuesday, Apple announced the iPhone SDK 3.0, and I’ll expose here some thoughts about what’s coming next. Continue reading

NIBs or code? Why not both? Here’s nib2objc.

(Somehow this project seems to me so simple, that I’m sure someone has done this before. Anyway). This is my feeble attempt to bring an answer to the eternal dichotomy between those arguing about the relative benefits of creating user interfaces via Interface Builder or via pure Objective-C code: let me introduce nib2objc.

Unbeknown to most of us, the ibtool utility bundled with Interface Builder and Xcode allows us to inspect the contents of NIB files (or XIBs, for that matter) and get from them nice property lists XML streams, which I transform in NSDictionary instances, which I loop over and over util I get something that looks like this:

[source:c] UIView *view6 = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 460.0)]; view6.frame = CGRectMake(0.0, 0.0, 320.0, 460.0); view6.alpha = 1.000; view6.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; view6.backgroundColor = [UIColor colorWithWhite:0.750 alpha:1.000]; view6.clearsContextBeforeDrawing = NO; // …

UIButton *view9 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; view9.frame = CGRectMake(167.0, 65.0, 72.0, 37.0); view9.adjustsImageWhenDisabled = YES; view9.adjustsImageWhenHighlighted = YES; view9.alpha = 1.000; view9.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin; view9.clearsContextBeforeDrawing = NO; view9.clipsToBounds = NO; view9.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter; // … [view9 setTitleShadowColor:[UIColor colorWithWhite:0.000 alpha:1.000] forState:UIControlStateSelected];

// … [view6 addSubview:view9]; // … [/source]

Using this tool, I can now use IB for design, and then generate the code for those designs, in case I prefer to use a code-only approach (usually for UITableViewCells, as I explained before). For the moment it only works with UIKit classes, but I don’t think it might be a problem to extend it to AppKit classes as well.

I hope this project is useful to all of you! As usual, open source, public domain and on Github.

Update, 2009-04-09: This project has been featured in an article in Ars Technica by Erica Sadun!

That iPhone Keypad

Finishing my series of copied flattered UIs, like that Facebook thingy or that Twitterriffic gadget, here’s Apple’s own iPhone keyboard, in a really sloppy implementation that has been blatantly and horribly copied, with awful sounds that pop when you tap the numbers and such. The Fring iPhone application uses a similar keyboard, but with a different color set.

This code, apart from showing the keyboard and playing those sounds, it doesn’t do anything else, even if a simple “tel:” URL call might suffice to turn it into a real dialer. As usual the code is on Github; feel free to play with it, extend it, and do what you want.

Quotes

A small compilation of quotes I’ve put below the header of this blog during the past few years:

  • No vemos las cosas como son. Las vemos como somos. (Hilario Ascasubi) – We don’t see things as they are; we see them as we are.
  • Don’t be afraid to try something new. An amateur built the ark. Professionals built the Titanic. (unknown)
  • Compatibility means deliberately repeating other people’s mistakes. (David Wheeler)
  • Cuando uno se compromete con lo que piensa, y encima piensa cosas que cuestionan lo incuestionable, es de esperar que haya alguna dificultad. (hernún) – When you stick to your ideas, and on top of that you think about questioning what’s out of question, it’s likely there’d be some problems.
  • The definition of insanity is doing the same thing over and over and expecting different results. (Benjamin Franklin)
  • Most people are fools, most authority is malignant, God does not exist, and everything is wrong. (Ted Nelson)
  • sin incertidumbre no hay novedad, sin novedad posible no hay más que repetición y, por lo tanto, negación del otro como un ser libre: el ser libre es un ser incierto. (adrian mancuso) – without uncertainty there’s no novelty, without novelty there’s only repetition and, therefore, negation of the other as a free being: being free is being unpredictable.
  • Software is like entropy. It is difficult to grasp, weighs nothing, and obeys the second law of thermodynamics; i.e. it always increases (Norman R. Augustine)

Asynchronous Loading of Images in a UITableView

This is one of the most common scenarios for network- + UITableView-based applications; a UITableView instance whose contents come from the network; not only the text, but also the images! Somehow we all want to reproduce the behavior of the App Store (or of the iTunes) iPhone application, where the icons (or covers) of the apps (or songs) are downloaded one by one, as you scroll the table, without crashing nor opening 1000 simultaneous network connections.

My solution (there might be many others!) consists in the following key elements:

  • Avoid loading images right after the RSS feed is parsed; instead, use the -tableView:willDisplayCell:forRowAtIndexPath: delegate method in the controller to trigger the loading of the image for cells that become visible; this ensures that only the cells that are visible will receive the order to load images from the network;
  • Use a “model” class for each element of the table, and make the custom UITableViewCell subclass a delegate of this model object; then, the model object is responsible of loading its own image, and will tell the UITableViewCell when done;
  • Use the ASIHTTPRequest framework, with a shared download queue in the application delegate, so that all of the requests are properly queued, and network resources are properly used;
  • Show feedback to the user with scrolling wheels whenever and wherever appropriate;
  • Use the Reachability class from Apple’s own sample code to see if we’re really connected to Flickr, and otherwise show an error to the user.

I have created a sample project, as usual in Github, where I gather RSS data from Flickr’s public feed, and then I download synchronously the preview images of the feed. I even included a very simple Core Animation effect which reminds me of how the iTunes iPhone application allows us to hear previews of the songs we want to buy (the image flips and shows another view “behind”).

Feel free to contribute, fork, enjoy, read, use in your own projects, as you want. As I said, there might be many other (and most probably better) approaches to do this, so feel free to leave your comments below, as usual.

Represión en Tigre

Policía bonaerense reprime a artistas y niños durante una obra de títeres

Fue el sábado 28 por la tarde mientras se realizaba un festival por la despenalización del arte callejero y el derecho al trabajo frente a la estación fluvial de Tigre. La represión policial incluyó empujones y patadas a los chicos que veían la obra de títeres. La persecución llegó hasta la estación de tren, donde fueron golpeados también vecinos que asistían al festival. Hubo heridos y nueve detenidos. Continue reading