premake5: Cannot get the "Hello World" example to generate a Visual Studio solution - premake

I am trying to generate a solution file for the premake5 out of the wiki example.
https://github.com/premake/premake-core/wiki/Your-First-Script
Calling premake5 vs2012 produces the following error -
Error: premake5.lua:2: attempt to call global 'workspace' (a nil value)
Does anyone know how to fix that? It looks like premake5 does not recognize the workspace() function. I followed the installation instructions and assume that I downloaded and unpacked the console utility correctly.

Sounds like you are running an older version of the code. The workspace() call was just introduced and will appear in the next alpha release, which should come out sometime next week. In the meantime, just use solution() instead; your code will still work when the new alpha arrives.

Related

Julia - how to update WinRPM in julia version 0.6.4

I'm new to Julia and I want to use COBRA Package.
For adding COBRA I use command :
Pkg.add("COBRA")
But when running, I get these errors:
INFO: Building WinRPM
WARNING: skipping repodata/repomd.xml, not in cache -- call WinRPM.update() to download
WARNING: skipping repodata/repomd.xml, not in cache -- call WinRPM.update() to download
INFO: Downloading https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml
WARNING: Unknown download failure, error code: 2148270086
WARNING: Retry 1/5 downloading: https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml
until:
WARNING: Unknown download failure, error code: 2148270086
WARNING: Retry 5/5 downloading: https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml
WARNING: received error 0 while downloading
https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml
After these errors, I have checked the link and I've found out the source is not there, anymore.
So then I ran this command as said above:
WinRPM.update()
But it has thrown this error:
ERROR: UndefVarError: WinRPM not defined
Please Help me to add COBRA to Julia. I'm using version 0.6.4 because Cobra does not work on the next versions.(Windows 10)
Any help would be appreciated.
The problem, as you've mentioned, is that the original sources used by the package aren't valid URLs anymore. The proper way to solve this is to open a pull request with the package to change the URLs (which I've now done here ). As a stopgap measure, here's a hacky way to work around this issue for now:
Do a Pkg.add("WinRPM"). This might trigger the same warnings as above, ignore these.
Next, using WinRPM to load the package we added
Now, the source URLs are read from the sources.list file (linked above) into a global WinRPM.sources variable. We're going to edit this variable's contents to point to new working URLs. (This is generally a terrible idea, to directly poke into the internals of a module and change things.)
julia> WinRPM.sources[:] = replace.(WinRPM.sources, "Leap_42.3" => "Leap_15.3")
2-element Vector{String}:
"https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_15.3"
"https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Leap_15.3"
A WinRPM.update() should now work, and download things into a local cache.
I'm using version 0.6.4 because Cobra does not work on the next versions.
I hope you mean Julia 1.6.4 here, or version 0.6.4 of something else in the stack. If you mean Julia version 0.6.4, you might face further problems down the road and find it hard to get support for such an old version.

command line compiling generates bigger file than the online version

I am testing google closure compiler on command line.
I took the latest version :
java -jar closure-compiler.jar --version
Closure Compiler (http://github.com/google/closure-compiler)
Version: v20190618
Built on: 2019-06-21 17:24
I am generating a compressed version of my javascript like this :
java -jar closure-compiler.jar my_script.js > out.js
The problem is that the generated code is bigger than the one I get when I use the online service at https://closure-compiler.appspot.com/home
I noticed that the command line version added, at the beginning, the following code :
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,c,b){a instanceof String&&(a=String(a));for(var d=a.length,e=0;e<d;e++){var f=a[e];if(c.call(b,f,e,a))return{i:e,v:f}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,c,b){a!=Array.prototype&&a!=Object.prototype&&(a[c]=b.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.polyfill=function(a,c,b,d){if(c){b=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];e in b||(b[e]={});b=b[e]}a=a[a.length-1];d=b[a];c=c(d);c!=d&&null!=c&&$jscomp.defineProperty(b,a,{configurable:!0,writable:!0,value:c})}};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,b){return $jscomp.findInternal(this,a,b).v}},"es6","es3");
I do not have such a code in my script: Where does it come from ?
how can I produce the same output as the online version ?
To get the compiler command line work as the web service, I just added an option :
--language_out=ECMASCRIPT_2015
This is likely a discrepancy between the settings on the web service and the ones you're using locally.
Have a look at a Closure Compiler: Flags and Options to see what settings you might prefer.
If you'd share your source, it'd be possible to try and help you narrow down the options.
As for the extra code, I believe it is at least partially a polyfill for Array.prototype.find (aka [].find), which I assume is in your code?
If so, that's Closure injecting code to improve your cross browser compatibility.

RedundantNameQualifier error when Running Resharper CLI inspect tool

I'm using Resharper inspect CLI tool for static code analysis(JetBrains.ReSharper.CommandLineTools.2018.3.1\InspectCode.exe) on a dotnet core 2.1 console application I've created. Within the solution, there is a separate project which is just a package used in the console app.
Layout is as follows:
When I run the inspectCode.exe as follows:
JetBrains.ReSharper.CommandLineTools.2018.3.1\InspectCode.exe "AI.DL.Backup\AI.DL.Backup.csproj" /o:"CodeInspection_20222.xml" /profile:"AI.DL.Backup.sln.DotSettings"
I get the following issue:
Output xml report has the following:
<IssueType WikiUrl="https://www.jetbrains.com/resharperplatform/help?Keyword=RedundantNameQualifier" Severity="WARNING" Description="Redundant name qualifier" CategoryId="CodeRedundancy" Category="Redundancies in Code" Id="RedundantNameQualifier"/>
<Issue Message="Qualifier is redundant" Line="5" Offset="146-154" File="AI.DL.Backup\src\AI.DL.Backup\Startup.cs" TypeId="RedundantNameQualifier"/>
The problem seems to be that it cannot find the dll project referenced and is throwing code analysis error (code HAS been built already, so bin/obj folders exist with relevant dlls/packages required).
Ling 5 (as specified) is just the using statement for the separate package, which it cannot resolve and is deeming to be redundant.
using AI.DL.DocumentManagement;
using AI.DL.DocumentManagement.Stores;
Going by the generated XML report, I can see that it can't find the namespace within the separate package. Why would this be? Anyone seen this before?
I was able to work around this issue when I repointed the "inspect.exe" to my solution file instead of individual project!

tryCatch error: the action can´t be completed because the folder is open in RStudio R session

When I download files (Windows 7) using
tryCatch(download.file(paste0(url_bv,arq), paste0(dir_bv,arq))
,error=function(cond) message(paste('erro:',arq,'não encontrado'))
,warning=function(cond) message(paste('warning:',arq,'não encontrado')))
I can´t delete files, getting the msg in the question title.
If I just do
download.file(paste0(url_bv,arq), paste0(dir_bv,arq))
there is no problem.
How can I release the folder/file in R?
I think this is likely a bug in R (windows version). I can faithfully reproduce it in R-3.2.5 (win10_64). I suggest you file a bug report (read R FAQ 9.2 for clear direction).
I tried it with several variations:
different url schemes ("http://" and "https://")
different download.file(..., method=...) options ("wininet", "internal", and "auto" all behaved in this manner; "libcurl" did not, but it merely downloaded the 404.html without telling me there was a problem)
triggers whenever warning=... or condition=... clauses are given to tryCatch and something weird happens in expr
does not trigger with error=... or finally=... arguments
32bit and 64bit variants
not in RStudio
as R --vanilla
All attempted on ubuntu-14.04 (R-3.2.3-64bit) as well, it would not trigger.

Neo4j spatial server plugin fails on withinDistance and closest java.lang.NoClassDefFoundError

I know that the plugin is being loaded properly, as other methods work such as spatial.procedures and spatial.addNode etc.
The error results after a call like this:
CALL spatial.withinDistance('profile_geo', [43.524, 96.7341], 500)
and the error that results is this:
Failed to invoke procedure `spatial.withinDistance`: Caused by: java.lang.NoClassDefFoundError: org/neo4j/cypher/internal/compiler/v3_0/commands/expressions/GeographicPoint
The same error appears when trying to use the closest function as well. Any help would be appreciated.
It looks that you are missing required Jar for GeographicalPoint class.
Please make sure you have this class in your Jars. I know this class exists in neo4j-cypher-compiler-3.0-3.0.3.jar but it is not going to work for you as it is residing in different namespace. If you will not be able to pinpoint the corresponding Jar in your environment please have a look at Maven repository and try to find it there.
short answer: upgrade to 3.0.3 (both neo4j and plugin)
long answer:
I ran into the exact same issue today. I was running version 3.0.2 with server plugin version 3.0.2 and ran the cypher query:
CALL spatial.withinDistance("spatial_records",{lon:20.0,lat:50.0},100000000)
Joran mentioned in the comments above that the REST API was a working alternative. So I tried that out and found he was indeed correct.
I tested this using httpie, with the following command:
cat tmp.json | http :7474/db/data/ext/SpatialPlugin/graphdb/findGeometriesWithinDistance
where tmp.json looks like:
{"layer" : "spatial_records","pointX" :3.9706,"pointY" : 46.7907,"distanceInKm" :10000000000}
While this works, using CYPHER with stored procedures would be nice. So upon further investigation, I noticed that a recent commit contained the following changes:
- <neo4j.version>3.0.1</neo4j.version>
+ <neo4j.version>3.0.3</neo4j.version>
...
-import org.neo4j.cypher.internal.compiler.v3_0.commands.expressions.GeographicPoint;
+import org.neo4j.cypher.internal.compiler.v3_0.GeographicPoint;
So I ended up downloading version 3.0.3 of both neo4j and the spatial plugin. Whatever the issue was before, seems to be fixed in this version. The call to the stored procedure now works as expected!

Resources