Re: [imaging] Thank you!

2020-01-05 Thread Guang Chao
On Fri, Jan 3, 2020 at 2:01 AM Bryan Atsatt  wrote:

> Just wanted to let the developers know that this project saved the day for
> an important Christmas present for my wife.
>
> She has wanted access to about 30k photos I have in an old Photoshop
> Elements catalog (with lots of keywords etc added), but didn't want to use
> that app.
>
> This library enabled me to preserve all the data by updating the photos,
> adding (approximate) GPS info where missing and making them searchable in
> Google Photos by appending keywords to the captions.
>
>
Maybe share the code in github


> She now has all of them in her Google Photos and on a portable drive, with
> no PSE required, and is very happy.
>
> So... thanks for all the hard work everyone, and Happy New Decade to you
> all.
>
> // Bryan
>


-- 
I love Java 


Re: [exec] Executed command can't open file argument

2018-05-02 Thread Guang Chao
On Wed, May 2, 2018 at 3:23 AM, Mark Trolley  wrote:

> (Sorry if this message appears twice. I sent it once before subscribing and
> haven't seen it appear in the archives so I assume it wasn't accepted.)
>
> I’m trying to use Apache Commons Exec to run the AtomicParsley tagging
> program, but execution fails with an error that the input file doesn’t
> exist. If I dump the command line arguments then manually execute
> AtomicParsley with the exact same arguments it succeeds. I know the file at
> the given path is readable because I tested reading it directly in my Java
> code and it succeeds. The error that the file doesn’t exist only happens
> when I use Commons Exec.
>
> Here is a snippet of my code:
>
> CommandLine cmdLine = new CommandLine("AtomicParsley");
> cmdLine.addArgument("${file}");
> cmdLine.addArgument("--overWrite");
> cmdLine.addArgument("--artwork");
> cmdLine.addArgument("REMOVE_ALL");
> Map map = new HashMap();
> map.put("file”, path.toFile().getAbsolutePath());
> cmdLine.setSubstitutionMap(map);
> ExecuteWatchdog watchdog = new ExecuteWatchdog(60 * 1000);
> Executor executor = new DefaultExecutor();
> executor.setExitValue(0);
> executor.setWatchdog(watchdog);
> try {
> executor.execute(cmdLine);
> } catch (IOException ioe) {
> System.err.println("Error removing artwork");
> ioe.printStackTrace();
> }
>
> If I use a script to dump out the arguments I see they are correct:
>
> "/Users/mtrolley/testing_mp4/Futurama - S05E01.mp4"
> --overWrite
> --artwork
> REMOVE_ALL
>
> If I use those arguments to manually run AtomicParsley it works:
>
> $ AtomicParsley "/Users/mtrolley/testing_mp4/Futurama - S05E01.mp4”
> --overWrite --artwork REMOVE_ALL
> No changes.
> $
>
>
Apologize, I just wish to cover the basics.  Have you check which user you
use to execute the Java program?  And could you kindly check if that user
has the rights to execute AtomicParsley?  Maybe set file permission to 755
or something.



> When I run the same command using exec:
> AtomicParsley error: can't open "/Users/mtrolley/testing_mp4/Futurama -
> S05E01.mp4" for reading: No such file or directory
>
> Thanks in advance for any help.
>



-- 
Guang 


Re: Missing type information (not seen in visitor)

2017-09-27 Thread Guang Chao
On Tue, Sep 26, 2017 at 7:05 AM, Showalter, Jim 
wrote:

> We have two classes like this:
>
> package com.intuit.foo;
>
> public class Foo {
> }
>
> public class FooHolder {
>private List foos = new ArrayList<>();
> }
>
> After visiting both classes and dumping out the info, I see this:
>
> com/intuit/foo/Foo:
>   class, lines 0 to ~2, deletable, public
>
> com/intuit/foo/Foos:
>   class, lines 0 to ~2, not-deletable, public
>   type references
> 
>   field declarations
> com/intuit/obill/v1/quote/response/Quote:chargeDetails:
> Ljava/util/List;
>
> Note that the type Foo is not seen in when visiting the Foos. Because
> there are no other references to Foo anywhere, this results in a
> false-positive delete of Foo.java.
>

I think that is expected for Generics if I am not mistaken.  The Foo in
List is just for compile time.  On runtime, it just knows that it is a
List, and do not know it is a list of Foo.


>
> I collect all of the referred-to types in the visitor like this:
>
>@Override
>public void visitConstantClass(final ConstantClass obj) {
>   String className = JavaUtils.dotsToSlashes(
> javaClass().getConstantPool().getConstant(obj.getNameIndex()).toString().replace("\")",
> "").replaceAll("^.*\"", ""));
>   if (ignore(className)) {
>  return;
>   }
>   type().addTypeReference(className);
>}
>
> What am I doing wrong?
>
> Jim Showalter
> Programmer
> Intuit, 2003H-265Z
> Garcia Avenue
> Mountain View, CA 94043
> (408) 353-4954 [home]
> (408) 204-1661 [personal cell]
> (669) 271-2257 [work cell]
>
>


-- 
Guang 


Re: [Math] PolyhedronsSet query

2017-08-09 Thread Guang Chao
On Thu, Aug 10, 2017 at 3:56 AM, Zach  wrote:

> Hi, I am making a PolyhedronsSet object by list of vertices and faces.
> Once I have created that object, I would like to get that same information
> back out or get a list of vertices. I am trying to use the union command to
> union two PolyhedronsSets and then get the lines or vertices of the unioned
> PolyhedronsSet. I've tried using the visit class to traverse the tree and
> see if the data is stored in the nodes but I can't figure out how to get
> data out of the nodes either.
>
> Thank you,
>
> Zach


Would you kindly share some code you are working on?

-- 
Guang 


Re: [CSV] Record Separator query

2017-08-09 Thread Guang Chao
On Wed, Aug 9, 2017 at 6:12 AM, nitin mahendru 
wrote:

> Hello All,
>
> I am trying to read in a csv file which may be 'crlf' or 'lf' seperated.
> Then I want to change a particular column, say encrypt it and then write
> back a new csv with that updated column. I want to use the same record
> separator as was in the input file.
>
> Is there a way to get the record separator back from the CSVParser object ?
> I am planning to use the below method to get the writer.
> CSVFormat.RFC4180.withRecordSeparator( separator).print()
>
> For using the above I need to know the record separator upfront which I
> have no clue about as the Parser object does not expose that detail.
>
> thanks
>
> Nitin
>

I think CSVParser is strict and may not work for both LF and CRLF.  Maybe
try to scan the file first and see if line ending is lf or crlf, and then
use a corresponding CSVParser instance that can handle each case.

-- 
Guang