Older blog entries for asmodai (starting at number 43)

On the topic of sensible date and temperature defaults in applications and websites

Something that can always get me a bit frustrated is the choice of defaults used in applications.

Dates: Aside from Belize, Canada, the Federated States of Micronesia, Palau, the Philippines, and the United States are the only countries using a date format where the month is the first entry, followed by day, and lastly year (mm/dd/yyyy). To put to numbers that’s about 436 million people who use this versus 6.35 billion that don’t (ratio of about 14:1). Of that 6.35 billion about 3.8 billion use a date format where day is first, followed by month, and lastly year (dd/mm/yyyy — ratio of about 9:1 to the month first users). About 1.81 billion use a form where the year is first, followed by month, and lastly day (yyyy/mm/dd, roughly equivalent to ISO 8601 — ratio of about 4:1 to the month first users). (Note: these 1.81 billion have a slight overlap with the 3.8 billion due to some countries having two date formatting forms in use or due to two or more distinct scripts with different date formatting styles.) So using a format where the month is first is only confusing for the majority of the world’s population. If you need a default date, use the ISO 8601 format — not only is it less ambiguous, it also allows for much better chronological sorting.

Temperature: Aside from Belize and the United States (I so far managed to find), the worldwide standard for temperature is Celcius, not Fahrenheit. If you are using Fahrenheit you are putting 6.48 billion people at a disadvantage solely against something like 313 million people. That’s a ratio of about 22:1, meaning you put 22 people at a disadvantage for every one person you are trying to please.

Disclaimer: do note that this of course only makes sense if you are appealing to an international audience. If you are just targetting a specific country you will of course default to what they use. On the other hand, properly fixing your code to be i18n-ready is the way to go anyway.

Syndicated 2010-06-19 17:59:01 from In Nomine - The Lotus Land

Predefined macros

So with the GNU compiler you can use the preprocessor to get a list of the predefined macros:

$ cpp -dM /dev/null

or if you prefer to invoke the preprocessor via gcc itself:

$ gcc -dM -E – < /dev/null

This should give you a list similar like:

#define __DBL_MIN_EXP__ (-1021)
#define __FLT_MIN__ 1.17549435e-38F
#define __DEC64_DEN__ 0.000000000000001E-383DD
#define __CHAR_BIT__ 8
#define __WCHAR_MAX__ 2147483647

For Microsoft’s Visual C++ compiler I have only found pages like:

For Intel’s C++ compiler I found the following page with predefined macros.

And I find this interesting page with a lot of different compilers and their predefined macros to identify them and their versions, if any.

Syndicated 2010-04-11 16:05:51 from In Nomine - The Lotus Land

CLDR 1.8 released

On the 17th the Common Language Data Runtime project at Unicode released version 1.8 of the CLDR.

CLDR 1.8 contains data for 186 languages and 159 territories: 501 locales in all. Version 1.8 of the repository contains over 22% more locale data than the previous release, with over 42,000 new or modified data items from over 300 different contributors.

Syndicated 2010-03-18 08:50:35 from In Nomine - The Lotus Land

Firefox 3.6 and the million proxy password popups

I needed to authenticate with a proxy today and with Firefox 3.6 I constantly got user/password dialog boxes. Of course, this is annoying. Some searching lead me to an article on the Mozilla support site which mentions a setting (which you can reach via about:config) named network.auth.force-generic-ntlm which, when set from false to true, fixes a lot of these popups.

Syndicated 2010-03-18 08:40:04 from In Nomine - The Lotus Land

On design

Maybe this will reach some people and cause less frustration for other people:

  • No, Microsoft Word is not the correct kind of program to design your logo in.
  • When your designer asks for a high resolution copy of your logo, he means something that not 150 x 300 pixels, but rather a logo professionally designed with a vector drawing program, say, Adobe Illustrator.
  • Despite how creative your designer is, he or she need input and ideas about what you want to accomplish in order to give you results in return.
  • Designing a logo that you feel comfortable with can take as little as 1 hour or as long as a few days or even weeks (depending on the amount of people who have to affirm it), you have to pay for such effort, obviously.
  • The primary colours are blue, green, and red (unless we are talking about print, then they are cyan, magenta, and yellow).
  • No, blue is not a warm colour. Subsequently, red is not a cool colour.
  • After you have approved all designs, changing your mind means you will incur additional costs.
  • You cannot just take photos or other images/designs from the Internet and reuse them without clearing proper copyright issues.

Syndicated 2010-02-17 13:40:56 from In Nomine - The Lotus Land

Clustering and relevant algorithms

Disclaimer: I’m mainland European, we tend to use the , to separate digits from the whole numbers.

Clustering is quite a common approach to aggregate coordinates that are relatively close together. The problem lies in the choice of algorithm to use. This choice is highly dependent on the space in which the coordinates are laid out. Quite often you can just use basic Euclidean distance which, for a 2-dimensional space, simply takes the square root of the sum of the squared subtraction of the respective coordinates of each point. So if you have a point p with coordinates (33, 52) and a point q with coordinates (82, 19), the distance between p and q would be:

>>> import math
>>> math.sqrt(pow(33 - 82, 2) + pow(52 - 19, 2))
59.076221950967721

And based on that distance you can start to cluster points together that are all roughly the same distance from a certain point, say 59,1. The fun part of this is that this distance is the radius of a circle. So if you would plot every possible coordinate at that distance you will see a circle emerge.

In looking at clustering algorithms I also encountered something called Manhattan distance, but this algorithm only makes sense if you are working in a grid with roughly equidistant lengths to the other coordinates in this space. Normally the shortest distance from A to B would be a straight line, as the Euclidean distance shows. However, if the movement from coordinate to coordinate is restricted to straight lines, say the grid layout of a lot of North American cities, then Euclidean distance cannot apply. This is the same problem a taxi faces when trying to find the shortest distance to drive from A to B and as such the algorithm is also known as the taxicab distance or geometry. It takes the sum of the absolute value of the subtraction of the respective coordinates of each point. So if you take point p and q again, the distance would in this case be:

>>> abs(33 - 82) + abs(52 - 19)
82

Now, if you would plot all possible coordinates with that distance you will see a circle emerge again. However, keep in mind that a circle is nothing more than a set of points with a fixed distance (the radius). In this case our geometry uses a differently defined distance. If you would plot this out with a finer and finer grid the circle shape that emerges is a square rotated 45° so that it rests on its point.

Syndicated 2010-01-18 11:35:38 from In Nomine - The Lotus Land

OpenGL 3.x and DirectX 10/11

Expect more information about OpenGL and DirectX related subjects in the coming period as I will start to delve into the basics of these.

Syndicated 2010-01-18 10:30:06 from In Nomine - The Lotus Land

Avatar 3D, blurry vision

Went to see Avatar in 3D tonight. Typical story, but the animation was amazing. The 3D was also better than what has been out there. But darn, for the past 4 hours after exiting the theatre I have been having my vision still be in stereoscopic mode or something. I see everything beyond 1-2 meters as blurry, as if watching the movie without glasses. Hope a good night’s rest will cure that.

Syndicated 2009-12-30 22:45:47 from In Nomine - The Lotus Land

Finally a stable connection

As I previously recorded in the posts here and here, my network interface card under Windows 7 started to drop the complete traffic whenever it got stressed out with network traffic. Heck, sometimes not even when stressing it out. Digging through various fora I came to the Nvidia forum again and found a thread that mentioned a Microsoft Knowledge Base article that instructs in turning off receive-side scaling.

After turning said option off and stress testing the link for a few hours I did not experience any drops. So this might actually finally be the stable connection I am looking for.

Syndicated 2009-12-16 06:47:01 from In Nomine - The Lotus Land

34 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!