Table Rollback Problem

Create a class that populates a table represented in the following way. You can think of this as a nested hash/map/dictionary structure. { "row1": { "col1":"foo", "col2":"bar" }, "row2": { "col1":"baz" } } The class should support the following methods: createRow(rowName): Creates a new empty row of the givenname. Do nothing if a row with that name already exists deleteRow(rowName): Deletes a row with the given name. Donothing if a row with that name doesn’t exist updateCell(rowName, columnName, newVal): Sets the value ofthe cell at the given row/column coordinate to the new value. If the row doesnot exist, do nothing. These actions are grouped together in transactions. Theactions above can only be performed as part of a transaction. The class should also support the following methods: ...

September 20, 2023 · 3 min · Özkan Pakdil

Solving the Remote Keyboard Traversal Problem: Navigating the Grid Efficiently

The Problem Write a program to search a movie title using screen keyboard with minimal traversal (e.g. Searching for a title Using ROKU/Apple TV remote on Netflix). Input keyboard can have all the characters in any order. Given : Movie title and initial position of remote selection We have five buttons in remote: UP, DOWN, LEFT, RIGHT, OK Keyboard: Input remote could be like this (as it buttons could be in any order) A B C D E F G H I J K L M N O P Q R S T U V W X Y Z For Example: Initial position of remote: A Movie title: BHE Result: RIGHT, OK, RIGHT, DOWN, OK, RIGHT, RIGTH, UP, OK (Right answer) Result: RIGHT, RIGHT, LEFT, OK, RIGHT, DOWN, OK, RIGHT, RIGTH, UP, OK (incorrect, not the shortest one) this problem can be categorized as a grid navigation or grid traversal problem ...

September 1, 2023 · 3 min · Özkan Pakdil

Add `open with intellij` into context menu in linux mint

Add code below to ~/.local/share/nemo/actions/intellij.nemo_action [Nemo Action] Name=Open in Intellij Comment=Open in Intellij Exec=sh -c '"$HOME/.local/share/JetBrains/Toolbox/apps/intellij-idea-community-edition/bin/idea" "%F"' Icon-Name=intellij Selection=Any Extensions=dir; Then in files go to folder you want to open with intellij then right click and choose open in intellij.

June 11, 2023 · 1 min · Özkan Pakdil

Add `open with vscode` into context menu in linux mint

Add code below to ~/.local/share/nemo/actions/vscode.nemo_action [Nemo Action] Name=Open in VS Code Comment=Open in VS Code Exec=code "%F" Icon-Name=visual-studio-code Selection=Any Extensions=dir; Then in files go to folder you want to open with VScode then right click and choose open in VS Code.

May 6, 2023 · 1 min · Özkan Pakdil

Printing running sqls in logs with spring boot 3 and hibernate 6

In application.properties logging.level.org.hibernate=info logging.level.org.hibernate.SQL=debug logging.level.org.hibernate.orm.jdbc.bind=trace logging.level.org.hibernate.stat=debug logging.level.org.hibernate.SQL_SLOW=info logging.level.org.hibernate.cache=debug will make print all sqls and bindings with it like below 2023-04-08T09:31:54.232+01:00 DEBUG 164224 --- [ main] org.hibernate.SQL : insert into "address" ("city", "line1", "post_code", "id") values (?, ?, ?, ?) 2023-04-08T09:31:54.232+01:00 TRACE 164224 --- [ main] org.hibernate.orm.jdbc.bind : binding parameter [1] as [VARCHAR] - [Glasgow] 2023-04-08T09:31:54.232+01:00 TRACE 164224 --- [ main] org.hibernate.orm.jdbc.bind : binding parameter [2] as [VARCHAR] - [apt:0] 2023-04-08T09:31:54.232+01:00 TRACE 164224 --- [ main] org.hibernate.orm.jdbc.bind : binding parameter [3] as [VARCHAR] - [G0] 2023-04-08T09:31:54.232+01:00 TRACE 164224 --- [ main] org.hibernate.orm.jdbc.bind : binding parameter [4] as [BIGINT] - [28]

April 8, 2023 · 1 min · Özkan Pakdil