{"@attributes":{"version":"2.0"},"channel":{"title":"DEV Community: Kalaiarasan Pushpanathan","description":"The latest articles on DEV Community by Kalaiarasan Pushpanathan (@iamkalai).","link":"https:\/\/dev.to\/iamkalai","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%2F91402%2F217f50be-b24a-4479-af74-c7e161b1cb52.jpg","title":"DEV Community: Kalaiarasan Pushpanathan","link":"https:\/\/dev.to\/iamkalai"},"language":"en","item":[{"title":"Quarantine Counter From A Python Noob","pubDate":"Sat, 11 Apr 2020 18:20:51 +0000","link":"https:\/\/dev.to\/iamkalai\/quarantine-counter-from-a-python-noob-c18","guid":"https:\/\/dev.to\/iamkalai\/quarantine-counter-from-a-python-noob-c18","description":"<p>I decided to make use of the self quarantine, work from home time to start learning some skills on the side. I started looking at Python (again) and did a tutorial to relearn the basics of the Python. I am one of those people who is always in <strong>tutorial purgatory<\/strong>, who often sees tutorials on various things and end up forgetting about it completely due to not doing any hands on practice. Half way through the tutorial, I realized that I am manually posting a tweet thread to Twitter, which could be automated easily.<\/p>\n\n<p>The tweet thread is simple, a <a href=\"https:\/\/twitter.com\/iamkalai2\/status\/1244667264734904328\">daily reminder<\/a> of the number of days <strong>since I wore pants<\/strong>. Here is <a href=\"https:\/\/github.com\/iamkalai\/PythonSnippets\/blob\/master\/LockDownCounter.py\">draft version<\/a> of the code if someone wants to skip reading this blog.<\/p>\n\n<p>What I love most about Python ecosystem is that there is always some library written by someone for most of my common needs. I found that <a href=\"https:\/\/www.tweepy.org\/\">tweepy<\/a> was the easiest way to tweet using Python.<\/p>\n\n<p>I registered a <a href=\"https:\/\/developer.twitter.com\/en\/apply-for-access\">twitter developer account<\/a> and found <a href=\"https:\/\/docs.wpwebelite.com\/social-network-integration\/twitter\/\">this site<\/a> to guide me in creating the app for interacting with Twitter. This site also lists out steps to create similar apps for other sites such as Facebook, LinkedIn.<\/p>\n\n<p>Now coming back to the Python script, it uses 2 text files for now (remember that I am still half way doing the tutorial :))<\/p>\n\n<ul>\n<li>First for storing the counter of number of days since I wore my pants.<\/li>\n<li>Second for storing the tweet id that is being posted. You will need to have the id of the tweet if you want to reply to it. I wanted to maintain the tweet chain that I already had and post the new tweets as a reply to last tweet. I decided to store id of the tweet instead of doing a get request every time to Twitter to find my last tweet. This made sense to me as the design decision.<\/li>\n<\/ul>\n\n<p>All of the logic is split into individual functions so that I can rewrite those as I learn more about Python. Most of the code is self explanatory. There are functions for reading from file, writing string to file, reply to a existing tweet and a function to increment to days counter.<\/p>\n\n<p>The script when executed works as below,<\/p>\n\n<ul>\n<li>Reads the counter from the text file.<\/li>\n<li>Increments the counter and writes it back to the same file.<\/li>\n<li>Message is formed using the days count.<\/li>\n<li>Last tweet id is read from another file.<\/li>\n<li>Tweet is posted and id of the new tweet is saved back to the file for next tweet.<\/li>\n<\/ul>\n\n<p>The script still needs rework to move the Twitter app details outside of the script, find a better way to store counter and tweet id and do some basic error handling. I am hoping to do this as I complete pending tutorial.<\/p>\n\n<p><strong>Bonus<\/strong>: I automated the execution of this using Crontab. This <a href=\"https:\/\/crontab.guru\/\">site<\/a> helps you create a cron schedule expression if you have problem understanding it's format. And, if you don't know how to create crontab, then see this <a href=\"https:\/\/www.youtube.com\/watch?v=kL5rmcxwgSs&amp;t=331s\">video<\/a><\/p>\n\n","category":["python","twitter"]},{"title":"View JSFiddle Result In A New Tab\/Window","pubDate":"Thu, 26 Mar 2020 06:08:36 +0000","link":"https:\/\/dev.to\/iamkalai\/view-jsfiddle-result-in-a-new-tab-window-19of","guid":"https:\/\/dev.to\/iamkalai\/view-jsfiddle-result-in-a-new-tab-window-19of","description":"<p><strong>TIL:<\/strong> You can view <strong>JsFiddle<\/strong> output in a separate tab by adding <strong>'\/show'<\/strong> at the end of your fiddle.<\/p>\n\n<p><strong>EX:<\/strong> <a href=\"https:\/\/jsfiddle.net\/iamkalai\/gs5eqhrf\/show\">https:\/\/jsfiddle.net\/iamkalai\/gs5eqhrf\/show<\/a><\/p>\n\n","category":"todayilearned"},{"title":"Few Random Interview Tips","pubDate":"Sat, 08 Sep 2018 07:24:35 +0000","link":"https:\/\/dev.to\/iamkalai\/few-random-interview-tips-4a27","guid":"https:\/\/dev.to\/iamkalai\/few-random-interview-tips-4a27","description":"<p>This is my first and a random post that I am using to share my limited experience of attending some interviews and also being at the other as an interviewer.<\/p>\n\n<h2>\n  \n  \n  <em>Being nervous is fine<\/em>\n<\/h2>\n\n<p>It's perfectly reasonable and fine being nervous during an interview. The environment is strange, people are new and everything may be out of your comfort zone. While it is true that <em>'First impression is best blah blah'<\/em> but if you can get over your nervousness during the course of the interview, many do ignore and understand your initial nervousness.<\/p>\n\n<p><strong>Tip:<\/strong> If you search on the internet, you will find a dozen suggestions for a dime, but the simplest thing that you can do to limit your nervousness is to get to the interview venue ahead of time. This gives time to relax, get comfortable with the environment and get in your zone before the interview. A habit that I have developed from past few years is to go to the interview venue before a day so that I can figure out logistics, etc. This helps me in planning my travel better on the day of the interview and I am not stressed to reach the interview on time.<\/p>\n\n<h2>\n  \n  \n  <em>Have some water before beginning<\/em>\n<\/h2>\n\n<p>You may not have followed the tip to reach early, but it's usually not a great idea practically to start your interview as soon as you arrive. You are already late and a couple of more minutes is not going to make things much worse. Excuse yourself and have a glass of interview. This gives you time and space to calm yourself down.<\/p>\n\n<h2>\n  \n  \n  <em>Don't be afraid to ask them to repeat<\/em>\n<\/h2>\n\n<p>Often times I have seen people not listening to the question properly and sometimes even scared while asking someone to repeat the question. There is no harm in asking someone to repeat their question. Consider the flip side, you do not understand the question, assume something and answer something that makes no sense to the actual question being asked :)<\/p>\n\n<h2>\n  \n  \n  <em>You are not supposed to know everything<\/em>\n<\/h2>\n\n<p>This again is my personal opinion but if you do not know something or have not got chance to work on something while being asked in interview, you can simply state the same and explain whatever you know. This atleast earns honestly and integrity points in my book plus remember <em>'Nobody can know everything'<\/em>. There is always scope to learn and improve.<\/p>\n\n","category":["interview","tips"]}]}}