2,544 questions
Advice
0 votes
1 replies
48 views
Swap full but all process terminated : does Linux free "orphans" pages when needed?
this is the first time I encounter a swap issue, I'm lost about how Linux is supposed to behave. I have a RHEL virtual machine running a batch processing RAM intensive application (100+GB RAM, 1GB ...
5 votes
4 answers
245 views
How to efficiently swap two parts of string without allocation? [closed]
I have a long string. In the string, I have two non-overlapping parts. They can have a gap between them. The lengths can be different. For example a string: This is a "foo", that is a "...
1 vote
1 answer
228 views
Are swaps allowed to self-check?
While checking &other != this is generally not a good idea in move/copy assignment and the copy-and-swap idiom should be preferred, is it allowed for a swap to perform such a check? Copy-and-swap ...
5 votes
2 answers
180 views
What is the rationale behind container types in std defining their own swap function even if their move-semantics have been correctly implemented?
Below is the most common implementation of std::swap: template<typename T> void std::swap(T& a, T& b) { auto tmp = std::move(a); a = std::move(b); b = std::move(...
4 votes
1 answer
81 views
A wait-free consensus algorithm for three processes, with a swap object and the fetch-and-increment object together in one atomic step
We know that a swap object consists of a shared register and supports a swap operation between the shared register and any local register, which atomically exchanges the values of the two registers. A ...
0 votes
0 answers
67 views
Why 1inch Swap API returns 3% less than estimated [AggregationRouterV6]
Can it be an error in configuration or swap routing(may be because of partial fill?) that I've got too low output from 1inch aggregation router v6? Example of transaction: https://arbiscan.io/tx/...
0 votes
1 answer
116 views
Solana Payment Gateway swaping issue
I am developing a payment gateway on Solana and need to swap tokens programmatically using Node.js. Currently, I am testing SOL to USDC swaps with the Jupiter API. Everything works until generating ...
1 vote
2 answers
72 views
Swapping strings or values in grouped data based on condition
The following data frame is grouped by the id variable. For each id on variables X, Y, and Z, I wish to replace "no" with "yes" on the first row if and only if the specific id has &...
0 votes
0 answers
61 views
When should I implement a swap() function for my class? [duplicate]
Suppose I'm writing a class intended not just for my private use, but for others to use as well (e.g. it's exposed in a library I'm writing or modifying). Let's suppose also that it's not a singleton. ...
1 vote
0 answers
57 views
Bytes reversing and swaping in nodejs
Context I have a file of binary logs and each log is 7 bytes. The first 4 bytes is a timestamp (writeUInt32BE), the following 1 byte is an indicator (num 1 or 2 using writeUInt8) and the last 2 bytes ...
4 votes
4 answers
265 views
Swap the first and the last words and reverse all the middle characters
Description Guru gave a task to his students. He gave a sentence, and the students have to swap the first and the last words and reverse all the characters between those words. Help the students ...
0 votes
0 answers
289 views
Error when fetching pool keys from Raydium_py Solana
I’m working with a public GitHub repo (you can find it here: https://github.com/AL-THE-BOT-FATHER/raydium_py) that interacts with the Raydium decentralized exchange using Python. I’m trying to fetch ...
0 votes
0 answers
116 views
What is the 'executor' parameter in 1inch AggregationRouterV6 (or 'caller' in older versions)
I am using 1inch swap aggregator smart contract to swap some amount of a token to another one. As 1inch described here in AggregationRouterV6 contract we can use the function swap as follows: function ...
0 votes
0 answers
63 views
Intuition for convexity adjustment for year on year inflation swaps
I am trying to understand the intuition behind why a convexity adjustment is required when calculating the YoY rate on inflation swaps. (Assume no lags for simplicity). The current inflation index is ...
-4 votes
1 answer
65 views
Swap 2 lines in text file using assembler
this is my code for swapping 2 lines in DosBox assembly. I can not find out why is it printing the same thing from input.txt to out.txt. I think the problem is with line numbers (and user input). ...