« first day (769 days earlier)      last day (3180 days later) » 

12:00 AM
There are 1392 unanswered questions
@QPaysTaxes I think it'll get reversed.
I got this reversed, so yeah.
I got my query to work! /r/YAY
@QPaysTaxes Well, I'm ahead of you in the quarter leagues, and the yearly leagues.
Here's my crappy query.
  Id AS [Post Link],
  Score            ,
  ViewCount        ,
  FORMATMESSAGE('%d / %d', Score, ViewCount) AS [Vote Percentage]
  Score     >= 15  AND
  ViewCount >= 500
I've never heard of FORMATMESSAGE, what does that even do?
It's like str.format in Python, or String.Format in C#
@EthanBierlein, you should put your commas at the beginning of the line like(, score)
Dunno. The data explorer just seems to only allow single quotes,
12:12 AM
Double quotes don't work in some engines
Most engines, actually
double-quotes are for column and table names, etc.
Hey, does anyone here know how to do graphs with the data explorer?
single-quotes are got strings
I saw one of your queries a while ago @rolfl, and it had a pretty graph.
@EthanBierlein You read the help?
12:13 AM
Wow. I never realized there was a help page.
Most people don't ;)
it's called a CTE - a common table expression.
that format is SQLServer specific
12:15 AM
Not really. It works in most SQL, except MySQL
@Phrancis Sure.... huh.
OMG, it is standard.
@rolfl PostgreSQL ^^
good luck
No worries! (pls don't downvote)
@QPaysTaxes If you want a reason to earn rep, and you want that reason to be catching up/passing me, then that's fine.
I am not possessive about my reputation like I am about the badges ;-)
@QPaysTaxes Is that why you code in Ruby? (sitcom audience laugh)
@rolfl You going for the last day of the Legendary badge soon?
12:22 AM
that's the idea.... yeah
@rol MySQL ^^ ;-)
Last day of the Legendary badge?
@Phrancis "You have an error in your choice of DBMS
Q: Spell Checker in C

syb0rgI recently stumbled across this article on how to write a spelling corrector, and figured I'd try to have a go at it in C (mainly because the link at the end of the page for the C code is broken). Here is what I would like reviewed: Accuracy: What can I do to make the program output a more acc...

12:24 AM
@rolfl Right. MySQL is the only RDBMS I know (besides Access, not really a RDBMS) that supports only very little of the ANSI SQL standard
I learned something there about the CTE's ... now I am kicking myself I did nto use them before.
@CaptainObvious About time buddy
Spall cehker?
@syb0rg Feel free to pimp it here b4 cpt obvi does?
@Quill You must be new here ... ;-)
12:25 AM
@rolfl An actual one this time
@Quill I already do that way too much lol
@rolfl I have my own bias on CTEs, I think they're good sometimes (on complex queries) but not so much others times (like the simple query I posted a bit ago)
@rolfl Does 5 months count?
Dec 11 '13 at 1:49, by syb0rg
Hi @Jamal
(it is actually small)
@QPaysTaxes I am 20 months here and new...
12:26 AM
I suppose
Maybe we're all new (except mods)
I visit on occasion
Life keeps me too busy
And @rob0t is offline
Last seen 4 secs ago
 visited 590 days, 590 consecutive
> visited 620 days, 2 consecutive
Damn it, broke my day count
12:29 AM
@EthanBierlein Try not to use them within the hour
I like it
> Did I miss a star-fest?
Guys, I've already used them all up in the half hour I had them back,
46 secs ago, by Quill
@EthanBierlein Try not to use them within the hour
12:30 AM
Petition on MSE for infinite stars!
@EthanBierlein ... RSA ;-)
@syb0rg Really?: #define SIZE_DICT 235886
@rolfl What's wrong with that? haha
@EthanBierlein Do it, let's watch how fast the mods rek (close) it
It's the number of lines in the file
With each line being a word
12:31 AM
But it doesn't necessarily refer to the number of lines in the file
It refers to the number of words in the dictionary
1 min ago, by syb0rg
It's the number of lines in the file
1 min ago, by syb0rg
With each line being a word
Q: Why can't we have more stars in chat?

Ethan BierleinI don't see the purpose of the star-limit. Why is there one? And, if possible, can we have unlimited stars? We do after all, have some star-happy users.

Feel free to pimp ^^
12:34 AM
Which message did you permalink?
Wow, three upvotes immediately. Thanks santas!
@Quill click the link. I think it's one of yours.
D'aw thanks ... I think
Wuzzup @hichris123
I'm here to investigate the need for more stars.
With luck, the dictators employees of SE will see that.
12:35 AM
A hearing is now convened
Present your case.
We need more stars. That's the case.
Especially in a star-happy room like The 2nd monitor.
Stars are a precious resource, and to be issued with care, not abandon
Vote time!
All in favor?
12:36 AM
Ayes have it.
Hearing is closed.
hi chris, bye chris
Do you have a specific question? "I experience difficulties" doesn't tell us much. What kind of difficulties are you experiencing, precisely? If you're just looking for a code review, there's a different site for that. — Matt Johnson 37 secs ago
They just drag it out for years instead.
12:38 AM
@MattJohnson Note that on Code Review, the code must be working. "...I experience difficulties when connecting on different networks." suggests this isn't the case. — QPaysTaxes 20 secs ago
@QPaysTaxes The original said stop pretending, I didn't notice the change
I'm here to provide a method of entering and exiting the court used to investigate the need for more stars.
Unfortunately, seems I'm a bit too late...
Hello @Doorknob
Judge and jury returned a verdict already
That's okay, you can stay. We love guests!
12:38 AM
Yay guests.
@EthanBierlein cough You must be new here too.
@Doorknob is the sworn enemy
@QPaysTaxes, you can use the auto commenter posted in meta for that
@rolfl I'm what? I have no clue what you're talking about. :D
Oh, well, okay.
@Doorknob So shog was giving me the gears about us not having as high of an answer rate as you.
12:40 AM
@rolfl I guess that there is some "history" here that I haven't heard in my few months on CR
Code Golf & Programming Puzzlescodegolf.stackexchange.com

Beta Q&A site for code golfers and for those who interested in code golfing (from beginners to experts), and programming puzzles.

Currently in public beta.

answer rate almost 10 per question.
^^^ superior site :P
Code Reviewcodereview.stackexchange.com

Beta Q&A site for feedback on projects you're working on, by sharing your code with fellow programmers and getting extensive feedback/review of best practices, design pattern usage, application UI, security, etc.

Currently in public beta.

ous is 1.8
It's not even Q&A though.
@EthanBierlein Neither is CR.
12:41 AM
I figure we need to dchoose the winner by byte-counts
Well, okay.
I have pizza and a movie on the go.
Gotta run and be social... IRL
@rolfl Isn't defending CR's honor more important?!
@Doorknob But the only reason there's a high answer count on codegolf.se is because challenges are posted there. They're essentially competitions, and what good is a competition without lots of people? That's why there's a high answer rate there.
@Doorknob hey hey hey, keep it civil, gentlemen
12:43 AM
brb, gotta get ready for dinner.
Or the mug.
Where is Mat anyway?
@EthanBierlein, I improved your link
@EthanBierlein True, and it is a bit silly to compare the statistics of two wildly different sites like that. (But it is fun. :P)
lol ikr
well, brb
@QPaysTaxes Is he a mug-half-empty or a mug-half-full kind of mug?
Hmm, wonder if he does road trips.
FedEx + UPS might not handle with enough care.
12:49 AM
@Doorknob @hichris123 Different models ought to be judged by different standards :)
@Phrancis Exactly! In fact, I think "amount of letter 'g's in site name" is an excellent standard to judge Programming Puzzles and Code Golf vs. Code Review by. ;)
There's a remarkable difference between "Project Euler 1 in as few characters as possible" and "I've implemented Project Euler 1 in Java, how can I improve it"
@QPaysTaxes Because "greatest average word length" is a much better metric, obviously. :D
@Phrancis I'm stealing this from someone (I think it was rolfl), but I remember there was a quote like "The goal of CR is to write good code. The goal of PPCG is to write bad code." :P
I don't think PPCG code is bad by definition
(though often in practice, it is)
@Phrancis I challenge you to find an answer to a question that you wouldn't consider bad.
12:54 AM
@Doorknob Well, it's good code, just unreadable.
(I guess sometimes there are opportunities for writing good code (, ), but rarely ever does that happen)
@QPaysTaxes I stand proudly behind that statement :D
Can someone help me understanding code posted on CR?
@QPaysTaxes ... do you have a link to that, so I can delete it?
ah, okay
In codereview.stackexchange.com/questions/47932/… <- this question, the second method (iterative breadth first forward).. I see the following line:
 while (current = stack[stackItem++])
12:56 AM
Wouldn't that always be "true"?
Doorknob in CR: There was this one post where the code didn't work
QPaysTaxes: do you have a link to that, so I can delete it?
For once, I thought FizzBuzz would be a good measure to compare PPCG and CR ;)
Or actually how are maps converted in javascript
@QPaysTaxes I'm perfectly well aware of these things (c++ experience, but no javascript)
Uh ye, but wouldn't it throw an out of range exception or something?
@Phrancis Isn't that JS answer fantastic? ;)
Consider a tree of a single element (so no childs) then the "list" will never contain more than a single index.
so the second "run" it tries to access element [1] but there is none
12:59 AM
@paul23 Upon the NUL character, it would be treated as false
At least in C
@syb0rg ? it's not a character array lol? it's a simple list.. But apparently the accessing out of bounds is possible in JS
JavaScript does funny conversions like that, which is part of why many don't like it
@syb0rg JS strings aren't null-terminated, but they act like an object, and object['somekeythatdoesntexist'] is undefined.
(well, they are an object, not just act like one)
Ah, didn't know it was JS
I came to the question trying to find effective ways to iterate over a tree-structure without recursion
I was trying at home to make a depth-first iteration, but yea breadth first is so much more logical without recursion
1:03 AM
Numbers ? Who needs number when you have Javascript !


Note: There is an infinite loop that will alert you the sequence.
Isn't the difference between DFS and BFS a matter of switching the order of your recursion?
@Phrancis You think that's impressive, take a look at this (warning, link contains expletives). :)
Oh no, that's pre-order, in-order and post-order
I love the "!![]+![]" part, if i'm correct it's basically doing "true + false" and the operator+ would then convert it to integers?
@Doorknob Oh, that's just outrageous (I don't mind f_ck, but the code is outrageous)
1:06 AM
@paul23 Yes, although there's an easier way (+!+[]).
wut that's even worse
... -.-"
What are the operators there actualy?
(yes, the second + is necessary. ![] is false, !+[] is true.)
1:08 AM
What the hell is !+[], should I read it as (!) + ([]) ?
A: Why can't we have more stars in chat?

QuillStars are designed, like upvotes and close votes, in that, they should be used sparingly to determine the worth of questions, or in this case, chat posts. Whilst in The 2nd Monitor, starwalls and pointless starring are somewhat commonplace, other chat rooms don't take so kindly to over starring ...

On what does the unary ! operator operate then?
JS is weird like that: [] == 0 -> true, ![] -> false, !0 -> true.
@paul23 ! ( + ( [] ) )
The + is also unary.
@Doorknob, can you take a look at my MSE star answer?
oh ye right, to make it a number, and that works?
1:09 AM
@Quill Sure.
I'm back
shakes head
@EthanBierlein o/
@EthanBierlein @EthanBierlein, I wrote an answer for your MSE question
Which wrong turn lead to these possibilities.
1:10 AM
Yeah, I saw it
Arg. Why won't WITH..AS work in the SEDE...
"use strict";
var a = b;
b = (!![] + ![]),
    c = (b + b);
while(++a) {
     e = !(a% (c + c + b));
     alert(!(a% (c + b))
         ? e
         ? "FizzBuzz" : "Fizz" : e
Still bad, but not as bad... @Doorknob
Might not work either. Man, don't know how you guys deal with this day in and day out.
@EthanBierlein What are you trying to do?
It is indeed sometimes (read: often) brain-twisting. :)
@Phrancis Would you happen to know why my WITH..AS clause is failing? I'm getting the error Invalid object name 'QuestionsToAnswer'. Here's the code:
CTEs are not that intuitive to use
DECLARE @MaxAnswerCount INT = ##MaxAnswerCount##;
DECLARE @MinQuestionScore INT = ##MinQuestionScore##;

WITH QuestionsToAnswer AS (
      Id AS [Post Link]
    , Score
    , ViewCount
    PostTypeId = 1 AND
    Score >= @MinQuestionScore AND
    AnswerCount <= @MaxAnswerCount

SELECT * FROM QuestionsToAnswer;
SELECT COUNT(*) FROM QuestionsToAnswer;
I think I did it correctly, from looking it up online, but it keeps failing.
1:14 AM
SELECT * FROM QuestionsToAnswer;
SELECT COUNT(*) FROM QuestionsToAnswer;
I'm pretty sure that's where your primary problem is. Those are two separate queries
@Phrancis you may also enjoy codegolf.stackexchange.com/a/21857/3808
Argh. Stupid SQL.
@EthanBierlein SELECT * can make things less obvious
In your case, the CTE is completely unneeded
Also, COUNT(*) is problematic. Count all what?
In best case, every record will count 1. I worst case, you'll get bugs like you're experiencing
@Phrancis I use a CTE because I don't want repeated code like this:
    Id AS [Post Link]
  , Score
  , ViewCount
    PostTypeId = 1 AND
    Score >= @MinQuestionScore AND
    AnswerCount <= @MaxAnswerCount;

  PostTypeId = 1 AND
  Score >= @MinQuestionScore AND
  AnswerCount <= @MaxAnswerCount;
Try this
DECLARE @MaxAnswerCount INT = ##MaxAnswerCount##;
DECLARE @MinQuestionScore INT = ##MinQuestionScore##;

    qta.Id AS [Post Link]
  , qta.Score
  , qta.ViewCount
FROM Posts AS qta
    qta.PostTypeId = 1 AND
    qta.Score >= @MinQuestionScore AND
    qta.AnswerCount <= @MaxAnswerCount
Now, you have to decide what you are wanting to count
@EthanBierlein OK, I hear you, and it's a common misunderstanding
1:22 AM
Ah, okay. Thanks @Phrancis
@EthanBierlein If you want multiple queries into the same result set, you have to use UNION or UNION ALL. However, it is very strict on types (think static typing)
So the SELECT Id FROM Foo UNION SELECT Id FROM Bar have to type-match for every record, otherwise you'll get errors
I'm wondering if my current structure of the program will stay logical/manageable.
I am making a library for a solar system indicator. Basically I have 2 (major/controlling) "objects": an orbit, and a planet object. A planet and contains sub orbits, but it only keeps a weak reference to it's actual orbit (not owning it). Each orbit has a list of planets (owning the planets) that follow the orbit. This is to facilitate multiple planets following the same orbit.
@Phrancis Hmm, okay, here's the final result. It's a bit more complex than it should probably be, but I'm still proud of it.
DECLARE @MaxAnswerCount INT = ##MaxAnswerCount##;
DECLARE @MinQuestionScore INT = ##MinQuestionScore##;

WITH QuestionsToAnswer AS (
      Id AS [Post Link]
    , Id
    , Score
    , ViewCount
    PostTypeId = 1 AND
    Score >= @MinQuestionScore AND
    AnswerCount <= @MaxAnswerCount

SELECT * FROM QuestionsToAnswer UNION
      COUNT([Post Link])
    , COUNT(Id)
    , COUNT(Score)
    , COUNT(ViewCount)
  FROM QuestionsToAnswer;
However this has now generated a quite complex tree like structure, and seeing a max recursion depth forces me to take some rigourous turns in lowering the tree. (basically adding a system object that has ownership over everything).
CTE is huge overkill if you're only selecting from a table or two, IMHO
1:30 AM
Yeah, I know, but I'm learning SQL, so it's good for me to practice different methods.
So I'm wondering if I should just let each planet have a unique personal orbit - and make just copies if I want to have multiple planets follow the same orbit.
CTEs are largely overrated, they're useful sometimes but not as often as some say they should be
But, nice job on that :)
Thanks! You've convinced me to learn more about SQL. I find it very interesting :)
Of course, SQL is kind of boring when you don't have a large database to use.
Ooh, that makes me wonder if I could build a standalone application for the data explorer...
Just an example ^^
Welp, I'm saving that script to my collection on github.
1:39 AM
@EthanBierlein You'll be surprised how much "real business" relies on SQL/databases rather than traditional programming, it's good to know about it
Yup. The bank one of my parents worked for actually went through a conversion, where they had to merge all the customer data from the other bank they bought,
And SQL goes many, many levels deeper that the simple SELECT and such
@Phrancis Oh, and btw, I think I've already asked this, but what's the name of the SQL IDE/editor that I see in those screenshots you've posted?
That, is, an epic query.
1:43 AM
It's just SQL.
Yes, but, wow.
Hmm in python which datastructure is the fastest with "in" (for_each iteration)
It's good, very good even; but not quite epic
I wouldn't care for ordering etc, if I access an element I would only access them using "for each"
An array.
what have you tested?
1:44 AM
Nothing yet
Actually, probably a scalar... ;-)
for i in (1):
well I need multiple elements lol
for i in [1, 2]:
^that would then be a tuple ;P
whatever l-)
But, an array, perhaps a numpy array
1:46 AM
But I wonder if say using a dict is faster (cause I don't care about ordering)
Or if there's a structure made specifically to do this
iterating a dict will pull the keys,
Regardless. I am not the python guy in here... but, If I was python, I would iterate arrays the fastest.
Still, even then, unless the data structure is horrible, the differences in performance are probably less than the time you process the data.
@paul23 If you want to test the speed of datastructures using for..in you can just use python -m timeit "code here" at the command line.
@EthanBierlein True - but another thing I always prefer is to use datastructures for what they are meant to do. - Dicts are for lookup things, arrays for having numerically ordered data etc etc.
Yeah. Anyways, here's an example:
Not to be overly critical: but isn't most time spend allocating a list in that case? And hence it can't be trusted since after a few runs the OS/garbage collector probably understands the memory it wants and keeps it allocated?
1:57 AM
True true.
Q: Random Alphabet array script c#

JaiSo I have to write a c program that will generate an alphabet which takes a random path around a 10x10 array. It starts with a 10x10 array that contains only the dot character '.' and start at the [0][0] location. I'll try to draw an example: A B . . . . . . . . . C D E F . . . . . . . . . G ...


« first day (769 days earlier)      last day (3180 days later) »