copy

What is the best way to load a massive amount of data into PostgreSQL?

纵然是瞬间 提交于 2019-12-04 19:17:35
I want to load a massive amount of data into PostgreSQL. Do you know any other "tricks" apart from the ones mentioned in the PostgreSQL's documentation? What have I done up to now? 1) set the following parameters in postgresql.conf (for 64 GB of RAM): shared_buffers = 26GB work_mem=40GB maintenance_work_mem = 10GB # min 1MB default: 16 MB effective_cache_size = 48GB max_wal_senders = 0 # max number of walsender processes wal_level = minimal # minimal, archive, or hot_standby synchronous_commit = off # apply when your system only load data (if there are other updates from clients it can result

Java - copy JPG while preserving all file attributes

我怕爱的太早我们不能终老 提交于 2019-12-04 18:58:36
What is the best way to move/copy file while maintaining all its attributes (Date created, Date, etc)? Thank you If you are using Java 7, use java.nio.file.Files.copy(Path source, Path target, CopyOption... options) Use the COPY_ATTRIBUTES option to maintain the last modified time: COPY_ATTRIBUTES Attempts to copy the file attributes associated with this file to the target file. The exact file attributes that are copied is platform and file system dependent and therefore unspecified. Minimally, the last-modified-time is copied to the target file if supported by both the source and target file

How can i clone an image in javascript

懵懂的女人 提交于 2019-12-04 17:30:20
问题 I'm trying to clone an image in javascript, bud without loading a new one. Normally new browsers will load an image once and there are several ways to use that image again. The problem is that when I test it in IE 6 the image will request a new image from the server. Anyone how has some info on how to do this in older browsers? 3 methods that not work: <html> <head> <title>My Image Cloning</title> <script type="text/javascript"> sourceImage = new Image(); sourceImage.src = "myImage.png";

MSBUild: Copy files with a name based on the original (following a pattern)

落爺英雄遲暮 提交于 2019-12-04 17:25:51
问题 I have a set of files inside a folder. They all have a name which matches the pattern DR__.*. I want to copy them to another folder, but removing the DR__ prefix. How can I do this with MSBuild? I used to do it like this using NAnt: <mkdir dir="${ClientPath + '\bin\' + ConfigurationName + '\Parameters'}"/> <foreach item="File" property="Filename" in="CVParameters"> <if test="${string::contains(Filename, Client + '_')}"> <property name="newFilename" value="${ string::substring( Filename,

Hook into the Windows File Copy API from C#

假如想象 提交于 2019-12-04 17:18:59
Is there a way to hook into the Windows File Copy API from C#? I'm aware this would require unmanaged code, but a code sample or starter would be helpful. I've already seen the C++ code, but it's all greek. UPDATE: I apologize, I should have been more clear about my intentions. I wish to actually change the copy feature of Windows to be more rigid (e.g. allow queing, scheduling, handle restarts, pauses, etc.). When I said hook, I meant API hook so that when someone starts a copy I get the sources and destinations and can handle it to my heart's desire. I'm old school and used to hook the Mac

HTML 5: Canvas copying Pixel Data within a Polygon

我怕爱的太早我们不能终老 提交于 2019-12-04 16:37:31
Good afternoon, I am new to Canvas in HTML 5 and in using it with Javascript. But I can see how powerful this really is and I needed help. I have done a search and could not find a clear answer to this. Perhaps someone here can help. I have created a context on the Canvas with a background image in place. Now, I want crop or copy a part of that image which is contained in Polygon Data and place it else where on the screen. I know how to create the background image. I know how to create a polygon over that image and I know how to copy image data to another part of the screen. So how would I

System.IO.DirectoryNotFoundException after deleting an empty folder and recreating it

僤鯓⒐⒋嵵緔 提交于 2019-12-04 16:34:41
问题 I want to copy a folder, and i want to delete destination folder first. So I am deleting destination folder then recreate it and then copy files. The problem is that i get the An unhandled exception of type 'System.IO.DirectoryNotFoundException' occurred in mscorlib.dll when trying to copy files. This is the code static public void CopyFolder(string sourceFolder, string destFolder) { if (Directory.Exists(destFolder)) // check if folde exist { Directory.Delete(destFolder, true); // delete

Paste a HTML table into Excel, how to keep the line break in cell

▼魔方 西西 提交于 2019-12-04 15:39:06
问题 I have a simple html table, for example, just one cell, but when I copy the dom node, and paste it into excel, it will be recognize as two rows, How to make Excel get the correct paste data. <table><tr><td>1<br>2</td><tr></table> I tried to add css style br {mso-data-placement:same-cell;}, But it only works in IE. Note, copy a plain text out is not OK, i need to add color, font information on cells. 回答1: As many of you probably know, you can output data (a report, for example) as an Excel

Copying data from one table to another table. Databases are different and table structure is different

匆匆过客 提交于 2019-12-04 14:38:07
I am looking for a solutions for my MySQL data copying related problem. I have a table TAB1 in a database DB1 that contains some data. Now I want some of these data rows to be migrated to another table TAB2 to some another database DB2. What would be an ideal way to write such a SQL script for MySQL server. I cannot write java/php program etc because I don't have access to the code base. Any example links will be helpful. I know this can be done in Oracle via DBLink but how to do it in MySQL. Thanks insert into db2.table2 (field1,field2,..,fieldN) select field1,field2,..,fieldN from db1.table1

How do I copy an ArrayIterator to preserve it's current iteration position?

£可爱£侵袭症+ 提交于 2019-12-04 14:06:08
Because this seems like what I have to do to get this effect: $arr = ['a'=>'first', 'b'=>'second', ...]; $iter = new ArrayIterator( $arr ); // Do a bunch of iterations... $iter->next(); // ... $new_iter = new ArrayIterator( $arr ); while( $new_iter->key() != $iter->key() ) { $new_iter->next(); } Edit: Also, just to be clear, should I NOT be modifying the base array with unset() ? I figure the array iterator stores its own copy of the base array, so using offsetUnset() doesn't seem right. ArrayIterator does not implement a tell() function, but you can emulate this, and then use seek() to go to