<?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 Blessing Adesiji on Medium]]></title>
        <description><![CDATA[Stories by Blessing Adesiji on Medium]]></description>
        <link>https://medium.com/@blessingadesiji?source=rss-d16dc6797dcb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*kezjgazVx4MbZef5DQ_WcA.jpeg</url>
            <title>Stories by Blessing Adesiji on Medium</title>
            <link>https://medium.com/@blessingadesiji?source=rss-d16dc6797dcb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 00:04:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@blessingadesiji/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 I Fixed My Magic Keyboard Bluetooth Connection Issue — And You Can Too]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://blessingadesiji.medium.com/how-i-fixed-my-magic-keyboard-bluetooth-connection-issue-and-you-can-too-5561df5aaa73?source=rss-d16dc6797dcb------2"><img src="https://cdn-images-1.medium.com/max/2600/1*axUmWTpLQFtKpoFAsggNjg.jpeg" width="6000"></a></p><p class="medium-feed-snippet">In this article, you will learn a clear, step-by-step guide to resolving connection issues with Apple&#x2019;s Magic Keyboard, Mouse, and&#x2026;</p><p class="medium-feed-link"><a href="https://blessingadesiji.medium.com/how-i-fixed-my-magic-keyboard-bluetooth-connection-issue-and-you-can-too-5561df5aaa73?source=rss-d16dc6797dcb------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://blessingadesiji.medium.com/how-i-fixed-my-magic-keyboard-bluetooth-connection-issue-and-you-can-too-5561df5aaa73?source=rss-d16dc6797dcb------2</link>
            <guid isPermaLink="false">https://medium.com/p/5561df5aaa73</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[keyboard]]></category>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Blessing Adesiji]]></dc:creator>
            <pubDate>Mon, 10 Jul 2023 23:08:31 GMT</pubDate>
            <atom:updated>2023-07-10T23:08:31.209Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Automating Document Processing for a Healthcare Use Case with AWS Textract & Comprehend Medical]]></title>
            <link>https://medium.com/mantium/automating-document-processing-for-a-health-care-use-case-with-aws-textract-comprehend-medical-c96a7565c8cd?source=rss-d16dc6797dcb------2</link>
            <guid isPermaLink="false">https://medium.com/p/c96a7565c8cd</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[document-processing]]></category>
            <category><![CDATA[insurance]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Blessing Adesiji]]></dc:creator>
            <pubDate>Mon, 12 Sep 2022 18:09:48 GMT</pubDate>
            <atom:updated>2022-09-12T19:35:48.555Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1faUYfuv8ztCfGqZZPPzEA.jpeg" /></figure><p>Protecting Extracted Health Information with AWS Textract &amp; Comprehend</p><h3>Introduction</h3><p>In this article, we will learn how to automate document processing workflows to achieve compliance obligations with sensitive health care information. Aside from compliance obligations, protecting health information allows the data to be used for other applications without the risk of private information leaking.</p><p>This tutorial shows how to mask personal health information(PHI) in clinical notes using AWS ML &amp; AI services. The process involves extracting text information from a clinical notes image file to a text file with Amazon Textract and saving the text into a file or S3 bucket. After this, we will perform named-entity recognition (NER) using Amazon Comprehend Medical API and mask the medical entities.</p><p>Note that this tutorial shows a quick proof-of-concept for learning purposes, and additional work may be required for your specific uses.</p><p>If you need help with Intelligent document processing for healthcare, financial, insurance, and mortgage use cases, <strong>Mantium can help you deploy an enterprise-ready solution; </strong><a href="https://mantiumai.com/lp/apn-linkedin-ad/"><strong>click here to find out more.</strong></a></p><p>Or you can <a href="https://discord.gg/SscDru7dFB">join us on Discord</a>; we’d be happy to answer your questions and help you in your building process.</p><h3>Prerequisites</h3><ul><li>AWS account</li><li>Python programming knowledge</li><li>Experience using Jupyter notebooks</li></ul><h3>Set Up your AWS Environment</h3><p>To write and run our code, we will use a Jupyter notebook. Follow the steps below to set up the S3 and Notebook instances.</p><h3>Create an S3 Bucket and Folder</h3><p>We need an S3 bucket to hold the raw documents and store the processed text documents. To create an S3 bucket, navigate to the S3 Console (you can search for S3 services) and click on Create Bucket.</p><p>Add a bucket name of choice, select an AWS Region, and create a bucket by accepting the remaining default settings.</p><p>If you name your bucket with <em>SageMaker, </em><em>sagemaker or </em><em>Sagemaker</em> will not need you to create an IAM role in the following step, and you can proceed to attach policies to your notebook instance. <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/howitworks-create-ws.html">Link</a></p><p>After creating the bucket, navigate to the bucket page, click the Create folder button to create a folder, provide the folder name, and accept default options.</p><h3>Create an IAM policy for your SageMaker Notebook to read from your new S3 bucket</h3><p>If you did NOT name your s3 bucket using “Sagemaker,” as described above, then you need to create a new IAM role to attach in the next step.</p><ol><li>Go to the IAM console screen, then proceed to “Policies”</li><li>Choose ‘create policy’</li><li>Choose any name and description for the policy you want, but remember, for the next step, “Create an Amazon SageMaker Jupyter Notebook Instance.” We will call it “MyNoteBookS3Policy” below</li><li>Paste the following policy in as JSON</li><li>Review and Save</li></ol><pre>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [{<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Action&quot;: [<br>        &quot;s3:GetBucketCors&quot;,<br>        &quot;s3:ListBucket&quot;,<br>        &quot;s3:PutBucketCors&quot;<br>      ],<br>      &quot;Resource&quot;: [&quot;arn:aws:s3:::mynewbucket&quot;]<br>    },<br>    {<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Action&quot;: [<br>        &quot;s3:AbortMultipartUpload&quot;,<br>        &quot;s3:DeleteObject&quot;,<br>        &quot;s3:GetObject&quot;,<br>        &quot;s3:PutObject&quot;<br>      ],<br>      &quot;Resource&quot;: [&quot;arn:aws:s3:::mynewbucket/*&quot;]<br>    }<br>  ]<br>}</pre><h3>Create an Amazon SageMaker Jupyter Notebook Instance</h3><p>Navigate to the SageMaker management console; on the left side, click on NotebookAnd click on Notebook instances. On the page, click the Create notebook instance button in the top right corner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sWRTCN2gM-0VOVJqBwWx4w.png" /></figure><p>On the next page, provide a name for your notebook instance, and select a suitable instance type(An AWS Free Tier is okay). In the IAM Role, you can create a new IAM Role or use an existing role.</p><p>Complete the creation steps by accepting the remaining default settings.</p><h3>Attach Policies to Notebook Instance</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A9iyyDYucrKFr-N9S0svtw.png" /></figure><p>On the Notebook Instance page, click on the instance you just created. Navigate to the Permissions and Encryption page, and click on the IAM role ARN.</p><p>On the Add Permissions dropdown, click on Attach Policies. After this, search for Textract in the search bar, and select the policy options to access all Amazon Textract APIs.</p><p>We need to repeat the above for the following policies; ComprehendFullAccess , ComprehendMedicalFullAccess, AmazonTextractFullAccess and MyNoteBookS3Policy if created. Click on the Attach Policies button when you are done.</p><p>Now that you’ve set up your AWS Environment Let’s write some code.</p><h3>Code</h3><h3>Notebook Setup &amp; Files</h3><p>Navigate to the Notebook Instance page, and click on either Open Jupyter or Open JupyterLab</p><p>Here is the image file that we will work with in this tutorial; it is an image file of an example clinical note (for educational purposes).</p><p>Download and upload <a href="https://static.mantiumai.com/demos/health_notes.png">this file</a> to your Notebook.</p><h3>Import Libraries</h3><p>We will use several libraries in this tutorial, so let’s import them. Then, you can copy the code below to your code cell.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4b55dd7d3c7d32c7dd35a83527c2efc7/href">https://medium.com/media/4b55dd7d3c7d32c7dd35a83527c2efc7/href</a></iframe><h3>Create a Session &amp; S3 Setup Bucket Path</h3><p>A session stores the configuration state and allows you to create service clients and resources. The code snippet below allows us to create a state and bucket path.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4ffb14ca6996c7490fa38c4775ca207d/href">https://medium.com/media/4ffb14ca6996c7490fa38c4775ca207d/href</a></iframe><h3>Create a Client</h3><p>Here we will create a client by using the service name, which is textract, then pass the region name, and endpoint_url parameters.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/52e92d8ad916142db9b77248891c5219/href">https://medium.com/media/52e92d8ad916142db9b77248891c5219/href</a></iframe><h3>Load the Image File</h3><p>The following code snippet reads the image file and converts it to encoded bytes. We are converting to encoded bytes because the DetectDocumentText API expects the document as base64-encoded bytes or an Amazon S3 Object.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/57c8e24b5e5e077a851af9b6ef785b99/href">https://medium.com/media/57c8e24b5e5e077a851af9b6ef785b99/href</a></iframe><h3>Detect Document</h3><p>The DetectDocumentText API detects text in the input document and returns the detected text in an array of Block objects.</p><p>Note that using the DetectDocumentText is a synchronous operation.</p><p>The following code snippet shows how to use the API to detect the text in the input document and generate a response of Block objects.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ed4aca49137eae070e15082d7ed0a693/href">https://medium.com/media/ed4aca49137eae070e15082d7ed0a693/href</a></iframe><h3>Textract Response Parser</h3><p>You will notice that the response is not in a suitable format; it is an array of blocks of objects. We need to get the useful text from the response using Textract Response Parser(TRP). TRP parses the JSON response returned by Amazon Textract.</p><p>In your notebook, install TRP with this command</p><pre>!pip install amazon-textract-response-parser</pre><p>Run the code below to parse the JSON response.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/59a1e5e49ad3b06ad07c2d4685292b98/href">https://medium.com/media/59a1e5e49ad3b06ad07c2d4685292b98/href</a></iframe><p>After running the code, you will see the extracted text as the output(see image below)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*16UCJcnhlcCZVh7fz4K8tA.png" /></figure><h3>Save Extracted Text to a File</h3><p>With the following code, you can save the extracted text to a txt file before we mask personal health information.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4739a5aa261ba7b7487d003f09e83fe2/href">https://medium.com/media/4739a5aa261ba7b7487d003f09e83fe2/href</a></iframe><h3>Save Extracted Text to S3</h3><p>The following code saves the extracted text to the S3 bucket. Ensure that you pass the created path with the set prefix.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/29016af927643d63bb7c363e11ceea4e/href">https://medium.com/media/29016af927643d63bb7c363e11ceea4e/href</a></iframe><h3>Detect Entities with Comprehend Medical API</h3><p>The <strong>DetectEntitiesV2</strong> searches the clinical text body for various medical entities and returns details about each one, including entity category, location, and degree of confidence.</p><p>With the code below, we will use detect_entities_v2 method to detect medical entities in English language texts(page_string)</p><p>You can print the entities object to see the returned results.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/441d8906947822b5310d822004c1cd86/href">https://medium.com/media/441d8906947822b5310d822004c1cd86/href</a></iframe><h3>Masking Detected Entities</h3><p>Now that we have detected the PHI in the extracted text, the next thing is to anonymize the information. For this tutorial, we will write a simple method that uses the detected entity&#39;s generic name to mask the detected information.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6c2a330bd7cda84c12bd78c879d7139b/href">https://medium.com/media/6c2a330bd7cda84c12bd78c879d7139b/href</a></iframe><p>In the results below, you will notice that we replaced the entity with the generic name. For example, John Doe was replaced with NAME , 64 was replaced with AGE and others.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fpn-eij4wp56gC8a1X7hLw.png" /></figure><h3>Conclusion</h3><p>This tutorial leveraged AWS Textract to extract text information from an image document. We then used Amazon Comprehend Medical to determine personal health information &amp; entities from the extracted text. After this, we masked the data with the detected entities&#39; names.</p><p>If you or your organization would like help productionizing a system like this, please reach out to us on <a href="https://discord.gg/SscDru7dFB">discord</a> or through this <a href="https://mantiumai.com/lp/apn-linkedin-ad/">link</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c96a7565c8cd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mantium/automating-document-processing-for-a-health-care-use-case-with-aws-textract-comprehend-medical-c96a7565c8cd">Automating Document Processing for a Healthcare Use Case with AWS Textract &amp; Comprehend Medical</a> was originally published in <a href="https://medium.com/mantium">Mantium</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is AWS Textract; A new world with Intelligent Document Processing.]]></title>
            <link>https://medium.com/mantium/what-is-aws-textract-a-new-world-with-intelligent-document-processing-d6ec1548b009?source=rss-d16dc6797dcb------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6ec1548b009</guid>
            <category><![CDATA[naturallanguageprocessing]]></category>
            <category><![CDATA[aws-textract]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[no-code]]></category>
            <dc:creator><![CDATA[Blessing Adesiji]]></dc:creator>
            <pubDate>Wed, 20 Jul 2022 17:41:32 GMT</pubDate>
            <atom:updated>2022-07-20T17:48:49.207Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*vdW5jd0L3BHRYmLJq-sC4g.png" /></figure><h3><strong>Processing Large-Scale Documents: A Challenge</strong></h3><p>Many organizations have scanned and handwritten documents, including financial institutions, healthcare, manufacturing, and other businesses. Imagine you have an archive of copies from which you would like to extract data; you can have a human read the document and then key all the values into a processing application or another document for easy processing.</p><p>Another approach is using rule-based formatting with an Optical Character Recognition(OCR) system to extract data from documents. Organizations have utilized these approaches to process and derive insights from records; however, they have lived in a world with many document processing challenges.</p><p>Humans have spent productive hours applying domain knowledge to extract insights from documents, perform mundane data entry and document review tasks, and spent thousands of dollars on provisioning infrastructure that handles associated processing workflows. It is costly for organizations to hire resources, pay for the infrastructure and continually manage the implementation of these services.</p><p>This article will explain what Amazon Textract is and how it can benefit you and solve the challenges mentioned above in document processing.</p><h3><strong>A new world with Intelligent Document Processing (IDP)</strong></h3><h4>What is Textract</h4><p>Firstly, the process of extracting data from documents, such as receipts, resumes, tax forms, scanned photos, etc., for subsequent processing is called intelligent document processing.</p><p>Amazon Textract presents a way of extracting handwritten &amp; printed text in forms, tables, pages from images, and PDF documents without any manual effort. It provides a serverless API that enables quick document management and scalability to millions of documents. It comes with a pre-trained model and provides APIs where you can send your documents in PDF or image format and get a response as text/tables, key/value pairs, and a confidence score.</p><h4>Intelligent Document Processing with Textract</h4><p>Amazon Textract supports many file formats — such as PNG, JPEG, and PDF files, and uses cases. Several use cases in IDP can leverage the power of AWS Textract for automation; some examples are below.</p><p><strong>Insurance Industry</strong></p><p>The insurance industry processes quite a lot of time-consuming documents, and the process is error-prone. Therefore, the industry would benefit from IDP significantly to automate data extraction for frequent use cases, including claims input, policy servicing, quotes, and payments.</p><p>A typical IDP process for an insurance company can be to use AWS Textract to extract data from scanned documents in claim settlements, issuing policies, etc., for further insights processing.</p><p><strong>Legal Industry</strong></p><p>While working on cases, lawyers frequently become bogged down with paperwork. Most legal documents are lengthy and extensive, whether for the clients, the ongoing litigation, or even reference material to prepare for a case.</p><p>For example, It might take hours for attorneys to attempt to annotate Contract documents. Leveraging AWS Textract, the IDP process effectively summarizes and extracts information from the contract agreements, data storage, and digitization of existing contractual information, thus automating a large chunk of legal firms’ document processing workflows.</p><p><strong>Financial Industry</strong></p><p>The finance industry is another industry that processes large amounts of documents, and its operations are document-centric. With Textract, financial firms can quickly process loan, mortgage, and commercial debt applications by accurately extracting crucial business information from corresponding financial forms. They can also use IDP to automate processes such as the KYC process (Know-your-customer), Anti-money laundering compliance applications.</p><p><strong>AI Process Automation</strong></p><p>From the examples above, you would understand that several industries leverage the IDP to automate document processing and the data or text extraction done with Textract. However, this is only a part of the IDP- data capture/data extraction. Add AI Process Automation to the workflow to automate insight generations, classifications, and recommendations.</p><p>Transformer models have changed how we work with text data, and state-of-the-art pre-trained models are available for easy access to build AI applications. Leveraging on this, once the data extraction occurs, users will be able to do other tasks with AI embedded in the workflow — such as Named Entity Recognition, Classifications, Text Summarization, Question Answering, etc. Thus, companies can build complex AI workflows that solve business needs, automate processes, and store information for easy retrieval.</p><p><strong>What we are doing at Mantium</strong></p><p>At Mantium, We are building a feature that allows users to build AI applications in Mantium that uses all the Textract services to create workflows to power intelligent document processing.</p><p><a href="https://mantiumai.com/lp/beta/">Sign up for a Beta-Access</a> to be a part of the new world we are leading in AI Process Automation.</p><p>You can also join our growing <a href="https://discord.gg/SscDru7dFB">community on Discord</a>; we’d be happy to answer your questions and help you in your building process.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6ec1548b009" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mantium/what-is-aws-textract-a-new-world-with-intelligent-document-processing-d6ec1548b009">What is AWS Textract; A new world with Intelligent Document Processing.</a> was originally published in <a href="https://medium.com/mantium">Mantium</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Programming; Today VS The Past]]></title>
            <link>https://medium.com/geekculture/programming-today-vs-the-past-414b39824c7e?source=rss-d16dc6797dcb------2</link>
            <guid isPermaLink="false">https://medium.com/p/414b39824c7e</guid>
            <dc:creator><![CDATA[Blessing Adesiji]]></dc:creator>
            <pubDate>Thu, 10 Feb 2022 10:24:02 GMT</pubDate>
            <atom:updated>2022-02-11T05:44:03.989Z</atom:updated>
            <content:encoded><![CDATA[<p>Programming today is very different from the programming of the past.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y5NUP_GMYu_M7BjuIF7Mbw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Markus Spiske</a> on <a href="https://unsplash.com/s/photos/programming?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Programming of the past involved knowing basic algorithms, a language that you used to generate code, and then a compiler that transformed the code into machine-executable instructions.</p><p>Today, the language is increasingly high-level, and the code that is generated is not machine-executable. What makes programming of the past different is that the code that an algorithm produces is a functional and deterministic outcome. With code as deterministic as that, it becomes much easier to debug because the code is clear and has a logical purpose. This can be very powerful in debugging a program, but the downside is that programs are very difficult to make. One reason is that the process of making a program is a very human one.</p><p>Programmers write code, debug code, and rewrite code until the program is finally complete. The end result is, the code is not completely deterministic because the code is the result of the human process. This process is extremely complex in that it is composed of many other human processes. One example of such a process is bug fixing. A bug is the result of a human process, and it is very difficult to identify which process is at fault, and how you could fix it.</p><p>Another problem is that with such a deterministic process, it’s difficult to make new code. The process of making code is a long and involved one that is very difficult to repeat accurately and to reproduce. In contrast, programming today is based on algorithms, which are very difficult to understand, and often can’t be reproduced exactly. If the code is a deterministic output of an algorithm, and the code is the result of human process, it is very difficult to make such a robust process repeatable. Because of this, programming today is much more complex than the programming of the past.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=414b39824c7e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/programming-today-vs-the-past-414b39824c7e">Programming; Today VS The Past</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a WhatsApp AI-Powered Chatbot with GPT-3, using Mantium & Twilio API]]></title>
            <link>https://medium.com/analytics-vidhya/build-a-whatsapp-ai-powered-chatbot-with-gpt-3-using-mantium-twilio-api-d4e40b6f0ed9?source=rss-d16dc6797dcb------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4e40b6f0ed9</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[naturallanguageprocessing]]></category>
            <dc:creator><![CDATA[Blessing Adesiji]]></dc:creator>
            <pubDate>Mon, 20 Dec 2021 10:32:54 GMT</pubDate>
            <atom:updated>2022-05-19T20:47:28.674Z</atom:updated>
            <content:encoded><![CDATA[<h4>Summary</h4><p>In this tutorial, we will build a WhatsApp AI-powered bot capable of conversational question and answering (QA). This type of bot is a generative chatbot, in contrast to the more common retrieval-based chatbot.</p><p>To create the bot, we will use Mantium’s Python library, Twilio WhatsApp API, and the Flask framework. The Mantium App/API enables us to get a generative response, as it supports and provides access to the OpenAI’s GPT-3 model.</p><p>Any questions? <a href="https://discord.gg/SscDru7dFB">Join the Mantium’s Discord Channel</a></p><p>Below is what we are going to build at the end of this tutorial.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*JAfxureGalqpEgaGhhVUqQ.png" /></figure><h3>Introduction</h3><p>Chatbots are applications that replicate and process written or spoken human conversations in a way that allows interactions with digital devices as if they were conversing with actual people. You may have interacted with a chatbot recently while browsing websites on the internet. You probably noticed that the chatbot automatically engages you in a pleasant and non-confrontational manner while trying to help achieve the objective of your visit to the site.</p><p>Chatbots have seen great applications in businesses, such as automating customer interactions, sales channels, etc., and they are becoming a lot smarter. They are capable of handling almost human-level interactions.</p><p>With recent advancements in the Natural language processing(NLP) field, which is developing the GPT-3 model by OpenAI in 2020, it is easier to solve language-based tasks such as generating and classifying text. It becomes even easier to use with Mantium, as they provide development support needed to build effectively with large language models. If you are wondering what OpenAI’s GPT-3 model is, it is the third generation prediction model that OpenAI created, and it has a capacity of 175 billion machine learning parameters.</p><p>With Mantium, we will use this to build a conversational QA WhatsApp bot in just a few lines of code. You don’t need to have a solid knowledge of machine/deep learning to build a use case with Mantium.</p><h3>Requirements</h3><p>To follow this tutorial you need the following;</p><ul><li><a href="http://app.mantiumai.com/">A Mantium Account</a></li><li><a href="https://developer.mantiumai.com/docs/provider-api-keys#openai">An OpenAI API Key</a></li><li>Twilio Account</li><li>Flask Framework</li><li>Local Tunnel</li><li>A smartphone with an active WhatsApp Account</li></ul><h3>Prompt Design with the Mantium App</h3><p>The first and essential step is to design the prompt (conversational text generation task) with the Mantium App. Prompt design is our way of guiding the GPT-3 model to give a favorable and contextual response as it enables us to provide a text input and get a generative response from the model.</p><p>Think of this like you are playing the game of charades where you give the players information to figure out the secret word. Similarly, with GPT-3, we provide just enough information for the model to recognize patterns in the training prompt.</p><p>To do this, you don’t need to have prior deep learning experience, and almost anyone can do this in a No-Code approach to build a simple text application using the <a href="https://app.mantiumai.com/">Mantium interactive UI</a>.</p><p>I will break this into more straightforward steps that you can follow.</p><h4>Step 1 — Register for a Mantium Account</h4><p>Visit the <a href="https://app.mantiumai.com/">app.mantium.com</a> website to create a free account.</p><h4>Step 2 — Connect your OpenAI API key.</h4><p>To access the GPT-3 model through the OpenAI API, you must connect your OpenAI API key on the Mantium App.</p><p>Click on AI Providers, paste your OpenAI and click Add API Key. Notice that Mantium supports other AI providers such as <a href="https://developer.mantiumai.com/docs/provider-api-keys#cohere">Cohere</a>, <a href="https://developer.mantiumai.com/docs/provider-api-keys#ai-21">AI21</a>, you can connect with their respective API keys, but for this tutorial, we build with the OpenAI&#39;s model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4mdl_RTnxVHqxygkqlO-Cg.png" /><figcaption>Connect your API Key here</figcaption></figure><p>If you don’t have your API key for any of the AI Providers , here is <a href="https://developer.mantiumai.com/docs/provider-api-keys">documentation</a> on how you can get one.</p><h4>Step 3 — Add New Prompt</h4><p>The next step is to add a new prompt. Navigate to the <strong>AI Manager</strong> drop-down tab on the left sidebar, click on <strong>Prompts,</strong> and click on the <strong>Add new prompt</strong> button, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*274LmGP37jyZExlL-Ua3Tw.png" /></figure><h3>Step 4 — Prompt Design</h3><p>Here, we will provide the information to build our training prompt.</p><p><strong>A. Basic Info</strong></p><p>Let’s fill in the basic information to identify our prompt. Note that you can provide any name and description.</p><p>Name of Prompt — Chatbot</p><p>Description — This is a chatbot</p><p><strong>B. Provider</strong></p><p>In this tutorial, we are using the OpenAI API, select OpenAI from the drop-down.</p><p><strong>C. OpenAI Info</strong></p><ol><li><strong>Choose an Endpoint</strong> — Select the Completion endpoint. This endpoint provides the model with some text and generates a text completion that tries to fit the context of the provided text.</li><li><strong>Prompt Line</strong> — Here we are going to provide the model with examples, and it will figure out the patterns to perform the given task. <strong><em>See below</em></strong> a Prompt that I designed for our conversational QA generative task.</li><li><strong>Choose an Engine</strong> — The OpenAI engine determines the language model used to execute tasks. OpenAI supports various models with varying capabilities. These models are described and accessed using engines. For this tutorial, select the “Davinci” Engine.</li></ol><pre>Human: Hello, who are you?<br>AI: I am an AI created by Blessing. How can I help you today?<br>###<br>Human: What is a language model?<br>AI: A language model is a statistical model that describes the probability of a word given the previous words.<br>###<br>Human: What is Cryptocurrency?<br>AI: A cryptocurrency (or “crypto”) is a digital currency that can be used to buy goods and services, but uses an online ledger <br>with strong cryptography to secure online transactions.<br>###<br>Human: What country won the 2010 world cup?<br>AI: Spain<br>###<br>Human: How many pounds are in a kilogram?<br>AI: There are 2.2 pounds in a kilogram.<br>###<br>Human: When did the first airplane fly?<br>AI: On December 17, 1903, Wilbur and Orville Wright made the first flights.<br>###<br>Human: How can I learn swimming?<br>AI: There are many ways you can learn to swim. The first thing you can do is talk to your parents and ask if they know any instructors. You can also look online to find a class that you can take in your area.<br>###<br>Human:</pre><p>Copy and Paste the above in the Prompt Line input field.</p><p><strong>D. Basic Settings</strong></p><p>Here you will provide the basic settings for the OpenAI model, see the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nM1YmQSJhZWs-T4Eu5yp9Q.png" /></figure><ul><li>Response Length — 150</li><li>Temperature — 0.8</li><li>Top P — 1</li><li>Frequency Penalty — 0.5</li><li>Presence penalty — 0.6</li><li>Stop Sequence — ###</li></ul><p><strong>Basic Settings Explanations.</strong></p><ol><li>Response Length — The response length sets a limit on how much text the OpenAI API includes in its completion. Take note of your response length, as OpenAI charges by the token, where one token is roughly 4 words. The max tokens controls the length of your completion and your prompt plus completion can’t add up to more than 2,049 tokens. For this example, on the Mantium App, input 150 as your response length.</li><li>Temperature &amp; Top P — The temperature controls the randomness of the response; it is one of the most important settings as it significantly impacts the output. Increase the temperature if you want more creative completions or if you want to let the model go off on a tangent. Decrease the temperature if you want the model to follow instructions or remain factual. Note that, If you alter the temperature, it’s recommended to not alter top_p as it defaults to 1. Set the value to 0.8</li><li>Frequency Penalty — This prevents word repetition. If you notice the output of a model is repeating the same word, and you want it to stop repeating the same word, increase the frequency_penalty</li><li>Presence Penalty — The presence penalty prevents topic repetition. If you notice the output of a model is stuck on a particular topic, and you want it to talk about something else, try increasing the presence_penalty</li><li>Stop Sequence — A stop sequence is a set of characters that signal the API to stop generating tokens.</li></ol><p><strong>Advanced Settings</strong></p><p>We can leave the Advanced settings to the default value for this tutorial.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kjFsBOS084DKxMuZlQNXmw.png" /></figure><p>For more information about these settings, you can read this <a href="https://developer.mantiumai.com/docs/using-mantium-for-employee-onboarding">tutorial by Mantium</a>.</p><h3>Step 5 — Testing Prompt Results</h3><p>On the Mantium App, we will use the Input field to test our prompt. See the image below, I asked the question How can I learn Machine Learing? and I got an interesting response. (See below)</p><p>Fill the input field, and hit the Test run button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uXE8gkyH64Tgtqq63a-glw.png" /><figcaption>Test Result</figcaption></figure><p>Congratulations on completing the first step and an essential step. Note that you can do the above step in code by using the Mantium API/Client Library, but I chose to explain the No-code approach to give you that first understanding and easy debugging.</p><p><a href="https://developer.mantiumai.com/docs/using-mantium-for-employee-onboarding#share-using-the-one-click-deploy-feature">With Mantium’s Deploy feature</a>, you can quickly generate a one-page application you can share with your friends to test your chatbot, but we intend to create a WhatsApp application. So, in subsequent steps, we will grab this prompt using Mantium’s Client Library and integrate it with the Twilio WhatsApp API in Python.</p><h3>Configure the Twilio WhatsApp Sandbox</h3><p>For this tutorial, we will use the Twilio WhatsApp Sandbox, where will develop and test our chatbot application.</p><h4>Step 1 — Create an Account</h4><p>Create an account with Twilio, and visit the <a href="https://www.twilio.com/console">Twilio Console</a>, where you will click on Explore Products and select Messaging.</p><h4>Step 2 — Setup Sandbox</h4><p>Navigate to the sidebar, Under Messaging and Settings, select the WhatsApp sandbox settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4WZd0BuDFS4c1DdUd1KJ3w.png" /></figure><p>Connect your sandbox by sending a WhatsApp message with the given code to the number assigned to your account. Twilio will send a reply stating that your sandbox is set, and you can complete the Two-way setup by sending “Hello” on your WhatsApp.</p><p>Note that, you can share the number assigned to your account for others to connect, and test your application in the Sandbox.</p><p>The last step is to configure the sandbox, which we will come back to.</p><h3>Let’s Build the Chatbot!</h3><p>Here we are going to write Python code to build the WhatsApp chatbot. The process is easy. We will develop and test our application with a few lines of code. We will take the user input (Your WhatsApp incoming message), pass the message as an input through the Mantium execute prompt method, which sends this request to the model and returns a response. Twilio processes this response, and it is returned as a reply on your WhatsApp.</p><p>If you are still unclear on what we are trying to achieve, see the illustration below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7C14H9uBGfnXxF9chPBuOw.png" /></figure><p><strong>Let’s write some code!</strong></p><h4>Step 1 — Setup a Python Virtual Environment.</h4><p>Create a Python virtual environment by using the command below.</p><pre>$ mkdir whatsapp-bot<br>$ cd whatsapp-bot<br>$ python -m venv whatsapp-bot-venv<br>$ source whatsapp-bot-venv/bin/activate</pre><p>After this, create a file named app.py in the root directory of the whatsapp-bot folder.</p><h4>Step 2 — Setup Mantium’s Client Library</h4><p>Mantium has provided a <a href="https://github.com/mantiumai/mantiumclient-py">Python client library</a> to improve the developer’s experience, and we will use that in this tutorial.</p><p><strong>Installation</strong></p><p>Using the command below, install the Python client library.</p><pre>pip install mantiumapi</pre><p><strong>Authenticate</strong></p><p>Here you will authenticate by providing your login credentials in an environment variable.</p><p>With the command below, install python-dotenv</p><pre>pip install python-dotenv</pre><p>After this, create a .env file to store your credentials. Input your login credentials as shown below.</p><pre>MANTIUM_USER=&#39;youremail.com&#39;<br>MANTIUM_PASSWORD=&#39;your-password&#39;</pre><p>In app.py , you will use the code below to authenticate your Mantium account and create a prompt. Notice that I imported the Mantium prompt method, more on that later.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fc2d9312ffa75dda78df946930fef792/href">https://medium.com/media/fc2d9312ffa75dda78df946930fef792/href</a></iframe><p>Here is the link to the <a href="https://github.com/mantiumai/mantiumclient-py">Mantium GitHub repository</a> for more. If you are interested you can contribute to the development of the library.</p><h4>Step 3 — Setup Webhook with Flask Framework</h4><p><strong>Installation</strong></p><p>Here we need to install the Flask framework to create the web application, and Twilio Python Helper Library to work with Twilio APIs.</p><pre>pip install twilio flask</pre><p>Now let’s set up a webhook with the Flask framework. We will create an endpoint that listens to POST requests, and when Twilio receives the incoming message they will invoke this endpoint. The body of the function is what processes the input message, and provides a response after Mantium executes the input.</p><p>Here is a starter template, in this we will input the body of the bot function.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2c279d2d0d5274ee5f7553d2e371ce36/href">https://medium.com/media/2c279d2d0d5274ee5f7553d2e371ce36/href</a></iframe><h4>Step 4 — Send Input to Mantium, and Return a Response.</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8d5748391cbba50a6671578b7a0920e5/href">https://medium.com/media/8d5748391cbba50a6671578b7a0920e5/href</a></iframe><p><strong>Let me explain the code above.</strong></p><p>Input message — This gets the user WhatsApp input message</p><pre>incoming_msg = str(request.values.get(&#39;Body&#39;, &#39;&#39;).lower())</pre><p>You need your Prompt ID. Remember the prompt that we created above. Let’s grab the ID. The easiest way to get this is to use the URL of the prompt editing page . See the link below, the last string is your prompt ID.</p><pre>https://app.mantiumai.com/ai-manager/prompt/{prompt_id}</pre><p>Using the from_id method, retrieve the prompt from Mantium.</p><pre>qa_prompt = prompt.Prompt.from_id(&#39;&lt;your-prompt-id&gt;&#39;)</pre><p><strong>Execute the Input and Get Result</strong></p><p>Here we will send the Prompt to the OpenAI API endpoint, and we will get the response from the GPT-3 model. You need to refresh because this is asynchronously done to get a result.</p><pre>result = qaPrompt.execute(incoming_msg)<br>result.refresh()<br>prompt_result = str(result.output)</pre><h4>Step 5 - Twilio Messages and Response</h4><p>Twilio expects a response from the webhook in <a href="https://www.twilio.com/docs/glossary/what-is-twilio-markup-language-twiml">TwiML or Twilio Markup Language</a>, which is an XML-based language format. With the Twilio helper library, we can easily create this response without having to create XML directly. Below explains how we can do that.</p><pre>from twilio.twiml.messaging_response import MessagingResponse<br><br>resp = MessagingResponse()<br>msg = resp.message()<br>msg.body(&#39;this is the response text&#39;)</pre><h3>Putting everything together</h3><p>This is the full code</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fb0371d73ece4dc83e5d328af85db59c/href">https://medium.com/media/fb0371d73ece4dc83e5d328af85db59c/href</a></iframe><h3>Testing the Chatbot.</h3><h4>Step 1 — Run the app.py file</h4><p>Run the command below to start the chatbot, and it will run at port 5000 on your local machine. See the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mh6vDlAEATUMfsZIG_DLsQ.png" /></figure><pre>python app.py</pre><h4>Step 2 — Local Tunnel</h4><p>Localtunnel is a simple tool that provides a publicly-accessible URL that reroutes every request to the locally-running service. It exposes our localhost to the world for easy testing and sharing, which we need to connect the URL to Twilio (Remember the step that we skipped when configuring the Twilio sandbox).</p><p>You can create another terminal beside the initial terminal, and install the Localtunnel tool. Use the command below, and ensure that <a href="https://docs.npmjs.com/downloading-and-installing-node-js-and-npm">NPM is installed.</a></p><pre>npm i localtunnel</pre><p>After this, run the command below and the browser window below automatically pops up. I can see that the app is working.</p><p>Take note that my app is running on port 5000</p><pre>lt --port 5000 --subdomain shan --local-host &quot;127.0.0.1&quot; -o --print-requests</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*oPfYil9fWm-fbVEA6zwdCw.png" /></figure><h4>Step 3 — Configure Twilio Sandbox</h4><p>On Twilio Console, paste the URL below in the WHEN A MESSAGE COMES IN field, since our chatbot is exposed under the /bot URL. After this, click on the Save button.</p><p>URL — <a href="https://shan.loca.lt/bot">https://shan.loca.lt/bot</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*4WZd0BuDFS4c1DdUd1KJ3w.png" /></figure><h4>Step 4 — Send and Receive Messages</h4><p>Now that the configuration is all done and the server is running, it’s time to test the chatbot.</p><p>Here, I decided to ask some random questions, since I didn’t design the prompt for a specific use case. See images below.</p><p>You can see that we got responses that weren’t in the Prompt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*JAfxureGalqpEgaGhhVUqQ.png" /></figure><h3>Logging with Mantium</h3><p>You can use the Mantium’s Log feature to check the output and status of your prompt. This can come in handy when you are not getting any reply to your WhatsApp message.</p><p>Navigate to the Monitoring tab on the left side, click on Logs .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lnJo8SjeqziKcMevHGCqtg.png" /></figure><h3>Conclusion</h3><p>While I didn’t design the prompt for any particular use case, I aimed to show the possibilities of a large language model(LLM) and how to use the <a href="https://developer.mantiumai.com/reference">Mantium API</a> integrated with Twilio’s API to build something interesting. There are many ways that you can spin this tutorial to build custom use cases; examples include but are not limited to Intelligent Customer Service bots, Virtual AI assistants etc.</p><p>I hope this tutorial was helpful, and you learnt about what you can do with Mantium &amp; Large Language Model. If you have something to build in mind, you can reach out to me via <a href="https://www.linkedin.com/in/bdetoye/">LinkedIn</a></p><p>Any questions? <a href="https://discord.gg/SscDru7dFB">Join the Mantium’s Discord Channel</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4e40b6f0ed9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/build-a-whatsapp-ai-powered-chatbot-with-gpt-3-using-mantium-twilio-api-d4e40b6f0ed9">Build a WhatsApp AI-Powered Chatbot with GPT-3, using Mantium &amp; Twilio API</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Preventing Spam Emails Led to Proof-of-Work]]></title>
            <link>https://medium.com/coinmonks/how-preventing-spam-emails-led-to-proof-of-work-46a294b2435?source=rss-d16dc6797dcb------2</link>
            <guid isPermaLink="false">https://medium.com/p/46a294b2435</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Blessing Adesiji]]></dc:creator>
            <pubDate>Fri, 19 Nov 2021 06:48:24 GMT</pubDate>
            <atom:updated>2021-11-19T12:58:08.772Z</atom:updated>
            <content:encoded><![CDATA[<h3>How preventing spam emails led to proof-of-work</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9tz0bEc2bJn0jWQZsXi19Q.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@peiobty?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Pierre Borthiry</a> on <a href="https://unsplash.com/s/photos/proof-of-work?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>You are probably wondering what proof of work is? Let me explain, so you know Bitcoin ($BTC). BTC uses proof of work for block generation; it uses the Hashcash proof of work system. The proper definition of proof of work is a piece of data that is difficult to produce but easy for others to verify, and it must meet specific requirements. The word “difficult” here means that it is costly and time-consuming. It takes a lot of trial and error process before a valid proof of work can be generated.</p><p>I said Bitcoin uses proof of work; how? For a block to be valid, it must hash — hash is a random value assigned to data — to a value less than a given target. This is a way to prove that work has been done on a particular block, hence the word “proof-of-work”. With this, it becomes challenging for miners to generate new blocks and protects the blockchain from getting tampered with. Changing a block would require you to regenerate all previous blocks and then do the work they contain.</p><p>To clarify, let me explain one of the applications of this in spam email prevention with a few lines of Python code. Here we will try to prevent spam by doing some work on the email sent, and the known receiver can easily verify this (Proof-of-work). The idea is to make the email computationally expensive to hack. The most widely used proof-of-work algorithm used is SHA-256, and that is what we will use in this short tutorial. If you want more information on Hashing, you can read it <a href="https://blockgeeks.com/guides/what-is-hashing/">here</a>.</p><p><strong>The code</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*wBE16NrHLIt7OWtQOh9B1Q.png" /><figcaption>Python Code Example</figcaption></figure><p><strong>Explaining the code.</strong></p><p>Import the hashing function — SHA-256</p><pre>from hashlib import sha256</pre><p>Create a Secret Phrase — This street phrase is only known by the legitimate receiver.</p><pre>secret_phase = &#39;tweet_tutorial&#39;</pre><p>Create a hashing function that takes in the email body as input data and the street phrase. The function returns a special 8-digit character that meets some certain requirement known by the receiver.</p><pre>def get_hash(input_data, secret_phase):     <br>  combined_string = input_data + secret_phase     <br>  return int(sha256(combined_string.encode(&#39;utf-8&#39;)).hexdigest(),   16) % 10**8</pre><p>Email body</p><pre>email_body = &quot;Hey man, The current price of Bitcoin is 56390.83,&quot; \     &quot; as at the time of writing this email shehejge2339944502013e3449500020440423432&quot;</pre><p>This is the email body, and you can see that I added some random string at the end of the email that I got through a lot of trial and error, just so that the email body combined with the secret phrase meets some specific requirement known to the receiver. The receiver can easily verify this by calling the <em>get_hash</em> function on the email body and the secret phrase.</p><pre>print(get_hash(email_body, secret_phase)) </pre><pre># 55673324</pre><p>What I did with the was to come up with a certain constraint that I can only satisfy by inserting arbitrary data into the email body. When the receiver checks the email_body and the secret phrase, the same output will be returned, thus a proof of work done by me. If the arbitrary data that I added changes by just a string, the result — 55673324 would also change, and the receiver can confirm for sure that the email has been tampered with. Below I changed the last digit of the random data at the end of the email to 5, and the new email body is</p><pre>email_body = &quot;Hey man, The current price of Bitcoin is 56390.83,&quot; \     &quot; as at the time of writing this email shehejge2339944502013e3449500020440423435&quot;</pre><p>My new output is</p><pre>28554609</pre><p>The output above is different from what the receiver is expecting, thus we know that the email has been tampered with.</p><p>In conclusion, legitimate emails will be able to do the work to generate the proof easily, but mass spam emailers will have difficulty generating the required proofs, which would require huge computational resources. And this is used as a consensus algorithm used in Bitcoin mining.</p><p>Twitter — <a href="https://twitter.com/bleso_a">https://twitter.com/bleso_a</a></p><p>Email — blessingadesiji96@gmail.com</p><blockquote>Join Coinmonks <a href="https://t.me/coincodecap">Telegram Channel</a> and <a href="https://www.youtube.com/c/coinmonks/videos">Youtube Channel</a> learn about crypto trading and investing</blockquote><h4>Also Read</h4><ul><li><a href="https://blog.coincodecap.com/crypto-exchange">Best Crypto Exchange | Top 10 cryptocurrency exchanges 2022 | CoinCodeCap</a></li><li><a href="https://blog.coincodecap.com/crypto-lending">10 Best Crypto Lending Platforms 2022 | CoinCodeCap</a></li><li><a href="https://medium.com/coinmonks/crypto-trading-bot-c2ffce8acb2a">10 Best FREE Crypto Trading Bots in 2023</a></li><li><a href="https://medium.com/coinmonks/best-crypto-signals-telegram-5785cdbc4b2b">5 Best Crypto Telegram Channels 2024 (Trading Signals)</a></li><li><a href="https://blog.coincodecap.com/best-social-trading-platforms">5 Best Social Trading Platforms [2021] | CoinCodeCap</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46a294b2435" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coinmonks/how-preventing-spam-emails-led-to-proof-of-work-46a294b2435">How Preventing Spam Emails Led to Proof-of-Work</a> was originally published in <a href="https://medium.com/coinmonks">Coinmonks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Earn while you Learn]]></title>
            <link>https://medium.com/geekculture/earn-while-you-learn-9bb3418b4c35?source=rss-d16dc6797dcb------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bb3418b4c35</guid>
            <category><![CDATA[articles]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[side-hustle]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[jobs]]></category>
            <dc:creator><![CDATA[Blessing Adesiji]]></dc:creator>
            <pubDate>Thu, 18 Nov 2021 18:03:49 GMT</pubDate>
            <atom:updated>2021-11-18T18:03:49.449Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N5ylajXWNSeCZ0arGe1-pA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@austindistel?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Austin Distel</a> on <a href="https://unsplash.com/s/photos/earn-incme?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>One of the best strategies you can employ while learning a skill is setting yourself up for earning. If this is something you’d like to try, continue reading this short article.</p><p>I know learning is fun, and if you find yourself in tech, you are in for a lifelong learning engagement. So, in this article, I will share how you can set yourself to earn some cool dollars while you are learning.</p><p>You can apply this if you are just learning how to code, while you are looking for jobs, you have a way to earn.</p><p>It worked for me and a few others that I know, so if you apply it well, I believe it should work out for you, even if you are a beginner.</p><h3>Technical Writing</h3><p>What I am trying to say here is WRITE ARTICLES. Don’t just write articles, be strategic about it. I will share two methods that can you can follow.</p><ol><li><strong>Write articles to share your learning process, progress and findings.</strong> <br>This method is a long-game strategy, which will open up more opportunities (full-time jobs, side gigs, etc.) For example, If you just started learning how to code in the Python programming language. You can write an article/series of articles to share your findings and code examples about Python’s particular topic. Don’t worry if you are a beginner; share your fresh POV as a beginner. What you are doing here is you are showing the world that you know the topic well because you understood the concept before sharing.</li><li><strong>Write paid technical articles. </strong><br>This is for getting quick cash, if you can write two articles in a month, you can get avg. income of $400. You can even make a career out of it, or do this while you hunt for a full-time job. Here is a compilation of writers program that you can join<br>- <a href="https://github.com/malgamves/CommunityWriterPrograms">Technical Articles</a> <br>- <a href="http://whopayswriters.com/#/results">Non-Technical Articles</a></li></ol><h3>Apply for Technical content creating jobs.</h3><p>These jobs employ and pay you to develop technical content (Blog posts, Interview Questions, Sample Projects, Online Courses, etc.), serving as a full-time job or side-gig. You can find these kinds of jobs on popular job boards, Twitter, LinkedIn, etc. <br>But you get faster results on Freelancing platforms such as Fiverr, Upwork.</p><p>See an example of a job post on Upwork. So you do your search based on your skillset &amp; interests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*dzU6NyEskDVdlbTwChu4ZQ.png" /></figure><h3>Code Review &amp; Mentorship</h3><p>What you are doing here is reviewing codes, projects, etc. You provide detailed feedback, help others to debug code, and answer complex questions. It might be a bit difficult for beginners to navigate this space, and land opportunities but experienced guys can do this.</p><p>Here are the links to apply for some of these opportunities.</p><ul><li><a href="https://www.udacity.com/jobs#mentors">https://www.udacity.com/jobs#mentors</a></li><li><a href="https://www.codementor.io/">https://www.codementor.io/</a></li></ul><h3>Run your own Tutorials</h3><p>You can create your tutorials and turn them into online courses. It is an excellent way to learn, earn and share your knowledge. I made online courses for a couple of E-learning platforms, so you can send a message if you need some help here. Note that this method requires a lot of effort and patience if you work with your brand, but it is nice passive income if you can figure it out.</p><p>Let me know if this works out for you. Connect with me via</p><p>Twitter — <a href="https://twitter.com/bleso_a">https://twitter.com/bleso_a</a></p><p>Email — blessingadesiji96@gmail.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bb3418b4c35" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/earn-while-you-learn-9bb3418b4c35">Earn while you Learn</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn Solidity 01: Writing your first Smart Contract]]></title>
            <link>https://medium.com/coinmonks/learn-solidity-01-writing-your-first-smart-contract-528cad29ba99?source=rss-d16dc6797dcb------2</link>
            <guid isPermaLink="false">https://medium.com/p/528cad29ba99</guid>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[blockchain-technology]]></category>
            <dc:creator><![CDATA[Blessing Adesiji]]></dc:creator>
            <pubDate>Mon, 12 Jul 2021 07:43:10 GMT</pubDate>
            <atom:updated>2021-07-19T12:08:22.003Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XPUSr4llHeDhv1RkaGSUTQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@zoltantasi?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Zoltan Tasi</a> on <a href="https://unsplash.com/s/photos/ethereum?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>I have been fascinated by blockchain technology for so many reasons, which I will not discuss in this article. However, it’s not a new topic that cryptocurrency is the future of money, and NFTs are doing incredibly impressive for digital artists.</p><p>So what is my aim with this article? I got interested in the blockchain space, and after doing a lot of research, I couldn’t find enough learning guides like you would, for, say, Data Science which is pretty standard. It would help if you understood that the reason for this is that there is a shortage of Solidity programmers(about 200,000* developers in the world) compared to other popular programming languages. Therefore, there aren’t enough tutorials out there. Hence, I will be writing a series of articles on learning the language, and you can learn from this to become a blockchain developer.</p><p>This is the first article of the series, and it will be on writing your first smart contract with Solidity. There are many concepts that you might not be familiar with yet, and that’s perfectly okay. I will do my best to break down each concept into bits as we move along the series, and you can do more research from there.</p><p>To get started, here are a few questions that you should be asking; What is a Smart Contract? What is Solidity? How does the blockchain work?</p><p>Follow along as I provide answers to these questions below.</p><h3>What is a Smart Contract?</h3><p>A “Smart Contract” is simply a program that runs on the Ethereum blockchain. It is a collection of code (its functions) and data (its state) that resides at a specific address on the Ethereum blockchain. Think of a smart contract as an account on the Ethereum network, which can not be controlled by the user and runs as a program. However, a user can interact with a smart contract by submitting transactions that execute a function defined on the smart contract.</p><p>The way smart contracts ensure that transactions occur in real life is much more complex, but here is a simple explanation to understand how things work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KJ1w05OCfJar0D8vxuisYA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@cedrikwesche?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Cedrik Wesche</a> on <a href="https://unsplash.com/s/photos/ethereum?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Imagine that this article is for sale, and I am the seller, you the reader is the buyer, and you are buying this article by using an affiliate link you saw on the internet. We can deploy a smart contract for this transaction, and here’s how the exchange might occur.</p><p>You, the reader, creates a transaction that sends the price of this article to the seller in exchange for a copy of this article. Like you would usually in a normal bank transaction, you will provide my address as an input to the smart contract’s address. The smart contract will then carry out this transaction by verifying that you have enough money in your wallet and that I also have a copy of this article ready for sale. Then, it deducts the money from your wallet, sends it to my wallet, tells me to send you a copy of the article, and finally sends the affiliate commission to the owner of the affiliate link after deducting that from my wallet.</p><p>The above is how smart contracts can facilitate transactions between users who do not trust each other, and it is used in the real world to carry out much more complex transactions.</p><p>This leads us to the following question: What is Solidity?</p><h3>What is Solidity?</h3><p>We already established the fact that Smart Contracts are software programs. For Ethereum, you can write smart contracts using a statically-typed language called Solidity, which is the most widely used smart contract programming language at the moment. Solidity is a full-featured language for writing general-purpose smart contracts, and it looks like JavaScript.</p><h3>How does the blockchain work?</h3><p>To answer the last question, I think it’s an important concept to know. I will share a good video by Anders Brownworth, it explains the concept: How does the blockchain work?</p><p>Watch <a href="https://www.youtube.com/watch?v=_160oMzblY8">here</a>; an elementary visual introduction to the concepts behind how the blockchain works.</p><p>Now that you have a good understanding of the concepts above let’s see how you can write your first smart contract.</p><h3>Step 1 — Setup Remix IDE</h3><p>1.1 — The first step is setting up the Remix IDE. Remix IDE is a browser-based development environment for Smart Contracts. The IDE provides several plugins and compilers for different solidity versions.</p><p>To launch the Remix IDE, visit <a href="http://remix.ethereum.org/">http://remix.ethereum.org</a>; you will see the page below, which might be different depending on when you are reading this article.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D4nWJVSFrcaP2Aft1Z6shg.png" /><figcaption>Remix Home Page</figcaption></figure><p>Notice that in the image above, you can see “Featured Plugins” because the Remix IDE is built with a pluggable architecture, which means that all the operations are performed using plugins.</p><p>1.2 — The next thing to do is to enable the Solidity compiler plugins, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hvojGPnKzI1YQYwCL30DyQ.png" /><figcaption>Enable Plugins</figcaption></figure><p>1c — After enabling the plugin, click on the “Solidity compiler” button, and select the compiler configuration shown in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YVcm1xyGT8onK9UM1WS2IA.png" /><figcaption>Compiler Configuration</figcaption></figure><p>It is noteworthy to mention that compiler versions in Solidity are tricky to work with, and the advice is that you should try not to work with the most recent version. Interestingly, you will find some legacy projects still running on older solidity versions, and this is okay. In summary, try to stick with the version you see in a particular tutorial if you are a beginner.</p><p>In the image above, you will see that we are working with compiler version 0.8.1, which might not be the recent version. Also, you can set the compiler version in the Solidity source file by using the “pragma” line at the beginning of the file. The Pragma line is just a way of telling the compiler the version you are working with.</p><p>Now that everything is all set let’s write our first smart contract in the next step.</p><h3>Step 2 — Write your first Smart Contract</h3><p>Like any other programming language, the first step is creating a project file for the language. Here, you will create a file titled, “MyFirstSmartContract.sol”. The “sol” file extension stands for Solidity, just like “py” is for Python.</p><p>See the images below to create this file in the Remix IDE.</p><p>2.1 — Create Workspace</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MkOX5ywRXG2DTQDixoc6hQ.png" /><figcaption>Create workspace</figcaption></figure><p>2.2 — Create the file; MyFirstSmartContract.sol</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7zm3HHmlypjiQIqUCD487g.png" /><figcaption>Create a file</figcaption></figure><p>2.3 — Write the code</p><pre>// SPDX-License-Identifier: GPL-3.0</pre><pre>pragma solidity ^0.8.1;</pre><pre>contract MyFirstContract {<br> string public myString = “Hello World”;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JZYmTOcbEZt80GWgDnsAHw.png" /></figure><p><strong>Part 1</strong></p><p><em>`// SPDX-License-Identifier: GPL-3.0` </em>— Is the Software Package Data Exchange® (SPDX®) identification used to specify the license under which the Solidity file will be distributed. It is recommended that it is included in your code, and the compiler will throw a warning message if it is missing from your file.</p><p><strong>Part 2</strong></p><p>pragma solidity ^0.8.1, the ^0.8.1 means version between 0.8.1 and 0.9.0, inclusive of 0.8.1 but not 0.9.0. In other words &gt;=0.8.1 and &lt;0.9.0.</p><p>The pragma keyword instructs the compiler to enable or check specific features. Finally, the version pragma is a mechanism that informs the compiler about the Solidity file’s compiler version.</p><p><strong>Part 3</strong></p><p><em>contract MyFirstContract </em>is the beginning of the code, just like the Class keyword in the Python programming language. The “myString” is a public storage variable to hold “Hello World.” You will learn more about this as we proceed through the series.</p><p><strong>Part 4</strong></p><p>Notice that the compiler displayed a green icon, and this signifies that the compilation is successful because you enabled auto-compile in the previous section.</p><h3>Congratulations 🎉🎉</h3><p>So there you have it; Congratulations, you just wrote your first smart contract. In the next article, we will discuss how you can deploy this smart contract to an actual blockchain.</p><p>* — Estimated figure</p><h3>Up next …</h3><p>If you don’t want to miss the next article, consider signing up for my <a href="https://blessingadesiji.substack.com/p/learn-about-how-technology-is-changing?r=1mihs&amp;utm_campaign=post&amp;utm_medium=web&amp;utm_source=copy">newsletter</a>, and you will receive a notification in your email when the article is ready. Remember, these article series aim to break down complex concepts in blockchain development, especially the Ethereum network.</p><h3>Get to Know me</h3><p>I write about exciting topics in Data Science, Software Development, and Blockchain Tech.</p><p>Follow me on my social media for more updates; <a href="https://twitter.com/bleso_a">Twitter</a> and <a href="https://www.linkedin.com/in/bdetoye/">LinkedIn</a>. Also, don’t hesitate to write me an <a href="/service/mailto:blessingadesiji96@gmail.com">email</a> for more information.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=528cad29ba99" width="1" height="1" alt=""><hr><p><a href="https://medium.com/coinmonks/learn-solidity-01-writing-your-first-smart-contract-528cad29ba99">Learn Solidity 01: Writing your first Smart Contract</a> was originally published in <a href="https://medium.com/coinmonks">Coinmonks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Arrays — Move Element to End]]></title>
            <link>https://blessingadesiji.medium.com/arrays-move-element-to-end-12a39cd3c5fb?source=rss-d16dc6797dcb------2</link>
            <guid isPermaLink="false">https://medium.com/p/12a39cd3c5fb</guid>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[coding-interviews]]></category>
            <dc:creator><![CDATA[Blessing Adesiji]]></dc:creator>
            <pubDate>Sat, 21 Nov 2020 08:23:08 GMT</pubDate>
            <atom:updated>2020-11-21T08:23:08.370Z</atom:updated>
            <content:encoded><![CDATA[<h3>Arrays — Move Element to End</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h4TLlisFk7XvtREAsS7C7Q.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@cgower?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Christopher Gower</a> on <a href="https://unsplash.com/s/photos/coding-challenge?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h4>Introduction</h4><p>This article is the first part of a series of articles that will explain data structures and algorithms challenges. The purpose of this is to help solidify your knowledge as you practice for coding interviews.</p><h4>Question</h4><p>You are given an array of integers and an integer. Write a function that moves all instances of that integer in the array to the end of the array. Return the array. <br>The function should mutate the input array, i.e. the operation should be performed in place, and doesn’t need to maintain the order of the integers.</p><p><strong>Sample input</strong></p><blockquote>array = [1, 2, 1, 1, 3, 4, 1] <br>toMove = 1</blockquote><p><strong>Sample Output</strong></p><blockquote>[4,2, 3, 1, 1, 1, 1]</blockquote><p>Note that 4, 2, 3 doesn’t have to be ordered perfectly.</p><p>How would you approach this question? Follow this tutorial for a detailed breakdown on how to solve this question.</p><h3>Figuring out the Algorithm</h3><p>You are provided with an integer to move all of the instances to the end of the array. The array can be potentially sorted to arrive at the solution, but it is not a viable method to follow. A better approach will be to have pointers (i, j) at each end element of the array. The pointer i is the pointer at the start of the array while pointer j is the pointer at the end of the array.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*k8DhXKmRp4wTX4YBfWxfVA.png" /></figure><h4><strong>Pointers’ Movement</strong></h4><p>As seen above, the position of the pointers is at the extreme ends of the algorithm. To understand the movement of the pointers, think of it as an indicator to swap the elements to the left and right side of the array.</p><p>The simple approach to follow using the pointers is that the array element (1) should move or remain in the extreme right side of the array, while other array elements should move to the left side of the array.</p><p>From the figure above, the element to move (1) is at the end of the array already(right side), so the pointer j will move to the left side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*ox33Vu8cJ3gpqVUvnDIP0g.png" /><figcaption>Current pointer position</figcaption></figure><p>Next, swap element 1 at the left side (pointer i) with element 4 (pointer j). After this, the pointer i moves to the right side since the element 2 is in the expected position (See image below)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*SQIVV89EO4tJ05P5dWfQDQ.png" /><figcaption>Current pointer position after doing the swap</figcaption></figure><p>Looking at the image above, the next step happens when pointer j moves to the left side after checking the condition. The new position of pointer j indicates that the current element should be swapped with the element at the position of the pointer i. (See image below)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*Mbs0Rojfshtx1re-lGRIng.png" /><figcaption>Pointer position</figcaption></figure><p>At this point, we’ve traversed through the array as the pointers are set to overlap and cross to a different side.</p><h4>Time &amp; Space Complexity</h4><p><strong>Time Complexity</strong></p><p>The two operations that were performed in the algorithm were accessing the index of each array of elements and swapping. So, the time complexity is linear time<em> O(N). </em>No complex operation was carried out.</p><p><strong>Space Complexity</strong></p><p>The space complexity is constant space as we didn’t make use of any other data structure and the operations were carried out in place.</p><h4>Coding the Algorithm</h4><p>The first step here is to initialize the pointers as shown below.</p><pre>def moveElementToEnd(array, toMove):</pre><pre>    i = 0</pre><pre>    j = len(array) - 1</pre><p>Using a while loop with a condition to break after traversing through all the arrays. You would have traversed through all the arrays at the point where the pointers overlap.</p><p>Another while loop condition to capture is when the pointer j is pointing at the element to move at the right side of the array (1), we have to decrease the index of the array by 1 as we move inwards(left side) till we get to a value that is not the element to move. In the inner while loop condition, we have to take care of the overlapping of the pointers also, (after traversing through the element) for the algorithm to know the point to break the while loop. So we add a condition “i &lt; j” to the inner while loop, and this prevents further decrement of pointer j and also prevent over swapping of the elements to the side as j decreases towards the left side.</p><pre>def moveElementToEnd(array, toMove):</pre><pre>    i = 0</pre><pre>    j = len(array) - 1</pre><pre>    while i &lt; j:</pre><pre>        while i &lt; j and array[j] == toMove:</pre><pre>            j -= 1</pre><p>So when the value at pointer j is not the value to move, we can perform the swap as long as the value at pointer i is equal to the value to move (1). After the swapping we increase the value of index i by moving to the right side. In the end you can return the array.</p><pre>def moveElementToEnd(array, toMove):</pre><pre>    i = 0</pre><pre>    j = len(array) - 1</pre><pre>    while i &lt; j:</pre><pre>        while i &lt; j and array[j] == toMove:</pre><pre>            j -= 1</pre><pre>        if array[i] == toMove:</pre><pre>            #Swapping</pre><pre>            array[i], array[j] = array[j], array[i]<br>  <br>        i += 1</pre><pre>    return array</pre><p>In conclusion, the problem becomes easy when you break it down into smaller chunks. Before your write any code, take time to think through the problem just like we did in the “Figuring out the algorithm” section.</p><p>Watch out for the next part of the tutorial, as we continue to tackle Array questions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12a39cd3c5fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google Cloud Platform — Big Data Analytics Solution: A Case Study]]></title>
            <link>https://blessingadesiji.medium.com/google-cloud-platform-big-data-analytics-solution-a-case-study-4c899ecdf790?source=rss-d16dc6797dcb------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c899ecdf790</guid>
            <dc:creator><![CDATA[Blessing Adesiji]]></dc:creator>
            <pubDate>Sun, 10 May 2020 14:42:25 GMT</pubDate>
            <atom:updated>2020-05-10T14:42:25.364Z</atom:updated>
            <content:encoded><![CDATA[<p>To show my understanding of Google Cloud Platform (GCP), I have decided to write a short summary on how its big data analytics solution can be leveraged by a small data-driven company that relies on getting streams of data, process and analyse for insights.</p><p>This is to express my interest in applying for the role of Cloud Data Engineer Intern at Cloud 7. I do hope that this short summary will portray my motivation to work and learn as a cloud data engineer in the firm.</p><h3><strong>Why GCP for Big Data Analytics</strong></h3><p>Google Cloud Platform is a suite of cloud computing services that runs on the same infrastructure that Google uses internally for its end-user products. It lets you build, deploy, and scale applications, websites, and services on the same infrastructure.</p><p>Based on the distributed services that Google offers, complexities in data analytics can be easily handled on the cloud. Insights generation processes are offered on serverless, integrated, and end-to-end data analytics services. The platform handles scalability, security, compliance and performance needs with cost-effective approaches.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*D2Dd3q-bH8BceZix-mSWJg.png" /><figcaption>The Big Picture — Google Cloud Platform</figcaption></figure><p><strong>Products that can be leveraged upon by the data-driven company.</strong></p><p>Google cloud platform offers products that enable an end-to-end data analytics process.</p><p>Assumption — The company ingests large data from distributed sensors or IOT devices.</p><p><strong>1. Capture Data- Cloud Pub/sub or Cloud IoT Core</strong></p><p>Cloud Pub/sub lets you ingest millions of events per second from anywhere (and lets you publish it anywhere) in the world via an open API. Thus, making data ingestion, processing, and storage easy for data engineers.</p><p>Cloud IoT Core is a fully managed service that allows you to easily and securely connect, manage, and ingest data from millions of globally dispersed devices.</p><p><strong>2. Process Data — Cloud Dataflow</strong></p><p>Cloud Dataflow enables faster streaming and batch data pipeline development with lower data latency. The team can focus on programming as Google manages the resources and removes complexities in data engineering workloads.</p><p><strong>3. Store &amp; Analyse Data</strong></p><p><strong>BigQuery</strong></p><p>This product enables gigabytes to petabytes data analytics using SQL at a fast speed. Making it easy to query streaming data in real-time and get up-to-date information on business processes. It also offers robust security as data is encrypted with encryption keys.</p><p>There are sub-products of BigQuery that are of benefits, namely, BigQuery ML and BigQuery BI Engine.</p><p><strong>BigQuery ML</strong> supports analytics team to build fast machine learning models with structured and semi-structured data directly inside BigQuery using simple SQL. The models can be exported to the Cloud AI Platform for integration into applications and the company’s products. Also, GCP has an AutoML tool that can be used by developers with no machine learning coding experience.</p><p><strong>BigQuery BI Engine</strong> supports the analytics team to analyze large datasets with fast query response time and high concurrency. It can be connected to Google’s visualization tool (Google Data Studio) and other products (Tableau, Qlik Looker), for analysis and report generation.</p><p>Other Google products that can be leveraged upon for a seamless analytics process are: Cloud Data Storage for tables and files, Cloud Dataproc</p><p><strong>4. Use — Data Studio for Visualization and Reporting</strong></p><p>Data Studio is a visualization and reporting tool. It enables the creation of informative and interactive reports. From other GCP analytics tools, processed and analyzed data are imported to create custom visualizations tailored to specific needs.</p><p>The platform also supports building report template, embedding reports, and publishing reports as template and connector.</p><p>In conclusion, the data-driven company can simply host its data processes on Google Cloud Platform for a seamless end-to-end operation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c899ecdf790" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>