Pages

Tuesday, March 24, 2015

IntelliJ IDEA 14.1 - Distraction Free Mode

IntelliJ IDEA 14.1 was released just recently with a good set of new features and improvements. Among other things, one really interesting feature that appeals to me is the new "distraction free mode".

Essentially, entering the distraction free mode means that you'd hide away everything but the editor.

The seasoned IntelliJ IDEA user would now ask, how is it different from "presentation mode" that is already available, or the full screen mode?

This is a very good question! Let's try to answer that! :)

Presentation mode

Presentation mode is designed essentially for delivering presentations. Some of my friends have adopted the presentation mode for actual coding. But to be honest, it only works fine if you have a reasonably large screen and you're not switching between windows while coding. This is how the whole screen looks like when IntelliJ IDEA is in presentation mode:

The default font size in presentation mode is much larger and can be configured in Settings -> Appearance & Behavior -> Appearance. Locate the setting at the bottom of the view:


Full screen mode

Entering the full screen means exactly that. IDE window will span the full screen area. On Mac OS X it also means that it will take the application window to another desktop, which I actually dislike very much, but it's rather a personal preference. In this mode, nothing is changed in the IDE window - all the toolbars, views, etc are preserved.

Notice all the control elements and widgets at the screenshot above?

Distraction free mode

"Distraction free mode" is actually just a fancy name that the marketers came up with :) In fact, it just means that by entering this mode you only keep the editor. This might sound like you're actually entering the presentation mode, it's an incorrect conclusion. In distraction free mode the IDE window doesn't expand to full screen and the fonts are preserved in the original configuration. Basically, we could call this mode as "Hide all toolbars" and it would probably confuse some users less.

At the screenshot above, you can see - it's only the editor that occupies the IDE window. No toolbars, no status bar, no additional views, nothing! So this is exactly what I wanted and I'm really pleased with the new feature! In addition, the text is center-aligned!

What's also cool is that in this mode I can still navigate the same way as I'm used to it in the normal mode. Navigate to the project tree:

... or call out the navigation bar:

Just have to learn the shortcuts ;)

P.S. The new distraction free mode is really cool. However, it is not quite new. In fact, all this was possible long before version 14.1. Even in earlier versions of IntelliJ IDEA you can achieve the same, just not with one mouse click or shortcut press. In the earlier Intellij IDEA versions, in the View menu, you could just hide the toobar, tool buttons, status bar and navigation bar and here you go - you have a "distraction free mode"! :) So the new feature isn't really new. It is rather just a convenience that was added on top of the existing features.

Tuesday, March 10, 2015

Packaging Java applications for Mac OS, javapackager

Stumbled upon an issue with installing muCommander on Mac. The native installer did not work, saying that the launcher is corrupted, but the portable version worked just fine via the command line:

java -jar mucommander.jar

Launching a GUI app from the command line is not convenient at all. One option is to assemble the *.app package using Launch4j. However, I didn't have enough patience to do apply the tool. So I tried looking for an alternative solution.

So I found this guide: Packaging a Java App for Distribution on a Mac. And the instructions worked just fine! Here's what I did:

1. Downloaded the appbundler utility from https://java.net/downloads/appbundler/

2. Create a build.xml file. For instance:

3. Run "bundle" task: ant bundle

Profit! :)

This is all cool and works, but the process is a bit clumsy. One has to download some strange utility and use a legacy build tool to assemble the final artifact. We should do better! So I found another documentation page: Java Platform, Standard Edition Deployment Guide: Self-Contained Application Packaging. Apparently, there's a javapackager utility included in JDK distribution that you can use to create native packages.

By running the following command in the same folder where mucommander.jar is located, it created the desired artifacts:

$JAVA_HOME/bin/javapackager -deploy -native -outdir .  -outfile mu.app -srcfiles mucommander.jar -appclass com.mucommander.Launcher -name "muCommander" -title "muCommander"
Voila!
muCommander-0_9_0 anton$ ls -l bundles/
total 269904
-rw-r--r--@ 1 anton  staff  75110066 Mar 10 23:53 muCommander-1.0.dmg
-rw-r--r--  1 anton  staff  63076596 Mar 10 23:53 muCommander-1.0.pkg
drwxr-xr-x  3 anton  staff       102 Mar 10 23:53 muCommander.app

The only missing bit there is a proper icon, which I was too lazy to bother about :)

Misconceptions about microservices

Every now and then I hear people asking questions like "How can I implement a microservice using Play framework?", or "How can I build a microservice using Spring Boot?". Every time I read this it sparks the "facepalming" reaction in me.

Repeat after me: microservice is not defined by a framework!

It doesn't matter what technology or a framework is used to implement a microservice. It is rather the domain or the functionality in isolation that defines it. Martin Fowler has written a nice article for defining the microservice and while he mentions the technology bit there, it's not about technology at all!

Captan Obvious says: if you use Play or Spring Boot to implement a microservice, it doesn't mean that those frameworks can't be used to build silos. Which also means that a microservice is a "mini-silo" :)

Monday, March 9, 2015

XRebel 2.0 Beta is available

XRebel 2.0 Beta is available for download! The new version includes profiling capabilities and it is now possible to get an overview of performance breakdown in a single HTTP request. The cool part is that XRebel shows only the minimal relevant information by filtering out a lot of irrelevant stuff. I have tested the new version with a lot of different enterprise-grade applications, including Atlassian Jira, Magnolia CMS, Liferay Portal, eXo Platform... and it works just great!

The greatest feedback so far was that the tool provided the ability to monitor JPA queries and the subsequent JDBC invocations in one go. With the new version, XRebel is turning into a real profiler, yet simple and powerful.

Monday, January 19, 2015

Groovy and Grails

The biggest today (19.01.2015) news in the community is probably the announcement regarding Pivotal pulling Groovy/Grails funding. And there are a lot of sad reactions on this in all channels that I have seen.

This might start a panic reaction around Groovy and Grails. IMO, there's nothing to panic about. Groovy and Grails communities are the healthiest and there's a lot of big companies that use Groovy and Grails and who would definitely be willing to sponsor the projects further. I'm pretty sure they all will be in line to get the both projects under their sponsorship just in a few weeks :)

All-in-all, it might even be very good for Groovy since Pivotal didn't seem to leverage Groovy in their ecosystem with the focus on Cloud Foundry offering. So we might even see an acceleration of Groovy/Grails development once the projects get a new sponsor.

GeekOut 2015 Registration is Open!

As of today, the registration to GeekOut Java conference in Tallinn is open!

The focus of the conference is on all-Java but not only. For instance, this year we have talks on Dart and Go programming languages. Other talks cover developer tooling, solution architecture, programming methodologies. There will be a few talks on Java concurrency that you shouldn't miss in case you're into writing multithreaded applications in Java.

And here's what the conference is in numbers:

  • 2 days
  • 400 attendees
  • 18 excellent talks
  • and 1 kick-ass party!

We're also expecting Stephen Chin to visit us with his awesome Nighthacking sessions, so one should expect a lot of fun from the event!

BTW, If you haven't been to Tallinn yet, this is a great reason to consider visiting and June is just perfect month for this travel!

Saturday, January 17, 2015

My "fluffy" reading list for 2015

In 2014 I was kind of reluctant to reading and the queue of my "to read" books has grown immensely. I could probably spend full time reading the books instead of my actual job - it still wouldn't help to clear up the queue. BTW, I keep track of my reading list at Goodreads, that's a nice website!

Why is it a "fluffy" reading list, you'd ask? Because none of the books here are technical. That's a part of my reasoning - if something is not technical, I call it "fluffy". It doesn't mean that it's a bad thing ;) So I though I'd share a few of the "fluffy" books that I'm planning to read next. Maybe someone would see that I'm planning to read a crappy book and can suggest something instead?

The book I'm currently reading is The Inmates are Running the Asylum Oh man! I wish I would have read the book 5 years ago when I just started to work at ZeroTurnaround! I could have saved so much time by now. This is a must read book for every product manager and software designer. Well written, highlights the issues with software from the usability POV.

Next on my list is Crossing the Chasm: Marketing and Selling Disruptive Products to Mainstream Customers. The author shows that in the Technology Adoption Life Cycle there is a vast chasm between the early adopters and the early majority. The challenge is to narrow this chasm and ultimately accelerate adoption across every segment. I've heard good things about the book, so I think I should give it a try. Nice cover, btw :)

How Google Works. I don't even know what to expect. The title is kind of abstract and the potential reader could assume different content depending on how the title is interpreted.

How Google Works is the sum of those experiences distilled into a fun, easy-to-read primer on corporate culture, strategy, talent, decision-making, communication, innovation, and dealing with disruption.

The Goal: A Process of Ongoing Improvement was suggested to my by colleagues. One of the reviewers wrote about this book:

The best process improvement novel I've seen, this classic work explains the all-important Theory of Constraints through real life examples and a surprisingly good story. Most books of this nature are exceptionally unrealistic, but this one manages to keep the reader engaged, which is key for an instructional text like this.

The Connected Company. The title is intriguing :) And good reviews also. I think it's worth reading.

Hooked: How to Build Habit-Forming Products is probably the last "fluffy" book on my immediate reading list. Again - suggested by colleagues. The title implies one very interesting topic for discussion "Why do some products capture widespread attention while others flop?"

Friday, January 16, 2015

Technology predictions for 2015

It is popular to announce predictions for the upcoming year. I though it would be fun to try predicting some stuff too :)

Disclaimer: my predictions are very subjective and are based on my not-so-huge awareness of the IT industry. Feel free to leave your opinions in the comments. So here it comes:

Big Data.

"How big is big?"- one would ask? I leave this question unanswered. But the term "big data" always reminds me of some data set that should be queried/calculated/analyzed etc. The thing is - enterprises are becoming data hungry. Even a small company internally generates huge amounts of data - website visits, emails, sale events, product releases, commits to version control - anything that comes up to your mind. This is all valuable data that can be analysed.

And it is a huge data lake that could be generated by data-intensive companies. Trying to keep the information structured was common just a few years ago - with data warehouse approach. Now we have technology that enables us to process so much data that the retail banking data warehouse would seem a child's play compared to the amounts of data processed today.

Now, where was I? Ah, yes... I you are an engineer and you still haven't learned about Hadoop, Spark, Storm, Kafka, Samza, Typesafe stack, or R, do yourself a favour pic one and start learning it! The demand in the skills for building data processing system backends will be huge in the upcoming year(s).

Want examples? How about Hortonwork's IPO? Startups being created to support Kafka? Or look at the awesome services being created for analytics!

It is just all about data now (it has always been). Business depends on it.

JavaScript and front end.

Business as usual. Every day a new batch of JS frameworks will be appearing. Nothing special. The efforts to make JavaScript better are definitely welcomed, but doesn't it bring some uncertainty - which JS framework would you pick for the new project? Angular? What do you think about Angular 2.0 then? What about Atscript? Dart?

Crazy stuff.. Don't get me wrong - the improvements and the progress are amazing in front-end tech. Compared to the time when I had to do JS coding the current work of front-end engineer is just pure pleasure! The problem that I see here: it is just never stable. Almost any front-end technology that is popular today might easily turn into unmaintainable in a few months. And it doesn't seem to get better, at least from my impressions. And this trend will continue.

JVM languages

Scala continues to grow, Java continues to decline. We will probably see more reports on Kotlin and Ceylon being used in real commercial projects. Despite all the recent efforts that have been done in Nashorn, I have lost my belief into dynamic languages, although Groovy remains my GTD programming language for JVM.

Microservices

Blah, blah, microservices, blah, blah, blah... The ESB of our time :P

The reality is, there are just a few companies, like Netflix, who would really benefit of microservices approach at a big scale. Others - just use the fancy term - microservice - and isolate some functions of the silo application into a dedicated service. That's it - "so micro, much service". So it's just a SOA reinvented. The community will realize it this year, I hope.

Docker

Docker is probably the biggest hype of 2014. Even bigger than 'microservices'. Well, now there's a competing effort - Rocket. I'm almost sure that in 2015 we would see some more challengers in this space - other competitors to Docker. Given the support of big vendors, however, Docker will continue the hype in 2015. I'm still not convinced by the technology though.

Technology marketing

Haha! You didn't see that coming, did you? :) Why technology marketing? Oh, because the most effective sales are not happening during a golf match any more. Even big vendors are now more developer-oriented. Hence marketing. The problem here - developers hate marketing.

But have no fear! Marketing guys are crafty as well - the new ways to deliver the message to developers about some new cool and shiny thing are being invented every day. How? Content. A huge effort is being put into creating content for software developers. Look, Voxxed have just been launched. Why? Answer - marketing.

So in 2015 you can expect even more content being pushed by the vendors related to the technologies I've mentioned above.

Done

OK, I think this is enough of predictions, it was a fun exercise :) Let's see how it turns out in a year.

Wednesday, December 17, 2014

XRebel 1.2

Just released XRebel 1.2. It is amazing, astonishing, splendid, beautiful, awesome, beautiful, beautiful, beautiful! :) I'm most pleased with its ability to show the relation between ORM-level events/queries and the generated SQL queries that are executed via JDBC. Like this:

Or even like this:

The cool part is that even with no special requirements to filtering, the call tree scales very well - the user could see the compact call stack with relevant branching points starting from the incoming HTTP request towards the JDBC calls, or NoSQL... or outgoing HTTP invocations.. even RMI!

/me happy! :)

Saturday, December 6, 2014

Java EE meets Kotlin

Here's an idea - what if one tries implementing Java EE application with Kotlin programming language? So I though a simple example, a servlet with an injected CDI bean, would be sufficient for a start.

Start with a build script:

And the project structure is as follows:

Here comes the servlet:

What's cool about it?

First, it is Kotlin and not Java, and it works with the Java EE APIs - that quite cool! Second, I kind of like the ability to set aliases for the imported classes: import javax.servlet.annotation.WebServlet as web, in the example.

What's ugly about it?

Safe calls everywhere. As we're working with Java APIs, we're forced to use safe calls in Kotlin code. This is kind of ugly.

In Kotlin, the field has to be initialized. So initializing the 'service' field with the null reference creates a "nullable" type. This also forces us to use either the safe call, or the !! operator later in the code.

The attempt to "fix" this by using the constructor parameter instead of the field failed for me, the CDI container could not satisfy the dependency on startup.

Alternatively, we could initialize the field with the instance of HelloService. Then, the container would re-initialize the field with the real CDI proxy and the safe call would not be required.

Conclusions

It is probably too early to say anything for sure, as the demo application is so small. One would definitely need to write much more code to uncover the corner cases. However, some of the outcomes are quite obvious:

  • Using Kotlin in Java web application appears to be quite seamless.
  • The use of Java APIs creates the need for safe calls in Kotlin, which doesn't look very nice.

Disqus for Code Impossible