Giter VIP home page Giter VIP logo

hx's Introduction

Hello!

I am a software engineer. As a programmer, I use 99% Java at work. In my free time I like to dabble in other languages. I prefer:

  • Java, because that's what I know best.
  • Lua (+ Love2D) for game programming.
  • Go, because it's fairly easy, fast, and type safe.
  • C, because it's also relatively easy. I wanted to learn it to understand more about memory management, Linux kernel programming and so on. I believe that understanding C will make you a better programmer.

Learning Rust more thorougly is also on my TODO list.

I've also attempted to do things in C++, but it's quite comprehensive. I decided it's not worth it anymore (in my free time), because there is just too much to know, and life is too short :)

hx's People

Contributors

elitetk avatar krpors avatar mbarbar avatar quizno50 avatar sevenbits avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

hx's Issues

Get hx into Debian repository

A great milestone would be to make hx comply with the Debian packaging standard and such, so it can eventually be included into their repository.

Doxygen style comments used in project, but do not conform to doxygen format confusing syntax highlighting.

The comments in the project use /** which is used by tools like doxygen to distinguish between normal comments and comments which are designed to be used for generating documentation. This can confuse certain syntax highlighting and if the project ever wishes to switch to doxygen (unlikely because this is not a library but who knows) then this will need to be done anyway.

Additionally some multi line comments are done using C99 style // comments. It might be worthwhile to switch to using one style throughout the project if the comments are to be changed to normal /* comments.

Segfault when searching before starting of file

To reproduce:

  1. Open file with hx.
  2. Type / to search for a string which does not occur in a file (e.g. akljahlekfahlkdjfh)
  3. Hit N to search backwards
  4. Segmentation fault occurs.

Backtrace:

#0  __memcmp_ssse3 () at ../sysdeps/x86_64/multiarch/memcmp-ssse3.S:1933
#1  0x0000000000402743 in editor_process_search (e=e@entry=0xfc5010, str=<optimized out>, str@entry=0xfc511c "asdfklj", dir=dir@entry=SEARCH_BACKWARD) at editor.c:740
#2  0x0000000000402e92 in editor_process_keypress (e=0xfc5010) at editor.c:923
#3  0x00000000004012de in main (argc=0x2, argv=<optimized out>) at hx.c:177

Byte search syntax

I wouldn't mind giving non-ASCII byte searching a shot. Though I'm not sure what the intented syntax is. editor.c seems to imply any search string starting with "0x" should be regarded as a hex byte sequence though of course this means searching for "0x" is impossible.

Here are the options I think could be possible... the existing input buffer size is 80 and I might make reference to that.

A separate search command
That is, instead of /, some other key.
Advantages

  • Straightforward to implement (convert typed bytes into actual bytes and use existing search process)
  • No extra typing (i.e. no need for \x or 0x) so 40 bytes fit
  • No need for a character to become an escape character

Disadvantages

  • Not possible to mix bytes and ASCII without typing the hex ASCII value ((e.g. 41 instead of A)
  • Creates a separate command

\x regards the entire search stirng as byte values
So "/\xabcf" searches for 0xab follow by 0xcf.
Advantages

  • Uses same command
  • No extra typing past initial "\x", so 39 bytes fit

Disadvantages

  • Not possible to mix bytes and ASCII without typing the hex ASCII value
  • \ becomes an escape character - though if \ appears in a position after the first, it's not an issue.

\x regards the following two bytes as a byte value
So "/a\x41b" searches for a followed by 0x41 followed by b.
Advantages

  • Can mix ASCII and byte values
  • Uses same command
  • Pretty simple to explain in documentation

Disadvantages

  • \x needs to be typed before every byte value so a maximum of 20 byte values can be searched (or 19 byte values and 4 ASCII characters, and so on)
  • \ becomes an escape character anywhere in the string - \ is required to search for \ and ' followed by anything but x or \ is an error that needs to be handled

\x can be replaced by 0x though I think making 0 an escape character would be frustrating as it isn't standard (as far as I've seen at least).

Reading from /proc returns 0 bytes

Reading files from the /proc/ filesystem (e.g. /proc/cpuinfo) returns 0 bytes, whereas using cat on it actually works. Ideally these should just be at least read properly.

κῦδος

Just wanted to say that old projects never die. I just made hx my hex viewer in my file manager.

:wq to save and exit

In Vim, :wq writes the file and closes (:wq! also works). It would be great to support that command combination in hx also.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.