Namek Dev
a developer's log

Java: enforce a single instance of an app

May 16, 2016

The Console is an app which typical usecase fits within running a single instance. That’s by design. However, we sometimes forget to check whether some the app is waiting for us in the background and try to launch them. That’s when disaster happens. Two consoles placed on top of window and reacting to same hotkey? Cannot be!

Here’s a short story about preventing from having multiple instances of same app made in Java. There’s a note about communication, too.

→ Continue reading Daj Się Poznać, the-console

babun + gitk

May 6, 2016

When I use git VCS, I simply work in a shell. Even more complicated branching can be resolved using git show-branch  command. But this time I wanted to compare that again with gitk. Since I work on Windows I use babun which is based on Cygwin. And we know that Cygwin can actually launch gitk properly, right? Well, yes - when you configure it.

→ Continue reading Daj Się Poznać, git, the-console

Modules in The Console - Take One

April 20, 2016

In previous posts (linked in the Summary) I discussed a topic of implementing modules in The Console. This time I’m going to describe my first step in this direction.

Currently The Console supports simple scripts - one .js file is one script, i.e. scripts/info/currency.js  is just a currency  command.

But that’s not enough. I want the modules, too. Here’s how I make them real.

→ Continue reading Daj Się Poznać, the-console

Build Runnable JAR of Xtend + JavaFX project in Maven

April 12, 2016

After a long research I’ve found a site that helps with compiling Xtend** **using Maven - - pretty straightforward, isn’t it? However, it lacks a few more things.

My goal was to compile and package Java 8 project together with JavaFX, written mostly in Xtend (in place of Java) with unpacked libraries into one Runnable JAR. In the end I’d like it to be compatible with e(fx)clipse IDE. Here’s how.

→ Continue reading Daj Się Poznać, the-console

The state of importing node.js modules into Java

April 9, 2016

As I noticed in previous article about script management I’d like to support script sharing in The Console. This topic automatically brings idea of supporting Node.js modules. Nashorn doesn’t provide any kind of module import/export mechanism like CommonJS. However, it’s doable to provide custom require() and module.exports. But is it possible to really import Node.js modules or anything from npm?

→ Continue reading Daj Się Poznać, the-console

REPL or even better

April 4, 2016

Read-eval-print loop is quite useful kind of tool that simplifies both learning and trying some short code ideas. REPLs are always very specific - they can be used for evaluating programming language statements, some math calculation, database management, file processing and so on. In The Console I decided having all those things and even more - way to incorporate custom REPLs.

However, idea have grown much more than expected. In this post I explain what’s the big deal to talk about which shows why the development have currently slowed down.

→ Continue reading Daj Się Poznać, the-console

Power of lambda in Xtend

April 2, 2016

The Console supports multiple tabs. By hitting CTRL+T  combination new tab is opened and auto-named. I decided to name tabs as “Tab 1”, “Tab 2”, etc. However, those tabs can be renamed and moved inbetween so auto-naming need an algorithm. I’ve done similiar operation few times but never done this specific things by using Lambda Expressions in Xtend. I was quite surprised by one small detail.

→ Continue reading Daj Się Poznać, the-console, xtend

The Console: script management

March 22, 2016

The biggest feature of my console software is ability to code own “commands” - scripts. It’s supposed to be easy and quick for programmers. I’m not trying to design my own DSL language or make users install some weird packages into system. JavaScript and console API is all you need to know to code your custom scripts.

If one of goals of The Console project is to make easy custom scripting then it’s logical that you need some way to manage your scripts. Putting all scripts in one file or even all scripts in one folder would be a mess. So, how to manage those files? How The Console deals with it?

→ Continue reading Daj Się Poznać, the-console