mellowcandle / bitwise Goto Github PK
View Code? Open in Web Editor NEWTerminal based bit manipulator in ncurses
License: GNU General Public License v3.0
Terminal based bit manipulator in ncurses
License: GNU General Public License v3.0
Hi!
As issue title says โ I am unable to fill all bits, when I am filling in decimal, hex or octal fields.
The case:
ffff ffff ffff fff
, only 15 symbols (whitespaces are for readability);0 0 0 0 1 1 1 1 | 1 1 1 1 1 1 1 1 | 1 1 1 1 1 1 1 1 | 1 1 1 1 1 1 1 1 | 1 1 1 1 1 1 1 1 | 1 1 1 1 1 1 1 1 | 1 1 1 1 1 1 1 1 | 1 1 1 1 1 1 1 1
, decimal is 1152921504606846975
, octal - 77777777777777777777
;f
to fill bits 60-63, but nothing happens. If I want to delete this last 16th f
I will delete both 16th and 15th.18446744073709551615
, hex to ffff ffff ffff ffff
, octal 1777777777777777777777
, all bits are set. And now all values have their expected values.Is it a bug or expected behaviour?
For hex values that are in range
If I pass more than 8 bytes ASCII: field only show dots (.........).
Will it be a problem to display more than 8 characters, or at least keep the first 8 letters in place?
0x875423[31:23]
0x875423[15]
Add mouse support using ncurses API to support toggling of single bits.
I use dark background themes on my terminals. In VIM I set bg=dark
. The color palette that bitwise uses makes it difficult to see some things (e.g., those in dark blue) on dark bg terms.
Nice tool though!
Hey, have added the git package in MPR, would like to show that in packaging status as well that its available as MPR package.
Kindly find the links for your reference.
MPR PKGBUILD
Whats MPR
Hey @herrbischoff , @kavu
Just drafter new release, can you update the packages in Brew / Macports ?
Thanks !
Ramon.
Currently when calling bitwise 3 + 3
, the result for 3 is displayed.
To avoid quoting (and making usage in pipes easier), all arguments should be parsed as an expression.
Thanks, this is already a great tool!
Hey @herrbischoff , @kavu
Just drafter new release (0.50), can you update the packages in Brew / Macports ?
Thanks !
Ramon.
in interactive command mode, add command to change output base. currently it set to hex, allow seeing it to decimal or octal or binary as well.
Hey @herrbischoff , @kavu
Just drafter new release, can you update the packages in Brew / Macports ?
Thanks !
Ramon.
Hey @herrbischoff , @kavu
Just drafter new release, can you update the packages in Brew / Macports ?
Thanks !
Ramon.
Trying to install and I'm getting the following error. I can't seem to find libreadline6 using apt-get install libreadline6
either.
Running Ubuntu 18.04.2 on WSL.
$ sudo apt-get install bitwise
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
bitwise : Depends: libreadline6 (>= 6.3) but it is not installable
E: Unable to correct problems, you have held broken packages.
I haven't tested out vigorously but it looks like the size calculation has some problems, at least for small values.
E.g:
$ bitwise 369
Decimal: 369
Hexdecimal: 0x171
Octal: 0561
Size: 369bytes
ASCII: .......q
Binary:
0 0 0 0 0 0 0 1 | 0 1 1 1 0 0 0 1
15 - 8 7 - 0
or
Decimal: 9
Hexdecimal: 0x9
Octal: 011
Size: 9bytes
ASCII: ........
Binary:
0 0 0 0 1 0 0 1
Best,
Ilker
Describe the bug
Dividing by 0 causes the program to crash with Floating point exception (core dumped)
error.
To Reproduce
Divide any number by 0.
Expected behavior
It should be handled by printing a warning.
Version:
v0.40
Desktop:
Whenever I open bitwise inside tmux my default colors are swapped to black foreground on white background. I do believe that's because some color resetting[1] happening after we call start_colors(). I've found two solutions:
I think 1) is the right way to deal with this problem because it will respect whatever colorscheme is being used. It's trivial to change, should I make a pull request?
[1] curs_color(3X) says that It restores the colors on the terminal to the values they had when the terminal was just turned on.
Describe the bug
There is a visual bug caused by, I suppose, by unpaint_screen(); ... paint_screen();
. When the cursor is on the bit-field and I preess ~
NOT hotkey, for example, values of decimal, hex and octal are hidden. And they will update again only when we change the value of bits or move cursor to the up to that fields.
To Reproduce
Steps to reproduce the behavior:
bitwise
in interactive modedecimal
field~
hotkeyExpected behavior
Screen repaint should update fields to actual current values โ values in decimal, hex, octal and bit number should not disappear.
Screenshots
https://asciinema.org/a/LMDk8RuDmdqlahkitRvKHPbUX
Version:
Desktop (please complete the following information):
Describe the bug
Overflow not handled elegantly
To Reproduce
Steps to reproduce the behavior:
:width 8
0xff + 1
Expected behavior
Overflow should probably be truncated, to resemble the behavior in most programming languages and provide a warning
Version:
Desktop (please complete the following information):
POSIX C also offers Radix 64
although a different implementation might be better, as
l64a
accepts big-endian integers but outputs little-endian strings.
https://pubs.opengroup.org/onlinepubs/9699919799/functions/l64a.html
Add commannd line mode using libreadline that allows more bit operations such as shifts, rors, etc.
Create help screen:
This 0
syntax has been deprecated by some languages:
https://developer.mozilla.org/Web/JavaScript/Reference/Errors/Deprecated_octal
Support for signed (twos-complement) numbers would be nice.
vim plugin should be able to launch command line vim on currently selected word and output the result in a new window.
It'd be nice for a box called ASCII which automatically converts to HEX.
Describe the bug
bitwise fails to compile.
Expected behavior
successful compilation
Screenshots
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: src/cmd.o: undefined reference to symbol 'nodelay'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib64/libtinfo.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:638: bitwise] Error 1
Version:
Desktop (please complete the following information):
Additional context
This problem is fixed by adding -ltinfo
to LIBS
on line 437.
Readme is much more updated than the man page.
sync the man page to the Readme.
In the interactive mode, if the input value doesn't fit in chosen word length, instead of returning an error or truncating, bitwise displays a bogus value.
For example, on the first try, I did not notice the 32-bit limitation and typed in 4294967296
. I'd expect one of:
yet I got:
hex 19999999
oct 3146314631
bin 0 0 0 1 1 0 0 1 | 1 0 0 1 1 0 0 1 | 1 0 0 1 1 0 0 1 | 1 0 0 1 1 0 0 1
clang8 complains:
src/misc.c:166:24: warning: data argument not used by format string [-Wformat-extra-args]
sprintf(buf, PRIu64, val);
~~~~~~ ^
src/misc.c:169:24: warning: data argument not used by format string [-Wformat-extra-args]
sprintf(buf, PRIx64, val);
~~~~~~ ^
src/misc.c:172:24: warning: data argument not used by format string [-Wformat-extra-args]
sprintf(buf, PRIo64, val);
~~~~~~ ^
The displayed bit string is always lagging one input behind.
Steps to reproduce:
./bootstrap.sh && ./configure && make && ./bitwise
1
(in the Decimal input)On v0.30
and on current master (306e66b).
change to byte width. Enter 255 in dec. Bit field should be all ones, instead it is not until the width is toggled again. Edit: it seem to be generally incorrect actually, just try entering some numbers when modifying width.
Describe the bug
The license terms are not clear, the license is GPLv3, which could allow any later version too if the files specify that.
The source files specify that the license is BSD-2 though, so what is the license of all files in this repo?
And if it is the way the License file specifies, rather than the way the source specifies. Can we use a later version too?
To Reproduce
Steps to reproduce the behavior:
Compare https://github.com/mellowcandle/bitwise/blob/master/src/stack.c and https://github.com/mellowcandle/bitwise/blob/master/LICENSE
Expected behavior
A defined license in both LICENSE and source files
Version:
Desktop (please complete the following information):
Additional context
Homebrew/homebrew-core#137210 reports usage of an outdated license identifier and I can't figure out what it should be either
0B
should be valid just like B
is.
[xfgusta@fedora bitwise]$ bitwise b101 + B010
Unsigned decimal: 7
Signed decimal: 7
Hexadecimal: 0x7
Octal: 07
Human: 7
Radix64: 5
IPv4 (Network byte order - Big): 7.0.0.0
IPv4 (Reversed byte order - Little): 0.0.0.7
ASCII: ........
Binary:
0 0 0 0 0 1 1 1
7 - 0
[xfgusta@fedora bitwise]$ bitwise 0b101 + 0B010
Unsigned decimal: 5
Signed decimal: 5
Hexadecimal: 0x5
Octal: 05
Human: 5
Radix64: 3
IPv4 (Network byte order - Big): 5.0.0.0
IPv4 (Reversed byte order - Little): 0.0.0.5
ASCII: ........
Binary:
0 0 0 0 0 1 0 1
7 - 0
Allow copying result to clipboard using a keybind,
This isn't not portable across OS's but this could be added with a compilation flag specifically for Linux.
The purpose of having documentation is to document the various operations of a program or alike. It would be awesome if the manpage could reflect the documentation written in the Readme (with completeness).
Describe the bug
Parser fails to parse expression that starts with negative number
To Reproduce
# bitwise -- -4
Couldn't parse expression: -4
Expected behavior
Parser should be able to parse it correctly.
Version:
master.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.