FAQ Database Discussion Community

User-readable file format for python list of lists

I'm considering using user-readable file format for my Python app. Right now I'm using pickle to store my data in binary. I'm not sure if XML or JSON is a way to go but basically my file contains list of lists that looks like this: [1, 'the name of the...

How do graphic file format types work?

I'm very interested in understanding how graphic file format (PNG, JPG, GIF) work. Are there any code examples that demonstrate how these files are made and also how they are interpreted (viewed in browser)?

What do these bytes do?

This is the hexdump of a black 1x1 PNG made in Gimp and exported with minimal information: 89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52 00 00 00 01 00 00 00 01 08 02 00 00 00 90 77 53 DE...

Creating a nifti file from a numpy array

I have a numpy array that I would like to covert into a nifti file. Through the documentation it seems PyNIfTI used to do this with: image=NiftiImage(Array) However, PyNIfTI isn't supported anymore. NiBabel, the successor to PyNIfTI, doesn't seem to support this function. I must be missing something. Does anyone...

Attachment downloaded in “File” format instead of pdf

I am sending an email with an attachment (pdf) through laravel.But the attachment when downloaded converts to "File" type instead of pdf... Heres my code $pdf_file_path = public_path() . '/user/invoices/invoice_' . $data['hp_transaction_id'] . '.pdf'; PDF::loadView('payment.payment-invoice', $data) ->setPaper('a4') ->setOrientation('portrait') ->setWarnings(false) ->save($pdf_file_path); Mail::send('emails.view-property-transaction-completed', $data, function($message) use ($pdf_file_path, $transaction) {...

Recognizing file formats from binary (C++)

I am a beginner C++ programmer. I wrote a simple program that creates a char array (the size is user's choice) and reads what previous information was in it. Often you can find something that makes sense (I always find the alphabet?) but most of it is just strange characters....

Dissecting MySQL InnoDB record format to restore from raw disk

I had a mysql database stored on a USB thumb drive which has irreparably lost its file allocation table. Therefore, I cannot get to the ibdata1 file as a whole. I can, however locate the record pages which were used using a hex editor. All the data is there, but...

Correct way to implement en/decrypting stream in .NET?

I want to import and export an old game file format, and its data is encrypted. Details are found here; shortly summarized, the file is seperated into blocks, each one uses a specific kind of an XOR encryption based on the previous uint, and a checksum trails each block which...

WASAPI Loopback: Save wave file

I want to record the system's audio output using WASAPI and then saving it to a .wav file. So far I've followed these guides on WASAPI: https://msdn.microsoft.com/en-us/library/windows/desktop/dd316551%28v=vs.85%29.aspx https://msdn.microsoft.com/en-us/library/windows/desktop/dd370800%28v=vs.85%29.aspx I get the buffer data using audioCaptureClient->GetBuffer(&data, &numFramesAvailable, &flags, NULL, NULL); then, I'm processing this data, by just writing it at the...