<?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: William Lake</title>
    <description>The latest articles on DEV Community by William Lake (@williamlake).</description>
    <link>https://dev.to/williamlake</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%2F241097%2F577e9ca8-5fba-4b0f-8f82-6414fc2a914d.jpeg</url>
      <title>DEV Community: William Lake</title>
      <link>https://dev.to/williamlake</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/williamlake"/>
    <language>en</language>
    <item>
      <title>Taming PgAdmin's SQL Formatting</title>
      <dc:creator>William Lake</dc:creator>
      <pubDate>Thu, 31 Mar 2022 13:10:55 +0000</pubDate>
      <link>https://dev.to/williamlake/taming-pgadmins-sql-formatting-4ib0</link>
      <guid>https://dev.to/williamlake/taming-pgadmins-sql-formatting-4ib0</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feqak7jui7h13nionz8g1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feqak7jui7h13nionz8g1.png" alt="Unformatted"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/QZt3gtVDEzxRAiU3kQ/giphy-downsized-large.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/QZt3gtVDEzxRAiU3kQ/giphy-downsized-large.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The example query I'm using came from &lt;a href="https://www.w3schools.com/sql/sql_case.asp" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Qualifiers
&lt;/h2&gt;

&lt;p&gt;I really appreciate &lt;a href="https://github.com/postgres/pgadmin4" rel="noopener noreferrer"&gt;PgAdmin&lt;/a&gt; and &lt;a href="https://github.com/postgres/pgadmin4/graphs/contributors" rel="noopener noreferrer"&gt;everyone who's built it.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Who knows what I'd be doing without their hard work.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/jemtcrzKEqWEU/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/jemtcrzKEqWEU/giphy.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  More Qualifiers
&lt;/h2&gt;

&lt;p&gt;I haven't read every line of their documentation. Maybe their setup instructions include this on the very first page. Maybe they've surrounded it with exclamation points and made it bold &amp;amp; red. The point is, if they did- I missed it. If you find this helpful- great! If not, that's ok too. Take what works and leave the rest. Or don't, I'm not the cops.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/1fhFON1kTnDVN8ZXjN/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/1fhFON1kTnDVN8ZXjN/giphy.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting to the Point
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Click inside your Query Editor and use this keyboard shortcut to format your SQL: 
Ctrl + Shift + k

&lt;ul&gt;
&lt;li&gt;You'll need to do this after any change to these preferences in order to see the effects.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;From the top-most "File" menu:

&lt;ul&gt;
&lt;li&gt;File -&amp;gt; Preferences&lt;/li&gt;
&lt;li&gt;Query Tool -&amp;gt; SQL formatting&lt;/li&gt;
&lt;li&gt;Set these options for very compact SQL.&lt;/li&gt;
&lt;li&gt;Set these options for less compact, but easier to read SQL.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Very Compact SQL
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Option&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Re-indent aligned?&lt;/td&gt;
&lt;td&gt;True&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Re-indent?&lt;/td&gt;
&lt;td&gt;False&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Spaces around operators?&lt;/td&gt;
&lt;td&gt;False&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tab size&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Use spaces?&lt;/td&gt;
&lt;td&gt;True&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7zuylngisyspc7uyuopr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7zuylngisyspc7uyuopr.png" alt="Compact Format"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Less Compact Easier to Read
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Option&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Re-indent aligned?&lt;/td&gt;
&lt;td&gt;True&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Re-indent?&lt;/td&gt;
&lt;td&gt;True&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Spaces around operators?&lt;/td&gt;
&lt;td&gt;False&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tab size&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Use spaces?&lt;/td&gt;
&lt;td&gt;True&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe81ipi9h35ry1k986yzs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe81ipi9h35ry1k986yzs.png" alt="Less Compact Format"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>tutorial</category>
      <category>sql</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Quick Poll: Fav/Most Used Python Virtual Environment manager?</title>
      <dc:creator>William Lake</dc:creator>
      <pubDate>Sat, 05 Feb 2022 04:31:13 +0000</pubDate>
      <link>https://dev.to/williamlake/quick-poll-favmost-used-python-virtual-environment-manager-imf</link>
      <guid>https://dev.to/williamlake/quick-poll-favmost-used-python-virtual-environment-manager-imf</guid>
      <description>&lt;p&gt;Hi All,&lt;/p&gt;

&lt;p&gt;I've used Anaconda, Minicoda, venv, and pipenv. I'm (mostly) indifferent about which is "better". Now I want to get a point of reference of what other python devs are using and/or prefer.&lt;/p&gt;

&lt;p&gt;Is there one you like or use the most?&lt;/p&gt;

&lt;p&gt;Is there one your work enforces explicitly?&lt;/p&gt;

&lt;p&gt;Is there one outside of this list you prefer or use a lot? If so, what is it and why do you prefer it over the others?&lt;/p&gt;

&lt;p&gt;Thanks for helping me learn something new ya'll, I hope your week has gone well!&lt;/p&gt;

</description>
      <category>python</category>
    </item>
    <item>
      <title>You're formally invited to a party on Mount Stupid.</title>
      <dc:creator>William Lake</dc:creator>
      <pubDate>Sat, 07 Aug 2021 01:58:35 +0000</pubDate>
      <link>https://dev.to/williamlake/you-re-formally-invited-to-a-party-on-mount-stupid-dummy-33jn</link>
      <guid>https://dev.to/williamlake/you-re-formally-invited-to-a-party-on-mount-stupid-dummy-33jn</guid>
      <description>&lt;p&gt;Wait, you're already a dev?&lt;/p&gt;

&lt;p&gt;Then you must have a vacation home here already.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UFMPdE0T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.giphy.com/media/AKJA347aQpPdm/giphy.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UFMPdE0T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.giphy.com/media/AKJA347aQpPdm/giphy.webp" alt="Gotcha Mother Cusser" width="320" height="180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Anyway, you ever heard of the Dunning-Kruger effect?&lt;/p&gt;

&lt;p&gt;It's a tem used to describe your annoying co-worker who skims the documentation of a new framework for five minutes, and then corrects you on its usage for the next week.&lt;/p&gt;

&lt;p&gt;To be more specific:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Dunning–Kruger effect is a hypothetical cognitive bias stating that people with low ability at a task overestimate their ability.&lt;br&gt;
&lt;a href="https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect?wprov=sfla1"&gt;Source&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Translation: Someone who knows just enough to feel like they're an expert, but not enough to know they're really not.&lt;/p&gt;

&lt;p&gt;Being in such a state is known as being on "Mount Stupid" and as devs, we all have vacation homes there.&lt;/p&gt;

&lt;p&gt;"How?" you might be asking, "I'm the team lead!"&lt;/p&gt;

&lt;p&gt;"Shut up" I respond, "This is an article, I can't hear you."&lt;/p&gt;

&lt;p&gt;As we all know this field is fluctuating, constantly. It goes without saying that even the best of us cannot know everything at all times. Although it's important to know what we bring to the table, over-estimating our talents can be a great way to unintentionally mislead ourselves and our customers. The Dunning-Kruger Effect helps us remember to re-evaluate once in a while, ensuring what we offer is more than bluster.&lt;/p&gt;

&lt;p&gt;So- consider this a formal invitation to my private villa on Mount Stupid. There's a pool and everything. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Bash Functions for Miniconda</title>
      <dc:creator>William Lake</dc:creator>
      <pubDate>Thu, 07 Nov 2019 13:50:11 +0000</pubDate>
      <link>https://dev.to/williamlake/bash-functions-miniconda-4mlf</link>
      <guid>https://dev.to/williamlake/bash-functions-miniconda-4mlf</guid>
      <description>&lt;p&gt;&lt;strong&gt;Qualifier:&lt;/strong&gt; These instructions were made with Ubuntu 18.04 in mind. &lt;em&gt;Your mileage may vary.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A little under 2 years ago a friend introduced me to &lt;a href="https://docs.conda.io/en/latest/miniconda.html"&gt;miniconda&lt;/a&gt; and I've loved it ever since. I know there's other ways manage python virtual environments (I use  &lt;a href="https://github.com/pypa/pipenv"&gt;pipenv&lt;/a&gt; at work and there's always &lt;a href="https://docs.python.org/3/tutorial/venv.html"&gt;venv&lt;/a&gt;,) but I've stuck with miniconda in my personal projects out of habit. If you use miniconda on Ubuntu, hopefully you'll find this helpful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Short &amp;amp; Sweet
&lt;/h2&gt;

&lt;p&gt;Add the following functions to your &lt;code&gt;~/.bashrc&lt;/code&gt; file. Don't forget to reload your &lt;code&gt;.bashrc&lt;/code&gt; before using them! (Reload via &lt;code&gt;source .bashrc&lt;/code&gt;)&lt;/p&gt;

&lt;h3&gt;
  
  
  newconda
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Creates a new python conda environment and installs the listed modules.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; &lt;em&gt;This function doesn't ask for confirmation!&lt;/em&gt; This is personal preference, but if you'd like to change it remove the &lt;code&gt;y&lt;/code&gt; in &lt;code&gt;-yn&lt;/code&gt; (E.g. &lt;code&gt;conda create -n "$1" python="$2"&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Creates a new python conda environment and installs the listed modules.&lt;/span&gt;
&lt;span class="c"&gt;# $1 : Environment Name (E.g. test_env)&lt;/span&gt;
&lt;span class="c"&gt;# $2 : Python Version (E.g. 3)&lt;/span&gt;
&lt;span class="c"&gt;# $3...$n+1 : A list of modules to install.&lt;/span&gt;
&lt;span class="c"&gt;# &lt;/span&gt;
&lt;span class="c"&gt;# E.g.&lt;/span&gt;
&lt;span class="c"&gt;#       newconda test_env 3 numpy pandas&lt;/span&gt;
&lt;span class="c"&gt;#       newconda test_env 3.6 tensorflow tensorflow-hub tensorflow-datasets&lt;/span&gt;
newconda&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

        &lt;span class="c"&gt;# Create the env with the given name and python version.&lt;/span&gt;
        &lt;span class="c"&gt;# Note: -y forces yes, you won't be asked for confirmation.&lt;/span&gt;
        conda create &lt;span class="nt"&gt;-yn&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nv"&gt;python&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$2&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

        &lt;span class="c"&gt;# Activate the environment.&lt;/span&gt;
        conda activate &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

        &lt;span class="c"&gt;# Loop through the remaining arguments, installing them as python modules.&lt;/span&gt;
        &lt;span class="k"&gt;for &lt;/span&gt;i &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="p"&gt;@&lt;/span&gt;:3&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
                &lt;span class="k"&gt;do &lt;/span&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
        &lt;span class="k"&gt;done&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  remconda
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Removes the listed conda environment.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; &lt;em&gt;This function doesn't ask for confirmation!&lt;/em&gt; This is personal preference, but if you'd like to change it remove the &lt;code&gt;y&lt;/code&gt; in &lt;code&gt;-yn&lt;/code&gt; (E.g. &lt;code&gt;conda env remove -n "$1"&lt;/code&gt;)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Removes the listed conda environment.&lt;/span&gt;
&lt;span class="c"&gt;# $1 : The name of the environment to remove.&lt;/span&gt;
&lt;span class="c"&gt;#&lt;/span&gt;
&lt;span class="c"&gt;# E.g. &lt;/span&gt;
&lt;span class="c"&gt;#       remconda test_env&lt;/span&gt;
remconda&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="c"&gt;# Deactivate the current environment.&lt;/span&gt;
        &lt;span class="c"&gt;# (In case you're in the target environment.)&lt;/span&gt;
        conda deactivate

        &lt;span class="c"&gt;# Remove the environment.&lt;/span&gt;
        &lt;span class="c"&gt;# Note: -y forces yes, you won't be asked for confirmation.&lt;/span&gt;
        conda &lt;span class="nb"&gt;env &lt;/span&gt;remove &lt;span class="nt"&gt;-yn&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>bash</category>
      <category>productivity</category>
      <category>python</category>
      <category>conda</category>
    </item>
    <item>
      <title>QuickTip: Add the Eclipse Integrated Terminal</title>
      <dc:creator>William Lake</dc:creator>
      <pubDate>Wed, 06 Nov 2019 14:07:07 +0000</pubDate>
      <link>https://dev.to/williamlake/quicktip-add-the-eclipse-integrated-terminal-1716</link>
      <guid>https://dev.to/williamlake/quicktip-add-the-eclipse-integrated-terminal-1716</guid>
      <description>&lt;p&gt;&lt;em&gt;Did you know Eclipse has an integrated terminal?&lt;/em&gt; It's such a useful feature in VSCode, I was thrilled when a co-worker pointed out the same functionality in Eclipse.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding the View
&lt;/h2&gt;

&lt;p&gt;Navigate to the top most menu and select:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Window&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Show View&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Terminal&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;(&lt;em&gt;If for some reason &lt;code&gt;Terminal&lt;/code&gt; isn't an option, select &lt;code&gt;Other...&lt;/code&gt; and search for "Terminal" by typing it into the resulting dialog.&lt;/em&gt;)&lt;/p&gt;

&lt;h2&gt;
  
  
  Opening a New Terminal
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Locate your Terminal View (usually opens at the botom) and click the &lt;code&gt;Open a Terminal&lt;/code&gt; button: &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MDhfBQ0X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7fgya38k9tf1ycn60lii.png" alt="Alt Text" width="351" height="34"&gt;
&lt;/li&gt;
&lt;li&gt;In the resulting dialog, select your desired options (go with the defaults if you're unsure) and click &lt;code&gt;OK&lt;/code&gt;.

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Note the &lt;code&gt;Choose Terminal&lt;/code&gt; drop-down also provides &lt;code&gt;SSH&lt;/code&gt; and &lt;code&gt;Telnet&lt;/code&gt; variants- handy!&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;In the new terminal, &lt;code&gt;cd&lt;/code&gt; to your project's working directory.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Side Notes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Eclipse doesn't always auto-detect file system changes made from the  integrated terminal.&lt;/em&gt; You can manually refresh your project by right clicking its root node in the Project Explorer and selecting &lt;code&gt;Refresh&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;You can exit/close a terminal by first entering the &lt;code&gt;exit&lt;/code&gt; command, then closing the tab.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>productivity</category>
      <category>eclipse</category>
      <category>java</category>
      <category>ide</category>
    </item>
    <item>
      <title>Create a linux alias to list all available commands</title>
      <dc:creator>William Lake</dc:creator>
      <pubDate>Sun, 03 Nov 2019 13:42:17 +0000</pubDate>
      <link>https://dev.to/williamlake/create-a-linux-alias-to-list-all-available-commands-311b</link>
      <guid>https://dev.to/williamlake/create-a-linux-alias-to-list-all-available-commands-311b</guid>
      <description>&lt;p&gt;&lt;strong&gt;Infomercial-style qualifier:&lt;/strong&gt; These instructions were created on Ubuntu 18.04. &lt;em&gt;Your mileage may vary.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I find myself constantly Googling Linux commands and then promptly forgetting them. This morning I decided to find a better way, and after creating my own process I thought I'd share. Hopefully it's useful to someone in the future.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bonus&lt;/strong&gt;: Found something useful along the way: &lt;a href="https://www.commandlinefu.com/commands/browse"&gt;https://www.commandlinefu.com/commands/browse&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  How To
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Create an alias named &lt;code&gt;allcomm&lt;/code&gt; and save it in your &lt;code&gt;.bashrc&lt;/code&gt;.&lt;/em&gt;&lt;br&gt;
&lt;code&gt;echo "alias allcomm=\"compgen -A function -abck\"" &amp;gt;&amp;gt; ~/.bashrc&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Reload your .bashrc so the changes will take effect.&lt;/em&gt;&lt;br&gt;
&lt;code&gt;source ~/.bashrc&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Searching results:&lt;/em&gt;&lt;br&gt;
&lt;code&gt;allcomm search_string_here&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;E.g.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;allcomm zip

zip
zipnote
zipcloak
zipgrep
zipinfo
zipsplit
zipdetails
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Searching via grep:&lt;/em&gt;&lt;br&gt;
&lt;code&gt;allcomm | grep search_string_here&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;E.g.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;allcomm | grep zip

zip
preunzip
unzip
zipnote
unzipsfx
zipcloak
zipgrep
zipinfo
funzip
prezip-bin
mzip
zipsplit
zipdetails
gpg-zip
prezip
bzip2recover
bunzip2
gunzip
gzip
bzip2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Source: &lt;a href="https://stackoverflow.com/a/949006"&gt;https://stackoverflow.com/a/949006&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>ubuntu</category>
      <category>productivity</category>
      <category>bash</category>
    </item>
    <item>
      <title>Quick &amp; Dirty Django Drag &amp; Drop Bootstrap Build with Layoutit.com</title>
      <dc:creator>William Lake</dc:creator>
      <pubDate>Sat, 26 Oct 2019 11:56:41 +0000</pubDate>
      <link>https://dev.to/williamlake/how-to-make-a-django-site-with-bootstrap4-and-layoutit-com-40op</link>
      <guid>https://dev.to/williamlake/how-to-make-a-django-site-with-bootstrap4-and-layoutit-com-40op</guid>
      <description>&lt;p&gt;&lt;strong&gt;Yay Alliteration&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Things you should know.
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;I'm new to Django, I.e. not an expert.&lt;/li&gt;
&lt;li&gt;These are instructions for a brand new Django project. I'm making a tutorial re: adding views to an existing project with this method, but I'm not there yet. In the meantime- get clever, I believe in you.&lt;/li&gt;
&lt;li&gt;Re: static files, if you're going to deploy this project to production the &lt;a href="https://docs.djangoproject.com/en/2.2/howto/static-files/"&gt;DjangoProject&lt;/a&gt; says "&lt;em&gt;This method is grossly inefficient and probably insecure, so it is unsuitable for production.&lt;/em&gt;" SO. See &lt;a href="https://docs.djangoproject.com/en/2.2/howto/static-files/deployment/"&gt;here&lt;/a&gt; for 
resolution.&lt;/li&gt;
&lt;li&gt;Probably doesn't need to be said, but just in case: &lt;code&gt;name_of_project&lt;/code&gt;/&lt;code&gt;name_of_app&lt;/code&gt; show up repeatedly and need to be replaced with your own deeply creative alternatives.&lt;/li&gt;
&lt;li&gt;Django 2+&lt;/li&gt;
&lt;li&gt;Bootstrap 4+&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Helpful Sites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.djangoproject.com/en/2.2/intro/tutorial01/"&gt;DjangoProject.com "Writing your first Django app"&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.djangoproject.com/en/2.2/"&gt;https://docs.djangoproject.com/en/2.2/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Getting to the &lt;strong&gt;Point&lt;/strong&gt; Already
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://realpython.com/python-virtual-environments-a-primer/"&gt;Virtual Environment&lt;/a&gt; (I recommend this, but I'm not the cops- do what you like.)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pip install django django-bootstrap4&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;django-admin startproject name_of_project&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cd name_of_project&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;python manage.py startapp name_of_app&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;name_of_app/templates/name_of_app&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;name_of_app/static/name_of_app&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Make required changes to &lt;code&gt;name_of_app/settings.py&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;Add entry to &lt;code&gt;INSTALLED_APPS&lt;/code&gt;: &lt;code&gt;'name_of_app.apps.NameOfAppConfig',&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add entry to &lt;code&gt;TEMPLATE&lt;/code&gt;'s &lt;code&gt;OPTIONS&lt;/code&gt; dict, using content in related section below.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Make optional changes to &lt;code&gt;name_of_app/settings.py&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.djangoproject.com/en/2.2/ref/settings/#databases"&gt;DATABASES&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TIME_ZONE&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;python manage.py migrate&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Build layout at &lt;a href="https://www.layoutit.com/"&gt;Layoutit&lt;/a&gt;, download, and unzip.&lt;/li&gt;
&lt;li&gt;Copy &lt;code&gt;layoutit_dir/layout/src/index.html&lt;/code&gt; to &lt;code&gt;name_of_project/name_of_app/templates/name_of_app&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Copy the css/fonts/js dirs in &lt;code&gt;layoutit_dir/layout/src&lt;/code&gt; to &lt;code&gt;name_of_project/name_of_app/static/name_of_app&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;base.html&lt;/code&gt; in &lt;code&gt;name_of_app/templates/name_of_app&lt;/code&gt;, fill w/ content from related section below.&lt;/li&gt;
&lt;li&gt;Open &lt;code&gt;name_of_app/templates/name_of_app/index.html&lt;/code&gt;, make replacements  in related section below.&lt;/li&gt;
&lt;li&gt;Open &lt;code&gt;name_of_app/views.py&lt;/code&gt; and add a view using content from related section below.&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;name_of_app/urls.py&lt;/code&gt; and fill with content from related section below.&lt;/li&gt;
&lt;li&gt;Open &lt;code&gt;name_of_project/urls.py&lt;/code&gt; and:

&lt;ul&gt;
&lt;li&gt;Add &lt;code&gt;include&lt;/code&gt; to the &lt;code&gt;django.urls&lt;/code&gt; import (E.g. &lt;code&gt;from django.urls import include, path&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Add import &lt;code&gt;from name_of_app import views&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add path to urlpatterns list: &lt;code&gt;path('name_of_app/',include('name_of_app.urls'))&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;python manage.py runserver&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Open browser to &lt;a href="http://localhost:8000/name_of_app/"&gt;http://localhost:8000/name_of_app/&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  8. [&lt;code&gt;TEMPLATE&lt;/code&gt;][&lt;code&gt;OPTIONS&lt;/code&gt;] Entry &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;            &lt;span class="s"&gt;'builtins'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
                &lt;span class="s"&gt;'django.contrib.staticfiles.templatetags.staticfiles'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;],&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I.e.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;TEMPLATES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s"&gt;'BACKEND'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;'django.template.backends.django.DjangoTemplates'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s"&gt;'DIRS'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
        &lt;span class="s"&gt;'APP_DIRS'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s"&gt;'OPTIONS'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="s"&gt;'context_processors'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
                &lt;span class="s"&gt;'django.template.context_processors.debug'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s"&gt;'django.template.context_processors.request'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s"&gt;'django.contrib.auth.context_processors.auth'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s"&gt;'django.contrib.messages.context_processors.messages'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="s"&gt;'builtins'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="c1"&gt;### NEW ENTRY ###
&lt;/span&gt;                &lt;span class="s"&gt;'django.contrib.staticfiles.templatetags.staticfiles'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  14. &lt;code&gt;base.html&lt;/code&gt; &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;{% load static %}

&lt;span class="cp"&gt;&amp;lt;!doctype html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"utf-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1, shrink-to-fit=no"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"{% static 'name_of_app/css/style.css' %}"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text/css"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"{% static 'name_of_app/css/bootstrap.min.css' %}"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text/css"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    {% block content %}{% endblock %}
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  15. &lt;code&gt;index.html&lt;/code&gt; Replacements &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Replace&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"utf-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;http-equiv=&lt;/span&gt;&lt;span class="s"&gt;"X-UA-Compatible"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"IE=edge"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Bootstrap 4, from LayoutIt!&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"description"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"Source code generated using layoutit.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"author"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"LayoutIt!"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"css/bootstrap.min.css"&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"css/style.css"&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;With&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;{% extends 'name_of_app/base.html' %}

{% block content %}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Then Replace&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"js/jquery.min.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"js/bootstrap.min.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"js/scripts.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;With&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;
&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"{% static 'name_of_app/js/jquery.min.js' %}"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"{% static 'name_of_app/js/bootstrap.min.js' %}"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"{% static 'name_of_app/js/scripts.js' %}"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
{% endblock %}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  16. &lt;code&gt;views.py&lt;/code&gt; Method &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;django.shortcuts&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;render&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;index&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# gather data
&lt;/span&gt;    &lt;span class="c1"&gt;# model_class = Model.objects....
&lt;/span&gt;
    &lt;span class="c1"&gt;# create context
&lt;/span&gt;    &lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s"&gt;'name_of_app/index.html'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  17. &lt;code&gt;urls.py&lt;/code&gt; &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;django.urls&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;

&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;.&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;views&lt;/span&gt;

&lt;span class="n"&gt;app_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'name_of_app'&lt;/span&gt;
&lt;span class="n"&gt;urlpatterns&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;views&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'index'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://i.giphy.com/media/3o6fJbVyV1d4QhVXjO/source.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/3o6fJbVyV1d4QhVXjO/source.gif" alt="" width="626" height="342"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>django</category>
      <category>bootstrap</category>
      <category>tutorial</category>
      <category>python</category>
    </item>
    <item>
      <title>Importing Stored Procedures in Apache Cayenne</title>
      <dc:creator>William Lake</dc:creator>
      <pubDate>Thu, 10 Oct 2019 13:02:27 +0000</pubDate>
      <link>https://dev.to/williamlake/importing-stored-procedures-in-apache-cayenne-560b</link>
      <guid>https://dev.to/williamlake/importing-stored-procedures-in-apache-cayenne-560b</guid>
      <description>&lt;h2&gt;
  
  
  Executive Summary
&lt;/h2&gt;

&lt;p&gt;Add to the cayenne plugin's dbImport section in your pom.xml:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;includeProcedure&amp;gt;&lt;/span&gt;Procedure_Name&lt;span class="nt"&gt;&amp;lt;/includeProcedure&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run your maven commands:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mvn cayenne:cdbimport&lt;/code&gt;&lt;br&gt;
&lt;code&gt;mvn cayenne:cgen&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The second should result in:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Add procedure Procedure_Name&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can use your procedure via:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Returns a ProcedureResult&lt;/span&gt;
&lt;span class="nc"&gt;ProcedureCall&lt;/span&gt;
&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;query&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Procedure_Name"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;param&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"param_name"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;param_value&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;call&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// The previously created context.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To return a particular class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;ProcedureCall&lt;/span&gt;
&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;query&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Procedure_Name"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nc"&gt;ModelClass&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;param&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"param_name"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;param_value&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;call&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// The previously created context.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To return a List of your particular class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;ProcedureCall&lt;/span&gt;
&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;query&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Procedure_Name"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nc"&gt;ModelClass&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;param&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"param_name"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;param_value&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;call&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// The previously created context.&lt;/span&gt;
&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;firstList&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Backstory
&lt;/h2&gt;

&lt;p&gt;I'm currently using &lt;a href="https://cayenne.apache.org/"&gt;Apache Cayenne&lt;/a&gt; for a project I'm working on for a friend. It's been really useful so far, but a couple days ago I realized it wasn't automatically importing my new stored procedure. Although there's &lt;a href="https://cayenne.apache.org/docs/4.1/api/org/apache/cayenne/query/ProcedureCall.html"&gt;code&lt;/a&gt; for &lt;em&gt;calling&lt;/em&gt; procedures, I was having a hard time ensuring my procedure was imported when I ran the &lt;code&gt;cdbimport&lt;/code&gt;/&lt;code&gt;cdbgen&lt;/code&gt; commands. Additionally, I was having a &lt;em&gt;really&lt;/em&gt; hard time finding resources/examples.&lt;/p&gt;

&lt;p&gt;In the end I ended up using "ol' reliable"- ctrl + space. After stepping through the sub-sections in pom.xml's cayenne plugin section I found one tag named &lt;code&gt;&amp;lt;includeProcedure&amp;gt;&lt;/code&gt;. Adding it to the &lt;code&gt;&amp;lt;dbImport&amp;gt;&lt;/code&gt; section is what finally did the trick: &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;build&amp;gt;
    &amp;lt;plugins&amp;gt;
            &amp;lt;!-- Other entries... --&amp;gt;
        &amp;lt;plugin&amp;gt;
             &amp;lt;groupId&amp;gt;org.apache.cayenne.plugins&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;cayenne-maven-plugin&amp;lt;/artifactId&amp;gt;
            &amp;lt;version&amp;gt;${cayenne.version}&amp;lt;/version&amp;gt;
            &amp;lt;configuration&amp;gt;
                &amp;lt;!-- Other entries... --&amp;gt;
                &amp;lt;dbImport&amp;gt;
                    &amp;lt;defaultPackage&amp;gt;com.example&amp;lt;/defaultPackage&amp;gt;
                    &amp;lt;includeProcedure&amp;gt;Procedure_Name&amp;lt;/includeProcedure&amp;gt;
                &amp;lt;/dbImport&amp;gt;
            &amp;lt;/configuration&amp;gt;
                    &amp;lt;!-- Other entries... --&amp;gt;
        &amp;lt;/plugin&amp;gt;
    &amp;lt;/plugins&amp;gt;
&amp;lt;/build&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After making this change, run your cayenne &lt;code&gt;cdbimport&lt;/code&gt;/&lt;code&gt;cgen&lt;/code&gt; commands again and you will be able to use the Procedure like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;ProcedureCall&lt;/span&gt;
&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;query&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Procedure_Name"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;param&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"param_name"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;param_value&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;call&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// The previously created context.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There's more to the ProcedureCall than just this example, so be sure to check out the Executive Summary above and its &lt;a href="https://cayenne.apache.org/docs/4.0/api/org/apache/cayenne/query/ProcedureCall.html"&gt;Javadoc&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Hopefully this will save someone some time in the future.&lt;/p&gt;

</description>
      <category>java</category>
      <category>orm</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
