TechDoc




Our website wants to use Cookies  


JVM Version change & BSP

Problem
Cannot run program "/usr/lib/jvm/java-17-openjdk/bin/java" (in directory "..."): error=2, No such file or directory
Solution Check config file .bsp/sbt.json and update reference to jvm version
JDBC ResultSet Fetch Size

To prevent Out of Memory Errors in JVM when receiving extensive, large ResultSets from JDBC queries, it can help to not only set FetchSize on Prepared Statement Level, but also defaultRowFetchSize on JDBC Driver Level. Depending on the used database system and driver, this may vary.
PreparedStatement Level:
ps.setFetchDirection( ResultSet.FETCH_FORWARD )
ps.setFetchSize( 1000 )

JDBC Driver Level:
props.setProperty("defaultRowFetchSize", 1000)
val connection = java.sql.DriverManager.getConnection(url, props)
Minus Symbol within Patterns (RegExp)

Minus Symbol must be escaped within character classes, e.g.
[A-Z\-]
but this is not needed (but doesn't harm either) in other use cases, such as
(?:eins|zwei|d-r-e-i)
Endless Repeat Command (Linux)

while(true); do echo abcdefgh ; date ; sleep 3; done
null.asInstanceOf[...]

scala> null.asInstanceOf[Integer]
val res4: Integer = null

scala> null.asInstanceOf[Int]
val res5: Int = 0
(Int is a primitive type)
Upper Case, Lower Case Conversion (ABAP)

to_upper( ... )   
or String Interpolation:
|{ ... case = upper }|

to_lower( ... )   
or String Interpolation:
|{ ... case = lower }|
Can't find jdk BSP_java-17-openjdk

Problem
Cannot start Scala compile server
Can't find jdk BSP_java-17-openjdk
Solution IntelliJ Settings -> Build, Execution, Deployment -> Compiler -> Scala Compiler -> Scala Compile Server -> Use compile server (checked); JVM: JDK: Select valid SDK (black font instead red font then).
Reboot when compile server problems persist.
Non-Capturing Group (RegExp)

Beispiel mit Strings-Alternativen
(?:eins|zwei|drei)
mp4 zu mp3

ffmpeg -i aaa.mp4 -b:a 192K -vn bbb.mp3
Button Type "submit" by default (pitfall)

<button>...</button>
The default type is submit, with all consequences (forward form data to a GET or POST destination, if there is a surrounding form tag somewhere). That is by default:
<button type="submit">...</button>
It is not so obvious, and could be a pitfall in my eyes (I'd prefer the default would be type=button, then the literals would match).

A button with type button (and not automatically forwarding form data to an URL destination) you get with:

<button type="button">...</button>
"indented definitions expected"

After migrating to Scala 3, and starting using indentation syntax, You're receiving the error message
indented definitions expected

To solve this issue:
  • 1. In project/plugins.sbt
    comment out:
    // addSbtPlugin("ch.epfl.scala" % "sbt-scala3-migrate" % "0.5.1")
    
  • 2. reload sbt project
  • 3. recompile

Ulm, Germany
Phone: +49 (0) 731 14 399 046
Email: hartmut0407@googlemail.com
Powered by Cetalison Http

IT Solutions im Bereich
Unternehmenssoftware & Linux