# All Questions

0answers
3 views

### Viability of custom framework to serve RESTful API

Context ( I've first asked this question here : http://programmers.stackexchange.com/questions/319636/viability-of-custom-framework-to-serve-restful-api and I've been told to ask it here, so, here I ...
0answers
4 views

### Design SQL Insert When Using Modular Address [on hold]

In designing my database, I created the addresses as a modular system. One table has the AddressID, and the rest of the address tables have a row for both the ...
0answers
7 views

### Javascript - Object Key Diff

Problem So I've been tasked with finding property differences in massive JSON structures and return them in a particular fashion ([key_1.key_2, key_1], etc). Solution Heres my code: ...
0answers
11 views

### Command line password generator

I built a random password generator in Java which is meant to be run from the command line. It accepts options for: Length Upper case letters Lower case letters Special characters Numbers The ...
2answers
23 views

### Text menu and validation of the chosen item

I am writing a asp.net console app that will take a user input from a list of selected options and do things based on the selected option. I have it working right now but just looking over it there ...
0answers
3 views

### Mongoose schema for products and social media posts

Here is my current Schema Brand: ...
1answer
27 views

### Count check before Linq Single() call

Should I check Count before Linq Single() call if I excpecte only one elemet? ...
0answers
11 views

### Handle decimal in mongodb

I'm trying to find a way to handle decimals in mongodb. Is there any good way and/or should I handle it with a class like this: ...
1answer
73 views

...
1answer
44 views

### Large Switch Statement Handling 50+ Options That Call Different Methods

I have a switch statement used to handle options that a user selected (stored in an array). The array is iterated through, and for each element (enum object) in the array, an appropriate action is ...
3answers
43 views

### Method for String Building in java

I have written a custom method to use StringBuilder in java. My Requirement is to create a method which accepts any number of arguments of any type and return String by concatenating the arguments. ...
0answers
28 views

### Python program to lock and unlock files

The code takes srcPaths and actionType as parameters. The former is a string with tab-delimited file paths, while the latter is ...
0answers
15 views

### How to optomize this code? [duplicate]

I have this code: ...
0answers
10 views

### Auto-upload tool (VBA, Excel)

i created an automatic upload tool, working great (most of the time). As i want to improve the code i have several questions: 1)Is it possible to make the iexplorer progress some kind of smoother? I ...
0answers
5 views

### Python html Page reporter

My program, page_reporter, attempts to port scan a network and identify servers hosting web pages. From here it will create an HTML report using iframes to give you a snapshot of what the page looks ...
1answer
16 views

### Unity3d class that inherits from button and add OnHold Event

I made my own class that inherits from button and has a OnHold event. It seems to work ok but I'm wondering if I can improve it or if you can spot any glaring mistakes that I made. Here is the code : ...
0answers
19 views

### Deleting duplicate elements from a single-linked list in C++11

The code below is a simple coding exercise I got from a book that asks to remove the duplicates from a single-linked list (using a simple struct; this is part 2, ...
0answers
13 views

### Utility class holding useful constants - Is it a bad practice? [on hold]

I'm taking a Google Firebase course on Udacity and on one of the videos, the teacher creates a Constants class which acts as a namespace for holding constant strings and integers that are useful ...
0answers
13 views

### Pomodoro timer in Go

My goal is to implement a simple pomodoro timer using Go: channels, goroutines. I'm newbie in Go world and have some misunderstanding about naming convention. I read a lot of Docker's code on GitHub ...
0answers
18 views

### Shortcode parser in Javascript

I've written a naive shortcode parser in JS that parses shortcodes akin to those found in Wordpress. The intention is for this to be used in realtime on the client in order to preview edits on the ...
0answers
11 views

### Optimization of matlab code

I am relatively new in MATLAB and my major problem is optimization. My code seems to run very slow and I can't think of any way to make it faster. All my arrays have been preallocated. S is a large ...
0answers
25 views

### Implementation of custom config section

i recently wrote my first custom config section. I have a collection of index files, each has a path and a savetime: ...
0answers
9 views

### different method to calculate blob area in OpenCv

I'm trying to use a different method to calculate a blob area from contourArea, I'm using countNonZero function. I want to see if there is significant approximation introduced by contourArea function, ...
0answers
19 views

### Printing the nth term of the Fibonacci Series (Array out of bounds error) [on hold]

I've written the following code for to print the nth Fibonacci term, ...
0answers
13 views

### Sleep () function , issue in c++ [on hold]

i am trying to make a very simple keylogger using the GetAsyncKeystate and i am adding the sleep function to reduce cpu usage ,however when i add Sleep (1); it doesnt seem to pick up the keystrokes ...
2answers
25 views

### Client categorisation based on hourly payment

I am currently working on a small internal rating system for clients to be able to prioritise my work based on what client pays best. The input data is the hourly rate they are paying and based on ...
0answers
13 views

### Rearrange String such that similar characters are placed at least 'K' distance apart

So I was asked this in an interview, and I had to write this code on a white board. Sadly I couldn't complete the code :( . I've realized that writing code on white board is completely different ...
0answers
9 views

### Using VBA Copying from one ,master sheet to other workbooks based on the file names provided in master book

Pretty new to this hence taking it as challenge. I have a master sheet in which Column A have all the file names( complete file name with .xls extensions). I need to copy data of column b in this ...
3answers
67 views

### Detecting if two given strings are isomorphic using Java data structures

So I have written the following code and it works for various same length isomorphic strings I have tried. However I am not sure what are some time complexity improvements and coding tweaks that could ...
3answers
111 views

### Reverse Polish Notation Evaluation in Java

I would like to hear feedback about my code both in term of improving efficiency if possible or using other data structures. Also go ahead and let me know about code styles/patterns. ...
0answers
71 views

### Socket application using TPL

This is an application I wrote that allows multiple TCP clients to share a single TCP connection to a remote server (hosted project, and a demo). Traffic generated by the server is forwarded to all ...
0answers
15 views

### Maximum clique problem: fast heuristic

I have implemented an algorithm which computes a maximum clique via a heuristic. The pseudo-code can be found in this Paper (see Algorithm 2). Maximum Clique Problem Given an undirected, simple ...
0answers
23 views

### Codility Fish Test 50%? [on hold]

I am getting a 50% overall mark (75% correctness and 25% performance) on the Codility Fish problem and my solution seems to be O(N) but I am only getting 25% performance. The results can be seen here ...
1answer
25 views

### Queue implementation using two stacks

Here's my code and I want to know if there's a better method for doing so. While the question has stated two stacks I wonder if we could do only with one as well? ...
0answers
8 views

### Sorting timestamp using the date not time (php, mysql) [on hold]

I'm having a bit of a problem trying to solve this one, Currently i've got a php script that scrapes data from a MySQL db, on one part of it the DB has a timestamp which has date and time in it. ...
1answer
38 views

### Histogram of a string

I'm teaching myself Python and when a friend posted this sentence Only the fool would take trouble to verify that his sentence was composed of ten a's, three b's, four c's, four d's, forty-six ...
1answer
37 views

### Maximum profit from buy and sell offers

Given a list of sell offers and a list of buy offers for an item I want to determine how many units to trade for maximum profit. Each offer consists of a price and a maximum amount of units being ...
1answer
28 views

### Using generics to find a View by Class

This works but feels clunky - any suggestions for improvement? ...
0answers
26 views

### Longest palindrome subsequence

This algorithm finds the longest palindrome that is a subsequence of a given input string in $\Theta(n^2)$. Example Input: character Output: ...
0answers
7 views

### Modular widget that minimizes js and css scope pollution

So, my goal with this is to create a simple login widget that does as close to nothing to the global scope as possible. The login mechanism is less important than the encapsulation. The whole script ...
1answer
15 views

### Factoring out a “get-change-set” pattern with Clojure's Records

I'm remaking an old program of mine in Clojure. It involves "Beings" (generic entities capable of attacking and breeding) let loose in a confined space. I've noticed a pattern of taking a record, ...
1answer
24 views

### Building a 2D array “month view” for a given date

I am working on a calendar widget for a project. For any given date, I need to build a 2D array representing the "Month" that the date falls in, where the rows represent weeks in the month and the ...
0answers
20 views

### Cuda C Matrix Compression

I am using Cuda to learn and implement a CSR matrix compression algorithm. What can I do better relating to C's best practices? main.c: ...
1answer
21 views

### Calculator improvments

I'm a beginner at Lua and programming in general and i just made a simple calculator and i was wondering where i could do improvements ...
2answers
35 views

### Check that files don't contain Unicode

I use this code to check that all files in a directory are free from Unicode and non-printable characters. Can I improve the structure of the code? ...
1answer
36 views

### Simple code refactoring in javascript

This code is working but there's a lot of duplication, how can I refactor it ? ...
1answer
51 views

### Pong game with a random twist

I made a simple Pong game using SDL2, with a twist: You don't get to play :), only the 2 AIs get to. ;) Because Pong is a very small game, I put everything in a single file (...
0answers
8 views

### Polymorphic event notification model in Rails

I have a polymorphic notification model. When user gets a notification he can get on the page of the notifiable to check out what happened exactly. For instance ...
0answers
6 views

### Accessing SharePoint's Managed Metadata TermSets Locally and Remotely

I have written a small program which has 2 main classes : ServerSideMMS: This can access the SharePoint Managed Metadata Services, but only from the server which ...
0answers
21 views

### Small Python class for Lindenmayer Systems

L-systems are basically rules for recursively rewriting a string, which can be used to characterize e.g. some fractal and plant growth. I wrote a small class to represent deterministic L-systems and ...

15 30 50 per page