Andrej Tozon's blog

In the Attic

NAVIGATION - SEARCH

Posting from Word 2007

Last night I installed both Windows Vista Beta 2 and Office 2007 Beta 2 on my HP NX7010 notebook. For Vista it took about 4 hours to upgrade from Windows XP, more than half of that time was spent on the last step. After the final reboot, my screen went blank. Nothing... So I plugged the notebook to the main monitor and started The quest for the missing screen. After one hour of freaking and tweaking the video settings I uninstalled the new video driver (Vista installed MS' Radeon 9000 driver) and reinstalled the original ATI's Radeon 9200 driver, which finally helped. OK, I'm not getting Aero Glass and the performance is poor, but this is Beta, running on an old(er) box, carrying not more than 512kB of RAM. The next thing was resetting the wireless connections' security settings, which all went brain dead. I attribute their memory loss to the Security intervention.

The Office 2007 upgrade was over before I knew it. Silent and quick.

I already feel comfortable working with new Office; adjusting to Vista will probably take a day or two more… I’m not sure I’m comfortable with the fact I have to confirm almost every mouse click, therefore I'm disabling UAC for the moment. Too much security might just kill the productivity.

Slides and demos from NTK2006

11th NT Conference (the biggest IT Event here in Slovenia) is over. For all, who attended (or not) my talk or hands-on-lab about building Windows Forms and Smart Clients with Visual Studio 2005, here are the links to the presentation materials:

Building Rich User Interface with VS2005: PPT | Code
Building Smart Clients with VS2005 (HOL): PPT | Manual | Code

For all you who didn't make it to the conference, head over to Dejan for a short resume of what was going on there.

Now downloading: Windows Vista Beta 2, Office 2007 Beta 2

Europe Weather map with Atlas

Continuing with Atlas experiments... This time, it's Europe Weather map, showing real-time weather conditions across some European cities. It's based on VirtualEarthMap control with custom pushpins. Just hover your mouse over some weather sign and you'll get current weather conditions for that city [in Slovenian language only].

Europe Weather map

At this point, this is just a sample, so I wouldn't call it a mashup (yet). I'll add new features in the future. Also, loading can be a little slow on slower boxes, so it might take a few seconds for weather signs to show on the map.

The current weather conditions are provided by national Environmental Agency.

New Ministry and Revco releases

Just learned today that both Ministry and Revolting Cocks released new albums this year. Took me a while to find out about those - obviously I don't read anything from the net anymore unless it's got RSS feed :P

If you're interested, you can stream the entire Ministry's latest album - Rio Grande Blood - for free [here].

On a side note: Google Trends works excellent also as a history recorder. I've seen a lot of people are comparing VB and C# on Google Trends; but to try something different, and with Eurovision Song Contest going on today and all, check out this popularity boost moment... ;)

Atic Atac PC remake

If words Atic Atac bring a nostalgic smile on your face, hurry up to Retrospec and download this excelent ZX Spectrum game remake for PC [just released today]. Now, I haven't been into gaming for some time, but 20+ years ago, this one had us kids pile up in front of the TV for whole afternoons after school...

Atic Atac

Atlas EuroCalculator

This is more of a local thing, but Slovenia is getting ready to adopt the Euro currency and I thought I could come up with the SIT to EUR currency calculator, wrapping it in a useful declarative Atlas sample. And here it is - copy the following code into the Atlas-enabled web page:

<div>
   <input type="text" id="inputBox" size="5" class="input" value="0"/> SIT
   <input id="calculateButton" type="button" value="SIT -> EUR" />
   <span id="resultLabel">0</span> EUR
   
<span id="euroValidator" style="color:red"> *</span>
</
div>
<
script type="text/javascript">
   function CalculateEUR(sender, eventArgs)
   {
      
var value = eventArgs.get_value();
      
var newValue = 0;
      
if (value > 0)
         newValue = parseInt(value / 2.3964, 10) / 100;
      
eventArgs.set_value(newValue);
   }
</script>
<
script type="text/xml-script">
   
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
      <components>
         <textBox id=
"inputBox">
            <validators>
               <requiredFieldValidator errorMessage=
"Vpiši številko!" />
               <typeValidator type=
"Number" errorMessage="Vpiši številko!" />
               <rangeValidator lowerBound=
"0" upperBound="100000000" errorMessage="Številka mora biti večja od 0!" />
            </validators>
         </textBox>
         <label id=
"resultLabel">
            <bindings>
               <binding id=
"calculator" dataContext="inputBox" dataPath="text" property="text" transform="CalculateEUR" direction="Out" automatic="false" />
            </bindings>
         </label>
         <validationErrorLabel id=
"euroValidator" visibilityMode="Hide" associatedControl="inputBox" />
         <button id=
"calculateButton">
            <click>
               <invokeMethod target=
"calculator" method="evaluateIn" />
            </click>
         </button>
      </components>
   </page>
</script>

The code is, thanks to Atlas, pretty straightforward, so I don't think I need to explain it here. If you have some questions, comments or improvements to the above code, feel free to post them here.

Disclaimer: the above sample is for illustrative purposes only. Don't use it to perform any real-world calculations, since [the above javascript funcion] hasn't at all been tested for accuracy of the SIT -> EUR conversion.
Actually, the included javascript function does a poor job in calculating the accurate result. It probably would be best to create a web service, which would return the correct result and bind the calculator to it.

[Update: The code was actually calculating EUR -> SIT, not vice versa. Fixed.]

Binding VirtualEarthMap Pushpin images

I've seen many questions regarding Atlas VirtualEarthMap control and assigning different images for different pushpins. The common solution is to use a single image for all pushpins on a map by specifying the map's [code language="C#"]pushpinImageURL[/code] property, but if you want pushpins to be represented by different images, you have to look a bit further. I took a closer look at this while playing with VirtualEarthMap, and the solution seems quite obvious: if you're retrieving your pushpin data from a web service, you probably defined a pushpin class, like:

[code language="C#"]public class Pushpin
{
   private int id;
   private double latitude;
   private double longitude;
   // other fields
   #region properties
      // ...
   #endregion   
}[/code]

Now, let's say you're marking important building in your area and you have prepared some image files like police.gif, fire.gif, hospital.gif , hotel.gif,... You would want to define another field in that class to represent the your pushpin image file, e.g. [code language="C#"]pushpinImage[/code]. Then, in your virtualEarthMap declaration, replace the [code language="C#"]pushpinImageURL[/code] property with these two:

[code language="C#"]dataImageURLFormatString="images/{0}"
dataImageURLField="PushpinImage"[/code]

The {0} part will be replaced with whatever is in [code language="C#"]pushpinImage[/code] (image filename), and your emergency map is ready to use.

One thing I noticed using VirtualEarthMap - binding to more than 10 pushpins at once significantly slows down the loading process. I'm not sure why, but once they are loaded, there are no more hiccups.

Subscribe to this blog with MSN Alerts

You can be notified of any changes to this blog through your MSN/Windows [Live] Messenger, email or your mobile device. To subscribe, click on the MSN Alerts icon on the right hand side of the main blog page and follow instructions. If you like this kind of service, more alerts are available from MSN Alerts Home.

Also, a new WLM Beta was released a couple of days ago. The current version is 8.0.0689 and is available through http://www.ideas.live.com/.