Live data from Hacker News

Your hex editor should color-code bytes

simonomi.dev

121–130 of 165 posts

Re: Your hex editor should color-code bytes

#121
post #48

Earlier quoted context omitted.

> Everything should try do some basic syntax highlighting IMO. Interesting idea. So even syntax–highlighting natural language. Grammar highlighting, as it were. Prepositions, verbs, question marks, etc. An LLM could do it. Would it actually improve readability though? Seems likely!

I always enjoy to find people who think so drastically differently than myself. This sounds like an absolute nightmare to me and I would gauge my eyes out.

Imo there would be ways to do it so that it could have a similar effect to the capitalized nouns in German

Re: Your hex editor should color-code bytes

#122
post #101
post #70

Earlier quoted context omitted.

Most color blind men are mildly color blind, plenty even go through their lives without noticing. Yours is on the much stronger side of the things.

A cousin of mine found out in his late 20's that he is red-green color blind.

Had one of those happen in high school — science teacher talking about colour blindness and shows students the colour blindness tests, one student assumes he’s being trolled and that one of the test images was a solid colour.

Re: Your hex editor should color-code bytes

#123
As a next level beyond coloring... how about adding some interactivity? How about a slider to control the brightness of each type of byte. Turn everything but text to 10% when when you're looking for some words in a binary file.

Re: Your hex editor should color-code bytes

#124
post #60

When (rarely) using hex editors, one thing constantly comes to my mind: isn't base 16 arabic-roman numerals a bit awkward for "skimmable" overview? Color-coding indeed helps immensely there, but wouldn't simply letting bits and bops shine in eight bit clusters, resembling the "physical" shape of the eight-bit byte, be somewhat more readable? We even have characters in the Unicode for representing 0..255 variations, a…

Might be useful, but do leave the hex representation in.

By the way, the "octants" representation is unreadable to me and I have HN at like 140% zoom.

Re: Your hex editor should color-code bytes

#125
post #86

I find it funny that I found the "single C0" pretty much instantly. I grant that the post largely has a point, mind you. But scanning for a needle in a haystack is something that you just don't often do? I am, of course, now very curious how often folks are using hex editors. And itching for an excuse to open a file that way. :D

The first time I used one was in high school when I was playing some video game in an emulator and wanted to convert the game save to another emulator's format, cause halfway through I realized the first emu had issues with the game. There was no conversion software, but with the hex editor I figured out that you needed to remove some header and change the endianness.

Re: Your hex editor should color-code bytes

#126
post #90

Any good neovim plugin recommendation for hex editing?

I came to scan for the same thing, basically. Is there a vi(m) hex editor? Hexmode https://github.com/fidian/hexmode or vim-deadc0de https://www.vim.org/scripts/script.php?script_id=6033 With decent color support? No.

I was kinda expecting vim with whatever common plugins I installed to do this already, but no. It does nice highlighting for all sorts of text formats, even non-code things like CSV, but not hex.

Re: Your hex editor should color-code bytes

#127

If you just want to see patterns, and don't actually need to see the values, you can go a step further and simply visualize the data as a bitmap, e.g. dd if=/dev/urandom bs=$[256*256] count=1 | display -size 256x256 -depth 8 GRAY:- You can do the same thing with audio, which makes different sorts of patterns obvious, e.g. dd if=/dev/urandom bs=$[256*256] count=1 | aplay -c 1

I made little CLI tool back in the MS-DOS days to dump binaries into VGA mode 0x13. It allowed me to vary the width of "line" wrapping. It was a killer tool for seeing data in binaries.

Re: Your hex editor should color-code bytes

#128

Earlier quoted context omitted.

as far as i can tell, no it does not. it only desaturates 00 in particular. the other colors you see in the screenshots come from matched formats/patterns. it does not do direct coloring based on byte value.

Under the Edit menu select "Highlighting Rules..." and you can define or load any set of rules you can imagine.

Thanks!

How many rules would it take to create 256 different colors for 00..FF?

Re: Your hex editor should color-code bytes

#129
If you're making a hex editor and going to have colour coding, I'd think you expend some effort to make the colouring schemes configurable — and easy to configure and change. Maybe load and save as separate files.

Different colouring schemes for different types of data.

Re: Your hex editor should color-code bytes

#130
post #39
post #35

Earlier quoted context omitted.

I'd recommend for every developer to get one or more colourblind friends. I have some, and regularly send them screenshots of what I'm working on to get feedback what they can see and what they can read/can't read. They've been absolutely invaluable for making sure their kind of people can't use my apps properly.

8% of the male population has some form of colorblindness (for women it’s around 0.5%). I have deuteranomaly colorblindness. If you search for images on the internet related to that type of colorblindness you’ll find representations of how we see color and how we see the world. It is not a fun condition to have, and leads to lots of problems in my everyday life. This blog post accidentally accentuated that issue, sin…

Does anyone know of a study done on depression/color blindness.
Post reply on HN