move

delete NAs to move data up, no stairs anymore

☆樱花仙子☆ 提交于 2020-06-04 02:19:59
问题 The data file that I get from an experiment looks like this VP Selbst ES eigForm eigES andForm andES MM MMRT Wunschform Geschlecht Muttersprache Alter 99 1 unhöflich NA NA NA NA NA NA 99 5 gesellig NA NA NA NA NA NA 99 6 ehrlich NA NA NA NA NA NA 99 NA 5 gründlich NA NA NA NA NA 99 NA 6 treu NA NA NA NA NA 99 NA 5 romantisch NA NA NA NA NA 99 NA NA 6 stark NA NA NA NA 99 NA NA 3 klein NA NA NA NA 99 NA NA 5 rational NA NA NA NA 99 NA ordentlich NA NA ["y"] [0.4] NA NA NA NA 99 NA sentimental

delete NAs to move data up, no stairs anymore

强颜欢笑 提交于 2020-06-04 02:19:40
问题 The data file that I get from an experiment looks like this VP Selbst ES eigForm eigES andForm andES MM MMRT Wunschform Geschlecht Muttersprache Alter 99 1 unhöflich NA NA NA NA NA NA 99 5 gesellig NA NA NA NA NA NA 99 6 ehrlich NA NA NA NA NA NA 99 NA 5 gründlich NA NA NA NA NA 99 NA 6 treu NA NA NA NA NA 99 NA 5 romantisch NA NA NA NA NA 99 NA NA 6 stark NA NA NA NA 99 NA NA 3 klein NA NA NA NA 99 NA NA 5 rational NA NA NA NA 99 NA ordentlich NA NA ["y"] [0.4] NA NA NA NA 99 NA sentimental

Is -Wreturn-std-move clang warning correct in case of objects in the same hierarchy?

穿精又带淫゛_ 提交于 2020-05-15 04:20:52
问题 Consider the following simple code: struct Base { Base() = default; Base(const Base&); Base(Base&&); }; struct Derived : Base { }; Base foo() { Derived derived; return derived; } clang 8.0.0 gives a warning -Wreturn-std-move on it: prog.cc:21:10: warning: local variable 'derived' will be copied despite being returned by name [-Wreturn-std-move] return derived; ^~~~~~~ prog.cc:21:10: note: call 'std::move' explicitly to avoid copying return derived; ^~~~~~~ std::move(derived) But if one called

Move resource in RESTful architecture

不打扰是莪最后的温柔 提交于 2020-05-10 04:28:25
问题 I have a RESTful web service which represent processes and activities. Each activity is inside one and only one process. I would like to represent a "move" operation of activity between the process it is currently in and another process. I've look at forums and found people suggest to use MOVE operation which is not very standard and other suggest to use PUT but then I'm not sure how to tell the difference between PUT that update and PUT that moves which looks semantically wrong. Any ideas?

Move resource in RESTful architecture

家住魔仙堡 提交于 2020-05-10 04:28:06
问题 I have a RESTful web service which represent processes and activities. Each activity is inside one and only one process. I would like to represent a "move" operation of activity between the process it is currently in and another process. I've look at forums and found people suggest to use MOVE operation which is not very standard and other suggest to use PUT but then I'm not sure how to tell the difference between PUT that update and PUT that moves which looks semantically wrong. Any ideas?

How to move undecorated JFrame by holding click on a JPanel in Java? [duplicate]

瘦欲@ 提交于 2020-04-15 04:33:12
问题 This question already has answers here : Drag and Resize undecorated JFrame (2 answers) Closed 5 years ago . I've been making an undecorated JFrame so far and I was wondering if it's possible to move the undecorated JFrame by holding click on a JPanel. Here is the source code I'm working on. private static void createFrame() { JFrame frame = new JFrame("Text Frame"); frame.setLayout(null); frame.setSize(500,300); frame.setUndecorated(true); JPanel panel = new JPanel(); panel.setBounds(0, 2,

How to get a move-only type out of a STL container?

ぐ巨炮叔叔 提交于 2020-04-11 04:27:07
问题 Let's consider an std::unordered_set of std::unique_ptr<T> as an example. Can I move an element of the set elsewhere ? #include <unordered_set> #include <iostream> #include <memory> #include <vector> int main() { std::unordered_set<std::unique_ptr<int>> mySet; mySet.insert(std::make_unique<int>(1)); mySet.insert(std::make_unique<int>(2)); mySet.insert(std::make_unique<int>(3)); std::vector<std::unique_ptr<int>> myVector; for (auto&& element : mySet) { std::cout << *element << std::endl; /

move assignment to object with const value

放肆的年华 提交于 2020-03-23 18:41:13
问题 I have a struct like this: struct OBJ { int x; const int y; OBJ& operator=(OBJ &&oth) { y = oth.y; // this is disallowed return *this; } } And an example code void func() { static OBJ obj; OBJ other; // random values if(conditon) obj = std::move(other); //move } I understand this as obj is Non const OBJ with const member y . I can't change just y but I should be able to change whole object (call destructor and constructor). Is this possible or the only proper solution is to remove my const

move assignment to object with const value

杀马特。学长 韩版系。学妹 提交于 2020-03-23 18:40:22
问题 I have a struct like this: struct OBJ { int x; const int y; OBJ& operator=(OBJ &&oth) { y = oth.y; // this is disallowed return *this; } } And an example code void func() { static OBJ obj; OBJ other; // random values if(conditon) obj = std::move(other); //move } I understand this as obj is Non const OBJ with const member y . I can't change just y but I should be able to change whole object (call destructor and constructor). Is this possible or the only proper solution is to remove my const

Why arguments moved twice when constructing std::thread

烈酒焚心 提交于 2020-03-10 04:18:11
问题 Consider this program that essentially creates std::thread that calls the function func() with arg as argument: #include <thread> #include <iostream> struct foo { foo() = default; foo(const foo&) { std::cout << "copy ctor" << std::endl; } foo(foo&&) noexcept { std::cout << "move ctor" << std::endl; } }; void func(foo){} int main() { foo arg; std::thread th(func, arg); th.join(); } My output is copy ctor move ctor move ctor As far as I understand arg is copied internally in the thread object