Thursday, December 1, 2011

Tip: Installing Chinese Font and Input Into BlackBerry Bold 9700

It's really frustrating when actually looks into the Google and found out that the only way to install a new language and input methods into your BlackBerry phone is to get it from your wireless Internet Provider when you already have a different OS version installed. There are 2 ways that we can install the extra language packs into the phone.

1. Wipe the entire BlackBerry phone using JL_Cmder and reinstall the OS that contains the language pack that you require.
2. Use the BBSAK(BlackBerry Swiss Army Knife) without have to wipe out your phone.

Based on the available option it's obvious that i go for option 2 which is easy and safe (if you use it properly).BBSAK offers you a comprehensive set of actions that you can use to install language files. The Chinese language files you can download from this link, which i got from

Follow the following instruction when using BBSAK:
1. Download and install BBSAK
2. Extract the language files to any folder.
3. Open up the BBSAK and go to "Modify CODs" tab.
4. Click on "Install CODs" and select all the language files that you want to install.
5. Click Ok and you are done. I tested it using the iSpeech application that used to show black boxes before i installed the language files, and here's the result.

Tuesday, July 26, 2011

Tip: Chilkat Email Component not working in my brand new server

Anyone who is using the Chilkat Email component will realize that it does not work in a brand new server with a 64-bit OS, without the C++ runtime library insalled. The Chilkat component is built using generic C++ code, so by just installing .NET FW is not good enough.

The C++ runtime can be downloaded from the following Microsoft web site.

Wednesday, June 8, 2011

Tip:Workflow Service on Windows Azure?

There are several considerations to ponder upon before one really decide to create Workflow Service solution on Windows Azure. Windows Azure is still a pre-mature platform to me. Many things that can be done on premise are still not supported by Windows Azure. A big dissapointment for those who are looking ways to migrate existing Workflow Service solution to the Windows Azure platform because of the lack of support at the moment. Below I list down a few considerations to think of:

1. Does the Workflow Service has a set of static xamlx files? Because Windows Azure does not support dynamic creation of the file once the service is deployed.
2. Does your Workflow Service makes use of SQL persistance store? Activity that can trigger a workflow instance to save into the database will have problem, because there's no service provided in Windows Azure that can automatically check runable instances.
3. Does your Workflow Service replies on Windows Server AppFabric? Windows Azure AppFabric is not the same as Windows Server AppFabric. The Workflow Management Service and Service Management Service are missing from the Windows AzureAppFabric.

There might be some other considerations, but these are the one for now.

Wednesday, May 11, 2011

Tip: Proper use of the jQuery "get" function

jQuery provides a function which gets a DOM element based on the index passed in. It's important to write the correct syntax at the selector part for it to work properly. For example,

let say I have a variable named "items" that is a drop down list with several options as represented at the html code below:

This will not work
items.get(1) --> TypeError: items.get is not a function

This will work
$('option', items).get(1) --> return option with value 2

Wednesday, May 4, 2011

Tip: How to make use of WorkflowControlClient to control workflows in a workflow service

If you host your WF service in IIS probably you will need a way to suspend, terminate, abandon, etc. a workflow that is running or persisted, other than using AppFabric Dashboard. In order to use WorkflowControlClient correctly, configuration at the workflow service is important. Given the following client code that terminates a workflow:

 WorkflowControlEndpoint endpoint = new WorkflowControlEndpoint()
Binding = new BasicHttpBinding(),
Address = new EndpointAddress("http://localhost/WorkflowService/AbsoluteDelayService.xamlx/wce")
WorkflowControlClient c = new WorkflowControlClient(endpoint);
if (!String.IsNullOrEmpty(TextBox2.Text))
c.Terminate(new Guid(TextBox2.Text));
based on the code above, the interesting part is the EndPointAddress that ends with the “wce” word. The “wce” word is actually configured in the workflow service web.config as shown below:
<serviceHostingEnvironment multipleSiteBindingsEnabled="false" />
<behavior name="behaviour2">
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceMetadata httpGetEnabled="true" />
<sqlWorkflowInstanceStore connectionString="Data Source=(local)\SQL2008R2;Initial Catalog=PersistenceDatabase;Integrated Security=True;Asynchronous Processing=True;"
instanceEncodingOption="GZip" instanceCompletionAction="DeleteAll" instanceLockedExceptionAction="BasicRetry" runnableInstancesDetectionPeriod="00:00:05" hostLockRenewalPeriod="00:00:05" />
<workflowInstanceManagement authorizedWindowsGroup="AS_Administrators" />
<workflowUnhandledException action="Terminate" />
<workflowIdle timeToPersist="00:01:00" timeToUnload="00:00:00" />
<etwTracking profileName="Sample Tracking Profile" />
<binding name="httpSecurityOff" closeTimeout="00:10:00"
openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
<service name="MustMatchWithXamlxConfigurationName" behaviorConfiguration="behaviour2">
<endpoint address="mex" contract="IMetadataExchange" binding="mexHttpBinding" />
<endpoint address="wce" contract="System.ServiceModel.Activities.IWorkflowInstanceManagement" binding="basicHttpBinding" bindingConfiguration="httpSecurityOff" kind="workflowControlEndpoint" />
<endpoint address="" contract="IService" binding="basicHttpBinding" bindingConfiguration="httpSecurityOff" />

The configuration above shows how the service endpoints should be configured in order for client to access it through the WorkflowControlClient API. Another important thing that one must ensure is that the service name must be the same as the “ConfigurationName” in the Xamlx file.


If the name is not matching, WCF will throw exception stating the following message:

The message with To 'http://(macinename)/WorkflowService/AbsoluteDelayService.xamlx/wce cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree.

Thursday, April 21, 2011

Tip: How to create a One-Way WCF WF service that persist to a SQL server?

Based on the research that i have done recently on the Workflow service using WCF, any call to a time-based workflow that has a delay activity will block the caller until the delay activity and subsequent activity is finished. That's to say, a web request is blocked until the entire workflow finish running, say for 1 minute if the delay activity is set to 1 minute. This is not the service behavior that I wanted, instead I want the service call to return immediatly after hitting the delay activity and the workflow is persisted to the database.

This how one can create a one-way WCF call to the Workflow Service:
1. Create a WCF Service Activity in Visual Studio
2. Remove the ReplyRequest Messaging activity.
3. Click on the ReceiveRequest activity, remove the item from CorrelationIntializers. This is not needed for one-way communication.
4. The end result will look something like this

5. At the client side reference the Workflow Service. Right click on the service reference and click Configure Service. Check the Generate asynchronous operations check box.

6. One can make use of the referenced service as follow:

7. Make sure to call to the GetDataAsync function and close the connection when done. The request will return immediately after the workflow hits the delay activity.
The IIS will resume whatever that is persisted in the database automatically when the time is right.

Friday, March 25, 2011

Tip: JavaScript "unload" event myth for IE8

I came across the needs to save certain state to the web server using Ajax when a user navigates away from a page, so i tried to use the browser (IE8) "unload" event to do it.
One thing that i noticed when using the "unload" event is that, once the user clicks on a new link to navigate to a new page, browser will first send the request to web server causing the "pageLoad" function to be triggered then only the Ajax request is process in the web server.
If the next page that the user navigates to relies on the first page state, there will be problem because the new page is loading without getting the data from previous page.

My workaround is not to rely on the "unload" event, but to use user action to save the state. For example, when the user clicks on a link to do popup, after the popup immediately save the state to server. It's costly but working for now.

Wednesday, March 2, 2011

Tip: Asp.Net Request.InputStream is empty?

Recently I needed to post some json data from browser to web server. I used the following codes to read the input stream:

System.IO.StreamReader sr = new System.IO.StreamReader(Request.InputStream);
string json = sr.ReadToEnd();

There's one problem with the above codes, that is the json variable will hold empty string even though I am sure that data is posted to the web server. The resolution of the problem is to always set the stream position to 0. The resulting codes looks like this:

Request.InputStream.Position = 0; System.IO.StreamReader sr = new System.IO.StreamReader(Request.InputStream);
string json = sr.ReadToEnd();

Now with the first line of the codes, you will be able to get the stream data.

Wednesday, January 5, 2011

Tip: Choosing MS SQL Server + Reporting Tool

Many times developers come across the need to choose which MS SQL server to use in his develoment work. Microsoft provided many different editions of the SQL server and each with different technical specification. It's wise to study through the specifications before deciding which edition of the server to deploy for end product. Here's some links that are useful for reference:

1. SQL Server 2008 R2 Editions Feature Comparison
2. Browser Support for SQL Server 2008 R2 Reporting Server Browser Compatibility Check
3. SQL Server 2008 R2 Express Edition Reporting Service Features Summary