We wish you a happy new year 2010!
For us, 2010 will be an exiting year as Monika is expecting our first child.
And of course we hope to meet all of you on the REAL events around the world.
Over Christmas I wrote a simple set of functions I can use in my plugins to easily split work on several threads. So for example the Picture.ThreadedTransformMBS function takes a thread parameter. With value -1 no threads are using and the work runs on the main thread. But if you use the value 0, the plugin creates one thread for each CPU core. This way you can easily get a good number of threads. Also you can pass a positive number to get that number of threads.
The number of threads to use for a certain function can be difficult. Sometimes more threads than CPU cores makes the function run faster, because on all threads running on the system you get a higher split. Sometimes the overhead introduced with threads makes this inefficient to use a lot of threads.
The plugin functions for threads have another advantage: They yield on the REALbasic thread. So if you call the function Picture.ThreadedTransformMBS inside a REALbasic thread, it will yield time to the main REALbasic thread so you can update GUI:
If you need a plugin function to run faster using multithreading, send me an email.
Frohe Weihnachten und ein gutes neues Jahr!
Merry Christmas & Happy New Year
Joyeux Noël et Bonne Année
Buon Natale e Felice Anno Nuovo
Monika & Christian Schmitz
One of the things I have to keep an eye on is the split of the plugins.
Making a plugin part has a certain overhead. We do have a minimum size for a plugin. On Windows 33 KB, on Mac OS X 12 KB per CPU architecture and 29 KB on Linux. But we also have common code which is used in several plugins.
So splitting a plugin part into two parts can reduce your application size if you only need one of the two parts. But if you use both, your size increases.
Today I change a few plugin parts inside the Cocoa plugin:
I merged NSGeometry, NSException, NSError and NSAutoreleasePool plugin parts into a NSBase plugin part. This are all basic Cocoa things so you properly have them anyway in your application if you use anything with Cocoa from my plugins. This plugin parts have 57 + 61 + 57 + 70 = 245 KB. But the combined part has only 86 KB, which saves 159 KB.
I also merged NSColorSpace and NSColor plugin parts. The NSColorMBS class has a Colorspace property and also the NSColorSpaceMBS class refers to the NSColorMBS class. So basicly once you use one of them in your app, you also have the other one. Here we have 147 + 74 combined to 164 KB which saves 57 KB.
Same for the NSView and NSWindow classes. Also NSResponder is the super class of NSView, so you have it always. Results in 123 KB saved for 225 + 127 + 168 adding to 397 KB.
All sizes are for universal plugins on Mac OS X (Intel+PPC code).
Today I spend some time writing Cocoa plugin classes for the tabpanel. You can soon use this classes to control more of the properties the tabpanel controls in REALbasic. Be aware that this is Mac OS X only for the Cocoa target:
So you can have the tabs on all sides, have small or mini tabs, use transparency and even hide all tabs or use a simple line border.
For now you can't change the colors of the tabs except for gray as Apple uses images for this and not a color property.
Today I had a client using CURL for FTP uploads, but with a few servers the login takes forever.
The reason was that this FTP server is old and does not understand the EPSV command. So the CURL library waits for the timeout.
The solution is simply to disable that EPSV command and use the old PASV command. In CURL you simply set the OptionFTPUseEPSV to false for this server and login is again done in less than a second.
If you like to use Microsoft SQL Server, you can use the MBS REALbasic SQL Plugin to connect to the database:
For a local secure connect, the connection string is "\@". For this example the name of the PC is WINDOWSXP, the instance name is SQLEXPRESS and the database name is master. And for the sample we installed MS SQL Express 2005. Make sure you switch on all the protocols and and it may help to allow remote connections.
For the Cocoa target in REALbasic we are working heavily to update the plug-ins. One thing I want to have is the cocoa classes for the controls ready. And this classes connected with extensions to the RB controls so you can easily access them.
You can soon use code like the following with MBS Plugins version 10.0 and RB 2010:
ImageWell1.NSImageViewMBS.alphaValue = 0.5
ImageWell1.NSImageViewMBS.imageFrameStyle = NSImageViewMBS.NSImageFramePhoto
ImageWell1.NSImageViewMBS.imageAlignment = NSImageViewMBS.NSImageAlignBottom
And if you use properties like this directly, you can have a lot of Cocoa specific tuning of the controls:
- current REALbasic ImageWell Look.
- imageFrameStyle = NSImageFramePhoto
- imageFrameStyle = NSImageFrameGrayBezel
- imageFrameStyle = NSImageFrameGroove
- imageFrameStyle = NSImageFrameButton
- alphaValue = 0.5
- imageAlignment = NSImageAlignTopRight and imageFrameStyle = NSImageFramePhoto
- imageAlignment = NSImageAlignBottomLeft and imageFrameStyle = NSImageFramePhoto
- imageScaling = NSScaleToFit and imageFrameStyle = NSImageFramePhoto
- imageScaling = NSScaleProportionally and imageFrameStyle = NSImageFramePhoto
If you need, you can order me to create you a plugin part with special features like Mac OS X 10.3.0 compatibility.
Or if you need for your application a smaller plugin size, I can compile a plugin with only the classes/methods you need.
Cost is by development time.
As you may know we have a SQL plugin for REALbasic. Whether you should use the database plugins coming with REALbasic or the MBS REALbasic SQL Plugin is a good question and it depends on what you need. Some prefer our plugin because of stability or for more features like bulk record reading or better blob handling.
For the text encoding, if you have trouble, you should check a few things:
- What native text encoding does the platform has the database server is running on?
- What text encoding is the database server using for storage?
- What text encoding does the database API use for clients over network?
- What text encoding do you use for query strings?
- What text encoding is set for the C library?
For 3 you should check the database manual. For example mysql can be configured to use ISO Latin 1 text encoding which will make trouble if you store Asian characters.
For 4 you may need to make sure that all text sent to the plugin has a known encoding. Internally the plugin converts text to UTF8 or Unicode and later into the encoding the database client needs.
For 5 you should look on a call like SQLGlobalsMBS.Setlocale(0,"UTF8") because that changes the text encoding conversion functions the plugin uses.
But once everything is setup correctly you can enjoy a nice and stable database access.
After the release of the 9.8 plugins I had today to increase that version number for the next release. I don't expect I need a 9.9 release between christmas and new year to fix some urgent bugs like I had it some years ago.
So next release is very 10.0. Ten, wow!
A few months ago the chamber of commerce a letter whether I want to be in their monthly magazine listed on the list for companies celebrating 10 years. I was amazed reading this, but next year on April 1st my company will be 10 years old.
So be happy and let's continue for the next years.
Today we released version 9.8 of the REALbasic plug-ins
and version 1.8 of the Filemaker Plug-In
Also we sent a few users an email asking for feedback. Please answer and tell us what we can improve.