All Questions

1
vote
0answers
14 views

Factory pattern with controls

I've created factory to create WPF controls. I have string with control name and I map it to enum. I think it's bad implementation of factory pattern. So please show me where I've made mistake. Main ...
7
votes
0answers
38 views

Ultimate Tic-Tac-Toe with AI and GUI

During my hiatus, I decided to revisit some of the Tic-Tac-Toe questions here. I created a simple Tic-Tac-Toe GUI game, and then thought, might as well do the Ultimate Tic-Tac-Toe challenge. I am ...
0
votes
0answers
9 views

How can I make this regex less greedy? [on hold]

Given: [URL="http://www.google.com"]test[/URL] [URL="http://www.foogle.com"]test[/URL] I'd like to match the entire string including [URL][/URL], the link, and ...
2
votes
2answers
96 views

Calculate employee wage

This is for a class assignment. The objective is to write a program that will take in user input for employee information and print the wage based on hours worked. Please review my code. ...
4
votes
0answers
26 views

Simple micro-benchmarking library

I'm working on a simple micro-benchmarking library in Java. This library makes it easy to benchmark multiple reference implementations. You provide the inputs and trigger the calls, the library takes ...
3
votes
1answer
24 views

An owned file descriptor

File descriptors are a common resource in Unix and Unix-like operating systems. They're a way to represent a resource such as a file, socket and so on. The user should release a file descriptor as ...
1
vote
0answers
22 views

Newton Color Disc [on hold]

I'm trying to create a working example of Newton Color Disc with HTML, CSS Animations, jQuery and RaphaëlJS. I was successful in creating the demo by making the sectors of different colors and ...
2
votes
1answer
11 views

jQuery-Keyframes allows dynamic generation of CSS3 keyframes with callback events

I want to learn best practices for structuring these kinds of small jquery plugin libraries. I believe I am using a bad design pattern and what I was going for is fewest line numbers and minimal code. ...
2
votes
2answers
43 views

Optimizing name highlighting

I have created a set of functions, that when given a struct of structs full of names, it will highlight those names that appear in a body of HTML based text. Is this the best method of doing this? ...
0
votes
2answers
37 views

Is this index selection useless? [on hold]

I'm reviewing some code and I came across this: ...
5
votes
2answers
233 views

Human anatomy quiz

My code works fine. I just want to have your insight and opinions about the way I did it. For example, is it easy to maintain? Does it have good architecture and design? ...
3
votes
1answer
23 views

MinHeap implementation

Please comment on this. ...
5
votes
0answers
35 views

Python package for handwriting recognition

I am currently writing my bachelor's thesis about on-line handwriting recognition. This is not OCR, because I have the information how a symbol is written as a list of pen trajectory coordinates (x, ...
0
votes
0answers
13 views

Chess in C: Negamax implementation works but sometimes doesn't spot mates in 1 [migrated]

I implemented negamax with alpha beta pruning and quiscence search and it seems like it works... except for sometimes the computer lets me mate in 1, even though there were moves that it could've done ...
0
votes
0answers
13 views

How to set aria-hidden attribute on JQuery Show/Hide functions [on hold]

I need to change(set if not exist) aria-hidden attribute when call JQuery Show()/Hide() finctions. This is showHide function from JQuery 1.9.1 I added only 2 lines of code: ...
1
vote
2answers
30 views

Simple interface and class for holding text to be analyzed

I am making a sentiment analysis library targeted first at social media text (like Twitter) and then I will expand it for more general use. For the first step I am making a simple interface and a ...
1
vote
2answers
49 views

Type determined return values

I have the following js code: ...
0
votes
0answers
23 views

OOP style and lexing

I'm not entirely clear how to do OOP cleanly. I have a Lexer class with a bunch of methods to retrieve different parts of a file, and some other helper methods. ...
2
votes
1answer
41 views

Validating email addresses and phone numbers

I have following code and I need need help refactoring: Validation class for objects you may create: Email address URL Norwegian Mobile Number (must start with 4, 9 or 59 and be 8 digits long) ...
4
votes
1answer
31 views

Ruby script to create git repos

I wrote my first ruby script, by this tutorial. It creates a local and remote git repo. I have been working for about 3 years with PHP, and somehow I find that my ruby script looks incredibly ugly. ...
2
votes
2answers
37 views

Parse a value to a given datatype

For our (internal) automated test project, I am writing a part where parameters can be passed to an SSIS Package before it gets executed. The tester delivers the parameter name, value and desired ...
0
votes
0answers
14 views

Changing the text of a button depending on the visibility of a table [migrated]

I'm trying to change the text of a button when a table is visible or not with jquery. The problem is that jquery .is(":visible") don't appear to do it. ¿What I'm doing wrong? I supposed that ...
1
vote
1answer
13 views

Bash script for reviewing .pdf articles

I wrote a bash script for reviewing scientific articles. It adds a blank page for notes and creates a new landscape file. I'm sure it can be made better code wise. Any suggestions? ...
7
votes
2answers
230 views

Custom matrix class

It took me while to finish, but here is my custom matrix class. I assume that the row/column iterators are the most critical part of this class but anyway I would very much appreciate your ideas of ...
2
votes
3answers
61 views

Is usage of friend class appropriate in this case?

I want to have a class that stores data from an input file, for use in a simulation program. It is like a struct but may require some small functions for accessors. A seperate class reads all the ...
1
vote
0answers
31 views

Email ticket system

How better to refactor nested if-blocks? ...
6
votes
1answer
94 views

Does this simulation follow abstraction and encapsulation?

This below code implements a simulation of an ocean(as 2d-array of cells) which currently have Shark, fish or be Empty. User can run this simulation, as shown below: ...
-1
votes
0answers
12 views

Writing wrapper function and handling exceptions correctly in Python [on hold]

I am writing test scripts using Selenium Webdriver and I have created a simple framework for tests step-by-step execution. My goal was to improve the readability of the code as well as the logic of ...
2
votes
1answer
33 views

Monkey patching angularjs controllers to have instance functions with injectables

In the spirit of Google's angular.js Style Guide, I set out to define my angularjs controllers as classes, complete with instance functions. I ran into trouble, however, when trying to access ...
2
votes
0answers
18 views

Adding parent reference to tree nodes

I want to add a parent reference to a tree like structure. The structure can be seen in the first code snippet, which also is how I would use my code, for example inside an angular controller. ...
7
votes
0answers
38 views

The Stack Exchange Editor Toolkit

I recently joined this GitHub project based on a user script that offers a powerful editing tool to Stack Exchange Editors. My Goal: In the past few days, I've spent many hours improving the ...
-1
votes
0answers
41 views

how to only allow 3 values in a “if” and “while” statement to allow the loop to exit [on hold]

I'm just stuck on some logic statements. specifically the ones that are in the function char GetInteger() so how would I only allow 3 values to cause the loop to ...
-2
votes
0answers
14 views

python turtle graphics projectile is not working [on hold]

Trying to make my projectile increase/decrease velocity and increase/decrease angle based on the arrow keys. What am I doing wrong because I am not getting any errors but nothing moves except my space ...
-1
votes
0answers
11 views

How to get the difference of each product then get the difference from the total balance using javascript or jQuery [on hold]

I'm sorry but I'm still a newbie in javascript. I have this issue that I have to get each initial difference first (Blue section cash - user input value) add all of the total from each input/blue ...
3
votes
0answers
19 views

How could I make CMS better when comes to passing data between themes and the page settings?

I'm designing a small CMS with best practices I learned. I came to this conclusion when comes to including page content and themes to each page depending by user or whatever. But how could I make ...
8
votes
3answers
197 views

Red Black Tree Implementation

I would like some feedback on my red black tree implementation. Anything is fine. I've debugged this and it seems to be working fine, however I may have missed something. Basically, this is a red ...
0
votes
0answers
13 views

How to fix/optimize this calendar program? [Using Zeller's Congruence] [on hold]

I have this calendar program that I've finished but it's kind of long. Also, could someone tell me why I'm getting the wrong starting days even though I'm following a formula? Thanks. ...
4
votes
1answer
27 views

Get extension(s) from path

I'm writing an utility function that returns the extension(s) of a boost::filesystem::path (v3). Boost's path class already has some of this functionality ...
2
votes
0answers
9 views

Node js single mongodb connection

I want my entire node application to use one single mongodb connection, at least that's what I think is better. I wrote this little script and want some feedback on it. Especially if what I'm doing ...
5
votes
0answers
32 views

TestExplorerWindow, the event-tossing UI

Following up on Integrating Unit Testing functionality into an old COM-based IDE, I made quite a few changes to the UI, and now the code-behind for my ...
2
votes
1answer
44 views

Finding a sum of unique triplet that is close to a given number in an array

I asked one question on code review yesterday about my code style, logic and readability of code. Hence, today I kept all those suggestions in mind while solving a new problem question. The question ...
-1
votes
0answers
12 views
0
votes
1answer
17 views

Django ListView with MySQL query for the queryset

(Note: Even if you don't know Django, it's probably the query that needs work anyway, so you probably don't need to know Django/Python) I have a ListView that ...
5
votes
1answer
32 views

Parser for simple programming language

I'm writing a basic LL(1) parser in java, but my parser class is quickly getting out of hand and becoming huge. PMD even calls it a "God class" and says that it has "Too many methods." Is there a way ...
3
votes
1answer
31 views

Basic singlepage blog application

I've started learning Mithril framework, which looks pretty awesome. I've created a basic blog app and have a few questions about code style and structure. ...
0
votes
0answers
13 views

CSMR: Cosine Similarity with MapReduce [on hold]

I'm working on a project for Large-Scale Text Processing, and the code at the link bellow, is a first implementation of the basic idea of CSMR. CSMR is an algorithm that measures the similarity ...
2
votes
0answers
15 views

Find binary sequences with low peak sidelobe level of autocorrelation function

I would like to find all binary sequences from the specified range, which has low peak sidelobe level of its autocorrelation function. Here is solution (this is simplified version of the real code) ...
5
votes
0answers
31 views

Easy bitset IO v2

In a previous question I posted a method for easy std::bitset IO on a bit-for-bit basis. This question was later followed up in another solution. Both of these ...
4
votes
2answers
26 views

Chained hash table implementation

While reading a data structure book, I have implemented a chained hash table. I want to share the code with you and get your opinion about it. chained_hash_table.h ...
-4
votes
0answers
11 views

Need help making jQuery Transit transition repeat [on hold]

Here is my code: http://jsfiddle.net/de74ezo5/14/ So what I was trying to achieve here was to make the pink header collapse and stay fixed at the top of the page after scrolling past the top red ...

15 30 50 per page