<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Jane Talks Code</title>
	<atom:link href="https://janetalkscode.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://janetalkscode.wordpress.com</link>
	<description>Jane&#039;s bits and bytes</description>
	<lastBuildDate>Wed, 30 Jun 2021 03:39:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<site xmlns="com-wordpress:feed-additions:1">49634520</site><cloud domain='janetalkscode.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>https://s2.wp.com/i/webclip.png</url>
		<title>Jane Talks Code</title>
		<link>https://janetalkscode.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="https://janetalkscode.wordpress.com/osd.xml" title="Jane Talks Code" />
	<atom:link rel='hub' href='https://janetalkscode.wordpress.com/?pushpress=hub'/>
	<item>
		<title>Halfway there</title>
		<link>https://janetalkscode.wordpress.com/2021/06/29/halfway-there/</link>
					<comments>https://janetalkscode.wordpress.com/2021/06/29/halfway-there/#respond</comments>
		
		<dc:creator><![CDATA[Jane Ullah]]></dc:creator>
		<pubDate>Wed, 30 Jun 2021 03:39:36 +0000</pubDate>
				<category><![CDATA[Personal]]></category>
		<guid isPermaLink="false">http://janetalkscode.wordpress.com/2021/06/29/halfway-there/</guid>

					<description><![CDATA[It’s a little surreal to think that the year is halfway through. There’s so much left to do! There’s a lot going on but I can’t share until after the fact. Until then I’ll leave you with a picture of my gorgeous nails]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">It’s a little surreal to think that the year is halfway through. There’s so much left to do!</p>



<p class="wp-block-paragraph">There’s a lot going on but I can’t share until after the fact. Until then I’ll leave you with a picture of my gorgeous nails</p>



<figure class="wp-block-image size-large"><img width="798" height="1024" data-attachment-id="644" data-permalink="https://janetalkscode.wordpress.com/2021/06/29/halfway-there/img_0107/" data-orig-file="https://janetalkscode.wordpress.com/wp-content/uploads/2021/06/img_0107.jpg" data-orig-size="2712,3481" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;1.6&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;iPhone 12 Pro&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1625002697&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;4.2&quot;,&quot;iso&quot;:&quot;800&quot;,&quot;shutter_speed&quot;:&quot;0.041666666666667&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="img_0107" data-image-description="" data-image-caption="" data-large-file="https://janetalkscode.wordpress.com/wp-content/uploads/2021/06/img_0107.jpg?w=798" src="https://janetalkscode.wordpress.com/wp-content/uploads/2021/06/img_0107.jpg?w=798" alt="" class="wp-image-644" srcset="https://janetalkscode.wordpress.com/wp-content/uploads/2021/06/img_0107.jpg?w=798 798w, https://janetalkscode.wordpress.com/wp-content/uploads/2021/06/img_0107.jpg?w=1596 1596w, https://janetalkscode.wordpress.com/wp-content/uploads/2021/06/img_0107.jpg?w=117 117w, https://janetalkscode.wordpress.com/wp-content/uploads/2021/06/img_0107.jpg?w=234 234w, https://janetalkscode.wordpress.com/wp-content/uploads/2021/06/img_0107.jpg?w=768 768w, https://janetalkscode.wordpress.com/wp-content/uploads/2021/06/img_0107.jpg?w=1440 1440w" sizes="(max-width: 798px) 100vw, 798px" /></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://janetalkscode.wordpress.com/2021/06/29/halfway-there/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">645</post-id>
		<media:content url="https://1.gravatar.com/avatar/d93ed28fa877c723edf0ffb014bb988f205e9f4bd28276354c1f9f040534d4d3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janoulle</media:title>
		</media:content>

		<media:content url="https://janetalkscode.wordpress.com/wp-content/uploads/2021/06/img_0107.jpg?w=798" medium="image" />
	</item>
		<item>
		<title>Stand up</title>
		<link>https://janetalkscode.wordpress.com/2019/01/12/stand-up/</link>
					<comments>https://janetalkscode.wordpress.com/2019/01/12/stand-up/#respond</comments>
		
		<dc:creator><![CDATA[Jane Ullah]]></dc:creator>
		<pubDate>Sat, 12 Jan 2019 15:37:52 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<guid isPermaLink="false">http://janetalkscode.wordpress.com/?p=641</guid>

					<description><![CDATA[On a recent project, we hit a minor setback where a system was delivered with components that didn&#8217;t play nicely together. How did this happen? One team member&#8217;s point of view (me) was that a strategy for interoperability was talked about and I felt we were all on the same page on how we were &#8230; <a href="https://janetalkscode.wordpress.com/2019/01/12/stand-up/" class="more-link">Continue reading <span class="screen-reader-text">Stand up</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>On a recent project, we hit a minor setback where a system was delivered with components that didn&#8217;t play nicely together. How did this happen? One team member&#8217;s point of view (me) was that a strategy for interoperability <em>was</em> talked about and I felt we were all on the same page on how we were to proceed. My instinctual reaction at discovering the incompatibility of the components was to feel frustration that &#8220;I was under the impression that we&#8217;d talked about doing X so why was Y done&#8221; and that additional unplanned development was now a part of an already-tight deadline. That&#8217;s my first reaction and it&#8217;s okay to feel that way. However, stopping at that reaction doesn&#8217;t address the deeper issues. The other part to this story is examining the processes or environment that led to the design and delivery of a system where two key components would not play well together. That&#8217;s a decent-sized &#8220;Oops&#8221; to have happen and I want to learn to prevent this from happening again.</p>
<p>At $currentCompany, we do Agile/Scrum with all the requisite ceremonies &#8211; daily standups, demos, et cetera. <a href="https://martinfowler.com/articles/itsNotJustStandingUp.html">Standups</a> are intended to help the team be aware of what everyone else is doing, help others get unblocked, and discuss any issues. I really like this explanation of what stand up are about from Jason Yip:</p>
<blockquote><p>Stand-ups are a mechanism to regularly synchronise so that teams&#8230;</p>
<ul>
<li><b>Share understanding of goals.</b> <span style="color:#ff6600;">Even if we thought we understood each other at the start (which we probably didn’t), our understanding drifts, as does the context within which we’re operating</span>. A “team” where each team member is working toward different goals tends to be ineffective.</li>
<li><b>Coordinate efforts.</b> If the work doesn’t need to be coordinated, you don’t need a team. Conversely, if you have a team, I assume the work requires coordination. <span style="color:#ff6600;">Poor coordination amongst team members tends to lead to poor outcomes.</span></li>
<li><b>Share problems and improvements.</b> One of the primary benefits of a team versus working alone, is that team members can help each other when someone encounters a problem or discovers a better way of doing something. A “team” where team members are not comfortable sharing problems and/or do not help each other tends to be ineffective.</li>
<li><b>Identify as a team.</b> It is very difficult to psychologically identify with a group if you don’t regularly engage with the group. You will not develop a strong sense of relatedness even if you believe them to be capable and pursuing the same goals.</li>
</ul>
</blockquote>
<p>The description above captures the ideal state and I think we do well on the &#8220;Identify as a team&#8221; and &#8220;Share problems and improvements&#8221; bullet points. We joke at standups and commiserate over issues/things. However, the &#8220;Coordinate efforts&#8221; and &#8220;Share understanding of goals&#8221; seems to be where things went left as it were. In particular, I think when &#8220;understanding drifted&#8221;, standups would have been a perfect place to bring it up in order for others working on various parts of the system to be given the time to assess how their understanding of their piece changes. I&#8217;ll keep noodling on this as I continue to introspect.</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://janetalkscode.wordpress.com/2019/01/12/stand-up/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">641</post-id>
		<media:content url="https://1.gravatar.com/avatar/d93ed28fa877c723edf0ffb014bb988f205e9f4bd28276354c1f9f040534d4d3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janoulle</media:title>
		</media:content>
	</item>
		<item>
		<title>Debugging a basic TypeScript app in Visual Studio Code</title>
		<link>https://janetalkscode.wordpress.com/2019/01/01/debugging-a-basic-typescript-app-in-visual-studio-code/</link>
					<comments>https://janetalkscode.wordpress.com/2019/01/01/debugging-a-basic-typescript-app-in-visual-studio-code/#comments</comments>
		
		<dc:creator><![CDATA[Jane Ullah]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 14:39:45 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<guid isPermaLink="false">http://janetalkscode.wordpress.com/?p=635</guid>

					<description><![CDATA[I&#8217;m learning TypeScript and one of the most important &#8216;to-do&#8217;s when learning a new language is setting up your debug environment or debugging. Here&#8217;s how to get a bare-bones app (e.g. a helloworld.ts file that compiles down to a helloworld.js file in the workspace folder) setup for debugging. Pre-requisite to following the steps below: you have already &#8230; <a href="https://janetalkscode.wordpress.com/2019/01/01/debugging-a-basic-typescript-app-in-visual-studio-code/" class="more-link">Continue reading <span class="screen-reader-text">Debugging a basic TypeScript app in Visual Studio&#160;Code</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>I&#8217;m learning <a href="https://www.typescriptlang.org/index.html">TypeScript</a> and one of the most important &#8216;to-do&#8217;s when learning a new language is setting up your debug environment or debugging.</p>
<p>Here&#8217;s how to get a bare-bones app (e.g. a helloworld.ts file that compiles down to a helloworld.js file in the workspace folder) setup for debugging. Pre-requisite to following the steps below: <a href="https://www.typescriptlang.org/index.html#download-links">you have already setup your computer to run a TypeScript application successfully</a>.</p>
<ol>
<li>Create a folder for your TypeScript HelloWorld application and initialize the folder using <a href="https://www.npmjs.com/package/tsc-init">tsc &#8211;init</a> (this creates the tsconfig.json file).</li>
<li>By default (version 1.30.1), the tsconfig.json file generated does not enable source maps. A source map is a mapping from the TypeScript file to the generated javascript file (typescript <em>transpiles</em> to javascript). As a result, in order to debug the TypeScript code, the source map attribute needs to be true.</li>
<li>To enable debugging via VS Code, you&#8217;ll need to create configuration for that. VS Code uses a special file called launch.json to instruct the IDE on how to debug. Per the <a href="https://go.microsoft.com/fwlink/?linkid=830387">official Microsoft documentation on debugging</a>, you simply create one via the IDE by clicking on the <em>Configure</em> gear icon on the <em>Debug</em> view top bar. You&#8217;re not done yet though; the autogenerated launch.json file requires the following modifications:
<ol>
<li>an absolute path to the TypeScript file to be debugged,</li>
<li>absolute paths to the generated JavaScript files after transpilation from TypeScript, and</li>
<li>setting the sourceMaps attribute to true (it&#8217;s not clear to me if this is enabled by default but better to be explicit here).</li>
</ol>
</li>
<li>Here&#8217;s an example of what my debug configuration looks like after step 3:
<div>
<div>{</div>
<div>&#8220;type&#8221;: &#8220;node&#8221;,</div>
<div>&#8220;request&#8221;: &#8220;launch&#8221;,</div>
<div>&#8220;name&#8221;: &#8220;Launch Program&#8221;,</div>
<div>&#8220;program&#8221;: &#8220;${workspaceFolder}/helloworld.ts&#8221;,</div>
<div>&#8220;sourceMaps&#8221;: true,</div>
<div>&#8220;outFiles&#8221;: [&#8220;${workspaceFolder}/helloworld.js&#8221;]</div>
<div>}</div>
</div>
</li>
<li>The workspaceFolder is a predefined variable you can use to construct full paths to files. In my view, using this would be preferred to hard-coding the absolute paths. Here&#8217;s the <a href="https://code.visualstudio.com/docs/editor/variables-reference">list of other predefined variables</a> for further exploration.</li>
<li>Now, you can add some arbitrary breakpoints to your TypeScript code, launch the configuration you just created, and observe that your breakpoints in the TypeScript file are being hit!</li>
<li>Some issues I ran into:
<ol>
<li>The value for the &#8220;program&#8221; option was incorrect i.e. pointing to a file that didn&#8217;t actually existing.
<p><figure data-shortcode="caption" id="attachment_636" aria-describedby="caption-attachment-636" style="width: 558px" class="wp-caption alignnone"><img data-attachment-id="636" data-permalink="https://janetalkscode.wordpress.com/2019/01/01/debugging-a-basic-typescript-app-in-visual-studio-code/program-does-not-exist/" data-orig-file="https://janetalkscode.wordpress.com/wp-content/uploads/2019/01/program-does-not-exist.png" data-orig-size="558,125" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="program-does-not-exist" data-image-description="" data-image-caption="" data-large-file="https://janetalkscode.wordpress.com/wp-content/uploads/2019/01/program-does-not-exist.png?w=558" class=" size-full wp-image-636 alignnone" src="https://janetalkscode.wordpress.com/wp-content/uploads/2019/01/program-does-not-exist.png" alt="program-does-not-exist" width="558" height="125" srcset="https://janetalkscode.wordpress.com/wp-content/uploads/2019/01/program-does-not-exist.png 558w, https://janetalkscode.wordpress.com/wp-content/uploads/2019/01/program-does-not-exist.png?w=150&amp;h=34 150w, https://janetalkscode.wordpress.com/wp-content/uploads/2019/01/program-does-not-exist.png?w=300&amp;h=67 300w" sizes="(max-width: 558px) 100vw, 558px" /><figcaption id="caption-attachment-636" class="wp-caption-text">Attribute &#8216;program&#8217; does not exist</figcaption></figure></p>
<p>I feel this error could be more friendly i.e. indicating the file could not be found or something similar. So if you get this error, verify that you don&#8217;t have a typo in the file name.</li>
<li>if you use relative paths for the file location, the error you&#8217;ll receive contains a lot of guidance on how to rectify this!
<p><figure data-shortcode="caption" id="attachment_637" aria-describedby="caption-attachment-637" style="width: 552px" class="wp-caption alignnone"><img data-attachment-id="637" data-permalink="https://janetalkscode.wordpress.com/2019/01/01/debugging-a-basic-typescript-app-in-visual-studio-code/program-is-not-absolute/" data-orig-file="https://janetalkscode.wordpress.com/wp-content/uploads/2019/01/program-is-not-absolute.png" data-orig-size="552,126" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="program-is-not-absolute" data-image-description="" data-image-caption="" data-large-file="https://janetalkscode.wordpress.com/wp-content/uploads/2019/01/program-is-not-absolute.png?w=552" class="alignnone size-full wp-image-637" src="https://janetalkscode.wordpress.com/wp-content/uploads/2019/01/program-is-not-absolute.png" alt="program-is-not-absolute" width="552" height="126" srcset="https://janetalkscode.wordpress.com/wp-content/uploads/2019/01/program-is-not-absolute.png 552w, https://janetalkscode.wordpress.com/wp-content/uploads/2019/01/program-is-not-absolute.png?w=150&amp;h=34 150w, https://janetalkscode.wordpress.com/wp-content/uploads/2019/01/program-is-not-absolute.png?w=300&amp;h=68 300w" sizes="(max-width: 552px) 100vw, 552px" /><figcaption id="caption-attachment-637" class="wp-caption-text">Attribute &#8216;program&#8217; is not absolute</figcaption></figure></li>
</ol>
</li>
</ol>
<p>&nbsp;</p>
<p>And that&#8217;s about it! Here&#8217;s my <a href="https://github.com/janoulle/helloworld-typescript">barebones helloworld TypeScript app</a> in github and happy debugging!</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://janetalkscode.wordpress.com/2019/01/01/debugging-a-basic-typescript-app-in-visual-studio-code/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">635</post-id>
		<media:content url="https://1.gravatar.com/avatar/d93ed28fa877c723edf0ffb014bb988f205e9f4bd28276354c1f9f040534d4d3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janoulle</media:title>
		</media:content>

		<media:content url="https://janetalkscode.wordpress.com/wp-content/uploads/2019/01/program-does-not-exist.png" medium="image">
			<media:title type="html">program-does-not-exist</media:title>
		</media:content>

		<media:content url="https://janetalkscode.wordpress.com/wp-content/uploads/2019/01/program-is-not-absolute.png" medium="image">
			<media:title type="html">program-is-not-absolute</media:title>
		</media:content>
	</item>
		<item>
		<title>JetBrains promotion</title>
		<link>https://janetalkscode.wordpress.com/2018/07/31/jetbrains-promotion/</link>
					<comments>https://janetalkscode.wordpress.com/2018/07/31/jetbrains-promotion/#respond</comments>
		
		<dc:creator><![CDATA[Jane Ullah]]></dc:creator>
		<pubDate>Wed, 01 Aug 2018 02:41:05 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<guid isPermaLink="false">http://janetalkscode.wordpress.com/?p=629</guid>

					<description><![CDATA[If you&#8217;re a Java developer, odds are very high that you use IntelliJ IDE for development. Professionally &#38; personally, I use the IntelliJ but until today, I was reliant on the Community Edition for my personal needs. Today and for a very limited time, Jetbrains is offering 50% all plans! I pulled that trigger so &#8230; <a href="https://janetalkscode.wordpress.com/2018/07/31/jetbrains-promotion/" class="more-link">Continue reading <span class="screen-reader-text">JetBrains promotion</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>If you&#8217;re a Java developer, odds are very high that you use IntelliJ IDE for development. Professionally &amp; personally, I use the IntelliJ but until today, I was reliant on the Community Edition for my personal needs.</p>
<p>Today and for a very limited time, Jetbrains is offering 50% all plans! I pulled that trigger so fast that my mom would&#8217;ve been impressed. <img src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p><a href="https://blog.jetbrains.com/blog/2018/07/30/celebrate-this-friendship-day-with-jetbrains-and-unwrap-your-presents/" rel="nofollow">https://blog.jetbrains.com/blog/2018/07/30/celebrate-this-friendship-day-with-jetbrains-and-unwrap-your-presents/</a> (you&#8217;re welcome. :D)</p>
]]></content:encoded>
					
					<wfw:commentRss>https://janetalkscode.wordpress.com/2018/07/31/jetbrains-promotion/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">629</post-id>
		<media:content url="https://1.gravatar.com/avatar/d93ed28fa877c723edf0ffb014bb988f205e9f4bd28276354c1f9f040534d4d3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janoulle</media:title>
		</media:content>
	</item>
		<item>
		<title>Debugging tests via gradle</title>
		<link>https://janetalkscode.wordpress.com/2018/06/06/debugging-tests-via-gradle/</link>
					<comments>https://janetalkscode.wordpress.com/2018/06/06/debugging-tests-via-gradle/#respond</comments>
		
		<dc:creator><![CDATA[Jane Ullah]]></dc:creator>
		<pubDate>Thu, 07 Jun 2018 01:41:01 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<guid isPermaLink="false">http://janetalkscode.wordpress.com/?p=490</guid>

					<description><![CDATA[From searching online, I&#8217;ve found two ways to debug tests via gradle: Setting the debug property within the test task to true and executing your gradle command without any additional flags passing the --debug-jvm flag to gradle In both cases, make sure you create a debug run config (port 5005) and run said config after &#8230; <a href="https://janetalkscode.wordpress.com/2018/06/06/debugging-tests-via-gradle/" class="more-link">Continue reading <span class="screen-reader-text">Debugging tests via&#160;gradle</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>From searching online, <a href="https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.Test.html">I&#8217;ve found two ways </a>to debug tests via gradle:</p>
<ol>
<li>Setting the <code>debug</code> property within the <code>test</code> task to true and executing your gradle command without any additional flags</li>
<li>passing the <code>--debug-jvm</code> flag to gradle</li>
</ol>
<p>In both cases, make sure you create a debug run config (port 5005) and run said config after starting your tests.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://janetalkscode.wordpress.com/2018/06/06/debugging-tests-via-gradle/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">490</post-id>
		<media:content url="https://1.gravatar.com/avatar/d93ed28fa877c723edf0ffb014bb988f205e9f4bd28276354c1f9f040534d4d3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janoulle</media:title>
		</media:content>
	</item>
		<item>
		<title>Hibernate Query Language</title>
		<link>https://janetalkscode.wordpress.com/2018/05/10/hibernate-query-language/</link>
					<comments>https://janetalkscode.wordpress.com/2018/05/10/hibernate-query-language/#respond</comments>
		
		<dc:creator><![CDATA[Jane Ullah]]></dc:creator>
		<pubDate>Fri, 11 May 2018 02:08:14 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<guid isPermaLink="false">http://janetalkscode.wordpress.com/?p=619</guid>

					<description><![CDATA[One really cool thing about using the Spring Boot framework is how easy it is to setup entities for database operations. Hibernate is the &#8216;persistence layer&#8217; that Spring uses to achieve this and this framework comes with something called &#8216;HQL&#8216;. Hibernate uses a powerful query language (HQL) that is similar in appearance to SQL. Compared &#8230; <a href="https://janetalkscode.wordpress.com/2018/05/10/hibernate-query-language/" class="more-link">Continue reading <span class="screen-reader-text">Hibernate Query Language</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>One really cool thing about using the Spring Boot framework is how easy it is to setup entities for database operations. Hibernate is the &#8216;persistence layer&#8217; that Spring uses to achieve this and this framework comes with something called &#8216;<a href="https://docs.jboss.org/hibernate/orm/3.3/reference/en-US/html/queryhql.html">HQL</a>&#8216;.</p>
<blockquote><p>Hibernate uses a powerful query language (HQL) that is similar in appearance to SQL. Compared with SQL, however, HQL is fully object-oriented and understands notions like inheritance, polymorphism and association</p></blockquote>
<p>With <a href="https://www.journaldev.com/2954/hibernate-query-language-hql-example-tutorial">HQL</a>, you can construct queries using your database entities instead of SQL. It certainly feels more declarative than constructing SQL queries. For example, here&#8217;s an <a href="https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model">ER diagram</a> of a personal project (cleaning up some things before I make the repo public).</p>
<p><img loading="lazy" data-attachment-id="620" data-permalink="https://janetalkscode.wordpress.com/2018/05/10/hibernate-query-language/restaurantscores-erd/" data-orig-file="https://janetalkscode.wordpress.com/wp-content/uploads/2018/05/restaurantscores-erd.png" data-orig-size="799,479" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="restaurantscores-erd" data-image-description="" data-image-caption="" data-large-file="https://janetalkscode.wordpress.com/wp-content/uploads/2018/05/restaurantscores-erd.png?w=799" class="alignnone  wp-image-620" src="https://janetalkscode.wordpress.com/wp-content/uploads/2018/05/restaurantscores-erd.png" alt="restaurantscores-erd" width="449" height="269" srcset="https://janetalkscode.wordpress.com/wp-content/uploads/2018/05/restaurantscores-erd.png?w=449&amp;h=269 449w, https://janetalkscode.wordpress.com/wp-content/uploads/2018/05/restaurantscores-erd.png?w=150&amp;h=90 150w, https://janetalkscode.wordpress.com/wp-content/uploads/2018/05/restaurantscores-erd.png?w=300&amp;h=180 300w, https://janetalkscode.wordpress.com/wp-content/uploads/2018/05/restaurantscores-erd.png?w=768&amp;h=460 768w, https://janetalkscode.wordpress.com/wp-content/uploads/2018/05/restaurantscores-erd.png 799w" sizes="(max-width: 449px) 100vw, 449px" /></p>
<p>To fetch all Restaurant records which had critical violations (severity of 3), I constructed the following HQL query.</p>
<pre>@Query(
    "select r from Violation v inner join v.inspectionReport ir inner join ir.restaurant r where v.severity = 3")</pre>
<p>Of course, by doing this, you cede control to Hibernate on exactly how the query is constructed. For more, check this <a href="https://spring.io/guides/gs/accessing-data-jpa/">official Spring guide on using JPA</a> (<a href="https://stackoverflow.com/questions/9881611/whats-the-difference-between-jpa-and-hibernate">JPA is a spec</a> and Hibernate is a JPA implementation) or this Udemy course on <a href="https://www.udemy.com/spring-hibernate-tutorial/">Spring + Hibernate</a>.</p>
<p>Another cool thing you can do with Hibernate is <a href="http://docs.jboss.org/hibernate/stable/annotations/reference/en/html_single/#d0e2785">creating a virtual column.</a> This virtual column can then be used in any HQL queries you need. derived properties. Here&#8217;s an example of my use case (creating a derived property):</p>
<pre>@Formula(
    "(SELECT COUNT(ir_violations.id)\n"
        + "  FROM ir_restaurants INNER JOIN \n"
        + "  ir_inspectionreport ON ir_restaurants.id = ir_inspectionreport.restaurant_id  INNER JOIN\n"
        + "  ir_violations ON ir_inspectionreport.id = ir_violations.inspection_report_id \n"
        + "  WHERE ir_violations.severity = 2 and ir_inspectionreport.restaurant_id = id\n"
        + "  GROUP BY ir_violations.severity)")
private Integer <strong>nonCriticalCount</strong>;</pre>
<p>and using this derived property:</p>
<pre>@Query(
  value =
      "select new com.janeullah.healthinspectionrecords.domain.dtos.FlattenedRestaurant"
          + "(r.id,ir.score,r.criticalCount,<strong>r.nonCriticalCount</strong>,r.establishmentInfo.name,ir.dateReported,r.establishmentInfo.address,r.establishmentInfo.county) "
          + "from InspectionReport ir inner join ir.restaurant r ORDER BY r.establishmentInfo.name ASC"
)</pre>
<p>Pretty nifty stuff!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://janetalkscode.wordpress.com/2018/05/10/hibernate-query-language/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">619</post-id>
		<media:content url="https://1.gravatar.com/avatar/d93ed28fa877c723edf0ffb014bb988f205e9f4bd28276354c1f9f040534d4d3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janoulle</media:title>
		</media:content>

		<media:content url="https://janetalkscode.wordpress.com/wp-content/uploads/2018/05/restaurantscores-erd.png" medium="image">
			<media:title type="html">restaurantscores-erd</media:title>
		</media:content>
	</item>
		<item>
		<title>Upgrading to Spring 2.0.1 (my notes)</title>
		<link>https://janetalkscode.wordpress.com/2018/05/09/upgrading-to-spring-2-0-1-my-notes/</link>
					<comments>https://janetalkscode.wordpress.com/2018/05/09/upgrading-to-spring-2-0-1-my-notes/#respond</comments>
		
		<dc:creator><![CDATA[Jane Ullah]]></dc:creator>
		<pubDate>Wed, 09 May 2018 20:06:40 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<guid isPermaLink="false">http://janetalkscode.wordpress.com/?p=617</guid>

					<description><![CDATA[A personal project of mine using Spring 1.5.12-RELEASE and I figured I&#8217;d bite the bullet &#38; upgrade. Before you embark on this upgrade, review the release notes, the configuration change log, a migration guide, and other articles on the subject. These are changes that  affected my project: Context path updates: server.contextPath is now server.servlet.context-path Actuator &#8230; <a href="https://janetalkscode.wordpress.com/2018/05/09/upgrading-to-spring-2-0-1-my-notes/" class="more-link">Continue reading <span class="screen-reader-text">Upgrading to Spring 2.0.1 (my&#160;notes)</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>A personal project of mine using Spring 1.5.12-RELEASE and I figured I&#8217;d bite the bullet &amp; upgrade. Before you embark on this upgrade, review the <a href="https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Release-Notes">release notes</a>, the <a href="https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Configuration-Changelog">configuration change log</a>, a <a href="https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Migration-Guide">migration guide</a>, and <a href="https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-5.x#upgrading-to-version-50">other</a> articles on the subject.</p>
<p>These are changes that  affected <strong><em>my</em> </strong>project:</p>
<ol>
<li><span style="text-decoration:underline;">Context path updates</span>: server.contextPath is now server.servlet.context-path</li>
<li><span style="text-decoration:underline;">Actuator updates</span>: Previously it was /app-context/health, it&#8217;s now /app-context/<strong>actuator</strong>/health. Note: to restore previous behavior, set
<div>
<div>
<div class="highlight highlight-source-ini">
<pre><span class="pl-k">management.endpoints.web.base-path</span>=/</pre>
</div>
</div>
</div>
</li>
<li><span style="text-decoration:underline;">Server</span>: org.springframework.boot.web.support.SpringBootServletInitializer relocated to org.springframework.boot.web.servlet.support.SpringBootServletInitializer.</li>
<li><span style="text-decoration:underline;">Spring repositories:</span>
<ol>
<li><em>findOne</em> no longer takes the id (e.g. long) but the actual entity. I replaced this with with <em>findbyId</em> (a built-in convenience method to the repository)</li>
<li>I previously could pass a List&lt;T&gt; to the <em>save</em> method. You are now required to use <em>saveAll</em> which is more appropriate</li>
<li>My JpaRepository classes previously returned an Iterable for methods like <em>findAll</em>. This method now returns a Collection (e.g. List&lt;T&gt;) of entities (additional info <a href="https://spring.io/blog/2017/06/20/a-preview-on-spring-data-kay#improved-naming-for-crud-repository-methods">here</a>).</li>
</ol>
</li>
<li><span style="text-decoration:underline;">Database:</span>
<ol>
<li><span style="text-decoration:underline;">Connection pooling</span> &#8211; Hikari is now the default connection pooling mechanism. Avoid using DataSourceBuilder&#8217;s automatic configuration with 2.x (see <a href="https://github.com/spring-projects/spring-boot/issues/12758">issue</a> and additional documentation on <a href="https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-two-datasources">configuring your datasource</a>).</li>
<li><span style="text-decoration:underline;">Postgresql</span> &#8211; I was previously on version <span class="blob-code-inner"><span class="pl-s">9.0-801.jdbc4</span></span> and I switched to the latest to resolve  the following error &#8216; PSQLException: Method org.postgresql.jdbc4.Jdbc4Connection.isValid(int) is not yet implemented.&#8217;</li>
</ol>
</li>
<li><span style="text-decoration:underline;">Testing</span>:
<ol>
<li><span style="text-decoration:underline;">Mockito</span> &#8211; *.<span class="blob-code-inner"><span class="pl-smi"><span class="x x-first x-last">runners</span>.MockitoJUnitRunner</span></span> is now in *.<span class="blob-code-inner"><span class="pl-smi"><span class="x x-first x-last">junit</span>.MockitoJUnitRunner</span></span></li>
</ol>
</li>
</ol>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://janetalkscode.wordpress.com/2018/05/09/upgrading-to-spring-2-0-1-my-notes/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">617</post-id>
		<media:content url="https://1.gravatar.com/avatar/d93ed28fa877c723edf0ffb014bb988f205e9f4bd28276354c1f9f040534d4d3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janoulle</media:title>
		</media:content>
	</item>
		<item>
		<title>Docker Adventures &#8211; Palantir Docker plugin</title>
		<link>https://janetalkscode.wordpress.com/2018/05/06/docker-adventures-palantir-docker-plugin/</link>
					<comments>https://janetalkscode.wordpress.com/2018/05/06/docker-adventures-palantir-docker-plugin/#comments</comments>
		
		<dc:creator><![CDATA[Jane Ullah]]></dc:creator>
		<pubDate>Sun, 06 May 2018 20:58:36 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<guid isPermaLink="false">http://janetalkscode.wordpress.com/?p=612</guid>

					<description><![CDATA[After my first post, a lot happened. First, the moment I moved my Dockerfile from my $projectDir root into a folder (docker/myapp/Dockerfile to declutter things), &#8220;everything&#8221; stopped working. A lot of tutorials and even the Transmode gradle docker plugin assume that your Dockerfile is in a standard location ($projectDir/Dockerfile) and if you step outside that, &#8230; <a href="https://janetalkscode.wordpress.com/2018/05/06/docker-adventures-palantir-docker-plugin/" class="more-link">Continue reading <span class="screen-reader-text">Docker Adventures &#8211; Palantir Docker&#160;plugin</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>After <a href="https://janetalkscode.wordpress.com/2018/05/04/adventures-with-docker/">my first post</a>, a lot happened. First, the moment I moved my Dockerfile from my <a href="https://docs.gradle.org/current/userguide/writing_build_scripts.html">$projectDir</a> root into a folder (docker/myapp/Dockerfile to declutter things), &#8220;everything&#8221; stopped working. A lot of tutorials and even the Transmode gradle docker plugin assume that your Dockerfile is in a standard location ($projectDir/Dockerfile) and if you step outside that, you&#8217;ll learn an awful lot about Docker build contexts and working directories.</p>
<p>To set some context, my application is a Spring Boot Java application (version 1.5.12-RELEASE). This became pertinent for me as a lot of the official Spring guides have defaulted to 2.x.x versions which have significant differences (notably the use of bootRepackage going away in favor of <a href="https://docs.spring.io/spring-boot/docs/2.0.1.RELEASE/gradle-plugin/reference/html/#packaging-executable-jars">bootJar </a>or bootWar).</p>
<p>So. I took a step back and yanked out the Transmode gradle plugin from my repository &amp; embarked on learning how to do it all manually. A lot of the tasks listed below are very nicely handled by docker-compose but I figured that I needed to know the essentials first in order to troubleshoot when things go sideways. Here are the manual tasks:</p>
<ol>
<li>manually building my Docker images (the spring application + postgres).
<ol>
<li>For the postgres image, I did not need to build one from scratch since there is an official image published on <a href="https://store.docker.com/images/postgres">Dockerhub</a>). You can read more about <a href="https://docs.docker.com/samples/library/postgres/#postgresalpine">configuring the official image</a> according to your needs.</li>
</ol>
</li>
<li>manually tagging and pushing both images to a remote registry (I practiced with both Dockerhub and the Heroku registry),</li>
<li>manually setting up the network (this is a nice-to-have since apps in the same network are implicitly able to communicate with each other. Of course, the server needs to talk to the database so this was the first step)</li>
<li>manually running the postgres application (since the database needs to be up before the server)</li>
<li>manually running the server application</li>
</ol>
<p>Once I verified that I could repeatedly perform steps 1 &#8211; 5, I decided to investigate the <a href="https://github.com/palantir/gradle-docker">Palantir Gradle Docker plugin</a> since I&#8217;d like to eventually get away from the lengthy Docker commands and move to gradle tasks for the entire process. The Palantir plugin is more robust than the Transmode plugin and in my opinion, it&#8217;s a little clearer to understand what is happening.</p>
<p>For the rest of this post, my focus will be on the image generation step and I&#8217;ll share my commands from the perspective of one whose Dockerfile is not in the typical location i.e. $projectDir/Dockerfile. Instead, my Dockerfile is located at $projectDir/docker/myapp/Dockerfile. I&#8217;ll outline the manual steps and the corresponding gradle task configuration (using the Palantir Gradle Docker plugin).</p>
<h3>Building your Docker image for a 1.5.x Spring boot app</h3>
<p>The basics of the <a href="https://docs.docker.com/get-started/part2/">Dockerfile </a>(what is it, etc) are on the Docker docs. The biggest issue I ran into was getting the COPY task to work the same whether the step was manual or via the gradle task. The recommendation I can share is to use a placeholder argument for the location of the jar file to be copied. When manually generating your image, you will then pass in the value of the ARG. <a href="https://gist.github.com/janoulle/83fab4722c3a7e3bca3e092acb2cf415">Here&#8217;s the full command</a> which was run at the root of my project.     Compare with the Spring guide configuration: </p>
<pre id="code-block-9" class="prettyprint highlight"><code class="language-groovy"><span class="pun">docker build --build-arg JAR_FILE=build/libs/AppServer-0.0.1-SNAPSHOT.jar -t myapp-server:beta -f docker\myapp-server\Dockerfile .</span></code></pre>
<p></p>
<p>The -t flag sets the friendly name of the image you intend to build. -f sets the location of the Dockerfile and the last argument <a href="https://docs.docker.com/get-started/part2/#build-the-app">is a dot</a> (this is important to set the working directory for Docker. Update this accordingly). Here's what <a href="https://gist.github.com/janoulle/f849ab85091b936f4674b92b35fe26ce">my Dockerfile</a> looks like.</p>
<p>In the <a href="https://spring.io/guides/gs/spring-boot-docker/">official Spring guide to dockerizing your Spring app</a>, you can also see how the ARG is declared and referenced in the COPY task later. Note: the official Spring guide is written with the Palantir Gradle Docker plugin and Spring 2.x.x in mind. So, I had to do things a little differently mainly:</p>
<ol>
<li>When <a href="https://plugins.gradle.org/plugin/com.palantir.docker">setting up the Palantir Gradle Docker plugin</a>, you need to specify the maven url (it's not in mavenCentral) so that bit me. I also opted to use the 'traditional' way of applying the plugin since the newer and more expressive way seems to have <a href="https://docs.gradle.org/current/userguide/plugins.html">some kinks</a>. As an aside, I've <a href="https://github.com/spring-guides/gs-spring-boot-docker/pull/50">created a PR</a> to include this bit of information to the guide.</li>
<li>The gradle configuration in the guide could do with a bit more explanation i.e. the why. Nevertheless, with a lot of trial/error and reading various docs (Spring, Docker, Stackoverflow, etc), I was able to come up with a configuration that works for my Spring Boot application. Here are my settings 
<pre>docker {
    dependsOn bootRepackage
    name "$dockerImageName:$dockerImageVersion"
    tags "$dockerImageVersion"

    //located in the build context which is a folder in build/docker
    dockerfile file("docker/Dockerfile")

    //directly reference the Jar file in the Dockerfile
    def artifact = "$projectName-${projectVersion}.jar"
   // copies artifact + Dockerfile to the build context
   files "$libsDir/$artifact", "$projectDir/docker/$dockerImageName/Dockerfile"

    //passing in the jar file location via --build-arg key=value
    buildArgs(['JAR_FILE'     : artifact])
    pull false
    noCache true
}</pre>
<p> Compare with the Spring guide configuration: </p>
<pre id="code-block-9" class="prettyprint highlight"><code class="language-groovy"><span class="pln">docker </span><span class="pun">{</span><span class="pln">
    dependsOn build
    name </span><span class="str">"${project.group}/${bootJar.baseName}"</span><span class="pln">
    files bootJar</span><span class="pun">.</span><span class="pln">archivePath
    buildArgs</span><span class="pun">([</span><span class="str">'JAR_FILE'</span><span class="pun">:</span> <span class="str">"${bootJar.archiveName}"</span><span class="pun">])</span>
<span class="pun">}</span></code></pre>
<p></li>
<li>The main diferences are:
<ol>
<li>What the docker task depends on. In my case, I depend on the bootRepackage task since within my file config setting, I'm fetching the generated jar file from my <a href="https://docs.gradle.org/current/dsl/org.gradle.api.plugins.BasePluginConvention.html">$libsDir</a> to be copied into the Docker build context along with the Dockerfile from its original location.</li>
<li>Another difference is the use of bootJar task which, for those of us still on 1.5.x, is absent.</li>
<li>In the Palantir readme, you'll observe how the output of a task is fetched like so 
<pre>files tasks<span class="pl-k">.</span>distTar<span class="pl-k">.</span>outputs, <span class="pl-s"><span class="pl-pds">'</span>file1.txt<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>file2.txt<span class="pl-pds">'</span></span></pre>
<p>. You may be tempted to do something like <em>tasks.jar.outputs</em> but your  Spring application <a href="https://docs.spring.io/spring-boot/docs/1.5.2.RELEASE/reference/html/build-tool-plugins-gradle-plugin.html#build-tool-plugins-gradle-packaging">won't be packaged correctly</a> although image generation will succeed (running a jar generated this way will result in an error message about the missing main class). My solution was to depend on the bootRepackage task in order to retrieve the full jar file from the expected location.</li>
</ol>
</li>
<li>I've attempted to comment the code in my docker task configuration but I welcome improvements for clarity/correction. A lot of the information I've gleaned is largely from trial/error. Finally, to run the gradle tasks, here's a verbose command I use which comes in handy when troubleshooting gradle tasks failures.  gradlew clean docker --console=plain --stacktrace </li>
</ol>
<h3>Running your Docker app</h3>
<p>Okay, we've got the image generation out of the way. It is important to validate that you can run the application before calling it a day.  For my purposes, I need to validate that my image was generated correctly and that I could run it with all the needed environment variables (which includes api keys, secrets, and the like). To avoid leaking my secrets, I created a .env file in a location outside of my repository. I was able to run &amp; validate my app two ways: manually and via docker-compose. Note: the Palantir plugin also has a way to programmatically setup your docker-compose file but that's a work in progress.</p>
<ol>
<li>Running my image manually with multiple arguments.
<ol>
<li>TL;DR - <a href="http://docker run -p 8080:8080 -p 8000:8000 --env-file ../Docker/myapp/environmentvariables-server.env --name myapp-server --link myapp-db --network myapp-network -v C:/Users/jane/Repositories/Docker/myapp/downloads/webpages:/usr/local/tomcat/downloads/webpages -v C:/Users/jane/Repositories/Docker/myapp/logs:/usr/local/tomcat/logs myapp-server:beta">docker run command</a></li>
<li>Within my docker run command, I'm setting the container name ( --name myapp-server), linking it to my postgres container ( --link myapp-db unnecessary since they both belong to the same network but eh) , mapping volumes ( v C:/Users/jane/Repositories/Docker/myapp/logs:/usr/local/tomcat/logs), associating the container to a network ( --network myapp-network), setting up my ports, and passing my .env file ( --env-file ../Docker/myapp/environmentvariables-server.env ). Compare with the Spring guide configuration: 
<pre id="code-block-9" class="prettyprint highlight"><code class="language-groovy"><span class="pun">docker run -p 8080:8080 -p 8000:8000 --env-file ../Docker/myapp/environmentvariables-server.env --name myapp-server --link myapp-db --network myapp-network -v C:/Users/jane/Repositories/Docker/myapp/downloads/webpages:/usr/local/tomcat/downloads/webpages -v C:/Users/jane/Repositories/Docker/myapp/logs:/usr/local/tomcat/logs myapp-server:beta</span></code></pre>
<p></li>
<li>If all is right with your image, you should see the normal Spring startup messages. If you run into issues like the missing main class, verify you didn't fat-finger the commands like someone I know (mainly when using CMD in the Dockerfile, each argument has to be its own entry to the array) and verify your jar is a valid jar. You should be able to run your jar like any normal java app e.g. java -jar -Dfoo=bar myapp.jar.</li>
</ol>
</li>
<li>Running my image with docker-compose is super simple! Here's the latest incarnation of <a href="https://gist.github.com/janoulle/d6694b5e55aeffcb37875f936f5f7911">my docker-compose file</a>.</li>
</ol>
<p>In summary, it was fun learning how to generate and run my images the 'hard' way but I'll be sticking to docker-compose from now on. <img src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://janetalkscode.wordpress.com/2018/05/06/docker-adventures-palantir-docker-plugin/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">612</post-id>
		<media:content url="https://1.gravatar.com/avatar/d93ed28fa877c723edf0ffb014bb988f205e9f4bd28276354c1f9f040534d4d3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janoulle</media:title>
		</media:content>
	</item>
		<item>
		<title>Adventures with Docker</title>
		<link>https://janetalkscode.wordpress.com/2018/05/04/adventures-with-docker/</link>
					<comments>https://janetalkscode.wordpress.com/2018/05/04/adventures-with-docker/#comments</comments>
		
		<dc:creator><![CDATA[Jane Ullah]]></dc:creator>
		<pubDate>Fri, 04 May 2018 13:28:06 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<guid isPermaLink="false">http://janetalkscode.wordpress.com/?p=607</guid>

					<description><![CDATA[At work, we make heavy use of Docker containers for local development and I figured I should apply those learnings into my personal projects. I will say that this would be slightly harder if I didn&#8217;t have a reference project (i.e. work project setup) to reference. My project is a Spring Boot Java application and &#8230; <a href="https://janetalkscode.wordpress.com/2018/05/04/adventures-with-docker/" class="more-link">Continue reading <span class="screen-reader-text">Adventures with Docker</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>At work, we make heavy use of Docker containers for local development and I figured I should apply those learnings into my personal projects. I will say that this would be slightly harder if I didn&#8217;t have a reference project (i.e. work project setup) to reference.</p>
<p>My project is a Spring Boot Java  application and requires a Postgresql database. Here&#8217;s how I built it up piece by piece:</p>
<ol>
<li>I started out learning to &#8216;dockerize&#8217; the Java web service which is pretty straightforward (my <a href="https://gist.github.com/janoulle/f849ab85091b936f4674b92b35fe26ce">sample Dockerfile</a> which has links to sites that I referenced). With your Dockerfile, you can generate the image using the standard docker commands (docker build -t org/yourapp:latest .). However, I wanted to get more comfortable with gradle so I used the Transmode gradle plugin. This allows me to generate my image using a simple gradle task (my sample <a href="https://gist.github.com/janoulle/00e085d7eef6a73f3e22c8cf9049b4ac">gradlew $dockerImageBuildTaskName</a>).</li>
<li>Then, I learned to configure the postgresql container (<a href="https://hub.docker.com/_/postgres/">already present on the DockerHub registry</a>) i.e. changing the port, setting my user/password, etc.</li>
<li>Once I was able to individually build each image, I saw the need for &#8216;orchestrating&#8217; the setup of the server + db which led me to <a href="https://docs.docker.com/compose/">docker-compose</a> (my <a href="https://gist.github.com/janoulle/d6694b5e55aeffcb37875f936f5f7911">sample docker-compose file</a>). Using this configuration-based approach takes the headache out of I&#8217;m also making use of <a href="https://docs.docker.com/compose/env-file/">env files</a> since my application takes in api secrets and the like (aside, do NOT commit items like these to git. I have these env files located outside of my application folder and I use relative paths to access them)</li>
<li><a href="https://hub.docker.com/billing-plans/">Dockerhub </a>allows you to create a free repository to hold images and pushing your image is a straightforward two-step process: docker tag local-image:tagname reponame:tagname and docker push reponame:tagname. You can create your docker-compose file in a way that your image gets built every time you do &#8216;docker-compose up&#8217; but I opted to separate out the build process from the startup.</li>
</ol>
<p>Overall, I&#8217;m pretty pleased with my progress so far. I&#8217;m certain I haven&#8217;t followed all the best practices regarding Docker container configurations but that&#8217;s on my Trello to-do list!</p>
<p>Useful links:</p>
<ol>
<li><a href="https://github.com/docker/labs/tree/master/developer-tools" rel="nofollow">https://github.com/docker/labs/tree/master/developer-tools</a></li>
<li><a href="https://spring.io/guides/gs/spring-boot-docker/" rel="nofollow">https://spring.io/guides/gs/spring-boot-docker/</a></li>
<li><a href="https://thepracticaldeveloper.com/2017/12/11/dockerize-spring-boot/#Dockerizing_Spring_Boot_or_any_executable_jar_file" rel="nofollow">https://thepracticaldeveloper.com/2017/12/11/dockerize-spring-boot/#Dockerizing_Spring_Boot_or_any_executable_jar_file</a></li>
<li><a href="https://github.com/Transmode/gradle-docker" rel="nofollow">https://github.com/Transmode/gradle-docker</a></li>
<li><a href="https://docs.docker.com/get-started/" rel="nofollow">https://docs.docker.com/get-started/</a></li>
</ol>
]]></content:encoded>
					
					<wfw:commentRss>https://janetalkscode.wordpress.com/2018/05/04/adventures-with-docker/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">607</post-id>
		<media:content url="https://1.gravatar.com/avatar/d93ed28fa877c723edf0ffb014bb988f205e9f4bd28276354c1f9f040534d4d3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janoulle</media:title>
		</media:content>
	</item>
		<item>
		<title>Signature calculation for AWS</title>
		<link>https://janetalkscode.wordpress.com/2017/10/01/signature-calculation-for-aws/</link>
					<comments>https://janetalkscode.wordpress.com/2017/10/01/signature-calculation-for-aws/#respond</comments>
		
		<dc:creator><![CDATA[Jane Ullah]]></dc:creator>
		<pubDate>Sun, 01 Oct 2017 00:14:42 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<guid isPermaLink="false">http://janetalkscode.wordpress.com/?p=590</guid>

					<description><![CDATA[I recently learned about ElasticSearch as a means of adding search to my android app which uses Firebase. From the android app, I am issuing a HTTP request (super easy thanks to Retrofit) to AWS ElasticSearch but this request has to be authenticated. Amazon has some detailed documents on how to do this yourself but &#8230; <a href="https://janetalkscode.wordpress.com/2017/10/01/signature-calculation-for-aws/" class="more-link">Continue reading <span class="screen-reader-text">Signature calculation for&#160;AWS</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>I recently learned about <a href="http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/what-is-amazon-elasticsearch-service.html">ElasticSearch</a> as a means of adding search to my android app which uses <a href="https://firebase.google.com/">Firebase</a>. From the android app, I am issuing a HTTP request (super easy thanks to <a href="http://square.github.io/retrofit/">Retrofit</a>) to AWS ElasticSearch but this <a href="http://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html">request has to be authenticated</a>.</p>
<p>Amazon has some detailed documents on how to do this yourself but I&#8217;m waving the white flag after spending 3+ hrs debugging a mismatch between the signature I generated and what Amazon generated.</p>
<p>So, I&#8217;ll save you the trouble and share actual source code from Amazon that worked for me.</p>
<ol>
<li><a href="http://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-examples-using-sdks.html" rel="nofollow">http://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-examples-using-sdks.html</a></li>
<li>Source code showing a signed POST request: https://s3.amazonaws.com/aws-java-sdk/samples/AWSS3SigV4JavaSamples.jar. &#8216;Unzip&#8217; this jar file if you have 7-zip. Otherwise, use the &#8220;jar xvf $file.jar&#8221; command</li>
<li>The classes in the &#8216;auth&#8217; &amp; &#8216;util&#8217; folders contain the classes of interest so copy them over to your project.</li>
<li>A &#8216;runnable&#8217; class you can inspect is PutS3ObjectSample.java which shows how it&#8217;s all put together.</li>
</ol>
]]></content:encoded>
					
					<wfw:commentRss>https://janetalkscode.wordpress.com/2017/10/01/signature-calculation-for-aws/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">590</post-id>
		<media:content url="https://1.gravatar.com/avatar/d93ed28fa877c723edf0ffb014bb988f205e9f4bd28276354c1f9f040534d4d3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janoulle</media:title>
		</media:content>
	</item>
	</channel>
</rss>
