How to Make PHP Barcode Reader on Linux

When developing a web barcode reader app in PHP, you can either use some JavaScript barcode libraries to recognize barcode images on client-side or read the barcode images on server-side with some PHP extensions that capable of reading 1D and 2D barcode. In this post, I will demonstrate how to create a PHP barcode reader with DBR (Dynamsoft Barcode Reader for Linux) on Ubuntu 14.04.

Read more

Time to Migrate Android Projects to Android Studio

Last week, Android Developers Blog posted an article – An update on Eclipse Android Developer Tools. It announced that Google will end development and official support for the Android Developer Tools (ADT) in Eclipse at the end of the year. Many developers have been using Eclipse to develop Android applications with ADT for many years. Someone may be reluctant to get started with a new IDE from scratch, though, it is worth spending time on the new tool if it is more powerful and efficient than Eclipse. As Google said, they will deliver a great experience on a unified development environment and make developers productive. Since I’ve been playing Android Studio for a few days, I’d like to share my experiences.

Read more

New to HTML5

What is HTML5

HTML5 is a markup language based on HTML 4 and XHTML 1. It’s goal is to support the latest multimedia and be much more readable and understandable by humans and devices. Also, it is dedicated to reducing the dependency on RIA (Rich Internet Application) such as Flash, Silverlight, JavaFX and so forth, providing more handy APIs for strengthening Internet applications. A generic definition of HTML5 is “HTML5 + CSS3 + JS”.

Why HTML5

  • Standard
  • Cross-platform
  • Auto-adapt to the web page
  • Update in real-time
  • No plugin needed
  • Open and free
  • Friendly to search engines

What can HTML5 do

For experiencing what HTML5 can do, here are some amazing HTML5 web pages:

http://spielzeugz.de/html5/liquid-particles.html

http://ghost-hack.com/post/jsexperiments/tunneler/tunneler.html

http://playbiolab.com/

http://bellard.org/jslinux/index.html

Features of HTML5

Semantics

HTML5 defines some new HTML elements, which makes document description much more precise and readable.

semantics

Here are some useful HTML5 elements:

<article> <header> <aside> <hgroup> <figure> <figure> <figcaption> <section> <footer> <time>.

Deprecated elements: <acronym> <applet> <basefont> <big> <center> <dir> <font> <frame> <s> <isindex> <noframes> <frameset> <strike> <tt> <u> and <xmp>

Connectivity

WebSocket

WebSocket provides for full-duplex communication, which makes more possible interaction between client and server, facilitating live content and the creation of real-time games.

websocket

 

Notifications

Website can push notifications to the desktop via the following code.

if (window.webkitNotifications.checkPermission() == 0) {
    var title = 'HTML5 notification',
        text = 'Can you see HTML5 notification?';
    window.webkitNotifications.createNotification('', title, text).show(); 
}

Multimedia

In HTML5, inserting a video or audio is as convenient as inserting an image.

HTML5 video

<audio src="sound.mp3" controls></audio>
<video src="movie.webm" autoplay controls></video>

3D Graphics Effects

Canvas

Dynamically draw something on the web page.

<canvas id="canvas" width="300" height="300"></canvas>
<script>
  var ctx = document.getElementById("canvas").getContext("2d");
  ctx.fillRect(20, 25, 150, 100);

  ctx.beginPath();
  ctx.arc(220, 110, 100, Math.PI * 1/2, Math.PI * 3/2);
  ctx.lineWidth = 15;
  ctx.lineCap = 'round';
  ctx.strokeStyle = 'rgba(255, 127, 0, 0.5)';
  ctx.stroke();
</script>

WebGL

Without needing a plugin, WebGL provides some APIs to render 2D and 3D graphics in the web browser. This website helps you check whether your browser supports WebGL. Here are some amazing WebGL samples.

HTML5 vs Flash

HTML5:

  • No plugin for web browser.
  • Complex
  • Low popularity so far
  • Cross-platform
  • Lacks an engine
  • Free development tools.

Flash:

  • Smooth and stunning
  • Easy to learn
  • High popularity
  • High battery cost
  • Not open
  • Paid development tools

For more specifications, refer to Wikipedia: Comparison of HTML5 and Flash

Please feel free to contact kgao@dynamsoft.com.

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.

 

 

How to auto-deploy web application with TFS Build Server

Provided as part of Visual Studio Team Foundation Server, Team Foundation Build enables developers/managers to manage the projects, from version controlling the source code, running associated unit tests, to releasing builds and publishing build reports. In this article, I’ll share with you on how to take advantage of TFS Build to auto deploy a web application to your web server.

TFS Web Deploy

1. Install Visual Studio 2010. In this article, we take Visual Studio 2010 for example.

2. Install TFS Build Server.
You can set up a local build server by yourself. If you are using the TFS Hosting service provided by Dynamsoft, you can ask to install the Build Server add-on for your account.

3. Install Web Deployment Tool on your TFS Build Server.

4. Install Web Deployment Tool on your Web Server and set up the site for your web application.
Note: Please change the .NET Framework Version of the site’s application pool to v4.0 in IIS and make sure the firewall or any antivirus software doesn’t block port 8172.

5. Add the following arguments to the “MSBuild Arguments” of your build definition. Separate them using space.

TFS Build Arguments

/p:DeployOnBuild=True
/p:DeployTarget=MsDeployPublish
/p:MSDeployServiceURL=https://<server name>:8172/msdeploy.axd
/p:DeployIISAppPath=”TestSiteForDeploy”
/p:CreatePackageOnPublish=True
/p:MsDeployPublishMethod=WMSVC
/p:AllowUntrustedCertificate=True
/p:UserName=***
/p:Password=*****

To edit a build definition, you must have the Edit Build Definition permission. To set the permission, you can choose the target project in Team Explorer, and right-click Builds -> Security. In the Security dialog box, choose the user or group you want to grant the permission to, for instance, [DWT]\Builders. And then confirm the Edit build definition option is set to Allow.

TFS Build Security

With the above settings, the build result will be deployed to your web server automatically when you perform Queue New Build (Team Explorer -> right-click Builds -> Queue New Build).

It’s just a quick review of auto-deployment. Hope the information helps you enable the feature smoothly. If you have any comments, please don’t hesitate to leave them below for discussion. You can also reach me at kgao@dynamsoft.com.

 

How to set up a build server for your TFS Hosting account

In this article, I will share with you on how to set up a build server for your TFS Hosting account.

Assume you have already signed up for a TFS hosting account. If not, you can go to TFS Hosting Sign Up to get one. Now please follow the steps below to set up a build server for your TFS hosting account.

1. Install TFS Build Service.

Download and run Visual Studio Team Foundation Server 2010 Setup. Since Dynamsoft has already set up the server side for you, you only need to choose the “Team Foundation Build Service” option. Then Click Install to install the service.

Team Foundation Setup

2. Start Build Service Configuration and click Next.

build service welcome

3. Project Collection

Then you’ll be guided to Project Collection to configure your Team Foundation Server info. Before configuring the connections, please add “72.15.153.156 TFSServer1” to the hosts file on your build machine (under C:\Windows\System32\drivers\etc\). 72.15.153.156 is the IP address of TFS server.

Then let’s go back to Project Collection. Click Browse… to select your team project collection. Since you haven’t connected to any TFS Server before, you can click Add in the “Add/Remove Team Foundation Server” dialog box to add a new one.

Name or URL of Team Foundation Server: tfsserver1
Path: tfs
Port number: 8080

After clicking OK, choose your team project collection. In this sample, we choose 105012.

4. Credential Settings

In the Run Team Foundation Build Service as section, choose “Use a user account” and enter the account name and password.

Please note that the account will be used to run the build service and connect to the Team Foundation Server, so please make sure:

a)      The account has the permission to run the build service. Usually you can choose the login user. In this case, I choose 105012_build.

b)      The same account exists on the TFS server. To double confirm this, you can log into your web portal and navigate to “TFS Hosted -> User Management”. If the user 105012_build is not there, you can click Create User to add the user. Please note that the password for the user should be the same on both machines.

c)        105012_build is in the “Project Collection Build Service Accounts” group. In Visual Studio, navigate to “Team -> Team Project Collection Settings -> Group Membership”. You can then choose “Project Collection Build Service Accounts” and click Properties to check the members. If the user is not in the list, please check out Can I add a Windows user to my TFS account for information on how to add.

For the port number, I choose the default one 9191. Please make sure it is not blocked by the firewall or any antivirus software on your build server.

5. Update Local Build Service Endpoint (incoming)

First, you need to stop the build service. To do this, you can open “Team Foundation Server Administrator Console” and click Stop in Build Configuration.

Then, click on Properties to change the value of Local Build Service Endpoint (incoming) from the machine name to your public network IP.

Note: please make sure that your firewall allows Microsoft Visual Studio Team Foundation Build Services to run both privately and publicly.

Done. Now you can get started to use your Build Server. If you have any questions or comments, please add them below or contact me at kgao@dynamsoft.com.

How to speed up File Search in version control?

SourceAnywhere is a SQL Server based version control tool designed for distributed teams. Since version 4.0 released on Aug 7, 2012, the tool supports “find in files”, which helps you search and navigate the source tree in seconds. In this article, I will introduce you to the basic technologies about the search feature in version control.

SourceAnywhere 30-day Free Trial Download
Sign up a Trial Account with the Hosting Edition of SourceAnywhere

Wildcard Search

Search for a specific document based on the file name. You can go to “SourceAnywhere Client -> Tools -> Wildcard Search” and enter the complete or part of the file name to “Wildcard”.

For instance, to search for a file named scanning.aspx, you can type scanning.aspx, scanning or scan to find the file. To narrow down the search result, you can choose the search area, and even filter the files by check-in date and/or file size.

wildcard search

Content Search

Besides Wildcard Search, you can also do the content search. The feature is quite useful when you have a relatively large project and/or have a distributed team cooperating together and working on the same project.
To do Content Search in SourceAnywhere, you can go to “SourceAnywhere Client -> Tools -> Find in Files”. In the dialog box, you can enter the keywords you are looking for. For instance, if you want to find the HTTPUploadAllThroughPostAsMultiPageTIFF function, you can enter “httpupload” to “String”. If you are not sure which path the file containing the upload function is located in, you can type $/ to “Item” as you can see below.

find in files

SourceAnywhere introduces the following techniques to help you narrow down the search range and get a better content search experience:

1. Regular Expression

A regular expression provides a concise and flexible means to match (specify and recognize) strings of text, such as particular characters, words, or patterns of characters. This can be used when you only remember part of the keyword you are looking for.
Regular Expression Basic Syntax Reference haracter Value

haracter Value
. Wildcard: any character
* Repeat: zero or more occurrences of previous character or class
^ Line position: beginning of line
$ Line position: end of line
[class] Character class: any one character in set
[^class] Inverse class: any one character not in set
[x-y] Range: any characters within the specified range
\x Escape: literal use of metacharacter x
\<xyz Word position: beginning of word
xyz\> Word position: end of word

For detailed information, please refer to Findstr.

How to enable Regular Expression

a. Check the “Use regular expressions” option in “Find in Files”.
b. Make sure that “Cache file” and “Cache file all versions” are checked, and in the meantime “Encrypt cached file” is unchecked. The options can be found at “SourceAnywhere Service Configurator -> Cache Settings”.

SourceAnywhere Cache

2. File Filter

As the wildcard search, you can filter the files by the check-in date and file size. After you give the conditions and request for the search result, you’ll get the target file or a list of files that match the given conditions.

search result

Afterwards, you can view the files, export the search result or check out the target file directly.

3. Windows Index Search.

To speed up the search process, Windows Index Search is supported by SourceAnywhere. Together with the cache mechanism supported by SourceAnywhere, the version control tool will add the list of cached files to the Windows Search index. In other words, after you get or search for a file once, you’ll have a much faster search experience from the second time.

How to enable Windows Index Search

SourceAnywhere will use Windows Index Search if the “Use regular expressions” option is not checked in the “Find in Files” dialog box.

Conclusion

After you add your projects to the version control tool, you can use Wildcard Search and Find in Files (Content Search) to organize the files and get the target files without any effort.