Questions tagged [types]
Types, and type systems, are used to enforce levels of abstraction in programs.
types
28,919
questions
0
votes
1
answer
20
views
Rust generic lifetime elision issue
I am trying to a implement generic observable collections for use with a UI framework I'm writing. I'm currently having an issue with lifetimes not being elidable in generics.
For brevity the ...
0
votes
0
answers
23
views
Creating a type from an object's keys and values in TypeScript
I'm trying to create a new type based on the type of a statically defined object in TypeScript. Given the following map:
const map = {
'hello': {a: 1, b: false},
'world': {b: 'hello', c: null}
...
3
votes
1
answer
30
views
Typescript: Variable inside Express RequestHandler becomes possibly undefined despite being checked in an if statement [duplicate]
I am creating a way to dynamically create routes before the server fully starts (meaning I'm not creating a route via a request lol that would be crazy), and I stumbled upon this interesting quirk.
...
-1
votes
1
answer
53
views
Picked structs in rust
Is it possible to have a picked struct in such a way that the type checker doesn't have a problem with it?
Coming from TypeScript:
// Considering a main object type containing all fields:
interface ...
9
votes
3
answers
2k
views
Type ERROR when upgrading to tensorflow 2.9
After upgrading to tensorflow 2.9 I got the following Erro message
when calling model.fit()
with tf 2.8 there were no error.
The fit runs anways but its worrying.
2022-06-21 12:42:58.930086: W ...
0
votes
1
answer
79
views
Universal way to check for empty/uninitialized RAW values
I am hoping to find a universal way to test "initial"/uninitialized values of RAW type (potentially other binary too). ABAP initial value article says there are no initial values for ...
0
votes
1
answer
61
views
Get templated struct without knowing initial template arguments
I am looking for a way to get a specified templated struct from the custom Node classes I am building without having to static_cast or dynamic_cast when I get the pointers. What ways can I use to ...
1
vote
1
answer
21
views
Why does Typescript loses inference on nested objects when accessing them with dynamic property names?
Playground: https://tsplay.dev/m3Gqqm
I'm trying to access deeply nested properties of my theme object based on input parameters, so I can provide a nice dev experience by having autocomplete.
But ...
1
vote
1
answer
55
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....
6
votes
2
answers
4k
views
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"
This guy here tried: UUID Tweet
...
12
votes
5
answers
8k
views
What Delphi type for 'set of integer'?
I have several hardcoded validations like these:
const
cLstAct = 1;
cLstOrg = 4;
cLstClockAct = 11;
const
FUNCT_1 = 224;
FUNCT_2 = 127;
FUNCT_3 = 3;
if lFuncID in [...
82
votes
9
answers
219k
views
What's the difference between primitive and reference types?
This is a past exam question and I was wondering what a primitive type and reference type are first off?
With an array I know that a reference type is where the array is composed of objects or ...
0
votes
1
answer
20
views
How would I pass a Test Command into a function in a JavaScript script in Smartbear's TestComplete?
I am working in TestComplete and have just learned about scripts as a way to make more complex test steps in the TestComplete environment. Because my tests will probably be used in the future, one of ...
0
votes
1
answer
19
views
How to fix: Property 'geocodeService' does not exist on type 'typeof import("node_modules/@types/esri-leaflet-geocoder/index")'
I'm having a typing issue with the Esri Leaflet Geocoder types package. https://www.npmjs.com/package/@types/esri-leaflet-geocoder
Here is how I'm importing it:
import * as L from 'leaflet';
import '...
2
votes
2
answers
52
views
How to convert data frame in R to a "character" data type?
The labeller function which I'm using for ggplot requires data of the type:
tempdat <- c(
"1" = "one",
"2" = "two"
)
If I use typeof(tempdat) it gives ...