Category Archives: língua/language

Changes in my tumblogs

I’ve had a Tumblr account for a long time but I was really missing out the fun of it: the creative visual extravaganza, maybe almost like a “visual twitter”, or the sharing wackiness of rebloging. I was missing it because I started using it as my scrapbook, a fancy aggregator to my most important online contents and the “liking” and “reblogging” didn’t fit there.

Putting Tumblr’s ability to rename tumblogs to good use, I decided to create a new one while re-branding the existing. So, from now on my scrapbook previously hosted at t3mujin.tumblr.com has moved to jpnalmeida.tumblr.com (possibly this ain’t the definitive url, more on that one of these days), and in it place there’s a new one destined to unleash my potential without restrictions.

Have fun!

Migrating a Visual Studio 2005 Guidance Package to Visual Studio 2010

Visual Studio 2010 has brought the concept of extensions, a brand new set of tools to extend and adapt the software to the needs of each developer.  This is great for Visual Studio users, for having a shiny new Gallery with lots of extensions, but also for addin developers as it makes the development process much easier.

But how about Guidance Automation (the way to go in extending Visual Studio 2005 and 2008)? To have all those guidance packages out there Microsoft released Guidance Automation Extensions and Guidance Automation Toolkit 2010, that allows to building and deploying existing projects as a VSIX package in Visual Studio 2010. But putting an existing guidance package to work in Visual Studio 2010 isn’t a seamless process and requires to migrate it manually, described thoroughly in this guide:

How to Update a Visual Studio 2008 Guidance Package to Visual Studio 2010

Although it’s aimed for Visual Studio 2008 guidance packages it also works for 2005, even if not out of the box. The main glitch is in step 4d while running the UpdateGuidancePackageToVSIX recipe: it won’t update the Version and PublicKeyToken of .vstemplate files because it expects a different version of the Microsoft.Practices.RecipeFramework.VisualStudio assembly, we must edit the WizardExtension element in all .vstemplate files manually (or replace in all files using a an editor like Notepad++) so in the end it each of them looks like this:

<WizardExtension>

<Assembly>

Microsoft.Practices.RecipeFramework.VisualStudio, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35

</Assembly>

<FullClassName>

Microsoft.Practices.RecipeFramework.VisualStudio.Templates.UnfoldTemplate

</FullClassName>

</WizardExtension>

Along the process some other issues might happen that could make the migrate more complicated:

  • The classes of namespace Microsoft.Practices.WizardFramework.Configuration exist in two assemblies (Microsoft.Practices.WizardFramework and Microsoft.Practices.RecipeFramework.VisualStudio) and if any of these classes is used we’ll have to use an extern alias to resolve the ambiguity,
  • If “The “GenerateMenuResource” task failed unexpectedly (…)” happens double check that the properties of each .vstemplate file are set to Build Action=Content , Copy To Output Directory=Copy if newer, Include in VSIX=True and also that there aren’t any .vstemplate files not included in the project (either include or delete them).

Sent from my iPhone/Droid/BlackBerry/(…)

Photo by catherinemariegriffin

People are  disliking the “Sent from my iPhone/Droid/BlackBerry/put-mobile-device-here”, myself included, because they’re obnoxious and have no real use. And the truth is when you read it the real meaning to what the sender is saying is either:

  1. Hey, I got a brand new iPhone/Droid/BlackBerry/put-mobile-device-here!! (this is the default from most device manufacturers)
  2. You’re not important enough for me to write a proper response to your email

So what’s yours?

Toodledo Web App for Google Chrome

Use Toodledo as your to-do list? Are you already using a Google Chrome’s development build with support for Web Apps (if you want to know how to do it read this first)? Now you can add Toodledo Web App for your Google Chrome.

Download it here!

15 Facts About Net Neutrality

15 Facts About Net Neutrality [Read Write Web]

What does mean loosing Net Neutrality

via reddit

Concursos fotográficos, um bom negócio…

Não gosto de concursos fotográficos, e isto alarga-se a muitos outros tipos de concursos criativos; são dos maiores embustes onde quem participa está crente na ilusão de promoção, de uma esperança vã de crédito reconhecido e possivelmente de um prémio (muitas vezes magro); mas na verdade não passam de uma forma fácil para quem os organiza, muitas vezes grandes empresas ou autarquias (ou como no caso abaixo, do novo concurso do Turismo de Lisboa), de obter conteúdos a um custo marginal, até porque muitas das vezes nem existe prémio monetário, tal como neste excerto das regras do novo concurso do Turismo de Lisboa:

(…)

Cada autor deve mencionar especificamente, no respectivo email ou carta, que cede ao Turismo de Lisboa todos os direitos de utilização das imagens que enviar;

O Turismo de Lisboa poderá utilizar todas as imagens recepcionadas, sejam elas premiadas ou não;

(…)

O prémio consiste na publicação de uma fotografia por mês, durante um ano, a partir de Novembro, na Revista Turismo de Lisboa-RTL, no Guia Follow Me e no site do Turismo de Lisboa. Será ainda atribuída uma peça em cerâmica, representativa de Lisboa, a cada um dos 12 vencedores;

via Visit Lisboa

A troco de um potencial destaque nos meios de comunicação da entidade e de uma mão cheia de peças de cerâmica para os vencedores, fica-se com um arquivo mais recheado de conteúdos sem quaisquer restrições ou limitações de utilização, conteúdos aos quais os autores abriram mão de todos os direitos de utilização, ainda por cima porque se tratam de todas as fotos a concurso e não só as doze vencedoras. Não querendo por em causa a má fé este concurso do Turismo de Lisboa, ou tantos outros, a verdade é que se trata de um bom negócio para algumas das partes, mas provavelmente não para todas…

Block noise with noise

Noise is a huge issue at workplace, the modern trend of open-space offices too often means you end up having a noisy environment. Some people deal with noise much better than others, but unfortunately I’m not one of them and usually I’ve a fair amount of time, and money, searching for the best way to block, trying several combinations of noise isolating headphones and earplugs with different kinds of music.

Amazingly, at least for me, one of the most effective methods I’ve found was using a white-noise generator, and the theory is simple: our brain can easily filter and ignore flat, constant sounds (like a fan working in the same room or rain pouring outside). I ended up using SimplyNoise, a real simple web-based generator that plays white noise, pink noise and brown noise (more on noise colors here) with a few other tweaks. Usually work better with the more “rain-ish” sound brown noise.

Injecting properties in Ninject 2 without “[Inject]” attribute

Dependency Injection is a great way to remove dependencies while having an lightweight container (a “service locator”) wiring up the application’s components and resolving instances and relationships. But Ninject, one of the dependency injection solutions for .Net, adds another unwanted dependency: to the container itself.
A dependency to Ninject is needed when initializing the container and obtaining entities, although the latest can be minimized using the Common Service Locator library to create an abstraction to most of the currently available dependency injection implementations. But Ninject also adds a dependency to the classes that will be initialized by the container, this is not desired and should be avoided at all cost and these classes shouldn’t be aware how they’ll be instantiated.
Ninject defines an attribute (Inject) used as an hint by the Ninject kernel to know where to inject the instantiated objects; although this attribute is optional for Constructor Injection is mandatory for Property Injection and Method Injection.

// My class where Ninject
// will create and inject
// an instance of IWeapon
public class Samurai
{
    //  This is a Ninject attribute,
    //  if we switch to another
    //  DI container the code will break
    [Inject]
    public IWeapon Context { get; set; }
}

Fortunately Ninject is highly customizable and allows to change that behavior, the plan is to create a custom attribute and configure it so that Ninject can use it the same way it uses the Inject attribute. The usage will be similar but all the dependencies will be to local classes, the custom attribute can be something as simple as this:

public class InjectHereAttribute : Attribute
{
}

The class will now look like this:

public class Samurai
{
    //  Now there's no external dependency,
    //
    //
    [InjectHere]
    public IWeapon Context { get; set; }
}

Now Ninject must be configured to use the custom attribute, this can be done by creating an implementation of IInjectionHeuristic that recognizes the custom attribute:

public class CustomInjectionHeuristic : NinjectComponent, IInjectionHeuristic, INinjectComponent, IDisposable
{
    public new bool ShouldInject(MemberInfo member)
    {
        return member.IsDefined(
          typeof(InjectHereAttribute),
          true);
    }
}

And finally add this behavior to the Ninject Kernel using the Components collection, it will run along the existing components, namely the default implementation of IInjectionHeuristic, which means either the default or the custom attribute can be used.


// Add custom inject heuristic
kernel.Components.Add<IInjectionHeuristic, CustomInjectionHeuristic>();

Avoid social noise in your timeline

Lately I’ve been growing a “pet hatred” towards applications that automatically post updates to Twitter or Facebook, specially those that do it often, I’m thinking in “I’m in [some place]” kind of posts of location-based services like Gowalla and Foursquare or the “Just listened to [some song]” updates of media players, just to name a few. The problem with these updates is that there’s no added value, nothing really relevant to share; while sometimes generated updates are useful, posting blog updates is the best example, in most cases a automated tool can’t add content, can’t share what’s so cool about that song or place, can’t share the context for that update. This often means a noisy timeline that people want to avoid and that’s why automated update services should be used sparingly, prefer sharing items explicitly and really sharing something rather that dumping stuff the timeline.

Switch to our mobile site