Search Results

Search found 4214 results on 169 pages for 'binary serializer'.

Page 122/169 | < Previous Page | 118 119 120 121 122 123 124 125 126 127 128 129  | Next Page >

  • PHP Force Download Causing 0 Byte Files

    - by Alex
    Hey, I'm trying to force download files from my web server using PHP. I'm not a pro in PHP but I just can't seem to get around the problem of files downloading in 0 bytes in size. CODE: $filename = "FILENAME..."; header("Content-type: $type"); header("Content-Disposition: attachment;filename=$filename"); header("Content-Transfer-Encoding: binary"); header('Pragma: no-cache'); header('Expires: 0'); set_time_limit(0); readfile($file); Can anybody help? Thanks.

    Read the article

  • Execute python code inside browser without Jython

    - by proportional
    Is there a way to execute python code in a browser, other than using Jython and an applet? The execution does not have to deal with anything related to graphics. For example, just sum all the digits of a binary 1Gb file (chosen by the browser user) and then return the result to the server. I am aware that python can be executed remotely outside a browser, but my requirement is to be done inside a browser. For sure, I take for granted the user will keep the right to execute or not, and will be asked to do so, and all this security stuff... but that is not my question.

    Read the article

  • How do I effectively write to 146 output files in C++ using cstdlib library

    - by Elpezmuerto
    I have a very large binary file and I need to create separate files based on the id within the input file. There are 146 output files and I am using cstdlib and fopen and fwrite. FOPEN_MAX is 20, so I can't keep all 146 output files open at the same time. I also want to minimize the number of times I open and close an output file. How can I write to the output files effectively? I also must use the cstdlib library due to legacy code.

    Read the article

  • write cache and write sequence order

    - by excanoe
    ok, here i have some weird question: let say we have some binary file (.log), and sequence of write operations, for example log1, log2, log3 and each has some block size n (raw data). question: can I be sure that log1,log2 and log3 sequences can be written in the correct order in ONE file, even if i have few cache levels (disk hardware and os level)? update very interested in what will be with records order (not with records) if we have software or hardware failure (reboot or another reason). update there can be some percent of write failures, but main question is: will write order stay correct?

    Read the article

  • What's the best way to build software that doesn't require the newest glibc?

    - by ZorbaTHut
    I'm attempting to build a binary package that can be run on multiple Linux distributions. It's currently built on Ubuntu 10.04, but it fails on Ubuntu 8.04 with the following error: ./test: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by ./test) ./test: /usr/lib/libstdc.so.6: version `GLIBC_2.11' not found (required by ./test) What's the preferred way to solve this problem? Is there a way to install an old glibc on a new box and build against it, or do I have to build on an old distribution? And if I build against an old glibc, will it work on a new glibc? Or, alternatively, are there just some handy compiler flags or packages I could install to solve the problem?

    Read the article

  • What's the best way to build software to not require the newest glibc?

    - by ZorbaTHut
    I'm attempting to build a binary package that can be run on multiple Linux distributions. It's currently built on Ubuntu 10.04, but it fails on Ubuntu 8.04 with the following error: ./test: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by ./test) ./test: /usr/lib/libstdc.so.6: version `GLIBC_2.11' not found (required by ./test) What's the preferred way to solve this problem? Is there a way to install an old glibc on a new box and build against it, or do I have to build on an old distribution? And if I build against an old glibc, will it work on a new glibc? Or, alternatively, are there just some handy compiler flags or packages I could install to solve the problem?

    Read the article

  • Quick, Beginner C++ Overloading Question - Getting the compiler to perceive << is defined for a spec

    - by Francisco P.
    Hello everyone. I edited a post of mine so I coul I overloaded << for a class, Score (defined in score.h), in score.cpp. ostream& operator<< (ostream & os, const Score & right) { os << right.getPoints() << " " << right.scoreGetName(); return os; } (getPoints fetches an int attribute, getName a string one) I get this compiling error for a test in main(), contained in main.cpp binary '<<' : no operator found which takes a right-hand operand of type 'Score' (or there is no acceptable conversion) How come the compiler doesn't 'recognize' that overload as valid? (includes are proper) Thanks for your time.

    Read the article

  • Reading bytes from JavaScript string

    - by Jan
    I have a string containing binary data in JS. Now I want to read, for example, an integer from it. So I get the first 4 characters, use charCodeAt, do some shifting etc. to get an integer. Problem is that strings in JS are UTF-16 (instead of ASCII) and charCodeAt often returns values higher than 256. The Mozilla reference states that "The first 128 Unicode code points are a direct match of the ASCII character encoding." (what about ASCII values 128?) How can I convert the result of charCodeAt to an ASCII value? Or is there a better way to convert a string of four characters to a 4 byte integer?

    Read the article

  • Data-only static libraries with GCC

    - by regularfry
    How can I make static libraries with only binary data, that is without any object code, and make that data available to a C program? Here's the build process and simplified code I'm trying to make work: ./datafile: abcdefghij Makefile: libdatafile.a: ar [magic] datafile main: libdatafile.a gcc main.c libdatafile.a -o main main.c: #define TEXTPTR [more magic] int main(){ char mystring[11]; memset(mystring, '\0', 11); memcpy(TEXTPTR, mystring, 10); puts(mystring); puts(mystring); return 0; } The output I'm expecting from running main is, of course: abcdefghijabcdefghij My question is: what should [magic] and [more magic] be?

    Read the article

  • Generate MySQL data dump in SQL from PHP

    - by Álvaro G. Vicario
    I'm writing a PHP script to generate SQL dumps from my database for version control purposes. It already dumps the data structure by means of running the appropriate SHOW CREATE .... query. Now I want to dump data itself but I'm unsure about the best method. My requirements are: I need a record per row Rows must be sorted by primary key SQL must be valid and exact no matter the data type (integers, strings, binary data...) Dumps should be identical when data has not changed I can detect and run mysqldump as external command but that adds an extra system requirement and I need to parse the output in order to remove headers and footers with dump information I don't need (such as server version or dump date). I'd love to keep my script as simple as I can so it can be hold in an standalone file. What are my alternatives?

    Read the article

  • Howto convert to string and read data from TCP packet

    - by salime
    I used sharppcap to capture TCP packets. Now i wanna reconstruct HTTP packet from TCP packets but i don't know how. I read somewhere i can find start of HTTP packet in TCP data... i tried to convert byte[] TCP data to string using this code: string s = System.Text.Encoding.UTF8.GetString(tcp_pack.Data); but the string isn't readable. like a binary file that is opened with notepad. is it because the data is encrypted or code is incorrect? how can i reconstruct HTTP packet from TCP packets?

    Read the article

  • How to create diagrams for papers.

    - by Simon
    I want to create some diagrams for some papers. Diagrams will contain some text, e.g. some console output. I need images for using also in html files. There is TikZ so can create images like this: http://www.texample.net/tikz/examples/boxes-with-text-and-math/ http://www.texample.net/tikz/examples/rule-based-diagram/ http://www.texample.net/tikz/examples/scenario-tree/ but as a result I get some ps/pdf files, not images. What's more I want to generate the pictures from text files as I want to track changes in some VCS, any binary files are not suitable for that.

    Read the article

  • In Linux, how can I completely disregard the contents of /etc/ld.so.cache?

    - by BillyBBone
    Hi, For the purposes of prototyping a new set of shared libraries in a development sandbox (to which I don't have root access), I'd like to know how to execute a binary while completely overriding the contents of /etc/ld.so.cache, so that none of the system libraries get loaded. How can this be done? I have looked at mechanisms like setting the LD_LIBRARY_PATH environment variable or launching the program wrapped inside /lib/ld-linux.so, but these methods all seem to supplement the loading of libraries from /etc/ld.so.cache, but not override it completely. Help?

    Read the article

  • TFS 2008 and Common libraries folder structure.

    - by Doerr
    TFS 2008 and Common Libraries I have created a Team Project called "Common Library" that will host code used in numerous different Team Projects throughout TFS. For sake of argument, lets say we have 2 distinct Librarys under the "Common Library" Team Projects, MailProject and LoggingProject. Other projects throughout TFS will be using the binary representation of these projects via branching and not the actual source code. What is the best way to set up the folder structure for this Team Project? Do I add the project to the "Common Library" and simply "include" the bin/release folder as part of the project? I have seen some examples of people creating a seperate "Deploy" folder. I assume this is synonamous with the bin/release folder?

    Read the article

  • Exception message (Python 2.6)

    - by TurboJupi
    If I want to open binary file (in Python 2.6), that doesn't exists, program exits with an error and prints this: Traceback (most recent call last): File "C:\Python_tests\Exception_Handling\src\exception_handling.py", line 4, in <module> pkl_file = open('monitor.dat', 'rb') IOError: [Errno 2] No such file or directory: 'monitor.dat' I can handle this with 'try-except', like: try: pkl_file = open('monitor.dat', 'rb') monitoring_pickle = pickle.load(pkl_file) pkl_file.close() except Exception: print 'No such file or directory' Does anybody know, how could I, in caught Exception, print the following line? File "C:\Python_tests\Exception_Handling\src\exception_handling.py", line 11, in <module> pkl_file = open('monitor.dat', 'rb') So, program would not exits, and I would have useful information.

    Read the article

  • How to know the file type of the file which you are forcing the user to download?

    - by Starx
    I am trying to force the user to download a file. For that my script is: $file = "file\this.zip"; header("Cache-Control: public"); header("Content-Description: File Transfer"); header("Content-Disposition: attachment; filename=$file"); header("Content-Type: application/zip"); //This is what I need header("Content-Transfer-Encoding: binary"); readfile($file); The files I am going to upload my not be .zip all the time so I want to know the content type of the image I am going to receive in $file. How to accomplish this

    Read the article

  • Why isn't my favicon appearing in IE7/8?

    - by X3Maverick
    Page of interest: https://www.gsb-yourbank.com/test/ ICO file: https://www.gsb-yourbank.com/test/favicon.ico My favicon is a 16x16 resolution, 16-color ICO file. It will not appear in IE 7/8 no matter what I do! I've tried everything I can think of, including: generating the ICO with a variety of different utilities, changing the syntax of the favicon link elements in the document head, using absolute, relative, and root-relative URLs in the favicon link elements, using a PNG instead of an ICO file, ensuring that I am uploading the file via FTP in binary mode, As a longtime web developer/programmer, I can't believe that this is tripping me up. Any help would be greatly appreciated.

    Read the article

  • How should i be handling string Interning on deserialization?

    - by DayOne
    In the example below I am interning the string in the constructor which is fine. However when i deserialise the object from the binary formatter I don't think the string will be interned as the constructor should be called. How should I be ensuring the _name string is interned? ... or will it be interned ok? Thanks [Serializable] class City { private readonly string _name; public City(string t) { _name = string.Intern(t); } public string Name { get { return _name; } } public override string ToString() { return _name; } }

    Read the article

  • Why does the right-shift operator produce a zero instead of a one?

    - by mrt181
    Hi, i am teaching myself java and i work through the exercises in Thinking in Java. On page 116, exercise 11, you should right-shift an integer through all its binary positions and display each position with Integer.toBinaryString. public static void main(String[] args) { int i = 8; System.out.println(Integer.toBinaryString(i)); int maxIterations = Integer.toBinaryString(i).length(); int j; for (j = 1; j < maxIterations; j++) { i >>= 1; System.out.println(Integer.toBinaryString(i)); } In the solution guide the output looks like this: 1000 1100 1110 1111 When i run this code i get this: 1000 100 10 1 What is going on here. Are the digits cut off? I am using jdk1.6.0_20 64bit. The book uses jdk1.5 32bit.

    Read the article

  • Faking a Single Address Space

    - by dsimcha
    I have a large scientific computing task that parallelizes very well with SMP, but at too fine grained a level to be easily parallelized via explicit message passing. I'd like to parallelize it across address spaces and physical machines. Is it feasible to create a scheduler that would parallelize already multithreaded code across multiple physical computers under the following conditions: The code is already multithreaded and can scale pretty well on SMP configurations. The fact that not all of the threads are running in the same address space or on the same physical machine must be transparent to the program, even if this comes at a significant performance penalty in some use cases. You may assume that all of the physical machines involved are running operating systems and CPU architectures that are binary compatible. Things like locks and atomic operations may be slow (having network latency to deal with and all) but must "just work".

    Read the article

  • What is the fastest method to calculate substring

    - by Misha Moroshko
    I have a huge "binary" string, like: 1110 0010 1000 1111 0000 1100 1010 0111.... It's length is 0 modulo 4, and may reach 500,000. I have also a corresponding array: {14, 2, 8, 15, 0, 12, 10, 7, ...} (every number in the array corresponds to 4 bits in the string) Given this string, this array, and a number N, I need to calculate the following substring string.substr(4*N, 4), i.e.: for N=0 the result should be 1110 for N=1 the result should be 0010 I need to perform this task many many times, and my question is what would be the fastest method to calculate this substring ? One method is to calculate the substring straight forward: string.substr(4*N, 4). I'm afraid this one is not efficient for such huge strings. Another method is to use array[N].toString(2) and then wrap the result with zeros if needed. I'm not sure how fast is this. May be you have any other ideas ?

    Read the article

  • Image ransfer using hessian protocol from client's folder to tomcat server

    - by ?? ?
    My goal is to upload a image(.jpg or .png)from client's folder to tomcat6 server through hessian protocol. And do image processing using opencv on server, then return the image back to client. Question1. Is the following transfering steps correct? put a test.jpg image on client's folder -- convert the test.jpg in client.java(main.java) class to BufferedImage -- convert the BufferedImage to mat or Iplimage in server for using openCV.I have set a hello world sample from Simple Messaging Example using Hessian , and searched from Hessian with large binary data and other websites, but still dont know how to use it! Question2. Is there a related JAVA sample code? Thank you very much. Btw, I am using ubuntu12+netbeans7.2

    Read the article

  • Database for Large number of 1kB data chunks (MySQL?)

    - by The Unknown
    I have a very large dataset, each item in the dataset being roughly 1kB in size. The data needs to be queried rapidly by many applications distributed over a network. The dataset has more than a million items (so 500 million+ 1kB data chunks). What would be the best method to storing this dataset (need to allow adding more items, and reading them rapidly, but never modifying already added data)? Would using a MySQL DB using the binary blob format be appropriate? Or should each of these be stored as files on a file system? edit: the number is 1 million items now, but needs to be able to scale to well over 500 million items easily.

    Read the article

  • Assembly 6800 Looping? Testing specific bits in a word.

    - by Jeremy
    Hi all, Trying to help a friend out with a friend out with some assembly code, but I've run into a small problem. I'm trying to work out how I would loop through a 8 bit binary word and check the value of specific bits. I need to check bits 1, 3, 5 & 7 to see if they are 1. i.e. int count = 1; int bitAdd = 0; foreach (var bit in word) { if (count = 1 || count = 3 || count = 5 || count = 7) { bitAdd += 1; } count += 1; } Help is much appreciated.

    Read the article

  • Tiny C Compiler and Virus warnings...

    - by NoMoreZealots
    I wanted to try out the TCC and got the Win32 Binary zip file from the website. upon decompressing it I tried to compile the "hello_win.c" source from the example directory. As soon as the compiler tried to write to the disk McAfee Popped up a dialog box and identified a Trojan named "Generic.dx." Has anyone else experience this? Dropping a virus into a compiler would be a sneaky, but brilliant, delivery mechanizism. I just want to know if this is a legit threat.

    Read the article

< Previous Page | 118 119 120 121 122 123 124 125 126 127 128 129  | Next Page >