<?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 hallettj</title><link>http://disqus.com/by/hallettj/</link><description></description><atom:link href="http://disqus.com/hallettj/comments.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 29 Jan 2019 13:35:55 -0000</lastBuildDate><item><title>Re: Chaining custom ZSH widget functions · Adventures in Reliability · Tony Lykke</title><link>https://www.tonylykke.com/posts/chaining-custom-zsh-widget-functions/#comment-4312925681</link><description>&lt;p&gt;Very helpful, thank you! I'm trying out a reusable helper to automate this:&lt;/p&gt;&lt;p&gt;&lt;code&gt;&lt;pre&gt;# Define behavior for a zle widget without replacing existing user-defined&lt;br&gt;# or built-in behavior. Example usage:&lt;br&gt;#&lt;br&gt;#     function reset-cursor-shape {&lt;br&gt;#       echo -ne '\e[1 q'&lt;br&gt;#     }&lt;br&gt;#&lt;br&gt;#     chain-widget zle-line-init reset-cursor-shape&lt;br&gt;#&lt;br&gt;# The example runs `reset-cursor-shape` when the `zle-line-init` widget runs,&lt;br&gt;# and also calls any previously-defined `zle-line-init` widget.&lt;br&gt;function chain-widget {&lt;br&gt;  local widget_name="$1"&lt;br&gt;  local implementation_name="$2"&lt;br&gt;  # Check for existence of a custom user func&lt;br&gt;  if [[ ${widgets[$1]} == user:* &amp;amp;&amp;amp; ${widgets[$1]} != "user:$2" ]]; then&lt;br&gt;    # drop the user: prefix&lt;br&gt;    to_exec="${widgets[$1]#"user:"} \"\$@\""&lt;br&gt;  elif [[ -n ${widgets[.$1]} ]]; then&lt;br&gt;    # There is no existing user-defined widget, but there is a special reference&lt;br&gt;    # to the built-in behavior.&lt;br&gt;    to_exec="zle .$1 \"\$@\""&lt;br&gt;  else&lt;br&gt;    to_exec=""&lt;br&gt;  fi&lt;br&gt;  local chained="_chain_$1_$2"&lt;br&gt;&lt;br&gt;&lt;br&gt;  # Define a function that invokes the new implementation and the original.&lt;br&gt;  eval "function $chained {&lt;br&gt;    \"$2\" \"$@\"&lt;br&gt;    ${to_exec}&lt;br&gt;  }"&lt;br&gt;  zle -N "$1" "$chained"&lt;br&gt;}&lt;/pre&gt;&lt;/code&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Tue, 29 Jan 2019 13:35:55 -0000</pubDate></item><item><title>Re: Build your own Command Line with ANSI escape codes</title><link>http://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html#comment-4169375844</link><description>&lt;p&gt;This is the information I was looking for! It took a surprising amount of searching to find the proper codes for bright colors. Thank you!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Mon, 29 Oct 2018 21:14:39 -0000</pubDate></item><item><title>Re: The Lost Art of the Makefile</title><link>http://www.olioapps.com/blog/the-lost-art-of-the-makefile/#comment-3780832034</link><description>&lt;p&gt;These are both great tips that I was ignorant of. Thanks!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Wed, 28 Feb 2018 16:15:34 -0000</pubDate></item><item><title>Re: Changes I would make to Go</title><link>http://sitr.us/2017/02/21/changes-i-would-make-to-go.html#comment-3215945167</link><description>&lt;p&gt;So my test was in fact flawed. I'm sorry to make false claims!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Tue, 21 Mar 2017 18:09:03 -0000</pubDate></item><item><title>Re: Changes I would make to Go</title><link>http://sitr.us/2017/02/21/changes-i-would-make-to-go.html#comment-3215718036</link><description>&lt;p&gt;&amp;gt; One problem I have here is that in JavaScript the only way you can yield control is by finishing the whole code. You can't do anything at all to receive results from queued up work. It's one-way communication. (Well in some browsers alert() can be used in a specific way to yield.)&lt;/p&gt;&lt;p&gt;This seems like an argument that Javascript concurrency is not "wonderful"? There are numerous examples of working programs that demonstrate that it is possible to pass data around in Javascript programs.&lt;/p&gt;&lt;p&gt;&amp;gt; real world JavaScript event handlers are written in ways that can be described as anything but order-independent units of work where execution time is an implementation detail&lt;/p&gt;&lt;p&gt;This is a strawman argument. My code expresses explicit data-flow dependencies using promises, and would generally work just fine with a different execution model.&lt;/p&gt;&lt;p&gt;Regardless, concurrency without parallelism is still concurrency. Case in point: Javascript web servers can handle many concurrent HTTP requests, switching between request handlers when waiting on I/O and so forth. There are typically no guarantees about the order in which I/O data will become available in each handler, or the order in which concurrent tasks within a handler will complete. And yet they usually manage to function correctly.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Tue, 21 Mar 2017 15:44:44 -0000</pubDate></item><item><title>Re: Changes I would make to Go</title><link>http://sitr.us/2017/02/21/changes-i-would-make-to-go.html#comment-3215675062</link><description>&lt;p&gt;My claim about goroutines blocking is based on my own testing in 1.7. I can let this run for 10 minutes and not see the message "done" in output:&lt;/p&gt;&lt;p&gt;&lt;a href="https://gist.github.com/hallettj/8b876f19cf3b757bbc5b47671475c4d0" rel="nofollow noopener" target="_blank" title="https://gist.github.com/hallettj/8b876f19cf3b757bbc5b47671475c4d0"&gt;https://gist.github.com/hal...&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I made sure to put a function call in the blocking goroutines to introduce a chance for pre-emption. I built with `-gcflags '-N -l'` in an attempt to disable inlining. (I'm not positive that is the correct way to disable inlining - my apologies if I screwed that up!) I also tried removing the `runtime.GOMAXPROCS` call, and bumping up the number of blocker goroutines, and got the same result.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Tue, 21 Mar 2017 15:19:43 -0000</pubDate></item><item><title>Re: Changes I would make to Go</title><link>http://sitr.us/2017/02/21/changes-i-would-make-to-go.html#comment-3215628133</link><description>&lt;p&gt;Ah; I'm sorry I did not understand your objection to my implication that there is some library external to the function spec that can hook into `make`. I will make an update to address that. And I will look at clarifying how equality works with custom structs.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Tue, 21 Mar 2017 14:53:52 -0000</pubDate></item><item><title>Re: Changes I would make to Go</title><link>http://sitr.us/2017/02/21/changes-i-would-make-to-go.html#comment-3215272770</link><description>&lt;p&gt;Good point - built-in types are perhaps not technically "standard library" types. But those are the types that are overwhelmingly used by programmers, and are no additional types in any kind of standard library that implement generics or iteration. I think it is not unfair to claim that the effective standard library includes the portions of the language spec that describe built-in data structures.&lt;/p&gt;&lt;p&gt;But the distinction between library and language spec does not affect the point that third-party data structures do not get to implement generics, cannot be used directly with `range`, and cannot be used with the standard equality and inequality operators. I'm not thinking of slices that hold custom types. I'm thinking of distinct data structures like persistent vectors, tree maps, lazily evaluated streams, and futures.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Tue, 21 Mar 2017 12:12:06 -0000</pubDate></item><item><title>Re: Changes I would make to Go</title><link>http://sitr.us/2017/02/21/changes-i-would-make-to-go.html#comment-3215259056</link><description>&lt;p&gt;I referenced a definition for concurrency in the article: "concurrency is a program-structuring technique in which there are multiple threads of control. Conceptually, the threads of control execute 'at the same time'; that is, the user sees their effects interleaved. Whether they actually execute at the same time or not is an implementation detail"&lt;/p&gt;&lt;p&gt;Javascript's non-blocking event loop model is concurrency according to that definition.&lt;/p&gt;&lt;p&gt;Goroutines are actually pretty similar to the Javascript model. Go has its own event loop and event queue. Goroutines are not pre-empted - control does not return to the event loop until the goroutine does something to yield control. Some of the ways that goroutines do that are to block on channel, call built-in IO functions, or explicitly call `runtime.Gosched()`. The difference is that Go uses more than one thread when processing the event queue. There are a fixed number of worker threads - the number is based on the number of available CPU cores by default.&lt;/p&gt;&lt;p&gt;Your example is accurate: if you schedule two units of work, those units will run in parallel in Go but not in Javascript (assuming GOMAXPROCS is not set to 1). But if GOMAXPROCS is set to 4, and you schedule 8 units of work, 4 of those units are guaranteed to not start before the first 4 units yield control.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Tue, 21 Mar 2017 12:03:13 -0000</pubDate></item><item><title>Re: Changes I would make to Go</title><link>http://sitr.us/2017/02/21/changes-i-would-make-to-go.html#comment-3213697387</link><description>&lt;p&gt;That's a good point! I really mean that type variables are the programming analog of anaphora, which let you refer to things that are part of the established context of conversation. But that explanation is not quite as punchy 😃&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Mon, 20 Mar 2017 13:59:18 -0000</pubDate></item><item><title>Re: Changes I would make to Go</title><link>http://sitr.us/2017/02/21/changes-i-would-make-to-go.html#comment-3211983265</link><description>&lt;p&gt;Thanks for the feedback! I updated the article to talk about the "?" operator. I kept the discussion of the "try!" macro, because I think that the "how it works" aspect is important, and I think macro expansion is a sensible way to talk about how boilerplate can be abstracted away. But if I read the Github discussions correctly, the "?" is not just syntactic sugar for macro application? I hope the behavior is close enough that my claim that macro and the operator "have the same effect" is not inaccurate.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Sun, 19 Mar 2017 13:17:03 -0000</pubDate></item><item><title>Re: WW’s November 2016 Endorsements: Local Measures</title><link>http://www.wweek.com/news/2016/10/12/wws-november-2016-endorsements-local-measures/#comment-2946835551</link><description>&lt;p&gt;It looks like two sections are swapped: argument for 26-184 is labelled 26-185, and vice-versa.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Wed, 12 Oct 2016 12:23:55 -0000</pubDate></item><item><title>Re: Javascript generators and functional reactive programming</title><link>http://sitr.us/2014/08/02/javascript-generators-and-functional-reactive-programming.html#comment-2691912519</link><description>&lt;p&gt;Nice! I'm glad that this exists.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Mon, 23 May 2016 19:11:32 -0000</pubDate></item><item><title>Re: Cookies are bad for you: Improving web application security</title><link>http://sitr.us/2011/08/26/cookies-are-bad-for-you.html#comment-2309579074</link><description>&lt;p&gt;I think that you are thinking of XSS prevention. CSRF attacks originate from third-party sites, where you have no control over code that may appear in a page. The operator of the third-party site is just as likely to be initiating attacks as users who exploit XSS for code injection on that site.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Thu, 15 Oct 2015 18:51:10 -0000</pubDate></item><item><title>Re: Kinesis Advantage with DSA keycaps</title><link>http://sitr.us/2014/05/19/kinesis-advantage-with-dsa-keycaps.html#comment-1873999177</link><description>&lt;p&gt;Oh wow - I have to respect your level of modding.  I have Clears on my Ergodox.  It might be nice to have those on the Kinesis too.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Tue, 24 Feb 2015 21:15:54 -0000</pubDate></item><item><title>Re: Kinesis Advantage with DSA keycaps</title><link>http://sitr.us/2014/05/19/kinesis-advantage-with-dsa-keycaps.html#comment-1873152149</link><description>&lt;p&gt;Thanks for the links!  I enjoyed looking at your various keyboard posts.  I am also using an Ergodox along with my Kinesis as my daily drivers.  My feeling is that the Kinesis would be just about perfect if it had stiffer switches.  I'm thinking about doing a mod, as I have read that replacing switches has been done with a Kinesis before, though it looks like it is difficult.[1]  I'm especially interested in Matias quiet click switches.  I have not tried them before, but I read that they are nice.  And I saw that someone was able to build an Ergodox with Matias switches with the stock PCB.[2]  An issue that is holding me back is the difficulty of sourcing Alps-compatible keycaps.&lt;/p&gt;&lt;p&gt;[1]: &lt;a href="http://www.gilesorr.com/misc/keyboards/kinesiskeys.html" rel="nofollow noopener" target="_blank" title="http://www.gilesorr.com/misc/keyboards/kinesiskeys.html"&gt;http://www.gilesorr.com/mis...&lt;/a&gt;&lt;br&gt;[2]: &lt;a href="https://www.reddit.com/r/MechanicalKeyboards/comments/2pgng5/ergodox_with_matias_clickly_switches/" rel="nofollow noopener" target="_blank" title="https://www.reddit.com/r/MechanicalKeyboards/comments/2pgng5/ergodox_with_matias_clickly_switches/"&gt;https://www.reddit.com/r/Me...&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Tue, 24 Feb 2015 13:53:43 -0000</pubDate></item><item><title>Re: Javascript generators and functional reactive programming</title><link>http://sitr.us/2014/08/02/javascript-generators-and-functional-reactive-programming.html#comment-1529037595</link><description>&lt;p&gt;You are right, I do mean "immutable".  An invocation of an immutable generator returns a value and a new generator, which can be invoked to run the next step.  Invoking the first generator a second time repeats the same step without affecting any other generators.  And there is still state: each generator is a closure that has access to the results of previous steps via closure scope.  So a generator represents a state resulting from applying a particular input to a previous state.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Tue, 05 Aug 2014 16:57:07 -0000</pubDate></item><item><title>Re: Category Theory proofs in Idris</title><link>http://sitr.us/2014/05/05/category-theory-proofs-in-idris.html#comment-1398632760</link><description>&lt;p&gt;I have not actually read any books on category theory.  I am fortunate to work with several people who have category theory background, and I have been learning from them in study group sessions.  In principle our group is working from Basic Category Theory for Computer Scientists by Benjamin Pierce.  In practice we are mostly lecture-driven.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Wed, 21 May 2014 20:16:02 -0000</pubDate></item><item><title>Re: Modding the Happy Hacking Keyboard | NK</title><link>http://nathankot.com/blog/2013/09/05/modding-the-happy-hacking-keyboard/#comment-1361246359</link><description>&lt;p&gt;Thanks, I love reading posts like this!  I adopted your use of the emulated number pad and arrow keys - the number overlay has been particularly helpful for me.&lt;/p&gt;&lt;p&gt;I don't have a programmable controller yet.  For the time being I have a "poor man's" overlay.  I remapped my Tab key to AltGr, which provides a third-level shift.  I use xcape to make it act like Tab again when tapped.  I changed my other key mappings to use numbers as the third-level shift characters for letters in my emulated numpad area.  I was able to use the same trick to turn some keys into arrow keys while holding Tab.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Tue, 29 Apr 2014 15:11:36 -0000</pubDate></item><item><title>Re: DailyJS: Indentation</title><link>http://dailyjs.com/2013/09/27/indentation/#comment-1061651382</link><description>&lt;p&gt;I recently found a plugin for Vim that uses heuristics to attempt to automatically detect the right indentation settings for each file that is opened.  I am surprised by how much smoother this has made my editing experience.  &lt;a href="https://github.com/tpope/vim-sleuth" rel="nofollow noopener" target="_blank" title="https://github.com/tpope/vim-sleuth"&gt;https://github.com/tpope/vi...&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Fri, 27 Sep 2013 15:18:59 -0000</pubDate></item><item><title>Re: es6-modules</title><link>http://www.2ality.com/2013/07/es6-modules.html#comment-983221920</link><description>&lt;p&gt;Do you know if a proposed API for System is written up anywhere?  I see that there example usages in Yehuda Katz' discussion; but I am not sure that I am getting the whole picture.  I want to be sure that it is possible to defer loading some modules and to configure the loader to load modules in batches, as in the Google Module Server pattern &lt;a href="https://github.com/google/module-server" rel="nofollow noopener" target="_blank" title="https://github.com/google/module-server"&gt;https://github.com/google/m...&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Wed, 31 Jul 2013 20:22:43 -0000</pubDate></item><item><title>Re: Functional Reactive Programming in JavaScript</title><link>http://sitr.us/2013/05/22/functional-reactive-programming-in-javascript.html#comment-931046915</link><description>&lt;p&gt;I had thoughts about using streams and promises together.  Though I have not tried that to find out how well that works.&lt;/p&gt;&lt;p&gt;Like promises, streams act as functors and monads.  So you should be able to do all of the same stuff that I described in my post on promises.  I think that the main difference is "empty" values.  Monads come with a concept of an "empty" or "failure" value - every data structure that acts as a monad must allow for that kind of value.  With promises the "empty" value is a promise  that results in an error; while for streams I think that a failure would be represented as a stream that never emits an event.  That could mean that promises are better suited to error propagation.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Fri, 14 Jun 2013 16:31:24 -0000</pubDate></item><item><title>Re: Promise Pipelines in JavaScript</title><link>http://sitr.us/2012/07/31/promise-pipelines-in-javascript.html#comment-855504660</link><description>&lt;p&gt;Promises provide a means to get rid of nested callback in many, but not all, cases.  In postWithAuthor the last step, which combines the post and author objects, has to reference both of those objects.  But the result of getUser() does not include any information about the post - it just resolves to a user object.  The simplest way to reference both objects is via closure scope, which requires nesting the getUser() callback inside of the getPost() callback.&lt;/p&gt;&lt;p&gt;The problem with your rewritten version is that the post variable is not in scope in the last callback.  If you run that code you will get "ReferenceError: post is not defined" on the line with the $.extend() call.&lt;/p&gt;&lt;p&gt;The alternatives to nesting callbacks are to encode all of the information that will be required for subsequent steps into each promise or to update shared variables that are defined outside of the promise callbacks. That second option is not very functional; but it could be done like this:&lt;/p&gt;&lt;p&gt;    function postWithAuthor(id) {&lt;br&gt;        var post;&lt;br&gt;        return getPost(id).then(function(p) {&lt;br&gt;            post = p;&lt;br&gt;            return getUser(post.authorId);&lt;br&gt;        }).then(function(author) {&lt;br&gt;            return $.extend(post, { author: author });&lt;br&gt;        });&lt;br&gt;    }&lt;/p&gt;&lt;p&gt;I don't think that it is possible to write postWithAuthor in a functional style without nesting callbacks.  But the good news is that it is only necessary to nest callbacks when performing sequential steps where one step has to refer back to a detail from the previous step that is not passed forward via promise.  You can write code that decorates resolved values at each step to limit nesting to two levels.  In fact that is what postWithAuthor is designed to do.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Sun, 07 Apr 2013 16:24:37 -0000</pubDate></item><item><title>Re: Stable, Vetted Hackage: Call for Participation</title><link>http://www.yesodweb.com/blog/2012/11/stable-vetted-hackage#comment-729038838</link><description>&lt;p&gt;I would like to submit the name Haskell Universe.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Thu, 06 Dec 2012 04:44:51 -0000</pubDate></item><item><title>Re: Yesod, AngularJS and Fay</title><link>http://www.yesodweb.com/blog/2012/10/yesod-fay-js#comment-728865630</link><description>&lt;p&gt;I saw some talks on TypeScript recently.  I think it will be more useful when it gets support for parameterized types.  Microsoft says that is coming; but the feature is not implemented yet.&lt;/p&gt;&lt;p&gt;In the meantime you can also get type checking in JavaScript via the Google Closure Compiler which reads type signatures from specially formatted comments in JavaScript code.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jesse Hallett</dc:creator><pubDate>Wed, 05 Dec 2012 21:15:58 -0000</pubDate></item></channel></rss>