Search Results

Search found 3923 results on 157 pages for 'binary x'.

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

  • Java - Need help with binary/code string manipulation

    - by ShrimpCrackers
    For a project, I have to convert a binary string into (an array of) bytes and write it out to a file in binary. Say that I have a sentence converted into a code string using a huffman encoding. For example, if the sentence was: "hello" h = 00 e = 01, l = 10, o = 11 Then the string representation would be 0001101011. How would I convert that into a byte? <-- If that question doesn't make sense it's because I know little about bits/byte bitwise shifting and all that has to do with manipulating 1's and 0's.

    Read the article

  • Split a binary file into chunks c++

    - by L4nce0
    I've been bashing my head against trying to first divide up a file into chunks, for the purpose of sending over sockets. I can read / write a file easily without splitting it into chunks. The code below runs, works, kinda. It will write a textfile and has a garbage character. Which if this was just for txt, no problem. Jpegs aren't working with said garbage. Been at it for a few days, so I've done my research, and it's time to get some help. I do want to stick strictly to binary readers, as this need to handle any file. I've seen a lot of slick examples out there. (none of them worked for me with jpgs) Mostly something along the lines of while(file)... I subscribe to the, if you know the size, use a for-loop, not a while-loop camp. Thank you for the help!! vector<char*> readFile(const char* fn){ vector<char*> v; ifstream::pos_type size; char * memblock; ifstream file; file.open(fn,ios::in|ios::binary|ios::ate); if (file.is_open()) { size = fileS(fn); file.seekg (0, ios::beg); int bs = size/3; // arbitrary. Actual program will use the socket send size int ws = 0; int i = 0; for(i = 0; i < size; i+=bs){ if(i+bs > size) ws = size%bs; else ws = bs; memblock = new char [ws]; file.read (memblock, ws); v.push_back(memblock); } } else{ exit(-4); } return v; } int main(int argc, char **argv) { vector<char*> v = readFile("foo.txt"); ofstream myFile ("bar.txt", ios::out | ios::binary); for(vector<char*>::iterator it = v.begin(); it!=v.end(); ++it ){ myFile.write(*it,strlen(*it)); } }

    Read the article

  • Find largest rectangle containing only zeros in an N&times;N binary matrix

    - by Rajendra
    Given an NxN binary matrix (containing only 0's or 1's), how can we go about finding largest rectangle containing all 0's? Example: I 0 0 0 0 1 0 0 0 1 0 0 1 II->0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 <--IV 0 0 1 0 0 0 IV is a 6×6 binary matrix; the return value in this case will be Cell 1: (2, 1) and Cell 2: (4, 4). The resulting sub-matrix can be square or rectangular. The return value can also be the size of the largest sub-matrix of all 0's, in this example 3 × 4.

    Read the article

  • How do I get the C# Winforms Webbrowser control to show PDF content embedded in the html file as bin

    - by uniball
    I am using a Winforms webbrowser control to display HTML content stored in my SQL DB table. However, some of my contents are PDFs which I intend to store as binary data in the SQL DB and feed to the Webbrowser control. I wish to avoid the hassle of storing the binary content in a temporary file on the client machine and then create html container code to reference this temporary PDF file. Is there a way inwhich I can embed the PDF binary content into the html directly and show this html on the webbrowser control directly? I found these previous threads referring to a COM 'hack'. Is there a simpler, easier way? Thanks! http://stackoverflow.com/questions/290035/how-do-i-get-a-c-webbrowser-control-to-show-jpeg-files-raw Thanks, uniball

    Read the article

  • How to compare mp3, flac audio data in a file, ignoring header data (ID3 tag) etc.?

    - by Rob
    I've backed up some audio files up in 2 places and added ID3 tags into one backup but not the other, since time has passed my own memory has faded on whether the backups are actually the same, but now one has ID3 data and the other doesn't, basic binary compare will fail and inspection will be cumbersome. Is there a tool to compare just the audio data (not the header, ID3) in mp3s, flac files, and other files using header data such as ID3. started a thread on beyond compare here: http://www.scootersoftware.com/vbulletin/showthread.php?t=7413 would consider other comparison software that does this task

    Read the article

  • Cygwin :: mount

    - by gabriela reyna
    I'm trying to configure the cygwin to work with TWiki, I have to input this in the Cygwin bash shell: mount -b -s c:/... but it doesn't recognize the "-s", I already fixed the problem with -b, it changed the syntax and now is "mount -o binary" for the "mount -b"part. But now it says unknown option with the "-s" anyone?? help?? or what does the -s mean, so I can look it up :S

    Read the article

  • What is a 8086 relocatable?

    - by gerrit
    I'm running some Fortran software (LBLRTM) and a shell-script that prepares input generates a number of files with names TAPE3, TAPE4, etc. For debugging purposes, I used file to identify the file type. file tells me: TAPE3: 8086 relocatable (Microsoft) My guess is that file is wrong here, and that it's just a binary file that happens to look like a 8086 relocatable. But what is a 8086 relocatable?

    Read the article

  • Pre-compiled Iperf 2.x binary for win32?

    - by Ryan Bolger
    I'd like to do some network testing on Windows using Iperf. The latest on sourceforge appears to be 2.0.4. However, it's only available as source to be compiled. I attempted to do some google searching for a pre-compiled version, but all I could find were some links to 1.x stuff. Admittedly, the 1.x version I found does seem to work and I could likely continue using it without issue. But I've got the itch that says I need the latest version and setting up a build VM and dealing with inevitable compile issues doesn't sound like a whole lot of fun. So I figured I'd ask here if anyone knows where to find pre-compiled Iperf 2.x binaries for Windows.

    Read the article

  • FastCGI + Apache: How to map a url to a specific fastcgi binary

    - by skyeagle
    I have written two C++ fastcgi applications (foo and foobar). I am running apache 2.2 (prefork) with mod_fcgid on Ubuntu 10.x. I want to be able to setup apache so that: http://mywebsite/some/path1?param1=value1&param2=value2 will run the fastcgi app foo AND mywebsite/another/path1?param1=value1&param2=value2 will run the fastcgi app foobar Note: The url above is intentionally invalid (missing the protocol type), since I cant post more than 1 link in this question. How do I setup apache to achieve this?

    Read the article

  • Binary management/delivery

    - by Stan
    Is there any good solution to management server application binaries (may up to 1GB), with the aim of achieving version control and delivery, and have a way to verify that every remote server has same version? Our operating system is Windows Server 2003.

    Read the article

  • can't find phpdoc binary?

    - by ajsie
    i've downloaded the phpdoc from their site, extracted it and put it in apache's documentroot for access through the web browser. however, i cant access the "phpdoc" tool from the command line. i have to add it to a Path but i cant find it in the extracted folder. where is it?

    Read the article

  • Can't find the PHPdoc binary file

    - by ajsie
    I've downloaded the phpdoc from their site, extracted it, and put it in apache's documentroot for access through the web browser. However, I cant access the phpdoc tool from the command line. I have to add it to the PATH because I want to use the command line for automated documentation building, but considering I can't find it I can't add it to the PATH.

    Read the article

  • /scripts/easyapache broke PHP and now outputs binary

    - by James Lawrie
    I ran /scripts/easyapache on one of my cpanel servers last night and since then PHP just gives 501 errors, which no logs I can find. I tried running it again and it's running as normal but all output has been replaced with strange characters, eg: ????+?+± °?? ?-?.?... =?? ????+?+± °?? ¦+?+?.?... =?? ????+?+± °?? ?=?/¦+?+?.?... +? ????+?+± °?? ?=?/??++.?... =?? ????+?+± °?? ??++.?... =?? ????+?+± °?? ???+?+.?... +? ????+?+± °?? ?=?/????¦???.?... =?? ????+?+± °?? +??±?+.?... =?? ????+?+± °?? +??¦+?.?... =?? Has anyone come across this before? Is it fixable?

    Read the article

  • Linux / UNIX / OS X Binary Directory Structure

    - by Kevin Sylvestre
    Will Linux / UNIX / OS X binaries be stored in the same directories across different platform or distributions? I'm asking because I need to have access to uuidgen (stored in /usr/bin/uuidgen on my development computer) and noticed that my local Apache server does not include /usr/bin in the PATH. I know I could add /usr/bin to the path, but I want to make sure the software can be re-deployed on a number of different systems with ease. Thanks!

    Read the article

  • Windows XP cannot execute binary file on Network Share

    - by angerman
    I'm having a Network Share provided by a Mac OS X Lion Server on a recent Mac Mini Server (CIFS / SMB); mounting the share in Windows (XP) is no problem, reading and writing neither. But when ever I try to execute an executable .exe, Windows complains that it's not a valid win32 executable. Copying the file from the network share to the desktop or some other local location, allows the file to be subsequently executed. Pointers to what the root cause of this problem may be are greatly appreciated.

    Read the article

  • permission denied when trying to execute a binary I burned to a CD-R

    - by user16654
    On a UBUNTU karmic machine, I burned a cd from the command prompt using: cdrecord -v speed=16 dev=0,1,0 /FPS.iso The CD now contains an executable and some files. I tested the cd by loading it onto another machine (Red Hat 5.3) and when I try to run the program I get the following message: bash: ./FPS1_1: Permission denied I can open other files like text documents (the executable also comes with shared libraries). I realized I had burned the cd as root so I burned another one as another user but I still got the same problem. How can I remove this permission or what is the problem? P.S. the image was in / if that helps

    Read the article

  • Ubuntu 12.04 crash analysis - strange binary data on all open files at the moment of crash

    - by lanbo
    A couple of hours ago we got a system crash on Ubuntu 12.04. We checked all the log files and there is nothing suspicious to blame to. Last stuff that was logged was some dovecot activity. There are no kernel panic messages. Nothing. It is a new server (new hardware) we are testing before production. And because it is new hard, I'm suspicious the problem may be due to some faulty hardware. We already run memtester with no problem detected. I'll be happy to hear from other hardware testing tools (the machine has SSD). Anyway, the thing I wanted to ask you is a different one. The strange thing is on every open file at the moment of the crash we found the next sequence of symbols was written into them: "@^@^@^@^@^@^@...". For example, on the syslog log file we got: Apr 16 15:53:56 odyssey dovecot: pop3-login: Aborted login (auth failed, 1 attempts): user=<info>, method=PLAIN, rip=46.29.255.73, lip=5.9.58.177 ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^ [these continues for about 1000 chars...] ^@^@^@^@Apr 16 15:55:12 odyssey kernel: imklog 5.8.6, log source = /proc/kmsg started. We got all these symbols in all open files. These include: syslog, mail.log, kern.log, ... But also on some logs that are output by php scripts run in CRONs from user accounts (not root). So, any idea why all open files got these characters written during the crash? This is pretty bad since the crash corrupted many files (we don't even know which other ones may be affected). We are suspicious that all open files (in write mode maybe) at the moment of the crash got all these symbols inserted. Why is that? BTW [in case it helps], the system automatically rebooted after the crash but Apache did not start. There were not traces in /var/apache2/*log why apache did not start. After running a "service apache2 start" it started with no problems. Also, we rebooted the machine manually and Apache also started on reboot. But it did not start after the crash and no errors were reported. Thanks guys!

    Read the article

  • Permission denied when trying to execute a binary burned to a CD-R

    - by user16654
    On an Ubuntu 9.10 (Karmic Koala) machine, I burned a CD from the command prompt using: cdrecord -v speed=16 dev=0,1,0 /FPS.iso The CD now contains an executable and some files. I tested the CD by loading it onto another machine (Red Hat 5.3) and when I try to run the program I get the following message: bash: ./FPS1_1: Permission denied I can open other files like text documents (the executable also comes with shared libraries). I realized I had burned the CD as root so I burned another one as another user but I still have the same problem. How can I remove this permission or what is the problem? P.S. the image was in / if that helps

    Read the article

  • Binary serialization/de-serialization in C++ and C#

    - by 6pack kid
    Hello. I am working on a distributed application which has two components. One is written in standard C++ (not managed C++) and the other one is written in C#. Both are communicating via a message bus. I have a situation in which I need to pass objects from C++ to C# application and for this I need to serialize those objects in C++ and de-serialize them in C# (something like marshaling/un-marshaling in .NET). I need to perform this serialization in binary and not in XML (due to performance reasons). I have used Boost.Serialization to do this when both ends were implemented in C++ but now that I have a .NET application on one end, Boost.Serialization is not a viable solution. I am looking for a solution that allows me to perform (de)serialization across C++ and .NET boundary i.e., cross platform binary serialization. I know I can implement the (de)serialization code in a C++ dll and use P/Invoke in the .NET application, but I want to keep that as a last resort. Also, I want to know if I use some standard like gzip, will that be efficient? Are there any other alternatives to gzip? What are the pros/cons of them? Thanks

    Read the article

  • Read binary file into a struct C#

    - by Robert Höglund
    I'm trying to read binary data using C#. I have all information about the layout of the data in the files I want to read. I'm able to read the data "chunk by chunk", i.e. getting the first 40 bytes of data converting it to a string, get the next 40 bytes, ... Since there are at least three slighlty different version of the data, I would like to read the data directly into a struct. It just feels so much more right than by reading it "line by line". I have tried the following approach but to no avail:StructType aStruct; int count = Marshal.SizeOf(typeof(StructType)); byte[] readBuffer = new byte[count]; BinaryReader reader = new BinaryReader(stream); readBuffer = reader.ReadBytes(count); GCHandle handle = GCHandle.Alloc(readBuffer, GCHandleType.Pinned); aStruct = (StructType) Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(StructType)); handle.Free(); The stream is an opened FileStream from which I have began to read from. I get an AccessViolationException when using Marshal.PtrToStructure. The stream contains more information than I'm trying to read since I'm not interested in data at the end of the file. The struct is defined like:[StructLayout(LayoutKind.Explicit)] struct StructType { [FieldOffset(0)] public string FileDate; [FieldOffset(8)] public string FileTime; [FieldOffset(16)] public int Id1; [FieldOffset(20)] public string Id2; } The examples code is changed from original to make this question shorter. How would I read binary data from a file into a struct?

    Read the article

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