writing

Easily writing Bundles in Cocoa

How can I write bundles in Cocoa without much "fuzz" around it? I just want to have a bundle with an Info.plist, a Contents Folder and that folder should contain a couple of files. ...

An important question on iPhone file writing

I use the NSHomeDirectory() function to get the app's home folder, and write to the Documents directory within that. I'm curious, though, what happens when the user downloads an update for the app in the appstore? Will it all be deleted? When I delete the app on the device, then reinstall it, its wiped out. So, I'm curious to know wh...

Web form filling using digital writing pads

Hi, I own a website, in which my users will fill a particular for many times in a single day. All i need is i want to give them a digital writing pad, so that they write the content in the pad instead of typing. And i need the written content to get automatically stored in my website form. Will this be possible, if yes how??? Pleas h...

Crossdomain file edit

Hi there. I need to know, where from is my script used (it's for sale, and i don't want any thiefs). I want to write on my server in file, IP of user, domain where from script has been runned, date, etc. I've tried fopen, fwrite, but is_file_writable returned that it isn't. File CHmods are 777, it parent catalog has too 777 chmods. Now...

Unable to open a file for writing

I am trying to write to a file. I do a file_exists check on it before I do fopen and it returns true (the file does exist). However, the file fails this code and gives me the error every time: $handle = fopen($filename, 'w'); if($handle) { flock($handle, LOCK_EX); fwrite($handle, $contents); } else { echo 'ERROR: Unable to ...

Java: file write on finalize method

In my understanding a singleton object will destroy only when the application is about to terminate. So in C++ I write a Singleton class to log my application and in that Singleton logger's destructor I log the time when my application was terminated. Things worked perfectly in C++. Now I want to have that same logger in Java, as in j...

Java FileOutputStream String Writing

I’ve been having issues with a Java File. Its designed to write line after line in a test file as a log. Unfortunately it overwrites the same line every time I call it. If anyone can help I would be eternally grateful as this has been driving me up the wall! Code Below. Thanks. public abstract class Log { protected static String Def...

Good books about writing technical documentation

Can you recommend any books about how to write technical documentation? I'm after some guidance on overall layout of the document, style (as in prose, not CSS), when and where to go into detail, etc. Please post only one book per answer ...

When writing struct to a file too many bytes are written

I'm trying to write a simple TGA image file saver as a learning exercise in C++. I'm basing my code on an example TGA loader that declares a struct for the header and then uses fread() to load the entire header in one go. My program isn't working right now, and it seems like there are two extra bytes being written to the file. I printed...

Writing only part of a line to a file.

I want to clean up my output and only write part of the line that I need to a new file and not the whole entire line. This is the relevent coding section: counter = 1 for line in completedataset: print counter counter +=1 for t in matchedLines: if t in line[:line.find(',')]: smallerdataset.write(line) ...

Creating and writing files with php

Hi Is it possible to pass a variable to 'file_get_contents' in php? Am getting errors and wondered if it was my syntax. Am using the code below. $page=file_get_contents('http://localhost/home/form.php?id={$data['form_id']}'); $fp=fopen('form.html','w+'); fputs($fp,$page); fclose($fp); thanks rifki ...

php file_get_contents errors

Hi I'm using the following code: to write contents from one file to another $page = file_get_contents('myPage.php?id='.$_GET['id']); $file = 'temp/form_'.$_GET['id'].'.html'; file_put_contents($page, $file); But I keep getting the following errors Warning: file_get_contents(myPage.php?id=9) [function.file-get-contents]: Invalid...

Deleting parts of a file with php

After using file_get_contents to write to a html file, I need to delete certain parts of this files contents because the paths to css and images has changed. So I have lines as below : <link href="/Elements/css/main.css" rel="stylesheet" type="text/css"> <image src="/Elements/images/image1.gif" /> I would like to remove the: '/Ele...

php creating editing and writing files

Im trying to use file_get_contents to get contents of a file and delete a certain part of a line in that file. Is the following anywhere near what I want to achieve? $page = file_get_contents('myPage.php?id='.$_GET['id']); $file = 'temp/form_'.$_GET['id'].'.html'; $change = file_get_contents('myPage.php?id='.$_GET['id']); $cha...

Is there a program like PSpad/notepad++ etc. that automatically suggests functions?

Hi there, I could not find this anywhere, but do you know if there is a php writing program which suggests functions automatically? So when you start: "include('head...." that the program suggests: "include('header.php'); automatically..? Would help me so much in both time and not knowing if i wrote the functions as I should... Thanks!...

Writing to and reading from the same file, at the same time (disk being asynchronous?)

We're creating a web service where we're writing files to disk. Sometimes these files will be read at the same time as they are written. If we do this - writing and reading from the same file - we sometimes end up with files that are of the same length, but where some of the data inside are not the same. So with a 350mb file we get mayb...

How to write good articles about programming in ASP.net and C#?

Over the last 1 1/2 years I've been working as a junior software-developer at a small company with focus on ASP.net / C#. During that time I've read in some great programming books, c# forums, stackoverflow, blogs et cetera and was able to learn much in a short time. But there was always something I missed: Most of the ~1500 page books ...

Overwrite ActiveRecord's save method to use custom interface

Hello, I got the following situation: I have a rails application and two databases, one is for the Rails Application and the second database (running on the same DB Server Instance) is for a different non-web application. My Rails Web Application may read from the (second) Database directly via SQL but it can't write to it because of ...

How to improve the transfer-code-from-mind-to-file effort?

QUESTION OBSOLETE: This question has been re-asked, in a much more condensed form, on programmers.stackexchange. Please vote to have this question closed. Programmers' trade is essentially to write code. Yes, there is a lot more involved than that, but when you really boil down to it, at the end of the day, programmers will have produce...

How can i write an HTML parts code using ASP.net C# language inside a specific part

<td runut="server" id="sa"> </td> i have a dynamic ASP button and i want to insert a HTML code inside that "TD" (above). just by pressing the button. please help me. ...