Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!
Score of 0
2 answers
83 views

I am using NHibernate 5.5.0 and need to pass the NHibernate connection and transaction to some existing ADO.NET code that expects IDbTransaction. I can get the current NHibernate transaction with ...
Score of 2
0 answers
175 views

I commonly use type aliases to be able to change a given type within my program and to give them some semantic, but I have an issue that appeared by adding the -Wuseless-cast to gcc: #include <...
Score of 0
2 answers
135 views

I made a mistake of using == to evalaute two strings instead of eq and when I tried to cast a variable that was a string of numbers to text, after such comparison, the result was a string but after ...
Score of 3
1 answer
209 views

I'm starting to learn a bit of C as a side project of sorts. Doing some simple exercises to get a grasp of the syntax and all that, I've come to a problem I cannot explain. I need to make a small ...
Advice
1 vote
7 replies
140 views

I have been studying C++ for a bit of time now. I am still a novice, but I continue to learn daily and practice and pickup new things. One thing I haven't been seeing too much information on is ...
Score of 0
1 answer
223 views

I have a method in a derived class which I want to call via a unique_ptr to the base class. How do I cast my unique_ptr to the base class to allow me to call the method in the derived class? In ...
Score of 1
1 answer
160 views

Using older versions of octave (5.2.0), I could easily add two numbers in hex format: octave: 1> 0x1122334455 + 0x1122 0x112233446677 In newest version at the time (11.1.0), that same command ...
Best practices
0 votes
3 replies
96 views

I was converting a list to an array, following the method shown in Convert list to array in Java and Converting 'ArrayList<String> to 'String[]' in Java. Unfortunately, it doesn't seem to work ...
Score of 5
1 answer
242 views

I came up with a C++11 implementation of a std::any-like thing. It works according to my testing, but I'm concerned that I might be invoking undefined behavior somewhere without realizing it. I'm ...
Score of 4
3 answers
184 views

I was trying to calculate square root of numbers without including math.h. I thought I could cast a double as a long as they both are 64 bits (in the function magnitude()) : #define NUMBER -2 #include ...
Score of 1
1 answer
148 views

(Continuing from: Cast to custom class in PowerShell) I would like to build a custom cast like: class CheckBox { [Nullable[Bool]]$NullableBool CheckBox([Nullable[Bool]]$NullableBool) { $this....
Best practices
0 votes
1 replies
113 views

I got the following Android UI-code: OutlinedTextField(value = mainVM.srcAmount.doubleValue.toString(), onValueChange = { // Implicit generated argument 'it' is a String. mainVM.setAmount(...
Score of 3
4 answers
377 views

I am currently trying to generate a random float number in C. And apparently that is a hard thing to do as there seems to be no real library for it, only workarounds with rand() from stdlib, but those ...
Score of 1
4 answers
206 views

I'm new to pointers and trying to wrap my head around how casting and dereferencing should function in comparator functions that qsort takes. My understanding is these always have the signature int ...
Advice
1 vote
4 replies
61 views

Type Checking Challenge for AmiNode I have an interesting challenge when parsing *.ami files. I use the following recursive type, which has arbitrary hierarchical depth: AmiName = NewType("...

15 30 50 per page
1
2 3 4 5
1338