<?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 Suveksha A on Medium]]></title>
        <description><![CDATA[Stories by Suveksha A on Medium]]></description>
        <link>https://medium.com/@suveksha?source=rss-389d604cb04a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*i81xgFGkrsAYBldp.jpg</url>
            <title>Stories by Suveksha A on Medium</title>
            <link>https://medium.com/@suveksha?source=rss-389d604cb04a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 10:31:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@suveksha/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[First Open Source Contribution]]></title>
            <link>https://medium.com/@suveksha/first-open-source-contribution-a6b99d7cbc70?source=rss-389d604cb04a------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6b99d7cbc70</guid>
            <category><![CDATA[hackgenius]]></category>
            <dc:creator><![CDATA[Suveksha A]]></dc:creator>
            <pubDate>Thu, 14 Apr 2022 07:59:17 GMT</pubDate>
            <atom:updated>2022-04-14T07:59:17.140Z</atom:updated>
            <content:encoded><![CDATA[<p>We as a team <a href="https://medium.com/u/3256454cdad0">Jila Rasnat B</a> and myself started our open source projects contribution journey with <a href="http://saythanks.io/">http://saythanks.io </a>project. We have added the Log module to the project, which is a very important part of any project.</p><p>SayThanks is a website used to provide a handy URL and QR code for receiving feedback, opinions, or thank you notes.</p><h4><strong>Logging Issue</strong></h4><p><a href="https://github.com/BlitzKraft/saythanks.io/issues/191">https://github.com/BlitzKraft/saythanks.io/issues/191</a></p><h4><strong>Logging and its importance:</strong></h4><p>Logging helps us to develop a better understanding of the flow of a program and discover scenarios that we might not even have thought of while developing. Logs can store information, like which user or IP accessed the application. If an error occurs, then it provides more insights than a stack trace by telling us what the state of the program was before, it arrived at the line of code where the error occurred.</p><p>Python provides a logging system as a part of its standard library, so we can quickly add logging to our application. Using the logging module, we can use “logger” to log messages that we want to see. There are 5 standard levels of logging that indicates the severity of events. The levels are as follows:</p><p>● DEBUG</p><p>● INFO</p><p>● WARNING</p><p>● ERROR</p><p>● CRITICAL</p><h4><strong>Implementing logging in python</strong></h4><pre>#importing module<br>import logging</pre><pre>#create and configure logger<br>logging.basicConfig(filename=&#39;Logfile.log&#39;,<br>                    filemode=&#39;a&#39;,<br>                    format=&#39;%(acstime)s - %(name)s - %(levelname)s - <br>                    %(message)s&#39;,<br>                    datefmt=&#39;%d-%b-%y %H:%M:%S&#39;)</pre><p>Here we have imported a logging module, configured the logger by providing the name of the file, in which mode it has to be opened, the format of logging, and the date format and finally, we have created an object known as logger.</p><p>Based on the levels of severity messages are logged as follows:</p><pre>logger.setLevel(logging.DEBUG)</pre><pre>logger.debug(&quot;Debug Message&quot;)</pre><pre>logger.setLevel(logging.INFO)</pre><pre>logger.info(&quot;Info Message&quot;)</pre><pre>logger.warning(&quot;Warning Message&quot;)</pre><pre>logger.error(&quot;Error Message &quot;)</pre><pre>logger.critical(&quot;Critical Message&quot;)</pre><p>We were overjoyed with the acceptance of our First PR. We would like to thank <a href="https://medium.com/u/aa31acb95eed">Ashok Be</a> and <a href="https://medium.com/u/76049088448f">Pavithra TR</a> for their guidance and motivating us on our first open source contribution. This is our first step in to open source community and we shall carry over our contributions to numerous projects.</p><p>Finally, we would like to conclude with a famous quote of Thomas Fuchs:</p><blockquote><strong>“The best error message is the one that never shows up.”</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6b99d7cbc70" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stringchar() and Stringichar() functions]]></title>
            <link>https://medium.com/hackgenius/stringchar-and-stringichar-functions-9002b45af2d8?source=rss-389d604cb04a------2</link>
            <guid isPermaLink="false">https://medium.com/p/9002b45af2d8</guid>
            <category><![CDATA[kgisl]]></category>
            <category><![CDATA[pointers]]></category>
            <category><![CDATA[clang]]></category>
            <category><![CDATA[hackgenius]]></category>
            <dc:creator><![CDATA[Suveksha A]]></dc:creator>
            <pubDate>Mon, 15 Jun 2020 17:11:07 GMT</pubDate>
            <atom:updated>2020-06-15T17:19:59.145Z</atom:updated>
            <content:encoded><![CDATA[<h3>Writing my own strchr() and strichr() functions in C</h3><h3>WHAT IS A POINTER?</h3><p>Before solving the problem let us see what does a pointer mean? Pointers in C language is a variable that stores/points the address of another variable. A pointer in C is used to allocate memory dynamically i.e. at run time. The pointer variable might be belonging to any of the data types such as int, float, char, double, short etc.</p><h3>STRINGCHAR PROBLEM</h3><blockquote>To write up a code which behaves as same as the built-in function <strong>strchr</strong>() present in the string.h using pointers in c language.This function should return the pointer to the first occurrence of the needle in the given string hay. If the needle isn’t present in hay then it should return 0.</blockquote><h4>ALGORITHM</h4><p>STEP 1 : Start</p><p>STEP 2 : Receives input for hay and needle through function call statements</p><p>STEP 3 : If the current hay value is equal to the needle character then it returns the memory address of hay</p><p>STEP 4 : hay pointer is updated to its next location</p><p>STEP 5 : Step 3 and 4 are repeated until hay pointer reaches null</p><p>STEP 6 : If none of the characters in hay matches with needle then it returns 0</p><p>STEP 7 : End</p><h4>SOLUTION FOR STRINGCHAR FUNCTION</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/0*Q8YksV_L9RykCG_2.png" /><figcaption>Code for stringchar()</figcaption></figure><h4><strong>FLOWCHART</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*uVI05ZuvkEzMQtjx8S2ULg.png" /><figcaption>Flow chart for stringchar()</figcaption></figure><blockquote>To clearly visualize how the stringchar function works click on the link given below which explains using an example.</blockquote><blockquote><a href="https://tinyurl.com/yawbumcb"><strong>https://tinyurl.com/yawbumcb</strong></a></blockquote><h3>STRINGICHAR PROBLEM</h3><blockquote>To write up a code for case insensitive version of stringchar() using pointers in c language.</blockquote><h4><strong>ALGORITHM</strong></h4><p>STEP 1 : Start</p><p>STEP 2 : Receives input for hay and needle through function call statements</p><p>STEP 3: Convert needle to its lowercase version and store it in needlel</p><p>STEP 4: If lowercase of character pointed by hay is equal to needlel then it returnns the memory address of hay</p><p>STEP 5: hay pointer is updated to its next location</p><p>STEP 6: Step 3 and 4 are repeated until hay reaches null</p><p>STEP 7: If none of the characters matches with needlel then it return 0</p><p>STEP 8: End</p><h4>SOLUTION FOR STRINGICHAR FUNCION</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/0*SgP_waNo9e2NzZoL.png" /><figcaption>Code for stringichar()</figcaption></figure><h4><strong>FLOWCHART</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*WHB10cNUIdtOyEa1hfn_sg.png" /><figcaption>Flowchart of stringichar()</figcaption></figure><blockquote>To clearly visualize how the stringichar function works click on the link given below which explains using an example.</blockquote><blockquote><a href="https://tinyurl.com/ydystu4n"><strong>https://tinyurl.com/ydystu4n</strong></a></blockquote><p>Lastly, I would like to thank the CSE department faculties and coding mentors at KGISL Institute of Technology(KiTE) for organising the <a href="http://j.mp/pCampKG">Pointer Camp</a> which enlightened me on the concept of Pointers. The camp was conducted over 16+ hours when I was immersed in writing code for several challenges and learned how to use pointers in an incremental way. During the camp, I was introduced to the CloudCoder learning platform which helped us to strengthen our coding skills.</p><p>Finally, I would like to conclude with a famous quote of Bill Gates:</p><blockquote>“I am not in a competition with anyone but myself. My goal is to improve myself continuously.”</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9002b45af2d8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackgenius/stringchar-and-stringichar-functions-9002b45af2d8">Stringchar() and Stringichar() functions</a> was originally published in <a href="https://medium.com/hackgenius">hackgenius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My own stringchar() and stringichar() function]]></title>
            <link>https://medium.com/hackgenius/my-own-stringchar-and-stringichar-function-47f071ec6ad2?source=rss-389d604cb04a------2</link>
            <guid isPermaLink="false">https://medium.com/p/47f071ec6ad2</guid>
            <category><![CDATA[pointers]]></category>
            <category><![CDATA[c-language]]></category>
            <category><![CDATA[kgisl]]></category>
            <category><![CDATA[hackgenius]]></category>
            <dc:creator><![CDATA[Suveksha A]]></dc:creator>
            <pubDate>Mon, 15 Jun 2020 10:34:04 GMT</pubDate>
            <atom:updated>2020-06-15T11:39:34.980Z</atom:updated>
            <content:encoded><![CDATA[<h3>Writing my own strchr() and strichr() functions</h3><h3><strong>POINTERS</strong></h3><h4><strong>WHAT IS A POINTER?</strong></h4><p>Pointers in C language is a variable that stores/points the address of another variable. A pointer in C is used to allocate memory dynamically i.e. at run time. The pointer variable might be belonging to any of the data types such as int, float, char, double, short etc.</p><h4><strong>IMPORTANCE OF POINTERS</strong></h4><p>-&gt;Pointers reduce the length and complexity of a program.</p><p>-&gt;They increase execution speed.</p><p>-&gt;A pointer enables us to access a variable that is defined outside the function.</p><h3><strong>STRINGCHAR PROBLEM</strong></h3><h4><strong>BUILT IN STRCHR FUNCTION</strong></h4><p><strong>Header File</strong>: string.h</p><p><strong>Syntax</strong>: const char* strchr(const char *hay, const char needle);</p><p><strong>Return value</strong>: This function returns the pointer to the first occurrence of the needle in the given string hay. If the needle isn’t present in hay then it returns 0.</p><h4><strong>PROBLEM STATEMENT FOR STRINGCHAR FUNCTION</strong></h4><p>To write up a code which behaves as same as the built-in function <strong>strchr</strong>() present in the string.h using pointers in c language.</p><h4><strong>SOLUTION FOR STRINGCHAR FUNCTION</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*Y6r89tIHvy3wjVcAGuPCdA.png" /></figure><h4><strong>WORKING OF STRINGCHAR FUNCTION</strong></h4><p>Stringchar function is another version of the built-in function strchr() which is present in the string.h header file. Input for this function is passed from the main() as hay and needle.By using just one do while block we can successfully write up the user defined stringchar function. This <strong>do-while</strong> block runs until null character is reached in the hay string and each time hay pointer is updated to its next location. If the character pointed by the hay pointer is equal to the needle character, address of the hay character is returned to the main(). If none of the characters in hay matches with needle character then the function returns 0 to the main().</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*wzpIUfOdQYQb_WGuDjhtdw.png" /></figure><h4><strong>LETS SEE THE WORKING WITH THE HELP OF AN EXAMPLE</strong></h4><p>To clearly visualize how the stringchar function works let’s take the help of an online c visualizer(<a href="http://www.pythontutor.com/c.html#mode=edit">http://www.pythontutor.com/c.html#mode=edit</a>). Now let us see how it works step by step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/242/1*xPZH2cgTKkqeSbxTGhisVQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/1*xZ3YuJM61T9wifkQahBOOw.png" /></figure><p>Execution of any program always starts from the main(), then sequentially flows over the blocks. These lines assign space for hay string and needle variable(with default value as null). The figure below shows the memory allocation for the two variables(hay and needle).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*APoU_x8UWBUd_YWBjS4Egw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/301/1*lEY36WeECd1aTarI2iRr1A.png" /></figure><p>Here the first line receives input for hay and needle variables as “ABCDEF” and ‘C’ respectively. The second line initializes a pointer variable <strong>find</strong>, whose value is been received by making a function call to the stringchar(). It also allocates memory for find(pointer variable) and for the stringchar() .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*E13C832WUGS_YiuHD0udCA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/302/1*5YFzSxqFwc2C5lAc_KDsJw.png" /></figure><p>Input for the actual parameters (present in function header) is been passed from the main().</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/197/1*fqUVqV6AVzDeHMGjZ81-gQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/302/1*J-xqXifgcMHFFLoxtPqUzA.png" /></figure><p>This do while loop runs until the hay pointer reaches the null character in hay , and returns the address of hay when it matches with the needle character.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/166/1*5yOljoBSdAE3JreqgP8oLA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/301/1*A-cYq53HWQrAAOZtM3kKSA.png" /></figure><p>Now hay pointer contains ‘C’ character which is equal to the needle character. So the function returns the memory address of hay pointer to the main()</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/379/1*OJrbM6oeRT0WrDZQZUBcAA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*Vgs6GqXro574rY7U4BghMg.png" /></figure><p>Again the flow reaches to the function call statement where find pointer is been updated to the memory address of hay.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/189/1*0rcoMzC1JaXF2pyWI5BXGg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*W1J5InlnK_NMPtL1dLr3sg.png" /></figure><p>Now address pointed by the find pointer is been printed on the output screen</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*fUaBwQptSuXMYoCvx3L5jw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*y8PO7WMgUkupbrY_IH9l6A.png" /></figure><p>Since find has a value, the condition is been satisfied. Hence <strong>printf</strong> statement is been executed.</p><h3><strong>STRINGICHAR PROBLEM</strong></h3><h4><strong>PROBLEM STATEMENT FOR STRINGICHAR FUNCTION</strong></h4><p>To write up a code for case insensitive version of string compare using pointers in c language.</p><h4><strong>SOLUTION FOR STRINGICHAR FUNCION</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*dl5DWcNmvCE4QKqYOfqutg.png" /></figure><h4><strong>WORKING OF STRINGICHAR FUNCTION</strong></h4><p>This function is similar to the strchr() present in the header file string.h. Only difference is that stringichar() is case insensitive(treats both upper and lower case similarly).</p><p>Input for this function is been passed form the main().Since we are checking for case-insensitive version, let us convert needle into lowercase beforehand and save it in a variable (<strong>needlel</strong>). By using just one do while loop we can successfully code for the case insensitive version of strchr().This <strong>do-while </strong>block runs until the null character is reached in the hay string. Each time lowercase of the character pointed by the hay pointer is compared with <strong>needlel</strong> and each time hay pointer is updated to its next location. If the lowercase of character pointed by the hay pointer is equal to the <strong>needlel</strong> character, address of the hay character is returned to the main(). If none of the characters in hay matches with needle character then the function returns 0 to the main().</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*ksF8QZ6CuJe2_oeI7fblwQ.png" /></figure><h4><strong>LET’S SEE THE WORKING WITH THE HELP OF AN EXAMPLE</strong></h4><p>To clearly visualize how the stringchar function works let’s take the help of an online c visualizer(<a href="http://www.pythontutor.com/c.html#mode=edit">http://www.pythontutor.com/c.html#mode=edit</a>). Now let us see how it works step by step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/205/1*_LCH6PC5z0cwX9R6iNU3vw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/302/1*U_f2CubWK0cgo7juD-gLhA.png" /></figure><p>Execution of any program always starts from the main(), then sequentially flows over the blocks. These lines assign space for hay string and needle variable(with default value as null).The figure below shows the memory allocation for the two variables(hay and needle).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/1*NBFonw35C5r7G5Q8OeZ6GQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*rLTeireDocoU9M-wyjE2QQ.png" /></figure><p>Here the first line receives input for hay and needle variables as “abcdef” and ‘D’ respectively. Second line initializes a pointer variable find, whose value is been received by making a function call to the stringichar(). It also allocates memory for find(pointer variable) and for the stringichar() .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*zULEu87iJ8wvrpqXGz2IPg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/302/1*jSuu22tk0bN1V_hBuz4Xjg.png" /></figure><p>Input for the actual parameters (present in function header) is been passed from the main() and memory is allocated for the needlel variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/312/1*F0q6kCwvXevahdyIA-hajQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*dauvyfNKrhe7xm0hY1PmYQ.png" /></figure><p>This line converts the character in needle variable to its lowercase and stores it in <strong>needlel</strong> variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/269/1*yPViYeYEOgpgHRT9u2dQzA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/1*dzDJuk-3qIiIV4ORbBdtbQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/301/1*tbquE5ssiYynFoesdMznAQ.png" /></figure><p>This <strong>do-while</strong> loop runs until the hay pointer reaches the null character in hay, and returns the address of hay when lowercase of hay matches with the <strong>needlel</strong> character.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/231/1*CO2h59zx53YMhkrwSbeC7g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/1*QeehAZsKNLpCY2dSBY_pUw.png" /></figure><p>Now hay pointer contains <strong>‘d</strong>’ character which is equal to the<strong> needlel</strong> character. So the function returns the memory address of hay pointer to the <strong>main</strong>().</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*ZXLBROJbv0a9xVtAlZiwhw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/302/1*cIwOMA2o7kdWOOszX2SxTg.png" /></figure><p>Again the flow reaches to the function call statement where <strong>find</strong> pointer is been updated to the memory address of hay.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/182/1*hdm9gw9yBpB2g2qPlgTM4A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/373/1*IBfCXcgILa8mRsgpBxiyoA.png" /></figure><p>Now address pointed by the find pointer is been printed on the output screen</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/315/1*fALz7ucAavFOR8wvdi2X-w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/1*D6kc62q56VkqW4we8HEiAg.png" /></figure><p>Since find has a value, the condition is been satisfied. Hence printf statement is been executed.</p><p>Lastly, I would like to thank the faculties of CSE department faculties and coding mentors at KGISL Institute of Technology(KiTE) for organising the <a href="http://j.mp/pCampKG">Pointer Camp</a> which enlightened me on the concept of Pointers. The camp was conducted over 16+ hours when I was immersed in coding solutions for several challenges and learned how to use pointers in an incremental way. During the camp, I was introduced to the CloudCoder learning platform which helped us to strengthen our coding skills.</p><p>Finally, I would like to conclude with a famous quote of Bill Gates:</p><blockquote>“I am not in a competition with anyone but myself. My goal is to improve myself continuously.”</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47f071ec6ad2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackgenius/my-own-stringchar-and-stringichar-function-47f071ec6ad2">My own stringchar() and stringichar() function</a> was originally published in <a href="https://medium.com/hackgenius">hackgenius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>