Search Results

Search found 25343 results on 1014 pages for 'write protect'.

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

  • ruby write newline character to file but do not interpret as a true newline

    - by thomas
    I am trying to write a ruby string to a file in such a way that any newline characters embedded in the string remain embedded. This is being written out to a file which will then be processed by another tool. An example is below. I want this: 1 [label="this is a\ntest"] \n (second \n is a true newline) I have tried this: string = '1 [label="this is a\ntest"]' + "\n" Any thoughts?

    Read the article

  • Can I write for .Net 4 using VS2008?

    - by chillitom
    Can I write code against .Net 4 and its libraries using VS2008? If so how should I configure it? I realise that VS2008 will probably struggle with language changes such as the dynamic keyword but can I install the version 4 and target it anyway? My only real interest is in being able to use some of the new libraries, in particular I'm interested in the TPL (http://en.wikipedia.org/wiki/Parallel_Extensions)

    Read the article

  • fwrite write an integer

    - by user149100
    I'm trying to write a word to a file using this function: extern void write_int(FILE * out, int num) { fwrite(&num,sizeof(int),1, out); if(ferror(out)){ perror(__func__); exit(EXIT_FAILURE); } } But I get a segmentation fault whenever it tries to run the fwrite. I looked at the man page for fwrite(3) and I feel like I used it correctly, is there something I'm missing?

    Read the article

  • Write Tomcat 5.5 output to one of Tomcat's log files

    - by Spiderman
    I'd like that all the output that is shown in Tomcat's console will be saved into a file including the output on startup and shutdown of Tomcat. How can I do this? I looked at apache documentation about logging, Do I need to change something in the logging.properties can I trust log4j to write message from the first message on startup to the last message on shutdown?

    Read the article

  • how to write this conditions in php

    - by Mac Taylor
    hey guys , im writing a class and im wondering how i can write a condition statement in this way : $this->referer= (!empty($_SERVER['HTTP_REFERER'])) ? htmlspecialchars((string) $_SERVER['HTTP_REFERER']) : ''; i need to find my user_id and this is the usual condtion : if(is_user($user)){ $cookie=cookiedecode($user); $user_id=intval($cookie[0]); } and i think it should be something like this : $this->user_id = (is_user($user)) ? (cookiedecode($user)) : $cookie[0]; but it didnt work

    Read the article

  • How to write text files with DOS line endings on linux

    - by gaumann
    I want to write text files with DOS/Windows line endings '\r\n' using python running on Linux. It seems to me that there must be a better way than manually putting a '\r\n' at the end of every line or using a line ending conversion utility. Ideally I would like to be able to do something like assign to os.linesep the separator that I want to use when writing the file. Or specify the line separator when I open the file.

    Read the article

  • Per directory read/write permissions in Mercurial

    - by pako
    I would like to convert my Subversion repository to Mercurial. I have a pretty big web project divided into many different folders. In Subversion I was able to set per directory permissions for a repository. For example, I could say that a new developer could only read and write a subset of all the project's directories. Is it possible to have a similar setup in a single Mercurial repository?

    Read the article

  • How to write a video encoder with ffmpeg ?

    - by Wallah
    I want to write an encoder with ffmpeg which can put iFrames (keyframes) at positions I want. Where can I found tutorials or reference material for it? P.S Is it possible to do this with mencoder or any opensource encoder. I want to encode H263 file. I am writing under & for linux.

    Read the article

  • Using python to write text files with DOS line endings on linux

    - by gaumann
    I want to write text files with DOS/Windows line endings '\r\n' using python running on Linux. It seems to me that there must be a better way than manually putting a '\r\n' at the end of every line or using a line ending conversion utility. Ideally I would like to be able to do something like assign to os.linesep the separator that I want to use when writing the file. Or specify the line separator when I open the file.

    Read the article

  • Learning to write a compiler

    - by Anton
    Preferred Languages : C/C++, Java, and Ruby I am looking for some helpful books/tutorials on how to write your own compiler simply for educational purposes. I am most familiar with C/C++, Java, and Ruby so I prefer resources that involve one of those three, but any good resource is acceptable.

    Read the article

  • document.write buggy?

    - by proyb2
    Something wrong with the code? I could print Hello on HTML but when I add to getPlayerVersion, the whole string doesn't print. What could be problem be? Leaving me feeling frustrated. <script type="text/javascript"> document.write("Hello"+deconcept.SWFObjectUtil.getPlayerVersion().major); </script>

    Read the article

  • How to write a jquery ui plugin?

    - by Haris
    I want to write a jquery ui plugin? I can't find a useful tutorial which will guide me from start. I've never written a plugin for jquery before. I want to prevent draggables from overlappping on each other. I found a plugin for jquery ui but it doesn't work with version 1.7.1 of jQuery UI Please help!

    Read the article

  • When to write an iterator?

    - by Jon
    I know this is probably a silly question.. When would I need to write my own iterator? Is it just when designing my own container class? Are there any other times when I would want to create my own iterator? Examples would be appropriated. -Jon

    Read the article

  • c# - Library to write javascript code

    - by Melursus
    Is there a c# library that can help to write and indent Javascript code. It's because I'm writing some c# code that generated some Javascript code. Something like this : js += "<script type=\"text/javascript\">\n"; js += " function()...\n"; And I find that generated a lot of ugly code. So, I thought that maybe a existing library can help me doing that ?

    Read the article

  • How do I write a analyzable thread dump format

    - by gamue
    I'm creating a global exception handling which collects some information before shutting down in some cases. One of this information is the current thread dump. i do this with following code: ManagementFactory.getThreadMXBean().dumpAllThreads(true, true); The problem is to write the information into a analyzable format for TDA. Is there a "simple" way to format the information instead of writing the format on my own?

    Read the article

  • Trying to write a loop that uses an OutputStream to write to a text file.

    - by Steve McLain
    I'm not a java programmer, I'm a VB programmer. I am doing this as part of an assignment, however, I'm not asking for help on something assignment related. I'd like to figure out how to get the OutputStreamWriter to work properly in this instance. I just want to capture the values I'm generating and place them into a text document. The file is generated, but only one entry exists, not the 40 I'm expecting. I could do this in a heartbeat with VB, but java feels very strange to me right now. Your help is appreciated. Thanks, Steve Here's the code: public static void main(String[] args){ long start, end; double result,difference; try {//OutputStream code assistance from http://tutorials.jenkov.com/java-io/outputstreamwriter.html OutputStream outputStream = new FileOutputStream("c:\\Temp\\output1.txt"); Writer out = new OutputStreamWriter(outputStream); for(int n=1; n<=20; n++){ //Calculate the Time for n^2. start = System.nanoTime(); //Add code to call method to calculate n^2 result = mN2(n); end = System.nanoTime(); difference = (end - start); //Output results to a file out.write("N^2 End time: " + end + " Difference: " + difference + "\n"); out.close(); } } catch (IOException e){ } try { OutputStream outputStream = new FileOutputStream("c:\\Temp\\output1.txt"); Writer out = new OutputStreamWriter(outputStream); for(int n=1; n<=20; n++){ //Calculate the Time for 2^n. start = System.nanoTime(); //Add code to call method to calculate 2^n result = m2N(n); end = System.nanoTime(); difference = (end - start); //Output results to a file out.write("N^2 End time: " + end + " Difference: " + difference + "\n"); out.close(); } } catch (IOException e){ } } //Calculate N^2 public static double mN2(double n) { n = n*n; return n; } //Calculate 2N public static double m2N (double n) { n = 2*n; return n; }

    Read the article

  • I write bad wave files using Java

    - by Cliff
    I'm writing out wave files in Java using AudioInputStream output = new AudioInputStream(new ByteArrayInputStream(rawPCMSamples), new AudioFormat(22000,16,1,true,false), rawPCMSamples.length) AudioSystem.write(output, AudioFileFormat.Type.WAVE, new FileOutputStream('somefile.wav')) And I get what appears to be corrupt wave files on OSX. They won't play from Finder however using the same code behind a servlet writing directly to the response stream and setting the Content-Type to audio/wave seems to play fine in quicktime. What gives?

    Read the article

  • PHP Increasing write to page speed.

    - by Frederico
    I'm currently writing out xml and have done the following: header ("content-type: text/xml"); header ("content-length: ".strlen($xml)); $xml being the xml to be written out. I'm near about 1.8 megs of text (which I found via firebug), it seems as the writing is taking more time than the script to run.. is there a way to increase this write speed? Thank you in advance.

    Read the article

  • Are there programs that iteratively write new programs?

    - by chris
    For about a year I have been thinking about writing a program that writes programs. This would primarily be a playful exercise that might teach me some new concepts. My inspiration came from negentropy and the ability for order to emerge from chaos and new chaos to arise out of order in infinite succession. To be more specific, the program would start by writing a short random string. If the string compiles the programs will log it for later comparison. If the string does not compile the program will try to rewrite it until it does compile. As more strings (mini 'useless' programs) are logged they can be parsed for similarities and used to generate a grammar. This grammar can then be drawn on to write more strings that have a higher probability of compilation than purely random strings. This is obviously more than a little silly, but I thought it would be fun to try and grow a program like this. And as a byproduct I get a bunch of unique programs that I can visualize and call art. I'll probably write this in Ruby due to its simple syntax and dynamic compilation and then I will visualize in processing using ruby-processing. What I would like to know is: Is there a name for this type of programming? What currently exists in this field? Who are the primary contributors? BONUS! - In what ways can I procedurally assign value to output programs beyond compiles(y/n)? I may want to extend the functionality of this program to generate a program based on parameters, but I want the program to define those parameters through running the programs that compile and assigning meaning to the programs output. This question is probably more involved than reasonable for a bonus, but if you can think of a simple way to get something like this done in less than 23 lines or one hyperlink, please toss it into your response. I know that this is not quite meta-programming and from the little I know of AI and generative algorithms they are usually more goal oriented than what I am thinking. What would be optimal is a program that continually rewrites and improves itself so I don't have to ^_^

    Read the article

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