Search Results

Search found 45804 results on 1833 pages for 'large files'.

Page 18/1833 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • Sending files from server to client in Java

    - by Lee Jacobson
    Hi, I'm trying to find a way to send files of different file types from a server to a client. I have this code on the server to put the file into a byte array: File file = new File(resourceLocation); byte[] b = new byte[(int) file.length()]; FileInputStream fileInputStream; try { fileInputStream = new FileInputStream(file); try { fileInputStream.read(b); } catch (IOException ex) { System.out.println("Error, Can't read from file"); } for (int i = 0; i < b.length; i++) { fileData += (char)b[i]; } } catch (FileNotFoundException e) { System.out.println("Error, File Not Found."); } I then send fileData as a string to the client. This works fine for txt files but when it comes to images I find that although it creates the file fine with the data in, the image won't open. I'm not sure if I'm even going about this the right way. Thanks for the help.

    Read the article

  • Splitting Code into Headers/Source files

    - by cam
    I took the following code from the examples page on Asio class tcp_connection : public boost::enable_shared_from_this<tcp_connection> { public: typedef boost::shared_ptr<tcp_connection> pointer; static pointer create(boost::asio::io_service& io_service) { return pointer(new tcp_connection(io_service)); } tcp::socket& socket() { return socket_; } void start() { message_ = make_daytime_string(); boost::asio::async_write(socket_, boost::asio::buffer(message_), boost::bind(&tcp_connection::handle_write, shared_from_this(), boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); } private: tcp_connection(boost::asio::io_service& io_service) : socket_(io_service) { } void handle_write(const boost::system::error_code& /*error*/, size_t /*bytes_transferred*/) { } tcp::socket socket_; std::string message_; }; I'm relatively new to C++ (from a C# background), and from what I understand, most people would split this into header and source files (declaration/implementation, respectively). Is there any reason I can't just leave it in the header file if I'm going to use it across many source files? If so, are there any tools that will automatically convert it to declaration/implementation for me? Can someone show me what this would look like split into header/source file for an example (or just part of it, anyway)? I get confused around weird stuff like thistypedef boost::shared_ptr<tcp_connection> pointer; Do I include this in the header or the source? Same with tcp::socket& socket() I've read many tutorials, but this has always been something that has confused me about C++.

    Read the article

  • Is there a distributed VCS that can manage large files?

    - by joelhardi
    Is there a distributed version control system (git, bazaar, mercurial, darcs etc.) that can handle files larger than available RAM? I need to be able to commit large binary files (i.e. datasets, source video/images, archives), but I don't need to be able to diff them, just be able to commit and then update when the file changes. I last looked at this about a year ago, and none of the obvious candidates allowed this, since they're all designed to diff in memory for speed. That left me with a VCS for managing code and something else ("asset management" software or just rsync and scripts) for large files, which is pretty ugly when the directory structures of the two overlap.

    Read the article

  • Are there version control systems that allow you to permanently delete files?

    - by Andrea Francia
    I need to keep under version some large files (some Gigs). I don't need, and I can't keep under version all the version of the files. I want to be able to remove from my VCS large files version at some moment. What control version system could I use? EDIT: The files that I want to keep under version control are big .zip files or ISO images. These files may contains executable software or data (seismic data, SAR images, GNSS data) and they are provided by the software supplier of my company.

    Read the article

  • How to insert large files in mysql database using php? [closed]

    - by anjan
    Hi! I want to upload a large file of size 10M max to my mysql database. Using .htaccess i changed the PHP's own file upload limit to "10485760" = 10M, i am able to upload files upto 10M size without any problem. But i can not insert the file in database if it is more that 1M in size. i am using file_get_contents to read all file data and pass it to the insert query as a string to be inserted into a LONGBLOB field. But files with more than 1M size is not being added to database, though i can use print_r($_FILES) to examine that the file uploaded correctly. Any help will be appreciated and i will need it within next 6 hours. So, please help! best regards, Anjan * This is a duplicate of http://stackoverflow.com/questions/492549/how-can-i-insert-large-files-in-mysql-db-using-php *

    Read the article

  • Iterating over a large data set in long running Python process - memory issues?

    - by user1094786
    I am working on a long running Python program (a part of it is a Flask API, and the other realtime data fetcher). Both my long running processes iterate, quite often (the API one might even do so hundreds of times a second) over large data sets (second by second observations of certain economic series, for example 1-5MB worth of data or even more). They also interpolate, compare and do calculations between series etc. What techniques, for the sake of keeping my processes alive, can I practice when iterating / passing as parameters / processing these large data sets? For instance, should I use the gc module and collect manually? Any advice would be appreciated. Thanks!

    Read the article

  • API for parse/update UNIX configuration files

    - by Chen Levy
    Unix configuration files come in all shapes and forms. I know that Webmin has a Perl API that makes it easy to parse and modify most common configuration pro grammatically, while preserving changes that might have been made by hand. Are there any other libraries that has similar functionality, perhaps for other languages (Python, Ruby, C, C++, etc)?

    Read the article

  • Splitting jQuery into multiple files (for iPhone caching)

    - by Marko Ivanovski
    Hi, I was wondering if there is a way to split jQuery into multiple files, i.e. jQuery-1.4.2_part1.js jQuery-1.4.2_part2.js jQuery-1.4.2_part3.js ...and so on. The reason I want to do this is because the iPhone doesn't cache assets larger than 25kb and I really need jQuery to only be downloaded once. If you think there are other workarounds for this I am considering all options right now. Thanks, Marko

    Read the article

  • Multiple IDE project files

    - by TomWij
    We are currently working in a team where we use both Visual Studio and Code::Blocks, is there a way to replicate changes between those project files? So if one adds a file to the project file it will also get adjusted in the project file of the other IDE? Please note: We want our project to work on multiple IDE's, platforms and compilers. Thus a general solution is welcome too.

    Read the article

  • Scala script to copy files

    - by kulkarni
    I want to copy file a.txt to newDir/ from within a scala script. In java this would be done by creating 2 file streams for the 2 files, reading into buffer from a.txt and writing it to the FileOutputStream of the new file. Is there a better way to achieve this in scala? May be something in scala.tools.nsc.io._. I searched around but could not find much.

    Read the article

  • communicating swf files.

    - by Addis Abebayehu
    I have two swf files I would like communicate. I have a videoplaylist.swf and a player.swf. I would like to select a video from videoplaylist.swf and have it played in the player.swf. How do I do that? How am I going to dispatch the click event with the video url to the player.swf? from the videoplaylist.swf. Please help.

    Read the article

  • Where are the .framework files?

    - by thyrgle
    Hi, I am wondering where the .framework files are located. I am using Mac OS 10.6. If this is more of a Superuser question just tell me because I was having trouble determining whether to put it here or Superuser or here but it seemed like it should go here.

    Read the article

  • Filling own template files

    - by Azat
    What is the best way to fill a template file with variables, which are collected from a Windows Form or Web Page. I want to create a wizard program that collects some data from user, for instance, reportname, reporttype, etc. and I need to create then some xml files (templates) with these variables inserted.

    Read the article

  • required files to distribute a c# .net application

    - by Jeff
    I'm trying to figure out what files are needed when I distribute an application that I have written. In the release folder after I have built the application I have the following: app.exe (obviously needed) app.exe.config (obviously needed for my config settings) app.pdb app.vshost.exe app.vshost.exe.config app.vshost.exe.manifest

    Read the article

  • Getting the names of all files in a directory with PHP

    - by Greelmo
    For some reason, I keep getting a '1' for the file names with this code: if (is_dir($log_directory)) { if ($handle = opendir($log_directory)) { while($file = readdir($handle) !== FALSE) { $results_array[] = $file; } closedir($handle); } } When I echo each element in $results_array, I get a bunch of '1's, not the name of the file. How do I get the name of the files?

    Read the article

  • Append or modify keys in conf files using sed/bash one-liner

    - by Jeff
    I often have to modify files such as sysctl.conf, and I'm familiar with using sed to replace existing values. Is there a way to append the new key/value pair to the file if sed wasn't able to replace it? For instance, using this example: modify config file using bash script sed -c -i "s/\($TARGET_KEY *= *\).*/\1$REPLACEMENT_VALUE/" $CONFIG_FILE How could I add the $TARGET_KEY = $REPLACEMENT_VALUE new line to $CONFIG_FILE using the same sed expression with slight changes? And on a related topic, how can I force creation of $CONFIG_FILE if it didn't exist?

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >