0
votes
0answers
16 views

Checking if a value falls between values that contain letters and numbers [on hold]

I am wondering how I should have programmed this, specifically the part of the question that says "Note that the range for R1-1 - R10H encompasses R1-1 to R9-9 and R1A to R10H." - I am not sure of how ...
4
votes
2answers
17 views

PHP Session Wrapper Class

I recently worked on a system for the company I work for and would love some feedback on the following class for managing sessions. I don't claim to be a PHP guru but I like to think I gave it a try! ...
1
vote
2answers
25 views

Find sum of number of times that each character of source occurs in the target

I wrote the following code in response to this question "find sum of number of times that each character of source occurs in the target", is there any better solution for it? Analysis ...
2
votes
1answer
32 views

Read CSV with 3 columns and group some elements

I have a csv with 3 columns (date, name, number) and it is about 20K rows long. I want to create a dictionary keyed by date whose value is a dictionary of ...
2
votes
2answers
45 views

Find number of times that difference of array values are equals to the number?

I wrote the following code to answer "find number of times that difference of array values are equals to the provided number", but I am wondering if there is any better approach. For example If ...
3
votes
0answers
38 views

Searching a Word Document from Excel - v2.0

My first question: Searching a Word Document from Excel Since then I have implemented most of the suggestions by @RubberDuck and @Comintern. I have also added functionality for different-sized ...
0
votes
0answers
7 views

PHP: Better way to replace string value in an array with an array? [on hold]

I'm new to PHP so I'm not sure how to optimize this code. I execute a Python script from PHP and the $output variable returned is an array of arrays. ...
1
vote
0answers
9 views

How to best structure code that shells out to an external script?

This code that shells out to an external script to return some things to its caller is a bit strange to me, but I can't put my finger on what seems weird about it. Input welcome, praise and critique. ...
3
votes
1answer
20 views

Function to count rows in a database query result

I have written this function that surprisingly works. (I didn't really know what I was doing; just a little experiment.) It is supposed to count rows selected by a PDO query. Is it well written? It ...
1
vote
1answer
23 views

HeapSort Efficiency

For heap (array based) sort, we need to start at index 1, ignoring the 0th index. If I want to make a static function like ...
5
votes
1answer
26 views

Array-like container for uints shorter than 8 bits (Rev 1)

This is a follow-up to Array-like container for uints shorter than 8 bits In short: The PackedBitfieldArray should be a kind of container for packed (unsigned) ...
2
votes
0answers
18 views

Binary Search in Ruby

I want to write a search that raises an error if the list supplied is not sorted. ...
0
votes
0answers
4 views

Apply Integration of dirac function for matlab code

I am try to implement a algorithm that here. For explain that algorithm. I already explain at mathematic. And now, I do it by myself. The main problem is that I want to implement the formula (7) in ...
5
votes
3answers
198 views

Time to Next Departure

I am trying to find out how many minutes that are remaining until the next train will departure, based on the current system time in Java. I am so far not familiar with the many aspects of Java, but ...
3
votes
1answer
23 views

Unit testing a servlet in a meaningful way

I have to write a unit test for the method processRequest in the servlet below and I'm wondering if: It just shouldn't be done. The class should be rewritten / ...
1
vote
1answer
22 views

Autocomplete Trie Optimization

I'm currently playing with the Typeahead problem on Talentbuddy. There are already 2 questions on this subject (Typeahead Talent Buddy and Typeahead autocomplete functionality challenge), but none of ...
3
votes
2answers
158 views

Returning status codes from business layer

This is what I've been doing so far in my business layer to return error messages to the user. ...
8
votes
3answers
254 views

Singleton Database wrapper

Before everybody yells at me about why I wrote a PDO wrapper class, it's to avoid writing try/catch, ...
2
votes
1answer
26 views

User entity of my domain v2

I would appreciate a thorough review of my updated User entity class. It's still an anemic domain model, but behavior (like ...
4
votes
3answers
90 views

Squaring all integers in an array [on hold]

I have a function that takes array and replaces all integer elements with their square: ...
0
votes
1answer
17 views

Loop through post and use in query

so i'm using a foreach loop to loop through a form i've send with javascript. In this loop I use the keys(input fields names) and values(input values) and use them to build my query, I still check for ...
3
votes
3answers
287 views

Parsing and formatting a time two ways (perfectionistic approach)

I'm still not satisfied by the readability of the code. The wanted behavior which would be self descriptive would sound like: "I've two fields; one is for the date and one for the hour. This two ...
-5
votes
0answers
34 views

Look for reviewers for C++11 project [on hold]

I began on opensource C++ project which aims to provides few libraries: logging files/folders management date/time utilities events resource files management cryptography I need feedbacks and ...
1
vote
1answer
15 views

Weighting mysql full-text search results by date

I'm using innodb full-text search to return a set of results where the newest posts are more relevant. Just wanted to check that this the best method: ...
1
vote
1answer
66 views

Repurposing UITableView infinite scroll configuration/properties

Had my first go at implementing infinite scrolling for UITableView's in my iOS app last night, and I noticed I ended up copying/pasting quite a bit of boilerplate from one VC to the next (if I wanted ...
3
votes
2answers
62 views

If Elif replacement for expandability

I am having the following problem. My code works, but it seems like it can improve a lot. I am fairly new to python and can't seem to get this block any better. The logic behind it goes like this. I ...
16
votes
2answers
882 views

Android Flashlight app

This is my first project, a Flashlight application for Android-based devices: ...
0
votes
0answers
4 views

Future proofing fluent-method-chained-DSL test code [migrated]

The current design is a pair of thin fluent-method-chained-DSLs that mix the "traditional" and "enhanced" builder patterns. That's just a fancy way to say some chained methods are optional and not ...
2
votes
2answers
100 views

Is SList class an ADT?

I call the SList class an Abstract Data Type because it satisfies following 6 invariants: Multiple users of SList class should ...
5
votes
2answers
45 views

Automagic testing framework for VBA

Building on @RubberDuck's recommendations, I now have something I find... beautiful. I'm sure there's a couple of things left to polish - this site is about making great code out of good any code, ...
3
votes
0answers
85 views

To subclass or to wrap for “default” implementation? [migrated]

I'm creating a toolset in Java consisting of many Natural Language Processing (NLP) tools, such as Tokenizer, POS tagger, Lemmatizer, Sentence parsing, etc. I want to put all good and publicly ...
1
vote
2answers
38 views

Putting all desktop items into a new folder

I'm quite a newbie with Python, but I wanted to try my own little project, so I made a small script that puts all the desktop icons/folders into a newly created folder (called "Desktop1") if there are ...
5
votes
1answer
53 views

JavaScript path parsing

I was attempting to do some contribution to the underscore-contrib library, and I ended up writing a function that will parse a JavaScript path to later on expose through an API if the path exists or ...
-2
votes
0answers
27 views

Why is my random not getting the last character? [on hold]

I am trying to create a console application which is basically a very simple version of a security measure used by some websites and banks etc. The user will have declared a "Secret Word", after ...
-4
votes
0answers
15 views

producing pseudo code of excessive number, proper position divisor, defect number, and prefect number [on hold]

Excessive number when the sum of factors of a number is greater than the a number, that number is called an excessive number Proper position divisor factor of ...
1
vote
0answers
11 views

Run length encoding of vectors in MATLAB: looped version and vectorized version

A project I'm working on requires something akin to run length encoding on a vector in matlab. The data is in the form of a numeric vector, and the output is in the form of two vectors, ...
3
votes
1answer
50 views

Implementing a genetic algorithm to solve knapsack

I am trying to develop a genetic algorithm to solve knapsack problem(0-1). I am new to algorithm and programming as well. Here is my code and it works but I would like to know your suggestions of how ...
3
votes
1answer
30 views

Optimizing gulpfile.js

I'm fairly new to JavaScript and Gulp. I was following this article for creating my gulpfile, trying to follow best practices, but it seems to me that this peace of code can be optimized and written ...
5
votes
1answer
37 views

JS Progress Bar Widget

Demo of the widget: http://jsfiddle.net/slicedtoad/Lywvbsf4/ It's a progress bar that shows a list of steps and which one is being completed as well as allowing previous steps to be revisited. It ...
1
vote
0answers
15 views

Clojure Tic Tac Toe solver

I am going through the 4clojure problems and I currently just solved the Tic Tac Toe analyzer: ...
1
vote
0answers
36 views

Diving into PHP's MVC - the application's core

I recently started programming in php using the mvc-pattern, which resulted in one of best choices, I did so far, but I read through many articles showing "easy" examples and some of them were quite ...
5
votes
2answers
254 views

Parallel “wget” in Java

Purpose: write Java program that downloads a list of URLs specified on commandline in parallel (simultaneously), reporting download completion every second. My solution follows below, please point ...
12
votes
2answers
417 views

Lexer+Parser code for my “Reedoo” programming language

I've been working on my own programming language, as a hobby for the past couple of months now, called Reedoo. It is implemented in pure C++ 11 and uses only the libraries that come with C++; no ...
9
votes
3answers
87 views

VBA Python-like List Class

VBA's Collection class is lacking so I created a basic List class using Python's as a template. This could make future derived ...
5
votes
1answer
58 views

Lightweight Tic-Tac-Toe in Python

This is a completely functional python script of the Tic-Tac-Toe game. I've used python's set container for almost all data structure and operation. The code is ...
11
votes
1answer
538 views

Rewrite code from Objective-C to conform with Swift power tools and concise style

I started a project with Objective-C and rewrote it with Swift. The project contains two UITableViewControllers: MasterViewController and DetailViewController. ...
0
votes
1answer
23 views

Improving Watir::Browser for my needs

I want to: use Watir::Browser methods without browser. instance prefix expand abilities of ...
1
vote
1answer
70 views

Performance in Hackerrank challenge “Sherlock and Queries”

I translated the solution by the author to his challenge from C++ to Python. It seems to be correct, but I get timeouts for the test cases 6, 9 and 12. Here is the full challenge description: ...
3
votes
1answer
59 views

Creation of a temp file on Windows

I implemented a test that reads data from temp file on Windows. I originally had an issue that I solved with the help of this answer ...

15 30 50 per page