torsten's .NET blog In the end, everything is a gag [Ch. Chaplin]
# 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]  | 
# Friday, September 02, 2005
"Send to OneNote..." plugin for RSS Bandit
Just got it work, yesss! You can download it here. Just expand the zip to your RSS Bandit installation sub-folder named plugins. Within the config file you can change the default note page used and some templates to format the posted item link and content.
Inspired by a comment by MrPuck at Dare Obasanjo's post I got the idea. It should work with OneNote 2003 SP1. Thanks to Donovan and Andrew.
Technorati tags:  |  |  | 
Friday, September 02, 2005 8:11:06 PM (W. Europe Standard Time, UTC+01:00)    #  Comments [2]  | 
# Friday, August 12, 2005
RSS Bandit new logo design contest

As my various mails to some web designers does not had any real effect to get a new set of icons for the Next Generation User Interface of my favorite feed reader, I hope I will get more responses and comments by starting a design contest for a new logo of RSS Bandit now. Currently we use this one:
  Bandit-Logo.32x32.png

The application icon is just the smiley face simulating the point of the character "i". Some professional users complains about the "unprofessional" look of our logo (they associate a game or an app to play with) while there are also users that really like it.
So I just started with some new that get rid of the smiley face, as you can see some variants here:

v1.3.0.png
Variant 1
v1.3.1.png
Variant 2
v1.3.3.png
Variant 3
v1.3.4.jpgEric Var 2
Variant 1 and 2 Eric (Thanks to Eric Winchester)
v1.3.0.1.png
Variant 1a
v1.3.1.1.png
Variant 2a
v1.3.3.1.png
Variant 3a
http://www.wiredprairie.us/journal/2005/09/rss_bandit_logo_idea.html
Variant Aaron (thanks to Aaron)
  v1.3.1.2.png
Variant 2b
 smiley variant 1
Smiley Variant 1 (Thanks to Mark Allanson)
Ash.draft.1.gif
Variant Ash (Thanks to Ash)

So please vote in comments to this post, what you like or not. Send your own designs to my contact address or that at www.rssbandit.org, please. I will add them here for all to preview and vote.

Use the App Icon png found in post enclosure to create your own with the awsome smiley...

Update: as suggested I added variants; 2a with smiley and made the "RSS" a little bit more different in color than the background.

Update 2: 2b with smiley in foreground and removed "hands", and a new variant 3a for the one who liked that.

Update 3: variant 4 (Eric Winchester by mail) and Smiley variant 1 (Mark Allanson by mail to Dare Obasanjo aaaages ago ;-)

Update 4: more variants (Aaron by comment, Ash by mail)

Update 5: more variants  from Eric Winchester with the bandito-mask (by mail). Jake, I got your images but they are not much different than our own or that of Mark Allanson. I only post variants here that are interesting AND different in variations. But go on with other/more samples, please!

Voting results as of Oct 11th, 2005 (53 comments, final result):

3  0  11  6  4  0  0  16  3  1  0 
1a  2a  2b  3a  Eric 1  Eric 2  Aaron  Ash 

So the team will go with variant Eric 1 and we do really want to say thank you all that helped with pictures and votings! 

Technorati tags:
Friday, August 12, 2005 11:26:52 AM (W. Europe Standard Time, UTC+01:00)    #  Comments [60]  |  Bandit-Logo.32x32.png (30.12 KB)
# Monday, July 25, 2005
Atom 1.0
Added today basic support for Atom 1.0 to the current CVS code base of RSS Bandit (still at 1.3.0.34). It is still draft, but testing at early stages is required... 
Technorati tags:
Monday, July 25, 2005 6:25:24 PM (W. Europe Standard Time, UTC+01:00)    #  Comments [2]  | 
# Tuesday, July 05, 2005
Why .NET Remoting does not have a RemotingConfiguration.Reset() ?

Hopefully the .NET 2.0 bits will support a similar call to reset the remoting infrastructure the clear way without restarting the whole remoting application!

As you may have noticed: there exists a RemotingChannels.UnregisterChannel() method to use to get rid of a old used channel and switch to a new one (registering). But that is not enough to get an application seamlessly work with a new remoting service endpoint: after you really used one of you configured services, you will get an exception if you try to register the service again with a different service endpoint. This is because the RemotingConfigHandler+RemotingConfigInfo method AddWellknownEntry() calls a method named CheckForRedirectedClientType() that cause a CantUseRedirectedTypeForWellKnownService exception. So after I tried a "fix" with managing the calls to the .NET remoting classes within a new separate AppDomain (and unload that on a reset remoting request) that did not work I end up with a hack using Reflection to get around that.

Here is the used code that works for our requirements:

    /// <summary>

    /// This is cool, but it is a HACK. Please validate the code each time

    /// the .NET framework gets updated. There is a little safty included to

    /// throw a InvalidOperationException if something changed we require to get

    /// it work somehow.

    /// </summary>

    /// <exception cref="InvalidOperationException">

    /// On every failed reflection call or if we do not get any of

    /// the required FieldInfo objects</exception>

    /// <remarks>

    /// The HACK bases on the fact Remoting informations are cached

    /// in the well hidden sync. Hashtable field "_remoteTypeInfo" after they get used once.

    /// This field you can find within the (internal) class

    /// RemotingConfigHandler.RemotingConfigInfo. The static RemotingConfigHandler.Info

    /// field holds a reference to an instance if that class.

    /// To reset we simply initialize that field with a new instance of

    /// a synchronized Hashtable.

    /// Note: We do only "fix" for Singleton objects, not client activated services.

    /// So to get it "fully" work (complete state reset), you may have to hack

    /// more and other fields.

    /// </remarks>

    private static void Release_NETRemotingResources() {

      bool raiseError = true// warn if we switch to a new .NET env where the reflection is maybe not working anymore!

      try {

        //HACK: please verify it after each Service Pack or new version of .NET runtime to be used!

        Type configHandlerType = Type.GetType("System.Runtime.Remoting.RemotingConfigHandler");

        if (configHandlerType != null) {

          FieldInfo infoFI = configHandlerType.GetField("Info", BindingFlags.GetField | BindingFlags.Public | BindingFlags.Static);

          if (infoFI != null) {

            object infoFIRef = infoFI.GetValue(null);  // static, so no object instance to provide

            if (infoFIRef != null) {

              FieldInfo remoteTypeInfoFI = infoFI.FieldType.GetField("_remoteTypeInfo", BindingFlags.Instance | BindingFlags.NonPublic);

              if (remoteTypeInfoFI != null) {

                remoteTypeInfoFI.SetValue(infoFIRef, Hashtable.Synchronized(new Hashtable()));

                raiseError = false// all seems to be OK

              }

            }

          }

        }

      } catch (Exception ex) {

        throw new InvalidOperationException("Failed to reset .NET internal remoting state.", ex);

      }

 

      if (raiseError)

        throw new InvalidOperationException("Failed to reset .NET internal remoting state.");

    }

Technorati tags:  | 
Tuesday, July 05, 2005 9:21:19 AM (W. Europe Standard Time, UTC+01:00)    #  Comments [2]  | 
# Friday, June 03, 2005
Google doodles
You ever missed one of the cool modified Google logos like me? Have a look here and just wonder about - like me :-)
Technorati tags:  | 
Friday, June 03, 2005 12:14:39 PM (W. Europe Standard Time, UTC+01:00)    #  Comments [0]  | 
# Tuesday, May 31, 2005
Cool shell extension for .NET assemblies
Back from vacations today I found the article Shell Extensions for .NET Assemblies at codeproject.com: really useful tool (must have) to get our projects organized (old VB6 stuff vs. newer .NET stuff). It visually distinguish between normal windows DLL's and .NET assemblies and shows if the assembly is signed via a public key token column.
Technorati tags:  |  |  | 
Tuesday, May 31, 2005 10:20:00 AM (W. Europe Standard Time, UTC+01:00)    #  Comments [4]  | 
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....
<November 2005>
SunMonTueWedThuFriSat
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

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