Undefined package in Ada - ada

I am really confused when the GNAT keeps telling me that I have an undefined error when I try to import a package.
This is the where the error occurs in the source code:
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
procedure WordCount is
package ASU renames Ada.Strings.Unbounded;
use ASU;
package StringStack is new ProtectedStack(100, ASU.Unbounded_String);
It keeps telling me that the ProtectedStack is undefined.
Since the ProtectedStack is provided, so I have to assume that this error is caused by mine...
I just start to work with Ada. Could anyone please tell me how to solve this problem?

You probably need to add with ProtectedStack;.

Related

Path issues with Ada and GNATStudio

I have the following code:
with Util.Serialise;
package body blah is
Reader : Util.Serialize.IO.JSON.Parser;
Mapper : Util.Serialize.Mappers.Processing;
end blah;
So the line where Reader is defined is fine with the compiler, however on the following I get the error Mappers not declared in Serialize.
Both packages are part of the Ada-Util installation, and in fact are in the same directory.
Is this a path issue? Have I used things wrongly? What's going on here?
You need to with Util.Serialize.Mappers; as well, if it's a child package.
You should also need a with Util.Serialize.IO.JSON;, don't know why you didn't get an error there
Probably Reader is considered as correct, because it is hidden by Mapper error.
Generally, in Ada you have to give the full package name if you want to have a package visible. Thus, your first two lines should be:
with Util.Serialize.IO.JSON;
with Util.Serialize.Mappers;
not just
with Util.Serialise;
In that situation, you enable package Utils.Serialize, not the two which you want.

kerasR giving error

I am trying to use kerasR for deep learning in R. I am trying to reproduce the examples in the package. Trying the following code produces error:
library(kerasR)
mod <- Sequential()
The error is:
Error in Sequential() : attempt to apply non-function
I'd suggest to look at this issue in KerasR Github repo:
https://github.com/statsmaths/kerasR/issues/1
Basically you should check where is located your version of python and then use reticulate::use_python("PATH_TO_PYTHON") to tell the system where to find Python.
Watch Out!
You can load just one Python interpreter per session and the use_python() function doesn't warn you if there already is a loaded interpreter.
Moreover if you run py_config() it automatically loads the first interpreter that he finds (which, in your case, seems to be the wrong one!), thus you'd better call reticulate::use_python("PATH_TO_PYTHON") before anything else.

NameError: name 'Pkg' is not defined

In the IJulia Notebook I'm trying to add the packages, but I'm getting the error:
NameError: name 'Pkg' is not defined
Python was wrongly selected instead of Julia in Jupyter:
Here's what happens in Julia:
And here's what happens in Python:
For me I had a very similar error, and apparently you have to define Pkg if you're installing this for the first time. Just enter
using Pkg
It looks like in your case the issue was you were using python but this is a fix for another case where you get this exact same error.

ArgParse #add_arg_table not recognized in Julia

I'm using Julia v0.3.9 right now. I recently updated all my packages (I haven't opened Julia in a couple months), including ArgParse. The macro #add_arg_table isn't recognized though. In particular, I tried running example code here, but I get the following error:
ERROR: #add_arg_table not defined
in include at /Applications/Julia-0.3.9.app/Contents/Resources/julia/lib/julia/sys.dylib
in include_from_node1 at /Applications/Julia-0.3.9.app/Contents/Resources/julia/lib/julia/sys.dylib`
while loading /Users/Uthsav/Desktop/Walking The Interactome Work/arg.jl, in expression starting on line 42
This is essentially the problem I'm having in my own code. I looked but couldn't find any information about this besides what it says on the Github, which is that the macro #add_arg_table should still work. Any help would be greatly appreciated. Thanks a lot!

Getting an error in using particular "?" this operator,How to use it in swirl?

I am using swirl package for R programming. And for that, in a particular part I have to give this command which gives this error and that's why can't progress further.
?c
Error in shell.exec(url) :
file association for 'https://127.0.0.1:19202/library/base/html/c.html' is not available or invalid
Please help me to solve this problem, otherwise I am stuck here and can't get any progress.
Type below,It worked for me
info()
skip()

Resources