<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mdayanc on Medium]]></title>
        <description><![CDATA[Stories by Mdayanc on Medium]]></description>
        <link>https://medium.com/@mdayanc?source=rss-c78c54235079------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*akOBvdZVhGzAQOJj</url>
            <title>Stories by Mdayanc on Medium</title>
            <link>https://medium.com/@mdayanc?source=rss-c78c54235079------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 08:43:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mdayanc/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Quitting Coffee x Awakening]]></title>
            <link>https://medium.com/@mdayanc/quitting-coffee-x-awakening-26f945383dfe?source=rss-c78c54235079------2</link>
            <guid isPermaLink="false">https://medium.com/p/26f945383dfe</guid>
            <category><![CDATA[caffeine]]></category>
            <category><![CDATA[withdrawal]]></category>
            <category><![CDATA[coffee-culture]]></category>
            <category><![CDATA[quitting-coffee]]></category>
            <category><![CDATA[cofffee]]></category>
            <dc:creator><![CDATA[Mdayanc]]></dc:creator>
            <pubDate>Sun, 10 Jul 2022 02:49:16 GMT</pubDate>
            <atom:updated>2022-07-10T23:21:21.477Z</atom:updated>
            <content:encoded><![CDATA[<p>I actually love everything about coffee aside from how it makes me feel. The culture of brewing, trying different beans all over the world, visiting local coffee shops and even just the smell of it.</p><p>I wasn’t really planning on actually quitting coffee, but I had a life changing experience that made me question my everyday habits. So, I decided, fuck it I am not drinking coffee no more. Thats how it started.</p><p>Also I am switching jobs right now so it is a great time to see the limits of my body and experiment different things. As when you are caught up in a work routine its hard to step back and analyze yourself.</p><h3><strong>The Journey</strong></h3><h4>06.29.22 x Wednesday</h4><p>So couple of days before this I actually was just chugging Starbucks Dark Roast Cold Brew that they sell on the counter. I wasn’t looking for pleasure in drinking the coffee I was just loaded with work and was trying to get a lot done. Mid way to the bottle I realized I actually was feeling terrible and my mind was rushing between thoughts and I wasn’t able to concentrate on anything. So, I decided I might as well just quit coffee and see what happens.</p><h4>06.30.22 x Thursday</h4><p>I had listened a lot of podcast and read articles in this matter and almost all of them was saying you need to have a wake up routine. Which I had before but I was just missing the essentials. GOING OUTSIDE. I work from home so there are some days that I don’t even step out of the house. So I created a morning routine.</p><blockquote>The Routine</blockquote><ul><li>Brush my teeth</li><li>Wash my face &amp; skincare</li><li>Drink protein shake w/ isolate protein, banana, peanut butter, oat meal</li><li>Go outside and bike for 15–30 minutes depending how I feel that morning and call my family to check-in how they are doing</li><li>After that I have a stretch routine that my roommate put me on that takes 10 minutes top and play lo-fi beats on the background</li><li>Shower up</li><li>Cook breakfast</li><li>Start the day</li></ul><p>This takes about an hour usually.</p><p>Before I had this routine I was traveling a lot for the past 2–3 months and didn’t really applied my earlier routine which was just going to gym on empty stomach, shower up , make my hair and put on nice clothes even though I work from home. I used to just put on whatever but I realized even though you are by yourself looking nice just feels good.</p><p>Anyways so we are still on <strong>07.1.22 x Thursday </strong>and I didn’t really felt like I needed caffeine. I also had the best night sleep in a while I was able to just fall asleep in 10–15 minutes. Couldn’t even watch an episode of South Park.</p><h4><strong>07.01.22 x Friday</strong></h4><p>I woke up did my routine and after that I was just feeling tired but just tried to keep working. However I wasn’t able to concentrate not just work but also looking at my phone or anything. I was just not in the moment and kind of phased out. The worst part was after having my lunch. I just wanted to lay down in the couch and move nothing but my fingers and thats only if I have to. I was feeling the withdrawal effects mainly Headache. So, I just kept drinking lots of water.</p><p>After work I went to gym around 5.30 and decided to hit hardcore legs. Just to earn the weekend. Oh man that was rough to get through the workout because I used to drink coffee around 3–4 and that was also helping me get through my workout. And I had a steam room session after my stretch for 10–15 minutes that just felt amazing.</p><p>Again I had a great night sleep. Also started reading book for 45 minutes before bed. Also the lights in my room is set to dim gradually every night at 11pm until 11.45 so I started using that time to read and wind-down. Then put some white noise to fall asleep.</p><h4>07.02.22 x Saturday</h4><p>I slept like 10 hours and my legs were barely functioning. Had a relaxing day worked on my side project and watched the Adesanya fight . Since I had a goodnight sleep I didn’t even wanted to drink coffee. Again did my wind-down routine and fell asleep easily.</p><h4>07.03.22 x Sunday</h4><p>I hit the gym early in the morning and stretched there and grilled at night. Since I didn’t really needed to use my brain I din’t think of coffee either.</p><h4>07.04.22 x Monday</h4><p>It was 4th of July so I went out got good breakfast with a friend after my morning routine of course. Next to the breakfast spot there was Starbucks so I really craved Iced Latte because it was 110 degrees in Phoenix. So I went in there and got me a decaf Iced Latte. That just reminded me how horrible decaf coffee tastes. So, I was completely disappointed.</p><p>Came back shoot the shit with Larson by the pool. Then relaxed during the rest of the day.</p><h4>07.05.22 x Tuesday</h4><p>Long weekend definitely made me forgot I was working. But I had bunch of meetings and bunch of small things that I needed to get out of the way. So it was a busy day din’t crave Caffeine much. But I kept eating a lot of almonds and drinking bunch of water to just to keep my desk busy. But I was just distracted through the day with one thing or another. I wasn’t able to focus much but I didn’t had to do heavy programming so that was fine.</p><p>Had a great sleep. Was able to sleep very shortly after I got in.</p><h4>07.06.22 x Wednesday</h4><p>This was for some reason the toughest day for quitting coffee. I had a big programming task to work on and I just needed to be wired in for 3–4 hours long block to make decent progress. I wasn’t anywhere near that. So it got me frustrated because I usually am pretty good with telling my mind what to do. But this was just rough. Whenever I felt tired I went outside get some Sun and vitamin D in and washed my face. Try to keep working.</p><p>I did longer bike session in the morning that might partially be it. Not sure also protein shake was too sweet for some reason that might have spiked my blood sugar level.</p><p>Anyways I also worked out later in the day and at night I didn’t want to read at all but forced myself to read and I am glad I did.</p><h3>Wrap up of the First Week</h3><p>Overall I think it was a great decision to take a break from coffee. It made me realize how important it is to just go outside and get a piece of nature before you start staring at you computer screen for the next 14 hours.</p><p>It made more connected to my body and also nature. I felt the importance of just taking care of yourself in a deeper level.</p><ul><li>I had headaches which I usually never have.</li><li>I wasn’t able to focus at all for the first couple days but I was lucky that I had the long weekend.</li><li>Now that a week passed I am feeling a lot more accustomed to it.</li><li>Almonds and drinking a lot of water helped a lot.</li></ul><p>I will write more but probably it will be a weekly report of my observing.</p><p>I don’t know how long I will keep doing this. But I was listening to this podcast with Michael Pollan x Joe Rogan and Pollan mentioned Coffe is actually a psychedelic drug and I think I want to quit it long enough that I can actually observe the effects of it.</p><p>ps. I also stopped drinking which I think helped a lot to make it easier to quit caffeine.</p><p>Cheers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26f945383dfe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CNN News Scraping using Selenium]]></title>
            <link>https://medium.com/@mdayanc/cnn-news-scraping-using-selenium-39ac7ff8ad71?source=rss-c78c54235079------2</link>
            <guid isPermaLink="false">https://medium.com/p/39ac7ff8ad71</guid>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[article-scraping]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Mdayanc]]></dc:creator>
            <pubDate>Mon, 14 Sep 2020 03:39:56 GMT</pubDate>
            <atom:updated>2020-09-14T03:41:26.101Z</atom:updated>
            <content:encoded><![CDATA[<p>This is article will help you to successfully set up Selenium to your Mac and scrape data from any web source. For this example I will be using <a href="https://www.cnn.com/">https://www.cnn.com/</a>.</p><p><strong>First:</strong> Download Selenium</p><pre>pip install selenium</pre><p><strong>Secondly:</strong> Set Up Chromedriver</p><p>You can download the chrome driver from this link -&gt; <a href="https://selenium-python.readthedocs.io/installation.html">https://selenium-python.readthedocs.io/installation.html</a></p><p>Before you download first check the version of your Google Chrome by clicking <strong>Google Chrome-&gt;About Google</strong> Chrome on the top left corner. After that download the compatible chromedriver.</p><ul><li>Unzip the file</li><li>Open up terminal</li><li>cp ~/Downloads/chromedriver /usr/local/bin</li><li>Right click on the chromedriver and press open</li></ul><p>This will add the chromedriver executable to your $PATH.</p><p><strong>Third: </strong>Start Scraping Data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PwqdzVQEIAKW7rZ0cwM54Q.png" /><figcaption>URL -&gt; <a href="https://www.cnn.com/search?q=politics&amp;size=100">https://www.cnn.com/search?q=politics&amp;size=100</a></figcaption></figure><p>By right clicking and then clicking inspect on any of the headlines you will see this HTML elements.</p><ul><li>Main container that contains all news articles is named -&gt; class= “cnn-search__result cnn-search__result — article”</li><li>Headline Container -&gt;class= “ cnn-search__result-headline”</li><li>Text Body (Article) class=“cnn-search__result-body”</li></ul><p><strong>Finally: </strong>Source Code</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d7b9763fbd7d411d856d6c7e1c275cd7/href">https://medium.com/media/d7b9763fbd7d411d856d6c7e1c275cd7/href</a></iframe><p>To run the code simply type,</p><p>python3 cnn_scrapper.py</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39ac7ff8ad71" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[File Upload Application Using Pure Javascript Client and Spring-Boot Server]]></title>
            <link>https://medium.com/@mdayanc/file-upload-application-using-pure-javascript-client-and-spring-boot-server-697206a9c208?source=rss-c78c54235079------2</link>
            <guid isPermaLink="false">https://medium.com/p/697206a9c208</guid>
            <category><![CDATA[clients]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[upload]]></category>
            <category><![CDATA[servers]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Mdayanc]]></dc:creator>
            <pubDate>Tue, 23 Jun 2020 19:02:33 GMT</pubDate>
            <atom:updated>2020-06-23T19:02:33.377Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sEttkDRitTe17fjbw6QD7A.png" /></figure><p>In this tutorial I will be explaining how to write basic file uploading application using pure Javascript on the client side and Spring-Boot on the server side. I will be using IntelliJ IDEA as my IDE however you can go whatever you are comfortable with. So, let’s begin.</p><p><strong>Step 0: Project Structure</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/1*pGmMbS0VlM0K7TbS68PdWg.png" /><figcaption>Project Structure</figcaption></figure><p><strong>Step 1: Creating Spring-Boot Server</strong></p><p>In order to create the server side up and ready for Multipart File HTTP request I highly encourage to follow the <a href="https://spring.io/guides/gs/uploading-files/#:~:text=To%20start%20a%20Spring%20Boot,xml)."><strong>tutorial</strong></a><strong> </strong>published on Spring-Boot’s official web page. However, I will briefly go over what those classes are doing.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a0f8d92527907399fb4b4056c23fd8c4/href">https://medium.com/media/a0f8d92527907399fb4b4056c23fd8c4/href</a></iframe><p>This class is the Service Class that does the business logic that you want to implement. In order to @Autowire this into the Controller class properly you should use @Service annotation to let Spring know and then handle the rest for you.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d47f0c3938e29a870a0a5da7fc99b005/href">https://medium.com/media/d47f0c3938e29a870a0a5da7fc99b005/href</a></iframe><p>This is the Storage Service Interface that is implemented in FileSystemStorageClass. You want to have a separate Interface rather than implementing all in one class because in large applications you might want to have 2 different implementations of the same service. Also, this helps you to switch between different implementations by just changing one line of code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f7a0ea79793c418544e9cb224cee5fab/href">https://medium.com/media/f7a0ea79793c418544e9cb224cee5fab/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5050d98e1d18d938390376df1d86dc6e/href">https://medium.com/media/5050d98e1d18d938390376df1d86dc6e/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f0a2362bf761d1c6a8b209f3a0efaa88/href">https://medium.com/media/f0a2362bf761d1c6a8b209f3a0efaa88/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/01b884a4cb0e589bee7a78dec26ba274/href">https://medium.com/media/01b884a4cb0e589bee7a78dec26ba274/href</a></iframe><p>This is the Controller class that handles the communication between javascript client and Spring-Boot server. You could have also annotated with @RestController however I annotated with @Controller because I wanted to return static html HTML files as a response.</p><p>In this part we have only 3 endpoints.</p><p>First one defines @GetMapping(“/”) in order to see the uploadForm.html file in your browser.</p><p>Second one defines @GetMapping(“/files/{filename:.+}”) to get the url to the file stored in the server.</p><p>Last one is the @PostMapping(“/”) in order to get Post requests from your javascript client. You could have endpoint like “/upload” but I decided to go with “/” for simplicity.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c95c92520c41b9c08740fb9ddb69ef55/href">https://medium.com/media/c95c92520c41b9c08740fb9ddb69ef55/href</a></iframe><p><strong>Step 2: Javascript Client</strong></p><p>First we need to have HTML file called uploadForm.html. Then we will write javascript script to make HTML file functional.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aac7481a3581d956f3490fa50664e334/href">https://medium.com/media/aac7481a3581d956f3490fa50664e334/href</a></iframe><p>This page doesn’t look nice at all but I leave it to you to make it look pretty.</p><p>Finally this is the javascript file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/63c64f286a52f0dcca25e7b98b7bc9bb/href">https://medium.com/media/63c64f286a52f0dcca25e7b98b7bc9bb/href</a></iframe><p>I hope you enjoyed this article and it helped you to solve a problem!</p><p>Thank you for reading! Let me know if you have any questions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=697206a9c208" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to run Spring Boot on your Virtual Box]]></title>
            <link>https://medium.com/@mdayanc/how-to-run-spring-boot-on-your-virtual-box-7fc23c723870?source=rss-c78c54235079------2</link>
            <guid isPermaLink="false">https://medium.com/p/7fc23c723870</guid>
            <category><![CDATA[virtual-environment]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[virtualbox]]></category>
            <category><![CDATA[e]]></category>
            <dc:creator><![CDATA[Mdayanc]]></dc:creator>
            <pubDate>Thu, 28 May 2020 17:31:54 GMT</pubDate>
            <atom:updated>2020-05-28T17:31:54.637Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>After reading this article you will be able to</strong></p><ul><li><strong>set up shared folders on your Virtual Box so that you can edit remotely</strong></li><li><strong>build and run your spring boot application on the server</strong></li></ul><p><strong>So, Let’s get started!</strong></p><h4>What you need to have?</h4><ul><li>Virtual Box set up on your local Machine with Linux OS and ssh establishment. ( Go to <a href="https://medium.com/@mdayanc/how-to-ssh-to-your-ubuntu-machine-on-virtual-box-3b7f74f2fd4">here</a> to learn how)</li><li>Spring Boot application, you can download one from <a href="https://spring.io/guides/gs/spring-boot/#scratch">here</a>.</li></ul><h4>How to File Share with your Virtual Machine</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*20XkYwmf9Cya-A6q-n1vwQ.png" /><figcaption>Figure 1. Shared Folders</figcaption></figure><p>Click on add icon on the top right corner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*73BgRD6WrjGuqvLZP28Qhw.png" /></figure><p>Folder Path is the path to the folder on your physical computer. Folder name is whatever the end point of the address provided on Folder Path. Shared folder will appear as the name you give here.</p><ul><li><strong>Check Auto-mount</strong></li><li><strong>Check Make Permanent ( If this doesn’t show up, don’t worry about it)</strong></li></ul><p>Go ahead and turn on your virtual machine,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*7eHz2VA2rrwmAuvyY_-B2A.png" /><figcaption>Figure 2. Desktop</figcaption></figure><p>Click on Insert Guest Addition CD Image…</p><pre>sudo mkdir -p /media/cdrom<br>sudo apt-get install -y gcc make</pre><p>You need to find where VBox_GAs_6.0.4 file is located then you need to run this command</p><pre>sudo &lt;Adress to VBox_GAs_6.0.4&gt;/VBoxLinuxAdditions.run<br>sudo usermod -aG vboxsf &lt;your_ubuntu_username&gt;</pre><p>Restart your virtual machine.</p><h3>Set up Java and Maven for Dev Environment</h3><pre>sudo apt-get install -y default-jdk<br>sudo apt-get install -y maven</pre><p>This will take approximately 5 minutes.</p><p>After this step you will have all the required environment setup. And you are all set to build and run your spring application. In order to so, you need to go to the directory where your spring application is located i.e. where your pom.xml is located. From there, you need to run the following command to build and run;</p><pre>mvn spring-boot:run</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*etvgmgoS6sj97Cj9v9ZTiQ.png" /><figcaption>Figure 3. How your terminal should look like</figcaption></figure><p>From here you can go to your browser and type,</p><pre>127.0.0.1:8080/</pre><p>You should see this following screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jub79lM0PpDKOUkHq-yhkw.png" /><figcaption>Figure 4. Local host page.</figcaption></figure><p>You are all set!! Now you can run your spring boot application on this virtual ubuntu server!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7fc23c723870" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to ssh to your Ubuntu Machine on Virtual Box]]></title>
            <link>https://medium.com/@mdayanc/how-to-ssh-to-your-ubuntu-machine-on-virtual-box-3b7f74f2fd4?source=rss-c78c54235079------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b7f74f2fd4</guid>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[virtualbox]]></category>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[ip]]></category>
            <category><![CDATA[network]]></category>
            <dc:creator><![CDATA[Mdayanc]]></dc:creator>
            <pubDate>Thu, 28 May 2020 14:03:10 GMT</pubDate>
            <atom:updated>2020-05-28T16:54:52.836Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article I will help you configure your ubuntu machine to enable ssh connection from other devices.</p><h4><strong>Step 1</strong></h4><p>Before we do anything else, open up your terminal. Then type</p><p>ip addr show</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*he9-h9lK32UT7HmGvj6LCA.png" /><figcaption>Figure 1. Entire ip show addr output</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*z7Njko-L8bXZVj68mzbNbg.png" /><figcaption>Figure 2. Your ip address</figcaption></figure><p>Your ip address is shown at the line starting with inet,</p><p>My ip address is 10.0.2.15</p><p>Note your ip address down.</p><h4>Step 2</h4><p>After you get this information power off your Virtual Machine and go to VirtualBox Manager -&gt; Settings -&gt; Network. After that click on advanced then go to Port Forwarding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ShOIIdkBlzuLS9FBWNGkw.png" /><figcaption>Figure 3. Network page</figcaption></figure><p>You probably will have a blank page here, then click on + icon on the upper right side. Then fill in the spaces accordingly. You will run it on your localhost (127.0.0.1) of your virtual Ubuntu machine. We will be using port 2222. Your Guest IP should be whatever the value that you already have from the previous step. Guest Port value should be 22. Hit OK and then go back to your terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LcxdAHIWfF0MTf3QrDMHsQ.png" /><figcaption>Figure 4. System Configurations</figcaption></figure><p>After this go to System and enable Network under Boot Order, also Enable I/O APIC under Extended Futures.</p><h4>Step 3</h4><p>Turn on your Virtual Machine and open your Terminal.</p><p>In order to download ssh, you should type;</p><p>sudo apt-get install ssh</p><p>sudo apt-get install openssh-server</p><h4><strong>Step 4</strong></h4><p>Once you downloaded the ssh, you should start the ssh connection by typing;</p><p>sudo service ssh start</p><h4>Step 5</h4><p>Go to your Computer’s terminal and then type</p><p>ssh &lt;username&gt;127.0.0.1 -p 2222</p><p>&lt;username&gt; should be replaced with your ubuntu username on your virtual box. Mine is mertay as you can see from Figure 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*JvdiHh-8_k5HzsgI29Sapw.png" /><figcaption>Figure 5. Establish connection.</figcaption></figure><p>You are all set! Hope you enjoyed reading this and helped you on whatever crazy thing you are trying to achieve.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b7f74f2fd4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Use On Focus Change to Format Edit Text on Android Studio]]></title>
            <link>https://medium.com/@mdayanc/how-to-use-on-focus-change-to-format-edit-text-on-android-studio-bf59edf66161?source=rss-c78c54235079------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf59edf66161</guid>
            <category><![CDATA[edittext]]></category>
            <category><![CDATA[onfocuschange]]></category>
            <category><![CDATA[android-studio]]></category>
            <category><![CDATA[focus]]></category>
            <category><![CDATA[how-to]]></category>
            <dc:creator><![CDATA[Mdayanc]]></dc:creator>
            <pubDate>Mon, 04 May 2020 09:14:30 GMT</pubDate>
            <atom:updated>2020-05-04T09:14:30.208Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello everyone, this post I will be talking about how to use Android Studio View.OnFocusChangeListener() to make sure users are interacting with your software in a controlled manner. Let’s think of this example; you are working on a subscription control app where you want to make sure users stick to your format while interacting with EditText.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*kTWBZkXPtknQxsHYPS5XKQ.png" /><figcaption>Figure 1. Price EditText with no Focus</figcaption></figure><p>In order to create more user friendly application, I wanted to make sure price EditText;</p><ol><li>Has gray color when the focus is somewhere else. (Figure 1)</li><li>Has white color when user clicks on it. (Focus is on this View).</li><li>If user interacted with it and left it empty, by default EditText will be set to “$0.00”.</li><li>If EditText has value “$0.00” and user clicks, it deletes the default text and waits for user input</li><li>If EditText doesn’t have decimal point after losing its focus, by default “.00” will be appended to the string. For example, “$50” will be “$50.00” after loosing its focus.</li></ol><h4><strong>Using View.OnFocusChangeListener()</strong></h4><p>In order to implement this functionality we will be using View.OnFocusChangeListener(). This interface has 1 abstract method called OnFocusChange which is evoked when the focus state of a view has changed. Details of this function are;</p><blockquote>public abstract void onFocusChange (<a href="https://developer.android.com/reference/android/view/View"><strong>View</strong></a> v, boolean hasFocus)</blockquote><blockquote>v -&gt; View: The view whose state has changed.</blockquote><blockquote>hasFocus -&gt; boolean: The new focus state of v.</blockquote><p>I prefer implementing Interfaces as anonymous classes when I won’t be using the same Interface for different Views. That is why I won’t be using a separate class to implement this interface and rather Override onFocusChange inside anonymous class.</p><h4><strong>Implementation</strong></h4><p>Here is the code that I have used to implement these functionalities that I mentioned above.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f0c2621357ebe6e023e7fbb2c3331cd5/href">https://medium.com/media/f0c2621357ebe6e023e7fbb2c3331cd5/href</a></iframe><p>If you are only interested in generic version of using OnFocusChangeListener I have code for that as well!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/332a24f7691068a20aeff8b305a4afd6/href">https://medium.com/media/332a24f7691068a20aeff8b305a4afd6/href</a></iframe><p>Now, you know how to use OnFocusChangeListener(), enjoy using it!!</p><p>I really hope this article helped you to solve something that you were looking for. If so, don’t forget to leave a clap and don’t hesitate to ask me if you have any other questions.</p><p>Happy Coding ✌🏽</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf59edf66161" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Brute Forcing Bad Horse Problem Google Kick Start]]></title>
            <link>https://medium.com/@mdayanc/brute-forcing-bad-horse-problem-google-kick-start-637f9acf4c50?source=rss-c78c54235079------2</link>
            <guid isPermaLink="false">https://medium.com/p/637f9acf4c50</guid>
            <category><![CDATA[bad-horse-problem]]></category>
            <category><![CDATA[google-kickstart]]></category>
            <category><![CDATA[competetive-programming]]></category>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[solutions]]></category>
            <dc:creator><![CDATA[Mdayanc]]></dc:creator>
            <pubDate>Mon, 13 Apr 2020 02:01:47 GMT</pubDate>
            <atom:updated>2020-04-13T02:01:47.541Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*35S5k9-v43KEZoWbt1BXDg.png" /><figcaption>Bad Horse</figcaption></figure><p>Before we approach the problem we need to understand what is it that question asking. The ultimate goal of this problem is to divide each pair of bad horses to two different sets such that there is no troublesome pair in neither of the sets. More information can be found under this link; <a href="https://code.google.com/codejam/contest/2933486/dashboard">https://code.google.com/codejam/contest/2933486/dashboard</a></p><h4><strong>Input Format</strong></h4><blockquote>The first line of the input gives the number of test cases, <strong>T</strong>. <strong>T</strong> test cases follow. Each test case starts with a positive integer <strong>M</strong> on a line by itself which represents the of troublesome pairs of League members. The next <strong>M</strong> lines each contain names of troublesome pairs, separated by a single space.</blockquote><h4><strong>Output Format</strong></h4><blockquote>For each test case, output one line containing “Case #x: y”, where x is the case number (starting from 1) and y is either “Yes” or “No”, depending on whether the League members mentioned in the input can be split into two groups with neither of the groups containing a troublesome pair.</blockquote><p>Example that yields <strong>“No”,</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*e5reAEa2svppbaa-soycvA.png" /><figcaption>Given Input</figcaption></figure><p>Given that each line represents troublesome pair. Which means Spider_Girl and Blue_Snowman cannot to be in the same set. As well as, Blue_Snowman and Roulette, Roulette and Spider_Girl. We fail to do divide each pair into 2 sets and the reason is that all of the combinations have troublesome pair.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*l3gKbZm7dN7R-84Q12rE1w.png" /><figcaption>Explanation why it won’t work</figcaption></figure><p>Example that yields<strong> “Yes”,</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RFN1HQR3wGslHtchl3BRFg.png" /><figcaption>Explanation of a case that yields Yes output.</figcaption></figure><h4><strong>How to approach?</strong></h4><p>The ideal solution to this problem would be using graphs, where edges are troublesome pairs and goal is to see if the graph can be divided into 2 (Same as checking if the graph is bipartite). However, I will be talking in detail about that solution in a different post.</p><p>I will be talking how to brute force this problem. In order to do so, I came up with this solution by getting inspired by Insertion Sort. The idea behind this solution is, you can only add new names to 2 distinct sets if and only if there adding this new element doesn’t have any trouble with the one that are already in the list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l5xuAr6QvdwYUShRE-wMmg.jpeg" /></figure><p>T is # of Tests</p><p>test_size is # of names in the current test</p><p>There are three for loops, the outermost loop iterates between different tests (Iterator t = 1 to T). Middle for loop (Iterator i = 0 to test_size) will be traversing the list from the beginning and in every iteration pairs in the current index will be compared with the ones that are already in the list (Elements with index less than i). So innermost loop (Iterator j = i-1 to 0)will be checking if list1[i] is not causing trouble with list1[j] where j is from i-1 to 0. This will be done for list2 as well. And if either list1[i] or list2[i] is causing problem, then we swap them and start checking starting from index j = i-1 to 0. If Swapping fixes the problem then we are good and keep checking until i equals test_size, if swapping doesn’t fixes the we output “NO”. If every check passes we toggle passed variable and return “YES”</p><p><strong>Solution</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b561678fcb3452dac51d68ed1764f5d6/href">https://medium.com/media/b561678fcb3452dac51d68ed1764f5d6/href</a></iframe><p>I really enjoyed while writing this article, I hope it helps and let me know in comments if you encounter any problems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=637f9acf4c50" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Prevent User to Delete the First Character of EditText]]></title>
            <link>https://medium.com/@mdayanc/how-to-prevent-user-to-delete-the-first-character-of-edittext-d7cb6689c44?source=rss-c78c54235079------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7cb6689c44</guid>
            <category><![CDATA[android-studio]]></category>
            <category><![CDATA[interfaces]]></category>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Mdayanc]]></dc:creator>
            <pubDate>Sat, 11 Apr 2020 08:38:03 GMT</pubDate>
            <atom:updated>2020-04-13T05:16:24.460Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello everyone in this post I will be talking about how to create prevent user to change the format of you edit text. So, let’s think of this example you are working on a subscription control app where you need to prompt user to input the subscription amount.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*bzBnW1-rk7865BVUWDqWiQ.png" /></figure><p>As it can be seen above you might want to prevent user to delete ‘$’ from the input because it helps your UI to stay simple and easy to understand.</p><p><strong>How to Implement</strong></p><p>I will share the whole application details later in this article but right now to make it simple I will work on a project that only has edit text.</p><h4><strong>Layout &amp; Main Activity</strong></h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5647f2f4d4e8acff682262ad41341611/href">https://medium.com/media/5647f2f4d4e8acff682262ad41341611/href</a></iframe><p><strong>Display</strong></p><figure><img alt="E.g., This how this basic code will look when launched. It takes only NUMERIC input instead of regular keyboard input." src="https://cdn-images-1.medium.com/max/1024/1*BAvlMpUaFvkCDam6JrQw9w.png" /><figcaption>Main Activity</figcaption></figure><p>Instead of regular input this will only take numeric input which will simplify the interface.</p><p>I hope this helps and enjoy your coding!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7cb6689c44" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>