# All Questions

61,612 questions
Filter by
Sorted by
Tagged with
5 views

### Loop to extract json from dataframe and storing in a new dataframe

I have a dataframe (obtained from a csv saved from mysql) with several columns, and one of them consist of a string which is the representation of a json. The data looks like: ...
4 views

### Create a zipmap function using javascript?

Consider this problem: Create a function zipmap that takes in two sequences, and creates a dictionary from the elements of the first sequence to the elements of the second. ...
6 views

### Simple Linear Regression in C++

Python has amazing sci-kit learn library but I am building some projects on C++ with involves some machine learning algorithms. I found machine learning libraries in C++ involves more dependencies so ...
5 views

### Cardinal direction enum from range input

Still learning JS and I made the following function to convert degrees into cardinal directions respectively. My first iteration of the code was over 50 lines and I was able to get it down to 13 using ...
17 views

### Refactor method to O(N)

I fetch a bunch of categories for a dropdow tree, and have to implement search in this dropdown. If there is a match in one of the elements, it should also get all parents to display in the dropdown ...
6 views

### Is using memcpy_s is correct in the below function?

I replaced memcpy with memcpy_s as memcpy is a banned function or it is deprecated. Can someone please review the belo function where I replaced memcpy with memcpy_s? ...
14 views

### Work-in-Progress Form to be used throughout an application

I want to write my own Work-In-Progress form to use it throughout my app (for the time being, mostly as an exercise). I came up with the following code, I would like to know what are the design ...
17 views

### Time and space complexity of base conversion code

I have an algorithm that performs the base conversion. The input is a string and two ints b1 and b2. The string represents an int in base b1 and converts it into base in b2. My code is: ...
27 views

### Make utility using LINQ

Make() takes projects with a list of tuples representing project references in the form of (Dependency, Dependent) and returns ...
10 views

### JavaScript HTML DatePicker

I'm still new in javascript and learning. I want to create a date picker using html and javascript. Below is what I have tried and it's working, so my question is "how can I do it better?" My idea is ...
15 views

### Code Improvement/Insight: Should I have approached these functions differently? Animations using Javascript

This code works as it is intended. What I seek is a feedback on the quality of my code. Where should I have written it differently or how should have I approached instead of the way that I have? ...
37 views

### Calculate the rates at which users get stuck at each stage

I completed an algorithm problem just as a personal study, and I can't help but feel like my solution is a bit needlessly complicated, although I can't figure out a better way to do it. Here's the ...
199 views

### LINQ for generating all possible permutations

Permutate() is supposed to generate all possible permutations of the source sequence: ...
31 views

### LINQ for extracting N bottom items (async streams)

source.Bottom(n, x => x) should be the same as well known LINQ source.OrderBy(x => x).Take(n) but is more memory/run-time ...
191 views

### Expanding powers of expressions of the form ax+b

I solved the following problem: Write a function expand that takes in an expresion with a single, one character variable, and expands it. The expresion is in the form ...
8 views

### Codeigniter 3 Registration and Login System

I am working on a basic blog application in Codeigniter 3.1.8 and Bootstrap 4. The application allows Registration and Login. I have concerns about the security level of the Registration system I ...
33 views

### JavaScript - Rock Paper Scissors Game

I built a simple console version of the rock paper scissors game. I would love to get some constructive criticism! Questions How could I code this in an object-oriented way? Did my code follow the ...
22 views

### Is my code of XML parsing is good enough? Android/Java

So I have an app that parse XMLTV file into a TV Guide listing, the file is quite big (35MB) with tons of information, right now it takes around 20-30 seconds to parse the file completely!! Which is ...
817 views

### Hangman game in Python - need feedback on the quality of code

I am new to Python (it's my first language), been coding for a couple of weeks now. I have already made a couple of simple scripts to download and manipulate some financial data, but lately I thought ...
22 views

### Minimum number of swaps for two 2D arrays to make the first one identical to other. Can someone optimize it more?

The input takes $t$ test cases, then 2 dimensions after that it will take matrix as input row wise. ...
30 views

### Work order spatial query (Part 2)

Part 2: Error Handling (and anything else that can be improved) Part 1 is here (it focused on general cleanup). I received this comment in an unrelated post (thanks @Milton): ...Since it is ...
35 views

### Find list of names in other Sheet and copy them

I’m asking for some advice on what is the best way to tackle this problem. Use any formulas inside excel or seek an alternative version (VBA Module) In sheet1, I have 16 columns and around 200k rows. ...
39 views

### JavaRPN calculator

I have found that there is a distinct lack of an RPN calculator available to me, so I decided to make my own. I am still adding new functions to it, but as of now, I would like to refactor my code. ...
30 views

### Convert a Binary Tree to Doubly Linked List

Challenge Link on geeksforgeeks: Binary Tree to DLL Given a Binary Tree (BT), convert it to a Doubly Linked List(DLL) In-Place. The left and right pointers in nodes are to be used as previous ...
35 views

### Lottery Game in Java

In the last days I've written a number guessing game that I've posted on this site. I have now written a lottery simulation in which I tried to acknowledge the criticisms of the project mentioned ...
11 views

### Train reservation system in Rust as my practice

Abstract I am a beginner of Rust language. As my practice I want to create simple train reservation system. I know little about the "best practice" in Rust, so I want some advises in my code. In ...
69 views

### Is it worth to compromise on speed to follow PEP 8 guidelines?

I have this long line of code: enc = encoder.predict(np.array([data[stock][4*i:4*(i+30)] for i in range(lens[stock]+days-30)])) The problem is, the number of ...
103 views

### Immediate Smaller Element Time Limit Exceeded

Immediate Smaller Element The code is working fine Code is here. For each element in the array, check whether the right adjacent element (on the next immediate position) of the array is smaller. If ...
36 views

### Bank ATM Mockup App

This is a follow-up on bank ATM mockup app in .NET Core framework and Entity Framework Core. I have 2 user interface: Console and Web. Previously I have UOW and repository layer but I have removed ...
34 views

### Generating word sounding similar to the ones given in a wordlist

The goal is to make a word generator. The program takes a word list (typically, it may be the full dictionary of a language, or a list of names), analyses it, and then invents word that sound alike ...
28 views

### Solving Sudoku using computer vision, feedback on class

I have made a project at Github that uses computer vision to solve Sudokus. Since this is my first project I would really like to get some feedback on my code. Since it is not allowed to link my ...
22 views

### i write code for number to word convert have a look please inform if any error [on hold]

suggest if more better solution is possible ...
36 views

### Count words with given prefix using Trie

I have been trying to solve this HackerRank problem: We're going to make our own Contacts application! The application must perform two types of operations: add name, where is a string ...
27 views

### Refactoring possible “Arrow Code” when using “Using” [on hold]

if if if if do something endif endif endif endif I understand that writing "Arrow Code" like above is an anti-pattern. But then I ...
22 views

### Project Euler : Multiples of 3 and 5 c++ [on hold]

I have implemented below code for the topic mentioned. Results are coming incorrect in c++. same code is working correctly in python why? ...
21 views

### Regex Help to Format Numbers with Commas [on hold]

I have a string of numbers that look like 999999999.99999 and I would like it to be 999,999,999.99999 Using the below code works but I get commas after the decimal point like this 999,999,999.99,999 ...
23 views

### Custom HashMap implementation in Java with Linear Probing

I have taken a stab at implementing a HashMap in Java. To deal with collisions I implemented sort of a LinkedList using a dataNode. I am not very confident of my implementation hence looking for some ...
49 views

### Change tracking POCO entities

Description In a time where thin clients, web browsers, web services and micro services are prevalent, we tend to forget we still have to deal with thick and smart clients. Many applications in B2B ...
31 views

### static_vector: a vector with stack storage

In many cases, we want a variable-size array like std::vector, but we know an upper limit on the size. In such cases, the vector can be allocated on the stack. We ...
24 views

### This game is (3 D) 2 D perspective hold the shield out with left control then press Q and deal damage [on hold]

//[![Code][1]][1] // This is my script so far ...
38 views

### Python script converts a subset-sum instance into a unary-ssum variant

I am done with my amateur project for subset-sum. This python script is meant to simulate a poly-time (or actual poly-time) conversion from binary into unary. ...
34 views

### Introduction to Haskell: Validating credit card numbers

I have implemented the introductory challenge of University of Pennsylvania's CIS 194: Introduction to Haskell (Spring 2013) course. I have added the most important information of the problem ...
14 views

### Testing for odd and even numbers between 1 and 10 [on hold]

I wrote this code to check for numbers between 1 and 10and it's not working well. Here is the line of codes: ...
37 views

### Find text between two strings in data

I download a page to get it's source code. I then extract the first segment of the page that is between two strings that appear in the source code more than once. How can my code be improved? ...
211 views

### Uri tokenizer as a simple state machine

I was feeling like writing a new Uri parser. The previous one was too limited and wasn't able to parse the authority part. This one is also based on the pretty ...
27 views

### Photo rename by Exif date and group into folders with a threshold

I wrote this tiny F# project yesterday, but I am a bit rusty and I would like to know if there is anything I can refactor and make more elegant. ...
16 views

### Discord.py commands ext keeping state [on hold]

I need to keep state in my Discord.py bot, and I need to save it to a file every time it changes. I can either use global variable, mutable data type or load it from the file every time I need it. ...
20 views

### All-core MediaWiki website upgrade script

I wrote the following Bash script to upgrade All-core MediaWiki websites (no added extensions/skins or images - besides logo image). I already tested the essence of this script and it worked for me; ...