<?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 Christ on Medium]]></title>
        <description><![CDATA[Stories by Christ on Medium]]></description>
        <link>https://medium.com/@christlloyd.here?source=rss-1d4a61ebf769------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Zq3d2zx5y27Hm50iDcKuPw.jpeg</url>
            <title>Stories by Christ on Medium</title>
            <link>https://medium.com/@christlloyd.here?source=rss-1d4a61ebf769------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 23:34:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@christlloyd.here/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[Ever wondered how those Search Engines go beat a sweat to find the song(s) that goes like lalala?]]></title>
            <link>https://medium.com/@christlloyd.here/ever-wondered-how-those-search-engines-go-beat-a-sweat-to-find-the-song-s-that-goes-like-lalala-d9c421872e42?source=rss-1d4a61ebf769------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9c421872e42</guid>
            <category><![CDATA[dns]]></category>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[google-chrome]]></category>
            <category><![CDATA[search-engines]]></category>
            <category><![CDATA[browsers]]></category>
            <dc:creator><![CDATA[Christ]]></dc:creator>
            <pubDate>Fri, 22 Nov 2024 15:24:38 GMT</pubDate>
            <atom:updated>2024-11-22T17:35:26.774Z</atom:updated>
            <content:encoded><![CDATA[<h3>Ever wondered how those Search Engines go beat a sweat to find the song(s) that goes like lalala? | Browsers, Search engines, DNS, Data, Advertisements</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FxnGdVs7j2h_agzg-t1Oaw.png" /></figure><p>US Justice Department wants Google to Sell Chrome, But Why? Monopolization, is the answer. And it, not monopolization particularly, piqued my interest to write this.</p><p>Well the scope of the article is not to discuss if Chrome should be sold or not but rather about <strong>Browsers, Search engines, Websites, the Data they operate on, what happens under the hood when you ask for your “the song that goes like lalala” or “what’s my crush’s id” query and how the corporations that owns these browsers and search engines are benefitted</strong>. but don’t worry, though it may contain some tech jargons, I’ll make sure to keep it simple and be not so techy techy.</p><p>So lets start with browsers. Though browsers like Chrome, Edge, Brave are what we interact with to access the internet, they do not do all the underlying works. They act as a gateway for us to access the so called world wide web or the internet and display the contents of it. When you want to access a website and you know its address, the URL (Uniform Resource Locator), you would probably type it in the browser’s address bar. But the browser wouldn’t exactly know where it’s resources are stored, So it queries the URL to the DNS (Domain Name System) Resolver, The DNS Resolver then again queries it to the appropriate Root Server, The Root Server then provides the details on which TLD Servers to look, to get the details of the Nameservers, and that in turn provides the address, the IP address, where the actual web server which serves the resource is located. And once the address of the URL has been known, the browser then directly communicates with the web server. The web server then serves the contents. The Browser, gets the content and renders it to our eyes.</p><h4><strong>Now that’s quite a lot of technical words, Let me go through it again, but with an example this time.</strong></h4><p>Lets say you want to access a website and you know the URL to it, say <a href="http://www.cats.com/">www.cats.com</a> which serves cute cat pics and videos. But neither you nor the browser know the IP address of the server that serves the cat contents, yet. So the browser relies on a DNS resolver, which does the job of communicating with the DNS Servers and converting the <a href="http://www.cats.com/">www.cats.com</a> to it’s IP address, say 192.168.1.1.</p><p>The DNS Servers, the Root and TLD Servers plays a major role in resolving the IP address. The Root Server, contains the details about the TLD (Top Level Domain) Servers, here the .com is the TLD, So the root server provides the pointer of the TLD Server which holds the details of the Authoritative Nameservers. These Nameservers are managed by the hosting provider or the domain owner where the website owner would have mapped its domain name to its webserver’s IP address. And with the actual address found now, the browser can now directly communicate with the webserver.</p><h4>Now Search Engines, What is the use of them?</h4><p>Lets say you want to access a resource or relevant resources in the internet but you don’t know the URLS of those resources, The Search Engine helps you with that. The Search Engine basically contains the index of keywords and its relevant resources. Bu-But- how does these search engines index these resources based on the keywords and relevancies? It uses crawlers, so called bots! that goes through a website and fetches all the possible URLS, its contents and other information. Now with the given information it builds an index based on the contents, keywords and relevancies and ranks them accordingly with that of the resources/URLS that have similar contents. That’s why keywords and meta data are important if you want your desired search engine to rank and pick up your website. And that’s the job of SEO (Search Engine Optimization).</p><p>The Search Engine performs this crawling once a while and keep its indices updated or you could even manually provide the Search Engine with the details about your resources and contents and keep track of how it performs. For google you it can be done through <strong>Google Search Console</strong>. Also you could even block ethical crawlers from crawling your website or specific pages with help of robots.txt and other meta tags.<br><strong>so its all about data, bots and ranking algorithms.</strong></p><h4>So what do these organizations that help you get your eyes and ears on what you want, benefits from?</h4><p><strong>TLDR; Data, Advertisements, Eco System lock in, promoting services.</strong></p><p>Keywords, contents and who’s accessing it and where is it being accessed from and what platforms are they accessing it from, when are they accessing it, how many times it is being accessed.</p><p>Advertisers could easily advertise their products or resources with better accuracy and targets with the help of all these Data. that’s one way to earn. now what’s <strong>Eco System Lock in</strong>? Products and Services offered by a corporation can be collectively called as an Eco System. Lets take Google LLC for example. they do have a Web browser (Chrome), Search engine (Google), Cloud Storage (Google Drive), Email Client (Gmail), Video Streaming service (YouTube), etc.,. now that’s an Eco system! Apple and Microsoft have their own Eco System. Though some of the services are partially available for free you can always opt in for paid services that offers better performance and services. And now that as well brings money into their accounts.</p><p>So take Chrome, Everywhere and everything at one place and there is much more to it. But now, I believe you would get an idea of why the US DOJ wants Google to Sell Chrome.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9c421872e42" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Boxing, Unboxing, Memory allocations and System.InvalidCastException | C#]]></title>
            <link>https://medium.com/@christlloyd.here/boxing-unboxing-memory-allocations-and-system-invalidcastexception-c-7a05e2bb36c9?source=rss-1d4a61ebf769------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a05e2bb36c9</guid>
            <category><![CDATA[reference-type]]></category>
            <category><![CDATA[memory-allocation]]></category>
            <category><![CDATA[c-sharp-programming]]></category>
            <category><![CDATA[boxing-and-unboxing]]></category>
            <category><![CDATA[type-casting]]></category>
            <dc:creator><![CDATA[Christ]]></dc:creator>
            <pubDate>Sat, 15 Jun 2024 18:55:29 GMT</pubDate>
            <atom:updated>2024-06-15T18:55:29.369Z</atom:updated>
            <content:encoded><![CDATA[<h3>Boxing, Unboxing, Memory allocations and System.InvalidCastException: Specified cast is not valid | C#</h3><p>So I was working on my project and I was supposed to retrieve a value from a dictionary which stored it’s values as Objects. My value was a floating point numeric and since I blindly assumed it must be of type double, as I mostly use type double for floating point values in my project, I casted it to a double. well what happened next? Tadaaa!! The compiler threw the below exception.</p><pre>System.InvalidCastException: Specified cast is not valid</pre><p><strong>TLDR</strong>; The exception is pretty straight forward and you could figure it out that it has something to do with the casting. So, yea, I should have unboxed the Object as a decimal instead of a double or a float as the unboxing type must be the same as that of the one it was boxed with.</p><p>But if you are not aware of boxing and unboxing, worry not, because I&#39;m going to dive a little bit deep and write a bit about boxing, unboxing and few other questions that occurred to me.</p><h4>Memory Allocations, Boxing and Unboxing:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*rw4JI5UbU63olEVJc1HZtw.jpeg" /><figcaption>get it?! boxing? ha ha (From Hajime no Ippo)</figcaption></figure><p>Well C# basically categorizes it’s data into 3 types. The One that stores the values of a variable, The Value types! The One that stores the reference to a variable, The Reference types! And the One that stores the address of a variable, The Pointer types.</p><p>The Value types are stored in the Stack memory of the Main memory. And the stack is specific to threads, as in it’s not shared among the other threads and it basically holds the method call frames, information regarding the method execution, vaguely speaking and local variables and parameter values. And when the control leaves the block or lets say a method, the items would pop out of the stack, as in they would be destroyed or you can call it deallocated, unlike a heap memory.</p><p>Now now why unlike a heap memory? what does it do? How’s it different? The Heap Memory is used to allocate memory and store values that are larger or complex than the value types as it doesn’t have a size restriction and unlike value types it is comparatively and slightly slower than the stack to read and write. So, the values of reference type variables are stored in the heap memory of the Main memory and the reference to their addresses are stored in the Stack memory and wont be destroyed or deallocated like a value in the Stack memory. well well at least until the Garbage Collection comes into the play i.e. When it goes out of scope, it’s reference in the Stack will be destroyed but the actual allocated memory in the heap wont be deallocated until garbage collection does its magic. And the garbage collection, you know? he.. oh wait, I believe we are drifting away from the scope of this article.</p><p>So, Boxing, huh? Remember how I mentioned the value types go into stack memory and reference types into heap memory? Well we do have a little trick to do the otherwise. The Value types can be converted to Object type, the most basic of types in C# or as the Microsoft states it as</p><blockquote>This is the ultimate base class of all .NET classes; it is the root of the type hierarchy</blockquote><p>And when a value type is converted into an Object type it is said to be <strong>boxed</strong> and when the Object type is again converted to its value type, it’s said to be <strong>unboxed</strong>. So, the value of a value type could now be stored in the heap.</p><p>But why? why can’t my little int or my other value types be peaceful and stay as they are?? Well they can but what if you want your beloved value types to get out of their comfort zone and fly high? What if we want to pass it to an API method that accepts Objects as its parameters as to stay as a type — neutral method? And also there are these non generic data structures like ArrayList which allows us to store values of different types in the same collection. Been curious on how it does that? Now you should know. The cat, meow, is out of the bag. Oh never mind its documented and publicly available.</p><p>So, yea, It boxes its value before storing them into the collection. But it comes with a slight drawback in performance when compared to the Generic collections Like List&lt;int&gt;, due to the boxing and all.</p><p>Now, How do you box?</p><h4>Boxing 101: The Guide to Box</h4><p>Front toe and back heal on the center line, evenly distribute your weight to both of your legs.. ha ha ha. Alright no more dad jokes.</p><p>Lets say we have our nice little variable of type int called number and I say we box him.</p><pre>int number = 7; //declaring our variable and assigning him a value.<br>Object boxedValue = number; //boxing a value of type int.</pre><p>Yup, It’s as simple as that and now now how do I unbox him?</p><pre>int number = 7; //declaring our variable and assigning him a value.<br>Object boxedValue = number; //boxing a value of type int.<br>int unboxedNumber = (int)boxedValue; //unboxing.</pre><p>So, what&#39;s with this <em>System.InvalidCastException: Specified cast is not valid </em>Exception<em>?</em></p><p>Well the rule about boxing is that <strong>the unboxing type must be the same as that of the one that it was boxed with</strong>. In our above example, We boxed an int and while unboxing, We did explicitly cast it into an int and assigned it to a variable of type int. In my case, while I tried to retrieve a floating point number from the dictionary which stored it’s values as objects, I assumed it as double out of practice and casted the object into double as</p><pre>var myValue = (double)exampleDictionary[&quot;KeyofMyValue&quot;];</pre><p>And so, the exception was thrown. Only upon looking at its type, I came to know that it was of type decimal and not the other floating point number types.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a05e2bb36c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Do you know people can track your emails? if so, How can you make a tracker in python?]]></title>
            <link>https://medium.com/@christlloyd.here/do-you-know-people-can-track-your-emails-if-so-how-can-you-make-a-tracker-in-python-4178aa3621a4?source=rss-1d4a61ebf769------2</link>
            <guid isPermaLink="false">https://medium.com/p/4178aa3621a4</guid>
            <category><![CDATA[flask-framework]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[pixel-tracker]]></category>
            <category><![CDATA[web-bug]]></category>
            <category><![CDATA[email-trackers]]></category>
            <dc:creator><![CDATA[Christ]]></dc:creator>
            <pubDate>Sat, 14 Jan 2023 09:42:56 GMT</pubDate>
            <atom:updated>2024-09-10T04:18:31.455Z</atom:updated>
            <content:encoded><![CDATA[<h3>Do you know people can track your emails? if so, here’s how you can make a tracker in python</h3><p>Well, If you don’t know the answer to my former question, the answer is yes, They can! and all it takes for someone to track your email is an image the size of a pixel and a server, where it is located, to record the requests.</p><p>If it wasn’t because of my friend, I wouldn’t have known these existed in the first place either. He came across some email tracking extensions that are available in the internet and it wasn’t so long before I stumbled across this thing in an email that was tagged as a spam.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*qJK7O903EMGsyHhzKfWIgA.png" /><figcaption>an email with a web bug/pixel tracker</figcaption></figure><h4>A Tracker Image? That seems fishy.</h4><p>A tracker image is a web bug (not your typical bug) that loads its image from a different webserver. This could be used to monitor the user’s activity by obtaining the time it was viewed, the IP that made the request and much more. So, on opening an email with a web bug, it let’s the sender know that the email has been opened by the recipient, along with the other information that the sender can obtain from the request.</p><p>These tracker images are often pixels of dimension 1x1 that are included in the HTML code of a web page or an email that loads every time they are viewed. To load the image, the <em>&lt;img&gt;</em> tag sends an HTTP request to the host web server. The hosted server URL is assigned to the <em>src</em> attribute of the <em>&lt;img&gt;</em> tag. An HTTP request is a client-server protocol that is used between the web browsers and web servers to exchange data such as HTML. And, on monitoring the incoming requests in the hosted server, to get the image, the activity can be logged.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T7wnotMAy6WNw-SArsgKdw.gif" /><figcaption>(GIF) An html page embedded with a web bug sending HTTP GET request to a localhost server on page refreshes</figcaption></figure><p>For this to be used in an email, we will have to write an email that supports its content in the HTML. Luckily, emails support its contents in three formats.</p><ol><li>Plain text</li><li>Rich text</li><li>HTML</li></ol><p>An email could have its content written in any combinations, of these formats.</p><p>The following is an example body of an email, written in the HTML with the <em>src</em> attribute in the <em>&lt;img&gt;</em> tag is assigned with an example hosted server. An HTTP GET request is made to the hosted server, along with some additional parameters such as the recipient&#39;s email address and the subject of the email.</p><pre>&lt;html&gt;<br>  &lt;head&gt;&lt;/head&gt;<br>  &lt;body&gt;<br>    &lt;p&gt;Greetings!&lt;br&gt;<br>        Roses are red,&lt;br&gt;<br>        Violets are blue.&lt;br&gt;<br>        It&#39;s been so long, So&lt;br&gt;<br>        How are you?&lt;br&gt;<br>        Love,&lt;br&gt;<br>        Christ S.&lt;br&gt;<br>    &lt;/p&gt;<br>    &lt;img src=&quot;https://example_server/?to=example@gmail.com&amp;sub=exampleSubject&quot; width=&quot;1px&quot; height=&quot;1px&quot; alt=&quot;image tracker&quot;&gt;<br>  &lt;/body&gt;<br>&lt;/html&gt;</pre><p>If the image is hosted in some third party sever, we will not have any low level controls on the requests. So we need to create a server of our own to have full control over the requests. Any HTTP server would do the work but in this article I have created and used a flask web application, to route and process the incoming requests and notify me by sending an email.</p><p>To get started with flask, <em>pip install flask</em> in your python virtual environment. Create a flask app, define the route and its function as shown below.</p><pre>from flask import Flask<br>from flask import request<br>from datetime import datetime<br><br>app = Flask(__name__)<br>@app.route(&#39;/&#39;, methods=[&#39;GET&#39;])<br>def zero():<br>    to = request.args.get(&#39;to&#39;)<br>    sub = request.args.get(&#39;sub&#39;)<br>    on = datetime.now()<br>    send_email(to,sub,on)<br>    return &#39;&lt;img src=&quot;&quot;  /&gt;&#39;<br><br>if __name__ == &#39;__main__&#39;:<br>    app.run()</pre><p>The send_email() function is defined to send an email, with the data that’s been obtained from the HTTP request, such as the recipient’s email address and the subject of the email. I have used my Gmail account to log in to the Gmail sever and send the email using the python’s smtplib module.</p><pre>from email.mime.multipart import MIMEMultipart<br>from email.mime.text import MIMEText<br>import smtplib<br><br>def send_email(to,sub,on):<br>    me = &quot;your_email&quot;<br>    msg = MIMEMultipart(&#39;alternative&#39;)<br>    msg[&#39;Subject&#39;] = f&quot;{to} read your email.&quot;<br>    msg[&#39;From&#39;] = me<br>    msg[&#39;To&#39;] = me<br>    text=f&quot;The email u sent to {to} subjected as {sub} has been read on {on}.&quot;<br>    part = MIMEText(text, &#39;plain&#39;)<br>    msg.attach(part)<br>    mail = smtplib.SMTP(&#39;smtp.gmail.com&#39;, 587)<br>    mail.ehlo()<br>    mail.starttls()<br>    mail.login(&#39;username&#39;,&#39;password&#39;)<br>    mail.sendmail(me, me, msg.as_string())<br>    mail.quit()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*oegUdy8Mw1fB0XD8w_8_QQ.png" /></figure><p>You can also write a python script to compose and send emails, so that you don’t have to specify all the parameters that you use in your HTTP requests, manually.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YYlqxYobyKHpwpDbM4wzoQ.gif" /><figcaption>(GIF) working prototype of the email tracker</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4178aa3621a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Make python to wish your friends a happy birthday on their birthday nights]]></title>
            <link>https://medium.com/@christlloyd.here/make-python-to-wish-your-friends-a-happy-birthday-on-their-birthday-night-8c5efa83803d?source=rss-1d4a61ebf769------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c5efa83803d</guid>
            <category><![CDATA[projects]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[web-automation]]></category>
            <dc:creator><![CDATA[Christ]]></dc:creator>
            <pubDate>Sat, 19 Mar 2022 20:17:40 GMT</pubDate>
            <atom:updated>2022-03-20T12:23:59.190Z</atom:updated>
            <content:encoded><![CDATA[<h3>Make python wish your friends a happy birthday on their birthday nights</h3><p>Ever since mobile phones started remembering things for us, we cared less to remember from phone numbers to birthdates and yes of course we cant really have all those 500 phone numbers or birthdays of 50 people in our memory and text them at their birthday nights without being confused.</p><p><em>But! what if you schedule a python script to do it for you? and that is what this post is about.</em></p><h4>Before we dive into the code let me just list out the libraries, modules and other applications that are necessary for us to carry out the automation<em>.</em></h4><ol><li><strong>Python:</strong><br>Well duh, that’s what we are going to code on.</li><li><strong>Selenium:</strong><br>This is an open source python library which lets us to automate the browsers.</li><li><strong>Web Browser and the driver for the browser:</strong><br>Here I have automated Google Chrome, the same shall be done with any selenium supported browsers. It is the web driver on which the selenium interacts to automate web browser. Make sure the driver is compatible with your browser version.</li><li><strong>A WhatsApp Account:</strong><br>Given Mostly everyone owns a WhatsApp account so I have chosen this as the medium to send the birthday wish.<br>So both the sender(us) as well the receiver (your friends) should own a WhatsApp account. <em>Well incase you wish the text to be sent as an SMS, you shall automate chrome to send it via google messages for web with few changes in the code.</em></li><li><strong>Pandas:</strong><br>Pandas is basically a library which is used for data manipulation and analysis. This is by which we are going to read the CSV(Comma Separated Values) file. The CSV file would contain the name of the person, their phone number, the message that has to be sent to them and the birthdate.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wvufmZXL_ygUC088nVgcjg.png" /><figcaption>Content format of the CSV file (image)</figcaption></figure><h4>Now lets take a look at how our scripts are going to work.</h4><p>Yes scripts, plural, two of them.</p><p>The first one is a setup script which will let us to login into our WhatsApp web and saves the user data so that our main script need not ask us to login for every time it tries to send a text.<br>This shall be used only to setup the senders WhatsApp account and need not be run again until the sender is to be changed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uI3yTS7bLkR-u9c6T63HXg.gif" /><figcaption>The setup script (GIF)</figcaption></figure><p>The second script, the main script, is where the actual automation happens.<br>The main script will check for the CSV file, once per day, to know if anyone from the data set has their birthdays in the next day and if its the case then their details are alone retrieved from the file and are stored in a list.</p><p>And at the 24th hour (12 AM, next day), the script would automate the browser to log in into our WhatsApp and send the messages to the people who are present in the list and this loops infinitely.</p><p>The script must be left to run in the background for it to do what it was meant to do completely i.e. to look for the birthdates and wish them all days.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f8Ygkgyw9KQHjm2mvSK-Yg.gif" /><figcaption>automation of sending messages(GIF)</figcaption></figure><p><strong>The code</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/08e7847b06ea487e3ff19d8f5274da3e/href">https://medium.com/media/08e7847b06ea487e3ff19d8f5274da3e/href</a></iframe><p><strong>Conclusion:</strong><br>Well yeah! now python does our job on remembering and wishing our friends on their birthdates without fail with a few lines of code and Its fun for a project but ….I personally would suggest you to ring up to them and put a smile on their face :)</p><p>Happy coding ❤</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c5efa83803d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>