Author: Arpit Mandliya
- 21 September
Print Bytes without b in Python
Just as a string is a collection of Unicode characters in Python 3, bytes are a collection of objects. Bytes can be stored on a disk and internally everything is stored as bytes in a computer. The relation between strings and bytes is that a string can be encoded into a bytes object. To make […]
- 21 September
Print Dictionary Line by Line in Python
Python provides four data types for collecting and storing data. These data types are also known as Python Collections. One of these four data types is a dictionary. A dictionary is capable of storing the data in key:value pairs, due to which there are certain styles in which it can be printed. This tutorial focuses […]
- 21 September
[Fixed] Org.Mockito.Exceptions.Misusing.WrongTypeOfReturnValue
In this post, we will see how to fix Org.Mockito.Exceptions.Misusing.WrongTypeOfReturnValue. There are two major reasons because of which you can get this Exception. These details are provided in Exception itself. This exception might occur in wrongly written multi-threaded tests. Please refer to Mockito FAQ on limitations of concurrency testing. A spy is stubbed using when(spy.foo()).then() […]
- 20 September
Replace Backslash with Forward Slash in Java
1. Introduction In this post, we will learn about how to replace backslash with forward slash in java. backslash() is used as escape character in Java. For example: It can be used to: Used in special characters such as new line character \n, tab \t Write unicode characters like \u%04x. That’s the reason we can’t […]
- 20 September
Print int as hex in Python
1. Introduction to the Problem Statement In Python, converting and printing an integer as its hexadecimal representation is a common task, especially in applications dealing with low-level data processing, cryptography, or memory address manipulation. Scenario: Let’s consider we have an integer, say 255. Our task is to convert and print this integer in its hexadecimal […]
- 20 September
Remove Backslash from String in Java
Learn about how to remove backslash from String in Java. backslash() is used as escape character in Java. For example it can be used to: Create special characters such as new line character \n, tab \t Write unicode characters like \u%04x. Ways to Remove Backslash from String in Java 1. Using replace() Method Use String’s […]
- 20 September
Convert 0 to 1 and 1 to 0 in Java
In this post, we wil see how to convert 0 to 1 and 1 to 0 in java. There are lots of ways to convert 0 to 1 and 1 to 0 in Java. Let’s go through them. Using Subtraction This is one of easiest solution to swap 0 to 1 and vice versa. Just […]
- 20 September
Get Unix Timestamp in Java
In this post, we will get unix timestamp in Java. As per wikipedia Unix time is a system for describing a point in time. It is the number of seconds that have elapsed since the Unix epoch, excluding leap seconds. The Unix epoch is 00:00:00 UTC on 1 January 1970. Unix time is standard way […]
- 20 September
Print Unicode Character in Python
1. Introduction Handling Unicode characters is a critical aspect of modern programming, especially in a globalized environment where software applications need to support multiple languages and character sets. Python, being a widely-used language, provides several methods to handle and display Unicode characters. This article will explore these methods in both Python 2 and Python 3, […]