My PhotoBruno Brás Silva

09, April 1986

info@brunosilva.net

Sintra Lisbon Portugal

Category: Web

Lost in translation

Posted on 2:52pm 8/01/2008 by Bruno Silva in Curiosities, Funny, My Life, Web, XBox 360

De 25.000 pontos para 75.00 ainda vai um bocado. :-P

Descoberto a navegar no site XBox Live ao trocar a lingua de pt-PT para en-US.

New “gadget” from Microsoft Research

Posted on 1:21pm 7/29/2008 by Bruno Silva in Curiosities, Microsoft, Web

Surface on a sphere. It’s kind of a different interface.

Microsoft Surface Sphere

Cuil - Search Results

Posted on 7:48pm 7/28/2008 by Bruno Silva in Curiosities, My Life, Web

See the first result? It’s this website. See that foto associated with my website? It is not me. It is some other Bruno Silva which is a professional football player. Bad association…

See the second result? It is a webproxy, linking to my website, not relevant either. Oh and the photo isn’t mine either. :)

Have you heard about Cuil?

Posted on 6:57pm 7/28/2008 by Bruno Silva in Curiosities, Web

It’s a new search engine that claims to be the world’s biggest search engine (at least concerning the number of indexed pages). There is a lot of people interested in this potential new Google rival.

Cuil is supposed to be read as “Cool”, don’t ask me how and in which language. I love the interface is really appealing and innovative in searching engines (at least I haven’t seen anyone similar). The suggestion system is nice too.

The search engine has some flaws, though. When the system is restored I’ll leave an example.

Stay tuned at www.cuil.com.

Windows Live Agents - Notifications and Automated Messages

Posted on 7:59pm 7/24/2008 by Bruno Silva in Programming, Web, Windows Live

I’ve been writing about Windows Live Agents recently, as you recall. Finally I had the time to leave some more tips.

First Goal: Trigger a notification (procedure that is scheduled to run some time after it has been triggered and which generate messages to the current user) based on a timer event. The notification will be triggered by the current user.

How to achieve this goal?

The code bellow is contained in the Main.ddl file. First of all I declare a global variable to count the number of notifications that were made to a specific user (counter1). Then I declare a procedure that increments the counter, sends the counter value to the user as a friendly message (Notify), and then the magic happens! :)

I declare a notification, which is composed by a time interval and the script that will be executed, in the example bellow the time interval is 10 seconds and the script to be executed is a call to the same procedure.

The usage of this recursive approach makes the notification to run every 10 seconds starting from the first call to the Notify procedure. The fist call is made when the user types “notify” and sends this message to our agent. Pretty simple.

Second Goal: Start a conversation with an user

If you want to start a conversation with a user, instead of reacting to the user input, BuddyScript allows you to achieve that objective. But be careful about the License Agreement and make sure you read it before you start developing a agent with this kind of behavior. In spite of this issue I’ll show an example for educational purposes only. ;)

How to achieve this goal?

While declaring a procedure you can add the startup keyword to run this procedure when the agent is loaded, and you can specify a time interval between calls to this procedure. In the example bellow we have a  timer-based procedure running every one minute since the agent is loaded.

To start a conversation with a user you can use the initiate command, which receives a user id (e-mail) and a procedure name to be called (this command can be used for other purposes, check the documentation in MSDN). The engine will start a conversation with the requested user and call the procedure in that user’s context (this way only that user will receive the messages sent by this call). You can initiate conversations with several users, just add several lines like the last one in the example above.

Blog - Archive pagination fixed

Posted on 8:02pm 7/08/2008 by Bruno Silva in Programming, Software, Web

I had a bug in pagination when navigating through categories or dates :(

It was due to a  customization I made sometime ago to make Wordpress 2.5 work o a IIS web server.

Instead of

$_SERVER[’REQUEST_URI’]=’/page/1′;

It must be

if($_SERVER['REQUEST_URI']=='')

$_SERVER[’REQUEST_URI’]=’/page/1′;

Shame on me :-P

© Bruno Silva | Powered by Wordpress