# All Questions

5,070 questions
Filter by
Sorted by
Tagged with
1k views

### Multi-Functional Event Delegate

I'm pretty new to JQuery, maybe a week's worth of experience, but I'm having a lot of fun so far. One of the things I thought I would give a shot is attempting to implement a custom CMS for my current ...
829 views

### Implement a working Vending machine [closed]

Task: Design a vending machine which does the following: Accepts coins of 1, 5, 10, 25, 50 cents or notes of 1 and 2 User selections: Candy, snacks, nuts, Coke, Pepsi and soda ...
38 views

### Parties and Messages in SQL e-Commerce db design

I'm posting a follow-up question based on my first question. My goal is to, as an exercise for myself, create a complex (in my opinion) e-commerce application. The explanation of the application can ...
60 views

### Converting Array of UINT8 (unsigned char) to Array of Float32 (float) Using AVX2

Given input array of UINT8 (unsigned char) with numElements how could one efficiently ...
141 views

### All-purposes AJAX handler made with PHP and .htaccess that speaks JSON - Part 2

Earlier, I've posted a question about a file used to handle AJAX requests. I've followed some of the advices given and made some changes on the code itself. You can go on "All-purposes AJAX handler ...
78 views

### User class: getting user data, logging in, secure CSRF session handling, logging out

In reference to my previous code: User class: getting user data, logging in, secure CSRF session handling I re-wrote my SystemUser class, without the DI container (for now), I'm still trying to ...
965 views

### Pure JS multi-slide carousel

On our home page we need simple multi-slide carousel. It is our highest traffic page, so we decided to remove all libraries (including jQuery) in order to increase page speed. Functionality we trying ...
53 views

### Advent of Code 2017 Day 5 (part 2) in Functional Programming (FP)

I wanted to practice functional programming (fp) without using any library but using vanilla JS only. So I took a problem from Advent of Code (the 2nd part of Day 5): https://adventofcode.com/2017/...
50 views

### FollowUp CommandLineInterpreter (CommandLineInteraction)

I wrote an command line interpreter (CLI) in Java and got some real helpful hints on how to improve. The cli is responsible to pick up the users input (via keyboard aka command line) into any app ...
191 views

### class IText - Validates text from Ajax POST | Add consistent return type, defensive coding, functional focus [closed]

I denotes independent, no dependencies. ...
317 views

### Find pairs of consecutive numbers fetched from blocking queues

I was coding for the following programming question: Suppose you have two independent blocking queues that will keep getting new data, the new data will always be greater than the last element of ...
114 views

### Date of Birth Value Object 2

I realize it could be argued that it is an overkill to create a ValueObject for such a simple type. I am just trying to make sure that I understand the principles of overriding/overloading these ...
61 views

### Achieve error differentiation in Promises

Background I have a REST API using MongoDB, Node.js and Express that makes a request to my NoSQL DB and depending on different results, I want to differentiate which error I send the customer. ...
22 views

### Send an inbound Enquiry to a Users registered Twitter Account to notify them of its arrival

This follows on from an earlier CR Question. - The reasoning behind which suggestions were taken on / which were not taken on board are no longer relevant as this is supposed to be, from my ...
386 views

### Directory that lists employee information

I'm working on a directory that lists employee information. Each employee can belong to multiple departments and each employee can have multiple job titles. I have 5 MySQL tables that I am pulling ...
271 views

### Generic object pool [closed]

I'm doing research on GenericObjectPool by putting Cipher in pool so it can be reused. ...
731 views

(See the next iteration.) The following snippet is a brute-force algorithm for computing a graph radius in time $\Theta(V^2 + VE)$ and space $\Theta(V)$ simply by doing $|V|$ breadth-first ...
176 views

### Wrapper class for calling external API [closed]

I have a PHP cronjob script. I need to send requests and get responses from some external API. So, there is code for the API class. In this class, I connect to the API and call public methods of ...
334 views

### Implementation of bridge design pattern for a web scraping app - follow-up

Earlier today I tried to implement an example of the bridge design pattern, but I ended up misinterpreting it. I made a lot of changes: ...
75 views

### Pretify JSON class -followup

This is a follow up to this question. This is an improved version in accordance to comments, suggestions and reviews. Is the namespace implementation proper? is the code readable? I didn't want to ...
46 views

### colorprint - part 2

This is a followup of the last review to comply with meta's rules. In the last, I posted a small library called colorprint and got some helpful pointers from chux ...
115 views

### A Java subclass of ArrayList that supports rotation in constant time - follow-up

(See the previous (and initial) iteration.) Compared to the previous iteration, I have added more methods that maintain the invariant required for constant time rotations, such as bulk add/remove, ...
1k views

### Quicksort for Objective-C

This is quite plain vanilla, but I'm hoping for Objective-C specific feedback. Also I'd be interested in what folks think about sorting in Objective-C vs. doing all sorting in C or C++ (and which?) ...
175 views

### Performing transformations on files [closed]

The code opens some files and does some transformations. I am looking for syntactical help where I can do the same thing I am doing now but speed it up. I can supply some of the calls code if ...
9k views

### Inventory Script (RPG) in C# [closed]

I would prefer if more experienced users could give pointers on how I can optimize and think better when writing code. If you are unfamiliar with unity3d, ignore the use of UnityEngine, the heritage ...
70 views

### Singly Linked List Implementation (With Nodes)

This code was recommended to me by my dear friend Jon after I wrote an implementation using arrays. With his help, I managed to create a Singly linked List similar to std::vector using Nodes. ...
139 views

### Heap selection sort - follow-up

See the previous and initial iteration. I got rid of Run objects and just maintain two integer arrays in the RunHeap: one for ...
77 views

### R Function to Generate Predictions from Ratings and Save Results

I am trying to generate predictions using the function below in combination with sapply. My actual datasets are very large, I am attempting to make 1.5 million predictions with this function and it is ...
348 views

### Java MultiThreading using wait and notify - follow-up

After following the tips from @VoiceOfUnreason on my previous question, I want to post the revised code. The purpose of the code is to simulate a Shop and a ...
288 views

### Does Java need an Observable object with generics?

This is the follow-up question from here. This is an Observable class similar to java.util.Observable. The difference is that ...
883 views

### Implementing multiple Producer Consumer using custom Blocking queue [closed]

I am trying to implement multiple producer multiple consumer problem using a custom blocking queue. The requirement is that: If the queue is not full, all the producers should be able to produce ...
1k views

### Palindrome algorithm

This code could be better? This is the algorithm: Compare the 1st character to the last character Compare the 2nd character to the second last character and so on Stop when the middle of the ...
761 views

### Effective Python 2/3 two-dimensional array initialisation

Recently I noticed that the idiomatic python two-dimensional array initialisation is extremely slow. I am wondering, is there a good, proper way of doing this simple task fast? Also, are those two ...
41 views

### ChatterBotV2.1 coded in python

I'm new to python and PEP 8, so I want to see how to improve my work. This is my first big project without a guide. This is 184 lines. I think I murdered PEP 8 and need help fixing that. ...
628 views

### Refactoring to avoid the use of dynamic

Based on the answer to my question on StackOverflow, I have ended up with the following code: ...
287 views

### Finding the Minimum and Maximum Value in an Image

Given an image which is padded to support aligning (SSE) I need to find its minimum and maximum value as fast as possible. Mind you the padded values are not defined and can't be assumed to have ...
233 views

### Implementation of a generic Stack in C++ [closed]

I've implemented a generic Stack in C++. I would like a code review in regards to my code, especially on whether or not my implementation satisfy the following 4 ...
59 views

### Project Euler # 43 Sub-string divisibility in Python

The number, 1406357289, is a 0 to 9 pandigital number because it is made up of each of the digits 0 to 9 in some order, but it also has a rather interesting sub-string divisibility property. Let \...
372 views

### QuadTree can't handle many elements

I'm currently implementing my own QuadTree in C++. It runs well with 100 items, but once you start adding more it slows down. remove, ...
146 views

### Base 256 array addition Recursively [closed]

Is there any way to improve private byte[] RecursiveAdd(byte[] f, byte[] s, int index, byte[] result, bool carry = false) method? The method signature is too long ...
151 views

### BubbleSort - checking if bubblesort is decreasing the iterations through the array

What I'm hoping my code is doing is instead of making 99 comparisons on every pass of a 100 element array, it will now make 98 comparisons on the second pass, 97 on the third pass and so on and thus ...
60 views

### Huge performance difference: PowerShell Core vs. 5.1 [closed]

Recently I have answered another question about performance. A solution found using PowerShell-ISE successfully, and good speed testified using PowerShell Core. However, running the same script(s) in ...
97 views

### Practicing Java servlets, MySQL and JSON - follow-up

(See the previous iteration.) What's new I have incorporated all the points of Dmytro Maslenko's answer. My code seems a little bit tidier. Code AddPersonController.java ...
289 views

### Prime Number Generator

The purpose of this program is to run an infinite prime generator that won't stop unless I tell the console to stop. This is not a sieve of Eratosthenes; it stores prime numbers in an array and ...
2k views

### Correct functions for cleaning and inserting data into database [closed]

Initializing variables: ...
999 views

### Mysql flexible insert record with bind_param or bind_value

I want to insert rows in a database table with the precaution of SQL-injection. I'm using below flexible MySQL insert function, which enters a record in a given table. Is this the best approach or is ...
189 views

### Increase the execution speed of VBA macro code

I am providing you with the code of my macro and hope that somebody can tell me what is making my macro slow and provide me with a solution as to how to make it run faster. Currently the execution of ...
166 views

### Better sorting speed

import sys x=int(sys.stdin.readline()) lst = [int(sys.stdin.readline()) for i in xrange(x)] lst.sort() print lst How can I make this code faster for large ...