« first day (533 days earlier)      last day (3781 days later) » 
00:00 - 18:0018:00 - 00:00

18:00
let's see what else I can do....
Strunk & White... I'm surprised I haven't edited 80 posts yet
I'll pimp this as it's one of my longer answers with only one upvote.
@janos If that badge was awarded multiple times, @Jamal would have gotten it for all of us.
3
And if I still earned +2 rep for each edit...
5
@Jamal In that case I'm pimping this
3
Q: Is there a more efficient way of executing multiple sql prepared statements at once?

crmI'm updating more than one table at once and as you will see it uses a lot of similar looking code. Is there a more efficient way of doing this, perhaps some way of combining the queries? For context: A user submits a small form containing information about their age, gender and favorite genre o...

this code is broken..
and Monking ;)
18:06
if we're pimping.... I have some oldish 0-vote ones.... if this is not useful enough to deserve votes, perhaps I should delete?
0
A: Check Image Dimensions Calculate Aspect Ratio, Set Image Dimensions, Resize

janosThis line is too long: var ua = navigator.userAgent; var event = (ua.match(/iPad/i)) ? 'touchstart' : 'click'; It would be better to split into two: var ua = navigator.userAgent; var event = (ua.match(/iPad/i)) ? 'touchstart' : 'click'; You can also omit the redundant parentheses there an...

and it lives, thanks to Santa! (or is that Vogel?) ah, it's actually Santas now
lots of napalming today...
@janos you could help other people get Epic, hint hint, nudge nudge...
-6
Q: Count percentage of audio samples exceeding a threshold

JohnI have this practice question that I have an answer to: In this stage of the project, you will identify any "danger" spots, in which the SPL is greater than or equal to 80 dB (the value above which long-term hearing damage is likely to result). The simplest approach is to logically overla...

actually, only 5 votes left for me today. have to pick carefully now
the night is young
it's very frustrating when you want to vote but cannot
18:12
@janos and I am at +139 for today.
@SimonAndréForsberg you did get my Santa love today // even despite trashing my code :-/
thank you, thank you, @janos. And again, sorry for the trashing ^^
I better ask a new question...
actually, I'm ready to accept your answer on my microbenchmarking question, anytime you want ;-)
Thanks Santas ... ;-) @Ma x
18:22
facepalm
I saw it happen but forgot to say, congrats @syb0rg on 10k!
3
@Jamal / @syb0rg s/StackOverflow/Stack Overflow/
See, even embedded links in chat have Stack Overflow as two words.
@janos Thank you very much!
@rolfl Slid that edit in before my edit period expired
Good, I was hoping you could
That's it, I'm replacing this mouse. I don't know why I've dealt with its clicking issues, even though it's quite inexpensive.
18:26
@janos I think I'd like that today.
Looks like GWT will support Java 8 in 2015 btw: blog.xam.de/2014/02/gwt-is-coming-back-in-2015.html
@skiwi If you haven't tried GWT already ^^
@SimonAndréForsberg now is good?
@janos yup, now is good
ka-ching :)
@SimonAndréForsberg Nice!
Hi again btw
But wait, it isn't 2015 yet
And violà:
0
Q: Memory with a twist

Simon André ForsbergDescription This is the good old game Memory with a twist: Every time you pick a wrong pair, the two tiles you chose will switch their location. So sometimes you might think that a tile is at one location when in fact... it has moved. And it might feel like you have no idea where it is anymore. ...

@skiwi true but 2015 is not that far away
18:41
hohoho ;)
2
Q: Memory with a twist

Simon André ForsbergDescription This is the good old game Memory with a twist: Every time you pick a wrong pair, the two tiles you chose will switch their location. So sometimes you might think that a tile is at one location when in fact... it has moved. And it might feel like you have no idea where it is anymore. ...

0
Q: Code for fake UI

EdeniaWhile i was coding it, i got better idea.. but i continued because i can not compare both of those ideas, because they are different. The idea of that function is to make your fake ui-building easier AND more advanced. void write_ui (char nodes[], int FOREGROUND, int BACKGROUND) { int i; ...

I really need to work on my memory.... my personal memory that is, not the game. Although the game could also use some improvements.
All that's missing is the generated JS and it'd work with a stack snippet, no?
+175 today
@Mat'sMug I considered that at first, I actually even tried it a little, but then I noticed the size of the generated code.... waaaaay to big for a Stack Snippet.
I guess I might just have to make an actual JavaScript version Stack Snippets just have to support Java!
3
> Author of this game is not responsible for any broken keyboards, screens and/or mouse devices.
18:55
Oh yes I forgot I'm in C, it is possible to pass yourself as function to another function
@Mat'sMug or perhaps you don't get as upset as I do when things are just not where you left them? Or perhaps you have a better memory than I do...
@skiwi Function pointers FTW!
@syb0rg I was using them to index an array
It gave a seg fault, unsurprisingly
@skiwi Using function pointers in an array?
0
Q: Calculating the minimum distance of a linear code

Cristian GrecoThis is a solution for the problem named Codes on the kattis platform: Given a generator matrix of a linear code, calculate the minimum distance of the code. I'm looking for reviews on optimization and best practices. Code readability should be preserved. public static class LinearCode { ...

19:01
@syb0rg Yep, it was not my intention
Gotcha
I'm quite stuck with this assignment, but not much that can be done anymore about it
It's a typical producer consumer problem, there's one producer and N consumers, and consumers may only get items that belong to them
We were supposed to use a FIFO buffer, but somehow I've managed that it always uses only one slot
Technically in the assignment there is no mentioning that you need to use the buffer ;)
And I believe it could fill up if consumers would take time to process the item, but in the assignment they do not
@Mat'sMug It has actually happened that one of the players of my Minesweeper Flags game destroyed his monitor when playing one of my AIs. He got angry because the AI had an extreme lucky-streak.
3
1
Q: Minimum Spanning Tree using Prim's algorithm

yadav_viI have implemented a Minimum Spanning Tree using Prim's Algorithm. Could someone give some about some improvements for code structure, conventions, performance, etc. #include <stdio.h> #include <stdlib.h> #include <limits.h> #define MAX_INT 512 struct q_node { int val; struct q_node *n...

@syb0rg Another problem is that my program randomly deadlocks occasionally, it's kind of a pity to debug
19:06
LOL!
@skiwi Are you using a stack for this?
Didn't touch code. Code gets broken. Can't explain that.
7
@syb0rg Nope an array with a cycling start index, it seems to be working though
Woah.. I just accidentally pressed Ctrl+T in VS. How did I not know about this search menu yet
19:09
@JeroenVannevel You thought it was going to open a new tab?
@janos Sadistic twist? No idea what you are talking about... whistling
@SimonAndréForsberg just clumsy fingers
@JeroenVannevel I mean: You didn't know about it because you thought it was going to open a new tab and you felt that you didn't need a new tab
@SimonAndréForsberg: my bad about ListUtils.shuffle, removed it. The link to SO is probably good to include in the question too
now, how can we crack that javascript....
3
@janos good idea.
@janos that's what I wonder too...
where does this thing store its data... looking at the resources in chrome console, there's nothing in local storage, cookies, session storage, application cache.... And the memorygwt.nocache.js file is the same on every page load, there's no data or visible randomization there either...
I'm actually not bad at cracking stuff
19:25
That game is.... infuriating
I did well at the Capture The Flag contests by Stripe, and turned their first one into a Live CD, playable in a virtualbox: janosgyerik.github.io/capture-the-flag
@Mat'sMug knownWords.add("infuriating");
It should have a scoring system. Like, +1000 when you match something... and -100 for every failed match
@janos I believe it's all in the memory somewhere. But I'm not good at debugging JavaScript to find out what variables are available.
@Mat'sMug And you would still end up with negative score.
Probably, yeah
19:28
@janos I am impressed.
@Mat'sMug Regular Memory is too easy, this makes it... quite a lot more challenging :) It's even more fun to play IRL.
I just beat it :)
..and I didn't throw my phone at the wall
Seriously, a scoring system would be nice.. just so you know how bad you played (and then you could track the all-time top 10 scores right?)
@sim wait, doesn't the game know a game is over?
Congratulations, @Mat'sMug!
You played in your phone? Did it work well?
It's not really a fully developed game, I mostly want to know if it's cheatable. The scoring system would indeed be nice though.
Worked nicely
And no, it doesn't know the game is over, the fact that you can click on an already-clicked square is a bit of a bug.
19:39
Well it's cheatable with a pen & paper for sure
@Mat'sMug that doesn't count. And I bet you'll have to scratch a whole lot and re-write.
I completed it too, to see in case something bad happens in the end so I can complain about usability. I thought of suggesting to add a button to start over or something, but thing is the button is already there: your browser's reload button, so fuggedaboutit
I was more thinking: Is it possible to win the game without picking one single wrong pair?
the switching is really wicked. if you're not careful you'll rearrange the entire board all by yourself
3
that's the whole point about it :)
19:41
With that much luck you're better off getting a lottery ticket
but in theory, it is really all about memory. Even though it might not feel like that :)
@Mat'sMug not luck. I mean: Is it possible to somehow use a JS debugger to find out the true values of the tiles?
Trick is to keep 2-3 numbers/locations in mind, and track them as they swap. Tracking more than that is inhuman.
...or I just suck at memory games
I think I will make some AIs for this game :)
Imagine playing AI Extreme with a perfect memory ;)
right, because the game is not sadistic enough...
3
I think you can make a few bucks with that game if you make a nice little UI and put it up on Google Play
19:45
lol, I might be a sadist apparently....
0
Q: Multiset implementation in Ruby -Take 2

gitarchieThis is a follow up to question. I fixed the issues mentioned in the answer as far as my understanding. The union and intersection now return new object instances with new implementation. I also wrote a test, which is below. class MultiSet include Enumerable def initialize enum=[] @memb...

@Mat'sMug I'd be surprised if there wasn't such a game already. But what has already been made, I can probably make even better
And then make a version with Chinese characters instead of numbers...
Btw.NORMAL, could I request some feedback to this meta selfie of mine?
For the record: The idea is from a game I played years ago, that's even more sadistic than my version (hear that @janos?). Note Memory: zefrank.com/memory/tones
19:47
2
A: Checklist or General Directions on how to write a good CR-ish answer

Vogel612There's a few things you might want to follow when reviewing code: Understand the asker's level of expertise: Some answers here on codereview are really in-depth. They address issues, that only experts could find, sometimes in ways, that only experts understand. While these answers are awesome,...

+1 from me
I like it. +1
Already had my +1
probably will have my +1 shortly
@SimonAndréForsberg: in the meantime, I added some more to my answer
20:02
hi @RubberDuck!
@janos good points. Especially about Random. As for the numbers, I agree with tim that regular users wouldn't expect numbers. If they would expect numbers though, 1-18 is better than 0-17
@Vogel I think that's a fine meta-selfie
@Vogel612 You might want to rewrite this sentence: "Additionally some questions just contain so extremely bad, that:"
"some questions just contain so extremely bad" feels grammatically wrong
Feels it should be "contain code that is so extremely bad"
20:16
TTGTB for now (with +190 for today, I hope I will be able to get one more answer-vote within the coming 3 hrs)
I keep forgetting it's a Sunday today ^
@SimonAndréForsberg btw added one more small point
ho ho ho (by Twanta, the Twitter Santa)
Train your memory with this simple memory game (with a twist): http://www.zomis.net/codereview/memory/MemoryGWT.html
@janos I've got nothing against that game, but I hate it ;)
it's just to torture my followers :)
why should only code reviewers suffer
3
20:26
@SimonAndréForsberg nice catch.. edit applied
20:36
woah
I did a QA so I assumed it would mark it automatically. Now I must wait 22 hours. This site fosters a culture of rudeness. — Luke Puplett Nov 24 '12 at 12:28
20:50
Huh.... chatsey app
Recommended 4 android
0
Q: Filter Out Date Records Which Don't Fall Within a Date Span

OmegaManI have records which have specific time spans. The need is to select records which adhere to the follow three rules ( read them as or conditions) concerning a target time span. Record's Begin date can begin within the target time span and end date does not matter. Record's End date falls with ...

21:19
0
Q: fast (faster than std::) ostringstream

GabiMeTried to implement faster ostringstream which initially uses the stack and grows afterwards on the heap. Also, it provides a way to access the data and size without creating new string unlike the standard ostringstream::str() Please review // A faster-than-ostringstream class // uses stack_buf...

What took you so long?
erm, I'm still the first, aren't I
@janos Well that's not the attitude we strive for
what attitude?
misunderstanding?
maybe I misused out-of-ammo?
hehehehe
22:10
oh
thought @rolfl has 3 more to go, and I'm the first
in any case, dunno what you meant by attitude there @JeroenVannevel. I didn't mean any
My numbers always seem to be off ;-)
@rolfl I was choosing carefully. Which btw would seem the perfect attitude
Also, I think sarcasm and irony are hard to get ovver the net.
too bad rolfl can't help me cap today, was kinda counting on it
got plenty of votes... link me up :)
22:24
0
Q: Mongodb making efficient and healthy db call

LazyI'm doing a calculation for a real-time browser game, where users can invest some of their balances to the site. And I need to update their invest's based on AN_AMOUNT_FROM_SITE and their percentage of shares(see PROFIT line). This function needs to run every 20-100 ms because AN_AMOUNT_FROM_SITE...

@mjolka it's alright, maybe it will happen naturally (just one more to go). might answer one more, just in case... but thanks, appreciate it!
@mjolka - this question would be a good candidate codereview.stackexchange.com/questions/67246/…
haha, thanks rolfl
yeay, thanks Santa mjolka!
Don't forget the question!
@rolfl i didn't forget anything on that page :)
22:34
@janos: just joking around, no worries :p
Now I'm back to bed
Later skaters
alright, catch ya later
cheers
ttgtb, see you all
night @janos
posted a new ad, based on feedback:
0
A: Let's make More Community Ads!

mjolka Variation on my first attempt, based on @IsmaelMiguel's comment about there being no code.

Hmm... is the anti-DRY.
22:53
@mjolka hmm you could have just edited your existing one, no?
@Mat'sMug maybe? was hesitant to do so given people already voted on what's there
maybe they would hate the version with code
loved that someone upvoted my comment saying i'm not good at design :)
wasn't me, promise
I'm going to do it now!
sure sure, monkey
haha
@rolfl you gonna submit an ad?
No, I suck at design ;-)
3
didn't stop me from trying :P
23:01
Me neither
thanks, Santa's Mug
@mjolka well if they don't like the new version, their votes would have unfrozen because if the edit, so they could remove their votes, or turn up into down.. but not everybody knows this I think.
@rolfl on that Oracle question, I'm scratching my head as to why this is returning 0 results... am I missing an Oracle-specific thing or is my logic flawed?
SELECT *
FROM dates_test t0
WHERE  (
  t0.BEGIN_DATE >= TO_DATE('03-06-2014', 'DD-MM-YYYY')
  AND    t0.BEGIN_DATE <= TO_DATE('04-06-2014', 'DD-MM-YYYY')
)
OR (
  t0.END_DATE >= TO_DATE('03-06-2014', 'DD-MM-YYYY')
  AND    t0.END_DATE <= TO_DATE('04-06-2014', 'DD-MM-YYYY')
);
@Mat'sMug i certainly didn't know that. hm.
Yeah edits defreeze votes
23:07
wtf.. lol
@Mat'sMug aren't you glad you aren't using Oracle?
Very
Shouldn't it be t0.TO_DATE?
Nope. TO_DATE is a date/time function not a column
facepalm
23:14
CREATE TABLE dates_test (
  id         NUMBER,
  hint       VarChar(20),
  BEGIN_DATE DATE,
  END_DATE DATE
);
-- If the span is Mar 6 to April 6 then 2, 3 and 4 are valid -
INSERT INTO dates_test VALUES (1, 'exclude before', TO_DATE('01-JAN-2014','DD-MON-YYYY'), TO_DATE('05-JAN-2014','DD-MON-YYYY'));
(etc.)
Looks like TO_DATE is required because the format in the table is not the same as in the SELECT... bad design?
Are they.... strings?
Aren't all dates strings?
Maybe not.
dates should be dates..
23:17
@Mat'sMug TunnelBear
My impression was that a DB would be setup to all use the same date format, not use varying formats in your tables and queries. That would get confusing as fudge.
Imagine multiple tables with all different formats
I think SQL Server takes anything you throw at it
Well, it tends to do that. It probably has smart date detection, like PHP has
Format is only relevant for a string representation, the stored value is a number
"Sunday, October 19, 2014" == "10-19-2014" == "19-OCT-2014"
Makes sense.
Guess Oracle has to be spelled out completely explicitly or it gets confused.
I tried without TO_TIME and got an error
23:21
bbl
0
Q: A multi-client coord sending boost asio async udp server

FeotusGodLets get strait to the code: This is the client class that the server uses. class client { private: std::string clientname_; //client name int xpos_ = 0, ypos_ = 0; //coordinates int dir_ = 0; //side the client is facing. bool movement_ = 0; //the clients current frame. udp::endpoi...

23:41
0
Q: How can I make my arraycopy more efficient?

jordanoooDesperate to find out how I can make my function more efficient. This is what I have now public boolean addAll(int i, Collection<? extends T> c) { for (T x : c) add(i++, x); return true; } public void add(int i, T x) { if (n + 1 > a.length) resize(); System.arraycopy(a, ...

00:00 - 18:0018:00 - 00:00

« first day (533 days earlier)      last day (3781 days later) »