0
votes
0answers
3 views

Is this idiomatic Haskell

This is the most Monadic code I have written to datem and I'd welcome comments. I'm also struck how much faster this mutable approach is than the immutable version I first wrote. It's slowness was ...
0
votes
0answers
3 views

Suggestions for storing and comparison of strings in better way

The problem goes like this. Change the strings provided by user to form palindromes. To do this, 2 rules are: (a) Reduce the value of a letter, e.g. Change 'd' to 'c', but cannot change 'c' to 'd'. ...
3
votes
1answer
24 views

Test with array and mock

Here is my function I want to test: ...
-3
votes
0answers
23 views

How do I finish this up? Sorting a list of arbitrarily generated integers [on hold]

Write a program that will sort a list of arbitrarily generated integers in descending order. Let the user determine how many arbitrary and unique numbers to sort from 1 to 10000. Use the random ...
4
votes
1answer
18 views

Logger class for MVC Framework

I have created a logger class for my own framework. Now I am trying to identify the components which can be done in a better way. The logger class doesn't log anything inside a file but it logs the ...
0
votes
0answers
6 views

Using Identity 2.0 with integer key in Onion architecture [on hold]

I was trying to analyse the code provided by Imran Baloch. Source code is available at : https://github.com/imranbaloch/ASPNETIdentityWithOnion This solution uses Onion Architecture and arranges the ...
1
vote
0answers
18 views

GOF Composite Design Pattern Implementation Using Modern C++

After reading about the composite pattern from the GOF design pattern book, I thought to re-implement the code mentioned in the motivation section using the modern C++ concept/idioms. Below is the ...
5
votes
1answer
14 views

IDE-Integrated Unit Testing… in VBA

My UnitTesting add-in works nicely, but it has dependencies on a Reflection and a System ...
2
votes
1answer
15 views

Filtering JSONArray by Branding & Modelling

I have a small function that takes in a list of JSON objects that has the format below. The function below that wants to see if the brand and model of car passed to it can be matched against the List ...
10
votes
1answer
31 views

Network Downtime

A while ago I was experiencing 'flakiness' on my home ADSL line. I run a Linux server in my basement, VOIP, and a few other things (like Netflix) and I was experiencing a few minutes of network ...
7
votes
3answers
78 views

Simple shell in C [on hold]

I am just getting started with C and made this simple shell to test my understanding of some basic principles. The shell reads commands from standard input, forks itself and executes the command. How ...
3
votes
0answers
20 views

Basic particle system

After about half an hour of fooling around with Processing.js/Javascript, I got this, fairly decent particle system set up. ...
2
votes
1answer
32 views

Finding strings inside of other strings in order in C

A question on Stack Overflow recently intrigued me to the point of me implementing the functionality in C. Can you critique this algorithm and tell me what is good and bad about it? This program will ...
3
votes
1answer
33 views

Handling errors on a web application

I have this C# production code for handling errors on a web application. There are currently two applications that use the class. In each application I initialize the class within the ...
3
votes
1answer
29 views

Monte Carlo AI in 21 game

I am very interested in the Monte Carlo AI. I tried my best, still, this AI plays very badly. This code "works" in the meaning that it does not crash, but the quality of play is extremely low. Have ...
0
votes
0answers
4 views

Storing a users submitted jQuery values in a Python/Django view. [on hold]

The below is a get_context_data method of a Django Session Wizard View which is used to display a form over multiple pages. The main idea of the ...
3
votes
2answers
45 views

VBA Excel Game - Testing

My brother bet me that I couldn't make a game in Excel. The code is all over the place and buggy in parts. But I would appreciate it if anyone would give this game a go. The music and the code has ...
2
votes
1answer
13 views

Grouping counts from tables by account ID

I'm working with this query to get counts from three different tables, and to group the results by account ID: ...
8
votes
2answers
48 views

Optimizing String combinations in Java

I need to obtain all combinations of a String of length k from the given elements. For example, for ...
11
votes
0answers
31 views

Zeller's Congruence Revisited

A couple of date-related questions have come up recently, and on both occasions I have been taken back to my 'early' days where one of my first forays in to programming involved implementing Zeller's ...
1
vote
0answers
11 views

AJAX/JSON based portfolio

This is a design portfolio page. On load, the JSON data is retrieved via ajax, and one of the keys is used to generate a list of '.project-links', however none of the projects are loaded by default. ...
2
votes
1answer
60 views

How can I avoid repeated code using lambdas?

I have a method which should accept a Function/Action and do something with that method (in my case I've added retry logic). I'm wondering how I can remove the duplicated code (for loop, etc) from ...
2
votes
2answers
117 views

Function to get the most frequently appearing pixel

What i have so far is a nice and rapid algorithm for finding the pixel dominant from bmp image. I am not sure how to make it to work.. i though it works, but the program freezes. ...
2
votes
4answers
25 views

Handing focusing and unfocusing of multiple form fields

Here is a link to my problem ...
-1
votes
0answers
14 views
2
votes
1answer
29 views

Binary Search in C

The standard C library function bsearch wasn't giving me correct results, apparently. So I decided to implement a binary searching function in place of it. It ...
2
votes
1answer
30 views

Building a basic framework

I am trying to build a very basic JS framework for my own uses, ultimately collating a lot of pieces of JavaScript I have created over the years. But I would not call myself a JavaScript expert. What ...
0
votes
0answers
26 views

Optimizing Dijkstra implementation using PriorityQueue in Java

I am trying to make Dijkstra implementation more efficient. Below is the code for class Node which implements Comparable so it ...
17
votes
2answers
834 views

Calculate amount of mugs StackExchange should give away so I'll receive one

Description Calculate how many mugs StackExchange should give away(for graduation) to top reputed users on codereview.stackexchange.com so I'll also receive one. (output is dividable by 50). Code ...
0
votes
0answers
17 views

Rendering speed in SDL2 [on hold]

I have a large rendering class using SDL2: video.cpp (github mirror) It all works fine, except it's a bit slow (starts lagging at larger resolutions). The reason for this is obvious - it basically ...
2
votes
1answer
36 views

Using array values to create variables, if statements and highchart dataset

I am trying to make my script maintenance-free by replacing some "static" variables and labels with dynamic ones. The main function of my code is to extract data from a SharePoint-list which contains ...
9
votes
3answers
427 views

Beginnings of a base-conversion game in Python

I'm pretty very new to python, so I thought that I'd write a game to teach me python and better teach me how to think in hexadecimal and binary. I'm starting off by writing a few functions to convert ...
12
votes
2answers
394 views

Pluggin' in Plugins

I'm currently working on an in-house project and a part of that project is this pretty standard plugin loader below. There must be a way to avoid so many ugly looking ...
5
votes
1answer
153 views

Logging with date in Java

I write my log messages in JTextArea. Each message should have a time added. I created a following method: ...
1
vote
1answer
33 views

Trajectory optimizations

Here's a function doing some trajectory optimization in the following manner: ...
3
votes
6answers
251 views

OOP PDO Database Connection

I'm currently learning about PDO, and trying to connect to the database and CRUD in OOP way, this is a simple code that I use. index.php ...
1
vote
1answer
19 views

Event handlers & helper methods for a Kendo Grid

Below are a few of my handlers and helper methods. This works perfectly fine, but I'm pretty sure I'm breaking about 1001 modern conventions and possibly even optimizations. Could you provide some ...
1
vote
0answers
20 views

WPF Binding to a Repository with Entity-Framework

I have an MVVM WPF application that will make use (hopefully) with a repository and ...
1
vote
1answer
23 views

UI-slider widget

This represents a UI-slider widget - there are a number of different widgets on the page. This function is repeated per widget - 90% of the code is the same - the only difference being that each has a ...
1
vote
0answers
31 views

Generic Java Task Scheduler (Followup) [on hold]

As a followup to my previous question, and after receiving a great answer, here is the updated Scheduler class. I would also like to state some goals & ...
-1
votes
0answers
39 views

2d race game movement [on hold]

I'm making a 2d race game for my school project. The idea is that we make a race track where 2 cars wil race vs eachother. I'm only struggling with the movements of my car. I made a squire for testing ...
1
vote
0answers
12 views

Correct Implementation of Custom UIView into ViewController Programatically

I am familiar with using scoreboards to construct UI elements in Xcode, but I am only beginning to learn how to make UI programmatically (with out storyboard). I wanted to know if this is the correct ...
0
votes
0answers
39 views

Security of ProtectedObject

Is ProtectedObject really secure? Otherwise, do you have any advice? ...
1
vote
1answer
53 views

Memory cache service

I am repeating this code at lot of places: ...
0
votes
0answers
23 views

Potholes in a multiplayer snake where players can use their own algorithms [on hold]

Topic originating from stackoverflow. I'm developing a snake-like multiplayer where players can use their own algorithms to determine the next move of their snake. A little background: My game ...
6
votes
3answers
703 views

String case reverse function in C++

This reverses the case of a character in a string (a string being an array of characters). How does it look? Anything I can improve on? Let's get critical here. ...
12
votes
3answers
2k views

Is it Friday yet?

This is the first program that I have written in my C++ saga that I actually think is useful. The description for this assignment is kinda long and mundane though: Write a program that inputs a ...
1
vote
1answer
30 views

Console Application Customizer v1.0.0.2

GetBootstrap v1.0.0.2 a console customizer update from this Please give me tips, request and suggestion for my future updates. (I update every 2 weeks) Sample Preview The following code contains ...
2
votes
1answer
63 views

Simple actor system in F#

Any thoughts on my actor model here? Obviously it doesn't have implementation for concurrency as it stands- being completely synchronous, but it should be easy to make the send/become/create be sent ...
9
votes
2answers
184 views

Implementation of fixed size hash map

I'm trying to brush up on my algorithms and data structures and wrote a fixed sized hash map assuming both key and value will be only integers. This is a significant simplification of the real case ...

15 30 50 per page