VFP9 stores currency data as Int64 (8 bytes). The original value is multiplied by 10,000, then rounded to 0 decimal places, and then stored in a table. For example, 12.4301 is stored as 124301.
Currency field type has 4 fixed decimal places.
Normally this knowledge is irrelevant because the VFP converts numbers to currency and backwards implicitly. Only if you need to access tables on a lower level, you need to know this.
Sunday 28 September 2014
Friday 26 September 2014
WPF DataGridColumnHeader cuts off first underscore character
In my WPF project I populate a data grid from a random source (a table in a database), so the number of columns and the column names vary each time the grid is filled. The column names of a table are used as grid headers. During testing I found that every grid header with underscore characters always has the 1st one cut off. The reason is that WPF uses the underscore character for marking accelerator keys.
If left as is, it will certainly confuse a small number of end-users. The majority of course will not notice, which still cannot excuse the developer from fixing the issue. Declaring it a feature in user manual is even more laughable because nobody ever reads user manuals except for searching a phone number to call and swear at support.
So I need a solution. First I decided to choose a complex path. No, first of course I started to Google. And then the second step, I decided to try either an event handler or to start messing up with DataGridColumnHeader's style and template. The results were as ugly as unsatisfactory.
But then, bingo, came a solution. If this guy, the DataGridColumnHeader, likes to have underscores for breakfast then make sure it has one every time. So now I simply prefix headers with the underscore. The issue is resolved.
If left as is, it will certainly confuse a small number of end-users. The majority of course will not notice, which still cannot excuse the developer from fixing the issue. Declaring it a feature in user manual is even more laughable because nobody ever reads user manuals except for searching a phone number to call and swear at support.
So I need a solution. First I decided to choose a complex path. No, first of course I started to Google. And then the second step, I decided to try either an event handler or to start messing up with DataGridColumnHeader's style and template. The results were as ugly as unsatisfactory.
But then, bingo, came a solution. If this guy, the DataGridColumnHeader, likes to have underscores for breakfast then make sure it has one every time. So now I simply prefix headers with the underscore. The issue is resolved.
FixieBreaky: when purging database records keep the transaction log in mind
The space on a database server was shrinking. That was not a danger level yet, though the trend left no mistakes: in about two month it would be over. A colleague of mine decided to delete a large amount of obsolete records in a database on the server.
Neither he nor anybody else around did not give a second thought about the transaction log growth caused by the deletions. That included me, even though I stepped into same trap a year ago.
Lessons:
Database backup is extremely important.
Heroic actions is not a substitute for planning.
No matter how large and expensive a storage is, one day it'll be filled
No magic software tool is a substitute for planning
Stay alert, whatever comes to you, look into your previous experience
Blaming and punishing is not a substitute for planning
Neither he nor anybody else around did not give a second thought about the transaction log growth caused by the deletions. That included me, even though I stepped into same trap a year ago.
Lessons:
Database backup is extremely important.
Heroic actions is not a substitute for planning.
No matter how large and expensive a storage is, one day it'll be filled
No magic software tool is a substitute for planning
Stay alert, whatever comes to you, look into your previous experience
Blaming and punishing is not a substitute for planning
Subscribe to:
Posts (Atom)