« first day (423 days earlier)      last day (3576 days later) » 

12:00 AM
Trying to decide if he's a rhesus:
 
Nope.
 
code monkey get up, get coffee; code monkey go to job
I just had to dig that song up in my playlist :)
 
0
Q: How bad is it calling println often than concatinating strings together and calling it once?

CeleritasI know output to the console is a costly operation. In the interest of code readability sometimes it is nice to call a function to output text twice, rather than having a long string of text as an argument. For example how much less efficient is it to have System.out.println("Good morning."); S...

 
Call me the Chaos Monkey
 
12:07 AM
TTGTB
 
Night Simon.
(that's a real thing, BTW, the Chaos Monkey)
 
yep, Netflix cloud testing
 
^^^ that's the one.
 
I forget the names of the other simian army tools
I thought there was supposed to be a chaos kong, which brings down an entire region
 
Even though this is very little code, I have to say I have been wondering the same thing. Would be nice to determine the answer to this once and for all — Simon André Forsberg 10 secs ago
Night. Poof. Gone. For real. Cya tomorrow / today.
 
12:11 AM
They mention kong down in the comments section
 
1
Q: Spell Check and Trie implementation

lijrobertI have written this code for an Edx course called CS50x (a beginner course). This problem set required me to write a program which: loaded a dictionary into some sort of data structure (I choose to implement a trie) and which could take an input text and search for misspellings uses a file wit...

0
Q: Extend to Palindrome (SPOJ) giving WA

dabangg.boyHere is the Problem Extend to Palindrome Problem code: EPALIN Your task is, given an integer N, to make a palindrome (word that reads the same when you reverse it) of length at least N (1 <= N <= 100,000). Any palindrome will do. Easy, isn't it? That's what you thought before you passed it on...

 
blah, edited in copy and swap into my post, now it really is a wall of text
 
@Yuushi Yesterday's LL question?
Ah, okay
 
yeah
 
I should maybe start doing copy & swap in my own code. I haven't tried it out yet.
 
12:26 AM
its been quite a while since I've actually written a class that has done any kind of low-level memory management
generally, pointers -> std::unique_ptr (or shared_ptr if it has to be) -> use either default or delete for move/copy constructor/assignment
technically some of what I've written is only true if swap is noexcept
but blah, too much detail
I'm trying to not frighten people who are newer to the language away
I think Loki sometimes piles too much on too quickly
 
I probably could've also mentioned in my answer that key is unneeded for such a data structure. Luckily, it appears that the OP figured it out himself. I'm just not sure if he found my answer useful enough (and it didn't help that I possibly mislead him about std::unique_ptr).
@Yuushi Well, Loki has scared me a bit in my first question ("I would never use this unless you fix it first"), but it didn't get me down. :-)
At least I no longer code like that. Yuck.
 
haha :)
 
Still, I really need to catch up on C++11 as well as get a better understanding of multithreading. Luckily I'll learn just that (the latter) in the fall.
 
basic concepts of multithreading aren't so hard
it's ensuring correctness in larger code bases that becomes very, very diffuclt
*difficult
 
It may allow me to review more code, too. I do not want to be the weakest (regular) C++ reviewer here.
 
12:32 AM
reviewing it should give you some good practice to look out for certain things
when you learn about race conditions and deadlock, you can comb through code asking "does this code have a race condition? Can it suffer from deadlock?"
valuable practice
 
I think I recall what race conditions are.
 
"Yo dawg, I heard you like threads. Compute I you in thread your can while a compute you so put thread."
A meme generator can sometimes take the edge off debugging things
 
heh
 
1:16 AM
Does anyone else think this appears to be example code?
 
1:38 AM
@Jamal - it's probably on the wrong-side of A vs. B.
It's true that the code 'works' though, and, I was inspired by Simon's comment.
 
1:50 AM
@Jamal It's a great question, but it does seem to be an example. I hated to cast that vote.
 
I was about to close it myself, but it just didn't quite feel right.
 
I know, it was a great question and @rofl's answer was phenomenal, but we've closed questions that were less of an example.
Let it go through the review queue. That's why it's there.
 
thanks @Santa!
damn hot network question.. probably the comment of the day on scifi.se:
Gollum was using the Ring in a cave under the Misty Mountains. There is no cell reception down there :p — Joseph R. 12 hours ago
3
 
2:06 AM
That's epic.
 
1
Q: First simple program; counting button presses

thumbtackthiefThis is my first solo Objective-C program... it does the complicated task of displaying a button and counting how many times it's been pressed. It retains that count (along with the last time it was pressed) between uses of the app. I have a few specific questions, but eagerly await any and all...

 
@nhgrif all yours ^^
@ckuhn203 that's also epic:
no Semi-Colons in VB...LOL — Malachi 11 hours ago
is c# getting to you? ;)
 
Is there a way to mark all your @tags in chat as read? Accidentally left chat on from home while at work and now have like close to 30 tags
Oh, wait. That just did it right there. Great!
 
lol
 
@Phrancis How did you do it?
 
2:13 AM
I just requested in human language that it did, and it did.
 
If you type a message, it clears the notifications
If you have focus in the text-entry box, and press escape, it clears things too.
So, if I type @Phrancis ... and you type escape .....
 
Maybe I should look into more of this Human Language script...
 
@JerryCoffin - for you .....
 
Bleh. I want to do some coding but I gotta pack those stupid boxes.
 
@ckuhn203 You can still take your vote back if you'd like.
 
2:16 AM
@rolfl Awesome. I'd even seen that happen, but never thought of it as a way to clear the notifications. Thank you.
 
No problem ;-)
Unlike the C++ answer to the Java question.
Also, isn't C and C++ a lower level language than Java?
 
how...
 
Yeah @Mat'sMug. It's seeping in.
I know @Jamal, but right is right and I think it's example code.
 
@rolfl Although he didn't include either tag, his question very specifically talks/asks about C and C++.
 
@rolfl I'm not sure if they're lower, but they are low.
 
2:19 AM
@rolfl C and C++ certainly are higher level languages than JAVA
 
hehe.. the other day I reviewed a piece of and refactored it.. and kept adding semicolons everywhere...
JAVA is on another scale I think.
5
 
@rolfl Sun always sold Java as being higher level--but I see little in the way of higher level abstractions to support that contention. It is true that Java is more limited in how low of level you can go if you want--but it's also true that it's much more limited in how high of level you can go if you want (and also how high of level you get by default).
 
Lol. I'm trying to talk my tower into c#. We have the option of using either with the new software.
 
@Phrancis Are you saying that Java is closer to the hardware than C?
 
@ckuhn203 I find the VB syntax bulky and annoying
 
2:21 AM
No, I have no opinion on that (because if I did it would likely be wrong). Just a comment about JAVA.
 
Just going to use some mod privileges here...
 
The funny thing is, I hate semicolons. Now I'm unconsciously typing them everywhere.
 
Never mind, I realised that you're talking about JAVA, which is not a language I know.
 
@ckuhn203 you forgot the grammatically correct semicolon after the word, "semicolon".
 
nah, the funny thing, is that you're going to end up luvin' those semicolons ;)
 
2:22 AM
Next thing you know I'll actually be using them in my TSQL like I should be.
2
Dang... Thanks for pointing it out @Phrancis. I'm mobile so I can't edit it either.
 
@ckuhn203 watch the battery!
 
@ckuhn203 MySQL one of the few redeeming facts is it won't take your script unless all the semicolons are in the right place. TSQL will gobble up pretty much anything, semicolons or not. That's why real pros use MySQL </sarcasm>
 
Lol @Mat'sMug.
M$ is supposedly moving that way, but I doubt we'll see it. Too many backwards comparability issues for their taste @Phrancis.
I think we have a new faux tag.
 
@rolfl C and Java are about tied. C does allow you to speak more directly to the hardware, but really doesn't require it. With C++ you can write just as low-level of code as you can in C, but you can also write substantially higher level code--template metaprogramming, in particular, is much more comparable to something like Haskell (in fact, it's almost isomorphic to Haskell, though with much more verbose syntax).
 
* googles isomorphic *
 
2:28 AM
@rolfl should I accept your answer now or wait a little more and see what we get?
 
Oh. Makes no sense at all. Eyes glazing over.
 
20
A: Let the CR Games begin!

rolflContent posted to Stack Exchange websites is under the Creative Commons license. Specifically, code posted to Stack Overflow and Code Golf are available for use, ..... and abuse! I suggest we take on the challenge of finding the worst code out there on our sister sites, and making it the best! ...

 
@JerryCoffin As a friend of mine put it, "template metaprogramming is pure functional programming with the worst syntax you've ever seen"
4
 
@Yuushi It's pretty awful, but I've definitely seen worse.
 
0
Q: Reverse Polish Notation Calculator

Kevin MeredithWorking through Learn You a Haskell, I made a Reverse Polish Notation calculator. Please critique it. -- LYAH uses `(Num a) => String -> a` as the signature solveRPN :: String -> Double solveRPN xs = head $ foldl (\acc x -> foldingFunction acc x) [] $ words xs foldingFunction :: [Double] -> St...

0
Q: How to validate multiple keys in the builder class basis on the rules?

WebbyI recently started using Builder pattern in one of my projects and I am trying to add some sort of validations on my Builder class. Below is my builder class - public final class DataKey { private final long userId; private final String uuid; private final String deviceId; priv...

 
2:34 AM
yes, yes, that is quite bad indeed
 
@JerryCoffin tell me this is like The Onion version of programming, and not an actual language... please...
 
@Phrancis It has been implemented, if that's what you mean. No, it's not really intended to be used to write anything useful though.
 
The excessive use of back ticks would make it very hard to post any of it here, for sure
```s``s``sii`ki
`k.*``s``s`ks
``s`k`s`ks``s``s`ks``s`k`s`kr``s`k`sikk
`k``s`ksk
 
@Phrancis ...and reading it is at least twice as hard as posting!
2
 
you ski?
 
2:42 AM
@Mat'sMug I have done skiing, but not for a couple of years now.
 
(no, I'm sikk)
I've done that, some... uh, 15 years ago. damn.
 
Sounds about right...
 
Have you ever seen this @Phrancis?
 
@Mat'sMug I can't help with that.
 
right.
 
2:45 AM
It is July 1st though.
(UTC)
 
timing would be ..perfect.
so be it.
 
@Jerry - I updated the println answer with some real numbers.
 
180 views in 3 days.
hmm
not a lot
 
@ckuhn203 WOW.
 
I'll edit the OP with an update
 
2:49 AM
Is it printLn (as Line) or printin (as in or into)?
 
L
@Mat'sMug :
 
Gotcha
 
Rags to riches refers to any situation in which a person rises from poverty to wealth, and in some cases from obscurity to fame--sometimes instantly. This is a common archetype in literature and popular culture (for example, the writings of Horatio Alger, Jr.). Criticism The concept of "Rags to riches" has been criticised by social reformers, revolutionaries, essayists and statisticians, who argue that only a handful of exceptionally capable and/or mainly lucky persons are actually able to travel the "rags to riches" road, being the great publicity given to such cases a natural Survivorsh...
 
interesting. let's put that in the tag wiki!
 
I like although for me is my fav. Just because I got a potty mouth. We should make one that is
 
2:51 AM
I liked the , but 200_success was right, too derogatory.
 
I'd like one with in it. lol
maybe not
the idea was to hint at reviewing [new content derived from] SE content
is nice though, especially with the part that says and in some cases from obscurity to fame--sometimes instantly.
 
@Mat'sMug I thought that said sometimes insanity there at first
 
haha
so, rules
1. you need to include a link to the SE question you're basing your code on.
2. you may grab code from Programmers, Stack Overflow, Code Golf, ...anywhere code is involved on SE.
3. you have to prettify it - solve OP's problem, in a beautiful way.
4. you create a new CR question tagged , with your new code.
5. vote.
thoughts anyone?
@rolfl is that what you had in mind?
 
@rolfl Looks good. If/when I get a chance, I'll add some numbers to my answer as well.
 
@Mat'sMug @Mat's, the concept was fairly 'flippant' when it came up. Yes, that seems reasonable.
 
3:02 AM
Oh, have you tried getting numbers with the output directed to a file instead? That seems more useful than just throwing the output away completely.
 
Let me thing for 30 seconds.
 
@rolfl Time's up.
Alex Trebeck is disappointed that you not only failed to answer in the allotted time, but then forgot to phrase your response in the form of a question.
 
@Mat'sMug Not just prettify it... you have to make sure it works.
 
yeah
CR-ify it
CRifyze
whatever
 
exactly.....
 
3:06 AM
CRewize
 
@Jerry - it runs about half the speed, but the proportions are about the same with short vs. long strings
(updated the answer)
 
CRew CReates CRomulent C[R]ode from CRud. Film at 11!
@rolfl Cool. Not surprising, but seems like a useful addition (at least to me).
 
0
Q: How to plot multiple Segplot in one window?

Mahdi HadiI used segplot for plotting the mean of two variables with 95% confidence interval and a vertical line which show the test value. This function can do a graphical t.test. the following code produced two graphs in separate windows. I would like to know how we can plot these graphs in one window to...

 
3:21 AM
How do you SELECT data and make it into a link in SEDE?
 
There are a few ways.
There are special cases for Posts, Users, and Tags.
For other things, you can concatenate things in to a stack-exchange-likely URL, and it will auto-link it.
 
I'm looking for Posts specifically
 
So, alias the Id of the post as [Post Link]
and it will auto-link it
 
> - The code in your question must be working code, but grabbing a SO question and just making it work is not enough and should be downvoted. We want to review your code. Don't just make it work, make it shine!
would that work?
 
Yes.
 
3:27 AM
@Mat'sMug What if you've already posted beautiful, shiny code in an answer where the question was asked?
 
then it's your code in the first place
I've done that already
7
A: C# like List<T> in VBA

retailcoderGenerics appeared in C# 2.0; in VB6/VBA the closest you get is a Collection. Lets you Add, Remove and Count, but you'll need to wrap it with your own class if you want more functionality, such as AddRange, Clear and Contains. Collection takes any Variant (i.e. anything you throw at it), so you'l...

 
Cool thanks @rolfl
 
@Jamal / @200_success - just so you know ..... Mat's pushing the CR July challenge through
 
I'm such a PITA right?
 
Not at all... it's a good thing
 
3:29 AM
@rolfl using a CTE does [Post Link] need to be in the CTE or the outer query? I'm guessing outer
 
But, this will give them the head's up, and also that I am saying OK ihtout them being around, so they can shout at me later ;-)
Phrancis, the column just has to be called that.
 
'night!
 
Very nice @rolfl thank you
Bye @Mat'sMug
I made a SEDE to find very short posts on SO (and others) can a few of you try it out and see if that may help with ?
Bah, created as anonymous
 
@Phrancis that's a very, very good idea
yeah SEDE login is seperate from the rest of SE...
 
Try this
Any suggestions I can edit, then post on Meta
 
[Post Link] doesn't seem to work
 
3:55 AM
I thought of putting a "downvote" restriction but then changed my mind, since users on SO generally don't give a
 
you want posts with high views
and ideally with highly upvoted answers
 
You're right... @rolfl what did I do wrong on [Post Link]?
@Mat'sMug can you think of a good arbitrary number for views? Or should I subquery to find higher-than-average views (slow)
 
nah, go with badge thresholds
 
?
 
25+ votes is a silver badge
10+ votes is a bronze badge
100+ votes is a gold badge
 
3:58 AM
That makes two of us..
So, short question, with high vote answer is what you're thinking? Or high vote question?
 
views is 1K for bronze, 2.5K for silver, 10K for gold
not sure about that criteria
both?
 
I think high views would be most entertaining
People on SO glancing it over and are like that and move on to the next one
Thoughts @Mat'sMug ?
 
if the code is horrible in the question, it's not likely to get lots of votes, even with lots of views
I'd think
 
Let me have a smoke and then we'll try it out. That is, if my wife doesn't kill me because I should be packing boxes. lol
 
4:28 AM
edited
14
Q: Let the CR Games begin!

Mat's MugJune is about to end. Summer's here (well, if you're in the northern hemisphere, that is.. otherwise, ... yay, winter!), and with it, vacations. We need a new community-challenge. Let's play. I mean, let's find a game to play. The game... Has to revolve around reviewing code, or posting code ...

rags to riches:
TTGTB... it's well past midnight, Cinderella.
 
4:45 AM
0
Q: Is there any way to simplify this Google Sheets function?

SupuhstarBelow I have a function that averages a set of percentages (in column E) between certain importance levels (column A, in this case between 1000 and 2000, not inclusive because the #000s designate breaks, not values) in a separate spreadsheet ('To Do') and displays that as a percentage. Is there a...

 
Can someone test this out with a few various tags? This is for
Runs a little slow (31000 ms) but otherwise seems to give interesting results
 
0
Q: Minimum number of letters to be removed from a string so that it becomes a Palindrome

Kunal B.Problem: Display minimum number of characters to be removed from a string so that it becomes a palindrome. Input #1: abc Output #1: 2 Input #2: abb Output #2: 0 My python code is as below: # Checks whether a string is palindrome def IsPalindrome(str): m = int(len(str) ...

 
Also, I think I figured out a good syntax style for SQL, inspired by procedural common syntax, e.g. indent embedded sections etc.
This one is better, few tweaks added:
 
5:18 AM
0
Q: Euler code evaluation

user46995I am doing Euler problems to lean ruby, this is #30 # Surprisingly there are only three numbers that can be written # as the sum of fourth powers of their digits: # 1634 = 14 + 64 + 34 + 44 # 8208 = 84 + 24 + 04 + 84 # 9474 = 94 + 44 + 74 + 44 # As 1 = 14 is not a sum it is not included. # The s...

 
5:33 AM
codereview.stackexchange.com/questions/55759 <- what should this be tagged with? ? ? the excel tag is bugging me
tagged with [google] and [spreadsheet] for now, if anyone wants to improve that somehow feel free
 
6:06 AM
morning @all
 
6:23 AM
s/morning/monking/
 
6:40 AM
Time to learn AngularJS
At last I have to step into the horrendous world of Javascript
3
 
@JeroenVannevel JS is awesome, I don't know what you're talking about.
 
Damn Web-"Developers" ;)
recently read a job-offering on careers:
 
@Vogel612 Damn JAVA "Developers"
 
> If you think, JS is more powerful than Java
and I was like, get lost!
 
functions in functions, dynamic objects, weird-ass equality operators
 
6:46 AM
@Vogel612 JS is not more powerful than Java, but it's a whole lot more fun.
 
That's no thing to develop with
 
@MadaraUchiha damn right, damn JAVA-Developers.
I am better with Java
 
@JeroenVannevel functions in functions is an incredible feature. And if you enter JS it's a good thing to learn.
dynamic objects is a bit weird, but if you're used to NoSQL you'll have a better time.
You can have === which is the "exactly equals" in contrast to =='s "probably equals".
@Vogel612 I'm good with both. JS is more fun.
I don't want to define a whole class just for an event callback! That's not how the real world work!
 
Yeah, but === has all kinds of unintuitive results when used with different values of different datatypes
I've seen the weekly popular topic in the JS corner
 
@JeroenVannevel No, actually, === is perfectly intuitive.
 
6:48 AM
always some strange behaviour with ===
always
 
== is weird, === isn't
Also, I don't count undefined behavior as "weird", it's undefined, don't use it.
 
[] + [] --> ""
[] + {} --> [object Object]
{} + [] --> 0
{} + {} --> NaN
 
@Vogel612 That's not ===
And why the hell would you want to add objects/arrays?
Show me a real world case where behavior is weird.
PHP has plenty of those, I know :P. I have yet to met it with sane JS
 
@MadaraUchiha that behaviour is even defined
 
-2
Q: how to have a zoomable heatmap from world to city level using jquery/javascript

user3789287i am new to jquery, i need to implement a zoomable jvector map. intailly world map should be shown. on zooming country ,it should zoom to city level for at least one country? can any please help me!!!

 
7:03 AM
@Vogel612 Maybe, but it's not something you would use in an application.
 
@MadaraUchiha heard of obfuscation? I would bet someone somewhere used this to obfuscate a codesample.
 
to be fair, you can write obfuscated code in any language
 
@Vogel612 I generally don't obfuscate my code.
My assumption is that if someone is good enough to follow my incredibly abstracted code, he can use an unobfuscator or read obfuscated code.
 
@Yuushi but only JS allows that exact obfuscation
 
@Vogel612 obfuscation is a hack to try and protect something that can't be protected.
Only stupid people obfuscate their code (differentiate "obfuscate" from "minify")
Obfuscation cannot and will not protect your code from prying eyes. Here's a nice example to prove my point:
 
7:11 AM
@MadaraUchiha I can't agree. Only stupid people think obfuscating their code has practical use. Some people do it just for fun though. ioccc.org
 
@JerryCoffin Yes, that is what I meant.
Doing stuff "for fun" or "for learning" is never stupid
That doesn't mean you need to take a theoretical concept and force it on real-world scenarios.
 
7:26 AM
1
Q: Finding all paths from a given graph

genclik27I need to find all paths from a given graph. I can do that for now, however my recursive code is not efficient also my graphs are very complicated. Hence I need a better algorithm. def findLeaves(gdict): # takes graph and find its leaf nodes leaves = [] for endNode in gdict.iterkeys(...

 
aaand another answer finished..
I would like to have some proofreading on it though, in my schoolnet I somehow can't access google to validate my approaches...
0
A: Validating multiple keys in the builder class based on the rules

Vogel612Flags and Flag-flags: Everytime your Variable name includes flag, there should be a flag raised in your head. You then should go back and either extract a method or a class. Usually a flag means you are trying to do two different things in one method and that's something you shouldn't. Instead ...

 
ttgtb
 
@Phrancis sleep well
0
A: show and modify List in grid ZK

chillworldI tested with your code and it works normally with me. Now I changed the code a little bit : Removed the extends SelectorComposer from your viewmodel cause that is not needed for MVVM. Changed your 2 templates to 1 template. Usage of your boolean in your viewmodel in the zul. Zul : <?xml ver...

did mine thing on SO for once :)
 
8:10 AM
btw what do you guys think about this answer?
-1
A: Calculating if a point is within a polygon, or outside of it

user612313One may also solve for the generalized barycentric coordinates: at least one of them must be negative for points outside the convex hull of the polytope, see for example this thesis on On Generalized Barycentric Coordinates...

not mine..
 
for me it's a bad answer, your comment is well placed
 
(nevermind)
 
:D morning for (almost) everyone
 
0
Q: How do you join two KeyedTuple objects in sqlalchemy?

Oz123I have the following two queries res=session.query(t_marketing_mailing_stats_tbl).filter( t_marketing_mailing_stats_tbl.c.mailing_id==mid) res_t=session.query(t_marketing_time_stat_tbl).filter( t_marketing_time_stat_tbl.c.mailing_id==mid) try: return res.one() + res_t.one() except ...

 
@Vogel612 You forgot flag-flag-flags
 
8:25 AM
@MadaraUchiha ?? And where do you have those?
 
@Vogel612 Right next to the flag-flag-flag-flags.
2
 

« first day (423 days earlier)      last day (3576 days later) »