Categories
Development

How to learn Python for beginners?

Learning Python as a beginner can seem like a daunting task, but with the right resources and approach, it can be quite manageable. Here are some steps that can help you get started with learning Python:

1. Set your goals

What do you want to do with Python? Do you want to build web applications, data analysis, machine learning, or something else? Knowing your end goal will help you stay motivated and focused.

2. Choose a good resource

Choose a good resource: There are many resources available for learning Python, including online tutorials, video courses, books, and interactive platforms. Some popular options include Codecademy, Udemy, Coursera, and Google’s Python Class.

3. Start with the basics

Python is a relatively easy programming language to learn, and it’s a great idea to start with the basics. Learn about variables, data types, control structures, functions, and basic syntax.

4. You need to make time for practice

The more you practice coding, the better you will become. Try to solve small problems and complete simple projects to apply your knowledge and solidify your skills.

5. Get involved in the community:

Python has a large and supportive community of developers, and getting involved with the community can help you learn faster, get answers to questions, and stay motivated. Join online forums, attend local meetups, or participate in online groups.

6. Work on a project

Once you have a good understanding of the basics, try to work on a project that interests you. This could be anything from building a simple calculator to creating a web application or a data analysis tool.

Remember, learning to code takes time and effort, but with persistence and determination, you can become proficient in Python.

Categories
Development

How to clear list in python?

Reassigning list to an empty list

You can clear a list in Python by reassigning the list to an empty list. For example:

my_list = [1, 2, 3, 4, 5]
print("Before clearing:", my_list)
my_list = []
print("After clearing:", my_list)

Output:

Before clearing: [1, 2, 3, 4, 5]
After clearing: []

Using clear() in Python 3.3

Another way to clear a list is to use the clear() method, which is available in Python 3.3 and later:

my_list = [1, 2, 3, 4, 5]
print("Before clearing:", my_list)
my_list.clear()
print("After clearing:", my_list)

Output:

Before clearing: [1, 2, 3, 4, 5]
After clearing: []
Categories
Development

How to clear screen in python?

There are several ways to clear the screen in Python, depending on the operating system you are using. Here are some of the common methods:

Using the os module:

import os
os.system('clear') # for linux/macOS
os.system('cls') # for Windows

Using ANSI escape codes:

print("\033c", end="")

Using the subprocess module:

import subprocess
subprocess.run("clear") # for linux/macOS
subprocess.run("cls") # for Windows

Disclaimer that you might need to run the following code in a terminal and that this might not work in a Python IDE by Pycharm.

Categories
Development

How to fix pip install automl getting stuck?

First of all you will need to change your “pip install automl” to “pip install automl”. This will give you a verbose output and you will find exactly where the installation is failing.

For example a common case for the installation to get stuck is at the point when it tries to install multiprocess as one of its dependencies.

Requirement already satisfied: multiprocess>=0.70.7 in ...\lib\site-packages (from pathos<0.3.0,>=0.2.1->automl) (0.70.11.1)
Collecting multiprocess>=0.70.7
...

Turns out that multiprocess, at the time of writing, worked only on Python 3.6 instead of Python 3.11 (which I was trying to use).

To fix the issue in this case you can switch between Python interpreter. If you want to support multiple versions of Python on Windows this is a good tutorial: https://levelup.gitconnected.com/how-to-install-and-manage-multiple-python-versions-on-windows-10-c90098d7ba5a

If you are on Linux: https://levelup.gitconnected.com/install-multiple-python-versions-on-linux-8bd6d301d78c

For my case I was on Pycharm. If you would like to change Python interpreter on Pycharm you can go to “Find Actions” -> type “Python Interpreter” and then just point it to an installation of folder of Python 3.6.

Anyway, this is if the installation is failing at multiprocess. The root cause of your issue might be different, like a permission issue, but whatever it is just turning on the verbose output and searching online should you give you enough information to unblock yourself.

In case you are still stuck, try to comment below and I will get back to you.

Categories
Business Management

How to pay less tax as a freelance developer?

This blog post highlights the main way that I have found out, legally, that you can use to pay less in tax as a freelance software developer. A disclaimer here that you will have to crosscheck the contents in this blog post to the laws of the country that you are operating in.

Registering as a private company to pay less in tax and how?

Usually freelancers register themselves as an independent contractor. This is faster to start your operations but this means that the you will have to pay taxes on all your income (minus a few expenses that you can deduct). The main “hack” is to instead open a private company. Why is that? Because you can pay taxes on dividends instead. If we use the UK as example there is a nice article here that you can read https://www.crunch.co.uk/knowledge-tax/what-tax-do-i-pay-on-dividends

The gist of it is as follows:

  1. Charge your customers from the company
  2. Optional: Pay yourself a minimum salary
  3. At end of the year declare a profit
  4. Pay yourself dividends which have much less tax

But how to maintain cash flow?

If you have cashflow issues and cannot wait until the end of the year to get paid with your dividends, then you might need to seek out a short term loan. In some countries this can be a business loan too. The ideal way is to at least have savings to sustain a year or part of it.

Last step: get an accountant

An accountant could easily advise you on the above for around 150 USD and it’s worth it. Seek them out before doing anything and you won’t regret it. The disclaimer again that this vary largely on the country that you are operating in.

Good luck, it’s a tough world out there 🙂

Categories
Ideas

Personal Opinion on why I think XRP is not an investment vehicle

Disclaimer to please not take this as investment advice.

Little Intro to Ripple

Ripple has been really successful over the years with widespread adoption of its technology. I personally think they are a good example of how cryptocurrency is here to revolutionize the world (at least the payment industry).

You can read more about it here: https://ripple.com/

Ripple basically provides a better way of doing cross-border payments than SWIFT. In the backend, this runs on the XRP Ledger. You could read up on this at: https://xrpl.org/

Why I think XRP’s price will not rise

1. Ripple injects XRP every month

Ok to the point of this post. Ripple have minted all the XRPs possible at the start of the project so the supply is limited. Now, you would think that given that the supply is limited, may be the price will keep on rising? But if that was the case it should already continued to rise. Why is that?

Turns out, that Ripple holds a big chunk of the total XRPs.

As of May 15th, 2022, this is how the total XRP is distributed:

Total XRP held by Ripple: 5,591,730,904
Total XRP distributed: 48,697,761,612
Total XRP held in Escrow account: 45,700,000,013

source – https://originstamp.com/blog/xrp-how-many-are-there-and-how-many-are-left/#:~:text=As%20of%20May%2015th%2C%202022,XRP%20held%20by%20Ripple%3A%205%2C591%2C730%2C904

They usually distribute XRP every month to increase the supply. And this makes sense for their business and they want liquidity.

2. There are fees associated with XRP Ledger

Now the other point to realise is that running transactions on the XRP Ledger involves fees. How to know which fees are associated to XRP ledger? Check this out to start: https://xrpl.org/fees.html

As you can see, there are transaction costs, transfer costs and outside the ledger costs (we can ignore that because I guess it depends on the application running on top of XRP Ledger).

The fees are all in XRP. What I understand from this is that if XRP’s price rises, this means that the price of transactions are also rising. If I were Ripple, I wouldn’t want that price to be high.

And let’s say that the price increases to 5$ like many websites are predicting at the time of writing. That would mean that now my transactions are costing me 20 times more than the current amount. As a customer of XRP would I want that? What I will likely have to do is increase my “outside the ledger” costs to consumers which is then going to make Ripple as a whole less competitive.

3. Is the total amount XRP really fixed?

Well it is said that 100 billion XRP limit has been hardcoded. However, I can’t think about how Ripple couldn’t just fork another version of XRP, create another Ledger, new validators and start a new whole thing when they reach a limit.

Conclusion

But I might be wrong here because I am not an “expert” in cryptocurrency, blockchain or investment. So I would welcome every reader to comment here on why they think I am wrong.

Categories
Management

How to get over imposter syndrome in Project Management

It can be easy for new managers or those wanting to become managers to feel inadequate or doubt there capabilities. Below are a few things you can practice to overcome your imposter syndrome.

Practice in small things (makes perfect)

Implement your project management skills or frameworks that you have learned into the smallest things. This will reinforce your knowledge and provide you with the confidence required. This could be for example a simple party at your house with your friends. Or a trip to the mountain.

You will need to turn into a project that needs to have a deadline and budget. Then break the project down into tasks. At the end you can do a debrief to break down the project outcome.

Join a non-profit volunteer organisation

This is my personal favourite. I would suggest you either join Junior Chamber International if you are under 40 or you join Rotary if you are above 40. They do regular projects and you should step in to be the project director for one of those projects. In there you will have access to a bigger project that the ones mentioned in the previous suggestion. You will also be management more people.

There is a real sense of satisfaction also associated with completing these projects as well as they are geared towards doing good for humanity.

Network/Interrogate other Managers

Let’s say your weakest point is budgeting for projects. You should find another manager, which could be your friend, colleague or someone else and have a talk about it. Do not feel awkward to ask questions about it. People like to help other people and feel superior when giving advice.

Do courses to re-affirm your capabilities

There are many courses online, both paid and free ones that you can enroll into. If you are already a manager there is only two potential outcomes to enrolling into them:

  1. Either you will learn something new and feel better
  2. Or you will not learn something new and be more confident

You can continue reading at: What is the best project management professional certificate for managers in Technology

Categories
Development

How to fix Blocking waiting for file lock on Cargo build or run

Option 1: Run “cargo clean”

Option 2: sudo pkill rls cargo

Option 3: delete ~/.cargo/.package-cache

Option 4: rm -rf ~/.cargo/registry/index/*

Also if you are on Windows (not sure about other operation systems). This issue can happen if your IDE is automatically compiling the project and locking a cargo file. You would get this error when trying to compile from command line. It is possible that you will also have to close the IDE in this case before trying the above.

Categories
Uncategorized

Quality of life improvement to the blog

We are now rapidly approaching 100 posts on the blog. What this meant for the users is that it has become increasing hard to navigate the website and the posts.

Secondly what this meant to the server side is that the load time had increased.

Changes to the category page

We felt that the most significant improvement that we can bring to the blog to address the two issues above was to make the category page list the posts, without the full post and without the excerpt.

This brings two advantages:

  1. The users can now easily find all posts inside every category. Previously they had to go through every post’s content. This was fine when we had a few posts but going through pages of content to find post titles was an unpleasant experience.
  2. The other advantage is that providing only the post titles instead of the content means that the server has much less work to do.

How we changed the category page to only list posts?

We are a knowledge blog and as tradition let us explain to you what we did in code. This blog is run on WordPress if you have not realised it yet and a variation of the TwentyTwenty theme: Free AMP WordPress Theme with 2 Sidebars

We introduced a category.php file inside the main folder next to functions.php. You can introduce other files with different levels of control to categories, see more here: https://developer.wordpress.org/themes/basics/template-hierarchy/

A simple category template

We used the code from https://www.wpbeginner.com/wp-themes/how-to-create-category-templates-in-wordpress/ which provides a really good explanation on categories and made it simpler as follows:

<?php
/**
* A Simple Category Template adapted from https://www.wpbeginner.com/wp-themes/how-to-create-category-templates-in-wordpress/
*/
 
get_header(); ?> 
 
<section id="primary" class="site-content">
<div id="content" role="main">
<?php 
// Check if there are any posts to display
if ( have_posts() ) : ?>
 
<header class="entry-header has-text-align-center header-footer-group">
<h1><?php single_cat_title( '', true ); ?></h1>
 
</header>
 
<div class="section-inner has-text-align-left ">
<ul class="wp-block-latest-posts__list wp-block-latest-posts">
<?php
  $count = 1;
  // The Loop
  while ( have_posts() ) : the_post(); ?>
  <li>
    <h4> <a class="wp-block-latest-posts__post-title"
     href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
        <?php echo $count."."; ?> <?php the_title(); ?>  <?php $count = $count + 1; //the_time('d/m/Y') ?> </a> </h4>
</li>

  <?php endwhile;   
  else: ?>
  <p>Sorry, no posts matched your criteria.</p>

  <?php endif; ?>
  </ul>
</div>

</div>
</section>
 
<?php get_sidebar(); ?>
<?php get_footer(); ?>

The main changes are the html elements and the style to adapt it to TwentyTwenty. We are debating at the moment on whether to display time next to the posts, hence the comment in the code.

This code basically just lists all posts under every category in the while loop and then create an HTML list <li> with a link to every post.

Introducing new Categories: Gaming and Management

We have also introduced two new categories which are Gaming and Management. Gaming has always been a big part of the blog and now we are introducing management which we plan to grow in the blog. The Management part will still be relevant to Technology.

Finally, thank you for reading the blog for the past 1+ year. We hope to continue for many more year and to provide you with many more educational articles.

If you want to read further, check our new article and category on management: What is the best project management professional certificate for managers in Technology

Categories
Management

What is the best project management professional certificate for managers in Technology

The best professional management certificate that you could do is the Google Project Management Certificate.

A highly qualified team of teachers (managers at Google)

This is the case mainly because the course itself is given by experienced management professionals in the technology space.

  1. Emilio, a Program Manager of Responsible Innovation
  2. JuAnne, a Senior Program Manager at the Cloud Security Program.
  3. Rowena, Senior Program Manager at Google Cloud.
  4. Elita, Senior Engineering Program Manager
  5. Sue, Technical Program Manager at Google Support Platform
  6. Dan, Program Manager at Google Research

Needless to say that this is a highly credible team.

The certificate is geared more towards technology

Although the courses will cover all the aspects of management there is a specific course about Agile given by the Sue. This is great for those working in technology.

There is a total of six courses:

  1. Foundations of Project Management
  2. Projection Initiation: Starting a Successful Project
  3. Project Planning: Putting it All Together
  4. Project Execution: Running the Project
  5. Agile Project Management
  6. Capstone: Applying Project Management in the Real World

This counts towards hours for PMP and CAPM

If you plan to do PMP (Project Management Institute Certification) then you will need at least 100 hours of project management education. Well lucky you, doing this professional certificate from Google will give you just that. This also apply to the Certified Associate in Project Management/CAPM in case you are interested in that.

You can learn at your own pace

This is all completely online. It consists of videos, quizzes and graded questions. But there is no time pressure in doing the certificate. This will give you the flexibility to make time for learning fit in your busy schedule. Or what I would suggest is to learn a course, start applying it in real life and then move to the next course.

The other motivational part for me was that actually it literally is at your own “pace”. You can speed up the videos (up to 2x) and speed run through the course. Whichever fits you best.

Would you like to know more?

You can register for the course at Google Project Management Certificate.