file

Plupload works with Ruby on Rails?

I tried following the example at: http://www.plupload.com/example_custom.php But in the request, file is not sent to the method of the controller, only the name. Maybe I need to set in the configuration of Plupload, something like 'multipart = true' Any idea? ...

Partially truncating a stream (fstream or ofstream) in C++

Hi, I am trying to partially truncate (or shorten) an existing file, using fstream. I have tried writing an EOF character, but this seems to do nothing. Any help would be appreciated... ...

.obj to .cpp converter?

Is there any .obj to .cpp converter? Is it possible to do it? MICROSOFT VISUAL STUDIO auto-magically deleted my code files when pressed the F5 key. Please help me. i have the .obj files(VS forgot to delete them.ha ha ha). ...

Delphi: Save TList of objects in text file

In Delphi I have the following classes: type TSong = class(TObject) private FArtist: String; FTitle: String; procedure SetArtist(Artist: String); procedure SetTitle(Title: String); public property Artist: String read FArtist Write SetArtist; property Title: String read FTitle Write SetTitle; constructor...

URLDownloadToFile API, how can it be used asynchronously?

How can this API URLDownloadToFile be used asynchronously? I need to show the progress of the download via SendMessage to a client window, which can't be done as the API appears to be synchronous and it never sends the OnProgress until the download completes. I have also seen some example codes involving IMoniker interface, but I can't f...

How to select a file from android memory to do some action on it.

Hi all, I want to transfer a file into android dev's SD memory and read the file for parsing it. But i don't know how to transfer a file into the emulators SD Card. Also I don't know which api is to be used to browse for the file from the application. This app provides the user to show it where he has kept the file which the app has to...

javascript call function in another file

Hello, I have a WSH javascript containing a function. I want to call that function form another javascriptfile . How can I do that ? Thanks, ...

create numbered files in C

I need to create files that have the same name, but with a number attached to the end of the filename to indicate that it was the nth file made. So in a for loop, I basically want to do this: char *filename = "file"; strcat(filename, i); // put the number i at the end of the filename Clearly that isn't the way to do it, but any ideas ...

Reading the last 50 characters of a file with fseek()

I'm trying to read the last 50 characters in a file by doing this: FILE* fptIn; char sLine[51]; if ((fptIn = fopen("input.txt", "rb")) == NULL) { printf("Coudln't access input.txt.\n"); exit(0); } if (fseek(fptIn, 50, SEEK_END) != 0) { perror("Failed"); fclose(fptIn); exit(0); } fgets(sLine, 50, fptIn); printf("%s", ...

PHP global include?

I have a seperate PHP file I include that has a several important functions on it. I also have a file called variables.php which I include into each function so I can call some important variables too. Is there a way to just call variables.php at the top of the page, instead of inside each function manually? I just thought it would be ea...

How to generate an XML file from an ASP.NET MVC view?

My main goal is to generate an XML file that can be downloaded. The below code succeeds in generating the file but the view (/Home/XmlView) can be accessed directly. If I use the [Authorize] attribute on the XmlView() method then the file is created with the HTML of my default logon page. How do get the authorization to work with the ...

Proper way to determine the number of lines in a file in .NET

This questions is really simple, and probably you .NET gurus now the answer =) So here it comes... What is the proper way (.NET language independent to determine the number of lines (non-blank) exists in a text files without having to check until the line is empty (My current approach)? Thanks in advance ...

Problem with replacing a word in a file, using Python

I have a .txt file containing data like this: 1,Rent1,Expense,16/02/2010,1,4000,4000 1,Car Loan1,Expense,16/02/2010,2,4500,9000 1,Flat Loan1,Expense,16/02/2010,2,4000,8000 0,Rent2,Expense,16/02/2010,1,4000,4000 0,Car Loan2,Expense,16/02/2010,2,4500,9000 0,Flat Loan2,Expense,16/02/2010,2,4000,8000 I want to replace the first...

python : file deletion using rm command

I want to make sure that I delete required files. I have code something like dir="/some/path/" file = "somefile.txt" cmd_rm= "rm -rf "+dir + file os.system(cmd_rm) The dir and file values are fetched from a database. How can I make sure I never end up running rm -rf /? What things should I check before doing rm -rf? ...

How to read a file from a jar file?

hello guys I have a file on a jar file; it's 1.txt for example how can I call it ; my source code is : Double result=0.0; try { File file = new File("1.txt")); //how get this file from a jar file BufferedReader input = new BufferedReader(new FileReader(file)); String li...

iphone sdk/mac - Yet another problem with sockets

Hi guys, My program consists of 2 parts - A server socket (sits on port 3490) running on a different thread, and a client to test the server. Now the server has a pdf file, and I want the client to display it in a UIWebView. To achieve this I used the folllowing: NSURLRequest *urlRequest = [NSURLRequest requestWithURL:[NSURL URLWit...

iphone/mac - how to send video file with a socket?

Hi My program (iphone app) consists of 2 parts - A server socket (sits on port 3490) running on a different thread, and a client to test the server. The server has a video file, and I want to send it to the client upon request. This I do like this: int fileDesc = open([viewController.filePath UTF8String], O_RDONLY); if (fi...

Writing viewing stats to XML file. Possible problems with losing data count?

Hello I have created XML which holds codes for properties and number of page viewings for that code: <?xml version="1.0" encoding="utf-8"?> <data> <nehnutelnost code="BSPO066P">35</nehnutelnost> <nehnutelnost code="PMDM029P">4</nehnutelnost> </data> I think I have found possible weakness with this, today all counters disapea...

is there a shell command to insert a string of characters in every line of a file

is there any shell command to insert a string of characters in every line of a file.. < in the beginning or the end of every line > ...

How to open a PowerPoint file with PHP

I want to be able to open a PowerPoint file with PHP and copy all the text to a different file. Is this possible or I need another language to do this? ...