Skip to main content
-1 votes
4 answers
117 views

I'm migrating a blog from Jekyll (source) to Hugo (source). Both use Markdown, but their syntaxes are slightly different. Let's say that in the old Jekyll blog I have this: {% include image.html src=&...
Antonio Medeiros's user avatar
0 votes
1 answer
126 views

How does one categorize an algorithm like this: def foo(arr): # original_len = len(arr) tmp = [] while arr: tmp.append(arr.pop()) while tmp: arr.append(tmp.pop()) The ...
Mathias Sven's user avatar
0 votes
0 answers
95 views

I am working on my YOLO model. When I try to train my model with the code below an error occured def main(): # Initialize model, loss, and optimizer model = Yolov5(version='l') print(f&...
Hanif Al-Farisi's user avatar
0 votes
0 answers
51 views

I am working on multi-agent DDPG RL model. While running the model, it gives following error. Currently I'm working with the PyTorch version 2.6.0 and torchrl version 0.7.0. ---------------------------...
Samitha's user avatar
  • 11
1 vote
1 answer
143 views

I am having a specific problem in julia, I cannot seem to figure out. I broke down my code to some minimal working example to demonstrate the problem: using BenchmarkTools function f!(u::Vector) ...
User341562's user avatar
0 votes
0 answers
44 views

I need to sort a Dataframe/Series along the Index, and then use searchsorted to find out the iloc of a target value, so as to do a slice. If I do sort_index(ascending=True), I can get the results what ...
Leon's user avatar
  • 2,165
1 vote
0 answers
52 views

I'm very interested in zero-copy operations (and disappointed that memoryview doesn't have all the member functions that bytes does). My application will be pretty intensive in this regard. Consider ...
JimB's user avatar
  • 1,107
2 votes
2 answers
95 views

I am looking for a way, without having to install a new library, to iterate through a Kotlin data class and to change the values according to their type. The implementation I would like is the ...
AvyWam's user avatar
  • 1,012
4 votes
1 answer
154 views

I want to remove zero numbers from the given array that contains a sequence of numbers terminated with last element -1. For example: arr2: .word 0 0 2 0 0 -1 ====> arr: .word 2 -1 arr: .word 0 3 0 ...
Kouroshtkk's user avatar
2 votes
1 answer
119 views

Consider the following C++23 code: #include <tuple> #include <cstdio> #include <iostream> struct W1 { int n; bool b; W1(int x, bool f) : n(x), b(f) {} }; struct W2 { ...
lobelk's user avatar
  • 531
-1 votes
1 answer
55 views

Sample data: data = [[1, '[email protected]'], [2, '[email protected]'], [3, '[email protected]']] person = pd.DataFrame(data, columns=['id', 'email']).astype({'id':'int64', 'email':'object'}) ...
Amazonian's user avatar
  • 462
1 vote
1 answer
348 views

Expressions such as: total_impact += impact in my restricted env are not allowed by default and they cause the error: NameError: name '_inplacevar_' is not defined but I would like to allow such ...
Menas's user avatar
  • 1,289
0 votes
0 answers
72 views

I have the following piece of code: eigvecs = torch.randn(n, b, dtype=eigval_approximations.dtype, device=eigval_approximations.device) eigvecs /= torch.linalg.norm(eigvecs, dim=0) for _ in range(...
Moon's user avatar
  • 336
1 vote
2 answers
142 views

I want create a awk script with a shebang such that ./main.awk text.txt performs in-place modification in text.txt. Inspired by a previous solution, I tried something like #!/usr/bin/awk -i inplace -...
Rubem Pacelli's user avatar
0 votes
1 answer
48 views

I have been pondering the basic big O performance of the functions, in isolation or in collaboration with each other. So IPM(S) is a function that does an in-place merge of S, and IPMS(S) is a ...
Fuzzy Coder's user avatar

15 30 50 per page
1
2 3 4 5
28