<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Disqus - Latest Comments for alexch</title><link>http://disqus.com/by/alexch/</link><description></description><atom:link href="http://disqus.com/alexch/comments.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Sun, 21 Jun 2020 13:33:04 -0000</lastBuildDate><item><title>Re: Twitch app arrives on LG TVs - FlatpanelsHD</title><link>https://www.flatpanelshd.com/news.php?subaction=showfull&amp;id=1590646435#comment-4962842953</link><description>&lt;p&gt;They forgot to implement login and chat, making it a useless broken toy with no purpose other than to check a box on some marketing list. They also made the mistake of letting the navigation interface *override and interrupt* the currently running stream, like the PS4 and Xbox apps. It's a TV, guys, let me keep watching while I mess with the settings or browse the channel list!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Sun, 21 Jun 2020 13:33:04 -0000</pubDate></item><item><title>Re:  The clickjacking attack El ataque clickjacking </title><link>https://disqus.com/home/discussion/javascriptinfo/the_clickjacking_attack_el_ataque_clickjacking/#comment-4378181183</link><description>&lt;p&gt;`let i = 1` does more than declare the variable i. It also sets its value to 1. That happens every time the function is called, so every 1000 msec, you set i to 1 before putting it on the page.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Thu, 14 Mar 2019 11:37:36 -0000</pubDate></item><item><title>Re:  The clickjacking attack El ataque clickjacking </title><link>https://disqus.com/home/discussion/javascriptinfo/the_clickjacking_attack_el_ataque_clickjacking/#comment-4378176976</link><description>&lt;p&gt;In func2 you are not passing in the alert function. You are *calling* the alert function and then passing it its return value (which is always `undefined`). In func1 you are defining an "inline fat arrow function" and passing it in, so setTimeout will return immediately, then add that timer function to its task queue; after func1 returns control back to the system, the task happens after 0 more msec -- that is, immediately, but not *as* immediately as in func2.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Thu, 14 Mar 2019 11:34:45 -0000</pubDate></item><item><title>Re: FormData</title><link>https://javascript.info/deleted#comment-4378170366</link><description>&lt;p&gt;"internal" in this context means "part of the JavaScript runtime implementation". It's a form of hand-waving -- your browser, or NodeJS interpreter, or V8 engine, or whatever program is actually parsing and compiling and running your JS program, has implemented a scheduler somehow. This scheduler is guaranteed to call your timer function after `delay` msec. The details of exactly how JS implements the scheduler don't matter, and in fact the important part is how it behaves.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Thu, 14 Mar 2019 11:30:15 -0000</pubDate></item><item><title>Re: Differences in Defining ES6 Class Methods | cmichel</title><link>https://cmichel.io/es6-class-methods-differences#comment-4246965474</link><description>&lt;p&gt;Those are not class methods. They are all instance methods; some of them rebind this so they can be used in callbacks. A class method is invokable directly from the class without using new. In ES6, class methods are defined with the static keyword.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Tue, 18 Dec 2018 13:54:20 -0000</pubDate></item><item><title>Re: Following Crash, All F-35s Temporarily Grounded For Inspections</title><link>http://digital.vpr.net/post/following-crash-all-f-35s-temporarily-grounded-inspections#comment-4146536810</link><description>&lt;p&gt;correction: "Lightening II" =&amp;gt; "Lightning II"&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Mon, 15 Oct 2018 16:19:47 -0000</pubDate></item><item><title>Re: Refactoring with Visual Studio Code </title><link>https://www.johnpapa.net/refactoring-with-visual-studio-code/#comment-3834273519</link><description>&lt;p&gt;Refactoring is changing the design of code without changing its behavior. It's not reformatting (doesn't change the design), and it's not text-search-and-replace (doesn't respect the design, e.g. two different variables with the same name in two different functions). In fact, of these nine items, only one is a refactoring (Rename symbols in all files). Does VSCode have Extract Method? Extract Variable? Inline Variable? Inline Method? Seems so: &lt;a href="https://code.visualstudio.com/docs/editor/refactoring" rel="nofollow noopener" target="_blank" title="https://code.visualstudio.com/docs/editor/refactoring"&gt;https://code.visualstudio.c...&lt;/a&gt; ... My advice is to either rewrite or rename this article. It's not honestly titled as is.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Sun, 01 Apr 2018 11:11:15 -0000</pubDate></item><item><title>Re: Learn To Code: Arrays</title><link>http://codelikethis.com/lessons/learn_to_code/arrays#comment-3703111647</link><description>&lt;p&gt;here's a hint: reverse the subject and the object, like Yoda&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Thu, 11 Jan 2018 14:33:26 -0000</pubDate></item><item><title>Re: Business Group Builds Case For Carbon Tax In Vermont</title><link>http://digital.vpr.net/post/business-group-builds-case-carbon-tax-vermont#comment-3590326954</link><description>&lt;p&gt;What is your definition of chemicals? Most people realize that chemicals compose all matter, including your body and all the flora and fauna in nature. For instance, water is a chemical.&lt;/p&gt;&lt;p&gt;Also, there's a chicken-and-egg problem with waiting around for people to get off fossil fuels. One of the points of a carbon tax is that it will make climate-friendly fuels and improvements more affordable, which will cause more people to use them. And yes, they are "willing to take that tax revenue and help homeowners upgrade their homes" -- most carbon tax proposals I've seen plow the new revenue either into subsidizing cleaner alternatives, or refunding the money back to the consumers somehow.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Sun, 29 Oct 2017 13:32:35 -0000</pubDate></item><item><title>Re: Business Group Builds Case For Carbon Tax In Vermont</title><link>http://digital.vpr.net/post/business-group-builds-case-carbon-tax-vermont#comment-3590317919</link><description>&lt;p&gt;Sounds like you are engaging in a lot of mind-reading here. If it's an organization made up of businesses, then it's a business organization. Imputing their motives as based solely on PR and anti-growth is pretty disingenuous. They provide several reasons why they think a carbon tax would be pro-growth and pro-business. Why not engage those predictions on their merits?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Sun, 29 Oct 2017 13:26:01 -0000</pubDate></item><item><title>Re: 
          Could we drop Symbols from Ruby?
        </title><link>http://blog.arkency.com/could-we-drop-symbols-from-ruby/#comment-3558441438</link><description>&lt;p&gt;How's this? :foo would still be a symbol. It's just that things like == and hashing would work interchangeably if a symbol were implemented as a frozen string.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Mon, 09 Oct 2017 08:54:22 -0000</pubDate></item><item><title>Re: 
          Could we drop Symbols from Ruby?
        </title><link>http://blog.arkency.com/could-we-drop-symbols-from-ruby/#comment-3558436990</link><description>&lt;p&gt;Rails introduced things like "HashWithIndifferentAccess" to solve a problem. For better or worse, Ruby lives in an ecosystem where it's the only player who cares about the distinction. If symbols were read-only strings then we could use JSON and HTTP/CGI and SQL all the other stuff without hassle.&lt;/p&gt;&lt;p&gt;Changing the *superclass* of Symbol so that it *extends* String would not hurt performance, and it would decrease confusion. You can still keep the symbol syntax -- :foo would just be the short syntax for "foo".freeze (or .intern or whatever).&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Mon, 09 Oct 2017 08:50:37 -0000</pubDate></item><item><title>Re: 
          Could we drop Symbols from Ruby?
        </title><link>http://blog.arkency.com/could-we-drop-symbols-from-ruby/#comment-3558434817</link><description>&lt;p&gt;Amen! I've been asking the same question for years: See &lt;a href="https://stackoverflow.com/questions/11085564/why-are-symbols-not-frozen-strings" rel="nofollow noopener" target="_blank" title="https://stackoverflow.com/questions/11085564/why-are-symbols-not-frozen-strings"&gt;https://stackoverflow.com/q...&lt;/a&gt; . The answer seems to be historical accident, and too many libraries to update. A major version release of Ruby would be a great time to fix this... is anything planned for 3.0?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Mon, 09 Oct 2017 08:48:47 -0000</pubDate></item><item><title>Re: There Are 3,600 Airbnb Hosts In Vermont. Lawmakers Can&amp;#039;t Agree On How To Regulate Them</title><link>http://digital.vpr.net/post/there-are-3600-airbnb-hosts-vermont-lawmakers-cant-agree-how-regulate-them#comment-3550944852</link><description>&lt;p&gt;You'd pass any fee through to your guests, like a cleaning fee. AirBNB makes that really easy.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Wed, 04 Oct 2017 18:59:10 -0000</pubDate></item><item><title>Re: There Are 3,600 Airbnb Hosts In Vermont. Lawmakers Can&amp;#039;t Agree On How To Regulate Them</title><link>http://digital.vpr.net/post/there-are-3600-airbnb-hosts-vermont-lawmakers-cant-agree-how-regulate-them#comment-3550942525</link><description>&lt;p&gt;"hosts rent out their spaces for about 24 nights" -- per year? per month? for all time? Also, does "on average" mean mean, or median, or what? Numbers matter, especially when they're used to support a claim about regulation by a business that would affect their profit.&lt;/p&gt;&lt;p&gt;For the record, I love AirBNB as both a host and a guest, and I think some regulation is necessary to protect guests and hosts from scammers as well as health and safety concerns. It's too bad we don't even have a straw man bill to debate. What are the "health codes that inns and hotels follow" that you mentioned? E.g. would a home kitchen need stainless steel sinks? Would a bedroom need a lit fire exit sign? Would smoking be banned? Etc.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Wed, 04 Oct 2017 18:57:05 -0000</pubDate></item><item><title>Re: A step by step guide to bulletproof 404s on Rails</title><link>http://jerodsanto.net/2014/06/a-step-by-step-guide-to-bulletproof-404s-on-rails/#comment-2931167674</link><description>&lt;p&gt;may i also suggest... in &lt;code&gt;spec/requests/not_found_route_spec.rb&lt;/code&gt; :&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;br&gt;require 'rails_helper'&lt;br&gt;describe 'making a request to an unrecognised path' do&lt;br&gt;  context 'web' do&lt;br&gt;    it 'returns 404 and HTML' do&lt;br&gt;      get '/nowhere'&lt;br&gt;      expect(response.status).to eq(404)&lt;br&gt;      expect(response.body).to include("&amp;lt;html")&lt;br&gt;      expect(response.body).to include("not found")&lt;br&gt;    end&lt;br&gt;  end&lt;br&gt;end&lt;br&gt;&lt;/code&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Mon, 03 Oct 2016 11:20:23 -0000</pubDate></item><item><title>Re: Debate: Democratic Treasurer Candidates</title><link>http://digital.vpr.net/post/debate-democratic-treasurer-candidates#comment-2817327435</link><description>&lt;p&gt;Dunne sounds *way* in over his head in this debate...&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Tue, 02 Aug 2016 12:57:51 -0000</pubDate></item><item><title>Re: What Bernie Takes From Tuesday</title><link>http://digital.vpr.net/post/what-bernie-takes-tuesday#comment-2719015477</link><description>&lt;p&gt;or even better... Hillary should make Bernie the Secretary of the Treasury!  Or chair of the DNC!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Wed, 08 Jun 2016 12:31:15 -0000</pubDate></item><item><title>Re: What Bernie Takes From Tuesday</title><link>http://digital.vpr.net/post/what-bernie-takes-tuesday#comment-2719002550</link><description>&lt;p&gt;Bernie as Vice President? Nah... Secretary of State, baby!!!&lt;/p&gt;&lt;p&gt;By the way, for everyone saying "it's time to step aside", just relax, he'll get around to it. If someone behind me in traffic is honking at me to go faster, I put on my brakes just to spite them.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Wed, 08 Jun 2016 12:24:01 -0000</pubDate></item><item><title>Re: English Has a New Preposition, Because Internet</title><link>http://www.theatlantic.com/technology/archive/2013/11/english-has-a-new-preposition-because-internet/281601/#comment-2272870575</link><description>&lt;p&gt;I mean on the second page of twitter search results for "because" I found&lt;/p&gt;&lt;p&gt;"WHEN SOMEONE TOLD YOU ONE DIRECTION CANT SING &lt;br&gt;SMASH THIS ON THEIR FACE BECAUSE DAMN VOCALS"&lt;/p&gt;&lt;p&gt;&lt;a href="https://twitter.com/93xfthoran/status/647170565652910081" rel="nofollow noopener" target="_blank" title="https://twitter.com/93xfthoran/status/647170565652910081"&gt;https://twitter.com/93xftho...&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Thu, 24 Sep 2015 20:36:36 -0000</pubDate></item><item><title>Re: English Has a New Preposition, Because Internet</title><link>http://www.theatlantic.com/technology/archive/2013/11/english-has-a-new-preposition-because-internet/281601/#comment-2272862462</link><description>&lt;p&gt;Has it? References, please.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Thu, 24 Sep 2015 20:29:09 -0000</pubDate></item><item><title>Re: Ruby on Enums, Queries and Rails 4.1</title><link>https://hackhands.com/ruby-on-enums-queries-and-rails-4-1/#comment-1992278335</link><description>&lt;p&gt;So basically, Enums -- which should be dead simple -- are actually complicated and fraught and broken in Rails 4. Maybe Rails should start again with stored-as-a-string enums, like this simple snippet I wrote (while teaching a team of junior developers that enums should be dead simple) a few months ago: &lt;a href="https://gist.github.com/alexch/a7be54e1b085718473ff" rel="nofollow noopener" target="_blank" title="https://gist.github.com/alexch/a7be54e1b085718473ff"&gt;https://gist.github.com/ale...&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Tue, 28 Apr 2015 14:35:30 -0000</pubDate></item><item><title>Re: Using Postgres Hstore with Rails 4</title><link>http://jes.al/2013/11/using-postgres-hstore-rails4/#comment-1699744147</link><description>&lt;p&gt;Any way to store types other than string? After I reload, all my values are strings.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Tue, 18 Nov 2014 12:24:20 -0000</pubDate></item><item><title>Re: Page-Specific Javascript in Rails</title><link>http://brandonhilkert.com/blog/page-specific-javascript-in-rails/#comment-1550994033</link><description>&lt;p&gt;Yeah, my solution is not perfect but works to get you up and running. It's using sprockets how it was designed. When Rails wrote the asset pipeline on top of sprockets they kind of broke it by making all JS appear on all pages by default. My trivial solution would be improved by making the javascript_include_tag be smarter and only appear if that file (foo.js for controller foo) exists, and then making sure that for every page you get at most 2 glommed JS files (global + specific) -- which should happen already via sprockets but you never know.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Wed, 20 Aug 2014 07:54:15 -0000</pubDate></item><item><title>Re: http://rubydoc.info/github/defunkt/resque/Resque:enqueue</title><link>http://rubydoc.info/github/defunkt/resque/Resque:enqueue#comment-1550986615</link><description>&lt;p&gt;The documentation for this method could be better :-) As &lt;a href="https://devcenter.heroku.com/articles/queuing-ruby-resque#queueing-jobs" rel="nofollow noopener" target="_blank" title="https://devcenter.heroku.com/articles/queuing-ruby-resque#queueing-jobs"&gt;https://devcenter.heroku.co...&lt;/a&gt; says: "In calling enqueue, the perform method of klass is called, with all the original enqueue arguments. These arguments are serialized as JSON, and therefore it is important to ensure that the arguments can in fact be serialized as JSON. Arguments like symbols, or entire ActiveRecord objects will not work. Try instead to send object IDs or as is the case in the example application, a AWS file token key is sent."&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alex Chaffee</dc:creator><pubDate>Wed, 20 Aug 2014 07:45:48 -0000</pubDate></item></channel></rss>