Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [bitwise]

Bitwise refers to a bitwise operation which operates on one or more bit patterns or binary numerals at the level of their individual bits.

19 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4 votes
0 answers
111 views

Barebones DNS Client in Rust

I'm starting to learn about networking and as a project I am building a really simple DNS client in Rust. Functionality to start was just to take a command line domain argument and sending a DNS A ...
matthewmturner's user avatar
4 votes
0 answers
621 views

BitVector64 implementation

I have implemented a structure to handle BitVector64 (default System library support only 32 bits). In the implementation i have added some custom method to manipulate bits inside the vector. I would ...
Skary's user avatar
  • 248
4 votes
0 answers
792 views

Java code to convert BigDecimal to/from .NET decimal

Background In many languages we have built-in data types for representing decimal floating point numbers. In .NET that's decimal, and in Java we have ...
Mark Vincze's user avatar
4 votes
0 answers
740 views

RGB to YCbCr conversion in Java

I found a Go language code to do RGB to YCbCr conversion from here! I ported it to Java: ...
lucky1928's user avatar
  • 183
4 votes
0 answers
90 views

Bit Vector implementation

Looking for a general review. ...
MAG's user avatar
  • 2,934
4 votes
0 answers
3k views

Calculating CRC using arbitrary polynomials

This is my implementation of calculating CRCs which supports arbitrary polynomials specified in different representations (according to the explanations given here and here). My concerns are: I don'...
mkrieger1's user avatar
  • 1,694
4 votes
0 answers
187 views

Parallel popcount of packed bytes

I want to do a popcount of bytes in an array. Not a total popcount of everything, but lots of little popcounts for every individual byte to determine the neighborhood count in GoL. The following ...
Johan's user avatar
  • 417
3 votes
0 answers
74 views

Implementing a Hilbert-like space-filling-curve conversion in Rcpp

I have written a series of functions that are designed to create a space-filling curve (similar to a Hilbert Curve) that is intended for symmetric matrices (as opposed to a square region). I plan to ...
Lewkrr's user avatar
  • 183
2 votes
0 answers
61 views

Implementing Generic, General, Specific and Portable Bitwise Operations

First my appologies. My mental faculties currently leave rather a lot to be desired and I have thus spend an inordinary amount of time on this pet project of mine, testing myself if you will. I find ...
Zacariaz's user avatar
  • 373
2 votes
0 answers
120 views

Kaitai Struct: shift rotate >1 byte groups

This is an implementation of rotation (cyclic shift) of many-byte groups to the left. Rotate right is supported as negative amount. I would like to request, if someone would be willing, to review this ...
ArekBulski's user avatar
2 votes
0 answers
388 views

Binary addition in VB.net

It starts by taking two user input from the console and putting them into strings. I then pad them to get them to the same length. I get the length of the num1 and assign it to the integer len. I then ...
Tim's user avatar
  • 121
2 votes
0 answers
3k views

Hackerrank: Max Score

Problem statement Consider an n-element sequence of integers, A = {a0, a0, ..., an-1}. We want to perform \$n\$ operations on \$A\$, where each operation is defined by the following sequence of ...
Jianmin Chen's user avatar
  • 2,396
2 votes
0 answers
101 views

Convert tri-gram of type wchar_t to an integer type

I am trying to convert a tri-gram containing 3 characters of type wchar_t to an integer type (an uint64_t at the present time). ...
Andreas W. Wylach's user avatar
2 votes
0 answers
1k views

Read bits, write bits data to arbitrary position in char array

I created functions to read bit data from arbitrary bit position of a char array to long long int, and I also created a function ...
John Doyle's user avatar
1 vote
0 answers
42 views

A machine learning model for predicting bit strings in Java

I have this GitHub repository (BitPredictor.java). Basically, I tried to harness a machine learning model for predicting bit strings. I have implemented it to the best of my understanding and have ...
coderodde's user avatar
  • 28.4k
1 vote
0 answers
146 views

Interleave Bits Generically

This commonly referenced "bit twiddling" site has an interesting algorithm for interleaving the bits of two 32-bit integers. Here is my attempt at completely generalizing the algorithm using ...
Kittoes0124's user avatar
  • 1,940
1 vote
0 answers
134 views

Generating Unique Subsets using Bitmasking

Given an array arr[] of integers of size N that might contain duplicates, the task is to find all possible unique subsets. Link to the judge: LINK Note: Each subset should be sorted. Example 1: ...
Shubham Prashar's user avatar
0 votes
0 answers
50 views

Counting Cram game positions in C

This code counts the number of possible positions in the game of Cram on a mxn board. EDIT 1: In the original question I mistakenly mentioned that this number is ...
martin's user avatar
  • 139
0 votes
0 answers
107 views

UPDATEIT SPOJ problem using Segment tree

UPDATEIT on SPOJ: UPDATEIT - Update the array ! #bitmasks You have an array containing n elements initially all 0. You need to do a number of update operations on it. In each update you specify l, r ...
DRV's user avatar
  • 101