move

Moving a class derived from istream

拥有回忆 提交于 2019-12-11 05:29:12
问题 I'm creating a C++ istream with a custom streambuf . Trying to move this fails because the istream move constructor is protected. To get round this I derived a class from istream : struct VectorCharBuf : public streambuf { VectorCharBuf(vector<char>& v) { setg(v.data(), v.data(), v.data() + v.size()); } }; struct IVectorCharStream : public istream { IVectorCharStream(VectorCharBuf* contents_buf) : istream(contents_buf) {} }; The default move constructor for this class is not generated because

FileSystemWatcher detect when file is moved to folder

那年仲夏 提交于 2019-12-11 04:42:18
问题 I'm having trouble with a script that's monitoring a folder. FileSystemWatcher only seems to detect when a file is being copied to the folder, not when it's just being moved to it from the same drive. Is there a way to detect this? $desFolder = "H:\Media" $ExFolder = "H:\Monitor" $Filter = '*.*' $fsw = New-Object IO.FileSystemWatcher $ExFolder, $Filter $fsw.IncludeSubdirectories = $true $fswOnChange = Register-ObjectEvent -InputObject $fsw -EventName Changed -SourceIdentifier FileUpdated

Move data from one table to another

核能气质少年 提交于 2019-12-11 04:35:19
问题 This question seems to be answered multiple times. However none match the criteria I need. Is it possible to select (and insert them in another table) and delete rows from the original table in Mysql without running the selected criteria twice? For example I could do this: INSERT INTO main (SELECT * FROM temp WHERE age > 30) DELETE FROM cache WHERE age > 30 However with a very complex and long running query the 'match part' of the query would be executed twice, whilst I think that there

Pygame, move a square on the screen, but can not erase the previous movements

…衆ロ難τιáo~ 提交于 2019-12-11 04:24:30
问题 This is my first post in StackOverflow, hope you guys can help a newbie programmer. It's Pygame Python simple ask. I am trying to move a square on the screen, but can not erase the previous movements. import pygame pygame.init() screen = pygame.display.set_mode((400,300)) pygame.display.set_caption("shield hacking") JogoAtivo = True GAME_BEGIN = False # Speed in pixels per frame x_speed = 0 y_speed = 0 cordX = 10 cordY = 100 def desenha(): quadrado = pygame.Rect(cordX, cordY ,50, 52) pygame

Is there any way to stop the tabs coming up with the keyboard in android?

穿精又带淫゛_ 提交于 2019-12-11 04:19:10
问题 I am making an app that supports all versions of android (just in case it is relevant), but when the user clicks on an app, the keyboard pops up and moves the tabs with it. Is there anyway to stop the tabs from doing this? 回答1: Try giving android:windowSoftInputMode="adjustPan" inside the manifest file for the activity. 回答2: write this android:windowSoftInputMode="adjustPan" in tabActivity class in manifest file. 来源: https://stackoverflow.com/questions/4956993/is-there-any-way-to-stop-the

Move first element of Vector to last element

故事扮演 提交于 2019-12-11 04:14:13
问题 I want to move first element of vector to the end of vector. v = {1,2,3,4} after this should be like this v= {2,3,4,1} my compiler version is gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1) I know in Vc11 we can use std::move to move element. but how can I do this in above version of compiler? 回答1: There's a std::rotate algorithm in the standard library: std::rotate(ObjectToRotate.begin(), ObjectToRotate.end()-1, // this will be the new first element ObjectToRotate.end()); 回答2: You should

HTML download movie download link

喜夏-厌秋 提交于 2019-12-11 04:07:58
问题 I want a user to be able to hit a button which triggers a .mov file to download. Linking to the file its self just causes the movie to play in a new page. I have tried this: <a onclick="document.execCommand('SaveAs',true,'assets/files/mymovie.mov');" href="javascript:void(0);"> But this does not seem to work. Can anyone point me in the right direction? Thanks 回答1: You can try the html5 download attribute. <a href='assets/files/mymovie.mov' download> 回答2: In addition to Musa's answer: Try

How to “move” Eigen::VectorXd s

我们两清 提交于 2019-12-11 03:41:20
问题 A commenter in a recent post of mine told me I need to utilize c++11 move-semantics better to deal with a bottleneck in my code. Below is a simplified version of what needs to be fixed. #include <iostream> #include <Eigen/Dense> #include <vector> void makeCopy(std::vector<Eigen::VectorXd> &oldV){ int n = oldV.size(); std::vector<Eigen::VectorXd> mandatoryCopy; mandatoryCopy.resize(n); for(int i = 0; i < n; i++){ mandatoryCopy[i] = oldV[i]; } // swap the two oldV = mandatoryCopy; } int main

Can't rename directory in C# but manually

徘徊边缘 提交于 2019-12-11 03:34:18
问题 I'm using Directory.Move(oldDir, newDir) to rename a directory. Every now and then I get a IOException saying "Access to the path "oldDir" is denied" . However if I right click the directory in the explorer I can rename it without any issues. How's that and how can I get it to work? EDIT The program is still running, I get the exception and can rename it manually while my cursor is paused on the breakpoint. I also tried setting a breakpoint at Directory.Move , successfully renamed the

c++11: how to understand the function move

与世无争的帅哥 提交于 2019-12-11 01:08:04
问题 I can't understand the function move in c++11. From here, I got things below: Although note that -in the standard library- moving implies that the moved-from object is left in a valid but unspecified state. Which means that, after such an operation, the value of the moved-from object should only be destroyed or assigned a new value ; accessing it otherwise yields an unspecified value. In my opinion, after move(), the moved-from object has been "clear". However, I've done a test below: std: