I'm trying to run the example CLIPS GUI projects, both versions 0.2 and 0.3, however without success. Nothing special - I create a simple Eclipse project with the codes, using Debian 64bit and I always end up with the "CLIPSJNI.SymbolValue cannot be cast to CLIPSJNI.MultifieldValue" exception. I got the libCLIPSJNI.so in /usr/lib64. Any help or suggestions appreciated.
I think your issue is that either the rule or resource files are not being found in your projects. There are probably multiple (or better) ways to do this, but what I did was create a CLIPSJNI project to contain the CLIPSJNI.dll, CLIPSJNI.jar, and libCLIPSJNI.jnilib files and then a separate project for each of the demos. I placed the clp files at the root level of the demo project, the java code within the src directory and the resources folder within the src directory:
Animal
src
AnimalDemo.java
resources
AnimalResources.properties
.
.
.
animaldemo.clp
bcdemo.clp
I placed an archive zip of the projects at https://sourceforge.net/projects/clipsrules/files/CLIPS/Misc/: CLIPSJNI_0_3_Eclipse_projects_64Bit.zip
Related
I have a project where I write XCUITests. I would like to place the accessibility IDs in a separate framework along with other things so that they can be read in the project and in the tests.
MyProject
- MyProject.xcworkscapce
- MyFramework
- MyApp
-MyApp (main-target)
-MyAppUITests (uiTest-target)
Loading MyFramework in the project is no problem. To make it visible for the UITests I import MyFramework into the UITests. The class and the static variables (Acc-Ids) are public. The completion also recognises everything, no errors are shown in the code, I can also navigate to the variables. The app works.
Now when I run the test, I get 4 error messages, which unfortunately tell me nothing at all:
/Users/john.doe/Library/Developer/Xcode/DerivedData/ALIS-ffdwrkfpekfzrggbfmnsazmrxelm/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyAppUITests.build/Objects-normal/x86_64/MyAppUITests.abi.json
/Users/john.doe/Library/Developer/Xcode/DerivedData/ALIS-ffdwrkfpekfzrggbfmnsazmrxelm/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyAppUITests.build/Objects-normal/x86_64/MyAppUITests.abi.json: No such file or directory
/Users/john.doe/Library/Developer/Xcode/DerivedData/ALIS-ffdwrkfpekfzrggbfmnsazmrxelm/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyAppUITests.build/Objects-normal/x86_64/MyAppUITests.swiftdoc
/Users/john.doe/Library/Developer/Xcode/DerivedData/ALIS-ffdwrkfpekfzrggbfmnsazmrxelm/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyAppUITests.build/Objects-normal/x86_64/MyAppUITests.swiftdoc: No such file or directory
/Users/john.doe/Library/Developer/Xcode/DerivedData/ALIS-ffdwrkfpekfzrggbfmnsazmrxelm/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyAppUITests.build/Objects-normal/x86_64/MyAppUITests.swiftmodule /Users/john.doe/Library/Developer/Xcode/DerivedData/ALIS-ffdwrkfpekfzrggbfmnsazmrxelm/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyAppUITests.build/Objects-normal/x86_64/MyAppUITests.swiftmodule: No such file or directory
/Users/john.doe/Library/Developer/Xcode/DerivedData/ALIS-ffdwrkfpekfzrggbfmnsazmrxelm/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyAppUITests.build/Objects-normal/x86_64/MyAppUITests.swiftsourceinfo /Users/john.doe/Library/Developer/Xcode/DerivedData/ALIS-ffdwrkfpekfzrggbfmnsazmrxelm/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyAppUITests.build/Objects-normal/x86_64/MyAppUITests.swiftsourceinfo: No such file or directory
What I tried:
clean project
delete derived data
the framework is in Copy Bundle Resources?
copy bundle resources: is there something red
This is a special "no such file or directory" error that some people seem to get.
Any help appreciated.
Facebook's Pysa tool looks useful, in the Pysa tutorial exercises they refer to files that are provided in the pyre-check repository using a relative path to include a path outside of the exercise directory.
https://github.com/facebook/pyre-check/blob/master/pysa_tutorial/exercise1/.pyre_configuration
{
"source_directories": ["."],
"taint_models_path": ["."],
"search_path": [
"../../stubs/"
],
"exclude": [
".*/integration_test/.*"
]
}
There are stubs provided for Django in the pyre-check repository which if I know the path where pyre check is installed I can hard-code in my .pyre_configuration and get something working but another developer may install pyre-check differently.
Is there a better way to refer to these provided stubs or should I copy them to the repository I'm working on?
Many projects have a standard development environment, allowing for hard coded paths in the .pyre_configuration file. These will usually point into the venv, or some other standard install location for dependencies.
For projects without a standard development environment, you could trying incorporating pyre init into your setup scripts. pyre init will setup a fresh .pyre_configuration file with paths that correspond to the current install of pyre. For additional configuration you want to add on top of the generated .pyre_configuration file (such as a pointer to local taint models), you can hand write a .pyre_configuration.local, which will act as an overlay and overwrite/add to the content of .pyre_configuration.
Pyre-check looks for the stubs in the directory specified by the typeshed directive in the configuration file.
The easiest way is to move stubs provided for Django in the pyre-check repository to the typeshed directory that is in the pyre-check directory.
For example, if you have installed pyre-check to the ~/.local/lib directory, move the django directory from ~/.local/lib/pyre_check/stubs to ~/.local/lib/pyre_check/typeshed/third_party/2and3/ and make sure your .pyre_configuration file will look like this:
{
"source_directories": ["~/myproject"],
"taint_models_path": "~/myproject/taint",
"typeshed": "~/.local/lib/pyre_check/typeshed"
}
In this case, your Django stubs directory will be ~/.local/lib/pyre_check/typeshed/third_parth/2and3/django
Pyre-check uses the following algorithm to traverse across the typeshed directory:
If it contains the third_party subdirectory, it uses a legacy method: enters just the two subdirectories: stdlib and third_party and there looks for any subdirectory except those with names starting with 2 but not 2and3, and looks for the modules in those subdirectories like 2and3, e.g. in third_party/2and3/
Otherwise, it enters the subdirectories stubs and stdlib, and looks for modules there, e.g. in stubs/, but not in stubs/2and3/.
That's why specifying multiple paths may be perplexing and confusing, and the easiest way is to setup the typeshed directory to ~/.local/lib/pyre_check/typeshed/ and move django to third_parth/2and3, so it will be ~/.local/lib/pyre_check/typeshed/third_parth/2and3/django.
Also don't forget to copy the .pysa files that you need to the taint_models_path directory. Don't set it up to the directory of the Pyre-check, create your own new directory and copy only those files that are relevant to you.
I'm following Maven's Standard Directory Layout for my project.
Is there a preferred directory to put my checkstyle.xml file? I've seen it on at least 3 possible locations:
src/main/resources/checkstyle.xml
src/main/checkstyle/checkstyle.xml - Example: Joda-Time
src/checkstyle/checkstyle.xml - Example: Spring Boot
Since this is mostly a file for developers, the first option gives me doubts. Would it make sense to include checkstyle.xml into the JAR file?
Thanks,
Fede
Putting checkstyle.xml in src directory doesn't really make sense, as it is not part of source code.
The most common convention I've observed in my projects is putting it into config/checkstyle/checkstyle.xml. Thousands of projects use it (filename:checkstyle.xml path:config/checkstyle) and Gradle uses this location by default.
I was wondering if it is possible to override/add to the template paths for Playframework? For instance, the default templates are looked under views folder and are compiled automatically. These templates are further reachable directly using a URL without any additional config.
---app
|-controllers
|-models
|-templates //How do I compile templates under this folder?
|-views
What I would like to know is if it is possible to add a custom path in addition to the views folder that is also compiled with the build process. Alternatively, is it possible to block certain templates to be not reachable by direct URL ?
Thanks in advance!
Under the app directory, Play should automatically compile anything that looks like a Twirl template - that is, has a registered extension such as *.scala.html - regardless of what directory it's in. The views directory is just a convention, and compiling templates under an app/templates directory should already happen.
If you open an SBT prompt you can verify this by running the command:
show twirlCompileTemplates::sourceDirectories
Which should give you something like:
[info] my-project/compile:twirlCompileTemplates::sourceDirectories
[info] List(/home/me/my-project/app)
For adding a templates directory outside the app folder, you should be able to add something like the following in your build.sbt (for example, the directory extra_templates):
import play.twirl.sbt.Import.TwirlKeys._
sourceDirectories in (Compile, compileTemplates) += file("extra_templates")
I'm having trouble getting the lobos database migrations library for Clojure to play with the maven-clojure-plugin and Maven-style project structure. Lobos looks for database migrations in the lobos.migrations namespace. If I layout the project Leiningen style:
src/
lobos/
migrations.clj
lobos correctly finds lobos.migrations at run time, when run via lein. However, if I lay out the project Maven-style:
src/
main/
clojure/
lobos/
migrations.clj
and use the maven-clojure-plugin to run the same tests, lobos no longer finds lobos.migrations. I thought this was an issue with the clojure-maven-plugin, but I have the same issue (lobos not finding lobos.migrations) if I run via leon, setting the source paths in project.clj appropriately:
:source-paths ["src/main/clojure"]
If I move lobos/ back under src/ and add src/ as a source path:
:source-paths ["src" "src/main/clojure"]
then lobos correctly finds lobos.migrations again.
I would like to use a Maven-style project layout (and eventually the maven-clojure-plugin). How can I help lobos find lobos.migrations? Where have I gone wrong?
The lobos.migration/*src-directory* variable indicates the source root for finding source for the *migrations-namespace*. If lobos.migration/*reload-migrations* is true (the default), then lobos.migrations looks for the migrations namespace in this source directory. The default is src/, so it needs to be rebound to src/main/clojure in order to use a Maven-style directory structure.
One other notable issue: when running from a JAR (i.e. not from source), you must disable reloading of the migrations namespace as well:
(binding [lobos.migration/*reload-migrations* false]
;; run migration
)
You need to change the dynamic variable lobos.migration/*migrations-namespace*. This is documented here: https://github.com/budu/lobos#migrations.