Rumo ao Hexa Brasil!

Posted on: Friday, 11 June 2010 by Fab

Brazil has won the World Cup 5 times:
1958 in Sweden
1962 in Chile
1970 in Mexico
1994 in the United States of America
2002 in Korea Republic and Japan

‘Rumo ao hexa’ means on the way, on route to the sixth championship title.

To show my support, I’ve created a banner that I’m using on facebook with my profile picture. It can be used on any other social site or web site.
I’ve used photoshop to create it, you can choose which one you’d like to use:
http://www.fabsanchez.co.uk/downloads/rumo_ao_hexa.png (Transparent PNG)
http://www.fabsanchez.co.uk/downloads/rumo_ao_hexa.psd (Photoshop)

This is what my picture looks like with it.


You will need photoshop to combine your photo with either of the files above.

Good luck Brazil!

Try sleeping with a broken heart by Alicia Keys

Posted on: Friday, 7 May 2010 by Fab

What refreshing song! Reminds me of the ballads of the 80s.

Adding an image to a JavaFx Button

Posted on: Wednesday, 21 April 2010 by Fab

This is not immediately visible by looking at the API for the Button class on JavaFx, but it’s extremely easy to accomplish.
JavaFx Button Image
All we have to do is specify an ImageView instance to the graphic variable of Button.

var button = Button {
    graphic: ImageView {
        image: Image { url:"{__DIR__}image.gif" }
    }
    action: function():Void {
        println("Button clicked.");
    }
};

Just ensure the image file (image.gif in this case) is in the same (source) directory as the class that is instantiating Button.

C style printf formatting in Java & JavaFx

Posted on: Friday, 19 March 2010 by Fab

The printf command in C makes it very easy to format numbers and dates into strings. It is very convenient and flexible.
For example (C code):

printf ("%4.2f %+.0e %E", 3.1416, 3.1416, 3.1416);
// Outputs: 3.14 +3e+000 3.141600E+000

Equivalent in Java:

String s = String.format("%4.2f %+.0e %E", 3.1416, 3.1416, 3.1416);
System.out.println(s);
// Outputs: 3.14 +3e+00 3.141600E+00

Equivalent in JavaFx:

// Well, you can just use the Java classes
println( String.format("%4.2f %+.0e %E", 3.1416, 3.1416, 3.1416) );
// Outputs: 3.14 +3e+00 3.141600E+00

// or
println("{%4.2f 3.1416} {%+.0e 3.1416} {%E 3.1416}");
// Outputs: 3.14 +3e+00 3.141600E+00

Read More »

CSS & Images to Make Round Corners

Posted on: Monday, 1 March 2010 by Fab

I wanted to create a round corner border to go in a page with a background colour and to have an inner background colour of a different colour (See image below).

There are various tutorials all over the internet on creating round borders by combining images,  CSS and some that even use jQuery plugins and other javascript code.
I’ll be examining the corner jQuery plugin, the site roundedcornr.com, and Webcredible blog … These are the best ones I’ve found so far and I have used the last 2 to create all rounded corners for this site.

Rounded Corner

Rounded Corner with CSS and Images

Read More »

Java style “public static final” constants in JavaFx

Posted on: Monday, 1 March 2010 by Fab

This tutorial explains how to define your JavaFx constants (def) so you can use them in exactly the same way as you would public static final variables in Java.
For instance, how do I write the following Java statement in JavaFx:
public static final int MY_VAR = 15;

Read More »

Social Network Sharing on Wordpress (No Plugins)

Posted on: Friday, 19 February 2010 by Fab

I wanted to add some nice icons to the bottom of my posts to allow readers to share them on their favourite social networking sites.

Social Networking & Feeds

Social Networking & Feeds

I didn’t want to use plugins as I wanted to control their position and the way they looked through my own code and stylesheets. As it turns out it wasn’t that difficult to get the first few going, I downloaded some icons and modified the file wp-contents/themes/my_theme/single.php to add an RSS Feed, Share on Facebook and Share on Twitter buttons.
Read More »

Hello World!

Posted on: Tuesday, 16 February 2010 by Fab

I’ve been meaning to redesign the website for a long time.
I’ve had it for a while and although the layout and colour scheme haven’t changed much, the back-end is changed completely.

I’ve finally integrated my original design based on a CSS template called ‘green piece’ by www.mitchinson.net to Wordpress (currently at version 2.9.2).

There are still lots of CSS things to fix on the various pages, but I’m hoping I’ll tidy everything up as I go along.

I’ll hopefully use this for more than 2 weeks, which is usually when I lose interest on new things I start (i.e. the gym, the breadmaker, …)

I want this to be a diary of things I like, dislike, my hobbies/profession, travel, cinema and programming, which I really enjoy.

Here we go…