Sunday, September 7, 2008

installing EPSON TM printer in Windows XP using USB to parallel port troubleshooting

It took me almost 3 days to solve this problem.
For background story, I have a EPSON TM-T88IV, and I want to install it to my new EEE Box. My EEE Box doesn't have any LPT port, so I bought a USB to parallel port cable.
I thought it would be as easy as plug and play. Unfortunately, it's not.

I won't tell long story about my struggle finding the solution.
So here's the solution:
- don't connect the printer (I don't know if this step is necessary)
- use WinXP driver (APD304E.exe)
- Install it
- After select module dialog appear, pick TM-T88IV Driver and select Port configuration. Select USB.
- continue install, and restart the computer.
- After restarted, connect the printer. Window will detect TM-P2.01, and want to install driver.
- Just press cancel.
- Open Control Panel -> Printers and Faxes
- Right click on the printer (T88IV) icon, and select properties.
- Select "Ports" tab.
- find the "virtual printer port for USB" in description.
- select it, and click apply.
- Test if the printer really connected to this virtual port. Unplugged the USB-LPT cable, and see printer icon in "Printers and Faxes" window. If it's connected, it should become "offline". and then plug it again, the status will be "ready". If it's not, well you can stop here, because I don't experienced this. If you have more than 1 virtual printer port, you can try it one by one.
- Uncheck "Enable bidirectional support" and "Enable printer pooling".
- Apply again.
- In "General" tab, you can test print. Click on "Print Test Page".
- And there you have it.

Thursday, June 19, 2008

Code 128 font (barcode) code in C#

I have problem using code128 barcode font.
When I use character 154 (& #154) in html it will be š but in C# its wrong.
š value will be 353 in C#.
So I make table for the character.
here's the codes:



readonly static string code128AsciiTable = "€!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~‘’“”•–—˜™š›œ";
private char Code128ToAscii(char c)
{
char res = (char)code128AsciiTable[(int)c];
return res;
}
private char AsciiToCode128(char c)
{
char res = (char)code128AsciiTable.IndexOf(c);
return res;
}
private char Code128CheckSum( string str, char startChar )
{
int result = 0;
for (int i = 0; i < str.Length; ++i)
{
result += (int)str[i] * (i + 1);
}
result += (int)startChar;
result %= 103;
result = Code128ToAscii((char)result);
return (char)result;
}
public string ConvertToCode128Format(string str)
{
char startChar = code128AsciiTable[104];
char stopChar = code128AsciiTable[106];
string convertedStr = "";
for (int i = 0; i < str.Length; ++i)
{
convertedStr += AsciiToCode128(str[i]);
}
char checkSum = Code128CheckSum(convertedStr, (char)104);
string FullConvert = startChar + str + checkSum + stopChar;
return FullConvert;
}
public void Test()
{
string testString = "156461003";
string code128String = ConvertToCode128Format(testString);
}


Friday, June 13, 2008

Agile Planning in my office

For the past 7 months, I've been introduced and experiencing a whole new world of software development planning, that's called Agile Planning. Well, I know it's not a new thing, but it is for me. I heard a lot about this method since 2 years ago, but I haven't got a chance to experienced it until 7 months ago.
When I first heard about it, I thought it was just another gimmick in software development, that will be forgotten in 2-3 years. But I was wrong, and I'm glad I'm wrong, because --for me-- this method is the best system in software development planning.
It so simple, but yet it so spot on in solving the problems in old ways of planning (waterfall). Starting from the scrum meeting, sprint, and milestone. It just feel so right for me.
I recommend everybody working in software business, at least have a try implementing agile development. Read Mike Kohn's books, or at least check his website.

Saturday, May 17, 2008

Show build configuration in Visual C# express

When I start download Visual C# express, I thought Microsoft remove the feature for selecting build setting (debug/release), because I can't find the build configuration anywhere.
I found out that you just need to do some setting.
To show the advanced build configuration,
open: Tools -> Options -> Project and Solutions and then check the "Show Advanced build configurations".
and viola, you have the build configuration (almost) like visual studio.

Tuesday, March 25, 2008

MySql: to reset auto increment number

Recently I've been doing a project using MySql database server. I created some tables using auto increment number as the Primary Key. Just like the name suggests, the number will increase every time I insert new record into the table. At some point I wanted to delete the whole dummy data I inserted.

Using the 'DELETE FROM Table_name'statement will only remove all records but will not reset the auto increment number back into 1. After some little effort of searching I found this useful syntax to reset the number:
ALTER TABLE Table_name AUTO_INCREMENT = 1;

Problem solved.

Wednesday, January 2, 2008

Sayur Asem (Sour vegetable soup)

Last week we cooked 'sayur asem' as dish companion to 'ayam goreng kuning'. As usual we got the recipe from googling in internet. It was a bit difficult to find one of the ingredients needed, daun salam (some say bay leaves). In the end of searching, we found it at a small shop of Malay. Interestingly, the shop also sells other Indonesian products like 'mie sedap' (not Indomie guyz), kecap bango, tempe, sambal abc (yeah!).

Anyway, and the ingredients are....(opening the notes)

Serves 4-6

- 1 litre of water
- 1 cube of chicken stock
- 2 daun salam (bay leaves)
- 1 cm galangal, a bit crushed
- white chick peas, as much as you like
- long green bean, chopped about 3-4 cms long
- 0.5 chayote (labusiam) chopped in cube about 2cmx2cm
- 1 sweet corn, chopped about 2 cm each.

Seasoning (crushed together)
- 3 shallots
- 1 garlic clove
- 1 red Thai chilli (hot enough for me)
- 1 tsp shrimp paste/terasi/belacan
- 4 tsp salt
- 4 tsp sugar
- 4 tsp tamarind paste (add water a bit to mix)

Preparation:
1. Grind the seasoning together into a paste.
2. Using a sauce pan bring the water and chicken stock to boil
3. Add the paste into the pan and stir to dissolve.
4. Add daun salam, galangal, chick peas, corn into the pan and wait for another 10-15 minutes or until the peas tender enough
5. Add the chayote, long green bean into the pan and bring back to simmer for another 10 minutes
6. Taste it if you like a bit sweeter or saltier can add more sugar and salt