0
votes
0answers
5 views

Working VBA code to re-arrange data is taking very long to run. Is there a way to speed it up, or another approach altogether?

In short, what this script aims to do is take the following data: 1 Alpha Beta Delta 2 Beta Echo Foxtrot Kilo 3 Alpha Kilo 4 Beta Echo Kilo Zulu And re-arrange ...
-1
votes
0answers
7 views

How do I change the code below to adhere to Open/Closed principle

Hello I was wondering if someone could help me refactor this code. Although I know this looks bad, it works. Now I would like to refactor it so I would respect the open/closed principle in SOLID. ...
0
votes
2answers
18 views

Calculate difference between two times

I just wrote this script that calculates the time difference between two times. It's going to be used in a larger program that will store the returned value in a database. I'm mainly wondering if ...
1
vote
2answers
60 views

Clean Code: Improving readability and refactoring

I'm curious how I can improve the readability of this short program I wrote. Mainly if and how there is a way to remove the for loops and maybe refactor the ...
0
votes
0answers
9 views

How to parse a POSIX command line pipeline in C

I've refactored this function that was 200+ rows. Now it is "only" 161 rows and I can do further refactoring now that I have a strategy. I fixed all the errors and memory leaks and measured with ...
1
vote
0answers
25 views

Hangman Game in windows forms

today I created a simple hangman game, which has 10 different categories with 10 words each. The words order is being randomized each time you pick a category. You have the chance to pick a wrong ...
-1
votes
0answers
16 views

Is goto accettable in this situation?

I've to authorize some users to do post requests from their CMSs in order to create a new resource on my database. I've to send a JSON response containing the status of the response (successful or ...
0
votes
1answer
21 views
0
votes
0answers
5 views

Portable periodic/one-shot timer thread (improvements)

Note: This is a much improved version (I hope) of code in this previous code review of mine. I have renamed several things, are the names good? I made it lazily start the worker thread only after ...
0
votes
0answers
11 views

Prefetch in ARMv7

I have to implement Khatri Rao product between 2 matrices in C. Mathematically this is a column major access of data and I can not change that. But if I use preload ( PLD instruction in ARMv7 ) to ...
0
votes
1answer
14 views

Optimizing and accounting for edge cases in Dijkstra's algorithm

I just recently wrote a program to simulate how multicast routing works. The program uses a weighted graph to represent the network and simply runs it through the algorithm. I would like to know if ...
0
votes
2answers
25 views

Counting occupants in each HouseHold provided large file of comma seperated personnel records

I was given the below Exercise as part of a coding Exercise to do at home for a technical interview, and I did not get through past this round. I would like to get some input on what i could have ...
0
votes
0answers
21 views

JavaScript calendar widget

I'd like to know how I can refactor my JS code for usability. Currently my JavaScript uses some HTML to build out a simple calendar with the following functionality: a. opens into the current month ...
2
votes
1answer
41 views

Calculating running average in Java

I have a library which makes HTTP calls to my service. I was trying to calculate running average of how much time my service is taking on an average. Here is the core logic of how I am calculating ...
0
votes
0answers
12 views

AES 256 FIPS compliant encryption + HMACSHA256

I created an Encryption class that encrypts data and decrypts it using the AesCryptoServiceProvider class with an HMACSHA256 ...
-1
votes
0answers
12 views

Something is wrong with my infix to postfix conversion in JAVA [on hold]

I have been doing this for hours and checked other codes but when I implement them, the postfix is still not how it's supposed to be. It would be great if anyone could check them. Thank you so much ...
2
votes
1answer
24 views

Composite implementation of a prototype singleton registry

I am studying design patterns and I've implemented a composite prototype pattern which is also a singleton (one instance per JVM). The main and most important part of the code is the ...
2
votes
0answers
21 views

Creating an istream peeker

I want an istream that you can safely peek arbitrarily many characters from. This works as far as I can tell, but I am unsure if this is really "the right way" to ...
5
votes
1answer
18 views

When values are pasted into a bigger range, the values should be repeated as needed to fill the range

I am currently working on a project, and I just wrote a piece of it that requires a lot of array manipulation. Given a text input I want to expand it to fill the number of rows and columns I have. I ...
2
votes
0answers
15 views

Finding cointegrated pair with minimal t-score

The function findMinimal() receives a tuple from a list which contains 171 tuples, each of them go into the function one by one and, for each tuple, it searches the ...
1
vote
1answer
24 views

Cross browser JavaScript implementation of xhr

I wrote a small, cross browser compliant implementation of xhr requests in client JavaScript that closely follows the jQuery $.ajax() API and standards. The goal is ...
1
vote
3answers
35 views

C single-linked list with remove

Can you please point out any problems with this C forward list with remove node functionality? I believe this can be way simpler ( removeNode function ) but I ...
6
votes
2answers
96 views

First C# program (Snake game)

I've just started out using C#. I've used Scratch (drag and drop programming for kids) for quite some time. Since Scratch didn't have classes and methods I have a feeling this code could be a lot more ...
0
votes
1answer
14 views

C function for copying array into matrix

I want a matrix that can grow dynamically and build up a structure in RAM as input arrives from standard input och terminal (shell). First I tried with a matrix like ...
-1
votes
0answers
12 views

2D Grid search in larger 2D Grid [on hold]

The goal is to return a boolean as to whether the 2D search area exists in the larget 2D grid. My logic is as follows: Find the first occurance in the grid that equals the target grid Find all ...
0
votes
1answer
14 views

Follow-up zp-Tree to represent Trees as nested arrays

This is a follow-up on my previous post. I have made modifications based on the feedback received on the previous post, hence I request another review on the modified code if ok. Note: review ...
1
vote
1answer
23 views

Storing hierarchical data into a data structure

With the following data in a table, ...
-2
votes
0answers
9 views

SQL inserts and Table creation Issues [on hold]

I'm creating a small database for an airline. I don' think my syntax is off, but something is going wrong in table creations/test data insertion. I'm using the Oracle DBMS and SQL syntax. I'm not ...
8
votes
1answer
61 views

Finding a string whose MD5 starts like the digits of π

I tried to make a program to find a string whose MD5-hash starts like the digits of pi, where dot is omitted. Is there a faster way to do it than this: ...
2
votes
0answers
6 views

A Data Explorer query that makes bar graphs

I wrote a query for SEDE that I think is pretty cool. It uses the currently available graphing capabilities (scatter plots) to create a bar graph. I have used it as the subject for a self-answer on ...
-3
votes
0answers
19 views

why isn't a dictionary being populated? automate the boring stuff excel census chapter [on hold]

New to all of this. Using linux, python 3.4 and openpyxl and doing the exercises from ATBS. Why am I not getting a fully populated dictionary? I am only getting the results from one row. The excel ...
9
votes
5answers
784 views

Generating Robot Name

Problem: Write a program that manages robot factory settings. When robots come off the factory floor, they have no name. The first time you boot them up, a random name is generated, such ...
5
votes
1answer
66 views

An optional<T> implementation

This is an implementation of optional<T> from C++17, it is mostly standard conforming. I'm looking for a review on efficiency, correctness and performance. ...
0
votes
1answer
11 views

Loading URLs via a case statement

I have the following code which loads in a URL based on the id of a user-clicked button. I'm looking to compress it down as much as possible, and make it more modular and reusable: ...
2
votes
1answer
20 views

Thread-safe Bloom Filter in Java

I have tried to implement a Bloom Filter in Java here. https://github.com/srirammanoj/skynet/tree/master/bloomfilter I just wanted to know if my implementation can be called 'thread-safe' , and if ...
0
votes
0answers
31 views

Unit test with Moq callback anonymous function

I have the following unit test that is testing predicate logic in a repository (Note: mockOpportunityRepository.Setup): ...
0
votes
0answers
14 views

Video encoding fake algorithm using STD thread with simple pipeline [on hold]

I've to make a simple program that basically imitate an encoding algorithm. I've thought a frame like a struct composed by a 2D vector and a variable type (I or B) that define the kind of encoding. ...
-3
votes
0answers
38 views

How to implement an algorithm in matlab? [on hold]

z(t) is the whitened input vector, y(t) is the output vector, W(t) is the weight matrix, and g is the nonlinearity in the NLPCA criterion. The parameter is a kind of “forgetting constant” that ...
2
votes
1answer
24 views

Slicing a big NumPy array

I have a function that takes a four-dimensional NumPy array M and, for each value i of its second index, takes all of M without the i-th "column", evaluates the product over all other columns, and ...
0
votes
2answers
36 views

Simplest way to write “FizzBuzz” in Rust

Can you write an a simpler Rust fizzbuzz program than I have? Use my output or the spec: Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of ...
4
votes
0answers
26 views

Passport user authentication

I'm using Passport in Node.js app to authenticate user by email and password (login) and also by token. Email and password are used only when user is logging in. Passport local strategy generates ...
2
votes
3answers
45 views

Tag dependence approach

I need to add class is_active to all div's when I click on <div id="all-tags"> and remove class if I click again. Only ...
3
votes
2answers
292 views

C dynamic array implementation using preprocessor

I have implemented a generic dynamic array implementation using defines. As I am new to C, I am not sure whether the code has any flaws. The code is as follows, ...
1
vote
0answers
10 views

Algorithm and PHP Class to Compare companies' information and define similarity

The task is: I get companies' information from a large CSV file and then I need to compare this information with each company in the database to know if the company is a new one or if it is already in ...
3
votes
2answers
64 views

Creating a new camera stream

I'm currently in the process of refactoring some code and I was wondering if I should use switch or if-else for the is code: ...
-1
votes
0answers
36 views
0
votes
1answer
24 views

A javascript equivalent for toDictionary (c#)

I made a function that should ease the making of new objects out of objects or arrays. I extended underscore so thats why the _. ...
-4
votes
0answers
11 views

I had two controllers performs two different functionalities. How to apply these two controllers on Same element [on hold]

I am new to angular js.please suggest how to achive it. I am preparing charts using angular js and i am able to display chart with angular js below js plug-ins. ...
0
votes
1answer
21 views

Data-structure “Singly-Listed List” in JavaScript

The purpose of the data-structure is to manage person-objects. Persons can be added at any time. But the order can't be changed afterward. Only the deletion of a person is possible. Represents the ...

15 30 50 per page