- Details
- Written by: Jason Ross
This is an error that turns up occasionally when you're developing code in Python. It started happening in some code I was working on recently, and all of the articles I found when I was looking for the cause said the same thing; that you're trying to assign something to a value that's None
. Probably something with an index or key, like a list or dictionary.
This didn't seem to match what I saw in my system at the time, but after looking much more closely it was right, although not for obvious reasons.
Read more: TypeError: 'NoneType' object does not support item assignment
- Details
- Written by: Jason Ross
What Is It?
Go is a statically-typed, general-purpose, compiled programming language. It also gets called "GoLang" because that was the original domain name for the language, but its real name it Go. It’s fairly easy to learn, so you can get started quickly. It’s also quite high level, so it’s easy to be productive with it.
- Details
- Written by: Jason Ross
One of the principles of software development is “Resource Allocation Is Initialization", or RAII. This is useful as it avoids uninitialized values in your code, because all values are initialized when they're declared. It's a great way of avoiding problems with uninitialized references, because there aren't any!
You might not know it as RAII, but there's always the feeling that when you declare something you should initialize it, if only to stop the code linter from complaining.
Like anything else though, it's easy to go too far with this. When the objects in your system take an appreciable amount of time to create, and you want a lot of them, you'll find your application slows to a crawl.
Lazy Evaluation can improve performance dramatically!
Read more: Improve Your System Performance With Lazy Evaluation
- Details
- Written by: Jason Ross
You can add a subheader, or tagline, to your Joomla 4 site. It's easy to do, the only problem is finding where to do it...
- Details
- Written by: Jason Ross
One of the Python features that gets a lot of publicity is list comprehension and, to a lesser extent, dictionary comprehension. It sounds very complex, and it’s very a very popular subject in technical interviews, but it’s really just syntactic sugar – something the interpreter uses to let you simplify your code.
Read more: Python List Comprehensions and Dictionary Comprehensions
- Details
- Written by: Jason Ross
The version of Python installed on the Raspberry Pi operating system is usually a few versions behind the latest. If this matters to you there's a good chance you will want to update it.
You can't use apt
to install the latest version of Python, because it's not available as a package. It's not available as a pre-built installation package from python.org either, so you'll have to built it. It's not too difficult to do this, although there is a problem with the build that I describe how to fix here, so here's how to do it.
Read more: Installing a New Version of Python On A Raspberry Pi
- Details
- Written by: Jason Ross
When you create a system, you want it to run as quickly as possible. Most of the time, this isn’t a problem, but eventually you’ll find yourself in a situation where the performance isn’t as good as you’d like or need.
At this point you have a few options: at first you might decide to throw more CPU power and memory at the problem. This is usually the approach people mean when they tell you that “CPU and memory are cheap!”. If you do this, things will probably improve for a while, before you’re back in the same position again. If you’re using a cloud-based system, you’ll also have a bigger recurring cloud bill and less money in your bank account. So, as always, it’s best to ignore anyone who tells you how “cheap” CPU and memory are.
Read more: Concurrency, Multiprocessing, Multi-threading and Asynchronous Code