TP-Link WN725N on Raspberry PI B

Today I rebuilt my second Raspberry Pi for home. The first one is currently being used as a media server permanently connected to the TV in the living room. At home we use it daily to watch movies or tv shows through genesis.

This second Raspberry Pi will  be used as an in-house server for backup or NAS. Despite  not being the most efficient for that purpose, the R-PI will be connected to our wireless network as well, for that I purchased a TP-LINK WN725N adaptor.

TP-Link TL-WN725N

TP-Link TL-WN725N

Unlike other adaptors, the WN725N is not plug & play on the different GNU/Linux distros that we can install in the Raspberry Pi. Hence you need to install the drivers and make sure that they load every time that you boot your device. After reading a few forums, blogs and tutorials I made it work stable in the mini-server.

Firstly we need to install our favorite distro for our Raspberry Pi, I decided to go with Raspbian. Follow this tutorial to install a base image in your Raspberry Pi. Once the OS is installed you need go know your kernel version so type:

root@raspberrypi:~# uname -a
Linux raspberrypi 3.18.7+ #755 PREEMPT Thu Feb 12 17:14:31 GMT 2015 armv6l GNU/Linux

The important bit is the 3.18.7+ #755 (numbers may change depending on the kernel version).

With the kernel version, we download the correct driver as mentioned in the following tutorial. This download you can do it directly from the raspberry pi if you have wired connection or on a different computer storing the file in a pendrive. Then copy the file in the raspberry pi as follows.

pi@raspberrypi:~# mount /dev/sda1 /mnt

pi@raspberrypi:~# cp /mnt/8188eu-v7-20150212.tar.gz .

pi@raspberrypi:~# mkdir tplink && cd tplink

pi@raspberrypi:~# tar -zxvf 8188eu-v7-20150212.tar.gz

pi@raspberrypi:~# umount /mnt/

pi@raspberrypi:~# ls tplink/
8188eu.conf 8188eu.ko install.sh

Now we will have 3 files in our folder. Executing install.sh will copy 8188.conf and 8818eu.ko to their folders but if something fials it won’t tell you the error. So, my recommendation is to open the install.sh

pi@raspberrypi:~# cat install.sh

and execute command by command

pi@raspberrypi:~# sudo cp 8188eu.conf /etc/modprobe.d/

pi@raspberrypi:~# sudo install -p -m 644 8188eu.ko /lib/modules/3.18.7+/kernel/drivers/net/wireless

pi@raspberrypi:~# sudo depmod -a

Then edit /etc/modules file to load the driver during the linux booting.

pi@raspberry:~# sudo vi /etc/modules

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with “#” are ignored.
# Parameters can be specified after the module name.

snd-bcm2835
8188eu #add this line

Now edit the wireless configuration

pi@raspberrypi:~# sudo vi /etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid=”YOUR SSID”
psk=”YOUR WIFI PASSWORD”
}

Reboot your raspberry pi for your configuration to take effect.

pi@raspberrypi:~# sudo reboot

If everything went ok your TP-LINK TP-WN725N should now be connected to your network. If it didn’t work yet, you may need to load another kernel module.

pi@raspberrypi:~# sudo insmod /lib/modules/3.18.7+/kernel/drivers/net/wireless/rtl8192cu/8192cu.ko

pi@raspberrypi:~# sudo depmod -a

pi@raspberrypi:~# sudo vi /etc/modules

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with “#” are ignored.
# Parameters can be specified after the module name.

snd-bcm2835
8188eu

8192cu #add this line

Reboot your Raspberry Pi

pi@raspberrypi:~# sudo reboot

Garmin forerunner 205 GPS training

A week ago I bought my new garmin forerunner 205 gps watch online and I’ve been training with it for a week now and so I have my first impressions about it which, so far, are great.

After many years training with just a heart rate monitor and basing my training days only on my heart rate, 70, 80, 90 % of my rate I wanted to do it while monitoring exactly how far and how fast my run gets. Not that I didn’t know it before as we all know how long we run and our speed, but this is way more accurate than it was before.

Despite the 205 is not the last garmin gps watch it is full of options and it lets you change between 3 different sports (runnning, clycling, other). For now I’ve only used cycling and running. While using it you can really make your circuit different every day and exactly run the same distance or the same speed so you do not get bored of the same streets, parks…

Let’s see the functionality of the gps watch. Firstly the speed with which it detects the gps signal, I cannot say that it is immediately, but it is quite fast, less than 1 min (way less) at least where I live in Barcelona. The gps is quite accurate as it takes the signal from as many satellites as it detects, but any way it is taking measurements every 5 meters (by default) which is quite ok. However it can lood very unreliable the first time that you use it, but it is because it is calibrating itself once you’ve run your first 200m everything is smooth and fine. The 205 also has 3 different screens which you can personalize displaying up to 4 data on each, this can be time, speed, lap time, distance, time (current time), max speed, calories,…) so quite a lot of options that helps you to control your training and your effort during your run. One of the best features of the forerunner 205 is its bring me back home feature. As it is a gps based watch your trac is set in the watch so if you are lost in the forest, mountain… you can use thi
s feature to get back to the start point. Once you activate this option, the watch will show you your route and it will give you indications on the screen to send you back to the starting point of your ride, walk or run which is quite useful if you train off road.

But is that all what the forerunner gives you? No. One of the best features that the garming 205 offers is not in the watch itself, but in the garmin training software which comes with it. With this software (windows and mac os compatible) you can  transfer your data from the watch to your computer and keep track and analyze your run or ride with quite a good precision. The software shows you the route on the map, the speed at any time and the high of your training. Analyzing this is very valuable for your daily training as if you are use to run always the same route you can see your best and your weak during your training, so you can fix it for a better performance.

This has been a very brief review on the garmin 205 gps watch, but I hope that it is useful for you if you are planning to buy one of this sport gadgets. I totally recommend it and if you are a frequent runner this is a must to have as good shoes are too 🙂

Manifiesto 15M

Estas son algunas de las medidas que, en cuanto ciudadanos, consideramos esenciales para la regeneración de nuestro sistema político y económico. ¡Opina sobre las mismas y propón las tuyas en el foro!

1. ELIMINACIÓN DE LOS PRIVILEGIOS DE LA CLASE POLÍTICA:

o   Control estricto del absentismo de los cargos electos en sus respectivos puestos. Sanciones específicas por dejación de funciones.

o   Supresión de los privilegios en el pago de impuestos, los años de cotización y el monto de las pensiones. Equiparación del salario de los representantes electos al salario medio español más las dietas necesarias indispensables para el ejercicio de sus funciones.

o   Eliminación de la inmunidad asociada al cargo. Imprescriptibilidad de los delitos de corrupción.

o   Publicación obligatoria del patrimonio de todos los cargos públicos.

o   Reducción de los cargos de libre designación.

2. CONTRA EL DESEMPLEO:

o   Reparto del trabajo fomentando las reducciones de jornada y la conciliación laboral hasta acabar con el desempleo estructural (es decir, hasta que el desempleo descienda por debajo del 5%).

o   Jubilación a los 65 y ningún aumento de la edad de jubilación hasta acabar con el desempleo juvenil.

o   Bonificaciones para aquellas empresas con menos de un 10% de contratación temporal.

o   Seguridad en el empleo: imposibilidad de despidos colectivos o por causas objetivas en las grandes empresas mientras haya beneficios, fiscalización a las grandes empresas para asegurar que no cubren con trabajadores temporales empleos que podrían ser fijos.

o   Restablecimiento del subsidio de 426 para todos los parados de larga duración.


3. DERECHO A LA VIVIENDA:

o   Expropiación por el Estado de las viviendas construidas en stock que no se han vendido para colocarlas en el mercado en régimen de alquiler protegido.

o   Ayudas al alquiler para jóvenes y todas aquellas personas de bajos recursos.

o   Que se permita la dación en pago de las viviendas para cancelar las hipotecas.


4. SERVICIOS PÚBLICOS DE CALIDAD:

o   Supresión de gastos inútiles en las Administraciones Públicas y establecimiento de un control independiente de presupuestos y gastos.

o   Contratación de personal sanitario hasta acabar con las listas de espera.

o   Contratación de profesorado para garantizar la ratio de alumnos por aula, los grupos de desdoble y los grupos de apoyo.

o   Reducción del coste de matrícula en toda la educación universitaria, equiparando el precio de los posgrados al de los grados.

o   Financiación pública de la investigación para garantizar su independencia.

o   Transporte público barato, de calidad y ecológicamente sostenible: restablecimiento de los trenes que se están sustituyendo por el AVE con los precios originarios, abaratamiento de los abonos de transporte, restricción del tráfico rodado privado en el centro de las ciudades, construcción de carriles bici.

o   Recursos sociales locales: aplicación efectiva de la Ley de Dependencia, redes de cuidadores locales municipales, servicios locales de mediación y tutelaje.

5. CONTROL DE LAS ENTIDADES BANCARIAS:

o   Prohibición de cualquier tipo de rescate o inyección de capital a entidades bancarias: aquellas entidades en dificultades deben quebrar o ser nacionalizadas para constituir una banca pública bajo control social.

o   Elevación de los impuestos a la banca de manera directamente proporcional al gasto social ocasionado por la crisis generada por su mala gestión.

o   Devolución a las arcas públicas por parte de los bancos de todo capital público aportado.

o   Prohibición de inversión de bancos españoles en paraísos fiscales.

o   Regulación de sanciones a los movimientos especulativos y a la mala praxis bancaria.
 
6. FISCALIDAD:

o   Aumento del tipo impositivo a las grandes fortunas y entidades bancarias.

o   Eliminación de las SICAV.

o   Recuperación del Impuesto sobre el Patrimonio.

o   Control real y efectivo del fraude fiscal y de la fuga de capitales a paraísos fiscales.

o   Promoción a nivel internacional de la adopción de una tasa a las transacciones internacionales (tasa Tobin).

7. LIBERTADES CIUDADANAS Y DEMOCRACIA PARTICIPATIVA:

o   No al control de Internet. Abolición de la Ley Sinde.

o   Protección de la libertad de información y del periodismo de investigación.

o   Referéndums obligatorios y vinculantes para las cuestiones de gran calado que modifican las condiciones de vida de los ciudadanos.

o   Referéndums obligatorios para toda introducción de medidas dictadas desde la Unión Europea.

o   Modificación de la Ley Electoral para garantizar un sistema auténticamente representativo y proporcional que no discrimine a ninguna fuerza política ni voluntad social, donde el voto en blanco y el voto nulo también tengan su representación en el legislativo.

o   Independencia del Poder Judicial: reforma de la figura del Ministerio Fiscal para garantizar su independencia, no al nombramiento de miembros del Tribunal Constitucional y del Consejo General del Poder Judicial por parte del Poder Ejecutivo.

o   Establecimiento de mecanismos efectivos que garanticen la democracia interna en los partidos políticos.


8. REDUCCIÓN DEL GASTO MILITAR

——————————————————–

ELIMINAR EL SENADO.

NORUEGA, SUECIA, DINAMARCA, NO TIENEN SENADO, ALEMANIA SOLO 100 SENADORES y EE.UU. UN SENADOR POR CADA ESTADO.

LOS GRANDES TEÓRICOS DEL DERECHO INTERNACIONAL Y CONSTITUCIONAL OPINAN QUE ES UNA CÁMARA INNECESARIA, PRESCINDIBLE Y QUE ESTÁ EN EXTINCIÓN, ¿ENTONCES POR QUÉ TENEMOS QUE MANTENER A 260 SENADORES?

DE ESTA FORMA AHORRAREMOS 3.500 MILLONES DE EUROS CADA AÑO.

ELIMINAR LA PENSIÓN VITALICIA DE TODOS LOS DIPUTADOS, SENADORES Y DEMÁS
“PADRES DE LA PATRIA”.

ELIMINAR A TODOS los diplomáticos excepto un embajador y un cónsul en cada país. No es posible que gastemos en esto más que Alemania y el Reino Unido).

Con eso, y con rebajar un 30% las partidas 4, 6 y 7 de los PRESUPUESTOS GENERALES DEL
ESTADO (transferencias a sindicatos, partidos políticos, fundaciones opacas y varios), se ahorrarían más de 45.000 millones de Euros y no haría falta tocar las pensiones ni los sueldos de los funcionarios, como tampoco haría falta recortar 6.000 millones de Euros en inversión pública.

CON LA MITAD DEL DINERO QUE EL ESTADO SE AHORRARÍA CON ESTAS MEDIDAS,
SE ACABARÍA LA CRISIS EN ESPAÑA

Por el cambio de la ley electoral, y por una democracia participativa de verdad, donde nuestra opinión, la de los ciudadanos,  sea lo que gobierne, no una papeleta cada cuatro años y que hagan con ella lo que quieran sin dar cuentas ni explicaciones.

The silent white

Today I’ve my new friend that will come with me in the new experience of the city cyclist. Today, the slim white of the family was born and gave her frist ride around Barcelona.

This project was in my mind for years but the lack of free time to do it plus the location of the bike before made me delay it until this year. The bike it self has my age or may be more more. Originally is a blue and yellow Peugeot that belonged to one of my cousins and he gave it to me as he had 2 similar bikes at home. With this bike I made my routes around my village but at some point the chainrings broke because of the wear out and the bike was not usable anymore as the chain was jumping all the time.

In a last chance of saving it as a roadbike I did manage to fix it and for that I made a make up of the bike by cleaning it and painting it in yellow but then I left it in my village w/out using it again and I should have done something else with it.

This year due to I’m back in Spain I normally go by bike to work, normally using the public bikes available in Barcelona, bicing. Which is a good service but sometimes is really difficult to find a bike in some parts of the city so you can spend about 30 min looking for a bike. Because of this I decided that it was time to catch up with my bike project. So in this holidays I took the old bike from where it was stored, I dismounted everything in the bike and repainted it in white, I never thought before about having a white bike but since I have mi BTT white I started to like this color in bikes, so I bought white paint in spray and started doing my job. The painting phase took about 2 days because you need to leave the paint dry for 24 hours in order to be perfectly dry and I wanted to put a second hand on it.

After the paint was dry it was time to change all the wires, this time it was only the breaks as I decided to have only a single speed in this bike because it makes the maintenance very simple. But with this decision you have to be very careful with the chainrings selected as you have to keep in mind that at some poing you’ll need to climb up a street so finally I chose a development of 44X18 which is an average one that lets you climb but also get some speed in flat.

Another change that I’ve done to the bike is change the position of the handle bar I put it upside down and cut it, like this you get little horns that you can use to make more effort when climbing or accelerate and also it is a good resting position for you too.

With this bike I still haven’t done much because I’m waiting to buy good locks but soon I’m planing to use it as my main main transport and also, if it is possible to play BikePolo, a sport that I didn’t know but that it looks very funny and promising. I’m getting in contact with people that plays BikePolo here, in Barcelona, and now I know where they play so someday soon I’ll go and give it a try because it looks quite funny. But about this I’ll write another post 🙂

Now I’ll leave you more photos of the white silent.

Deployment of an Axis2 service in WSO2 ESB

This tutorial will tell you how to deploy a simple service using a WSO2 ESB.
We basically will follow the quickstart guide that is already on the WSO2 web page.

http://wso2.org/project/esb/java/2.1.0/docs/quickstart_guide.html

Once said where we can find an exteded version of this tutorial let’s start with the deployment guide.

In the tutorial the wsdl that we will deploy must be online, so firstly deploy your service anywhere and make the wsdl available from outside via http. In our example we will use a SimpleService that will return to us the message that we are sending, i.e. it is acting as an echo service. In our case the service will be deployed in a tomcat and the wsdl direction is this:

http://localhost:7070/axis2/services/SimpleService?wsdl

So in this basics let’s start with the deployment orchestration in the ESB:

  1. Login into the ESB.
  2. On the left hand side menu, clcik on Proxy Service to add a new service.
  3. In the Step 1:
    1. insert “Proxy Service Name”
    2. Below in “General Settings” -> “Publishing WSDL”, Specify Source URL. Introduce the url and thest the connection.
    3. Choose the transport settings: http or https or both.
    4. click on “Next”.
  4. In the Step 2: There are 2 areas to fill here: “In Sequence Options” and “Endpoint Options”. To fill one is mandatory.
    1. In “Secuence Options”: let us add a secuence of actions that we can do with the incoming request, such as xslt tranformations or security appliance, even send the request from the sequence.
    2. “Endpoint Option”: if you haven set any secuence or you haven’t set any epr in the secuence where to send the incoming message add an endpoint here to send the message to. This can be the real service EPR or another ESB epr where you want to keep on doing stuff with your message.
    3. click on “Next”.
  5. In the Step 3: This step is the same as the Step2 with the outgoing message with the difference that now the “Out Secuence Options” and the “Fault Secuence Options” aren’t obligatories so you can leave then in “none”. By doing this the message will continue it’s way to the client.
    6. click on “Finish” to save the configuration of the new proxy.
  6. Now in the menu, under services click on list to see al the services that you have deployed in your ESB. By clicking on one of the services you can see information about the proxy/service that you have deployed with the EPR where to call it.
  7. Use this EP in your client to call the ESB and this to call the Service.

Now you have deployed a Proxy Service in your ESB and it is ready to be called 😉

Manifiesto “En defensa de los derechos fundamentales en internet”

Ante la inclusión en el Anteproyecto de Ley de Economía sostenible de modificaciones legislativas que afectan al libre ejercicio de las libertades de expresión, información y el derecho de acceso a la cultura a través de Internet, los periodistas, bloggers, usuarios, profesionales y creadores de Internet manifestamos nuestra firme oposición al proyecto, y declaramos que:

  1. Los derechos de autor no pueden situarse por encima de los derechos fundamentales de los ciudadanos, como el derecho a la privacidad, a la seguridad, a la presunción de inocencia, a la tutela judicial efectiva y a la libertad de expresión.
  2. La suspensión de derechos fundamentales es y debe seguir siendo competencia exclusiva del poder judicial. Ni un cierre sin sentencia. Este anteproyecto, en contra de lo establecido en el artículo 20.5 de la Constitución, pone en manos de un órgano no judicial -un organismo dependiente del ministerio de Cultura-, la potestad de impedir a los ciudadanos españoles el acceso a cualquier página web.
  3. La nueva legislación creará inseguridad jurídica en todo el sector tecnológico español, perjudicando uno de los pocos campos de desarrollo y futuro de nuestra economía, entorpeciendo la creación de empresas, introduciendo trabas a la libre competencia y ralentizando su proyección internacional.
  4. La nueva legislación propuesta amenaza a los nuevos creadores y entorpece la creación cultural. Con Internet y los sucesivos avances tecnológicos se ha democratizado extraordinariamente la creación y emisión de contenidos de todo tipo, que ya no provienen prevalentemente de las industrias culturales tradicionales, sino de multitud de fuentes diferentes.
  5. Los autores, como todos los trabajadores, tienen derecho a vivir de su trabajo con nuevas ideas creativas, modelos de negocio y actividades asociadas a sus creaciones. Intentar sostener con cambios legislativos a una industria obsoleta que no sabe adaptarse a este nuevo entorno no es ni justo ni realista. Si su modelo de negocio se basaba en el control de las copias de las obras y en Internet no es posible sin vulnerar derechos fundamentales, deberían buscar otro modelo.
  6. Consideramos que las industrias culturales necesitan para sobrevivir alternativas modernas, eficaces, creíbles y asequibles y que se adecuen a los nuevos usos sociales, en lugar de limitaciones tan desproporcionadas como ineficaces para el fin que dicen perseguir.
  7. Internet debe funcionar de forma libre y sin interferencias políticas auspiciadas por sectores que pretenden perpetuar obsoletos modelos de negocio e imposibilitar que el saber humano siga siendo libre.
  8. Exigimos que el Gobierno garantice por ley la neutralidad de la Red en España, ante cualquier presión que pueda producirse, como marco para el desarrollo de una economía sostenible y realista de cara al futuro.
  9. Proponemos una verdadera reforma del derecho de propiedad intelectual orientada a su fin: devolver a la sociedad el conocimiento, promover el dominio público y limitar los abusos de las entidades gestoras.
  10. En democracia las leyes y sus modificaciones deben aprobarse tras el oportuno debate público y habiendo consultado previamente a todas las partes implicadas. No es de recibo que se realicen cambios legislativos que afectan a derechos fundamentales en una ley no orgánica y que versa sobre otra materia.

DIY Laptop stand

One of the issues that laptop have is the cooling. They are build to cool in a proper way, but we all know that most of them are overheat and that it is better to have them a bit separated from the table to let air pass through. How dod we do this? The little legs are not enough sometimes so here is where stands comes.It also helps to lift our laptop a bit and that is good to get a better ergonomic position while working with it.

I didn’t want to spend money in a stand because I really don’t need one with fans or something else. So I took an idea from my firend Teo. He did one for his laptop with a cardboard box and it was working fine, you can see the stand in his blog, here. Mine is slightly different but with the same principle. I took a cardboard box from the toy-box of  a friend of me (it is a Playmobil box and the box is the best of the game as we all know that Lego is so much better).

Taking out the cover and the back to make it fit for your laptop. I also didn’t make it flat, but with an small level difference from front to rear. This way if you wan’t/need to type directly in the laptop is better for it as well although I must say it is not that comfortable.  So it has a hole right in the middle of the front side to let you open the laptop properly.  And in the left hand side it also have a hole to insert a USB cable because you can fit stuff inside the open box.

That is what I actually have, the stand is not only for cooling but it is also a home-made docking station where I have inside an external hard drive + n USB hub with room for 4 USB slots. All this makes your  stand also a quite cheap and functional stuff. It also let you have your desk clean of devices and cables.

Effectively this is the result which I am quite happy about. I am only missing some decoration on it but time to time because I am planning to do further work on it.

Long exposures

Since a long time ago I quite like to do exposures while I am taking photos. For those who don’t know what an exposure in photography is here you have a definition from Wikipedia.

In photographic jargon, an exposure generally refers to a single shutter cycle. For example: a long exposure refers to a single, protracted shutter cycle to capture enough low-intensity light, whereas a multiple exposure involves a series of relatively brief shutter cycles; effectively layering a series of photographs in one image. For the same film speed, the accumulated photometric exposure (H) should be similar in both cases.

To know more about it just go to the entire article by clicking here.

Big BenGoing back to the topic of this post I would like to show you some exposures that I did in my last visit to London where I took my camera for a walk at night (this is something I don’t do quite often but that I like to do from time to time). Usually to do exposures you may need a tripod. In my case I didn’t want to carry with the tripod the whole day so instead of that I was using mainly my camera bag to build a stable surface to put the camera on.

With this small collection of exposures I didn’t want to express movement, which is one of the reasons why people does them. In this case I was capturing a city landscape so buldings, but I wanted to take the colour that I was seeing, so no flash at all to get  the correct amount of light. This fact makes this kind of photos such a challenge because don’t forget that in cities there are many different light sources and in many different colours, so get the light that you want is quite a difficult target.

Big BenHouse of Parlament

To find out more go to my flickr gallery.

Editing xml elements with xslt stylesheet

In the last days I have spent some time using xsl to modify my xml messages in run time. Since I saw xsl the first time with the help of Pierre, a friend of me. I realized the amount of different things that you can do with xsl and how power it can be.

So what I have done this days is editing the values of xml and removing elements. So for that I will give you a tip of how to do so.

The source of the example will be this xml.

<?xml version=”1.0″ encoding=”UTF-8″?>
<soap:Envelope xmlns:soap=”http://www.w3.org/2003/05/soap-envelope”&gt;
<soap:Header>
<wsa:To xmlns:wsa=”http://www.w3.org/2005/08/addressing”>http://localhost:7070/WsSongStore/services/WsSongStore</wsa:To&gt;
<wsa:Action xmlns:wsa=”http://www.w3.org/2005/08/addressing”>http://songstore.org/cap/mgmt/CreateOperation</wsa:Action&gt;
<wsa:MessageID xmlns:wsa=”http://www.w3.org/2005/08/addressing”>uuid:fe33274e-1ca7-daca-ceab-13e4417560c2</wsa:MessageID&gt;
<wsa:From xmlns:wsa=”http://www.w3.org/2005/08/addressing”&gt;
<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address&gt;
</wsa:From>
<vSTS:FederationUUID xmlns:vSTS=”http://www.example.com/example-STS”>aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa</vSTS:FederationUUID&gt;
<vSTS:businessKey xmlns:vSTS=”http://www.example.com/example-STS”>1a555434-ca9e-4c31-b59a-dc3c07f6dad1</vSTS:businessKey&gt;
<user:username xmlns:user=”http://www.example.com/ssc-User”>juanlu</user:username&gt;
</soap:Header>
<soap:Body>
<pfx1:CreateOperation xmlns:pfx1=”http://songstore.org/cap/mgmt”/&gt;
</soap:Body>
</soap:Envelope>

And what we will do first is to change the uri of the element to within the header for a different value. And for that we will apply the xsl stylesheet below that what it does is look through the xml tree for the element we say in the when statement and change its value for the one stored in the variable that we declared at the beginning.

<?xml version=”1.0″ encoding=”UTF-8″?>
<xsl:stylesheet version=”2.0″ xmlns:xsl=”http://www.w3.org/1999/XSL/Transform&#8221; xmlns:xs=”http://www.w3.org/2001/XMLSchema&#8221; xmlns:fn=”http://www.w3.org/2005/xpath-functions&#8221; xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/&#8221; xmlns:wsa=”http://www.w3.org/2005/08/addressing”&gt;
<xsl:output method=”xml” version=”1.0″ encoding=”UTF-8″ indent=”yes”/>
<xsl:variable name=”fromVirtualUri”>http://localhost:8080/WsSongStore/services/WsSongStore</xsl:variable&gt;
<xsl:template match=”node()|@*”>
<xsl:copy>
<xsl:choose>
<xsl:when test=”local-name()=’To'”>
<xsl:if test=”namespace-uri()=’http://www.w3.org/2005/08/addressing'”&gt;
<xsl:value-of disable-output-escaping=”yes” select=”$fromVirtualUri”></xsl:value-of>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select=”@*|*|processing-instruction()|comment()|text()”>
<xsl:with-param name=”virtualUri”></xsl:with-param>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>

The second transformation removes elements from the xml, may be because we don’t want them anymore in the message because we have used them already and the message that the other component is expecting does not contain them. So the following  xsl loos for the element we  say on the variable that we declare at the beginning and copies everything to the exit but that element, that is skipped due to the when declaration.

<?xml version=”1.0″ encoding=”UTF-8″?>
<xsl:stylesheet version=”2.0″ xmlns:xsl=”http://www.w3.org/1999/XSL/Transform&#8221; xmlns:xs=”http://www.w3.org/2001/XMLSchema&#8221; xmlns:fn=”http://www.w3.org/2005/xpath-functions&#8221; xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/&#8221; xmlns:wsa=”http://www.w3.org/2005/08/addressing”&gt;
<xsl:output method=”xml” version=”1.0″ encoding=”UTF-8″ indent=”yes”/>
<xsl:variable name=”tag”>username</xsl:variable>
<xsl:template match=”node()|@*”>
<xsl:choose>
<xsl:when test=”local-name()!=$tag”>
<xsl:copy>
<xsl:apply-templates select=”node()|@*|*|processing-instruction()|comment()|text()”/>
</xsl:copy>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

I hope this helps you.

Cycling in the city (Copenhagen)

Since a while ago I have been looking at different cities and how ready they are to ride a bike on them. During this, almost, 2 years living in UK I have been going to work cycling more than the 80% of the days. My office is around 6 miles (10 km) away from my house in Ipswich. Cycling there takes between 25 and 40 minutes, depending on the weather conditions and the company (usually when you go with more people takes longer due to speaking).  Getting there is quite easy and save as we have a full cycling paths network inside and surrounding the town, so as soon as you can imagine you are inside one of this cycling paths.

Today, by using 4 different videos with true histories of people that lives in Copenhagen I would like to show the people how  easy and comfortable can be to go by bike to work skipping traffic jams, not looking for parking and also because it is increment friendly and healthy for yourself. Copenhagen is a city with more bikes than population and where it is not difficult to see entire families going anywhere by bike, from the dad in the shut that goes to work to the little kid that can either go with his own bike or in a special chair in his parents bike. This makes Copenhagen a place where the bike culture is deeply attached to the people and even if you go just for visiting it makes you feel that you have to ride a bike to know how would you feel in the city, kind of comparable as visiting the monuments and museums of the city.

In comparison with my home town Madrid, where cycling is basically a sport that you might do at the weekend and where if you go by bike in the city most likely you will be going through the side-way (which is illegal) because nobody respects you, where you don’t have spaces special for bikes, where it is almost impossible to combine bike and public transport because of restrictions in the metro for instance… So i wish this changes ASAP as Madrid, with all the hills that it has, can easily improve the quality of live with just a few changes in the infrastructure and car culture that we have over there. Other big cities in Spain have started to change this issue by implementing a hire bike service, where you can get a bike somewhere and drop it in a different place.

Hopefully with the Olympic Games candidature our politicians at Madrid think twice about this issue and act in consecuence.

Right, after all I have said here you can see the videos:

Part 1

Part 2

Part 3

Part 4

Part 5