WYSIWYG

http://kufli.blogspot.com
http://github.com/karthik20522

Saturday, August 9, 2014

AKKA.NET Actor Creation - Typed, Untyped, Receive Actor

There are three potential ways of creating Actors using Akka.net (v0.6.2).

1. Using Receive Actor: In order to use the Receive() method inside an actor the actor must inherit from ReceiveActor. All message handling must be part of the constructor. Please note that handler matches, the one that appears first is used. More info Akka.net documentation.

2. Using Typed Actor: In typed actor, you explicitly provide the message types that the actor would receive. This is very helpful in code readability as you are ware if type of message that the actor receives. For receive message, you need to define a overloaded "Handle" function with message types.

3. Using Untyped Actor: Untyped Actor, similar to Receive actor requires to pattern match the message type. For using Untyped actor, the OnReceive function needs to be overridden.
Handling unknown messages can be done 2 ways:

Labels: , ,

Thursday, October 25, 2012

Unhandled GZip Encoding

What happens when you have GZip turned on and there is an unhandled exception is thrown, look no further.. a completely cryptic garbage page is returned



So whats the problem, well when an unhandled exception is thrown ASP.NET/MVC removes the GZip header or any other custom header that was set and returns a non-zipped content while your IIS decides to send to browser that the content is GZipped when it's not really. So your browser is receiving a non-zipped content with GZIP content type, thus the garbage content.

To fix this in the global.ascx add the following to the Application_PreSendRequestHeaders function:

Labels: , , , ,

Wednesday, June 10, 2009

FreeTextBox 3.1.6 (FTB) in Sharepoint 2003 (WebPart)

I have noticed that many programmers/users have failed to implement FreeTextBox onto Sharepoint portal (WebPart). Well it's very much possible and also easy to do so. We could skip all the Registering FTB on aspx page and RUNAT server tags and stuff like those which are hard to implement in Sharepoint Server. Below is a step-by-step implementation of FreeTextBox control on Sharepoint portal as a WebPart.

1. As per the original FTB documentation, we need to copy all the FTB support files into a directory. Over here, I have copied onto the default Sharepoint 2003 images directory.(C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\IMAGES\FreeTextBox)


2. We need to then add FreeTextBox.DLL (provided in FreeTextBox zip/setup package) onto GAC (Global Assembly Cache) either by using GACUTIL.exe or using .NET Configuration Manager in Control Panel -> Administrative Tools. Choose the appropriate FTB DLL based on .NET version being used.

Step 1 and Step 2 end's the setup process which is more simpler than the original setup methodology like referencing axd file, adding "Register" on top of the aspx page and runat server tags and adding in web.config file. What an hazel !! :)

3. First we need to add FreeTextBox reference in out WebPart Project. Add the following line of code onto ur .cs file.




4. Then need to initialise the control. Add the following code in "protected override void CreateChildControls()" method.

5. Add tBox.RenderControl(output) in "protected override void RenderWebPart(HtmlTextWriter output) method.
THAT'S IT....U have now FTB on your WebPart!!

Labels: ,