blog RSS

The Programmer Blog is here to help you, the programmer. We do our best to provide useful resources that offer explanations to popular programming problems, across a variety of programming languages. If you would like to suggest a blog topic or have a question, please leave us a message.


How can I redirect the user from one page to another using jQuery or pure JavaScript?

You can redirect the user from one page to another using either jQuery or pure JavaScript. Here are two examples: Using jQuery: // Redirect the user to the specified URL $(location).attr('href', 'https://www.example.com'); // Redirect the user to the URL of the current page  $(location).attr('href', window.location.href); Using pure JavaScript: // Redirect the user to the specified URL window.location.href = 'https://www.example.com'; // Redirect the...

Read more

for, for loop, loop, nested loop, python, python for loop

Python - For Loop

The Python for loop is used to iterate a sequence. The for keyword acts very similarly to that of C++ and Java. Let's have a look at some for loop examples below. For loop flowchart Before we dive into code examples, let's take a quick look at the flowchart below. First we execute the body and then we check a condition. If it's true we...

Read more

gift guide, programmer gift, programmer mugs, programmer shirts, programmer stickers

5 Gift Ideas for Programmers, Developers and Coders

We know finding for the perfect gift for a programmer, developer or coder in your life can be tricky. But that's why we're here! Below we’ve put together a list of top programmer gift ideas to give you some ideas and hopefully secure the perfect programmer gift. If you’re a programmer, developer or coder and have any  suggestions, don't hesitate to...

Read more

c#, c# int to string, int, string

C# - Convert int to string

C# int to string conversion is actually one of the less painful conversions to do. Converting int to string in C# is easy because everything we need is built right into the library. Keep reading to learn the many ways to convert integers to strings in C#. Why convert int to string? Converting an integer to a string is a quite...

Read more

c#, switch, type

C# - Switch on Type

Prior to C# 7 switching on data types was fairly tricky. Luckily with the latest update we can do a C# switch on type very easily. Let's have a look below at why type switching is useful. We will also go over some code examples for both legacy C# and C# 7+. Why switch on types? Switching on an objects type is...

Read more