<?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[TechCrush - Medium]]></title>
        <description><![CDATA[TechCrush is an online publication on medium platform that publish articles related to technology. We intend to give out both the basic noob stuff and advanced geek stuff. Because everything is Tech. - Medium]]></description>
        <link>https://medium.com/techcrush?source=rss----567ad9d0d381---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>TechCrush - Medium</title>
            <link>https://medium.com/techcrush?source=rss----567ad9d0d381---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 04:16:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/techcrush" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The love for AMD CPUs and Budget]]></title>
            <link>https://medium.com/techcrush/the-love-for-amd-cpus-and-budget-99372ebf60b6?source=rss----567ad9d0d381---4</link>
            <guid isPermaLink="false">https://medium.com/p/99372ebf60b6</guid>
            <category><![CDATA[pc]]></category>
            <category><![CDATA[laptop]]></category>
            <category><![CDATA[amd]]></category>
            <category><![CDATA[cpu]]></category>
            <dc:creator><![CDATA[acrophobic pilot]]></dc:creator>
            <pubDate>Thu, 28 May 2020 05:03:51 GMT</pubDate>
            <atom:updated>2020-05-25T19:18:52.484Z</atom:updated>
            <content:encoded><![CDATA[<p>AMD<em> you better pay me for this.</em></p><p>Let’s go way back. Definitely not the Big Bang or The Origin, but to somewhat much closer. 2006 or 2007. The times when I played Cricket ’07, GTA Vice City or something. I remember, dad bringing a new box. I was used to seeing components inside the cabinet by that time, there were already plenty in that small room where we kept our PC. A new processor and motherboard, and this thing was new, for a kid who’s heard of only Intel’s Pentium series, AMD was a new one. “Which is this local thing?”, any kid who’s not seen a Marlon Brando act before and minutes before the performance would react the same way. Maybe that was too harsh. Everybody knows Brando. Dulquer Salmaan? Nevermind.<br>So, the old Pentium 4 (or rather, dead) was removed, the motherboard removed, and here comes the bomb. The <strong>AMD Athlon</strong>. I don’t remember which one. I was 7, come on.</p><p>The San Andreas which worked like an Amal Neerad movie till last week,(last movie reference, I swear), now worked like a charm. Butter smooth.</p><p>That went for like few years until 2011. The old one died, or sold? I don’t remember correctly. But this time, we bought an <strong>AMD Phenom II X6 1055T!</strong> Yes, I remember the exact name and number. I mean look at that. The name itself is, a thing. Now compare the Intel names, i3, core2duo, yuck!<br>So why we bought an AMD instead of intel? Well, comparing to other processor at big that time, AMD was much cheaper. I wasn’t much into games either. So, with a Nvidea Geforce 9400 GT and an AMD Phenom II, I was in heaven already. Moderate performance, enough for me to play games in high graphics, the PC worked like a dream. About the heat, yes. AMD heats like the sun, I’m gonna agree. Damn, the thermal paste vaporing up was a big deal. But, but, but, but we, being an average, Indian, middle class family and the nearest computer market being 30–40km away, we adjusted using tooth paste, with mint ;). Oh you guys do that too? <em>Highfive</em>.</p><p>Fast forward again, to my first laptop. 2016. The shopkeeper showed me these beautiful Laptop with intel i5, and stuffs, and me with a limited budget asked for the lower end models. He showed me i3s. Then came a beauty. A good old <strong>AMD A8 7410</strong>. That was the first mistake I made, but later I changed my mind. This badass right here, I swear, I used Adobe Premiere and Adobe Audition side by side on this. The best hours of my good old laptop. I’m sure with an independent graphics, it would’ve been the bomb, but … yeah, it was great</p><p>Now, I have this laptop. With a freakin <strong>Ryzen 5 3550</strong>, and I know it lies somewhere between i5 8th gen and i5 9th gen, but that is all I want. I won’t say the best performance, but there’s nothing to complain either. Unlike said words, this one doesn’t heat much. Also calm and composed, even I had doubts if this one really is an AMD. It was never about the CPUs, I mean it is, but not just that, I have an independent graphics card, RX 560X, and an SSD and the laptop is smooth AF.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/0*JZG-9R6qTkT0BWYV.jpg" /></figure><p>All I wanna say is, there are much wider options in the market. Better and cheaper ones. Just, do a thorough check and buy the best suited for you.</p><p><em>Cheers!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99372ebf60b6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techcrush/the-love-for-amd-cpus-and-budget-99372ebf60b6">The love for AMD CPUs and Budget</a> was originally published in <a href="https://medium.com/techcrush">TechCrush</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[UnderLine — Just the Essentials]]></title>
            <link>https://medium.com/techcrush/underline-just-the-essentials-3dfab6c7cc24?source=rss----567ad9d0d381---4</link>
            <guid isPermaLink="false">https://medium.com/p/3dfab6c7cc24</guid>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[news-apps]]></category>
            <category><![CDATA[news-aggregator]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[jaseem CK]]></dc:creator>
            <pubDate>Thu, 21 May 2020 13:01:21 GMT</pubDate>
            <atom:updated>2020-05-21T13:00:52.034Z</atom:updated>
            <content:encoded><![CDATA[<h3>UnderLine — Just the Essentials</h3><h4>News Aggregator</h4><p>#The_incomplete_projects</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gJb2-ZmROUBMXk-xLR26xQ.png" /></figure><p><strong>News aggregator</strong>, online platform or <a href="https://www.britannica.com/technology/software">software</a> device that collects news stories and other information as that information is published and organizes the information in a specific manner. This is accomplished in several ways. Some aggregators are <a href="https://www.merriam-webster.com/dictionary/curated">curated</a> by people to whom certain types of information is of particular import and others use <a href="https://www.britannica.com/technology/HTML">HTML</a> (hypertext mark-up language) coding on the websites of news-gathering organizations to create <a href="https://www.britannica.com/technology/RSS">RSS</a> (really simple syndication) feeds and other public notifications of instant updates to news content regarding a specific subject.</p><p>There are a number of News aggregator available for free and it has been most useful in these recent days. As a matter of fact people are turning in to digital news platforms than the tradition newspapers. This gives them real time news which is available real fast within some hours of the actual event happens. The coming years will see more of these coming.</p><p>This is a small attempt to create such a web application which uses an API to fetch top headlines. As the name suggest it just gives the headline and a brief description of the news. Nothing more, nothing less.</p><p>Things that can come handy in the project are:</p><ul><li>newsapi API</li><li>APIClient in python</li><li>Flask app</li><li>Heroku app</li></ul><h4>newsapi API</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*G6O0kLM2LyEFR25gpjt6fw.png" /></figure><p>News API is a simple HTTP REST API for searching and retrieving live articles from all over the web. It can help you answer questions like:</p><ul><li>What top stories is the NY Times running right now?</li><li>What new articles were published about the next iPhone today?</li><li>Has my company or product been mentioned or reviewed by any blogs recently?</li></ul><p>You can search for articles with any combination of the following criteria:</p><ul><li><strong>Keyword or phrase</strong>. Eg: find all articles containing the word ‘Microsoft’.</li><li><strong>Date published</strong>. Eg: find all articles published yesterday.</li><li><strong>Source name</strong>. Eg: find all articles by ‘TechCrunch’.</li><li><strong>Source domain name</strong>. Eg: find all articles published on nytimes.com.</li><li><strong>Language</strong>. Eg: find all articles written in English.</li></ul><p>You can sort the results in the following orders:</p><ul><li>Date published</li><li>Relevancy to search keyword</li><li>Popularity of source</li></ul><p>The Python client library can be used to integrate News API into your Python application.</p><p>To install: $ pip install newsapi-python</p><pre>from newsapi import NewsApiClient<br><br># Init<br>newsapi = NewsApiClient(api_key=&#39;API_KEY&#39;)<br><br># /v2/top-headlines<br>top_headlines = newsapi.get_top_headlines(q=&#39;bitcoin&#39;,<br>                                          sources=&#39;bbc-news,the-verge&#39;,<br>                                          category=&#39;business&#39;,<br>                                          language=&#39;en&#39;,<br>                                          country=&#39;us&#39;)<br><br># /v2/everything<br>all_articles = newsapi.get_everything(q=&#39;bitcoin&#39;,<br>                                      sources=&#39;bbc-news,the-verge&#39;,<br>                                      domains=&#39;bbc.co.uk,techcrunch.com&#39;,<br>                                      from_param=&#39;2017-12-01&#39;,<br>                                      to=&#39;2017-12-12&#39;,<br>                                      language=&#39;en&#39;,<br>                                      sort_by=&#39;relevancy&#39;,<br>                                      page=2)<br><br># /v2/sources<br>sources = newsapi.get_sources()</pre><p>This will fetch the titles, description, image, url etc. from the source. This can be used to display in a webpage we make. This project uses the flask app for this.</p><h4>Flask APP</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*XHsLGfB4I7cMLgvu_DWMJw.jpeg" /></figure><p>Check out these tutorial blogs to learn how to build a flask app:</p><ul><li><a href="https://medium.com/techcrush/how-to-render-html-file-in-flask-3fbfb16b47f6">How to render HTML file in Flask</a></li><li><a href="https://medium.com/techcrush/how-to-deploy-your-ml-model-in-jupyter-notebook-to-your-flask-app-d1c4933b29b5">How to deploy your ML model in Jupyter Notebook to your Flask App?</a></li></ul><p>The main.py of the project initialize the api configuration and fetch the required details.</p><pre>from flask import Flask, render_template<br>from newsapi import NewsApiClient</pre><pre>app = Flask(__name__)</pre><pre><a href="http://twitter.com/app">@app</a>.route(&quot;/&quot;)<br>def homepage():<br>    newsapi = NewsApiClient(api_key=&quot;APIKEY&quot;)<br>    topheadlines = newsapi.get_top_headlines(language=&#39;en&#39;)<br>    articles = topheadlines[&#39;articles&#39;]<br>    desc=[]<br>    news=[]<br>    for i in range(len(articles)):<br>        myarticles = articles[i]<br>        news.append(myarticles[&#39;title&#39;])<br>        desc.append(myarticles[&#39;description&#39;])<br>    mylist = zip(news,desc)<br>    return render_template(&#39;index.html&#39;,context=mylist)</pre><p>Then we can use these in the index.html page:</p><pre>&lt;div class=&quot;row&quot;&gt;<br>    {% for new, des in context %}<br>    &lt;div class=&quot;col&quot;&gt;<br>            &lt;h3 class=&quot;card-title strong&quot;&gt;{{new}}&lt;/h3&gt;<br>            &lt;p class=&quot;card-text&quot;&gt;{{des}}&lt;/p&gt;<br>        &lt;/div&gt;<br>    &lt;/div&gt;<br>    &lt;/div&gt;<br>    {% endfor %}<br>&lt;/div&gt;</pre><p>Play around with API and create different routes for each tags you wish include in the site.</p><h4>Deploy in Heroku</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M1QgLDmU6YD4rBTfijpiYA.png" /></figure><p>The flask app can be deployed in heroku. First you would need a heroku account which is free. You can deploy a number of applications of a limited size with heroku for free. Check <a href="https://devcenter.heroku.com/articles/getting-started-with-python">Heroku</a> and start hosting your applications.</p><p>Go through the below blog to deploy a flask app:</p><p><a href="https://medium.com/the-andela-way/deploying-a-python-flask-app-to-heroku-41250bda27d0">Deploying a Python Flask app on Heroku</a></p><p>News aggregator are getting popular in recent years and it is natural to get curious about how those works. This can give you a brief description of the entire function if not the entire picture.</p><p>The source code for the project is available in <a href="https://github.com/Jaseemck/UnderLine">github</a>. The web application is deployed in heroku and is available in <a href="https://underline-news.herokuapp.com/">UnderLine-news</a>.</p><p>#Keep_Coding!Keep_Innovating</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3dfab6c7cc24" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techcrush/underline-just-the-essentials-3dfab6c7cc24">UnderLine — Just the Essentials</a> was originally published in <a href="https://medium.com/techcrush">TechCrush</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Developer Jaathakam]]></title>
            <link>https://medium.com/techcrush/developer-jaathakam-3a771c919f33?source=rss----567ad9d0d381---4</link>
            <guid isPermaLink="false">https://medium.com/p/3a771c919f33</guid>
            <category><![CDATA[netlify]]></category>
            <category><![CDATA[vanillajs]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[jaseem CK]]></dc:creator>
            <pubDate>Wed, 20 May 2020 10:39:54 GMT</pubDate>
            <atom:updated>2020-05-20T10:17:43.697Z</atom:updated>
            <content:encoded><![CDATA[<h4>And this has nothing to do with horoscope🤗</h4><p>#The_incomplete_projects</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JqoK6DQhQaTSwhq0LNvOAw.png" /></figure><p>Developer Jaathakam is a simple github profile comparison application. A rating is generated for all the profiles based on their repos, stars, forks, etc. The technologies used to build this application are:</p><ul><li>Vanilla Javascript</li><li>Bootstrap css</li><li>Github API</li><li>Netlify</li></ul><h4>Vanilla Javascript</h4><p>VanillaJS is a name to refer to using <strong>plain JavaScript without any additional libraries</strong> like jQuery. People use it as a joke to remind other developers that many things can be done nowadays without the need for additional JavaScript libraries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*XQVxUPPhxIcvx_sw-gaKhQ.png" /></figure><h4>Bootstrap CSS</h4><p><strong>Bootstrap</strong> is a free and open-source <strong>CSS</strong> framework directed at responsive, mobile-first front-end web development. It contains <strong>CSS</strong>- and (optionally) JavaScript-based design templates for typography, forms, buttons, navigation, and other interface components. In this project only the css capability of bootstrap is used. But it is very powerful and can make website designing way more easier. We can either embed the CDN or download and use the files. The minimized css file is used in this project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*TJT7z7w3baYO0ON-6RbaYA.png" /></figure><h4>GitHub API</h4><p>The GitHub API can be used to fetch the details of GitHub users and their activities. This API is used to compare the profiles of given users and to rate them. They are compared and their similarity is represented by a number in the range of 1 to 10, 10 being the most similar and 1 being not much similarity. The measures or attributes used for comparison are:</p><ul><li>Number of Repos</li><li>Number of Followers</li><li>Number of Followings</li><li>Number of Stars</li><li>Number of Forks</li></ul><p>This can be extended to give a more reliable and efficient ranking and scoring for each profile. It is possible to fetch a lot of other attributes too. The complete capability of the API is not used in the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kzBNcw1ay3anpA1rCR31kQ.png" /></figure><h4>Netlify</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/275/1*aKqhW-71CaMCUB2Rjg-8Eg.png" /></figure><p><strong>Netlify</strong> is an all-in-one platform for automating modern web projects. Replace your hosting infrastructure, continuous integration, and deployment pipeline with a single workflow. Integrate dynamic functionality like serverless functions, user authentication, and form handling as your projects grow. It is pretty easy to host your static website using github or gitlab or bitbucket and netlify. These are free for limited services. It is an ideal hosting platform for your hobby projects.</p><p>The most exciting part of this project is playing around with the Github API. Github is like a social platform for all the developers and the status of the github profile is a big deal for all of us. There are a plenty of attributes that can be used with API. It can be used for a number of purposes. Check the <a href="https://developer.github.com/v3/">documentation</a> and get started right away.</p><p>The source code for the project is available in <a href="https://github.com/Jaseemck/Developer_Jaathakam">github</a>. The web application is deployed in netlify and is available in <a href="https://silly-roentgen-e39060.netlify.app/">Developer_Jaathakam</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a771c919f33" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techcrush/developer-jaathakam-3a771c919f33">Developer Jaathakam</a> was originally published in <a href="https://medium.com/techcrush">TechCrush</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#The_incomplete_projects]]></title>
            <link>https://medium.com/techcrush/the-incomplete-projects-792b12eabaaa?source=rss----567ad9d0d381---4</link>
            <guid isPermaLink="false">https://medium.com/p/792b12eabaaa</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[recommendations]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[flask]]></category>
            <dc:creator><![CDATA[jaseem CK]]></dc:creator>
            <pubDate>Wed, 20 May 2020 00:12:28 GMT</pubDate>
            <atom:updated>2020-05-20T00:12:10.766Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Build a Movie Recommendation System Using Content Filtering Method</h3><h4>Count Vectorization | Cosine Similarity | Flask | Heroku</h4><p>#The_incomplete_projects</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8y9sCjaxFmAzEiVEzw3YoQ.jpeg" /></figure><p>In this article we will go through a number of questions and eventually build a recommendation system resolving those:</p><ul><li>What is a recommendation system?</li><li>What are the methods used for movie recommendations?</li><li>Which data set can be used for modeling the recommendation system?</li><li>What are the Techniques used in Content based Recommendation System?</li><li>How to use those methods to implement the recommendation system?</li><li>How to convert these into a website?</li><li>Where can I host the application?</li></ul><h4>What is a recommendation system? What are the methods used for movie recommendations?</h4><p><em>A </em><strong><em>recommender system</em></strong><em> or a </em><strong><em>recommendation system</em></strong><em> is a subclass of information filtering system that seeks to predict the “rating” or “preference” a user would give to an item. In other words, we can say, “</em>a recommendation system suggest anything relevant based on the used interest<em>”</em></p><p>There are usually two methods used for movie recommendations:</p><ul><li>Content Based recommendation</li><li>Collaborative filtering recommendation</li></ul><p>The idea behind <strong>Content-based (cognitive filtering) </strong>recommendation system is to recommend an item based on a comparison between the content of the items and a user profile. In simple words,I may get recommendation for a movie based on the description of other movies. Like movies of same directors, actors, plots or genre.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*RPnLOhju1hBS5YM3xqpavQ.png" /></figure><p>The theory behind collaborative filtering to work with collaboration with user or movie id.For example, there are two user <strong>A </strong>and <strong>B, user A </strong>likes movie <strong><em>P</em></strong>,<strong>Q,R,S</strong> and <strong>user B </strong>like movies <strong>Q,R,S</strong>,<strong><em>T</em></strong>. Since movies Q, R and S are similar to both user, therefore, movie P will be recommended to user B and movie T will be recommended to used A.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/353/1*22kdAU2c-Tr4YAq0SMzxxg.png" /></figure><p>In this project, we are using the content based method. That is using the descriptions of the previous movies, we will recommend similar movies to the user.</p><h4>Which Dataset can be used for modeling the recommendation system?</h4><p>There are a number of datasets on movies available in many open websites. Some of the datasets are:</p><ul><li><a href="https://www.kaggle.com/rounakbanik/the-movies-dataset">Movie Dataset</a></li><li><a href="https://grouplens.org/datasets/movielens/">Movie Lens</a></li><li><a href="https://www.imdb.com/interfaces/">IMDB Dataset</a></li><li><a href="https://www.kaggle.com/netflix-inc/netflix-prize-data">Netflix Prize Dataset</a></li><li><a href="https://www.kaggle.com/tmdb/tmdb-movie-metadata">tmdb Movie Metadata</a></li></ul><p>In this project we are using <a href="https://www.kaggle.com/tmdb/tmdb-movie-metadata">tmdb_movie_metadata</a> dataset. It gives the title and description of 5000 movies. It is a good place to start.</p><h4>What are the Techniques used in Content based Recommendation System?</h4><p>Two concepts that we should know in order to implement content based recommendation systems are:</p><ul><li>Count Vectorizer</li><li>Cosine Similarity</li></ul><p>Count Vectorization involves counting the number of occurrences each words appears in a document (i.e distinct text such as an article, book, even a paragraph!). Python’s Sci-kit learn library has a tool called <a href="https://scikit-learn.org/stable/modules/generated/sklearn.feature_extraction.text.CountVectorizer.html">CountVectorizer</a> to accomplish this.</p><p><a href="https://www.machinelearningplus.com/nlp/cosine-similarity/">Cosine similarity</a> is a metric used to measure how similar the documents are irrespective of their size. Mathematically, it measures the cosine of the angle between two vectors projected in a multi-dimensional space. The cosine similarity is advantageous because even if the two similar documents are far apart by the Euclidean distance (due to the size of the document), chances are they may still be oriented closer together. The smaller the angle, higher the cosine similarity<em>.</em></p><h4>How to use those methods to implement the recommendation system?</h4><pre>def get_recommendations(title):<br>    cosine_sim = cosine_similarity(count_matrix, count_matrix)<br>    idx = indices[title]<br>    sim_scores = list(enumerate(cosine_sim[idx]))<br>    sim_scores = sorted(sim_scores, key=lambda x: x[1], reverse=True)<br>    sim_scores = sim_scores[1:11]<br>    movie_indices = [i[0] for i in sim_scores]<br>    tit = df2[&#39;title&#39;].iloc[movie_indices]<br>    dat = df2[&#39;release_date&#39;].iloc[movie_indices]<br>    return_df = pd.DataFrame(columns=[&#39;Title&#39;,&#39;Year&#39;,&#39;Plot&#39;,&#39;Ratings&#39;,&#39;Genre&#39;])<br>    return_df[&#39;Title&#39;]=tit<br>    return_df[&#39;Year&#39;]=dat<br>    plo = []<br>    gen = []<br>    rat = []<br>    for i in tit:<br>        movie = GetMovie(title=i, api_key=&#39;c938d4f0&#39;)<br>        mov = movie.get_data(&#39;Genre&#39;,&#39;Ratings&#39;,&#39;Plot&#39;)<br>        plo.append(mov[&#39;Plot&#39;])<br>        rat.append(mov[&#39;Ratings&#39;][0][&#39;Value&#39;])<br>        gen.append(mov[&#39;Genre&#39;])<br>    return_df[&#39;Plot&#39;]=plo<br>    return_df[&#39;Ratings&#39;]=rat<br>    return_df[&#39;Genre&#39;]=gen<br>    return return_df</pre><p>We are using the title of movie given by the user to find similar movies based on it’s descriptions. Then we make a dataframe to store all the alikes in one datastructure. This dataframe is returned in every input of the user and later used to display the results.</p><p>In this I have also used the <a href="http://www.omdbapi.com/">omdbapi</a> API to fetch the plot, genre and ratings of the recommended movies. Check the <a href="http://www.omdbapi.com/">API</a> documentation for more.</p><h4>How to convert these into a website?</h4><p>We can use the Flask app to execute this. This framework is ideal for small projects like these.</p><pre><em>import flask<br>app = flask.Flask(__name__, template_folder=’templates’)<br># Set up the main route<br>@app.route(‘/’, methods=[‘GET’, ‘POST’])def main():<br>    if flask.request.method == ‘GET’:<br>        return(flask.render_template(‘index.html’))</em></pre><p>Check out my previous write-ups on flask implementation. This can help you from writing your first code in flask to implementing a ML model in the app.</p><ul><li><a href="https://medium.com/techcrush/hello-world-in-flask-2f868349f55a">Hello World in Flask</a></li><li><a href="https://medium.com/techcrush/how-to-deploy-your-ml-model-in-jupyter-notebook-to-your-flask-app-d1c4933b29b5">How to deploy your ML model in Jupyter Notebook to your Flask App?</a></li></ul><h4>Where can I host the application?</h4><p>The flask app can be deployed in heroku. First you would need a heroku account which is free. You can deploy a number of applications of a limited size with heroku for free. Get started with <a href="https://devcenter.heroku.com/articles/getting-started-with-python">Heroku</a> right away.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IIzoS4IWfIksE2yGhsugXw.jpeg" /></figure><p>The collaborative filtering method is a better option and is preferred more these days. The content based recommendation is more like a naive approach. But it of course can do the task and at times will be more helpful as it suggests the movies only like the movies you have already watched and won’t depend on the behavior of other users. It has it’s pros and cons.</p><p>The source code for the project is available in <a href="https://github.com/Jaseemck/suggest-a-movie">github</a>. The web application is deployed in heroku and is available in <a href="https://suggest-movie-for-me.herokuapp.com/">suggest-a-movie</a>.</p><p>#keep Coding</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=792b12eabaaa" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techcrush/the-incomplete-projects-792b12eabaaa">#The_incomplete_projects</a> was originally published in <a href="https://medium.com/techcrush">TechCrush</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to deploy your ML model in Jupyter Notebook to your Flask App?]]></title>
            <link>https://medium.com/techcrush/how-to-deploy-your-ml-model-in-jupyter-notebook-to-your-flask-app-d1c4933b29b5?source=rss----567ad9d0d381---4</link>
            <guid isPermaLink="false">https://medium.com/p/d1c4933b29b5</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[jaseem CK]]></dc:creator>
            <pubDate>Mon, 27 Apr 2020 13:52:49 GMT</pubDate>
            <atom:updated>2020-04-27T13:52:25.550Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to make a naive Machine learning model in your Jupyter Notebook or Colab and deploy it to a Flask app to build a web application?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*XHsLGfB4I7cMLgvu_DWMJw.jpeg" /></figure><p>As beginners in ML or Data science, we would have gone through a number of projects or Kaggle competitions. The environment most of us would have used might be Jupyter notebook or colab. I always use colab for my ML projects due to many of it’s advantages over local environments. There’s a time when we look forward to implement these solutions or model as an application. It is not difficult as many of us think. This articles walks through how to make a naive ML model on Iris dataset and deploy it in flask app. If you don’t know about flask app or how to render an HTML file in flask, then you should probably visit my previous articles in the series.</p><ul><li><a href="https://medium.com/techcrush/hello-world-in-flask-2f868349f55a">Hello World in Flask</a></li><li><a href="https://medium.com/techcrush/how-to-render-html-file-in-flask-3fbfb16b47f6">How to render HTML file in Flask</a></li><li><a href="https://medium.com/techcrush/style-the-web-app-with-flask-3788ee3873d6">Style the Web App with Flask</a></li></ul><blockquote>First, we have to make an ML model using the Iris data. Download the dataset from <a href="https://www.kaggle.com/uciml/iris">kaggle</a>.</blockquote><p>You can either use Jupyter notebook in your local system or colab in the browser. Load the dataset to the notebook.</p><p>I assume that you know how to do prediction in this dataset. We can use many algorithms to do this task such as logistic regression, KNN, decision tree, SVM etc. I have used the KNN classifier for modeling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yGfIDKe0Lqp37a2SMhoN9w.jpeg" /><figcaption>Importing Iris dataset in colab</figcaption></figure><p>But how can we actually bring the model or result attained at the notebook in local system or colab to the flask environment. That’s where Pickle comes.</p><p>Serializing is a way to write a python object on the disk that can be transferred anywhere and later de-serialized (read) back by a python script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/373/0*J3snU4VNxVxm-WuP.png" /></figure><p>We can convert the model which is in the form of a python object into a character stream using pickling. The idea is that this character stream contains all the information necessary to reconstruct the object in another python script.</p><pre>import pickle</pre><pre>filename=&#39;model.pkl&#39;</pre><pre>pickle.dump(knn, open(filename, &#39;wb&#39;)</pre><p>Now, we have to create a directory for the project. Then create a file app.py, where we will be doing our python script, a folder named ‘templates’, in which we create a file named index.html.</p><blockquote>We have to take the <strong>model.pkl</strong> file that we got from the notebook output to the project directory so that we can use that. Then, in the <strong>app.py</strong> file insert these code.</blockquote><pre>import os<br>import pandas as pd <br>import numpy as np <br>import flask<br>import pickle<br>from flask import Flask, render_template, request</pre><pre>app=Flask(__name__)</pre><pre><a href="http://twitter.com/app">@app</a>.route(‘/’)<br>def index():<br> return flask.render_template(‘index.html’)</pre><pre>def ValuePredictor(to_predict_list):<br> to_predict = np.array(to_predict_list).reshape(1,4)<br> loaded_model = pickle.load(open(“model.pkl”,”rb”))<br> result = loaded_model.predict(to_predict)<br> return result[0]</pre><pre><a href="http://twitter.com/app">@app</a>.route(‘/predict’,methods = [‘POST’])<br>def result():<br> if request.method == ‘POST’:<br> to_predict_list = request.form.to_dict()<br> to_predict_list=list(to_predict_list.values())<br> to_predict_list = list(map(float, to_predict_list))<br> result = ValuePredictor(to_predict_list)<br> prediction = str(result)<br> return render_template(“predict.html”,prediction=prediction)</pre><pre>if __name__ == “__main__”:<br> app.run(debug=True)</pre><p>In the index file, we will have to give a form to input the sepal and petal length and width for the model to classify it into type of Iris. We are using the <strong>POST</strong> method for this. As you can see in the <strong>/predict</strong> route, we are collecting all the form values. So we get all the features for predicting the Iris type. In the <strong>ValuePredictor</strong> function, we reshape the features to suit the model. We then load the pickle file, <strong>model.pkl</strong> and use that to predict the Iris type from the input features. The predicted string is returned to the route and given to the html file, <strong>predict.html</strong>.</p><blockquote>The below code is to be inserted in the index.html</blockquote><pre>&lt;html&gt;<br>&lt;body&gt;<br>    &lt;h3&gt;Iris Species Classification&lt;/h3&gt;</pre><pre>&lt;div&gt;<br>  &lt;form action=&quot;/predict&quot; method=&quot;POST&quot;&gt;<br>    &lt;label for=&quot;seplen&quot;&gt;Sepal Length&lt;/label&gt;<br>    &lt;input type=&quot;number&quot; step=&quot;0.01&quot; id=&quot;seplen&quot; name=&quot;seplen&quot;&gt;<br>    &lt;br&gt;<br>    &lt;label for=&quot;sepwid&quot;&gt;Sepal Width&lt;/label&gt;<br>    &lt;input type=&quot;number&quot; step=&quot;0.01&quot; id=&quot;sepwid&quot; name=&quot;sepwid&quot;&gt;<br>    &lt;br&gt;<br>    &lt;label for=&quot;petlen&quot;&gt;Petal Length&lt;/label&gt;<br>    &lt;input type=&quot;number&quot; step=&quot;0.01&quot; id=&quot;petlen&quot; name=&quot;petlen&quot;&gt;<br>    &lt;br&gt;<br>    &lt;label for=&quot;petwid&quot;&gt;Petal Width&lt;/label&gt;<br>    &lt;input type=&quot;number&quot; step=&quot;0.01&quot; id=&quot;petwid&quot; name=&quot;petwid&quot;&gt;<br>    &lt;br&gt;<br>    &lt;input type=&quot;submit&quot; value=&quot;Submit&quot;&gt;<br>  &lt;/form&gt;<br>&lt;/div&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><blockquote>Create another file named, <strong>predict.html</strong> in the <strong>templates</strong> folder</blockquote><pre>&lt;!doctype html&gt;<br>&lt;html&gt;<br>   &lt;body&gt;<br>       &lt;h1&gt; {{ prediction }}&lt;/h1&gt;<br>   &lt;/body&gt;<br>&lt;/html&gt;</pre><blockquote>Now we can check out how the result look like. Type the commands in the terminal.</blockquote><pre>python app.py</pre><blockquote>The result will be as follows:</blockquote><pre>* Serving Flask app “app” (lazy loading)<br> * Environment: production<br> WARNING: This is a development server. Do not use it in a production deployment.<br> Use a production WSGI server instead.<br> * Debug mode: on<br> * Running on <a href="http://127.0.0.1:5000/">http://127.0.0.1:5000/</a> (Press CTRL+C to quit)<br> * Restarting with stat<br> * Debugger is active!<br> * Debugger PIN: 162–328–040</pre><blockquote>Now open the browser. The index page appears. Now fill the form with the input features and click submit.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xTXiXlDOzk-CdJsUIqKOFg.jpeg" /><figcaption>Index Page</figcaption></figure><blockquote>As we click submit button, we will be redirected to the predict.html page and the classification result will be displayed in the page. Revisit the ValuePredictor function to get a clear picture.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cPMSut4xfhmrehYfSLk1eg.jpeg" /><figcaption>Result Page</figcaption></figure><p>We have successfully deployed a ML classifier in the Flask app. Now try out with different datasets and algorithms. This was a simple classifier and it can get a little complicated as things change. So make sure you explore all kinds.</p><p>#Keep calm Keep coding</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1c4933b29b5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techcrush/how-to-deploy-your-ml-model-in-jupyter-notebook-to-your-flask-app-d1c4933b29b5">How to deploy your ML model in Jupyter Notebook to your Flask App?</a> was originally published in <a href="https://medium.com/techcrush">TechCrush</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From a “mouse guy” to a “keyboard guy” -Part I]]></title>
            <link>https://medium.com/techcrush/from-a-mouse-guy-to-a-keyboard-guy-part-i-e00cf2a9e3e2?source=rss----567ad9d0d381---4</link>
            <guid isPermaLink="false">https://medium.com/p/e00cf2a9e3e2</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[mouse-to-keyboard]]></category>
            <category><![CDATA[terminal-commands]]></category>
            <category><![CDATA[keyboard-shortcuts]]></category>
            <category><![CDATA[keyboards-for-developers]]></category>
            <dc:creator><![CDATA[Allen K Abraham]]></dc:creator>
            <pubDate>Mon, 27 Apr 2020 05:32:39 GMT</pubDate>
            <atom:updated>2020-04-27T05:32:39.883Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>If you are still a ‘keyboard person’ in the 21st century, you most probably will be a programmer.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/275/1*lVSK1rJMhmHfm3airXqZuA.jpeg" /><figcaption><strong>Mouse developed by Douglas Engelbart.</strong></figcaption></figure><p>In 1970 Douglas Engelbart brought the concept of the computer mouse and in 1973 it was first displayed to the general public. It took 10 years for this device to be popular and become part of our everyday life. In 1983 the Apple Lisa Computer was released with a mouse attached to it. This brought out a revolution in the world of computers. Later trackpads, touchpads and I would say the concept of the touchscreen will not be existing till now if the mouse weren’t invented even there won’t be any smartphones that we are using today. The mouse had brought luxury to human civilization. We cannot imagine even a single system without a pointer these days.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*kZLeWHsFXBCTCEXi6OSbTw.jpeg" /></figure><p>We are unaware of the working of a computer as we are living in a high-level language world. The concept of abstraction is being applied in everything we could imagine in this world. There was a time when the users need to write a few lines of code to open an application. Even to play a computer game we need to hard code it, the BASIC Language users would have experienced this in their life. At that time every storybook had a Basic language code printed on it so that the users could play games related to that story.</p><p>To get that feeling of the older days computer users had, we need not use those age-old systems. Instead, that feeling could be experienced in the Linux operating systems. Although it doesn’t reach those days’ experience, it’s reasonable. The popular operating system nowadays is the Windows operating system. I would call those users the proprietary people. Although Windows care very much about UI and UX, it had increased the distance between the computer and the humans. Whereas Linux, although it looks boring sometimes, it won’t cause any crack in the relation between humans and computers.</p><p>I would like to compare the above difference with an example of a guy who is new to web development. In windows what he will be doing is that he will watch all tutorials and he will make his system ready for web development. First, he will be creating an HTML file then right-click on it and choose Open with the IDE and start coding the page. Now coming to a Linux user, not everyone will be doing it but the majority of them will be, they will open the terminal then ‘cd’ to the respective directory the command to open the ide&lt;space&gt; ‘.’ the IDE opens then he makes the webpage. He will be having more like a Hollywood hacker kind of feeling the first time he does it (Under a condition he switched from Windows to Linux).</p><p>The usage of Terminal is so fantastic that it could not be expressed by a user. Even to check the network connection the user will use ‘ping google.com’ rather than opening a browser and typing google.com and searching.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*DfiEebuT6S4YbjkxuoEyhg.jpeg" /></figure><p>By reading this, many of you must have guessed what I’m up to. Some of you may be thinking that I’m up for a Linux v/s Windows article. Some of you may be having no idea. So I’m up to convey that using a keyboard is much better than using a mouse. Still, you may be thinking “How the hell is this possible?”, I can explain, it doesn’t matter whether your OS in Windows of Linux. So lets drill down.</p><p>As I mentioned before check the internet instead of going to the browser we may use ping google.com, opening a terminal takes less time as compared to opening a browser. Here a point goes to Keyboard.</p><p>Next, you will be thinking that to open a terminal we need a mouse, we don’t need a mouse. In the Linux system usually on pressing Ctrl+Alt+T a terminal opens. In window just press Window Key + R and type cmd and Enter. Its that simple. Here again, the keyboard wins.</p><p>To open an application consider opening the Visual Studio Code. Normally we will be going to start menu, search for it, and then click, this is fine. Using a terminal we just type ‘code’ and press Enter, the editor opens. This says that every application could be opened using Terminal. Again the keyboard wins.</p><p>As of now, there could be a doubt, How will we know the commands for each application. The solution is to use it daily. Some of you may be saying that using a mouse will be better as we don’t need to remember anything, that shows the laziness hidden inside you. Due to this problem, a point goes to the mouse.</p><p>Now the score is 3–1. This is the end of part 1. In the next part, I intend to discuss fast keyboard alternatives for our day to day tasks using a mouse. For now, I am applying my brakes. By the time, you can check out which all tasks could be replaced using a keyboard.</p><h3>️Peace Out ✌️</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e00cf2a9e3e2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techcrush/from-a-mouse-guy-to-a-keyboard-guy-part-i-e00cf2a9e3e2">From a “mouse guy” to a “keyboard guy” -Part I</a> was originally published in <a href="https://medium.com/techcrush">TechCrush</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ask Musk]]></title>
            <link>https://medium.com/techcrush/ask-musk-1b50539041e9?source=rss----567ad9d0d381---4</link>
            <guid isPermaLink="false">https://medium.com/p/1b50539041e9</guid>
            <category><![CDATA[spacex]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[elon-musk]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[tesla]]></category>
            <dc:creator><![CDATA[jaseem CK]]></dc:creator>
            <pubDate>Sat, 25 Apr 2020 07:03:16 GMT</pubDate>
            <atom:updated>2020-04-25T07:02:51.034Z</atom:updated>
            <content:encoded><![CDATA[<h4>Highlights from the AMA session with Elon Musk by HackClub</h4><p>*This is not what it is, this is what I think it is 😜*</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q3Pz2cF6nw8eZ5zl90hdNA.jpeg" /></figure><p>It was half-past one in the morning when I forced myself to sit in front of the blurred screen of my 5-year-old laptop. The last time I was awake this early, Croatia just lost to France in the FIFA world cup final. And there I was, one year later, to meet my superhero- Elon Musk. I thought it would be best to start with an introduction to who Elon Musk is, but then I decided that if you don’t know who Elon Musk is, you don’t deserve to read my blog. And before I start, let me convey my gratitude to the team of Hack club for providing this opportunity for millions of deities to meet their God. A huge shoutout to the founder of Hack club- Zach (I hope you remember the photo I took with you) 😊. It started kind of slow- had to wait a bit to get the first glimpse of Elon. And as he appeared on the screen, he was messing with his hair. There he was- Elon Musk. Apart from the frequent glitches on the screen, it was as if he was with me there. The conversations were a bit unclear, but I was fine with it, as long as I can see his lips move. However, here are some of the stuff I have taken home from this one hour Youtube live.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*noZgzZRX7wMAxoySoTxbdQ.jpeg" /></figure><p>It was Zach, who started off the program with an introduction. The way he proudly proclaimed that he dropped out of school in ninth grade, made me want to revisit my childhood and fail my matriculation test. Elon must have been impressed, but it didn’t show on his face. The AMA session was hosted by a 17-year-old nerd in glasses(no offense) 🤗.</p><p>Theo was the one who posed the first question; his opinion on cryonics. Elon pointed out that the brain is physical and that it is spontaneously amazing but less mysterious than we think. His words reflected that there is a lot of scope in the field and that the maze of the brain can be solved.</p><p>Another interesting question came up next, about his first hack. Elon showcases one of his classic giggles and responded that revealing a lot might get him into trouble. But he said that he started with school-related hacks, like the lab computers, library and so on…<br>One other interesting thing that I noticed was that the average age of the group was probably 17 or 18, and that too with Zach to pull up the weights. So, this question seemed relevant to me- “What role would high schoolers play in the future-tech?”. Elon went back to his roots, told us about the time he was into video games, and how he was inspired to do it for the rest of his life. He further advocated the need to do the things that we are interested in- work, that doesn’t feel like work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/230/1*DSxEG7_dxBeuH9DeHAbnrA.jpeg" /></figure><p>Another question arose from the imagination of Jacob, who asked Elon if the world was a simulation, what would be the cheat code?</p><p>Elon: Find out other civilizations, maybe in planets far away, understand more about the universe. For all questions, the universe is the answer.</p><p>The next query was something that I wanted to ask him myself: “You said you are not that much into advertisements. But you are still a popular figure, what is your take on public representation of making things?”. His answer was as simple as ‘believe in yourselves and try out more ideas”.</p><p>He was then posed the question of the big C- capitalism. Elon said he believed in capitalism with certain rules and limits. He further redefined the government as ‘a corporate with a limit, having a monopoly over something.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YbgHJgiIQkg0-LdSEs1bGw.jpeg" /></figure><p>The host interrupted the session and asked the participants to speed up a notch as the allotted time was almost up. But Elon assured them that he was willing to stay a little longer if they’re OK with it.</p><p>Next was a fun question by Jamsheer, “recently, a song you wrote and performed became trending in the community. Do you have a plan for another and if yes, when is it dropping out?” A reddish shade splashed on Elon’s face as he responded, “It wasn’t planned. It happened while I was working on something. And it was my girlfriend who recorded it first. Then we gradually made it out into production. That is how it happened.” He giggled for the next 40 seconds- classic Elon!</p><p>He later explained how he transformed himself from time to time to suit the different contexts he gets involved in. He frequently had to switch between SpaceX, Tesla, Neurolink, and his personal life.<br>After about 30 minutes into the program, Zach took the center stage again. Zach: “Tabs or space?”</p><p>Elon: “I use both. But when coding fast, I prefer to use the former.” The answer was followed by a big boo from Zach as he was more of a ‘space’ person.</p><p>Zach: Emacs or VIM? Elon: “I usually adhere to the basic text editors. I believe that we should put more effort into compilers, it should catch memory leaks”.</p><p>Zach took things a bit more to the fantasy realm with his next question: “ Say, when you were called into this meeting, instead of getting into google meet, you found yourself teleported into 500 BC, where you are the dictator of the world. And there are 3 identical worlds- one in which you are in (500 BC), one in 2020, and the other 2500 years from now. These three worlds are about to go for a war, of which only one survives. What would you do to ensure the victory of your world?”</p><p>Elon: “ Seems like a video game. Well, I would try to increase the rate at which technology develops- possibly to the fastest phase possible”. The conversation between the two was surely something to watch. As they discussed the importance of bringing people together to work on problems, Elon said: “ It is important that we set a common goal for people so that they can work in harmony. And it is equally important that we have some fun along the way”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QRLT1BihXi4BqjRLG-ng_g.jpeg" /></figure><p>The recent memes with Elon and his Tesla cyber truck were popular even among people with no knowledge about Tesla or Elon. The next bullet was shot by Melody: “What was going on in your mind when Cyber truck window shattered” Elon: “It was quite shocking. It was all working during practice. And I was startled when it didn’t then. However, it turned out to be good, as it got a lot of attention”.</p><p>The next question was, “How do you know if AI has gone too far, and what would be your solution if AI took over?” Elon: “There is a possibility that AI be used with bad intentions. And there are AI designed with this exact goal, which might lead to a global crisis. But we can counter such uprisings by effectively using AI, by detecting such potential threats and eradicating them when they are young and vulnerable”. <br>The final question of the AMA session came next, “You have your hands in a lot of ventures. How do you communicate your visions and ideas with your team?”</p><p>Elon: “There is always a big gap between the idea that one comes up with initially and it’s the most ideal form. The goal is to make this idea less wrong each day. And everyone has to follow this approach. It is often said that we shouldn’t question the experts. But I believe it is wrong. What matters is the logic behind the questions, not the status of the person it is posed to. Everyone is wrong sometimes.” With this, the session came to an end. Elon Musk emphasized that he don’t deceive others by his praise and that he was impressed with the team. <br>If you got this far, a big shout out to your patience. Gratitude to the team at HackClub, HackClub India, and my neighbor who helped me stay awake throughout the session. I apologize in advance if there are any errors in the transcription. I blame it on my normal lifestyle- Going to bed at 10 and getting up at 7. I hope there comes a day when I can converse with Elon Musk offline, face to face 😎.</p><p>If you want to watch the session, go to <a href="https://www.youtube.com/watch?v=riru9OzScwk&amp;feature=youtu.be">https://www.youtube.com/watch?v=riru9OzScwk&amp;feature=youtu.be</a></p><p>If you want to know more about hackclub, go to their website. <a href="https://hackclub.com/">https://hackclub.com</a></p><p>credits: <a href="https://medium.com/@jzlckclt">JZL</a> (editor), HackClub and the IST😅</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b50539041e9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techcrush/ask-musk-1b50539041e9">Ask Musk</a> was originally published in <a href="https://medium.com/techcrush">TechCrush</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Style the Web App with Flask]]></title>
            <link>https://medium.com/techcrush/style-the-web-app-with-flask-3788ee3873d6?source=rss----567ad9d0d381---4</link>
            <guid isPermaLink="false">https://medium.com/p/3788ee3873d6</guid>
            <category><![CDATA[js]]></category>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[jaseem CK]]></dc:creator>
            <pubDate>Tue, 21 Apr 2020 08:03:09 GMT</pubDate>
            <atom:updated>2020-04-21T08:02:46.769Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*O0S2-UBv_Y1RRgHgRkg1yQ.png" /></figure><p>This article will get you started with styling and formatting in the flask app. If you have no clue about what flask is or how to use it, go through my previous articles. If you want brush up the basics and learn how to render a html page in flask app, just click the below links.</p><ul><li><a href="https://medium.com/techcrush/hello-world-in-flask-2f868349f55a">Hello World in Flask</a></li><li><a href="https://medium.com/techcrush/how-to-render-html-file-in-flask-3fbfb16b47f6">How to render HTML file in Flask</a></li></ul><p>Now, since you brushed your basics, let’s get deeper. What if you want to format the content or embed an image in the web app. Returning a string is not what we need and certainly not so cool. So in this article, we will learn how to render static files such as css files, js files and images in a HTML template.</p><p>A web page always consists of some formatting, design and images and hence the static files are important in web development. In conventional web development, it is easy to attach these files to the HTML. But it is a little different in Python. Python’s Flask Framework provides an special method “<strong>url_for()</strong>” for rendering all of these things in our HTML Templates.</p><blockquote>First we have to create a folder in the project directory named “static”. Now we have to make a file “style.css” and insert some styling for the contents. In the usual method we usually attach this css file in html page as follows:</blockquote><pre>&lt;link rel=&quot;stylesheet&quot; href=&quot;/static/style.css&quot;&gt;</pre><blockquote>But in Flask framework we have to attach this file as below. The link tag can be embedded anywhere but preferably in the head section of the html file.</blockquote><pre>&lt;link rel=&quot;stylesheet&quot; href=&quot;{{ url_for(&#39;static&#39;, filename= style.css&#39;) }}&quot;&gt;</pre><blockquote>In <strong>href</strong> attribute of the code, we use <strong>url_for()</strong> provided by flask framework, in this function we passed ‘<strong>static</strong>’ as first argument which tells the flask that this would be an static file and then passed ‘<strong>filename</strong>’ as second argument and assigns the <strong>filename.extension_of_file </strong>to it. Then, we put all this stuff in this special curly braces “<strong>{{ }}</strong>” and will just print the full path to our html file.</blockquote><blockquote>Similarly, we can attach an image into the web page. Let’s assume that we have a picture named “<strong>home.jpg</strong>” in the static folder. Now we have to embed the below code in the target html file to display the image.</blockquote><pre>&lt;img src=&quot;{{ url_for(&#39;static&#39;, filename=&#39;home.jpg&#39; ) }}&quot; alt=&quot;TechCrunch&quot;&gt;</pre><p>Now that you know, how to render a html file in flask framework and how to attach the static files in it, you can build any static web pages you want with python Flask. But if you want to just make a static web page, you perhaps don’t had to do all this. You could have done it effortlessly using other methods. But what you exactly need is how to build a api or an ML app with flask. Fed up with basics let’s get straight to it…🙌🏻</p><p>Seat belts on…🏎</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3788ee3873d6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techcrush/style-the-web-app-with-flask-3788ee3873d6">Style the Web App with Flask</a> was originally published in <a href="https://medium.com/techcrush">TechCrush</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to render HTML file in Flask]]></title>
            <link>https://medium.com/techcrush/how-to-render-html-file-in-flask-3fbfb16b47f6?source=rss----567ad9d0d381---4</link>
            <guid isPermaLink="false">https://medium.com/p/3fbfb16b47f6</guid>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[jaseem CK]]></dc:creator>
            <pubDate>Tue, 21 Apr 2020 07:29:56 GMT</pubDate>
            <atom:updated>2020-04-20T02:34:46.955Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*3mPLMG0NEkPd8bWVXizndQ.png" /></figure><p>In <a href="https://medium.com/techcrush/hello-world-in-flask-2f868349f55a">last tutorial,</a> we get to know how to run a simple flask app. If you haven’t read those, please go through that and then come back. Let’s leap a little forward. What if we want it to really look like a website, and not just returning random strings. I assume you have the basic knowledge in html. Hypertext Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser. So, let’s learn how to make a HTML template in the flask app.</p><blockquote>First, create a new folder in the project directory called <strong>templates</strong>. This naming is important. Now create a new file in the templates folder naming <strong>“index.html”</strong>. Then insert the below code in the file.</blockquote><pre>&lt;html&gt;<br>&lt;head&gt;<br>&lt;title&gt;Flask Tutorial&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>&lt;h1&gt;This is the Index page&lt;/h1&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;  </pre><blockquote>Now, create another file named <strong>app.py </strong>in the project directory. Then write these codes in to the python file.</blockquote><pre>from flask import Flask, render_template<br>app = Flask(__name__)<br><br>@app.route(&#39;/&#39;)<br>def home():<br>   return render_template(&#39;index.html&#39;)<br>if __name__ == &#39;__main__&#39;:<br>   app.run()</pre><blockquote>In this file, we are actually importing <strong>render_template</strong> function provided by the Flask and then rendering our HTML template, index.html in the home route. Now it is all set to execute. Type python3 app.py in the terminal to run the app.</blockquote><p>If everything went well, it will say Running on <a href="http://127.0.0.1:5000//">http://127.0.0.1:5000//</a><strong> . </strong>Now we can paste this link in the browser and see the displayed html content. The output will be as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g6pGLb5gxGMtArt22tOjGQ.png" /></figure><p>Now that you have learned how to render an html page in flask, you can display any static web pages you want in the flask app. One question that you might have is how to use css, js and images in the web pages. Stay tuned and until then keep routing 😜</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fbfb16b47f6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techcrush/how-to-render-html-file-in-flask-3fbfb16b47f6">How to render HTML file in Flask</a> was originally published in <a href="https://medium.com/techcrush">TechCrush</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hello World in Flask]]></title>
            <link>https://medium.com/techcrush/hello-world-in-flask-2f868349f55a?source=rss----567ad9d0d381---4</link>
            <guid isPermaLink="false">https://medium.com/p/2f868349f55a</guid>
            <category><![CDATA[flask-restful]]></category>
            <category><![CDATA[hello-world]]></category>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[jaseem CK]]></dc:creator>
            <pubDate>Sun, 19 Apr 2020 11:23:49 GMT</pubDate>
            <atom:updated>2020-04-19T11:22:58.491Z</atom:updated>
            <content:encoded><![CDATA[<p>Flask is a micro web framework written in Python. We use Python extensively for ML projects and data analytics. Many a times, we would have thought of displaying or publishing it in the internet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*3mPLMG0NEkPd8bWVXizndQ.png" /><figcaption>Flask Framework</figcaption></figure><p>There are many ways to achieve this. There’s a number of frameworks and libraries for web development in Python. Django, Flask, CherryPy, web2py, bottle etc. are some examples. Django and Flask are the most popular and easy frameworks for web development. Flask provides simplicity, flexibility and <em>fine-grained control</em>. If you are looking to build a final product for the market, then django is more preferred. But if you want try out something fast, or make a Rest API, then flask is your thing.</p><p>This would be a series of blogs to help you deploy Machine Learning models in flask app but not just that. We can either turn it into an API or rather use it as a web application. This article will discuss the bare minimum you require to start the flask journey. Hop on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q0oTC8t21Sj6ZEgsv0QC6A.png" /></figure><p>Whatever the language is, or the framework is, starting with the traditional Hello World is somewhat mandatory. It has a long and inspiring back story to tell and I think all the Hello world programs are tributes to those brilliant efforts. Apart from that it can also be used as a sanity test to make sure that a computer language is correctly installed, and that the operator understands how to use it. So back to Flask :)</p><blockquote>First you will have to install Flask in your system. This can easily be done by using pip. Depending on how your pip is set up, the command can change.</blockquote><p>pip3 install flask</p><blockquote>After installing the flask, now you have to make a file named <em>hello.py</em> in a directory. Once you create the file, insert the below code in the file.</blockquote><pre>from flask import Flask</pre><pre>app = Flask(__name__)</pre><pre>@app.route(&quot;/&quot;)<br>def hello():<br>  return &quot;Hello World!&quot;<br>  <br>if __name__ == &quot;__main__&quot;:<br>  app.run()</pre><ul><li>The first line imports Flask</li><li>Second line initializes a variable app, using the __name__ attribute</li><li>In the next line, the @app.route is a Python decorator. It takes the function directly below it and modifies it. In this case, we use this to route traffic from a specific URL to the function directly below. Using different @app.route calls, we can &#39;trigger&#39; different parts of the code when the user visits different parts of our application. In this code, we used a single route /, which is the default &quot;root&quot; of our application.</li><li>In line four, the function hello will be called automatically.</li><li>In the very next line, the string “Hello World!” is returned to our user. We can render a template or return HTML here so that users will see a nicely formatted page, but returning a Python string works fine too.</li><li>The if condition is normal Python boilerplate to make sure we don’t run anything automatically if our code is imported by another Python script.</li><li>The final line calls the run() method of the app. This starts the development server for Flask and allows us to visit our web application from our local machine by visiting the localhost.</li></ul><blockquote>Now, we can run the python script. Type this command in the terminal.</blockquote><p>python3 hello.py</p><blockquote>The output will be as follows(hopefully) :</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*PEcBEIl6G_SAtgoLzTCiQQ.jpeg" /><figcaption>Terminal Output</figcaption></figure><blockquote>Now we can check out the localhost to see the magic. It is displayed in the terminal where it is running. By default the port will be 5000, but we can change that using the port parameter. You can stop the server by pressing CTRL+C in the terminal. If everything goes well, this will be the final result.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WXiwvBMTn9pbRTR0534Hig.jpeg" /><figcaption>Final Output</figcaption></figure><p>Tada…We just run Hello World program in flask. There’s a long way to go, but so far so good. Play around with routes and functions. The next tutorial will be up soon.</p><p>#Keep calm Keep coding</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f868349f55a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techcrush/hello-world-in-flask-2f868349f55a">Hello World in Flask</a> was originally published in <a href="https://medium.com/techcrush">TechCrush</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>