All Questions

1
vote
0answers
4 views

Poker hand identifier

Inspired by this post (along with a number of other people by the looks of it), I created a poker hand identifier with a very similar format. Note that the syntax of the hands is a little different to ...
1
vote
1answer
15 views

Haskell function to explode a list

I've written the following explode function using break. The intended behavior is, that a list is divided into sublists by a predicate function, i.e. those elements which match the predicate are the ...
0
votes
0answers
10 views

BigDecimal code critique

I'm teaching myself BigDecimal and would appreciate a critique. In the code fragment below, I calculate a tip from user input: check and tip percentage (entered as integer): txt_check = ...
0
votes
1answer
10 views

2vs2 Poker Hand One Pair Winner Algorithm

I wrote this algorithm to determine the winning hand of two players going head to head with a hand of One Pair. Note that the hand is sorted once it is given out, and the algorithm has to compare the ...
1
vote
1answer
30 views

Database table with a single row - bad idea?

I have a "virtual scratchpad" Rails app that has pages (analogous to a piece of scratch paper), and each page has_many :notes (analogous to the notes that you'd write on that paper). I want to count ...
1
vote
1answer
34 views

Ruby code refactoring

I have n-times similar statements if trigger_data.tt_closed unless trouble_ticket.changes.key?(:status) @run = 0 break end unless ...
0
votes
0answers
36 views

Java - Object declaration out of while loop

Could you explain to me which code is better (more optimal) and why? Vesion 1: while(something){ Runnable task = (Runnable) taskQueue.dequeue(); Throwable ex = null; ... } Version 2: Runnable ...
1
vote
1answer
27 views

Improving the Controller Module of an MVC - How to?

The code below is for modern browsers only. The current structure uses two module patterns Cin and Cout. As the controller handles all (in)coming and (out)going requests to the user, this made most ...
0
votes
0answers
19 views

my first gem as a newbie rubyist

Good sunny afternoon, I have made my first gem! Hooraah, it is very simple and fuses httparty gem with ebay xml api to get categories from ebay. The api keys etc are loaded from ENV variables. ...
0
votes
0answers
16 views

MVC - Is the “current connected user” an information that should be shared with the domain?

I'm working right now in a readers social network. The main points are this: When an user connects with his account I save his user id in the session variable. My MVC is working with DTO's all the ...
2
votes
0answers
29 views

Is Nesting Grids a Good Idea?

I find myself nesting alot of grids inside grids in WPF. I just found myself 3 Grids deep, and stopped to think: "Should I be doing this?" Is there some kind of performance cost? Is it unmaintainable? ...
0
votes
0answers
11 views

Core Data - Data Model Design - Bidirectional Ordered To-Many Relationships - Reduce Complexity and Reveal Intent

I a Core Data model two entities Video and Playlist. A Video can be a member of many Playlists A Playlist can have many Videos, including the same Video multiple times A Playlist's Videos are ...
0
votes
0answers
17 views

Stream data from DataReader to the OutputStream in ASP.NET Web API [migrated]

Consider the following code from SomeApiController: public IEnumerable<string[]> Get() { using (var conn = new SqlConnection(asyncConnString)) using (var cmd = conn.CreateCommand()) ...
0
votes
3answers
22 views

JSLint says “unexpected function” doCalc, also please help refactor

See the full calculator with HTML -> https://gist.github.com/1861120 You should be able to drag that html file from github into a browser and start using it. I'm only putting the js below. The ...
0
votes
0answers
8 views

How to Decouple a Custom ListCellFactory From Controller?

I'm writing a UI with JavaFX 2.1. It looks like this: So far so good. For the right list I have some custom elements- questions I want the user to answer. It's a string with three Comboboxes that ...

15 30 50 per page
1 2 3 4 5 258