file

Can this be done faster (read file, substitute [sed], write new file)

I use this piece of code in my bash script to read a file containing several hex strings, do some substitution and then write it to a new file. It takes about 30 minutes for about 300 Mb.I'm wondering if this can be done faster ? sed 's,[0-9A-Z]\{2\},\\\\x&,g' ${in_file} | while read line; do printf "%b" ${line} >> ${out_file} printf ...

How can i write something to file at the end of the file in c++

Hello, i'm writing something to file and it writes it in the middle of the file, is there any function that writes output to the end of the file? thanx in advance. ok this is really wierd i'm running with the visual studio debugger and i see that it writes thing to file like this : A B C D which is good, and than when i'm writing somethi...

Simple ajax/prototype problem

Hi, im beginning with Ajax, i have problem with including Ajax files. Ajax code written in original page (like index.php) and placed in (head) section works fine, but when i try to place code in external file (in js folder, where is placed prototype.js file), i don't get any response, not even in Firefox Error Console. I haven't change...

Performance issues in writing to large files?

I have been recently involved in handling the console logs for a server and I was wondering, out of curiosity, that is there a performance issue in writing to a large file as compared to small ones. For instance is it a good idea to keep the log file size small instead of letting them grow bulky, but I was not able to argue much in favo...

Facing a weird situation in PHP while parsing a file

I am reading some lines from a file in the following format: Identifier String Number String Number String Number String Number Identifier String Number String Number String Number Identifier String Number String Number Identifier String Number String Number String Number String Number String Number In the file that was given to me, ...

Storing Huge Amount of Files in the Application Bundle

Um, I working on a dictionary app and currently trying to add narration for each article. I have about 97000 AAC-files. They are tiny - about 3-5 kilobytes each, but there are so many of them! I don't need SQL DB for access management because filenames are identical to the primary keys, so given the key I will be able to pick a proper so...

How to split a 110Mo file with Haskell

Hi I have a file which look like this index : label, index's value contain keys in the range of 0... 100000000 and label can be any String value, I want split this file which has 110 Mo in many slices of 100 lines each an make some computation upon each slice. How can I do this? 123 : "acgbdv" 127 : "ytehdh" 129 : "yhdhgdt" ... 989...

file upload specify default download directory

Hi, I'm looking for a solution , that makes it possible to have the users upload files to the server , but with the ability to specify the default upload directory. The reason is that users have a mapped network drive , where they should put there files ( location is backupped , etc ... ). So , it would be best if each time they want ...

Stream pdf/excel files dynamically to flex UI application

Hello all, We have an app that has the following characteristics- a) Flex front-end. b) Spring, BlazeDS and tomcat back-end c) Flex UI communicates with the back-end server using AMF/xmlrpc d) Mate framework is used for Flex front-end I have a requirement to generate reports on the flex UI and be able to export these reports in PDF ...

GIT: List all commits for a specific file

Hi there! Well, the subject says everything. Is there a way to list all commits that changed a specific file? I don't mind if that involves some bash magic, but it'd be way cooler if git already has this feature and I'm just so dumb not to be able to find it anywhere. If anyone can enlighten me on this, domo arigato. Regards, ...

Input File field to Input Text field

I don't even know if this is possible or not but is there a method you can take the value of the selected file in a input file field to a input text field? Like this: ...

is .htaccess working?

How can I ensure that .htacess file is working? Is there something in Apache config that would disable .htaccess? I add redirect directives that are not working. I even made a syntax error, which should prevent page in specified directory from loading, but it loaded anyway. There is no AllowOverride in hppd.conf. ...

xml properties file location in web java app

Hi, I have a web app in java, and in a servlet I need to load properties from a xml file. The code is XMLReader reader = XMLReaderFactory.createXMLReader(); ... FileInputStream fis = new FileInputStream("myconf.xml"); reader.parse(new InputSource(fis)); My question is: where should the myconf.xml file be placed in the war file...

uploading empty file to ftp with psuedo-file

Hey all, As far as i know it is impossible to create an empty file with ftp, you have to create an empty file on the local drive, upload it, then delete it when you are done. I was wondering if it is possible to do something like: class FakeFile: def read(self): return '\x04' ftpinstance.storbinary('stor fe', FakeFile()) ...

What is the most memory efficient way to write from a database to a (zip) file in Java?

My program is fast enough, but I'd rather give up that speed for memory optimization since one user's maximum memory usage goes up to 300 MB meaning few of them could constantly crash the application. Most of the answers I found were related to speed optimization, and other were just general ("if you write directly from a database to mem...

Sedna: Add XML file to document

I am running a simple Sedna database but have a small issue. I have multiple XML files that I want to add all to the same document. The files all follow the same schema. LOAD "1.xml" "mydoc"& LOAD "2.xml" "mydoc"& LOAD "3.xml" "mydoc" But I get the following error SEDNA Message: ERROR SE2001 Document with the same name already exists...

My C# app is locking a file, how I can find where it does it?

I'm writing code that check files path calculate hash (SHA1) and copy them. I made sure that I do not lock them like for example using public static string SHA1(string filePath) { var fs = new FileStream(filePath, FileMode.Open, FileAccess.Read); var formatted = string.Empty; using (var sha1 = new SHA1Managed...

accessing files created by java runtime process

I'm running a windows program from within java: String command = "cmd /C start "+fileName+".bat"; Runtime rt = Runtime.getRuntime(); Process pr = rt.exec(command, null, new File(currWD)); int exitValue = pr.waitFor(); The program completes successfully (exitValue == 0) and creates a file "fileName" in the worki...

Hosting for large file uploads

Hi All, I need to find an inexpensive LAMP Web host that allows for large file uploads (500-1024MB) via PHP/HTML. My current host has lots of restrictions with this that I cannot override. thx. ...

Is there something to double output a % character?

Is there something in a BATCH file that would double a % character? The test.txt INPUT file contains the following " Hello World The filename is : filename with spaces and 50% percentages signs.txt The %~nf removes extenstions Is there something to double a % charactor? As I would like 50% to be outputed as 50%% because the output o...