All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
33 views

Line-wise input, EOF handling, and behavioral differences between implementations of getchar

I've implemented a menu system where all input calls ultimately go through io_getline, a function which reads a line of input up to the max buffer size or newline (...
0
votes
2answers
63 views

Processing list of users- filtering out from refused list

The code below takes a list of users and displays two lists Refused users Admitted users Sample output: Refuse: Phil, Lola. Admit: Chris, Anne, Colin, Terri, Sam, Kay, Bruce. Any feedback is ...
0
votes
0answers
29 views

One-way chat which encode messages, this is the server side

Alright, this is one of my first real projects in python, it's basically a one-way chat where the server sends away an encoded message. The logic of it is pretty simple and I know there is some ...
-3
votes
0answers
42 views

I want to generate unique random numbers in Java [closed]

I am trying to create a bank acc multi-time in ArrayList with a random number and every person can create only one ACC I have done this code< ...
1
vote
1answer
58 views

DNA Challenge from CS50

Added the problem link below and my implementation of it. Took me a few hours to program. I have added comments to explain my thought process. Problem Link Goal - To implement a program that ...
0
votes
1answer
87 views

Custom Binance API wrapper around IHttpClientFactory

I made a custom Binance API wrapper (BinanceRestClient) which uses IHttpClientFactory in order to prevent socket exhaustion, ...
2
votes
0answers
54 views

Create a collection of truly unique objects of custom type

I'm using TypeScript for my Vue app and have a custom type I'm working with ...
0
votes
0answers
22 views

Macro which performs a series of operations on a given set of data

This macro calculates some basic figures from a given set of data. But it runs very slow probably due to me referencing the sheet again and again. Does anyone have a better idea on how to optimize ...
1
vote
1answer
66 views

Python IPv6 verifier, parser and converter

This is a simple Python 3 program that verifies whether a string is a valid IPv6 address or not, parses IPv6 address to its hexadecimal and decimal values, and converts an integer to IPv6 format. I am ...
0
votes
2answers
33 views

handling different states of a complex gui control

I need to handle different states of a complex GUI control (such as NORMAL, DRAGGING, MARKING, ...). I came upon this idea: ...
1
vote
2answers
109 views

How can I shorten my tic tac toe game?

At the moment, it is simply massive. I already reduced the size by about a hundred lines but it still seems way too big... Would appreciate some help :) ...
2
votes
1answer
40 views

2d Grid - Iterating by Rows / Cells

The feature Here is a Grid class representing a 2d grid. The class will get templated once it reach a satisfactory state. At this time the cells are int values. ...
0
votes
3answers
108 views

Converting whole numbers to binary in C/C++

...
0
votes
0answers
38 views

passing type value to a function on basic of values calculations [closed]

passing type value to a function on basic of values calculations. I am doing something like this to calculate and pass new values to funtion . ...
2
votes
2answers
55 views

Using JS Template Literals as for a simple Templating Engine

There are many template engines but my question is: Why do they still exist? Can we not achieve the same job with readily available JavaScript Template Literals? So influenced from this blogpost, I ...
-1
votes
0answers
21 views
0
votes
1answer
65 views

Find the minimal distance between two values in an array [closed]

Given 2 values and an array, I must return the minimal distance between the indices of both values, as efficiently as I can in terms of run time and space. This is my solution: ...
4
votes
2answers
563 views

Custom implementation to provide an immutable range of a vector without copying it

I needed to pass a const reference to part of a std::vector without copy. Some research, particularly this SO question, suggested that it is not something supported ...
2
votes
0answers
39 views

Naive Bayes spam classifier improvements

Could you please have a look at our naive bayes model. We look at a corpus of emails where an email is either spam or not. To classifiy we naively assume a bag of words and estimate prior ...
1
vote
1answer
47 views

Create a linked list from an array, and also free that list

I'm currently learning C/C++ and I saw this question on Reddit on how to create a linked from an array and decided that would make a good exercise for learning the absolute basics of C, so without ...
1
vote
1answer
32 views

Protect Routes/Page with NextJS

I have a simple project that I built that protects the routes/pages of the website by using the if and else statement and putting each page with a function ...
1
vote
1answer
55 views

Generic doubly linked list in C

I have implemented generic doubly linked list in C language in which you can store any data type you want. Just like in C++ and Java, where a list can store any data type, like - string, int, long, ...
3
votes
2answers
89 views

Python TIC TAC TOE Project

I just joined here. I have been doing python for a couple of weeks and I would like for some experienced programmers to review my code. I made this for a school project and I am proud of it. The code ...
0
votes
0answers
24 views

Replace any occurrence of a word in a document with vanilla JavaScript [closed]

I need to change all occurrences of the word ערךים to ערכים (in modern Hebrew ך is a ...
2
votes
0answers
61 views

Evaluate performance of DLL calls from VBA

While playing with a VBA project involving Windows APIs, I have noticed some odd behavior: API calls under Excel 2016/VBA7/x64 appeared to be much slower than under Excel 2002/VBA6/x32. Since I ...
-2
votes
0answers
20 views

which way is better [closed]

which way is better : 1st way : I want to get owner data of every device one by one . so need to call database again and again for every device like this ...
3
votes
1answer
70 views

IOSP Kata: merge two sorted arrays without iterators

I wrote the code below as a Kata to practice the Integration Operation Segregation Principle (IOSP, clean-code-developers.com). I would like to have some feedback ...
-2
votes
0answers
22 views

Am not sure how to complete this code (c) [closed]

I am a first year CS student am currently learning how to program in C and am running into an issue with my program that is supposed to run exercise 2 of the provided image,[![enter image description ...
3
votes
2answers
417 views

Simple string manipulation in C (for small microcontrollers)

Although I have long experience of other languages, I've not used C until playing around with microcontrollers using the Arduino IDE. I'm a bit uncomfortable with my use of pointers in conjunction ...
-4
votes
0answers
41 views

Gamertag task- Repeats itself and im not sure how to fix it [closed]

my issue is whatever I put, it says both conditions and i have tried everything and still haven't figured it out. ...
1
vote
1answer
59 views

Web Scraping DOL with Selenium

This is my code to extract data from the DOL website for a project I'm doing for my portfolio. The code does extract all of the data that I need, however it runs really slowly. I think it took like 15 ...
2
votes
1answer
80 views

Stop exam cheating using python: Part 2 - Argparse and config

Intro This is a spiritual successor to the question Stop cheating on home exams using python The details are not important, but I decided to reimplement everything using dataclasses. My script is now ...
-1
votes
0answers
34 views

Pass a two dimensional array and return it [closed]

This is my first time using code review so please give me some constructive criticism on anything I should change. I am currently trying to code up a program that will row reduce matrices to echelon ...
5
votes
2answers
369 views

C++20 Thread Pool

I've implemented a thread pool using C++20. I'm fairly new to concurrently/multi-threaded programming and wanted to work on a project that I could learn from while also getting to know some of the new ...
0
votes
0answers
26 views

Highly versionable API

Environnement : Rails 6.1.4.1 db : PostgreSQL Hi everyone, I've been working on this for some hours now and want to know how other Rails developpers would react to this type of project structure. ...
0
votes
0answers
35 views

Solving a linear system with Gaussian Elimination

I decided to implement a solver for linear systems of equations based on the gaussian elimination and reduction to upper triangular form. The gaussian elimination is quite simple to implement but the ...
2
votes
2answers
64 views

Setting instance variable for salary bonus based on academic position

I have a class Scholar which is basically a teacher in a university. I have to calculate the yearly salary of a scholar instance where the formula is ...
2
votes
3answers
70 views

Recursive Filter/Search function

JSFiddle: https://jsfiddle.net/EddTally/jsa69f7r/3/#&togetherjs=zMFpAQcRTt Those who cannot access JSFiddle: ...
1
vote
1answer
42 views

Printing reverse number triangle

I have to write a program in python that will take a number and print a right triangle attempting to use all numbers from 1 to that number. For example: ...
-2
votes
0answers
14 views

Making a Git alias out of a working Git command... unsuccessful [closed]

I do have a command that works for showing the Git history of a file: ...
2
votes
1answer
90 views

Using fluent builder pattern for generating pdf

I'm testing to use a fluent builder pattern for generating a pdf file using AbcPDF. I've looked at several methods of accomplishing this and I'd be very glad to get some input on what I've written so ...
0
votes
0answers
20 views

Relational join of two datasets

Front Matter I'm learning Scala and have not gotten used to functional programming and the language. I'm hoping a review of my naively implemented code can help me bridge my object-oriented ways to ...
-1
votes
0answers
14 views

Changing captain by swapping values [closed]

This code snippet is a part of a gameplay design for a fantasy football, where a player object has a varaiable isCaptain with Integer data type, So here, when players are substituted or replaced, if ...
-4
votes
0answers
24 views

How to use pandas not to treat text file new line as a new column in pandas [closed]

I am given a text file that looks like this :- 12312|123|orange|apple|14123|pinapple mango|mbb|lemon|11233|ssaa|ssa apple So I used pandas to read the text file :- ...
2
votes
1answer
82 views

Finding better logic for addition and removal of Nodes in a Linked List

Consider the following piece of code I wrote (a templated Linked List): ...
-1
votes
0answers
29 views

Subset sum saving array [closed]

I wrote this code to find out the subset sum closest to pi. Example: user inputs 1,6,2. Computer outputs 3 and the subset {1,2}. It seems like the sum is calculated and returned properly but I am ...
3
votes
0answers
36 views

How to remove a lot of the duplication in this JavaScript AST transformer?

I have put together this complete runnable source code with an example set of test expressions which it parses and prints. The code requires acorn, which is a JS ...
4
votes
2answers
1k views

VLOOKUP Macro to reformat data between sheets preserving the connection to the source

Hello I'm relatively new to VBA and I have this macro to VLookup information into corresponding cells in the sheet that works, the issue is that it depends on a For Loop to iterate through 10s of ...
0
votes
0answers
32 views

jquery function updated from javascript

This is original Code ...
2
votes
0answers
34 views

Fast git change sets with git wrapping scripts

After having a good experience with virtualenvwrapper built on top of the venv, I thought maybe it could be benefitial to have similar shortcuts for standard activities with git which could be time ...

15 30 50 per page