<?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 ওয়াসী (Wasi) on Medium]]></title>
        <description><![CDATA[Stories by ওয়াসী (Wasi) on Medium]]></description>
        <link>https://medium.com/@wasi0013?source=rss-bdc85827d951------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*mpyrw93GaZfuGL7ApXsciw.gif</url>
            <title>Stories by ওয়াসী (Wasi) on Medium</title>
            <link>https://medium.com/@wasi0013?source=rss-bdc85827d951------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 14:25:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@wasi0013/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[‘How to minimize your Google Footprint’ — A brief introduction to your privacy protection on Google]]></title>
            <link>https://medium.com/@wasi0013/how-to-minimize-your-google-footprint-a-brief-introduction-to-your-privacy-protection-on-google-2d6b4da0dadc?source=rss-bdc85827d951------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d6b4da0dadc</guid>
            <category><![CDATA[google]]></category>
            <category><![CDATA[introduction]]></category>
            <category><![CDATA[privacy-protection]]></category>
            <category><![CDATA[privacy]]></category>
            <dc:creator><![CDATA[ওয়াসী (Wasi)]]></dc:creator>
            <pubDate>Wed, 25 Dec 2019 21:16:49 GMT</pubDate>
            <atom:updated>2019-12-25T21:17:55.604Z</atom:updated>
            <content:encoded><![CDATA[<h3>‘How to minimize your Google Footprint’ — A brief introduction to your privacy protection on Google</h3><p>This is an excerpt, please read the whole article here:<br><a href="https://wasi0013.com/2019/12/26/tweaking-data-personalization-settings-of-your-google-account-to-minimize-your-shared-data/"><strong>https://wasi0013.com/2019/12/26/tweaking-data-personalization-settings-of-your-google-account-to-minimize-your-shared-data/</strong></a></p><p>Ever wondered how Google knows what you are looking for? Or, had a creepy feeling that Google knows more about you than you know yourself? If so, read on!</p><h3>Download &amp; Backup all your Google Data</h3><p>Before, I begin, I think it will be fun to know, what data Google already collected about you. Your daily activities in Google Products can be seen here:</p><p><a href="https://myactivity.google.com/myactivity">https://myactivity.google.com/myactivity</a></p><p>If you use Android/Apple or any smart devices with Google sign in their app activities will also get listed here!</p><p>You can also download all of your Google Data and create a backup all at once! Interested?</p><p>Just go to <a href="https://takeout.google.com/">https://takeout.google.com/</a> and, download all your data!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-gbKUDU0u_dk0eLZ" /></figure><p>You will be able to collect all the data of every Google Services you ever used! So for example, if you have tons of data in your Gmail, Youtube, Google Drive, etc the amount of data might be overwhelmingly large and take a while to archive! So, be sure to select only the information that you are interested in!</p><p>Once, the archiving process is done! Feel free to extract it to your local device and explore various folders. Most of them will be in HTML format or, JSON so it should be easy to understand! For example, take a look at a snippet from my map history</p><pre> &quot;duration&quot; : { &quot;startTimestampMs&quot; : &quot;1554207917304&quot;,&quot;endTimestampMs&quot; : &quot;1554211404619&quot;</pre><pre>},</pre><pre>&quot;distance&quot; : 4411,</pre><pre>&quot;activityType&quot; : &quot;IN_PASSENGER_VEHICLE&quot;,</pre><pre>&quot;confidence&quot; : &quot;HIGH&quot;,</pre><pre>&quot;activities&quot; : [ {</pre><pre>&quot;activityType&quot; : &quot;IN_PASSENGER_VEHICLE&quot;,</pre><pre>&quot;probability&quot; : 97.94460895230867</pre><pre>}, {</pre><pre>&quot;activityType&quot; : &quot;WALKING&quot;,</pre><pre>&quot;probability&quot; : 1.318871350750673</pre><pre>}, {</pre><pre>&quot;activityType&quot; : &quot;MOTORCYCLING&quot;,</pre><pre>&quot;probability&quot; : 0.4827684891064022</pre><pre>} ],</pre><p>I think the data above is self-explanatory! Just notice, how accurately google detected I was in a passenger vehicle i.e. Uber instead of motorcycling or, walking! The confidence level of Google’s Prediction model is 97.95% for Passenger Vehicle, 1.3% for Walking &amp; 0.4% for Motorcycling!</p><p><strong>Fascinating</strong> isn’t it? …</p><p>The above article was originally published on my personal website. Please, read the whole article there:</p><p><a href="https://wasi0013.com/2019/12/26/tweaking-data-personalization-settings-of-your-google-account-to-minimize-your-shared-data/"><strong>https://wasi0013.com/2019/12/26/tweaking-data-personalization-settings-of-your-google-account-to-minimize-your-shared-data/</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d6b4da0dadc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Some Code Snippets for Downloading files using Python 3]]></title>
            <link>https://medium.com/@wasi0013/some-code-snippets-for-downloading-files-using-python-3-31aaf73cd561?source=rss-bdc85827d951------2</link>
            <guid isPermaLink="false">https://medium.com/p/31aaf73cd561</guid>
            <category><![CDATA[wget]]></category>
            <category><![CDATA[download]]></category>
            <category><![CDATA[curl]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[selenium]]></category>
            <dc:creator><![CDATA[ওয়াসী (Wasi)]]></dc:creator>
            <pubDate>Fri, 04 Oct 2019 15:54:02 GMT</pubDate>
            <atom:updated>2019-10-04T16:48:57.403Z</atom:updated>
            <content:encoded><![CDATA[<h3>Some Useful Code Snippets for Downloading files using Python 3</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JuRA8axMHdHX5Rwip_BQSg.jpeg" /></figure><p><strong>This is an excerpt. Please, read the Full Article here</strong>:</p><p><a href="https://wasi0013.com/2019/10/04/how-to-download-a-file-from-a-website-link-using-python-script-or-code-snippet/">https://wasi0013.com/2019/10/04/how-to-download-a-file-from-a-website-link-using-python-script-or-code-snippet/</a></p><p>In this article, I’m going to demonstrate some code snippets that you can utilize to download files from the Internet using Python. I’m assuming you have a strong basic knowledge of python. I’m going to use some python libraries that are available on the python package index (pip). The codes given in this tutorial is written using Python 3 and tested on a Linux machine. Since it is written in python it should work on other Operating Systems as well.</p><h3>Download Small File Using Requests</h3><p>If you are downloading tiny files you can simply use python’s most popular HTTP module called requests. Install it using pip if not installed already. The code will be similar to this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bc62ae3ff5038808cb7924844a047f35/href">https://medium.com/media/bc62ae3ff5038808cb7924844a047f35/href</a></iframe><p>In the above script, we are downloading the logo of my website and saving it in a file named logo.png This code should work for tiny files. If you need something more sophisticated, i.e. download large files, download files by setting custom headers &amp; cookies or, download files that are protected using authentication, check out the original article that I’ve published on my personal blog:</p><p><a href="https://wasi0013.com/2019/10/04/how-to-download-a-file-from-a-website-link-using-python-script-or-code-snippet/">https://wasi0013.com/2019/10/04/how-to-download-a-file-from-a-website-link-using-python-script-or-code-snippet/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31aaf73cd561" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Term “Good Programming” — in a nutshell in Bangla]]></title>
            <link>https://medium.com/@wasi0013/the-term-good-programming-in-a-nutshell-in-bangla-ac4aa9f2124b?source=rss-bdc85827d951------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac4aa9f2124b</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[bangla]]></category>
            <category><![CDATA[good-coding-practice]]></category>
            <dc:creator><![CDATA[ওয়াসী (Wasi)]]></dc:creator>
            <pubDate>Sun, 13 Jan 2019 09:36:01 GMT</pubDate>
            <atom:updated>2019-09-01T09:53:24.763Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Term “Good Programming” — in a nutshell</h3><h3>‘ভালো প্রোগ্রামিং কি?’ — এ নিয়ে দু’টি কথা</h3><p>This article was originally posted in my personal <a href="http://wasi0013.com/blog">blog</a>. You can find the English version <a href="https://wasi0013.com/2018/12/25/the-term-good-programming-in-a-nutshell/">here</a></p><p>প্রোগ্রাম সবাই লিখে, বিশেষ করে আমরা যারা কম্পিউটার সায়েন্স কিংবা ওয়েব ডিজাইন ও ডেভেলপমেন্ট এর সাথে জড়িত তাঁরা সবাই কম বেশী প্রোগ্রামিং করে থাকি। তবে, ভালো প্রোগ্রাম লিখতে কিন্তু সবাই পারে না।</p><p>এর অন্যতম কারণ হলো ভালো কোড লিখতে হলে সময় ও রিসোর্স লাগে। কিন্তু প্রায়শঃ বিভিন্ন কোম্পানীতে কিংবা কর্মক্ষেত্রে এই বাড়তি সময় ব্যয়কে অপচয় মনে করা হয়। মজার ব্যাপার হলো — দেখতে ও পড়তে বিশ্রী এমন কোড দিয়েও কিন্তু দিব্যি কাজ চালিয়ে নেয়া যায়। যেটা ঐ সব ক্ষেত্রে, ঋণাত্মক প্রভাবকের ভূমিকা পালন করে। এমন অনেক কোম্পানী আছে যেখানে ডেভেলপাররা ১০ বছরের পুরনো কোন বিশাল দৈত্যাকার কোডবেইস কে এখনো পরিচর্যা করছে! এবং ঐ কোডবেইসের উপর ভিত্তি করে পাওয়া বিভিন্ন বাগ ট্রেইস কিংবা নতুন ফিচার ডেভেলপমেন্ট করতে গিয়ে মাথার চুল ছিঁড়ছে প্রতি নিয়ত। অনেক ক্ষেত্রে, ঐ ঐতিহাসিক কোডবেইস পুরোপুরিভাবে ব্যবহার অনুপযোগী না হওয়া পর্যন্ত কিংবা ভালো বিকল্প ব্যবস্থা না পাওয়া পর্যন্ত এটা চলতে থকে।</p><p>ফেইসবুকের কথায় ধরা যাক, ২০০৪ সালে প্রথমবারের মত, যখন ফেইসবুক লগইন করা হয় তখন ফেইসবুক চলতো পি এইচ পি ল্যাঙ্গুয়েজ দিয়ে। পরবর্তীতে, ধীরে ধীরে কোড বেইস বাড়তে থাকে, এক সময় মিলিয়ন মিলিয়ন লাইনের পি এইচ পি কোড এর এক বিশাল দৈত্যতে পরিণত হয় যার ফলশ্রুতিতে ফেইসবুক পি এইচ পি স্ট্যাক থেকে অন্য কোন স্ট্যাকে সুইচ করতে ব্যর্থ হয়। এ সমস্যার সমাধানে ফেইসবুক পি এইচ পি এর উপর ভিত্তি করে নতুন একটা প্রোগ্রামিং ল্যাঙ্গুয়েজ পর্যন্ত আবিষ্কার করে! যেটার নাম দেয়া হয় <a href="http://hacklang.org/">হ্যাক</a>। অন্যান্য ফাংশনাল প্রোগ্রামিং ল্যাঙ্গুয়েজ এর নিরাপত্তামূলক বৈশিষ্ট্যগুলো নিয়েই হ্যাক ল্যাঙ্গুয়েজটিকে সাজানো হয়। যাতে করে পুরনো কোডবেইসকে বর্জন না করে, কাজে লাগানো যায়। এতে কিছু অতিরিক্ত সময় ব্যয় হলেও পরবর্তীতে কোডবেইস এ নতুন ফিচার যোগ করতে ডেভেলপারদের কষ্ট অনেক কমে যায়।</p><p>উপরের ফেইসবুকের উদাহরণ থেকেই দেখা যাচ্ছে, ভালো কোড এর জন্যে সময় ব্যয় করলে তা পরবর্তীতে ভালো ফল দেয়। এক্ষেত্রে, আরো একটা উদাহরণ দিইঃ</p><blockquote><em>যখন আমি আমার প্রথম ল্যাপটপটি গিফট পাই, তখন আমি শুধু দুই তর্জনী দিয়ে টাইপ করতাম, কি বোর্ড দেখে দেখে। টাইপিং স্পীড ছিলো ১০-১৫ শব্দ প্রতি মিনিটে। পরবর্তী ৩-৪ মাসে ব্যবহার করতে করতে দুই আঙ্গুল দিয়েই রীতিমত ৩৫-৪০ শব্দ প্রতি মিনিটে উন্নীত হয়। এটা দিয়ে কাজ চলে যেত কিন্তু এর পরে স্পীড কেমন যেন থমকে গেলো… দুই আঙ্গুলে ৫০ শব্দ প্রতি মিনিট করা অনেক কষ্ট সাধ্য ছিলো (অন্ধকার রুম মানেই বিভীষিকা)। পরে একদিন চিন্তা করলাম দুই আঙ্গুলে অনেক হলো এবার ঠিক মতো টাইপিং শিখি। সুতরাং, অনুশীলন শুরু হলো। সব আঙ্গুল ব্যবহার করে না দেখে টাইপ করা প্রথম দিকে অনেক পেইনফুল ছিলো। স্পীড ড্রপ করে ৫-১০ শব্দে চলে আসলো। ১০ টা শব্দ লিখতে ১০০ বার ব্যাকস্পেস চাপতে হতো। সময় ও অনেক বেশী লাগতো। এভাবে, ১ মাস চলে গেলো। ধীরে ধীরে টাইপিং করার ধকল ও ব্যাকস্পেসের সংখ্যা কমতে লাগলো এবং স্পীড ও একুরেসী ইম্প্রোভ হতে লাগলো। বর্তমানে আমি টাচ টাইপিং করতে শিখেছি এবং এভারেজ টাইপিং স্পীড ৭৫-৮০ এর কাছাকাছি থাকে।</em></blockquote><p>যদিও এটা প্রোগ্রামিং এর সাথে সম্পর্কিত নয় তবে, ভালো প্রোগ্রামিং শেখার ক্ষেত্রেও কিন্তু ব্যাপারটি একই। প্রথমদিকে প্রচুর সময় ইনভেস্ট করতে হয় ফলে অনেক হতাশা, উদ্বেগ এর সৃষ্টি হয়। সময় নিয়ে ধীরে ধীরে শিখলে তবেই প্রোগ্রামিং স্কিল এর উন্নতি হতে থাকে। প্রথমদিকে উৎপাদনশীলতা ক্ষীণ দৃশ্যমান হলেও ক্রমেই উৎপাদনশীলতা বাড়তে থাকে।</p><p>অনেক তো হলো এবার মূল টপিকেই ফিরে যাইঃ</p><h3>কিভাবে বুঝবো আমার কোড ভালো নাকি খারাপ?</h3><p>এ প্রশ্নের উত্তর খুবই সাধারণ! নিচের ছবিতে দেখুনঃ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/0*caj3ljEpoM6ljrLL" /></figure><p>অর্থাৎ, আপনার কোড যখনই আপনার সতীর্থ ডেভেলপার কিংবা ক্লায়েন্ট ব্যবহার করবে তাদের রিভিউ থেকেই আপনি বুঝে নিতে পারবেন আপনার কোডের মান কেমন। অনেক সময় নিজের লেখা পুরনো কোড দেখলেও এটা বুঝা যায়। যদি আপনি আপনার অনেক আগের কিছু কোড দেখে কি জন্যে লিখেছেন সেটাই বুঝতে হিমশিম খান তাহলে হতাশ হবেন না, কারণ প্রত্যেক প্রোগ্রামারই এ ধরণের কোড জীবনে এক বার হলেও লিখে থাকে । আর যদি, আপনার ছয় মাসের পুরনো কোড দেখে কোন ইম্প্রুভমেন্ট স্কোপ খুঁজে না পান তাহলে বুঝে নিবেন, হয় আপনি ইতোমধ্যেই লেজেন্ডারী কোডার হয়ে গেছেন অথবা, আপনি ছয়মাস আগের আপনিতেই রয়ে গেছেন। অর্থাৎ, পর্যাপ্ত পরিমাণে সময় নিজের স্কিল ইম্প্রুভমেন্ট এর জন্যে ব্যয় করছেন না।</p><p>চলুন তবে, এবার আমরা ভালো কোডের কিছু বৈশিষ্ট্য নিয়ে আলোচনা করিঃ</p><ul><li><strong>মার্জিত ও যত্নপূর্ণ কোড</strong> — ভালো কোড পড়তেই আনন্দ লাগবে। অনেকটা গল্পের মতই শৈল্পিক। মনে হবে, কেউ যেনো অত্যন্ত যত্নের সাথেই বিস্তারিত তথ্যের প্রতি গুরুত্ব দিয়ে নিপুণভাবে কোডের মাধ্যমে এপ্লিকেশান বা সফটওয়ারটি গড়ে তুলেছে</li><li><strong>ফোকাসড কোডিং</strong> — এটা ভালো কোডের অন্যতম বৈশিষ্ট্য। প্রতিটা ফাংশন, প্রতিটা ক্লাস কিংবা প্রতিটা মডিউল একটা নির্দিষ্ট বিষয়বস্তু কে কেন্দ্র করেই আবর্তিত হবে</li><li><strong>টেস্ট</strong> — কোডের সাথে সাথে কোড সংশ্লিষ্ট মৌলিক ও গুরুত্বপূর্ণ টেস্টগুলো অবশ্যই থাকবে এবং টেস্ট গুলো ঠিক ভাবে রানও করবে।</li><li><strong>রিপিটেড কোড থাকবে না</strong> — অর্থাৎ কোডটি DRY আদর্শের উপর ভিত্তি করেই লেখা হবে। অর্থাৎ কোন ডুপ্লিকেশান থাকবে না।</li><li><strong>সিম্পল ও অপ্টিমাল</strong> — কোড হবে খুবই সাধারণ, এবং সর্বনিম্ন সংখ্যক ফাংশন, ক্লাস কিংবা এন্টিটি নিয়ে গঠিত।</li><li><strong>সীমিত ও সংক্ষিপ্ত কমেন্ট </strong>— এ ছাড়াও অনেক জ্ঞ্যানীগুণী ব্যক্তিরা বলে থাকেন, ভালো কোডে কমেন্ট লাগে না! কোড দেখলেই যে কেউ বুঝতে পারে কোডটার কাজ কি!</li></ul><h3>কিভাবে ভালো কোড লিখবো?</h3><p>ভালো কোডের বৈশিষ্ট্যগুলো তো জানলাম এবার, আসি ভালো কোড কিভাবে লিখতে হবে সে বিষয়েঃ</p><h3>অর্থপূর্ণ নাম</h3><p><strong>ভেরিয়েবলের নাম</strong> — নামের অর্থের সাথে কাজের মিল থাকতে হবে। সংক্ষিপ্ত নাম ব্যবহার করতে হবে, যাতে করে ভ্যারিয়েবল, ফাংশন, ক্লাসের নাম গুলো দেখেই এদের কাজ গুলো বুঝা যায়। নিচের উদাহরণটি দেখুনঃ</p><pre>s = 60000<br>m = 12<br>y = s * m</pre><p>এবার পরবর্তী উদাহরণটি দেখুনঃ</p><pre>salary = 60000<br>month = 12<br>yearly_income = salary * month</pre><p>কোন কোডটি দেখে বুঝতে কম সময় লেগেছে? খেয়াল করে দেখবেন, কোড দুটিতে সব অপারেটর কিন্তু একই, শুধুমাত্র ভেরিয়েবলের নাম এর জন্যেই দ্বিতীয় কোডটি প্রথম কোড থেকেও ভালোভাবে বুঝা যাচ্ছে। এবার প্রথম কোডটির নিচের ভার্সন দেখুনঃ</p><pre>s = 60000 // Salary of the user<br>m = 12  // number of months<br>y = s * m  // calculated yearly income</pre><p>আগের কোডটির চেয়ে আরেকটু ক্লিয়ার হলেও, সমস্যা কিন্তু সমস্যাই রয়ে গেছে। ধরেন, এইবার একই কোডের দুইশত নিরানব্বই নাম্বার লাইনে গিয়ে যদি আবার আপনাকে উপরের যেকোনো একটা ভেরিয়েবল ব্যবহার করতে হয় সেক্ষেত্রে, হয় আপনাকে মনে রাখতে হবে s, m ও y এর কাজ কি না হয়, স্ক্রল করে আবার উপরে গিয়ে ভেরিয়েবলগুলোর ডেফিনিশান চেক করতে হবে নতুবা, আপনাকে আবার একটা কমেন্ট লিখতে হবে। সুতরাং বুঝতেই পারছেন, যখনই এমন সিচুয়েশান দেখবেন অর্থাৎ, এমন ভেরিয়েবল লিখলেন যেটার জন্যে আপনাকে এক্সট্রা একটা কমেন্ট করতে হচ্ছে তখনি ঐ ভেরিয়েবল এর নাম নিয়ে ব্রেইনস্ট্রম করে নামটা সেট করে নিবেন এই এক্সট্রা চিন্তার কারণে ব্যয় করা সময় পরবর্তীতে অনেক অনেক ঘণ্টার অপচয় থেকে আপনাকে বাঁচাবে।</p><p><strong>ফাংশনের নাম</strong> — ভালো ফাংশনের বৈশিষ্ট্য হলোঃ শুধুমাত্র একটা কাজ করা এবং ঐ কাজটি ভালোভাবে করা। যেহেতু ফাংশনের কাজই হলো ক্রিয়া সম্পাদন তাই, ফাংশনের নাম ও হতে হবে ক্রিয়া পদের। উদাহরনঃ delete_user(), make_payment()</p><p><strong>ক্লাসের নাম</strong> — ক্লাসের নাম হতে হবে বিশেষ্যপদের, ফাংশনের মতো ক্রিয়াপদের নাম ক্লাসের ক্ষেত্রে প্রযোজ্য নয়। এছাড়াও, মনে রাখতে হবে শুধুমাত্র নামবাচক বিশেষ্য ব্যবহার করা উত্তম গুণবাচক বিশেষ্য এড়িয়ে চলা উচিত। উদাহরনঃ AbstractUser ইত্যাদি।তবে এ ধরনের নামগুলো পরিহার করা উচিত যেমন - Manager, Info</p><p>আরেকটা গুরুত্বপূর্ণ বিষয় হলোঃ নামের ক্ষেত্রে যেকোনো একটি শব্দ সিলেক্ট করে সেটাকে বার বার ব্যবহার করলে, দ্বিধান্মিত কিংবা বিভ্রান্ত হওয়া থেকে রক্ষা পাওয়া যায়। মনে করেন আপনি একটি এপি আই ডিজাইন করছেন, সে ক্ষেত্রে আপনি যদি create, update, delete শব্দগুলো ব্যবহার করেন আবার সে সাথে সাথে add, modify, remove ও ব্যবহার করেন সে ক্ষেত্রে এপিআই ইউজার কিন্তু বিভ্রান্ত হবে এবং, বার বার ডকুমেন্টেশান চেক করতে করতে হতাশ বা, বিরক্ত হয়ে যাবে।</p><h3>ফাংশন নিয়ে আরো কিছু কথা</h3><p>ফাংশন লেখার শুরুতেই মাথায় রাখতে হবে, ফাংশনকে হতে হবে ছোট এবং সংক্ষিপ্ত। এ রুল কিন্তু ফাংশনের ভিতরে যে loop বা if else স্টেটমেন্টগুলোও সেগুলোর ক্ষেত্রেও প্রযোজ্য অর্থাৎ ঐগুলোকেও ছোট হতে হবে। এমন হতে পারে ঐ গুলো একলাইনের অন্য কোন ফাংশন কল। আরেকটা জিনিস হলো ফাংশনের আর্গুমেন্ট ৩ এর বেশী হওয়া উচিত নয়। যদি দেখেন, কোন একটা ফাংশনের আর্গুমেন্ট অনেকগুলো তাহলে, সাথে সাথে বুঝে নিবেন ঐ ফাংশন মাত্রাতিরিক্ত কাজ করছে এবং, ছোট কয়েকটি ফাংশনে বিভক্ত করে নেওয়া উত্তম হবে।</p><p>— -</p><p>অনেকতো বললাম, আসলে এরকম আরো অনেক কিছুই আছে যা মেনে চললে আপনার কোড আগের চেয়ে ইম্প্রুভ হবে। সেগুলো না হয় আরেকদিন অন্য কোন পোস্টে শেয়ার করবো। তবে, এই আর্টিকেলটি কেমন লেগেছে তা জানাতে ভুলবেন না। অন্য কোন বিষয় নিয়ে জানার আগ্রহ থাকলে এবং, ঐ বিষয় নিয়ে আর্টিকেল পড়তে ইচ্ছুক হলে <a href="https://wasi0013.com/contact/">আমাকে জানাবেন</a>, আমার স্কোপের ভিতরে থাকলে অবশ্যই ঐ টপিকে লেখার চেষ্টা করবো।</p><h3>Author:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*QCoRVDClrx6CCTRc.png" /><figcaption>Wasi Mohammed Abdullah</figcaption></figure><p>Thinker, Day Dreamer, Python Enthusiast, Javascript Admirer, <br>An Introvert with Exception!</p><p><em>CEO, Founder <br></em><a href="https://www.dreamcatcherit.com/"><strong>Dreamcatcher IT</strong></a><br>twitter: <a href="http://twitter.com/wasi0013"><em>twitter.com/wasi0013</em></a><em><br></em>facebook: <a href="http://fb.me/WasiMohammedAbdullah"><em>fb.me/WasiMohammedAbdullah</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac4aa9f2124b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Four Amazing Python Books that I recommend to every Beginners]]></title>
            <link>https://medium.com/dreamcatcher-its-blog/four-amazing-python-books-that-i-recommend-to-every-beginners-44b4324cb6bb?source=rss-bdc85827d951------2</link>
            <guid isPermaLink="false">https://medium.com/p/44b4324cb6bb</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python-beginner]]></category>
            <category><![CDATA[books]]></category>
            <category><![CDATA[recommended-reading]]></category>
            <category><![CDATA[amazon-books]]></category>
            <dc:creator><![CDATA[ওয়াসী (Wasi)]]></dc:creator>
            <pubDate>Mon, 19 Nov 2018 08:13:26 GMT</pubDate>
            <atom:updated>2019-11-13T08:22:00.800Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SLV-F-3rUlRRfdbbb1wkXg.jpeg" /><figcaption>image collected from awesome content/freepik</figcaption></figure><h3>Four Amazing Python Books that I Recommend to Every Beginner</h3><p>In this article, I’m gonna talk about four <a href="http://python.org/">python</a> books that I found extremely helpful to harness the power of python.</p><p>If you are just getting started with Python, I will suggest you to buy and read them sequentially.</p><ul><li>Start with <a href="https://docs.python.org/3/tutorial/index.html"><strong>python doc</strong></a><strong> </strong>it’s free!<strong> <br></strong>Python’s Documentation is well maintained. It even contains tutorials that will help you to get familiarize with basic python syntax. Whenever you are stuck it is always a good idea to check out the docs first. As most of the time, you will find whatever you are looking for within the python doc!</li><li><a href="https://www.amazon.com/gp/product/1593275994/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1593275994&amp;linkCode=as2&amp;tag=wasi0013-20&amp;linkId=96ffa8ac0dff04db4539082fbbe04f53">Automate the Boring Stuff with Python: Practical Programming for Total Beginners</a><br>I love this book! Cause, this book is full of interesting projects that will make your python learning journey adventurous! In each step, you will find the exquisite taste of accomplishment, which will keep you motivated to learn even more.<br><strong>Check Price:</strong> <a href="https://amzn.to/2DLCrYe">https://amzn.to/2DLCrYe</a></li><li><a href="https://amzn.to/2qOpHaK">Fluent Python</a><br>What is so special about this book? Well, this book covers special features of python so well that it made quite a great impression on me. Another thing that I love is this book focuses on writing Pythonic code. Hence, you will be able to <a href="https://www.youtube.com/watch?v=OSGv2VnC0go">transform codes into beautiful idiomatic python</a><br><strong>Check Price:</strong> <a href="https://amzn.to/2qOpHaK">https://amzn.to/2qOpHaK</a></li><li><a href="https://amzn.to/2qQC3im">Python Cookbook</a><br>The Python Cook Book is full of recipes! Recipes or, scripts that you will use in everyday life! Various topics such as Data Processing, Network Programming or, advanced topics such as Meta Programming are all covered. This book is pretty advanced compared to other books but, nonetheless beginners will find it super useful!<br><strong>Check Price:</strong> <a href="https://amzn.to/2qQC3im">https://amzn.to/2qQC3im</a></li><li><a href="https://amzn.to/2Q3h3DA">Pro Python</a><br>Pro python is another advanced book that can be recommended to beginners with basic python knowledge. The best thing about this book is it teaches python best practices. It will help you get rid of your sloppy code habits and, let you write more concise and, idiomatic python.<br><strong>Check Price:</strong> <a href="https://amzn.to/2Q3h3DA">https://amzn.to/2Q3h3DA</a></li></ul><p><strong>All these books are Highly Recommended!</strong></p><p><strong>Note: </strong>I recommend that you buy these books as a token of appreciation to the authors. It will help them to produce more and more good stuff which will be beneficial to you, me and all of us.</p><p>Thanks for reading! Your claps are always appreciated! :)</p><p>Do you have any recommendations for beginners? Let me know in the comments section!</p><h3>Author:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*PQf0dLR2X7uN4MT8d0ZN6A.png" /><figcaption>Wasi Mohammed Abdullah</figcaption></figure><p>Thinker, Day Dreamer, Python Enthusiast, Javascript Admirer An Introvert with Exception!</p><p><em>CEO, Founder <br></em><a href="https://www.dreamcatcherit.com/"><strong>Dreamcatcher IT</strong></a><strong> </strong><br>twitter: <a href="http://twitter.com/wasi0013"><em>twitter.com/wasi0013</em></a><em><br>Github: </em><a href="http://github.com/wasi0013"><em>github.com/wasi0013</em></a><em><br></em>facebook: <a href="http://fb.me/wasi0013"><em>fb.me/wasi0013</em></a></p><p><em>Please, feel free to </em><a href="https://wasi0013.wordpress.com/contact/"><em>contact</em></a><em> me if you need any help.</em></p><p>P.S. I have <strong>switched from medium to my personal blog</strong>. Visit my blog to get the latest posts! You can also suggest the topic of your choice by contacting me, I will try my best to write about it. :)</p><blockquote>Personal Blog: https://<a href="https://wasi0013.com/blog">wasi0013</a>.com/blog</blockquote><p>** All the book links given above are affiliate links of Amazon. **</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44b4324cb6bb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dreamcatcher-its-blog/four-amazing-python-books-that-i-recommend-to-every-beginners-44b4324cb6bb">Four Amazing Python Books that I recommend to every Beginners</a> was originally published in <a href="https://medium.com/dreamcatcher-its-blog">Dreamcatcher IT’s Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Byte Sized Hacks: Manage dependencies of your Python Project with pipenv]]></title>
            <link>https://medium.com/dreamcatcher-its-blog/byte-sized-hacks-manage-dependencies-of-your-python-project-with-pipenv-bf236df6104b?source=rss-bdc85827d951------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf236df6104b</guid>
            <category><![CDATA[pipenv]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[manage-python-projects]]></category>
            <category><![CDATA[virtualenv]]></category>
            <dc:creator><![CDATA[ওয়াসী (Wasi)]]></dc:creator>
            <pubDate>Fri, 12 Jan 2018 14:56:45 GMT</pubDate>
            <atom:updated>2018-11-17T10:38:33.975Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*AAzzvbZWn3aRBnZw5M-Rvw.png" /></figure><p>For last couple of years or so, I extensively used <a href="https://virtualenv.pypa.io/en/stable/">virtualenv</a> for maintaining a sand boxed environment for my Python projects with all the dependencies. I followed the typical pattern consisting of creating requirements.txt and updating it time to time by pip freeze &gt; requirements.txt.</p><p>It enables you to experiment with different python modules without making changes to system. For any projects, all you have to do is create an environment first! using virtualenv command (Of course, you will have to install it first, if you don’t have it already).</p><p>virtualenv -p &lt;your_python_path&gt; &lt;virtual_environment_name&gt;</p><p>e.g</p><p>virtualenv -p /usr/bin/python3.6 .env</p><p>After creating the environment you will have to activate it i.e. assuming you are in the project directory, you can activate the virtual environment with:</p><p>source .env/bin/activate</p><p><em>Note: </em><em>.env is the environment_name</em></p><p>This way, you can easily create a separate environment for each of your projects. However, there are some issues that are pretty cumbersome. For example, in some cases, you might need to install additional modules for aiding you in the development for testing/debugging. To maintain such dependencies one solution is to create multiple requirements.txt files like, requirements_dev.txt etc. for keeping development environment with additional packages for debugging separate from the production environment. <br>Managing these things are really tough. By creating aliases for commands you can ease up it a little bit but, its still the same. And, every time you start on a project you will have to create environment also, activate the environment each time you work itself is pretty bothering…</p><p>While I was constantly looking for alternatives I found pipenv along with others. I liked the simplicity of pipenv! And, started to explore it.</p><p>Guess what, it is now officially recommended Python packaging tool from p<a href="https://packaging.python.org/tutorials/managing-dependencies/#managing-dependencies">ython.org</a></p><h3>Meet pipenv!</h3><p><a href="https://www.kennethreitz.org/">Kenneth</a>’s pipenv is extremely helpful for managing projects with less headache! It combines <a href="https://pip.pypa.io/en/stable/">Pip</a>, <a href="https://github.com/pypa/pipfile">Pipfile</a> and <a href="https://virtualenv.pypa.io/en/stable/">Virtualenv</a> and provides a command line tool which is pretty straightforward. I just love it.</p><h3>Installation</h3><p>Cakewalk! Just use pip:</p><p>pip install pipenv</p><p>After installation you can literally forget pip! pipenv will take care of all the dependencies along with the virtual environment. It generates Pipfile Pipfile.lock which is similar to requirements.txt keeps all your dependencies noted. To start a new project all you have to do is create a new project folder. open it in terminal. And, run the following command:</p><p>pipenv install</p><p>This will look for existing environments if there is none, it will create a new one for you and initialize it… Thats it! No need to execute virtualenv commands or anything! You can use--two or --three arguments along with the above command e.g. pipenv install --three for creating python 3 environment. If you don’t specify it will use the system preferred version (output of which python )</p><h3>Managing Development Environments with pipenv</h3><p>Coolest thing of pipenv is, you can install modules in development mode by passing --dev as argument! It will install it only for development environment. For example</p><p>pipenv install --dev django_debug_toolbar</p><p>will install the django_debug_toolbar module only for dev! So, if you run</p><p>pipenv install</p><p>in your production it won’t install django_debug_toolbar! but if you run</p><p>pipenv install --dev</p><p>it will only then install all the development packages along with the production packages. Simple right?</p><p>So, all you have to do is to share the pipfile with your teammates (you can include this file on git repo as well) then they can replicate your dev/prod environment without a single hassle!</p><h3>So, how to activate the virtualenv within pipenv?</h3><p>As, I have mentioned before you don’t have to activate or deactivate your virtualenv if you already have installed pipenv<br>To invoke a python shell in your virtual environment you can simply use the following command:</p><p>pipenv shell</p><p>It will open up the python Interactive shell using the project environment! To run a python file you can similarly use:</p><p>pipenv run python your_script.py</p><p>This will run your_script.py file using the virtual environment.</p><p>Okay, that is it! You can explore the <a href="http://pipenv.readthedocs.io/en/latest/">pipenv documentation</a> to know more about it. Or, if you like you can checkout the source from their <a href="https://github.com/pypa/pipenv">github repository</a></p><h3>Author:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*BL4acfWHcWRtBR7pW4ALBQ.png" /><figcaption>Wasi Mohammed Abdullah</figcaption></figure><p>Thinker, Day Dreamer, Python Enthusiast, Javascript Admirer An Introvert with Exception!</p><p><em>CEO, Founder <br></em><a href="https://www.dreamcatcherit.com/"><strong>Dreamcatcher IT</strong></a><strong> </strong><br>twitter: <a href="http://twitter.com/wasi0013"><em>twitter.com/wasi0013</em></a><em><br>github: </em><a href="http://github.com/wasi0013"><em>github.com/wasi0013</em></a><em><br></em>facebook: <a href="http://fb.me/wasi0013"><em>fb.me/wasi0013</em></a></p><p>P.S. I have <strong>switched from medium to my personal blog</strong>. Visit my blog to get latest posts! You can also suggest topic of your choice by contacting me, I will try my best to write about it. :)</p><blockquote>Personal Blog: https://<a href="https://wasi0013.com/blog">wasi0013</a>.com/blog</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf236df6104b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dreamcatcher-its-blog/byte-sized-hacks-manage-dependencies-of-your-python-project-with-pipenv-bf236df6104b">Byte Sized Hacks: Manage dependencies of your Python Project with pipenv</a> was originally published in <a href="https://medium.com/dreamcatcher-its-blog">Dreamcatcher IT’s Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Simple Tips for Efficient Web Crawling using Selenium Python]]></title>
            <link>https://medium.com/dreamcatcher-its-blog/5-simple-tips-for-improving-automated-web-testing-or-efficient-web-crawling-using-selenium-python-43038d7b7916?source=rss-bdc85827d951------2</link>
            <guid isPermaLink="false">https://medium.com/p/43038d7b7916</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[web-crawling]]></category>
            <category><![CDATA[automated-web-testing]]></category>
            <category><![CDATA[web-scraping]]></category>
            <dc:creator><![CDATA[ওয়াসী (Wasi)]]></dc:creator>
            <pubDate>Fri, 05 Jan 2018 11:37:01 GMT</pubDate>
            <atom:updated>2021-11-17T13:16:08.292Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N231KIdJLeOZJt-Ei-vt-A.png" /></figure><p>In this article, I will share 5 simple tips that will help you to improve automation of your web scraping bot or crawler that you wrote using python selenium. But, first let me briefly introduce you with <a href="https://pypi.python.org/pypi/selenium">python’s selenium</a> module in case, if you are not familiar with it:</p><p>It is actually a python binding for the API of Selenium Web Drivers. For example, you will be able to conveniently access the API of Selenium Web drivers like <a href="https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver">Firefox</a>, <a href="https://sites.google.com/a/chromium.org/chromedriver/downloads">Chrome</a>, <a href="http://phantomjs.org/">PhantomJS</a>, etc. Using this module, you can use web driver API to simulate all sorts of actions that you can perform on a typical Web Browser! i.e. click on buttons of websites, scroll and navigate through pages, type something in input boxes, submit forms, use proxies, even execute custom Javascripts on pages and many more! All these stuff using just a python script! Pretty cool! right? <br>Now, let&#39;s jump straight to the first tip:</p><h3>Tip No 1: Crawl websites without loading Images</h3><p>As we are talking about, automated scripts these scripts will run hundreds or thousands of times. So, every second (perhaps, milliseconds?) count. Most of the modern dynamic websites have lots of images. When a page loads, selenium loads all the elements in it including those images!</p><p>Hence, even though we don’t interact much with those images when we are testing website functionalities. Selenium still loads them! The good thing is there are ways to load pages without loading images in selenium! I will show the codes for phantomjs webdriver &amp; chromedriver below:</p><p><strong><em>PhantomJS Web Driver Load Web Page without Images</em></strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/11dc941c6f1fcbb021a429d63b444ce3/href">https://medium.com/media/11dc941c6f1fcbb021a429d63b444ce3/href</a></iframe><p><strong><em>Chrome Web Driver Load Pages without Images:</em></strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/21dde2d1d60db7f752954b71edb4779d/href">https://medium.com/media/21dde2d1d60db7f752954b71edb4779d/href</a></iframe><h3>Tip No: 2 Scrape Websites using Disk Cache</h3><p>Caching the assets often leads to faster page loads. In a modern web browser, disk caching reduces page loading time impressively. You can take advantage of this on selenium web driver as well!. All you have to do is set the configuration before the initialization of the web driver. This basically stores all the website&#39;s assets like CSS, js in the disk storage for faster loading. Helpful, when you load multiple pages of the same website<br><strong><em>Note: </em></strong><em>Obviously, when automating your tests, you can’t (and shouldn’t) cache the assets that have effects on the data you want to test! For example, if you are testing a dynamic website where the data is loaded using assets say javascript then, disk cache might even make your tests obsolete!</em></p><p><strong><em>Chrome Web Driver Load Pages using Disk Cache:</em></strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/89460b26646d888977078ad44c2053e8/href">https://medium.com/media/89460b26646d888977078ad44c2053e8/href</a></iframe><p><strong><em>PhantomJS Web Driver Load Web Page with Disk Cache</em></strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/436646492df2651ca6329bb92b762bfb/href">https://medium.com/media/436646492df2651ca6329bb92b762bfb/href</a></iframe><h3>Tip No: 3 Use Javascript for scrolling</h3><p>When interacting with page elements especially clicking on buttons, if the element you are looking for is not visible in the viewport. Selenium raises an exception notifying that element is not visible. I prefer Javascript for scrolling the element into view and, then wait for a bit using time.sleep() so that the scroll effect goes off. And, then trigger the click… simple!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7c0ab95d0491d9e66d5e1acca10a3a76/href">https://medium.com/media/7c0ab95d0491d9e66d5e1acca10a3a76/href</a></iframe><h3>Tip No: 4 Scrolling items in a drop-down using Select</h3><p>Let&#39;s say, you are trying to select an option from a select element with a huge number of options say 20+. In this case, you can’t select the item in an ordinary way. You will have to first locate the select element using the driver. Then, find all the options. Filter through each of them to find the appropriate option you are looking for. After that, make it visible and click on it! Fortunately, selenium has a class called ‘Select’ which will help you to do the above task in a lot easier way! Take a look at the following script. Its pretty self explanatory but, if you have any questions about it feel free to comment!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ab123423701abb1392cb9086015ce5e7/href">https://medium.com/media/ab123423701abb1392cb9086015ce5e7/href</a></iframe><h3>Tip No: 5 Properly close the driver using quit</h3><p>It is important to properly close the driver after finishing the automation especially if you run your scripts periodically! When you invoke your python automation script to do things for you, it uses additional resources/processes for the selenium web drivers. After the python script finishes execution it doesn’t release those additional resources if you don’t tell it to do so! One way to do it is to use driver.close().</p><p>But, driver.close() doesn’t always stop the web driver that’s running in the background. And, if you are doing things using multiple tabs of the selenium web browser then it closes only the current one! Leading others open. <br>You can use <strong>driver.quit()</strong> instead, as it closes all the tabs of the selenium web browser. The Selenium Web driver instance is also gets killed after this!</p><p>Additionally, I usually append an os.system(‘killall phantomjs’) command or, os.system(‘killall chrome’) in the code when I am only running a single task in my computer. Just a little hack to make sure all the resources are freed up. <br><strong><em>Warning:</em></strong><em> It might not be a good thing to do if you are running multiple scripts at once! Or say, surfing the Internet using Google Chrome on the same computer. The Command- killall chrome will definitely kill your browser as well!</em></p><p>I will wrap it up by saying one last thing:</p><blockquote>Always minimize the number of requests you make to the Web Server. Try to reduce it as much as possible</blockquote><p>That is all for this moment! I hope these tips will help you to automate your web testing or, write more efficient web crawlers from now on.</p><p>I would love to hear from you! please, feel free to comment on your feedback, or share your preferred way to do the above things and, don’t forget to clap for it. <br>;)</p><p><strong>EDIT: </strong>Phantom JS is deprecated now! So, use chromedriver or gecko driver instead!</p><p>If you are looking for python selenium alternatives, you might want to check these modules:</p><p><a href="https://github.com/kennethreitz/requests-html">requests-html</a></p><p><a href="https://pypi.org/project/mechanize/">mechanize</a></p><p><a href="https://marionette-client.readthedocs.io/en/master/">Scrapy</a></p><p><a href="https://marionette-client.readthedocs.io/en/master/">Marionette</a></p><h3>Author:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*PQf0dLR2X7uN4MT8d0ZN6A.png" /><figcaption>Wasi Mohammed Abdullah</figcaption></figure><p>Thinker, Day Dreamer, Python Enthusiast, Javascript Admirer Introvert</p><p><em>CEO, Founder <br></em><a href="https://www.dreamcatcherit.com/"><strong>Dreamcatcher IT</strong></a><strong> </strong><br>twitter: <a href="http://twitter.com/wasi0013"><em>twitter.com/wasi0013</em></a><em><br>github: </em><a href="http://github.com/wasi0013"><em>github.com/wasi0013</em></a><em><br></em>facebook: <a href="http://fb.me/wasi0013"><em>fb.me/wasi0013</em></a></p><p>P.S. I have <strong>switched from medium to my personal blog</strong>. Visit my blog to get the latest posts! You can also suggest the topic of your choice by contacting me, I will try my best to write about it. :)</p><blockquote>Personal Blog: https://<a href="https://wasi0013.com/blog">wasi0013</a>.com/blog</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43038d7b7916" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dreamcatcher-its-blog/5-simple-tips-for-improving-automated-web-testing-or-efficient-web-crawling-using-selenium-python-43038d7b7916">5 Simple Tips for Efficient Web Crawling using Selenium Python</a> was originally published in <a href="https://medium.com/dreamcatcher-its-blog">Dreamcatcher IT’s Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Byte Sized Hacks: Quickly Backup & Restore a Postgresql Database from a .sql Backup File]]></title>
            <link>https://medium.com/@wasi0013/byte-sized-hacks-quickly-backup-restore-a-postgresql-database-from-a-sql-backup-file-694748d1aa11?source=rss-bdc85827d951------2</link>
            <guid isPermaLink="false">https://medium.com/p/694748d1aa11</guid>
            <category><![CDATA[linux-tutorial]]></category>
            <category><![CDATA[restore]]></category>
            <category><![CDATA[backup]]></category>
            <category><![CDATA[byte-sized-hacks]]></category>
            <category><![CDATA[postgres]]></category>
            <dc:creator><![CDATA[ওয়াসী (Wasi)]]></dc:creator>
            <pubDate>Thu, 28 Dec 2017 11:35:12 GMT</pubDate>
            <atom:updated>2017-12-28T11:39:29.465Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, I’m gonna write about the fastest way that I’ve discovered so far to backup and restore a Postgresql database using terminal (that worked for me) <br>I’m using Ubuntu 16.04 LTS for this tutorial, and I already have <a href="https://www.postgresql.org/">postgresql</a> along with <a href="https://www.pgadmin.org/">pgadmin III</a> installed. Although, it is not required to have pgadmin III installed in your machine. I’m just gonna create a new db with it so no big deal. You can do it with a simple psql command if you don’t have pgadmin III.</p><h3>Backup A Postgres DB:</h3><p>I prefer pg_dump command for this part. I open up my terminal change my directory to `/tmp` and execute the following command:</p><blockquote>cd /tmp<br>sudo -u postgres pg_dump -U postgres -E UTF-8 -F p -b -C -f backup_db.sql primary_db</blockquote><p>In the above command, the first `postgres` is a user, the second `postgres` is the role. `backup_db.sql` is the sql backup file that we are going to use when restoring the database. And, `primary_db`is the database that we are going to backup.<br>Once the command finishes execution you will get a backup_db.sql file in your /tmp directory, copy it to anywhere you prefer.</p><h3>Restore A Postgres DB:</h3><p>Create a New Database on Postgresql. I usually do it with pgadmin III choosing the right user as owner (In my case owner is ‘wasi’ and db name is ‘backup_db’) <br>After creating the database, open up your terminal (use shortcut if you like, ctrl+alt+T). Navigate to the folder where you kept your sql file and execute the following command:</p><blockquote>psql backup_db wasi</blockquote><p>It will open up a psql shell using the new database that you have created a moment ago. Inside postgres shell execute the following command:</p><blockquote>\i ‘backup_db.sql’</blockquote><p>note that, you will have to use single quote when writing the sql filename. It will restore all the tables in backup_db. Now, you if you like you can rename the database back to primary_db (Assuming, the primary_db was dropped).</p><p>Please, don’t hesitate to comment your preferred way of backup &amp; restore.</p><h3>Author:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*PQf0dLR2X7uN4MT8d0ZN6A.png" /><figcaption>Wasi Mohammed Abdullah</figcaption></figure><p>Thinker, Day Dreamer, Python Enthusiast, Javascript Admirer An Introvert with Exception!</p><p><em>CEO, Founder <br></em><a href="https://www.dreamcatcherit.com/"><strong>Dreamcatcher IT</strong></a><strong> </strong><br>twitter: <a href="http://twitter.com/wasi0013"><em>twitter.com/wasi0013</em></a><em><br>github: </em><a href="http://github.com/wasi0013"><em>github.com/wasi0013</em></a><em><br></em>facebook: <a href="http://fb.me/wasi0013"><em>fb.me/wasi0013</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=694748d1aa11" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making a Stand Alone Executable from a Python Script using PyInstaller]]></title>
            <link>https://medium.com/dreamcatcher-its-blog/making-an-stand-alone-executable-from-a-python-script-using-pyinstaller-d1df9170e263?source=rss-bdc85827d951------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1df9170e263</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[executable]]></category>
            <category><![CDATA[pyinstaller]]></category>
            <category><![CDATA[py2exe]]></category>
            <category><![CDATA[make-exe]]></category>
            <dc:creator><![CDATA[ওয়াসী (Wasi)]]></dc:creator>
            <pubDate>Thu, 05 Oct 2017 16:00:22 GMT</pubDate>
            <atom:updated>2019-07-11T08:34:00.323Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gjCld-Z7O1hF6V2OnI51TA.jpeg" /><figcaption>Making a Stand Alone Executable from a Python Script using PyInstaller</figcaption></figure><p>This article is also available in English. Please, <a href="https://wasi0013.com/2017/10/03/making-a-stand-alone-executable-from-a-python-script-using-pyinstaller/"><strong>click here</strong></a><strong> </strong>to read the English version.</p><p><a href="https://www.python.org/">পাইথন</a> স্ক্রিপ্টকে <a href="https://en.wikipedia.org/wiki/Executable">এক্সিকিউটেবলে</a> রূপান্তর করার অনেক গুলো উপায় রয়েছে। উদাহরণ স্বরূপ নিচের মডিউলগুলো চেক করুন:</p><ul><li><a href="http://www.pyinstaller.org/">PyInstaller</a></li><li><a href="https://pypi.python.org/pypi/py2exe/0.9.2.0">py2exe</a></li></ul><p>পাইথন ২ স্ক্রিপ্ট এর জন্যে আমি py2exe ব্যবহার করতাম। ছোটখাটো স্ক্রিপ্টকে খুব সহজেই এক্সিকিউটেবল এ কনভার্ট করার জন্যে খুবই কার্যকরী একটি টুল এটা। কিন্তু একটাই সমস্যা, এটা শুধু পাইথন ২ সাপোর্ট করতো! তাই, আমি পাইইন্সটলার এ সুইচ করি। যদিও, py2exe এখন পাইথন ৩ সাপোর্ট করা শুরু করেছে, py2exe নিয়ে আরেকটি আর্টিকেল লেখার ইচ্ছে আছে তবে সেটি আরেকদিন।</p><p>এই আর্টিকেলটি পাইন্সটলারের জন্যেই নিবেদিত। অসাধারণ এটুলটি স্পেশালি উইন্ডোজ ইউজারদের জন্যে খুবই কাজের, কারণ একটি কমান্ড ব্যবহার করে খুব সহজেই স্ক্রিপ্টকে exe তে রূপান্তর করা যায়! যদিও আমি লিনাক্স ব্যবহার করতে পছন্দ করি, আমাকে প্রায়শঃই উইন্ডোজ ইউজার এর জন্যে exe ফাইল তৈরী করতে হয়েছে বিভিন্ন উইন্ডোজ ভার্সন এর জন্যে(ক্লায়েন্ট রিকোয়ারমেন্ট)</p><p>চলুন তবে, আর দেরী না করে স্ক্রিপ্টকে এক্সিকিউটেবল বানানোর প্রসেসটা জেনে নিই।</p><h3>ইন্সটলেশন:</h3><p><a href="http://www.python.org/downloads">পাইথন</a> আর পিপ ইন্সটল করা থাকলে শুধু নিচের কমান্ড দিলেই হবে!</p><pre>pip install pyinstaller</pre><p>নোটঃ<strong> </strong>আপনি উইন্ডোজ ব্যবহারকারী হলে আপনাকে হয়তো <strong>PyWin32</strong> ও ইন্সটল করতে হবে! এখানে ক্লিক করে ডাউনলোড করে নিতে পারেন: <a href="https://sourceforge.net/projects/pywin32/files/">https://sourceforge.net/projects/pywin32/files/</a></p><p>এছাড়াও, অন্য কোন সাহায্য লাগলে অবশ্যই পাইন্সটলারের ডকুমেন্টেশন দেখতে পারেন: <a href="https://pyinstaller.readthedocs.io/en/stable/installation.html">https://pyinstaller.readthedocs.io/en/stable/installation.html</a></p><p>যদি পিপ ছাড়া অন্য কোন প্যাকেজ ম্যানেজার ব্যবহার করেন যেমন ধরেন কোন্ডা<strong> </strong>(<a href="https://anaconda.org/">Anaconda</a> এর জন্যে) tতাহলে আপনাকে নিচের কমান্ডগুলো ব্যবহার করতে হবেঃ</p><pre>conda install -c conda-forge pyinstaller<br>conda install -c anaconda pywin32</pre><p>বিস্তারিত জানতে আপনার প্যাকেজ ম্যানেজার এর ডকুমেন্টেশান দেখুন।</p><h3>এক্সিকিউটেবল বানানো:</h3><p>ইন্সটলেশন তো হলো, এবার আপনি যে স্ক্রিপ্টকে এক্সিকিউটেবল বানাতে চাচ্ছেন সেটাকে খুঁজে বের করুন। শুধু যে ফোল্ডারে স্ক্রিপ্টটা আছে সে ফোল্ডারে গিয়ে কমান্ড প্রম্পট বা টার্মিনাল ওপেন করলেই হবে। পাইথন স্ক্রিপ্ট ঠিকভাবে কাজ করে কি না সেটা একবার চেক করে দেখুন।</p><pre>python your_script.py</pre><p>আপনার স্ক্রিপ্ট সঠিকভাবে কাজ করে কি না তা আগে নিশ্চিত হোন। এরপরে, নিচের কমান্ডটি ব্যবহার করুন। আমি এই কমান্ড সাধারণত বেশী ব্যবহার করিঃ</p><pre>pyinstaller --onefile &lt;your_script_name&gt;.py</pre><p>কমান্ড রান হওয়া শেষ হলে dist ফোল্ডার চেক করুন। চিন্তার কোন কারণ নেই, এই ফোল্ডারটি আপনাকে তৈরী করে দিতে হবে না, নিজে থেকেই তৈরী হয়ে যাবে উপরের কমান্ড রান করলেই!</p><p>লক্ষ্য করুন, আমরা একটি আর্গুমেন্ট পাস্ করেছি “— onefile”. এই আর্গুমেন্ট এর জন্যেই পাইন্সটলার সরাসরি একটি ফাইল তৈরী করেছে। এই কমান্ড পাস্ না করলে, আপনার স্ক্রিপ্ট যে লাইব্রেরি গুলো ব্যবহার করে, পাইন্সটলার সেগুলোর জন্যে আলাদা ফোল্ডার তৈরী করবে।</p><p><strong>দ্রষ্টব্যঃ </strong>এক্সিকিউটেবলের ফরম্যাট/ এক্সটেনশন আপনি কোন প্ল্যাটফর্মে কমান্ড রান করেছে সেটার উপর নির্ভর করে। অর্থাৎ, আপনি যদি উইন্ডোজে এই কমান্ড রান করেন, তাহলে পাবেন .exe লিনাক্স এ রান করলে ফাইল এক্সটেনশন ডিস্ট্রো এর উপর নির্ভর করে পরিবর্তিত হয়ে যাবে।</p><blockquote>আপনি শুধুমাত্র যে অপারেটিং সিস্টেম এ কমান্ড রান করবেন সেটার এক্সিকিউটেবল পাবেন। অর্থাৎ উইন্ডোজ করলে উইন্ডোজের বা, লিনাক্স এ করলে শুধুই লিনাক্সের!</blockquote><p>উদাহরণ দিয়ে বলতে গেলে, লিনাক্স এ পাইন্সটলার কমান্ড সরাসরি ব্যবহার করে উইন্ডোজ এক্সিকিউটেবল (exe) পাওয়া সম্ভব না। অথবা, উল্টোভাবে বলা হলে, উইন্ডোজ ব্যবহার করে লিনাক্স এর জন্যে এক্সিকিউটেবল বানাতে পারবেন না।(যদি কোন উপায় জানা থাকে তবে নিচে কমেন্ট করুন)</p><p>এসব ক্ষেত্রে যেটা করতে পারেন তা হলো Virtualbox অথবা ওইধরনের কিছু সফটওয়ার ব্যবহার করে ভার্চুয়ালি অপারেটিং সিস্টেম রান করে ঐ ভার্চুয়াল অপারেটিং সিস্টেমে এক্সিকিউটেবল বানিয়ে তা পরবর্তীতে এক্সপোর্ট করে নিতে পারেন। লিনাক্সে ওয়াইনও ব্যবহার করা যেতে পারে (যদিও আমি কখনো এটা ব্যবহার করি নি)</p><p>আপনার পাইথন স্ক্রিপ্ট যদি এক্সট্রা কোন এক্সিকিউটেবল বা, ফাইলের উপর ডিপেন্ড করে, যেমনঃ ফ্যান্টম জেএস অথবা, ক্রোমড্রাইভার সে ক্ষেত্রে ঐ ফাইলগুলোকেও পাইন্সটলারের তৈরি করা এক্সিকিউটেবলের সাথে একই ফোল্ডারে রাখতে হবে।</p><p>এধরণের ডিপেন্ডেন্সী গুলোর জন্যে উইন্ডোজ প্ল্যাটফর্মের ক্ষেত্রে আমি <a href="http://nsis.sourceforge.net/Main_Page">NSIS</a> দিয়ে সব প্রয়োজনীয় ফাইলগুলোকে একসাথে প্যাকেজ করে দিতে পছন্দ করি। কিভাবে প্যাকেজ করতে হবে, এর ধাপগুলো নিচে দেয়া হলো (ধরে নিচ্ছি NSIS ইন্সটল করা আছে):</p><ul><li>এক্সিকিউটেবল, ডিপেন্ডেন্সি, রিড মি ইত্যাদি যাবতীয় ফাইলগুলো নিয়ে একটি জিপ ফাইল তৈরী করুন</li><li>এবার NSIS রান করুন</li><li>‘make installer from zip archive’ এ ক্লিক করুন</li><li>জিপ ফাইলটি সিলেক্ট করুন</li><li>একটি নাম লিখে এক্সিকিউটেবল(Installer.exe/Setup.exe) বানিয়ে নিন</li></ul><p>যে এক্সিকিউটেবলটি পাবেন সেটা একটা এক্সট্রাক্টর, যেটা দরকারী সব ফাইলগুলোকে একটি ফোল্ডার এ এক্সট্র্যাক্ট করবে। অসাধারণ!</p><h3>মূল্যবান লিংকসমূহ:</h3><ul><li><a href="https://stackoverflow.com/questions/5458048/how-to-make-a-python-script-standalone-executable-to-run-without-any-dependency">স্ট্যাক ওভারফ্লো এর উত্তর</a></li><li><a href="https://github.com/pyinstaller/pyinstaller">সোর্স কোড</a></li><li><a href="https://github.com/pyinstaller/pyinstaller/wiki/Supported-Packages">PyInstaller যে প্যাকেজ গুলো সাপোর্ট করে</a></li><li><a href="http://www.py2exe.org/index.cgi/Tutorial">py2exe অফিশিয়াল টিউটোরিয়াল</a></li><li><a href="https://www.reddit.com/r/Python/comments/74mdnl/making_a_stand_alone_executable_from_a_python/">এই আর্টিকেল সম্পর্কিত reddit এ আলোচনা</a></li></ul><h3>Author:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*PQf0dLR2X7uN4MT8d0ZN6A.png" /><figcaption>Wasi Mohammed Abdullah</figcaption></figure><p>Thinker, Day Dreamer, Python Enthusiast, Javascript Admirer An Introvert with Exception!</p><p><em>CEO, Founder <br></em><a href="https://www.dreamcatcherit.com/"><strong>Dreamcatcher IT</strong></a><strong> </strong><br>twitter: <a href="http://twitter.com/wasi0013"><em>twitter.com/wasi0013</em></a><em><br>github: </em><a href="http://github.com/wasi0013"><em>github.com/wasi0013</em></a><em><br></em>facebook: <a href="http://fb.me/wasi0013"><em>fb.me/wasi0013</em></a></p><p><em>Please, feel free to </em><a href="http://wasi0013.com/contact/"><em>contact</em></a><em> me if you need any help.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1df9170e263" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dreamcatcher-its-blog/making-an-stand-alone-executable-from-a-python-script-using-pyinstaller-d1df9170e263">Making a Stand Alone Executable from a Python Script using PyInstaller</a> was originally published in <a href="https://medium.com/dreamcatcher-its-blog">Dreamcatcher IT’s Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Byte Sized Hacks: Xubuntu Desktop Disappearance]]></title>
            <link>https://medium.com/@wasi0013/quick-fix-xubuntu-desktop-disappearance-d5b47de5e460?source=rss-bdc85827d951------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5b47de5e460</guid>
            <category><![CDATA[disappearances]]></category>
            <category><![CDATA[desktop]]></category>
            <category><![CDATA[quickfix]]></category>
            <category><![CDATA[byte-sized-hacks]]></category>
            <category><![CDATA[xubuntu]]></category>
            <dc:creator><![CDATA[ওয়াসী (Wasi)]]></dc:creator>
            <pubDate>Sat, 08 Jul 2017 09:01:21 GMT</pubDate>
            <atom:updated>2017-12-28T11:43:15.798Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Problem Description: </strong>I don’t know how but, all my desktop icons and files disappeared. Also, the desktop became non-clickable. Rebooting didn’t fix it. The files were accessible via nautilus / File Manager.</p><p><strong>Solution:</strong> I tried many things and failed. Then my intuition started to tingle and say something is wrong with the cache… So I thought of deleting the cache. Removing the desktop sessions stored in the <strong>.cache </strong>of my home folder and then logging out of the system I logged in and it worked like a charm!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5b47de5e460" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Byte Sized Hacks: Set Screen Brightness from Terminal using xbacklight(Ubuntu 16.04 LTS)]]></title>
            <link>https://medium.com/@wasi0013/set-screen-brightness-from-terminal-using-xbacklight-ubuntu-16-04-lts-657cd91cc38e?source=rss-bdc85827d951------2</link>
            <guid isPermaLink="false">https://medium.com/p/657cd91cc38e</guid>
            <category><![CDATA[xbacklight]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[brightness]]></category>
            <category><![CDATA[byte-sized-hacks]]></category>
            <category><![CDATA[terminal]]></category>
            <dc:creator><![CDATA[ওয়াসী (Wasi)]]></dc:creator>
            <pubDate>Fri, 09 Jun 2017 19:28:16 GMT</pubDate>
            <atom:updated>2017-12-28T11:44:12.791Z</atom:updated>
            <content:encoded><![CDATA[<p>Found a pretty neat solution for changing screen brightness from terminal. Just open up, your terminal (ctrl+alt+t) and then type</p><blockquote>xbacklight -set 100</blockquote><p>It will set your screen brightness to 100%. You can set any value ranging from <strong>0</strong> to <strong>100</strong>. If you don’t have <a href="https://wiki.archlinux.org/index.php/backlight#xbacklight">xbacklight</a> package pre-installed then fetch it using the apt:</p><blockquote>sudo apt update<br>sudo apt install xbacklight</blockquote><p>There you go! Now you can use xbacklight from terminal. Simple! isn’t it?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kNPOdawz2pwKTGULZcmznw.png" /><figcaption>Change Screen Brightness using xbacklight from terminal (Ubuntu 16.04 LTS)</figcaption></figure><p><strong><em>Note: </em></strong><em>I have tested it on Ubuntu 16.04 LTS. But, it should work on other Linux distributions as well. Also, don’t hesitate to suggest/comment other ways to change brightness that you prefer(if there any) !</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=657cd91cc38e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>