Skip to main content

Questions tagged [types]

Types, and type systems, are used to enforce levels of abstraction in programs.

-1 votes
2 answers
81 views

uint8_t elements exceeding one byte?

I saw this code: uint8_t broadcastAddress[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; I know uint8_t holds a byte, so how does this line of code work when a single element, 0xFF, is in itself one whole ...
bittybytey's user avatar
0 votes
0 answers
10 views

R visNetwork arrow type

The below code is meant to yield the following network graph: . library(visNetwork) library(magrittr) nodes <- data.frame(id=c("a","b","c","d"), label=c(&...
jbowerbir's user avatar
1 vote
3 answers
75 views

In C, why can a variable holding a char array be assigned to a pointer, but the address of the same pointer cannot?

Consider the following code: char stringy[] = "There's too much confusion, I can't get no relief!"; char *pStringy; pStringy = stringy; This compiles - stringy is an array of characters, ...
Bennypr0fane's user avatar
0 votes
1 answer
100 views

Write a new Delphi type that lets a method have inline code as a parameter?

Is it possible to have this in Delphi? DoThis(ShowMessage('SomeMsg ..'); Caption := 'SomeCaption'; Inc(I)); Is it possible to create a new type that handles inline code like this? For example, we ...
MBen's user avatar
  • 19
-2 votes
0 answers
16 views

What should I prefer input type for voice synthesis [closed]

I decide to make my artificial neural network for synthesis my voice but still I am not sure about what I use for input type. Should I use input type as letter or syllable? I still not start the ...
Yunus's user avatar
  • 1
1 vote
1 answer
39 views

R get local variable from formula

Consider the R code : foo <- function(formula){ Y <- get(formula[[2]]) print(Y) } main <- function(){ Y <- 1 X <- 2 foo(Y ~ X) } main() The outcome says that in get(...
温泽海's user avatar
  • 344
0 votes
0 answers
21 views

check if given object implements certain generic interface; type argument(s) NOT known [duplicate]

I have some object. I want to check at runtime if it is an IReadOnlyCollection<T> of any T, i.e. I cannot specify that T in my check. So it should return true for e.g. IReadOnlyCollection<...
Kjara's user avatar
  • 2,792
0 votes
0 answers
33 views

As a wrapper object in JavaScript, why can not use 'new' to create a BigInt in JavasScript? [duplicate]

There are 5 wrapper objects in JavaScript: Number, BigInt, String, Boolean, and Symbol.You can use 'new' to create a Number, String, Boolean, Symbol. But you can not use 'new' to create a BigInt. what ...
Leo qiao's user avatar
-2 votes
0 answers
76 views

Are there objects for primitive data types? [duplicate]

If the object represents a data type, is the variable for a primitive data type like an integer also an object representing this type, or do objects not represent primitive data types? // Let's assume ...
Ahmed Hamed's user avatar
0 votes
0 answers
38 views

Why print(f"{variable = }") in Python 3.12 also prints numpy type?

I noticed, that with Python 3.12 and a numpy.float64 when I simply do a x = numpy.sqrt(3) # type is <class 'numpy.float64'> now print(f"{x = }") # this is printed >>>x = np....
emefff's user avatar
  • 1
0 votes
1 answer
52 views

How to enforce error on impossible switch case?

There is a linter we can enable for equality check. What about switch case ? This does not seem to work. https://stackoverflow.com/a/78736339/6727914 How to convert the warning into errors ? Example: ...
TSR's user avatar
  • 19.5k
3 votes
1 answer
59 views

How to enforce error on impossible equality check?

There is a linter to it https://dart.dev/tools/linter-rules/unrelated_type_equality_checks but it just shows a warning, rendering it almost useless for large projects. How to convert the warning into ...
TSR's user avatar
  • 19.5k
1 vote
0 answers
15 views

Why am I having an issue with typescript and Prisma ORM when trying to find a unique item?

I am having issues with my ability to use the prisma .findUnique() function call. My code doesn't show any compilation error, but when I actually try to go to a product page it causes a runtime error. ...
The Elina's user avatar
0 votes
1 answer
21 views

Checking subclass against metaclass type

I have a set of plugins that inherit from a metaclass. the metaclasss is defined like so: from abc import ABC, abstractmethod class MetaReader(ABC): def __init__(self, arg1, arg2, **kwargs): ...
KBriggs's user avatar
  • 1,338
1 vote
0 answers
27 views

Unexpected behavior when combining mapped type created from Union that is used within conditional type [duplicate]

I came across some unexpected behavior when trying to expand mapped type I created from an union of object types, when trying to use this type within conditional type: Playground export type ...
Jarek's user avatar
  • 7,651

15 30 50 per page
1
2 3 4 5
1931