Installing Python & related tools on Windows
Open Source For Geeks
by Aniket Thakur
1w ago
Background In this post, we will see how we can install Python & related tools on the Windows Operating System.  Installing Python Let's start with installing Python itself. For this, you can go to the Python official website and download the Windows installer (link). The version at the time I am writing this is Python 3.12.2. You can download the installer based on your Windows architecture. I have Windows 64-bit, so I downloaded the corresponding installer. You can download and execute the installer. It will install Python and add it to your PATH which will let you execut ..read more
Visit website
Understanding Rest & Spread operator in Javascript
Open Source For Geeks
by Aniket Thakur
3M ago
 Background In JavaScript, we tend to use rest & spread operators to keep code simple and easy to read. Both use three dots "..." but the use cases are different. In this post, we will see what these operations are and how to use them. Before we proceed to looking into individual aspects just remember rest is for collecting elements and spread is for spreading elements.  Rest operator Let's try to see the rest operators 1st. The rest operator is used to collect the remaining elements in an array. The rest syntax works in both function arguments and arrays. Let's look at ..read more
Visit website
Closures in Javascript
Open Source For Geeks
by Aniket Thakur
3M ago
 Background In one of the earlier posts, we saw how to use Javascript (JS) closures to hide variables from the console with a counter-example. In this post, I will explain JS closures in more detail. Closures in Javascript Quoting closures from MDN web docs: A closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment). In other words, a closure gives you access to an outer function's scope from an inner function. In JavaScript, closures are created every time a function is created, at function creation time. It ..read more
Visit website
How to fix Apostrophes and double quotes not showing up in Windows
Open Source For Geeks
by Aniket Thakur
1y ago
 Background Recently I started using Windows 11 and realized Apostrophes (Single quotes) and double quotes not showing up until I type in the next letter. This behavior is really annoying, especially for me (I am from India/Asia) if you are wondering ? . This is most probably because you are using a US-international keyboard. In this post, I will show you how to fix this behavior. Fixing "Apostrophes and double quotes not showing up in Windows" As I mentioned before the issue is with you using the US-international keyboard. So you need to fix that. I am using "Windows ..read more
Visit website
How to move TaskBar to the top or side in Windows 11
Open Source For Geeks
by Aniket Thakur
1y ago
 Background I recently started using Windows 11 and noticed there is no way to move windows TaskBar around. It is permanently fixed toward the bottom of the screen. I personally need the TaskBar towards the left or right of the screen and here's why - Our screen (Desktop or Laptop has more horizontal space than vertical space, hence it's only logical to keep TaskBar on the left or right of the screen so that it takes only horizontal space). Though there is no good way to move the TaskBar around there is a registry edit hack that does the trick.  NOTE: If you are a normal windows use ..read more
Visit website
How to fix issue of not able to click anything on Windows 10
Open Source For Geeks
by Aniket Thakur
3y ago
 Background Recently I came across an issue in Windows 10 where I was not able to click on icons. This was a relatively weird issue. What was happening is - I could click either on icons on the taskbar or icons on the desktop but not both. Also, cancel, minimize buttons won't work. This happened when I switched my mouse from USB to wireless. Anyways there are few ways we can fix this which I have listed below. Restart PC Restart File Explorer Use sfc (system file scanner) Restart PC Well, why not? This fixed the problem. There is not a lot of problems that restarting cant fix. But t ..read more
Visit website
Decorators in Python
Open Source For Geeks
by Aniket Thakur
4y ago
Background In the last post we saw what are closures in Python. In this post we will see what are decorators in python. Closures are heavily used in Decorators. Let's see how.  Decorators in Python As we know already everything in Python is an Object. A decorator is an object that is used to modify a function or a class. Function decorator takes a reference to the decorated function and returns a new function. It will internally call the actual decorated/referenced function. You can also have a class as a decorator instead of a function. When we decorate a method with a class, that func ..read more
Visit website
Understanding python closure
Open Source For Geeks
by Aniket Thakur
4y ago
Background In the last couple of posts, we saw how we can pass multiple arguments in python functions and what are generators in python. Next, I want to explain what decorators are in python. Decorator is a very powerful feature of python but in order to explain it, we need to understand closure in Python. You must have heard of Javascript closures, these are kind of similar. We will see this in detail now. Understanding python closure Python closures are related to nested functions. Consider the following example: def print_func(text): text_to_print = text def printer(): print(text_to_prin ..read more
Visit website
How to add code Syntax highlighting to your blogger blog?
Open Source For Geeks
by Aniket Thakur
4y ago
BackgroundIf you own a technical blog or a website you generally need to add code to illustrate your examples. In such cases highlighting the code becomes essential. You would have seen the code syntax highlighting in this blog itself. In this post, I will show you how you can achieve this. How to add code Syntax highlighting to your blogger blog?For code syntax highlighting we will use SyntaxHighlighter. I will specifically tell you how to add this to your blogger blog. Open your blogger blog dashboard Go to Theme Click on 3 dots beside "My theme" and click on  "Edit HTML ..read more
Visit website
Difference between yield and return in python
Open Source For Geeks
by Aniket Thakur
4y ago
Background If you have been using Python you would have come across return and yield statements. Both are used to return something from a function. Though both of them are used to return something from the function both serve different purposes. In this post, I will try to explain what those are. I use Jupyter notebook for running python code snippets. To see how you can install it refer to my earlier post (link in the Related Sections at the end of this post). Understanding return in Python Let's try to understand returns first as that's the simplest. The return keyword is used is a similar ..read more
Visit website

Follow Open Source For Geeks on FeedSpot

Continue with Google
Continue with Apple
OR