domingo, 6 de abril de 2008

The One With the Bags

I think that's it - I'm finally going to travel around Europe this Summer. I wish I could convice more people though. I had to say this, I'm freakin' happy!

Meanwhile, I fell in love with this website. It has a wonderful collection of great fine art photography. Check out Nitsa's Street Photography, it's just beautiful.

And... I'm HUGELY addicted to this little game, Dolphin Olympics. I can't believe a tiny game like this could ever be so great... I don't think I can let it go! (my topscore is above 2 million , haha, beat that suckers!)

That's all folks.

sábado, 29 de março de 2008

So divine

A week full of great stuff. I don't even know where to start... and I really haven't listened/played with everything new I got this week.

But let's give it a try! Starting with music...


I finally gave it a go to Corrosion of Conformity, with the album "In The Arms of God".

It's doubtful category of "Sludge Metal" wasn't taken by any chance; it's actually hard to describe C.O.C. music style. Mixing a bit of the early hardcore punk with the new stoner metal sound, it results in some kind of melodic brutality... which is awesome to hear out loud, shout directly from their lungs. Recommended!







Possibly, Jack White's favorite side project ever. The Raconteurs are back with "Consolers Of the Lonely", after their debut album in 2006. And they do, in fact, console. The similarities between Raconteurs and The White Stripes are obvious, but, there are major differences. Instead of the traditional blues -semi-progressive- rock they got us used to, we find in Consolers of the Lonely pure garage rock, as if Jack White worked with The Kills back in 2003. Much more solid than the previous work, there's plenty to enjoy here, in a wide selection of genres distributed across 14 tracks.





Yeah! Good ol' doom metal in it's best! But wait, that's not all! You'll even get a free sample of sludge metal and stoner metal in the box! Free of charge! I cannot hold responsabilities for damages in your pinky and index finger, after listening to Electric Wizard's "Dopethrone". Truly great stuff.










As for movies... the reviews will come next week, as well as the rest of the albums. One step at a time, dear ones... one step at a time.

domingo, 23 de março de 2008

Flex 3 and PHP

I'm tired of searching for Flex 3 and PHP tutorials on the web, and non of them working. Why? Because most of the tutorials you find are made for Flex 2 instead of Flex 3, and some database-relevant code has changed in this version.

So, I came up with a simple working solution, 100% Flex 3 compatible. This example will fill a Flex Data Grid with the existing data from an existent MySQL database table, allowing you to add information as well. It's still not bug-free, as it's still possible to add blank data to the table.

Here's what it looks like:

The button "Adicionar" it's what actually expands the menu, allowing the user to insert new values. (I wanted to experiment with 'States' as well, so I included them). The 3 dataGrid columns are retrieving data from the 3 existing fields in the database.

1) Let's begin with the database itself: (use Apache/Wampserver to run it locally)

Database name: flex1
Table name: contactos
Username: rychas
User password: 123456

Field1: id
Field2: nome
Field3: email

And add some contacts to these fields.

You're obviously free to change these parameters, as long as you change the correspondent values in the PHP file. Create them like these if you want to use the PHP's directly.

2) The PHP coding.

This is the main file, that will read the database and output its data as XML.
Call this file "rest.php".

<?php

$MySQLConnection = mysql_connect( "localhost", "rychas", "123456" );
//connecting and picking DB

mysql_select_db( "flex1" );

//making the query from table contactos
$Query = "SELECT * from contactos";
$Result = mysql_query( $Query );


/* fetching data and output as xml */
print "<people>\n";
while( $Row = mysql_fetch_object( $Result ) )
{
print "<person><id>".$Row->id."</id><name>".$Row->nome."</name><email>".$Row->email."</email></person>\n";
}
print "</people>";
?>


If you run this file directly and check the html source code, you'll find a XML tree with the data. Flex will interpret these results.
I'm gonna leave the user adding for later. Let's get to Flex.

3) Flex 3 application

This is the entire Flex 3 code, so just create a new Project and paste this code. PLEASE be aware of the php files location; I'm using a local server (localhost) and the files are in a root folder called "flex1". If your source php is in a different location, which is more likely, change this in the third code line.


<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="rest_service.send()" >

<mx:HTTPService id="rest_service" url="http://localhost/flex1/rest.php"/>
<mx:Panel width="365" id="pp" resizeEffect="Resize" height="229" layout="absolute" title="Lista de utilizadores" horizontalCenter="0" verticalCenter="5">
<mx:DataGrid dataProvider="{rest_service.lastResult.people.person}" id="lista" width="316.5" height="125" x="18.5" y="18">
<mx:columns>
<mx:DataGridColumn headerText="ID" dataField="id"/>
<mx:DataGridColumn headerText="Nome" dataField="name"/>
<mx:DataGridColumn headerText="Email" dataField="email"/>
</mx:columns>
</mx:DataGrid>
<mx:Button x="251" y="157" id="adiciona" label="Adicionar" click="update();"/>


<mx:Script>
<![CDATA[
import mx.controls.Alert;
private function update():void{
lista.enabled=true;
lista.focusEnabled;
currentState="registo";

}

]]>
</mx:Script>

</mx:Panel>

<mx:states>
<mx:State name="registo">
<mx:SetProperty target="{pp}" name="height" value="56%"/>
<mx:AddChild relativeTo="{pp}" position="lastChild">
<mx:TextInput x="18.5" y="183" id="utilizador"/>
</mx:AddChild>
<mx:AddChild relativeTo="{pp}" position="lastChild">
<mx:Text x="18.5" y="157" text="Utilizador"/>
</mx:AddChild>
<mx:AddChild relativeTo="{pp}" position="lastChild">
<mx:Text x="18.5" y="213" text="Email"/>
</mx:AddChild>
<mx:AddChild relativeTo="{pp}" position="lastChild">
<mx:TextInput x="18.5" y="237" id="email"/>
</mx:AddChild>
<mx:AddChild relativeTo="{pp}" position="lastChild">
<mx:Button x="250" y="265" label="Submeter" click="reg_user.send();"/>
</mx:AddChild>
</mx:State>

<mx:State name="outro">
<mx:SetProperty target="{pp}" name="title" value=""/>
</mx:State>
</mx:states>

<mx:HTTPService id="reg_user" result="confirma(event)" showBusyCursor="true" method="POST" url="http://localhost/flex1/add.php" useProxy="false">
<mx:request xmlns="">
<utilizador>
{utilizador.text}
</utilizador>
<email>
{email.text}
</email>
</mx:request>
</mx:HTTPService>

<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
private function confirma(evt:ResultEvent):void{
mx.controls.Alert.show("Utilizador adicionado");
}
]]>
</mx:Script>

</mx:Application>


The really important thing is the first few lines, that define the dataGrid parameters. The "people.users" actually refers to the XML category that will be read. The 'dataField' specifies which label will be read by each column. If you change the XML's output in the rest.php file, you'll have to change it here as well.

4) Adding a user

This is the traditional PHP code to add something to a database. It'll just get the values sent by Flex, in the "utilizador" (means user) and "password" fields. If you change them, you'll have to change this file too.

Call it add.php.

<?php
$con = mysql_connect("localhost","rychas","123456");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db("flex1", $con);

mysql_query("INSERT INTO contactos (nome, email)
VALUES ('$_POST[utilizador]', '$_POST[email]')");

mysql_close($con);
?>

5) You're done! Now just run the project. If you did everything right, the data should be written in the columns immediately. XML output will give you plenty of possibilities to play with, but I don't think there is a direct way of Flex connecting to a MySQL database.

sábado, 15 de março de 2008

Eternal Circle


The belt is tight nowadays, when it comes to money. There's simply so many wonderful things that you wish for but can't have, fearing the risk of money spent the wrong way.

Fortunately, I was right about Bob Dylan's Bootleg Series; best ~23 dollars~I ever spent. If you're familiar with Dylan's work, you know how simple it is for him to write and compose a beautiful song, easily to be related with one way or another. And among the extense list of recordings the man has gave us since the early 60's, one tends to think that that's all there is to it - nothing else could possibly be squeezed into the hot chocolate cup anymore.

And then you find about 50 rare recordings and b-sides Dylan never included in his LP's, maybe because they didn't fit, maybe because they weren't good enough for him. But the truth is, some of that work is gorgeous work, in fact, almost all of it. These recordings express themselves almost as a form of naked music, uncovering the organs of a fabulous conceptual machine.

This one will certainly be a keeper.


And Down tickets are already kept in the precious stuff-shelf. I never thought I would actually like this kind of Metal, but it's a straight fact that I really do. The concert takes place by the end of next month, and it'll be my first metal concert. And with great company.


I'm also updating my song covers list, already have a lot more and there's a few still on the list right now. What started as curiosity a few months ago may now be one of my obsessions.

sexta-feira, 7 de março de 2008

Just Like Heaven




Tomorrow, by this hour, I shall be seeing one of the greatest bands alive, The Cure! It's finally my chance to watch Mr. Robert Smith in person, which will most likely happen once in this lifetime.

Don't take me wrong, I'm not the biggest and craziest fan about The Cure. I just happen to really like them, what they did and what they do, and truth be told, the band had a major influece in my teenage years. So it would be silly not to take this chance.

I d0n't even know what their current line up is! I shall now do some background checking and song reviewing in order to be... prepared! :D

sábado, 23 de fevereiro de 2008

The Incredible... Macro Box!

I've been asked a few times about the right way to photograph an object alone, like most of the commercial products you see nowadays, especially when it comes to marketing. If you want to take an isolated photo of an object, it isn't always simple to eliminate completely the background and still manage to control the lightning you want.

You can't simply place an object on a table and expect it to look good. So what's the trick?



A few years ago, me and some friends did some research about a home made system that could provide us basic control over both the object, environment, and lightning. Without spending a lot of money, of course, and by a lot of money I mean anything above €15!

So... we created a box.






Yep, this is it. An old micro-wave box which can wonders. But you need to modify it, in order to provide some basic (good) lightning and color control.

Step 1) Get a box. A big one, if you're using large objects. Place it so the opening will be facing you.

Step 2) Cut 4 holes in each side of the box: two on the side, one on top and one on the back. These holes should be large, it's where our light will come from; but should still be small enough to be covered with an A4 size sheet.

Step 3) We could leave our holes as they are, but the light would be too harsh and we need to diffuse it. Paper will do just fine. So get 4 A4 pieces of thin white paper and cover these big holes from the outside.

Step 4) Cut the flaps on the opening, you won't need them.

Step 5) This is important as it teaches you how to get the infinite background effect. You simply have to place a LARGE piece of paper inside the box, in a curved shape (NOT like the photo above!!!)

Here's a sketch, using side view (yes, my drawing skills are extremely unique):



As you can imagine, shooting this object from the front will simulate an infinite horizon, and no one will be able to tell you've used a sheet of paper to get the effect.










Step 6) Lightning. You will need it, and lots of it, wether it's natural of artifficial. And this is actually the fun part. I prefer using artifficial light because I can control it better, and placing colored sheets in front of white lamps gives you a natural control of coloring. I usually use two lamps coming from the side, other times I use one on the side and another one coming from the top.

For natural effects, ONLY use white lamps, not yellow.

Optional Step: Use black cardboard or black sheets in order to create dark effects (see Porsche image above). You can do whatever you like, depending on the effect you wish to create.

Optional Step 2: Mirrors! It's amazing what a simple flat mirror can do. Simply place it as the "floor", and be careful not to shoot it's edges while composing the frame. This works better with dark environments.

Optional Step 3: If you don't have a mirror large enough, you can use black silverware plates filled with water.

Optional Step 4: Macro rings. If you can't afford a macro lens, or don't have a camera capable of changing lenses, look for a small dioptry macro ring and put it in front of you camera. This will reduce your field of view and enable you to shoot closer, comfortably.

Optional Step 5: A tripod will make your life a whole lot easier.

Optional Step 6: Use closed aperture values (f8.0+) and shoot longer.

And that's pretty much it. It all depends on the lightning, and how you play with it. I'm only giving you my best way to control it, but it's still up to you to find the correct values to play with. Keep in mind that different materials and color completely change the way your object will look like

domingo, 3 de fevereiro de 2008

Passage





Today, while reading a few blogs, I discovered a tiny game (not quite a game, but keep reading) that changed my state of mind, and probably speeded up my heartbeat rate for a while. It's called Passage, and it's an old-fashioned side-scrolling game with a unique characteristic:

It represents your whole life during 5 minutes.

The game itself only lasts 5 minutes, then you die. It's a simple, yet complex maze where you control a young character. Eventually, this character will grow old, slowing down, and at the end, die. You can read the author's notes to become fully aware of what this game means, in it's full complexity.

At the start, you have the possibility to team up with someone else (your wife). But you can choose not to, and your character will walk faster and manage to get through mazes you couldn't reach with company. But if you team up, you'll walk side by side (in love!) through the whole thing.
You begin in the left side of the screen, and the right side (which represents your future) is a giant amount of blurred pixels. As you walk by, you can search for treasures in complicated mazes, increasing your score. But you won't live to see all the scenery, and just walk around freely with your love. As you get near the end, you're already on the right side of the screen, not much future to look up to, and the left side of the screen is now the blurry part... your past.
And you begin to think if your score is really that important.

You get the idea of the game, but you really have to play it to feel what it has to tell you. I was shocked when I felt that the "life algorithm" could be recriated in 5 minutes alone, and altough impressed, I'm now afraid of playing this game.

Download it here, and don't forget to read the author's notes.

sábado, 26 de janeiro de 2008

It's so easy

... to find good music.


The Mars Volta new album, "The Bedlam In Goliath", is a wonderful piece of musical art. The ex-At-the Drive In did it again, and managed to fit a whole bunch of delicious progressive rock jams into a new release. The lyrics are exceptional, and the hardcore feeling attached to it is superb, enough to keep my mind under constant pressure while listening to these fantastic tracks.







Finally! I found Witchcraft's second album, "Firewood", from 2005. And what could I expect from them, if not the best stoner rock alive? "Firewood" clearly steals a lot from old "Pentagram" early releases, but that doesn't take any credit away from them. Unlike the recent "The Alchemist", "Firewood" is raw and straight to the point, wrapping the corner stone between stoner rock and stoner metal in hot aluminium foil. Delicious.





Fuck fuck fuck, why do I always forget about how much I love Bowie? If there's anyone in the musical industry with a tremenduous amount of compilations, is David Bowie. (and J. Cash as well, but that's another story.) So you got to know how to pick them right. "London Boy", from 1998, is a fine way to start collecting. Why, you ask? Well, for starters you get to listen to the very original "Space Oddity" version, which seems rare to listen nowadays. The annoying "Laughing Gnome" he once tried to hide, now fits right in the middle of the album. And you get 16 more great songs from David, but it's important to mention that London Boy is not a Best Of. And that's the beauty of it, really.




And the new The Sword album, to be officially released in April this year, kicks ass.

domingo, 20 de janeiro de 2008

Buzzards and Dreadful Crows

Finally, some time to breathe. After spending the last 6 ou 7 weeks in a peep-hope every day, since early morning to late night and with no time to sleep or eating right, I find myself now in a short term peace. Only exams left to do now, which means I can start and stop work whenever I actually want!

... it feels awesome.

And these are good days, especially because... the new Mars Volta album is out! Yes, and it's fuckin' great. "The Bedlam In Goliath" is one hell of an album, I know for sure I'll keep on listening to it over and over again as I did with the previous ones. And I've discovered a great 70's stoner rock band some time ago, called "Pentagram". It's a lot like Witchcraft, and I'm eager to find more stuff from those guys.

And I'm re-watching Band Of Brothers, the best war-series related ever made in history. Only two episodes left to finish it but.. it will be worth it. They're great. And I'm also re-watching good old Twin Peaks again, in good company.

A lot of work is coming again, very soon, both related and non related to University. But I don't really care, I want to make the most of these days and also do whatever the hell pleases me.

Taking both my camera and my girlfriend out, sometime, are priorities. A lot of music and movies are next on the list. Maybe even travelling, if the time is right. Who knows what 2008 might bring.