casting Questions

5

Solved

I try to build CRF++ in Visual Studio 2013 and get this error in the last line: array_[begin + siblings[i].code].base = value_ ? static_cast<array_type_>(-value_[siblings[i].left]-1) : st...
Bergquist asked 1/4, 2016 at 3:54

11

Solved

I am trying to write a C++ template function that will throw a runtime exception on integer overflow in casts between different integral types, with different widths, and possible signed/unsigned m...
Lawrence asked 15/6, 2009 at 21:48

6

Solved

Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production. I have a table in the below format. Name Department Johny Dep1 Jacky Dep2 Ramu Dep1 I need an output in the below f...
Sycophancy asked 28/3, 2013 at 8:45

7

Solved

If I have a array with objects: $a = array($objA, $objB); (each object has a __toString()-method) How can I cast all array elements to string so that array $a contains no more objects but their...
Reba asked 25/1, 2010 at 10:4

16

Solved

Before I updated xCode 6, I had no problems casting a double to a string but now it gives me an error var a: Double = 1.5 var b: String = String(a) It gives me the error message "double is not c...
Sneed asked 16/8, 2014 at 12:0

4

Solved

Essentially, if I have typedef struct { int x; int y; } A; typedef struct { int h; int k; } B; and I have A a, does the C standard guarantee that ((B*)&a)->k is the same as a.y?
Luisluisa asked 6/11, 2013 at 5:17

9

I need to select from one column of datatype float and insert it in another column as nvarchar. I tried to cast it: cast([Column_Name] as nvarchar(50)) The result was 9.07235e+009 instead of a 10...
Stigmasterol asked 3/2, 2011 at 0:54

6

Solved

Within the following code, $quiz_object->personalities contains an array of Personality objects. // Loop through each personality that exists for the quiz foreach($quiz_object->personalities...
Detailed asked 13/9, 2012 at 15:36

9

I am trying to convert a Object type to Long type in Java and I got as: public static Long castObjectToLong(Object object) { return ((Long)object).longValue(); When I run, it throws ClassCastEx...
Cassondracassoulet asked 30/6, 2016 at 7:9

2

Solved

Does casting a real number to complex number set the imaginary part to 0 in C? Here is what I am trying to do: #include <complex.h> #include <stdio.h> int main(void){ float complex a...
Astound asked 3/8, 2022 at 22:44

8

Solved

I am not familiar with PHP at all and had a quick question. I have 2 variables pricePerUnit and InvoicedUnits. Here's the code that is setting these to values: $InvoicedUnits = ((string) $Invoice...
Activate asked 26/1, 2009 at 21:32

3

The Percent_Failure in the query below is giving results as either 1.00 or 0.00. Can anyone help me understand why it's not giving me the actual decimal? SELECT sf.hierarchy_name AS Hierarchy_Nam...
Outfield asked 1/2, 2019 at 21:35

6

Solved

If have this in the setter of a property: decimal? temp = value as decimal?; value = "90" But after the cast, temp is null... What is the proper way to do this cast?
Cambist asked 9/2, 2009 at 8:59

6

Solved

How can I cast a string in the format 'dd-MM-yyyy' to a date type also in the format 'dd-MM-yyyy' in Hive? Something along the lines of: CAST('12-03-2010' as date 'dd-mm-yyyy')
Charleencharlemagne asked 9/9, 2015 at 9:9

8

(OK, I'll expose the depths of my ignorance here, please be gentle) Background I've got a method which looks (a bit) like this: public void AddLink(Enum enumVal) { string identifier = m_EnumInt...
Walczak asked 29/10, 2009 at 13:3

1

Is there an algorithm to detect the data types of each column of a file or dataframe? The challenge is to suggest the data type by having wrong, missing or unnormalized data. I want to detect the d...
Wreckful asked 14/7, 2022 at 8:58

4

Solved

I have a Dictionary [String:AnyObject] which contains some keys and values. I want to increment a key to which value is of type Double. I can do it this way: let nr = dict["number"] as! Double d...
Runabout asked 20/5, 2015 at 16:49

1

Solved

Suppose A is a struct and I have a function to allocate memory f(size_t s, void **x) I call f to allocate memory as follows. struct A* p; f(sizeof(struct A), (void**)&p); I wonder if (void**)...
Subhuman asked 13/7, 2022 at 9:17

3

Solved

I have code that runs on different platforms that seems to get different results. I am looking for a proper explanation. I expected casting to unsigned to work the same for float or double as for ...

9

Solved

I would like to write a method that would return a java.util.List of any type without the need to typecast anything: List<User> users = magicalListGetter(User.class); List<Vehicle> veh...
Dedrick asked 24/7, 2013 at 17:3

2

Solved

From JDK8's Comparator.java: public static <T, U extends Comparable<? super U>> Comparator<T> comparing( Function<? super T, ? extends U> keyExtractor) { Objects.requireN...
Responsiveness asked 6/1, 2017 at 6:15

6

Solved

Say I have an array of AnyObject. let grabBag: [AnyObject] = [ "Tom", 4, "Dick", NSObject(), "Harry" ] and I want to cast it to an array of Strings, extracting only those elements that are in fa...
Tyeshatyg asked 3/11, 2015 at 17:5

2

Solved

I'm trying to use the @PreAuthorize annotation for access control. I need to check some custom fields in the details of the authentication object. I have a CustomWebAuthenticationDetails class, whi...
Favored asked 9/6, 2012 at 2:56

6

Solved

Using reflection I have an object which I need to cast into an iterable list of items (type unknown, will be object). Using the Watch window I can see my object is an array of some type as it tells...
Johnie asked 22/6, 2011 at 9:56

3

Solved

I have a slice of strings that are in CIDR notation. They are both ipv4 and ipv6 and I need them cast into the type net.IPNet. How would I do this in golang? example strings: 192.168.1.1/24 fd...
Cosmopolis asked 11/6, 2014 at 17:34

© 2022 - 2024 — McMap. All rights reserved.