<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Daniel Ferber's Technical Tavern</title><link>https://techtavern.danielferber.com.br/</link><description>Recent content on Daniel Ferber's Technical Tavern</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 27 Sep 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://techtavern.danielferber.com.br/index.xml" rel="self" type="application/rss+xml"/><item><title>Time to unslop human spec writing</title><link>https://techtavern.danielferber.com.br/posts/time-to-unslop-human-spec-writing/</link><pubDate>Sun, 27 Sep 2026 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/time-to-unslop-human-spec-writing/</guid><description>&lt;p&gt;We blame AI for writing slop specs. But the worst spec slop I&amp;rsquo;ve seen in my career was written by humans.&lt;/p&gt;&#10;&lt;p&gt;Long before LLMs, I was reading requirements like this:&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;&amp;ldquo;The system shall allow the user to be able to add an item to the set of items.&amp;rdquo;&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;&amp;ldquo;The system shall not allow an unauthenticated user to fail to be prevented from accessing non-public resources.&amp;rdquo;&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;&amp;ldquo;The system shall block registration of customers whose tax ID already exists and allow registration of customers that already exist, updating the previous record.&amp;rdquo;&lt;/p&gt;&#10;&lt;/blockquote&gt;</description></item><item><title>More or less Portable WebLogic 12c on Windows</title><link>https://techtavern.danielferber.com.br/posts/more-or-less-portable-weblogic-12c-on-windows/</link><pubDate>Sun, 21 Aug 2022 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/more-or-less-portable-weblogic-12c-on-windows/</guid><description>&lt;p&gt;&lt;em&gt;This article appeared first at &lt;a href="https://techtavern.wordpress.com/"&gt;techtavern.wordpress.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;(or, &amp;ldquo;Oracle SOA Suite&amp;rdquo; from &amp;ldquo;Quick Start installation&amp;rdquo;, as stated in the overworded documentation from Oracle)&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;(or version 12.2.1.4 of WebLogic)&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;Yes, it is possible to create a more or less portable installation the WebLogic 12c. This installation will work afterwards without administration privileges. And may run with other JVMs (even non &amp;ldquo;certified&amp;rdquo; ones as Adopt Open JDK). The installation might be moved to other directories or computers where one does not own administration privileges.&lt;/p&gt;</description></item><item><title>Copying all DBeaver configuration from one computer to another</title><link>https://techtavern.danielferber.com.br/posts/copying-all-dbeaver-configuration-from-one-computer-to-another/</link><pubDate>Wed, 21 Apr 2021 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/copying-all-dbeaver-configuration-from-one-computer-to-another/</guid><description>&lt;p&gt;&lt;em&gt;This article appeared first at &lt;a href="https://techtavern.wordpress.com/"&gt;techtavern.wordpress.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;This article explains how to copy your current DBeaver connection from one computer to another.&lt;/p&gt;&#10;&lt;p&gt;Instead of installing all drivers again and instead of creating your connections from scratch, it is actually very simple to copy the DBeaver configuration from one computer to another.&lt;/p&gt;&#10;&lt;p&gt;First, discover where the configuration is stored on the source computer. You can check this easily the the Preferences: Menu -&amp;gt; Preferences -&amp;gt; Worspace. Check the path shown at &amp;ldquo;Show full workspace path:&amp;rdquo;.&lt;/p&gt;</description></item><item><title>Moving from AppEngine and taking your data with you</title><link>https://techtavern.danielferber.com.br/posts/moving-from-appengine-and-taking-your-data-with-you/</link><pubDate>Wed, 03 Mar 2021 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/moving-from-appengine-and-taking-your-data-with-you/</guid><description>&lt;p&gt;&lt;em&gt;This article appeared first at &lt;a href="https://techtavern.wordpress.com/techtavern.wordpress.com"&gt;techtavern.wordpress.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;AppEngine and its companion Datastore have been of great value for our application. Nevertheless, time has come to move to another cloud, which also means to face the annoying fact that all our data is stored within a closed, isolated, black box within Googles infrastructure and accessible only through Googles proprietary AppEngine API.&lt;/p&gt;&#10;&lt;p&gt;This article explains how we managed to download all data from Datastore and prepared it for another cloud.&lt;/p&gt;</description></item><item><title>Choosing a Gradle Java Webstart/JNLP Plugin</title><link>https://techtavern.danielferber.com.br/posts/choosing-a-gradle-java-webstartjnlp-plugin/</link><pubDate>Sat, 11 Mar 2017 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/choosing-a-gradle-java-webstartjnlp-plugin/</guid><description>&lt;p&gt;While developing a &lt;strong&gt;JavaFX&lt;/strong&gt; application distributed with &lt;strong&gt;Webstart&lt;/strong&gt;, I had to choose a &lt;strong&gt;Gradle&lt;/strong&gt; plugin in order to package the application. Unfortunately, Gradle does not support Webstart out of the box. After experiencing several available plugins, I decided for the &lt;a href="https://github.com/tschulte/gradle-jnlp-plugin"&gt;&lt;code&gt;gradle-jnlp-plugin&lt;/code&gt;&lt;/a&gt; from &lt;a href="https://github.com/tschulte"&gt;Tobias Schulte&lt;/a&gt;, hosted at Github.&lt;/p&gt;&#10;&lt;p&gt;His &lt;code&gt;gradle-jnlp-plugin&lt;/code&gt; creates a webstart distribution for a JavaSE application as required by the webstart specification. It creates the &lt;code&gt;jnlp&lt;/code&gt; file and compresses/signs the &lt;code&gt;jar&lt;/code&gt; files. The directory created by the plugin may then be uploaded to your static web server or embedded into your &lt;code&gt;war&lt;/code&gt; file.&lt;/p&gt;</description></item><item><title>Using the gradle-jnlp-plugin – part 1</title><link>https://techtavern.danielferber.com.br/posts/using-the-gradle-jnlp-plugin-part-1/</link><pubDate>Sat, 11 Mar 2017 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/using-the-gradle-jnlp-plugin-part-1/</guid><description>&lt;p&gt;This collection of articles describe the &lt;a href="https://github.com/tschulte/gradle-jnlp-plugin"&gt;&lt;code&gt;gradle-jnlp-plugin&lt;/code&gt;&lt;/a&gt; from &lt;a href="https://github.com/tschulte"&gt;Tobias Schulte&lt;/a&gt;, hosted at Github.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://techtavern.wordpress.com/2017/03/11/using-the-gradle-jnlp-plugin-part-1/"&gt;Using the gradle-jnlp-plugin – part 1&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://techtavern.wordpress.com/2017/03/11/using-the-gradle-jnlp-plugin-part-2"&gt;Using the gradle-jnlp-plugin – part 2&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;The plugin produces a webstart distribution for a JavaSE application as required by the webstart specification. It creates the &lt;code&gt;jnlp&lt;/code&gt; file and compresses/signs the &lt;code&gt;jar&lt;/code&gt; files. The directory created by the plugin may then be uploaded to your static web server or embedded into your &lt;code&gt;war&lt;/code&gt; file.&lt;/p&gt;</description></item><item><title>Using the gradle-jnlp-plugin – part 2</title><link>https://techtavern.danielferber.com.br/posts/using-the-gradle-jnlp-plugin-part-2/</link><pubDate>Sat, 11 Mar 2017 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/using-the-gradle-jnlp-plugin-part-2/</guid><description>&lt;p&gt;This collection of articles describe the &lt;a href="https://github.com/tschulte/gradle-jnlp-plugin"&gt;&lt;code&gt;gradle-jnlp-plugin&lt;/code&gt;&lt;/a&gt; from &lt;a href="https://github.com/tschulte"&gt;Tobias Schulte&lt;/a&gt;, hosted at Github.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://techtavern.wordpress.com/2017/03/11/using-the-gradle-jnlp-plugin-part-1/"&gt;Using the gradle-jnlp-plugin – part 1&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://techtavern.wordpress.com/2017/03/11/using-the-gradle-jnlp-plugin-part-2"&gt;Using the gradle-jnlp-plugin – part 2&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;The plugin produces a webstart distribution for a JavaSE application as required by the webstart specification. It creates the &lt;code&gt;jnlp&lt;/code&gt; file and compresses/signs the &lt;code&gt;jar&lt;/code&gt; files. The directory created by the plugin may then be uploaded to your static web server or embedded into your &lt;code&gt;war&lt;/code&gt; file.&lt;/p&gt;</description></item><item><title>Datanucleus fails for Google AppEngine on Netbeans 8</title><link>https://techtavern.danielferber.com.br/posts/datanucleus-fails-for-google-appengine-on-netbeans-8/</link><pubDate>Sat, 15 Oct 2016 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/datanucleus-fails-for-google-appengine-on-netbeans-8/</guid><description>&lt;p&gt;This article explain how to prevent Datanucleus Enhancer failure when developing for Google AppEngine on Netbeans 8.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;This article originally appeared on https://techtavern.wordpress.com&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;The cause&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;The Google AppEngine plugin for Netbeans from &lt;a href="https://code.google.com/p/nb-gaelyk-plugin/"&gt;Gaelyk&lt;/a&gt; does not work with Google AppEngine Java SDK 40 and later.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;The workaroud&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;While developing, use AppEngine Java SDK 37 (latest available version thar worked for me on Netbeans). You may download it from Maven Repository (&lt;a href="https://mvnrepository.com/artifact/com.google.appengine/appengine-java-sdk/1.9.37"&gt;see this link&lt;/a&gt;), as it is no longer available at Google Appengine site. When building the release version, compile against the latest AppEngine Java SDK.&lt;/p&gt;</description></item><item><title>Unit tests for Objectify entities and DAOs</title><link>https://techtavern.danielferber.com.br/posts/unit-tests-for-objectify-entities-and-daos/</link><pubDate>Wed, 14 Sep 2016 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/unit-tests-for-objectify-entities-and-daos/</guid><description>&lt;p&gt;This article explains how to write unit tests (with &lt;a href="http://junit.org/junit4/"&gt;junit&lt;/a&gt;) for &lt;a href="https://github.com/objectify/objectify"&gt;Objectify&lt;/a&gt; entities and DAOs.&lt;/p&gt;&#10;&lt;p&gt;Google Cloud Platform describes &lt;a href="https://cloud.google.com/appengine/docs/java/tools/localunittesting"&gt;how to write unit tests for Google DataStore&lt;/a&gt;. A small adaptation enables the same solution for Objectify.&lt;/p&gt;&#10;&lt;p&gt;The documentation suggest creating a LocalServiceTestHelper to be initialized in a @Before/setUp() method and disposed in a @After/tearDown() method.&lt;/p&gt;&#10;&lt;p&gt;After calling helper.setUp(), initialize the objectify framework by calling ObjectifyService.begin(). Store the returned closable so you can dispose Objectify at the end of your test.&lt;/p&gt;</description></item><item><title>Displaying PDF documents on Netbeans RCP</title><link>https://techtavern.danielferber.com.br/posts/displaying-pdf-documents-on-netbeans-rcp/</link><pubDate>Thu, 14 Jan 2016 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/displaying-pdf-documents-on-netbeans-rcp/</guid><description>&lt;p&gt;This article explains how to display PDF documents on &lt;a href="http://platform.netbeans.org"&gt;Netbeans RCP&lt;/a&gt;, using &lt;a href="http://community.jaspersoft.com/project/jasperreports-library"&gt;JasperReports libraries&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;This article appeared first at &lt;a href="https://techtavern.wordpress.com/techtavern.wordpress.com"&gt;techtavern.wordpress.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;The proposed solution uses a TopComponent instance in editor mode to display each PDF document. It assumes that there is a JasperPrint object that represents a page-oriented document that can be viewed, printed or exported to other formats. The TopComponent will use a JRViewer to render the PDF document. The JRViewer handles scrolling, zooming, paging and even printing and saving as PDF, Excel and other formats.&lt;/p&gt;</description></item><item><title>HttpURLConnection and GET query parameters</title><link>https://techtavern.danielferber.com.br/posts/httpurlconnection-and-get-query-parameters/</link><pubDate>Mon, 30 Nov 2015 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/httpurlconnection-and-get-query-parameters/</guid><description>&lt;p&gt;I regret that JAVA SE still lacks any decent native HTTP client framework! Simple use cases like GET requests with query parameters require handcrafted coding with HttpURLConnection.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;This article appeared first at &amp;lt;techtavern.wordpress.com&amp;gt;.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;HttpURLConnection misses methods to set query parameters. There is no URI builder facility as found on Apache HTTP Client. You are on your own.&lt;/p&gt;&#10;&lt;p&gt;Therefore, I wrote the &lt;em&gt;applyParameter&lt;/em&gt; method that takes care of GET query parameters.&lt;/p&gt;</description></item><item><title>Comparing your Oracle databases</title><link>https://techtavern.danielferber.com.br/posts/comparing-your-oracle-databases/</link><pubDate>Mon, 26 Oct 2015 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/comparing-your-oracle-databases/</guid><description>&lt;p&gt;This article suggests an approach to compare your development, test and production databases using SQL scripts executed from a Servlet.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;This article appeared first on &lt;a href="https://techtavern.wordpress.com"&gt;techtavern.wordpress.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;Create a Servlet that produces following SQL statements as a text report: (replace **** with a proper value applicable to your database).&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Tables, sequences and views:&lt;/strong&gt; SELECT OBJECT_TYPE, OBJECT_NAME, STATUS FROM ALL_OBJECTS WHERE OWNER = ‘****’ ORDER BY OBJECT_TYPE, OBJECT_NAME&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Columns of each table:&lt;/strong&gt; SELECT TABLE_NAME, COLUMN_NAME, QUALIFIED_COL_NAME, DATA_TYPE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE, NULLABLE, CHARACTER_SET_NAME, CHAR_COL_DECL_LENGTH, CHAR_LENGTH, CHAR_USED FROM ALL_TAB_COLS WHERE OWNER = ‘****’ ORDER BY TABLE_NAME, COLUMN_NAME&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Constrains of each table:&lt;/strong&gt; SELECT TABLE_NAME, CONSTRAINT_NAME, CONSTRAINT_TYPE, STATUS, SEARCH_CONDITION, R_CONSTRAINT_NAME, DELETE_RULE, DEFERRABLE, DEFERRED, VALIDATED, GENERATED FROM ALL_CONSTRAINTS WHERE OWNER = ‘****’ ORDER BY TABLE_NAME, CONSTRAINT_NAME&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Sequences:&lt;/strong&gt; SELECT SEQUENCE_NAME, INCREMENT_BY, MIN_VALUE, MAX_VALUE, CACHE_SIZE, CYCLE_FLAG, ORDER_FLAG FROM ALL_SEQUENCES WHERE SEQUENCE_OWNER = ‘****’ ORDER BY SEQUENCE_NAME&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;For security reasons, you may prefer to output them into the application log.&lt;/p&gt;</description></item><item><title>Update licence header without plugin</title><link>https://techtavern.danielferber.com.br/posts/update-licence-header-without-plugin/</link><pubDate>Mon, 26 Oct 2015 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/update-licence-header-without-plugin/</guid><description>&lt;p&gt;This article explains how to update license header for your java source files without any tool. It works for Notepad++, Netbeans and Eclipse and does not require installing any additional plugin.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;This article appeared first at techtavern.wordpress.com.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Option 1: Using Notepad++&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;Open Notepad++ and navigate to Search-&amp;gt;Find ind Files. Fill the dialog as shown below.&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://techtavern.wordpress.com/wp-content/uploads/2015/10/update-license-header-withou-any-tool-notepadplusplus.png"&gt;&lt;img src="https://techtavern.danielferber.com.br/images/update-licence-header-without-plugin/update-license-header-withou-any-tool-notepadplusplus.png" alt="update-license-header-withou-any-tool-notepadplusplus"&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;Find what: \A(.*?^package){1}&lt;br&gt;&#10;Replace with: /\&lt;em&gt;\r\n \&lt;/em&gt; (line 1)\r\n \* (line 2).\r\n \*/\r\npackage&lt;br&gt;&#10;Directory: The root directory of your source code.&lt;br&gt;&#10;Filters: *.java&lt;br&gt;&#10;Activate “Regular expression” and “. maches newline”.&lt;/p&gt;&#10;&lt;/blockquote&gt;</description></item><item><title>Netbeans RCP: increasing JVM memory settings</title><link>https://techtavern.danielferber.com.br/posts/netbeans-rcp-increasing-jvm-memory-settings/</link><pubDate>Tue, 20 Oct 2015 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/netbeans-rcp-increasing-jvm-memory-settings/</guid><description>&lt;p&gt;This article explains how to increase memory limits for your Netbeans RCP application when using Ant to create a ZIP package or a Windows installer.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;This article appeared originally at techtavern.wordpress.com.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;Both ZIP package and Windows installer contain an executable that reads JVM and bootstrap settings from the etc/application_name.conf file. This file is copied from the laucher configuration template at netbeans-installation\harness\etc\app.conf. The default options contains all command line parameters passed to the executable. JVM parameters are prefixed by “-J”.&lt;/p&gt;</description></item><item><title>Calling Objectify within DeferredTask</title><link>https://techtavern.danielferber.com.br/posts/calling-objectify-within-deferredtask/</link><pubDate>Mon, 19 Oct 2015 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/calling-objectify-within-deferredtask/</guid><description>&lt;p&gt;This article explains how to call &lt;a href="https://github.com/objectify/objectify"&gt;Objectify&lt;/a&gt; within a &lt;a href="https://cloud.google.com/appengine/docs/java/javadoc/com/google/appengine/api/taskqueue/DeferredTask"&gt;DeferredTask&lt;/a&gt; on Google App Engine &lt;a href="https://cloud.google.com/appengine/docs/java/taskqueue/overview-push"&gt;push queue&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;This article appeared first on &lt;a href="https://techtavern.wordpress.com"&gt;techtavern.wordpress.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;Objectify Wiki presents a clear &lt;a href="https://github.com/objectify/objectify/wiki/Setup"&gt;explanation how to user ObjectifyFilter to get or inject a Objectify instance&lt;/a&gt; into your servlet. However there is no word using Objectify within push queues.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Solution 1: Create task with worker URLs that are mapped to your servlet&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;Let ObjectifyFilter inject the Objectify instance. It your responsibility to encode and handle parameters and to secure your URLs.&lt;/p&gt;</description></item><item><title>Google App Engine Java SDK advices</title><link>https://techtavern.danielferber.com.br/posts/google-app-engine-java-sdk-advices/</link><pubDate>Thu, 08 Oct 2015 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/google-app-engine-java-sdk-advices/</guid><description>&lt;p&gt;It would have been nice if I knew this beforehand about Google App Engine Java SDK&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;This article originally appeared on https://techtavern.wordpress.com&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;GAE infrastructure is a kind of Java 7 platform. You may compile your code using the current Java 8 SDK, as long as source code version is set to Java 7. You may deploy and run your application locally with Java 8, too.&lt;/p&gt;&#10;&lt;p&gt;However, when deploying to Google infrastructure, there are some pitfalls.&lt;/p&gt;</description></item><item><title>Netbeans RCP: Asking before exiting the application</title><link>https://techtavern.danielferber.com.br/posts/netbeans-rcp-asking-before-exiting-the-application/</link><pubDate>Sun, 23 Aug 2015 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/netbeans-rcp-asking-before-exiting-the-application/</guid><description>&lt;p&gt;This article explains how to present a confirmation dialog asking if the user really wants to close the application.&lt;/p&gt;&#10;&lt;p&gt;This article was originally published on &lt;a href="https://techtavern.wordpress.com"&gt;techtavern.wordpress.com&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;The following solution registers a callable via @OnStop annotation. The callable is an opportunity to cancel closing the application by returning false.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;import java.util.concurrent.Callable;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;import org.openide.DialogDisplayer;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;import org.openide.NotifyDescriptor;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;import org.openide.modules.OnStop;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;@OnStop&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;public class ApplicationOnStop implements Callable&amp;amp;amp;lt;Boolean&amp;amp;amp;gt; {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;@Override&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; public Boolean call() throws Exception {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; NotifyDescriptor d = new NotifyDescriptor.Confirmation(&amp;#34;Close application?&amp;#34;, NotifyDescriptor.YES_NO_OPTION)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; return DialogDisplayer.getDefault().notify(d) == NotifyDescriptor.YES_OPTION; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; } &#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>SLF4J on Netbeans RCP Applications</title><link>https://techtavern.danielferber.com.br/posts/slf4j-on-netbeans-rcp-applications/</link><pubDate>Sun, 26 Jul 2015 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/slf4j-on-netbeans-rcp-applications/</guid><description>&lt;p&gt;This article explains how to configure SLF4J logging framework for your Netbeans RCP modules.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;This article was originally published on techtavern.wordpress.com&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;Netbeans RCP favors Java standards for a small memory footprint and to spare us from learning new APIs. For example, Netbeans uses java.util.logging instead of creating its own logging API. However, most developers prefer leaner logger APIs like SLF4J.&lt;/p&gt;&#10;&lt;h2 id="context"&gt;Context&lt;/h2&gt;&#10;&lt;p&gt;It happens that Netbeans kept only the API and replaced most of the java.util.logging original implementation. The startup module replaces the log manager. A custom handler writes messages into the platform messages file using a custom pattern. Another handler repeats messages on the platform messages TopComponent.&lt;/p&gt;</description></item><item><title>Netbeans RCP: external layer.xml</title><link>https://techtavern.danielferber.com.br/posts/netbeans-rcp-external-layer-xml/</link><pubDate>Thu, 02 Jul 2015 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/netbeans-rcp-external-layer-xml/</guid><description>&lt;p&gt;A Netbeans RCP application might benefit from an additional layer.xml file stored outside of application bundles. A network directory or a http server may provide some layer.xml with centralized or corporated configuration or user profiles, maintained the network administrator.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;This article was first published at techtavern.wordpress.com&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;There are two solutions to add an additional layer.xml file to your application. Both solutions are provided by &lt;a href="https://github.com/useful-toys/netbeans-rcp-toys"&gt;Netbeans RCP Toys at github&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;LayerProvider&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;Register a LayerProvider using the @ServiceProvider(service = LayerProvider.class) annotation. The platform calls all LayerProvider.registerLayers(Collection&amp;lt;? super URL&amp;gt;) to populate the collection with URLs to additional layer files. This URL may refer a local file or a remote over HTTP. As this method is called early, your application might not yet know the URL. For example, it does not work for command line argument as they have not been parsed then LayerProvider.registerLayers() is called. This approach is file as long as your URLs are declared as static constants.&lt;/p&gt;</description></item><item><title>SLF4J on Java Google App Engine</title><link>https://techtavern.danielferber.com.br/posts/slf4j-on-java-google-app-engine/</link><pubDate>Fri, 05 Dec 2014 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/slf4j-on-java-google-app-engine/</guid><description>&lt;p&gt;This article suggest a recipe to configure SLF4J on Google App Engine for Java.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;This article was first published at techtavern.wordpress.com&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;Google App Engine for Java offers a restricted Java 6 API, which includes just the cumbersome Java Utils Logging. Fortunately, SLF4J works as well. The recipe is the standard one. Nearly no configuration is required.&lt;/p&gt;&#10;&lt;p&gt;Just add following SLF4J libraries into the applications WEB-INF/lib directory: slfj4-api-1.7.7.jar and slf4j-jdk14-1.7.7.jar (version number may vary). This will redirect all your SLF4J logging statements to the Java Utils Logging controlled by the App Engine.&lt;/p&gt;</description></item><item><title>View TopComponents with icons on Netbeans RCP</title><link>https://techtavern.danielferber.com.br/posts/view-topcomponents-with-icons-on-netbeans-rcp/</link><pubDate>Wed, 03 Dec 2014 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/view-topcomponents-with-icons-on-netbeans-rcp/</guid><description>&lt;p&gt;This article explains an approach to enable tabs with icons to ‘view’ TopComponents.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;This article appeared first on techtavern.wordpress.com&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;The Problem&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;A typical Netbeans RCP application always displays TopComponents with ‘editor’ mode with their icon and their title, even if the tab runs out of space. Here is an example:&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://techtavern.danielferber.com.br/images/view-topcomponents-with-icons-on-netbeans-rcp/editortopcomponenttab.png"&gt;&lt;img src="https://techtavern.danielferber.com.br/images/view-topcomponents-with-icons-on-netbeans-rcp/editortopcomponenttab.png" alt="EditorTopComponentTab"&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Tabs of editor TopComponents&lt;/p&gt;&#10;&lt;p&gt;TopComponents with other modes are displayed as ‘views’. Their tabs are extremely simplistic: they never show their icon and their title is shortened or even omitted in case of less space. Here is an example:&lt;/p&gt;</description></item><item><title>Copying from Git to Clearcase</title><link>https://techtavern.danielferber.com.br/posts/copying-from-git-to-clearcase/</link><pubDate>Sun, 23 Nov 2014 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/copying-from-git-to-clearcase/</guid><description>&lt;p&gt;This article is about my recent open source project, &lt;a href="https://github.com/danielferber/git-to-clearcase/graphs/contributors" title="Git to Clearcase script"&gt;git-to-clearcase&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;There are many old-fashioned IT business that still believe on &lt;a href="http://en.wikipedia.org/wiki/Rational_ClearCase"&gt;Clearcase&lt;/a&gt; as their software configuration management.&lt;/p&gt;&#10;&lt;p&gt;I experienced that Clearcase imposes an extremely complex versioning model, is poorly supported on major IDEs and lacks some elementary features, like simple file undelete. Everything is complicated and slow on Clearcase and crashes happen frequently. Even worse, Clearcase completely fails to support some modern trends, like agile development, lean infrastructure, incremental design and refactoring.&lt;/p&gt;</description></item><item><title>Netbeans Platform: excluding locales from zip and installer distribution</title><link>https://techtavern.danielferber.com.br/posts/netbeans-platform-excluding-locales-from-zip-and-installer-distribution/</link><pubDate>Tue, 03 Jun 2014 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/netbeans-platform-excluding-locales-from-zip-and-installer-distribution/</guid><description>&lt;p&gt;This article explains how to prevent Netbeans RCP from packaging unwanted locales into the zip distribution and installers.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;This article originally appeared on https://techtavern.wordpress.com&lt;/em&gt;&lt;/p&gt;&#10;&lt;h4 id="current-situation"&gt;Current situation:&lt;/h4&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;The default Netbeans RCP build always includes all localization jars from the harness directory: Russian, Chinese, Japanese and Brazilian Portuguese.&lt;/li&gt;&#10;&lt;li&gt;Netbeans project properties and branding properties lack configuration to select bundled languages.&lt;/li&gt;&#10;&lt;li&gt;The build templates did not foresee features to exclude locales.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h4 id="problem"&gt;Problem:&lt;/h4&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Annoying long build times. Proportional to the number of jars, build time increases by five if all default languages are included.&lt;/li&gt;&#10;&lt;li&gt;Larger distributable artifact size. Localization jars take about 500kB.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h4 id="solution"&gt;Solution:&lt;/h4&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Netbeans Ant build is reasonably organized by build templates. And Ant allows overriding targets inherited from templates.&lt;/li&gt;&#10;&lt;li&gt;We override the build-zip target. This target generates the .zip distribution artifact, which also serves a input for the installer.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h4 id="the-modified-script"&gt;The modified script:&lt;/h4&gt;&#10;&lt;p&gt;The original build-zip target (netbeans 8.0) is found in the harness directory of your Netbeans installation. We place an adapted copy into the build.xml of your application root directory, thus overriding the behavior of the original target. The red lines were added to prevent adding localization for Russian, Chinese and Japanese.&lt;/p&gt;</description></item><item><title>Google AppEngine on Netbeans 8</title><link>https://techtavern.danielferber.com.br/posts/google-app-engine-on-netbeans-8/</link><pubDate>Tue, 13 May 2014 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/google-app-engine-on-netbeans-8/</guid><description>&lt;p&gt;Even though Google does not officially support Netbeans IDE, it is still possible to develop Google App Engine applications with Netbeans 8.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;This article originally appeared on https://techtavern.wordpress.com&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;There has been a Netbeans plugin for Google App Engine hosted at &lt;a href="https://kenai.com/projects/nbappengine"&gt;Kenai&lt;/a&gt;, which seems to have been left on its own since June 2009. Fortunately, the project was forked by &lt;a href="https://code.google.com/p/nb-gaelyk-plugin/"&gt;Gaelyk&lt;/a&gt; and who updated the plugin for Netbeans 7.4. I was pleased to confirm that his plugin also works for Netbeans 8.0 and for Google App Engine 1.9.x. And I assure that it work better than that dumb Eclipse Web Tools Platform.&lt;/p&gt;</description></item><item><title>Git Ignore file for Netbeans RCP projects</title><link>https://techtavern.danielferber.com.br/posts/git-ignore-file-for-netbeans-rcp-projects/</link><pubDate>Sun, 11 May 2014 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/git-ignore-file-for-netbeans-rcp-projects/</guid><description>&lt;p&gt;This article suggest a .gitignore file for GIT repositories that keep Netbeans RCP suite and module projects.&lt;/p&gt;&#10;&lt;p&gt;For short:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;nbproject/private/&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;build/&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;dist/&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As explained:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;code&gt;nbproject/private/&lt;/code&gt; Matches the local, per-user configuration directories, which are &lt;em&gt;suite/nbproject/private&lt;/em&gt; for suites and &lt;em&gt;module/nbproject/private&lt;/em&gt; for module projects.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;build/&lt;/code&gt; Matches the &lt;em&gt;module/build&lt;/em&gt; and &lt;em&gt;suite/build&lt;/em&gt; directories. Modules store their compiled classes within the &lt;em&gt;module/build&lt;/em&gt; directory. Suites write shareable artifacts into the &lt;em&gt;module/build&lt;/em&gt; directory.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;dist/&lt;/code&gt; Matches the &lt;em&gt;suite/dist&lt;/em&gt; directories, where suites store distributable artifacts like installation programs and java webstart.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;If you prefer Eclipse EGit, then add following lines:&lt;/p&gt;</description></item><item><title>Ant task to remove signature from jar file</title><link>https://techtavern.danielferber.com.br/posts/ant-task-to-remove-signature-from-jar-file/</link><pubDate>Tue, 01 Apr 2014 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/ant-task-to-remove-signature-from-jar-file/</guid><description>&lt;p&gt;This article suggest an Ant macro that removes the publisher signature from an java .jar file, also known as to ‘unsign’ a jar.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;lt;macrodef name=&amp;#34;unsignjar&amp;#34;&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;lt;attribute name=&amp;#34;jarFile&amp;#34; /&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;lt;sequential&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;lt;jar update=&amp;#34;yes&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; jarfile=&amp;#34;@{jarFile}.tmp&amp;#34;&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;lt;zipfileset src=&amp;#34;@{jarFile}&amp;#34;&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;lt;include name=&amp;#34;**&amp;#34;/&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;lt;exclude name=&amp;#34;META-INF/*.SF&amp;#34;/&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;lt;exclude name=&amp;#34;META-INF/*.DSA&amp;#34;/&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;lt;exclude name=&amp;#34;META-INF/*.RSA&amp;#34;/&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;lt;/zipfileset&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;lt;/jar&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;lt;move file=&amp;#34;@{jarFile}.tmp&amp;#34; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; tofile=&amp;#34;@{jarFile}&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; overwrite=&amp;#34;true&amp;#34; /&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;lt;/sequential&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;lt;/macrodef&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;An example how to call the macro.&lt;/p&gt;</description></item><item><title>Portable Java 8 JDK on Windows</title><link>https://techtavern.danielferber.com.br/posts/portable-java-8-sdk-on-windows/</link><pubDate>Tue, 25 Mar 2014 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/portable-java-8-sdk-on-windows/</guid><description>&lt;p&gt;Yes, it is possible to extract the Java 8 JDK without administration privileges (a portable Java 8 JDK), although Oracle only provides an installer for windows. This recipe also works for Java 7.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Recipe for JDK 8 (update 93 and newer)&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;Prerequisite: Install &lt;a href="http://www.7-zip.org"&gt;7-Zip file archiver&lt;/a&gt; (or its &lt;a href="http://portableapps.com/apps/utilities/7-zip_portable"&gt;portable alternative&lt;/a&gt;).&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Download the Java 8 SDK for Windows from Oracle. You will get a file named like jdk-8u101-windows-x64.exe.&lt;/li&gt;&#10;&lt;li&gt;Open the downloaded file with 7-Zip, which will show a a list of files and folders.&lt;/li&gt;&#10;&lt;li&gt;Open folder ‘.rsrc’ (select and double click this folder within 7-Zip).&lt;/li&gt;&#10;&lt;li&gt;Open folder ‘1033’ (or the folder of greatest size).&lt;/li&gt;&#10;&lt;li&gt;Open folder ‘JAVA_CAB10’ (or the folder of greatest size).&lt;/li&gt;&#10;&lt;li&gt;Open file ‘111’ (or the folder of greatest size).&lt;/li&gt;&#10;&lt;li&gt;Open file ‘tools.zip’.&lt;/li&gt;&#10;&lt;li&gt;Extract its contents to a directory where own write permissions, for example: C:\Users\Daniel\Documents\jdk-8u102-x64. To prevent issues, I recommend a directory without spaces.&lt;/li&gt;&#10;&lt;li&gt;From within this directory, search for all .pack files and extract them using unpack2000.exe command line tool found in the bin subdirectory. Following windows prompt command does the trick when executed from within the extracted directory: for /r %i in (*.pack) do .\bin\unpack200.exe %i %~pi%~ni.jar&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;The downloaded .exe file also contains the JDK sources. Navigating through the folders ‘.rsrc’, ‘1033’, ‘JAVA_CAB9’, ‘110’.&lt;/p&gt;</description></item><item><title>Compiling your abstract syntax tree transformation with Netbeans IDE</title><link>https://techtavern.danielferber.com.br/posts/compiling-your-abstract-syntax-tree-transformation-with-netbeans-ide/</link><pubDate>Wed, 11 Dec 2013 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/compiling-your-abstract-syntax-tree-transformation-with-netbeans-ide/</guid><description>&lt;p&gt;This article explains how to configure the Netbeans IDE to recognize java code the uses compiler internal classes. These classes are not part of the standard JDK and are not recognized by IDEs such as Netbeans, which will refuse to compile the correct code.&lt;/p&gt;&#10;&lt;p&gt;The compiler internal classes are used mainly as a hack to define annotations that automatically generate code. The most significant example is the &lt;a href="http://projectlombok.org/"&gt;Project Lombok&lt;/a&gt;, which transparently generates getters, setters and other code bload. Under the hood, the “Pluggable Annotation Processing API”  (&lt;a href="http://www.jcp.org/en/jsr/detail?id=269"&gt;JSR 269&lt;/a&gt;) provides a mechanism that exposes internal classes from the java compiler. These classes provide methods that allow us change the abstract syntax tree.&lt;/p&gt;</description></item><item><title>Smaller font sizes for Netbeans on Linux</title><link>https://techtavern.danielferber.com.br/posts/smaller-font-sizes-for-netbeans-on-linux/</link><pubDate>Tue, 01 Oct 2013 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/smaller-font-sizes-for-netbeans-on-linux/</guid><description>&lt;p&gt;&lt;em&gt;This article describes an approach to launch &lt;a href="http://www.netbeans.org" title="Netbeans IDE"&gt;Netbeans&lt;/a&gt; on Linux with smaller and narrower font sizes.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;Modern desktop environments like &lt;a href="http://www.kde.org"&gt;KDE&lt;/a&gt; or &lt;a href="http://www.gnome.org"&gt;Gnome&lt;/a&gt; suggest larger font sizes to enhance screen readability. However, Netbeans users might not be willing to waste precious space on views around the source code that matters. Here are some alternatives one might consider.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;This article originally appeared on https://techtavern.wordpress.com&lt;/em&gt;&lt;/p&gt;&#10;&lt;h3 id="1-to-customize-window-manager-and-themes"&gt;1) To customize window manager and themes&lt;/h3&gt;&#10;&lt;p&gt;The Gnome desktop provides nice dialogs to customize GTK+ and Gnome decorations and font sizes. The KDE desktop offers the QT-GTK binding that applies KDE design on GTK/Gnome applications. While simple, this alternative applies to Netbeans and all other application, which might not be your intention.&lt;/p&gt;</description></item><item><title>Copy files by extension that keeps directory structure</title><link>https://techtavern.danielferber.com.br/posts/copy-files-by-extension-that-keeps-directory-structure/</link><pubDate>Fri, 13 Sep 2013 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/copy-files-by-extension-that-keeps-directory-structure/</guid><description>&lt;p&gt;Some more essential Linux knowledge, written down to document it.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;Copy only files by their type (or file extension), while preserving the directory structure.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;I would recommend using rsync that copies files recursively and allows filtering them by their file name. The challenge is configuring a set of filter rules.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Command line:&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;To copy everything: rsync -avim –include=’*/’ –include=’*.doc’ –exclude=’*’ /source /destination&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Explained:&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;Copy recursively. Go down into directory structure.&lt;/p&gt;</description></item><item><title>Netbeans actions toolbar with local lookup context</title><link>https://techtavern.danielferber.com.br/posts/netbeans-actions-toolbar-with-local-lookup-context/</link><pubDate>Fri, 05 Jul 2013 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/netbeans-actions-toolbar-with-local-lookup-context/</guid><description>&lt;p&gt;This article talks about Netbeans and an action toolbar that is sensitive to a local selection lookup context. Actually, &lt;a href="http://wiki.netbeans.org/DevFaqActionContextSensitive"&gt;global selection context sensitive actions&lt;/a&gt; is powerful mechanism with a subtle limitation: &lt;strong&gt;everything happens globally&lt;/strong&gt;. It is no use for a local actions menu or toolbar sensitive to a limited selection context restricted to a JPanel or TopComponent. Not surprisingly, the Netbeans Java IDE itself reinvents the wheel each time this requirement arises, for example, on the ‘variables’ and ‘breakpoint’ windows.&lt;/p&gt;</description></item><item><title>Simplest JTable icon cell renderer ever</title><link>https://techtavern.danielferber.com.br/posts/simplest-jtable-icon-cell-renderer-ever/</link><pubDate>Mon, 01 Jul 2013 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/simplest-jtable-icon-cell-renderer-ever/</guid><description>&lt;p&gt;While there are many examples of JTable cell renderers spread on the Internet, they lack a clear understanding about how they were proposed to work. This article presents and explains a minimal and correct cell renderer, extending the default cell renderer as supposed by the Java API. The example explains how to display icons instead of text.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://techtavern.wordpress.com"&gt;https://techtavern.wordpress.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;For the hurried, first the code:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;public &lt;span style="color:#66d9ef"&gt;class&lt;/span&gt; EnumIconCellRenderer &lt;span style="color:#66d9ef"&gt;extends&lt;/span&gt; DefaultTableCellRenderer {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;private final Map&lt;span style="color:#f92672"&gt;&amp;lt;!--&lt;/span&gt;&lt;span style="color:#960050;background-color:#1e0010"&gt;?&lt;/span&gt;, ImageIcon&lt;span style="color:#f92672"&gt;--&amp;gt;&lt;/span&gt; icones;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; public EnumIconCellRenderer(final Map&lt;span style="color:#f92672"&gt;&amp;lt;!--&lt;/span&gt;&lt;span style="color:#960050;background-color:#1e0010"&gt;?&lt;/span&gt;, ImageIcon&lt;span style="color:#f92672"&gt;--&amp;gt;&lt;/span&gt; icones) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;//&lt;/span&gt; Initialize data used to render cells&lt;span style="color:#f92672"&gt;.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; this&lt;span style="color:#f92672"&gt;.&lt;/span&gt;icones &lt;span style="color:#f92672"&gt;=&lt;/span&gt; icones;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;//&lt;/span&gt; Set properties that never change&lt;span style="color:#f92672"&gt;.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; this&lt;span style="color:#f92672"&gt;.&lt;/span&gt;setHorizontalAlignment(JLabel&lt;span style="color:#f92672"&gt;.&lt;/span&gt;CENTER);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; this&lt;span style="color:#f92672"&gt;.&lt;/span&gt;setVerticalAlignment(JLabel&lt;span style="color:#f92672"&gt;.&lt;/span&gt;CENTER);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; this&lt;span style="color:#f92672"&gt;.&lt;/span&gt;setText(null);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#960050;background-color:#1e0010"&gt;@&lt;/span&gt;Override&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; protected void setValue(&lt;span style="color:#a6e22e"&gt;Object&lt;/span&gt; value) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;//&lt;/span&gt; Set properties that change on individual cells&lt;span style="color:#f92672"&gt;.&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; this&lt;span style="color:#f92672"&gt;.&lt;/span&gt;setIcon(icones&lt;span style="color:#f92672"&gt;.&lt;/span&gt;get(value));&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A cell renderer works like a rubber-stamp for each cell in the table. The renders uses a Swing component to draw the first cell, changes the contents of that cell renderer, and for each following row shifts the origin of the component to the new location, then re-draws it. The default cell renderer uses the convenient &lt;code&gt;JLabel&lt;/code&gt; to stamp a potentially inconvenient &lt;code&gt;toString()&lt;/code&gt; representation of data objects. Note that &lt;code&gt;getTableCellRendererComponent()&lt;/code&gt; returns itself (the &lt;code&gt;JLabel&lt;/code&gt;), but properly configured for an individual cell. Therefore, setting properties of the renderes itself actually configures the component returned by &lt;code&gt;getTableCellRendererComponent()&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>MySQL, Scheduled Events and Amazon RDS</title><link>https://techtavern.danielferber.com.br/posts/mysql-scheduled-events-and-amazon-rds/</link><pubDate>Tue, 25 Jun 2013 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/mysql-scheduled-events-and-amazon-rds/</guid><description>&lt;p&gt;This article explains how to enable SQL database scheduled events for the Amazon Relational Database Service (RDS). By default, Amazon does not allow one to create (in other words, to schedule) events. Events are SQL code intended to execute periodically or in future. The solution is quite similar my &lt;a href="https://techtavern.wordpress.com/2013/06/17/mysql-triggers-and-amazon-rds/" title="MySQL, Triggers and Amazon RDS"&gt;last article&lt;/a&gt;. One needs to provide the ‘event_scheduler’ parameter set to “ON” or “1”. Parameters are set by creating a new parameter group (or editing an existing one) and assigning this parameter group to the database instance.&lt;/p&gt;</description></item><item><title>MySQL, Triggers and Amazon RDS</title><link>https://techtavern.danielferber.com.br/posts/mysql-triggers-and-amazon-rds/</link><pubDate>Mon, 17 Jun 2013 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/mysql-triggers-and-amazon-rds/</guid><description>&lt;p&gt;This article explains how to enable SQL database triggers for the Amazon Relational Database Service (RDS).&lt;/p&gt;&#10;&lt;p&gt;If one attempts to create a SQL database trigger, then the database server will complain a confusing and misleading message like: “&lt;em&gt;ERROR 1419 (HY000) at line #: You do not have the SUPER privilege and binary logging is enabled (you &lt;strong&gt;might&lt;/strong&gt; want to use the less safe log_bin_trust_function_creators variable)&lt;/em&gt;“.&lt;/p&gt;&#10;&lt;p&gt;It happens that Amazon decided to disable all user defined SQL code, as binary procedures could compromise the RDS architecture. And for this purpose, Amazon blocked granting the missing ‘SUPER’ privileges to any database user except the ‘rdsadmin’ user owned by Amazon itself.&lt;/p&gt;</description></item><item><title>Logging practices on running solver processes in Java</title><link>https://techtavern.danielferber.com.br/posts/logging-practices-on-running-solver-processes-in-java/</link><pubDate>Wed, 24 Oct 2012 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/logging-practices-on-running-solver-processes-in-java/</guid><description>&lt;p&gt;We implemented a java computer program that solves a certain mathematical problem. The program runs for a long time and produces a textual representation of the best solution found.&lt;/p&gt;&#10;&lt;p&gt;It was the opportunity to discover the importance of adopting two usually unnoticed components: the Simple Logging Facade for Java (&lt;a href="http://www.slf4j.org/" title="Simple Logging Facade for Java (SLF4J)"&gt;&lt;strong&gt;SLF4J&lt;/strong&gt;&lt;/a&gt;) and the &lt;a href="http://logback.qos.ch/" title="Logback Project"&gt;&lt;strong&gt;Logback&lt;/strong&gt;&lt;/a&gt; logging framework. By employing both components a step further than they were originally designed, we increased our coding, debugging, testing and validation productivity in means far away than expected for traditional logging. All benefits were nearly for free and required no additional coding.&lt;/p&gt;</description></item><item><title>SymmetricDS syncronizing two tables with different names</title><link>https://techtavern.danielferber.com.br/posts/symmetricds-syncronizing-two-tables-with-different-names/</link><pubDate>Sat, 14 Jul 2012 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/symmetricds-syncronizing-two-tables-with-different-names/</guid><description>&lt;p&gt;While working with our newly discovered SymmetricDS tool, I realized that their manual does not clearly state how to synchronize two databases if their table names do not match. That might happen while matching tables between databases of two different companies, each one with its own table name policies. Blame those Database Administrators!&lt;/p&gt;&#10;&lt;p&gt;Here is how I accomplished synchronized two tables with different names:&lt;/p&gt;&#10;&lt;p&gt;First, I did the usual configuration: I defined two node groups &lt;em&gt;A&lt;/em&gt; and &lt;em&gt;B&lt;/em&gt;, defined a link between those node groups, defined a channel and a router for each direction (&lt;em&gt;A&lt;/em&gt; to &lt;em&gt;B&lt;/em&gt;  and &lt;em&gt;B&lt;/em&gt; to &lt;em&gt;A&lt;/em&gt;).&lt;/p&gt;</description></item><item><title>How SymmetricDS successfully replaced our complicated client-server architecture</title><link>https://techtavern.danielferber.com.br/posts/how-symmetricds-successfully-replaced-our-complicated-client-server-architecture/</link><pubDate>Thu, 14 Jun 2012 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/how-symmetricds-successfully-replaced-our-complicated-client-server-architecture/</guid><description>&lt;p&gt;With SymmetricDS , we avoided investing effort in designing, implementing and testing a complex, asynchronous communication protocol over web-service layer. Instead, we achieved a simple, intuitive interface that allowed us to deliver out solution within few days.&lt;/p&gt;&#10;&lt;p&gt;Our application started with a local standalone server that processes long running transactions. It naturally evolved to a distributed architecture. While benefits of the new architecture were clear to us and our customers, an issue arose : we would force our customers to enable their applications with boring and non intuitive web-services to communicate with our transaction server.&lt;/p&gt;</description></item><item><title>Eclipse Subversive does not frustrate me anymore… Now I use EGit!</title><link>https://techtavern.danielferber.com.br/posts/eclipse-subversive-does-not-frustrate-me-anymore-now-i-use-egit/</link><pubDate>Wed, 01 Feb 2012 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/eclipse-subversive-does-not-frustrate-me-anymore-now-i-use-egit/</guid><description>&lt;p&gt;A considerably time ago, I &lt;a href="https://techtavern.wordpress.com/2010/11/25/eclipse-subversive-plugins-frustrate-me-every-day/"&gt;wrote down my frustration&lt;/a&gt; on using the &lt;a href="http://www.eclipse.org/subversive/"&gt;Eclipse Subversive Plugin&lt;/a&gt;. At that time, I was annoyed just because refactoring did not work properly. Now, &lt;strong&gt;Subversive has gone worse&lt;/strong&gt;.&lt;/p&gt;&#10;&lt;p&gt;SVN itself does a good job tracking history of moved and copied files, even if directories are moved or renamed. By 2009, the Subversive plugin stopped supporting this features and a simple directory rearrangements may now lead your local copy to an irreversible inconsistent state.&lt;/p&gt;</description></item><item><title>Firefox memory footprint</title><link>https://techtavern.danielferber.com.br/posts/firefox-memory-footprint/</link><pubDate>Thu, 10 Nov 2011 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/firefox-memory-footprint/</guid><description>&lt;p&gt;Firefox is releasing one new version after the other. And each new version, Mozilla claims to have enhanced memory usage to reduce the amount of resource required to load each page. Is that a valid claim?&lt;/p&gt;&#10;&lt;p&gt;As a curious computer engineer, I decided to install several legacy Firefox versions and compare the amount of memory required to load two greedy pages: &lt;a href="http://www.gmail.com"&gt;http://www.gmail.com&lt;/a&gt; and &lt;a href="http://www.spiegel.de"&gt;http://www.spiegel.de&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;Here are the results.&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://techtavern.wordpress.com/wp-content/uploads/2011/11/memc3b3ria-firefox.png"&gt;&lt;img src="https://techtavern.wordpress.com/wp-content/uploads/2011/11/memc3b3ria-firefox.png" alt="" title="Memória Firefox"&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;One observes that at Firefox 3.6, reading emails from gmail suddenly doubled memory usage. And from Firefox 4.0 on, it requires the triple of memory. I suspect that gmail also loads more content on newer versions since Firefox enhanced javascript support.&lt;/p&gt;</description></item><item><title>ILOG OPL syntax highlighting for gEdit</title><link>https://techtavern.danielferber.com.br/posts/ilog-opl-syntax-highlighting-for-gedit/</link><pubDate>Mon, 17 Jan 2011 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/ilog-opl-syntax-highlighting-for-gedit/</guid><description>&lt;p&gt;This article offers the syntax highlighting definition file for gEdit 2.16.&lt;/p&gt;&#10;&lt;p&gt;Place the following content into the file &lt;em&gt;~/.gnome2/gtksourceview-1.0/language-specs/opl.lang&lt;/em&gt;. The definitions are not yet complete, I will update them eventually.&lt;/p&gt;&#10;&lt;p&gt;Due to gEdit limitations, the definitions allow highlighting according to lexical analysis, but they do not understand grammar. That means that the syntax will be highlighted according to the token used, but not according to their meaning within the model.&lt;/p&gt;</description></item><item><title>ILOG OPL cannot distinguish apples from oranges</title><link>https://techtavern.danielferber.com.br/posts/ilog-opl-cannot-distinguish-apples-from-oranges/</link><pubDate>Mon, 10 Jan 2011 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/ilog-opl-cannot-distinguish-apples-from-oranges/</guid><description>&lt;p&gt;I used to think about OPL that promotes obligatorily &lt;a href="http://en.wikipedia.org/wiki/Rigour#Mathematical_rigour"&gt;mathematical rigor&lt;/a&gt; as one would expect from a mathematical modeling language. I was misunderstood: it seems that OPL deludes itself when &lt;a href="http://en.wikipedia.org/wiki/Apples_and_oranges"&gt;comparing apples and oranges&lt;/a&gt;. OPL still requires enhancements that address serious idiosyncrasies how the model is handled.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Objectives&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;The article presents some OPL examples for expressions that do not satisfy type safety. It additionally relates possible error messages.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;The Apple and Orange model&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Eclipse subversive plugins frustrate me every day…</title><link>https://techtavern.danielferber.com.br/posts/eclipse-subversive-plugins-frustrate-me-every-day/</link><pubDate>Thu, 25 Nov 2010 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/eclipse-subversive-plugins-frustrate-me-every-day/</guid><description>&lt;p&gt;Please apologize, but I really need to expose my anger to the subversive plugins. The statement on &lt;a href="http://www.eclipse.org/subversive/"&gt;Subversive – SVN Team Provider&lt;/a&gt; that “&lt;em&gt;At the same time project is stable and had a long history on the previous location at the the Polarion.com&lt;/em&gt;” is really a very bad joke.&lt;/p&gt;&#10;&lt;p&gt;I have been using svn projects on eclipse for about 6 years and always praised this combination. It was a pleasure to see polairon plugins providing a better integration over time. Unfortunately, since the subversion plugins have been available on eclipse repositories, I cannot anymore talk any good word about subversive.&lt;/p&gt;</description></item><item><title>How to prevent EOFException when socket is closed</title><link>https://techtavern.danielferber.com.br/posts/how-to-prevent-eofexception-when-socket-is-closed/</link><pubDate>Tue, 09 Nov 2010 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/how-to-prevent-eofexception-when-socket-is-closed/</guid><description>&lt;p&gt;When one needs some very simple java client that reads some data from socket, then it might be a bit annoying to effectively detect that there is no more data to read, aka “End of File”. Here I show an approach to solve some issues to avoid spurious IOExceptions.&lt;/p&gt;&#10;&lt;p&gt;Consider two Java applications that exchange data over a socket, lets call them Alice and Bob. On my example, Bob sends triples of integers, and when he does not have any more triples to send, he takes initiative to close the socket. Here I only show a simple code for Alice.&lt;/p&gt;</description></item><item><title>About the Transcend SDHC Class 10 8GB memory card</title><link>https://techtavern.danielferber.com.br/posts/about-the-transcend-sdhc-class-10-8gb-memory-card/</link><pubDate>Wed, 20 Oct 2010 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/about-the-transcend-sdhc-class-10-8gb-memory-card/</guid><description>&lt;p&gt;The “Class 10” label on Transcend card suggest that is should work 2½ as fast as the my plain 3 years old Kingston SDHC Class 4 8GB memory card. Indeed, I was disappointed to realize the opposite: &lt;strong&gt;Transcend class 10 was on average about twice as slow as Kingstone class 4.&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;The Transcend SDHC Class 10 8GB memory card was the best compromise among price, speed and capacity. “Class 10” means that the card is expected to read and write data at a rate of at least 10MB/s.&lt;/p&gt;</description></item><item><title>Java: Class.forName() to retrieve inner class</title><link>https://techtavern.danielferber.com.br/posts/java-class-forname-to-retrieve-inner-class/</link><pubDate>Thu, 19 Aug 2010 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/java-class-forname-to-retrieve-inner-class/</guid><description>&lt;p&gt;Sounds trivial, but was not obvious because Eclipse IDE mislead me: How do I get a reference to a inner class by calling &lt;code&gt;Class.forName()&lt;/code&gt; ?&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;package&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;a&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;b&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;c&lt;/span&gt;;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;public&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;class&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;Outer&lt;/span&gt; {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;...&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#a6e22e"&gt;public&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;static&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;class&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;Inner&lt;/span&gt; {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;...&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;...&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I first tried to call Class.forName() passing as parameter the fully qualified name generated by Eclipse:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Class innerClass = Class.forName(&amp;#34;a.b.c.Outer.Inner&amp;#34;);&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;But that was wrong! After wondering for some time, I found the (obvious solution):&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Class innerClass = Class.forName(&amp;#34;a.b.c.Outer$Inner&amp;#34;);&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Looks like as Eclipse “fully qualified” name is not exactly the same fully qualified name that the Java compiler uses to identify inner classes.&lt;/p&gt;</description></item><item><title>On fixing CPLEX variable names generated by OPL</title><link>https://techtavern.danielferber.com.br/posts/on-fixing-cplex-variable-names-generated-by-opl/</link><pubDate>Thu, 19 Aug 2010 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/on-fixing-cplex-variable-names-generated-by-opl/</guid><description>&lt;p&gt;You wrote your OPL model for your important mathematical programming problem. But the result looks weird: the model just cannot produce such solution. The most desperate approach consists in diving though the mathematical programming model generated by OPL, checking each (in)equation one by one.&lt;/p&gt;&#10;&lt;p&gt;Here I describe some issues that happened while using the OPL Java interface to create the CPLEX model and to print out the mathematical programming model as a .lp file. And after days of frustration with this .lp printout, I found myself writing my own Java class that renames all CPLEX variables generated by OPL…&lt;/p&gt;</description></item><item><title>Serializing Hibernate objects as XML using XStream</title><link>https://techtavern.danielferber.com.br/posts/serializing-hibernate-objects-as-xml-using-xstream/</link><pubDate>Fri, 16 Jul 2010 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/serializing-hibernate-objects-as-xml-using-xstream/</guid><description>&lt;p&gt;People have been looking for  serializing Hibernate as XML using XStream, a task that is not straightforward.&lt;/p&gt;&#10;&lt;p&gt;I designed a solution that I would like to share with the open source community, called &lt;strong&gt;&lt;a href="http://code.google.com/p/xstream-for-beans"&gt;xstream-for-pojo&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;&#10;&lt;p&gt;It seams a quite simple approach at the beginning. Until you discover that Hibernate injected a lot of additional fields into your original objects and that sometimes Hibernate exchanges your original objects with proxies. Even worse, data may not yet be loaded on fields declared as lazy. Hibernate collections are even more complicated.&lt;/p&gt;</description></item><item><title>OPL and Java: loading dynamic Linux libraries</title><link>https://techtavern.danielferber.com.br/posts/opl-java-loading-dynamic-linu-libraries/</link><pubDate>Mon, 12 Jul 2010 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/opl-java-loading-dynamic-linu-libraries/</guid><description>&lt;p&gt;When calling IBM ILOG OPL (Optimization Programming Language) from a Java application running on Linux, one will face some issues regarding loading dynamic OPL libraries. Typical error messages look like:&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;Native code library failed to load: ensure the appropriate library (oplXXX.dll/.so) is in your path.&lt;/p&gt;&#10;&lt;p&gt;java.lang.UnsatisfiedLinkError: no opl63 in java.library.path&lt;br&gt;&#10;java.lang.UnsatisfiedLinkError: no opl_lang_wrap_cpp in java.library.path&lt;br&gt;&#10;java.lang.UnsatisfiedLinkError: no cp_wrap_cpp_java63 in java.library.path&lt;br&gt;&#10;java.lang.UnsatisfiedLinkError: no concert_wrap_cpp_java63 in java.library.path&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;This article explains my considerations and some approaches how to fix it.&lt;/p&gt;</description></item><item><title>Running Eclipse on a machine without Java</title><link>https://techtavern.danielferber.com.br/posts/running-eclipse-on-a-machine-without-java/</link><pubDate>Sat, 03 Jul 2010 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/running-eclipse-on-a-machine-without-java/</guid><description>&lt;p&gt;As “portable applications” are getting more and more popular, it is important to say that Eclipse has always been portable: just unzip it anywhere and run it. The real issue is not having Java Runtime Environment installed on the machine where you want to run Eclipse. Unfortunately, installing Java on Windows requires full administrator rights.&lt;/p&gt;&#10;&lt;p&gt;I decided to create my portable Eclipse distribution on an USB hard drive (a Western Digital Passport) instead of an USB pen drive. The latter would be impractically too slow to support applications that require  handling thousands of files.&lt;/p&gt;</description></item><item><title>OPL language: the battle of array declarations</title><link>https://techtavern.danielferber.com.br/posts/opl-language-the-battle-of-array-declarations/</link><pubDate>Thu, 24 Jun 2010 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/opl-language-the-battle-of-array-declarations/</guid><description>&lt;p&gt;The OPL Development Studio, created by ILOG (and recently acquired by IBM), provides tools based on the Optimization Programming Language. This tool intends to simplify the process of feeding data and model formulae to other ILOG optimization tools for mathematical programming and constraint programming.&lt;/p&gt;&#10;&lt;p&gt;Experience has been proven OPL to be extremely helpful as a compact and high level language for both data and model. Nevertheless, this language still reveals some constructs that are not well understood nor well documented.&lt;/p&gt;</description></item><item><title>Criticism on SWT</title><link>https://techtavern.danielferber.com.br/posts/criticism-on-swt/</link><pubDate>Tue, 20 Apr 2010 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/criticism-on-swt/</guid><description>&lt;p&gt;The &lt;strong&gt;Standard Widget Toolkit&lt;/strong&gt; (&lt;a href="http://en.wikipedia.org/wiki/Standard_Widget_Toolkit"&gt;SWT&lt;/a&gt;) is a graphical widget toolkit for the Java platform. It conceived as an alternative to the &lt;a href="http://en.wikipedia.org/wiki/Abstract_Window_Toolkit"&gt;AWT&lt;/a&gt; or &lt;a href="http://en.wikipedia.org/wiki/Swing_(Java)"&gt;Swing&lt;/a&gt; toolkits provided by &lt;a href="http://en.wikipedia.org/wiki/Sun_Microsystems" title="Sun Microsystems"&gt;Sun Microsystems&lt;/a&gt;. It has the intent for better performance (to run faster and and to consume less memory), native look and feel and deep platform integration.&lt;/p&gt;&#10;&lt;p&gt;As there is already a lot of &lt;a href="http://www.google.com.br/search?q=swt+vs+swing"&gt;discussion about Swing and SWT&lt;/a&gt; on the web and I will not compare them again. I personally prefer SWT because I felt more productive with this toolkit. Nevertheless, I still did not yet feel productive enough to consider SWT valuable. Let me explain why.&lt;/p&gt;</description></item><item><title>Java and incorrect timezone on Windows XP</title><link>https://techtavern.danielferber.com.br/posts/java-and-incorrect-timezone-on-windows-xp/</link><pubDate>Thu, 15 Apr 2010 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/java-and-incorrect-timezone-on-windows-xp/</guid><description>&lt;blockquote&gt;&#10;&lt;p&gt;How reliable is Java date, time and timezone API? In this article I discuss a relevant issue that may compromise application correctness when relying not only on date/time calculations, but also on reporting date/time according to local timezone and locale.&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;Recently I was debugging an activity scheduling application that was reporting events to weird time. Even worse, the weird time varied according to the desktop PC the application was running on. First, we assured that all date/time &lt;strong&gt;calculations were done correctly&lt;/strong&gt;. Then, we double checked if &lt;strong&gt;Java reads the correct date/time from the system&lt;/strong&gt;. Also, date, time and &lt;strong&gt;timezone configurations were set properly&lt;/strong&gt; on the underlying platform. The odd behavior appeared on Java Virtual Machines from Sun, &lt;strong&gt;both JRE 1.5 and JRE&lt;/strong&gt;. What was happening? We compared Java API results to Joda Time API.&lt;/p&gt;</description></item><item><title>Create a front page for WordPress that does not show up twice</title><link>https://techtavern.danielferber.com.br/posts/create-a-front-page-for-wordpress-that-do-not-show-up-twice/</link><pubDate>Mon, 11 Jan 2010 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/create-a-front-page-for-wordpress-that-do-not-show-up-twice/</guid><description>&lt;blockquote&gt;&#10;&lt;p&gt;&lt;em&gt;Note: I think this is not an issue anymore, since WordPress finally created the “menu” design feature. There is no need anymore to create front pages to show content as tabs at the top of the page. The “menu” feature works better than front pages.&lt;/em&gt;&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;Several people wonder how to configure WordPress to show ones own page when opening the blog (also called front page). There are instructions on &lt;a href="http://en.support.wordpress.com/pages/front-page/"&gt;wordpress support&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>JFace table sorting</title><link>https://techtavern.danielferber.com.br/posts/jface-table-sorting/</link><pubDate>Mon, 04 Jan 2010 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/jface-table-sorting/</guid><description>&lt;p&gt;Nowadays, when the application displays as a table, the modern user expects to click on the the column header to change the ordering criteria. Unfortunately, SWT/JFace API have not yet implemented this feature transparently. The programmer is required to write a bunch of code to implement this feature on each table.&lt;br&gt;&#10;For this purpose, I have written a single class that listens to table columns and applies ordering to the table viewer.&lt;/p&gt;</description></item><item><title>When Java code becomes funny</title><link>https://techtavern.danielferber.com.br/posts/when-java-code-becomes-funny/</link><pubDate>Mon, 04 Jan 2010 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/when-java-code-becomes-funny/</guid><description>&lt;p&gt;Eventually, some fun happens while writing Java code.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Apache Commons: Error or Success?&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;An &lt;code&gt;Error&lt;/code&gt; is a subclass of &lt;code&gt;Throwable&lt;/code&gt; that indicates serious problems that a reasonable application should not try to catch.&lt;/em&gt; (&lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/Error.html"&gt;see Java API docs&lt;/a&gt;)&lt;em&gt;.&lt;/em&gt; Does it make sense to call such subclass “&lt;em&gt;Error&lt;/em&gt;“?&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://techtavern.wordpress.com/wp-content/uploads/2010/01/java-error-success.png"&gt;&lt;img src="https://techtavern.wordpress.com/wp-content/uploads/2010/01/java-error-success.png" alt="" title="java-error-success"&gt;&lt;/a&gt;Found at org.apache.commons.configuration.plist.PropertyListParser&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Two way names&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;Particularly, the Eclipse naming convention resulted this interesting symmetric method declaration.&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://techtavern.wordpress.com/wp-content/uploads/2010/01/eclipse-help.png"&gt;&lt;img src="https://techtavern.wordpress.com/wp-content/uploads/2010/01/eclipse-help.png" alt="" title="eclipse-help"&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;protected void initialize(ColumnViewer viewer, ViewerColumn column)&lt;/p&gt;</description></item><item><title>Printing java logger configuration</title><link>https://techtavern.danielferber.com.br/posts/printing-java-logger-configuration/</link><pubDate>Thu, 10 Dec 2009 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/printing-java-logger-configuration/</guid><description>&lt;p&gt;I have been wondering for some time how to print out a list with details how loggers were configured.&lt;br&gt;&#10;In order to work, one requires to create at least one logger instance of each logger that shall be listed.&lt;br&gt;&#10;I will provide further details in future.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;public void print(PrintStream out) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;out.println(&amp;#34;Configuração de log: &amp;#34;);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;LogManager logManager = LogManager.getLogManager();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;Enumeration&amp;lt;String&amp;gt; loggerNames = logManager.getLoggerNames();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;Set&amp;lt;String&amp;gt; names = new TreeSet&amp;lt;String&amp;gt;();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;Set&amp;lt;Handler&amp;gt; handlerSet = new HashSet&amp;lt;Handler&amp;gt;();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;while (loggerNames.hasMoreElements()) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;String name = loggerNames.nextElement();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;names.add(name);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;for (String name : names) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;Logger logger = logManager.getLogger(name);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;String nome = logger.getName();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;if (nome.length() == 0) nome = &amp;#34;&amp;lt;root&amp;gt;&amp;#34;;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;//&#9;&#9;boolean inheritedLevel = false;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;Level level = logger.getLevel();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;//&#9;&#9;boolean inheritedHandler = false;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;Handler[] handlers = logger.getHandlers();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;Logger parentLevelLogger = null;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;if (level == null) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;parentLevelLogger = logger.getParent();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;while (parentLevelLogger != null &amp;amp;&amp;amp; level == null) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;&#9;Level parentLevel = parentLevelLogger.getLevel();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;&#9;if (parentLevel != null) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;&#9;&#9;level = parentLevel;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;&#9;} else {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;&#9;&#9;parentLevelLogger = parentLevelLogger.getParent();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;&#9;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;Logger parentHandlerLogger = null;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;if (handlers == null) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;parentHandlerLogger = logger.getParent();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;while (parentHandlerLogger != null &amp;amp;&amp;amp; handlers == null) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;&#9;Handler[] parentHandlers = parentHandlerLogger.getHandlers();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;&#9;if (parentHandlers != null) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;&#9;&#9;handlers = parentHandlers;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;&#9;} else {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;&#9;&#9;parentHandlerLogger = parentHandlerLogger.getParent();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;&#9;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;String nivel = &amp;#34;?&amp;#34;;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;if (level != null) nivel = level.getName();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;if (parentLevelLogger != null) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;if (parentLevelLogger.getName().length() == 0)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;&#9;nivel = &amp;#34;&amp;lt;root&amp;gt;:&amp;#34;+nivel;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;else&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;&#9;nivel = parentLevelLogger.getName()+&amp;#34;:&amp;#34;+nivel;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;String lista = &amp;#34;?&amp;#34;;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;if (handlers != null) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;List&amp;lt;Handler&amp;gt; list = Arrays.asList(handlers);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;if (list.size() == 0) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;&#9;lista = &amp;#34;&amp;#34;;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;} else {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;&#9;lista = null;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;&#9;for (Handler handler : list) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;&#9;&#9;if (lista == null) lista = handler.getClass().getName();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;&#9;&#9;else lista += &amp;#34;, &amp;#34; + handler.getClass().getSimpleName();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;&#9;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;if (parentHandlerLogger != null) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;if (parentHandlerLogger.getName().length() == 0)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;&#9;nivel = &amp;#34;&amp;lt;root&amp;gt;:&amp;#34;+lista;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;else&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;&#9;&#9;nivel = parentHandlerLogger.getName()+&amp;#34;:&amp;#34;+lista;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;out.format(&amp;#34; - %s (%s): %s\n&amp;#34;, nome, nivel, lista);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;for (Handler handler : handlerSet) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;String nome = handler.getClass().getSimpleName();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;String nivel = handler.getLevel().getName();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;&#9;out.format(&amp;#34; - %s (%s)\n&amp;#34;, nome, nivel);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&#9;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Ubuntu 9.04: External and internal speaker issues</title><link>https://techtavern.danielferber.com.br/posts/ubuntu-9-04-external-and-internal-speaker-issues/</link><pubDate>Sat, 08 Aug 2009 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/ubuntu-9-04-external-and-internal-speaker-issues/</guid><description>&lt;p&gt;&lt;em&gt;If you run Ubuntu 9.04 and your desktop or laptop is featured with both internal speaker and TRS jacks for external speakers, then you might face some issues that sound is played on both. I have written some articles where I propose some very simple solutions and you may try them and choose the one you like most.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;Of course, I discarded any inappropriate solutions that were proposed in several forums: editing mysterious configuration files,recompiling the kernel and unplugging the internal speaker from the motherboard.&lt;/p&gt;</description></item><item><title>Ubuntu 9.04: External and internal speaker issues – part 2</title><link>https://techtavern.danielferber.com.br/posts/ubuntu-9-04-external-and-internal-speaker-issues-part-2/</link><pubDate>Sat, 08 Aug 2009 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/ubuntu-9-04-external-and-internal-speaker-issues-part-2/</guid><description>&lt;p&gt;&lt;em&gt;If you run Ubuntu 9.04 and your desktop or laptop is featured with both internal speaker and TRS jacks for external speakers, then you might face some issues that sound is played on both. I have written some articles where I propose some very simple solutions and you may try them and choose the one you like most.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Issue 2: Connecting the headset does not turn off internal speaker.&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;Try to connect/remove a headset from the external jack and observe if your internal speaker becomes automatically muted. If not, then some more configuration is required.&lt;/p&gt;</description></item><item><title>Ubuntu 9.04: Microphone issues</title><link>https://techtavern.danielferber.com.br/posts/ubuntu-9-04-microphone-issues/</link><pubDate>Sat, 08 Aug 2009 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/ubuntu-9-04-microphone-issues/</guid><description>&lt;p&gt;&lt;em&gt;Continuing the discussion of audio configuration issues on Ubuntu 9.04…&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;If you are using Skype, please also read my next article that discusses Skype on Ubuntu 9.04.&lt;/p&gt;&#10;&lt;p&gt;I suggest testing the microphone with the “Sound Recorder” that is found in the “Applications”-&amp;gt;”Sound and Video” menu of the top bar on the Ubuntu desktop. Ensure that “voice, lossless (.wav)” (may vary according to your language) is selected. Click on “Record” and talk to the microphone. The “Level” bar should increase as you talk louder. Click on “Stop” and “Play” to hear if your voice was recorded sucessfully.&lt;/p&gt;</description></item><item><title>Ubuntu 9.04: Skype issues</title><link>https://techtavern.danielferber.com.br/posts/ubuntu-9-04-skype-issues/</link><pubDate>Sat, 08 Aug 2009 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/ubuntu-9-04-skype-issues/</guid><description>&lt;p&gt;&lt;em&gt;This article addresses an issue similar &lt;a href="https://techtavern.wordpress.com/2009/03/18/skype-on-ubuntu-810-microphone-and-internal-speaker-issues/"&gt;to another that I have already adressed for Ubuntu 8.04&lt;/a&gt;: How to correctly configure Skype on Ubuntu 9.04.&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;First, I assume that Skype was installed from midibuntu.org repositories.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Issue 1: Speakers do not work.&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;The first required configuration change is setting Skype to use Pulse Audio Support instead of default (ALSA) sound drivers. Go to Skype-&amp;gt;Options-&amp;gt;Audio Devices. Select “pulse” for all audio devices.&lt;/p&gt;&#10;&lt;p&gt;I also recommend to disable an option like “Allow Skype to automatically adjust mixer levels” for this first moment. While this option was enabled, I have experienced Skype undoing the correct configuration and turning off my microphone volume before each call . After you manage to have Skype working fine, then you may enable this option again to see if Skype continues working fine 🙂&lt;/p&gt;</description></item><item><title>How to correclty calculate days between two days</title><link>https://techtavern.danielferber.com.br/posts/how-to-correclty-calculate-days-between-two-days/</link><pubDate>Mon, 13 Apr 2009 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/how-to-correclty-calculate-days-between-two-days/</guid><description>&lt;p&gt;The standard Java API has no solution to calculate the period between two days, although this is a common request for someone who is doing calendar arithmetic.&lt;/p&gt;&#10;&lt;p&gt;Googling around, the are many people who expose their own solutions (see some of them &lt;a href="www.rgagnon.com/javadetails/java-0097.html"&gt;1&lt;/a&gt;, &lt;a href="http://www.java-tips.org/java-se-tips/java.util/compute-days-between-2-dates.html"&gt;2&lt;/a&gt;, &lt;a href="http://www.roseindia.net/java/java-get-example/number-days-between.shtml"&gt;3&lt;/a&gt;, &lt;a href="http://www.faqs.org/qa/qa-10170.html"&gt;4&lt;/a&gt;).  All them suggest getting difference between the two dates, measured in number of milliseconds, and divide by 1000 * 60 * 60 * 24 (that means, the number of milliseconds in a day typical day).&lt;/p&gt;</description></item><item><title>Regex that matches path, filename and extension</title><link>https://techtavern.danielferber.com.br/posts/regex-that-matches-path-filename-and-extension/</link><pubDate>Mon, 06 Apr 2009 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/regex-that-matches-path-filename-and-extension/</guid><description>&lt;p&gt;I was looking for a regular expression for Python capable to match a string containing a valid path, file name and extension. Finally, I discovered following solution:&lt;br&gt;&#10;&lt;code&gt;^(.*/)?(?:$|(.+?)(?:(\.[^.]*$)|$))&lt;/code&gt;&lt;br&gt;&#10;Let me explain how I got this regular expression. Fortunately, &lt;a href="http://www.movingtofreedom.org/" title="Moving to Freedom"&gt;Scott Carpenter&lt;/a&gt; has written an excellent &lt;a href="http://www.movingtofreedom.org/2008/04/01/regex-match-filename-base-and-extension/" title="Regex Walk-Through: Match filename base and extension"&gt;article&lt;/a&gt; about a regular expression to match a file name with extension. Matching the file name extension is not trivial for all possible situations.&lt;/p&gt;</description></item><item><title>Skype on Ubuntu 8.10: microphone and internal speaker issues</title><link>https://techtavern.danielferber.com.br/posts/skype-on-ubuntu-810-microphone-and-internal-speaker-issues/</link><pubDate>Wed, 18 Mar 2009 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/skype-on-ubuntu-810-microphone-and-internal-speaker-issues/</guid><description>&lt;blockquote&gt;&#10;&lt;p&gt;&lt;em&gt;It has been a long time since my last post… Also, it has been some time I managed live without a PC and Internet. Now I have a PC and Internet again and I took the chance to immediately install Linux!&lt;/em&gt;&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;&lt;strong&gt;Updated:&lt;/strong&gt; I also solved the issue of skype consuming 100% cpu during a call.&lt;/p&gt;&#10;&lt;p&gt;Although the &lt;a href="http://ubuntuguide.org/wiki/Ubuntu:Intrepid"&gt;Ubuntu Guide&lt;/a&gt; has a good description &lt;a href="http://ubuntuguide.org/wiki/Ubuntu:Intrepid#Skype"&gt;how to install Skype on Ubuntu Intrepid&lt;/a&gt;, it can be quite challenging to place a call successfully. Shame on Gnome, Pulse Audio and Skype! I had to overcome following issues:&lt;/p&gt;</description></item><item><title>Resume scp/rsync file transfer</title><link>https://techtavern.danielferber.com.br/posts/resume-scprsync-file-transfer/</link><pubDate>Wed, 19 Nov 2008 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/resume-scprsync-file-transfer/</guid><description>&lt;p&gt;This is very basic Linux knowledge, but the question has arisen too often and I decided to document it.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;Transfer (or upload/download) a large tree of files and directories from one machine to another using a ssh connection, and being able to resume/continue if the operation is interrupted.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;Until now, I believe that the best solution is using rsync over ssh, since rsync has a feature to resume interrupted file transfer, even when an entire tree of directories is involved.&lt;/p&gt;</description></item><item><title>About Trilead SSH open source project</title><link>https://techtavern.danielferber.com.br/posts/about-trilead-ssh-open-source-project/</link><pubDate>Thu, 13 Nov 2008 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/about-trilead-ssh-open-source-project/</guid><description>&lt;p&gt;Some time ago &lt;a href="https://techtavern.wordpress.com/2008/09/30/about-jsch-open-source-project/"&gt;I have written an article&lt;/a&gt; about the &lt;a href="http://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;ct=res&amp;amp;cd=1&amp;amp;url=http%3A%2F%2Fwww.jcraft.com%2Fjsch%2F&amp;amp;ei=wJ7hSIqHMYSGgwS-zp3eAw&amp;amp;usg=AFQjCNFEETFDy_PvFq6a3L_sqnj_u5o-ZQ&amp;amp;sig2=d5zFilMy_7as3IRg1RdEYA"&gt;JSch&lt;/a&gt; open source project. However, I soon lost all my motivation when I faced, again, the code complexity required for JSch just to start a execution session, a file copy or a port forwarding with JSch. Nevertheless the completely misunderstood authentication API for JSch let me to a mood even worse. I started looking for alternatives and fortunately I found &lt;a href="http://www.trilead.com/Products/Trilead_SSH_for_Java/"&gt;Trilead SSH&lt;/a&gt;, a pure Java implementation of SSH, available with the BSD license.&lt;/p&gt;</description></item><item><title>PCMan: the real and true Gnome file manager</title><link>https://techtavern.danielferber.com.br/posts/pcman-the-real-and-true-gnome-file-manager/</link><pubDate>Fri, 24 Oct 2008 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/pcman-the-real-and-true-gnome-file-manager/</guid><description>&lt;blockquote&gt;&#10;&lt;p&gt;&lt;em&gt;I have modified this post after several people complained that I was misunderstood: Nautilus can, sure, display a tree view of the file system. Sure, but only for “who-knows-how”.&lt;/em&gt;&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;I do not like &lt;a href="http://www.gnome.org/"&gt;Gnome desktop environment&lt;/a&gt; because of its excessively simplified GUI that leverages all users as if they lack minimal skill to interact with a computer. And what I dislike most on Gnome is even more oversimplified vision of the file system provided by &lt;a href="www.gnome.org/projects/nautilus/"&gt;Nautilus&lt;/a&gt; on its default configuration.&lt;/p&gt;</description></item><item><title>Fortified compiling prevents building older RPM</title><link>https://techtavern.danielferber.com.br/posts/fortified-compiling-prevents-building-older-rpm/</link><pubDate>Mon, 13 Oct 2008 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/fortified-compiling-prevents-building-older-rpm/</guid><description>&lt;p&gt;Today I had to build and test some older Open MPI RPM packages. However, I was prevented to build them, although the code apparently was correct.&lt;/p&gt;&#10;&lt;p&gt;The command:&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;rpmbuild -ba openmpi-1.2.1.spec&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;&#10;&lt;p&gt;The error message was:&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;In function &amp;#39;open&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; inlined from &amp;#39;orte_abort&amp;#39; at runtime/orte_abort.c:91:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;/usr/include/bits/fcntl2.h:51: error: call to &amp;#39;__open_missing_mode&amp;#39; declared with attribute error: open with O_CREAT in second argument needs 3 arguments&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;&#10;&lt;p&gt;The line of source code that causes the error is:&lt;/p&gt;</description></item><item><title>A poem about Subversion</title><link>https://techtavern.danielferber.com.br/posts/a-poem-about-subversion/</link><pubDate>Tue, 07 Oct 2008 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/a-poem-about-subversion/</guid><description>&lt;p&gt;I found an interesting poem from Peter Kriens about &lt;a href="en.wikipedia.org/wiki/Subversion_(software)" title="Subversion"&gt;SVN&lt;/a&gt; (subversion) that was posted to the Eclipse committer mailing list. Really interesting how frustration can encourage your imagination in others arts besides computer programming.&lt;/p&gt;&#10;&lt;p&gt;(I do not want to start a new discussion about pros vs. cons of SVN. Neither discuss who is right or who is wrong. I am sharing the poem just because it is curious.)&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;&lt;em&gt;Hear! Hear! And I started drinking way too much coffee due to SVN because it gives me ample time … Last year I wrote my first poem ever (and likely last) during a checkout:&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;Oh, how I long for the days of CVS&lt;br&gt;&#10;When checkouts were a bless&lt;br&gt;&#10;Updates found to be a breeze&lt;br&gt;&#10;And a build went in a wheeze&lt;br&gt;&#10;Now we are old and wise&lt;br&gt;&#10;It is SVN that I despise&lt;br&gt;&#10;A simple checkout takes forever&lt;br&gt;&#10;And often it ends never&lt;br&gt;&#10;It is hungry for files and directories&lt;br&gt;&#10;About disk usage it has no worries&lt;br&gt;&#10;And with its split personality&lt;br&gt;&#10;Using it from the shell has a penalty&lt;br&gt;&#10;But alas, progress should not be blamed&lt;br&gt;&#10;Directories can now be renamed!- A sad SVN user&lt;/p&gt;&#10;&lt;p&gt;Ok, I won’t pursue a career in this area, but it illustrates my frustration …&lt;/p&gt;&#10;&lt;p&gt;Kind regards,&lt;/p&gt;&#10;&lt;p&gt;Peter Kriens&lt;/p&gt;&#10;&lt;/blockquote&gt;</description></item><item><title>About JSch open source project</title><link>https://techtavern.danielferber.com.br/posts/about-jsch-open-source-project/</link><pubDate>Tue, 30 Sep 2008 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/about-jsch-open-source-project/</guid><description>&lt;p&gt;There are many, many open source, pure java implementation for the SSH/SFTP protocol. However, in my opinion, there are two of them that can be taken seriously. One of them is &lt;a href="http://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;ct=res&amp;amp;cd=1&amp;amp;url=http%3A%2F%2Fwww.jcraft.com%2Fjsch%2F&amp;amp;ei=wJ7hSIqHMYSGgwS-zp3eAw&amp;amp;usg=AFQjCNFEETFDy_PvFq6a3L_sqnj_u5o-ZQ&amp;amp;sig2=d5zFilMy_7as3IRg1RdEYA"&gt;JSch&lt;/a&gt;, the other one is &lt;a href="http://www.trilead.com/Products/Trilead_SSH_for_Java/"&gt;Trilead SSH&lt;/a&gt;. I will talk about my experience on the former one while implementing the RemoteTools framework for the &lt;a href="www.eclipse.org/ptp"&gt;Parallel Tools Platform&lt;/a&gt; for &lt;a href="www.eclipse.org/"&gt;Eclipse&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;JSch is one of the few (if not the only one) &lt;strong&gt;open source, pure Java implementation&lt;/strong&gt; with the a &lt;strong&gt;complete implementation of the SSH specification&lt;/strong&gt;, covering both SSH versions. It also covers less common ssh use cases, like &lt;a href="http://www.psc.edu/networking/projects/hpn-ssh/"&gt;High Performance Enabled SSH/SCP&lt;/a&gt; (although I have not yet seen a SSH server willing to easily support this). The JSch maintainers are very careful to &lt;strong&gt;adhere strictly to the ssh specification&lt;/strong&gt;. They even refuse to implement workarounds for known issues for common ssh servers. They reply: “Ask your ssh server provider for a fix”. And I tend to agree with them.&lt;/p&gt;</description></item><item><title>Smaller font sizes for Eclipse on Linux</title><link>https://techtavern.danielferber.com.br/posts/smaller-font-sizes-for-eclipse-on-linux/</link><pubDate>Wed, 24 Sep 2008 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/smaller-font-sizes-for-eclipse-on-linux/</guid><description>&lt;p&gt;&lt;em&gt;This article describes some approaches to launch &lt;a href="http://www.eclipse.org"&gt;Eclipse&lt;/a&gt; on Linux with smaller font sizes and customized graphical user interface (GUI).&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;The modern desktop environments like &lt;a href="http://www.kde.org"&gt;KDE&lt;/a&gt; or &lt;a href="http://www.gnome.org"&gt;Gnome&lt;/a&gt; use larger font sizes to enhance readability of screen contents. However, Eclipse, looks better with a clean design and small fonts.&lt;/p&gt;&#10;&lt;p&gt;Views like &lt;em&gt;Package Explorer&lt;/em&gt; or &lt;em&gt;Outline&lt;/em&gt; may contain very large listings of important information. Eclipse uses are not willing to waste precious space neither with large fonts nor with fancy window decorations.&lt;/p&gt;</description></item><item><title>Fixing Copy-Paste issues on Eclipse and KDE</title><link>https://techtavern.danielferber.com.br/posts/fixing-copy-paste-issues-on-eclipse-and-kde/</link><pubDate>Sun, 10 Aug 2008 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/fixing-copy-paste-issues-on-eclipse-and-kde/</guid><description>&lt;p&gt;&lt;em&gt;This article describes a solution to fix a long term issue (bug?) involving copy &amp;amp; paste when running &lt;a href="http://www.eclipse.org"&gt;Eclipse&lt;/a&gt; on &lt;a href="http://www.kde.org"&gt;KDE&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#10;&lt;h3 id="the-problem"&gt;The problem&lt;/h3&gt;&#10;&lt;p&gt;When launching Eclipse from KDE, one might experience several types failures with cut, copy and paste actions in Eclipse. The reported misbehavior is non-deterministic, but frequent enough to degrade user experience.&lt;/p&gt;&#10;&lt;p&gt;Inside the editor, specially the Java or C/C++ editor, selecting text and issuing the copy action (ctrl+c or equivalent menu entry) may not copy the select text to the clipboard (no text is copied).&lt;/p&gt;</description></item><item><title>Polling files on NFS shared directories</title><link>https://techtavern.danielferber.com.br/posts/polling-files-on-nfs-shared-directories/</link><pubDate>Wed, 06 Aug 2008 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/polling-files-on-nfs-shared-directories/</guid><description>&lt;p&gt;These days we were implementing a distributed application where processes read startup information from a shared file stored in an NFS directory. Unfortunately, the approach did not work as expected, and we faced strange situations. After all, we learned that polling NFS shared directories can be quite tricky.&lt;/p&gt;&#10;&lt;h4 id="the-original-approach"&gt;The original approach&lt;/h4&gt;&#10;&lt;p&gt;Let me explain shortly the algorithm that was initially intended for the application. There is one master process and other N slave processes running on different machines. All of them are started nearly at the same time. But the slave processes must first wait for a file with instructions created and written by the master process.&lt;/p&gt;</description></item><item><title>Running eclipse based apps on Fedora 9 x86_64</title><link>https://techtavern.danielferber.com.br/posts/running-eclipse-based-apps-on-fedora-9-x86_64/</link><pubDate>Wed, 30 Jul 2008 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/running-eclipse-based-apps-on-fedora-9-x86_64/</guid><description>&lt;p&gt;Many IBM applications are based on eclipse for i386 architectures. Just some examples: Lotus Notes, Sametime, Symphony, IES (IBM eclipse SDK). However, the &lt;a href="http://fedoraproject.org/wiki/Releases/9"&gt;Fedora 9&lt;/a&gt; for x86_64 architectures does not install any 32 bits libraries anymore. How shall these applications now run on Fedora 9?&lt;/p&gt;&#10;&lt;p&gt;One one side, these applications were designed for Linux on 32 bit architectures. Therefore, they were build on the 32 bits eclipse framework that relies on several &lt;a href="http://en.wikipedia.org/wiki/Java_Native_Interface"&gt;JNI&lt;/a&gt; (Java Native Interface) calls to 32 bit libraries. The most important library is the low level access to &lt;a href="http://www.gtk.org/"&gt;gtk&lt;/a&gt; API.&lt;/p&gt;</description></item><item><title>xfs forgetful?</title><link>https://techtavern.danielferber.com.br/posts/xfs-forgetful/</link><pubDate>Wed, 30 Jul 2008 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/xfs-forgetful/</guid><description>&lt;p&gt;I have been using &lt;a href="http://en.wikipedia.org/wiki/XFS"&gt;xfs&lt;/a&gt; for some months now. Somewhere I had read about advantages of xfs and got convinced that I should store my files on that file system (sorry, I don’t remember the references anymore).&lt;/p&gt;&#10;&lt;p&gt;Today it happened that, suddenly, &lt;a href="http://www.eclipse.org"&gt;eclipse&lt;/a&gt; complained that all the files I was editing did not exist anymore on the workspace and that the file view was out of sync with the file system. Probably, a bug of new Ganymede version, I thought. But in sequence, everything crashed: KDE, firefox, Sametime, Notes, …&lt;/p&gt;</description></item><item><title>Backing up DVD movies on Linux now useful</title><link>https://techtavern.danielferber.com.br/posts/backing-up-dvd-movies-on-linux-now-useful/</link><pubDate>Sun, 20 Jul 2008 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/backing-up-dvd-movies-on-linux-now-useful/</guid><description>&lt;p&gt;For a long time I have been struggling on Linux to easily create backup copies of my favorite movies, until I finally found &lt;a href="http://k9copy.sourceforge.net/"&gt;&lt;em&gt;k9copy&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h4 id="before-k9copy-backing-up-dvds-was-darkness"&gt;Before &lt;em&gt;k9copy&lt;/em&gt;, backing up dvds was darkness&lt;/h4&gt;&#10;&lt;p&gt;On one hand, there are many fancy video tools available for Windows. However, nearly all of them have some kind of embedded spyware or virus. On the other hand, Linux tools are all written for command line, and require a lot of expertise just to understand what they do.&lt;/p&gt;</description></item><item><title>Whats this? IOException: Write end dead</title><link>https://techtavern.danielferber.com.br/posts/whats-this-ioexception-write-end-dead/</link><pubDate>Wed, 16 Jul 2008 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/posts/whats-this-ioexception-write-end-dead/</guid><description>&lt;p&gt;I like Java very much. Nevertheless, there are things I cannot stand in Java. Sure, and one of them are undocumented exceptions from the Java API, that nobody can explain.&lt;/p&gt;&#10;&lt;p&gt;I will talk about “Write end dead” IOExceptions. What does this mean? Why did this happen? Even if googling around, it is difficult to find a clear answer.&lt;/p&gt;&#10;&lt;p&gt;This article is a full explanation to understand this exception and shows how to fix your code. Just continue reading…&lt;/p&gt;</description></item><item><title>About</title><link>https://techtavern.danielferber.com.br/about/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://techtavern.danielferber.com.br/about/</guid><description>&lt;p&gt;&lt;img src="foto.jpg" alt="Daniel Ferber"&gt;&lt;/p&gt;&#10;&lt;p&gt;I&amp;rsquo;ve spent my career building shared understanding: between users and complex&#10;systems, among the people who build software, and between specifications and&#10;code. Now I&amp;rsquo;m studying how AI can do this for software development itself.&lt;/p&gt;&#10;&lt;p&gt;For 17 years at Petrobras I&amp;rsquo;ve worked in nearly every role of software&#10;development: requirements and business analysis, mathematical modeling,&#10;architecture, programming, databases, infrastructure, DevOps and technical&#10;leadership. Having been on both sides of almost every handover taught me a great&#10;deal about shared understanding, and about how processes, governance and&#10;regulatory requirements challenge it.&lt;/p&gt;</description></item></channel></rss>