Category "types"

Can I short-circuit type evaluation?

I'm trying to create a composable configuration framework wherein each node in the dependency graph can access all of its upstream nodes. Although I've managed

prevent numpy stack method change INT data to float

I try to stack three one dimension array. a and b are int that can be work as index and c is float. After I stack this three with axis=0, the a and b data chang

How to add a value within specific key when extending an interface?

Let's say I have an interface: interface Person { age: number name: { first: string second: string } } And I want to extend Person to Friend, whi

Is there any reason or advantage to specify string column length in BigQuery?

I am new to BQ and experienced in OLTP RDBMS, I found the data in BQ for my company are mostly in STRING type while it was VARCHAR(255) or even less in the OLTP

Declare types from file with `export .. from` to global interface

I have the file with a lot of export { default as NAME } from './PATH_TO_FILE'; And I want to declare types to global @vue/runtime-core inside GlobalComponents.

Specifying a type in an interface of the type that inherits this interface

Need a real implementation of this code interface IExample{ public this ReturnMe(); } class Example : IExample { public this ReturnMe(){...} //returns an

How is a binary/bytes column sorted in sql?

The following query sorts a binary column in BigQuery: with tbl as ( select B'123' as col union all select B'234' ) select * from tbl order by col; ----------

Workaround for TypeVar bound on a TypeVar?

Is there some way of expressing this Scala code with Python's type hints? trait List[A] { def ::[B >: A](x: B): List[B] } I'm trying to achieve this sort

In typescript, why do the | and & operators flip their meaning when used on function types?

In this code, example1 and example2 are confusing me: type F1 = (a: string, b:string) => void; type F2 = (a: number, b:number) => void; // re: example

Typescript: how to inference class type that implements an interface

Giving an interface interface IAnInterface { } How to reference and point to a class type that implements that interface! Meaning! Giving a class: class AClas

JSDoc equivalent to Typescript's `as const`?

I'm in an old project that is too huge to easily convert to Typescript, so I've been using JSDoc instead. The Typescript feature that I can't figure out how to

How to create a UUID template literal type in Typescript?

Did anyone suceed in writing a type for UUID in Typescript using the new template literal types? e.g.: const id:UUID = "f172b0f1-ea0a-4116-a12c-fc339cb451b6" T

Enforcing units on numbers using Python type hints

Is there a way to use Python type hints as units? The type hint docs show some examples that suggest it might be possible using NewType, but also those examples

Check if string is in string literal type

We use static type checking extensively, but we also need some simple runtime type checking. I'd love to use our static types for that runtime type checking. I'

How to specify python type hints for complex package as opencv or tensorflow?

I am building a python library and I writing a function like this: def addimg(image) -> None: now I want to specify the type of image as an OpenCV image (e.

Correctly declare interface or type for functions params

How to correctly declare type for param cardsByStatus inside function addCardsToStatus? It works for cardsByStatus: any, but it doesn't make sense for me. Error

Define an empty object type in TypeScript

I'm looking for ways to define an empty object type that can't hold any values. type EmptyObject = {} const MyObject: EmptyObject = { thisShouldNotWork: {},

error TS2322: Type 'Event' is not assignable to type 'string'. [(ngModel)]="todoItem" (keyup) ="addTodo()"

I'm trying to bind my input to be able to display string. But I've this error: Error: list.component.html:3:15 - error TS2322: Type 'Event' is not assignable to

Defining new types in Haskell

I am pretty new to Haskell, and I was wondering if one can define new types that are defined by lists of other types. For example, I assume a string is defined

Append to existing tuple in c++

i am trying to make a thing to store types in list. The best thing is to use a tuple. then to get the type i use tuple_element_t. But the problem is when append