Parse errror: version mismatch between Agda and its standard library - agda

I'm running the prebuilt Windows Agda version 2.4.2.2. In Emacs/Agda2 Include Dirs I have identified c:/agda-stdlib-0.13/src and the folders one level below.
Upon loading a module which consists only these two lines, I get an error message.
module test1 where
open import Integer
The error message:
C:\agda-stdlib-0.13\src\Data\Empty.agda:13,5-5
C:\agda-stdlib-0.13\src\Data\Empty.agda:13,5: Parse error
HASKELL<ERROR> data AgdaEmpty #-} {-# COMPIL...
Is something missing from the proper installation of the library?

Your Agda is old. See this page for library compatibility. You need Agda 2.5.2 for this library.

Related

how to tokenize indic languages using inltk

i did this using this NLP documentation check it out:
https://inltk.readthedocs.io/en/latest/index.html
from inltk.inltk import tokenize
text="जो मुझको सताती है तुझे वो बातें आती है जब सामने तू होता नहीं बेचैनी बढ़ जाती है मैं रूठ "
tokenize(text ,'hi')
the error is:
RuntimeError: Internal: src/sentencepiece_processor.cc(890)
[model_proto->ParseFromArray(serialized.data(), serialized.size())]
The issue you encountered usually appears when a wrong SPM model is used, or when there is any other issue related to SPM model.
Make sure you set up the language support first:
from inltk.inltk import setup
setup('hi')

This expression was expected to have type 'System.String' but here has type 'string'

How is it possible that the F# compiler rejects the type string when it's expecting a System.String?
#I #"..\..\packages"
#r #"FSharp.Data\lib\net40\FSharp.Data.dll"
open FSharp.Data
let [<Literal>] csvFile = #"..\..\data\FootballResults.csv"
type Football = CsvProvider< csvFile >
let data = Football.GetSample().Rows |> Seq.toArray
After running this simple code, I get the error message:
Script.fsx(5,30): error FS0001: This expression was expected to have type 'System.String' but here has type 'string'
I thought string was simply an alias for System.String?
Edit
The csv file is quite big, just the first rows are important:
Date,Home Team,Away Team,Full Time Home Goals,Full Time Away Goals,Full Time Result,Half Time Home Goals,Half Time Away Goals,Half Time Result,Home Shots,Away Shots,Home Shots on Target,Away Shots on Target,Home Fouls,Away Fouls,Home Cards,Away Cards,Home Yellow Cards,Away Yellow Cards,Home Red Cards,Away Red Cards
08/18/2012,Arsenal,Sunderland,0,0,D,0,0,D,14,3,4,2,12,8,7,0,0,0,0,0
08/18/2012,Fulham,Norwich,5,0,H,2,0,H,11,4,9,2,12,11,6,3,0,0,0,0
08/18/2012,Newcastle,Tottenham,2,1,H,0,0,D,6,12,4,6,12,8,3,5,2,2,0,0
The full file can be downloaded here under the folder data
FSharp.Data version
FSharp.Data 2.3.2
I found the problem, it was in the paket script provided in the book Get Programming with F#.
The script was pointing to an old version of FSharp.Data (I thought paket was this amazing package manager that always get you the best version for your project while in fact, it does not, you always fight and struggle with wrong dependencies).
At the end I managed to fix the problem this way:
Solution 1
Simply start a new project using the nuget command Install-Package FSharp.Data -Version 4.2.7 and then the reference to the package #r "nuget: FSharp.Data"
Solution 2
Update the paket.lock provided by the book with the correct version FSharp.Data (4.2.7). The code posted in my question run after that.
Advice for F# learner
Whoever is trying to learn F# with this book, it's a good book but be very careful with their package reference. They seem outdated and can get you into unpleasant situation.

Using JavaCV with Kotlin

I'm currently attempting to start a project using JavaCV in Kotlin. I'm using IntelliJ Idea as my IDE. I'm using JavaCV 1.3.2 and OpenCV 3.20.
This is my setup for the module's dependancies for OpenCV:
and for JavaCV:
I have opencv before javacv in the dependancies.
To test that OpenCV is present and valid, I wrote the below to test. As I can loadLibrary and the version number shows correctly I can assume that OpenCV is actually working.
import org.opencv.core.Core
import org.opencv.core.Mat
import org.opencv.core.CvType
import org.opencv.core.Scalar
import org.bytedeco.javacv.OpenCVFrameGrabber
fun main(args : Array<String>) {
println("Test Built Successfully")
System.loadLibrary(Core.NATIVE_LIBRARY_NAME)
println("Running OpenCV Version ${Core.VERSION}")
val grabber = OpenCVFrameGrabber(1)
}
The line where we initialize the grabber rasies the following exception:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniopencv_core in java.library.path
Caused by: java.lang.UnsatisfiedLinkError: no opencv_imgproc320 in java.library.path
Perhaps I am missing something here, but I have followed the instructions provided by the README.md in the Git repository for JavaCV. I haven't seen anybody else trying to use this library with Kotlin on StackOverflow, though have checked out some posts about the same exception being raised using java.
Handling this error is no different in Kotlin from Java; you need to specify the path to the native libraries for opencv. By default on Windows it will look for the native libraries in whatever is set in your PATH environment variable.
You can also explicitly specify which directory to look for the native libraries by specifying the system property java.library.path (as indicated by the error message).
For example, you can add a run configuration like this:
Where ${PATH_TO_DYNAMIC_LIB} would be where ever the native lib opencv_imgproc320.dll is - I think in your case it would be C:/Users/ms/IdeaProjects/CVTest/opencv/build/java/x64.
I was able to resolve this by leaving my VM options blank and adding all necessary OpenCV libraries as native library paths in my JavaCV library configuration.
on MacOS, you don't need to install a native library. On OpenCV3.41, as fetched from
<!-- https://mvnrepository.com/artifact/org.openpnp/opencv -->
<dependency>
<groupId>org.openpnp</groupId>
<artifactId>opencv</artifactId>
<version>3.4.2-1</version>
</dependency>
I looked in the library (jar tf ~/.m2/repository/org/openpnp/opencv/3.4.2-1/opencv-3.4.2.-1.jar) and found dlls and whatnot in it:
jar tf *1.jar | grep nu
...
nu/pattern/opencv/osx/
nu/pattern/opencv/osx/x86_64/
nu/pattern/opencv/osx/x86_64/README.md
nu/pattern/opencv/osx/x86_64/cmake.log
nu/pattern/opencv/osx/x86_64/libopencv_java342.dylib
...
This led me to this StackOverflow question on nu.pattern which show how to use the nu.pattern in code.
static {
nu.pattern.OpenCV.loadShared();
System.loadLibrary(org.opencv.core.Core.NATIVE_LIBRARY_NAME);
}
This prologue code enabled sample apps which used to fail as above to run.

Need help installing the GNU Scientific Library for Lisp(GSLL)

I use Emacs\Slime\SBCL\QuickLisp\Cygwin(new to Cywgin I know nothing really about it) I, per this GNU link http://common-lisp.net/project/gsll/, tried to follow these instructions under the download and install section:
"You will need to make sure that the libraries and header files associated with GNU Scientific Library (GSL) and libffi are installed; your distribution may name these libgsl0-dev and libffi-dev. Once they are installed and you have loaded the quicklisp file:
run (ql:quickload "gsll")"
but its not working . I get this error message in emacs when running (ql:quickload "gsll")
Unable to load any of the alternatives:
("libffi-6.dll" "libffi-5.dll" "libffi.dll")
[Condition of type CFFI:LOAD-FOREIGN-LIBRARY-ERROR]
I have quicklisp installed correctly i use it all the time so I know its not that ....I don't really understand this part of above excerpt from website(above)
"your distribution may name these libgsl0-dev and libffi-dev." Once they are installed and you have loaded the quicklisp file"
well I do kind of and quicklisp can't seem to find them with "(ql:system-apropos "libffi")" or "(ql:system-apropos "libffi")" also the website(above link) names these dependencies, I think here in this exerpt:
"Requirements
GSLL should work in any Common Lisp implementation and platform combination for which the following are supported:
GSL
CFFI and cffi-grovel, version 0.11.0 or newer; callbacks and foreign-funcall must be supported.
trivial-garbage
Antik
ASDF
Osicat
lisp-unit, (Optional) necessary to run the tests
FSBV, (Optional) necessary for functions using complex scalars or simulated annealing
iterate and asdf-system-connnections, (Optional) provides a convenient way to iterate over elements or indices of vectors or matrices."
of the above I have CFFI CFFI-Grovel,trivial garbage, asdf,iterate ,Antik(all from quicklisp) but still can't figure it out please help me with step by step instructions for Windows 8 64-bit with perfectly functioning Emacs\Slime\SBCL\QuickLisp\Cygwin installed and available...I would appreciate any and all advice..Thank You
Note: now of these - Excerpt from website http://comments.gmane.org/gmane.lisp.gsll/257"
To load "gsll":
Load 3 ASDF systems:
alexandria cl-ppcre split-sequence
Install 20 Quicklisp releases:
antik asdf-system-connections babel bordeaux-threads
cffi chunga cl+ssl cl-base64 drakma flexi-streams fsbv
gsll iterate osicat puri static-vectors
trivial-features trivial-garbage trivial-gray-streams
usocket"
I have all but Osicat. GSLL, and fsbv. When I try to load GSLL with
(ql:quickload "gsll")
I get:
Error while trying to load definition for system gsll from pathname
D:/Users/W/AppData/Roaming/quicklisp/dists/quicklisp/software/gsll-20130312-git/gsll.asd:
Unable to load any of the alternatives:
("libffi-6.dll" "libffi-5.dll" "libffi.dll")
[Condition of type ASDF:LOAD-SYSTEM-DEFINITION ERROR]
When I try to load Osicat with
(ql:quickload "osicat")
I get:
Error while invoking <COMPILE-OP (:VERBOSE NIL) {26FB8F59}> on
<CL-SOURCE-FILE "osicat" "src" "osicat">
[Condition of type ASDF:COMPILE-ERROR]
and quicklisp doesn't have FSBV.....Any Help would be appreciated.
;;;;;;;;;;;;;;;;EDIT;;;;;;;;;;;;;;;;;;;
#Nelson
Made new progress on this one ...I got past the:
"Error while trying to load definition for system gsll from pathname
D:/Users/W/AppData/Roaming/quicklisp/dists/quicklisp/software/gsll-20130312-git/gsll.asd:
Unable to load any of the alternatives:
("libffi-6.dll" "libffi-5.dll" "libffi.dll")
[Condition of type ASDF:LOAD-SYSTEM-DEFINITION ERROR]"
Error Message when I ran (ql:quickload "gsll") in Emacs. I did it by downloading the LIBFFI tarball from here:
http://sourceware.org/libffi/ ..the link at the top of page.
then i followed this tutorial http://phosphor-escence.blogspot.com/2011/08/build-libffi-and-libyaml-on-mingw-for.html
to build LIBFFI with a correctly installed MinGW(installed at C:\MinGW)
I learned to install MinGw correctly here: http://www.mingw.org/wiki/Getting_Started
after building LIBFFI I added its path - D:\libffi-3.0.13 - to my "system" Environment Variables "path" variable:
D: is my root drive.
I searched the D:\libffi-3.0.13 folder in Windows Explorer by putting *.dll in search bar, found libffi-6.dll
and put it in D:\Program Files (x86)\Steel Bank Common Lisp\1.1.4 so SBCL could access it , the libffi-6.dll
was named in the previous error message:
Error while trying to load definition for system gsll from pathname
D:/Users/W/AppData/Roaming/quicklisp/dists/quicklisp/software/gsll-20130312-git/gsll.asd:
Unable to load any of the alternatives:
("libffi-6.dll" "libffi-5.dll" "libffi.dll")
[Condition of type ASDF:LOAD-SYSTEM-DEFINITION ERROR]
Jobs not done though...now I'm getting this Error Message, Which I will start on Tomorrow:
"Error while trying to load definition for system gsll from
pathname
D:/Users/W/AppData/Roaming/quicklisp/dists/quicklisp/software/gsll-20130312-git/gsll.asd:
External process exited with code 1.
Command was: "C:/MinGW/bin/gcc.exe" "-m32" "-I/Program Files (x86)/Steel Bank Common Lisp/1.1.4/site/cffi/" "-o" "D:\Program Files (x86)\Steel Bank Common Lisp\1.1.4\site\cffi\libffi\libffi-win32.exe" "D:\Program Files (x86)\Steel Bank Common Lisp\1.1.4\site\cffi\libffi\libffi-win32.c"
Output was:
[Condition of type ASDF:LOAD-SYSTEM-DEFINITION-ERROR]"
Any help in the meantime would be appreciated:
;;;;;;;;;;SOLVED;;;;;;;;;;
A Tutorial link for it is coming soon and will posted right
under this point<-----here.
Here it is Fellow Lispers..I give you GSLL on Windows 7 AND 8: https://wnetai.wordpress.com/how-to-install-gsll_the-gnu-scientific-library-for-lisp-on-windows-7-and-windows-8/
and here is a link of GSLL Error Mesages and their Solutions: https://wnetai.wordpress.com/how-to-install-gsll_the-gnu-scientific-library-for-lisp-on-windows-7-and-windows-8/error-message-you-may-get-when-installing-gsll-and-their-solutions/
I'm working on a Database of Code Snippets for GSLL starting with Linear Algebra which will be on the same Blog as those upper two links so stay tuned here and on my Lisp Blog for those. Its basically a How to use GSLL Tutorial made with Code Snippets, Descriptions of the Snippets and Examples.
Your problem is that the development version of libffi (with header files) is not installed. There might be windows users on the cffi-devel mailing list that could help you with that; I recommend you post your question there. As far as the lisp libraries are concerned, quicklisp should take care of that and they are irrelevant to your problem. (And also, FSBV is obsolete and not needed; thanks for pointing out that the documentation needs to be updated.) (Also, emacs and slime are irrelevant to the problem, tags should be removed.)
It seems like you need to install those libraries into your system, you'll have to find the windows equivalents.
For debian/ubuntu : http://pkgs.org/download/libffi-dev
These aren't installed through quicklisp but through the system package manager, in your case you will have to find a windows compatible version and install it.
Any luck with getting GSLL to work on Windows 7? I've been trying to install the software and
have even used Dependency Walker to track any missing DLLs that might be needed but still have not been able to get it to run. I do have it running fine on Linux but I am looking to have it running under Window 7.

Is SVCUTIL.exe broken or is it the supplier's WSDL?

I am trying to use SVCUTIL from the SDK to generate the common types in several web services. When I try to generate code I get the errors (shown at the bottom)- these suggest the WSDL is broken. However, if I import the service in ServiceReferences Visual Studio does not complain. Is SVCUTIL broken?
The WSDLs are public and are:
http://test.wlr3.net/empws/services/WLR3AssuranceServices?wsdl
http://test.wlr3.net/empws/services/WLR3BillingServices?wsdl
http://test.wlr3.net/empws/services/WLR3DialogueServices?wsdl
http://test.wlr3.net/empws/services/WLR3FulfillmentServices?wsdl
http://test.wlr3.net/empws/services/WLR3InventoryServices?wsdl
http://test.wlr3.net/empws/services/WLR3InventoryOrderServices?wsdl
http://test.wlr3.net/empws/services/WLR3InventoryTroubleReportServices?wsdl
http://test.wlr3.net/empws/services/WLR3InventoryWorkItemServices?wsdl
http://test.wlr3.net/empws/services/WLR3IssueServices?wsdl
http://test.wlr3.net/empws/services/WLR3ReportingServices?wsdl
http://test.wlr3.net/empws/services/WLR3SecurityServices?wsdl
If you check these out you'll see a lot of common types and several namespaces. I've tried sending these to SVCUTIL to generate the code but it doesn't like the FulfillmentServices and the InventoryServices ones:
Error: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.XmlSerializerMessageContractImporter
Error: Cannot import invalid schemas. Compilation on the XmlSchemaSet failed.
XPath to Error Source: //wsdl:definitions[#targetNamespace='http://imperatives.co.uk/V20']/wsdl:portType[#name='WLR3FulfilmentServices']
Error: Cannot import wsdl:binding
Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on.
XPath to wsdl:portType: //wsdl:definitions[#targetNamespace='http://imperatives.co.uk/V20']/wsdl:portType[#name='WLR3FulfilmentServices']
XPath to Error Source: //wsdl:definitions[#targetNamespace='http://imperatives.co.uk/V20']/wsdl:binding[#name='WLR3FulfillmentServicesHttpBinding']
Error: Cannot import wsdl:port
Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on.
XPath to wsdl:binding: //wsdl:definitions[#targetNamespace='http://imperatives.co.uk/V20']/wsdl:binding[#name='WLR3FulfillmentServicesHttpBinding']
XPath to Error Source: //wsdl:definitions[#targetNamespace='http://imperatives.co.uk/V20']/wsdl:service[#name='WLR3FulfillmentServices']/wsdl:port[#name='WLR3FulfillmentServicesHttpPort']
As per comments to the question, there is a small difference in the two problem WSDLs. I compared these with older versions and found there is a type in these based on a virtual base type called "Dto".
This is applied to only two types - one in the Fulfillment Services and one in the Inventory Services, and these are also found in other WSDLs but without the base - the WSDL files are not consistent.
So I can exponerate SVCUTIL here and give the supplier a kick..
Thanks to John Saunders for looking at it

Resources