<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: harleybl</title>
    <description>The latest articles on DEV Community by harleybl (@harleybl).</description>
    <link>https://dev.to/harleybl</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F102432%2F4fc02ac2-67c5-4fb8-a836-5e7ba20eb231.jpeg</url>
      <title>DEV Community: harleybl</title>
      <link>https://dev.to/harleybl</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/harleybl"/>
    <language>en</language>
    <item>
      <title>The Joy of UX: User Experience and Interactive Design for Developers</title>
      <dc:creator>harleybl</dc:creator>
      <pubDate>Mon, 13 Jul 2020 14:48:01 +0000</pubDate>
      <link>https://dev.to/harleybl/the-joy-of-ux-user-experience-and-interactive-design-for-developers-2mp8</link>
      <guid>https://dev.to/harleybl/the-joy-of-ux-user-experience-and-interactive-design-for-developers-2mp8</guid>
      <description>&lt;p&gt;I recently finished the book "The Joy of UX: User Experience and Interactive Design for Developers" by David Platt. I recommend it to anyone looking to make better software. You can buy it at &lt;a href="https://www.amazon.com/Joy-Experience-Interactive-Developers-Usability-ebook/dp/B01F7SBPJO"&gt;Amazon&lt;/a&gt;, or if you have an O'Reilly learning account, you can read it "for free."&lt;/p&gt;

&lt;p&gt;When a lot of people hear design (myself included), their first thought is about the look and feel of the front end. Things like which typefaces and color schemes I should use to make the front end easy on the eyes. While that is important for having a polished and professional-looking product, that is not the subject of this book.&lt;/p&gt;

&lt;p&gt;The main idea I got from the book is that developers are not the primary users of the systems that we create (unless you are building an IDE or dev tools). The experience of using our software suffers due to our bias as developers. Improving the experience helps our apps get out of the way of our customers and let them accomplish their goals. Doing so makes them happier, and in turn, helps our bottom line.&lt;/p&gt;

&lt;p&gt;In the book, David lays out the main principles of good user experience and backs them up with concrete examples from real websites and systems to make the principles relatable. I am not going to re-hash all the tenets and tidbits from the book, but here are the ones that stuck with me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Start with reasonable defaults&lt;/li&gt;
&lt;li&gt;Don't make your users think or do your work&lt;/li&gt;
&lt;li&gt;Lead the witness&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If this topic interests you, I also recommend the work the &lt;a href="https://www.linkedin.com/learning/ux-design-for-developers"&gt;UX Design for Developers&lt;/a&gt; course on LinkedIn learning by Billy Hollis.&lt;/p&gt;

&lt;p&gt;If you have a resource for this topic that you recommend, please share it below.&lt;/p&gt;

</description>
      <category>development</category>
      <category>frontend</category>
      <category>career</category>
    </item>
    <item>
      <title>A Ray Tracing Anecdote</title>
      <dc:creator>harleybl</dc:creator>
      <pubDate>Tue, 12 May 2020 16:11:29 +0000</pubDate>
      <link>https://dev.to/harleybl/a-ray-tracing-anecdote-nj9</link>
      <guid>https://dev.to/harleybl/a-ray-tracing-anecdote-nj9</guid>
      <description>&lt;h1&gt;
  
  
  Overview
&lt;/h1&gt;

&lt;p&gt;I was reading an article about the next generation of Playstation and Xbox consoles. Each of them will support real-time Ray tracing. Wikipedia defines Ray Tracing as "a rendering technique for generating an image by tracing the path of light as pixels in an image plane and simulating the effects of its encounters with virtual objects." &lt;/p&gt;
&lt;div class="ltag__wikipedia--container"&gt;
  &lt;div class="ltag__wikipedia--header"&gt;
    &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Sew3uq9H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/wikipedia-logo-0a3e76624c7b1c3ccdeb9493ea4add6ef5bd82d7e88d102d5ddfd7c981efa2e7.svg" class="ltag__wikipedia--logo" alt="Wikipedia Logo" width="128" height="128"&gt;
    &lt;a href="https://en.wikipedia.org/wiki/Ray_tracing_(graphics)" rel="noopener noreferrer"&gt;Ray tracing (graphics)&lt;/a&gt;
  &lt;/div&gt;
  &lt;div class="ltag__wikipedia--extract"&gt;&lt;p&gt;In 3D computer graphics, &lt;b&gt;ray tracing&lt;/b&gt; is a technique for modeling light transport for use in a wide variety of rendering algorithms for generating digital images.&lt;/p&gt;&lt;/div&gt;
  &lt;div class="ltag__wikipedia--btn--container"&gt;
    
      &lt;a href="https://en.wikipedia.org/wiki/Ray_tracing_(graphics)" rel="noopener noreferrer"&gt;View on Wikipedia&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
.&lt;br&gt;
I am excited to see this development because I believe it will bring a significant improvement in the visual quality of the games and VR experiences of the near future. 

&lt;p&gt;Here is an excellent example of the difference in visual quality using Minecraft. The Ray-traced version on the left: &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WTid5mbR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8z0h6sksly6jxw1j6y8j.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WTid5mbR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8z0h6sksly6jxw1j6y8j.jpg" alt="Minecraft regular vs. Ray Tracing" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can watch the full video here: &lt;a href="https://www.youtube.com/watch?v=nXoLY9lF-NI"&gt;https://www.youtube.com/watch?v=nXoLY9lF-NI&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Back to the Past
&lt;/h1&gt;

&lt;p&gt;However, this story isn't about the near future, and it starts in the distant past. Gather 'round the campfire kids, because Grandpa is off his meds and is about to spin a yarn about life back in the late 90s. &lt;/p&gt;

&lt;p&gt;The year was 1998, and I was hired out of college to write graphics software for a financial news television station. My group was responsible for writing the software that rendered the scrolling ticker, news stories, and graphs on the television screen. &lt;/p&gt;

&lt;p&gt;The head of the whole division had recently seen Toy Story and remarked that he wanted intraday 3D graphs to be of the same quality. My boss decided that this would be a good project for me as the new guy since it was off the critical path of the main software the group was responsible for producing. I rolled up my sleeves and got to work.&lt;/p&gt;

&lt;h1&gt;
  
  
  The "Architecture"
&lt;/h1&gt;

&lt;p&gt;What ensued was a Rube-Goldberg machine of epic proportions to act as a prototype to create these 3D intraday graphs. Here was how the application worked:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A PERL script would read an XML configuration file that contained the graph definition&lt;/li&gt;
&lt;li&gt;The Perl script requested the market data from an API and write that to a text file.&lt;/li&gt;
&lt;li&gt;It would then launch Maya, load up a template scene with some Mel scripting language that knew how to read the market data file, and create the 3d models for the graph and place them in the correct part of the scene.&lt;/li&gt;
&lt;li&gt;The script would send the scene file to a rendering farm running Renderman nodes to render the frames of the scene to a configured shared directory.&lt;/li&gt;
&lt;li&gt;Once Renderman generated all the frames, the script would launch another program to combine the frames into an AVI file for display on television.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I also created a front end in Perl and Tck/TL to edit the configuration and so an operator could monitor the progress of the application.&lt;/p&gt;

&lt;p&gt;The render farm consisted of every spare Silicon Graphics machine I could find and install Renderman on with the temporary license the company had given us to test the software. I used additional capacity on all the DEV and UAT machines, which gave me a modest farm of 10-15 machines. &lt;/p&gt;

&lt;p&gt;The work-horse of the render farm was the SGI Indigo 2 in all it's glory here:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6FGwR2lE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/aurou3y33ha3wudsjr9v.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6FGwR2lE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/aurou3y33ha3wudsjr9v.jpg" alt="Rendering machine" width="880" height="880"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The main problem with this setup was the time it took to render. My small farm was able to deliver 10-15 seconds of footage in 15-20 minutes. This was not fast enough for doing intraday financial graphs. I demonstrated the final product to the department head, and he was impressed with the final product. He asked what it would take to bring the render time down. I did some calculations and estimated that we would need about $100,000 just in Renderman licenses, and probably another $100,000 in hardware to get the time down to five minutes. Needless to say, that was the end of the project.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;This holiday season, you'll be able to buy a game console for ~$400 that will do 60 times a second what took minutes and considerably more money to do in minutes, 20+ years ago. &lt;/p&gt;

</description>
      <category>graphics</category>
      <category>storytime</category>
    </item>
    <item>
      <title>Question: Is this a terrible idea?</title>
      <dc:creator>harleybl</dc:creator>
      <pubDate>Thu, 30 Apr 2020 03:32:10 +0000</pubDate>
      <link>https://dev.to/harleybl/question-is-this-a-terrible-idea-49gb</link>
      <guid>https://dev.to/harleybl/question-is-this-a-terrible-idea-49gb</guid>
      <description>&lt;p&gt;I have a bunch of utility functions in typescript for doing various things. I find that I often want to check if an array has any elements in it, but I am not sure if that array is undefined or null. I wind up with blocks similar to this in my code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (!someArray || someArray.length == 0) {
   doNothing();
} else {
   doSomething();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My first instinct was to write this method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export function any&amp;lt;T&amp;gt;(arr: T[]): boolean {
    if (!arr) return false;
    return arr.length &amp;gt; 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The original code block becomes this, which I find more readable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (any(someArray)) {
   doSomething();
} else {
   doNothing();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I chose 'any' because I spend a lot of time in c# land and it roughly matches the LINQ method enumerable.Any(). However, using a reserved word for a function name seemed like a bad idea. Is it a bad idea?&lt;br&gt;
Even if the transpiler allows it, maybe it is even less readable since any is the "I don't know what type this is" type.&lt;/p&gt;

&lt;p&gt;In this instance, I chose to rename the function to atLeastOne which is a little more descriptive and doesn't clash with a reserved word, but I am still wondering if it was a bad idea.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>javascript</category>
      <category>question</category>
    </item>
    <item>
      <title>FIX Master Is Awesome</title>
      <dc:creator>harleybl</dc:creator>
      <pubDate>Thu, 26 Mar 2020 17:09:27 +0000</pubDate>
      <link>https://dev.to/harleybl/fix-master-is-awesome-1oin</link>
      <guid>https://dev.to/harleybl/fix-master-is-awesome-1oin</guid>
      <description>&lt;h1&gt;
  
  
  The Problem
&lt;/h1&gt;

&lt;p&gt;The Financial Information Exchange protocol (&lt;a href="https://www.fixtrading.org/"&gt;https://www.fixtrading.org/&lt;/a&gt;) is a communication format that defines how financial institutions communicate transactions to one another. It is a text-based format where each message consists of a bunch of numbered tags as keys and their corresponding values. An equal sign separates tags and values. The 0x01 (SOH) character separates the tag/value pairs.&lt;/p&gt;

&lt;p&gt;For example, the simplest message that you will send or receive is a heart-beat message. The HeartBeat is a periodic message that each side sends to let the other side know that your application is still around and in a good state.&lt;br&gt;
Here is an example Heart Beat:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;8=FIX.4.2|9=74|35=0|34=4846459|49=MySystem|52=20200325-15:00:16.455|56=TargetSystem|10=195|%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I've replaced the SOH characters with pipes so you can see them.&lt;/p&gt;

&lt;p&gt;As you can see, this format was created to be compact over the wire, but not necessarily easy to interpret by people. Programs use a Data Dictionary that defines what the tags mean. When troubleshooting FIX connectors, you are often having to look at large files containing thousands of these messages, against data dictionaries which have hundreds of tags defined.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Solution
&lt;/h1&gt;

&lt;p&gt;While troubleshooting why my application failed to process some messages, I thought there has to be a better way to look at these FIX logs. I was thinking of writing a VSCode plug-in to parse these types of log files and print them in a human-readable format. It turns out that a man named Gary Huges beat me to the punch. This VSCode plug-in already exists, and it is called FIX master.&lt;br&gt;
You can find it here: &lt;a href="https://marketplace.visualstudio.com/items?itemName=geh-fixmaster.fixmaster"&gt;https://marketplace.visualstudio.com/items?itemName=geh-fixmaster.fixmaster&lt;/a&gt; or by searching for "FIX Master" in the Visual Studio Code Extension Marketplace.&lt;/p&gt;

&lt;p&gt;This plug-in will pretty print your FIX messages and do the required dictionary lookup. For example, the plug-in will turn the example heart-beat above to this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Heart-beat
{
 BeginString    (8) FIX.4.2
  BodyLength    (9) 74
     MsgType   (35) 0 - Heartbeat
   MsgSeqNum   (34) 4846459
SenderCompID   (49) MySystem
 SendingTime   (52) 20200325-15:00:16.455
TargetCompID   (56) TargetSystem
    CheckSum   (10) 195
} 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you do any work with FIX Protocol messages, I encourage you to check out this excellent plug-in. If you like it be sure to leave a review in the Marketplace and Star the project on Github.&lt;/p&gt;

</description>
      <category>todayileared</category>
      <category>finance</category>
      <category>vscode</category>
    </item>
    <item>
      <title>Diff GIT stash versus working directory in Visual Studio 2019</title>
      <dc:creator>harleybl</dc:creator>
      <pubDate>Tue, 03 Mar 2020 16:19:02 +0000</pubDate>
      <link>https://dev.to/harleybl/diff-git-stash-versus-working-directory-in-visual-studio-2019-2869</link>
      <guid>https://dev.to/harleybl/diff-git-stash-versus-working-directory-in-visual-studio-2019-2869</guid>
      <description>&lt;p&gt;Have you previously stashed some code using git stash and want to see what applying it would do to your workspace? &lt;/p&gt;

&lt;p&gt;I had this happen today and my first thought was to reach for "git stash show -p" on the command line. While this is a useful command for a small stash it is not that easy to see the changes in a pretty side by side manner. &lt;/p&gt;

&lt;p&gt;The project I am working on is a C# project and I am already using Visual Studio 2019 for the project so I was wondering if there was a way that the tool could help me. Sure enough, the Visual Studio team has already thought of this.&lt;/p&gt;

&lt;p&gt;To view a stash within Visual Studio, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the Team Explorer&lt;/li&gt;
&lt;li&gt;Go to the Changes View within Team Explorer.&lt;/li&gt;
&lt;li&gt;Double click on the Stash in the stashes section (below Changes)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This will open up the stash details and allow you to see the files contained in the stash. To see the differences of a specific file in the stash, double click that file to see the difference between the stash and your workspace. &lt;/p&gt;

&lt;p&gt;I found this useful, hopefully others will find it useful as well.&lt;/p&gt;

</description>
      <category>todayilearned</category>
      <category>git</category>
      <category>visualstudio</category>
    </item>
  </channel>
</rss>
