move

multi image upload wrong quantity on file-upload

╄→гoц情女王★ 提交于 2019-11-28 14:39:30
i like to upload some images to a directory with the help of arrays. therefore i have this code: $allowedExtensions = array('jpg', 'jpeg', 'png', 'bmp', 'tiff', 'gif'); $maxSize = 2097152; $Dir = "a/b/c/d"; $storageDir = "a/b/c/d/tmp_images"; //Arrays $errors2 = $output = array(); if(!empty($_FILES['image'])){ // Validation loop (I prefer for loops for this specific task) for ($i = 0; isset($_FILES['image']['name'][$i]); $i++) { $fileName = $_FILES['image']['name'][$i]; $fileSize = $_FILES['image']['size'][$i]; /*$fileErr = $_FILES['image']['error'][$i];*/ $fileExt = strtolower(pathinfo(

Why is this not compiling? (RValue as thread CTOR arguments)

只谈情不闲聊 提交于 2019-11-28 11:11:40
问题 Hello here is a test code I wrote on MSVC12. Could someone tell me why the std::move when I pass parameters to the thread are not converting the variabes to RValue refs?? And what I should do. Thank you! ///some arbitrary long task std::string DumpFile(std::string path){ std::this_thread::sleep_for(std::chrono::seconds(10)); return path; } void run_promise(std::promise<std::string> &&_prom, std::string &&_path){ try { std::string val = DumpFile(std::move(_path)); _prom.set_value(val); } catch

Move Constructor vs Copy Elision. Which one gets called?

我的未来我决定 提交于 2019-11-28 10:25:20
I have two pieces of code here to show you. They are two classes and each one provides a Move Constructor and a function which returns a temporary. In the first case, the function returning a temporary calls the Move Constructor In the second case, the function returning a temporary just tells the compiler to perform a copy elision I'm confused: in both cases I define a Move Constructor and a random member function returning a temporary. But the behavior changes, and my question is why . Note that in the following examples, the operator<< was overloaded in order to print a list (in the first

汉诺塔

試著忘記壹切 提交于 2019-11-28 08:58:55
''' 问题: 有三个柱子A、B、C。移动n个盘子从 A -> C 分析: 步骤1: 移动前n-1个盘子 A -> B 步骤2: 移动第n个盘子 A -> C 步骤3: 移动前n-1个盘子 B -> C 实验: (n个盘子从上到下编号:1, 2, 3,...,n) n=2: move 1 A -> B 步骤1:移动前n-1个盘子 A -> B move 2 A -> C 步骤2:移动第n个盘子到 A -> C move 1 B -> C 步骤3:移动前n-1个盘子 B -> C n=3: move 1 A -> C move 2 A -> B move 1 C -> B 移动前n-1个盘子 A -> B move 3 A -> C 移动第n个盘子到 A -> C move 1 B -> A move 2 B -> C move 1 A -> C 移动前n-1个盘子 B -> C n=4: 4 A C 3 A B 4 C B 2 A C 4 B A 3 B C 4 A C 可以看到, 要把盘子A->B 要通过C, 把盘子从B->C要通过A def move(n, start,end, middle) move n start -> middle move n-1 start -> end move n middle-> end if n==1: move 1 A -> C move

php - Differences between copy, rename and move_uploaded_file

£可爱£侵袭症+ 提交于 2019-11-28 07:05:09
问题 Are there differences when I use that functions? Why should I use one instead of the other one... 回答1: copy() copies the file - you now have 2 files, and for large files, this can take very long rename() changes the file's name, which can mean moving it between directories. move_uploaded_file() is basically the same as rename() , but it will only work on files that have been uploaded via PHP's upload mechanism. This is a security feature that prevents users from tricking your script into

Raphael JS : how to move/animate a path object?

拟墨画扇 提交于 2019-11-28 05:32:57
Somehow this doesn't work... var paper = Raphael("test", 500, 500); var testpath = paper.path('M100 100L190 190'); var a = paper.rect(0,0,10,10); a.attr('fill', 'silver'); a.mousedown( function() { testpath.animate({x: 400}, 1000); }); I can move rects this way but not paths, why is that, and how do I move a path object then?! TimDog With the latest version of Raphael, you can do this: var _transformedPath = Raphael.transformPath('M100 100L190 190', 'T400,0'); testpath.animate({path: _transformedPath}, 1000); This saves you from the trouble of having to clone a temp object. Rudu It seems a

move marker on google maps api 2

可紊 提交于 2019-11-28 05:05:45
How do I move marker on Google maps api V2 ? I am using below code but it does not move marker on the map. What am I doing wrong here ? This should work when location changes, so I have added onLocationChanged method and in that, am getting location details and trying to move marker on new details, but this doesn't work. Here is my code: import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GooglePlayServicesUtil; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.model

Usage of std::forward vs std::move

点点圈 提交于 2019-11-28 03:33:05
I always read that std::forward is only for use with template parameters. However, I was asking myself why. See the following example: void ImageView::setImage(const Image& image){ _image = image; } void ImageView::setImage(Image&& image){ _image = std::move(image); } Those are two functions which basically do the same; one takes an l-value reference, the other an r-value reference. Now, I thought since std::forward is supposed to return an l-value reference if the argument is an l-value reference and an r-value reference if the argument is one, this code could be simplified to something like

Move column by name to front of table in pandas

删除回忆录丶 提交于 2019-11-28 03:32:44
Here is my df: Net Upper Lower Mid Zsore Answer option More than once a day 0% 0.22% -0.12% 2 65 Once a day 0% 0.32% -0.19% 3 45 Several times a week 2% 2.45% 1.10% 4 78 Once a week 1% 1.63% -0.40% 6 65 How can I move a column by name ("Mid") to the front of the table, index 0. This is what it needs to look like: Mid Upper Lower Net Zsore Answer option More than once a day 2 0.22% -0.12% 0% 65 Once a day 3 0.32% -0.19% 0% 45 Several times a week 4 2.45% 1.10% 2% 78 Once a week 6 1.63% -0.40% 1% 65 My current code moves the column by index via "df.columns.tolist()" but Id like to shift it by

Visual C#: Move multiple files with the same extensions into another directory

前提是你 提交于 2019-11-28 00:14:10
guys. I've got a problem I can't solve: I have a 2 folders I choose with folderBrowserDialog and tons of files in source directory I need to move to the target directory. But, I have only to move files with a specific extension like .txt or any other extension I can get from textbox. So how can I do it? First get all the files with specified extension using Directory.GetFiles() and then iterate through each files in the list and move them to target directory. //Assume user types .txt into textbox string fileExtension = "*" + textbox1.Text; string[] txtFiles = Directory.GetFiles("Source Path",