All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
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: ...
0
votes
0answers
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. ...
0
votes
0answers
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 ...
-1
votes
0answers
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 ...
-3
votes
0answers
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 ...
-1
votes
0answers
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? ...
1
vote
0answers
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 ...
0
votes
0answers
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: ...
2
votes
1answer
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 ...
1
vote
0answers
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 ...
0
votes
1answer
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? ...
4
votes
1answer
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 ...
4
votes
4answers
199 views

LINQ for generating all possible permutations

Permutate() is supposed to generate all possible permutations of the source sequence: ...
2
votes
1answer
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 ...
5
votes
2answers
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 ...
0
votes
0answers
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 ...
2
votes
1answer
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 ...
-2
votes
0answers
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 ...
9
votes
3answers
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 ...
1
vote
1answer
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. ...
1
vote
1answer
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 ...
-1
votes
0answers
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. ...
5
votes
2answers
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. ...
2
votes
1answer
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 ...
1
vote
0answers
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 ...
1
vote
0answers
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 ...
0
votes
3answers
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 ...
6
votes
1answer
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 ...
1
vote
0answers
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 ...
2
votes
1answer
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 ...
3
votes
1answer
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 ...
-1
votes
0answers
22 views
2
votes
0answers
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 ...
-4
votes
0answers
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 ...
-5
votes
0answers
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? ...
-1
votes
0answers
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 ...
1
vote
0answers
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 ...
4
votes
1answer
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 ...
2
votes
0answers
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 ...
-4
votes
0answers
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 ...
1
vote
0answers
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. ...
1
vote
0answers
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 ...
-4
votes
0answers
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: ...
1
vote
0answers
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? ...
3
votes
2answers
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 ...
1
vote
0answers
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. ...
0
votes
0answers
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. ...
4
votes
1answer
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; ...
7
votes
2answers
267 views

Network helper class with retry logic on failure

I wrote an helper class which allow me to request the body content from a site that is created by AJAX, for doing so I'm using <...
2
votes
0answers
11 views

Managing Angular subscriptions

There are different methods to get data from server in Angular application: Get Observable from the service and subscribe to it at component Create Subject at the service and subscribe to the Subject ...

15 30 50 per page