torsten's .NET blog In the end, everything is a gag [Ch. Chaplin]
# Saturday, March 25, 2006
Update: DiffPatchResources creates .strings file(s)

As I yet posted this is a little tool to help with common tasks to maintain resource files. Recently I started to use the famous StringResourceTool MS used within the Enterprise Library and it is way cool! Worth to have a look if you start a new project from scratch.
But stop! You can now migrate existing project(s) to use the the StringResourceTool by the little help of the DiffPatchResources tool! Just download and copy it to a folder you configured to be found if you start a windows command line (%PATH% variable). Then use the new option -s to create the .strings file out of your existing main .resx file and save all the hand writings...

Update: to get the StringResourceTool run in VSIDE 8.0, add these settings to your registry by help of a .reg file with content:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Generators\{FAE04EC1-301F-11D3-BF4B-00C04F79EFBC}\StringResourceTool]
"CLSID"="{1D47CA76-5AF1-4152-8106-08140FF9886E}"
"GeneratesDesignTimeSource"=dword:00000001
@="Microsoft Data Warehouse String Resource Generator"

Technorati tags:  | 
Saturday, March 25, 2006 5:12:31 PM (W. Europe Standard Time, UTC+01:00)    #  Comments [3]  | 
# Friday, March 03, 2006
Enterprise Library - Syslog Sink Extension available for download
My user sample related to the Enterprise Library is now up and available for download. It extends the logging by providing a sink that is able to log to a syslog daemon (some of you may know that from UNIX systems). It works  according to the definitions in RFC 3164 (http://www.faqs.org/rfcs/rfc3164.html) writing log entries to UDP port 514. Not yet optimized for speed and no EntLib Configuration Console support, but a starting point. Binaries, a short documentation and source can you find here.
Technorati tags:  | 
Friday, March 03, 2006 3:28:14 PM (W. Europe Standard Time, UTC+01:00)    #  Comments [1]  | 
# Saturday, January 21, 2006
Congrat's to Marco!
Congratulation to Marco Buechel (the son of our CEO): he was the second with only a diff. of only 0.05 secs to the winner in Kitzbuehl (the legendary Streif race)!  Very nice, keep it on!
Technorati tags:  | 
Saturday, January 21, 2006 5:58:03 PM (W. Europe Standard Time, UTC+01:00)    #  Comments [1]  | 
# Saturday, January 07, 2006
Remoting from CLR 1.1 to 2.0 and back: issue 1

This week I had a hard day to track down a remoting issue we had with our product. We have a application service running (Windows Service or Console Window for tests) under CLR 1.1 and a ASP.NET 2.0 application want to call the service. After figuring out an issue with a third party software component I got another exception: "Serialization Error: Unknown member TextInfo". I'm talking about remoting serialization of function parameters and return values, not using/calling any formatter like SOAP. Diving into the problem analysis I found our software never uses such a member and so I examined a involved CLR class that member is part of using reflector: the CaseInsensitiveHashCodeProvider class used indirectly by an own collection inherited from NameObjectCollectionBase. I know MS worked hard to get the old style collections compatible to the new implementations using Generics and new approaches and so it is with that base collection. It is mentioned at the .NET 2.0 obsolete type/member list the collection is using a new preferred constructor with the IEqualityComparer parameter and they wrap up the old style HashCodeProvider and Comparer with a internal class named CompatibleComparer.

Knowing all that now I had to find a way to get around the serialization exception. It happens the moment the CLR 1.1 running at the app service try to deserialize the CLR 2.0 serialized collection. I started to create some experimental own HashCodeProvider classes and one that worked recently had the original (don't change the semantic!) CaseInsensitiveHashCodeProvider hold as a non-serialized member and just serialized the CultureInfo.Name to be able to re-create it on creation/deserialization implementing ISerializable and IDeserializationCallback to set the private members ("_hashProvider" and "_comparer" using reflection - they can only be set via the costructor!) of NameObjectCollectionBase. We had to replace the Comparer also, because after it serialized/deserialized our migratable HashCodeProvider successfully we got another wired exception we had to workaround by a homebrewed Comparer class implemented similar to our HashCodeProvider class.

Now it works fine. What we learned? Also MS don't keep in mind to consider also internal classes to provide backward compatible serialization formats. They used only the code attribute "Serializable" and don't implement ISerializable to explicitly get compatible serialization. I expect to get more issues like this... :-(

Update: It looks like the new cool feature named VTS (version tolerant serialization) will not work for Net.Remoting, isn't it?

Technorati tags:  | 
Saturday, January 07, 2006 2:34:02 PM (W. Europe Standard Time, UTC+01:00)    #  Comments [1]  | 
# Sunday, December 25, 2005
Feed icons

Who is somewhat involved in the feeds/rss/rdf/atom world like me may have noticed the interesting discussion at the Microsoft Team RSS blog. There is now a consens by major players about using this common icon  to visualize webfeeds. Two or three days ago Matt opens a site named http://www.feedicons.com/ to get it broadcasted and so I did by this post :-)

As soon Dare Obasanjo gets the bugfix installer ready of my favorite NewsReader you will notice we use it the same way as it will be used within IE7 - to indicate autodiscovered feeds while you browse. OK, that's an old feature, but you know we refreshed all our used icons and so it was just the right time for the right think thing.

Technorati tags:  |  | 
Sunday, December 25, 2005 3:16:53 PM (W. Europe Standard Time, UTC+01:00)    #  Comments [3]  | 
# Saturday, December 10, 2005
Trust a trusted site

Just got this message from my IE 6 this moment:

trust a trusted site?

Yes, indeed!. Short moment after: yesss, I do. Once again: yes!
Did I got a silent "featured" security update last week?

Technorati tags:  |  |  | 
Saturday, December 10, 2005 6:32:15 PM (W. Europe Standard Time, UTC+01:00)    #  Comments [3]  | 
# Tuesday, December 06, 2005
First steps with VWD 2005 Express - no luck

Today I installed the Visual Web Developer/C# 2005 Express editions and just want to get the simple Homepage template running. The express editions install also the new MSDE 2005 Express (silently) - so I assumed it would run out of the box.

Bang! SQL failure: "Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance". Yes, I read all the articles I found at the net here and here and there: no success. Now are three hours fighting the problem are lost, out of ideas. I installed all of them as a normal domain user (member of the local adimistrators group) while I'm offline from the company's local network. Is this also a kind of remote desktop issue (and if so: a bug within the OS)? Should it gone if I would work from within the local area network@work?

And: I really miss the system tray console window to control the SQL Server Express engine like that of v2003...

Technorati tags:  |  | 
Tuesday, December 06, 2005 3:01:18 PM (W. Europe Standard Time, UTC+01:00)    #  Comments [1]  | 
# Wednesday, November 30, 2005
Still there

Yes, a whole month and no post. Sorry, but we are soo busy at work.

Meanwhile we got the 1.3.0.38 release of my favorite news reader ready (somehow), and it seems it get positive feedback. Read, what email.about has to say about it.

Technorati tags:  | 
Wednesday, November 30, 2005 2:16:59 PM (W. Europe Standard Time, UTC+01:00)    #  Comments [0]  | 
# Friday, October 28, 2005
VistaDB: blog it, get it, try it... throw away?

Low cost marketing: So here is the first step -- I blog about:

VistaDB 2.1 database for .NET has been released
This 2.1 update includes over 60 improvements, including new support for .NET 2.0 and Visual Studio .NET 2005. VistaDB is a small-footprint, embedded SQL database alternative to Jet/Access, MSDE and SQL Server Express 2005 that enables developers to build .NET 1.1 and .NET 2.0 applications. Features SQL-92 support, small 500KB embedded footprint, free 2-User VistaDB Server for remote TCP/IP data access, royalty free distribution for both embedded and server, Copy 'n Go! deployment, managed ADO.NET Provider, data management and data migration tools. Free trial is available for download.
- Learn more about VistaDB
- Repost this to your blog and receive a FREE copy of VistaDB 2.1!

Now awaiting to get it for test...

Technorati tags:  |  | 
Friday, October 28, 2005 5:07:58 PM (W. Europe Standard Time, UTC+01:00)    #  Comments [2]  | 
# Tuesday, October 25, 2005
1.3.0.36 Alpha and AdsBlocker HowTo

We decided to post another iteration of the Rss Bandit Alpha (v1.3.0.36): read about the details at Dare Obasanjo's blog and download it here.

It is the first version that is AddIn - enabled and you can find and use the first AddIn available here: AdsBlocker. So how to use it?

  1. Download and unzip to a folder you like (e.g. "AddIns" sub-folder within your Bandit installation path).
  2. Start Bandit and open the AddIns dialog via Tools|AddIns... menu.
  3. Press the "Add..." button and select the AdsBlocker.AddIn.dll
  4. Press "Close"
  5. Optional: add entries/modify the ads.blacklist.txt file (regular expressions) to configure your blocked content (urls)
  6. Optional: create a white list "ads.whitelist.txt" in the same location if your blacklist gets large and you want to re-enable some blocked content.

 

Technorati tags:  |  |  | 
Tuesday, October 25, 2005 6:59:45 PM (W. Europe Standard Time, UTC+01:00)    #  Comments [4]  | 
# Tuesday, September 27, 2005
More to know about .NET Timers

As you may know, .NET 1.1 supports three different Timer classes:

  1. Windows timers with the System.Windows.Forms.Timer class
  2. Periodical delegate calling with System.Threading.Timer class
  3. Exact timing with the System.Timers.Timer class

The timings are more or less accurate (see CodeProject: Multithreading in .NET), but that is not the point I want to highlight today. Two sentences from the mentioned codeproject article are important for this post:

"... Events raised from the windows forms timer go through the message pump (together with all mouse events and UI update messages)..."

and

"...the System.Timers.Timer class. It represents server-based timer ticks for maximum accuracy. Ticks are generated outside of our process..."

To report state and newly retrieved items from requested feeds we used a concept to serialize the asynchronous received results from background threads with the help of a timer. This was introduced in the NightCrawler Alpha Dare Obasanjo posted last week for external tests. Some users reported strange failures, memory hog up and bad UI behavior with this Alpha so I would suggest here to not use it anymore for testing if your subscribed feeds count is higher than 20 or 30 feeds.

The idea was not as bad as it seems to be (if you only look at the issues above). The real issue in our case was to use simply the wrong timer class! The UI state refresh includes an update of the unread counters that is reported to the user within the treeview as number postfixes and (more important here) a font refresh (as user decides, default is to mark the feed caption text bold). Have a look to the constructor of the class we used for background thread result processing:

    1 public ThreadResultManager(RssBanditApplication owner, ISynchronizeInvoke syncObject) {

    2       this.owner = owner;

    3       resultInfos = PriorityQueue.Synchronize(new PriorityQueue());

    4 

    5       // what we catch on:

    6       this.owner.FeedHandler.UpdateFeedStarted += new NewsHandler.UpdateFeedStartedHandler(this.OnUpdateFeedStarted);

    7       this.owner.FeedHandler.OnUpdatedFeed += new NewsHandler.UpdatedFeedCallback(this.OnUpdatedFeed);

    8       this.owner.FeedHandler.OnUpdateFeedException += new NewsHandler.UpdateFeedExceptionCallback(this.OnUpdateFeedException);

    9 

   10       processResult = new System.Timers.Timer(250);

   11       processResult.Elapsed += new System.Timers.ElapsedEventHandler(OnProcessResultElapsed);

   12       processResult.SynchronizingObject = syncObject;

   13       processResult.Start();

   14     }

As you can see in line 10 we used the System.Timers.Timer class. The syncObject parameter is (as you can guess) the main form.

So what happens exactly now if the timer fires? I used the CLR Profiler to get the following exiting results. The event is called in sync. with the SynchronizingObject, means Control::WndProc(m) calls calls into System.Windows.Forms.Control::InvokeMarshaledCallbacks void(), MulticastDelegate::DynamicInvokeImpl()... and then our event method OnProcessResultElapsed(). The allocation graph mentions 101 MB (44.78%) used here! Here is the implementation:

   20 private void OnProcessResultElapsed(object sender, System.Timers.ElapsedEventArgs e) {

   21       // get them out of the resultInfos list and deliver

   22       if (resultInfos.Count > 0) {

   23         ThreadResultInfo t = (ThreadResultInfo)resultInfos.Dequeue();

   24         if (t.Args is NewsHandler.UpdateFeedEventArgs) {

   25           this.owner.OnUpdateFeedStarted(t.sender, (NewsHandler.UpdateFeedEventArgs)t.Args);

   26         } else if (t.Args is NewsHandler.UpdatedFeedEventArgs) {

   27           this.owner.OnUpdatedFeed(t.sender, (NewsHandler.UpdatedFeedEventArgs)t.Args);

   28         } else if (t.Args is NewsHandler.UpdateFeedExceptionEventArgs) {

   29           this.owner.OnUpdateFeedException(t.sender, (NewsHandler.UpdateFeedExceptionEventArgs)t.Args);

   30         }

   31       }

   32     }

As you can see: no real magic things happen. Interesting is the line 22: if there are no queued results, we just return and do nothing. But there was already a cost calling it in sync with the main UI thread, look at the call chain above! And as such it breaks the UI thread every 250 msecs also if there is just nothing to do.

But lets look what will happen if there is a result to process: let's pick the call into owner.OnUpdatedFeed(). The owner forwards to the UI class and no .InvokeRequired call is needed (the only good thing so far). It calls into FeedTreeNodeBase class to update the unread counter and node text of the treeview that in turn calls the TreeNode::UpdateNode() function. It will call into the treeview:WndProc(m), WmNotify(), CustomDraw()..., FontHandleWrapper::.ctor,... Font::ToHFont(), Font:ToLogFont() and...? You are right: it checks the code access security with CodeAccessPermission::Demand()! Right and secure, but slow. More slow even though the CodeAccessSecurityEngine::Check calls into a AppDomain::MarshalObject(Object) followed by a parameter memory serialization into another AppDomain! I scratched my head: what the f...? Then I remembered the second quote (above): Ticks are generated out of process! So this was the obvious reason for the cross-AppDomain call (memory allocation: 75MB, 33%).

So what to do to fix the problem(s)? Simply use the Windows.Forms.Timer! Think about it: it is driven by the main window message pump and runs always in the right context of the main UI thread (no .InvokeRequired calls). Timing isn't an important point here, we just want to process one result each time we are called. Further: no cross-AppDomain security check should happen anymore! With that timer it is just a simple update control(s) with some fresh data!

So take care of the timer class(es) you may use in your projects! Check their implications! Be careful, there are also other issues with it I did not mentioned here, read the docs!
Now I'm off to close related bugs...

Technorati tags:  |  | 
Tuesday, September 27, 2005 1:52:06 PM (W. Europe Standard Time, UTC+01:00)    #  Comments [0]  | 
# Thursday, September 08, 2005
BASTA! 2005
BASTA! 2005
Technorati tags:  | 
Thursday, September 08, 2005 11:40:01 AM (W. Europe Standard Time, UTC+01:00)    #  Comments [0]  | 
Navigation

Like RSS Bandit? Make a donation to help support its development and maintenance. As little as 1€ will help.

Make payments with PayPal - it's fast, free and secure!
On this page....
<March 2006>
SunMonTueWedThuFriSat
2627281234
567891011
12131415161718
19202122232425
2627282930311
2345678

SUBSCRIBE RSS GeoURL e-mail

Search
Categories
Blogroll
[Feed] Dare Obasanjo
Dare Obasanjo aka Carnage4Life
[Feed] Clemens Vasters
[Feed] Omar Shahine
[Feed] Tom Mertens

newtelligence dasBlog 2.1.8102.813

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

WOT Notar

Join WebHost4Life.com