The Programmer 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.

bytes, python, python bytes to string, string

Python - Convert bytes to string

Converting bytes to a string in Python can be done by decoding the bytes into a unicode string. Below are a few examples of how to convert bytes to a string in both Python 2 and Python 3. We hope this quick guide helps the next time you are converting byte values in Python! If you need to convert int to string,...

Read more

Button, HTML

HTML - Create button that acts like a link

Learning how to create an HTML button that acts like a link is surprisingly difficult for those new to web programming. Let's create an HTML button that links to another page and explain what exactly is needed for this implementation. The tricky part is that an HTML button is typically nested within a form and its job is to either submit the form...

Read more

array, Javascript

JavaScript - Remove element from array

Removing one or many elements from an array in JavaScript is pretty straightforward. Though with all things programming there is some nuances that you should be aware of and there's a million ways to do it. Let's take a quick look at a few different examples to manipulate elements in JavaScript arrays. Removing elements from the end of a JavaScript array...

Read more

Is Clothing An Identity Symbol For Nerds?

In May 2012, young 27-year-old Mark Zuckerberg wore a sweatshirt instead of a shirt and tie to meet with potential investors for Facebook's Initial Public Offering, to the dismay of well-dressed financial analysts around the world. With his casual wardrobe, Zuck entered the pantheon of great nerd technology entrepreneurs; famous in part for the "uniforms" they wear (or wore). Steve...

Read more

Java - How do I compare strings?

Using the == operator to compare strings is common but can have some pitfalls. Below is a short example of the difference between .equals and == operators and when it's appropriate to use them. == tests for reference equality (if they are the same object). .equals() tests for value equality (if they are logically "equal"). Objects.equals() checks for null before calling .equals() so you don't have to. String.contentEquals() compares the content...

Read more