Skip to content

Instantly share code, notes, and snippets.

Avatar

Jon Ericson jericson

View GitHub Profile
@jericson
jericson / trilogy_question.md
Created Aug 9, 2018
How might I get detailed database error messages from dbplyr::tbl?
View trilogy_question.md

I'm using R to plot some data I pull out of a database (the Stack Exchange data dump, to be specific):

dplyr::tbl(serverfault, 
           dbplyr::sql("
select year(p.CreationDate) year,
       avg(p.AnswerCount*1.0) answers_per_question,
       sum(iif(ClosedDate is null, 0.0, 100.0))/count(*) close_rate
from Posts p
where PostTypeId = 1
group by year(p.CreationDate)
@jericson
jericson / new_mac.md
Last active Mar 10, 2020
My instructions for setting up a new Mac
View new_mac.md
  1. Settings => Mouse => uncheck “Scroll direction: Natural” (Whatever, jerks.)
  2. Settings => Trackpad => Secondary click => Click in bottom right corner
  3. Settings => Keyboard => check “Use F1, F2, etc. keys as standard function keys”
  4. Settings => Keyboard => Modifier Keys… => Caps Lock to Control [Repeat for each keyboard] (Uuuuuuugh)
  5. Settings => Keyboard => Touch Bar shows => F1, F2, etc. Keys [For MacBook Pros with the Touch Bar]
  6. Settings => Sound => Output => Headset
  7. Settings => Sound => Input => Headset
  8. Settings => Date & Time => Clock => check Use a 24-hour clock and Show date
  9. Dock => right click [icon] => [skip for Siri] Options => “Remove from Dock” [Repeat for each unused application]
  10. Safari => Chrome => Download Now
@jericson
jericson / IDVB_comments.csv
Last active Sep 1, 2017
All idownvotedbecau.se comments on Stack Overflow.
View IDVB_comments.csv
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 9.
PostId,Text,Score,CreationDate,DeletionDate
"13519990","I made -49th downvote because: [there was no effort to debug the code](http://idownvotedbecau.se/nodebugging/)","","2017-08-01 16:38:15",""
"45028733","idownvotedbecau.se/noexceptiondetail (I didn't downvote, but still read that as it describes how to get the details of the exception and why it's important to do so)","1","2017-07-11 15:52:54",""
"46006398","http://idownvotedbecau.se/nocode/","1","2017-09-01 18:56:45",""
"44762214","idownvotedbecau.se/noexceptiondetails (well, not enough exception details)","","2017-06-26 14:40:47",""
"45765175","http://idownvotedbecau.se/nocode/","","2017-08-18 21:21:40",""
"45777673","Welcome to Stack Overflow! [I downvoted because no MCVE](http://idownvotedbecau.se/nomcve/). Please post a [minimal verifiable example](//stackoverflow.com/help/mcve), of your problem.","","2017-08-20 01:31:27",""
"45439770","http://idownvotedbecau.se/itsnotworking/","2","2017-08-01 13:53:25",""
"45441543","downvoted because: [there was no
@jericson
jericson / docs_pivot.md
Last active May 17, 2017
Tearing Down the Structure of Documentation
View docs_pivot.md

Since early on in the private beta of Documentation, we’ve used a simple, rigid structure:

Tags => Topics => Examples + optional sections

At the time, users wondered if this was the right structure. Since Documentation is a grand experiment, I figured we’d wait to see how the structure gets used and adjust as needed. But rather than being a step in the right direction, tags and topics were just getting in the way. We didn’t address the problem partially because we focused on other broken features and partially because we hoped the current system would pan out. At long last, we’ve got the message: fundamentally the structure we provided isn’t working. This isn’t something we can address by tweaking a few features; it’s the foundation of the entire product. Let’s work together to find a way of organizing Documentation that’s better than what we have now and, perhaps, revolutionizes the entire gen

@jericson
jericson / Dsafds_draft.md
Created Sep 30, 2016
Dsafds' discarded draft (C++: Copying vs Assignment)
View Dsafds_draft.md

Copying vs Assignment

Assignment Constructor

The Assignment Operator is when you replace the data with an already existing(previously initialized) object with some other object's data. Lets take this as an example:

// Assignment Operator
#include <iostream>
#include <string>
@jericson
jericson / deep_web.md
Created Jun 8, 2016
What exactly is the Deep Web?
View deep_web.md
@jericson
jericson / mod_vac_requests.md
Last active Jul 26, 2016
Moderator Vacation feature requests
View mod_vac_requests.md

Completed

  • Add date/reason for absence to the mod page instead of being in the title attribute.
  • Network vacations for mods with more than one site.
  • Send notifications to community@ automatically.
  • Status on meta should inherit from main.

Declined

  • Begin and end dates for pre-planned absenses. [Unfortunately, because of the way moderator vacation was been implemented, this was not easy this time around.]
@jericson
jericson / documentation.md
Last active Apr 6, 2016
Text for introducing Stack Overflow Documentation
View documentation.md

This is a book for learning more Perl. Neither a reference book nor a tutorial book, the Perl Cookbook serves as a companion book to both. It's for people who already know the basics but are wondering how to mix all those ingredients together into a complete program.—Tom Christiansen & Nathan Torkington, "Preface", Perl Cookbook

Asking on Stack Overflow is a bit like sitting at a sushi bar. If you respect the traditions, there is no better experience. Where else can you get a personalized answer to your programming question from a true master of the field? Unlike sushi, anyone with access to a search engine can sample Stack Overflow answers. What could be better?

Well, suppose someone is standing behind you at the bar and they grab some fish off your plate. After tasting it, they tell the chef, "Hey, could I get that with a bit more salt?"

View keybase.md

Keybase proof

I hereby claim:

  • I am jericson on github.
  • I am jericson (https://keybase.io/jericson) on keybase.
  • I have a public key ASBsLTBLKN7ERrdkUfHHQbmbHaKD1-i14NvT7YVv90ksfAo

To claim this, I am signing this object:

@jericson
jericson / moderator_vacation.md
Last active Mar 10, 2016
Moderator vacation
View moderator_vacation.md

Moderator vacation

Stack Overflow uniquely requires moderators to operate with a standard of duty. Even so, moderators generally feel a sense of obligation to be around in case of problems. Such voluntary dedication is much appreciated and often means people really enjoy what they are doing. But everyone needs a vacation from time to time.

Currently, we have no good way for moderators to communicate their vacation plans to either to Community Managers (we suggest they email us), other moderators (this usually happens in chat) or other users (more on this momentarily). In addition, the temptation remains to "just handle that one flag" if a moderator happens to browse their site while theoretically off-duty. Finally, I believe "vacation" might be a graceful way for moderators to step down if the job stops being fun and rewarding.

Proposal

Pro

You can’t perform that action at this time.