0
votes
0answers
8 views

Java GS Collections ImmutableList implementation [on hold]

The following code is taken from GS Collections implementation of immutable Lists. Is it good practice to perform the above chain of construction for small lists of size <=10 ? ...
1
vote
0answers
6 views

A solution to the AST Typing Problem

Expression trees are the bread and butter of functional programming but when it comes to adding additional information to an established tree it can be difficult to incorporate such changes without ...
1
vote
0answers
6 views

Module pattern callback implementation

Is there a problem with this callback implementation for a module? Or with the module implementation? ...
2
votes
0answers
9 views

Deep pick using lodash/underscore

Use Case _.pick creates a shallow clone of an object given a predicate that identifies which keys to keep. pickDeep would ...
2
votes
0answers
6 views

Does my design workable (Repository/UOW) rock or suck?

I'm using VS 2013/EF 6/WEB API 2. This application of mine which is working on will eventually grow to be big project and I'm in the very beginning stage and need your expertise to make it simple as ...
7
votes
1answer
29 views

Bitcoin address validator in C

Here is a Bitcoin address validator I am looking to have reviewed in C. Normally I would have the enum and function prototypes declared in a header file, but I ...
5
votes
2answers
26 views

Instantiating a k-ary hierarchical tree in C without relying on RAM

I created a k-ary tree in C to be used as an easy and efficient way to organize "UML-like" data in embedded devices. The left node is at the lower logical level (a child) while the right node is at ...
1
vote
1answer
9 views

Aggregating values of a path-dependent type

I have a type representing an immutable order which contains immutable order lines that belong to it. I want to use path-dependent types for this. Obviously you cannot instantiate a path-dependent ...
1
vote
1answer
28 views

How easy is it to crack this encryption algorithm?

When I was about 13 or 14 years old, I was a little interested in cryptography (which is, after all, an interesting field). I learnt quite a lot since that time (it has been about 8 years since then), ...
1
vote
0answers
16 views

Simple Object known state System

I'm currently re-studying C# and I wanted to make a basic system where objects always know where each other are. But I also wanted to make it so that objects that don't need to know about other ...
1
vote
1answer
15 views

Optimization of recursive jQuery images swap function

There's this website I'm working on that needs to swap images every few seconds, like a slideshow or image fade swap in a way, except that you need to target 5 IMG tag elements. I was able to make a ...
3
votes
2answers
37 views

Returns values for a specific array and key

This code is intended to take an array and a key as inputs, and return an array of the values paired with that key. ...
3
votes
0answers
13 views

How to unify XML formatting with inheritable parsing?

Inspired by the XML format for game data question, I was interested to see how my system works for storing game data. My system works a lot like Halo, where there are a variety of gametypes and ...
-1
votes
1answer
16 views

Dropdown Form to Link to Another Page [on hold]

I'm trying to create a dropdown form that will allow me to link to another page after the user clicks on one of the dropdown items. I've tried searching forums and lynda.com (this code is based off ...
8
votes
3answers
140 views

Finding the largest of a series of numbers being XORed

I'm working on solving a problem involving finding the largest of a series of numbers being XORed. This is the actual problem: Xorq has invented an encryption algorithm which uses bitwise XOR ...
3
votes
0answers
17 views

Predictive recursive descent parser for math expressions

I've been learning about language theory and parsing, and decided to write my first parser: a LL(1) recursive descent parser. But actually, it does a little more than just expressions; it can also ...
3
votes
2answers
43 views

Getting the unique factors of a number recursively

I have written the below code to get the unique factors. Please offer suggestions for better results. ...
7
votes
1answer
19 views

Creating ShortCut (RightClick) Menus in Access

I'm writing a tool to create shortcut menus for an application that I maintain built on the Access runtime. I compile this app into an *.accde file, so much to my chagrin, all right click menus are ...
1
vote
0answers
11 views

Filter by a distinguishing field when making publications using meteor

In my publications with meteor.js, I find myself repeating the same style of code and would like a cleaner approach. For example: I have a users collection that ...
2
votes
0answers
24 views

Determining maximum profit to be made from selling shares

Question Your algorithms have become so good at predicting the market that you now know what the share price of Wooden Orange Toothpicks Inc. (WOT) will be for the next \$N\$ days. ...
3
votes
1answer
27 views

Updating properties and states

I am rewriting a VB.NET application in C#. This code was originally done in 50 lines and I am trying to clean it up. As you can see I have gotten it down to 10 but I still feel its ugly. I want to ...
0
votes
0answers
13 views

row not retrieving date until line 63 [on hold]

I'm running the following code, but it doesn't start the result until the 63rd row. Not sure how to change it. ...
-2
votes
3answers
42 views

Arithmetic operation from string

I have a string like str = " 4+ 6 * 30";. I have to perform an arithmetic operation on this using C#; My solution to this problem is as follows. ...
1
vote
0answers
18 views

Sending a HttpRequest Message, and retrying in case of unauthorised

This code simply sends a HttpRequest message and, if it comes back Unauthorized, gets a new login and tries again. This code is meant to deal with the moment a ...
0
votes
0answers
18 views

“Transparently” converting the output to an e-mail message? [on hold]

I recently wanted to write a regression testing script that produces a report that looks like this: ...
5
votes
2answers
174 views

Index into array as if it is circular

The problem: Treat an array as if it is circular; out-of-bounds indices "wrap around" the array to become in-bounds. Current solution: ...
2
votes
2answers
95 views

Are either of these better than other performance wise?

I have these few lines of code (written inside a Smarty .tpl file). ...
8
votes
1answer
149 views

Calculating the checksum digit with the Luhn-algorithm

I'm doing some exercises in Python and this one is about using the Luhn-algorithm to calculate the checksum digit in Swedish personal identification numbers. The description is the same as this ...
2
votes
0answers
26 views

Logging strategy setup

I finally set up my logging infrastructure to work as desired, however I feel like I had to do quite a lot things just to fulfill a few requirements. Now I'm worried if my approach has major ...
1
vote
0answers
29 views

Async function with slow web reference(web service) slowing down webpage

(Repost from SO since I got recommended to post it here instead) tl;dr: Is there a way to make a threading/async post with a web reference not slow down the whole website just because the web ...
12
votes
2answers
510 views

XML format for game data

I want to create an XML format in which I will define data objects for a game I am currently working on. The base idea is that I will have Elements which can be ...
0
votes
0answers
16 views

Optimizing max similarity for WSD in python

I have a library for simple Word Sense Disambiguation (WSD), https://github.com/alvations/pywsd But i have a function for WSD based on the sum of maximum similarity score for every word. But it's a ...
3
votes
1answer
44 views

Changing these 2 Function into one function

I have two functions that are similar. The only differences is that their using two different models. How can i change them into one function? ...
4
votes
0answers
31 views

Java secured cookie - security issues?

I tested the play framework the last days and had mixed feelings about it. In the end, I don't use play for my new REST project. I use http://www.sparkjava.com as minimal server setup. But I really ...
0
votes
0answers
12 views

Best algorithm to find a subarray whose sum is closer or equal to given number. [on hold]

Suppose we have sub array of size n and we have to find subarray of whose sum is equal to k or closest to k. Solution: What would be best algo for this problem.
8
votes
2answers
48 views

YARPI: Yet Another Repository Pattern Implementation

Following-up on this post, I wanted to be able to put a copy of that Excel workbook on a USB key and take it home to keep working on the code a bit (there's more than just one or two tables to ...
5
votes
4answers
61 views

Optimizing nested loop in run length encoding function

I'm currently working on a tool that needs to decode, modify data, then re-encode that data using the Yaz0 format. Everything has been in a working state, but after running some code analysis on my ...
4
votes
3answers
31 views

Controller method - Ajax request

I'm quite new to Laravel, and I'm not sure what am I doing is the best practice. I'd like to return JSON if the request is Ajax, or return a view otherwise. This is the way I made it, and it works ...
1
vote
0answers
21 views

Locating a bitmap inside another (larger) bitmap with F#

This is my first go at the completed project that I've been working on with CodeReview assistance, so further advice is appreciated! See here, here and here for the past history of the project. I ...
0
votes
0answers
9 views

laravel: controller method - ajax request [duplicate]

I'm quite new to Laravel and I'm not sure what am I doing is the best practice. I'd like to return json if request is Ajax, or returning view otherwise. This is the way I made it, works fine, but I'm ...
3
votes
2answers
91 views

Determining if an entity exists in a database via a stored procedure

Here is a short and simple Ajax method that returns "True" or "False" if an entity exists in a database via a stored procedure ...
2
votes
1answer
58 views

Checking if switch is checked and doing something with the data

How can I optimize this code? ...
8
votes
2answers
259 views

Instantiating a run-time implementation of an interface

Below is my code that was written for the following task (based on an SO question): Given a Java Collection (of N elements) create an ...
2
votes
1answer
33 views

Recognizing elements and doing event handling for repeating templates

This fiddle has an ADD button when you click it a Chat window is added. When there are more than 1 windows the message from one window is reflected across all the windows. Say you have templates (in ...
2
votes
2answers
25 views

Replacing an F# loop over a mutable variable by an immutable approach

Consider: let mutable m' = m while m' % i = 0L do m' <- m' / i I've refactored it into: ...
12
votes
3answers
907 views

How is my CMS design? Any security, design, or other issues?

I am trying to learn PHP in depth by creating this personal CMS. I try to utilize OOP concepts and do best I can... The way I am trying to design this CMS is to keep including 'modules' within a page ...
1
vote
0answers
15 views

Speed up projection of a bipartitie network for a big file using NetworkX and Pandas

I have a pretty big file (3 million lines) with each line being a person-to-event relationship. Ultimate, I want to project this bipartite network onto a single-mode, weighted, network, and write it ...
3
votes
1answer
26 views

Processes and Handling (Piping)

I basically have 3 processes which I loop through. The first process is encoding Video. It's actually 2 processes but they are connected, so I don't need to worry about how it handles the other one. ...
1
vote
0answers
24 views

Is the following code SOLID? [on hold]

I found the following code, which is used to write and parse CSV files, on the web. However, it seems it cannot handle the cases such as "|" delimited CSV file. Also does it violate any SOLID ...
6
votes
2answers
171 views

Blackjack game with classes instead of functions

To try out the concepts and tools I've been learning, I decided to write a Blackjack game. I wrote it entirely with functions, so it hasn't helped me at all with the concept I really lack ...

15 30 50 per page