Monday, July 24, 2017

Making a list from a single element

Do
newArrayList(string)
Super handy method from Google Collections

Sunday, April 30, 2017

How to scan with an HP C309a on Mac OS X Sierra

I have an HP c309a photosmart premium all in one print fax scan copy (never used for faxing) that is a very slow scanner but it's a scanner that does work so I'm not going to replace it if I can help it. Though today I gave that serious consideration when I discovered that with the new Mac OS, Sierra (10.12.4 at "press" time), the scanner is no longer supported even by HP Easy Scan.

When I tried running HP Easy Scan I got an error popup that said "Scanner reported an error: HP Photosmart C309a series is currently unavailable. Ensure your device is powered on, check the connection, and ensure your network is functioning properly. If these conditions are correct, restart the device and try scanning again."

I tried all these things, of course, with no luck. Searching on this found nothing but the strong suggestion that this product has passed its end of life and is no longer supported by HP. Argh HP why do you insist on being so lame.

I spent a while looking at replacements. I really don't want to spend a couple hundred bucks to replace this. My husband's printer doesn't work (begging the question why he keeps it) so I can't just get a new scanner.

Then I discovered that you can go into System Preferences, to Printers-Scanners, choose the Scanners tab, and scan through that! This worked for the first scan, on the flatbed, but then when I tried to use the automatic feeder, it did all the scanning and then displayed "No document loaded..." on the screen.


Sinking heart. Really need the ADF.

Suddenly it occurred to me that maybe it did work - I looked in the target directory - my files were there! "Scan.jpeg", "Scan 1.jpeg", "Scan 2.jpeg", etc. I can work with this!

HTH,
kewpiedoll99

p.s. It turns out I misunderstood what it meant by "No document loaded": There's nothing left in the feeder.

p.p.s. I have been using a great PDF splitter and merger software since it was a (I think open source) project in dev on Source Forge or similar. It's PDF Split And Merge and it is great. They've really improved the UI. I never upgraded from the old version I had until now, when I lost the old version in a computer upgrade. Highly recommend this app if you ever need to split or merge PDF files.

Thursday, February 16, 2017

Use correct header with CURL

Upon submitting a request to my service like

CURL -X POST http://localhost:8600/a/b/c -d '{"assignmentId[]":[12345]}'

I got this error:

"A servlet request, to the URI http://localhost:8600/a/b/c, contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected."

Resolved with this answer from http://stackoverflow.com/a/33636404/187423 (thanks Arnold B.).

When I changed my request to

CURL -X POST http://localhost:8600/a/b/c -H "Content-Type: application/json" -d '{"assignmentId[]":[12345]}'

(adding the header) the service was able to parse the request and handle it normally.

HTH,
kewpiedoll99