quote

martedì, febbraio 28, 2023

Code Completion in IntelliJ IDEA on Mac

The shortcut for code compeletion for intelliJ IDEA in MacOS is:
Ctrl+Option+Space

lunedì, febbraio 27, 2023

Coin Change Problem (Dynamic Programming)

youtube
I've asked to chatGPT why dp[i] +=dp[i-coin]
In point 2), we consider the case where we use the coin c to make change for the amount i. In this case, we can use the same number of possible combinations as we could for the amount i-c to make change for the amount i. Let me give you an example to illustrate this. Suppose we have the coins [1, 2, 5] and we want to make change for the amount 7. To compute the number of possible combinations of coins required to make change for the amount 7 using the coins up to 5, we can do the following: We start with dp[0] = 1, since there is only one way to make change for 0 (using no coins). We consider the first coin 1. For each amount i from 1 to 7, we check whether we can use the coin 1 to make change for the amount i. If we can, we update dp[i] by adding the value of dp[i-1] to it, since we can use one 1 coin and the number of possible combinations required to make change for the amount i-1 to make change for the amount i. For example, to make change for the amount 2, we can use one 1 coin and the number of possible combinations required to make change for the amount 1. Therefore, we update dp[2] by adding dp[1] to it. After considering the first coin, we have dp = [1, 1, 1, 1, 1, 1, 1]. We consider the second coin 2. For each amount i from 2 to 7, we check whether we can use the coin 2 to make change for the amount i. If we can, we update dp[i] by adding the value of dp[i-2] to it, since we can use one 2 coin and the number of possible combinations required to make change for the amount i-2 to make change for the amount i. For example, to make change for the amount 3, we can use one 2 coin and the number of possible combinations required to make change for the amount 1. Therefore, we update dp[3] by adding dp[1] to it. After considering the second coin, we have dp = [1, 1, 2, 2, 3, 3, 4]. We consider the third coin 5. For each amount i from 5 to 7, we check whether we can use the coin 5 to make change for the amount i. If we can, we update dp[i] by adding the value of dp[i-5] to it, since we can use one 5 coin and the number of possible combinations required to make change for the amount i-5 to make change for the amount i. For example, to make change for the amount 6, we can use one 5 coin and the number of possible combinations required to make change for the amount 1. Therefore, we update dp[6] by adding dp[1] to it. After considering the third coin, we have dp = [1, 1, 2, 2, 3, 4, 5].

giovedì, marzo 12, 2020

How to get out of projector mode (Win 7) - black screen

I was stuck on windows reboot, after having tried to connect my windows laptop to a projector.
I could see just black screen, it was scaring.

Solution: Hold [Windows key] + P
source

domenica, febbraio 02, 2020

Uninstall Logitech GHUB from Mac

  • Delete the G Hub application from /Applications
  • Trash the entire folder lghub at ~/Library/Application Support/
  • Trash ~/Library/Application Support/Logitech/Gaming/ghubDevices.json
  • Trash settings.json from that same folder

domenica, gennaio 05, 2020

default spring security in spring-boot app

If you include this dependency in your pom:

 groupId: org.springframework.boot
 artifactId: spring-boot-starter-security


you "inherited" the default spring security.
When you application starts, have a look to this message:

Using generated security password: 03219696-3a8d-49d5-8385-11e84fe94ac8

Then if the login mask shows up:













Type this:

user: user
password: that password in the message...

martedì, settembre 10, 2019

Issue with wireless Ubuntu 18.04 - board QCA6174


Workaround:
  1. Replace the folder /lib/firmware/ath10k/QCA6174/hw3.0 with the corresponding from https://github.com/kvalo/ath10k-firmware/tree/master/QCA6174/hw3.0
  2.  rename firmware-4.bin_WLAN.RM.2.0-00180-QCARMSWPZ-1 to firmware-6.bin


giovedì, marzo 28, 2019

Information about maven plugin

$mvn help:describe -Dplugin=io.swagger.codegen.v3:swagger-codegen-maven-plugin:3.0.7 -Ddetail=true
link

martedì, marzo 19, 2019

Debugging test with maven

$ mvn -Dmaven.surefire.debug -Dtest=MultipleJsonDatasetLoaderTest#loading_Multiple_Dataset_Loading_From_Jar test
From intellij remote attach debug on port 5005

venerdì, marzo 08, 2019

intellij - find class not working

In case [ctrl]+[N] is no longer working in intelli then delete the following folder: %USER_HOME%\.IntelliJIdea70\system\caches.
link

martedì, novembre 13, 2018

Ubuntu deja-dup Backup [exclude list]

$ dconf-editor

  • Search for /org/gnome/deja-dup/exclude-list
  • Add ['**/target', '**/.git']

lunedì, settembre 24, 2018

tmux

$ tmux
$ [Ctrl]+[b] / [Shift] + 5
$ [Ctrl]+[b] / [arrow]
$ [Ctrl]+[b]/ [Shift] + "