Making it happen
Archive for August, 2005
CMYK Jpegs
Aug 30th
I’m currently having a weird issue with 4-channel JPEGs in CMYK color space. The result of the decompression with libjpeg is different than the image as seen windows image viewer, MSPaint and Photoshop. Currently only Macromedia product display the bizarre jpeg file exactly like us. I suspect the whole point may be in the CMYK – RGB conversion.
Geeky rap :D
Aug 27th
Programming contests
Aug 22nd
Tonight is Google CodeJam qualification round, I’ll be coding there with username “Pisoi”. It is the first of the contests I will attent, the rest being ACM, CSIDC and Windows Embedded Challenge. My target is at least 3 out of 4 finals.
UPDATE:
FillRect & DrawText DC drawing mess
Aug 20th
Ok so in the last weeks I had some weird bugs involving drawing from an OLE server into the client-supplied DC. This DC had about 4000 logical points per device point, however a device point represented about 10 pixels on the screen. Because of the large logical points coordinates I found out that somewhere in FillRect they got truncated to the first word, so it didn’t draw correctly at all.
Another issue: because of 10 pixels per 1 device point the dimensions returned by GetTextExtent were all rounded to a multiple of 10 (!).
But the weirdest issue that I gived up solving was that a DrawText with DT_CENTER using the entire client rectangle was not centering it at all but rather drawing at a random position every time it was called. Some really strange things happening there… well in the end I wrote a workaround but eventually when I will have some more spare time I may again take a look at this.
Quake 3 source code
Aug 20th
It was officially released under GPL and it’s available here [ftp.demon.co.uk]. Didn’t have time to look thoroughly at it but will do that next week.
VB empty arrays
Aug 11th
I found out that VB doesn’t support empty arrays, i.e. 0-length ones. So LBound will be always <= than UBound. The only workaround is to check for a “Nothing” array before its usage.
Hot to avoid closing the property page
Aug 11th
When the user has clicked OK but you would liek to stop the closing because there is invalid data entered. The straightforward solution is to override OnApply and check for a flag set by OnOK. Depending on its value return TRUE or FALSE.
Mac looks
Aug 10th
Insert binary data from SQL script
Aug 5th
This is a big problem in SQL server. So I need to generate a creation script that should also fill the tables with data. For the populate commands I couldn’t find any program so I’ve written one quickly. Now, the problem was the image fields, although SQL server has support for binary constants (using 0x), the script lines are limited to 64k (in SQL Query Analyzer). Now this can be avoided theoretically by adding a part of the data and then constantly updating the data with + (so concatenating the existing contents with new data) until the whole data is added.
Unfortunately this doesn’t work – I have to cast “image” to varbinary, and varbinary in the script is limited to 8000 bytes. So if anyone knows a method how to do it – please advise.
Mac design
Aug 4th
I found out this guy that has designed lots of Apple’s products. Many of them are discontinued, so I have never seen them. They used to look very cool in the past, also.
