Skip to main content
0 votes
0 answers
19 views

CGAL Customed AABB_tree face a question which can not read memory in AABB_tree's feild 'm_primitives' when left function which construct the tree

#include <iostream> #include <list> #include <CGAL/Simple_cartesian.h> #include <CGAL/AABB_tree.h> #include <CGAL/AABB_traits_3.h> typedef CGAL::Simple_cartesian<...
StackOverFlow999's user avatar
-2 votes
2 answers
112 views

Java Collection with Arrays

I am confused how an collection is allowing to hold arrays of primitive data type, but not the primitive datatype itself. What happens internally here? My underlying question is how array is handled ...
anshu_anand's user avatar
0 votes
1 answer
63 views

What prevents JavaScript primitives from being mutated?

In C, after declaring and initializing a primitive, we're able to access the memory address where the primitive is stored and directly modify its value. However in JavaScript it is said that primitive ...
Ziqi Zou's user avatar
0 votes
1 answer
87 views

In Rust, what is the idiomatic way to associate members of one enum with other enum types and map between their integer and string representations?

Goal: I'd like to turn a pair of (usagePage, usageID) integers to Rust enumeration variants and get the names of both the page and specific usages as strings for debugging purposes. I'd like to ...
EB.'s user avatar
  • 3,525
-4 votes
1 answer
132 views

How do Java's equality tests (`==`) work between same primitives (e.g. int, char) and what is most efficient?

How do Java's equality tests work between primitives? I'm specifically looking for efficiency (and speed) within single-type comparisons. Is the char == char comparison faster than int == int? I ...
Eliezer Meth's user avatar
1 vote
0 answers
71 views

Why are different variations of wrapping base R functions faster/slower?

I am wrapping a number of R functions in a library (purely for syntax consistency with other systems, not performance or anything else). Something like: ABS_1 <- function (x) { abs(x) } ABS_2 <- ...
FISR's user avatar
  • 73
0 votes
2 answers
421 views

Union type for primitive types data in dart

How can I define a variable with only two possible primitive types, such as (String or num) for example, in Dart? Is there a way to do this? like union types in TypeScript. const x:string|number;
Jaafar Melhem's user avatar
4 votes
1 answer
112 views

Java: Casting Object to primitive array using Class.cast()

Casting a known primitive array masquerading as an Object back to it's original primitive array type using the Class.cast method involves breaking the operation up into two assignments first before it'...
JNellis's user avatar
  • 53
2 votes
1 answer
245 views

How can i set rep_delay in ibm qiskit runtime

I want to be able to speed up the sampling done by qiskit_ibm_runtime.Estimator, by reducing the time qubits are allowed to decay to their ground state. I realise this might introduce errors in the ...
Robert Cumming's user avatar
4 votes
4 answers
241 views

Integer -> double unboxes, but Double -> int doesn't unbox. Why?

To avoid confusion, I'm looking for the rule/JLS entry. I'm not asking why Double -> int would fail, I'm asking about the way it fails I'm aware of the lossy conversion, as I've mentioned in my ...
Vince's user avatar
  • 15.1k
0 votes
0 answers
24 views

Constructor functions return statement [duplicate]

Can you explain me the differences between these two provided examples or provide me articles to read? function x (){ this.name="Diana" return [1,2,3] } let newOne = new x() // the ...
Diana's user avatar
  • 39
0 votes
0 answers
27 views

JS undefined: access primitive value of undefined without property?

I'm learning JavaScript (JS). I came across that undefined (such as from MDN) is a global property that refers to the undefined primitive value. I've seen this, for example, with the behavior of the ...
mishar's user avatar
  • 455
1 vote
2 answers
100 views

JS has object wrappers to let me check primitive's "property" exists or not, how do I let TS work like that?

The return value of XMLValidator.validate is either true or ValidationError (which is not exactly correct, check my update), which has err property. validate( xmlData: string, options?: ...
Qiulang's user avatar
  • 12.2k
0 votes
1 answer
73 views

Need help upon using serialization without classes in C++ since I didn't yet begin object oriented programming. I have an assignment. Please help me [closed]

I didn't learn working with classes in C++, focusing on non object oriented programming. So I ran into a situation where I need to make sure I can serialize vectors and other primitive data types, so ...
user22075622's user avatar
0 votes
0 answers
152 views

Convert list of Float objects to an array of float primitives in Java [duplicate]

Given a List of Float objects: List< Float > floatObjects = List.of( 7F , 42F , 99F ) ; // Auto-boxing produces a `List< Float >`. … how does one easily get an array of double primitive ...
Basil Bourque's user avatar

15 30 50 per page
1
2 3 4 5
66