Sunday, September 28, 2008

Eu Sou Meu Próprio Avô

Homer & Jethro 1956 RCA Victor 6765

Muitos, muitos anos atrás, quando eu tinha 23 anos
Eu me casei com uma viúva linda
Essa viúva tinha uma filha crescida de cabelos vermelhos
Meu pai se apaixonou por ela e logo os dois se casaram

Isto fez do meu pai meu genro e mudou minha vida pra sempre
Porque minha filha era a minha mãe porque ela era a esposa do meu pai
Pra complicar o negócio mais ainda, apesar de me dar alegria,
Eu logo me tornei o pai de um menino

Eu sou meu próprio avô
Eu sou meu próprio avô
Sei que é engraçado
Mas é verdade
Eu sou meu próprio avô

Meu bebê então se tornou cunhado do meu pai
E assim se tornou meu tio embora isso me tenha entristecido
Pois se ele era meu tio então isso o fazia ser irmão
Da filha crescida da viúva que era, claro, minha madrasta

A esposa do meu pai então teve um filho que os mantinha ocupados
E ele se tornou meu neto pois ele era filho da minha filha
Minha esposa agora é a mãe da minha madrastra e isso me entristece
Porque apesar de ser minha esposa ela é também minha avó

Eu sou meu próprio avô
Eu sou meu próprio avô
Sei que é engraçado
Mas é verdade
Eu sou meu próprio avô

Ah, se minha esposa é minha avó então eu sou seu neto
E todas as vezes que penso isso, eu fico quase louco
Porque agora eu me tornei o caso mais estranho que você já viu
Como marido da minha própria avó eu sou meu próprio avô

Eu sou meu próprio avô
Eu sou meu próprio avô
Sei que é engraçado
Mas é verdade
Eu sou meu próprio avô

Original em Inglês

Homer & Jethro 1956 RCA Victor 6765

Many, many years ago when I was 23
I was married to a Wider who was purty as can be
This Wider had a grown-up daughter who had hair of red
My father fell in love with her and soon they two were wed

This made my dad my son-in-law and changed my very life
For my daughter was my mother cause she was my father's wife
To complicate the matter even though it brought me joy
I soon became the father of a bouncing baby boy

I'm my own grampa,
I'm my own grampa
It sounds funny I know
But it really is so
I'm my own grampa

My little baby then became a brother-in-law to dad
And so became my uncle though it made me very sad
For if he was my uncle then that also made him brother
Of the Wider's grown up daughter who of course was my step-mother

My father's wife then had a son who kept them on the run
And he became my granchild for he was my daughters son
My wife is now my mother's mother and it makes me blue
Because although she is my wife she's my grandmother too

I'm my own grampa,
I'm my own grampa
It sounds funny I know
But it really is so
I'm my own grampa

Oh if my wife is my grandmother then I'm her grandchild
And every time I think of it, it nearly drives me wild
For now I have become strangest case you ever saw
As husband of my own grandmother I'm my own grampa

I'm my own grampa,
I'm my own grampa
It sounds funny I know
But it really is so
I'm my own grampa

Friday, September 26, 2008

Campanha da Dignidade

Vamos promover a dignidade? Inclua você também essas imagens em seu blog!

(Se não aparecer imagens acima, espere um pouco)
Clique na imagem uma vez para ver mais detalhes.
Clique na imagem uma segunda vez para ler mais detalhes ainda.

Inclua esse trecho de HTML na sua página:

<iframe style='width:500px; height:375px;'
frameborder='no' allowtransparency='true'></iframe>

ou visite este link.

Ou ainda, inclua um link para essa imagem abaixo:

Image and video hosting by TinyPic

( a URL da imagem: http://i36.tinypic.com/midrac.gif )

Tuesday, September 23, 2008

My daily SharePoint frustration - V

The error message:

Could not load type 'Blah.Control'. at System.Web.UI.TemplateParser.GetType(String typeName, Boolean ignoreCase, Boolean throwOnError)

at System.Web.UI.TemplateParser.ProcessInheritsAttribute(String baseTypeName, String codeFileBaseTypeName, String src, Assembly assembly)
at System.Web.UI.TemplateParser.PostProcessMainDirectiveAttributes(IDictionary parseData)

The context:
I was trying to create a custom field type with a custom control. The problem appeared when I was trying to create a new column in a list. Apparently SharePoint wasn't finding the class for the inheritance of the control, declared in the ascx file.

The solution (or workaround):
I checked that the public key token was the same in the GAC, in the ascx.
I checked that the FieldTypeClass in the field declaration was correct in my fldtypes_blahblahblah.xml
I reset IIS. (I think this is what "solved" the problem). It is as if resetting IIS forced SharePoint to "reconsider" the proper version of the assembly in the GAC (flushed whatever from memory).

Thursday, September 18, 2008

For the Record: Why Privatize the Variables?

I don't like using private variables when I suspect the variable may have a different use in the future. I can't understand the "movement" towards not using protected variables at all. Some even suggest using private variables with public accessor methods instead of protected variables! I like protected variables. Perhaps someone will see a different use of my code in the future.

Tuesday, September 16, 2008



ZENN Motor Company Inc.

Toronto, Ontario, Canada



Toronto, Ontario – September 16, 2008– ZENN Motor Company Inc. (“ZMC” or “the Company”) is pleased to announce the Canadian debut of its all-electric ZENN in the province of Québec. Following the announcement by Transport Minister Julie Boulet of a three year province-wide pilot project enabling the sale of low-speed vehicles (LSVs), ZMC has obtained a Retailer license to enable direct customer sales from its factory in Saint-Jérôme, Québec.

To celebrate its Canadian debut, ZENN Motor Company is hosting a launch event for the made-in-Québec, zero-emission, no-noise ZENN at its Saint-Jerome manufacturing facility on Saturday, October 4th. All prospective consumers who signed up for ZMC’s waiting list via its website will be invited to test drive the ZENN, meet ZMC officials and enjoy the momentous event of bringing the first commercial electric low-speed vehicles to the Canadian market. This launch event will mark the first day of sales operations and the Company will be taking orders and deposits on a first-come, first-served basis for the first ZENN deliveries in Canada.

“The all-electric ZENN is proudly manufactured in Québec and it is certainly fitting that its Canadian debut is in this highly progressive province that is committed to supporting zero emission transportation solutions,” stated Ian Clifford, CEO of ZENN Motor Company. “This represents an exciting milestone for ZMC as this is the first time we can actively market our vehicle at home where the car is produced.”

ZENN Motor Company plans to market the ZENN through a unique factory-direct approach. Retail operations for ZENN Motor Company will be based in Saint-Jerome and will offer customers the opportunity to not only see first-hand how their new vehicle will be constructed, but to also meet the people who will be building their ZENN.

The ZENN is a fully featured all-electric low-speed vehicle that offers consumers a guilt-free driving experience. The ZENN represents everything good about personal transportation: it’s stylish, fun and socially responsible. The ZENN cruises at a federally regulated top speed of 40 km/h and can travel on roads with posted speed limits of 50 km/h. Featuring generous seating for two plus 13 cubic feet of storage, the ZENN is perfect for those short local trips to pick up groceries, drop off dry cleaning or rent a movie The ZENN provides a range of 50-80 kilometres per charge and ‘topping up the tank’ is as easy as plugging in your cell phone. The cost of driving a ZENN is less than 2 cents per kilometre and as little as four hours of charging will provide 80% capacity from a completely ‘empty’tank’. The ZENN has a retail price in Québec of $16,900.

The ZENN will be officially launched at the Company’s manufacturing facility at 921 Chemin de la Rivière du Nord, in Saint-Jérôme, on Saturday, October 4th at 11:00am. The official ribbon-cutting ceremony will commence promptly at 11:30am and interested consumers who would like to attend and test drive a ZENN are asked to register by clicking on the following link:


For members of the press who wish to coordinate an extended test drive and interview with senior ZMC officials, during the morning prior to the press event please contact Catherine Scrimgeour at (416) 535-8395 x 201.



ZENN Motor Company, Toronto, Canada, is dedicated to being the global leader in zero emission transportation solutions for markets around the world. Driven by quality, ingenuity, and a philosophy of social responsibility, the ZMC team is redefining what is possible in both urban and business fleet transportation.

The ZENN™ (Zero Emission No Noise) provides a complete, no-compromise transportation solution for environmentally conscious drivers who want to dramatically reduce their operating costs, and free themselves from dependence on oil. The current ZENN low speed vehicle is perfect for urban commuters and commercial fleets such as resorts, gated communities, airports, college and business campuses, municipalities, and parks. The current ZENN is sold through a growing network of retailers across the United States and factory-direct in Québec, Canada.

The planned commercialization of the ultra capacitor being developed by ZENN Motor Company’s strategic partner, EEStor Inc. for future ZENN vehicles will enable ZMC vehicles to travel at greater speeds and distances, just like a traditional car but at a fraction of the cost and with zero emissions!

For additional information please contact:

Catherine Scrimgeour

Public Affairs Specialist

ZENN Motor Company

Tel. (416) 535-8395 x 201


Monday, September 15, 2008

Feridas Abertas da Fome

Do repórter fotográfico Arnaldo Carvalho, autor das chocantes fotos do caderno especial Feridas Abertas da Fome.

Real world software engineering - II

You know the company has a problem when the developers/engineers cannot validate the veracity of the product marketing and, worst, start believing it.

Saturday, September 13, 2008

Zona da Reforma

Certas coisas são tão boas que me deixam ansioso. É o caso da Zona da Reforma:


É tão boa e me deixou tão ansioso que não tive coragem de assistir por meses. Finalmente hoje assisti a alguns vídeos que, claro, matam a pau.


Friday, September 12, 2008

My daily SharePoint frustration - IV

I got a message in my build saying "SPWeb is not CLS-compliant". I couldn't find out how to inspect SPWeb to confirm the fact. So I gave up and added false
to my project (Project/PropertyGroup element in the .csproj file)
Problem solved (or postponed?)

Real world software engineering

In my Real World Unified Process (RWUP), it is conceivable that one will look at the technology, look at the delivery date, prioritize problems and tweak requirements based on features/limitations of the technology.

Monday, September 08, 2008

Meaningful error messages

This is error code -2145091577. I was trying to enable my mouse in Hyper-V for about 1 hour, fighting with keyboard sequences. Only to arrive at error code -2145091577. Can't software have more meaningful error messages?

Sunday, September 07, 2008

Montoneros, una historia


Film documental. Ana, una ex-montonera, evoca la experiencia de los años violentos de la Argentina en el movimiento montonero con los ojos del presente y con los interrogantes que aún no ha podido responderse. Historia personal y colectiva a la vez, evoca los días tumultuosos de su juventud, desde su ingreso en la Universidad hasta su encierro en la Escuela de Mecánica de la Armada, y desde su vinculación con Juan, combatiente convencido, hasta el nacimiento de la hija de ambos, va enhebrando los restantes testimonios y las imágenes tomadas de noticieros y videotapes que reproducen rostros y episodios clave de aquellos años: el ajusticiamiento de Aramburu, los copamientos y los choques armados, la masacre de Ezeiza, el regreso de Perón al gobierno, la vuelta de los Montoneros a la clandestinidad, el tiempo de Isabel y López Rega y la usurpación del poder por la Junta Militar, con su secuela de crímenes, secuestros y desapariciones.

Dirección: Andrés Di Tella
Guión: Roberto Barandalla y Andrés Di Tella
Idioma: Español.
País: Argentina.
Género: Documental.
Tiempo: 88 Minutos.
Fecha de Estreno: 26 de noviembre de 1998


(I just watched it today - Acabei de ver hoje)

Violence in Brazil

I was born in Rio in 1974 and was raised in Porto Alegre, south of Brazil. In 1998 I moved to Canada to work with software. Along with the majority of Brazilians, I too know well how violence affects daily living there. I was only robbed twice, but I know of too many sad stories of violence. One cousin of mine was robbed thrice at gunpoint while entering his car. Another cousin took a series of bad decisions in life and was assassinated by order of the local drug lord in Rio. She was a mother of two at the time. In the many circles of conversation of Brazilians I have sat, stories of violence are an unavoidable theme. If you get a chance to sit in a circle like that, ask them to tell some of these stories. Albeit being a Canadian citizen now (my garage is full of stuff and I learned to skate on ice), I keep my Brazilian identity. My parents, my in-laws and many of my friends live there. This and other inexplicable reasons maintain alive within me a keen interest in the country.

I was listening to a Brazilian journalist in August who was comparing numbers of the violence in Iraq and in Rio de Janeiro[1]. Rio de Janeiro is one among 26 States in the Federation. The rate of killings was higher in Rio de Janeiro than in Iraq in the beginning of 2008. As he was saying, according to the Iraq Coalition Casualty Count website, from January to May 3458 Iraqis – both militaries and civilians – were killed. For the same period in Rio de Janeiro, according to official records from the Secretaria de Segurança Pública, there were 2441 homicides, 87 deaths by thievery, 17 episodes of bodily harm followed by death and 6 policemen killed in action, yielding a total of 2551 assassinations. Considering that the population of Iraq is twice bigger than that of Rio de Janeiro, one can say that Rio’s death toll is higher than Iraq’s.

Death by the police is also a concern. According to official records, in the State of São Paulo the police killed 538 people in the first half of 2006, an increase of 87% from same semester in the previous year. Police in Rio de Janeiro, in turn, killed 694 people in the first semester of 2007. As one Brazilian friend of mine here in Ottawa says half-joking, if he’s ever caught between fires of police against thieves, he’ll run towards the thieves.

Unfortunately, violence is not restricted to the largest urban centres. It is in fact spread over large regions of the country (if you ask me I can show you a map). It affects the daily habits of common people in practice. The book Violência Urbana [2] takes a serious look at urban violence. I believe the authors stated the following not in an alarmist but rather thoughtful way:

“The notions of security and communitarian life were substituted by the feeling of insecurity and by the isolation that fear imposes. The other is not seen any more as a potential partner; the unknown one is seen as a threat. The feeling of insecurity transforms and disfigures life in our cities.”

For those interested in knowing more about violence in Brazil I recommend the movies “Ônibus 174” - a documentary by Padilha and Lacerda (which reminds me of highway 174 here in Ottawa, where I drive almost daily) - and “Cidade de Deus” (City of God) by Lins and others.

As a Christian, I am reminded of the Parable of the Good Samaritan. It is one of the PG-rated parables of Jesus for scenes of violence. The religious characters of the parable did not help the victim precisely because of their religious duties and rituals. This is one reason why I value a Christianity that is not restricted to a Sunday morning moment but is intertwined with daily living and action. And this is also one reason why I fear an idolatry of the religious experience that alienates one from these difficult realities.

Gustavo K-fé Frederico

[1] Diogo Mainardi’s podcast, Veja magazine, 5/Aug/2008

[2] Violência Urbana, by Paulo Pinheiro and Guilherme Almeida, 2003 (ISBN-13: 978-85-7402-483-7)

Friday, September 05, 2008

Wednesday, September 03, 2008

Passing parameters between pages via URL in SharePoint

Many blog posts write about how to pre-populate fields in SharePoint using JavaScript. It wasn't clear to me how to pass parameters through the URL between SharePoint pages.

For instance, assume that a certain page has a URL parameter passed to it. How to embed this value in the URL to a new list item? (Often a customized version of NewForm.aspx)

Consider two pages: the source page and the NewCustomForm.aspx. This is how I did it:

1. I copied an existing schema.xml from a 'base' list template. In my case, 12\TEMPLATE\FEATURES\DiscussionsList\Discuss\schema.xml.

2. Adding a new field to the content type, I added a new FieldRef under ContentTypes/FieldRefs in schema.xml.

<!-- custom by Gustavo -->
<fieldref name="MyField">
<!-- end custom by Gustavo -->

3. I also added a new Field under Fields.

4. I added a reference to the new field in ViewFields under the proper View.

<!-- custom by Gustavo -->
<FieldRef Name="MyField">
<!-- end custom by Gustavo -->

5. Now the brain surgery: the task now is to embed the URL parameter in the link that creates a new item. In my case, the view I was working in (the view defined in schema.xml) defined a hyperlink with text and the URL in it. My task was to modify this hyperlink to append the parameter. (careful: if the redirection between pages is done by JavaScript, the href in the a element may not be the actual URL. This was my case). I begin adding a JavaScript function under the View/Toolbar element. It just gets the value of the parameter:

<Toolbar Position="After" Type="Freeform">
<RightsGroup PermAddListItems="required" />
<!-- customization by Gustavo -->

function GetMyFieldFromURL() {

var qs = location.search.substring(1, location.search.length);

var args = qs.split("&");

var vals = new Object();

for (var i=0; i < args.length; i++) {

var nameVal = args[i].split("=");

var temp = unescape(nameVal[1]).split('+');

nameVal[1] = temp.join(' ');

vals[nameVal[0]] = nameVal[1];
if("MyField" == nameVal[0]) {
return nameVal[1];

return "";

<!-- end of this customization by Gustavo -->

6. Now I can append the parameter to the URL:

<HTML><![CDATA[ <table width=100% cellpadding=0 cellspacing=0 border=0 > <tr> <td colspan="2" class="ms-partline"><IMG SRC="/_layouts/images/blank.gif" width=1 height=1 alt=""></td> </tr> <tr> <td class="ms-addnew" style="padding-bottom: 3px"> <img src="/_layouts/images/rect.gif" alt=""> <a class="ms-addnew" ID="idAddNewDiscuss" href="]]></HTML>
<URL Cmd="New" />
<HTML><![CDATA[" ONCLICK="javascript:NewItem(']]></HTML>
<URL Cmd="New" />
<HTML><![CDATA[?MyField='+GetMyFieldFromURL(), true);javascript:return false;" target="_self">]]></HTML>
<!-- _locID_text="onetid6" _locComment="{StringCategory=HTX}" -->$Resources:core,Add_New_Discussion;

7. Continuing the brain surgery: include JavaScript under the PlaceHolderMain section that does the lookup and populates the fields in the target form (customized NewForm.aspx). I followed this blog post:

I modified copied this function to populate a regular text field instead of select options.

function fillDefaultValues() {

setTextFromFieldName("MyField", vals["MyField"]);


function setTextFromFieldName(fieldName, value) {
if (value == undefined) return;
var theInput = getTagFromIdentifierAndTitle("input","",fieldName);

And this is it. Just wait for the patient to wake up from the anesthesia and everything will be alright.

This is how to see it in action:
Put your list somewhere.
Verify that the hyperlink to create a new item actually has the parameter (careful: if the redirection between pages is done by JavaScript, the href in the a element may not be the actual URL)
Click on the link to create the new list item. The parameter must be in the URL at this stage.
Note that the value of the URL made its way to the form.

If you find an easier way to do this, please let me know.

Buzzword of the day: metadata

The buzzword of the day is "metadata". The term is often abused by software developers and architects, frequently ending up in documentation for the end user. What a beautiful idea to annotate data, or set data about data. It is more interesting when the data is easily accessible and useful.

Tuesday, September 02, 2008

Rio x Iraque

"Espantosamente nos últimos 2 meses matou-se mais no Rio de Janeiro do que no Iraque. Claro que foi um exagero. Sempre exagero. [...] No caso, exagerei no número de mortes da guerra no Iraque. Na realidade, a taxa de assassinatos no Rio de Janeiro não superou a do Iraque somente nos últimos 2 meses e sim em todo o ano de 2008. De Janeiro a Maio segundo o site Iraq Coalition Casualty Count foram mortos exatamente 3458 iraquianos entre civis e militares. Pro mesmo período no Rio de Janeiro de acordo com os dados oficiais da Secretaria de Segurança pública foram cometidos 2441 homicídios dolosos, 87 casos de latrocínio, 17 episódios de lesão corporal seguidas de morte, e 6 policiais mortos em serviço. Total: 2551 assassinatos. Considerando que a população do Iraque é duas vezes maior do que a do Rio de Janeiro, pode-se dizer que a nossa guerra é bem mais mortal do que a deles.

Podcast de Diogo Mainardi, jornalista
Revista Veja, 5 de Agosto de 2008


Software design

Part of the task of software design in my experience consists of describing the system with some language that is understandable to developers (and tester and often stakeholders). It is a modeling exercise. And I emphasize language.

Monday, September 01, 2008

Teologia do Chimarrão (Theology of Chimarrão)

Teologia do Chimarrão:

(Me faz lembrar das classes da Escola Bíblica Dominical na igreja que eu participava... com chimarrão, é óbvio)