Tuesday, August 20, 2013

My Weapons (Tool set)

  1. 7-Zip.
  2. Adobe Reader
  3. EditPad and Notepad++: Advanced text editor.
  4. Fiddler Web Debugger: http/https traffic inspector.
  5. firstobject XML Editor: Formatting XML and browsing nodes in a tree view.
  6. Google Chrome: HTML/Javascript/CSS inspector/debugger.
  7. IDE:
    1. Delphi:
      components:
      1. CnPack IDE Wizards
      2. madshi’s madCollection
    2. Microsoft Visual Studio
  8. Kentico CMS.
  9. Link Shell Extension: Managing file’s hard link.
  10. Microsoft Network Monitor.
  11. Nullsoft Install System
  12. Paint.Net: Graphic tool.
  13. Pdf995.
  14. soapUI.
  15. Synergy: one set of mouse and keyboard for multiple PC.
  16. TeamViewer
  17. VisualSVN Server, TortoiseSVN and WinMerge
  18. WinDirStat: shows disk usage in colour blocks
  19. Windows Live Writer: Writing blogs.
    Plugins:
    1. Live Writer Code Prettify Plugin

Sunday, July 28, 2013

An easy to use tool for query Oracle database

LINQPad can be used for query Oracle database as well. All you need to do is download IQ Driver for Oracle.
The steps are:
1. Click “Add connection” in the connection tree.
2. Click “View more drivers …” in the “Choose Data Context” dialog
3. Click “Download & Enable Driver” under the “IQ Driver – for MySQL, SQLite, Oracle” section.

In my case, parameters in Advanced tab of IQ Connection need to be populated to be able to connect to Oracle database directly.

Wednesday, July 10, 2013

A way to validate your email address

http://verify-email.org/index.php?option=com_emailverifier&check=bochen.lin@global-health.com&view=emailverifier&layout=verify&format=raw&2f8b80496c78ca0e01ff56a06da6bc8f=1

×

bochen.lin@global-health.com - Result: Ok
MX record about global-health.com exists.
Connection succeeded to mx.global-health.com SMTP.
220 mailhub.ws.com.au ESMTP

> HELO verify-email.org
250 mailhub.ws.com.au

> MAIL FROM: <check@verify-email.org>
=250 ok

> RCPT TO: <bochen.lin@global-health.com>
=250 ok

Wednesday, June 19, 2013

Upgrade Orchard 1.3 site from MVC3 (VS2010) to MVC4 (VS2012)

  1. Uses NuGet Package to install MVC4 into the project
  2. Manually change Rozer and MVC assembly configuration in the Web.Config files from old version to version 2 and 4. Add to Web.Config in each View folder of the project.
    1. <configuration>

      <system.web.webPages.razor>
              <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
              <pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
                  <namespaces>
                      <add namespace="System.Web.Mvc" />
                      <add namespace="System.Web.Mvc.Ajax" />
                      <add namespace="System.Web.Mvc.Html" />
                      <add namespace="System.Web.Routing" />
                      <add namespace="System.Linq"/>
                      <add namespace="System.Collections.Generic"/>
                      <add namespace="Orchard.Mvc.Html"/>
                  </namespaces>
              </pages>
          </system.web.webPages.razor>

      </configuration>

  3. Remove “@” if it is in and “@{}” block.
  4. Replace “jQueryUtils_TimePicker”

Sunday, June 16, 2013

Javascript scope in HTML page which contains iframe

If a HTML page contains a “iframe”, what is the relationship between the javascripts in the two HTML pages in terms of function/variable scope?

Tuesday, March 26, 2013

Failed Web Service Call Due to Big Time Difference Between Servers

The other day, a working web site was suddenly down. Its registration and login related functionalities were all failed.
The error was caught but the error message was kind of “Unknown”. Dug to the code, the caught exception “e” in below code is a null:
   1:  try
   2:  {                   
   3:      return client.Proxy.IdentityTypeList();
   4:   }
   5:  catch (Exception e)
   6:  {
   7:      this.HandleException(e);
   8:   }

what line 3 does is calling a web service, but it was failed and throwing an null exception. As there was no message text at all, it seemed it was getting into a dead end in for trouble shooting.

It finally turned out it was caused by there was a big time different between the tow machines (the calling web server and the web service server). The difference was more than 5 minutes.

What I have done to find out the cause was I wrote a test program in C#. The test program was a WinForm application. The function of the application was to call the same web service as above code did.

When the application was deployed to the web service, it failed to call the web service and threw an exception. This time the exception did have a error message text complaining that the web service returned in future time and the time in the future was longer than 5 minutes.

What is still mystery to me from the above case is that the same code in Web application and WinForm application throws different exception. The exception threw in Web application does not make sense at all which make it very difficult to do the trouble shooting.