<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title>Pixelbath</title>
  <link href="https://www.pixelbath.com/"/>
  <link rel="self" type="application/atom+xml" href="https://www.pixelbath.com/feed.xml" />
  <updated>2026-05-01T01:35:58.799331+00:00</updated>
  <author>
    <name>Michael Hoskins</name>
  </author>
  <id>https://www.pixelbath.com/</id>

  <entry>
    <title>C#: Value does not fall within the expected range</title>
    <link href=""/>
    <id>https://www.pixelbath.com//2020/03/csharp-value-does-not-fall-within-expected-range/</id>
    <updated>2020-03-30T02:04:30.077643+00:00</updated>
    <content type="xhtml" xml:lang="en">
      <div xmlns="http://www.w3.org/1999/xhtml"><p>To save anybody from a fruitless internet search, the default message for ArgumentException is the phrase "Value does not fall within the expected range". This error may be returned from various sources, but in my case it was an explicit throw:</p>
<pre><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">someInvalidValue</span><span class="p">)</span>
<span class="p">{</span>
<span class="w">    </span><span class="k">throw</span><span class="w"> </span><span class="k">new</span><span class="w"> </span><span class="nf">ArgumentException</span><span class="p">();</span>
<span class="p">}</span>
</pre>
<p>So if this error is bubbling up, it's an <code>ArgumentException</code>.</p></div>
    </content>
  </entry>

  <entry>
    <title>Fantasy Consoles</title>
    <link href=""/>
    <id>https://www.pixelbath.com//2020/02/fantasy-consoles/</id>
    <updated>2020-02-10T02:04:30.077643+00:00</updated>
    <content type="xhtml" xml:lang="en">
      <div xmlns="http://www.w3.org/1999/xhtml"><p>I'd been meaning to write for my blog, since I'm now posting more regularly on Twitter, and am fairly active in a few Discord chats. Most of what I've been doing lately has been centered around fantasy consoles.</p>
<h2 id="fantasy-consoles">Fantasy Consoles?</h2>
<p>While there are differing opinions on exactly <em>what</em> constitutes a fantasy console, the basic idea is that it's a game development platform for hardware that doesn't exist. In some cases, there are entire <em>systems</em> dedicated to maintaining the illusion that somewhere in an alternative universe, these video game consoles could have existed.</p></div>
    </content>
  </entry>

  <entry>
    <title>ROM Checksums and Headers</title>
    <link href=""/>
    <id>https://www.pixelbath.com//2019/08/rom-checksums-and-headers/</id>
    <updated>2019-08-05T02:04:30.077643+00:00</updated>
    <content type="xhtml" xml:lang="en">
      <div xmlns="http://www.w3.org/1999/xhtml"><p>Lately I've been futzing around with classic game ROMs a bit more. Since nearly day one of Nesticle hitting the Internet, I've been obsessed with emulation of classic computer systems. I love playing old video games, and I love learning more about the internals of the systems I cut my teeth on back in the day.</p></div>
    </content>
  </entry>

  <entry>
    <title>Let's Get Cuddly! (or not, I'm not judging)</title>
    <link href=""/>
    <id>https://www.pixelbath.com//2019/06/visual-studio-cuddly-braces/</id>
    <updated>2019-06-07T02:04:30.077643+00:00</updated>
    <content type="xhtml" xml:lang="en">
      <div xmlns="http://www.w3.org/1999/xhtml"><p>As a personal preference, I'm a fan of cuddly braces. It's the way I learned, but I feel like it leads to more concise and readable code in most cases. I could go on, but as a topic it's been beaten to death, and there are arguments with merit on both sides.</p>
<p>That being said, at work we use newline braces, and I don't like it. A good programmer follows the in-place coding style, so that's what I've been doing. It doesn't mean I have to like it, though. While I use a separate installation of Visual Studio on an entirely different computer for coding my personal projects, there are times where I'd like to not have to completely switch machines to bang out some lines of code.</p>
<p>After reading that you can export and import Visual Studio settings, I created two settings files trimmed down to only include indentation and newline settings, so now I can simply import a settings file and all the rules I want changed are changed.</p>
<p>Feel free to edit the below files to your needs:</p>
<ul>
<li><a class="button-std file-icon icon-vssettings" href="/downloads/VS_Personal.vssettings">VS_Personal.vssettings</a> (3.6k): Cuddly style</li>
<li><a class="button-std file-icon icon-vssettings" href="/downloads/VS_Work.vssettings">VS_Work.vssettings</a> (3.6k):  Non-cuddly style (braces on newlines)</li>
</ul>
<p>These are only for Visual Studio, though. I've got nothing to offer for other editors, but feel free to contribute settings files for any other IDE.</p></div>
    </content>
  </entry>

  <entry>
    <title>PSA: Vertex and Vertices</title>
    <link href=""/>
    <id>https://www.pixelbath.com//2019/05/psa-vertex-and-vertices/</id>
    <updated>2019-05-28T02:04:30.077643+00:00</updated>
    <content type="xhtml" xml:lang="en">
      <div xmlns="http://www.w3.org/1999/xhtml"><p>Hey everybody, just a quick reminder <strong>that the singular form of vertices is <em>vertex</em></strong>. There is no such thing as a "vertice".</p>
<div class="image-caption alignright">
<img alt='the singular form of "vertices" is "vertex"' src="/images/vertices-wrong-word.png" />
</div>

<p>I've heard it pronounced this way in some...specific 😉 video tutorials, but recently I've noticed this malapropism being used in written tutorials as well.</p></div>
    </content>
  </entry>

  <entry>
    <title>The Importance of Order</title>
    <link href=""/>
    <id>https://www.pixelbath.com//2019/03/the-importance-of-order/</id>
    <updated>2019-03-30T02:04:30.077643+00:00</updated>
    <content type="xhtml" xml:lang="en">
      <div xmlns="http://www.w3.org/1999/xhtml"><p>The order of things is important; even moreso when those things are command line arguments.</p>
<p><img alt="the venerable Blender default cube" class="aligncenter" src="/images/default-cube-render.png" /></p>
<p>After spending way too long (~30 minutes) trying to figure out why my background Blender renders were producing default cubes when that is clearly not what is in the scene, I finally looked at the console output and understood.</p>
<p><code>blender --background --python script.py myfile.blend</code></p>
<p>What this command does is tells Blender, "Load into memory as a background process and run script.py (which changes some settings and starts a render). <em>Then</em> load myfile.blend." Once the file is loaded, background Blender exits.</p>
<p>In the proper order:</p>
<p><code>blender myfile.blend --background --python script.py</code></p></div>
    </content>
  </entry>

  <entry>
    <title>PHP PDF Libraries</title>
    <link href=""/>
    <id>https://www.pixelbath.com//2015/04/php-pdf-libraries/</id>
    <updated>2015-04-01T02:04:30.077643+00:00</updated>
    <content type="xhtml" xml:lang="en">
      <div xmlns="http://www.w3.org/1999/xhtml"><div class="image-caption alignright">

<img alt="PDFs are easy! Like riding a...oh." src="/images/pdf-bike-crash.jpg" />

<p>PDFs are easy! Like riding a...oh.</p>
</div>

<p>I wanted to do something I figured would be relatively simple. After all, we're doing it in .Net with a third-party library: Create a PDF with text from a database with vector graphics incorporated in the page. Turns out, it's pretty easy if you want a paid solution; numerous libraries exist for PHP that are non-free. If you insist on going free-only though, be warned: here be dragons (maybe).</p></div>
    </content>
  </entry>

  <entry>
    <title>HP Color LaserJet 3600 Windows 7/8/8.1</title>
    <link href=""/>
    <id>https://www.pixelbath.com//2014/08/hp-color-laserjet-3600-windows-788-1/</id>
    <updated>2014-08-07T02:04:30.077643+00:00</updated>
    <content type="xhtml" xml:lang="en">
      <div xmlns="http://www.w3.org/1999/xhtml"><p>I honestly don't know why HP hates its customers. They assume I want to use USB to connect a business printer, or want ~140MB for a driver, or want some other print management software instead of just a driver.</p>
<p>So here you go. The HP Color LaserJet 3600 64-bit driver for Windows 7, 8, and 8.1.</p>
<p><a class="button-std file-icon icon-zip" href="/downloads/HP3600_64_Bit.zip">HP3600_64_Bit.zip</a> (14.2 MB)</p></div>
    </content>
  </entry>

  <entry>
    <title>SimpLESS: An Easier Way of Getting LESS Done</title>
    <link href=""/>
    <id>https://www.pixelbath.com//2013/02/simpless-an-easier-way-of-getting-less-done/</id>
    <updated>2013-02-26T02:04:30.077643+00:00</updated>
    <content type="xhtml" xml:lang="en">
      <div xmlns="http://www.w3.org/1999/xhtml"><p><img alt="LESS" class="aligncenter" src="/images/less-css.jpg" /></p>
<p>When I first took a look at LESS as a CSS replacement, I wasn't too interested in having even a command-line compiler. The idea of having my stylesheet loaded and parsed by Javascript didn't sound that great either, but tolerable if it saved me enough time and effort writing CSS.</p>
<p><img alt="simpless" class="alignright" src="/images/simpless.png" /></p>
<p>While testing LESS on my local server, I used <code>less.js</code> to process my <code>.less</code> stylesheet on the client side. It worked well, and on modern browsers the processing time is minimal, but I decided to look around for LESS compilers anyway. I discovered <a href="SimpLESS">http://wearekiss.com/simpless</a> nearly immediately, and it looked perfect.</p>
<p>Compiling a <code>.less</code> file is as easy as drag-and-drop, and it monitors the file for changes. When your file is saved, it is nearly immediately compiled into a CSS file. If you've made an error in your file, the file highlights red and specifies the line number at which the problem occurred. Output is pure, minified CSS goodness.</p>
<p>SimpLESS, by default, inserts a comment at the top referring to its website. This can easily be disabled if you like.</p>
<p>When I first started using SimpLESS, I was copying and pasting the output into a WordPress template style.css file, which requires a properly-formatted comment at the top to describe the theme. Since SimpLESS performs minification, comments are stripped out. I thought this was the only way to keep my WordPress theme comment intact while still using the features of LESS. This copy-paste tedium was something I specifically wanted to avoid in the first place.</p>
<p><strong>Note: The remainder of this post was written before SimpLESS users complained enough about this very issue, so theme comment preservation is no longer an issue.</strong></p>
<p>I thought that there must be some way to preserve a comment when compiling. Surely that wasn't an uncommon use case? I checked out the <a href="SimpLESS source code">https://github.com/Paratron/SimpLESS</a> to see how it was performing its minification (<code>master/Resources/js/clean_css.js, line 30</code> if you're interested), and saw they included a special character to preserve certain comments: the exclamation mark.</p>
<p>To preserve a CSS comment in SimpLESS (not that this will not work using the Javascript version, as WordPress will not find a <code>style.less</code> file), simply put an exclamation point after the initial comment delimiter, like so:</p>
<pre><span class="c">/*!</span>
<span class="c">Theme Name: My Super-Cool Theme</span>
<span class="c">Theme URI: https://www.pixelbath.com/</span>
<span class="c">Description: Blah blah blah...</span>
<span class="c">[cut for length]</span>
<span class="c">*/</span>
</pre>
<p>The exclamation point is ignored by WordPress, and if you have SimpLESS processing your <code>style.less</code> file, you can continue to upload your theme's <code>style.css</code> file as usual.</p></div>
    </content>
  </entry>

  <entry>
    <title>Clear Photoshop's Swatch Palette</title>
    <link href=""/>
    <id>https://www.pixelbath.com//2012/04/clear-photoshops-swatch-palette/</id>
    <updated>2012-04-13T02:04:30.077643+00:00</updated>
    <content type="xhtml" xml:lang="en">
      <div xmlns="http://www.w3.org/1999/xhtml"><div class="image-caption alignright">

<img alt="The Photoshop swatch palette" src="/images/photoshop-swatch-palette.png" />

Everybody wants a rainbow, apparently.
</div>

<p>Whether you're trying to save a specific set of colors for later use, or simply want a palette with only your colors on it, you'll likely have encountered a problem that has been plaguing Photoshop for as long as I remember, and still hasn't been addressed in CS5 (or CS5.5, that I know of): <strong>how do you clear the swatch palette</strong>?</p></div>
    </content>
  </entry>

  <entry>
    <title>After Effects: Fullscreen Preview</title>
    <link href=""/>
    <id>https://www.pixelbath.com//2011/03/after-effects-fullscreen-preview/</id>
    <updated>2011-03-03T02:04:30.077643+00:00</updated>
    <content type="xhtml" xml:lang="en">
      <div xmlns="http://www.w3.org/1999/xhtml"><p>If you actually bother preemptively reading your software documentation, you may have already known this, but this is a huge time-saver over having to render test movies for my HDTV.</p>
<p>At work, I'm using a 27" 1080p monitor/television as my secondary monitor. We use a model that has a similar color profile for presentations, so using this screen as a preview screen is essential. Otherwise, we'd have to keep our presentation displays unpacked and hooked up to a computer, transfer files, and so on. I won't get into (more) details, but suffice to say it would be a royal pain.</p></div>
    </content>
  </entry>

  <entry>
    <title>Generative Art: Google Logo</title>
    <link href=""/>
    <id>https://www.pixelbath.com//2009/05/generative-art-google-logo/</id>
    <updated>2009-05-29T02:04:30.077643+00:00</updated>
    <content type="xhtml" xml:lang="en">
      <div xmlns="http://www.w3.org/1999/xhtml"><p>I've been impressed with what the <a href="http://processing.org/">Processing</a> community does with generative art, and Actionscript seems to be at a point where it can be used much like Processing. In that vein, I've been watching <a href="http://www.flickr.com/photos/markknol/sets/72157604259349437/">Mark Knol's generative art</a> for a while, and while I wanted to do something like it, I've never actually bothered to create sit down and start coding it up.</p>
<p>Today, I tried to recreate <a href="http://www.flickr.com/photos/markknol/2568436053/in/set-72157604259349437/">his work on the Google logo</a>. While mine doesn't seem to have as much depth or chaos, I think it turned out fairly well. With some tweaking, I could improve it, but for now I just wanted to put something out there.</p>
<p>Hope you like it!</p>
<div class="image-caption aligncenter">
<img alt="Google logo rendered in circles" src="/images/google-logo-generative.jpg" />
<p>Great Googly Moogly!</p>
</div></div>
    </content>
  </entry>

  <entry>
    <title>Host-Based Ad Blocking</title>
    <link href=""/>
    <id>https://www.pixelbath.com//2009/01/host-based-ad-blocking/</id>
    <updated>2009-01-23T02:04:30.077643+00:00</updated>
    <content type="xhtml" xml:lang="en">
      <div xmlns="http://www.w3.org/1999/xhtml"><p>To block ads on the web, we need to catch requests to a particular ad server and send them to our local server. We do this by adding an entry to the <a href="https://en.wikipedia.org/wiki/Hosts_file">hosts file</a>. The hosts file on a computer system gives the system information about where to find a computer on the network by mapping hostnames to IP addresses. For our purposes, we will be taking advantage of this by routing requests to ad servers from webpages to our personal system.</p>
<p>These steps will require that you have Apache HTTP server (or IIS with ISAPI_rewrite, something that can rewrite URLs) running on your local machine (or on a system with low latency, possibly on your network).</p></div>
    </content>
  </entry>

</feed>