2,545 questions
0
votes
0
answers
25
views
Cannot modify swap memory using zram-generator [closed]
I have a Rasperri Pi 5 and I need to increase swap memory to 4GB.
I made sure that zram generator is installed by running:
sudo apt install systemd-zram-generator
and I have ONLY one config file in ...
5
votes
4
answers
244
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 "...
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(...
0
votes
0
answers
66
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/...
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 &...
1
vote
0
answers
53
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 ...
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
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 ...
0
votes
1
answer
43
views
Swap 2 lines in text file with assembler
could someone provide an example how to swap 2 lines in txt document using assembly? I would be using it as an example, because right now i'm able to copy contents from one txt file to another, but ...
0
votes
4
answers
116
views
Python: Decorator to count swaps in sorting algorithms
I want to write a decorator that will count the number of swaps in a sorting algorithm. I created a swap function to swap numbers and a decorator that counts each call to this function. The issues I'...
3
votes
1
answer
1k
views
Can Jupiter api swap and send swapped token to another account?
I am using Jupiter api for my app and on my app I want to swap and directly send the swapped token to merchant account. can I do this on one transaction?
https://station.jup.ag/docs/apis/payments-api
...
1
vote
0
answers
422
views
Solana Raydium SDK Swap with TypeScript
I’m currently working on implementing a swap function that exchanges 0.01 SOL for USDC using the Raydium SDK on the Solana mainnet with TypeScript. I’ve set up the environment, connection, and wallet, ...
0
votes
1
answer
633
views
How to calculate estimate gas fee using wagmi for the swap
I need to calculate estimate gas fee for the swap function using wagmi
import { useEstimateGas } from 'wagmi'
import { parseEther } from 'viem'
import { config } from './config'
function App() {
...
0
votes
1
answer
536
views
SOFR swap NPV and cashflow different from BBG results using Python Quantlib
I'm using python quantlib to price a swap, but the NPV and cashflow result differently from BBG results as all the input controls the same, fixed schedule should be the same but floating cashflow is ...
-5
votes
1
answer
61
views
Why is swapping using function and swapping using assignment produce in different results?
This is the code for Quick sort in which i used assignment to swap the values.
def partion(arr,low,high):
partion_index=low
pivot=arr[partion_index]
while (low < high):
while low < ...
0
votes
0
answers
261
views
Swap tokens on Uniswap v3 with Python code. Error - insufficient funds for gas * price + value
I try to use the following code to exchange tokens on the Uniswap V3 exchanger in the Arbitrum network.
from web3 import Account, Web3
from abi import UNISWAP_V3_ROUTER2_ABI, WETH9_ABI, MIN_ERC20_ABI
...
0
votes
1
answer
391
views
Python Solana bot transaction issues
I’m attempting to create a solana bot that has limit order to buy $MAGA using raydium. However everytime i run the code, the transaction does not go through.
<!-- begin snippet: js hide: false ...
0
votes
0
answers
145
views
Problem to deal with some ERC20 Tokens on Polygon-PoS (USDC, USDT) using Web3.py + Uniswap V3
gm. This is my first post here, i will do my best to be specific.
I started to work and build some python scripts to automate some operations on Polygon-PoS network.
I have the following working:(each ...
0
votes
0
answers
253
views
Current prices of tokens to be exchanged with Pancakeswap
I get the list of pools with Pancakeswap Exchange V3 Subgraph API, but the price information in the pool information does not match the price on the site. Also, as the amount increases, the price on ...
0
votes
3
answers
337
views
using for loops to swap digits
using a for loop i have to write code to swap the 2nd and 3rd digit of a number given via user input in javascript.
for ( i = 0; i < entNum.length; i++) {
if (i === 0) num2 = entNum[i];
...
1
vote
1
answer
1k
views
How to swap in base chain (Eth Layer2)
Hello Stack Overflow Community,
I am working on swapping tokens in a base layer2 network using Uniswap V3 and ethers.js. I have successfully approved the transaction using the approve function, but ...
0
votes
1
answer
42
views
need an function swap for swaping elements
function swap(ev, targetId) {
//Working on a school project and got stuck, was trying to swap .gif like drag and drop
const currentId = ev.dataTransfer.getData("text");
const current = document....
0
votes
1
answer
69
views
Switching values of columns by condition
I would like to rearrange the positions of certain cells in my Excel spreadsheet using R. There are two columns, place_x and place_y, where the coordinates are not correct. I intend to swap some ...
1
vote
1
answer
96
views
Are rvalue references Cpp17MoveConstructible?
Do rvalue references satisfy the Cpp17MoveConstructible requirement?
For this to be the case, in the expression T u = rv;, u would need to be "equivalent" to rv. If T was an rvalue reference ...
0
votes
0
answers
29
views
Label are not scrolled and swap with table and their respectieve rows
cell_icons = {}
image_references = {}
def on_release(event, label, image_path):
if label in dragged_icons:
x, y = event.x_root, event.y_root
x -= table.winfo_rootx()
y -= table....