1,262 reputation
613
bio website localhost
location United States
age 26
visits member for 3 years, 5 months
seen 17 mins ago

SUNY Buffalo 2010


Jul
24
comment Word for when variables are not null? Naming a method
I've not heard another name other than non-null. Also, is what you are implementing !(var1 == null ^ var2 == null)? If so it might be hard to come up with a name that's shorter than the code. Perhaps !isExactlyOneNull(var1, var2)
Jul
1
comment Should I be using a composite key for this table?
If I'm reading your schema correctly, it is different than what I would think to make. I would think you would have tables Word(word_id, word), Ryhme(rhyme_id, sound), and RhymeWord(word_id, rhyme_id). The RhymeWord key can then be a composite of the word_id and rhyme_id. The problem with how you set it up is how do you know that bat rhymes with fat without entering a bunch of "duplicate" data or writing the bat-fat query differently than the cat-bat query.
Jun
14
comment Looking to simulate the rolling of a ball around a roulette wheel, while the resulting number is already known
In line with my previous comment where the idea is to calculate the final time/position of the ball and then afterwards manipulate the wheel so that the number you want meets it at the same time. Previously I suggested delaying the release of the ball to accomplish this. Another possibility is not delaying the release of the ball, but instead determine the appropriate deceleration of the wheel to make the number meet the ball.
Jun
14
comment Looking to simulate the rolling of a ball around a roulette wheel, while the resulting number is already known
Is delaying the release of the ball an option? If so, given any wheel speed and ball starting position/velocity you could run the simulation ahead of time to know which fixed time and position the ball would fall. Then it's just a matter of delaying the release of the ball until the number you want will be in the position you want when the ball actually falls which would be an easy calculation. At most the time you would have to wait for the wheel to make 1 rotation at it's initial speed.
Jun
4
comment Tail-recursive implementation of take-while
I'm going to agree that this should not be possible. With the other conditions, I think using reverse is the best you can do since it is big-o linear time and memory (proportional to the prefix which is the best you can do). Also since you're not producing a lazy sequence, the call to reverse is not making something eager which otherwise wouldn't have been.
May
28
revised Should data structures be integrated into the language (as in Python) or be provided in the standard library (as in Java)?
deleted 94 characters in body
Apr
30
comment Finding all subsets of a set running time
What does it mean to "Generate the subsets"? You could create a 'lazy sequence' of the subsets in constant time, however anything that iterates over all the subsets in any way must be at least O(2^n) because it involves iterating over O(2^n) sets. Generating possibly the most efficient representation of the sets (an integer of n bits where each bit represents the presence or absence of the nth item of the set) still requires you to generate O(2^n) integers.
Apr
28
revised Finding all subsets of a set running time
added 340 characters in body
Apr
28
answered Finding all subsets of a set running time
Apr
13
revised Evaluation order of expressions in Clojure?
added 518 characters in body
Apr
13
answered Evaluation order of expressions in Clojure?
Apr
9
answered how to design a stack without using java library or using list
Mar
2
awarded  Yearling
Feb
16
awarded  Good Answer
Feb
14
comment Why lifting of binary function into the list monads goes over all the element combinations?
One of the reasons I liked learn you a haskell was that it gives so many examples of implementing different classes. He usually shows Maybe, Either, List and IO. I also just edited the code so you can see that you don't need to limit yourself to naming that function cartesianProd because it also acts like dotProduct or even functions I don't have names for if you use it for other types.
Feb
14
revised Why lifting of binary function into the list monads goes over all the element combinations?
added 45 characters in body
Feb
14
revised Why lifting of binary function into the list monads goes over all the element combinations?
deleted 12 characters in body
Feb
14
answered Why lifting of binary function into the list monads goes over all the element combinations?
Feb
2
answered When to store Date/DateTime?
Jan
12
awarded  Enlightened