string subscript out of range. I want to know what to doenter image description here
Related
we are trying to set a TraceID with a the OpenTelemetry Transform Processor [1].
There is a way to set the TraceID with a hard coded value [2] like this (the example shows a SpanID, but TraceID works too).
traces:
set(span_id, SpanID(0x0000000000000000))
We want to set it to a value we have stored in an attribute. We tried
traces:
set(trace_id, attributes["traceID"])
where attributes["traceID"] is a String 0x00000000000000000000000000000000.
This won't work, but if we try
traces:
set(trace_id,TraceID(attributes["traceID"]))
the collector won't even start, since we are trying to give a String, where a Byte Slice is expected
collector server run finished with error: invalid configuration: processor "transform" has invalid configuration: invalid argument at position 1 invalid argument for slice parameter at position 0, must be a byte slice literal
We tried different approaches to cast the String to a Byte Array but none did work.
Does anyone have an idea?
Thanks in advance, kind regards!
[1] https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/fbb8ff9658b3bac7892dea6c7d49f40afe154bd8/processor/transformprocessor
[2] https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/pkg/ottl#update-a-spans-id
We found the answer:
- set(trace_id.string,attributes["traceID"])
Works just fine :)
While making a project in Xcode, I ran into the error "tried to merge string value for key 'CFBundleExecutable' onto dictionary value." As an additional message to this error, the compiler states: "tried to merge string value for key 'CFBundleExecutable' onto dictionary value." I am wondering what the error could possibly be, and how can I fix this? I appreciate the help!!
1.This error occurs when you are trying to merge a string value with an array value for the key "CFBundleIdentifier". To resolve this issue, you should make sure that both values are of the same data type. If you want to append the string value to the array, you can use the append method:
Suppose we are debugging some Go code, and somewhere in an external dependency we encounter this line:
return json.Marshal(foo)
We want to set a breakpoint and use IntelliJ's "Evaluate Expression" to inspect the JSON being produced. However, this doesn't work:
If we evaluate the expression json.Marshal(foo), we only get to see the byte array.
Evaluating string(json.Marshal(foo)) doesn't work because json.Marshal returns two values, the byte array and an error.
There is no way in Go to access one of the return values directly.
So how can I use "Evaluate Expression" to achieve my goal of just printing the produced JSON string when I'm not able to change the underlying source code?
you can print the returned bytes as a string
bytes, err := json.Marshal(foo)
// check error here
fmt.Println(string(bytes))
update based on comments
You can't change the byte slice in the debugger to a string without changing the source code.
Doing this example in Matlab Image Category Classification
I have found an error trying to get the vocabulary of SURF features with this command
bag = bagOfFeatures(trainingSet);
The error is the following
Error using bagOfFeatures/parseInputs (line 1023)
The value of 'imgSets' is invalid. Expected imgSets to be one of these types:
imageSet
Instead its type was matlab.io.datastore.ImageDatastore.
I am using a ImageDatastore input instead of imgSets, but I am following a Mathworks example. Anyone can explain me why is this happening and how can I convert trainingSet into a imgSets type?
You have to convert the ImageDatastore object to an imageSet object. This can simply be done by using the following line instead:
bagOfFeatures(imageSet(trainingSet.Files));
I am trying to conditionally format a graph with a repository variable. My goal is to end with a number between 1-12 which corresponds to the current month.
When I try,
biServer.variables['CURRENT_MONTH']
I get the following error:
Graphing engine is not responding.
"A fatal error occurred while processing the request. The server responded with: oracle.bi.nanserver.fwk.exception.BISvsException: java.lang.NumberFormatException: For input string: "2014 / 07"."
Trying the following,
RIGHT(biSerber.variables['CURRENT_MONTH'],2)
I get an error:
"A type mismatch occurred while evaluating an expression."
Finally, the follow also errors.
RIGHT('biServer.variables['CURRENT_MONTH']',2)
"The syntax of the expression to be evaluated is invalid."
Anyone have ideas? Thanks.
I ended up with a workaround that is serviceable but not ideal.
I added a new column and created a custom formula where the month number, in this case "7", is compared to the repository value CURRENT_MONTH. If CURRENT_MONTH is greater than 7, then return ".", else return "null". (The period being the least noticeable character I could think of)
From here I added the new column to the graph and set a conditional format on that column where if the value is equal to not null (a period in this instance), apply the desired conditional format.
The following link was most helpful for me.
http://bidirect.blogspot.com/2013/10/conditional-formatting-is-it-possible.html