casting Questions
3
Solved
I'm receiving a buffer from a network which was converted to an array of 32-bit words. I have one word which is defined as an IEEE-754 float by my interface document. I need to extract this word fr...
Skilful asked 15/2, 2018 at 9:2
3
Solved
I am developing web service that will receive JSON. Go converts types too strict.
So I did following function to convert interface{} in bool
func toBool(i1 interface{}) bool {
if i1 == nil {
r...
2
Solved
I have the following code:
let show = {
createTag: false,
updateFeature: false,
createFeatureGroup: false,
deleteFeature: false,
deleteCycle: false,
};
And I'm getting a value from the querys...
Black asked 5/10, 2021 at 22:36
5
Solved
I'm trying to put the values of a string into a byte array with out changing the characters. This is because the string is in fact a byte representation of the data.
The goal is to move the input...
29
Solved
In this question, someone suggested in a comment that I should not cast the result of malloc. i.e., I should do this:
int *sieve = malloc(sizeof(*sieve) * length);
rather than:
int *sieve = (int *...
7
Solved
I have my base class as follows:
class point //concrete class
{
... //implementation
}
class subpoint : public point //concrete class
{
... //implementation
}
How do I cast from a point objec...
Cranial asked 7/8, 2012 at 22:27
2
Solved
I'm following these (1, 2) guides to create a sender Android application for Chromecast and I'm only interested in sending pictures.
There are a lot of informaton and samples how to cast Text, Aud...
Ebro asked 4/6, 2015 at 12:30
6
What is the difference between boxing/unboxing and type casting?
Often, the terms seem to be used interchangeably.
3
Solved
I'm having one null-able bool (bool?) variable, it holds a value null. One more variable of type pure bool, I tried to convert the null-able bool to bool. But I faced an error "Nullable object must...
2
Solved
How to get an Integer instead of Long from JSON?
I want to read JSON in my Java program, but when I get a JSON value which is a number, my parser returns a number of type Long.
I want to get an I...
Elysha asked 1/1, 2014 at 13:32
11
Solved
My question is shown in this code
I have class like that
public class MainCS
{
public int A;
public int B;
public int C;
public int D;
}
public class Sub1
{
public int A;
public int B;
pub...
Flub asked 8/9, 2010 at 23:40
5
I am trying to cast to Decimal in MySQL like this:
CAST((COUNT(*) * 1.5) AS DECIMAL(2))
I'm trying to convert the number of rows in a table (times 1.5) to a floating point number with two digits...
10
Solved
Why is m always = 0? The x and y members of someClass are integers.
float getSlope(someClass a, someClass b)
{
float m = (a.y - b.y) / (a.x - b.x);
cout << " m = " << m << "\...
Durra asked 28/3, 2011 at 9:9
2
I was getting some weird errors that after much searching appeared to (maybe) come from my data not being considered numeric in some cases. This seems to be because I used Float64 dtype (which I th...
2
Solved
Consider:
float const& f = 5.9e-44f;
int const i = (int&) f;
Per expr.cast/4 this should be considered as, in order:
a const_cast,
a static_cast,
a static_cast followed by a const_ca...
Milzie asked 26/3, 2021 at 12:13
17
Solved
I need to get the value of a field using reflection. It so happens that I am not always sure what the datatype of the field is. For that, and to avoid some code duplication I have created the follo...
Fuliginous asked 14/7, 2011 at 8:57
2
Solved
In C++, I'm trying to print the address of a C-string but there seems to be some problem with my cast. I copied the code from a book but it just doesn't compile on my mac.
const char *const word =...
5
Solved
We are trying to cast an instance of IQueryable<EntityObject> to an IQueryable<SpecificEntityObject>, the SpecificEntityObject type is only known at runtime.
We have tried using the co...
Worshipful asked 11/1, 2012 at 12:7
3
Solved
In the following, I have a generic function fun <T : Number> sum(list : List<T>) : T with a type parameter T : Number.
In the function, I sum up the list's numbers as a sum : Double and...
Burgle asked 3/12, 2021 at 11:22
6
Solved
I have an id that is represented at an int64. How can I convert this to a []byte? I see that the binary package does this for uints, but I want to make sure I don't break negative numbers.
3
Solved
How can I cast a Java object into a boolean primitive
I tried like below but it doesn't work
boolean di = new Boolean(someObject).booleanValue();
The constructor Boolean(Object) is undefined...
11
Solved
3
Solved
I have a benefit_type integer column in Provider Model Which is a enum column.
Provider.rb
enum: ['abc', 'bcd']
Now I want to migrate to array_enum
Provider.rb
array_enum: {'abc': 0, 'bcd':...
Lifton asked 25/2, 2020 at 6:21
2
Solved
Hi i would like to query a table based on its primary key.
i have tried both
var deviceDetails = (from d in db.Devices
where d.DeviceId == pointDetails.DeviceId
select d).ToList();
EDIT d.De...
5
Solved
I have a ComboBox filled with mixed items of two different types. The types are either
KeyValuePair<Int32, FontFamily>
or
KeyValuePair<Int32, String>
Now there are occasions where...
Bunting asked 25/9, 2015 at 12:6
© 2022 - 2024 — McMap. All rights reserved.