Andrés Jaimes

design, photography & web development

Show User Library Directory in Mac OS X Lion

Show User ~/Library in OS X Lion Launch Terminal from Spotlight or Launchpad > Utilities, and enter the following command to show the directory: chflags nohidden ~/Library/ The users Library folder will immediately become visible. Reverting this back to the standard Lion setting is simple too: Hide User ~/Library in OS X Lion (default setting) [...]

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 but 3, the VB.Net counterpart only required 2 because VB.Net assumes the System Namespace, whereas C# [...]

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 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 [...]

Reocities, a web time traveller…

If you are one of those who started surfing and creating the web in the 90′s, Reocities will take you back in time to the beginning of an era. Blue text on green or yellow wallpapers and animated gif’s overloaded the pages during the last decade of last century. After Geocities closed in 2009, Reocities [...]