Archive for the ‘.Net’ Category

Atom to RSS 2.0 converter - The C# way

Friday, November 28th, 2008

This blog was on blogger but a few weeks ago it started to launch a java connection exception. It doesn’t allowed me to publish my blog at this address through ftp.

Then I decided to switch to WordPress so I extracted a backup from blogger in the Atom format and tried to import it, but WordPress only accepts RSS 2.0

I tried to find an out of the box solution to make this convertion between Atom and RSS but nothing. So this is my implementation in C#

 1:// -----------------------------------------------------------------------
 2:// Isaias Gonzalez <siderevs@gmail.com>
 3:// -----------------------------------------------------------------------
 4:
 5:using System.IO;
 6:using System.ServiceModel.Syndication;
 7:using System.Xml;
 8:
 9:namespace DeAtomizer
10:{
11:    public class AtomToRss2Converter
12:    {
13:        public void AtomToRss20(string atomFileName, string rssFileName)
14:        {
15:            ConvertToRss20(ReadFeed(atomFileName), rssFileName);
16:        }
17:
18:        private static void ConvertToRss20(SyndicationFeed feed, string rssFileName)
19:        {
20:            Rss20FeedFormatter rss2 = new Rss20FeedFormatter(feed);
21:            XmlWriter writer = XmlWriter.Create(rssFileName);
22:            rss2.WriteTo(writer);
23:
24:            // You can also use 
25:            // feed.SaveAsRss20(writer);           
26:        }
27:
28:        private static SyndicationFeed ReadFeed(string fileName)
29:        {
30:            StreamReader stream = new StreamReader(fileName);
31:            XmlReader reader = XmlReader.Create(stream);
32:            SyndicationFeed feed = SyndicationFeed.Load(reader);
33:            return feed;
34:        }
35:    }
36:}

And as you can see, I successfully converted the file.

flickrFavs 0.2.1 - Corrected

Friday, May 25th, 2007

This post is about a new corrected version of flickrFavs, statistics on the use of my tools for flickr and a list of the all time most visited interesting pictures pages in The Most Interesting Pictures By…

Nueva Versión de flickrFavs

Hay una nueva versión de flickrFavs. Corregí unos errores que surgieron por el uso de una versión vieja de Flickr.Net.

Gracias a Silke, Michael y Evolutica por avisarme acerca de esto. Ofrezco una disculpa por tomar tanto tiempo en corregirlo… Estoy trabajando en una versión completamente nueva pero la verdad es que he avanzado poco. Así que consideren esta versión sólo como un patch.

Algunos datos de mis programas para flickr.

flickrBuddy alcanza ya las 90 descargas por mes. flickrFavs está en un nivel similar, es un poco más popular pero este error que lo sacó del aire un tiempo le ha afectado.

Mi herramienta más utilizada sigue siendo The Most Interesting Pictures By…

En marzo alcanzó las 67441 visitas -visitantes únicos, con aproximadamente 90 000 page views. El ancho de banda comienza a ser un problema para mi, pero es un problema agradable.

Se han visto los perfiles de 65689 usuarios de flickr a través del sitio desde que inició en octubre del 2005.

Existen varios scripts de greasemonkey que hacen uso del sitio, particularmente me gusta More User Links

Top 5

Como una muestra de mi agradecimiento, he aquí la lista de los 5 usuarios con más visitas de todos los tiempos en The Most Interesting Pictures By…

  1. Seb Przd ¿Cómo logra ese efecto? :|
  2. Predi Un fotografo de la naturaleza, colorido y detallista
  3. somesai Todos amamos a los pandas
  4. valpopando El maestro del HDR
  5. Java Cafe Paisajista principalmente, pero versatil

Probabilistic Roadmap Planner

Saturday, October 14th, 2006

Hace aproximadamente un año y medio, hice un verano, el único en mi vida. En él tomé un curso que impartió el profesor Seth Hutchinson: Robot Motion Planning.

Dicho curso se imparte generalmente a lo largo de un semestre, pero por ser verano, a mi me tocó hacerlo en un mes :| Fue un mes realmente intenso de noches sin dormir y mucha cafeína,… aún recuerdo el sabor de ése verano.

Para evaluarnos, el profesor dejaba cada semana un proyecto. Uno de ellos y que me pareció el más interesante, fue el Probabilistic Roadmap Planner.

Dicho algoritmo sirve para encontrar un camino que puede seguir un robot de una configuración inicial (home) a una final (goal) evitando los obstáculos que existen en su espacio.


Configuración inicial, final, una configuración que no colisiona con los obstáculos
y obstáculos.

Para lograr esto, el algoritmo calcula un número dado de posibles configuraciones del robot de manera aleatoria, tales que no colisionen con los obstáculos. Desde la posición inicial intenta encontrar el camino más corto pasando por las configuraciones que están libres de colisiones hasta llegar a la posición final, evitando colisionar con los obstáculos en su camino de una configuración a otra.


Con 200 configuraciones aleatorias

Por desgracia no alcancé a terminar dicho proyecto, le faltaron unos cuantos detalles, afortunadamente el profesor comprendió que tomar su curso en un mes es para suicidas (just the way i like it).


con 800 configuraciones aleatorias.

El proyecto lo desarrollé usando Visual C# 2005 Express. El código me gusto mucho y puede ser útil para estudiar cosas como la detecciones de colisiones entre polígonos, el cálculo de la cinemática directa para un robot articulado, la animación con OpenGL (Tao Framework), y en si, el algoritmo de un RPM. Pensé en terminarlo algún día y publicarlo orgulloso en mi blog, pero cada vez veo más lejano ese día así que aquí lo tienen, incompleto.

Me quedó pendiente hacer la cinemática inversa o algún otro método para realizar la animación adecuada del robot de una configuración a otra, e implementar algún algoritmo que calcule el camino más corto (Dijktra o alguno similar).

Las características de mi aplicación son:

  • Zoom in o out con las teclas: i y o
  • Panning: con las flechas del teclado
  • Mostrar u ocultar las posibles configuraciones del robot con la tecla: c
  • Se pueden agregar cualquier número de obstáculos, se puede calcular cualquier número de configuraciones probabilísticas del robot.
  • El robot es un brazo de 4 articulaciones.

Por cierto recomiendo mucho el libro del profesor Hutchinson:

CHOSET, HUTCHINSON. Principles of Robot Motion, Theory, Algorithms and Implementation. The MIT Press.

Aquí el código fuente.

Releasing the code

Wednesday, January 4th, 2006

I’ve been receiving feedback from the users of one of my projects, MSNAliceBot. This little project doesn’t had the number of downloads as my projects for flickr. But the users are more “participative”.

I wanted to continue the develop of this project because i think it got some potencial. But I’m running out of time for other projects, so i think it is time to release the source code. I don’t want to see it die.

So, consider this a new year’s gift. ;)

You’ll find more information on the project’s page.

Another project under the GPL

Have fun!

HintNotes 0.1

Wednesday, December 21st, 2005

This week i been working on an application to take notes, you can see the details in the project’s page.

Yes, there is the source code :P

HintNotes project’s page

HintNotes

Wednesday, December 21st, 2005

Estos últimos 3 días, he estado programando una pequeña aplicación para tomar notas. Se que hay muchas por ahi, pero todas ellas tienen muchas cosas que no uso - y quería hacer la mía.

Me gustan las aplicaciones que recuerdan su estado de la última vez que corrieron y también aquellas a las que se les puede asignar una hotkey . Así que le puse ambas características a mi aplicación.

Para recordar su estado uso serialización con XML y la parte de la hotkey se tiene que realizar con código unmanaged.

Como un pequeño extra, le puse la característica de poder leer la nota actual.

HintNotes

Por desgracia consume bastante memoria, eso es una desventaja conocida de los programas .Net

Subí el código fuente (se puede consultar desde la página del proyectito).

flickrBuddy 0.1

Saturday, November 26th, 2005

This tool allows you to see and download the most interesting pictures of your contacts in flickr.

flickrBuddy 0.1

No source code for the moment -i need to figure out how to do some things with threads…

You’ll need the .Net Framework 2.0 to run it

The tool page is here

Sierpinski’s triangle

Wednesday, October 12th, 2005

I had always wanted to program the chaos game,… I know, it is a stupid thing…

Well here is it:
I used Opengl in C# with the Tao Framework. Most of the opengl in my code is from the nehe tutorials.

You can put as many points as you want, but be careful with your memory, they are stored in an arraylist (the C# equivalent to a Java, C and many other languages vectors)

The insteresting part are this 4 lines of code:
//the three vertices of triangle
oglw.mainvertex.Add(new obvertex(5f,13f));
oglw.mainvertex.Add(new obvertex(-15f,-15f));
oglw.mainvertex.Add(new obvertex(15f, -11f));
//starting point
oglw.obvertexArr.Add(new obvertex(0f,0f));

Change the values to see what happen
Features:Zoom in and out: i o keys
panning: arrow keys
turn off the axes: c key

Sierpinsky's triangle

Binary here
Source here (Visual C# Express 2005)
Source here SharpDevelop project

flickrFavs 0.2.1

Friday, October 7th, 2005

flickrFavs 0.2.1 - Now with a new and more friendly installer.

I made this installer with Windows Installer XML (WiX) toolset, wich i found amazing.

“The WiX tools allow you to define the structure of a Windows Installer package using an XML file. This gives you all of the usual benefits of XML: easy editing with a variety of tools, the ability to modify the files using well-known technologies, and the ability to put the source file under source code control, for example. The WiX tools themselves are command-line tools, so they fit well with almost any build process.”

OnDotNet: Introducing Wix

flickrFavs v 0.2

Sunday, July 31st, 2005

This new release contains a list of the downloaded pictures, a picture box showing the last downloaded pic and a progress bar that give you an idea of the pictures that left to download.

Here is a screen shot:

flickrFavs 0.2

You can download an installer here

More info here