I wrote a code that requests user input and then converts binary to bcd then back to binary using bitwise operations.
While I think my code is good I want to know if there is a better way to write the code.
Is there also a way to keep the code mostly the same but getting rid of the arrays for pri...

I wrote a function that checks what's the ratio of the number of positive, negative and null values inside an array in relation to its length.
The code I wrote is the following:
function plusMinus(arr) {
/**first I declare 3 variables to store the positive, negative and null elements inside...

So I have a somewhat delicate question. On another forum, someone made reference to some people from CodeReview thinking of trying something new due to the train wreck referenced in the starred links on the right. I was wondering where I might find out more about this effort? If there's somewhere else I should ask this question, please let me know.

@user1118321 I'm not sure if any of us are involved, but there are a couple of 'alternatives to SE' slowly growing. I think codidact is the one with the most traction at the moment, but they're far from ready. Although Writing.SE has a clone running on an old version of that, I think.

I have a set of 2d vertices (x,y) and a set of triangles referring to the vertices' index (p1,p2,p3).
The vertices represent a closed polygon shape, however those are not in order.
When 'merging' all the triangles together, we get a the area of the desired polygon (from which we can conclude th...

Looking for some advice on weather or not this can be improved in terms of efficiency and speed, it would need to work on large data sets.
public class Anagrams {
public static boolean isAnagram(String str1, String str2) {
String s1 = str1.replaceAll("\\s", "");
String s2 = str2...

For a 500x500 matrix with 50k iterations, it would easily take one full day to compute. How to reduce the computation time drastically?
Logically program is correct.
I tried profiling, it didn't tell me a whole lot. The while loop is causing the issue? Any suggestions to improve the efficiency ...

Tape setup
Esolang constants are compact, but not efficient. You are using an esolang constant to get the number 61, but what you actually want is a series of numbers: 0 5 66 117 122 105 70 3 0 100. In this case Esolang constants doesn't really help. Instead, it helps to look at the series of nu...

Rust has been Stack Overflow’s most loved language for four years in a row, indicating that many of those who have had the opportunity to use Rust have fallen in love with it. However, the roughly 97% of survey respondents who haven’t used Rust may wonder, “What’s the deal with Rust?”

The short answer is that Rust solves pain points present in many other languages, providing a solid step forward with a limited number of downsides.

I’ll show a sample of what Rust offers to users of other programming languages and what the current ecosystem looks like. It’s not all roses in Rust-land, so I talk about the downsides, too. …

Currently trying to automatically update thousands of PDFs at once if they're older than X from a German website in 3 languages without API, buffered over a local folder to minimize impact on the network.

Shouldn't be too hard, yet...

Poor standardization is killing me.

All portable of-course, to work around system limitations that should've been fixed 2 weeks ago.

headers is unused here, as far as I can see. It is defined and not sent in the POST call. You can send both: requests.post('<address>', headers=headers, data=xml) I checked this was true. I didn't get an error when not including it, but I think I'm seeing faster results with it... anyway, if just defining it and not passing it does something magical in Python that I don't know about that wouldn't surprise me. This answer did help me get further. There's my code review :) — Neil Guy Lindberg55 secs ago

this week I learned about QuickSort and used the technique to solve the Dutch National Flag problem. I would appreciate it if someone would review my code and give feedback.
The Dutch national flag problem is a computer science programming problem proposed by Edsger Dijkstra. The flag of the ...

Put all of those parameters into a single entity (struct). Then that will have the constructor taking only one parameter, not 20 or 30. Call the struct SMSInformation or something like that. Also, the code would fail many code reviews, and even have automatic code "inspectors" give a red flag, due to the number of parameters. To be honest, it is not worth to keep the code in that state. — PaulMcKenzie21 secs ago

@Mast Thanks for the info. I had seen codidact but someone claimed there was something else code review-related, so thought I'd ask. But perhaps it's not taken off or they were misremembering. Oh well.

I want to ask a conceptual question whether some code piece that works perfectly fine is considered an example of bad practice or misuse of some design pattern / library that is available. I was considering asking the question on Code Review, but I do not know if it allows for conceptual discussi...

I guess all my Code Review answers are not helpful. I wander why I have so much rep then... Something's not really adding up for me. — Peilonrayz14 mins ago

Couldn't have said it better myself, @Peilonrayz ^^

Ask the question, add a comment here with a link to it and ping me. If it is not a good fit for Code Review, then Peilonrayz and I can assist you and explain how to improve it. — Simon Forsberg9 secs ago

I'm mainly working with Java and Gradle, but for my current project I have to use C++ with CMake and thus I would like to have some feedback on my current folder structure and project setup.
root_project
|─── .gitignore
|─── CMakeLists.txt
|─── build
|─── src
| | |─── [...].hpp...

I am a CS student and I was wondering is this code looks clean. I tested it and it passed every tested but I think the delete(Node node) is a bit long, I did not find a way to reduce it
Node class
public class Node {
private int data;
private Node next;
Node(int data){
...

I have been working on creating a code solution for the Hungarian Algorithm, and from the testing, the slowest and buggiest part has been the bipartite matching. The most recent rendition is based on this GeeksforGeeks article, but, I removed the recursion since that was a stack-overflow waiting...

We have a Java application that's continuously running. Nothing much goes on in the main method except initializing a few background threads through a helper class. The background threads process socket events as they occur. Apart from the time the socket events are being processed, app remains i...

I want to left rotate an array
like this ,
a = [1,2,3,4,5];
after left rotate
a = [2,3,4,5,1];
after another left rotate
a = [3,4,5,1,2]
a = [1,2,3,4,5];
//after left rotation
leftRotate(a);
a = [2,3,4,5,1];
Are there any methods instead of for loops?

Yesterday, I asked this question because I was asked to implement a software that used variably sized matrices with C89's limitation, so I had to practise dynamic pointer-to-pointer allocation. After the useful answers I got, I started working on a solution to a problem that I was assigned as an ...

I'm working on a project for digital marketing, I want to automate the upload of pictures. The program itself isn't done but here I came up with a way to keep track of which and when pictures have been posted.
from os import listdir, rename
from random import choice
from _datetime import datetim...

I am working on a Java project that currently depends on 500+ configuration files in the form of XML, XSLT and YML files. The vast majority (~400) are XSLT files, and the purpose of the application is to transform a variety of XML structures using XSLT, and currently the files are deployed as par...

Just an Rx wrapper around Kafka to represent topic consumption as IObservable<T>:
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Confluent.Kafka;
using PM.TT.Live.Kafka.Rx.ConfluentKafka;
using Reactive = System.Reactive;
namespace PM.TT.Live.Kafka.Rx
{
...

For my Networking class, we learned about subnetting and subnet masks.
I decided to write a little "calculator" (a generous term) that when given n-many network bits, generates a 32-bit subnet mask, then displays it as octets, and as binary with the leading 0s removed. Example main:
int main() ...

I have a standard tableview app that displays information from a data model array that uses a custom class. There is a UISearchController to filter the data.
A simplified version of the custom class is shown. I use a computed property for a string that is checked when searching the data.
class ...

Click here https://www.hackerearth.com/practice/data-structures/arrays/1-d/practice-problems/algorithm/can-you-solve-it/ to view the source of the problem
Given an array 'A' consisting of 'n' integers, It is required to find the maximum value of the following expression:
|Ai - Aj| + |i ...

Before we get started I need to let you know a critical piece of information: Due to permissions within an offsite database I am NOT allowed to create tables even temporary ones within the database that I am getting the data from.
With that being said: All of the code below works as expected, ...

I was curious how vectorization works and how to write suck code. To start simple I choose 7-bit encoding as my test suspect. I'm not expecting improved throughput in any way. My implementation works just fine, until we go over 2^31 due to compare not doing unsigned comparison. I would like to kn...

I need a unique_ptr and shared_ptr like structure, but instead of pointers, I would like to store some kind of reference to a resource. It is usually just an int and maybe some attributes. I would like to avoid using pointers, so these objects can be kept on the stack.
I usually use these contai...

I used minimum edit distance algorithm to find the bundle of the most similar strings in an array.
So, I have to travel double for loop to compare all element.
If the data is large enough, this algorithm is Inefficient.
Values have rules
1. value’s length is 10
2. value is A-Z and can’t be dup...

I failed a code test at a problem that should be very simple. But still, after submitting an incorrect solution, I cannot spot where my logic is going wrong. I want to learn from this let down so I can do better next time, but there is no solution online to this problem.
Can someone let me know...