<?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>DEV Community: Daniel Parkson Tano</title>
    <description>The latest articles on DEV Community by Daniel Parkson Tano (@parksontano).</description>
    <link>https://dev.to/parksontano</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%2F796771%2Fa6eb6990-4817-463b-8e6f-409f3aab1357.jpeg</url>
      <title>DEV Community: Daniel Parkson Tano</title>
      <link>https://dev.to/parksontano</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/parksontano"/>
    <language>en</language>
    <item>
      <title>My Quantum Journey with Womanium Quantum 2023</title>
      <dc:creator>Daniel Parkson Tano</dc:creator>
      <pubDate>Sun, 02 Jul 2023 15:45:15 +0000</pubDate>
      <link>https://dev.to/parksontano/my-quantum-journey-with-womanium-quantum-2023-4kfo</link>
      <guid>https://dev.to/parksontano/my-quantum-journey-with-womanium-quantum-2023-4kfo</guid>
      <description>&lt;p&gt;As a passionate enthusiast of quantum technologies, I recently had the incredible opportunity to join the Womanium Quantum Program 2023. This transformative experience will not only deepen my knowledge but also empower me in the rapidly evolving field of quantum computing, sensing, and communication. In this blog post, I will be sharing my quantum journey and highlighting the invaluable insights and growth I gained through this program.&lt;/p&gt;

&lt;p&gt;After the onboarding session, these were some focal points I took down. Participate in the Womanium Quantum Program 2023 will offer the following&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Expanding Quantum Horizons:&lt;/strong&gt;
The Womanium Quantum Program 2023 opened doors to a world of possibilities. Through interactive workshops, engaging lectures, and hands-on projects, I was introduced to the foundational concepts of quantum mechanics and their applications in various domains. From quantum algorithms to quantum sensing techniques, the program equipped me with a solid understanding of the fundamentals while exposing me to cutting-edge advancements in the field.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;-** Mentorship and networking:**&lt;br&gt;
One of the most enriching aspects of the Womanium Quantum Program will be the opportunity to connect with inspiring mentors and fellow participants. These established professionals and like-minded peers provided guidance, shared their experiences, and sparked thought-provoking discussions. Building a supportive network within the program allowed me to gain diverse perspectives, collaborate on projects, and establish lifelong connections in the quantum community.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Empowerment and Representation:&lt;/strong&gt;&lt;br&gt;
Womanium Quantum Program 2023 strongly emphasized empowering everyone in quantum technology. The program fostered an inclusive environment that celebrated diversity and highlighted the contributions of women in the field. It provided a platform to challenge gender biases, break barriers, and inspire the next generation of female quantum pioneers. Through panel discussions and talks by accomplished women in quantum, I felt empowered to make my mark in this rapidly advancing field.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Hands-on Projects:&lt;/strong&gt;&lt;br&gt;
The Womanium Quantum Program will enable me to apply theoretical knowledge to real-world scenarios through hands-on projects. From coding quantum algorithms to experimenting with quantum sensors, these projects provided invaluable practical experience and deepened my understanding of the challenges and opportunities in quantum technology. The guidance and feedback from mentors helped refine my skills and instilled confidence in my abilities.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Growth and Future Prospects:&lt;/strong&gt;&lt;br&gt;
Participating in the Womanium Quantum Program has undoubtedly transformed my quantum journey. The program will enhance my technical proficiency, expanded my professional network, and boosted my confidence to pursue a career in quantum computing, sensing, or communication. The knowledge and skills gained during the program have opened doors to exciting opportunities in research, industry, and entrepreneurship.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In conclusion, My quantum journey with the Womanium Quantum Program 2023 will be an enriching and empowering experience. The program will provide the perfect platform to learn, grow, and connect with remarkable individuals in the quantum community. I am now more determined than ever to contribute to advancing quantum technologies, inspire others, and promote gender diversity in the field. I am deeply grateful for the opportunities and support provided by Womanium Quantum, and I am excited to continue my quantum journey with newfound enthusiasm and confidence.&lt;/p&gt;

</description>
      <category>computing</category>
      <category>quantum</category>
      <category>womanium</category>
      <category>stem</category>
    </item>
    <item>
      <title>How to update a user password with Django RestFramework</title>
      <dc:creator>Daniel Parkson Tano</dc:creator>
      <pubDate>Fri, 31 Mar 2023 07:26:37 +0000</pubDate>
      <link>https://dev.to/parksontano/how-to-update-a-user-password-with-django-restframework-2960</link>
      <guid>https://dev.to/parksontano/how-to-update-a-user-password-with-django-restframework-2960</guid>
      <description>&lt;p&gt;You have probably been in situation where you coded a web app using a frontend framework like React Js or Angular and django for backend and django restframework to create API.&lt;br&gt;
You need to allow a user (Admin or management) to update another users password directly from the frontend.&lt;br&gt;
For example, let's assume  you built a Human Resource management app for a company and the user with administrative priviledges can create an employee as well as update their credentials (password and username or email).&lt;/p&gt;

&lt;p&gt;To do this after creating your user model in models.py file, now you will have to create Change password serializer in the serializers.py file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class ChangePasswordSerializer(serializers.ModelSerializer):
    password = serializers.CharField(write_only=True, required=True, validators=[validate_password])

    class Meta:
        model = User
        fields = ('password',)


    def update(self, instance, validated_data):

        instance.set_password(validated_data['password'])
        instance.save()

        return instance
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above block of code is a serializer that recieves the new password and updates the user account.&lt;br&gt;
But no user credentials was passed for instance email or username. The next thing you have you do now is to create a view (ChangePasswordView) in your views.py files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from rest_framework import generics 
class ChangePasswordView(generics.UpdateAPIView):

    queryset = User.objects.all()
    serializer_class = ChangePasswordSerializer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You are using a class base generic view so that the methods of the updateAPIView (Put and Patch) which will be inherited by your view class.&lt;/p&gt;

&lt;p&gt;After creating your view class the last thing to do is to create url path to your view class in the urls.py file. As such&lt;/p&gt;

&lt;p&gt;&lt;code&gt;path('change_password/&amp;lt;int:pk&amp;gt;', ChangePasswordView.as_view(), name='auth_change_password')&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The path takes a single argument which is the user_Id (or the primary key of your user model)&lt;/p&gt;

&lt;p&gt;You can now make put request from your frontend code to the &lt;code&gt;change_password/&amp;lt;int:pk&amp;gt;&lt;/code&gt; url. &lt;br&gt;
Below is a code you can use with axios to make the http request&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    const update_password = async (event) =&amp;gt; {
        event.preventDefault();
        new_password != "" &amp;amp;&amp;amp;
            (await axios
                .put(API_URL + `account/change_password/${employee.user.id}`, {
                    password: new_password
                })
                .then(async (response) =&amp;gt; {
                    alert("Password Successfully Changed")
                })
                .catch(async (err) =&amp;gt; {
                    console.log(err);
                }))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Looking at the above code, let's take a walk through each statement:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;new_password != "" &amp;amp;&amp;amp;&lt;/code&gt;&lt;br&gt;
checks is the new password field is not null (empty). if the new password field is not null then the next part of the code is executed&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;await axios.put(API_URL + `account/change_password/${employee.user.id}`, {password: new_password })
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We are using Async/await inoder to asynchronously execute the code. You have to pass in your change passowrd url path (API_URL + `account/change_password/) and the userID of the account you want to update thr password (for instance the userID here is stored in employee.user.id). You then make a put request using axios or Javascript Fetch.&lt;/p&gt;

&lt;p&gt;This function will have to be called when a specific button is click (add OnClick={update_password} to your button).&lt;/p&gt;

</description>
      <category>react</category>
      <category>django</category>
      <category>webdev</category>
      <category>python</category>
    </item>
    <item>
      <title>Python swapcase without using Swapcase()</title>
      <dc:creator>Daniel Parkson Tano</dc:creator>
      <pubDate>Mon, 26 Dec 2022 19:24:45 +0000</pubDate>
      <link>https://dev.to/parksontano/python-swapcase-without-using-swapcase-3j3m</link>
      <guid>https://dev.to/parksontano/python-swapcase-without-using-swapcase-3j3m</guid>
      <description>&lt;p&gt;We can easily swap the cases of characters in string using the python inbuilt &lt;em&gt;&lt;strong&gt;swapcase()&lt;/strong&gt;&lt;/em&gt; function.&lt;br&gt;
Casing swapping is simply changing upper case character to lower case character and lower case character to upper case character.&lt;br&gt;
For example:&lt;br&gt;
If we swap case the string "helloWorld" we will get "HELLOwORLD".&lt;/p&gt;
&lt;h3&gt;
  
  
  Example of using python &lt;em&gt;&lt;strong&gt;swapcase()&lt;/strong&gt;&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;Swap the cases in the string "Welcome to Tano Space".&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;string = "python IS A PROGRAMMING language"
new_string = swapcase(string)
print(new_string)
//it will return "PYTHON is a programming LANGUAGE"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's simple right? Yes. But assuming you are in a technical interview for a python developer role, and the interviewer asked you to write a python thats swap the cases of characters in a string. You can't use the swapcase() function. How then will you be able to achieve such ?&lt;br&gt;
The code below depict one of the ways to write the code.&lt;/p&gt;

&lt;p&gt;Let me show you how&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;string = "python IS A PROGRAMMING language"
 new_string = []

for i in string:
    #check if the character is a upper case letter
    if i.isupper():
        #if the character is upper case the change it to lower 
        #case 
        i.lower()
        # add the converted character to the list
        new_string.append(i)
    else:
        i.upper()
        new_string.append(i)

#use the join() to combine the items of the list
print("".join(new_string)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;You are Welcome&lt;/strong&gt;
&lt;/h3&gt;

</description>
      <category>bitcoin</category>
      <category>cryptocurrency</category>
    </item>
  </channel>
</rss>
