3
votes
0answers
9 views

Simple slideshow with jQuery

I've made a very simple slideshow that works by appending and prepending images (on click and every 3 seconds). This is my first time trying to use classes or objects so any help would be great. I ...
1
vote
1answer
14 views

Structural design of a Date and Time classes

I have two classes named Date.class and an enum class Time. I have declared these class like ...
3
votes
0answers
10 views

Correctly rewriting Japanese verb conjugator in modular JS

For my first use of javascript I've made an app that takes an input verb from html in Japanese and outputs it in to many conjugated (manipulated) forms. Essentially, it defines an alphabet, some ...
1
vote
1answer
17 views

Form data handler class

I've started to write a form data handler class in PHP. Can you please review it and point out any mistakes or logic errors, or perhaps if a method can be written in a better way? ...
2
votes
1answer
12 views

Styling and activating radio buttons on condition

I have some php code to style a button and activate it, when a specific variable is true. It's actually a radio button, styled with the bootstrap to a button. As you can see below, this is how it ...
1
vote
1answer
20 views

Perl script to handle include files

I am trying to extend the JSON format (for private use) to include an include statement. This could be used to include other ...
1
vote
0answers
19 views

A function to convert FASTA .txt to a dictionary

I'd like feedback on my function to convert FASTA data to a dictionary in Python. Here's an example of FASTA text: ...
0
votes
0answers
8 views

Unit Testing of Curl based Rest Client Library

https://github.com/andrewjwolf/payjunction-php I ran into some issues with unit testing in that getting the response body etc from the curl handle was tricky. I didn't want to necessarily use a mock ...
0
votes
0answers
18 views

Conversion of CRC function from C to C# yields inconsistencies [on hold]

I posted this question on Stack Overflow and was advised that it is best suited to this site. I'm trying to convert a couple of simple CRC calculating functions from ...
1
vote
1answer
12 views

Should this Method be in TableViewCell or ViewController?

I have a custom tableview cell for displaying different foods, with a star next to each name. If the food has been favorited (i.e., it exists in the database), the star is filled in, otherwise it is ...
4
votes
5answers
140 views

Refactoring String manipulating method with TDD

I'd like to refactor my extractSimplePromptName test so it does the same but it's "prettier", hence less code. As far as looking at it, it seems like it could be ...
0
votes
0answers
7 views

Java method for executing any type of hql

i have written two methods in java that executes any type of hql and returns data. Methods are like ...
2
votes
2answers
42 views

Simple class, solely for setting “globals”

I'm aiming for the best and simplest way to access "global" variables set in the config file for my website. So I can use them anywhere, even inside functions It's for file versioning, and I use ...
0
votes
0answers
13 views

Managing lifecycle of entities [on hold]

I'm trying to find best structure for managing lifecycle of my entities. Let's say we have classes Component, Parameter and ...
7
votes
4answers
706 views

How to remove code smell from Room Booking code?

I am new with coding and I recently read an article about code refactoring, so I have made a console application for booking rooms on a ship. I need help with code refactoring. As far as I understand ...
5
votes
4answers
236 views

Too-high / too-low guessing game in Swing

I have created this program and it works fine. It's just that its too wonky and huge so I was wondering if anyone knew how I could shorten the program so I didn't have to put all of these into each ...
-1
votes
0answers
15 views

c++ zero on a button [on hold]

I am asked to restrict a button on a program. By using another restricted one, I added a few lines and restricted it. But one of lines was adding 0 for when we have nothing on the button. When we ...
6
votes
3answers
156 views

Partitioning a list to a list of smaller lists

I created a utility method ListUtils.partition(iterable, size) to partition a potentially large list to a list of smaller lists: ...
1
vote
2answers
21 views

How can I optimize a particle filter weighted selection step?

I have a vector with 10000 particles that I use in a Particle Filter. The problem is it's taking too long to compute the weighted selection of the particles. Is there anyway I can optimize this? ...
2
votes
2answers
105 views

HackerRank “Manasa and Stones” in Python

Problem Statement: Manasa is out on a hike with friends. She finds a trail of stones with numbers on them. She starts following the trail and notices that two consecutive stones have a difference ...
4
votes
2answers
271 views

HackerRank “Service Lane” in Python

Problem statement: Calvin is driving his favorite vehicle on the 101 freeway. He notices that the check engine light of his vehicle is on, and he wants to service it immediately to avoid any ...
3
votes
1answer
15 views

Update only specific field of specific item (data) in List from YAML

I don't like the logic to update [Repository] list here because I need to map whole list to change only specific field of specific node, I especially don't like ...
2
votes
0answers
15 views

JavaScript function that toggles element class according checked radio input V2.0

This question is about an improvement of the code from this previous question (previous changed visibility, new applies a css class with a border). It is a constructor function that attaches a click ...
3
votes
0answers
22 views

Writing a faster mutable trie

I am implementing a mutable trie. I tested and it produces correct results. However, it is very slow. I benchmark it against plain old Data.Map, which is more than ...
3
votes
0answers
16 views

Zeckendorf numbers the Clojure way

I'm just getting into Clojure, and I wanted to make sure I am writing code the "Clojure way". The challenge I took on is Zeckendorf numbers (fairly trivial). ...
4
votes
1answer
25 views

Safe Reverse Polish Notation

I implemented the following (what I believe to be) safe Reverse Polish Calculator. Now I'm using foldM to take advantage of the power of Monads. Previously, I was ...
4
votes
1answer
25 views

Determine maximum window bounds

Preamble: the default frame positioning with Swing JFrames has always bothered me. Eventually I wrote some code to calculate my available desktop space, not ...
3
votes
1answer
17 views

Parsing Valve Key-Value files

Introduction Valve recently launched the Dota 2 Workshop Tools, which allows players to create their own maps with custom gamemodes, similar to Warcraft 3 in capabilities. Ability and unit ...
6
votes
1answer
40 views

Updating the UI with a timer - code intended to help teach

I thought it would be helpful to put together an example of what I'm talking about in the second part of my answer to this stackoverflow question. The idea is that there's some data that is updated ...
3
votes
0answers
16 views

Simple JavaScript Backbone.Js tool to highlight multiple search terms

I wrote a simple JavaScript tool to highlight multiple keywords at the same time in some text. It uses different color for each keyword, and also shows the count of matches. I'm using Backbone.js ...
2
votes
1answer
16 views

Clicking child view and preventing parent view from running dblclick event

I have a parent view which has a dblclick event handler bound to it. I also have a view which is a descendant of the parent. This child view has a click event handler bound to it. Currently, my code ...
4
votes
1answer
23 views

Object.extends in JS

I built an easy inheritance implementation for js that works similar to other OO languages and wanted some feedback on it. This works perfectly how I'd like it to, but I've read a lot of varying ...
5
votes
1answer
28 views

Animated magazine

How can I write this code better? I'm doing an animated magazine, so I run and then clean the animation per page. ...
1
vote
1answer
25 views

Django project structure and settings configuration

I'm new to Django but after some googling and reading blogs I found that I should follow this kind of structure (I compiled 2-3 suggested structure and this is what I came with): ...
10
votes
2answers
209 views

Super sophisticated game information web application

Considering I've got an exam on Spring tomorrow, I figured you could review a small example application I whipped together as preparation (and as such, I'd prefer the emphasis to be on Spring-related ...
0
votes
0answers
33 views

Is this code malicious? [on hold]

I'm working on a website and recently picked someone up to work on the php portion and I have had suspicions that he may have added malicious code to the site, he pushed a bit of php without ...
4
votes
1answer
23 views

Model class for networking that uses notifications

I just finished a model class that represents an Instagram Networking client for my iOS app. I am specifically looking for a review of my use of static constants. These are strings that represent ...
5
votes
0answers
48 views

Topological Sort and Graphing in Python 3

I wrote a program for DFS traversal, topological sort, find all vertices, and has_cycle methods. Can you please suggest more elegant and eloquent ways for this program? (Perhaps better ways to ...
2
votes
0answers
17 views

Heterogenous tree in the application domain: How do I represent them?

The Domain I have three types of items in my domain: ItemA, ItemB, ItemC. (I can't use their real names.) ItemA has one attribute: thing_id. ItemB has 6 attributes: thing_id, name, description, ...
4
votes
1answer
28 views

Admin section - Secure login and authentication

After a lot of back and forth on various sites, reading articles, watching videos etc i still can not figure out the best way to secure my admin section. The ...
3
votes
2answers
76 views

Similar statements need duplication removed

How would you refactor this? ExpensiveQuery must only run when necessary. ...
4
votes
1answer
33 views

Thin proxy class for hashables

I need some kind of thin wrapper object to mark dictionary keys, like: d = { Required('name'): str, Optional('age'): int, } And these wrappers should behave ...
4
votes
1answer
48 views
0
votes
0answers
28 views

Smooth way to avoid redundant cast when casting object type [on hold]

From the DB I'm getting a thingy of type Object. In order to use it, I need to cast it. According to the watch in VS, I can see what kind of true entity that hides inside it so I simply cast the ...
1
vote
0answers
17 views

Questions about style/ organization in Assembly [on hold]

This is my first venture into assembly, and I'd love a few pointers regarding organization/ style. This code takes an integer and prints the cube (I'm running it on Windows, via NASM), and while the ...
2
votes
3answers
120 views

How to best set default values? [on hold]

I recently got into a discussion about the best way to set a couple of default values. I created two sample blocks that would have the same results. The "isDefined" function is specifically for ...
4
votes
1answer
51 views

Restaurant system with javascript connecting to php

I'm making a web application for a restaurant kind of type. The idea is to administrate the orders and customers with the functions such as: Make a new order Delete a order View all the orders Make ...
-3
votes
0answers
17 views

Reset password number generator [on hold]

What am I missing? It it supposed to be a reset password number generator that sends a confirmation code to your phone. ...
-2
votes
0answers
13 views

Parse error: syntax error, unexpected '}' in /home/u506124311/public_html/process.php on line 38 [on hold]

Hi Guys im receiving the followin error when I'm trying to upload a picture from the process.php Parse error: syntax error, unexpected '}' in /home/u506124311/public_html/process.php on line 38 ...

15 30 50 per page