<?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 Khurram Ayubi Butt on Medium]]></title>
        <description><![CDATA[Stories by Khurram Ayubi Butt on Medium]]></description>
        <link>https://medium.com/@khurram-ayubi?source=rss-8239a3562194------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*YNpOIifdC0zIGMgRKSB-Nw.jpeg</url>
            <title>Stories by Khurram Ayubi Butt on Medium</title>
            <link>https://medium.com/@khurram-ayubi?source=rss-8239a3562194------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 21:01:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@khurram-ayubi/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[ExamBlitZ Privacy Policy]]></title>
            <link>https://khurram-ayubi.medium.com/examblitz-privacy-policy-e0e3f78f8510?source=rss-8239a3562194------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0e3f78f8510</guid>
            <dc:creator><![CDATA[Khurram Ayubi Butt]]></dc:creator>
            <pubDate>Sat, 14 Dec 2024 21:19:54 GMT</pubDate>
            <atom:updated>2024-12-14T21:19:54.481Z</atom:updated>
            <content:encoded><![CDATA[<h3>Last Updated: December 14, 2024</h3><p>ExamBlitz (“we,” “our,” or “us”) is committed to protecting your privacy. This Privacy Policy explains how we collect, use, and safeguard your information when you use our app, ExamBlitz.</p><h3>1. Information We Collect</h3><h3>1.1 Personal Information</h3><p>We collect the following personal information during account creation:</p><ul><li><strong>Name</strong>: Used to personalize your account.</li><li><strong>Email Address</strong>: Used for authentication and account management.</li></ul><p>We do not collect any other personal information.</p><h3>1.2 Automatically Collected Information</h3><p>We use Firebase, RevenueCat, and Google Gemini LLM, which may collect certain data in compliance with their respective privacy policies. These services may gather device information, app usage data, and crash analytics.</p><h3>2. How We Use Your Information</h3><ul><li><strong>Account Management</strong>: To create and manage your account.</li><li><strong>Service Provision</strong>: To deliver app features, including creating and managing exams.</li><li><strong>Subscription Management</strong>: To manage subscriptions and provide access to Pro features via RevenueCat.</li></ul><h3>3. Data Sharing</h3><p>We do not share your personal information with third parties except as required for:</p><ul><li><strong>Service Providers</strong>: Firebase, RevenueCat, and Google Gemini LLM, for app functionality.</li><li><strong>Legal Obligations</strong>: Compliance with applicable laws or legal requests.</li></ul><h3>4. Data Retention</h3><ul><li><strong>Account Data</strong>: Retained until you delete your account.</li><li><strong>Exam Data</strong>: Exams you create may become part of a public catalog. These templates are anonymized and are not tied to your account after deletion.</li></ul><h3>5. Account Deletion</h3><p>Users can delete their account within the app. However, any exams created by the user may remain in the catalog as anonymized templates.</p><h3>6. Security</h3><p>We use Firebase’s secure backend services and industry-standard practices to safeguard your data. However, no method of transmission or storage is entirely secure, and we cannot guarantee absolute security.</p><h3>7. Updates to This Policy</h3><p>We may update this Privacy Policy from time to time. You will be notified of significant changes through in-app notifications, where you may be required to accept the updated policy.</p><h3>8. Contact Us</h3><p>For questions about this Privacy Policy, contact us at: <strong>Email</strong>: <a href="/service/mailto:examblitzapp@gmail.com">examblitzapp@gmail.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0e3f78f8510" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ExamBlitZ Terms of Use]]></title>
            <link>https://khurram-ayubi.medium.com/examblitz-terms-of-use-73903025dec8?source=rss-8239a3562194------2</link>
            <guid isPermaLink="false">https://medium.com/p/73903025dec8</guid>
            <dc:creator><![CDATA[Khurram Ayubi Butt]]></dc:creator>
            <pubDate>Sat, 14 Dec 2024 21:17:30 GMT</pubDate>
            <atom:updated>2025-01-06T21:41:31.455Z</atom:updated>
            <content:encoded><![CDATA[<h3>Terms of Use</h3><h4>Last Updated: 11/12/2024</h4><p>These Terms of Use (“Terms”) govern your access to and use of ExamBlitz (the “App”). By using the App, you agree to be bound by these Terms.</p><h4>1. Account Registration</h4><p>- <strong>Eligibility</strong>: The app is available to all users. By registering, you confirm that the information you provide is accurate and complete.<br>- <strong>Account Security</strong>: You are responsible for maintaining the confidentiality of your account credentials and for all activities under your account.</p><h4>2. Pro Membership and Subscriptions</h4><p><strong>Pro Membership and Subscriptions</strong></p><ul><li><strong>Features:</strong> Pro users gain access to advanced features, including unlimited exam creation and adaptive exams.</li><li><strong>Pricing:</strong> Subscription options are available as monthly and yearly subscriptions, with prices displayed at the point of purchase.</li><li><strong>Billing and Auto-Renewal:</strong></li><li>Payment will be charged to your Apple ID account at confirmation of purchase.</li><li>Subscriptions automatically renew unless auto-renew is turned off at least 24 hours before the end of the current billing period.</li><li>Your account will be charged for renewal within 24 hours before the current period ends.</li><li>Manage or cancel subscriptions in your Apple account settings.</li><li><strong>Refunds:</strong> Refund requests are handled by Apple. Contact Apple Support for assistance.</li></ul><h4>3. User Responsibilities</h4><p>- <strong>Content</strong> <strong>Ownership</strong>: Exams you create are owned by you. However, they may be anonymized and added to the catalog as templates.<br>- <strong>Prohibited</strong> <strong>Actions</strong>:<br> — Reverse engineering or tampering with the app to access Pro features without a subscription.<br> — Engaging in fraudulent activities or attempting to misuse the app.</p><h4>4. Account Termination</h4><p>We may terminate your account if:<br>- You violate these Terms.<br>- You attempt to access Pro features without a valid subscription.<br>- You engage in fraudulent or prohibited activities.</p><h4>5. Limitation of Liability</h4><p>- ExamBlitz is provided “as is.” We are not responsible for:<br> — Any data loss, interruptions, or errors.<br> — Exam content accuracy or outcomes resulting from the use of the app.<br>- To the fullest extent permitted by law, we disclaim all liabilities related to app use.</p><h4>6. Dispute Resolution</h4><p>- Users can contact customer support at [Insert Customer Support Email] for assistance with disputes.<br>- We will make reasonable efforts to resolve issues promptly.</p><h4>7. Updates to These Terms</h4><p>We reserve the right to modify these Terms. You will be notified of significant changes and may be required to accept the updated Terms to continue using the app.</p><h4>8. Privacy policy</h4><p>The updated privacy policy can be viewed at <a href="https://khurram-ayubi.medium.com/examblitz-privacy-policy-e0e3f78f8510">https://khurram-ayubi.medium.com/examblitz-privacy-policy-e0e3f78f8510</a></p><h4>9. Contact Us</h4><p>For questions about these Terms, contact us at:<br><strong>Email:</strong> examblitzapp@gmail.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73903025dec8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Particle Swarm Optimization In Java]]></title>
            <link>https://khurram-ayubi.medium.com/particle-swarm-optimization-in-java-fc51e4acadc7?source=rss-8239a3562194------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc51e4acadc7</guid>
            <category><![CDATA[pos]]></category>
            <category><![CDATA[particle-swarm]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Khurram Ayubi Butt]]></dc:creator>
            <pubDate>Sat, 12 Dec 2020 20:19:10 GMT</pubDate>
            <atom:updated>2020-12-12T20:22:37.496Z</atom:updated>
            <content:encoded><![CDATA[<p>A simple introduction to understanding Particle swarm optimization (PSO) and learning to implement it (in Java).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KI0shwjrZFw01O8-" /></figure><h3>Introduction</h3><p>Particle swarm optimization (PSO) is a stochastic population based metaheuristic algorithm, inspired from the behaviour of fish schooling and flocking of birds. It was first developed by Kennedy and Eberhert in 1995, as a method to simulate social behaviour based on bird flocking and fish schooling.</p><p>The term <em>“particle” </em>in PSO refers to a simple entity which represents a candidate solution and these particles are moved around the n-dimensional search space. Each particle has a position (in n-dimensions), velocity and is responsible for keeping track of its best position (solution) found so far. The movement of each particle is governed by its velocity, current position, their personal best as well as the global best i.e. the particle which has the best fitness value. The fitness value of particles is measured over some objective function value which represents how good or bad a particle is. The term “swarm” refers to the population of said particles, where each particle is a candidate solution. Since the movement is dependent on the personal best as well as the global best, as new and better positions are found, they guide the movement of the swarm. Typically, the particle’s position represents the candidate solution. Thus, by moving the particles through the n-search space, the PSO algorithm attempts to iteratively improve the solution represented by each particle with an end goal of convergence or finding a high quality solution.</p><p>The following three factors primarily influence the movement of particles in the search space:</p><ul><li>The velocity of the particle</li><li>The global best position</li><li>The personal best position of the particle found so far</li></ul><p>The effect of these 3 factors on the position update is controlled by a constant for each factor.</p><p>The inertia constant, <em>ω</em>, controls the impact of the velocity of a particle in finding a new position. Inertia in physics is defined as the resistance of an object to a change in its state of motion or rest. In PSO, the inertia allows to apply a portion of the previous velocity to the updated velocity and thus the particle will attempt to continue in the same direction it was previously heading in. This can help overcome local minima. The cognitive component, <em>c1</em>, controls how much the personal best position affects the movement of the particle. Lastly, there is a social component <em>c2</em> which controls the impact of the global best on the movement of the particle. There are also the stochastic components, <em>r1</em> and <em>r2</em>, which are uniform random vectors with component values between [0,1]. These add a random element to enhance exploration and can help prevent premature convergence.</p><h3>Updating the velocity and position</h3><p>Now, we will take a look at the equations for updating the velocity and position vector for the particles in the swarm. After all, we need to be able to update these values for our algorithm to reach a useable solution. The equations may look a little scary at first glance, but do not worry. We will dissect them and look at everything separately.</p><h4>Let’s start with the velocity update:</h4><blockquote><em>v</em>ᵢ<em>(t + 1) = ωv</em>ᵢ<em>(t) + c1r1(y(t) − x</em>ᵢ<em>(t)) + c2r2(z(t) − x</em>ᵢ<em>(t))</em></blockquote><ul><li><em>vᵢ(t + 1)</em> is the updated velocity of particle i at the next time step (This is what we want to calcuate)</li><li><em>ω, c1, c2, r1, r2</em> are just the constants described earlier.</li><li><em>vᵢ(t)</em> is the velocity of particle <em>i</em> at time <em>t</em></li><li><em>y(t)</em> is the personal best solution of particle <em>i</em> at time <em>t</em></li><li><em>z(t)</em> is the global best solution at time <em>t</em></li><li><em>xᵢ(t)</em> is the current position of particle <em>i</em></li></ul><h4><strong>Now the position update follows:</strong></h4><blockquote><em>xᵢ(t+1) = xᵢ +vᵢ(t+1)</em></blockquote><ul><li><em>xᵢ(t + 1)</em> is the updated position of particle <em>i</em> at the next time step (This is what we want to calculate)</li><li><em>xᵢ</em> is the current position of particle <em>i</em></li><li><em>vᵢ(t + 1)</em> is the updated velocity for particle <em>i</em> (calculated using the velocity update formula above).</li></ul><h4>A quick note</h4><p>The values for the inertia weight, social and cognitive components need to be established empirically through testing as they can differ for each problem. However, there are some values which have been shown to provide high quality results for a variety of problems e.g., van den Bergh (2002) has shown that the parameters <em>w</em> = 0.729844 and <em>c1</em> = <em>c2</em> = 1.496180 perform empirically well and can lead to convergence.</p><h3>Pseudocode</h3><p>Lets take a look at the pseudocode for PSO before we dive into implementing it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CdK9jNp6_n86OvSuLzjgHw.png" /><figcaption>Pseudocode for PSO</figcaption></figure><p>So, in simple terms, we start by initializing the swarm with oarticles. Then we enter a loop which goes on until we reach our specified max iterations (or until we reach convergence).</p><h3>Implementation</h3><h4>The particle class</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/86efd5cbdbebdd62aa335a8c8f019c1f/href">https://medium.com/media/86efd5cbdbebdd62aa335a8c8f019c1f/href</a></iframe><p>So this is a pretty straightforward object class in Java. The particle keeps track of its position vector, velocity vector, fitness and the personal best.</p><h4>The PSOEngine Class</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d33f1ec2bd0c6d9579d8642bf5dd2594/href">https://medium.com/media/d33f1ec2bd0c6d9579d8642bf5dd2594/href</a></iframe><p>Firstly, we add the constructor and we pass the necessary arguments for the engine. We need to set the constants for inertia, cognitive and social component as well as the number of dimensions, particles and the max number of iterations. This set up defines the PSO engine.</p><p>The rest of the code implements methods needed by the engine to effectively carry out the algorithm.</p><p>We start off with a<strong> initParticles()</strong> method which initializes the swarm by setting the positions randomly between [-5.12,5.12] (more on this in a bit) and the velocities to 0.</p><p>We have an <strong>updateVelocity()</strong> and an <strong>updatePosition()</strong> method, which updates the velocity and position respectively, for a given particle. These may seem a little daunting but pay close attention, it is doing nothing more than simply implementing the formulas we covered above. One area of confusion can possibly be because of the way the calculation is carried out. Each particle has n-dimensions. So the velocity vector is a 1-D array of size n. We break down the formula and calcualte each term seperately to be clear about what is happening. First we calculate the inertia term, then the cognitive term and lastly the social term. Finally we add these 3 terms together to get the updated velocity for particle <em>i.</em></p><p>The position update is simple and straightforward so I will skip that.</p><h4>Remember when we initialized the particles and set the positions randomly between [-.512,5.12]?</h4><p>We did this because of the fitness function we are using. For this simple implementation, I decided to use the <strong>Rastrigin function</strong>, which is a non-convex function used as a performance test for optimization problems. Since PSO is an optimization algorithm, it fits our needs well. On an n-dimensional domain, the function is defined as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*pxUW93n6xPPaqkVpPyFa_A.png" /></figure><p>Where nₓ is the dimension of the problem and xᵢ is a value between [-5.12,5.12]. Therefore, according to the function definition, we need to ensure that the position vector is valid and has values between this range. The function has a global minimum at 0 and thus our PSO should seek to find a solution close to 0. This means that the closer the fitness of our particle is to 0, the fitter the particle is. The<strong> evaluateFitness()</strong> method in our implementation, calculates the fitness of a given particle using this function.</p><p><strong>Please note that for this specific problem, the lower the fitness value, the better. However, depending on the problem being solved, it is possible to have a fitness function such that the higher the value of the fitness function, the fitter the particle.</strong></p><h4>The PSOImplementation Class</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b866fbc877501ba522f9a4e5fe3f253/href">https://medium.com/media/2b866fbc877501ba522f9a4e5fe3f253/href</a></iframe><p>This is a simple class which essentially runs the pseudocode shown above for PSO. It initalizes the engine with all the constants and starts the loop. The loop continues until we reach the number of specified max iterations and then terminates, printing the fittest particle’s position and its fitness value.</p><h3>Final Remarks</h3><p>So this is it! We have successfully implemented a PSO for solving the Rastrigin function. I ran the algorithm with 30 dimensions, 30 particles, <em>ω</em>= 0.729844, <em>c1</em> = <em>c2</em> = 1.496180. With this setup, I get values converging to ~70. But remember, any PSO algorithm requires a lot of testing, statistical analysis and trial and error with different constants to reach an optimal or sub-optimal solution. The purpose of this write up was just a brief introduction to PSO and not the testing of different constants to find the best set of parameters.</p><p>The full code is hosted can be found <a href="https://github.com/khurramayubi/PSO.git">here</a>, hosted on GitHub.</p><p>I hope you enjoyed the article and got a good grasp on understanding the fundamentals of PSO and how to implement it!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc51e4acadc7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>