2,208 questions
Best practices
0
votes
4
replies
105
views
How to properly implement target requirements in game?
I'm a self-taught beginner learning through trial and error. I'm working on a card game in Unity (C#), and I'm trying to design a clean and extensible system for validating targets during gameplay.
...
1
vote
1
answer
102
views
call/cc and multiple values
I'm playing around with implementing looping using call/cc and wrote a map function like this:
(define (map1 f l)
((lambda (state)
(let ((cc (car state))
(l (cadr state))
(...
1
vote
0
answers
92
views
How does Python represent slices in various cases?
Consider
l = [1, 2, 3, 4, 5]
print(l is l[:])
t = (1, 2, 3, 4, 5)
print(t is t[:])
print(t[1:] is t[1:])
print('aa'[1:] is 'aa'[1:])
print('aaa'[1:] is 'aaa'[1:])
The result is, somewhat surprisingly,...
1
vote
0
answers
44
views
Could not find method implementation() for arguments [com.firebaseui:firebase-ui-auth:8.0.2]
First of all, I am new to developing applications with flutter. I am developing my project in android studio. When I select windows(desktop) as the flutter device, my application works without any ...
-1
votes
1
answer
52
views
typical implementation of read/write permissions in file reading code
Every language I've done some form of file handling in has some form of read/write specification when interacting with a file, something like
open_file(file_name, read=true)
Is this typically ...
-2
votes
1
answer
95
views
How should I implement Fuzzing techniques presented in "The Fuzzing Book"? [closed]
I am currently reading "The Fuzzing Book" and I am trying to determine how I should apply or implement the fuzzing techniques that I have learned from the book. For instance, in the book, ...
0
votes
0
answers
85
views
AndAdMob 'No Fill' Error: Live Ads Not Loading After Multiple Account Changes
I have a Play Console account since 2018, and I have implemented AdMob ads three times. Initially, the ads ran fine, but after some time, I started receiving the following message:
Failed to load ad:
{...
1
vote
0
answers
87
views
How to have different implementation for tuple of references vs tuple of values
I'm trying to write an ECS system that can query components by value, reference, or mutable reference. For this, I want a different implementation for various tuple types as an Archetype.
trait ...
0
votes
2
answers
102
views
How to implement `tail -1` in Python
I have some very big files (more than 100 millions lines).
And I need to read their last line.
As I 'm a Linux user, in a shell/script I use 'tail' for that.
Is there a way to rapidly read the last ...
1
vote
2
answers
283
views
Custom k-Nearest Neighbor (kNN) slow implementation
I'm writing for an advice about a kNN implementation I made.
I'm studying a dataset representing a multiple choice question exam and my variable are an identifier of the student, the course, the year ...
0
votes
1
answer
215
views
nrzi signal decoding implementation in python - whats wrong?
solving simple nrzi python decoding. 0 bit means no changed occurred but 1 bit means a change occurred in digital signal sequence.
"_": low signal
'¯': high signal
"|": pipe signal(...
3
votes
1
answer
717
views
How does boost::asio::yield_context work?
I'm reading through the documentation for boost::asio and came across this example:
void foo(boost::asio::yield_context yield)
{
size_t n = socket.async_read_some(buffer, yield);
// ...
}
I am ...
3
votes
1
answer
179
views
do, ?do and loop implementation
The DO ... LOOP execute always at least one time. If I want to skip execution when limit = index, I can put the loop inside a if ... then :
2DUP <> IF DO ... LOOP THEN
The recommended ...
2
votes
1
answer
96
views
What is the advantage of adding a static "builder()" method in the Builder Pattern? [closed]
I'm wondering about whether my implementation of the Builder pattern is wrong or not.
Let's say we have a User class for which we want to have a Builder, my implementation would be:
public class User
{...
0
votes
0
answers
47
views
Binary Search in Java personalized implementation not working properly
Why is my code not working though I've tried dry running it 1000 times, but still I'm not able to find my doubt, maybe I'm short of the knowledge which will help me find the mistake, can anybody help ...
2
votes
1
answer
88
views
How to Transform a 2D Array In-Place Without Using an Additional Array in C#?
I’m trying to shift the elements of a 2D array to the right and down by one position without using an additional temporary array. Here’s the current implementation using a temporary array:
public ...
0
votes
0
answers
139
views
T-SQL ENCRYPTBYPASSPHRASE key derivation procedure [duplicate]
ENCRYPTBYPASSPHRASE in T-SQL takes a passphrase as a parameter. I'm wanting to encrypt some data in the same way outside of SQL server, in such a way as said data may be decrypted using the ...
2
votes
0
answers
552
views
IntelliJ not detecting gradle implementation project
I have this gradle project with 4 subprojects inside. I use one of them as a library for the other 3. I can do a gradle build just fine, but IntelliJ doesn't detect it:
Unresolved imports
My root ...
0
votes
1
answer
549
views
Missing implementation (but help message says I have implemented it)
I'm writing a tonic middleware to load application state into a gRPC handler, and I cannot get my app to serve with the middleware layer
I've double-checked the types and looked at many examples and I ...
0
votes
1
answer
388
views
How to immediately apply DISPLAYCONFIG_SCALING display scaling mode with SetDisplayConfig and DISPLAYCONFIG_PATH_TARGET_INFO
I am currently trying to use SetDisplayConfig from winuser.h to immediately apply a "Preserve aspect ratio" display scaling mode for the active display mode, but I can't seem to get the ...
-1
votes
1
answer
50
views
DFS Recursion, why save results instead of running it again
I was doing this leetcode question https://leetcode.com/problems/binary-tree-cameras/.
Here is the solution that passes:
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, ...
0
votes
0
answers
40
views
Is there a way to encapsulate certain properties in a Swift protocol so they aren't visible to users of the protocol?
I am looking for a way to encapsulate certain properties in a Swift protocol to hide them from users of the protocol while making them available to types implementing the protocol.
Here is a simple ...
0
votes
1
answer
161
views
how can i generate this series of sequence using recursion?
the question goes like this
We define sequences
Sn as follows.
S1
is a sequence of length 1 containing a single 1.
Sn(n is an integer greater than or equal to 2) is a sequence obtained by ...
-1
votes
1
answer
90
views
Why does the string class have the parameterless constructor and the constructor that takes a string literal as argument?
The String constructor that takes a string literal argument has the following implementation.
@IntrinsicCandidate
public String(String original) {
this.value = original.value;
...
3
votes
1
answer
230
views
How can I return an impl trait from a function dynamically when this trait contains a method which returns itself an impl trait?
As the following code shows:
trait T2impl {}
struct S4T2impl;
impl T2impl for S4T2impl{}
trait TimplMethod {
fn f() -> impl T2impl;
}
struct S4TimplMethod;
impl TimplMethod ...