3,454 questions
-5
votes
0
answers
76
views
How can I migrate the Tapp AMM exchange on move smart contract? [closed]
Can anyone teach me what is the issue in the following code lines. This is tapp exchange migration script in move smart contract.
let data = vector::empty<u8>();
// pool id (32 bytes)
vector::...
1
vote
1
answer
97
views
How to split a slice at a given index, then move the remaining elements into a boxed slice without copying or cloning?
We have a boxed slice of an arbitrary type T. I'd like to slice it at a given index, then move the remaining elements after the index into a new Box<[T]>. It's fine if the original Box<[T]>...
0
votes
0
answers
56
views
How to input multiple type args in the SUI CLIENT PTB CLI
I have a function that requires 2 type arguments. In the PTB CLI I have tried all the below to no avail:
--move-call $PACKAGE::escrow::swap "<$TYPEARG> <$TYPEARG>" @$ESCROW @$KEY ...
0
votes
2
answers
221
views
Will moving a map inside an object create a memory leak?
I have a generic collection class that's a wrapper on top of different data types.
In this intersection function I created a new object in order to avoid the map::erase() as a small optimization, ...
0
votes
0
answers
48
views
Move features and preserve spatial relationsips with maplibre
I'm moving all polyline features around a centre to a new center. How can I ensure that their spatial relationships are preserved after the features have been moved?
It seems I would calculate the ...
2
votes
0
answers
105
views
How does Sui’s one-time witness (OTW) guarantee single initialization at the protocol level?
Sui Move’s one-time witness (OTW) pattern ensures a module’s init function runs exactly once.
From Move documentation
The OTW is a special type of Witness that can be used only once. It
cannot be ...
2
votes
1
answer
118
views
Why are there no rvalue ref-qualified begin() overloads in STL containers?
In the following code:
#include <vector>
int main() {
using vec_t = std::vector<int>;
vec_t v;
auto it1{std::move(v).begin()};// type is vec_t::iterator
auto it2{std::...
2
votes
1
answer
78
views
Moving Group-Element to numeric-edited field vs moving alphanumeric field to numeric field
When trying to make a Date readable we sometimes use numeric-edited field,e.g.
01 Date-Readable pic 99.99.99.
Decimal-Point is comma is in effect.
Although this solution is not how the decimal point ...
1
vote
0
answers
32
views
move a geometry line next to another by a distance with postgis?
I would like to move a geometry line next to another by a distance using PostGIS. The ST_OffsetCurve function allows you to move the geometry, but sometimes the movement is done in the opposite ...
0
votes
1
answer
104
views
Aptos Unit Testing Account Initializations
I'm posting my problem here as I'm new to Aptos and I'm facing an issue I havn't found any solution online before. I've recently joined a team and they are codding using Move that basic multisig ...
1
vote
1
answer
64
views
How to convert RefCell<Box<dyn std::io::Write>> to owned File? [duplicate]
I want to move a File datatype from one struct into another and then drop the original struct.
I have a data structure with a logger of type RefCell<Box<dyn std::io::Write>>
pub struct ...
1
vote
2
answers
92
views
Click shape to move forward and back in cells of the same row
I have a table with data in date format (day/month/year) distributed in row 6 and in several columns that go from E6 to NE6.
That is, E6 = 01/01/2025 and NE6 = 12/31/2025.
To advance between these ...
0
votes
1
answer
109
views
move an image between two canvases in python
I would like to ask how can I move one image from upper canvas to lower canvas in python?
here is my code which I would like to move an image from upper canvas to lower canvas:
from tkinter import *
...
2
votes
3
answers
157
views
How to move elements from std::map to std::vector
I have a std::map which contains a bunch of key value pairs. I want move these elements into a std::vector. I tried using std::transform from <algorithm> to do this, but it doesn't work. Here's ...
-1
votes
1
answer
41
views
Calculate MaxVelocity after AddForce
I am making a game in which i have a few Balls moving on their own and never stopping. Now I tried to add a Forcefield which should redirect the balls, which I did with AddForce:
ball.gameObject....
1
vote
3
answers
241
views
What is the difference between `transfer::share_object` vs `transfer::public_share_object` in Sui Move?
What is the difference between transfer::share_object vs transfer::public_share_object in Sui Move?
I need to create a shared object which can be only modified in the same package but others cannot ...
1
vote
0
answers
64
views
Can I get a list of all items in bag collection of Sui Move?
I need to fetch a list of all items of a bag collection after adding items. Is there a way or an alternative way to fetch a list?
I tried to find a method from Move docs but it does not have methods ...
0
votes
0
answers
39
views
Is it possible to retrieve resource_account signer out of the module address? move on aptos
I started learning move language on aptos blockchain by solving programming quests on overmind.xyz
This is an example:
https://github.com/overmind-xyz/heads-up/blob/main/sources/coin_flip.move
I ...
5
votes
1
answer
150
views
Why does one call of this function use NRVO while another call of the same function does not?
vector is a struct with two public members X and Y; a parameterized constructor that prints integer constructor called; a copy constructor that prints copy constructor called; and a move constructor ...
0
votes
0
answers
66
views
Utilize copy/move elision with a never again used reference
This has been bothering me for some time. Say we have a constructor that takes many parameters (copies or rvalues):
Object(A a, B b, C c, D d, ...);
When you need to use this constructor you can do ...
0
votes
1
answer
99
views
If I pass a const char* to std::vector<std::string>'s push_back, will it be copied or moved?
In this code (using C++17), will "abc" be used to create a std::string temporary object and then copied into letters by push_back, or will it be moved ?
Is it more efficient to use push_back ...
2
votes
1
answer
123
views
In Rust what happens if you move an object a Box points to?
In the following code 'Drop' is being called only once:
#[derive(Default)]
struct MyStruct
{
my_int: i32,
my_vec: Vec<i32>,
}
impl Drop for MyStruct {
fn drop(&mut self) {
...
0
votes
0
answers
43
views
How do I switch between a dash and automatic movement without creating an infinite loop?
I'm attempting to make a cube dash when the spacebar is pressed. I already have automatic movement in a random direction set up when the code starts executing. However I am uncertain how to switch ...
0
votes
1
answer
142
views
"Failed to borrow global resource" error while trying to get timestamp
I got a problem while writing an unit test for my module, and I realize that I can't get timestamp in unit test. I tried to get timestamp in the below code,
#[test]
fun get_seconds() {
...
0
votes
0
answers
71
views
Is moving a member and lifetime prolongation guaranteed in this C++ snippet?
I have the following code snippet:
#include <iostream>
#include <array>
struct Matrix
{
struct Proxy
{
Proxy(Matrix& m) : m_ { m } {}
Proxy(Proxy&& rhs)...
1
vote
1
answer
156
views
move constructor of std::vector
I have discovered an interesting problem that I am unsure of the reason. Here is my code:
#include<vector>
#include<iostream>
using namespace std;
std::vector<int>&& fun_1()
...
0
votes
1
answer
60
views
Unhiding Parent and Children Sheets and move to Right of Index Sheet
I am calling the Parent sheet with the Listbox, and the Parent Sheet should be moved to the right of the "Index" Sheet, and then the Case Statement with the Array Sheets, which are the ...
-1
votes
1
answer
1k
views
MacOS Sequoia keyboard shortcut to move a window between different screens [closed]
I have three screens on my computer but I only use one of them when I am sharing my screen in a meeting, I want a quick keyboard shortcut to move the window to the screen I am using to share.
I used ...
0
votes
2
answers
629
views
Make Snake move smoother, look like Google Snake in unity
Trying to make a snake game, but my version is a little complex, because I am not using a single green or black box for snake, I use different sprites for snake head, tail, body, and corner like this. ...
1
vote
1
answer
56
views
Delete entry from the spreadsheet and move the particular data field to other spreadsheet
I have 2 spreasheets in excel file where I enter the daily objects to be completed in spreadsheet 1 and master data in spreadsheet 2 ( where the the objects which are completed are stored )
As of now, ...
2
votes
0
answers
65
views
How can i delegate signer capability to another account / smart contract in aptos?
I need to delegate the authority of some of my token to another account or smart contract in aptos
I searched and found there is a function called offer_signer_capability but my question is how can i ...
0
votes
1
answer
123
views
VBA code to rotate a list of positions/names on two columns, one row up (top row will fall last) but not to include blank cells
VBA code that can rotate in sync up one row two columns with positions/names so that the top row will always fall down on last position. The code should ignore the blank cells and only rotate the ...
1
vote
1
answer
82
views
C++17 copy elision rules and implicitly move
There is the following piece of code
#include <iostream>
class A {
public:
A() {}
// Explicit move constructor
A(A&&) noexcept {
std::cout << "move ctor&...
0
votes
3
answers
126
views
Batch command to move files which names contain a certain amount of alphanumeric characters
I have hundreds of files that when created generate a random file name with either 15 character or 32 character. I need to target only the 32 character files to move. I need this to be a batch command....
1
vote
1
answer
135
views
In C++, what happens under the hood when an rvalue of a move-only type is passed to a function by value?
I am trying to understand value categories in C++ a bit better, and I encountered some code that got me a bit confused.
I looked at some questions such as Accept move-only parameter by value or rvalue ...
-1
votes
1
answer
103
views
pass std::unique_ptr to std::bind
if i pass simple int or string all is okay. but when i pass unique_ptr it moves inside bind object (bind_f) and i can't call bind_f();
#include <iostream>
#include <memory>
#include <...
-3
votes
1
answer
101
views
Understanding when a compiler copies, moves or constructs in place [closed]
I've been reading up on copy and move semantics to improve my knowledge of when to use T vs T const & vs T &&
I wrote a small bit of test code to verify my intuition
#include <iostream&...
0
votes
2
answers
132
views
how to make a restriction on movement along the boundaries of the camera in unity
please help me introduce a restriction on player movement along the boundaries of the camera. At first I just used box collider 2d, but the enemies are bumping into it. And as the phone screen changes,...
0
votes
1
answer
59
views
How to move focus between wpf images?
enter image description here
Hello, there are several images. One image is in focus and has a red border.
I want the border to move to the next image when the right or left side is selected with the ...
3
votes
2
answers
178
views
Use after move in function call
When exactly does an object cast with std::moved get moved?
For instance, does the following code constitute use after move?
f(std::move(a), a.Something())
Where f = f(A a, int x) and a is an ...
0
votes
3
answers
180
views
Returning an object with only explicit move constructor
The following code would not compile:
#include <utility>
class Foo{
public:
Foo(const Foo& foo) = delete;
explicit Foo(Foo&& foo) = default;
Foo() = default;
Foo ...
0
votes
1
answer
681
views
'mv' is not recognized as an internal or external command
Why does this code work, only when I replace the mv with move?
forfiless /c "cmd /c mv @FILE @FNAME_changed.@EXT"
Generally the short form mv works just well, but when I use it with the ...
1
vote
1
answer
76
views
Is there a way to call the default move operator from a non-default one?
I have this class:
struct Handle
{
int* ptr_to_something;
void operator=(Handle&& other)
{
ptr_to_something = other.ptr_to_something;
this->member1 = other....
0
votes
2
answers
515
views
how to copy formulas into a new sheet using office-script
I am new to office-script and I have tried to work on this issue with ChatGPT, but this was not helpful at all. :-(
I am trying to copy rows from one sheet to another with the code below, but this ...
3
votes
1
answer
173
views
If I do not declare move constructor, the copy one is called, but if I delete the move constructor - compilation error - why?
struct X
{
X() = default;
X(const X& src)
{
cout << "copy" << endl;
}
};
int main()
{
X x1;
X x2(move(x1));
}
Output:
copy
struct ...
1
vote
0
answers
45
views
how to drag item lists using angular cdkDropList
html:
<table class="normal_table white" nzTemplateMode>
<thead>
<tr>
<th>Category</th>
<th>Items</th>
...
0
votes
2
answers
102
views
Inserting a class in std::map using only move constructor
I have a class that doesn't implement neither a default constructor, nor a copy constructor, just a move constructor, and inside a function I want to insert a new instance of this class into a std::...
1
vote
1
answer
165
views
GCC Address sanitizer bug or invalid move?
I have a boost::asio::io_context that I want to move around. Since I cannot move it without a pointer, I use an std::unique_ptr. However, I noticed that when running with -fsanitize=address heap-use-...
0
votes
2
answers
60
views
How to reuse small parsers in `alt` when they cannot `move`?
As an example I want to parse a string that can either be 2 dot-separated words or a single word. Each "word" is a combination of alphanumeric and underscore characters, so I write the word-...
5
votes
1
answer
117
views
c++ thread function accepts class object by value: why is move constructor called?
#include <iostream>
#include <thread>
template<int Num>
class MyClass {
public:
MyClass(int val) : val_(val) {}
// Copy constructor
MyClass(const MyClass& other) : ...