Jekyll2020-04-01T20:03:01+00:00http://edgriebel.com/feed.xmlJava GemsJust another Jekyll siteEd GriebelGoodbye Catalant2020-03-31T00:00:00+00:002020-03-31T00:00:00+00:00http://edgriebel.com/goodbye-catalant<p>Today marks the end of my journey at Catalant Technologies. Even though the end was unexpected, I have met so many great people and learned so much in the time that I was there. Some highlights:</p>
<ul>
<li>How to have a software product without a dedicated datacenter. Every developer could run the entire system on their desktop in Docker (with a subset of obfuscated production data), and when pushed to production “it just works”</li>
<li>Super-short release times. It was not unusual that I’d finish coding a feature after lunch and it would be released before the end of the day</li>
<li>Incredibly frequent releases. There were some days where we would release over 20 features to production. Coming from organizations that struggled to define and implement bi-weekly releases, this was a revelation and amazing to see first-hand a real-world example of releases as described in <em>The Phoenix Project</em></li>
</ul>
<p>Each of these is a big lesson, but probably the biggest lesson is that the “Principal Software Engineer” role has wide variations, not only between organizations but sometimes within the same company.</p>
<p>If your organization is looking for a problem solver with deep experience in software engineering using Java, Python, and SQL please keep me in mind.</p>Ed GriebelToday marks the end of my journey at Catalant Technologies. Even though the end was unexpected, I have met so many great people and learned so much in the time that I was there. Some highlights: How to have a software product without a dedicated datacenter. Every developer could run the entire system on their desktop in Docker (with a subset of obfuscated production data), and when pushed to production “it just works” Super-short release times. It was not unusual that I’d finish coding a feature after lunch and it would be released before the end of the day Incredibly frequent releases. There were some days where we would release over 20 features to production. Coming from organizations that struggled to define and implement bi-weekly releases, this was a revelation and amazing to see first-hand a real-world example of releases as described in The Phoenix ProjectMy Craziest Production Fix Ever!2019-04-11T00:00:00+00:002019-04-11T00:00:00+00:00http://edgriebel.com/my-craziest-production-fix-ever<p>I used to work on a trading floor for the short term bond/repo desk some time ago at a small buy-side firm.
My job was to create and maintain command-line and GUI applications written in C (<em>definitely</em> some time ago).
There was a bug in an application that was caused by a problem in a string.
Fixing the string in the source code would have required a code edit and a recompile.
This would have taken at minimum a half-hour, where time really is money and the fix was needed <em>right now</em>.</p>
<p>Because the users needed the fix as soon as possible, I reviewed
with the head of the desk and responsible development manager
the half-hour option, as well as a more expedient option.</p>
<p>Since we could contain the risk by making a copy of the executable, and because it was used only by this trading desk,
the expedient solution was chosen.</p>
<p>Emacs is well known to safely binary files because it doesn’t add characters (e.g. trailing newline, word-wrapping, etc.),
I brought up the executable in Emacs; the fix only required substituting a smaller string for the existing one.
I searched for the string in the file (<code class="language-plaintext highlighter-rouge">C-x C-f</code>) and made the change. <code class="language-plaintext highlighter-rouge">nul</code> characters were added at the end of the new string,
making sure that I had the exact same number of characters including the original trailing <code class="language-plaintext highlighter-rouge">nul</code>.</p>
<p>After making sure that the file was the same size, I crossed my fingers while saving the file (<code class="language-plaintext highlighter-rouge">C-x C-s</code>) over the original one and had one
of the traders restart the application. (Other traders already running the app weren’t affected because the original version was still at
the same inode.)</p>
<p>The app started fine and the bug was fixed, so the other traders restarted theirs and had no problems either.
Because I fixed this problem in about 5 minutes I was hero for a day and became known as a go-to guy for problems.</p>
<p>(original as bullet points 3/10/17)</p>Ed GriebelI used to work on a trading floor for the short term bond/repo desk some time ago at a small buy-side firm. My job was to create and maintain command-line and GUI applications written in C (definitely some time ago). There was a bug in an application that was caused by a problem in a string. Fixing the string in the source code would have required a code edit and a recompile. This would have taken at minimum a half-hour, where time really is money and the fix was needed right now.MySQL for Oracle Developers2019-03-19T00:00:00+00:002019-03-19T00:00:00+00:00http://edgriebel.com/mysql-for-oracle-devs<p style="float: right" width="200px"><img src="https://www.mysql.com/common/logos/powered-by-mysql-167x86.png" alt="mysql" width="200px" /><br />
<em>Not MariaDB</em></p>
<p>I’ve been using Oracle DBMS for years, and sometimes it’s hard to differentiate what is an “Oracle built-in” and a standard SQL feature.</p>
<p>In teaching a Database Modeling course at RIT in MySQL I have found out that there are some differences between Oracle and MySQL:</p>
<ul>
<li>
<p>MySQL comparisons are case-insensitive, so <code class="language-plaintext highlighter-rouge">SELECT * FROM table WHERE name='ABC';</code> returns the same results as <code class="language-plaintext highlighter-rouge">SELECT * FROM table WHERE name='abc';</code></p>
</li>
<li>
<p>MySQL table names <em>are</em> case-sensitive but only on Linux.</p>
</li>
<li>
<p>MySQL has a richer set of datatypes, especially for integer types: <code class="language-plaintext highlighter-rouge">tinyint</code>, <code class="language-plaintext highlighter-rouge">smallint</code>, <code class="language-plaintext highlighter-rouge">mediumint</code>, <code class="language-plaintext highlighter-rouge">int</code>, and <code class="language-plaintext highlighter-rouge">bigint</code>, but is missing <code class="language-plaintext highlighter-rouge">BLOB</code>/<code class="language-plaintext highlighter-rouge">CLOB</code> and native(-ish) XML.</p>
</li>
<li>
<p>Single and double-quotes are allowed for string literals (but cannot be mixed).</p>
</li>
<li>
<p>Executing queries in an Oracle database are done by specifying the database name in the connect string. MySQL supports the <code class="language-plaintext highlighter-rouge">USE</code> command to choose a database to run.</p>
</li>
<li>
<p>There are a lot fewer functions available than in Oracle (which someone could write a an-oracle-function-a-day series and have a year’s worth of material).</p>
</li>
<li>
<p><code class="language-plaintext highlighter-rouge">CHECK</code> constraints are “supported” in DDL but before MySQL 8 are only verified to be syntatically correct.</p>
</li>
<li>
<p><code class="language-plaintext highlighter-rouge">MINUS</code> is not supported, but can be simulated with <code class="language-plaintext highlighter-rouge">NOT IN (<subquery>)</code></p>
</li>
<li>
<p>Concatenation operator <code class="language-plaintext highlighter-rouge">||</code> isn’t supported, must use <code class="language-plaintext highlighter-rouge">CONCAT()</code>.
MySQL allows string literals to be concatenated without operators (<code class="language-plaintext highlighter-rouge">SELECT 'foo' 'bar';</code>).</p>
</li>
<li>
<p>tables can be aliased by backticks with or without the <code class="language-plaintext highlighter-rouge">AS</code> keyword because “ and ‘ are both allowed for string literals.
Oracle lets you use a <code class="language-plaintext highlighter-rouge">"quoted"</code> value for a table alias without <code class="language-plaintext highlighter-rouge">AS</code>, for example <code class="language-plaintext highlighter-rouge">SELECT 'foo' AS foo_col, 'bar' "bar_col" FROM dual;</code></p>
</li>
<li>
<p>nested queries must have a table alias in MySQL even if table name isn’t referenced. For instance, <code class="language-plaintext highlighter-rouge">AS my_sales</code> is mandatory in this statement: <code class="language-plaintext highlighter-rouge">SELECT count(*) from (SELECT distinct * from sales) AS my_sales;</code></p>
</li>
<li>
<p>Joins inside nested queries need to have unique column names in MySQL. Oracle will rename the columns (generally by appending “_1” to the duplicate column name) but an error is returned.
For instance, given tables <strong>STOCKTRADES(cusip, price, trade_date, commission)</strong> and <strong>BONDTRADES(cusip, price, trade_date, commission)</strong>.
In Oracle, <code class="language-plaintext highlighter-rouge">SELECT count(*) FROM (SELECT * FROM stocktrades UNION SELECT * FROM bondtrades) AS all_trades;</code></p>
</li>
<li>
<p><code class="language-plaintext highlighter-rouge">NVL()</code> is not supported, use <code class="language-plaintext highlighter-rouge">COALESCE()</code> instead</p>
</li>
<li>
<p>Good summary is at <a href="https://www.slideshare.net/ronaldbradford/mysql-for-oracle-developers">this SlideShare</a> but it’s sometimes not clear what the original Oracle analog would be and it’s a little dated.</p>
</li>
</ul>Ed GriebelNot MariaDBEmbedding Mermaid Diagrams in Jekyll without plugins!2019-03-08T00:00:00+00:002019-03-08T00:00:00+00:00http://edgriebel.com/embedding-mermaid-diagram<p>Embed a jekyll diagram by including a javascript file and putting diagram in a <code class="language-plaintext highlighter-rouge"><div></code> object with class <code class="language-plaintext highlighter-rouge">mermaid</code>:</p>
<script src="https://unpkg.com/mermaid@8.0.0/dist/mermaid.min.js"></script>
<div class="mermaid">
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
</div>
<p>And the code:</p>
<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt"><script </span><span class="na">src=</span><span class="s">"https://unpkg.com/mermaid@8.0.0/dist/mermaid.min.js"</span><span class="nt">></script></span>
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"mermaid"</span><span class="nt">></span>
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
<span class="nt"></div></span>
</code></pre></div></div>
<p>Adapted from <a href="http://kkpattern.github.io/2015/05/15/Embed-Chart-in-Jekyll.html">http://kkpattern.github.io/2015/05/15/Embed-Chart-in-Jekyll.html</a></p>Ed GriebelEmbed a jekyll diagram by including a javascript file and putting diagram in a <div> object with class mermaid:As a Programmer you need to know several things2019-01-21T00:00:00+00:002019-01-21T00:00:00+00:00http://edgriebel.com/as-a-programmer-you-need-to-know-several-things<blockquote>
<p>As a Systems Programmer you need to know several things;</p>
<p>How to do something, arguably the easiest to learn.<br />
Why do I do it.<br />
When do I do it.<br />
When don’t I do it.<br />
When to follow the rules.<br />
When not to follow the rules.<br />
How to make the process foolproof.<br />
How to make the process damn foolproof, or as close to it as possible.<br />
How to think inside the box.<br />
How to think outside the box.<br />
Knowing which one to use.<br />
How to get out of any mess you created.<br />
How to get out of any mess someone else created.<br />
When to ask for permission.<br />
When to ask for forgiveness.</p>
<p>It’s as much as an art as it is a science. We can teach the science, the art of Systems Programming has to be lived.</p>
</blockquote>
<p>(From a quote by Mark Jacobs on LinkedIn posted to rands-leadership.slack.com, I can’t find original post)</p>Ed GriebelAs a Systems Programmer you need to know several things; How to do something, arguably the easiest to learn. Why do I do it. When do I do it. When don’t I do it. When to follow the rules. When not to follow the rules. How to make the process foolproof. How to make the process damn foolproof, or as close to it as possible. How to think inside the box. How to think outside the box. Knowing which one to use. How to get out of any mess you created. How to get out of any mess someone else created. When to ask for permission. When to ask for forgiveness. It’s as much as an art as it is a science. We can teach the science, the art of Systems Programming has to be lived.New Theme: Minimal Mistakes2018-12-04T00:00:00+00:002018-12-04T00:00:00+00:00http://edgriebel.com/new-theme-minimal-mistakes<p>I’m moving to a new theme, <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/">Minimal Mistakes</a>.</p>
<p>I don’t like the default github themes because they’re missing basic things like sidebars and displaying post titles.
These <em>can</em> be added (because it’s all code nothing is impossible), but it requires modifying a theme’s _layout and locking you into a theme, but theme flexibility is the point of using a <a href="https://pages.github.com/themes/">built-in theme</a>.</p>
<p>Github has recently-ish (11/2017) added <a href="https://blog.github.com/2017-11-29-use-any-theme-with-github-pages/">shared themes a.k.a remote themes</a>, allowing specially-built <a href="https://github.com/topics/jekyll-theme">themes</a> stored in github to be used by reference in your <code class="language-plaintext highlighter-rouge">_config.yaml</code>.</p>
<p>I chose Minimal Mistakes because it looked good and didn’t need any customization in <code class="language-plaintext highlighter-rouge">_layouts</code> (none in my case) and minimal configuration.</p>
<p>Some of the steps I needed to do to incorporate it:</p>
<ul>
<li>Changes to <code class="language-plaintext highlighter-rouge">_config.yml</code>
<ul>
<li>added required new plugins</li>
<li>defaults for posts</li>
<li>Added sidebar links and avatar that links to my Gravatar page</li>
<li>Declarations for pagination, breadcrumbs,</li>
<li>Include for <code class="language-plaintext highlighter-rouge">_pages</code> dir to get it processed</li>
</ul>
</li>
<li>created <code class="language-plaintext highlighter-rouge">_pages/category-archive.md</code> and <code class="language-plaintext highlighter-rouge">_pages/tags-archive.md</code> to generate pages with tags and categories</li>
<li>removed <code class="language-plaintext highlighter-rouge">layout: post</code> from front matter in every post (now defaulted in <code class="language-plaintext highlighter-rouge">_config.yml</code>)</li>
<li>Added a lot of defaults for posts and pages in <code class="language-plaintext highlighter-rouge">_config.yml</code></li>
<li>Removed all customizations from <code class="language-plaintext highlighter-rouge">_layouts</code></li>
<li>Moved <code class="language-plaintext highlighter-rouge">about.md</code> to <code class="language-plaintext highlighter-rouge">_pages</code> and fixed the permalink in the file</li>
<li>Created <code class="language-plaintext highlighter-rouge">_data/navigation.yml</code> to set up a menubar</li>
<li>Changed <code class="language-plaintext highlighter-rouge">index.html</code> to have “important” front matter, the key being <code class="language-plaintext highlighter-rouge">layout: home</code>. Until I added this the homepage didn’t work.</li>
<li>Add a header image and configure header code in <code class="language-plaintext highlighter-rouge">index.html</code> front matter</li>
</ul>
<p>It looks like a lot of steps, but was a good learning experience for Jekyll and a lot of these steps were because I was porting from another theme.</p>
<p>I will be labeling the merge to <code class="language-plaintext highlighter-rouge">master</code> branch so I can easily find the changes, but for now all changes are made on the
<a href="https://github.com/edgriebel/edgriebel.github.io/tree/minimal-mistakes"> branch</a> <code class="language-plaintext highlighter-rouge">minimal-mistakes</code>.</p>Ed GriebelI’m moving to a new theme, Minimal Mistakes.Using R in Jupyter2018-11-26T00:00:00+00:002018-11-26T00:00:00+00:00http://edgriebel.com/using-r-in-jupyter<p><a href="http://jupyter.org/">Jupyter Notebooks</a> will handle <a href="https://www.r-project.org/about.html">R</a> well by following <a href="https://docs.anaconda.com/anaconda/navigator/tutorials/r-lang/">these steps</a>.
But, these steps don’t work with <a href="https://towardsdatascience.com/jupyter-notebooks-are-breathtakingly-featureless-use-jupyter-lab-be858a67b59d">Jupyterlab</a>.</p>
<p>Following the instructions <a href="https://richpauloo.github.io/2018-05-16-Installing-the-R-kernel-in-Jupyter-Lab/">here</a> will enable one to choose an R kernel. Note that there is a <em>ton</em> of output from R when running <code class="language-plaintext highlighter-rouge">install.packages("deftools")</code> because it’s building it from source.</p>
<p>If one is not doing a lot of R development then create an <a href="https://medium.freecodecamp.org/why-you-need-python-environments-and-how-to-manage-them-with-conda-85f155f4353c">environment</a> that can be switched into using <code class="language-plaintext highlighter-rouge">source activate <env-name></code> when R notebooks are needed. I do this because R is a <strong>ton</strong> of code that could crap up your root Python install.</p>
<p>(<a href="https://www.datacamp.com/community/blog/jupyter-notebook-r">This</a> is an alternative description of how to set up R in Jupyter and includes steps that work for Jupyter Notebooks and Jupyterlab.)</p>Ed GriebelJupyter Notebooks will handle R well by following these steps. But, these steps don’t work with Jupyterlab.Rebooting Blog and Moving to Github Pages2018-11-03T00:00:00+00:002018-11-03T00:00:00+00:00http://edgriebel.com/blog/rebooting-blog-moving-github-pages<p>I’m taking the plunge and finally finishing up moving this off of Dreamhost and onto Github pages.
It’s been “staged” on github for a while now, finally allocated time to getting it fully off dreamhost (and will save $10/mo).
HTTPS is not working yet, some extra config needs to be done on github’s side.
It was pretty easy on Dreamhost, just click a box and it automatically set up a LetsEncrypt cert for your domain.
I’m just happy that www redirection works :-)</p>
<p>I’m going to be moving content that’s been in draft form for “a while” (a <em>long</em> while in some cases), I’ll mark them the date I published them as the as-of date. If I’m disciplined enough I’ll add the original date in the text.</p>
<p>At some point I’m going to go on a theme hunt again.
I have to add an ‘about’ page with my resume and contact info, and find a template that shows the title and date at the top of a post.
I’ve added them in myself to an old verison of the website, but then you can’t auto-update anymore (or at least I haven’t figured out how to do it yet).</p>Ed GriebelI’m taking the plunge and finally finishing up moving this off of Dreamhost and onto Github pages. It’s been “staged” on github for a while now, finally allocated time to getting it fully off dreamhost (and will save $10/mo). HTTPS is not working yet, some extra config needs to be done on github’s side. It was pretty easy on Dreamhost, just click a box and it automatically set up a LetsEncrypt cert for your domain. I’m just happy that www redirection works :-)Words to Cut from Writing2018-11-01T00:00:00+00:002018-11-01T00:00:00+00:00http://edgriebel.com/personal-development/words-to-remove-from-writing<ul>
<li>just, perhaps, maybe</li>
<li>that</li>
<li>I think/I believe</li>
<li>All adverbs and most adjectives
<ul>
<li>really, very, seriously, …</li>
</ul>
</li>
<li>Don’t use big “two dollar” words:
<ul>
<li>numerous -> many</li>
<li>assistance -> help</li>
<li>sufficient -> enough</li>
</ul>
</li>
<li>Useless phrases like:
<ul>
<li>
<blockquote>
<p>It is interesting to point out</p>
</blockquote>
</li>
<li>
<blockquote>
<p>In a sense</p>
</blockquote>
</li>
<li>
<blockquote>
<p>I am tempted to say</p>
</blockquote>
</li>
</ul>
</li>
<li>Useless phrases (according to <em>Strunk & White</em>)
<ul>
<li>There is no doubt that -> No doubt</li>
<li>This is a topic that -> This topic</li>
<li>In order to -> To</li>
</ul>
</li>
</ul>
<p>(Via: Medium.com/writingcooperative.com)</p>Ed Griebeljust, perhaps, maybe that I think/I believe All adverbs and most adjectives really, very, seriously, … Don’t use big “two dollar” words: numerous -> many assistance -> help sufficient -> enough Useless phrases like: It is interesting to point out In a sense I am tempted to say Useless phrases (according to Strunk & White) There is no doubt that -> No doubt This is a topic that -> This topic In order to -> ToInstalling Synergy to share Windows and Linux2018-01-30T00:00:00+00:002018-01-30T00:00:00+00:00http://edgriebel.com/utils/synergy-on-windows-and-linux<p>I haven’t used Synergy in…years, but it was mostly reliable when I did use it last.</p>
<h1 id="configuration">Configuration:</h1>
<ul>
<li>HP 840 G1, 16GB i5, Windows 7 Enterprise as server</li>
<li>HP Compaq 8200 Elite SFF Linux, 16GB i7, Mint 18.3 Sylvia MATE 64-bit</li>
</ul>
<h1 id="install-on-windows">Install on Windows</h1>
<ul>
<li>Start with a Windows server as the “Server” where the kbd/mouse will be used</li>
<li>To test it, download a version (1.8.8) from <a href="https://github.com/brahma-dev/synergy-stable-builds/releases">forked Synergy repo</a></li>
<li>Install msi file</li>
<li>App will launch, set it up as a server, don’t bother to install Bonjour</li>
<li>Create a map with the hostname of the new machine on the screen setup page</li>
<li>click “Start” button</li>
<li>Note ip address (e.g. <code class="language-plaintext highlighter-rouge">ipconfig</code>)</li>
</ul>
<h1 id="install-on-linux">Install on Linux</h1>
<ul>
<li>run <code class="language-plaintext highlighter-rouge">sudo apt-get install synergy</code></li>
<li>Launch synergy: <code class="language-plaintext highlighter-rouge">synergy&</code></li>
<li>Select “Client” option</li>
<li>Enter Server’s IP address</li>
<li>Click “Start”</li>
</ul>
<p>Once these steps are done, you should see handshaking between the servers in the console.
When you get a connection message, the windows go away on both hosts.</p>
<p>Test that the mouse and keyboard work by hitting the edge of the screen, if so you’re done!</p>
<p>Notes:</p>
<ul>
<li>copy/paste between systems doesn’t seem to work, I haven’t tried to troubleshoot it</li>
<li>Error message in Linux window <code class="language-plaintext highlighter-rouge">The program 'Synergy' uses the Apple Bonjour compatibility layer of Avahi.</code>, I haven’t tried to troubleshoot it</li>
<li>As noted above, bonjour not installed on windows. This will probably cause a problem with auto-discovery and auto-configuration.
Entering IP address manually worked fine. Systems with a changing DHCP assignment may not work as well.</li>
</ul>Ed GriebelI haven’t used Synergy in…years, but it was mostly reliable when I did use it last.