<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Kefas Kingsley</title>
    <description>The latest articles on Forem by Kefas Kingsley (@cyberking99).</description>
    <link>https://forem.com/cyberking99</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F395642%2F6101f364-77ad-460c-97b2-966058bebd6b.jpeg</url>
      <title>Forem: Kefas Kingsley</title>
      <link>https://forem.com/cyberking99</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/cyberking99"/>
    <language>en</language>
    <item>
      <title>How I Solved a Challenging Backend Problem with PHP &amp; MySQL</title>
      <dc:creator>Kefas Kingsley</dc:creator>
      <pubDate>Fri, 28 Jun 2024 09:54:55 +0000</pubDate>
      <link>https://forem.com/cyberking99/solving-a-challenging-backend-problem-with-php-h0l</link>
      <guid>https://forem.com/cyberking99/solving-a-challenging-backend-problem-with-php-h0l</guid>
      <description>&lt;p&gt;Hello there, it's been a while since I wrote a blog post; well, here I am writing about one of the most challenging problems I encountered and an overview of how I solved it.&lt;/p&gt;

&lt;p&gt;Challenges especially ones that will get you worked up cannot be escaped as a backend developer. Recently, while working on an ad network using PHP and MySQL, I encountered a complex issue related to optimizing the Cost Per Mille (CPM) for publishers based on specific criteria. This problem tested my technical skills and provided an invaluable learning experience. In this post, I will walk you through how I solved this problem step-by-step, highlighting the challenges faced and the solutions implemented. I will be glad if there are suggestions I can get on how to efficiently implement or a better way to go about it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;The task was to adjust the publisher’s CPM based on the following criteria:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;5% increase if there are clicks from 10 different IP addresses in the last 10 minutes.&lt;/li&gt;
&lt;li&gt;8% decrease if there are clicks from the same IP address 5 times in the last 10 minutes.&lt;/li&gt;
&lt;li&gt;2% increase if there are 10 consecutive clicks from the same country.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The Solution Journey
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Understanding the Requirements
&lt;/h3&gt;

&lt;p&gt;Before jumping into the implementation, I needed a clear understanding of the requirements. I discussed with stakeholders to confirm the criteria and the desired behavior for adjusting the CPM. This initial step was crucial in planning the solution effectively.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Setting Up the Database
&lt;/h3&gt;

&lt;p&gt;I already have my database and tables created, also, the project was already live, so I just needed to add the criteria. I ensured that the database and table were set up to store and accommodate necessary information for clicks tracking. The table schema included fields for storing the click timestamp, ip address, and country code (there are other fields/columns which I wouldn't include 'cos they are not really important for the cause of this post).&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Capturing Click Data
&lt;/h3&gt;

&lt;p&gt;Next, I implemented a function to get and save the IP address and country code whenever a user clicks an ad. This data was stored in the clicks table.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Implementing the Criteria Checks
&lt;/h3&gt;

&lt;p&gt;With the data being captured, the next step was to implement the logic to check the criteria and adjust the CPM accordingly.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Checking for Unique IP Addresses
I count the unique IP addresses in the last 10 minutes using the &lt;strong&gt;COUNT&lt;/strong&gt; function and &lt;strong&gt;DISTINCT&lt;/strong&gt; keyword which evaluates expression for each row in a group and returns the number of unique, non-null values.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cd"&gt;/** 
 * Get the count of unique IP addresses in the last 10 minutes
 */&lt;/span&gt;
&lt;span class="nv"&gt;$stmt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$pdo&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;prepare&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"
    SELECT COUNT(DISTINCT ip_address) AS unique_ips
    FROM clicks
    WHERE date_time &amp;gt;= NOW() - INTERVAL 10 MINUTE
"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nv"&gt;$stmt&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nv"&gt;$unique_ips&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$stmt&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;fetchColumn&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$unique_ips&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$cpm&lt;/span&gt; &lt;span class="o"&gt;*=&lt;/span&gt; &lt;span class="mf"&gt;1.05&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="cd"&gt;/**
     * Here, I check for clicks from the same IP address
     * This is in the second condition
     * ...
     **/&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Checking for Repeated IP Addresses
I then check for repeated or non-unique IP addresses in the last 10 minutes using the SQL &lt;strong&gt;COUNT&lt;/strong&gt; function.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cd"&gt;/** 
 * Checking non-unique (repeated) IP addresses in the last 10 minutes
 * If the condition is true, decrease the CPM by 8%
 */&lt;/span&gt;
&lt;span class="nv"&gt;$stmt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$pdo&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;prepare&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"
    SELECT ip_address, COUNT(*) AS click_count
    FROM clicks
    WHERE timestamp &amp;gt;= NOW() - INTERVAL 10 MINUTE
    GROUP BY ip_address
    HAVING click_count &amp;gt;= 5
"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nv"&gt;$stmt&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nv"&gt;$repeated_ips&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$stmt&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;fetchAll&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$repeated_ips&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$cpm&lt;/span&gt; &lt;span class="o"&gt;*=&lt;/span&gt; &lt;span class="mf"&gt;0.92&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="cd"&gt;/**
     * Here, I check for consecutive clicks from the same country
     * This is in the third condition
     * ...
     **/&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Checking for Consecutive Clicks from the Same Country
Here, I apply the third criterion which is checking for consecutive clicks from the same country.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cd"&gt;/** 
 * Checking clicks from the same country consecutively
 * If the condition is true, increase the CPM by 2%
 */&lt;/span&gt;
&lt;span class="nv"&gt;$stmt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$pdo&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;prepare&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"
    SELECT country_code
    FROM clicks
    ORDER BY timestamp DESC
    LIMIT 10
"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nv"&gt;$stmt&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nv"&gt;$last_ten_clicks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$stmt&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;fetchAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;PDO&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;FETCH_COLUMN&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;array_unique&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$last_ten_clicks&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$cpm&lt;/span&gt; &lt;span class="o"&gt;*=&lt;/span&gt; &lt;span class="mf"&gt;1.02&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 5: Updating the CPM
&lt;/h3&gt;

&lt;p&gt;For this part, I update the publisher's CPM and use it to calculate his earnings for that particular click.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Outcome
&lt;/h2&gt;

&lt;p&gt;By implementing this solution, the ad network now dynamically adjusts the CPM based on click data from the user. This ensures a fair and optimized revenue model for publishers, enhancing the overall effectiveness of the ad network.&lt;/p&gt;

&lt;h2&gt;
  
  
  About Me and Why HNG Internship?
&lt;/h2&gt;

&lt;p&gt;I'm Kingsley Gbutemu Kefas, a backend developer passionate about building scalable and efficient systems. I am a problem solver, I love to learn new things and ways of doing something. As a developer, I am motivated by solving challenges, especially complex ones that make me think critically. I know &lt;a href="https://hng.tech/internship"&gt;HNG Internship&lt;/a&gt; is an opportunity for me to grow as a developer by working on real-world projects and learning from industry experts. I am excited to start my journey with HNG Internship and contribute to the tech community. I believe this journey will sharpen my skills and contribute to impactful projects and I am sure that I will benefit more from the benefits of &lt;a href="https://hng.tech/premium"&gt;HNG Premium&lt;/a&gt;. &lt;/p&gt;

</description>
      <category>hng</category>
      <category>php</category>
      <category>internship</category>
      <category>backend</category>
    </item>
    <item>
      <title>Kenya Music - The Importance of Kenya Music</title>
      <dc:creator>Kefas Kingsley</dc:creator>
      <pubDate>Sun, 30 Apr 2023 13:30:25 +0000</pubDate>
      <link>https://forem.com/cyberking99/kenya-music-the-importance-of-kenya-music-5a2k</link>
      <guid>https://forem.com/cyberking99/kenya-music-the-importance-of-kenya-music-5a2k</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--F8OgeQQ1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://upload.wikimedia.org/wikipedia/commons/3/3d/Musicians_performing_traditional_Luo_songs.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--F8OgeQQ1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://upload.wikimedia.org/wikipedia/commons/3/3d/Musicians_performing_traditional_Luo_songs.jpg" alt="Kenya Music" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Importance of Kenya Music
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://swahilisongs.com/kenya-songs/"&gt;Kenyan music&lt;/a&gt; is a diverse and vibrant reflection of the country's rich cultural heritage. The country's music is characterized by a blend of various musical styles, including traditional African rhythms, contemporary pop, and hip hop. Music plays an important role in Kenya's society, serving as a means of communication, celebration, and expression.&lt;/p&gt;

&lt;p&gt;One of the most popular genres of music in Kenya is &lt;a href="https://swahilisongs.com/tag/benga/"&gt;Benga&lt;/a&gt;, which originated in the 1940s and is characterized by its fast-paced guitar rhythms and upbeat melodies. Benga music has been influential in shaping the country's music scene, and many modern Kenyan artists continue to incorporate Benga elements into their music.&lt;/p&gt;

&lt;p&gt;Another popular genre of music in Kenya is &lt;a href="https://swahilisongs.com/?s=afro"&gt;Afro-pop&lt;/a&gt;, which is a fusion of traditional African rhythms and contemporary pop music. Afro-pop artists in Kenya have gained a significant following across the African continent and beyond, with some of them collaborating with international artists.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://swahilisongs.com/?s=hip+hop"&gt;Hip hop&lt;/a&gt; has also become increasingly popular in Kenya in recent years, with many local artists gaining recognition for their unique sound and style. Kenyan hip hop often addresses social and political issues, providing a platform for artists to express their views on a range of topics.&lt;/p&gt;

&lt;p&gt;Apart from these mainstream genres, Kenya also has a vibrant music scene for &lt;a href="https://swahilisongs.com/kenya-songs/"&gt;traditional music&lt;/a&gt;, &lt;a href="https://swahilisongs.com/kenya-gospel-songs/"&gt;gospel music&lt;/a&gt;, and other genres. The country has produced many talented musicians and bands, such as &lt;a href="https://swahilisongs.com/tag/sauti-sol/"&gt;Sauti Sol&lt;/a&gt;, &lt;a href="https://swahilisongs.com/?s=eric"&gt;Eric Wainaina&lt;/a&gt;, and &lt;a href="https://swahilisongs.com/tag/suzanna-owiyo/"&gt;Suzanna Owiyo&lt;/a&gt;, who have gained international recognition for their music.&lt;/p&gt;

&lt;p&gt;Overall, Kenyan music is a vital part of the country's cultural heritage and serves as a powerful tool for social and political expression. Whether it's Benga, Afro-pop, or hip hop, Kenyan music reflects the country's rich cultural diversity and provides a platform for local artists to showcase their talent to the world.&lt;/p&gt;

&lt;p&gt;For those interested in listening to Kenyan music, there are several websites where you can find a wide variety of Kenyan music. Some of these websites include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://highlifeng.com/"&gt;https://highlifeng.com/&lt;/a&gt; - This website offers a wide selection of African music, including Kenyan music, in different genres.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://highlifeng.com/hausa/"&gt;https://highlifeng.com/hausa/&lt;/a&gt; - This website is dedicated to Hausa music, a popular genre in northern Nigeria and neighboring countries, but also features a selection of Kenyan music.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://hausamp3songs.com/"&gt;https://hausamp3songs.com/&lt;/a&gt; - This website specializes in Hausa music but also offers a variety of African music, including Kenyan music.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://swahilisongs.com/"&gt;https://swahilisongs.com/&lt;/a&gt; - This website is dedicated to Swahili music, a popular genre in East Africa, which includes music from Kenya.&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://mdundosongs.com/"&gt;https://mdundosongs.com/&lt;/a&gt; - This website offers a wide variety of African music, including Kenyan music.&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Unifiedcamp - A Pathway For Easier and Better Learning Experience</title>
      <dc:creator>Kefas Kingsley</dc:creator>
      <pubDate>Sat, 06 Jun 2020 12:04:00 +0000</pubDate>
      <link>https://forem.com/cyberking99/unifiedcamp-a-pathway-for-easier-and-better-learning-experience-521f</link>
      <guid>https://forem.com/cyberking99/unifiedcamp-a-pathway-for-easier-and-better-learning-experience-521f</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimagehost.imageupload.net%2F2020%2F06%2F06%2F1591438301490.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimagehost.imageupload.net%2F2020%2F06%2F06%2F1591438301490.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
Unifiedcamp - A Pathway For Easier and Better Learning Experience



&lt;p&gt;UnfiedCamp is an interactive and educative platform, specifically created for students' use.
 This platform provides free school resources such as e-books, documents and tutorial videos.
  It does not only consist of that but also Forums where discussions can be held and Blog to get hold of interesting articles.&lt;/p&gt;
  

&lt;p&gt;&lt;br&gt;
  &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimagehost.imageupload.net%2F2020%2F06%2F06%2F1591438368032.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimagehost.imageupload.net%2F2020%2F06%2F06%2F1591438368032.jpg"&gt;&lt;/a&gt;&lt;br&gt;Unifiedcamp - Learn to Share and Collaborate
  &lt;br&gt;
  &lt;/p&gt;


&lt;p&gt;Unifiedcamp has different sections which makes the platform educative and exciting. Being a member of Unifiedcamp allows you enjoy the below listed features:&lt;/p&gt;
&lt;br&gt;
  
&lt;ul&gt;

  &lt;li&gt;UnifiedShare&lt;/li&gt;

  &lt;li&gt;Forum&lt;/li&gt;

  &lt;li&gt;Blog&lt;/li&gt;

  &lt;/ul&gt;


&lt;h2&gt;*. UnifiedShare:&lt;/h2&gt;
&lt;br&gt;
  &lt;p&gt;UnifiedShare is a section of Unifiedcamp which has educational resources.&lt;/p&gt;
&lt;br&gt;
  &lt;p&gt;With over 200+ E-books, UnifiedCamp Provides school materials for students to download such as PDFs, Docs, Documents, and Tutorial Videos via the UnifiedShare section.&lt;/p&gt;


&lt;h2&gt;*. Forum:&lt;/h2&gt;
&lt;br&gt;
  &lt;p&gt;At the moment there are two Forums:&lt;br&gt;
  &lt;/p&gt;
&lt;ol&gt;

  &lt;li&gt;The General Forum&lt;/li&gt;

  &lt;li&gt;The Quiz Forum&lt;/li&gt;

  &lt;/ol&gt;


&lt;h2&gt;1. The General Forum:&lt;/h2&gt;
&lt;br&gt;
  &lt;p&gt;The general forum is created for anyone to ask questions.&lt;br&gt;
   When you post (ask) a question over there, other users can answer your question (if the can be of help); there is no limit to how many answers your question(s) can get, so you can be rest assured of getting different views and positive response(s).&lt;/p&gt;
&lt;br&gt;
   &lt;p&gt;Who knows? You might be of great help to someone in need of an answer.&lt;/p&gt;


&lt;h2&gt;2. The Quiz Forum:&lt;/h2&gt;
&lt;br&gt;
  &lt;p&gt;The Quiz forum is one which consists of Past Exam questions which will be posted on a daily basis for members to answer.&lt;br&gt;You get to test your capabilities by attempting to answer you think you can answer. You can also use that as an arena to learn; for questions you have no clue, just sit back and watch others answer it so as to learn how to answer such questions (making emphasis on questions which involves calculations - I know how it irritates some people).&lt;/p&gt;
&lt;br&gt;
  &lt;p&gt;Did I mention this is my best forum?&lt;br&gt;No, I did not. Anyway, this is my favorite forum and guess why, it is because the &lt;strong&gt;Quiz Forum&lt;/strong&gt; comes attached to each question a prize. Yes, I mean a &lt;b&gt;prize&lt;/b&gt;.&lt;/p&gt;
&lt;br&gt;
  &lt;p&gt;There is a reward for answering a question correctly!!!&lt;br&gt;Now you know why this forum is my fav. Funny right? Don't think otherwise, who doesn't like getting rewarded? 😁&lt;br&gt;A little secret: "it makes me add extra effort to read". Shhhh! Don't tell no one.&lt;/p&gt;
&lt;br&gt;
  &lt;p&gt;This is all I can say about the forums but not all about &lt;strong&gt;Unifiedcamp&lt;/strong&gt;.&lt;/p&gt;


&lt;h2&gt;*. Blog:&lt;/h2&gt;
&lt;br&gt;
  &lt;p&gt;The Unifiedcamp also has a blog section where writers/bloggers can publish their articles.&lt;br&gt;You want to reach out to an audience?&lt;br&gt;You want to be heard?&lt;br&gt;You want to express yourself?&lt;br&gt;You want to create awareness?&lt;br&gt;You want to.............?&lt;br&gt;The blog section is there for you. You can write, express yourself, create awareness, and other things alike with the blog section.&lt;/p&gt;
&lt;br&gt;
  &lt;p&gt;You can publish as many articles as you want; but hey, make sure your articles are meaningful and helpful!&lt;br&gt;Nobody wants to read an article that is not meaningful and also won't be of help. So you know what to publish.&lt;/p&gt;

&lt;h2&gt;*. CourseCamp:&lt;/h2&gt;

&lt;p&gt;This is one of the most important section of the UnifiedCamp. The CourseCamp is a part of UnifiedCamp that focuses on learning.&lt;/p&gt;

&lt;p&gt;CourseCamp is an online learning and teaching environment for students. The platform was created for educational purposes which includes: Online Learning, School Books, Idea Sharing, Educational Materials, Courses and lots more. CourseCamp does not focus only on high education institution as there is provision of courses and educational materials for secondary level especially those preparing for Senior School Certificate Examination (SSCE) - UTME, WASSCE, NECO SSCE, GCE and others.&lt;/p&gt;

&lt;p&gt;Knowing that CourseCamp is an Online Tutorial Platform for all students within and around Africa. It is an arena that provides a complete learning guide for students preparing for examinations in various schools and institutions with the necessary materials and resources for learning.&lt;/p&gt;

&lt;p&gt;The vision of CourseCamp is to see that students get a better learning experience and to help impact every student's life academically while improving and making a better learning platform through which every student can learn.&lt;/p&gt;

&lt;p&gt;In addition, you can request for a tutorial on any subject or course of your choice as they provide both online and offline tutorial lessons for students.&lt;/p&gt;

&lt;p&gt;CourseCamp brings you a new and exciting way to learn and prepare for examinations, we provide online, private (one-on-one), and group tutorials (one-on-one) for students.&lt;/p&gt;
  


&lt;p&gt;The Unifiedcamp is founded in February, 2020 by &lt;a href="https://www.linkedin.com/in/seth-longe-47b548155/" rel="noopener noreferrer"&gt;Seth Michael Longe&lt;/a&gt;, a software developer and student of &lt;a href="https://www.unijos.edu.ng" rel="noopener noreferrer"&gt;University of Jos (UJ)&lt;/a&gt;, studying Computer Science; with the aim of unifying students in an educative and fun platform.&lt;br&gt;More features are still being added to Unifiedcamp, so a daily visit to the platform will help you explore and enjoy the available and soon to be added features.&lt;/p&gt;
&lt;br&gt;
  &lt;p&gt;What are you waiting for? This is the end of this article, so head over to &lt;a href="https://unifiedcamp.com" rel="noopener noreferrer"&gt;Unifiedcamp.com&lt;/a&gt; now!&lt;/p&gt;

</description>
      <category>unifiedcamp</category>
      <category>learning</category>
    </item>
    <item>
      <title>Some Interesting JavaScript Tricks You Can Try Today</title>
      <dc:creator>Kefas Kingsley</dc:creator>
      <pubDate>Fri, 05 Jun 2020 10:46:14 +0000</pubDate>
      <link>https://forem.com/cyberking99/some-interesting-javascript-tricks-you-can-try-today-4jc2</link>
      <guid>https://forem.com/cyberking99/some-interesting-javascript-tricks-you-can-try-today-4jc2</guid>
      <description>&lt;p&gt;Just like every other programming language, JavaScript has dozens of tricks to accomplish - both easy and difficult tasks. Some tricks are widely known while others are enough to blow your mind.&lt;/p&gt;

&lt;p&gt;Let's have a look at seven little JavaScript tricks you can start using today!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimagehost.imageupload.net%2F2020%2F06%2F05%2F1591353076931.jpg" class="article-body-image-wrapper"&gt;&lt;img alt="Some Interesting JavaScript Tricks You Can Try Today" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimagehost.imageupload.net%2F2020%2F06%2F05%2F1591353076931.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
Some Interesting JavaScript Tricks You Can Try Today



&lt;h2&gt;1. Get Unique Values of an Array&lt;/h2&gt;

&lt;p&gt;Getting an array of unique values is probably easier than you think:&lt;/p&gt;

&lt;pre&gt;
var j = [...new Set([1, 2, 3, 3])]
&amp;gt;&amp;gt; [1, 2, 3]&lt;/pre&gt;

&lt;p&gt;I love the mixture of rest expression and &lt;code&gt;Set&lt;/code&gt;!&lt;/p&gt;

&lt;h2&gt;2. Array and Boolean&lt;/h2&gt;

&lt;p&gt;Ever need to filter falsy values (&lt;code&gt;0&lt;/code&gt;, &lt;code&gt;undefined&lt;/code&gt;, &lt;code&gt;null&lt;/code&gt;, &lt;code&gt;false&lt;/code&gt;, etc.) out of an array? You may not have known this trick:&lt;/p&gt;

&lt;pre&gt;
myArray
    .map(item =&amp;gt; {
        // ...
    })
    // Get rid of bad values
    .filter(Boolean);&lt;/pre&gt;

&lt;p&gt;Just pass &lt;code&gt;Boolean&lt;/code&gt; and all those falsy values go away!&lt;/p&gt;

&lt;h2&gt;3. Create Empty Objects&lt;/h2&gt;

&lt;p&gt;Sure you can create an object that seems empty with &lt;code&gt;{}&lt;/code&gt;, but that object still has a &lt;code&gt;__proto__&lt;/code&gt; and the usual &lt;code&gt;hasOwnProperty&lt;/code&gt; and other object methods. There is a way, however, to create a pure "dictionary" object:&lt;/p&gt;

&lt;pre&gt;
let dict = Object.create(null);

// dict.__proto__ === "undefined"
// No object properties exist until you add them&lt;/pre&gt;

&lt;p&gt;There are absolutely no keys or methods on that object that you don't put there!&lt;/p&gt;

&lt;h2&gt;4. Merge Objects&lt;/h2&gt;

&lt;p&gt;The need to merge multiple objects in JavaScript has been around forever, especially as we started creating classes and widgets with options:&lt;/p&gt;

&lt;pre&gt;
const person = { name: 'Kefas Kingsley', gender: 'Male' };
const tools = { computer: 'Windows', editor: 'Sublime Text' };
const attributes = { handsomeness: 'Average', hair: 'Black', eyes: 'Black' };

const summary = {...person, ...tools, ...attributes};
/*
Object {
  "computer": "Windows",
  "editor": "Sublime Text",
  "eyes": "Black",
  "gender": "Male",
  "hair": "Black",
  "handsomeness": "Average",
  "name": "Kefas Kingsley",
}
*/&lt;/pre&gt;

&lt;p&gt;Those three dots made the task so much easier!&lt;/p&gt;

&lt;h2&gt;5. Require Function Parameters&lt;/h2&gt;

&lt;p&gt;Being able to set default values for function arguments was an awesome addition to [removed]&lt;/p&gt;

&lt;pre&gt;
const isRequired = () =&amp;gt; { throw new Error('param is required'); };

const hello = (name = isRequired()) =&amp;gt; { console.log(`hello ${name}`) };

// This will throw an error because no name is provided
hello();

// This will also throw an error
hello(undefined);

// These are good!
hello(null);
hello('Kingsley');&lt;/pre&gt;

&lt;p&gt;That's some next level validation and JavaScript usage!&lt;/p&gt;

&lt;h2&gt;6. Destructuring Aliases&lt;/h2&gt;

&lt;p&gt;Destructuring is a very welcomed addition to JavaScript but sometimes we'd prefer to refer to those properties by another name, so we can take advantage of aliases:&lt;/p&gt;

&lt;pre&gt;
const obj = { x: 1 };

// Grabs obj.x as { x }
const { x } = obj;

// Grabs obj.x as { otherName }
const { x: otherName } = obj;&lt;/pre&gt;

&lt;p&gt;Useful for avoiding naming conflicts with existing variables!&lt;/p&gt;

&lt;h2&gt;7. Get Query String Parameters&lt;/h2&gt;

&lt;p&gt;For years we wrote gross regular expressions to get query string values but those days are gone -- enter the amazing &lt;code&gt;URLSearchParams&lt;/code&gt; API:&lt;/p&gt;

&lt;pre&gt;
// Assuming "?post=1234&amp;amp;action=edit"

var urlParams = new URLSearchParams[removed].search);

console.log(urlParams.has('post')); // true
console.log(urlParams.get('action')); // "edit"
console.log(urlParams.getAll('action')); // ["edit"]
console.log(urlParams.toString()); // "?post=1234&amp;amp;action=edit"
console.log(urlParams.append('active', '1')); // "?post=1234&amp;amp;action=edit&amp;amp;active=1"&lt;/pre&gt;

&lt;p&gt;Much easier than we used to fight with!&lt;/p&gt;

&lt;p&gt;JavaScript has changed so much over the years but my favorite part of JavaScript these days is the velocity in language improvements we're seeing. Despite the changing dynamic of JavaScript, we still need to employ a few decent tricks; keep these tricks in your toolbox for when you need them!&lt;/p&gt;

&lt;p&gt;Now, let me hear from you.&lt;br&gt;What is/are your favorite JavaScript trick(s)?&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>Dragon Programming Language: The Introduction</title>
      <dc:creator>Kefas Kingsley</dc:creator>
      <pubDate>Mon, 01 Jun 2020 14:58:25 +0000</pubDate>
      <link>https://forem.com/cyberking99/dragon-programming-language-the-introduction-12j4</link>
      <guid>https://forem.com/cyberking99/dragon-programming-language-the-introduction-12j4</guid>
      <description>&lt;p&gt;

&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fnuD4sKs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dragon-lang.org/dta/dragon.jpg" class="article-body-image-wrapper"&gt;&lt;img alt="The Dragon Programming Language" src="https://res.cloudinary.com/practicaldev/image/fetch/s--fnuD4sKs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dragon-lang.org/dta/dragon.jpg" width="297" height="204"&gt;&lt;/a&gt;Dragon Programming Language


&lt;/p&gt;

&lt;p&gt;Hello guys, I'm here with a new article. Today I will introducing you guys to a new and interesting programming language called "&lt;strong&gt;Dragon&lt;/strong&gt;".&lt;/p&gt;

&lt;p&gt;I know most of you might have not heard of this programming language and what you all know is that "Dragon is just a fire breathing creature", but not to worry as I will introduce you to what Dragon is and is about to be.&lt;br&gt;Enough of the talk!&lt;/p&gt;


&lt;h2&gt;What is Dragon?&lt;/h2&gt;
Dragon is an innovative and practical general-purpose, multi-paradigm scripting language.
It supports multiple programming paradigms such as imperative, object-oriented, functional, natural programming, and declarative programming using nested structures.&lt;br&gt;
The language is portable (Windows, Linux, Mac OS X, Android, etc.) and can be used to create console and GUI applications.
The language is designed to be simple, small, flexible, and fast. 
It is a dynamically- and weakly-typed language that interprets the source code through the &lt;b&gt;JVM&lt;/b&gt; or &lt;b&gt;LLVM&lt;/b&gt;.&lt;br&gt;
The first version of the language was released on &lt;b&gt;January 4th, 2018&lt;/b&gt;.
&lt;p&gt;The language is simple, trying to be natural, encourage organization and comes with transparent and visual implementation.
&lt;br&gt;It comes with compact syntax and a group of features that enable the programmer to create natural interfaces and declarative domain-specific languages in a fraction of time.
It is very small, fast and comes with smart garbage collector that puts the memory under the programmer control.
It supports many programming paradigms, comes with useful and practical libraries.
The language is designed for productivity and developing high quality solutions that can scale.&lt;/p&gt;
&lt;p&gt;Dragon is "Designed for a Clear Goal".
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Applications programming language.&lt;/li&gt;
&lt;li&gt;Productivity and developing high quality solutions that can scale.&lt;/li&gt;
&lt;li&gt;Small and fast language.&lt;/li&gt;
&lt;li&gt;Simple language that can be used in education.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Also Dragon is influenced by these programming languages:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Lua&lt;/li&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;li&gt;Ruby&lt;/li&gt;
&lt;li&gt;Java&lt;/li&gt;
&lt;li&gt;QML&lt;/li&gt;
&lt;li&gt;Ring&lt;/li&gt;
&lt;/ul&gt;



&lt;h2&gt;Features of Dragon:&lt;/h2&gt;
&lt;p&gt;The Dragon language comes with these features&lt;/p&gt;
&lt;p&gt;💡Tip:&lt;/p&gt;
&lt;p&gt;The language is ready for production!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Interpreter&lt;/li&gt;
&lt;li&gt;Declarative programming on the top of Object-Oriented programming&lt;/li&gt;
&lt;li&gt;No explicit end for statements (No ; or ENTER is required)&lt;/li&gt;
&lt;li&gt;Portable (Windows, Linux &amp;amp; Mac OS X)&lt;/li&gt;
&lt;li&gt;Comments (One line ,In-line &amp;amp; Multi-lines)&lt;/li&gt;
&lt;li&gt;Dynamic Typing&lt;/li&gt;
&lt;li&gt;Weakly typed&lt;/li&gt;
&lt;li&gt;Default scope for variables inside functions (Local)&lt;/li&gt;
&lt;li&gt;Default scope for variables outside functions (global)&lt;/li&gt;
&lt;li&gt;Garbage Collector - Automatic Memory Management (Escape Analysis and Reference Counting)&lt;/li&gt;
&lt;li&gt;Structure Programming&lt;/li&gt;
&lt;li&gt;Rich control structures &amp;amp; Operators&lt;/li&gt;
&lt;li&gt;No Main Function&lt;/li&gt;
&lt;li&gt;Call Function before the definition&lt;/li&gt;
&lt;li&gt;Recursion&lt;/li&gt;
&lt;li&gt;Multi-line literals&lt;/li&gt;
&lt;li&gt;Reflection and Meta-programming&lt;/li&gt;
&lt;li&gt;Clear program structure (Statements then functions)&lt;/li&gt;
&lt;li&gt;Exception Handling&lt;/li&gt;
&lt;li&gt;I/O commands&lt;/li&gt;
&lt;li&gt;Math functions&lt;/li&gt;
&lt;li&gt;String functions&lt;/li&gt;
&lt;li&gt;Standard functions&lt;/li&gt;
&lt;li&gt;File processing functions&lt;/li&gt;
&lt;li&gt;Database support&lt;/li&gt;
&lt;li&gt;Create GUI Applications for Desktop&lt;/li&gt;
&lt;li&gt;.dgn file extension&lt;/li&gt;
&lt;/ul&gt;



&lt;h2&gt;Simple Syntax&lt;/h2&gt;
Dragon is a very simple language, and has a very straightforward syntax.
&lt;br&gt;It allows programmers to program without boilerplate code.
&lt;p&gt;To print/display something to the screen using the standard output, we use the '&lt;b&gt;show&lt;/b&gt;' command and '&lt;b&gt;showln&lt;/b&gt;' for output in newline.
&lt;br&gt;
&lt;b&gt;Example:&lt;/b&gt;
&lt;/p&gt;

&lt;pre&gt;&lt;span&gt;show&lt;/span&gt; "Hello, World!"&lt;/pre&gt;

&lt;p&gt;&lt;b&gt;Output&lt;/b&gt;&lt;/p&gt;

&lt;pre&gt;
&lt;span&gt;Hello, World!&lt;/span&gt;&lt;/pre&gt;
            

&lt;p&gt;For taking input, we can use '&lt;b&gt;readln()&lt;/b&gt;' method which is in the '&lt;b&gt;std&lt;/b&gt;' library.
&lt;br&gt;
&lt;b&gt;Example:&lt;/b&gt;
&lt;/p&gt;
&lt;pre&gt;&lt;span&gt;select&lt;/span&gt; "std"
&lt;span&gt;show&lt;/span&gt; "Say Something: "
a = readln()
&lt;span&gt;showln&lt;/span&gt; a 
&lt;/pre&gt;

&lt;p&gt;&lt;b&gt;Output:&lt;/b&gt;&lt;/p&gt;

&lt;pre&gt;Say something: I Love Dragon!

I Love Dragon!&lt;/pre&gt;



&lt;p&gt;Awesome right?&lt;br&gt;
If you will like to know more about &lt;b&gt;Dragon&lt;/b&gt;, you can visit the official website &lt;a href="https://dragon-lang.org/"&gt;Dragon-lang.org&lt;/a&gt;.
&lt;br&gt;&lt;br&gt;
Well, that is it about &lt;b&gt;Dragon&lt;/b&gt; 🐉.&lt;br&gt;
&lt;/p&gt;

</description>
      <category>dragon</category>
      <category>beginners</category>
      <category>dragonlang</category>
    </item>
  </channel>
</rss>
