Pular para o conteĂşdo principal

Postagens

Mostrando postagens de setembro, 2020

Using jbang for ETL Scripts

As a Java programmer I prefer to use good old Java to extract/transform/load data to make it usable in tools I work for data visualization. However, it is a burden having to use maven just to write a single Java file. Hopefully there's a new tool called jbang that makes it easier to do scripting in Java. More than simple scripts What is impressive about jbang is that you are not restricted to standard Java APIs in fact you can use any library you want coming from Maven! What you will miss is the burden of having to deal with pom.xml and maven builds. Dependencies are simply declared in the Java file itself using a " DEPS " comment, for example: //DEPS org.slf4j:slf4j-nop:1.7.25 Installation To install jbang you just have to check the best way for you in downloads page.  In my case I have sdkman, so it was just a matter of running: $ sdk install jbang Hello World The simplest hello world we can thing can run with jbang without any additional configuration, just install j...

Porting Battleship Game to Android

 The final goal of creating a battleship game was porting it to Android so I can run it on my phone. I was not in the mood to do all configuration and remember how to do it. This changed when GluonHQ introduced start.gluon.io . In this brief post I will share my steps porting the Battleship Game to JavaFX.  Android application development To take advantage of start.gluon.io I created a project and made it part of battleship maven project : The I modified the original JavaFX app so I could use it in the Android ready app: Decoupled the application setup from a pure desktop app: Instead doing setup on desktop main, I moved it to a separated class, so I could reuse the setup in mobile app; Resize: Since I didn't know the target device size, I had to react to scene resize to redraw the game boards. This was easily accomplished by adding a default method in Screen interface, which is called when Scene is resized. Then screen can modify boards size accordingly. I made more small c...