<?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: Abhilash Panicker</title>
    <description>The latest articles on DEV Community by Abhilash Panicker (@abpanic).</description>
    <link>https://dev.to/abpanic</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%2F476883%2F5b509f78-6958-4298-a023-d974cdf19e4b.png</url>
      <title>DEV Community: Abhilash Panicker</title>
      <link>https://dev.to/abpanic</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abpanic"/>
    <language>en</language>
    <item>
      <title>Tkinter vs PyQt: Choosing the Right GUI Library for Your Python Projects</title>
      <dc:creator>Abhilash Panicker</dc:creator>
      <pubDate>Mon, 08 May 2023 08:23:58 +0000</pubDate>
      <link>https://dev.to/abpanic/tkinter-vs-pyqt-choosing-the-right-gui-library-for-your-python-projects-1oj0</link>
      <guid>https://dev.to/abpanic/tkinter-vs-pyqt-choosing-the-right-gui-library-for-your-python-projects-1oj0</guid>
      <description>&lt;p&gt;When it comes to creating graphical user interfaces (GUIs) for Python applications, Tkinter and PyQt are two of the most popular libraries. Both offer a wide range of features and ease of use, making it difficult to choose between them. In this article, we will compare Tkinter and PyQt, exploring their key differences and advantages, to help you decide which library best fits your project's needs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Overview&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;a. Tkinter&lt;br&gt;
      - Tkinter is the standard GUI library for Python and comes bundled with most Python installations. It is a thin object-oriented layer on top of the Tcl/Tk GUI toolkit. Tkinter is simple and easy to use, making it a popular choice for beginners and small projects.&lt;/p&gt;

&lt;p&gt;b. PyQt&lt;br&gt;
      - PyQt is a set of Python bindings for the Qt application framework, a popular choice for creating desktop applications. PyQt is known for its flexibility, extensive features, and robustness. It is suitable for large projects and professional applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Installation and setup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;a. Tkinter&lt;br&gt;
      - Tkinter is included with most Python installations, making it easy to get started without needing to install any additional packages.&lt;/p&gt;

&lt;p&gt;b. PyQt&lt;br&gt;
      - PyQt requires a separate installation using pip (e.g., &lt;code&gt;pip install PyQt5&lt;/code&gt;). It also needs a compatible version of the Qt library installed on your system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Documentation and community support&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;a. Tkinter&lt;br&gt;
      - Tkinter has extensive documentation and a large community. Many online resources, tutorials, and examples are available to help beginners get started.&lt;/p&gt;

&lt;p&gt;b. PyQt&lt;br&gt;
      - PyQt also has comprehensive documentation, and its community is growing. Since PyQt is based on the Qt framework, you can find extensive resources related to Qt development, which can be helpful when working with PyQt.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Features and capabilities&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;a. Tkinter&lt;br&gt;
      - Tkinter provides basic widgets (buttons, labels, text boxes, etc.) and simple layout management. It is suitable for small projects and simple applications, but it might be limiting for more complex projects.&lt;/p&gt;

&lt;p&gt;b. PyQt&lt;br&gt;
      - PyQt offers a wide range of advanced features, such as custom widgets, OpenGL integration, multithreading support, and extensive layout management. It is suitable for complex applications and professional projects, where advanced functionality is required.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Look and feel&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;a. Tkinter&lt;br&gt;
      - Tkinter's default look and feel is dated and does not always blend well with modern operating systems. However, it is possible to customize the appearance using themes and styles.&lt;br&gt;
      - Tkinter example: &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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F39jclf7h8nqckn7nhnfi.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F39jclf7h8nqckn7nhnfi.png" alt="Tkinter screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;b. PyQt&lt;br&gt;
      - PyQt applications have a native look and feel on all supported platforms, making them visually appealing and consistent with the user's OS. PyQt also provides advanced styling options, allowing for extensive customization.&lt;br&gt;
      - PyQt example: &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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb8b5jjza1lgivzh9gj4d.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb8b5jjza1lgivzh9gj4d.png" alt="PyQt screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Performance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;a. Tkinter&lt;br&gt;
      - Tkinter has decent performance for small to medium-sized applications. However, it may struggle with larger projects or applications that require rapid updates to the UI.&lt;/p&gt;

&lt;p&gt;b. PyQt&lt;br&gt;
      - PyQt has better performance compared to Tkinter, making it suitable for larger projects and applications that require fast UI updates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Both Tkinter and PyQt have their advantages and are suited for different types of projects. If you are new to GUI programming or working on a small project with basic requirements, Tkinter is a simple and easy-to-use option. However, if you need more advanced features, a native look and feel, or better performance, PyQt is a more suitable choice for larger projects and professional applications. Ultimately, the choice between Tkinter and PyQt depends on your project's requirements and your personal preferences.&lt;/p&gt;

&lt;p&gt;About the Author: &lt;a href="https://dbugr.vercel.app/" rel="noopener noreferrer"&gt;https://dbugr.vercel.app/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>programming</category>
      <category>discuss</category>
    </item>
    <item>
      <title>How to connect to D365 CE and stay connected even when token expires</title>
      <dc:creator>Abhilash Panicker</dc:creator>
      <pubDate>Sat, 06 May 2023 05:41:47 +0000</pubDate>
      <link>https://dev.to/abpanic/how-to-connect-to-d365-ce-and-stay-connected-even-when-token-expires-4dkc</link>
      <guid>https://dev.to/abpanic/how-to-connect-to-d365-ce-and-stay-connected-even-when-token-expires-4dkc</guid>
      <description>&lt;p&gt;To create a simple console application in C# that connects to Dynamics 365 CE with OAuth and refreshes the token when it expires, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install the required NuGet packages:
Install the following NuGet packages using Package Manager Console in Visual Studio or add them manually through the NuGet Package Manager:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Microsoft.IdentityModel.Clients.ActiveDirectory&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Microsoft.CrmSdk.CoreAssemblies&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Microsoft.CrmSdk.XrmTooling.CoreAssembly&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create a new C# Console Application in Visual Studio.&lt;br&gt;
Create a new project and select "Console App (.NET Core)" or "Console App (.NET Framework)".&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Replace the contents of &lt;code&gt;Program.cs&lt;/code&gt; with the following code:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Microsoft.IdentityModel.Clients.ActiveDirectory&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Microsoft.Xrm.Sdk&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Microsoft.Xrm.Tooling.Connector&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;Dynamics365OAuthApp&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Program&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Replace with your Dynamics 365 CE instance URL&lt;/span&gt;
        &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;ResourceUrl&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"https://&amp;lt;your_instance&amp;gt;.crm.dynamics.com"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="c1"&gt;// Replace with your Azure AD tenant ID&lt;/span&gt;
        &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;TenantId&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;your_tenant_id&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="c1"&gt;// Replace with your Azure AD application client ID&lt;/span&gt;
        &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;ClientId&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;your_client_id&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="c1"&gt;// Replace with your Azure AD application client secret&lt;/span&gt;
        &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;ClientSecret&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"&amp;lt;your_client_secret&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;AuthorityUrl&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"https://login.microsoftonline.com/"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;TenantId&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;service&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;GetCrmService&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="n"&gt;service&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="c1"&gt;// Add your code to interact with Dynamics 365 CE&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="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Failed to connect to Dynamics 365 CE."&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="n"&gt;IOrganizationService&lt;/span&gt; &lt;span class="nf"&gt;GetCrmService&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;try&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;authenticationContext&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;AuthenticationContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;AuthorityUrl&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;credentials&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;ClientCredential&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ClientId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ClientSecret&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;authResult&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;authenticationContext&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AcquireTokenAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ResourceUrl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;credentials&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;Result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;connectionString&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;$@"&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="s"&gt;                    ServiceUri=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;ResourceUrl&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;;&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="s"&gt;                    AuthType=OAuth;&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="s"&gt;                    AccessToken=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;authResult&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AccessToken&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;;&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="s"&gt;                    "&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

                &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;crmService&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;CrmServiceClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;connectionString&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="n"&gt;crmService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;IsReady&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;crmService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;OrganizationWebProxyClient&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;
                        &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IOrganizationService&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;crmService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;OrganizationWebProxyClient&lt;/span&gt;
                        &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;crmService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;OrganizationServiceProxy&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;
                &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Failed to connect: "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;crmService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;LastCrmError&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Exception&lt;/span&gt; &lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Error: "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Message&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;

            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&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;p&gt;Make sure to replace &lt;code&gt;&amp;lt;your_instance&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;your_tenant_id&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;your_client_id&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;your_client_secret&amp;gt;&lt;/code&gt; with your own values.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Run the console application
Build and run the console application. If successful, it will connect to Dynamics 365 CE using OAuth and return an instance of &lt;code&gt;IOrganizationService&lt;/code&gt; which can be used to interact with the Dynamics 365 CE instance.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When the token expires, the &lt;code&gt;CrmServiceClient&lt;/code&gt; will automatically refresh the token using the provided &lt;code&gt;ClientCredential&lt;/code&gt;. You do not need to worry about manually refreshing the token.&lt;/p&gt;

&lt;p&gt;That's it! You now have a simple console application that connects to Dynamics 365 CE with OAuth and automatically refreshes the token when it expires.&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>tutorial</category>
      <category>dynamicscrm</category>
    </item>
    <item>
      <title>Supervised Learning: Understanding the Concepts and Algorithms with Examples</title>
      <dc:creator>Abhilash Panicker</dc:creator>
      <pubDate>Wed, 03 May 2023 18:51:17 +0000</pubDate>
      <link>https://dev.to/abpanic/supervised-learning-understanding-the-concepts-and-algorithms-with-examples-2egp</link>
      <guid>https://dev.to/abpanic/supervised-learning-understanding-the-concepts-and-algorithms-with-examples-2egp</guid>
      <description>&lt;p&gt;Supervised learning is a machine learning technique that involves training a model on a labeled dataset, where each data point is associated with a target label. The goal of supervised learning is to learn a function that maps input features to the corresponding output labels. In this article, we will explore the concepts of supervised learning and discuss some popular algorithms, such as Linear Regression, Logistic Regression, Decision Trees, and Random Forests.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Understanding Supervised Learning:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In supervised learning, we have a dataset consisting of input features and corresponding output labels. We use this dataset to train a model that can predict the output label for new, unseen data points. The goal of supervised learning is to learn a function that maps input features to the corresponding output labels. The input features are also called independent variables, while the output labels are called dependent variables.&lt;/p&gt;

&lt;p&gt;Supervised learning can be classified into two types: regression and classification. In regression, we predict a continuous output variable, such as the price of a house based on its features. In classification, we predict a categorical output variable, such as whether an email is spam or not based on its features.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Popular Supervised Learning Algorithms:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Linear Regression:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Linear Regression is a popular algorithm for regression problems, where we want to predict a continuous output variable based on one or more input features. In Linear Regression, we assume a linear relationship between the input features and the output variable. The goal of Linear Regression is to find the line that best fits the data.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pandas as pd
from sklearn.linear_model import LinearRegression

df = pd.read_csv('data.csv')
X = df[['feature1', 'feature2']]
y = df['target']

model = LinearRegression()
model.fit(X, y)

# Predict on new data
X_new = [[0.5, 0.6], [0.2, 0.3]]
y_pred = model.predict(X_new)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Logistic Regression:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Logistic Regression is a popular algorithm for classification problems, where we want to predict a categorical output variable based on one or more input features. In Logistic Regression, we assume a linear relationship between the input features and the log-odds of the output variable. The goal of Logistic Regression is to find the line that best separates the two classes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pandas as pd
from sklearn.linear_model import LogisticRegression

df = pd.read_csv('data.csv')
X = df[['feature1', 'feature2']]
y = df['target']

model = LogisticRegression()
model.fit(X, y)

# Predict on new data
X_new = [[0.5, 0.6], [0.2, 0.3]]
y_pred = model.predict(X_new)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Decision Trees:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Decision Trees are a popular algorithm for both regression and classification problems. In Decision Trees, we build a tree-like model of decisions and their possible consequences. Each internal node of the tree corresponds to a decision on an input feature, while each leaf node corresponds to a predicted output value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pandas as pd
from sklearn.tree import DecisionTreeRegressor

df = pd.read_csv('data.csv')
X = df[['feature1', 'feature2']]
y = df['target']

model = DecisionTreeRegressor()
model.fit(X, y)

# Predict on new data
X_new = [[0.5, 0.6], [0.2, 0.3]]
y_pred = model.predict(X_new)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Random Forests:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Random Forests are an ensemble learning method that combines multiple Decision Trees to improve the accuracy and stability of the model. In Random Forests, we build a large number of Decision Trees, each based on a random subset of the input features and training data. The predicted output value is then the average of the predictions of all the trees.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pandas as pd
from sklearn.ensemble import RandomForestRegressor

df = pd.read_csv('data.csv')
X = df[['feature1', 'feature2']]
y = df['target']

model = RandomForestRegressor()
model.fit(X, y)

# Predict on new data
X_new = [[0.5, 0.6], [0.2, 0.3]]
y_pred = model.predict(X_new)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In conclusion, supervised learning is a powerful machine learning technique that allows us to predict output labels based on input features. We discussed the concepts of supervised learning, including the difference between regression and classification problems. We also explored some popular supervised learning algorithms, such as Linear Regression, Logistic Regression, Decision Trees, and Random Forests, and provided examples of how to implement them in Python using the Scikit-learn library. By using supervised learning, we can build accurate and reliable models that can make valuable predictions and provide valuable insights for decision-making.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>datascience</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Data Visualization: The Importance of Visualizing Data and How to Use Matplotlib and Seaborn to Create Stunning Visualizations</title>
      <dc:creator>Abhilash Panicker</dc:creator>
      <pubDate>Wed, 03 May 2023 18:45:25 +0000</pubDate>
      <link>https://dev.to/abpanic/data-visualization-the-importance-of-visualizing-data-and-how-to-use-matplotlib-and-seaborn-to-create-stunning-visualizations-271h</link>
      <guid>https://dev.to/abpanic/data-visualization-the-importance-of-visualizing-data-and-how-to-use-matplotlib-and-seaborn-to-create-stunning-visualizations-271h</guid>
      <description>&lt;p&gt;Data visualization is a powerful tool that allows us to communicate complex data insights in a simple and intuitive way. By creating visual representations of data, we can better understand patterns and relationships that might be difficult to discern from raw data alone. In this article, we will discuss the importance of data visualization and how to use libraries such as Matplotlib and Seaborn to create different types of visualizations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Importance of Data Visualization:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Data visualization is important for several reasons. Firstly, it allows us to identify patterns and relationships in the data that might not be immediately apparent from looking at raw data. Secondly, it helps to communicate data insights to others in a way that is easy to understand and interpret. Finally, it can help to identify errors or outliers in the data that might otherwise go unnoticed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating Visualizations with Matplotlib:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Matplotlib is a popular data visualization library in Python that provides a wide range of tools for creating static, interactive, and animated visualizations. Here are some examples of how to use Matplotlib to create different types of visualizations:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Line plots:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(0, 10, 100)
y = np.sin(x)

plt.plot(x, y)
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Scatter plots:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import matplotlib.pyplot as plt
import numpy as np

x = np.random.normal(size=100)
y = np.random.normal(size=100)

plt.scatter(x, y)
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Bar charts:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import matplotlib.pyplot as plt

x = ['A', 'B', 'C', 'D', 'E']
y = [10, 15, 20, 25, 30]

plt.bar(x, y)
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Creating Visualizations with Seaborn:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Seaborn is a Python library that provides a higher-level interface to Matplotlib, making it easier to create more complex and visually appealing visualizations. Here are some examples of how to use Seaborn to create different types of visualizations:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Line plots:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import seaborn as sns
import numpy as np

x = np.linspace(0, 10, 100)
y = np.sin(x)

sns.lineplot(x, y)
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Scatter plots:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import seaborn as sns
import numpy as np

x = np.random.normal(size=100)
y = np.random.normal(size=100)

sns.scatterplot(x, y)
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Bar charts:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import seaborn as sns

x = ['A', 'B', 'C', 'D', 'E']
y = [10, 15, 20, 25, 30]

sns.barplot(x, y)
plt.show()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In conclusion, data visualization is an essential tool for communicating complex data insights in a simple and intuitive way. By using libraries such as Matplotlib and Seaborn, we can create a wide range of visualizations that help to identify patterns and relationships in the data, communicate data insights to others, and identify errors or outliers in the data. By taking the time to properly visualize data, we can gain a deeper understanding of the data and make more informed decisions based on the insights that we discover.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>datascience</category>
      <category>learning</category>
    </item>
    <item>
      <title>Data Preparation: Techniques for Cleaning, Preprocessing, and Transforming Data for Machine Learning</title>
      <dc:creator>Abhilash Panicker</dc:creator>
      <pubDate>Wed, 03 May 2023 18:41:35 +0000</pubDate>
      <link>https://dev.to/abpanic/data-preparation-techniques-for-cleaning-preprocessing-and-transforming-data-for-machine-learning-2c96</link>
      <guid>https://dev.to/abpanic/data-preparation-techniques-for-cleaning-preprocessing-and-transforming-data-for-machine-learning-2c96</guid>
      <description>&lt;p&gt;Data preparation is a critical step in the machine learning process that involves cleaning, preprocessing, and transforming data in order to make it suitable for use in machine learning models. In this article, we will discuss the importance of data preparation and the techniques used to clean, preprocess, and transform data for machine learning.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Importance of Data Preparation:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Data preparation is essential because machine learning models are only as good as the data they are trained on. Poor quality or poorly prepared data can lead to inaccurate or biased models that produce unreliable results. In addition, data preparation can help to reduce noise and redundancy in the data, making it easier for the model to identify relevant patterns and make accurate predictions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Techniques for Data Cleaning:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Data cleaning involves identifying and correcting errors, inconsistencies, and missing values in the data. This is typically the first step in the data preparation process. Some of the techniques used for data cleaning include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Removing duplicates: Duplicate data can skew the analysis and produce inaccurate results. To remove duplicates, we can use the Pandas library to drop rows with duplicated values.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pandas as pd

df = pd.read_csv('data.csv')
df.drop_duplicates(inplace=True)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Handling missing values: Missing values can occur when data is not available or when there are errors in the data collection process. To handle missing values, we can either drop the rows or columns with missing values or impute the missing values with a value that makes sense for the data.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Dropping missing values
df.dropna(inplace=True)

# Imputing missing values
from sklearn.impute import SimpleImputer

imputer = SimpleImputer(strategy='mean')
df_imputed = pd.DataFrame(imputer.fit_transform(df), columns=df.columns)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Techniques for Data Preprocessing:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Data preprocessing involves transforming the data into a format that can be easily understood by the machine learning algorithm. This may involve scaling the data, encoding categorical variables, and feature engineering. Some of the techniques used for data preprocessing include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Scaling the data: Scaling involves transforming the data so that it falls within a certain range. This is important because some machine learning algorithms are sensitive to the scale of the data. One way to scale the data is using the MinMaxScaler or StandardScaler from the Scikit-learn library.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Using MinMaxScaler
from sklearn.preprocessing import MinMaxScaler

scaler = MinMaxScaler()
scaled_data = scaler.fit_transform(data)

# Using StandardScaler
from sklearn.preprocessing import StandardScaler

scaler = StandardScaler()
scaled_data = scaler.fit_transform(data)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Encoding categorical variables: Categorical variables are variables that take on discrete values, such as colors or types of products. Many machine learning algorithms require numerical inputs, so categorical variables must be encoded in order to be used in the model. One way to encode categorical variables is using the OneHotEncoder from the Scikit-learn library.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from sklearn.preprocessing import OneHotEncoder

encoder = OneHotEncoder()
encoded_data = encoder.fit_transform(data)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Techniques for Data Transformation:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Data transformation involves creating new features from the existing features in the data, or reducing the dimensionality of the data. This can help to improve the performance of the machine learning algorithm. Some of the techniques used for data transformation include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Feature engineering: Feature engineering involves creating new features from the existing features in the data. This may involve combining features, creating interaction terms, or extracting features from text or images.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Creating interaction terms
data['interaction'] = data['feature1'] * data['feature2']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Dimensionality reduction: Dimensionality reduction involves reducing the number of features in the data while retaining the most important information. This can help to improve the performance of the machine learning algorithm and reduce the risk of overfitting. One popular technique for dimensionality reduction is Principal Component Analysis (PCA).
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from sklearn.decomposition import PCA

pca = PCA(n_components=2)
transformed_data = pca.fit_transform(data)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In conclusion, data preparation is an essential step in the machine learning process that involves cleaning, preprocessing, and transforming data in order to make it suitable for use in machine learning models. Some of the techniques used for data preparation include data cleaning to identify and correct errors, inconsistencies, and missing values; data preprocessing to transform the data into a format that can be easily understood by the machine learning algorithm; and data transformation to create new features from the existing features in the data or reduce the dimensionality of the data. By taking the time to properly prepare data, we can create accurate and reliable machine learning models that produce valuable insights and predictions.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>datascience</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>NumPy and Pandas: Essential Tools for Data Analysis and Manipulation</title>
      <dc:creator>Abhilash Panicker</dc:creator>
      <pubDate>Wed, 03 May 2023 18:35:34 +0000</pubDate>
      <link>https://dev.to/abpanic/numpy-and-pandas-essential-tools-for-data-analysis-and-manipulation-1953</link>
      <guid>https://dev.to/abpanic/numpy-and-pandas-essential-tools-for-data-analysis-and-manipulation-1953</guid>
      <description>&lt;p&gt;Data analysis and manipulation are essential tasks in the world of data science and machine learning. NumPy and Pandas are two Python libraries that provide the necessary tools to perform these tasks efficiently and effectively. In this post, we will discuss the key features of NumPy and Pandas, and provide examples to illustrate their use in data analysis and manipulation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NumPy:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;NumPy (short for Numerical Python) is a library that provides support for large, multi-dimensional arrays and matrices, along with a wide range of mathematical functions to operate on them. NumPy is widely used for scientific computing, data analysis, and machine learning tasks.&lt;/p&gt;

&lt;p&gt;One of the key features of NumPy is its support for multi-dimensional arrays. These arrays can have any number of dimensions and can be indexed and sliced in many different ways. For example, let's create a simple 2D array using NumPy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;numpy&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;

&lt;span class="n"&gt;arr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;([[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
                &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
                &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;]])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can access the elements of this array using indexing and slicing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;  &lt;span class="c1"&gt;# Output: 2
&lt;/span&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;  &lt;span class="c1"&gt;# Output: [2, 5, 8]
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;NumPy also provides a wide range of mathematical functions for working with arrays, including basic arithmetic operations, statistical functions, and linear algebra operations. For example, we can perform element-wise addition and multiplication of two arrays as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Output: [5 7 9]
&lt;/span&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Output: [4 10 18]
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Pandas:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Pandas is a library that provides tools for data analysis and manipulation. It is built on top of NumPy and provides a higher-level interface for working with tabular data.&lt;/p&gt;

&lt;p&gt;One of the key features of Pandas is its data structures, which include Series and DataFrame. A Series is a one-dimensional labeled array, while a DataFrame is a two-dimensional labeled data structure with columns of potentially different types. For example, let's create a DataFrame using Pandas:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;pandas&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;

&lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;'name'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;'Alice'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'Bob'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'Charlie'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="s"&gt;'age'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;35&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="s"&gt;'gender'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;'Female'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'Male'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'Male'&lt;/span&gt;&lt;span class="p"&gt;]}&lt;/span&gt;

&lt;span class="n"&gt;df&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DataFrame&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can access the elements of this DataFrame using indexing and slicing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;'name'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;  &lt;span class="c1"&gt;# Output: ['Alice', 'Bob', 'Charlie']
&lt;/span&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;loc&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;'age'&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;30&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;  &lt;span class="c1"&gt;# Output: Charlie, 35, Male
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pandas also provides a wide range of tools for manipulating data, including filtering, grouping, sorting, and merging. For example, we can filter the rows of a DataFrame based on a certain condition as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;df_filtered&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;'age'&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;30&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df_filtered&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Output: Charlie, 35, Male
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pandas also provides support for data visualization, through integration with libraries such as Matplotlib and Seaborn. This allows data to be visualized in a wide range of formats, including line plots, scatter plots, histograms, and more.&lt;/p&gt;

&lt;p&gt;In conclusion, NumPy and Pandas are essential tools for anyone working with data in Python&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>learning</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Building a Simple Pomodoro Timer in C# on Ubuntu/Windows with .NET Core</title>
      <dc:creator>Abhilash Panicker</dc:creator>
      <pubDate>Mon, 01 May 2023 06:47:30 +0000</pubDate>
      <link>https://dev.to/abpanic/building-a-simple-pomodoro-timer-in-c-on-ubuntuwindows-with-net-core-3e7i</link>
      <guid>https://dev.to/abpanic/building-a-simple-pomodoro-timer-in-c-on-ubuntuwindows-with-net-core-3e7i</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Pomodoro Technique is a popular time management method that involves breaking work into intervals (usually 25 minutes) separated by short breaks. In this blog post, we'll create a simple Pomodoro Timer application called TaskTracker using C# and .NET Core on Ubuntu. You can perform this on Windows with the same steps. The application will run in the console, displaying messages when it's time to work and when it's time to take a break.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before we start, make sure you have .NET Core SDK installed on your Ubuntu machine. If you don't, follow the instructions at &lt;a href="https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu"&gt;https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu&lt;/a&gt; to install it.&lt;/p&gt;

&lt;p&gt;Step 1: Create a new console application&lt;/p&gt;

&lt;p&gt;Open a terminal and type the following command to create a new console application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dotnet new console -o TaskTracker
cd TaskTracker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 2: Edit Program.cs&lt;/p&gt;

&lt;p&gt;Open the &lt;code&gt;Program.cs&lt;/code&gt; file in your favorite text editor or IDE. The file should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;TaskTracker&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Program&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello World!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&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;p&gt;Step 3: Create a Timer class&lt;/p&gt;

&lt;p&gt;Create a new file named &lt;code&gt;Timer.cs&lt;/code&gt; in the &lt;code&gt;TaskTracker&lt;/code&gt; folder and add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Timer.cs&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.Timers&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;TaskTracker&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Timer&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;_interval&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="n"&gt;Timer&lt;/span&gt; &lt;span class="n"&gt;_timer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;event&lt;/span&gt; &lt;span class="n"&gt;EventHandler&lt;/span&gt; &lt;span class="n"&gt;TimerFinished&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;Timer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;interval&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;_interval&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;interval&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="n"&gt;_timer&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Timer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_interval&lt;/span&gt; &lt;span class="p"&gt;*&lt;/span&gt; &lt;span class="m"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;_timer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Elapsed&lt;/span&gt; &lt;span class="p"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;Timer_Elapsed&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Start&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;_timer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Start&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Stop&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;_timer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Stop&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Timer_Elapsed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;object&lt;/span&gt; &lt;span class="n"&gt;sender&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ElapsedEventArgs&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;_timer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Stop&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="n"&gt;TimerFinished&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;Invoke&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;EventArgs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Empty&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&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;p&gt;The &lt;code&gt;Timer&lt;/code&gt; class defines a custom timer that triggers an event when the specified interval elapses. We'll use this class to manage work and break intervals.&lt;/p&gt;

&lt;p&gt;Step 4: Create a Task class&lt;/p&gt;

&lt;p&gt;Create a new file named &lt;code&gt;Task.cs&lt;/code&gt; in the &lt;code&gt;TaskTracker&lt;/code&gt; folder and add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;TaskTracker&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Task&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="n"&gt;Timer&lt;/span&gt; &lt;span class="n"&gt;_workTimer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="n"&gt;Timer&lt;/span&gt; &lt;span class="n"&gt;_breakTimer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;_completedCycles&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;workMinutes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;breakMinutes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;_workTimer&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Timer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;workMinutes&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;_breakTimer&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Timer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;breakMinutes&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

            &lt;span class="n"&gt;_workTimer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TimerFinished&lt;/span&gt; &lt;span class="p"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;WorkTimerFinished&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="n"&gt;_breakTimer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TimerFinished&lt;/span&gt; &lt;span class="p"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;BreakTimerFinished&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Start&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;_workTimer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Start&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;WorkTimerFinished&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;object&lt;/span&gt; &lt;span class="n"&gt;sender&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;EventArgs&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Work time is over. Take a break!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;_breakTimer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Start&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;BreakTimerFinished&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;object&lt;/span&gt; &lt;span class="n"&gt;sender&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;EventArgs&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;_completedCycles&lt;/span&gt;&lt;span class="p"&gt;++;&lt;/span&gt;
            &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;$"Break time is over. Completed cycles: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;_completedCycles&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;. Time to work!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;_workTimer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Start&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="p"&gt;}&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;p&gt;The &lt;code&gt;Task&lt;/code&gt; class manages work and break cycles using two instances of the &lt;code&gt;Timer&lt;/code&gt; class. It starts the work timer and, when it finishes, starts the break timer. This cycle repeats indefinitely.&lt;/p&gt;

&lt;p&gt;Step 5: Modify Program.cs&lt;/p&gt;

&lt;p&gt;Update &lt;code&gt;Program.cs&lt;/code&gt; to use the &lt;code&gt;Task&lt;/code&gt; class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Program.cs&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;PomodoroTimer&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Program&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Pomodoro Timer!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

            &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;workMinutes&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;25&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;breakMinutes&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

            &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;pomodoro&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Pomodoro&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;workMinutes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;breakMinutes&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="n"&gt;pomodoro&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Start&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Press any key to exit the timer."&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ReadKey&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&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;p&gt;Step 6: Build and run the application&lt;/p&gt;

&lt;p&gt;In the terminal, navigate to the &lt;code&gt;TaskTracker&lt;/code&gt; folder and execute the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dotnet build
dotnet run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The application will start, and the Task timer will begin with the default 25 minutes of work time and 5 minutes of break time. You'll see console messages indicating when it's time to work and when it's time to take a break. Press any key to exit the application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this blog post, we created a simple C# TaskTracker application using .NET Core on Ubuntu. The application uses a custom &lt;code&gt;Timer&lt;/code&gt; class to manage work and break intervals and a &lt;code&gt;Pomodoro&lt;/code&gt; class to manage cycles. The console application provides a minimalistic interface to help users stay focused and manage their time effectively using the Pomodoro Technique.&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>programming</category>
      <category>productivity</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Renaming Folders in a Python Project with a Simple Script</title>
      <dc:creator>Abhilash Panicker</dc:creator>
      <pubDate>Mon, 01 May 2023 03:03:10 +0000</pubDate>
      <link>https://dev.to/abpanic/renaming-folders-in-a-python-project-with-a-simple-script-2l0o</link>
      <guid>https://dev.to/abpanic/renaming-folders-in-a-python-project-with-a-simple-script-2l0o</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Managing folder names in a project can sometimes become tedious, especially when you want to change the naming convention. In this tutorial, we'll show you how to create a Python script to rename folders in your project quickly and efficiently.&lt;/p&gt;

&lt;p&gt;In our example, we will rename folders with the pattern "01_Lesson_Introduction" to "01_Introduction". We'll use the os and re libraries in Python to accomplish this task.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating the Python Script:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Start by importing the required libraries:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;re&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, define a function called rename_folders that takes one argument, path, which is the path to the directory containing the folders you want to rename.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;rename_folders&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside the function, create a list of directories in the provided path using a list comprehension.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;    &lt;span class="n"&gt;dir_list&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;listdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;))]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, start a loop that iterates through each folder in the dir_list:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;folder&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;dir_list&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the loop, try to match the folder name to a given regular expression pattern:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;        &lt;span class="n"&gt;match&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="s"&gt;"(\d{2})_Lesson_(.+)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;folder&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If there's a match, create a new folder name using the matched groups:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;match&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;new_folder_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;match&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;_&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;match&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;group&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, construct the full paths for the current folder and the new folder name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;            &lt;span class="n"&gt;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;folder&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;dst&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;new_folder_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rename the folder using the os.rename function and print the renamed folder's source and destination paths for confirmation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;            &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rename&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;src&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dst&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s"&gt;"Renamed folder '&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;src&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;' to '&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;dst&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;'"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, provide the path to your project folder and call the rename_folders function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;project_path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"/path/to/your/project"&lt;/span&gt;
&lt;span class="n"&gt;rename_folders&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;project_path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember to replace "/path/to/your/project" with the actual path to your project folder.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this tutorial, we demonstrated how to create a Python script to rename folders in a project using the os and re libraries. This script can save you time when managing folder names and help keep your project organized.&lt;/p&gt;

&lt;p&gt;Always remember to backup your project folder before running any scripts that modify its contents, just in case something goes wrong.&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>automation</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Building a Pomodoro Timer for Ubuntu in Python</title>
      <dc:creator>Abhilash Panicker</dc:creator>
      <pubDate>Thu, 27 Apr 2023 13:49:46 +0000</pubDate>
      <link>https://dev.to/abpanic/building-a-pomodoro-timer-for-ubuntu-in-python-fh0</link>
      <guid>https://dev.to/abpanic/building-a-pomodoro-timer-for-ubuntu-in-python-fh0</guid>
      <description>&lt;p&gt;&lt;strong&gt;The following can be used as a code along but the project has been moved to : &lt;a href="https://github.com/abpanic/Task-Tracker"&gt;https://github.com/abpanic/Task-Tracker&lt;/a&gt; &lt;br&gt;
It has more features, being used by almost 35 SDK Engineers for daily Task management and I will provide a code along for it in addition to creating executables for distribution&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I had to install Ubuntu on my personal machine and spend some time up-skilling. I learnt about the Pomodoro Technique for better time management and realised that there was a need for an app for Ubuntu since none of the apps provided the functionality I wanted.&lt;/p&gt;

&lt;p&gt;Hence, the project started of and the completed component in its alpha version is here: &lt;a href="https://abpanic.github.io/PomodoroTimer/"&gt;https://abpanic.github.io/PomodoroTimer/&lt;/a&gt;&lt;br&gt;
In this blog post, I'll be discussing the build process of a custom Pomodoro Timer created for my use case. Let's dive into the details.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Build Process
&lt;/h2&gt;
&lt;h2&gt;
  
  
  Installing Pre-requisite
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.python.org/"&gt;Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.python.org/3/library/tkinter.html"&gt;Tkinter library&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.pygame.org/news"&gt;Pygame library&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Visual Studio Code
&lt;/h3&gt;

&lt;p&gt;I started by creating a new file in Visual Studio Code with the filename "PomodoroTimer.py" and added an initial scaffolding to outline the main components of the application. The starter code looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import tkinter as tk

class PomodoroTimer:
    def __init__(self, master):
        self.master = master
        master.title("Pomodoro Timer")

        # Create timer label
        self.timer_label = tk.Label(master, text="00:00", font=("Arial", 48))
        self.timer_label.pack(pady=50)

        # Create timer control buttons
        self.start_button = tk.Button(master, text="Start", command=self.start_timer)
        self.start_button.pack(side="left", padx=10)

        self.pause_button = tk.Button(master, text="Pause", command=self.pause_timer, state="disabled")
        self.pause_button.pack(side="left", padx=10)

        self.stop_button = tk.Button(master, text="Stop", command=self.stop_timer, state="disabled")
        self.stop_button.pack(side="left", padx=10)

    def start_timer(self):
        pass

    def pause_timer(self):
        pass

    def stop_timer(self):
        pass

root = tk.Tk()
app = PomodoroTimer(root)
root.mainloop()

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The starter code is just the scaffolding of the application, and it's okay not to have all the components functionally coded in the first go. However, running the starter code in VSCode should launch the app, as we kick off and it should launch fine as it did.&lt;/p&gt;

&lt;p&gt;Next, I added the rest of the code components to ensure the application is functional and performs the tasks it's supposed to. As you can see the start, pause and stop timer function was missing so was the timer and state of the app. We also added countdown and timer label&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import tkinter as tk    
class PomodoroTimer:    
    def __init__(self, master): 
        ...//code here remains the same 
        master.title("Pomodoro Timer")  
        self.seconds_left = 25 * 60  # 25 minutes   
        self.is_running = False 
        ...//code here remains the same     
    def countdown(self):    
        if self.seconds_left &amp;gt; 0 and self.is_running:   
            self.seconds_left -= 1  
            self.update_timer_label()   
            self.master.after(1000, self.countdown)  # Call this method again after 1000 ms (1 second)  
    def update_timer_label(self):   
        minutes, seconds = divmod(self.seconds_left, 60)    
        self.timer_label.configure(text=f"{minutes:02d}:{seconds:02d}") 
    def start_timer(self):  
        if not self.is_running: 
            self.is_running = True  
            self.start_button.config(state="disabled")  
            self.pause_button.config(state="normal")    
            self.stop_button.config(state="normal") 
            self.countdown()    
    def pause_timer(self):  
        if self.is_running: 
            self.is_running = False 
            self.start_button.config(state="normal")    
            self.pause_button.config(state="disabled")  
    def stop_timer(self):   
        if self.is_running or self.seconds_left != 25 * 60: 
            self.is_running = False 
            self.seconds_left = 25 * 60 
            self.update_timer_label()   
            self.start_button.config(state="normal")    
            self.pause_button.config(state="disabled")  
            self.stop_button.config(state="disabled")   
if __name__ == "__main__":  
    root = tk.Tk()  
    ...//code here remains the same 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, the application is coming up nicely, and we can run it from the terminal with &lt;code&gt;python3 PomodoroTimer.py&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The application launches and the timer starts. However, a Minimum Viable Product (MVP) should have features that go beyond basic functionality. It should include features in the initial phase that make users want to use it more.&lt;/p&gt;

&lt;p&gt;So, I focused on two unique features to set it apart from other Pomodoro timers available in the Ubuntu snap store:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;An alarm sound that the user can hear, allowing them to reset the timer.&lt;/li&gt;
&lt;li&gt;The ability to launch the application with a double click on Ubuntu.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To implement these features, I made the following changes:&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding Alarm Sound
&lt;/h3&gt;

&lt;p&gt;I used the &lt;code&gt;pygame&lt;/code&gt; library to add the alarm sound feature:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import tkinter as tk
import pygame

class PomodoroTimer:
    def __init__(self, master):
        ...//code here remains the same 

        pygame.mixer.init()

    def countdown(self):
        if self.seconds_left &amp;gt; 0 and self.is_running:
           ...//code here remains the same  
            self.master.after(1000, self.countdown)  # Call this method again after 1000 ms (1 second)
        elif self.is_running:
            self.play_alarm()

    ...//code here remains the same 

    def stop_timer(self):
        if self.is_running or self.seconds_left != 25 * 60:
            ...//code here remains the same 
            self.pause_button.config(state="disabled")
            self.stop_button.config(state="disabled")

    def play_alarm(self):
        pygame.mixer.music.load("alarm_sound.wav")  # Replace "alarm_sound.wav" with the path to your sound file
        pygame.mixer.music.play()

if __name__ == "__main__":
    root = tk.Tk()
    app = PomodoroTimer(root)
    root.mainloop()

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Making the Application Executable with Double Click on Ubuntu
&lt;/h3&gt;

&lt;p&gt;To make the Python script executable with a double click on Ubuntu, I followed these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add a shebang line to the script.
Open your Python script (PomodoroTimer.py) in a text editor and add the following line to the very top of the file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/usr/bin/env python3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This line tells the operating system to use Python 3 to run the script.&lt;br&gt;&lt;br&gt;
Save and close the file.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Make the script executable.
Open a terminal window and navigate to the directory where the script is located. Then, run the following command:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod +x PomodoroTimer.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This command grants the script executable permissions.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Associate the script with the Python interpreter.&lt;br&gt;&lt;br&gt;
To make sure your script opens with Python when double-clicked, you need to associate .py files with the Python interpreter. To do this, follow these steps:&lt;br&gt;&lt;br&gt;
a. Right-click on the PomodroTimer.py file and select "Properties" from the context menu.&lt;br&gt;&lt;br&gt;
b. In the "Properties" window, navigate to the "Open With" tab.&lt;br&gt;&lt;br&gt;
c. Find the "Python 3" interpreter in the list of applications. If you don't see it, click "Show other applications" and find it in the extended list.&lt;br&gt;&lt;br&gt;
d. Select "Python 3" and click the "Set as default" button.&lt;br&gt;&lt;br&gt;
Double click the script: Now you should be able to double-click the PomodoroTimer.py file to run the script.&lt;br&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;(Optional) Create a desktop shortcut.&lt;br&gt;&lt;br&gt;
Right-click on your desktop and select "Create a new launcher here" or "Create Launcher" (the wording may differ depending on your Ubuntu version).&lt;br&gt;&lt;br&gt;
In the "Create Launcher" window, fill in the details:&lt;br&gt;&lt;br&gt;
a. Type: Select "Application" from the dropdown menu.&lt;br&gt;&lt;br&gt;
b. Name: Enter a name for the shortcut, such as "Pomodoro Timer".&lt;br&gt;&lt;br&gt;
c. Command: Click the "Browse" button and navigate to the location of your PomodoroTimer.py file. Select the file and click "Open".&lt;br&gt;&lt;br&gt;
d. (Optional) Icon: Click the icon placeholder to choose an icon for the shortcut.&lt;br&gt;&lt;br&gt;
Click "OK" or "Create" to create the desktop shortcut.&lt;br&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;With these enhancements, it's now time to work on creating a distributable version of the pilot application.&lt;/p&gt;

&lt;p&gt;To convert the Python script into a Debian package (.deb file), I followed these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install required tools.
Open a terminal and run the following commands to install the necessary tools:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
sudo apt install dh-python devscripts debhelper
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Create a directory structure for the package.
Replace your_package_name with a name for your package, and run the following commands:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir -p your_package_name/usr/src/your_package_name
mkdir -p your_package_name/usr/bin
mkdir -p your_package_name/debian
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Then, move your Python script (PomodoroTimer.py) to the your_package_name/usr/src/your_package_name directory.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a script to run the application.
In the your_package_name/usr/bin directory, create a new file called your_package_name (without any file extension). In this file, add the following content:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/sh
/usr/bin/python3 /usr/src/your_package_name/PomodoroTimer.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Save the file and make it executable by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod +x your_package_name/usr/bin/your_package_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create a &lt;code&gt;debian/control&lt;/code&gt; file.
In the your_package_name/debian directory, create a new file called control. Add the following content to the file, replacing the placeholder text with your package details:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Source: your_package_name
Section: utils
Priority: optional
Maintainer: Your Name &amp;lt;your.email@example.com&amp;gt;
Build-Depends: debhelper (&amp;gt;=9), dh-python, python3
Standards-Version: 3.9.8

Package: your_package_name
Architecture: all
Pre-Depends: dpkg (&amp;gt;= 1.16.1), python3
Depends: ${shlibs:Depends}, ${misc:Depends}, ${python3:Depends}
Description: Short description of your package
 Long description of your package.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create a &lt;code&gt;debian/rules&lt;/code&gt; file.
In the your_package_name/debian directory, create a new file called rules. Add the following content to the file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/usr/bin/make -f

%:
    dh $@ --with python3 --buildsystem=pybuild --system=setuptools
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the file and make it executable by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod +x your_package_name/debian/rules
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create a &lt;code&gt;debian/changelog&lt;/code&gt; file.
Add the following content to the file, replacing the placeholder text with your package details:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;your_package_name (1.0-1) unstable; urgency=low

  * Initial release.

 -- Your Name &amp;lt;your.email@example.com&amp;gt;  &amp;lt;current_date&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace  with the current date in the format Mon, DD MMM YYYY HH:MM:SS +ZZZZ.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create &lt;code&gt;setup.py&lt;/code&gt; file.
Create a setup.py file in the root directory of your project with the following content:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from setuptools import setup, find_packages

setup(
    name="pomodorotimer",
    version="1.0",
    packages=find_packages(),
    entry_points={
        'console_scripts': [
            'pomodorotimer=pomodorotimer:main',
        ],
    },
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace pomodorotimer:main with the appropriate module and function name for your application entry point.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a &lt;code&gt;debian/compat&lt;/code&gt; file.
Creating create a new file called compat in the debian directory with the following content:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This sets the compatibility level to 10, which should work with the tools you are using.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Build the Debian package.
Navigate to the root of your your_package_name directory in the terminal and run the following command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dpkg-buildpackage -us -uc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the build is successful, a .deb file will be generated in the parent directory of your your_package_name folder.&lt;/p&gt;

&lt;p&gt;Now, I have a .deb file that I can distribute and install on Debian-based systems using the &lt;code&gt;dpkg -i your_package_name.deb&lt;/code&gt; command.&lt;/p&gt;

</description>
      <category>python</category>
      <category>ubuntu</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to add a Credly Badge page to your site</title>
      <dc:creator>Abhilash Panicker</dc:creator>
      <pubDate>Sun, 19 Mar 2023 11:52:46 +0000</pubDate>
      <link>https://dev.to/abpanic/how-to-add-a-credly-badge-page-to-your-site-cbo</link>
      <guid>https://dev.to/abpanic/how-to-add-a-credly-badge-page-to-your-site-cbo</guid>
      <description>&lt;p&gt;Hello there!&lt;/p&gt;

&lt;p&gt;I recently created a portfolio website for myself at &lt;a href="https://dbugr.vercel.app/"&gt;https://dbugr.vercel.app/&lt;/a&gt;. While working on it, I faced the challenge of showcasing my various badges and certifications online, as a traditional 2-page resume wouldn't allow me to include all of them. That's where having a portfolio website comes in handy, as it allows recruiters to easily view my credentials separately.&lt;br&gt;
In this post, I will walk you through how I created a separate page for my badges and certificates, complete with badge images and links to the Credly website for verification.&lt;/p&gt;

&lt;p&gt;Step 1: Save the Credly page&lt;/p&gt;

&lt;p&gt;To get started, I went to the Credly website and saved the page where all my badges are listed. For me, that page is &lt;a href="https://www.credly.com/users/abhilash-panicker/badges"&gt;https://www.credly.com/users/abhilash-panicker/badges&lt;/a&gt;. By saving this page, I was able to have access to the complete list of all my badges, along with the images of each badge. Additionally, I could obtain the links to each badge individually, making it easier to access the relevant information from the Credly site.&lt;/p&gt;

&lt;p&gt;Step 2: Remove non-relevant sections:&lt;/p&gt;

&lt;p&gt;Next, I investigated the downloaded HTML file and removed the non-relevant sections. Luckily, I found that the badge names were available in JSON format, which made my life much easier.&lt;br&gt;
Here's an example of what I found:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;accepted_badges: [
  {
    id: "f809e5ce-7e81-4790-8797-d287430a497e",
    name: "IBM Machine Learning Specialist - Associate",
    template: "57fdad10-d407-4f3e-bafb-754d565c52c2",
    created_by_id: "d5a90a02-5fe7-4915-a42d-8273c91cab0f",
    created_by_name: "IBM",
    issued_at: "2022-10-06",
    image: "/Badges-Credly_files/Machine_Learning_Specialist_-_Foundational.png",
    desc: "",
    skills: "",
  },
  // more badges...
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this information, I was able to put the data in a file and create an object with all the badge information, which I could then iterate through in the next step.&lt;/p&gt;

&lt;p&gt;Step 3: Create a separate page for certifications&lt;/p&gt;

&lt;p&gt;Once I had gathered all the necessary information about my badges and certifications, I created a separate page on my website dedicated to displaying them. I titled the page "Certifications" and designed it to include a section on the side that would allow users to easily navigate to the websites where they could view my academic projects and badges.&lt;/p&gt;

&lt;p&gt;To achieve this, I used a nested div element and the Tailwind CSS framework to create a left side section for the page. The code for this section looks like this:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{/* Social Buttons */}

  {/* Social Links */}
  &amp;lt;h1&amp;gt;
    Links to my Certifications:
  &amp;lt;/h1&amp;gt;



        &amp;lt;a href="https://www.credly.com/users/abhilash-panicker/badges"&amp;gt;
          →
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          &amp;lt;div className="text-lg text-gray-500 font-mono relative overflow-hidden dark:text-gray-300"&amp;gt;
            &amp;lt;div className="absolute h-0.5 w-full bg-gray-400 bottom-0 transform -translate-x-24 group-hover:translate-x-0 transition duration-300"&amp;gt;&amp;lt;/div&amp;gt;
            Credly
          &amp;lt;/div&amp;gt;
        &amp;lt;/a&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;div className="flex flex-row justify-start items-center"&amp;gt;
      &amp;lt;div&amp;gt;
        &amp;lt;a href="https://eportfolio.mygreatlearning.com/abhilash-panicker"
           className="flex flex-row items-center space-x-4 group"
        &amp;gt;
          &amp;lt;div className="my-4"&amp;gt;&amp;amp;rarr;&amp;lt;/div&amp;gt;
          &amp;lt;div className="text-lg text-gray-500 font-mono relative overflow-hidden dark:text-gray-300"&amp;gt;
            &amp;lt;div className="absolute h-0.5 w-full bg-gray-400 bottom-0 transform -translate-x-24 group-hover:translate-x-0 transition duration-300"&amp;gt;&amp;lt;/div&amp;gt;
            GreatLearning
          &amp;lt;/div&amp;gt;
        &amp;lt;/a&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;As you can see, I used the certData object to iterate through and display each badge as a grid component. To create the grid, I separated each badge's CSS element and used the code below:&lt;/p&gt;


&lt;h3&gt;
&lt;br&gt;
    Credly Badges:&lt;br&gt;
  &lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    {certData.accepted_badges.map((badg, idx) =&amp;amp;gt; (

    ))}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Conclusion: This is how you can too have a certifications page on your portfolio website and it can help showcase your skills and accomplishments since it is considered as an important part equivalent to experience while hiring. Feel free to try this on your own. Hope you enjoying reading.&lt;/p&gt;



</description>
      <category>tutorial</category>
      <category>portfolio</category>
      <category>frontend</category>
      <category>nextjs</category>
    </item>
  </channel>
</rss>
