An easy way to do a CSS Horizontal Menu

by Andrés Jaimes Here it is. Start with a conventional item list like the following: <ul class=”hmenu”>     <li><a href=””>Option 1</a></li>     <li><a href=””>Option 2</a></li>     <li><a href=””>Option 3</a></li>     <li><a href=””>Option 4</a></li>     <li><a href=””>Option 5</a></li> </ul> Don’t forget to add the class parameter to the ul tag – that will help us do…

How to create a simple gradient in C#

Creating a simple gradient using two colors is very simple: Rectangle rect = new Rectangle(0, 0, 100, 100); LinearGradientBrush lgb = new LinearGradientBrush(rect, Color.White, Color.Blue, 90); e.Graphics.FillRectangle(lgb, rect); This code will generate a gradient in the given rectangle that goes from white to blue in a vertical way (see last parameter in constructor). In this…

Printing in C# – The easy way

Believe me, it is easy. As with any class, before we can use any of the Classes, Events and Objects available to us in the .Net Framework we need to import the Namespaces we need. For this we need 3 namespaces. VB.Net users only required 2 because VB.Net assumes the System Namespace, whereas C# isn’t…

How to know if you have a light or a dark color

There is a simple way to know this. The following code takes white (#ffffff) divided it by two as our reference color. If the comparing color is “lower” than the reference color, then you have a dark color, otherwise you have a light color. function isLightOrDark($hexcolor) { return (hexdec($hexcolor) > 0xffffff/2) ? ‘light color’ :…

How to choose a printer using C#

You can assign a printer and other settings by using the basic PrintDocument and PrintDialog controls properties. Look at the next example: if (printDialog.ShowDialog() == DialogResult.OK) { printDocument.PrinterSettings.PrinterName = printDialog.PrinterSettings.PrinterName; printDocument.PrinterSettings.Copies = printDialog.PrinterSettings.Copies; }  

How to Move a WordPress Blog to a New Domain or Location

Before trying the queries in this page, I recommend you to read the full article here: http://www.mydigitallife.info/how-to-move-wordpress-blog-to-new-domain-or-location To update WordPress options with the new blog location, use the following SQL command: UPDATE wp_options SET option_value = replace(option_value, ‘http://www.old-domain.com’, ‘http://www.new-domain.com’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’; After that you will need to fix URLs of…

How to install Papyrus on Eclipse Indigo

Papyrus is a UML designer plugin for the eclipse development environment. Installing it on the Indigo version is very easy: Go to Help > Install New Software… Under Work with, select All Available Sites and look for Modeling on the tree view. Under Modeling, look for MDT Papyrus – SDK and press the Next button…

Java, brigther than ever

Java, the programming language for many of us, is shinning more than ever! Just see how Android (Google’s operating system) uses it for its applications: http://en.wikipedia.org/wiki/Android_%28operating_system%29

IIS tips and tricks

Running multiple versions of the .NET framework in IIS When you install a new .NET framework in your IIS server some applications can stop working showing you the following error: Server Application Unavailable   In the event viewer you will find this: It is not possible to run two different versions of ASP.NET in the…

Some words on Java, C# and C++

I have always considered myself a C++ guy. That was one of the first languages I learned. But, life has taken me through many different paths, and I have needed to learn others. It was seven years ago, when I tried my first cup of Java and I realized objects were a must: Why did…