It's 2008. Where's my flying car? RSS 2.0
 Monday, September 15, 2003

The temples of the old Khmer empires in Angkor (Siem Reap) in Cambodia are truly amazing and a must see for anyone interested in ancient cultures. (Although they are actually medieval on the Western time scale considering the time they were built – between 900AD and 1300AD). The picture shows the most famous and best preserved temple, Angkor Wat, which can only be compared in terms of overall scale and work effort to the great Cheops pyramid in Giza. Angkor Wat is the biggest religious site on the planet.

 

I don’t even know where to start writing about how impressive the Angkor sites are and I am certainly not the least bit qualified to describe them properly, so the best is for you to check this very informative guide to the Angkor monuments.

 

In Siem Reap we stayed (luckily) at one of the two best hotels in town, at the Sofitel, which was US$100 a night, but which I can highly recommend if you want to avoid a major culture shock. Cambodia is one of the poorest countries in the world and while Siem Reap doesn’t immediately reflect this, staying at the Sofitel is certainly the best thing a western tourist can do who is not of the adventurer/backpacker type. I spoke to a Swiss tour organizer who specializes in Cambodia tours and he told me that he consolidated his hotel list to only 4 hotels in Siem Reap and the Sofitel easily tops his favorites list – and it’s not the most expensive one. In general, Siem Reap is not a very cheap place to go to considering all cost, but it’s all money well spent if you consider that tourism is the primary source of income and the economic engine for literally hundreds of  thousand of people in the Siem Reap region and that Angkor is still mostly a destination for “those who know”.

 

The entry fee for all of the Angkor sites is US$20 per day and person or US$60 for a three day pass. A good local tour guide and a taxi driver will cost you between US$30 and US$40 per day. You’ll need both and you shouldn’t try to explore the sites just with a book – the guides speak good English (a German speaking guide will ask US$10/day more) and are usually very well educated about the sites and they will fill you in with all the religious background and legends that you will need to understand to appreciate the art. Food can be very cheap (less than US$1 for a meal) if you are one of the daring types with a strong stomach or between US$10 and US$30 at a hotel or at the very few proper restaurants, if you are such a civilization wimp as I am.

 

What you definitely need is lots of sun-block, anti-mosquito spray, light clothes and a hat. Even in the rain season (which is now) it’s very hot around noon time and the humidity is easily at >90%. But that’s not so different from Cairo ;)

Monday, September 15, 2003 3:36:01 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [1] - Trackback
Cambodia
 Sunday, September 14, 2003

Hey, Don! Your "API of the day" entries make me wonder whether you got bored w/ XML. Isn't this counter revolutionary activity?

I actually checked twice whether I am looking at the right date ;)

+1 on MkParseDisplayName(Ex)

 

 

Sunday, September 14, 2003 10:27:28 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [0] - Trackback
COM

I am safely back from my Asia tour and Patricia and I have seen lots of very cool places and I am sure going to post some pictures today and tomorrow.  The one thing that didn’t really work well for me was Internet access so I was essentially offline for the last two weeks. So, first things first, below you’ll finally find the download links for the demos of my talks in Malaysia.

Download: FlightsRUs.zip
Download: newtelligenceSDK-2-21-3239-0.zip
Download: NorthwindTechEdMalaysia.zip

Sunday, September 14, 2003 9:43:05 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [3] - Trackback
TechEd Malaysia | Travel

I have to admit that I was a bit hesitant when Patricia came up with the idea to go to Vietnam on the “leisure-loop” of our South-East Asia trip. The country is, of course, still controlled by a socialist party and is even still “Socialist Republic”, and I really knew very little about Vietnam except for the horrible historic events of the 1960s and 1970s. Of course I was absolutely wrong being concerned about our safety and Ho Chi Minh City isn’t socialistically dull and boring, at all. In fact, it’s great fun!

DungTuangWe met Dung (right) and Tuang (on the left) at a street corner where they asked us whether we wanted to take a tour on their bike-carts. One hour per person for $3 US. Although Vietnam does of course have a proper local currency (the exchange rate is about 15,500.00 VND for 1 USD), everything can be paid for in U.S. Dollars and that’s actually the preferred way of payment. In fact, $3 USD/hr is relatively expensive already considering that locals can get a full meal for less than 30 cents and that you can buy 2.5 liters of (surprisingly good) local draught beer for about 30,000 VND if you (a) find the right place and (b) have local people with you as we did.

However … Dung and Tuang’s services are easily worth their money. They are very friendly (it seems like any other Vietnamese person you could meet in the streets of HCMC is like that), they speak OK-enough English for a conversation and for them to explain a couple of things here and there and of course they know the places to go. But their most amazing skill is navigating through the traffic chaos of Ho Chi Minh City. In “HCMC”, you see a couple of cars here and there, but the streets are dominated by thousands of quadrillion-bazillons of small motorbikes. And of course, nobody pays any close attention to traffic rules (if there are any), but mysteriously, it just works. Even if you go with a slow bike-cart against a one-way street smack in the middle of the road, the traffic flows magically around you and you never get a feeling of being in danger. The secret seems to be that everyone drives very slowly and everyone seems very alert. I would think that the average speed in traffic is about 25-30 km/h. Dung and Tuang took us around for about 6 hours for the money equivalent of 3 rollercoaster-rides at the “Kirmes” in Düsseldorf complete with the entire thrill but a lot more fun.

What becomes very apparent even as you approach the city-center from the airport is that all that seems left of the “Socialist Republic” are the occasional paroles on street posters, but otherwise the market rules. We were told that it’s very different outside the two big cities Ho Chi Minh City and Hanoi and that the agricultural collectives are still the common organization of work there, but there’s no trace of what I think is a “Socialist Republic”, of course having East Germany in mind as an example. Quite to the contrary, Saigon (you will find the old name used much more frequently than “Ho Chi Minh City”; “Sai Gon” is in fact the name of the central 1st district) is a very colorful and vibrant city with a lot of very visible entrepreneurial spirit.

While it seems to be a fun place to be (I spoke to an English guy who went there for a three day trip, went home, quit his job and is now there for 9 months already), don’t expect too much great sightseeing experiences. There are a couple of things to see, but nothing too spectacular. “The War Remnants Museum” on the premises of the old U.S. embassy (from which the last U.S. troops were evacuated by swarms of helicopters), shows a couple of U.S. weapons that were left behind, including the obvious Huey Chopper, an F-5 fighter, a couple of tanks and all sorts of short range missiles. The most horrible two weapons on display are two “daisy cutters” – 7 ton fuel-bombs that annihilate all life within a 500m radius of their point of detonation. The most horrible pictures on display in the adjacent exhibitions halls are those that illustrate the short and long-term effects of the infamous “Agent Orange” on people. Interestingly enough, the rest of the exhibition – except some obvious propaganda in a hall illustrating the support of the world for Vietnam in the times of war – is mostly from U.S. publication sources and photographers, which gives the exhibition some (strange) balance. The entrance fee is 10,000 VND per person.

Otherwise, Saigon is a very interesting and friendly place to explore if you have two or three days while in South East Asia. The Vietnamese people have long understood what the Dollar and Euros are not only worth to them but also to you so don’t expect it to be very cheap. Saigon seems more expensive than, for instance, Bangkok and is much less developed at the same time. However, just from feeling much less “westernized” than any of the other Asian cities that I’ve been to, it draws its appeal.

Sunday, September 14, 2003 9:34:18 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [1] - Trackback
Vietnam
 Monday, September 01, 2003
Samples from TechEd Malaysia should be posted by the end of this week due to lack of Internet access.
Monday, September 01, 2003 2:35:21 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [1] - Trackback
TechEd Malaysia
 Thursday, August 28, 2003

With TechEd Malaysia done, Patricia and I now have a bit more than 2 weeks of vacation! Today we fly to Saigon (Vietnam) and tomorrow from there for 4 days to Siem Reap (Cambodia) to see the temples of the sunken capital of the Khmer empire in Angkor. Then we’ll fly back to Thailand to spend 1 ½ weeks in a beach resort and finally we fly home after another one night stop in Bangkok. This is going to be great fun.

Thursday, August 28, 2003 6:38:13 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [6] - Trackback
Other Stuff
 Wednesday, August 27, 2003

Although we had an excessive first night here in Kuala Lumpur (getting strangers drunk on arrival seems to be some sort of tradition around here), that wasn't the reason for me showing up 15 minutes late for my first talk about "Building Distributed .NET Applications" this morning at 9:00am (then 9:15am) here at TechEd Malaysia. The notification about session slot change somehow either just didn't find its way into my inbox or it fell victim to the Sobig.F mail sweeping. Whatever happened... it seems all people in a full room did indeed patiently wait for me while I rushed from the hotel to the session room. Thank you! Being late to a session at a conference was definitely a (bad) "first" for me and is doubleplusungood to happen to a German. The session ended up going really well and I will post the related samples tomorrow together with the sample for the session on aspects.

The second session was a fun chalk talk with Tim Huckaby about the same topic area. As the lead example for a loosely-coupled, distributed system I used dasBlog and its interactions with other blog engines and moved on to explain how the architectural mesaures taken there could be used for more "traditional" enterprise software scenarios. Core message: asynchronous is good!

Wednesday, August 27, 2003 2:05:49 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [1] - Trackback
TechEd Malaysia
 Thursday, August 21, 2003

The Sobig.F worm is hitting massively. My inbox. While we have all shields up at newtelligence for virus-protection, a bunch of people who have my email in their contacts obviously don't. Since yesterday evening I had to clean out at least 300-400 mails from my inbox that were generated by the worm. By average, I am currently getting a (formerly, pre-scan) infected email every 4-5 minutes. It's f***ing annoying.

Thursday, August 21, 2003 5:15:23 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [3] - Trackback
Other Stuff
 Wednesday, August 20, 2003

While I wasn't looking, Doug Purdy, who is the PM for the team in charge of the XmlSerializer has posted this little cryptic answer to my initial question:

String serializedDateTime = XmlConvert.ToString( someDateTime );

DateTime deserializedDateTime = XmlConvert.ToDateTime( serializedDateTime );

What Doug is showing is really what the serializer is doing with dates under the hood and that I am incorrectly blaming the XmlSerializer for the lack of UTC support. [XmlConvert.ToString() also does nothing more than calling DateTime.ToString() with the appropriate format string]. As I was already saying in yesterday's post, but what I want to make a bit clearer here again is that the actual problem is the lack of time-zone awareness in DateTime.

So the proper thing more me to do is to ask the base-class library team for time-zone support in the base-class library for Whidbey so that Doug can fix this for us ;)

Wednesday, August 20, 2003 6:43:30 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [2] - Trackback
XML | CLR
 Tuesday, August 19, 2003

I posted a little question here, just asking "Why?". For your reading convenience, I pull the code in here once more:

DateTime issued;

[XmlIgnore]
public DateTime IssuedUtc
{ get { return issued; } set { issued = value; } }

[XmlElement("issued")]
public DateTime IssuedLocalTime
{ get { return Issued.ToLocalTime(); } set { Issued = value.ToUniversalTime(); } }

So, indeed, why am I doing this? Well, when I decided to normalize all times handled by the backend engine of dasBlog into the UTC timezone, I really didn't think of the XML Serializer being a problem at first. It turned out to be one.

The reason why I wanted all times to be handled internally as UTC is quite simple: Too many time zones to deal with and I need to have a proper reference to do forward and backward time calculations. dasBlog deals with four time-zones:

  • "Reader Time": The "<%userWhen%> macro emits a block of script that will cause the browser to emit the time of a post local to the reader's time zone. That one is easy, because the calculation happens on the client, but I need to feed it UTC (GMT).
  • "Display Time": This is the time zone the blog owner selects for his/her blog. All times displayed on the weblog pages are shown in that time zone (complete with the TZ name and the GMT offset). This also applies to the "admin pages" such as referrals and events (which both roll over in synch with the display time zone). Display time is calculated dynamically and you will notice that it also automatically adjusts for daylight savings time. The display time zone is also by no means fixed. If the blog author travels (and you will see this on my blog starting next week), he/she can adjust the blog to his/her present time zone. When I am going to be at TechEd Malaysia, my blog will show UTC+0800. To make this time-zone shifting work, the absolute time must be stored in UTC.
  • "Engine Time": This is UTC. All of the dasBlog runtime handles everything in UTC.
  • "Server Time": Now were getting to the point. The engine runs on a server that has it's own local time zone setting: "server local time". That's something that the user who's running his engine at some ISP can't control and that's the one of all the time zones that really nobody is ever interested in. You shouldn't care whether your blog is hosted in Germany, the U.S. East Coast or Singapore. That's even more of an issue because one could expect that hosted sites may get moved around between ISP locations. The only little thing we're interested in is that the server knows its offset to UTC.

So ... I was thinking.... ask for DateTime.Now.ToUniversalTime(), handle everything in UTC from there on and everything's good. (Btw, I know about DateTime.UtcNow, but I like the expressiveness of this better).

What I wasn't considering is the way the XmlSerializer works, which I am using both for storage and for the various web services (including the Atom feed). What I also found is that the DateTime class in the framework isn't time-zone aware.

The workaround above is used because the XML Serialization infrastructure always assumes local time ("Server time") for serialization and will always emit ISO 8601 dates with a time-zone suffix like this: 2003-08-19T15:15:58.0781250+02:00. So when you are handling UTC times internally and use them blindly with XML serialization for both storage and web services, the serializer will assume you are using local time and throw you off by your own time-zone difference to UTC.

This isn't "too bad" when you store stuff in local XML files, because when you write something wrong from the same place you read it back into and your time-zones don't change you are in ok in memory, but you are nevertheless wrong on disk. What happened to me in dasBlog version 1.1 was that I was thinking that I stored UTC, but in fact I stored everything in local time. My UTC time 2003-08-19T15:15:58 always turned into 2003-08-19T15:15:58+02:00, because the DateTime class doesn't keep time-zone information around that the serializer could use. Therefore the serializer must always assume local time and that causes the offset to be emitted. That's of course much worse for UTC+12.

The fix:

The field  DateTime issued; holds the "engine time", which is always UTC. 

The property

[XmlIgnore]
public DateTime IssuedUtc
{ get { return issued; } set { issued = value; } }

wraps this value and is the property that the engine works with internally. The XmlSerializer is instructed to ignore this value in the serialization process by declaration of the [XmlIgnore] attribute. Instead, we tell the serializer to look at the following property, which is not used by the engine itself and also indicates that by its name suffix "LocalTime", which essentially declares it as "off limits" for direct access to everyone knowing the project:


[XmlElement("issued")]
public DateTime IssuedLocalTime
{ get { return Issued.ToLocalTime(); } set { Issued = value.ToUniversalTime(); } }

This property is the one that the serializer grabs and it does the proper conversion to and from server local time that the serializer requires. The actual dasBlog code is using a variant of this property that is a bit larger in code size because it also checks for DateTime.MinValue and DateTime.MaxValue occurrences, which, depending on the server time zone, would cause the time zone shifting to fail with an overflow/underflow exception (and no, I am not checking near MinValue and MaxValue):

[XmlElement("Date")]
public DateTime DateLocalTime
{
   
get
    {
      
return (DateUtc==DateTime.MinValue||DateUtc==DateTime.MaxValue)?
               DateUtc:DateUtc.ToLocalTime();
    }
   
set
    {
        DateUtc = (
value==DateTime.MinValue||value==DateTime.MaxValue)?
                  value
:value.Date.ToUniversalTime();
    }
}

So, that's why.

Be aware that all of this applies to ASP.NET Web Services, too, and if you are dealing with multiple time zones are you are using UTC normalized times in your app, you will have to deal with this. If "server time" makes you happy, you won't need to worry.

Tuesday, August 19, 2003 11:41:11 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [2] - Trackback
XML | CLR

Ok, I couldn't resist getting the Arabic support (mostly) right. Malek helped me and by what he tells me, we've succeeded mostly. There are a few things left to do around wildly wrapping symbol characters, but that'll be worked out eventually.

So, this little patch updates dasBlog with French, Russian and Arabic, including full right-to-left reading support, which the engine injects appropriately into the <body> tag (dir="RTL") based on a hint in the Arabic resource table.

Tuesday, August 19, 2003 6:15:58 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [3] - Trackback
dasBlog
 Monday, August 18, 2003

On the download site I posted add-on packs for French language support and the first steps toward Arabic language support, which are the string tables. My friend Malek Kemmou from Morocco wants to help me figuring out how we can make right-to-left reading work "magically" and without having to rework all the templates. He also did those two translations. Thanks!

Update: I added a first attempt at generic RTL support to my private build and installed it here. If the primary language is set to any of the Arabic language variants, the page will flip into RTL reading. There are some issues around formatting to be worked out, though.

Monday, August 18, 2003 3:28:42 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [1] - Trackback
dasBlog

The workspace is maxed out at the current 20 users. I already submitted the form to ask for more users (the largest decimal number it takes is 99 so I went for that) and I really hope that there's someone at the other end of that form. GDN team, are you listening?

Update: Fixed.

Monday, August 18, 2003 1:36:07 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [2] - Trackback
dasBlog

I just posted newtelligence dasBlog version 1.2.3230.0 to the GotDotNet workspace and to the download section on the dasBlog site.

With this drop, I now have a feature set that makes me happy for my own blog and which some of you out there hopefully find useful for your own blogs. It’s been 5 weeks that were a lot of fun and I learned a lot about other user’s requirements through the feedback that I’ve gotten in the three weeks that the code has been public now.

And with this drop, I will therefore also stop the feature rush and likely not post more than fixes or updates to the language files and templates. Don’t expect significant new features from me in the upcoming weeks. What that means is clearly that I expect that something happens in the GotDotNet workspace from people other than me. There’s been a lot of complaining in the BlogX workspace about BlogX being stalled in terms of features and that the code-base has been locked and checked out the whole time. So, there you go: dasBlog is not checked out and open for all workspace members to change. I am going to be on the road for 3 1/2 weeks starting Wednesday, so don’t expect me to organize anything in the workspace or watch it. It’s yours. I’ll delegate accepting new members and begging to Microsoft for more workspace resources to someone around here, but that’s about it.

That also means that my private copy I am carrying around on my notebook is now forked off from the main code base and is going to be my own private little playground for new things to try.

Even if you are not at all interested in running the software as-is, you may want to go and grab the code base, because I am sure there’s a lot of useful little things in there if you are developing ASP.NET apps. It turned out to be so much new code and so many new little utilities and tricks that I could hardly keep track of the “new new” things, let alone document them. There’s a lot of fodder for articles, tips and tricks columns or for highlighting aspects here on the blog.

One thing you’ll find digging into the code-base is that almost always when there’s something that doesn’t need to be done synchronously, I don’t do it synchronously. Every referral gets queued up in an in memory queue and is written to the referrer-log on a secondary thread. All mail notifications, pingbacks, trackbacks and the pining of weblogs.com and blo.gs are also done on secondary threads.

You’ll also find that the little drop-shadows on the configuration page for the content-filter are neither rendered by IE, not will you be able to find the displayed images anywhere in your site’s directories. Instead, the drop shadows are all dynamically rendered. The magic is done by the “ShadowBox” control that’s in the newtelligence.Web.UI.WebControls assembly. You can configure the shadow depth, the background color onto which the shadow is to be rendered, etc.

The DHTML editor is also a reusable component from that assembly. It loads its toolbar from an embedded resource using the same technique: The ControlImageHandler class is an IHttpHandler which is capable of redirecting requests for images back to the controls that rendered the image links. So, in essence, you get something similar to Windows Forms’ OnPaint() support for WebControls.

There’s a complete (and working) implementation of a class WindowsTimeZone, derived from System.TimeZone and a matching WindowsTimeZoneCollection that grabs all the time zone information known to Windows and exposes that in a .NET Framework compatible way, including daylight savings time and all that.

The UrlMapper is a generic component that lets you use regular expressions to filter incoming URLs and map them to internal URLs, which comes very handy if you change a site’s structure around, MailToWeblog contains a five-liner showing how to create thumbnails from images, …

…. many things to explain in more detail and so little time. Stay tuned. ;)

Monday, August 18, 2003 7:17:45 AM (Pacific Daylight Time, UTC-07:00)  #    Comments [3] - Trackback
dasBlog
Stuff
About the author/Disclaimer

The content of this site are my own personal opinions and do not represent my employer's view in anyway. In addition, my thoughts and opinions often change, and as a weblog is intended to provide a semi-permanent point in time snapshot you should not consider out of date posts to reflect my current thoughts and opinions.

© Copyright 2008
Clemens Vasters
Sign In
Statistics
Total Posts: 724
This Year: 18
This Month: 0
This Week: 0
Comments: 1226
Themes
Pick a theme:
All Content © 2008, Clemens Vasters
DasBlog theme 'Business' created by Christoph De Baene (delarou)