Category "types"

Unmarshalling Dynamic JSON Data With Overlapping Fields in Golang

Sorry If i'm posting a question that has already been answered, but I can't seem to find any similar situations on here. I have a websocket client that receives

How do I add dynamic content in the HTML part of my Elm file without getting a "Type mismatch error"?

I have an Elm file with some HTML content in a function called view. Part of the HTML content is dynamically generated via a map function that extracts data fro

How do I add dynamic content in the HTML part of my Elm file without getting a "Type mismatch error"?

I have an Elm file with some HTML content in a function called view. Part of the HTML content is dynamically generated via a map function that extracts data fro

How to perform Data Type validations for each individual fields of a POJO in Java?

I have a Request POJO class which comes with all String data type fields. When I have to store them to DB, the data types must be accurate. Considering that I

How to convert data in Polars?

I used .write_ipc from Polars to store as a feather file. It turns out that the numerical strings have been saved as integers. So I need to convert the columns

How to update @type/packageName according to updating packageName?

My current packages - - [email protected] - @types/[email protected] I updated my lodash version to minimum stable one as [email protected] Now, what will be the @ty

Why there is no compilation error when I am using different data types for switch expression and case value in this case

public class Conditionsif { public static void main(String[] args) { // TODO Auto-generated method stub int day=1; switch(day){

What does this mean in angular, what kind of type is this?

I would like to know what this type means: type newtype = (state: EntityState<IEntities>) => IEntities[];

Define an "extends string" type that doesn't allow union of strings

I have this function function something<T extends string>(): void { // ... } I would like to restrict T to be a SINGLE string, and not a union of strin

SQL Server : unable to save decimal digits

I am facing a peculiar problem. I have a few tables in SQL Server where I have properly declared a few columns as decimal(18, 2). Unfortunately, whenever, I sav

Is there a way to keep type inference in union types from type guards inside a function?

Let's say I have three types (and a union one) type A = { type: 'a' title: string description: string } type B = { type: 'b' title: string

Typescript: Enforcing property type based on another property value which is a key of a generic

Given the following type: export type MyType = { a: boolean; b: number; } I want to create a type: export type Mapper<T> = { key: keyof T;

Elasticsearch “data”: { “type”: “float” } query returns incorrect results

I have a query like below and when date_partition field is "type" => "float" it returns queries like 20220109, 20220108, 20220107. When field "type" => "l

Alternative to index signature

I have an array of object like this: [ { "bio": "Douglas Gerald Hurley is an American engineer, former Marine Corps pilot and former NASA astronaut. He la

how to make an iterable type in type script that has a key value pair

I am using type script and I want to make a type that represents an object like this the keys generated are genrated dynamically how do I do that { dog:true,

Typescript, merge object types?

Is it possible to merge the props of two generic object types? I have a function similar to this: function foo<A extends object, B extends object>(a: A,

Typescript reduce return wrong Type and also forbid to assert it

Faced very strange ts behaviour. type Labels = Record<string, boolean | undefined> type LabelGroups = Record<string, Labels> export function reduc

Which C/C++ data type should I use for PHI(N) calculator?

I found a source code online for calculating PHI. I made some small adjustments to the variable types, such as using an unsigned long int, however I am limited

How to capture Typescript conditional property type

I have the following Typescript type: type Config = { key: string, type: `input` | `switch` | `radios` | `select` | `checklist` | `image`, options: string

Destructure a function parameter in Typescript

I'm trying to give a type to the members of below function. args is an object with a data property of type UserCreateInput So, from this: createUser(parent: a