All Questions

1
vote
0answers
4 views

Ruby script to create git repos

I make my first ruby script (It creates a local and remote repo for git, by this tutorial: http://blog.shvetsov.com/2013/04/using-git-with-dropbox.html). I have been working for about 3 years with ...
2
votes
1answer
10 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
13 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
7 views

Bash Script for reviewing articles (pdf)

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? ...
5
votes
1answer
21 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 ...
1
vote
1answer
33 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
17 views

Email ticket system

How better to refactor nested if-blocks? ...
1
vote
0answers
26 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
10 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 ...
0
votes
0answers
12 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
13 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. ...
3
votes
0answers
22 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 ...
0
votes
0answers
24 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
12 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
16 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 ...
7
votes
3answers
164 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
12 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
24 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
23 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 ...
1
vote
1answer
26 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
13 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
29 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
28 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
13 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
30 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
22 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 ...
4
votes
0answers
28 views

A reversed-string Trie data structure

This is a simple Trie data structure for strings, except it puts the strings into the structure backwards. The insert method simply iterates over chars from the string-to-be-inserted backwards, and ...
6
votes
1answer
62 views

Excel VBA binary search class module [on hold]

I have a long list of sorted strings in a Workbook, and I have to find a lot of values in it. I was hoping to build a binary search Class Module that will find them for me faster than Excel's built-in ...
6
votes
2answers
23 views

Checking and updating lines in a file

I am trying to check a bunch of files that should have a leading | delimiter but sometimes don't. If the first line doesn't have the ...
0
votes
0answers
14 views

Python - call all methods of a class [on hold]

I'm wondering if my design is flawed or if I'm thinking this incorrectly: I have a class Lexer that has a number of methods. All methods are ...
0
votes
2answers
2 views

How would I go about simplifying this code?

I have to calculate the premium from a rate chart based on a person's age and the amount of insurance they request. I started out using if/switch statements, but the code is getting too long and seems ...
0
votes
3answers
3 views

How to This Make JavaScript Switch Statement More Succint

The following script uses a switch statement to determine the numeric month based on the actual month. Is there a more succinct way (read: elegant, or less time to write) to accomplish the same ...
6
votes
0answers
25 views

(Yet Another) Conway's Game of Life in Haskell (Naive)

I code Haskell as a hobbyist. I'm interested in feedback on my naive implementation of Conway's Game of Life. Specifically, as stated in the Quick Tour of the website, I am interested in: Best ...
2
votes
1answer
49 views

Node2D and Node3D classes implemented using a shared decorator

I have the following classes. validator is a decorator that receives a class which defines validation criteria for a decorated function. ...
2
votes
1answer
37 views

Simplifying WebView

I started to code on Android, but I think my code is very heavy and may slow down the performance of my app. For example, when I run my app and I try to drag the page in one of my webviews, it's ...
3
votes
1answer
24 views

Compute adjacent days from date string

I'm trying to do some datetime processing. The input is a string of the form 20141005 ('%Y%m%d') and I want to return a data ...
4
votes
2answers
42 views

Formatting checks against a session

This is the current code that gets put into a option box, is there a way to make this code more efficient and use less code ...
3
votes
1answer
24 views

Hide content unless an array contains at least one non-empty string

I have an array of hints. Sometimes, this array could contain an empty string. Occasionally, the array might contain only empty strings, in which case I want the whole block to be skipped. This is ...
4
votes
2answers
411 views

Project Euler Problem 1 - Functional approach?

I'm trying to learn F# right now coming from C# and I'm finding it a great difficulty to "reconfigure" my mind to the functional programming mindset. So I'm going to attempt a few Project Euler ...
7
votes
5answers
339 views

Python odd number diamond

I worked up a quick diamond program that takes only odd numbers while returning an error with even numbers or 0. The code looks rather ugly to me, especially with the recurring ...
1
vote
0answers
12 views

Transfer Python data structures through ssh

I need to communicate between 2 machines through ssh to do some processing on one of the machines, and at the end, transfer the output to the first machine. Given ...
14
votes
5answers
939 views

Beginner number guessing game in Java

I am a first year CS student. We are currently learning Java and my latest assignment was to create this random number game. I am hoping to get some feedback on code style etc so that I know what not ...
2
votes
3answers
245 views

For a query over multiple databases, is it faster to do GROUP BY first or UNION first?

Having several databases with the same table, I need to group the union of the records. The xTables are stored in separate databases named by the year (this is by ...
-1
votes
0answers
9 views

Logic problem, 2nd zoom and every zoom after that flips y-axis, JavaScript [on hold]

See the full code at http://jsfiddle.net/6h82nro7/ -- the HTML code kept displaying as HTML tags and hiding itself, even when I indented four spaces to mark it as code. Anyway, it's not important. ...
3
votes
0answers
25 views

Grayscale bilinear patch extraction - SSE optimization

My program makes an intensive use of small sub-images extracted using bilinear interpolation from larger grayscale images (some call this problem subpixel translation). I am using the following c++ ...

15 30 50 per page