Setup TomTom to work with the Samsung Omnia i-900

 

Many people say that it is necessary to install the program GPSFlex to make the TomTom work in the Omnia. This is sometimes true, depending on your Omnia´s ROM, but this program seems to drain off your batteries and to heat your device up. I made a quick test today and with mine, GPSFlex was not necessary at all.

My Omnia comes with the default Orange ROM. What you have to do is:

1.- Configure GPS as: “Other NMEA device”, speed: 4800, COM3. The GPS device should be detected almost immediately.

2.- It sometimes takes 2 or 3 minutes to get a valid GPS signal. If after several minutes it doesn't do it, try switching off your Omnia (with a long push in the power button). After reboot, it should get signal. Some people said that it helps to deactivate your phone before switching off, but this seems a bit weird to me. However, you can try…

Cheers.

Internet Explorer 8 – crash boom bang! -

Yesterday, I installed IE8 (retail version, not beta) in a laptop with the following specs:Ver imagen en tamaño completo

  • Dell M1530
  • 3GB Ram
  • Windows Vista Home Premium SP1

The experience was quite horrible, mostly because:

  • Some add-ons (like Skype) seemed to be incompatible with IE8, what made necessary to update them. That´s quite reasonable, by now, but the worst is yet to come…
  • “Open in new tab” feature didn´t work at all. The tab was opened, but stuck in “connecting…” with no results
  • “Open in new window” feature didn´t work neither. The window was not even open.
  • And what is even more annoying: Installing IE8 interfered  with my Windows Explorer, making it to always open folders in new windows when they were “double-clicked”

And YES, I checked the “Open in new window” and “Open in the same window” folder options were Ok.

After more than half an hour trying to find information, the only suggestion I found was to deactivate all the add-ons installed in Internet Explorer. Is that really a solution? Nevermind, because it it didn´t worked anyway, so…

I uninstalled it (Programs&Features –> Installed Updates) and now everything works like a charm again…

We will have to wait a bit more for it to work properly…

Charla sobre XNA en SecondNug

La peña de SecondNug me ha invitado a dar una charla introductoria a XNA el día 21 de Abril. En ella, desarrollaremos un juego completo desde cero: un clon del Arkanoid, tocando temas como gráficos, sonido, input, animación, etc.

Second NUG: Desarrollo de videojuegos: XNArkanoid

Como todas las charlas de este grupo, se tratará de un WebCast al que podrás unirte a través de Live Meeting. Mas información y registro en el evento aqui y en www.secondnug.com.

Salu2!

Jornadas sobre la profesión de Ingeniero. Universidad pública de Navarra

Next wednesday I´ll be one of the speakers in the conferences about the Engineering studies and careers hosted by the Universidad Pública de Navarra.

----

El próximo miércoles, seré uno de los ponentes en las jornadas sobre la profesión de Ingeniero de la Universidad pública de Navarra.

Aula 4. Edificio el Sario. Pamplona

Texto íntegro:

http://ecodiario.eleconomista.es/espana/noticias/1099078/03/09/La-Universidad-Publica-de-Navarra-organiza-unas-jornadas-sobre-la-profesion-de-ingeniero.html

La Escuela Técnica Superior de Ingenieros Industriales y de Telecomunicaciones de la Universidad Pública de Navarra ha organizado unas jornadas sobre la profesión de ingeniero vista desde sus diferentes especialidades. Las jornadas tendrán lugar los días 17, 18 y 23 de marzo en el Aula 04 de El Sario (Campus de Arrosadia).

PAMPLONA, 14 (EUROPA PRESS)

Las jornadas tienen como objetivo proporcionar un mejor conocimiento de las titulaciones de ingeniero de telecomunicación, informático e industrial tanto a los potenciales alumnos como a la sociedad en general, informó el centro educativo en un comunicado.

La primera de las jornadas estará dedicada al ingeniero de telecomunicaciones y se celebrará el día 17 de 16.30 a 18 horas. En primer lugar se abordará la figura del ingeniero de telecomunicación en el desarrollo futuro de Navarra.

Intervendrán el vicerrector de Investigación de la Universidad Pública de Navarra, Alfonso Carlosena; Cernín Martínez, director general de Política y Promoción Económica del Gobierno de Navarra; Carlos Fernández Valdivieso, vicedecano del Colegio Oficial de Ingenieros de Telecomunicación; y Antonio López Martín, coordinador de Ingeniería de Telecomunicación y subdirector de la Escuela Técnica Superior de Ingenieros Industriales y de Telecomunicación.

A continuación, se desarrollará un mesa redonda sobre la profesión de ingeniero de telecomunicación en la que participarán Oscar Matellanes García, director de Expansión y Negocio de La Información S.A.; Francisco Javier Aranzadi, de Acciona; Joseba Carricas García de la Vega, responsable del área técnica de aplicaciones de Gamesa; Roberto Mercero Igoa, director autonómico de Telefónica en Navarra; y Daniel Lasaosa Medarde, ingeniero de desarrollo en ANIMSA. El moderador será el profesor Antonio López Martín.

Al día siguiente, 18 de marzo, la jornada se centrará en el ingeniero informático y constara de dos charlas. La primera comenzará a las 10 horas y tratará sobre la experiencia personal en el ámbito de la ingeniería informática y correrá a cargo de Iñaki Ayúcar, ingeniero informático y fundador de la empresa Simax Virt S.L., que desarrolla tecnología en el campo de la simulación y ha recibido varios premios como mejor idea de negocio.

En segundo lugar, a las 11.30 horas, se abordará el siguiente tema: 'Inteligencia computacional. Aplicaciones a la industria y a la banca'. Los ponentes serán, por un lado, Francisco Herrera, profesor del Departamento de Ciencias de la Computación e Inteligencia Artificial de la Universidad de Granada, y, por otro, Arantxa Iraizoz, responsable de coordinación de Basilea, de Caja Navarra.

Las jornadas concluirán el 23 de marzo, con una sesión en la que se hablará sobre las aportaciones que pueden ofrecerse en situaciones de crisis, a través de la innovación, desde la profesión de ingeniero industrial.

En la primera parte de la jornada se presentarán iniciativas innovadoras que se están llevando a cabo desde el ámbito de la ingeniería industrial dentro de la Universidad Pública de Navarra. Tal es el caso del proyecto de investigación desarrollado por el Grupo Hidrógeno que ha dado como resultado la transformación, por primera vez en España, de un motor de coche convencional en un motor da coche alimentado por hidrógeno.

Asimismo, se presentará el proyecto de un grupo de estudiantes de ingeniería, que van a diseñar, desarrollar y fabricar una moto de competición, dentro de un concurso internacional (Moto Student) en el que participan universidades de todo el mundo. La segunda parte de la jornada estará dedicada a exponer iniciativas innovadoras en el mundo empresarial relacionadas con la ingeniería industrial.

Easily post VisualStudio formatted source code in your blog

I have posted source code many times before, and always crap-looking. Always wanted to have a copy-paste method to quickly copy source code keeping the format used in Visual Studio. I knew there were tools to do that, but always was too lazy to look for one. Today I did it, and the answer is CSAH: CopySourceAsHtml.

 

It´s a Visual Studio Add-In that offers you a “Copy as HTML” context menu item inside your Visual Studio. You can find it here

 

I have tested it in VStudio 2008, and you can check the results below:

 

 

    public partial class FrmNewDisp : Form

    {

        public FrmNewDisp()

        {

            InitializeComponent();

        }

    }

 

Great!

The tire size mess

A guy asked me a while ago how to read the tire size codes in a wheel. After explaining him, he complained because his results did not match a measurement made on a real wheel. I´ll try to explain why:

205/55R16. What does this mean?

Well, don´t tell me why they did it, but the guys that decided how to code tire sizes made a complete mess around something, in theory, really simple: width, sidewall height and rim diameter. That´s all, but expressed in the most strange and disturbing units they were able to find. It could only be stranger if expressed tire width in light-years…

Tire width: expressed in millimeters. Everything fine by now. Just measure your tire´s width, from a top view, when no load is applied to it.

Tire sidewall height: expressed as a percent of the tire width. So, if the width is 205 mm, a 55% of that (the sidewall height) is 112.75 mm.

Rim diameter: expressed in inches. To translate:

  • inches to meters -> multiply by 0.0254
  • meters to inches –> divide by 0.0254

So, the rim´s diameter will be 406 mm in this case.

An easy calculation: wheel (tire+rim) diameter

If no stress is applied to the wheel, the diameter should be:

Wheel diameter = rim diameter + (sidewall height x 2)

It is important to note that the sidewall height should be multiplied by 2, as it´s the height of one side only (see next picture).

image

Why do I get different results if I measure my tire?

When you take a tape and go out to measure your car´s tires, you will see different results. Specifically in the tire´s sidewall and rim proportion. You should not find any differences in the wheel diameter or radius. Why´s that? Easy… because you are not doing it properly, and this mistake is seen in many places.

The rim diameter should be measured from the inner part where that the tire bead sits on, not from the exterior visible part. So, in order to properly measure the rim size, you will have to take the tire off the rim first, or make an estimation of the amount of tire sidewall that fits inside the rim (usually a bit more than 2 cm, or a bit less that 1 inch).

image

So, measured from the exterior part, with the wheel mounted, we will get at rim (more or less) 2 cm bigger (and of course, 2 cm less of sidewall height).

To know more about tires: The wheel and tire bible

Contribution to SlimDX. UVAtlas wrapper

If you are a .Net developer who wants to deal with 3D Graphics, your best two options are:

  1. Go the XNA way
  2. Use SlimDX 

As all of you probably already know, XNA is a .Net full framework for Game Development. It´s very easy to use, powerful, and cross-platform with the XBox and Zune (too bad no support for Windows Mobile yet). It is great, but in some cases, it has its disadvantages, as being cross-platform introduces some limitations for windows only development.

SlimDX is a DirectX Wrapper to allow .Net developers access the DirectX functionality from C#, Visual Basic, IronPython, etc… It´s a bit more complex, as it just “translates” DirectX to .net, but it is currently the only way to get access to DirectX 10 and DirectX 11 from .Net.

Which way you choose is your business and should depend on many factors. Check the links for more information.

The point is that, due to the problems regarding UVAtlas in Managed DirectX 9 (depicted here), I constributed to the last release (March 2009) of SlimDX with a UVAtlas wrapper for DirectX9, a feature still not present in SlimDX. This implementation fixes the problems present in MDX and explains a bit the meaning of some parameters.

Hope it helps someone.

D3DX UVAtlas for mesh parameterization fails with some meshes (Partition, Pack and Create)

I have been searching for a solution to this situation for a long time. Searched and searched with no luck on the net. I guess that not many people is using the UVAtlas functionality that comes with DirectX9. So, these are my findings:

Partition and Pack always fail?

If you are using the Managed version of DirectX, the Partition and Pack methods will ALWAYS fail. I´m not sure if it´s related to the MDX implementation itself or (as ZMan suggested), may be due to MDX being based on an old version of DirectX. However, if you want to use them, you will have to deal with the native version: D3DXUVAtlasPartition and D3DXUVAtlasPack.

If you have been experiencing random failures in the UVAtlas generation, keep reading:

I have found that the problem is related to the MaxStretch parameter. If you don´t care much about stretching your geometry in the Atlas, the reasonable value is "1" (any amount of stretch allowed), but this value will cause errors with some meshes. I still wasn´t able to detect why and when it fails exactly.

More precisely, what happens then is that Partition method returns wrong values as output texture coordinates, even when returning S_OK as result. If you don´t detect this situation (as D3DXUVAtlasCreate doesn´t) and pass the resulting wrong mesh to the Pack method, it will throw an exception. The worst thing is that this exception is sometimes a native memory violation exception, so a managed try-catch won´t handle it and will force your application to exit.

To detect wrong texture information, Lock the mesh VertexBuffer (to get into its contents) and check for wrong resulting U,V values: +/- infinity, NaN, or extremely big values.

The general criteria to fix this situations is to low MaxStretch down. Most of the times (if not always), using 0.999f instead of 1 makes it, but maybe sometimes you will have to make it even lower, depending on your meshes.

Hope this helps.

Cheers!

How to sign C++ CLI assemblies with a strong name

If your application is signed with a strong name, Visual Studio will require you to sign every assembly you reference. Now, even if you are a .Net only developer, it happens sometimes that you have to deal with some kind of interop with C++/CLI DLLs. If both situations happen, you will find yourself in the need to sign a C++ assembly with a strong name.
To do so, you have to specify the key file you will use at:
Project->Properties->Configuration Properties->Linker->Advanced->Key File. Something like this:
image
Don´t try to sign the assembly with a .Pfx file. It won´t work. To do so, you need a .SNK file (Strong Name Key). You can generate one with the SN.EXE tool, using:
sn.exe –k [directory]\[filename].snk
Where to find SN.EXE ?
In the Microsoft .Net Framework SDK (usually c:\program files\microsoft .net\sdk\bin, or something similar). You can download the SDK from here.
Note: In order to install that SDK, you will also need the .Net Framework 1.1 installed. As it´s a bit old, many people don´t have it in their machines.

Avoid that strange “Form going to background” effect in WinForms

Someone asked me yesterday about a strange effect he was getting in a WinForms application.

Scenario:

  1. Form1 is the main form of the application
  2. Form2 is a child form shown sometimes to make additional operations. This form is shown using the Show() method, not the ShowDialog() method. I´m not sure if this affects this specific situation, but in his program, Form2 is forced to never be closed (except when app exiting), so it can be reopened whenever the user wants, without loosing information. This way, when user closes the form, it´s in fact being hidden, not closed.

Symptoms:

Apparently sometimes, when user closes Form2 (actually hides it), the focus doesn´t come back to the main form. Instead, Form1 is minimized, what is very frustrating from the user experience point of view.

Solution:

What looked like a random behavior, it is in fact due to Form2 opening additional modal dialogs, like MessageBoxes, and setting their owner to himself (Form2). Something like this:

class Form2

{

MessageBox.Show(this, “Hello”, “World”…);

}

The solution is to set the MessageBox´s Owner to Form1 (the main form), instead of Form2, like this:

MessageBox.Show(this.Owner, “Hello”, “World”…);

And that´s it ;)

ListView highlighting effects (and how to force it to keep highlight when lost focus)

 

Many people ask about how to force a List View to keep the selected item highlight when the control lost its focus.

The obvious and fast answer is: Set “HideSelection” property to false, as it seems to be designed with such purpose. In part, this is true, because when the the list view losses the focus the item remains highlighted, but with the “inactive” color, instead the default highlight one.

A VERY EASY way to achieve is:

1.- Mark your list view as “Owner Draw” (OwnerDraw property = true)

2.- Write an event handler for the even “DrawItem” or “DrawSubItem” of the list view, doing something like this:

 

private void lvModelsInfo_DrawItem(object sender, DrawListViewItemEventArgs e)
       {
           if (e.Item.Selected)
           {
               e.Graphics.FillRectangle(new SolidBrush(COLOR1), e.Bounds);
               e.Graphics.DrawString(e.Item.Text, listview1.Font, COLOR2, e.Bounds.Location);
           }
           else
           {
               e.Graphics.DrawString(e.Item.Text, listview1.Font, COLOR3, e.Bounds.Location);
           }
       }

 

Et´voila. The list view keeps the highlight.

In addition to that, I´ve marked three variables: COLOR1, COLOR2 AND COLOR3. This vars allow you to customize the selection highlight color, item fore color (when selected), and item fore color (when not selected), respectively.

Hope this helps.

Cheers!

Bungie´s Lighting and Rendering pipeline

Yesterday, I found a very interesting website with publications and articles from Bungie, the creators of Halo. You can find them here.

One of them talks about lighting and rendering and there is a specially interesting slide that will explain a lot of people how they achieve such a wonderful visuals. It shows, step by step, the rendering stages they process (which doesn't necessarily have to be done in different passes). Starting from the transformed geometry:

1.- Draw geometry with shaders using the following information:

  • Albedo (on the right): This includes normal textures, taken form pictures and processed to be seamless, normalized lighting, etc.
  • Normal Maps (on the left): Special textures storing surface information, instead of visual appearance or color.

One thing to note: Watching the albedo, they don´t use HDR textures. This is something logical, as it frees content creators form processing every single texture to adapt it to scene lighting conditions. This ifnormation is applied in the next step.

image

2.- Static Lighting

Applies lighting calculations from static lights. This process is probably the responsible to add the HDR information to the result of the previous stage. You can clearly appreciate it in the following picure (the level of contrast between the outside and inside parts is huge).

image

3.- Dynamic Lights

This stage adds the lighting information coming from lights that may change each frame (moving or changing lights, etc). In the picture, you can clearly see the new light that will simulate an explosion later. Of course, this light needs to be dynamic, as it´s intensity will vary to simulate the explosion effect.

image

4.- Transparents

To achieve some visual effects, like lens flares, explosions, fire, etc, using 2D impostors is still the way to go. You can appreciate the ray or explosion effect in the picture.

image

5.- Post-processing

And finally, with some 2d post processing (some bloom, tone mapping, etc), and the final result.

image

Microsoft Research and Bungie… talented people, for sure…

image