<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Yertoob on despatches</title><link>https://icle.es/tags/yertoob/</link><description>Recent content in Yertoob on despatches</description><generator>Hugo</generator><language>en</language><lastBuildDate>Thu, 19 Jun 2025 21:38:42 +0100</lastBuildDate><atom:link href="https://icle.es/tags/yertoob/index.xml" rel="self" type="application/rss+xml"/><item><title>What I learnt developing a small JavaFX App</title><link>https://icle.es/2018/06/26/what-i-learnt-developing-a-small-javafx-app-wip/</link><pubDate>Tue, 26 Jun 2018 11:18:38 +0000</pubDate><guid>https://icle.es/2018/06/26/what-i-learnt-developing-a-small-javafx-app-wip/</guid><description>&lt;h1 id="introduction">Introduction&lt;/h1>
&lt;p>This is a collection of the things I learnt developing a simple JavaFX app over
the last month or two. My background is very much in Java EE with decades of
experience building high end, high-performance ticketing systems. This means
that my expectation from a development environment is relatively high. There are
many optional components in here that I find worthwhile setting up at the start,
but are not necessary&lt;/p></description><content:encoded><![CDATA[<h1 id="introduction">Introduction</h1>
<p>This is a collection of the things I learnt developing a simple JavaFX app over
the last month or two. My background is very much in Java EE with decades of
experience building high end, high-performance ticketing systems. This means
that my expectation from a development environment is relatively high. There are
many optional components in here that I find worthwhile setting up at the start,
but are not necessary</p>
<h2 id="tools">Tools</h2>
<h3 id="maven">Maven</h3>
<p>One of the most useful tools I have found while working with Java is maven. If
maven isn't a part of your build, have a look at it and re-evaluate that. I
have no doubt that maven has saved me hundreds, if not thousands of hours over
the last few years.</p>
<h3 id="javafx-scene-builder">JavaFX Scene Builder</h3>
<p>While this one has a bunch of issues and serious limitations, it can still be a
helpful tool. It helped me get a handle on the components available and placing
items.</p>
<h1 id="libraries">Libraries</h1>
<h2 id="testing">Testing</h2>
<p>I use <strong>junit5,</strong> but there are other options like test-ng which are equally
good. I use **Mockito **for mocking, but there are many other options like
PowerMock, JMockit, EasyMock, etc.</p>
<p>For UI Testing, you can use <strong>TestFX.</strong> I don't like UI work, so haven't done
much work with this.</p>
<pre><code>    org.junit.platform
    junit-platform-launcher
    1.2.0
    test


    org.junit.jupiter
    junit-jupiter-engine
    5.2.0
    test


    org.junit.vintage
    junit-vintage-engine
    5.2.0
    test



    org.mockito
    mockito-core
    2.18.3
    test
</code></pre>
<h2 id="logging">Logging</h2>
<p>I can&rsquo;t live without logging in any application. It can make troubleshooting
much easier, particularly when you&rsquo;ve deployed your app. <strong>log4j2</strong> is the main
logging framework out there. You can choose another one if you like, but I
strongly recommend having and using one.</p>
<pre><code>    org.apache.logging.log4j
    log4j-slf4j-impl
    2.11.0


    org.apache.logging.log4j
    log4j-api
    2.11.0


    org.apache.logging.log4j
    log4j-core
    2.11.0
</code></pre>
<h2 id="dependency-injection">Dependency Injection</h2>
<p>If you have working the Java EE Environment, you have almost certainly come
across
<a href="https://en.wikipedia.org/wiki/Inversion_of_control">Inversion of Control</a>, 
particularly in the form
of <a href="https://en.wikipedia.org/wiki/Dependency_injection">Dependency Injection</a>. I
love dependency injection. It helps with decoupling components and with testing.
I looked at various frameworks including
<a href="https://google.github.io/dagger/">Dagger 2</a>, <a href="https://spring.io/">Spring</a>,
<a href="https://github.com/google/guice">Guice</a>.</p>
<h3 id="dagger">Dagger</h3>
<p>The fully static (compile time) nature of Dagger 2 means that it doesn't gel
well with JavaFX which is very dynamic.</p>
<h3 id="spring">Spring</h3>
<p>I had worked with Spring many years ago and didn't want to tangle with a
behemoth for a small project. There are many components and loads of
functionality in spring and if you building a large and complex project, it
might be worth it.</p>
<h3 id="google-guice">Google Guice</h3>
<p>Google Guice is the framework that I ended up going with. It does have some
dependencies like Guava, but as it turned out, I Guava comes in handy for JavaFX
anyway. We don't need an entry in the pom.xml for this because of the following
dependency.</p>
<h2 id="gluon-ignite">Gluon Ignite</h2>
<p><a href="https://gluonhq.com/labs/ignite/">Gluon Ignite</a> was released by gluon labs to
integrate Dependency Injection frameworks with JavaFX. In other words, it ties
in the DI framework with the FXMLLoader so that it will load the correct
controller instances. Since I am using Guice, I needed the ignore-guice module.
If you add this into your pom.xml, it will also pull in google guice. Easy eh?
;)</p>
<pre><code>    com.gluonhq
    ignite-guice
    1.0.2
</code></pre>
<p>If you don't want to add another dependency, you could take a look at the code
in this module. It's fairly straightforward to integrate that manually into
your app. It's just easier to add in the dependency and let it do the magic</p>
<h2 id="event--publisher--subscriber-framework">Event / Publisher / Subscriber Framework</h2>
<p>It is likely that you will need an event framework or a publisher/subscriber
framework. The nature of GUI design and work is that it is an easy and simple
solution for a number of problems you will come across. Fortunately, we already
have an
<a href="https://github.com/google/guava/wiki/EventBusExplained">event framework</a> in
place within <a href="https://github.com/google/guava">Guava</a> which is a dependency of
Google Guice.</p>
<h2 id="project-lombok">Project Lombok</h2>
<p>Don't you love adding in a getter and a setter for each field? When you change
your fields, don't you love going in and updating all the getters and setters?
How about defining the long, pita to type types with generics of variables that
you are assigning from a method call? I mean the compiler can't possibly figure
that out by itself, right? How about writing out the toString, equals and
hashCode for each class? What do you mean no, you don't? You don't love these
tedious repetitive tasks of development? Good! You will love
<a href="https://projectlombok.org/setup/eclipse">Lombok.</a> Unfortunately, with Lombok,
it's not as simple as adding it into your pom.xml. Check out the install
instructions on their website for you IDE etc. You also need it in your pom.xml.</p>
<pre><code>    org.projectlombok
    lombok
    1.18.0
    provided
</code></pre>
<p>There is some controversy around Lombok. There is a
<a href="https://stackoverflow.com/questions/3852091/is-it-safe-to-use-project-lombok">good post on stackoverflow that covers some of these things in a reasonable fashion</a>.</p>
<h2 id="apache-commons">Apache Commons</h2>
<p>Last but certainly not least, we have
<a href="https://commons.apache.org/">apache commons</a>. This is a collection of libraries
rather than a single one. You know all those bits of code you write over and
over. Chances are that there is something in here that does it better and in a
simpler way.</p>
<h2 id="persistence">Persistence</h2>
<p>TBC</p>
<h1 id="packaging">Packaging</h1>
<p>TBC</p>
]]></content:encoded></item><item><title>yertoob</title><link>https://icle.es/2018/06/25/yertoob/</link><pubDate>Mon, 25 Jun 2018 00:00:00 +0000</pubDate><guid>https://icle.es/2018/06/25/yertoob/</guid><description>&lt;p>YerToob is an app that I am developing to alleviate the tedium of uploading
videos to YouTube. YerToob works by automating large parts of the YouTube upload
process.&lt;/p>
&lt;p>I currently upload a few videos a week and this involves:&lt;/p>
&lt;ul>
&lt;li>Copying and pasting various bits of text for:
&lt;ul>
&lt;li>The description&lt;/li>
&lt;li>The title&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Copying and pasting in the tags, and adding any additional ones&lt;/li>
&lt;li>Scheduling the video&lt;/li>
&lt;li>Adding to playlist&lt;/li>
&lt;li>Generating and uploading a thumbnail&lt;/li>
&lt;li>Scheduling a tweet&lt;/li>
&lt;/ul>
&lt;p>YerToob tries to automate all of the above. It works by defining templates for
the description and the title using tags.&lt;/p></description><content:encoded><![CDATA[<p>YerToob is an app that I am developing to alleviate the tedium of uploading
videos to YouTube. YerToob works by automating large parts of the YouTube upload
process.</p>
<p>I currently upload a few videos a week and this involves:</p>
<ul>
<li>Copying and pasting various bits of text for:
<ul>
<li>The description</li>
<li>The title</li>
</ul>
</li>
<li>Copying and pasting in the tags, and adding any additional ones</li>
<li>Scheduling the video</li>
<li>Adding to playlist</li>
<li>Generating and uploading a thumbnail</li>
<li>Scheduling a tweet</li>
</ul>
<p>YerToob tries to automate all of the above. It works by defining templates for
the description and the title using tags.</p>
<hr>
<h3 id="title-template-example">Title Template Example</h3>
```
Ep[episode:number] - [episode:name] | [playlist:name] | Let's Play Space Engineers
```
<hr>
<h3 id="description-template-example">Description Template Example</h3>
```
[episode:synopsis]

---------

A lone space engineer wakes up in his small ship, far away from a home he once knew. There are only a handful of people still awake, with a few thousand people across a few factions in cryo-sleep. A capital ship is being built to house these cryo chambers. Several engineers have been sent out into the galaxies to build a base.

Their mission is to colonise planets, ideally multiple planets, for each of the three factions. With a few hundred to a thousand people in each faction. Once all the habitats have been built, the engineer is to send a radio signal and await the arrival of the cargo.

With the heavy burden of this mission on their shoulders, this space engineer wakes up, caught in the gravitational pull of a blue planet.

---------

Blog Post: https://drone-ah.com/2018/03/19/lets-play-space-engineers-pilot-series/
Playlist: https://www.youtube.com/playlist?list=PLQb-fOWHIdUzyM-bJllq3QpWdVGDBhC98
Twitter: https://twitter.com/drone_ah

Space Engineers Genome: https://www.genomised.com/games/space-engineers

Games like Space Engineers: https://www.gamecupid.com/games/space-engineers/games-like

Website: http://www.spaceengineersgame.com/

[episode:addendum1]
---------
Credits

https://freesound.org/people/kasa90/sounds/143203/

[episode:addendum2]
```
<hr>
<h3 id="tags">Tags</h3>
<p>There are a set of tags associated with each playlist and with each episode.
These are combined together and set against the video.</p>
<hr>
<h3 id="schedule">Schedule</h3>
<p>You can select which days of the week a video should be uploaded in each
playlist. You also select the time at which it should be published.</p>
<p>The app will then schedule them accordingly.</p>
<hr>
<h3 id="playlist">Playlist</h3>
<p>Each video is added to the relevant playlist automatically.</p>
<hr>
<h3 id="thumbnails">Thumbnails</h3>
<p>The app will pick up a screenshot from one folder, put the specified overlay
image on top, and then scan and overlay another image on top based on the
episode number. The thumbnail is then set against the video.</p>
<hr>
<h3 id="tweet">Tweet</h3>
<p>You define a tweet template:</p>
```
#LetsPlay @SpaceEngineersG | Ep [episode:number] - [episode:title]|
https://youtu.be/[episode:videoId] | #pcgaming
```
<p>Link up your Twitter account, and it will post that tweet at the scheduled time.</p>
<hr>
<h3 id="finding-videos-to-upload">Finding Videos to Upload</h3>
<p>For each playlist, you specify which folder the app should scan for new videos.
Each video in that folder is then uploaded. Each video needs to be tagged with
an episode number. For example, the 50th episode could be:</p>
```
[50] The 50th Episode.mp4
```
<p>If you haven&rsquo;t already defined the episode details in the app, it will create a
new episode with the title of &ldquo;The 50th Episode&rdquo; by removing the episode number
tag and the file extension.</p>
<p>This can be useful if you don&rsquo;t have much episode-specific information.</p>
<hr>
<h3 id="current-status">Current Status</h3>
<p>I am currently testing this app. If you are interested in further updates,
<a href="https://twitter.com/drone_ah">please follow me on Twitter.</a></p>
]]></content:encoded></item></channel></rss>