« first day (483 days earlier)      last day (3526 days later) » 

2:00 PM
If you type the at sign and start typing a name, you can push tab to auto-complete it.
 
can i get someone to create a 'stylus' tag for this question (dont have enough rep myself): codereview.stackexchange.com/questions/61438/…
while you are at it, can you kill the node.js and html5 tags? :-)
 
@nhgrif gotcha
 
@cimmanon Can you add some more description to the question to clarify what the question is about?
Simply putting "stylus" in the question title isn't enough for me to justify creating a stylus tag. I'm not sure we need a tag for stylus...
 
oh sorry. stylus is a css preprocessor, similar to sass and less. just not as popular as the other 2
 
I'm not asking you to tell me what it is in chat.
The question needs more detail.
 
2:04 PM
it isnt my question :-)
 
I see.
Well, if I create the tag, will you edit the Wiki to add information about it?
(Copy & paste from SO if it exists over there)
 
sure, i can do that
 
WHAT U PLAY?
[C]HEEZ [B]URGR [L]OL
Y U PLAY ZPOCK
MAH Y U CHEAT? I WINZ LOL
 
So... good job on Stylus making that language worse.
3
 
2:08 PM
isnt that sass?
 
No.
Please create the wiki for the tag. :/
 
i just did
 
Ok
 
thanks :-)
 
@nhgrif How on earth... is this even helpful?
I want to ban that idea from the world wide web right now.
2
 
2:11 PM
Exactly.
 
like i said, stylus isnt very popular ;-)
 
Like... we should be moving code in the opposite direction....
 
why stop there? let's blow up node.js while we are at it :p
 
WHAT U PLAY?
[C]HEEZ [B]URGR [L]OL
Y U PLAY LOL
MAH CHEEZ WINZ LOL
I think my rock-paper scissors works :)
 
Hey All.... @BrunoCosta too
 
2:15 PM
@rolfl hi
 
Sorry, been locating my wife's iPad.
2
And the last letter in my name is rolfl (a lower-case L not an i).
That will help you 'ping' me better ;-)
 
@nhgrif already stated that, I'm so sorry I always mess up with your nick
 
That's OK, it's actually my first name and last initial.
Rolf L.
Not exactly common.
I am tempted to rename my profile 'Monkey' to make things simpler for everyone.
2
 
@rolfl It's definitely starfood, but I can't star, because I cannot agree
 
0
A: Conditional initialization of objects

nhgrifGiven that Class2 is a subclass, we can declare the variable outside as a Class1 object: Class1 *object; if (a == b) { object = [[Class1 alloc] init]; } else { object = [[Class2 alloc] init]; } Now, in the current scope, the compiler will throw warnings if you try to call Class2 method...

 
2:18 PM
30 mins ago, by Bruno Costa
see @rolfl implementation and see what the problem is if you need 1.000.000 random numbers from a 0 to 1.000.000 range
I think your assumption here is common to a lot of answers on that question....
and that is why there is so much confusion.
 
@rolfl <--- ...is is really going to be that much simpler? What if I make my name 'Monkey'?
 
The Original code has a range, it is hard-coded as 0 .. Int32.MaxValue.
 
We have a lot of users beginning with M here already.
Only two with R
 
So, the many concerns people have about my solution having significant problems with 'limited range' input, are wrong ;-)
When people request a count approaching 1billion numbers (or > 4GB memory), then, my solution will be about 25% slower than O(n).
 
@rolfl It's about how many element's we want ot take from the collection, I already know that
 
2:20 PM
No, it is about the range of values.
which is fixed, and constant.
Any solution posted to that question (including @Jeroen's) that is not able to solve the same use-case as the OP's use-case, is not really a valid answer.
2
@Mat'sMug Which is why the order by GUID is a broken solution
 
@rolfl if the count specified where int.MacValue then your solution would take infinite time
or bett would go towards infinity
better*
 
> You've earned the "Enlightened" badge (First to answer and accepted with score of 10 or more) for "Down with FizzBuzz… LOL".
2
 
Hey ho
 
Int.MaxValue isn't nearly large enough number to compare it anywhere close to infinity.
 
@BrunoCosta Not really true.... my solution would throw an out-of-memory exception.
 
2:24 PM
27 views to 2.5K!
 
I really want some upvotes. :/ I think my answer here is clearly better...
0
A: Conditional initialization of objects

nhgrifGiven that Class2 is a subclass, we can declare the variable outside as a Class1 object: Class1 *object; if (a == b) { object = [[Class1 alloc] init]; } else { object = [[Class2 alloc] init]; } We could also one-line it as such: Class1 *object = (a == b) ? [[Class1 alloc] init] : [[Cl...

 
@rolfl well, let's say int.MaxValue/4
 
@nhgrif indeed
better explained anyway
any difference between Class1* object; and Class1 *object;?
 
For MaxValue/4. that means that, on average, there will be a collision, about 2% of the time, and, of that 2%, the next value will 'miss' and existing value almost every time.
 
Better explained. The actual solution is better.... except I don't do the very wicked omission of optional braces.
 
2:26 PM
So, for MaxValue/4, the repeat-loops are very few.
 
37 secs ago, by Mat's Mug
any difference between Class1* object; and Class1 *object;?
You mean Class1 and Class2?
Oh, I see
And no, there's not a difference.
 
your answer goes Class1 *object;, other one says Class1* object;
OIC
 
Class1 is the variable type. * means it's a pointer.
So, object is a pointer to an object of type Class1.
 
I know, was wondering about the placement of the *
 
Yeah, it doesn't matter.
 
2:28 PM
@rolfl but wouldn't it be better if that could be avoided, I'm just trying to do that!
 
My answer matches the question and as far as I know is the preferred style in ObjC.
@BrunoCosta Depends on how much overhead there is in avoiding that.
As I said...premature optimization.
 
@rolfl would posting a rock-paper-scissors be pushing it?
 
@nhgrif That's why I'm trying to have a nive work around for it.
maybe I can maybe I can't. I'll see
 
@rolfl "Almost every time" = 99.96% of the time, assuming your 2% is accurate.
A 1 in 2,500 chance that there is back-to-back collision.
@Mat'sMug In fact, that other answer violates 3 Objective-C common style patterns.
His placement of the *, while not wrong, is uncommon. He omits optional braces. He uses new. All three of these things are not wrong, but uncommon.
You will never see the first or the third in any Apple example code. The second, you might see in some Apple example code... but Apple agrees that optional braces aren't a good thing and have made them non-optional in Swift.
 
my 2% is not apparently accurate, it is 12.5% .... at least according to a quick calculation.
 
2:35 PM
That's the collision chance for the last number?
 
Since the data starts off sparse, and gets progrssively more dense, collisions start off being very rare, and as the data gets close to Max/4 values, the provavility of collision tends towards 25%
 
@rolfl reasons to start worriing! evilness
 
It's not a reason to start worrying though...
 
On average, for the run, the probability is 12.5%
 
Compile and run his solution. See how long it actually takes.
Even if you run into a collision 50% of the time, you're still only making Int.Max/2 iterations.
Which doesn't actually take that much time, really.
 
2:37 PM
The overhead you require to prevent duplicate collisions is much larger than the actual handling of the exception cases.
2
Take this solution, for example....
2
A: Generate random numbers without repetitions

KrisIf there are 1-4 possible numbers, and you have generated 1 number already, that means there are (4 - 1) 3 possible numbers left. Make a random number between 3, for every generate number it is greater than or equal, increase the created number by 1. lets say the number is 2, and you want to ge...

That one is guaranteed to do much more work. It generates a random number, then compares that to every number aldrewady generated.
So, it guarantees, for a set of Max/4 values, that it not only has done Max/4 iterations to get to the last one, but on the last loop, it also loops through the Max/4 - 1 previous solutions.
For small count sizes, it's not a problem. For large ones, it is a huge problem.
 
A huger problem than the 12.5% chance of collision.
Although... doesn't a set's .add function do this comparison anyway?
 
@rolfl I think I did it. Could you check with me before posting, in some way?
may I post it in pastebin or something
 
For my solution (and Toppin's), the problem is not a problem for small counts, and additionally, for large counts, my overhead is only '12.5%' that there is a problem, and on each successive attempt, it becomes more and more likely that there will not be a collision.
For exampole, on the last loop, there is a 87.5% chance I will get it the first time, and a 98% chance it will be within two times, and a 99.x % chance in three guesses, and 99.9999 somthing in 4 times, and diminishingly small after that.
 
@rolfl This is untrue as stated...
For each successive attempt, the odds that there is a collision remain the same.
However, the odds that 2 out of 2 will be collisions is less than the odds of either individually.
I think that some of the other solutions though probably suffer the problem of being farther from a true random than @rolfl's solution
 
@nhgrif That is what I mean... and explained in the second sentence.... ;-)
 
2:45 PM
Any feedback anyone? <.<
 
But yes, it is not true as stated.
@Bruno, it looks like you still have a problem with the ranges being limited....
 
@rolfl which is?
 
Is it possible, with your solution, to have all 10 values in a 1..1000 range fall between 0 and 10 inclusive>?
If it is not possible, then your solution is not valid.
 
it is possible but unlikly
elementsTakenFromInterval is random
 
It's too early and I'm too unfamiliar with C# to understand what's happening in your solution.
Could you plain-English the algorithm?
I think you have a problem in that you've compromised the randomness potentially.
Let's say I'm generating numbers between 1 and 100
I've already added 1, 2, 3, 4, 5, 7, 9, 14 to the list.
How does your logic determine how to generate the next number?
 
2:50 PM
Not just potentially... the logic is flawed.
int elementsTakenFromInterval = Math.Max(r.Next(count), 1);
should at least be count+1
so it is possible that all count values can come from interfal 0.
 
Is it possible to generate a number less than 14 if you've already generated the number 1,2,3,4,5,7,9,14?
 
@rolfl Is that the only thing? :o
 
Also, if 2 values come from interval 0, then no values will ever come from interval count-1.
 
And if so, how does your logic deal with RNG returning a value between 5 and 14 inclusive?
 
gotcha it's more unlinkly to have values from the last ranges!
I think I can't avoid that :p
 
2:53 PM
Which means, the following outcome is impossible: [1,2,999] for the inputs min=0, max=1000, count=3
Hope you are not selecting lottery numbers ... some folk will be disappointed ;-)
 
@BrunoCosta Any solution which does not produce the correct results is indeed not a more optimal solution.
 
let's see If I can remove the 1 from there at least It would make it more random althought I must consider the case where all randoms are 0
...
 
@BrunoCosta - the more you try to handle these cases, the more likely it is that the basic algorighm is not going to work.
 
let's generate other random?!
no that wouldn't do wither
either*
 
randomness is not just about the predictability of the number, it is also about the distribution and probability of potential outcomes.
for example, with a dice, the probability of a 1 or 6 is the same.
but, put two dice together, and things mess up fast....
the possibility of a 2 (a 1 and 1 throw) is just as likely as a 12, but only half as likely as a 3..... because there are two different ways to make 3.
 
2:57 PM
that's why I like number 7
 
Your solution looks vulnerable to those sorts of problems because you are combining randomness in two different planes.
 
@BrunoCosta If you just generate another random, then aren't you in the same position as @rolfl's solution?
 
(looking for duplicates.... yes).
 
@rolfl no because I'm only comparing to one number and he is comparing to n numbers
 
To me, the most important things to get right when talking about generating random numbers, first and foremost, is making sure the randomness is as true as possible.
 
2:59 PM
Well, yes, but because I use a HashSet, the check is as fast as if I had just 1 number in the 'n'.
 
@rolfl what about this pastebin.com/ezahjQtw
 
@BrunoCosta Did you address my concerns?
Given this set of already generated numbers (1,2,3,4,5,7,9,14), can you generate a number less than 14, and if so, how does your logic handle a number generated between 5 and 14 inclusive?
 
@rolfl in int elementsTakenFromInterval = Math.Max(r.Next(count+1), 0). The max is doing nothing there
I can't generate a number before 14 anymore, but I don't really have to, that is the trick
 
Then your solution isn't generating a true random.
Consider a 6-sided die, where it's equally likely to roll each number.
I want to generate 3 random numbers of those 6.
 
That is the discussion I had with @ruahk. The kind of randomness you are talking about is independent randomness. But randomness doesn't need to be independent to solve this problem
 
3:04 PM
If I generate an already generated number, I reroll.
What happens if I roll a 5 first?
If I continue to roll, I could still generate 1-4.
 
2502 views! w00t!
 
You don't have to have independent randomness to solve this problem
 
What happens if I need 100 numbers between 1 and 1mil in your solution, and your solution generated the number 999,997 first?
How can we generate the other 99 numbers if there are only 3 more numbers between our first number and the max number?
 
you will have your 100 numbers shuffled
 
But you said once the numbers 1,2,3,4,5,7,9,14 are generated, I can no longer generate number lower than 14.
 
3:06 PM
but the random numbers are created dependent on each other
that's true
 
Right, then if I roll 999,997 FIRST, how do I roll 9 more numbers?
If there are only 3 more numbers left in the range?
999,998 and 999,999, and 1,000,000
I can't get 9 more unique numbers out of 3 available numbers.
 
the thing is that you won't be rolling 999,997 first
ever!
 
Why not?
 
Because he limits the first roll to the first interval.
I have to go.
Saturday chore list.
 
<-- that
 
3:07 PM
So rolling a set of the last 10 numbers is significantly more likely than rolling the first 10 numbers sequentially
or any run of 10 sequentially
 
Yes.
 
And that massively sacrifices the randomness.
Which makes the solution very wrong.
 
Also, inside the range, the intervals multiple values will tend to be squashed to the upper half.
 
The result set will ALWAYS be weighted toward the higher end of the range.
If I roll a number between 1 and 1000, average roll is 500
If I roll between 500 and 1000, average roll is 750.
If I roll between 750 and 1000, average roll is 875.
Etc.
Which each successive roll, I cut my available range of random numbers in half on average.
Which means in the range of 1 to 1000, rolling the number 1000 is significantly more likely than rolling the number 1.
If I want 2 numbers in the range of 1 to 1000, rolling the number 1000 is exactly twice as likely as rolling the number 1.
Because I will always have as many chances at rolling 1000 as I have total numbers, meanwhile, I will only ever have 1 chance at rolling a 1.
And as such, if I want 100 numbers in the range of 1 to 1000, rolling 1000 is 100 times as likely as rolling a 1.
This is not random at all.
 
@nhgrif Well at least was a good attempt, I guess...
 
3:12 PM
Yeah. It's just important we get the results right.
Random can be hard to understand.
 
@nhgrif I understand the issue I just didn't see it ocurring.
 
Yeah.
 
@nhgrif theorically
 
I wasn't saying you didn't understand my explanation. I'm saying random can be hard to understand and as such what I saw and what I was concerned with can be hard to see.
 
yup
 
3:15 PM
Until you've spent a little bit of time working with and thinking about random.
 
I'll spend some more 20 minutes to see if I find a workaround for it and that work around is feasable
 
1
Q: Recreating merge-with

ChrisJust working through the questions on 4Clojure as I learn the language. This is my solution for #69. Would appreciate feedback as this one gave me a little trouble. (fn merge-with2 [f m & ms] (let [update-or-add (fn update-or-add [m1 k f arg] (let [x (get m1 k)] ...

 
@BrunoCosta - consider writing a test harness for your solution.
Do something 'easy' that produces say 4 results from 0..15 inclusive.
That is useful, because you can represent the bits as a 16-member bitset, that will have 1820 possible values.
there are 1820 ways to select 4 values from 16 candidates.
    int max = 1 << 16;
    int bitCount = 0;
    for (int i = 0; i < max; i++) {
        if (Integer.bitCount(i) == 4) {
            bitCount++;
        }
    }
    System.out.printf("%d%n", bitCount);
Then, what you should do, is run your tests a million times or so, and you should count the number of times each of the 1820 solutions comes up.
From that, you should get a number of about 550 times each.
If your variuances are much less than 500 for any one solution, or more than 600, then your skewness is horrible.
 
@rolfl thak's for support :D
thanks*
 
And then, if/when you do get a solution that produces the correct results, time it versus @rolfl's solution.
 
3:28 PM
@nhgrif I'll do that. I even have a measurment algorithm from a question I made long time ago
 
3:43 PM
I got my first nice answer badge codereview.stackexchange.com/help/badges/45/…
3
 
@JaDogg grats!
 
:D
 
0
Q: SQL Server DateTime internal representation to FILETIME (C/C++)

NeilwHere is a routine I put together to convert SQL Server's internal DateTime representation (BINARY(8)) to a FILETIME. I know that the SQL DateTime (as in GetDate()) is not precise and will vary from the SystemTimeAsFileTime. But it should be different by milliseconds, but by seconds, right? In an...

 
and boom
actually... no. not today
I'll space 'em up a bit
 
3:58 PM
0
Q: First c++ program: Really basic terrain generator

Vladimir PutinThis is my first attempt at writing a c++ program, so bear with me if you see anything that makes you want to facepalm. I tried to use as many methods as I learned in about a week-long period. #include <iostream> #include <stdlib.h> #include <time.h> void generator(char tree, char water, char ...

 
@CaptainObvious Vladimir Putin... really?
 
O RLY?
 
4:13 PM
Mr Putin even changed his profile pic a few times, every time to another great shot of Mr Putin
 
0
Q: Managing ZK Tabpanels

SandeepScenario: I am working on a Java/ZK Subscriber Management application. There are 2 tabs: Basic Info and STB-VC. The first one for creating a new subscriber and the second one for assigning STB/VC(Set-top box and viewing card). I am trying to achieve/ensure Someone can only click/use the secon...

 
4:27 PM
0
Q: Careful simulation of a 3D space

user3465201What is an accurate computer-description of space? I've been building up my abilities with various population simulations, and I'd like to add a spacial element to them now. I'm self-taught with Python, so any insight or critique is greatly appreciated. The following code is my first idea on th...

 
hey guys
 
4:46 PM
Hey Webby
And Dan
 
(205) The 2nd Monitor: Reset Content
I was thinking about waiting until (404) The 2nd Monitor: Not Found
 
@rolfl hey there. I was about testing I did not quite get the part of mapping the range to the bits <.<
 
0
Q: Idiomatic catching of unchecked exceptions in ExecutorService.submit

Dan PantryOK, here's the problem space: Lwjgl, a graphical library, has the ability to throw an unchecked LWJGLException on certain methods - like Display.create(). This becomes a problem when you have to off-load all work done by Display onto a single thread using an ExecutorService - that's what I'm doin...

 
I didn't know Putin could code... — Simon André Forsberg 20 secs ago
 
4:55 PM
@sim like my rock/paper/scissors? :)
 
@Mat'sMug your what?
 
The 2K+ link above
I might add lizard spock and tag it with ...
Sudoku solver will have to wait till LOLCODE 1.3 :(
(i.e. arrays)
 
Hey rolfl quick question on atomicity in Java, do we need to have synchronization blocks to maintain the full atomicity always?
 
@Mat'sMug No random numbers in lolcode? That's the same in Brainfuck :(
 
I wonder if there will actually be a LOLCODE 1.3, or 2.0...
 
5:15 PM
@SimonAndréForsberg cool story bro
 
0
Q: Why I am seeing lot of client timeouts if any one server goes down?

WebbyI know it's a pretty long question but I am stuck on this for a while and not able to understand why it is happening so providing as much details as possible. I am working on a project in which I construct a url with a valid hostname (but not a blocked hostname) and then execute that URL using...

 
Part of me feels like posting is a bit like whoring views/votes.. OTOH if it's a well-written question with reviewable code, it makes a funny way of showcasing what CR does, whatever your favorite "normal" language is, and does seem to bring lots of traffic. But so do good questions in "real" languages...should I feel dirty about posting lolcode?
@Webby I'm on the fence with your question. You shouldn't expect reviewers to find a bug in your code..
 
the way I feel about it is that while the majority of his code is working, it's not fulfilling the contract it is expected to, and thus is bugged and belongs on S/O
in the same way that you could introduce a subtle dividing by zero clause into a program and have it compile and work fine right up until you get to the divide by zero
 
I see but they can review and see what can cause the problem? If not, then yeah I might have posted wrong here. Sorry about that. May be I was not clear while posting here. I always get confused.
 
If there is a problem with your code it should not be on codereview
code review is only for code that works as expected but might need additional improvements from a programmer's point of view
 
5:28 PM
I see
And from my perspective, I think its an iimprovvement
 
well
the difference is
is that your "improvement" is central on fixing unintended behaviour. i.e, a bug
 
I see
 
while fixing bugs may almost certainly be construed as being a "programmer improvement" it is also not working => StackOverflow
If you were to ask if you could have made that code any better by way of patterns or conventions or alternative methods of doing the same thing with less LOC or making the code less brittle
That would be a different question entirely :p
 
OTOH SO will shut it down in its current form, undoubtedly.
 
I think the issue stems from the fact that "code review" can either mean "review how my code looks and tell me if I could make it more idiomatic"
but OTOH it might also mean "peer-review my code and bulletproof it"
@Mat'sMug possibly
either way I've voted for close so we'll just have to see what other punters see. /afk
 
5:31 PM
They like shorter posts. Likely that ppl would comment along the lines of "this looks like a better fit for codereview"...
 
yeah thats what i was also thinking
they will close there as well and move here
if you guys think, I can delete the question
 
You need to debug it before it can make a good CR question. I VTC'd, sorry :/
 
I already tried debugging a lot but that case is not making sense to me. If by any chance you guys can think of something, I might try exploring those options?
 
You already know what circumstances create the problem, that's a good start! I haven't really looked at your code, but I'd look for a lock that doesn't release, causing other threads to wait and eventually time out.
...but me and multithreading (/and Java) aren't really familiar with each other :(
 
sure thats fine
 
5:45 PM
Does anyone know if you can create/update multiple wiki pages on github at once?
 
:/
0
A: Loop Animation on several UIButton's NSLayoutConstraint

nhgrifI'm not completely familiar with animating auto-layout constraints. Fortunately (or unfortunately), I've not yet ever had the need to do this. So, I'm not sure if there's a better way, but I'd say if it's working, that's a good sign. What I do want to comment on is your readability: constrai...

 
1
Q: Count frequency of characters in a file

xgedSome patterns are emerging ("fmap (b->a) . fmap (c->b) . .. . (IO z)"). Also infix zip is kind-of a hack. What is: Best practice in no-func-arguments style? Best practice? Elegance > Performance; Functional > Imperative import qualified Data.Map.Lazy as M import qualified Data.ByteString.C...

 
I finally got in another review, but it's tiny, and I have a feeling that the OP will say that something's wrong with it. I sometimes feel hesitant about questions with just one function.
 
@skiwi Are you going to start making the bot aware of wiki pages now?
 
@SimonAndréForsberg It has the option for it... so why not
But I'm not having the feeling like multiple pages will be added/updated at once, but the API is offering it for some reason
I don't even see a way to do it via Github
 
5:55 PM
so i have a lip piercing now. oops
and why on earth has my S/E photo not updated from when I changed it 2 weeks ago
 
Did you update your profile on all sites or just the one you happened to be logged in at at that time?
 
i have no clue lol
it was, after all, 2 weeks ago
that's a long time :(
 
Can't be cache ;)
 
@skiwi Because there's a TCG to work on instead?
 
@SimonAndréForsberg I'll be done soon :o
 
6:00 PM
@sim so I shouldn't feel bad about undeleting CHEEZ-BURGR-WAFLZ then?
 
> [30-08, 18:52] Drakantas: Even PHP is better ROFL [30-08, 18:51] Drakantas: JAVA IS SHIT
 
JAVA ya
 
From someone who relies on Code Igniter as a crutch
 
@Mat'sMug As long as there's not a third one coming, sure. But if you get another popular question badge, then you should feel bad!
 
I wouldn't dare a 3rd. But odds of it getting hot, given what happened to fizzbuzz, I'd evaluate to near 100%...
 
6:10 PM
I say in a chat box, "Java is pretty". It turns into a debate where a web developer says that Java and VB (by extension .NET CLR) is almost as bad as PHP. he then backs it up with "I'm a web developer".

Let me just go tell that farmer over there that his tools are bad because I've planted a sunflower at one point in my life
 
haha
@SimonAndréForsberg I feel like putting a +100 bounty on your zombie
 
@Mat'sMug I've been considering putting a +100 bounty on it myself :)
 
6:35 PM
31
Q: Zipper Comonads, Generically

J. AbrahamsonGiven any container type we can form the (element-focused) Zipper and know that this structure is a Comonad. This was recently explored in wonderful detail in another Stack Overflow question for the following type: data Bin a = Branch (Bin a) a (Bin a) | Leaf a deriving Functor with the follow...

Uh...
look at that answer
wtf
 
wow that's gotta be near the 30K limit!
 
instance (Diff2 b, Diff2 c) => Diff2 (b :**: c) where
  type D (b :**: c) v = (D b v :**: c) :++: (b :**: D c v)
  up v (L (b' :**: c) :<- vv) = up v (b' :<- vv) :**: c
  up v (R (b :**: c') :<- vv) = b :**: up v (c' :<- vv)
  down (b :**: c) =
    zimap (const (L . (:**: c))) (down b) :**: zimap (const (R . (b :**:))) (down c)
  around v z@(L (b' :**: c) :<- vv :: Z (b :**: c) v x y)
    = L (dzimap (const (L . (:**: c))) v ba :**:
        zimap (const (R . (b :**:))) (down c))
      :<- vV v z where
What? ^
 
@SimonAndréForsberg I have some esoteric rep to pay back, I put up a +150 bounty :)
 
0
Q: Refactor Javascript Mess

user2671355I have some javascript that was put together for functionality but I wanted to know if there was a better way to write it. As it stands it's a little hard to read and follow. Javascript: $(document).ready(function(){ var loop = null; $("li").click(function(){ $("li").css("box-shadow", "non...

0
Q: How to serialize data from two URL's in the same object efficiently?

WebbyThis is a follow on to: Serializing JSON data coming from two URLs in the same object I have two URLs (urlA and urlB) and both the URL gives me a JSON response back in the same JSON format. Below is my JSON string which I am getting back by calling from urlA. I have shorten it down by having onl...

 
Another comprehensive answer from GarethRees:
2
A: Flappy Bird game clone for a beginners' programming class

Gareth Rees You have docstrings for your functions and classes, which makes your code better than 95% of code submitted to Code Review. The behaviour of the pipes is split into several pieces: (i) the PipePair class; (ii) the motion, drawing, and destruction logic in main; (iii) the scoring logic in main; (...

 
6:44 PM
Oh how I wish more teachers were like you! Welcome to Code Review! Teach your students to review code! — Simon André Forsberg yesterday
 
@skiwi Hey, that's almost Brainfuck!
@Mat'sMug You are way too nice, Mug :D
 
hopefully it won't fall into the void...
BTW undeleted:
0
Q: Cheese-Burger-Waffles (aka Rock-Paper-Scissors)

Mat's MugFizzBuzz was fun, and I got great feedback and learned a few things (which I hope I put in practice here), but only scratched the surface. I wanted to explore the LOLCODE language a bit more, so I implemented a little rock-paper-scissors, to play with functions, parameters, return values.. and us...

 
@Mat'sMug The best thing about the fact that you're the one posting the bounty is that I could put up a selfie if no one else answers it ;)
 
:)
 
> I don't like that I'm hard-coding the strings in the WTF (switch)
 
6:48 PM
it's a WTF block :D
 
0
Q: JPA - Proper way to handle exceptions for a JPA DAO

user3590149I want to make sure I'm handling this properly for JPA and exceptions? In my insert function I'm mostly catching unique constraints exceptions that being throw when persisting into database. Should I use flush() or close() or both in the finally? I'm not sure how to do update method in JPA? Is i...

 
Welcome to Code Review! As we all want to make our code more efficient or improve it in one way or another, try to write a title that summarizes what your code does, not what you want to get out of a review. — Simon André Forsberg 20 secs ago
I had a feeling I would have use for that comment ^^
 
It's actually a very useful autocomment... when @Jamal's not too busy! ;)
 
@Mat'sMug I changed the title based on one of the sentences in the post. I'm not sure if it's entirely accurate, but whatever.
 
If a dish needs accurate amounts, they have these amounts prepared. Noone wants to see Gordon Ramsay weigh "250 grammes of fucking* flour" while preparing his marbled cake, they want to see him curse at the other chefs. having to weigh ingredients during the show cuts into that valuable time they have to throw insults at each other.. *expletive included for comedy value and character personality. — Nate Kerkhofs 2 days ago
2
Haha phone browse accident took me there
 
6:58 PM
Fuck yeah!
 
No fucking swearing in here please, okay?
 
Bitch, please
 

« first day (483 days earlier)      last day (3526 days later) »