Unable to Install Facebook Duckling on Windows - Stack Exec Fails - windows

I'm trying to setup Facebook Duckling on Windows 10.
When I execute: stack exec duckling-example-exe it produces the following error:
duckling-example-exe.EXE: /etc/zoneinfo/: getDirectoryContents:findFirstFile: does not exist (The system cannot find the path specified.)
I don't understand why I'm getting this error since I followed the recommendation on this GitHub thread which suggests replacing "/usr/share/zoneinfo/" in Duckling/exe/ExampleMain.hs with a link to a folder containing the zoneinfo files. You can see I replaced the path as suggested in the screenshot below:
I also tried adding a double slash as seen below - but it didn't help:
I tried with forward slash instead but this didn't help either:
Moreover, I don't understand where the path: /etc/zoneinfo/ is coming from, if the path is no longer present in ExampleMain.hs? Where is the compiler pulling the path from?
Thanks!

You need to run stack exec duckling-example-exe in the directory where the stack.yaml and project.yaml files of the duckling source code is that you are trying to modify. Otherwise it will use the version of duckling from stackage without your changes.

Related

go-swagger restapi/configure_todo_list.go - api.TodoGetHandler undefined error

I am a newbie in go and go-swagger. I am following steps in Simple Server tutorial in goswagger.io.
I am using Ubuntu 18.04, swagger v0.25.0 and go 1.15.6.
Following the same steps, there are a few differences of the files generated. For instance, goswagger.io's has find_todos_okbody.go and get_okbody.go in models but mine does not. Why is that so?
Link to screenshot of my generated files vs
Link to screenshot of generated files by swagger.io
Starting the server as written in the tutorial go install ./cmd/todo-list-server/ gives me the following error. Can anyone please help with this?
# my_folder/swagger-todo-list/restapi
restapi/configure_todo_list.go:41:8: api.TodosGetHandler undefined (type *operations.TodoListAPI has no field or method TodosGetHandler)
restapi/configure_todo_list.go:42:6: api.TodosGetHandler undefined (type *operations.TodoListAPI has no field or method TodosGetHandler)
The first step in goswagger.io todo-list is swagger init spec .... Which directory should I run this command in? I ran it in a newly created folder in my home directory. However, from the page, it shows the path to be ~/go/src/github.com/go-swagger/go-swagger/examples/tutorials/todo-list. I am not sure whether I should use go get ..., git clone ... or create those folders. Can someone advise me?
Thanks.
This is likely the documentation lagging behind the version of the code that you are running. As long as it compiles, the specific files the tool generates isn't so crucial.
This is a compilation error. When you do go install foo it will try to build the foo package as an executable and then move that to your GOPATH/bin directory. It seems that the generated code in restapi/configure_todo_list.go isn't correct for the operations code generated.
All you need to run this tutorial yourself is an empty directory and the swagger tool (not its source code). You run the commands from the root of this empty project. In order not to run into GOPATH problems I would initialise a module with go mod init todo-list-example before doing anything else.
Note that while the todo-list example code exists inside the go-swagger source, it's there just for documenting example usage and output.
What I would advice for #2 is to make sure you're using a properly released version of go-swagger, rather than installing from the latest commit (which happens when you just do a go get), as I have found that to be occasionally unstable.
Next, re-generate the entire server, but make sure you also regenerate restapi/configure_todo_list.go by passing --regenerate-configureapi to your swagger generate call. This file isn't always refreshed because you're meant to modify it to configure your app, and if you changed versions of the tool it may be different and incompatible.
If after that you still get the compilation error, it may be worth submitting a bug report at https://github.com/go-swagger/go-swagger/issues.
Thanks #EzequielMuns. The errors in #2 went away after I ran go get - u -f ./... as stated in
...
For this generation to compile you need to have some packages in your GOPATH:
* github.com/go-openapi/runtime
* github.com/jessevdk/go-flags
You can get these now with: go get -u -f ./...
I think it's an error of swagger code generation. You can do as folloing to fix this:
delete file configure_todo_list.go;
regenerate code.
# swagger generate server -A todo-list -f ./swagger.yml
Then, you can run command go install ./cmd/todo-list-server/, it will succeed.

Vim Vundle installation on windows: unknown function vundle#begin

I am a beginner with Vim and I am trying to install Vundle for plugin management. However I keep getting the same error when I open gVim:
Error detected while processing C:\Users\jacob\Vim\_vimrc:
line 5:
E117: Unknown function: vundle#begin
line 7:
E492: Not an editor command: Plugin 'VundleVim/Vundle.vim'
line 9:
E117: Unknown function: vundle#end
I am working on windows 10 and this is how my _vimrc file looks like:
set nocompatible
filetype off
set rtp+=$HOME/.vim/bundle/Vundle.vim/
call vundle#begin('$HOME/.vim/bundle/')
Plugin 'VundleVim/Vundle.vim'
call vundle#end() " required
filetype plugin indent on " required
Perhaps a bit on the late side, but I also received the same error.
After diagnosing what has happened I came to the following problem and solution:
The problem is that using GIT to clone the files, this downloades the Vundle directory to the filepath: ~/vimfiles/bundle/Vundle.vim to the Windows home directory. the final filepath on Windows would then look like: C:\Users\User1~\vimfiles\bundle\Vundle.vim . However the _vimrc files is located under the directory C:\Users\User1\
The sollution is to copy the folder "vimfiles" to the user1 directory (exchange user1 for your own username). The final filepath for the Vundle files should then be C:\Users\User1\vimfiles\bundle\Vundle.vim .
Looks like you missed some steps of the installation, that would clone the Vundle git repository under the $HOME/.vim/bundle directory, creating a Vundle.vim subdirectory there which would have an autoload/vundle.vim which is where functions such as vundle#begin would be searched.
See the Quick Start guide for further instructions. In particular for your case, there's also a link to a quite detailed Windows setup document with many details on how to get the components you need to install Vundle.
You might also want to consider vim-plug as an alternative to Vundle. It's newer and actively maintained, while at the same time using a similar model to Vundle, supporting a similar set of commands and using similar configuration directives. It's also much easier to install, also on Windows. (It only needs a single file to be downloaded.)

scald.rb results in error (could not find or load main class)

I am trying to run the tutorial files from https://github.com/twitter/scalding/tree/develop/tutorial.
I cloned the 0.17.x branch and current develop branch and haven't had much success with either.
I have also already ran "sbt update" and "sbt assembly" to create the fat jar which is used by this scald.rb script.
Upon running the command below from the root scalding directory
scripts/scald.rb --local tutorial/Tutorial0.scala
I receive either of these errors:
Error: Could not find or load main class Files
[SUGGESTION]: Try scald.rb --clean, you may have corrupt jars lying around
or
Error: Could not find or load main class scala.tools.nsc.Main
[SUGGESTION]: Try scald.rb --clean, you may have corrupt jars lying around
Whatever I try to do I cannot get the scald.rb script to work. I have tried the clean option and many other stackoverflow answers such as setting scala_home in my environment variables and path to scala/bin. Many versions of sbt/scala and nothing works.
Current Software:
-Ruby 2.4.2-2-x86
-sbt 0.13.15
-Scala 2.11.8
-scalding 0.17.x branch

Open HTML in chrome from command line using app flag

(Before downvote im aware how to do this using code thats inline to this command but not how to do it using a file that uses the --app="data:text/html,<sometags></sometags>)
How would I open a local html (mar.html) file using this command
C:\'Program Files (x86)'\Google\Chrome\Application\chrome.exe --profile-directory="Default" --app=
Specifically, the issue is my lack of familiarity with the --app flag
I tried
C:\'Program Files (x86)'\Google\Chrome\Application\chrome.exe --profile-directory="Default" --app="mar.html"
C:\'Program Files (x86)'\Google\Chrome\Application\chrome.exe --profile-directory="Default" --app="file:///mar.html"
Both don't work.
Giving me the error
Your file was not found
It may have been moved or deleted.
ERR_FILE_NOT_FOUND
You almost got it. The file descriptor path must be absolute and encoded.
Encoding the path correctly with cli tools like "urlencode"(gridsite-clients) did not work for me.
If you have NodeJS installed and would use a linux machine, you could use this command.
chromium --app=`node -e "console.log('file://'+encodeURI(process.argv[1]))" "$(realpath "/path/of/your/file.html")"`
This works also fine with relative paths.
For windows you have to rewrite this yourself.

appledoc Exception: at least one directory

After wasting some time to figure out what goes wrong, I finally have to ask for help. I want to use appledocs from Gentle Bytes. I followed every step of the quick install guide, but I´m not able to compile the project.
Here is what I´ve done:
1. cloned it from git://github.com/tomaz/appledoc.git
2. installed the templates to ~/Library/Application Support/appledoc
3. tried to compile the project
Everytime I try to compile, I get following error:
ERROR: AppledocException: At least one directory or file name path is required, use 'appledoc --help'
What do I have to do now?
Sounds like you've compiled it just fine and are now running the program. If it's a command-line program try command-option-R in Xcode to provide some arguments (i.e. names of files that you want to process).
The error means you didn't give it source paths: after all switches, you must give it at least one path to your source files. Can be either file or directory. In later case it will recursively scan the dir. Here's example
appledoc <options> ~/MyProject
Above example will use ~/MyProject directory as a source. You can also add multiple source paths. Note that you need to give the tool few options, see this page for minimum command line and other usage examples.
You either have to copy appledoc executable to one of directories in your path, as suggested by Caleb, or use full path to it when invoking (for example: /path/to/appledoc)

Resources