Category "casting"

PostgreSQL Can't Convert String to double precision

So I'm asked to do this query for a college project: SELECT l.city AS name, AVG((pr.ap_price::double precision * 7 - pr.weekly::doub

Convert [String: Any] to [String: String] in swift

How to convert a [String: Any] to [String: String] in Swift. I've tried to cast like this, but it didn't help: for (key, value) in dictionary { dictionary[

Is it possible to cast from one enum to another in PostgreSQL

I need to populate a new table in a second schema from an existing one, but having problems casting the "schema1.a.disclosure_level" column enum to the "schema2

cannot cast 'float64' to different essential type 'unsigned16' [MISRA 2012 Rule 10.8, required]

cannot cast 'float64' to different essential type 'unsigned16' [MISRA 2012 Rule 10.8, required] double x, y; #define MIN 2.0 uint16_t z = (uint16_t) ((x * MIN)

What is the difference between using INTXX_C macros and performing type cast to literals?

For example this code is broken (I've just fixed it in actual code..). uint64_t a = 1 << 60 It can be fixed as, uint64_t a = (uint64_t)1 << 60 but

Metabase Custom Column Casting from Text to Integer

How can I use Custom Column feature in Metabase to cast column from Text to Integer for sum calculation.

Powershell decimal to [Int] not failing

I am trying to validate a string of what should be comma separated integer values to use as success codes. If I start with an array with some invalid values, li

How to conditionally cast a type in dart?

It seems if it's just a variable, I can conditionally cast like this. Animal animal = Dog(); if (animal is Dog) { animal.bark(); // animal is of type Dog her

What is difference between "as" and "is" operator in Kotlin?

In Java, I can write code like: void cast(A a) { if(a instanceof Person) { Person p = (Person) a; } } In Kotlin, what should I do? Us

Fastest way to cast a float to an int in javascript?

Let's say I have x = 12.345. In javascript, what function floatToInt(x) has the fastest running time such that floatToInt(12.345) returns 12?

Steps to programmatically cast from android to miracast receiver

I'm trying to write an app that will start casting the screen from an Android phone to a TV via miracast. I'm using an HDMI dongle since the TV in question does

CASE statement in Netezza

I am new to Netezza so may be I am not able to figure out the issue. I have a scenario to implement in informatica with Netezza as the database. As few functio

How to split string in chars and get code of each char in freemarker?

I think that I can split using this: <#list str as c> ... </#list> But then I need to convert this char to byte and add it to another number.

How can I convert a buffer of a slice of bytes (&[u8]) to an integer?

I am reading raw data from a file and I want to convert it to an integer: fn main() { let buf: &[u8] = &[0, 0, 0, 1]; let num = slice_to_i8(buf

How do I idiomatically convert a bool to an Option or Result in Rust?

It seems there is no way of such one-line conversion using std. I do not like this kind of verbosity: match my_bool { true => Ok(()), false => Err

TypeScript enum to object array

I have an enum defined this way: export enum GoalProgressMeasurements { Percentage = 1, Numeric_Target = 2, Completed_Tasks = 3, Average_Milest

Socket Programming, Casting sockaddr_in to sockaddr. Why?

Here is a sample socket programming snippet from the client side. My question revolves around the type-casting that casted sockaddr_in into sockaddr. My questio

How to cast a datetime format to date as string in SQL Server

I am struggling to find a solution for the below issue. date1 = 31-08-2017 12:10:00 I want to cast it as string and need to take date (31-08-2017) alone. Th

Casting Any to Tuple2

I have a Scala function which passes message of type 'Any'. In most cases it will be a tuple of size 2. The function that receives this message needs to see the

SQL error "ORA-01722: invalid number"

A very easy one for someone, The following insert is giving me the ORA-01722: invalid number why? INSERT INTO CUSTOMER VALUES (1,'MALADY','Claire','27 S