copy

Fast methods to copy(move) files in batch file

雨燕双飞 提交于 2020-01-04 14:00:12
问题 I have a massive number of files in one directory that I need to validate. The problem was, the file explorer takes too much time to load the file list and my whole computer becomes slow. So I wrote the following code to group files by moving certain number of files(shown as %limit% and will be 700) to numbered folders(shown as %DirN% ) for /f "tokens=1-2 delims=:" %%a in ('dir /b /a-d ^|findstr /n /v ".bat .cmd .txt"') do if %%a lss %limit% robocopy "%cd%" "%cd%\%DirN%" "%%b" /mov >nul This

Deep copy entity with NHibernate

雨燕双飞 提交于 2020-01-04 05:09:52
问题 I am currently starting a new ASP.NET MVC Project at work where we need to generate a project cost estimate. We are using NHibernate, ASP.NET MVC 1.0 and StructureMap. The client wants to be able to fill all the information about the project, the information is in different pages and we need to persist in between each post back. The client does not want to have the option to Save it under a name when it is completed, but we want to persist it in the database even when he did not save it yet.

How do I copy with scp with a wildcard(*) in the destination path?

情到浓时终转凉″ 提交于 2020-01-04 00:56:06
问题 Is it possible to get the value of what a wildcard matched to? I.e. I want to do scp -r user@host:some/path/with/*/file.txt cp/to/*/file.txt With the command above, I want some/path/with/TEST/file.txt --> cp/to/TEST/file.txt some/path/with/OTHER/file.txt --> cp/to/OTHER/file.txt EDIT: I'll add some more data of my actual setup, which might make it clearer. On my server I have the structure server $ pwd ~/sixtrack/simulations server $ ls run0001 run0002 run0003 ... Each run* is a directory,

Copying contents of one file to another in C++

跟風遠走 提交于 2020-01-03 21:14:07
问题 I am using the following program to try to copy the contents of a file, src, to another, dest, in C++. The simplified code is given below: #include <fstream> using namespace std; int main() { fstream src("c:\\tplat\test\\secClassMf19.txt", fstream::binary); ofstream dest("c:\\tplat\\test\\mf19b.txt", fstream::trunc|fstream::binary); dest << src.rdbuf(); return 0; } When I built and executed the program using CODEBLOCKS ide with GCC Compiler in windows, a new file named "....mf19.txt" was

Pipe between sockets

心已入冬 提交于 2020-01-03 10:20:17
问题 I've got a C++ server that acts as a mirror. What gets in gets out to a different socket. Right now, it reads the socket into a buffer and writes it into the other socket. I want to improve the throughput. I've read stuff about sendfile() and splice() , but it seems limited to "file-to-socket" transfers. Maybe a simple pipe() between sockets would work. What do you recommend? A portable solution would be perfect, but it's fine if it's Linux-only. 回答1: You can setup a named pipe in linux.

JQuery - Copy dimensions and absolute position of element

点点圈 提交于 2020-01-03 05:37:09
问题 I'm trying to copy a element's dimensions and the position(relative to the document) onto another element. Ex: var SelectedElement = $("div#MyTargetElement"); // The CopiedButEmpty element is a div with absolute position that is meant to hover/float above the selected element. $("div#CopiedButEmpty").css("width", SelectedElement.width()).css("height", SelectedElement.height()) .css("left", SelectedElement.offset().left).css("top", SelectedElement.offset().top) .css("marginTop",

Use VBA to copy all visible and non-empty cells in a range

淺唱寂寞╮ 提交于 2020-01-03 04:32:14
问题 After filtering, I want to copy all visible and non-empty cells (the cells which contain text). For some reason, my current code isn't working. Any help would be greatly appreciated. Thanks! Sheets("Sheet1").Range("S2:S5000").SpecialCells(xlCellTypeVisible).SpecialCells(xlCellTypeConstants).Copy 回答1: Full admission that I did not try your code, but you can also try the following With Sheets("Sheet1").Range("S2:S5000") Application.Intersect(.SpecialCells(xlCellTypeVisible), _ .SpecialCells

Insert copied row based on cell value

帅比萌擦擦* 提交于 2020-01-02 23:09:13
问题 The vba code below (modified from here) will insert a blank row above any row that has a value of "0" in column E. Instead of inserting a blank row, is there a way to copy the row with "0" and insert it above itself? Can this vba code be modified to do this? Sub BlankLine() Dim Col As Variant Dim BlankRows As Long Dim LastRow As Long Dim R As Long Dim StartRow As Long Col = "E" StartRow = 1 BlankRows = 1 LastRow = Cells(Rows.Count, Col).End(xlUp).Row Application.ScreenUpdating = False With

Copying files to a remote server over FTP protocol

Deadly 提交于 2020-01-02 10:37:34
问题 I use Filezilla to do my FTP duties and I'm unable to copy files without making a copy to the my local computer. I doubt Filezilla is bad software. Is this just an inherent quality of FTP? 回答1: The FTP Protocol does not define a "copy" command. If your FTP client has a copy command, then it has to implement this itself using what's available through FTP. This works out to something like: GET/RETR , CWD , PUT/STOR . Some FTP servers will implement proprietary extensions and offer a command

A batch file that copies another into Start Up folder?

别说谁变了你拦得住时间么 提交于 2020-01-02 10:15:15
问题 I am making a batch file that needs to copy another batch file into the Start Menu Start Up folder (the one used when a program launches on login/start up) . Since the path uses the user's computer name eg. C:\Documents and Settings\User Name I need the batch file to get the user's correct name instead of the "User Name" or * (wildcard). Wildcards doesn't work as the batch file comes up with " the filename directory name or volume label syntax is incorrect ". I hope this is clear enough. 回答1: