How you debug a binary format

I would like to be able to debug building a binary builder. Right now I am basically printing out the input data to the binary parser, and then going deep into the code and printing out the mapping of the input to the output, then taking the output mapping (integers) and using that to locate the corresponding integer in the binary. Pretty clunky, and requires that I modify the source code deeply to get at the mapping between input and output.

It What seems like you could do is view the binary in different variants (in my case I’d like to view it in 8-bit chunks as decimal numbers, because that’s pretty close to the input). Actually, some numbers are 16 bit, some 8, some 32, etc. So maybe there would be a way to view the binary with each of these different numbers highlighted in memory in some way.

The only way I could see that being possible is if you actually build a visualizer specific to the actual binary format/layout. So it knows where in the sequence the 32 bit numbers should be, and where the 8 bit numbers should be, etc. This is a lot of work and kind of tricky in some situations. So wondering if there’s a general way to do it.

Also wondering what the general way of debugging this type of thing currently is, so maybe I can get some ideas on what to try from that.

How to add n-days to twig date format within a for-loop?

I’m working with twig and got the date and format working. I have a start date (let’s say todays day) and I’d like to print every day into a table cell.

I have my date field in the var datum and I’m able to add 1 day with this. it’s working.

{% set datum = date(current_user.cwmon)|date_modify("+1 day")|date('D d.m.y') %} 

when I put this into a for loop, I get not the answer I’d like to.

the code itself:

{% for j in 0..6 %}     {% set datum = date(current_user.cwmon)|date_modify("+1 day")|date('D d.m.y') %}     // other code     {{ j }}: {{ datum }}     // other code {% endfor %} 

is there a way to use my var j instead of +1 day? Whatever I try I get an error.

my desired result:

0: Mon 15.01.19 1: Tue 16.01.19 ... 6: Sun 20.01.19 

Thank you very much in advance.

How to dynamically set a column to actionParams when using a format action in JSON – MS FLOW

I’m working on have to trigger ms flow from a link in sharepoint via the modern UI list. I can trigger the link and it fires the flow but instead of hardcoding the flow GUID i want to store them in a field in SharePoint and pass it in as an action parameter in the JSON. Is this possible? See screenshot below of the JSON for custome formating

{   "$  schema": "",   "elmType": "span",   "style": {     "color": "#0078d7"   },   "children": [     {       "elmType": "span",       "attributes": {         "iconName": "Flow"       }     },     {       "elmType": "button",       "style": {         "border": "none",         "background-color": "transparent",         "color": "#0078d7",         "cursor": "pointer"       },       "txtContent": "Start Flow",       "customRowAction": {         "action": "executeFlow",          //How can i pass a column field name there to the ID instead of the hardocded GUID?         "actionParams": "{\"id\": \"c42f9124-653d-468a-8178-07063e5f5c88\"}"       }     }   ] } 

My External Hard Drive’s format changed to FAT16 without any reason

I have an ADATA HD710 1TB external hard drive which I use mostly in my Mac Mini 2011 and I have created two separate partitions for my drive.

One of the partitions has APFS (Apple File System) format and the other has MS-DOS FAT (FAT32) format. I use the second one for Windows 10 that is installed on my computer using Bootcamp. As it’s not possible to view files of the drive which is formatted in APSF in Windows I use that FAT32 partition to move some files from my main drive to that and view them in Windows.

Yesterday I plugged my external drive in to Windows 10 and after copying some files I just ejected it. Today when I tried to access my files in macOS I realized that my Hard drive’s format is changed to FAT16 and none of the two partitions which I had created are displayed.

enter image description here

I tried repairing my drive using the Disk Utility’s First Aid feature but it didn’t work. I also tried repairing it via Terminal using diskutil repairDisk command and the result was the same as Disk Utility. Finally, I tried repairing it in Windows (using diskpart commands) and I was unsuccessful again.

How can I fix this issue?

Please notice that I really need the information inside my main partition of the drive (The FAT32 partition is not that important for me). Otherwise, I know that if I erase the whole drive, I can use it again.

The exact error message that I get when I connect my external drive to macOS is:

The disk you inserted was not readable by this computer.

Why use DX format? It’s an FX camera

I covered “Nikon” and “D700” with black tape. Silly, I know, but it does seem to have a size and attention reducing effect.

The loud shutter sound. Well, it’s certainly not a quiet camera, but that has not prevented me from taking unnoticed shots in pubs and the like. I could imagine it being a problem in a theater for instance.

I use the D700 as a FF digital FE2 I guess.

How do I convert an image in a np array to the same format as reading that image using binary read

I’m using the Face cognitive service from Microsoft and my workflow has the image as a numpy array

MS allow images to be passed in as a url or as data in the header

If data is passed in the header, it can be created with a binary read as follows:

# cropped is the image as a numpy array # the three attempts below do not work # as microsoft does not recognise the result # as an image image_data = cropped.tobytes() image_data = cropped.tobytes("F") image_data  = cropped.tobytes("C")  # the following method does work but seems  # a bit ridiculous cv2.imwrite("temp.png", cropped) with open(path_to_image, 'rb') as f:     image_data = 

I can get my numpy array in the correct format by saving to disk with opencv imwrite and then reading it back in as above, but that doesn’t seem like a sensible thing to do.

I tried using the numpy function tobytes(“F”) and tobytes(“C”) but MS doesn’t recognise the result as a valid image

How can I use numpy to turn my image array into the same format as if I’d read the image from disk?