move

System.IO.File.Delete() / System.IO.File.Move() sometimes does not work

蹲街弑〆低调 提交于 2019-12-07 07:44:27
问题 A Winforms program needs to save some run time information to an XML file. The file can sometimes be a couple of hundred kilobytes in size. During beta testing we found some users would not hesitate to terminate processes seemingly at random and occasionally causing the file to be half written and therefore corrupted. As such, we changed the algorithm to save to a temp file and then to delete the real file and do a move. Our code currently looks like this.. private void Save() { XmlTextWriter

move,scale and crop the image in android like facebook profile picture

瘦欲@ 提交于 2019-12-07 00:31:48
问题 I want crop an image in my application.I tried a lot but not succeed. Its challenge to android developer. Is there any idea or reference to implement the features move,scale and crop the image in android like facebook upload profile pic. Now i am able to move, scale and crop and the image.But not consistant like facebook.I want to set fix image scale based on orientation.I attached the screen shot-3. My code as below:- crop_image.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns

Is value returned by std::unique_ptr::get valid after moving unique_ptr?

余生长醉 提交于 2019-12-06 19:52:11
问题 Consider the following code snippet: class Owner { public: Owner(std::unique_ptr<int> ptr) : owned_pointer<int>(std:move(ptr)) {} private: std::unique_ptr<int> owned_pointer; }; std::unique_ptr<int> ptr(new int); int* ptr1 = ptr.get(); Owner new_owner(std::move(ptr)); Is it safe to assume that ptr1 is valid as long as new_owner stays in scope? It seems to work, but I can't find a specification that states that explicitly - is it undefined behavior/implementation specific and just happen to

move files with specific extension to folder in higher hierarchy

泄露秘密 提交于 2019-12-06 16:43:43
All my files are in specific folders: 17\1\1\PRO 17\1\2\PRO 17\2\1\PRO xx\xx\xx\PRO 17 is the year (so 18 for next year etc) the first 1 is the folder specifying the case number (can be up to 100). The second 1 is the sub parts on the case number. That last 1 has a folder PRO in it where all data resides. We need to move these files, but the files need to stay inside their respective "PRO" folders. For example: a file in 17\1\1\pro\xxx\www\ needs to go to 17\1\1\pro\movies a file in 17\2\2\pro\xxdfsdf\eeee\ needs to go to 17\2\2\pro\movies . The movies folder should get created if there are

Problems with moving my Wordpress site to another domain/server

[亡魂溺海] 提交于 2019-12-06 14:43:50
问题 I'm having problems moving a wordpress site from one domain to another. I've searched the site but couldn find a useful answer for my situation. Here's what i did: I made a backup of the website. Then i exported the database. Then i installed Wordpress on the other domain. Then i copied all my Wordpress files of the old website on the new server overwriting the new installation. Then i deleted everything from the database on the new server and imported the database of the old server. Then i

move datagridview Row to another datagridView

独自空忆成欢 提交于 2019-12-06 12:51:48
I've gone through the other answers for this kind of question, nothing has really worked well so far. I have a foreach loop that should add the the row from the source datagridview to the destination datagridview then remove that row from the source. The invalid operation exception is: Row provided already belongs to a DataGridView control. I couldn't get ...Rows.Copy() to work either. Any ideas? foreach (DataGridViewRow selRow in fromDataGridView.SelectedRows) { toDataGridView.Rows.Add(selRow); fromDataGridView.Rows.Remove(selRow); } Roy Goode You need to remove the row from fromDataGridView

Is there a way to make Android tabs slide?

隐身守侯 提交于 2019-12-06 12:35:48
问题 I'm new to Android development, and I was wondering if anyone knew either how to make Tabs slide, or how to get a similar effect without tabs. I have quite a few tabs in my application, and it does not look good on devices with smaller screens. Or maybe tabs are not what I am looking for. If you don't know what I'm talking about, I'd like to reproduce something similar to Photoshop.com Mobile's effects screen. I know this is possible. Thanks in advance! 回答1: I haven't experimented w/ sliding

Automatic generated move operations and raw pointer members

别说谁变了你拦得住时间么 提交于 2019-12-06 12:18:21
问题 Consider a MemoryMappedFile class, with the following data members: class MemoryMappedFile { .... private: // RAII wrapper to some OS-specific raw handle (e.g. Win32 HANDLE), // representing the memory-mapped file. Handle m_handle; // Pointer to file begin (first file byte). BYTE* m_first; // Pointer to file end (one byte past last file byte). BYTE* m_last; }; The Handle class is some RAII wrapper to some specific OS raw C-like handle (e.g. think of Win32 HANDLE ). It is not copyable, but it

Move (drag/pan) and zoom object (image or div) in pure js

时间秒杀一切 提交于 2019-12-06 12:13:21
问题 I'm working on a little script that makes an object (div or img) moveable and zoomable within a given frame. However I came across a few problems I'm not really sure of, because I'm a javascript beginner - so explanation of why those problems occure would be appreciated. Problems: Calling the functions start_drag() , while_drag() and stop_drag() returns undefined - why is that? What should be returned? The dragging and moving of the image does not work correctly - instead of clicking the

jQuery: move table row to first position and then back

可紊 提交于 2019-12-06 10:15:03
I need to move a table row from a position to the first in the table and after clicking again to the old position. I have a list of checkboxes in a table. These are coming from code behind and are already sorted. If I click on a checkbox, I want to move this entry to the begin of the list. If the users unchecks this box or clicks on another box, it shall be moved to the old position. for better understanding: [ ] 1 [ ] 3 [ ] A [ ] B [ ] C After clicking on e.g. [ ] C : [X] C [ ] 1 [ ] 3 [ ] A [ ] B After clicking on e.g. [ ] 3 C has got the old position and 3 has moved to the top. [X] 3 [ ] 1