All Questions

-2
votes
0answers
19 views

BinaryReader unicode error [on hold]

I'm trying to sort out the binaryReader in an error Unable to read after finishing the file I can not understand what the error is and why he does not read Unicode ...
1
vote
1answer
24 views

CSS and React.js for a basic navigation drawer

I am trying to optimize my navigation drawer code. I have tried and followed the BEM naming convention for my CSS although I would like it reviewed with respect to the best practices being followed. ...
2
votes
1answer
18 views

C Recursive Opendir Wrapper to Sort Directories First (ascending/descending)

A recent post on StackOverflow about a recursive directory listing which produced an unsorted mixed file/directory list, sparked the stray thought of "What would it take to write a wrapper for the ...
-2
votes
0answers
10 views

Unity Google Play Games Plugin: ERROR NOT AUTHORIZED [on hold]

I m developing an android Game .I'm using a real device for testing. The game uses Google Games Services. when I tried to implement the game services login authorised failed unity. the error comes ...
0
votes
1answer
52 views

Adding <li> items dynamically to a to-do list

For a homework assignment, I have to create a "TO-DO" list, which will add a list item to the unordered list dynamically using JavaScript. The input element is also added using JavaScript, having to ...
2
votes
1answer
37 views

Swift: arrayToTree() where array contains int and nil

I am learning tree on Leetcode. Need to prepare the testing data. It is easy to convert the array to an organized node, where its elements are integers. such as ...
3
votes
0answers
53 views

TCP client reading socket asynchronously

I'm relatively new to .Net/UWP networking and have been trying to make sense of the APIs. I'd like to implement a TCP client that is capable of reading and sending messages independently (there is no ...
-2
votes
0answers
35 views

Is there a way to compress this? [on hold]

This code seems very large and clunky, but I don't know any way of compressing it and making it smaller. Does anyone have any solutions? ...
1
vote
0answers
12 views

how to take the linspace of values between 2 columns in pandas [on hold]

I am trying to take the linspace of between 2 columns of a dataset. Heres an example. a b C D 0 3 13 3 13 1 4 14 4 14 2 5 15 5 15 ...
3
votes
1answer
40 views

Leetcode 102: Binary tree level-order traversal in Swift

102. Binary Tree Level Order Traversal Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example: Given binary ...
2
votes
1answer
44 views

Fast Factorisation (Python Implementation)

An algorithm for finding prime factors of a number given a list of all primes up to the square root of the number. It's worst case time complexity is \$O(n^{1/2})\$, the best case would be \$O(\log(n))...
-1
votes
0answers
21 views

Updated quiz code, how to imlement C# OOP classes to accomplish the same thing [on hold]

I asked for help on a C# Quiz program I am writing for my ENGR115 class in this thread: Original Question Roland replied with some good advice for me, which I followed, and came up with this revised ...
0
votes
1answer
51 views

Fast Prime Sieve (Python Implementation)

A modified version of the prime sieve. I actually doubt it could be implemented any faster, but I might be wrong: ...
1
vote
0answers
16 views

Python Text Analysis with TextBlob — Reading lines from The Office TV Show

I have a Jupyter notebook that allows a user to type in a phrase and the program will 'guess' which Office character it resembles. Here is a link to the github repo I have the following littered ...
1
vote
0answers
19 views

Transparent proxy using HttpClient

I'm looking for feedback on some code I've written to work as a transparent proxy. I'm developing a web app that needs information from another web site's API, but that web site has disabled CORS and ...
0
votes
0answers
11 views

Make lambdas concise using enumerations? [migrated]

Generally, we are looking to create a logging framework that can target human readable output as well as various structured data formats. So, a goal is minimizing code duplication in packaging the ...
1
vote
0answers
12 views

Proper way to map Entities to DTOs in TypeScript

In a recent project my backend architecture consists of Repositories (talking to database) Services (handling business logic) <...
0
votes
0answers
19 views

Need help writing my code for creating an average grade calculator with C [on hold]

I'm currently a beginner at C programming. I'm trying to create a calculator where the user inputs letter grades and it outputs the average letter grade AND average GPA. This is nearly complete ...
3
votes
3answers
80 views

LeetCode Problem 66 : Plus One

I have started practicing problems in leetcode and I solved the following problem on LeetCode. The challenge is : Given a non-empty array of digits representing a non-negative integer, plus one to ...
4
votes
5answers
85 views

Get n-th perfect number

The task: A number is considered perfect if its digits sum up to exactly 10. Given a positive integer n, return the n-th perfect number. For example, given 1, you should return 19. Given ...
2
votes
0answers
60 views

Feels like I have no clue what I'm doing in my “project” - “GAME”

Never had any programming course. Am not programmer. Does not plan to be. If anyone has a lot a time to lose, I feel like I have no clue what I'm doing / that a lot of my code is very badly ...
4
votes
3answers
51 views

Uniformly generate a number from 0 to n-1 that isn't on a blacklist

The task: Given an integer n and a list of integers l, write a function that randomly generates a number from 0 to n-1 that isn't in l (uniform). Solution 1: ...
1
vote
0answers
23 views

Filtering users in socket.io and seeing who is online

While implementing socket.io on my server, I ran into some problems and eventually fixed them. The code below is fired on the connection event of socket.io: ...
7
votes
1answer
41 views

Maintain non-persistent database for books

The following program displays a menu, and prompts the user to choose an option. Options include to add a book, delete a book, view all books, and to exit the program. (Note that the actual code to ...
-4
votes
0answers
39 views

Is my “project” folowing good practices [on hold]

I'm not a dev, during my slack at work I started trying to learn "programmation" (VBA). To make so I decided to try to make a "game" on excel. As I'm mostly using online resources to learn, I have no ...
1
vote
0answers
45 views

Optimize Application of Python Gensim Search Functions

I have a DataFrame that has a text column. I am splitting the DataFrame into two parts based on the value in another column. One of those parts is indexed into a gensim similarity model. The other ...
1
vote
1answer
28 views

Shortening Custom Document Property additions [on hold]

Context I have blocks of if statements that check if a certain cell contains a particular string and to add to the counter of the respective custom property. Originally I was using global variables, ...
3
votes
1answer
41 views

Passing a callback to a component in Vue.js

I'm currently trying to teach myself Vue.js and I've just created my first small project: a simple todo list. While writing the component I discovered that you can't access methods from the parent ...
2
votes
1answer
44 views

Revision: BinaryTree<T> written in C#

Since my last question (BinaryTree<T> written in C#), I have rewritten my code based on the responses. My project can be found on my GitHub repo here; ...
-2
votes
0answers
22 views

Generalized Hailstone that converges with the sequences [on hold]

Can someone please help me solve this problem in python? Thank you in advance! ...
-2
votes
0answers
40 views

Im teaching c# arrays is this a good tutorial? [migrated]

So I am jumping in for a teacher next week and my job is to teach them about arrays in c#. They know variables, int, string, double and how to output data. I tried to build this so it would be ...
3
votes
0answers
25 views

Export EXIF data from thousands of images to CSV

I have written a script that retrieves specific fields of Exif data from thousands of images in a directory (including subdirectories) and saves the info to a csv file: ...
1
vote
2answers
40 views

Mutex Protected Object (scoped object wrapper)

This is a class that holds mutex and associated object. On checkout/access the mutex is locked while the stack object lives and a reference to object is obtained. Any suggestions or improvements is ...
1
vote
1answer
34 views

Moving character in given direction C++ SFML

I have written simple input manager which is used for me to detect key press, and fire assigned function. For example I can do something like that: ...
0
votes
0answers
14 views

A simple toy ResNet model and its implementation

I want to understand how resnet works also called us residual networks and I understand it better when I code one myself. I tried to find a simple implementation of resnet in the web but most I found ...
3
votes
1answer
75 views

Swap even and odd bits of unsigned 8-bit integer

The task: Given an unsigned 8-bit integer, swap its even and odd bits. The 1st and 2nd bit should be swapped, the 3rd and 4th bit should be swapped, and so on. For example, 10101010 should ...
-3
votes
0answers
17 views
3
votes
1answer
50 views

C++ OpenGL - GLFW Window Abstraction

I made a GLFW window abstraction, as I find it very useful for me to make such abstractions while learning an API, and It actually pretty much eases my work while coding. Anyways, share your ...
5
votes
1answer
78 views

Building a bool expressions validator

I'm writing a system that's responsible for changing Status of Order. There's a specific set of rules that define route of changing ...
-1
votes
0answers
17 views

Entity Framework Core - Dynamic Relationship Builder [on hold]

So I have a relatively large database that is defined with code first principles in Entity Framework Core. I had quite a few lines of relationships within my context file. So I went ahead and wrote a ...
2
votes
1answer
40 views

Word Chain Implementation follow up

it's hard for me to implement all those features that were suggested, i did so many thing wrong. can you please review this update on my code, concerning OOP, clean code, and maybe an eye on the ...
0
votes
1answer
55 views

Checking For multiple null references [on hold]

So this question might be a bit opinion based but I am a bit confused, say i have these two code snippets - ...
10
votes
3answers
3k views

Goldbach's conjecture algorithm

I did a Goldbach's Conjecture exercise and got it to work. It's pretty slow though and I was wondering how I could optimize it. ...
-1
votes
0answers
32 views

is there a better way to test this class? [on hold]

Recently, I am learning unit test and try to use this skill in my project. However, I have some question about how to test following code. ...
1
vote
0answers
23 views

See if a specific resource exists in a Kubernetes namespace

I want to have a function that checks to see if a certain resource (deployment, job, cronjob etc) exist in a namespace. Using the Kubernetes Python client, I can create a boolean function (using ...
1
vote
0answers
17 views

React hook “select all” checkbox implementation

This is a select-all checkbox (and checkboxes that it controls), that's usually found in tables/lists. Two things I'm concerned about: I'm returning elements from a React Hook - is that OK to do? As ...
-2
votes
1answer
47 views

How to correct this OOP? [on hold]

I have 2 classes user and topics, a user can follow/unfollow topics, but i don't know where to add the follow function, in User class or Topic class ? ex:- ...
1
vote
0answers
26 views

Helper class for ASP.net to return data from SQL server

My goal is to create a class that I can call from my webpages like this. Similar to a data access layer? ...
2
votes
1answer
57 views

AVL height-balanced binary search Tree and Dictionary

Mostly as a learning exercise, and partly as I thought it might be useful, I have written an implementation of AVL trees ( https://en.wikipedia.org/wiki/AVL_tree ). An AVL tree is a height-balanced ...
1
vote
1answer
34 views

Token generator for Valve Data Format parser in Java

I'm looking to parse a reduced subset of the Valve Data Format (VDF). It is similar to JSON, allowing representation of key-value collections (maps) with arbitrary recursion. As a small example: <...

15 30 50 per page