file

How Do I Programmatically Set a File Tag

When using Windows Explorer to view files, I'm given the option to set a "tag", "category", or other attributes. For a JPEG a different set of attributes (including "tag") are options. I'd like to be able to set these programmatically. How do I programmatically set a file tag and other file attributes using Delphi (I have Delphi 2010 ...

How can I retrieve a collection of file locations if I give the method a location of the parent folder?

For example, given the folder: C:\images\a How could I retrieve a collection of all of the images in that folder? Thank you. ...

no such file to load -- yet file is config.gem in environtment.rb file in rails

I keep getting this error for different gems, the most recent is acts_as_reportable: no such file to load -- acts_as_reportable However, I have the following line in my environment.rb: config.gem 'acts_as_reportable' And I also ran the following: >gem install acts_as_reportable It it output: >gem install acts_as_reportable S...

How to transfer a file greater than 100mb using spring

How to transfer a file greater than 100mb using spring mvc. I have been through the post http://stackoverflow.com/questions/214888/how-to-handle-100mb-uploads-for-users, that tells to use ftp api. But want to know an alternative with spring. ...

MATLAB how to write header in text file

How to write a text header in text file? for example in the example below, how to write the header code salay month just once? Code Salary Month 12 1000 12 14 1020 11 11 1212 9 fid = fopen('analysis1.txt','wt'); for i=1:10 array = []; % empty the array .... array = [code salary month]; format short g; fprin...

how can i write line by line in txt data?

I try to write line by line data but. if i run my application. writng last text1 data in script.txt private void button1_Click(object sender, EventArgs e) { System.IO.TextWriter tw; tw = new StreamWriter("C:/Script.txt"); tw.WriteLine(textBox1.Text); tw.Close(); } ...

Upload a file to a varbinary with SQL Management Studio

Is there any way to upload a file to a varbinary with SQL Management Studio without writting a manual SQL query ? ...

adding space in an output file with out having to read the entire thing first

Question: How do you write data to an already existing file at the beginning of the file with out writing over what's already there and with out reading the entire file into memory? (e.g. prepend) Info: I'm working on a project right now where the program frequently dumps data into a file. this file will very quickly balloon up to 3-...

Logic: Best way to sample & count bytes of a 100MB+ file

Let's say I have this 170mb file (roughly 180 million bytes). What I need to do is to create a table that lists: all 4096 byte combinations found [column 'bytes'], and the number of times each byte combination appeared in it [column 'occurrences'] Assume two things: I can save data very fast, but I can update my saved data very slo...

[Python] Best strategy for dealing with incomplete lines of data from a file.

I use the following block of code to read lines out of a file 'f' into a nested list: for data in f: clean_data = data.rstrip() data = clean_data.split('\t') t += [data[0]] strmat += [data[1:]] Sometimes, however, the data is incomplete and a row may look like this: ['955.159', '62.8168', '', '', '', '', '', ''...

Add bytes to binary file using only PHP?

I am trying to add random bytes to binary (.exe) files to increase it size using php. So far I got this: function junk($bs) { // string length: 256 chars $tmp = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

Delphi Search files and directories fastest alghorithm

Hi, I'm using Delphi7 and i need a solution to a big problem.Can someone provide me a faster way for searching through files and folders than using findnext and findfirst? because i also process the data for each file/folder (creation date/author/size/etc) and it takes a lot of time...I've searched a lot under WinApi but probably I hav...

obtaing File Format in java/ DOS-UNIX

Is there an easy way to see whether particular file has DOS/MAC/UNIX line endings? Currently i read the file byte by byte and stop if i see Windows carriage return for (byte thisByte : bytes) { if ((!isDos) && (thisByte == 13)) { isDos = true; } ... Is there a way to get same information without reading file byte by byte? ...

filename and line number of python script

Hello everyone, How can I get the file name and line number in python script. Exactly the file information we get from an exception traceback. In this case without raising an exception. ...

Populating XML file in PHP

Currently, a friend of mine is wanting a Flash Gallery and the ability to upload files. I don't have the time of day to teach him where to edit the XML properly or dare I even give him FTP access. He hand picked out this gallery program: http://flashnifties.com/xml_gallery.php Which as you can tell works off XML. Creating a script to h...

Python - appending a file?

Hi I wish to add a column of data to a file. The file currently has three tab delimited columns. abbd 1234 0.987 affr 2345 0.465 I have a list of length 8,800 comprising floats. li = [-1.0099876, 34.87659] I wish to add this list as a fourth column to the file. abbd 1234 0.987 -1.0099876 Note - my file is ...

How to remove a specific file in Rails public folder?

User in my web app are able to upload file. I use Paperclip to handle file attachment issue. Is there any method if I would like to remove any specific user-uploaded file programmatically? ...

PHP list of specific files in a directory

The following code will list all the file in a directy <?php if ($handle = opendir('.')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $thelist .= '<LI><a href="'.$file.'">'.$file.'</a>'; } } closedir($handle); } ?> <P>List of files:</p>...

How to see .class content in Eclipse?

Sometimes, in Eclipse , i press a combination of keys which take me to the editor page that shows contents of my .class file (bytecode). I never seem to be able to remember what that key combination is. Can someone please let me know? Or in other words, how can one see own bytecode? ...

where do i put html files in my web-app folder for a lift project with maven?

I'm new to Lift framework for scala. For some reason, index.html resides in the web-app directory, and when I start up jetty, http://localhost:8080/ will point to that index.html file just fine. However, if I put a login.html file in the same folder as the index.html, and then go http://localhost:8080/login, Lift does not serve the file....