Unanswered Questions
28
votes
0answers
2k views
Why (or why not) are existential types considered bad practice in functional programming?
What are some techniques I might use to consistently refactor code removing the reliance on existential types? Typically these are used to disqualify undesired constructions of your type as well as to ...
9
votes
0answers
370 views
How to implement a branch-and-bound in a functional programming language?
I am trying to write a branch and bound search on the set of all functions f: D -> R, where the domain size is small (|D| ~ 20) and the range is much bigger (|R| ~ 2^20). Initially, I came up with the ...
7
votes
0answers
192 views
Using uniqueness types to implement safe parallelism
I've been interested in uniqueness types as an alternative to monads in pure functional languages for some time; unfortunately, this is kind of an esoteric area of CS research and online resources ...
7
votes
1answer
927 views
Useful design patterns for working with FragmentManager on Android
When working with fragments, I have been using a class composed of static methods that define actions on fragments. For any given project, I might have a class called FragmentActions, which contains ...
6
votes
0answers
218 views
Does the games industry use automated testing for visual parts of games/rendering? How?
Some parts of a game are easy to test in an automated way (logic, maths, input handling); but there's also a lot that's purely visual and not easily testable.
I would be surprised if the games ...
5
votes
0answers
77 views
+50
3d Packing algorithm for item's shipping
I've received a task to build a shipping estimative that suggests the best accomodation of goods on as few boxes as possible:
There is a finite set of known retangular box sizes
There are many ...
5
votes
1answer
697 views
Attachment handling for web application with Jackrabbit
I need to manage attachments on my Spring web application and I thought to use an open source repository.
My app it's a job approval system using J2EE / SPRING 3 Framework and Postgress DB to allow ...
4
votes
0answers
66 views
When we say a monad 'encapsulates a computation' - is this just saying 'wraps a functional transformation of data'?
When I think of the word 'computation' - my mind jumps to lambda calculus or operations on a state machine representing a CPU. It is quite a broad definition.
Now some people talk about monads as ...
4
votes
1answer
106 views
Is it possible to programmatically attach custom metadata to phone calls?
I'm trying to determine if it should be possible for a cell phone app to relay custom data along with a phone call. By "should be possible" I mean that I'm not trying to learn how to do it in ...
4
votes
0answers
101 views
How do browsers paint a render tree to the screen?
I'm interested in building a browser-like rendering engine. I understand a bit about how OpenGL and GUI toolkits work. But how do browsers actually put pixels on the screen? Are they like software ...
4
votes
6answers
160 views
Should I store x,y coordinates as an array, a class object, or two variables?
I have a MyObject which has an x and y coordinate.
as far as I can see, I can store it in three ways:
class MyObject:
def __init__(self, x, y):
self.x = x
self.y = y
class ...
4
votes
2answers
154 views
Reducing dependency cycles and reducing coupling
I'm trying to learn how to produce quality object-oriented code and have been studying concepts like SOLID. I'm currently working on an entity-component-process system for a small game engine.
...
4
votes
0answers
206 views
Why does the new ADT create a static inner class Fragment by default?
Honestly, I can't help but feel that this is done merely to confuse newcomers. Most of the errors on Stack Overflow by complete Android newbies mostly stem from that they have a static inner class ...
4
votes
0answers
135 views
How to represent hard-to-calculate “properties” of “objects” in functional code?
I have a polyline "class" in my Clojure program, which is represented by a vector of points. (It's not really a class or anything.)
The polyline's length (in the geometric sense) is something that is ...
4
votes
1answer
969 views
Design Pattern for Data Validation
What would be the best design pattern for this problem:
I have an Object A. Object A can either be registered or deleted from the database depending on the user request.
Data validation is performed ...