Jeppe Sommer

Ranch Hand
+ Follow
since Jan 07, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jeppe Sommer

How can I get the list of all canteenIDs (50,51,52) which belongs to companyID="1"?

I have tried with the expressions:
String expression = "/invoice/companySetup[@companyID='1']/canteen/canteenID"

and

String expression = "/invoice/companySetup[@companyID='1' and canteen/canteenID]"

but it didn't work.

Hi.

I want to use xpath to match the second companySetup node in the XML below (if and only if two criterias matches). Let's say I want the companySetup with the attribute companyID="1" and the sub node /companySetup/canteen/canteenID with the text value = 50.

I tried to execute the xpath below, but it returns the first companySetup node which has the canteenID text value = 20.

Any help would be appreciated.

The XML looks like:
Thanks for your comments.

We solved our memory issue by simply add:

-XX:+CMSClassUnloadingEnabled
-XX:+CMSPermGenSweepingEnabled
-XX:MaxPermSize=256m

For some reasons that we don't know, the MaxPermSize was reseted and too low.

When this is said our traffic is still low so I am not sure about your discussion.

I will keep in mind about the simultaneous active transformations...
10 years ago
Hi.

I am trying to unzip a file but get an access denied error.

I'm running (resin) in administrator mode on Windows. I am able to create files and folders, but my code fails here:
out = new FileOutputStream(entryDestination);

The error looks like:

*** Folder created: C:\Users\myUser\foodticket\icaste
*** EntryDestination: C:\Users\myUser\foodticket\icaste

java.io.FileNotFoundException: C:\Users\myUser\foodticket\icaste (access denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
at java.io.FileOutputStream.<init>(FileOutputStream.java:145)
at module.driver.icaste.ICaste.unZipIt(ICaste.java:165)
at module.driver.icaste.ICaste.downloadZippedDriverPackage(ICaste.java:2
84)

Looking in Windows path finder the folder "icaste" is created properly:
C:\Users\myUser\foodticket\icaste



Any help would be appreciated, please.
10 years ago
The file is only 12 kb.

The server have 2560 MB and Xmx512m.

I have tried to save the attachment as a file on disk.

The error now come here:
transformer.transform( src, result );



Server log:
10 years ago
Hi.

I am trying to use FOP to get an e-mail attachment returned as byte array.

It seems that I am running out of memory when I create the Fop object:
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);

I am pretty sure it has something to do with the ByteArrayOutputStream.

Any help would be appreciated?



Server log:
10 years ago
Seems to work with:
<update check="background" />
11 years ago
Hi.

I am trying to make my web application being able to start, when I am offline, but I can't get it work.

In the JNLP file I use the <offline-allowed/> element, but it won't start up when being offline:


The console error is:


I have tried to add the update attribute "timeout":
<update check="timeout">

- but it still doesn't work.

Any help would be appreciated.
11 years ago
Hi.

Does anyone know an API to parse data on a MiFare card?

Thanks in advance.
11 years ago
Alright I am facing a more complicated issue when printing QR barcode.

According to the manual:
http://www.starmicronics.com/support/Mannualfolder/linemode_cm_en.pdf
Page 3-128:

My code looks like, but its doesn't work. It's just printing the QR text, no QR image is shown. Do I make any mistakes in my code below?:


The following is an example showing the sending of the commands.

(1) Set bar code type
<ESC> <GS> "y" "S" "0" 1 Sets to model 1.
<ESC> <GS> "y" "S" "1" 0 Sets mistake correction level to L.
<ESC> <GS> "y" "S" "2" 3 Sets cell size to 3 dots.

(2) Set bar code data
<ESC> <GS> "y" "D" "1" 0 20 0 "2005, January, 1 (SAT)" <LF>
Sets bar code data (Data automatic analysis)
Sets bar code data (Data manual analysis)

<ESC> <GS> "y" "D" "2" 10 1 4 0 "2005" ","
4 2 0 "Year" ","
1 1 0 "1" ","
4 2 0 "Month" ","
1 1 0 "1" ","
4 2 0 "Day" ","
4 2 0 "(" ","
2 3 0 "SAT" ","
4 2 0 ")" ","
3 1 0 <LF>

(3) Print bar code
To verify whether to print with the current settings, check the bar code expansion information.
<ESC> <GS> "y" "I" Check bar code expansion information
<ESC> <GS> "y" "p" Print
11 years ago

Pat Farrell wrote:You want to send what are normally called "escape sequences" They have been used for printer, modem, and CRT controls since the early 1970s. Maybe earlier, that's when I first started using them.

How is this printer connected to your computer? In the olden days, the printers were connected with either parallel or serial connections. Serial connections required manual setup of a lot of very low level communications parameters that we just let the network handle for us these days. Things like parity, number of bits in a byte, etc. were important and had to be managed in the application software. Stuff we usually ignore, like the highest order bit in a character, can cause serious headaches over a serial line.



Stephans commands works.

I am using USB connection. I am wondering about if you know any java api to call ESC commands (something like setBoldFontOn(), setBoldFontOff(), setFontSize(12), etc.) or do you know any API where you can just send HTML and it will convert it to ESC commands?
11 years ago

Stephan van Hulst wrote:The commands exist of ASCII characters. In the document the ascii decimal values are listed with the commands. n may be either the numerical value of the command you want to perform, or the character code representing that number.

48 is the decimal value for ascii '0'.

You can easily create the correct String like so: (char) 27 + 'd' + '0';



Thank, it works.
11 years ago
Hi, I am trying to send a cutter control command (ESC/P) to a thermal printer (Star TSP100).

The documentation says that you can send the command:
ESC d n

- where n is a function:

n Auto-cutter
0, 48 Full cut at the current position.
This command is ignored on tear-bar models.
1, 49 Partial cut at the current position.
This command is ignored on tear-bar models.
2, 50 Paper is fed to cutting position, then a full cut is executed. (*!)
On tear-bar models, paper is fed to the tear-bar position. (*2)
3, 51 Paper is fed to cutting position, then a partial cut is executed. (*1)
On tear-bar models, paper is fed to the tear-bar position. (*2)
(*1) Paper feed to cutting position: Executes a 1 inch

Please see documentation at:
http://www.starmicronics.com/support/Mannualfolder/dotcom_epm.pdf
Page 48: Cutter control

I am not sure how the function "n" works. What is meant by "0, 48"?

Here is my code:
str.append(ESC);
str.append( ( char ) 'd' );
str.append( ( char ) 0 );
str.append( ( char ) 48 );

or

str.append(ESC);
str.append( ( char ) 'd' );
str.append( ( char ) 0 );
str.append( ( char ) ',' );
str.append( ( char ) 48 );

- but it doesn't work? How do we understand the function n "0, 48"?
11 years ago
Hi.

I forgot to tell that I am calling the method inside a servlet, so I guess this is thread safe?
11 years ago