Python range() Function: start, stop and step Explained
Learn Python range() with start, stop and step, negative steps, why range uses little memory, indexing and slicing, and enumerate() vs range(len()).
Learn Python range() with start, stop and step, negative steps, why range uses little memory, indexing and slicing, and enumerate() vs range(len()).
Convert JSON to custom Python objects with object_hook, nested data, a JSONDecoder subclass, object_pairs_hook for duplicate keys and input validation.
Fix TypeError Object is not JSON serializable in Python with a default function, a JSONEncoder subclass, dataclasses.asdict() or __dict__, with dates.
Append data to a JSON file in Python by reading, updating and rewriting it. Fix the dict append AttributeError, write safely, and use JSON Lines.
Write JSON to a file in Python with json.dump(). Learn indent, sort_keys, ensure_ascii for non-ASCII text, the conversion rules and default for dates.
Read a JSON file in Python with json.load(), access nested values, compare load() and loads(), and handle FileNotFoundError, JSONDecodeError and JSONL.
Calculate a file hash in Python with hashlib.file_digest() or chunked reads, verify SHA-256 checksums, find duplicate files, and avoid MD5 for security.
Python capitalize() uppercases the first character and lowercases the rest. See how it differs from title(), capwords() and upper(), with edge cases.
HikariCP is a lightweight JDBC connection pool. Learn about various options for configuring the HikariCP with Spring boot JPA and hibernate.
Testing a Spring Boot application means checking each layer on its own, the controller, the service and the repository, and then checking all layers together. Spring Boot supports these tests with slice annotations such as @WebMvcTest and @DataJpaTest, which test one layer, and with @SpringBootTest, which starts the application. The …
Filter an array of objects by property in TypeScript with filter(): single and multiple conditions, lists of values, nested and optional fields, a typed filterBy() helper and type narrowing.
Configure the Log4j2 Console appender with PatternLayout in log4j2.xml, properties or YAML, with real output. Includes colored levels, JSON logs, ThresholdFilter and fixes for a missing config file.
Java EdDSA example with Ed25519 and Ed448. Generate keys, sign and verify messages, save and load keys, and compare EdDSA with ECDSA, RSA and ML-DSA.
Learn sealed classes and interfaces in Java with permits, final, sealed and non-sealed subclasses, records, exhaustive switch and the reflection API.
Java FileWriter explained with constructors, write and append methods, append mode, the UTF-8 default since Java 18, flush, close and the alternatives.
Java InputStreamReader decodes bytes from an InputStream into characters. Learn charsets, read methods, malformed input, closing rules and alternatives.
Learn the Java FileReader class with UTF-8 charset constructors, char[] and line reading, error handling and when to use Files.newBufferedReader instead.
Install Java on 64-bit Windows with JDK 25 using the MSI, ZIP or winget, set JAVA_HOME and Path, verify java -version and check 32-bit vs 64-bit.
Print a Python list without brackets, with a separator, one item per line, with indexes or as a string with join(), and pretty-print nested lists.
Print to a file in Python with print(file=f), append mode and encoding, contextlib.redirect_stdout(), sys.stdout and shell redirection with > and 2>&1.
Print without a newline in Python using end, the difference between end and sep, printing a list on one line, progress lines with \r and flush.
Learn the Python print() function, its sep, end, file and flush arguments, printing to stderr and files, f-string debugging and pprint for nested data.
Read user input in Python with input(), convert it to numbers safely with a retry loop, read several values from one line, and handle EOFError cleanly.
Learn what the Python pass statement does, why a comment cannot replace it, how it differs from continue, and when to use Ellipsis or NotImplementedError.
Learn how the Python continue statement skips a loop iteration, avoid the infinite while loop trap, and compare continue with break and pass in examples.
Stop a Python loop early with break. Learn for-else for the not-found case, while True loops, nested loops, and next() or any() as shorter alternatives.
Learn the Python while loop with examples. Avoid infinite loops, use break, continue and else, read input with the walrus operator, and emulate do-while.
Learn Python if, elif and else with examples. Order branches, combine conditions, use truthiness and the conditional expression, and replace long chains.
Learn Python sets with examples. Add and remove items, union, intersection and difference with operators, every set method and its return value, frozenset.
Learn the Python dictionary with examples. Create, read with get(), add, update, merge with |, delete and iterate, and every dict method with return value.
Python ascii() returns repr() with non-ASCII characters escaped as \x, \u or \U. See examples on strings and lists, and compare it with repr() and ord().
Write and run the Python Hello World program from a file and the interactive prompt, fix common first-run errors, and add a main block to the script.
Python all() returns True when every element is truthy, and for an empty iterable. See dict and string examples, why empty is True, and validation.
Python any() returns True if at least one element is truthy. See examples with lists, dicts and strings, generators that stop early, and any() vs or.
Python abs() returns the absolute value of a number or the magnitude of a complex number. See return types, -0.0, Decimal, __abs__ and math.fabs().
Learn Python type conversion with examples. Implicit int to float widening, casting with int(), float() and str(), return values and common errors.
Learn the Python for loop over lists, tuples, sets, strings and dicts, with range(), enumerate(), zip(), for-else and why not to change a list in a loop.
Fix Error could not find or load main class in Java by reading the Caused by line. Package, classpath, typos, missing JARs, Main-Class and IDE cases.
Java console input and output with System.out, System.err, printf, Scanner, Java 25 IO, the Console class, hidden passwords and the null console case.
Java Hello World program for Java 25 and older versions, with javac and java commands, real output, a line-by-line walkthrough and fixes for common errors.
Java examples grouped by task, from a program to add two integers with overflow checks to number, string, console and JVM behavior programs.
Calculate the average of N numbers in Java from user input, arrays and lists, and avoid integer division, overflow and empty input bugs.
Learn to read a file from the classpath in Java, how class loaders resolve names, Class vs ClassLoader, context class loader, JARs and modules.
Set classpath from command line in Java with -cp and CLASSPATH on Windows, Linux and macOS, with wildcards, quoting, argument files and the -jar trap.
Pattern matching for instanceof in Java with type patterns, flow scoping, null and generics rules, equals() examples, record patterns and Java 25 updates.
HowToDoInJava provides tutorials and how-to guides on Java and related technologies.
It also shares the best practices, algorithms & solutions and frequently asked interview questions.