611 questions
0
votes
1
answer
97
views
What is the name of this C++ syntax: "new (bar[n]) Foo();"? [duplicate]
I have this memory buffer class:
class Buffer {
const size_t size; // size of one element
const std::unique_ptr<char[]> data; // storage
public:
Buffer(const size_t &size, const ...
0
votes
4
answers
346
views
How to feature test for BigInt support?
I'm not familiar with modern JS and tooling to even try something.
References:
https://github.com/tc39/proposal-bigint
0
votes
0
answers
25
views
"gzip" feature problem trying to implement rolling logger in Rust (programmatically) [duplicate]
I've found this page. At the bottom of that page the author says he's giving a programmatic way of configuring so as to have a console logger component but also a rolling file logger component.
I'm ...
1
vote
1
answer
79
views
What exactly are the "auto-implemented properties" introduced in C# 6.0?
Microsoft's version history page mentions "auto-implemented properties" as one of the new features added to C# in version 6.
Their page on auto-implemented properties gives the following ...
0
votes
1
answer
160
views
Is there a method of initiating a ThinBox<[T]>?
I have been dabbling in experimental features lately and have been using them for a library I'm building. I am trying to reduce the size of an enum by using ThinBox<[T]> to store contents in a ...
0
votes
3
answers
2k
views
Is there a way to specify function parameters and return value as const in dart?
I wrote an extension function to add SizedBox between every child in Column or Row to add space between child, instead of putting SizedBox between every child, for which I didn't find any other way ...
0
votes
1
answer
115
views
PHP working after Fatal Error in the include file. Error disappear in the try-finally-return
index.php
<?php
function bar()
{
try {
$res = 'loading foo:';
include 'foo.php';
} finally {
return $res . 'finally.';
}
}
$res = bar() . " Why it's ...
3
votes
0
answers
268
views
How to shift focus on the side bar of VSCode programmatically
How to shift focus on the side bar of VSCode programmatically?
Is there any specific command/end-point I can make use of?
I have some custom contributes.viewsContainers, they are not getting over-...
0
votes
1
answer
258
views
C#10: A namespace-scoped Access modifier [duplicate]
As in the title, I would love to see this in C#.
namespace PrivateStuff; //note: filescope namespace here!
public class PartiallyVisibleOutside
{
public int A;
namespace int B;
}
public class ...
1
vote
1
answer
184
views
Pattern match over non-constructor functions
One of the most powerful ways pattern matching and lazy evaluation can come together is to bypass expensive computation. However I am still shocked that Haskell only permits the pattern matching of ...
0
votes
1
answer
100
views
What version of Perl introduced lexical my subroutines?
According to this bug report one of my modules is generating this error on older Perls,
Experimental "my" subs not enabled at <file.pm> ...
What should I set my minimum perl version ...
0
votes
1
answer
695
views
Dart - Is deconstruction the name of the feature that allows to build arrays from for or if statements
Since not everything from dart is an expression (Like Kotlin) I wonder how it is possible that the next code runs:
Example 1
I do a for loop that returns somehow each array item, it's like a ...
2
votes
1
answer
124
views
Why is there no "exists" functions within C++ map?
I find myself sometimes checking to see if an item already exists in a std::map, which I do with the following:
if(myMap.find(item) != myMap.end()) ...
I was wondering why there is not a function ...
1
vote
0
answers
54
views
Why do we allow overflow by default? [duplicate]
I had a theory that casting from long to int with a value greater than int.MaxValue or less than int.MinValue would result in an exception. The issue I had at the time was identifying which type of ...
0
votes
1
answer
117
views
Dart: How to implement a similar situation like "when hashcode() is overridden, ==() should also be overridden"?
When either hashCode() or == operator is overridden in a class, the dart analyzer warns, saying that the other method should also be overridden.
Can I implement a similar case on other methods? Or is ...
0
votes
0
answers
796
views
Is there a clean way in Rust to mutate a `&mut` by replacing its value? [duplicate]
Is there a clean way to implement a safe function g that mutates a mutable reference by applying f on its value without having to implement Clone or Default (or any other special trait) for T? If not, ...
4
votes
1
answer
2k
views
How do you language options in your kivy app
I'm trying to create an app using kivy and would like to add a language option.
I was wondering whether that means that every word the app displays in English has to be manually translated. But that ...
8
votes
2
answers
874
views
Sum types - Why in Haskell is `show (Int | Double)` different than `(show Int) | (show Double)`
Why are these not equivalent?
show $ if someCondition then someInt else some double
and
if someCondition then show someInt else show someDouble
I understand that if you isolate the if ... else part ...
1
vote
1
answer
67
views
What is the name of feature that allows separate function implementations for different values of parameters?
In some programming languages one can specify the function implementation for particular values of arguments:
factorial[x] = x * factorial[x-1]
factorial[0] = 1
Calling the function with 0 will use ...
1
vote
1
answer
172
views
Does C# have something similar to Python's universal newlines
Python's file objects can now support end of line conventions other than the one followed by the platform on which Python is running. Opening a file with the mode 'U' or 'rU' will open a file for ...
-2
votes
2
answers
147
views
Why is `math.Sin` disallowed in a Go constant?
According to Effective Go, the function math.Sin cannot be used to define a constant because that function must happen at run-time.
What is the reasoning behind this limitation? Floating-point ...
3
votes
1
answer
610
views
How is hashing implemented in SGNN (Self-Governing Neural Networks)?
So I've read the paper named Self-Governing Neural Networks for On-Device Short Text Classification which presents an embedding-free approach to projecting words into a neural representation. To quote ...
0
votes
0
answers
86
views
template argument deduction for class templates not working with gcc 8.1.0? [duplicate]
I tried to create vector of properties. This vector supposed to be kind of "mark" that would help distinguish between other tuples.
This simple snippet works on clang 6.0 and does not work on any of ...
0
votes
1
answer
357
views
How to Handle `@WHEN` unsatisfied condition in `cucumber`?
In my case I used cucumber with Junit and in @WHEN i used logic for test.When my test is satisfied then my code goes to @THEN. But when my code is unsatisfied i use org.Junit.Assert.fail() to Fails a ...
0
votes
1
answer
65
views
I need help identifying a programming technique so that I can research and fix it
The Code:
ParentControl.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ParentControl.ascx.cs"
Inherits="ParentControl" %>
<%@ Register Src="~/ChildControl.ascx" TagPrefix="...