scanner

Access scanner from Java or Python (or something else if it's technically motivated) in Linux (but Windows would be nice)

Hi, I want to write a system for handling important documents in my home. This is the user story for getting a new document: I "Add new document" and am prompted to scan it using my combined printer/scanner. I view the scanned copy to see it's of good enough quality. Which it has. The system tells me to mark it with number N, which I ...

using java.util.Scanner to read a file byte by byte

I'm trying to read a one line file character by character using java.util.Scanner. However I'm getting this exception": Exception in thread "main" java.util.InputMismatchException: For input string: "contents of my file" at java.util.Scanner.nextByte(Scanner.java:1861) at java.util.Scanner.nextByte(Scanner.java:1814) at p008...

Storing short strings and numeric values in resources in Android

I want to have some static numeric and text values as an application resource. For example my data is like this: Levels 5 First_Level 500 60 1 Second_Level 500 80 1 Third_Level 200 60 1 Fourth_Level 130 30 2 Final_Level 100 30 3 ... and another 300 lines... The format and order of the data is predefined and guaranteed to be valid. I ...

Why is setting PixelType not working when negotiating Twain Session?

Hello, I'm trying to specify programmatically settings for scanning in TWAIN session. Because amount of code here would be significant I'm going to try to explain the problem without pasting the entire code. I hope there's someone good at TWAIN to help me.... To do scanning settings I'm using lowlevel calls to native Twain library. The...

Register a single class for multiple closed versions of a generic interface in StructureMap using the scanner.

Here are the relevant types and an example of the handler I want linked to IHandle<EventA> and IHandle<EventB>: // marker interface public interface IEvent {} public interface IHandle<TEvent> where TEvent : IEvent { void Handle(TEvent e); } public class SomeHandler : IHandle<EventA>, IHandle<EventB> { public void Handle(EventA...

WIA, Vista, and VB6. Does this code work?

Basically the constraints here are that i must use WIA because i am trying to get my scanner software to work in Windows 7 and Vista. It would be preferable (like really preferable) if i could do this in VB6. Now this code i have compiles and everything, however when i run it i get the error "No WIA device of the selected type is availa...

Try/catch in Java

Could someone please give me a hint why this try and catch is not working? It throws a scanner exception instead of printing the message I expect. import java.util.*; import java.io.*; import java.math.*; import javax.swing.*; public class Main { public static void main(String[] args) { Boolean test = true; while (t...

How can i handle it with scanner (java)?

Hello everyone I have a question about scanner please;I working at a small company; we have a software; it generate a big text file; and we must get some useful information from it ; i want write a simple application with java for saving time; could you please guide me ? for example i want this output ; Output RFID : 25 BLUID : 562...

How can i filtered with the best performance? (JAVA)

Hello everyone I'm working at a small office,I have an application,it's generate a big text file with 14000 lines; after each generate i must filter it and it's really boring; I wanna write an application with java till I'll can handle it as soon as possible. Please help me; I wrote an application with scanner (Of course with help :)...

Fastest way of processing Java IO using ASCII lines

Hello, I'm working with an ASCII input/output stream over a Socket and speed is critical. I've heard using the right Java technique really makes a difference. I have a textbook that says using Buffers is the best way, but also suggests chaining with DataInputStreamReader. For output I'm using a BufferedOutputStream with OutputStreamWri...

scanUpToCharactersFromSet stops after one loop

I'm trying to get the contents of a CSV file into an array. When I've done this before I had one record per line, and used the newline character with scanUpToCharactersFromSet:intoString:, passing newlineCharacterSet as the character set: while ([lineScanner scanUpToCharactersFromSet:[NSCharacterSet newlineCharacterSet] ...

Java parsing many instances of substring from String

Hello, I am trying to write a small java program that will accept a file (using Scanner class), return the file as a String, and then search that string for any instance of a substring starting with "Email:" and ending with ".edu". There will be many instances of this substring, each of which I want to parse out into an array or a new f...

How to make Java read very big files using Scanner?

I'm using the following basic function which I copied from the net to read a text file public void read () { File file = new File("/Users/MAK/Desktop/data.txt"); System.out.println("Start"); try { // // Create a new Scanner object which will read the data from the // file passed in. To check i...

Set page size using WIA (with scanner)

Hello, I'm using WIA to acquire images from a scanner with C#. I can scan the papers, but I can't set up the page size correctly, it always defaults to A4 and I need to use Letter or Legal sometimes. I tried with the WIA_DPS_PAGE_SIZE property, but when I try to set a value, I always get an error, that the value is out of the interval (...

Find closest IP

I know how to scan subnets in c++...I also know how to find geo location (altough it's not 100%)...But does anyone have an idea how can i find the closest ip addresses to mine ? Ex one neighbor is 100 meters from me and another one is 50 and if they are both connected to the internet, i should get the ip of the second which is 50 meter...

WIA Document Handling Status returns 0 even though the ADF has pages loaded

I'm trying to scan from an ADF using VBA and the Windows Image Acquisition library (WIA). I am trying to check to see if there are pages loaded in the ADF so I know whether to scan another page. This function seems to work well in Windows 7 (my dev machine) but not in Windows XP (the production machines). I know MS made some changes t...

How to write a StructureMap Scanner for this case

I have these registrations in a registry and am trying to figure out the correct way to implement them with a scanner instead of manual registration. For<ISomeView>.Use(HttpContext.Current.CurrentHandler) For<IOtherView>.Use(HttpContext.Current.CurrentHandler) For<IAnotherView>.Use(HttpContext.Current.CurrentHandler) And so on. I have...

Scanner errors in ActionListener/actionPerformed class

Hey everyone, I'm working on a hex dump utility made in Java. I'm having some issues with the Scanner I'd be using before the hex/ascii logic. Right now I have the logic and a few other things excluded for debugging reasons, but if anyone knows what's going on I'd like to know! Hints greatly appreciated. package filedumputility; impor...

Java: use scanner delimiter as token

Hi, I'm trying to find a good way to get a Scanner to use a given delimiter as a token. For example, I'd like to split up a piece of text into digit and non-digit chunks, so ideally I'd just set the delimiter to \D and set some flag like useDelimiterAsToken, but after briefly looking through the API I'm not coming up with anything. Right...

Regular Expression to Match " | "

Hey guys, I am trying to use Java's useDelimiter method on it's Scanner class to do some simple parsing. Basically each line is a record delimited by " | ", so for example: 2 | John Doe 3 | Jane Doe 4 | Jackie Chan The method takes as a parameter a regular expression for which to match for. Can someone please provide me with the regul...