« first day (1105 days earlier)      last day (3211 days later) » 
00:00 - 12:0012:00 - 00:00

00:00
RELOAD! There are 2293 unanswered questions (93.2782% answered)
0
Q: Have a class that holds all the interfaces

Jose AI seriously didn't know how to write this in Google, there must be an answer lying around. Here it goes: I'm using Ninject (IoC) and ASP.NET MVC 5. I have a business layer with a couple of classes. Is it ok if I have one class that holds all these classes? Like this: public class BusinessL...

0
Q: Better alternative than using switch cases to call functions based on string input?

AspergerI am trying to call a function based on a passed string argument. Now I have read that things can be solved in a more OOP fashion by avoiding switch cases. I also read about the reflection api but I want to avoid it. Im thinking but It seems I cant figure out how to create a cleaner version of th...

00:16
@Phrancis I've decided that I'm no longer up voting SQL questions that don't include table defs.
Leaving that info out just makes it too difficult.
@RubberDuck table defs are nice, but I prefer exec plans or EXPLAIN (MySQL), at least if they are asking about performance
The explain will help to give them what they want, the def helps us give them what they need. =;)-
But point taken.
How've you been?
Pretty good, just doing my old SQL thing. How about you?
Getting a little more knowledgeable about interoperability engines too, which can be interesting
I think good formatting goes a long way, what do you think? pastebin.com/0vxhHiQi
@Phrancis It's still MySQL
Or rather here
00:31
Stack Overflow just gave us a "shitload on code (sic)":
0
Q: How can i write this code in a shorthand function?

BeginnerprogrammerI am working on an interactive map which highlight specific areas. Now I fixed it but I have a shitload on code I started to write it out in a function but don't know how to start. I hope someone can help me out on this. Below the code I allready started with the function highlightedArea but it...

It doesn't work as intended, right?
Or do the individual click handlers count as working code?
Gotta go for now.
0
Q: Connect four applet

Smarticles101I am making a connect four type of game in java. I want to make sure that all the code seems nice before I decide to add more stuff... I have three classes: Make4: import java.util.Arrays; import java.awt.*; import java.applet.Applet; import javax.swing.JOptionPane; /** * @since 0.1.0 */...

> but it seems not to work
Not having errors is quite irrelevant.
Can we throw it back to SO?
Who migrated it?
Seems like it never should've been migrated.
Good grief
Can that be remigrated to SO?
00:40
Also, it already has 5 answers.
@Mat'sMug around?
@Mast Yeah my thought also
Mug and @janos were both last seen an hour ago.
But 200 is already on it I think.
7 mins ago, by 200_success
Gotta go for now.
Wassup?
Oh look, a lurking mug.
00:42
This should not have been migrated from Stack Overflow, as the code is not working. — Phrancis 2 mins ago
^This Q, was migrated from SO, but is off-topic here, and has 5 answers from SO
> Post Migrated Away to codereview.stackexchange.com by stdob--, Filburt, Matt♦
Was wondering if it could be re-migrated back to there where it (may) belong
I smell a moderator conflict incoming if we migrate it back. May be a good idea to poke them in the moderator chat.
im assuming captain obvious is a bot?
@Smarticles101 RSS feed
00:43
> migration rejected from stackoverflow.com 5 secs ago
Good.
@Smarticles101 A feed actually.
@Duga is the only bot in the room.
@Mat'sMug Should we just close it here then?
@Phrancis It's closed and rejected.
00:44
That's how you reject a migration yes
Either one of those could've caused the other one, not exactly sure how that goes.
@Mast RoboSanta too
@Mast are you sure?
@Quill Oh, right, but he only yells twice a day.
I thought Marvin was here too, but then I remembered he's using my account
00:45
Locked by community, what does that imply/mean in this case?
@Mat'sMug With a room full of lurkers? Never.
so there's a partial bot through me on that list
Site business guys pls
24
Q: Welcome to The 2nd Monitor!

PhrancisSo, you have found your way to the Code Review main chat room, The 2nd Monitor, perhaps for one of these reasons: You were invited or "pinged" by a site moderator or other user to discuss a post on the main Code Review site; You visited Code Review for the 1st or Nth time, and noticed the chat ...

Just trying to think of this OP which may not have had any say in the migration matter (though I couldn't tell, can't see deleted stuff on SO)
00:47
Sorry that didn't go as planned. Please read Minimal, Complete, and Verifiable example and How to Ask help center pages to avoid having your questions put on hold /closed in the future. — Mat's Mug 10 secs ago
OP is probably the victim here, yes. But OP would've been more victimized by letting it stick here than by rejecting the migration.
@Mat'sMug Now that is much more appropriate
For those who decided to migrate this to Code Review, please don't. The code is broken and Code Review requires working code. — Mast 6 secs ago
@Phrancis I presume the system locks the post while migration is sort of in limbo
00:49
That would make sense
@Duga s/broken/not working as intended/
Thanks for handling @Mat'sMug good work :)
@Mat'sMug Semantics, we got a meta about that.
their post is going to get sucked into the void of migration for all of eternity
00:51
No.
It will stay locked now.
no, rejecting the migration unlocked the post on SO
@Smarticles101 If they can improve their SO version, I don't see a reason why it wouldn't be OK on SO
> Migration Rejected
occurred 8 mins ago
Post Unlocked by Community♦
occurred 8 mins ago
@Mat'sMug Yes and no.
On my screen, it's perfectly on-hold.
look at the edit history
00:52
I know.
But the on-hold notice at the bottom of the question still sticks.
because it is off-topic
There may be 2 copies of it
Yes, it isn't locked, but still on hold.
locked != on hold
2 mins ago, by Mat's Mug
no, rejecting the migration unlocked the post on SO
so more yes than no ;-)
I feel sortof bad for the OP
00:53
meh
one does not simply dump a "shitload of code" on SO and get away with it
@Mat'sMug Yes, I should've phrased that better.
the applicable close reason actually goes like this:
> Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example.
BTW, @Smarticles101 it's unfortunate your question came right in before this mess, so here
17 mins ago, by Captain Obvious
0
Q: Connect four applet

Smarticles101I am making a connect four type of game in java. I want to make sure that all the code seems nice before I decide to add more stuff... I have three classes: Make4: import java.util.Arrays; import java.awt.*; import java.applet.Applet; import javax.swing.JOptionPane; /** * @since 0.1.0 */...

@Phrancis haha thanks
00:56
oh, . I talk out of my .....mug, everytime. keeping clear.
@Smarticles101 You're using Swing, any chance you could add a screenshot? That usually makes posts "stand out" a bit if it has a visual aspect :)
And now for something completely different. I posted a question.
0
Q: String manipulation for shell project

Programmer 400I'm writing a shell, have refactored my code from my previous question (especially the function that the answer was about) and would like a new review. The purpose of this functions is to split and tokenize a string. The elements of the array result are the tokens from a command-line pipeline whe...

0
Q: Rate limiter utility class

Donald.McLeanI had a problem in my system where the class that sends messages to other systems sometimes gets flooded and so I needed to add rate limiting. I threw together something that would work, but I would really like to see what I can do to improve and/or clean it up. This class does not do the actual...

Sure enough you did!
for (loopCount <- 1 to 5)
What is this <- operator?
Is it bascially just saying "1 to 5 is the loop count"?
Probably.
01:02
I added screenshots :D
2
Q: Connect four applet

Smarticles101I am making a connect four type of game in java. I want to make sure that all the code seems nice before I decide to add more stuff... I have three classes: Make4: import java.util.Arrays; import java.awt.*; import java.applet.Applet; import javax.swing.JOptionPane; /** * @since 0.1.0 *...

@Smarticles101 Nice!
@Phrancis thanks for the edit
I'm still learning Java at a fairly beginner level, have yet to make an applet. I'm working on threads at the moment
0
Q: Generate random number from a range to be used as time in milliseconds

Jessica CI'm trying to figure out how to generate a random number so that my stimulus will appear on the screen for a random time between 1200 and 2200 ms. I've figured out that random.randomint (1200,2200) will generate the number i'm looking for. However this gives me a time in seconds, not millisecon...

@Phrancis I haven't learned threads yet, but I know most of the basic features of java. In my cs class someone was shocked the other day when they asked if I was good at using swing and replied "no"
that kid considers me the smartest in the class
01:09
@Phrancis if "->" is for "goes to", then "<-" has to be "comes from"
@Smarticles101 We're learning in a different order then, I'm going through a book, and applets is one of the last sections
Threads are pretty interesting, though not necessarily "natural"
I'm pretty late to the party, also lol *feels old*
yeah, multi threading seems very confusing
@Phrancis I think it's a for-comprehension operator.
@Donald.McLean you could have written that as a standard for loop syntax I presume?
@Smarticles101 I have found the actor model very helpful for doing multithreading.
@Phrancis That is standard for loop syntax for Scala.
01:14
Ah, gotcha
ls
cd ../
So used to the for(i = 1; i <= 5; i++) of Java
@rob0t this is not a command line
I'm not sure why they got rid of the old C style for loop syntax, but they did.
@Donald.McLean thanks, I'll check it out
01:16
@Smarticles101 I mistook rob0t's terminal for the actual bash terminal
9
@syb0rg wow, for a minute I thought that @rob0t would ask what those commands did.
@Smarticles101 ^ if you ever want to reply to a specific message
Nah, I just forgot that he can make himself reconnect to the chatroom
He's now been taken offline, hence him not responding to his name
@Phrancis That is so complicated
There are so many modern features in Scala that I don't even know what all of them are, and some of the ones I do know, my understanding is a little shaky.
01:19
@Smarticles101 just click the little arrow to the left of a message not your own, then click reply
@Phrancis You can hover over the message and then click on the arrow at the right too
It's a mini shortcut
@syb0rg Always forget about that...
I only go to the right side for starring
2
Apparently you can flag over there as well, I've never gone that way to do that tho
huh, I never even noticed that darn arrow
I dont think my finger can handle any more clicking
01:23
I think there is a keyboard shortcut to reply to one of your pings... forgot what it was
@syb0rg that is definitely what I need
@Smarticles101 I notice the applet you made doesn't have a "formal" entry point, e.g. main method... where does it enter?
18
Q: Keyboard shortcuts for chat

Madara UchihaYes, I know there's a script for that. But I think it's useful enough to be inserted into the live chat for everyone. The following keyboard shortcuts are incredibly useful: CTRLUp and CTRLDown - For replying to messages (each Ctrl+Arrow should change the :[message ID] in the chat input. CTRLS...

Oh wait, nvm that's a request
But there are scripts you could install
@Phrancis It enters at the start() method, then it moves on to the paint() method
Ah, here's an actual wiki answer with some actual shortcuts:
6
A: Keyboard Shortcuts in SE Chat

rolflCommunity Wiki Answer: Entering text: Ctrl-K --> Format the text 'Fixed Font' Esc --> Cancel editing the text Markdown formatting is slightly different than in regular comments: ---strikethrough text--- Automagic links: [tag:tag-speak] renders a tag link (whether that tag exists or not) [he...

Made by our monkey
01:28
@Smarticles101 Ah I see, interesting. Is start() inherited from Applet and kind of the default way to enter the Applet code?
[help/on-topic]
;-;
@Phrancis in applets, the init() method is called when the applet is loaded, the start() method is called when the applet is started or restarted, destroy() is called when the browser window is closed, stop() is to basically pause the applet, and paint() does the painting.
@Phrancis All of the methods I just listed are inherited from the Applet class but, the applet requires at least a paint() method to start with but it is good to use start() or init() to run code that only needs to be run once before the initial painting of the program because repaint() is called often by the superclass
It was too long to send in one message -.-
@Smarticles101 Thank you for explaining, that makes sense :)
@Smarticles101 I won't bother you with more questions now, I'll learn about applets soon enough. In case you want to look at threads (beginner stuff) this is what I've been working on
Just a bunch of disjointed exercises really
@Phrancis Thanks. I'll look into it
02:08
@Mast that made me lol
yesss HipChat has a grumpycat emoticon
0
Q: Step Back in List While Removing From It And Iterating

Joe DImagine you're iterating over an array of objects, (in any language really, for the purposes of this question lets say Java) I see many solutions involving Iterators, etc. however, I often use this method: ArrayList<SomeObject> objectList = new ArrayList<>(); for(int i = 0; i < objectList.size(...

02:29
The request to review the code really should be on the codereview site. — KevinO 43 secs ago
02:46
0
Q: Are specific troubleshooting questions on topic?

OldBunny2800In the Help Center, I read that general questions about code review are off topic. It also says that only working code questions are on topic. Does this mean I can't ask about my finished code that has an unexpected bug I can't find? Resource for answerers perusal and laziness: What topics...

0
Q: Insert into two tables during user registration using PHP

jakeI'm working on creating a user registration script in PHP. I have two tables that need to be inserted into. One that stores some general user information, and another that stores their login credentials. My issue is that my code to perform these insert is a mess of if/else blocks and I'm tryin...

 
1 hour later…
03:48
As a recovering developer, I seem to recall final being a brilliant tool for preventing harmful behavior from entering critical sections. I also seem to recall inheritance being a powerful tool in a variety of ways. It's almost as if gasp different tools have pros and cons and we as engineers have to balance those factors as we produce our software! — corsiKa 13 hours ago
0
Q: Generating a html table with colspan and rowspan from a one dimensional array

ChrisI will be given the following input: const input = [ { value: "a1", colspan: 1, rowspan: 1 }, { value: "a2", colspan: 1, rowspan: 1 }, { value: "a3", colspan: 1, rowspan: 3 }, { value: "b1", colspan: 1, rowspan: 1 }, { value: "b2", colspan: 1, rowspan: 1 }, { value: "c1", cols...

 
2 hours later…
06:03
Reading Clean Code is really interesting and it's such a good book. I'd recommend it to everyone who hasn't read it based on what I have read so far.
I think it's really interesting how it starts by trying to drill professionalism into your head and that there is never an excuse for not testing your code
and also teaching you how to say "no" and how to correctly say "yes" to managers, etc
I got that for the secret santa from @Mat'sMug :D
It's an awesome book
I've only just started the Coding chapter now but I'm reading it on my phone and yeah, just really impressed so far
also interesting to see Roy Osherove in there :P I remember reading his guide on testing a while ago
0
Q: compile data from multiple sheet into one based on heading in excel

Praveen Ankolekari need one help in writing macro to copy data from multiple sheets into one based on matching heading column, i have 50 plus sheets in one workbook in each sheet 30 plus columns present however i wanted only 5-6 columns data to be copied from there, i have given the column heading in one sheet b...

@Mast om nom nom troll food
(I have no idea what I am on about)
oh lord
i'm getting 23 hours of overtime pay this month
Did you forgot to go home again
06:14
LOL
actually, yes
I ran out of issues at lunch time again... I've been scalping issues since then
I have four (soon to be five) open PRs
you use PRs internally?
yeah
I am not sure how I feel about them. Bitbucket uses them, but it always does a merge commit even if the branch can be fastforwarded, which breaks bisect
issues -> go in a sprint -> get worked on -> PR -> "is it working" review -> merge -> Q&A -> Marked as done in the sprint
repeat steps three and four until you drink yourself to death at your desk
2
06:19
idk
to me merge commits are really annoying and clutter
i don't like any workflow that actively encourages them
There's always merge conflicts for every push, pull and PR
Thankfully Atom has a nice merge conflicts tool
Well, you can use git rebase to remove those merge conflicts
you are allowed to force-push to PR branches assuming they are personal branches
which means there's no reason to just ff the PR
unless you want to keep history of PR merges I guess?
but I dont' see why you would want to do that
ff the PR?
ff merge
fast-forward
PR merges are a fancy way for my seniors to scrutinise and condescend my work
Jokes on them, I do that anyway
06:23
Cool, I'm going to do exactly this and have my code reviewed, to mess with my coworkers, thanks :) — C.Evenhuis 56 secs ago
just to mess with his coworkers
that's the worst reason to get a code review
s/mess with/impress and earn the respect of/
Reading about the fast-forward thing, maybe it's better idea to ff smaller branches and --no-ff feature branches
I have the same opinion for minor bug fixes, or features under like 25 lines
but it's better to be safe than sorry, I suppose
i just reallllllly like bisect.
06:27
For some reason Travis doesn't like my grunt setup still
okay, i'm going to trial merge commits simply because thet ability to git revert hash is very appealing to me
06:46
thou shalt always use DateTime.UtcNow
07:04
0
Q: Efficient File Searching

Brendan LesniakDuring an interview I was asked to consider the following: You are trying to find an instance of an error code within a number of log files within a directory. The goal is to count the number of times that the error code appears within the specified files. For the written function, it was t...

07:50
@DanPantry Thou shalt not roll thou own DateTime.
And if you don't keep flags, UTC is preferred, yes.
all times in our db are implicitly UTC, so we have to make sure we convert them all to UTC ahead of time unless we want some nasty surprises
this question is more suitable for codereview.stackexchange.com — AdamSkywalker 1 min ago
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: AngularJS controller to fetch and display employee data from database
Is it just me or is the actual question here completely unclear? Is this a code review? — timgeb 59 secs ago
08:10
@Duga I got a hundred flags a day. You're not match for my powers.
Yesterday, we got 16 more accepted answers, 18 more questions were answered, 48 more answers were posted, 147 badges were earned, 200 comments were left, 36 more questions were asked, 18 more questions were unanswered, 87 users were created, and 307 votes were created.
Our question answer accept rate went down by 0.0155%.
Our question answer rate went down by 0.0457%, and our answer accept rate went down by 0.0014%.
@DanPantry When you get on, can you help me get D3 going?
@Quill I've yet to consume enough alcohol to even pass out, much less die.
possible answer invalidation by Phuti on question by Phuti: codereview.stackexchange.com/posts/128069/revisions
08:26
@EBrown I've never used d3, sorry
and I have a really, really busy day ;-; I have been assigned 25h worth of work.. there are 25h left in the sprint
and I am 99% sure that the work I have been assigned is going to take more than 25h lol
Holy carp
I made it work
0
Q: Simple Calculator: Good code? Optimizations?

MattaI created a simple command line calculator, and then after some reading I made a few tweaks and then remade it with a friends idea to make it more simpler. I'm wondering if this can be more optimized or if any part of the code can be done "better"? I recently started learning Java and wanted fo...

This is actually really easy.
08:30
@EBrown Madness.
D3 isn't so bad.
Zak
Zak
Monking @all
yo
Any Atom experts on?
@EBrown No expert, but you could just shoot your question and hope one of us answers it anyway.
08:43
My problem is with tabs. I want hard-tabs, but Atom refuses.
@EBrown Settings->Config
It should open up a config.cson file
  editor:
    tabLength: 4
    tabType: "hard"
you need one of those in there
Ah, there it is.
Holy carp
D3 graphing works.
Hmm, time to play it looks like.
I need to figure out line graphs next.
09:07
@Mast I have a D3 graph. :)
0
Q: Table-Driven Finite State Machine

tobsprI'm writing a finite state machine based on a transition table in C++ 14. My code so far looks like: #include <array> #include <functional> template < typename _State, typename _Event > class FSM { static constexpr size_t state_count = static_cast<size_t>(_Event::_); static constexpr size_t...

Sorry if this should be going to code review; when I started asking the question I'd not hit upon the solution, and since the solution I found seems very hacky I felt it's suitable for either community. — JohnLBevan 10 secs ago
@EBrown Pics or didn't happen.
Just a sec.
possible answer invalidation by Joseph on question by Joseph: codereview.stackexchange.com/posts/127989/revisions
09:16
@Mast ^^
You might want to put this question in 'Code Review' stackoverflow, not really appropriate here. — Stacker-flow 46 secs ago
@EBrown Shiny.
09:39
@Mast ^^
The colour change is when you hover a bar.
:D
You can put a line graph and a bar graph together.
That's awesome.
Yup.
Oh man, D3 is sweet.
0
Q: Populating an array with times with half hour interval between them

user3494179So for example, getTimes("12:00", "15:30"); should return: ["12:00", "12:30", "13:00", "13:30", "14:00", "14:30", "15:00", "15:30"] The input parameters are always in :30 or :00 intervals(so 06:00, 06:30, 07:00, ...). getTimes("06:00", "17:00"); -> should work getTimes("06:30", "17:00"); -> sho...

possible answer invalidation by Skyp89 on question by Skyp89: codereview.stackexchange.com/posts/128223/revisions
10:01
@Duga Rolled back.
I happen to have a zombie answer on that, makes me wonder what's wrong with it...
10:17
My mom, little sister, and little brother all just woke up. I haven't slept yet and it's hilarious to see how tired they look.
Mom: "how'd you sleep?" Me: "jokes on you, I didn't."
I got a whole 4 hours of sleep this night. The rest is coffee.
@Mast I did something horrible.
Zak
Zak
10:33
@Mast That's about 3 hours more than (I think) I got.
Google: "Parsey McParseface, an English parser that we have trained for you and that you can use to analyze English text."
0
Q: Factory that Creates Reusable Class Builders for a Racing App

Josh DawsonIn a project for fun/practice, I made a few builder classes that all started to feel the same, so I decided to generalize them by creating a factory that would automatically assign the similarities that they all shared. Each of my builders would have a private variable, data, which would eventu...

Zak
Zak
Also, "SyntaxNet, an open-source neural network framework ..." I can't see any way that could possibly go wrong.
I'm voting to close this question as off-topic because it is seeking a code reviewQuentin 9 secs ago
I think you should put on some effort or atleast google. Check these links wideskills.com/java-tutorial/java-swing-calculator codereview.stackexchange.com/questions/56718/…Beniton 51 secs ago
10:51
Wait, what?
I can see my profile picture.. and @Zaks...
That means that Facebook must be unblocked on the work PCs
Wtf it is
get Gravatar
you should download as many viruses as you can while the proxy is off
2
I am the original poster of this post, I did not previously have an account on code review and have subsequently made one. I don't have enough rep to reply to Raystafarian as a comment, so it seems logical to reply as an answer. Sorry for confusing you — SRS 5 mins ago
@Mast I have something cool for you.
-1
Q: I want to create an MCQ quiz using Java

T LinI am new to Java and want to create an MCQ quiz. I have already created the JForm using Netbeans. The question will be displayed in a jlabel and the answers in radio buttons. This is what I have so far. package interviewsystem; import java.util.ArrayList; import java.util.Enumeration; import ...

in The Nineteenth Byte, 20 secs ago, by Quill
I have good news: I officially don't have node on my laptop anymore :D
Except I don't like these box plots.
11:05
@Zak There was a huge ship with a naming contest. One of the contesting names was something along the lines of Boaty McBoatface.
and it won.
@EBrown The fun with D3 is you can plot a lot of different things. If you don't like your plot, modify it so it gets even better.
Zak
Zak
@Mast Oh believe me, I'm aware. It was virtually impossible *not* to come across that story.
and the owner of the boat was then like "yeaaaaaaaaaaa nahhhhhh"
@Quill why the frick frack paddy whack not?
11:08
because grunt is still not working so I decided to update node... bad idea
@Quill Now everything stopped working?
yeah, it start throwing seg faults and now it wont brew install
@Mast I can't make it do anything I want.
Yes you can.
It's just a heck of a lot of work sometimes.
11:18
More work than I care for at this moment. :P
How have I not seen this before...
With links and all.
Almost a one-stop resource shop.
0
Q: Calculating the biggest number of consecutive ones in a binary number

AdHominemGiven code calculates the biggest number of consecutive ones in the binary representation of a number, for example 6 -> 2 (110), 5 -> 1 (101): String numberAsBinaryString = Integer.toBinaryString(number); List<String> listOfConsecutiveOneStrings = Arrays.asList(numberAsBinaryString.split("0")); ...

11:35
aaaand we're back in business
0
Q: Creating a class person, which takes in user input and sorts their names in lexico order and ages in natural order?

NiaocI am creating a class Person which will be the outline of what the people will be defined as. Is there any glaring mistakes in this, thank you: import java.until.ArrayLists; import java.util.Scanner; public class Person{ private String name; private String phoneNumber; private int age; private...

I need someone's javascript help.
sure
I have an array data, which has an array of objects within it that have various properties.
I want to enumerate all the data objects, and anytime an object has a
has a?
11:44
Right, so premature send. Anyway, the objects have a DayOfWeek and DayOfWeekInt property.
Basically, I want to average all the values for the same DayOfWeekInt or DayOfWeek.
I.e. the dataset might look like:
var data = [
    {DayOfWeek: "Sunday", DayOfWeekInt: 1, Difference: 5},
    {DayOfWeek: "Monday", DayOfWeekInt: 2, Difference: 6},
    {DayOfWeek: "Tuesday", DayOfWeekInt: 3, Difference: 7},
    {DayOfWeek: "Wednesday", DayOfWeekInt: 4, Difference: 8},
    {DayOfWeek: "Thursday", DayOfWeekInt: 5, Difference: 7},
    {DayOfWeek: "Friday", DayOfWeekInt: 6, Difference: 6},
    {DayOfWeek: "Saturday", DayOfWeekInt: 7, Difference: 5},
    {DayOfWeek: "Sunday", DayOfWeekInt: 1, Difference: 5},
    {DayOfWeek: "Monday", DayOfWeekInt: 2, Difference: 6},
And I want to average each group of DayOfWeek, or DayOfWeekInt (whichever is easier).
Into the following object:
var dataWeekdayAvgs = [
    {DayOfWeek: "Sunday", DayOfWeekInt: 1, Difference: 5},
    {DayOfWeek: "Monday", DayOfWeekInt: 2, Difference: 6},
    {DayOfWeek: "Tuesday", DayOfWeekInt: 3, Difference: 7},
    {DayOfWeek: "Wednesday", DayOfWeekInt: 4, Difference: 8},
    {DayOfWeek: "Thursday", DayOfWeekInt: 5, Difference: 7},
    {DayOfWeek: "Friday", DayOfWeekInt: 6, Difference: 6},
    {DayOfWeek: "Saturday", DayOfWeekInt: 7, Difference: 5}
];
Where there is only one entry for each DayOfWeek.
@CaptainObvious 2 more VTC.
0
Q: Building an index of items from an iterable-of-tuples

William PayneIs there a more conventional / standard / easy-to-read way of building an index of tuples from an iterable than this: # ----------------------------------------------------------------------------- def build_index(itable_tup): """ Return an index for an iterable container of tuples, all ...

@EBrown Too many magic numbers.
Make them relational to each other.
Whatever the DayOfWeekInt of Wednesday will be, it will always be the DayOfWeekInt of Tuesday +1. Overflow at 7. Create a new type for it :P
Figured it out.
function averageForDayOfWeek(dayOfWeek) {
    var sum = 0;
    var count = 0;

    data.forEach(function(d) {
        if (d.DayOfWeekInt == dayOfWeek) {
            sum += d.Difference;
            count++;
        }
    });

    return sum / count;
};

var dataWeekdayAvgs = [
    {DayOfWeek: "Sunday", DayOfWeekInt: 1, Difference: averageForDayOfWeek(1)},
    {DayOfWeek: "Monday", DayOfWeekInt: 2, Difference: averageForDayOfWeek(2)},
    {DayOfWeek: "Tuesday", DayOfWeekInt: 3, Difference: averageForDayOfWeek(3)},
@Mast ^^
@EBrown For a split second I thought you were drawing a filter ^^
11:56
:P
Looks good!
That shows a clear trend. :P
Exactly enough information to see what you want to see. Not too much, not too less.
Yeah. The bar graph will be disappearing in the actual release.
And the scatter dots will be gone as well.
I think the scatter dots are good, but only if it's for a couple of data points.
Do it for a year's worth and you won't see a thing.
11:58
Instead, I'll be placing several coloured lines, for each type of change.
I.e., TotalQuestionsChange will be blue, TotalAnswersChange red, etc.
Hmmm, that may be even better. It probably boils down to experimenting a bit with it.
Yeah, I'm about to start the next phase.
00:00 - 12:0012:00 - 00:00

« first day (1105 days earlier)      last day (3211 days later) »