Cannot invoke Parse method of System.Version - powershell-2.0

In a PowerShell script, when I try to parse [System.Version]::Parse("1.2.3.4")
I get this error:
Method invocation failed because [System.Version] doesn't contain a method named 'Parse'
I have PowerShell 2.0 and NET Framework 4.0.

Related

I am unable to use `ejabberd_auth` in my **helloworld** project

I am unable to use ejabberd_auth in my helloworld project.
-behaviour(ejabberd_auth).
...
....
try_register(<<"username">>, <<"example.com">>, <<"secret_password">>).
With that I get the error warning:
helloworld.erl:15: Warning: behaviour ejabberd_auth undefined
-import(ejabberd_auth, [try_register/3]).
...
....
try_register(<<"username">>, <<"example.com">>, <<"secret_password">>).
With this I get:
exception error: undefined function ejabberd_auth:try_register/3
Why am I unable to access ejabberd_auth?
I am using IntelliJ Idea, with the Erlang plugin installed.
Thank you all in advance.
UPDATE:
I'm on Ubuntu 16.04 LTS
I can get you past that error. Here's how...
When I compile a module in the erlang shell, the compiler creates a .beam file in the same directory, which allows me to call functions defined in the module. In your case, if you cd into the directory:
.../ejabberd/ebin
you will see all the ejabberd .beam files, including ejabberd_auth.beam. If you start an erlang shell in that directory, then issue your function call (don't compile anything), you won't get that error anymore.
But, then I get the error:
exception error: undefined function jid:nodeprep/1
in function ejabberd_auth:validate_credentials/3 (src/ejabberd_auth.erl, line 796)
in call from ejabberd_auth:try_register/3 (src/ejabberd_auth.erl, line`
There is no jid.beam file in that directory. But:
~/Downloads/ejabberd$ find . -name jid.beam
./deps/xmpp/ebin/jid.beam
You are going to have to figure out how to compile your module so that all the ejabberd modules are available to your program. See: ejabberd how to compile new module.
I am unable to use ejabberd_auth in my helloworld project.
Are you following a tutorial somewhere?

Recompiling src file from cowboy prompt gives undefined function compile

I have my server running with
make run
Then I edited a file. Back in the cowboy terminal I type
(tunnel#127.0.0.1)2> c(clock).
Recompiling /root/tunnel/src/clock.erl
** exception error: undefined function compile:file/2
in function c:compile_and_load/2 (c.erl, line 259)
in call from c:safe_recompile/3 (c.erl, line 235)
(tunnel#127.0.0.1)3> compile(clock).
it seems that the shell recognizes the compile shortcut but it lists it as undefined.
How do I recompile while the server is running?
I also tried erlc src/clock.erl, which gave me a warning using export all but didn't respond with any error.

Can't build OpenCV 3.1 on Windows (using MinGW)

I need to build OpenCV from source, because I want to make modifications to it. So using pre-built binaries is not an option for me. I'm doing this on Windows 8. I do not have MS Visual Studio, and I don't want to use it.
Here is how I reproduce the build error:
I git clone https://github.com/opencv/opencv
I use CMake 3.7.1, press Configure, then press Generate. It seems to work (no errors). I named the output folder opencv/release.
I go to the opencv/release folder, and type mingw32-make.
Eventually, after compiling for a while, it displays the following error message:
Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/parallel.cpp.obj
modules\core\src\parallel.cpp:135:43: error: operator '&&' has no right operand
modules\core\src\parallel.cpp: In function 'void cv::parallel_for_(const cv::Range&, const cv::ParallelLoopBody&, double)':
modules\core\src\parallel.cpp:311:52: error: 'parallel_for_pthreads' was not declared in this scope parallel_for_pthreads(range, body, nstripes);
^
modules\core\src\parallel.cpp: In function 'int cv::getNumThreads()':
modules\core\src\parallel.cpp:370:50: error: 'parallel_pthreads_get_threads_num' was not declared in this scope return parallel_pthreads_get_threads_num();
^
modules\core\src\parallel.cpp: In function 'void cv::setNumThreads(int)':
modules\core\src\parallel.cpp:431:46: error: 'parallel_pthreads_set_threads_num' was not declared in this scope parallel_pthreads_set_threads_num(threads);
^
modules\core\CMakeFiles\opencv_core.dir\build.make:990: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/src/parallel.cpp.obj' failed mingw32-make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/parallel.cpp.obj] Error 1
Note: I tried to compile both with and without TPP (in the CMake config), and I get the same error message.
Also, I read the other similar questions on StackOverflow and the answers do not help.

Dart - error running rpc generate client

I am trying to follow the "Beware the Nest o’ Pirates" tutorial
https://www.dartlang.org/codelabs/server/ and have hit a problem when I try to generate the client code for the PiratesApi
When I run the command
pub global run rpc:generate client -i lib/server/piratesapi.dart -o
lib/client
I get the following error message
Failed executing command 'discoveryWithImports' with error:
No constructor 'ApiParser' with matching arguments declared in class
'ApiParser'.
NoSuchMethodError: incorrect number of arguments passed to method
named 'ApiParser'
Receiver: Type: class 'ApiParser'
Tried calling: ApiParser(strict: true)
Found: ApiParser()
What does that error message mean?
Try activating the rpc package with a version constraint:
pub global activate rpc 0.4.1
https://www.dartlang.org/tools/pub/cmd/pub-global.html

Grails Plugin Uploadr doesn't run

I'm trying to use uploadr but I cannot put it to work... Even the Uploadr-demo does not run.
So, it's what I have tried so far:
Using Grails 2.4.2 and adding the plugin in a existing project:
I get this error when I run the project:
| Error 2014-07-16 16:00:54,667 [localhost-startStop-1] ERROR resource.ResourceMeta - Resource not found: /assets/jquery.tipTip.minified.js
| Error 2014-07-16 16:00:54,697 [localhost-startStop-1] ERROR resource.ResourceMeta - Resource not found: /assets/tipTip.css
| Error 2014-07-16 16:00:54,727 [localhost-startStop-1] ERROR resource.ResourceMeta - Resource not found: /assets/jquery.uploadr.js
| Error 2014-07-16 16:00:54,754 [localhost-startStop-1] ERROR resource.ResourceMeta - Resource not found: /assets/jquery.uploadr.css
However the server starts, but when I try to open the page using uploadr I get this error:
Error 500: Internal Server Error
[...]
Class: java.lang.IllegalArgumentException
Message: Module [tipTip] depends on resource [/assets/jquery.tipTip.minified.js] but the file cannot be found
The page I'm trying to open is just to call the uploadr demo:
<head>
<g:javascript library='jquery' />
<r:require modules="uploadr"/>
<r:layoutResources/>
</head>
<body>
<uploadr:demo/>
<r:layoutResources/>
</body>
The BuildConfig:
plugins {
// plugins for the build system only
build ":tomcat:7.0.54"
// plugins for the compile step
compile ":scaffolding:2.1.2"
compile ':cache:1.1.7'
compile ":asset-pipeline:1.8.11"
//uploadr
runtime ":resources:latest.integration"
compile ":modernizr:latest.integration"
compile ":uploadr:latest.integration"
compile ":quartz:latest.integration" //1.0.1"
// plugins needed at runtime but not for compilation
runtime ":hibernate4:4.3.5.4" // or ":hibernate:3.6.10.16"
runtime ":database-migration:1.4.0"
runtime ":jquery:1.11.1"
}
As it didn't work I tried to download the Uploadr-demo from github.
First it I couldn't import (I'm using Spring Tool Suite v.:3.5.1.RELEASE) because the demo is to grails 2.3.3. Fine, I got grails 2.3.3, and again it didn't work. This time a new error:
Loading Grails 2.3.3
|Environment set to development
........
|Compiling 10 source files
..
|Compiling 154 source files
.Error
|
Compilation error: startup failed:
/home/ainsoph/workspace-sts-3.5.1.RELEASE/grails-uploadr-demo/target/work/plugins/uploadr-0.8.2/grails-app/controllers/hungry/wombat/UploadController.groovy: -1: Repetitive method name/signature for method 'java.lang.Object withFormat(groovy.lang.Closure)' in class 'hungry.wombat.UploadController'.
# line -1, column -1.
/home/ainsoph/workspace-sts-3.5.1.RELEASE/grails-uploadr-demo/target/work/plugins/uploadr-0.8.2/grails-app/controllers/hungry/wombat/UploadController.groovy: -1: Repetitive method name/signature for method 'java.lang.Object withFormat(groovy.lang.Closure)' in class 'hungry.wombat.UploadController'.
# line -1, column -1.
/home/ainsoph/workspace-sts-3.5.1.RELEASE/grails-uploadr-demo/target/work/plugins/database-migration-1.3.8/grails-app/controllers/grails/plugin/databasemigration/DbdocController.groovy: -1: Repetitive method name/signature for method 'java.lang.Object withFormat(groovy.lang.Closure)' in class 'grails.plugin.databasemigration.DbdocController'.
# line -1, column -1.
/home/ainsoph/workspace-sts-3.5.1.RELEASE/grails-uploadr-demo/target/work/plugins/database-migration-1.3.8/grails-app/controllers/grails/plugin/databasemigration/DbdocController.groovy: -1: Repetitive method name/signature for method 'java.lang.Object withFormat(groovy.lang.Closure)' in class 'grails.plugin.databasemigration.DbdocController'.
# line -1, column -1.
4 errors
I also tried to create a new project with grails 2.3.3, but it doesn't even compile:
Command terminated with an exception: java.lang.Exception (see details for partial output)
Command: GrailsCommand(P/grails-uploadr> compile --non-interactive --refresh-dependencies)
---- System.out ----
Loading Grails 2.3.3
.
|Environment set to development
..........
|Compiling 79 source files
.Error
|
Compilation error: startup failed:
/home/ainsoph/workspace-sts-3.5.1.RELEASE/grails-uploadr/target/work/plugins/database-migration-1.3.8/grails-app/controllers/grails/plugin/databasemigration/DbdocController.groovy: -1: Repetitive method name/signature for method 'java.lang.Object withFormat(groovy.lang.Closure)' in class 'grails.plugin.databasemigration.DbdocController'.
# line -1, column -1.
/home/ainsoph/workspace-sts-3.5.1.RELEASE/grails-uploadr/target/work/plugins/database-migration-1.3.8/grails-app/controllers/grails/plugin/databasemigration/DbdocController.groovy: -1: Repetitive method name/signature for method 'java.lang.Object withFormat(groovy.lang.Closure)' in class 'grails.plugin.databasemigration.DbdocController'.
# line -1, column -1.
2 errors
When I tried to create a new project with grails 2.3.3 I first changed the $GRAILS_HOME to point to 2.3.3 and I called spring from a terminal that had its path updated
Well I tried everything that I could think or find on Google... Any ideas?
I managed a work around, it's running, but still with errors...
I installed Grails 2.3.3 and Oracle jdk1.7.0_65. Using both I can create a new project where uploadr works, and I also can run the uploadr-demo, but both with the errors below:
Groovy: compiler mismatch Project level is: 2.1 Workspace level is 2.3
Groovy compiler level expected by the project does not match workspace compiler level.
Go to Project properties -> Groovy compiler to set the Groovy compiler level for this project uploadr-Grails2.3.3-JDK7 uploadr-Grails2.3.3-JDK7 Groovy compiler mismatch problem
The resource is a duplicate of .link_to_grails_plugins/hibernate-3.6.10.4/grails-app/i18n/messages.properties and was not copied to the output folder messages.properties /uploadr-Grails2.3.3-JDK7/.link_to_grails_plugins/resources-1.2.1/grails-app/i18n Unknown Java Problem
Groovy:Repetitive method name/signature for method 'java.lang.Object withFormat(groovy.lang.Closure)' in class 'br.eti.andersonq.UploadrController'. UploadrController.groovy /uploadr-Grails2.3.3-JDK7/grails-app/controllers/br/eti/andersonq line 1 Java Problem
Groovy:Repetitive method name/signature for method 'java.lang.Object withFormat(groovy.lang.Closure)' in class 'br.eti.andersonq.UploadrController'. UploadrController.groovy /uploadr-Grails2.3.3-JDK7/grails-app/controllers/br/eti/andersonq line 1 Java Problem
The resource is a duplicate of .link_to_grails_plugins/resources-1.2.9-SNAPSHOT/grails-app/i18n/messages.properties and was not copied to the output folder messages.properties /Blogito/.link_to_grails_plugins/uploadr-0.8.2/grails-app/i18n Unknown Java Problem
Groovy:Repetitive method name/signature for method 'java.lang.Object withFormat(groovy.lang.Closure)' in class 'grails.plugin.databasemigration.DbdocController'. DbdocController.groovy /uploadr-Grails2.3.3-JDK7/.link_to_grails_plugins/database-migration-1.3.8/grails-app/controllers/grails/plugin/databasemigration line 1 Java Problem
Groovy:Repetitive method name/signature for method 'java.lang.Object withFormat(groovy.lang.Closure)' in class 'grails.plugin.databasemigration.DbdocController'. DbdocController.groovy /uploadr-Grails2.3.3-JDK7/.link_to_grails_plugins/database-migration-1.3.8/grails-app/controllers/grails/plugin/databasemigration line 1 Java Problem
Finally I found out a solution to everything \o/
uploadr doesn't seem to work with any grails version newer then 2.3.3
The errors 'Groovy:Repetitive method name/signature' are due a incompatibility between grails 2.3.3 and JDK8. However to solve properly it is necessary to also change the STS.ini from spring to use JDK7. Because even though I had changed all my system and preferences inside spring to use JDK7 it wasn't enough.
STS.ini is located at:
springsource/sts-3.5.1.RELEASE/STS.ini
and add/change:
-vm
/path/to/your/jdk/installation
to me it was:
-vm
/usr/lib/jvm/jdk1.7.0_65/bin/java

Resources