Code Pool Review: Top 10 Articles of 2014

top10banner

Top 10 Pages from Google Analytics

  1. Take a Photo and Upload it on Mobile Phones with HTML5
  2. Take a Photo from Android Camera and Upload it to a Remote PHP Server
  3. How to implement a simple barcode scan application on Android
  4. VSS / SourceSafe Tutorial
  5. How to Source Control SQL Server Stored Procedure using TFS in VS 2012?
  6. How to Use JavaScript to Save Canvas Data in Chrome
  7. How to auto-deploy web application with TFS Build Server
  8. WCF & Java Interop
  9. Using Git-TFS in Visual Studio 2013 Express
  10. How to Read and Write Excel Files in Java

Draw the Board | Modern Ludo

Today we start making our Modern Ludo Game from scratch.

The first thing to do is draw the board. For this part, we’ll simply use the <Canvas> in HTML5.

The MarkUp is very simple:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>ModernLudo</title>
    <link rel="stylesheet" type="text/css" href="Styles/modernludo.css" />
</head>
<body>
    <div id="playGround" style="display:none;">
        <div id="main">
            <canvas id="gameboard"></canvas>
        </div>
    </div>
    <script type="text/javascript" src="Scripts/modernludo.js"></script>
</body>
</html>

CSS:

body {
    padding: 0;
    margin: 0 auto;
    overflow-y: hidden;
    background-color: #0D0D0D;
}
div#main {
    background-color: khaki;
    margin: 0 auto;
    padding: 0;
}

#gameboard {
    position: absolute;
    margin: 0;
    padding: 0;
    box-sizing: padding-box;
}

The important part is the JavaScript. How to actually draw the board:

  1. Placing the board in the browser window. Considering that we want to build an application that runs in web browsers, we need to make sure that our board can adjust itself to fit a browser window of any size:
    function refreshBoard() {
        canvasWidth = window.innerHeight - 10;
        canvasHeight = window.innerHeight;
        maindiv.style.width = canvasWidth + "px";
        maindiv.style.height = canvasWidth + "px";
        ctx.canvas.width = canvasWidth;
        ctx.canvas.height = canvasWidth;
    }
  2. Creating the background. Our game is Modern Ludo, so a blue sky makes for a good background:  Read more

Dynamic .NET TWAIN 5.0 Released!

I’m glad to announce Dynamic .NET TWAIN 5.0 is released today. Dynamic .NET TWAIN is a .NET Component for TWAIN Scanning which enables you to acquire images from any TWAIN compliant devices and UVC compatible Webcams, edit the scanned images and then save them to a local disk, web server, database or FTP site.

Here are some highlights of the new features in version 5.0:

  • Added WPF version of Dynamic .NET TWAIN, which makes it easier to integrate document scanning feature into your WPF applications.
  • Added an IfShowCancelDialogWhenBarcodeOrOCR property to display a progress bar while doing barcode or OCR.
  • Added an OnWaitForEnd event to detect the beginning and ending of Barcode/OCR progress.
  • Changed the way trial notification is displayed to make it more friendly
  • Added GIF format support for load and download methods.
  • Improved the Print method so that users are able to print the desired number of pages instead of just all of them.

 

Release Notes of 5.0 >>
Try Dynamic .NET TWAIN Demo >>
Download 30-day free trial of Dynamic .NET TWAIN 5 >>
How to upgrade to v5.0 >>

Thanks for the continued support of our customers. I hope you enjoy the new version.

 

Dynamsoft Is 10 Years Old!

Founded in September 2003, Dynamsoft is now 10 years old. Happy birthday! Throughout the first ten years, Dynamsoft has grown a lot with hard work by all employees. And, of course, we couldn’t have accomplished our growth without continued support from all customers. We are grateful to our employees and our customers for their dedication and help in making Dynamsoft a success.

When you reach a decade-long milestone like Dynamsoft has, it’s important to reflect upon the journey that got you here to maximize successes for the journey ahead. Here’s a quick look back.

Dynamsoft Product History

  1. Dynamsoft released its first image capture SDK product, Dynamic TWAIN, on Aug. 8, 2003. This was just prior to the official company establishment in Sept. 2003.
  2. On Aug. 20, 2003, Dynamic Web TWAIN 1.0 was released. This web-based scanning SDK has since expanded to support all mainstream browsers on Windows and Mac OS X, including browsers that have come and gone.
  3. On Nov. 15, 2003, Dynamsoft introduced SourceAnywhere for VSS (original name SourceAnywhere), a remote access add-on tool for Microsoft Visual SourceSafe (VSS). In the ‘good old days‘ of SourceSafe, many customers were thrilled to find SourceAnywhere for VSS which facilitated Internet access to local VSS databases from anywhere.
  4. Dynamsoft opened its first official office in Vancouver, Canada, in Sept. 2004. Today, the company has two offices. In addition to the Vancouver office, there is another in Asia. This expansion enabled Dynamsoft to better serve global customers.
  5. Dynamsoft earned its very first customer – LOCKHEED MARTIN – in Dec, 2004. Today, thousands of customers including HP, IBM, Intel, and Siemens use Dynamsoft source control solutions/services and imaging SDKs. See our partial customer list
  6. On Jul. 18, 2005, Dynamsoft released Issue Tracking Anywhere, a web-based issue and bug tracking solution.
  7. On Jan. 5, 2006, SourceAnywhere Standalone (original named SourceHero) was released to the public. This source control solution was designed as a replacement for SourceSafe. To this day many customers like it because of its ease of use, speedy performance, and stability.
  8. On Jun. 4, 2007, Dynamsoft released SourceAnywhere Hosted, which is the SaaS version of SourceAnywhere Standalone.
  9. On Oct.17, 2007, Dynamsoft earned Gold Certified Partner Status within the Microsoft Partner Program.
  10. n Dec. 18, 2008, SCM Anywhere was released. This is a simple software configuration management solution which combines source control and issue tracking features. (The product was pulled off the shelves in June, 2012.)
  11. Dynamic .NET TWAIN was released on Jan. 20, 2010.
  12. In Mar. 2011, Dynamsoft became an associate member of the TWAIN Working Group, which defines the TWAIN standard.
  13. On Dec. 10, 2011, Dynamsoft started providing hosting services for Microsoft Team Foundation Server.
  14. On Nov. 12, 2012, ImageCapture Suite was made available. Based on Dynamic Web TWAIN, it added support for image capturing from webcams.
  15. On Jan. 08, 2013, Dynamsoft released barcode reader and OCR SDKs, available in both ImageCapture Suite (web based) and Dynamic .NET TWAIN (.net version).

Dynamsoft continues to aim to be a dynamic center for software developers. To this end, our product lines continue a focus on source control and TWAIN/imaging SDKs. We’ve made many product updates in 2013 alone to continue to address our customer requirements for advanced source control and image capture application solutions.

We look forward to another 10 golden years with our employees and working closely with our customers. Again, we are sincerely grateful for your support during our first 10 years of growth.

SourceAnywhere 64-bit Server is available!

I’m pleased to announce that SourceAnywhere 64-bit Server is released on September 25th, 2013. This is a SQL server-based version control software designed as a VSS replacement.

As you may already know, a 32-bit application may not work very efficiently sometimes, as its available memory and CPU are limited. With the new release of SourceAnywhere 64-bit Server, the capacity and performance of SourceAnywhere server are now greatly improved!

If you are running a medium-sized or large team, it is highly recommended that you upgrade to the 64-bit version on your 64-bit Windows server for the best performance.

Check out the Release Notes >>

Download the 30-day free trial >>

How to upgrade to the latest version? >>

If you have any questions or comments regarding the new release, please feel free to let me know (kgao@dynamsoft.com).

Cheers!

Dynamic Web TWAIN 9.1 released!

I’m pleased to announce that Dynamic Web TWAIN 9.1 is released on August 27th, 2013.

Three exciting improvements are included in this new version:

  • Added native scanning support for Mac Edition. The new property ImageCaptureDriverType allows Mac users to directly acquire images via native scan (without installing a TWAIN driver).
  • Improved IE users’ experience when using a separate process for document scanning. In v9.0, IE users might need to manually allow the broker process to run. It is now automated with the enhanced security of the ActiveX edition.
  • Fixed a bug where OnPostTransfer event is not triggered in some cases.

 

Check out the Release Notes >>
Download the 30-day free trial >>
Visit online store >>

I’d love to hear any comments or suggestions about this new version. Please don’t hesitate to contact me (kgao@dynamsoft.com).

Cheers!

Using Git-TFS in Visual Studio 2013 Express

Microsoft has released Visual Studio 2013 Preview, and announced the availability of Git for Visual Studio and Team Foundation Service. Today, let’s go through the new experience of version control in VS 2013 Preview.

Account Creation

Microsoft provides Team Foundation Service Free Plan for up to 5 users. I’m using the service for demo in this article. If you don’t have an in-house TFS Server, you can also take advantage of it and sign up for an account here. If you need a TFS Hosting service with good customer service, you may check out Dynamsoft TFS Hosting plans.

After creating an account with Microsoft TFS Service, you will be directed to your TFS page like the one shown below. You can see two options for creating a team project. The account URL is located below “Getting started”.

TFS main page

Team Project Creation

Click “New team project + Git” to create a team project using Git as the source control provider.

create git project

 

Specify the project name and select Git for version control.

specify new project

 

This is the page for my newly created team project. After creating the team project, we can then push the local repo to remote server.

project created

Local Project Creation

Create a new project in Visual Studio, and do not forget to check “Add to source control”.

create local project

 

Choose Git as your source control system.

choose git

 

Now you will be able to view the changes of your source code.

changes of source code

 

Commit your code.

commit changes

 

Right click a file in Team Explorer, you can compare version differences with syntax highlighting.

diff files

 

Also, checking repo history is convenient by right click.

view history

Publish to Remote Repository

Switch to Commits.

switch to Commits

 

Find Git URL on your TFS account.

git URL

 

Copy the URL to remote repository configuration, and click “Publish” to upload your local files to remote server.

publish to remote repo

 

Check commits information online.

commit log

 

Import Git from GitHub

Clone Git repo.

git clone

 

Download source code to local disk.

clone finished

 

Double-click your repo and click “Open” to mount your project.

open cloned project

 

That’s all about how to simply use Git between Visual Studio 2013 Express and Git remote server. Don’t hesitate to email kgao@dynamsoft.com if you have any idea to share with me.

 

 

ActiveX Deployment

ActiveX is a software framework created by Microsoft for sharing information and functionality among different applications. As for web application, ActiveX only works with Internet Explorer.

Choose a secure ActiveX control

Due to the fact that ActiveX control can literally do anything you can do to a computer, it is important that you choose a secure ActiveX that you can trust.

Things you can check:

  • Whether the ActiveX is digitally signed

    If an unsigned control is infected by a virus or maliciously changed by hackers, and it has full access to the resources on your machine, it’d be very dangerous. Digital signing tells users where the control came from and verifies that the control has not been tampered with since its publication.

  • Whether the control is marked safe for initializing and scripting

    This way, you can protect by restricting the domains in which the control can be scripted. This is referred to as “site locking” (or, locking down your control) and makes it harder for a control to be maliciously repurposed.

Licensing ActiveX control

Windows Internet Explorer uses the license package file (LPK) to verify if an ActiveX control is licensed. The LPK file can be included in any HTML page by using the OBJECT object.

Below is a simple sample:

<OBJECT CLASSID="clsid:5220CB21-C88D-11cf-B347-00AA00A28331"> <PARAM NAME="LPKPath" VALUE="time.lpk"> </OBJECT>
  • The CLSID identifies the object as a license package
  • The PARAM object specifies the relative location of the license package file with respect to the HTML page.

Note: Only one .lpk file can be included in a given HTML page.

However, we have received quite a lot requests on license error from our customer using our TWAIN scanning ActiveX. Because it is cumbersome to create LPK files – users need to download the LPK tool, ensure the license information of the ActiveX on the machine is correct, and  run the LPK tool to generate a LPK file and then put the LPK at proper path and refer to it in the LPK object correctly. During the steps, it is easy for web developers to miss something and got license error for ActiveX.

So for Dynamic Web TWAIN, the TWAIN interface for web application, we have introduced another way to license the control – using a ProductKey property to license Dynamic Web TWAIN ActiveX at runtime.

Deploy ActiveX control on web server

ActiveX control is usually package in CAB file, which helps reduce the file size and the associated download time for Web content from web servers.

An ActiveX control is identified by the OBJECT object in an HTML file. If the control has been stored in a .cab file, OBJECT must include a CODEBASE attribute that specifies the URL for this .cab file.

For example, below is the object for the trial version of Dynamic Web TWAIN ActiveX v9.0:

<object classid = "clsid:FFC6F181-A5CF-4ec4-A441-093D7134FBF2" id="DWObject" CodeBase = "DynamicWebTWAIN.cab#version=9,0"style ="width :500px; height:500px;">
<param name = "Manufacturer" value = "Dynamsoft Corporation" />
<param name = "ProductName" value = "Dynamic Web TWAIN" />
</object >

After you deploy the ActiveX on web server properly, on the first visit of web page with the control, users will get prompt to install the control.

Here is what it looks like when you visit the web scan page with Dynamic Web TWAIN ActiveX:

Install Dynamic Web TWAIN ActiveX on client machine

You can try it out by visiting the online demo of Dynamic Web TWAIN.

Besides CAB, you can also use MSI installer for ActiveX control. In that case, you can add a download link to the path of the MSI file for end users to download and install it on client machines.

Dynamsoft Enhances Barcode Reader for its .NET TWAIN Software Dev Kit

Updated Barcode Reader Increases 1D and 2D Barcode Recognition and Performance in Dynamic .NET TWAIN SDK for Use in Developing Image Acquisition and Processing Applications

 

VANCOUVER – June 3, 2013 – Dynamsoft Corp., a developer of scanner programming libraries and JavaScript webcam plug-ins, has upgraded the barcode reader add-in for its latest Dynamic .NET TWAIN software development kit (SDK), version 4.3, to improve its overall performance. Barcode reader performance (1D or 2D) is improved from 50 to 300 percent compared to previous versions. Barcode recognition accuracy has also been improved.

 

The larger the barcode image, the more pronounced the improved performance of the barcode reader. Also, the SDK now allows developers to use zone optical character recognition (OCR) on scanned / captured documents. The Dynamic .NET TWAIN SDK enables a simpler development path for applications to capture images from most imaging devices for sale or in use. The SDK has built-in webcam support. It also supports TWAIN, WIA and UVC application programming interfaces (API). These features and more practically eliminate worries related to ensuring device compatibility. Extension features include image editing and uploading capabilities to allow post-capture processing in WinForm, WPF or other .NET applications.

 

“Barcodes continue to grow in popularity and as this happens it becomes important that developers be able to leverage their advantages,” said Amy Gu, Vice President of Dynamsoft.  “Accurate barcode recognition is critical, regardless of the size of the barcode. Dynamic .NET TWAIN’s latest barcode add-in address these performance needs.”

 

Dynamic .NET TWAIN is based on Microsoft’s .NET framework and the TWAIN library is optimized for use in C# and Visual Basic .NET. Customizable scanning configurations include, ADF; duplex; resolution; pixel type, and more. Multiple support channels are provided for the SDK, including email, live chat, forum and phone.

 

Pricing and Availability

Dynamsoft’s Dynamic .NET TWAIN SDK is available starting June 4, 2013. It is licensed for $799 per developer and allows royalty-free distribution. The purchase of a yearly subscription includes Premier Support, offering advantages such as one-to-one product training, code reviews up to three times annually and more. The SDK can be purchased online at https://www.dynamsoft.com/Secure/.Net-TWAIN-Scanner-BuyIt.aspx. Full details on Premier Support are available at https://www.dynamsoft.com/Products/Yearly-Subscription-Benefits.aspx#TWAIN-Benefits.

 

About Dynamsoft Corp.

Founded in 2003, Dynamsoft Corp. provides enterprise-class source control / version control software. Its SourceAnywhere™ software enables efficient file management of source code versions. This ensures greater collaboration and integrity of source code. It is ideal for web, software and application development throughout the lifecycle of development and support. Dynamsoft also provides TWAIN™ software development kits (SDK) and other image capture SDKs. Dynamsoft is an associate member of the TWAIN Working Group that develops TWAIN standards. Thousands of customers use Dynamsoft’s source control and TWAIN SDK solutions. Customers include: 3M®; Apple®; EMC®; Fujitsu®; GE®; H&R Block®; HP®; IBM®, Intel®; InfoSys®; Lockheed Martin®; Olympus®; Philips®; PricewaterhouseCoopers®; Samsung®; Siemens®; Symantec®; Unisys®; Verizon®; and more.  More information is available at http://www.dynamsoft.com.

 

Note: Whether noted or not, references to certain words may be trademarks or registered trademarks of their respective owners.

Dynamic .NET TWAIN 4.3 Released!

Dynamic .NET TWAIN is a .NET component which enables image acquisition, editing and uploading for desktop application. I am very pleased to announce that version 4.3 is now available!

5 months ago, we released v4.2 and most of our customers just loved it. We have a bunch of customers who want to make Dynamic .NET TWAIN a perfect product, so they always love to share their suggestions and comments about the product. Thanks to their great inputs, some exciting features are now added to version 4.3:

  • Greatly improved speed and robustness of the barcode recognition.
  • Enabled OCR on a certain area of the image.
  • Added property LicenseKeys for flexible licensing.
  • Added property SelectionRectAspectRatio to fix aspect ratio for selection rectangle.
  • Added methods to manage images by GUID.
  • And many more.

Please give this new version a try and feel free to share your opinions. A 30-day trial version is available for your testing.

If you are ready to order a license of Dynamic .NET TWAIN, please go to our online purchase page or send your Purchase Order to sales@dynamsoft.com.

Cheers!