Runtime error in ideal Coefficient ring of LHS must be a field - magma-ca

I am trying the following code in magma
z:=Integers();
P<x>:=PolynomialRing(z);
ideal<P|x>;
I tried also :
z:=GR(2,2,1);
P<x>:=PolynomialRing(z);
ideal<P|x>;
both are shown the same erreur "Runtime error in ideal< ... >: Coefficient ring of LHS must be a field"
Im trying to construct an ideal of Z[x]

Related

Implementing mib2c template for scalar

I am trying to get the mib2c template code to work for a simple scalar, but continue to get MY-MIB::mibName = No such object available on this agent at this OID upon a snmpget request no matter what I do.
When generating the mib2c template code I choose the net-snmp -> scalar options. From there I have tried options 1 and 2.
My understanding of the option 2 template is that you shouldn't even have to change any of the code to get it to successfully return a zero value for scalars.
However, the debug messages show that the init_* functions are getting called but the handlers are not getting called at all.
I am wondering if anyone can point me to resources showing a successful implementation example of the mib2c generated code as I am fairly lost at this point.
Thanks!

How can I set a stack panel's border color programmatically in C++ in WinUI3?

I am working on a project using WinUI 3 in C++, and I want to change the border color of a XAML control(e.g. stackpanel) according to some condition. I have tried search it online, but most of answers are in c#, and some in C++ I have tried but got no luck.
For example: ("StackPanel" is defined in the xaml )
StackPanel().BorderBrush(SolidColorBrush(ColorHelper::FromArgb(255, 255, 255, 255)));
Then the error would come up:
no instance of overloaded function matches the argument list
argument types are: (winrt::Windows::UI::Xaml::Media::SolidColorBrush)
object type is: winrt::Microsoft::UI::Xaml::Controls::StackPanel
And another one I tried in .cpp file:
StackPanel().BorderBrushProperty(SolidColorBrush(Colors::Black()));
the error is:
too many arguments in function call.
Why are these errors happening?
Could anyone help me on this? Or any suggestions?
Sample code would be great!
PS : I am still very new to WinUI 3 especially in C++ (there are not so much study material for C++)
I would be grateful for any help.
From what I'm seeing the actual error (as best as i can replicate what you're doing) is
Severity Code Description Project File Line Suppression State
Error C2664 'void Windows::UI::Xaml::Controls::StackPanel::BorderBrush::set(Windows::UI::Xaml::Media::Brush ^)': cannot convert argument 1 from 'Windows::UI::Xaml::Media::SolidColorBrush' to 'Windows::UI::Xaml::Media::Brush ^' App1 c:\repos\App1\MainPage.xaml.cpp 29
If you create your brush like this auto brush = ref new SolidColorBrush(...);
And pass it to the stackpanel like this stackpanel->BorderBrush = brush;
Your error should go away.
Obviously how you are getting your stack panel might be different from how i did, but the point is you should be able to just set it to the value as long as you have the value in the correct form a ref new object in this case, it would seem.

Mind the gap: Finding the text of C++ code called by an R function

I would like to find the text of the C++ code called by an R function, specifically, the function "_dplyr_summarise_impl" which is called by summarise_impl. Even more specifically, I would like to find the bit of code that precedes that which returns the error message"
Error in summarise_impl(.data, dots) :
Evaluation error: argument "yes" is missing, with no default.
I presume that the "yes" in the code above varies, but that it is supplied by some other bit of dplyr or the related tidyverse, as none of my code possess a "yes" argument to be missing. Or it might be base R code called by tidyverse code. But in either case, there is a gap between the error message and the last function I could see with traceback, caused, I am guessing, by traceback being unable to find its way through called C++ code. I am hypothesizing that if I can find the code that was supposed to supply the "yes" argument, that will tell me what is going wrong. But there is a gap between the last function that traceback supplies and the error message above. I am looking for help in bridging that gap.
It now appears to me that this is a standard error message for some version of eval, either base or tidyverse, that is called either by _dplyr_summarise_impl, or some function that it calls. Many, perhaps all, of the dplyr major verbs have an unexported function of the form <function>_impl, and all of these functions return error messages very similar to the one previously cited. So I suspect they may be calling a common error message process.
I just found the text of _dplyr_summarise_impl here, in dplyr/src/RcppExports.cpp. That takes me one step closer, but I don't know enough C++ to know which of these lines is most likely to be calling the function that calls the error. Guess I'll read the C++ chapter in Advanced R next.
// summarise_impl
SEXP summarise_impl(DataFrame df, QuosureList dots);
RcppExport SEXP _dplyr_summarise_impl(SEXP dfSEXP, SEXP dotsSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< DataFrame >::type df(dfSEXP);
Rcpp::traits::input_parameter< QuosureList >::type dots(dotsSEXP);
rcpp_result_gen = Rcpp::wrap(summarise_impl(df, dots));
return rcpp_result_gen;
END_RCPP
}

error running tensorflow trained model c++

I am working on Tensorflow on c++ with network I trained myself. I trained facenet on MS-Celeb-1M then I created my graph.pb. I modified the example provided here : https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/label_image in order to test my network.
In main.cpp:
string graph = "data/graph1.pb";
string output_layer = "InceptionResnetV1/Repeat/block35_5/Relu";
I get this error if I test :
Running model failed: Invalid argument: You must feed a value for placeholder tensor 'phase_train' with dtype bool [[Node: phase_train = Placeholderdtype=DT_BOOL, shape=[], _device="/job:localhost/replica:0/task:0 /cpu:0"]]
I have looked for some answers such as here https://github.com/davidsandberg/facenet/issues/108:
But there is still a problem
tensorflow.python.framework.errors_impl.InvalidArgumentError: You must feed a value for placeholder tensor 'phase_train' with dtype bool
when global variables are initialized. I'm not sure why this problem happens but it has to do with batch normalization. It can be fixed by changing
phase_train_placeholder = tf.placeholder(tf.bool, name='phase_train')
to
phase_train_placeholder = tf.placeholder_with_default(tf.convert_to_tensor(True, dtype=tf.bool), shape=(), name='phase_train')
And then it seems to work fine.
David Sandberg is speaking about changing a line. However, I don't know how can I provide the parameter phase_train in c++.
When you call Session->Run, the first input to the method is a vector of pair. You need to create a tensor with the name phase_train, type Boolean, and a value of whatever makes sense. Add that tensor to the input list.

Error when creating R library on vertica : "basic_string::_S_construct NULL not valid"

I'm trying to create a R language library in HP Vertica.
I've been able to do it on a different machine, but now when I try to do it on a different machine I get this error messsage :
create library rhlib as 'foo.r' language 'R';
ROLLBACK 3399: Failure in UDx RPC call InvokeSetExecContext(): Error calling setupContext() in User Defined Object [] at [/scratch_a/release/vbuild/vertica/UDxFence/vertica-udx-R.cpp:112], error code: 0, message: Exception in Validate Library:basic_string::_S_construct NULL not valid
What can be the issue? Is my R language pack not installed correctly?