Search Results

Search found 2397 results on 96 pages for 'copying'.

Page 39/96 | < Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >

  • Testing + production server and syncing MySQL data

    - by Matthew
    I have a web application running on LAMP with a testing server and a production server. Is there a standard practice for keeping the data on the testing server in sync with the production server? The data on the testing server gets out of date pretty quick and I feel like there must be an easier way than just dumping the production server and copying it onto the testing server every so often. It's not important that the data is in total sync, just that the testing server represents the production enviornment as accurately as possible.

    Read the article

  • C++: Trouble with Pointers, loop variables, and structs

    - by Rosarch
    Consider the following example: #include <iostream> #include <sstream> #include <vector> #include <wchar.h> #include <stdlib.h> using namespace std; struct odp { int f; wchar_t* pstr; }; int main() { vector<odp> vec; ostringstream ss; wchar_t base[5]; wcscpy_s(base, L"1234"); for (int i = 0; i < 4; i++) { odp foo; foo.f = i; wchar_t loopStr[1]; foo.pstr = loopStr; // wchar_t* = wchar_t ? Why does this work? foo.pstr[0] = base[i]; vec.push_back(foo); } for (vector<odp>::iterator iter = vec.begin(); iter != vec.end(); iter++) { cout << "Vec contains: " << iter->f << ", " << *(iter->pstr) << endl; } } This produces: Vec contains: 0, 52 Vec contains: 1, 52 Vec contains: 2, 52 Vec contains: 3, 52 I would hope that each time, iter->f and iter->pstr would yield a different result. Unfortunately, iter->pstr is always the same. My suspicion is that each time through the loop, a new loopStr is created. Instead of copying it into the struct, I'm only copying a pointer. The location that the pointer writes to is getting overwritten. How can I avoid this? Is it possible to solve this problem without allocating memory on the heap?

    Read the article

  • How can I copy unmanaged data in C# and how fast is it?

    - by Danvil
    I have two unmanaged pointers in the form of IntPtr and want to copy data between them. How can I do this? I know the method Marshal.Copy, but it can only copy between unmanaged and managed. And the second part: Is copying unmanaged data from C# slower than doing it in unmanaged C/C++ using memcopy?

    Read the article

  • IE8 Session sharing across tabs and windows

    - by Clint
    Has anyone implemented any effective solutions to address the numerous issues that are caused by IE8's session sharing functionality? We've gotten very close by writing a custom http module that compares session and view state values, but our efforts are thwarted by things such as accelerator keys and unaccceptable copying of session objects. This is a VB.Net web app.

    Read the article

  • running same query in different databases

    - by user316833
    I wrote a query that I want to run in several access databases. I have 1000+ access databases with the same tables (same names, same fields). So far, I have been manually copying this query from a txt file to the sql view in the access query design screen for each database and then run it. I did not need to change the query language - everything is the same for the 1000 databases. Is there a way to automate this?

    Read the article

  • ssms copy database

    - by 2xMax
    Hello, I have a local sql express server with DB A and remote server uXXX.mssql.domainname.com with DB B. using sql mangament studio 2008, I want to move copy DB A to DB B with all tables, data, dependencies and stored procedures. how to figure out this problem? I only had understood table and table data copying(using Tasks-Import Data).

    Read the article

  • Amazon S3 components for Delphi 2010

    - by Mick
    Besides the Amazon Integrator from /n software, are there any other Amazon S3 components available that can be used with Delphi 2010? I would use the one from /n software, but it has some issues (e.g. GetObjectInfo doesn't work if the object is stored in a specific location) and limitations (e.g. copying objects doesn't let you define replacement meta-data). I don't have the time or resources to create such a component myself. Thanks!

    Read the article

  • Using ROWLOCK in an INSERT statement (SQL Server)

    - by RPS
    Would it be wise to use ROWLOCK on an insert statement that is copying large amounts of data and inserting it into the same table? Ex) INSERT INTO TABLE with (rowlock) (id, name) SELECT newid, name FROM TABLE with (nolock) WHERE id = 1 Does anybody have recommendations on how to improve this statement, as I see when SQL Server gets busy it will end in Timeout Query returned for SQL Server.

    Read the article

  • How to iterate over Directories in Ant

    - by Laxmi
    I've a root directory and it contains many directories,in turn each sub-directory contains many directories and so on.For example if "A" is a root directory it contains sub-directories "A.a","A.b",so on... and each directory("A.a","A.b",etc) contains many directories.I want to copy the inner directories of "A.a" , "A.b" ,etc.. to other directory structure similar to the "A".Instead of copying the each directory I want to use loop that iterates every directory and it's sub-directories(even files).How to do that...Please help me out as I'm new to Ant...

    Read the article

  • Simple oracle backup without using exp or expdp

    - by Jacob
    I have Oracle 10g installed on Windows in C:\oracle. If I stop all Oracle services, is it safe to backup by just copying the entire directory (e.g., to C:\oracle_bak), or am I significantly better off using expdp? Pointers to docs/websites very welcome, I wasn't able to Google up anything relevant.

    Read the article

  • How do I get the set of all letters in Java/Clojure?

    - by Jason Baker
    In Python, I can do this: >>> import string >>> string.letters 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' Is there any way to do something similar in Clojure (apart from copying and pasting the above characters somewhere)? I looked through both the Clojure standard library and the java standard library and couldn't find it.

    Read the article

  • Running cruise control.net under different credentials

    - by zachary
    So I have one part of my build that requires domain rights and does file copying. Another part of my build runs some program that requires the user to interact with the desktop which seem to be only accomplish able by the system account. What is the best way to work around these two items? At the moment it seems like I can only do one or the other...

    Read the article

  • Website Replication using Wordpress

    - by chouputra
    Hi I have a wordpress installed on h*ttp://domainname.com and I would like to have replication of the same website on a subdomain for example h*ttp://sub1.domainname.com h*ttp://sub2.domainname.com What should I do to make this happen without copying any database and the wordpress should be smart enough to recognize the "sub1" and "sub2" to be used later in the program.

    Read the article

  • c# Unable to open file for reading

    - by Maks
    I'm writing a program that uses FileSystemWatcher to monitor changes to a given directory, and when it recieves OnCreated or OnChanged event, it copies those created/changed files to a specified directorie(s). At first I had problems with the fact that OnChanged/OnCreated events can be sent twice (not acceptable in case it needed to process 500MB file) but I made a way around this and with what I'm REALLY STUCKED with is getting the following IOException: The process cannot access the file 'C:\Where are Photos\bookmarks (11).html' because it is being used by another process. Thus, preventing the program from copying all the files it should. So as I mentioned, when user uses this program he/she specifes monitored directory, when user copies/creates/changes file in that directory, program should get OnCreated/OnChanged event and then copy that file to few other directories. Above error happens in all casess, if user copies few files that needs to owerwrite other ones in folder being monitored or when copying bulk of several files or even sometimes when copying one file in a monitored directory. Whole program is quite big so I'm sending the most important parts. OnCreated: private void OnCreated(object source, FileSystemEventArgs e) { AddLogEntry(e.FullPath, "created", ""); // Update last access data if it's file so the same file doesn't // get processed twice because of sending another event. if (fileType(e.FullPath) == 2) { lastPath = e.FullPath; lastTime = DateTime.Now; } // serves no purpose now, it will be remove soon string fileName = GetFileName(e.FullPath); // copies file from source to few other directories Copy(e.FullPath, fileName); Console.WriteLine("OnCreated: " + e.FullPath); } OnChanged: private void OnChanged(object source, FileSystemEventArgs e) { // is it directory if (fileType(e.FullPath) == 1) return; // don't mind directory changes itself // Only if enough time has passed or if it's some other file // because two events can be generated int timeDiff = ((TimeSpan)(DateTime.Now - lastTime)).Seconds; if ((timeDiff < minSecsDiff) && (e.FullPath.Equals(lastPath))) { Console.WriteLine("-- skipped -- {0}, timediff: {1}", e.FullPath, timeDiff); return; } // Update last access data for above to work lastPath = e.FullPath; lastTime = DateTime.Now; // Only if size is changed, the rest will handle other handlers if (e.ChangeType == WatcherChangeTypes.Changed) { AddLogEntry(e.FullPath, "changed", ""); string fileName = GetFileName(e.FullPath); Copy(e.FullPath, fileName); Console.WriteLine("OnChanged: " + e.FullPath); } } fileType: private int fileType(string path) { if (Directory.Exists(path)) return 1; // directory else if (File.Exists(path)) return 2; // file else return 0; } Copy: private void Copy(string srcPath, string fileName) { foreach (string dstDirectoy in paths) { string eventType = "copied"; string error = "noerror"; string path = ""; string dirPortion = ""; // in case directory needs to be made if (srcPath.Length > fsw.Path.Length) { path = srcPath.Substring(fsw.Path.Length, srcPath.Length - fsw.Path.Length); int pos = path.LastIndexOf('\\'); if (pos != -1) dirPortion = path.Substring(0, pos); } if (fileType(srcPath) == 1) { try { Directory.CreateDirectory(dstDirectoy + path); //Directory.CreateDirectory(dstDirectoy + fileName); eventType = "created"; } catch (IOException e) { eventType = "error"; error = e.Message; } } else { try { if (!overwriteFile && File.Exists(dstDirectoy + path)) continue; // create new dir anyway even if it exists just to be sure Directory.CreateDirectory(dstDirectoy + dirPortion); // copy file from where event occured to all specified directories using (FileStream fsin = new FileStream(srcPath, FileMode.Open, FileAccess.Read, FileShare.Read)) { using (FileStream fsout = new FileStream(dstDirectoy + path, FileMode.Create, FileAccess.Write)) { byte[] buffer = new byte[32768]; int bytesRead = -1; while ((bytesRead = fsin.Read(buffer, 0, buffer.Length)) > 0) fsout.Write(buffer, 0, bytesRead); } } } catch (Exception e) { if ((e is IOException) && (overwriteFile == false)) { eventType = "skipped"; } else { eventType = "error"; error = e.Message; // attempt to find and kill the process locking the file. // failed, miserably System.Diagnostics.Process tool = new System.Diagnostics.Process(); tool.StartInfo.FileName = "handle.exe"; tool.StartInfo.Arguments = "\"" + srcPath + "\""; tool.StartInfo.UseShellExecute = false; tool.StartInfo.RedirectStandardOutput = true; tool.Start(); tool.WaitForExit(); string outputTool = tool.StandardOutput.ReadToEnd(); string matchPattern = @"(?<=\s+pid:\s+)\b(\d+)\b(?=\s+)"; foreach (Match match in Regex.Matches(outputTool, matchPattern)) { System.Diagnostics.Process.GetProcessById(int.Parse(match.Value)).Kill(); } Console.WriteLine("ERROR: {0}: [ {1} ]", e.Message, srcPath); } } } AddLogEntry(dstDirectoy + path, eventType, error); } } I checked everywhere in my program and whenever I use some file I use it in using block so even writing event to log (class for what I ommited since there is probably too much code already in post) wont lock the file, that is it shouldn't since all operations are using using statement block. I simply have no clue who's locking the file if not my program "copy" process from user through Windows or something else. Right now I have two possible "solutions" (I can't say they are clean solutions since they are hacks and as such not desireable). Since probably the problem is with fileType method (what else could lock the file?) I tried changing it to this, to simulate "blocking-until-ready-to-open" operation: fileType: private int fileType(string path) { FileStream fs = null; int ret = 0; bool run = true; if (Directory.Exists(path)) ret = 1; else { while (run) { try { fs = new FileStream(path, FileMode.Open); ret = 2; run = false; } catch (IOException) { } finally { if (fs != null) { fs.Close(); fs.Dispose(); } } } } return ret; } This is working as much as I could tell (test), but... it's hack, not to mention other deficients. The other "solution" I could try (I didn't test it yet) is using GC.Collect() somewhere at the end of fileType() method. Maybe even worse "solution" than previous one. Can someone pleas tell me, what on earth is locking the file, preventing it from opening and how can I fix that? What am I missing to see? Thanks in advance.

    Read the article

  • pdf <pre> equivalent

    - by ddowns
    I'm trying to put some code examples in a pdf, but copying them out messes up the formatting and rearranges the lines, there's a lot of manual cleanup needed after pasting. Is there a equivalent to html's pre for PDFs? For "this" block of text respect line breaks, spacing, and copy as plain text like its shown. The closest thing I can see is adding note annotations next to every code example.

    Read the article

  • Simple doubt related to strings in C

    - by piemesons
    // The first example: char text[] = "henri"; char *p; p = text; *(p + 1) = 'E'; // Output = hEnri // Now If we want to remove the "e" ie hnri, we would go for????? *(p + 1)=????? Please dont say start copying the array. I am looking for the best solution

    Read the article

  • Cast into new Object, Copy values by Property Name

    - by Alex
    Hello, I have the following: Class 1 (Text, State, Level) Class 2 (Text, State, Level, Ident) Is there a way for me to cast an object of Class 2 into into Class 1, and not having to do the usual cast code (Text = c.Text, State = c.State etc.)? Possibly by identifying the property names of each class and copying the value over?

    Read the article

  • Convert an ArrayList to an object array

    - by marionmaiden
    Hello, Is there a command in java for conversion of an ArrayList into a object array. I know how to do this copying each object from the arrayList into the object array, but I was wondering if would it be done automatically. I want something like this: ArrayList<TypeA> a; // Let's imagine "a" was filled with TypeA objects TypeA[] array = MagicalCommand(a);

    Read the article

  • What is the Best way to copy Folder using c#

    - by karthik
    I need to copy a Folder from one drive to a removable Hard disk. The Folder which needs to be copied will have many sub folders and files in it. The input will be Source Path and Target Path. Like.. Source Path : "C:\SourceFolder" Target Path : "E:\" After copying is done, i shud be able to see the folder "SourceFolder" in my E: drive. Thanks.

    Read the article

  • Drupal: update.php error...

    - by Patrick
    hi, I'm copying my Drupal installation to another folder and I've copied the related database. When I run update.php on the new copy I get the following error: http://dl.dropbox.com/u/72686/updateError.png should I disable some modules.. or is something about Drupal core ? thanks

    Read the article

< Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >