01
Mar 12

A lesson that every developer must know about multiple class cascade in CSS

The text above was taken from http://css-discuss.incutio.com

Please read the red text above at least 10 times… :)

“What’s the expected behavior when an element has multiple classes which redefine properties? Here’s an example:

<style type="text/css">
  .headline { border: 3px solid red }
  .newsitem { border: 2px solid red }
  .blurb    { border: 1px solid red }
</style>
...
<h1 class="headline newsitem blurb">French Noblewoman Advocates Increased Cake Consumption Among Peasants</h1>

Will the border of the H1 element be 3, 2, or 1 pixel wide?

To answer this question you need to understand how Selector Specificity works in CSS. In this case the (rough) answer is the "last highest-weighted rule wins", so the border will be 1px. Note that it’s the order of the rules in the stylesheet that controls which takes precedence; the order of the class names in the class attribute is irrelevant.”


01
Jan 12

11 Things every Software Developer should be doing in 2012 by Michael Crump

Do you need help to improve your personal quest to be a better developer?

Read this blog post created by Michael Crump.

Click here to visit original post!

“Introduction

2011 is winding down and 2012 is upon us. Have you set any goals for 2012 both professionally/personally? Regardless of the answer, I’m sure one or two of the items listed below can help. I usually don’t blog many opinion posts, due to the fact that I like to keep my blog technical. This post is an exception. :)

11 Things every Software Developer should be doing in 2012.
  1. Get on Twitter – If you’re not using Twitter and are a Software Developer then you are missing out. I believe that Twitter is the one of theMOST important tool a Software Developer can use. Why?
    1. Regardless if you have 10 followers or 10000 followers, any coding question can be found and answered in a matter of seconds using Twitter Hashtags. 
    2. Get software developer news straight from the source by following other developers.
    3. Again hashtags – To monitor topics important to you. For example, I use it to monitor #wp7, #silverlight and #wpf. 
    4. To stay engaged in a conversation with other developers and to see what projects they are working on. 
  2. Read StackOverflow Daily – StackOverflow is the number one forum for asking a coding question. Even if you don’t have an account, it’s worth it just for browsing questions and learning. I think it is a wise investment of your time to spend at least 20 minutes a day reading StackOverflow.
  3. Start a Blog – I believe that every Developer should have a blog. Why?
    1. It is a footprint that we leave for other developers studying our craft.
    2. It allows you to become engaged in the community.
    3. It helps you market yourself as a professional.
  4. Get out there – Get out of your shell and start talking to other developers at local user groups/other meet ups/conferences. I will let you in on a secret – most everyone is shy at first. If you start a conversation with them then it usually takes off very fast.
    1. Networking with other developers is big – really big. You start building connections in the industry and if you ever need help then you have someone to go to.
  5. Carry around a modern phone – If you’re a developer and carrying around an older phone then its time to upgrade. I remember a manager at one of my jobs that had to walk back to his desk to email me something. I remember thinking, “This guy is in IT?” Just like some industries you need to drive a fancy car, have nice clothes or the latest jewelry. In technology, we need to stay current with our computers, software and mobile phones.
  6. Embrace Mobile  – Do you think this “mobile” thing is going away? Well, it is just getting started. You need to know more than how to develop for the iPhone, WP7 or Android. You need to learn how to create web applications that will run on every mobile device. (Including phones, iPads, Windows and Android slates). I believe that every developer will have to create a mobile application in his/her programming career. This is something a modern developer cannot ignore.
  7. Learn at least one design pattern- I am not going to tell you which one you should learn or focus on, but you need at least one. I prefer MVVM for myself because I am a Silverlight/WPF/WP7 Developer. If you are familiar with at least one design pattern then it would make me feel better about hiring you.
    1. I’d start with this book: Gang of Four – Design Patterns: Elements of Reusable OOS.
  8. Set reachable goals each and every year – Create a short-list of goals that you are looking to accomplish in the next year. Not only should you be challenging yourself with a set of goals, you should also create a quarterly outlook/Gmail reminder to evaluate your progress. I am a believer that you should start small with a goal and build up from there. I did this with my MCPD certification. I shot for the MCP, then MCTS then the MCPD.
  9. Learn a different programming language –  Simply put, it broadens your perspective and permits a deeper understanding of how a computer and programming languages actually work.
    1. If the only tool you have is a hammer, you’ll treat every problem as a nail.
  10. Boost your confidence – It always amazes me how few developers are confident in themselves. If you feel like you’re behind on something then learn it. I can’t find any excuse for staying ignorant in this industry. There is just too many FREE resources on the web. 
  11. Read Blogs/Programming Books/Magazine – How many programming books have you read this year? What about good developer magazines? I believe a good developer would read at least 5 programming books a year and at least a magazine or two monthly. Even if you don’t have a subscription to MSDN you can get the .PDF for free a month after release.  How can you get better if your not constantly reading?”

11
Dec 11

Blog RSS Updated

If you follow my blog please update the RSS URL.

For now on I have two URLs. One for my posts and another for my recommended readings/recent readings.

If you would like to read my personal posts use http://feeds.joao.manso.eu/GeeknessInWords.

If you want to get some spam about recommended readings/recent readings please subscribe http://feeds.joao.manso.eu/GeeknessInWords/RecentReadings

Thanks


24
Aug 11

How to upgrade your apps to NHibernate 3.2 with Fluent NHibernate 1.2

Since version 3.0 the number of files that NHibernate uses shrink. So first, you need to know what kind of files you need to update and delete.

In version 3.0 NHibernate:

    • NHibernate
    • Iesi.Collections
    • Remotion.Data.Linq
    • NHibernate.ByteCode.Castle
    • Castle.Core
    • Antlr.Runtime

In version 3.1, Antlr.Runtime and Remotion.Data.Linq have been ILMerged into NHibernate

  • NHibernate
  • Iesi.Collections
  • NHibernate.ByteCode.Castle
  • Castle.Core

In version 3.2,  NHibernate integrates a default lazy provider based on LinFu

  • NHibernate
  • Iesi.Collections

To upgrade to the last version 3.2 you need to update the last two DLLs and delete the rest ( here ).

If your app uses any DLLs from NHibernate Contrib you need to update them to the version 3.2.

Next you need to download Fluent NHibernate 1.2 ( here ).

After the update of Fluent DLLs is necessary to change the fluent configuration, to start using the default lazy proxy.

From:

.ExposeConfiguration(c => c.SetProperty( Environment.ProxyFactoryFactoryClass, typeof( ProxyFactoryFactory ).AssemblyQualifiedName))

 

To:

.ExposeConfiguration(c => c.SetProperty( Environment.ProxyFactoryFactoryClass, typeof( DefaultProxyFactoryFactory ).AssemblyQualifiedName))

 

And because Fluent 1.2 expects NHibernate 3.1 you need to redirect the DLL in .config.

<runtime>
   <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
          <assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral" />
          <bindingRedirect oldVersion="0.0.0.0-3.2.0.4000" newVersion="3.2.0.4000"/>
       </dependentAssembly>
    </assemblyBinding>
</runtime>

 

Is possible to avoid the redirect, if you download the source code of Fluent NHibernate 1.2 and create a build with NHibernate 3.2 DLLs.


11
Aug 11

Disabling an element in jQuery 1.6

Last week, I had to update the jQuery to the last version 1.6.2 because the version 1.5.2 didn”t work properly in IE9. After that upgrade and some more tests. I discovered some problems disabling some elements. After trying to find out why the hell the disabling was not working I found the answer. With the release of jQuery 1.6, the recommendation has been to generally start using prop() where you used to use attr().

So is necessary to substitute

$(''.control'').attr(''disabled'', ''disabled'');
$(''.control'').removeAttr("disabled");

 

with

$(''.control'').prop(''disabled'', ''disabled'');
$(''.control'').removeProp("disabled");

24
Jul 11

How to add Windows Live Writer additional dictionaries

If you need to add another dictionary to check the content of your blog post to find spelling errors,  you need to install another language pack. So you must go to the Windows Control Panel and select Clock, Language, and Region. Press Windows Live Language Setting and select the language of the new dictionary. When the installation is done the user interface (UI) of Windows Live Writer will change to the new language. You can revert this running the Windows Live Language Setting again and select the original language.

1 - Control pannel

2 - Select Language

image


24
Jul 11

Pizza Pão (Bola)

image

Ingredientes

Pão fatiado ou bolas cortadas ao meio
Polpa de tomate
Queijo mozarella
Cogumelos fatiados
Bacon fatiado
Azeitonas
Orégãos
Azeite

Preparação

Barrar o pão ou as bolas com a polpa de tomate.

Colocar  o queijo mozarella, os cogumelos,  o bacon, as azeitonas, os orégãos e um fio de azeite.

Por fim, colocar no forno por 10 minutos a 220º.