<?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/"
	>

<channel>
	<title>curl &#8211; CodePills.com</title>
	<atom:link href="https://codepills.com/tag/curl/feed/" rel="self" type="application/rss+xml" />
	<link>https://codepills.com</link>
	<description>Helping you make a better code</description>
	<lastBuildDate>Thu, 19 May 2022 13:41:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>Developer Notes 001</title>
		<link>https://codepills.com/developer-notes-001/</link>
					<comments>https://codepills.com/developer-notes-001/#respond</comments>
		
		<dc:creator><![CDATA[Andrej Buday]]></dc:creator>
		<pubDate>Sun, 01 May 2022 13:34:28 +0000</pubDate>
				<category><![CDATA[Tips & tricks]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[Enum]]></category>
		<category><![CDATA[interpunct]]></category>
		<category><![CDATA[Jackson]]></category>
		<category><![CDATA[Java 8]]></category>
		<category><![CDATA[Lombok]]></category>
		<category><![CDATA[NUMBER]]></category>
		<category><![CDATA[Oracle DB]]></category>
		<category><![CDATA[Postman]]></category>
		<category><![CDATA[serialization]]></category>
		<category><![CDATA[String]]></category>
		<category><![CDATA[Switch]]></category>
		<guid isPermaLink="false">https://codepills.com/?p=1298</guid>

					<description><![CDATA[The list of a few developer notes collected during the software development which were not enough for a self-standing article. <a href="https://codepills.com/developer-notes-001/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>This article selects a few developer notes collected during the software development, which were unfortunately not enough for a self-standing article.</p>
<p><span id="more-1298"></span></p>
<p>Developer notes will be an irregular series of articles where I will briefly go through some of my notes to make notes for posterity. The notes themself can be pretty long, yet their length is not enough for writing a meaningful article.</p>
<p>Let&#8217;s take a look at a list of content:</p>
<ul>
<li><a href="#oracle_error" title="Oracle Error: Value Larger Than Specified Precision Allowed For This Column">Oracle Error: Value Larger Than Specified Precision Allowed For This Column</a></li>
<li><a href="#switch_on_string_with_enum_name_in_java_8" title="Switch on String in Java">Switch on String with Enum Name in Java 8</a></li>
<li><a href="#lomboks_serialization_error_for_jackson" title="Lombok's serialization error for Jackson">Lombok&#8217;s serialization error for Jackson</a></li>
<li><a href="#interpunct" title="Interpunct">Interpunct</a></li>
<li><a href="#how_to_do_curl_in_postman" title="How To Do CURL in Postman">How To Do <em>curl</em> in Postman</a></li>
</ul>
<h2 id="oracle_error">Oracle Error: Value Larger Than Specified Precision Allowed For This Column</h2>
<p>I was getting errors on inserting data into the Oracle database &#8220;ORA-01438: value larger than specified precision allowed for this column.&#8221;</p>
<p>The reason why I was getting an error was a too big number. When I looked over UI to database column definition, I saw something like this NUMBER(15,2).</p>
<p>Official Oracle documentation, as for <a href="https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/Data-Types.html#GUID-75209AF6-476D-4C44-A5DC-5FA70D701B78" title="Number datatype" target="_blank" rel="nofollow noopener">Oracle database v21</a>, depicts <code>NUMBER</code> datatype defined as <code>NUMBER (precision,scale)</code>.</p>
<p><code>NUMBER</code> datatype notation can be rather rewritten to <i>NUMBER (size,precision)</i>) where the first number depicts the total size of the digits in a number, and the second means the decimal point scale.</p>
<p>In other words, for example, for <code>NUMBER(2,2)</code>, we can place the column number consisting of 2 digits, both of which will be decimals. i.e. 0.15, 0.45 etc. But if we would like to have a bigger number in the column, we need to upgrade the size of the column reserved for the whole number &#8211; <code>NUMBER(5,2)</code> will get us five digits, of which 2 are decimals. i.e 125.40, 18.00.</p>
<h2 id="switch_on_string_with_enum_name_in_java_8">Switch on String with Enum Name in Java 8</h2>
<p>Here is an example of how to use <em>Enum</em> values as strings in a <code>switch</code> case. You can only use the strings which are known at compile time. The compiler cannot determine the result of expression. However, in Java <em>Enum</em> case <code>VALUE1, VALUE2</code> are static.</p>
<pre><code class="language-java">String name = ...
switch(CustomEnum.valueOf(name)) {
   case VALUE1:
        ...
        break;
   case VALUE2:
        ...
        break;
    ...
}</code></pre>
<h2 id="lomboks_serialization_error_for_jackson">Lombok&#8217;s serialization error for Jackson</h2>
<p>When I created a new aggregated DTO class on my REST output, I got the following error:</p>
<pre><code class="language-bash">Type definition error: [simple type, class CUSTOM_DTO_CLASS_NAME]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class CUSTOM_DTO_CLASS_NAME and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: CUSTOM_DTO_CLASS_NAME[\"aggregation-class-property\"]->java.util.ArrayList[0])</code></pre>
<p>I am sure this error will be thrown quiet often as the solution on it is very simple. All I was missing on my <i>Custom DTO</i> class was <strong>Lombok&#8217;s</strong> <code>@Getters</code> annotation for serialization. So fix consisted on adding missing <code>@Getters</code> annotation on the top of my custom class for Lombok generating getter methods at compile time.</p>
<h2 id="interpunct">Interpunct</h2>
<p>I was editing my resume this month and wanted to create a nice date range in positions I held in the past. I got this from my LinkedIn profile, where LinkedIn use dates in the form as <em>Jan 2020 – Feb 2020 · 2 mos</em>. But I could not figure out where to take the dot sign as it was an image. However, the character for such sign as little black dot <strong>·</strong> really exists and its name is <strong>Interpunct</strong>,  or <strong>middle dot</strong>. So every time you would like to create a nice division of text with the help of <strong>·</strong>, think about the <strong>Interpunct</strong>.</p>
<h2 id="how_to_do_curl_in_postman">How To Do <em>curl</em> in Postman</h2>
<p>Is there a way hot to make a <em>curl</em> command in Postman? What if we would like to import the <em>curl</em> command easily into Postman and make a Postman GUI request from it.<br />
Is it even possible to easily translate all the <em>curl</em> command parameters into the Postman request?</p>
<p>Surely it is. Postman request are eventually nothing else than more fancy <em>curl</em> requests and Postman supports the <em>curl</em> import feature. Importing <em>curl</em> is very simple. Here is simple list of steps which will lead you to success:</p>
<ol>
<li>Open Postman.</li>
<li>Go to navigation menu, click File and Import option</li>
<li>In <i>Import</i> window select the raw text tab.</li>
<li>Paste the raw text e.g. <code>curl --location --request GET "https://www.google.com/"</code>, then click continue.</li>
<li>Check the name, format and import as.</li>
<li>If everything is correct, click <i>Import</i> button.</li>
</ol>
<p>Following the steps will automatically import the <em>curl</em> command into the Postman on the new tab.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codepills.com/developer-notes-001/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
