Sunday, December 18, 2011

Bar-code readers


There is huge zoo of these devices. They are divided to different groups from marketing and user point of view. In this post I'd like to introduce you a third point of view. Point of view of software engineer.

1. Quick start

Bar-code reader is always read only device for PC.
Bar-code reader could be configured via scanning special bar-codes from it's user manual
You can configure many parameters in that way. The most interesting for us are prefix and suffix of code sequence (I'll back to this later in details)

2. Two kinds of bar-code readers

I divided our bar-code readers zoo in two parts: 1. Bar-code readers that interact with PC like HID devices (these includes PS/2 and USB bar-code readers); 2. Bar-code readers that connects via RS-232 port.
Both of these kinds of devices have their advantages and disadvantages.

2.1. HID devices

Pros:
+ Easy to prepare your program to work with them.
+ You have no need to handle reconnection issues and the like.
Cons:
- There is sometimes hard to determine if we have input from bar-code reader or from keyboard (but this can be solved by using a prefixes and suffixes).

2.2. RS- 232 devices

Pros:
+ You always know that input that you receive is from bar-code reader.
Cons:
- You should handle reading from RS-232 port in your program.
- You should handle connection issues in your program.

3.N.B.

If you make some mistakes in configuration of bar-code readers, there is a page with “reset to factory defaults” sequence in user manual (Check if you have this page before making any changes in configuration).  

Tuesday, November 22, 2011

Announcment

I'd like to share some knoledgee about next items:
1. How to deal with interesting devices (Scales, Barcode readers, etc)

Sunday, October 23, 2011

ZKoss UI testing experience

Recently I had experience of developing small set of web applications for internal use. These applications were based on ZKoss AJAX UI framework. During development me and my teammates realized that we need set of UI test just because it easier and faster to test our work automatically than manually.

To solve this issue I take a look at Selenium. We realized that we can’t test ZKoss applications by Selenium itself; we need some additions because id’s of UI elements have been generated automatically by ZKoss (see presentation about it at slideshare and video (Ukrainian language) here ).

Fortunately ZK team have made testing framework on the top of Selenium to test their components. So I made a fork of this framework at github and modified it for our purposes (instead of component testing our team needed to make an integration tests).

So we received an ability to locate UI elements by different parameters. We choose next sets of parameters for this purpose:

  1. ZKoss element id (not an javascript id)
  2. ZKoss element type and caption (i.e. @menu[label=”File”])
  3. ZKoss element type, caption and modal form on which it located (i.e. @window[title=”Error”] @button[label=”Close”])

All these approaches works fine at the moment.

Also we have some issues:

  1. With two similar applications we have different behavior of internet explorer WebDriver (it’s related to issue http://code.google.com/p/selenium/issues/detail?id=2247). With one application we see unnecessary scrollbar and with other we don’t see it.
  2. We still can’t run htmlunit tests with our application.
  3. We still can’t run component tests with ZTL-2 and this will be subject of future investigation.
P.S. Also there is a brunch at ZKoss forum related to subject http://www.zkoss.org/forum/listComment/17556-ZTL-issues

Thursday, July 7, 2011

Telnet server on Windows 7

Windows 7 as telnet server

1. Enabling telnet server feature under Windows 7

In Windows 7 and Windows Server 2008 R2, both Telnet client and Telnet server features are available, although they are not turned on by default. These features can be turned on by an administrator (or a user with an administrator account) through Control Panel\Programs\Programs and Features\Turn Windows features on or off. Instructions for turning on the Telnet client are also provided in Help in Windows 7 and Windows Server 2008 R2.

(Source : http://technet.microsoft.com/en-us/library/ee126154%28WS.10%29.aspx)

2. Increase maximal telnet server connections count

To set desired number of connection please modify next registry key

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\TelnetServer\1.0]

"MaxConnections"=dword:00000002

(Source: http://64.4.11.252/en-us/library/cc771020(WS.10).aspx)

3. Each user could have own autologon script

You should modify file C:\WINDOWS\system32\login.cmd ( check registry key LoginScript in node HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\TelnetServer\1.0)

@echo off

rem

rem Default global login script for the Telnet Server

rem

rem In the default setup, this command script is executed when the

rem initial command shell is invoked. It, in turn, will try to invoke

rem the individual user's login script.

rem

rem Modification allows to have own autorun for each user


echo *===============================================================

echo Microsoft Telnet Server.

echo Hello %USERRNAME%

echo To have autorun please modify (or create)

echo %HOMEDRIVE%\%HOMEPATH%\autotelnet.bat

echo *===============================================================

cd /d %HOMEDRIVE%\%HOMEPATH%

IF EXIST "%HOMEDRIVE%\%HOMEPATH%\autotelnet.bat" call "%HOMEDRIVE%\ %HOMEPATH%\autotelnet.bat"

After that, modify your autotelnet.bat in your user directory (for example add c:\dn\dn line to run DosNavigator on each logon).

4. Troubleshooting

If you have troubles with hot-keys usage, you could run telnet client in next way

telnet -t vtnt YOUR_SERVER_NAME




Saturday, May 21, 2011

Amazon warranty experience

Beginning

After month of usage I've got crack (1/4") starting at the lower left corner of the screen, in the plastic casing (the screen itself is fine).

I wrote letter to Amazon service. Lately I received an answer. From the answer I understand that I need to call to customer service. I live in Ukraine and it’s costly to me to call to US. I wrote another letter to describe situation. But the answer was the same

The Call

I called to customer service and described the situation. After short talk I was assured that my kindle will be changed to new one and all my charges will be refunded.

In action

  1. There was order created for me. I should pay for the new Kindle and for shipping ($210).
  2. Money for my old Kindle and it’s shipping to Ukraine was refunded on my card one week later ($210).That day I confirmed order to my new Kindle.
  3. Later I went to the UPS office and sent my old kindle back to Amazon ($106,5)
  4. In 10 days I received my money back.

Wednesday, May 11, 2011

Tricks to make CHM files look well on Kindle

All you need it's just to convert CHM to MOBI format using Calibre.

But in this case you can get artifacts like in picture below

So we need:

  1. Remove buttons

  2. Remove table and link CONTENTS


1 Remove buttons

To get images from CHM like from archive you can use CHMdir plugin for Total Commander. Find necessary images and edit them. Make them blank with any image editor (it could be even Paint for Windows).

2 Remove table

Follow all operations on a screenshot

You are ok if in field 6 after test (5) you will have not zero

In this example I replaced:

<table width="100%" border=" 1 " bgcolor="#EBEBFF">

with

<table width="100%" border=" 0 " bgcolor="#EBEBFF">

to hide the table and

<a class="docLink" href="Front%20matter.htm">CONTENTS</a>

with empty line to remove this link.

After all this steps you will have pretty clean e-book in mobi format

Saturday, May 7, 2011

Anounce

Next week you will see here:

1. Tricks to make chm files look fine on your Kindle

2. My experience with Amazon warranty