Monday, April 16, 2007

Silverlight: Based on the Microsoft .NET Framework

I came across a blog post from Brightcove which made my day. It indicated that Microsoft’s new name for WPF/E was Silverlight and that Brightcove would be looking at using the technology. So I hopped over to the supplied links and did a few searches. Some useful web pages on the subject include:



The main Silverlight web site contains these wonderful words:



“Based on the Microsoft .NET Framework”


Man that’s good to hear. The last CTP of the WPF/E technology had no CLR functionality at all and I was starting to worry. The .NET CLR functionality opens up a whole world of functionality to Torq Software business partners (my customers). I was surprised to see news of any of this sort of announcement until the Mix07 conference started. It will be good to start seeing some technical details of the Silverlight CLR functionality presumably by next month.


The only disappointing aspect is that there is absolutely no mention of Linux support. This would make the claim that it is “cross platform” much more reasonable instead of being limited to Windows and Mac. We’ll have to see how things pan out, but I’m hoping Microsoft “sees the light” and either provides a Linux version or at least not hamper the open source versions of the technology that will likely result.

Tuesday, April 03, 2007

The Fallacy of Local Optimization

Scoble has an interview with the founders of Fog Creek. I smiled at this quote from Joel Spolsky:



That’s the big joke inside of Microsoft. Developers are rewarded for writing a lot of code and fixing a lot of bugs. So the incentive is to write a lot of code and write it very quickly.. Churn it..piles of code… buggy as all hell and then you get a bunch of bug reports and you fix them all and you will look a lot better than a slow methodical developer that gets from point A to point B in the same amount of time or even in less time because of the funny way that that metric might be used.


This is an example of “the fallacy of local optimization” which I first came across as a concept in the Poppendieck’s Lean Software Development book. Basically if you try and optimize locally (increase software development and reduce software faults/bugs) then you are likely to be far less effective and even introduce unwanted second order effects than if you optimized the whole. Lean principals are based on optimizing the whole and not optimizing a portion of your system (whatever it is). So basing incentives and on measuring some aspect of your business/process one level higher than you would expect is more effective for the business as a whole. Providing incentives or penalizing developers based on source code output and bug fix counts can potentially move developers to produce much more buggy code rather than the end goal of better quality software at an acceptable development cost. What I love about the lean principals is that they are “truisms” that apply to more than just software development.

Wednesday, March 07, 2007

Office 2007 UI Licensing Bull

I just upgraded to the Infragistics 2007 Volume 1 release which includes support for a ribbon based user interface. It was annoying to come across this dialog during the installation:


InfragisticsRibbonUI


I consider myself a pragmatist and don’t think Microsoft is the evil empire or anything, but… when they pull this sort of thing, it peeves me off. The implication is that software developers need to request for the right to create a user interface that is similar to the Office 2007 ribbon user interface – not the same, just similar. In my opinion, the ribbon UI is a great improvement on previous Office user interfaces with respect to browsing through commands but its not revolutionary. Breaking it down, its just a bunch of tabbed command windows each with a controls grouped together in associated panels. Tabbed windows have existed for ages in windowing systems. So have panels, icons, buttons etc. Given this I don’t think Microsoft have any IP ownership of this style of UI except for the very specific layout/graphics used in MS Word, Excel etc. Now the question for me is if I use the Infragistics ribbon implementation, do I have to ask permission of Microsoft? Do I ignore this unreasonable request and if so is there a risk of being bullied by Microsoft’s legal machine. All in all, it sucks.

Saturday, February 17, 2007

CentOS Linux

We’ve been developing MacroView on Linux since Redhat Linux 7.2 and have deployments on RH 7.2, 7.3, Fedora Core 1 and Fedora Core 5. After RH Linux 9.0, Redhat changed their distribution strategy and effectively their business model by moving all community efforts into the Fedora project and all commercial efforts into RedHat Enterprise Linux (RHEL). Their Enterprise Linux is protected somewhat from business competition by trademark law and not directly by copyright as the distribution is to my knowledge all GPL code. You can’t copy and distribute/sell RHEL because it would violate their trademarks. RHEL is also somewhat protected from business competition by being the defacto standard for commercial applications where source code isn’t provided.


Sidetrack: I’m not lawyer, so don’t treat this blog post as legal advice… yada yada yada…


Anyway, back to the point. Fedora releases are good stable releases but man do they come at a fast pace for an OS e.g. every six months or so. Its tough to plan product support around such a quickly moving target. This was obviously part of Redhat’s grand plan and it looks like it works pretty well. So Fedora is a good platform for MacroView systems, but the pace of releases makes it difficult to support as easily as an operating system with a slower release cycle. The problem with RHEL is the yearly subscription fees which I think are quite high given that its based on an open source free-as-in-beer base. Some MacroView customers would not have a problem with RHEL fees, but some would. The approach we have been taking is to stagger the support for Fedora Core versions i.e. skipping some version numbers.


As part of an investigation into an alternative Linux OS support approach, I’m checking out the CentOS distribution. CentOS stands for the Community ENTerprise Operating System. It is built from the RHEL source code but with Redhat trademark information removed. So its a reasonable basis for future potential use with MacroView. Customers that want Redhat support can go the RHEL route, whilst other customers can use CentOS. Both will have a longer release cycle than Fedora releases i.e. 6 months compared with 18 months to 2 years. Note that this all just experimentation at this stage, so nothing is written in stone.


Check out some of the screen shots from the CentOS install process. Feels familiar doesn’t it:


Centos4InstallBoot


Centos4Install1


Centos4Install2


Centos4Install3


Centos4Install4


Centos4Install5


Centos4Install6


Centos4Install7

Tuesday, January 23, 2007

Linux Mini PC MacroView Demo

I was preparing for a demo scenario today where MacroView Windows Desktop needs to connect to a Linux or Unix system to show X windows connectivity and integration. Because of this, just a straight Windows laptop wasn't enough. I also didn't want to have to depend on Internet or even Intranet access to proceed with any demonstrations. The hardware I'm going to use is a Linux (Fedora Core 5) server running MacroView and a Windows laptop running the various client side software packages that are going to be demonstrated. A Linux server was borrowed from Sentient Computing. Thats the Linux server on the left in the pictures. Its a sweet little unit and is made up of a 1.5GHz Pentium M processor, 1GB RAM and an 80GB hard disk. Man ... I can remember when PSTN modems were way bigger than the Linux box in question.

The laptop is a Toshiba tablet with 512MB RAM and a 1.6MHz Pentium M. They're connected by a cross over ethernet cable. A nice aspect of the Fedora+mini-pc combination is that it boots without stopping even if no monitor, keyboard or mouse is connected. This means demo set up is quite easy. There is an external power supply which is a bit of a pain but all in all, the unit is quite nifty. The first picture below shows MacroView Windows Desktop with a VNC session running the KDE desktop. The second picture shows the MacroView XAML module running. The photos of the Toshiba screen are average and this is probably due to the nature of tablet pc screen surfaces.



Ranorex and Screenscraping/Automation

After many web searches looking into screen scraping technologies for automating legacy Windows applications, I came across a testing automation product from Ranorex. It's oriented towards the development process, but technically could also be used to script/automate interaction with a legacy Windows appplication. Check out this screencast where interaction with a Nokia DB2 Manager windows program was automated.


Wednesday, January 17, 2007

xops3 Command Line Arguments

I recently received a request from a customer for information on all the command line options for the MacroView xops3 executable. This post is a quick summary of the command line options:

-checkMemory
Runs xops3 in a memory buffer checking mode. This mechanism was included in the original MacroView Version 3 development from ~1992 as a means of chasing down memory faults in C++ applications. It is rarely used these days as tools such as Purify provide a more effective memory debugging approach. When used, every dynamically allocated memory segment is logged in a memory manager and header/footer segments surround the memory allocation. A memory manager then checks for allocation/deallocation pairs and memory overruns. It reports on any memory corruptions found and detects memory leaks. Note that program execution speed is of course much slower when run in this mode.
-file <dgtfile>
By default xops3 displays the base.dgt file in the configuration directory. This command line option allows a different startup graphic dgt file to be used.
-updateRate <seconds>
Sets the default scan rate for graphic updates in the xops3 session. This can be over-ridden by individual graphic metafiles in the dgt header.
-reportTimes
Reports on graphic dgt file load and display times. It is useful for measuring draw time performance.
-edit
Puts xops3 in EzEng configuration and editing mode.
-highlight
Displays dynamic graphic objects with a rectangular highlight box to allow an engineer to see the bounds of the object at run time.
-processEvents <n>
The metascript variable management system in xops3 will automatically inform all graphic objects that reference it that the variable has changed. The graphic objects can then immediately update their graphic state. The process events count defines how many of these events are process in a cycle. Note that a graphic object display update can potentially cause the variable to be set again. The event processing limit stops this potential recursion from continuing indefinitely. A zero value turns off the variable change event processing which means that graphic display updates occur at the dgt page's update rate. The default is that all events in the variable set event queue are processed.
-olderr
The xops3 error processing system handles each internally generated error message and either stores the error in an internal (table variable based) list or sends the error as a system alarm to the system message queue. Previous versions of xops3 sent all internal errors to the system message queue and didn't keep an internal list. The -olderr command line option reverts operation to this older message processing implementation.
-noConfig
Runs the xops3 session with no configuration directory i.e. the entities, sources and type attribute databases are not read.
-lastGoodValue
By default, xops3 expects a shared memory driver to update an entity.attribute value on a regular basis and will display -999 values if it is not updated regularly. The determination of "regular" is data source specific and is based on the requested update rate configured in that data source. The -lastGoodValue command line option turns this check off so that the last good value is displayed even if the communications driver is failing to meet the configured update rate for that entity.attribute. This functionality is not supported in the Windows version of the executable.
-consoleSet
A defunct command line option for an xops3 feature called "Console Sets" that is no longer supported.
-letScript <filename>
Instructs xops3 to run a metascript from the supplied file every time a LET command is executed on a PLC or sorted image data source entity.attribute. The metascript is run with 3 arguments in the following order: entity name, attribute name and a value string. This allows xops3 to perform LET action side effects across a whole graphic configuration instead of having to embed calls throughout a graphic configuration.
-iocount
Reports the IO count for the current configuration. This is the number of entity.attribute instances derived from the configuration. It is also the value used for IO count licensing checks.
-dlm
A defunct command line option for an xops3 feature for logging database changes that is no longer supported.
-metascriptProgramTime <seconds>
Sets the maximum amount of time a metascript can take to run within the xops3 GUI environment before it is automatically terminated. The default is 10 seconds which is also the minimum setting. A value of -1 turns of the maximum execution time checks.
-startMaximized
Starts xops3 in a maximized window state rather than the default window size.
Xt command line arguments
xops3 on Unix/Linux also supports standard Xt command line arguments such as -geometry.

Thursday, January 11, 2007

Weird ImageListStreamer InvalidOperationException

One of our MacroView Studio customers sent a strange stack trace from an application crash yesterday. It's strange in that the standard Windows Forms ImageListStreamer class is where the exception occurs. The exception being thrown is a TargetInvocationException wrapping an InvalidOperationException and occurs as a result of very basic form constructor code which is run many times in the application and hence many users will run that code during normal operation. As is typical with tough to resolve faults, I can't reproduce it in the office and will wait for more information from the customer if it occurs again. Regardless the symptoms and some results of web research into the problem has been posted here for any other poor souls that encounter it and also for my own benefit as a record. Here's the stack trace:


Exception Details:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Loading of the ImageList did not succeed.
at System.Windows.Forms.ImageListStreamer..ctor(SerializationInfo info, StreamingContext context)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._SerializationInvoke(Object target, SignatureStruct& declaringTypeSig, SerializationInfo info, StreamingContext context)
at System.RuntimeMethodHandle.SerializationInvoke(Object target, SignatureStruct declaringTypeSig, SerializationInfo info, StreamingContext context)
at System.Reflection.RuntimeConstructorInfo.SerializationInvoke(Object target, SerializationInfo info, StreamingContext context)
at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Resources.ResourceReader.DeserializeObject(Int32 typeIndex)
at System.Resources.ResourceReader.LoadObjectV2(Int32 pos, ResourceTypeCode& typeCode)
at System.Resources.ResourceReader.LoadObject(Int32 pos, ResourceTypeCode& typeCode)
at System.Resources.RuntimeResourceSet.GetObject(String key, Boolean ignoreCase, Boolean isString)
at System.Resources.RuntimeResourceSet.GetObject(String key, Boolean ignoreCase)
at System.Resources.ResourceManager.GetObject(String name, CultureInfo culture, Boolean wrapUnmanagedMemStream)
at System.Resources.ResourceManager.GetObject(String name)
at Syncfusion.Windows.Forms.Edit.FindReplaceDlg.InitializeComponent()
at Syncfusion.Windows.Forms.Edit.FindReplaceDlg..ctor()
at Syncfusion.Windows.Forms.Edit.EditControl..ctor()
at MacroView.Script.MetascriptEditControl.InitializeComponent()
at MacroView.Script.MetascriptEditControl..ctor()
at MacroView.Script.MetascriptEditor.InitializeComponent()
at MacroView.Script.MetascriptEditor..ctor()


Some links that are relevant:


It appears from web searches on the problem is that it is likely to be caused by accessing winform controls from other than the GUI thread and/or the visual styles functionality. This theory is re-enforced by looking at the code for the System.Windows.Forms.ImageListStreamer class serialization constructor using Reflector. The constructor includes native platform theming calls and synchronization support. I don't what goes on to cause the fault but it's very subtle and is rare. At first I suspected the Syncfusion (legacy) edit control of perform winform control actions across threads but the debugger showed that although the thread code was there, it shouldn't ever be called in the MacroView Studio application scenario.




IntPtr ptr1 = UnsafeNativeMethods.ThemingScope.Activate();


try


{


MemoryStream stream1 = new MemoryStream(this.Decompress(buffer1));


lock (ImageListStreamer.internalSyncObject)


{


SafeNativeMethods.InitCommonControls();


this.nativeImageList = new ImageList.NativeImageList(SafeNativeMethods.ImageList_Read(


new UnsafeNativeMethods.ComStreamFromDataStream(stream1)));


}


}


finally


{


UnsafeNativeMethods.ThemingScope.Deactivate(ptr1);


}


if (this.nativeImageList.Handle == IntPtr.Zero)


{


throw new InvalidOperationException(SR.GetString("ImageListStreamerLoadFailed"));


}



Friday, January 05, 2007

Line Margin Selection Edit Control Request

This post is a request to Syncfusion for an additional feature in their Edit Control functionality. The blog was just a convenient place to put a screencast related to the feature request submitted on their site. Showing a concept rather than describing it in text can often be a better way to communicate.


Thursday, December 14, 2006

ADX.NET V2.7 and V2.8 Registry Comparison

We’re just going through some versioning relating development hassles with the MacroView Excel Addin functionality. This blog post is just a means of placing some images in a public location for reference in the Addin Express forums. It appears that in Version 2.7 of ADX.NET the addin dll’s assembly version number was encoded into the registry as part of the COM component’s .NET load info. See the Assembly registry value below:AdxNetRegistryV27Image1


In addition, there was a child key whose name matched the DLL version number below the InprocServer32 key:AdxNetRegistryV27Image2

Now in V2.8 of ADX.NET, there doesn’t appear to be a sub-key and no version number in the Assembly value. This is probably better as there will likely be fewer deployment version issues in the future. Regardless, we are encountering hassles moving from V2.7 to V2.8 – probably because V2.8 can’t handle registering over the top of or unregistering the V2.7 registry info.AdxNetRegistryV28