<?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: Adam Sung Min Park</title>
    <description>The latest articles on DEV Community by Adam Sung Min Park (@adamsteradam).</description>
    <link>https://dev.to/adamsteradam</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%2F919521%2F46233a03-2f9d-44c2-bcb1-c69dd6ed180a.png</url>
      <title>DEV Community: Adam Sung Min Park</title>
      <link>https://dev.to/adamsteradam</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adamsteradam"/>
    <language>en</language>
    <item>
      <title>TIL : Java Data Type</title>
      <dc:creator>Adam Sung Min Park</dc:creator>
      <pubDate>Fri, 23 Sep 2022 14:34:51 +0000</pubDate>
      <link>https://dev.to/adamsteradam/til-java-data-type-5dai</link>
      <guid>https://dev.to/adamsteradam/til-java-data-type-5dai</guid>
      <description>&lt;p&gt;As a Java beginner, data type threw me off the window. &lt;br&gt;
Now I realize how JavaScript was generous (or didn't really care what I was doing) when it comes to my "loose" programming skills.&lt;/p&gt;

&lt;p&gt;Java has 7 primitive data types: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;Byte , Short, Int, Long, Float, Double&lt;/code&gt;&lt;br&gt;
(from most narrow to most wide)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Converting one primitive datatype into another is known as type casting (type conversion) in Java. You can cast the primitive datatypes in two ways namely, Widening and Narrowing.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Widening is when converting a lower datatype to a higher datatype. &lt;br&gt;
Casting/conversion is done automatically, AKA "implicit type casting".&lt;br&gt;
Datatypes have to be compatible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When does the automatic type conversion happens?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;either:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the data types are compatible&lt;/li&gt;
&lt;li&gt;destination type is bigger than the source type&lt;/li&gt;
&lt;/ul&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kr"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;WideningExample&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="kr"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;String&lt;/span&gt; &lt;span class="nx"&gt;args&lt;/span&gt;&lt;span class="p"&gt;[]){&lt;/span&gt;
      &lt;span class="nx"&gt;char&lt;/span&gt; &lt;span class="nx"&gt;ch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;C&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nx"&gt;int&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nx"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;out&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&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;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Integer value of the given character: 67&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Narrowing is the opposite of widening and in this case, type casting and conversion is not done automatically. It needs to  be done by using cast operator "(datatype)". AKA "explicit type casting"&lt;br&gt;
Datatypes can be incompatible.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;java&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;util&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Scanner&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kr"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;NarrowingExample&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="kr"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;String&lt;/span&gt; &lt;span class="nx"&gt;args&lt;/span&gt;&lt;span class="p"&gt;[]){&lt;/span&gt;
      &lt;span class="nx"&gt;Scanner&lt;/span&gt; &lt;span class="nx"&gt;sc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Scanner&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="nx"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;out&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Enter an integer value: &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="nx"&gt;int&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;sc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;nextInt&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="nx"&gt;char&lt;/span&gt; &lt;span class="nx"&gt;ch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;char&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nx"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;out&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Character value of the given integer: &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;ch&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;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Enter an integer value:&lt;br&gt;
67&lt;br&gt;
Character value of the given integer: C&lt;/p&gt;

&lt;p&gt;As you can see, in the case of narrowing, &lt;code&gt;int i&lt;/code&gt; got casted into &lt;code&gt;(char)&lt;/code&gt;. &lt;/p&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%2Frq7xyve2i0k3yb3clgan.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%2Frq7xyve2i0k3yb3clgan.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rules&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;If byte, short, int are used in math =&amp;gt; result comes out in int.&lt;/li&gt;
&lt;li&gt;Single Long will turn the expression in Long.&lt;/li&gt;
&lt;li&gt;Float operand in expression will convert the whole expression in float.&lt;/li&gt;
&lt;li&gt;any operand is double, the result is double.&lt;/li&gt;
&lt;li&gt;Boolean cannot be converted to another type.&lt;/li&gt;
&lt;li&gt;Java does not allow conversion from double to int.&lt;/li&gt;
&lt;li&gt;conversion from long to int is also not possible.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Still really confused about the data casting, but now I am more sure about what I can do with my data and what I can't do.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>JWT(JSON web token)</title>
      <dc:creator>Adam Sung Min Park</dc:creator>
      <pubDate>Sat, 17 Sep 2022 14:36:37 +0000</pubDate>
      <link>https://dev.to/adamsteradam/jwtjson-web-token-2id5</link>
      <guid>https://dev.to/adamsteradam/jwtjson-web-token-2id5</guid>
      <description>&lt;p&gt;Been awhile. &lt;/p&gt;

&lt;p&gt;currently trying to learn how to implement login function to my python project. the project itself doesnt really require user authentication/authorization but I thought it would be a good place to learn how to do so.&lt;/p&gt;

&lt;p&gt;My first approach was to look in to &lt;code&gt;JWT&lt;/code&gt;.&lt;br&gt;
JWT is consisted of three parts, header, payload and signature.&lt;/p&gt;

&lt;p&gt;I liked how they made this to secure the user information, by not storing the user info into the db.&lt;br&gt;
I learned how to generate the token but utilizing this token to access designated user info is going to be a different challenge to me. &lt;/p&gt;

&lt;p&gt;Hopefully soon, I'll learn how to actually "authorize/authenticate" so that i can make my projects more realistic. &lt;/p&gt;

&lt;p&gt;TL;DR : learning how to play with JWT.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>sEcuRitY BreAch (git-crypt)</title>
      <dc:creator>Adam Sung Min Park</dc:creator>
      <pubDate>Mon, 12 Sep 2022 10:48:26 +0000</pubDate>
      <link>https://dev.to/adamsteradam/security-breach-7df</link>
      <guid>https://dev.to/adamsteradam/security-breach-7df</guid>
      <description>&lt;p&gt;Tell me you are new to coding without telling me you are new to coding:&lt;/p&gt;

&lt;p&gt;Naive enough to put my DB credentials into my github PLAINTEXT.&lt;/p&gt;

&lt;p&gt;I thought what could go wrong with my credentials when committing to the github without encrypting it, and today i learned how.&lt;br&gt;
I was working on my project as always and suddenly my data seemed weird. When i checked my DB there were bunch of random data inserted into the column. It basically ruined all my data since i used the same database for all my other projects as well. &lt;br&gt;
At first I thought it would be ok to expose my credentials online since i thought it would do me no harm and give them no gain. &lt;br&gt;
Anyways, I just finished implementing &lt;code&gt;git-crypt&lt;/code&gt; to hide all my credentials across my repos. &lt;br&gt;
glad to learn something so important with such a little price. &lt;br&gt;
Security is always going to be on top of my list now &lt;/p&gt;

&lt;p&gt;TL;DR : "save" what you worked for &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Today's struggle (Selenium)</title>
      <dc:creator>Adam Sung Min Park</dc:creator>
      <pubDate>Thu, 08 Sep 2022 12:05:52 +0000</pubDate>
      <link>https://dev.to/adamsteradam/todays-struggle-selenium-2105</link>
      <guid>https://dev.to/adamsteradam/todays-struggle-selenium-2105</guid>
      <description>&lt;p&gt;Currently working(more like practicing) on data crawling using Python + BeautifulSoup4 to imitate web pages. &lt;br&gt;
It was all fun and games until I figured it is quite challenging to scrape off the web page that uses JavaScript to manipulate the DOM. &lt;/p&gt;

&lt;p&gt;Obviously my first approach was to go to google and ask for help and came across this awesome (but with so much confusion) library called Selenium.&lt;/p&gt;

&lt;p&gt;I liked the idea of how you can actually ask the code to wait for the browser to load first, and then look for the html elements.&lt;/p&gt;

&lt;p&gt;I was able to get some data back but not all the time. Probably needs more studying and playing time with it. &lt;br&gt;
But I feel like this library can be really helpful in the future, mixing it with BS4 could really save my life :)&lt;/p&gt;

&lt;p&gt;TL;DR : &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;study Selenium&lt;/li&gt;
&lt;li&gt;mix with BS4&lt;/li&gt;
&lt;li&gt;ignore all the copyrights :D&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;fun fact: I actually researched about Nanoparticle using Selenium lmao &lt;/p&gt;

</description>
    </item>
    <item>
      <title>UUID</title>
      <dc:creator>Adam Sung Min Park</dc:creator>
      <pubDate>Tue, 06 Sep 2022 05:20:01 +0000</pubDate>
      <link>https://dev.to/adamsteradam/uuid-im2</link>
      <guid>https://dev.to/adamsteradam/uuid-im2</guid>
      <description>&lt;p&gt;Soo i was still kinda messing with my CRUD function i have made, and came up with this issue where my ID# for each entry could be the same if i were to delete the post in between the collection. &lt;br&gt;
Since my way of generating not so unique ID was to get all the entries from the DB and count them up, and just add 1 to the total number. &lt;/p&gt;

&lt;p&gt;with this approach, if i were to erase post #2, out of 5 entries, my 6th post which should have an id of 6 would have 5 instead. &lt;/p&gt;

&lt;p&gt;In order to fix this issue, I decided to take a look at UUID. &lt;br&gt;
At first I wasnt so sure how to use it since it was giving my error when i simply set &lt;code&gt;{'id' : uuid.uuid4()}&lt;/code&gt;. &lt;br&gt;
The thing is that I had to generate the ID first and give it to the key value pair. &lt;/p&gt;

&lt;p&gt;and there goes my other problem of integer length being too long, and so on but I was able to make it work with what I think "cheap shots" but hey, as long as it works, i am happy. &lt;/p&gt;

&lt;p&gt;Probably going to fix it once I get more use to using UUID.&lt;/p&gt;

&lt;p&gt;TL;DR UUID works and i am happy nonetheless.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Python CRUD function</title>
      <dc:creator>Adam Sung Min Park</dc:creator>
      <pubDate>Sun, 04 Sep 2022 12:56:03 +0000</pubDate>
      <link>https://dev.to/adamsteradam/python-crud-function-afc</link>
      <guid>https://dev.to/adamsteradam/python-crud-function-afc</guid>
      <description>&lt;p&gt;So I am currently learning how to use Python with MongoDB + Flask. &lt;/p&gt;

&lt;p&gt;Been playing with the DB bunch of GET request, POST etc. &lt;br&gt;
Thanks to my previous exposure to CRUD with Node.js, I was able to get the grasp of the concept rather quickly, and noticed that Python is really more straightforward in a sense. &lt;/p&gt;

&lt;p&gt;Anyways, still need to learn more about linking the AJAX call with front and back. &lt;/p&gt;

&lt;p&gt;Beside from CRUD function, I am also trying to learn some Java, and today I learned about 8 primitive data types and String data type of Java. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Integer, Double, Float, Boolean, Long, Byte, Char and Short.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Feels like I am only going to use some of them, but still it was quite interesting to see the data types I was not familiar with.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>09/03/22 Python GET request</title>
      <dc:creator>Adam Sung Min Park</dc:creator>
      <pubDate>Sat, 03 Sep 2022 08:41:20 +0000</pubDate>
      <link>https://dev.to/adamsteradam/090322-python-get-request-47ag</link>
      <guid>https://dev.to/adamsteradam/090322-python-get-request-47ag</guid>
      <description>&lt;p&gt;Python, pymongo, Flask, mongoDB&lt;br&gt;
So today i was trying to make a function which allows users to upload the pic and saving it. &lt;br&gt;
Seemed quite simple since I already have done saving the post before. &lt;br&gt;
However, when I tried to make a new  &lt;code&gt;@app.route(/)&lt;/code&gt; for the get request, for some reason the response was giving me back the HTML file I have filled in the argument field.&lt;/p&gt;

&lt;p&gt;Still I am not sure how to solve this problem correctly, or efficiently but hey I have done it somehow. &lt;/p&gt;

&lt;p&gt;I am thinking that this problem is caused since I already have one 'GET' request for the previous data load, so why not bring all the data at once and just pick and choose the data accordingly to the page? &lt;/p&gt;

&lt;p&gt;Therefore I was able to solve the problem, not feeling great but still happy that it works. &lt;/p&gt;

&lt;p&gt;TL;DR : 1. calling two 'GET' methods didnt seem to work &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;My solution : load all the data at once under different keys and use them accordingly. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Cheers.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>First Post!</title>
      <dc:creator>Adam Sung Min Park</dc:creator>
      <pubDate>Fri, 02 Sep 2022 05:30:10 +0000</pubDate>
      <link>https://dev.to/adamsteradam/first-post-4km3</link>
      <guid>https://dev.to/adamsteradam/first-post-4km3</guid>
      <description>&lt;p&gt;So I have decided to keep on track of my developer journal.&lt;br&gt;
I am going to try to post here daily with what I have been doing, and what I have learned etc.&lt;/p&gt;

&lt;p&gt;cheers.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
