My PhotoBruno Brás Silva

09, April 1986

info@brunosilva.net

Sintra Lisbon Portugal

Category: Web

Imagine Cup 2009 - You decide

Posted on 9:13pm 5/20/2008 by Bruno Silva in Design, Events, Imagine Cup, Microsoft, Web

It’s time for us to decide the next year Imagine Cup design graphics!

There are several choices.
CREATE

Imagine Cup 2009

A celebration of imagination and technology! This bold and colorful design dazzles the viewer with rich color, energy, and motion.

LIGHTBURST

Imagine Cup 2009

Imagination, motion and the idea of creating something powerful from nothing. Time freezes as we see figures dramatically emerge from cascades of moving light.

EMERGE

Imagine Cup 2009

Inspirational elements emerge from colorful bite-sized nuggets! Fun characters playfully make their way into the design.

FLOW

Imagine Cup 2009

Creativity, motion and inspiration.

TEXTILE

Imagine Cup 2009

With its color pallet, stitch patterns and color overlay, this design evokes a sense of hand wrought do it yourself design that resonates with youth culture. Earth themes are echoed throughout with elements like rain and plants, animals and clouds.

EXPLOSIVO

Imagine Cup 2009

Vinyl Toys, Spray Paint and Felt Tip Markers. Vibrant colors and high contrast hand drawn patterns evoke an energetic street pop art aesthetic.

Cast your vote at http://www.mondorobot.com/microsoft/IC2009/!

Dia da Inovação | Final do Imagine Cup 2008

Posted on 1:57pm 5/19/2008 by Bruno Silva in Events, Imagine Cup, Microsoft, Web

Dia da Inovação - Final Nacional do Imagine Cup 2008

Amanhã na Culturgest - Lisboa pelas 9h00. Prevejo grandes projectos nesta final. :)

A agenda do dia está disponível para download.

Para quem não puder estar presente, pode sempre acompanhar a emissão em directo no Sapo Vídeos. Basta clicar na emissão ou seguir este link directo.

Amanhã lá estarei. E mais tarde sobre o evento “blogarei”. :)

Compressão de ficheiros Javascript

Posted on 9:19pm 5/17/2008 by Bruno Silva in Programming, Web

Hoje em dia cada vez temos mais Javascript nos sites que produzimos. Existem “milhentas” bibliotecas giras que usamos para produzir experiências teoricamente mais ricas para os visitantes dos web sites. Vê-se de tudo, desde bibliotecas para efeitos visuais, até frameworks de AJAX incluindo também os nosso próprios ficheiros de script.

O download destes ficheiros corresponde a um overhead considerável, e por isso mesmo enquanto estava, recentemente, a trabalhar num site recorrendo à framework Adobe Spry, pesquisei sobre formas de minimar este peso extra no download. Encontrei uma entrada de um blog bastante interessante. Compara algumas abordagens.

A redução do tamanho de um ficheiro de código Javascript pode ser realizada removendo todos os caracteres dispensáveis: comentários, quebras de linha, espaços, etc. O código continua a ser válido, e correctamente interpretado, perdendo apenas a legibilidade. Encontra-se “na moda” haver versões de debug e release para bibliotecas Javascript por esta razão.

Pode-se ainda aproveitar a capacidade de compressão no protocolo HTTP e reduzir ainda mais o tamanho dos ficheiros, tendo sempre em consideração que vai implicar processamento extra no lado do cliente, pois o que foi comprimido tem de ser descomprimido, de forma a poder ser interpretado.

Deixo a comparação entre 2 métodos distintos de redução de tamanho de ficheiros javascript, que dá bem a ideia do compromisso que está em causa.

Javascript Compression

Para utilizar ficheiros em Javascript “gzipped” basta utilizar uma ferramenta que comprima neste formato, compactar o ficheiro e colocar o ficheiro gzip no atributo src da tag script.

Exemplo: <script type=”text/javascritpt” src=”mylib.js.gz”/>

HTTP Request and HTML Parsing in .NET

Posted on 7:26pm 5/17/2008 by Bruno Silva in .NET, Open Source, Programming, Utilities, Web

I’ve been working in college assignment which goal is to integrate several information systems. One of those is a website where we can see the flight schedules from/to Portuguese airports.

The website URL is http://www.innovata-llc.com/ana/default.asp. Me and a colleague of mine had to write a web service that was used by BizTalk as a wrapper of this web site’s form. It was supposed to send an HTTP request passing some request parameters using POST parameters, and to parse the HTML response in order to extract the flight list for a given destination city and departure date.

First of all lets see the code we used to get the response.

Uri address = new Uri(requestURL);
HttpWebRequest request = WebRequest.Create(address) as HttpWebRequest;
request.Method = “POST”;
request.ContentType = “application/x-www-form-urlencoded”;
StringBuilder data = new StringBuilder();

data.Append(“DPT_Date=” + “17-05-2008″);
data.Append(“&RET_Date=” + “20-05-2008″);
data.Append(“&dpt_station=” + “LIS”);
data.Append(“&arv_station=” + “LHR”);
data.Append(“&non_stops=” + “on”);

// Create a byte array of the data we want to send
byte[] byteData = UTF8Encoding.UTF8.GetBytes(data.ToString());
// Set the content length in the request headers
request.ContentLength = byteData.Length;
// Write data
using (Stream postStream = request.GetRequestStream())
{
postStream.Write(byteData, 0, byteData.Length);
}

// Get response
String htmlResponse;
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
{
// Get the response stream
StreamReader reader = new StreamReader(response.GetResponseStream());
// Get the response string
htmlResponse = reader.ReadToEnd();
}

After getting the response content is time to use a nice HTML parser helper library. It is called HTML Agility Pack and it is open-source. You can find it at Codeplex.com/htmlagilitypack.

Now it is time to create an HtmlDocument (a class which ships with HTML Agility Pack) and load the response into this new instance. //Load HTML as XHTML
HtmlDocument htmlDoc = new HtmlDocument();
htmlDoc.LoadHtml(htmlResponse);

After looking to the HTML source code, we got the right Xpath expressions to extract the flight list.
//Get flight lines
HtmlNodeCollection flights = htmlDoc.DocumentNode.SelectNodes(
“//body/div/table[3]/tr[position()>=4 and position()<last()-1]“);

foreach (HtmlNode flight in flights)
{
//Get attributes
string departureTime = flight.ChildNodes[1].FirstChild.InnerText;
string arrivalTime = flight.ChildNodes[3].FirstChild.InnerText;
//Do some stuff …
}

That’s almost it. The next step was adding the extracted information into some data structures, and returning that data. But these details are out of this post scope.

Popfly Game Creator Alpha

Posted on 12:13pm 5/03/2008 by Bruno Silva in Popfly, Silverlight, Software, Web

Popfly Game Creator

Yesterday Popfly Game Creator was released (at least the alpha version :) )

It allows you to write a Silverlight-based games, without actually writing any code. Once again, just as I think about the original Popfly, it is hard for non-developers to use this tool, but it can be great to people who lack a lot of advanced knowledge about development but are related to Computer Science (such as students or hobbyists).

One problem about the interface is that it is meant to be used in large resolution monitors. All the buttons are big, and even with a 1280×800 resolution I had some difficulties using the Game Creator.

Here’s a screenshot of the game editor. I like the childish look&feel. :)

Popfly Game Creator Editor

Dan Fernandez has written a nice introduction to this tool on his blog. Take a look at it.

Here’s an example of a template which ships with this tool. It is called Big Race.

''

Slide Share

Posted on 6:47pm 4/30/2008 by Bruno Silva in Utilities, Web

Slide Share

Today, while reading an entry on Alcides’ blog I found out about Slide Share. It allows you to upload your slide show presentations and then get them embed in your website or blog in a flash movie.

I tried it out and it is pretty nice and useful, nevertheless there are at least 2 points which need some improvement. It does not support the pptx file extension yet, and when it comes to presentations that use animations it doesn’t work that well. This service seems that just takes a picture of each slide and turn that set of pictures into a movie with previous/next buttons. So, if you intend to use this service to share your slides, don’t forget to cut off the animations, or you won’t be pleased with the result.

This service usage is pretty similar to YouTube. You upload your file and wait until the processing is done on the servers. Than you can share the presentation in social networks and other websites. It allows you to attach the original presentation file for download, if you want so.

Here’s an example.

© Bruno Silva | Powered by Wordpress