JavaScript Webapps with Gradle

Originally posted on Shine Technologies:

Duke_the_Ripper IAP4377

Gradle is a build tool on the JVM platform that’s been gaining prominence over the last few years. Gradle’s reach doesn’t stop with JVM languages though.  The most recent releases, 1.10 and 1.11, have improved support for compiling native code (C / C++ / Objective C) and introduced support for the .NET platform. For Android projects, Google have made Gradle the de facto build tool. It’s getting a name for its flexibility, so when the opportunity came to build a single page Javascript webapp we decided to put the latest addition to the polyglot build tool arsenal through its paces.

View original 4 290 słów więcej

Adding Features to an existing Product

Originally posted on ...code is the easy part...:

Normally when building an eclipse product using Tycho, you specify all the features you require in the .product file. This creates a single root level IU. There are various situations where this is not desirable. For example you may have a core product with add-ons features – much like Eclipse itself – but only maintain a single .product file. You may also wish to be able to update some features without needing to rebuild the whole product. There is an open bug for Tycho to help with this in the future.

In this post we will concentrate on the former case. We will assume there is a prebuilt product published to a p2 repository – here we will use the Eclipse RCP product. It is possible to use these steps are part of an eclipse-repository build but you will need to adapt the default Tycho configuration to delay the product…

View original 804 słowa więcej

Xperf Basics: Recording a Trace (the ultimate easy way)

Originally posted on Random ASCII:

imageIf your Windows computer is running slowly – if a program takes a long time to launch, if a game has a poor frame rate, or if an idle application uses too much CPU time – the best way to investigate is to record an Event Tracing for Windows (ETW) trace. An ETW trace records a wealth of information (CPU sampling, context switches, disk I/O, custom data, and much more) that allows most performance problems to be understood by a trained expert. If you’re not a trained expert then you can still record an ETW trace, and then share it with somebody who is.

If a particular program is being slow or inefficient then you may be able to record an ETW trace and share it with the authors of that program. Quite often they can figure out what is going wrong, whether it is a bug on their side

View original 1 048 słów więcej

Eclipse/JVM fails to start due to lack of memory

Originally posted on Eclipsed:

Lately, when starting Eclipse, the JVM has failed to start.  A reboot of the system usually fixed the problem.  Until yesterday.  So I had to dig in and solve this problem.

I wanted to share my experiences with debugging this issue.

Added Note: This is not the bug by which Eclipse running under java 1.6u21 fails to pass the permgen size on to the JVM.  If you are running java 1.6u21 with Eclipse, don’t.

Determine why eclipse.exe is crashing with „-debug”

I edited my eclipse.ini and added the -debug option:


Then I ran eclipse.exe from the command-line, hoping to get a bit more information:

$ ./eclipse.exe
Error occurred during initialization of VM
Could not reserve enough space for object heap

Now that’s a clear error message!

I need lots of memory

You may have noticed some pretty…

View original 450 słów więcej

My favorite features of Scala – part I

During the last few months I’ve spent substantial amount of free time learning Scala and consider it time well spent. This article is first part describing my favorite features of Scala

Extractor Objects

Whenever you define a val or var, what comes after the keyword is not simply an identifier but rather a pattern.

val regex = "(\\d+)/(\\d+)/(\\d+)".r
val regex(year, month, day) = "2015/7/29"

The val regex is an instance of Regex, and when you use it in a pattern, you’re implicitly calling regex.unapplySeq , which extracts the match groups into a Seq[String], the elements of which are assigned in order to the variables year, month, and day.

Detecting missing and unnecessarily imported packages in OSGi bundles

When developing OSGi based application in Eclipse adding required import package declaration is assisted by PDE. In practice, it means that import package declarations are never missing – otherwise Eclipse project won’t comile and run. What programmers almost never do is to remove unnecessary declarations. Why would they if it works? In practice bundle manifests polluted with unnecessary imported packages can cause performance issues during bundle resolution and classloading and sometimes confuse Eclipse PDE during development.

To mitigate this problem I’ve created a small application leveraging the power of excellent BND library. I was really surprised when I run this tool against bundles from application I’m currently working on – some had literally hundreds of unnecessarily imported packages.

oipv 1.x
Usage: oipv [options]

  -j <jar1>,<jar2>... | --jars <jar1>,<jar2>...
        jars or folders to include
  -e <package1>,<package2> | --exclude-package <package1>,<package2>
        Package prefixes to exclude from analysis. You may want to
        excluded packages exported by JRE - javax.swing, javax.sql, etc.
        to avoid false positives
        print usage text

Application code available at GitHub ( – The app itself is available here:

Delete all disabled branches of a Bamboo build plan

Recently I found myself doing some Bamboo maintenance. Namely, I had to delete all disabled branches of build plan related to already deleted feature branches that Bamboo failed to automatically remove. At first, I tried this shell script, but it didn’t work for me with Bamboo 5.6.2 and I ended writing my own version. I’m posting it here hoping it will be useful for others too

Usage is very simple

groovy bamboo_delete_disabled_branches.groovy \
      --bamboo-url <BAMBOO_URL, i.e. http://mycompany/bamboo> \
      --plan-key <PLAN_KEY> \
      --user <USER> --password <PASSWORD>

You can also perform a simulation without actually deleting anything with „–dry-run” option.