Stanford Word Segmenter download lacks source code - stanford-nlp

The download package for the Stanford Word Segmenter, e.g.
http://nlp.stanford.edu/software/stanford-segmenter-2015-01-29.zip
does not include any source code, though the web page
http://nlp.stanford.edu/software/segmenter.shtml
suggests that it should: "The download is a zipped file consisting of model files, compiled code, and source files". The download does include a build.xml file, but the lack of a src directory means that ant doesn't work (specifically complaining that it can't find the expected src directory).
And src seems to be needed, because without recompilation, attempt to use the demo script results in an "Unsupported major.minor version 52.0" error.

The sources are contained within the jar file called stanford-segmenter-3.5.1-sources.jar. All these sources are also included within the larger CoreNLP package, whose source you can browse on GitHub.
And src seems to be needed, because without recompilation, attempt to use the demo script results in an "Unsupported major.minor version 52.0" error.
Stanford NLP tools version 3.5 and later require Java 8. You need to either update your JDK version or downgrade to the Segmenter 3.4.1 (this is the last version compatible with Java 7).

Related

gtsam is not able to find Eigen

I use version 4.1.1 of GTSAM. I have version 3.3.4 of Eigen installed.
The error is:
/usr/local/include/gtsam/base/OptionalJacobian.h:22:10: fatal error: Eigen/Dense: No such file or directory
#include <Eigen/Dense>
I tried building GTSAM with the flag -DGTSAM_USE_SYSTEM_EIGEN set to both on and off.
The same error message appears in both cases.
For reference this is a ROS project built with catkin.
Have you seen this PR: https://github.com/borglab/gtsam/pull/1304
If you can upgrade GTSAM to 4.2a8, it uses Eigen's find script's rather than custom ones and should properly find Eigen3, if you have it installed if you require to build from source.
Since you are using ROS, why not go the standard route... Have you declared a dependency on it in your package.xml and installed it with rosdep?
https://github.com/ros/rosdistro/pull/23198/files
Add to your package.xml:
<depend>gtsam</depend>
And, your CMakeLists, you just call
find_package(gtsam REQUIRED)
It is unclear to me, if gtsam is available through binaries, why you would be building it from source.
I was able to get it working by cloning version 4.0.3 of GTSAM into the src folder of my workspace, then building it with the following arguments:
-DGTSAM_USE_SYSTEM_EIGEN=ON -DGTSAM_POSE3_EXPMAP=ON -DGTSAM_ROT3_EXPMAP=ON

How to include selenium with pyinstall

I've got my script running fine using selenium web driver
In order to avoid the issue where users have mismatch versions of chrome and chromium extensions I use web driver to download the last versions at runtime.
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()))
So I don't have to include any chromium binaries in the spec file as it's downloaded at runtime (right?)
Everything is working, but when I try to build an unix executable file
with pyinstaller, I don't know what binaries should I include in the spec file, (I mean the path to selenium) and as a result it cannot find the selenium module and outputs me the error
ModuleNotFoundError: No module named 'selenium'
(only with the 'standalone' build with pyinstall, the scripts don't sent me this error)
So on Mac the full package is located here:
Library/python/x.x/lib/python/site-packages/selenium/
and I had to include it in the spec file within
the binaries with the project :
binaries=[('/Users/myusername/ProjectDir', '/Users/myusername/Library/Python/x.x/lib/python/site-packages/selenium')],

Building a React Native bridge but a file within the framework can't be found

I'm trying to build a React Native wrapper for the RichRelevance iOS SDK.
I've created the wrapper project and imported it into my React Native app. I'm using Cocoapods to add the RichRelevance SDK to the app
I'm now attempting to import the RichRelevance SDK into the wrapper project using:
#import <RichRelevanceSDK/RichRelevanceSDK.h>
The problem I have is that when the compiler attempts to compile the RichRelevanceSDK, it throws an error that one of the files is not found:
Line 63 is the original import that was written in the SDK. I added Line 62 to show that the file can be found if the type of import is changed. However, this isn't really an option since I don't want to modify the SDK (I don't own it).
In either type of import, I'm able to cmd+click the file and go to the definition. So XCode seems to know about the file. Additionally, I see the file in the Project browser under:
Pods -> Pods -> RichRelevanceSDK -> RCHImportable.h
The primary difference with this file is that, if I look in the file browser, that file is located in a sub-folder, relative to all of the other files in the SDK:
I'm hoping there's a way to change my wrapper project so that this file can be found, so I don't have to edit or fork the SDK files.
So far, I've attempted to update the various Search Paths in my wrapper project but with no luck. I've added the following two paths to all of the Search Paths:
UPDATE:
I was able to make some progress and I can now get it to compile.
I ended up:
cloning the SDK's repo to my computer
removing the SDK from the Podfile
adding the SDK's xcodeproj file to MyApp/Libraries
adding the SDK.framework file to MyApp -> Embedded Binaries
I can now import the SDK into my bridge module
I would still prefer to find a better way to do this though. This method either involves me committing the SDK to our repo or asking all of my colleagues to clone the repo to their machine. NPM can't seem to install the repo; my guess is this is due to the repo missing a package.json file
There does appear to be something wrong with the packaging, as the header in question would appear to be captured in the public_header_files glob in the Podspec.
However, I think more direct path is to simply include the RCHSDK.h file, as RCHSDK is the entrypoint to the SDK functions. The RichRelevanceSDK.h serves primarily as a shorthand for importing additional headers versus specifying them individually.
Alternatively, you can follow the instructions in Include of non-modular header inside framework module, this seemed to correct the issue in local tests.

missing payoffs.hpp and other .hpp from version

When building the Windows C++ version of quantlib 1.9.1, I get this error of missing payoffs.hpp. When I browse to the directories, I see payoffs.cpp, but not payoffs.hpp:
Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: 'ql/instruments/payoffs.hpp': No such file or directory FittedBondCurve c:\users\administrator\google drive\quantlib-1.9.1\ql\cashflows\conundrumpricer.hpp 27
I also get this for #include <ql/instruments/swap.hpp> [and possibly others]. I am able to build the windows quantlib library ok. Just not the examples.
I just checked the QuantLib 1.9.1 release available from the project downloads (did you get your version from there?) and the files you're looking for are contained in the release zip and tarball. Also, it's pretty weird that you could compile the library without them, so I'd double check if they're there. If they really aren't—well, hard to know how they got displaced; anyway, you can download the release again and replace them. If that doesn't fix the problem (or if they're already there after all), it's possible that you have to fix the include path for the example you're trying to compile. Does it include the QuantLib directory?

How to install Java 3D on Mac

I am taking a computer graphics course at my university. I am unable to create 3D graphics using Java since I do not have it properly installed. I downloaded the Java 3D API from Oracle. There is no installer included. Just the raw files j3dcore.jar, j3dutils.jar, and vecmath.jar as well as a few read me files. One of the read me files does contain a link that has instructions for the install. It says I must "Unzip Java 3D 1.5.1 into the "jre" directory of your JDK." Where is my JDK? I found my Java folder System > Library> Java > Extension and moved the files there because I read some other things online. I still get this error message in Eclipse when coding: "Access restriction: the method [whatever] from the type [whatever] is not accessible due to restriction on required library /System/Library/Java/Extensions/j3dutils.jar." But I have this file exactly where it says it should be.
Java 3d version 1.3 is pre-installed in Mac OS X. You shouldn't need to install anything. Perhaps try put things back the way they were?
If you want to upgrade to version Java 3D 1.5, you can download this installer: http://create.ife.no/vr/tools/j3d/java3d_1_5_2-macosx.pkg.zip
Firstly i would make sure that all those files have the correct permissions on them... based on the "Access restriction" error, it seems like the problem might have to do with that. From the looks of it, you have them installed in the right place (thats where mine is installed anyway)
this is what mine looks like:
Open a terminal, navigate to the directory you moved the jars to, and use the command:
chmod +x *.jar
+x is a file permission that allows execution of files as programs; files without this permission set will throw errors if you attempt to execute them. Java is technically a bytecode interpreter and jar files are interpreted rather than run, but it's possible that java checks the file permissions manually before loading classes from jars, in which case it would logically fail with an error similar to that which you're reporting.
If you are using eclipse then you can just download the 3d zip file. Move the jars into your project and right click on them. Select add build path. There should be 3 new jars in the referenced libraries.

Resources