Start Oracle From Git Bash

Goal To run Oracle SQL in Git Bash. Assumption You have sqlplus added to your PATH. export PATH=${PATH}:/c/oraclexe/app/oracle/product/11.2.0/server/bin/ Problem The option /nolog doesn’t work as expected. $ sqlplus /nolog SQL*Plus: Release Production on Mer. Juin 7 09:43:47 2023 Copyright (c) 1982, 2014, Oracle. All rights reserved. … When SQL*Plus starts, and after CONNECT commands, the site profile (e.g. $ORACLE_HOME/sqlplus/admin/glogin.sql) and the user profile (e.g. login.sql in the working directory) are run. [Read More]

Closer Look into ArrayList Iterator

Background Given an ArrayList of Integers from 0 (inclusive) to 10 (exclusive) with step size 1. We use a while-loop and an Iterator<Integer> to check if this ArrayList hasNext() element, before we remove() the current element. Problem The code below throws an IllegalStateException. import java.util.ArrayList; import java.util.Iterator; import java.util.List; public class UnderstandArrayListIterator { public static void main(String[] args) { List<Integer> a = new ArrayList<>(); for (int i = 0; i < 10; i++) { a. [Read More]

Passed Codingame Java Certification Test

A note to some forgotten methods

String regex replace using capture groups

Since Java SE 9, java.util.regex.Matcher’s replaceAll() method supports lambda expressions.

// import java.util.regex.*;
String varName = "random_string";
Pattern pattern = Pattern.compile("_([a-z])");
Matcher matcher = pattern.matcher(varName);
String result = matcher.replaceAll(m ->;

Source: Arvind Kumar Avinash’s answer on Stack Overflow

Check characters properties using Character’s static methods

The Character class provides some static predicates like

  • isAlphabetic(char c)
  • isDigit(char c)
  • isLowerCase(char c)

Source: Java Character isAlphabetic() Method on Javapoint

Exploration of My First IntelliJ Project

We’ll try to stay in the project root if possible. Find all non-hidden files to know the file structure. $ find -path './.*' -prune -o -type f -print ./Algo-init.iml ./out/production/Algo-init/fr/eql/ai114/algo/init/demo/_1_HelloWorld.class ./src/fr/eql/ai114/algo/init/demo/ -prune returns true for the chosen path and prevents find from descending. -o means OR, so the paths matching -prune won’t pass through -o. -type f selects files, not folders. By default, AND is used to connect different conditions. [Read More]

Reuse Commands with Shell Arguments

My arguments for arguments, functions and alias

Background We often want to test the output with different values for a parameter. Here’s an example: we have a parameter that pandoc uses to / compile source code files to PDF / M$ Word / etc. rm output.html; param=0; pandoc input$param.txt -o output.html; \ echo param = $param In practice, a parameter can be a font, the font size, etc, and there can be multiple parameters. Problem To change the value in the parameter (e. [Read More]
linux  tcsh 

Some Public APIs to Be Viewed

API description
JSON Placeholder mock REST APIs for development only
Google Translate generate free translations up to a certain limit
Open Weather Map weather prediction across the world
REST Countries info about the world’s countries
IP API data about IP addresses
Random Data API like the first one, but with a sharper focus on random data
Pokemon API info about Pokemon with recent introduction of GraphQL API

Merge Two PDF to Single Encrypted PDF

Problem I have unprotected input1.pdf input2.pdf and I want to create one single encrypted.pdf. My try I looked up QPDF’s manual and tried the following command. qpdf --empty --pages input{1,2}.pdf --encrypt upw opw 256 -- encrypted.pdf but I got this error. qpdf: unrecognized argument --encrypt (pages options must be terminated with --) For help: qpdf --help=usage usage information qpdf --help=topic help on a topic qpdf --help=--option help on an option qpdf --help general help and a topic list Solution The sentence inside the parentheses says it all. [Read More]