Skip to content

Instantly share code, notes, and snippets.

View vackosar's full-sized avatar
🛰️

Vaclav Kosar vackosar

🛰️
View GitHub Profile

Print contents of a Java collection.

   Arrays.deepToString(collection.toArray());

Change owner of linux mounted directory

Remount the directory. Oridinary "chown" won't work.

Resolve Issues Installing LUbuntu Into VirtualBox.

Encoutered couple of issues.

  • Turn swap off before starting installation to install with full disk encryption.
  sudo swapoff --all

  • Download essentials before installing VirtualBox Additions.
  sudo apt-get update
  sudo apt-get install build-essential linux-headers-"$(uname -r)"
  # sudo apt-get install virtualbox-guest-*

Git Review

Git has indeed many nice features.

I really like ability to - compile readable commit history (git rebase) - review code with pull request review

@vackosar
vackosar / gist:6e61da6fee69da68c8de
Last active August 29, 2015 14:20
SPRING INTEGRATION ROUTER SPEC SUBFLOW MAPPING VS CHANNEL MAPPING

Spring integration RouterSpec functions subflowMapping VS channelMapping

I find it unintuitive that two seemingly similar functions subFlowMapping and channelMapping are very different. The difference is not mentioned in the Javadoc. Difference is described in release announcement.

Quote

The channelMapping() continues to work as in regular Router mapping, but the subFlowMapping() tied that subflow with main flow. In other words, any router’s subflow returns to the main flow after .route().

@vackosar
vackosar / gist:87568cdd6a78a72cf884
Last active August 29, 2015 14:20
Eclipse Luna Service Release 1 (4.4.1) poor support for Java 8 lambda refactoring
I cannot extract objects from lambda expressions. I cannot say that Eclipse has full support of Java 8.
EXAMPLE
x -> x.toString()
cannot be extracted to
Function<Object, String> ToStringFuction ...
@vackosar
vackosar / gist:486e2b6b437f73abfe39
Last active August 29, 2015 14:20
DSL vs XML configuration
DSL configuration has all relevant information colocated on one place in the code.
XML configuration has information scattered. Part is in the XML and part in the code.
DSL CONFIGURATION EXAMPLE
.<OrderItem, Boolean>route(OrderItem::isIced, mapping -> mapping // 16
.subFlowMapping("true", routeIced())// 24
.subFlowMapping("false", routeNotIced()))
@vackosar
vackosar / gist:e79fa2453bf0f3e44b4d
Created April 18, 2015 17:32
Spring is much more complex than JEE
Spring compared to JEE is much more complex and configurable. Spring also has kind of organic-growth feel. This is why I currently still prefer JEE.
http://www.mkyong.com/tutorials/spring-tutorials/
@vackosar
vackosar / gist:bf3fb1f9484e08a49b60
Created April 18, 2015 15:10
JEE vs Spring: Spring Bean Scopes vs JEE Bean Types
Spring Singleton corresponds to either
- JEE stateless session bean
- or if it has internal state to JEE singleton
Spring Prototype corresponds to JEE stateful session bean.
Spring Scopes Session and Request correspond to CDI Scoped beans. However CDI does not support transactions in contrast to Spring Beans or JEE beans.