Software Development and related activities

Something I want to share with you

Reading List 2014-April-18

Death of Gabriel Garcia Marquez is definitely the worst yesterday’s news. Read more: Gabriel Garcia Marquez dies at 87

Announcements

  1. CDI 1.2 Released (The Aquarium)
  2. CDI 1.2 is released | Contexts and Dependency Injection
  3. AlloyUI 2.5.0 Released
  4. AngularDart 0.10.0 (ostemad-teleportation) : breaking changes and versioning
  5. Spring XD 1.0.0.M6 Released
  6. Spring Security OAuth 2.0.0.RC1 Available
  7. The New Linode Cloud: SSDs, Double RAM & much more | Linode Blog

Software development

  1. The Heartbleed Aftermath: all CloudFlare certificates revoked and reissued
  2. Starbucks Does Not Use Two-Phase Commit
  3. When two-factor authentication is not enough
  4. Big Data Quality: Certify or Govern?
  5. Things You Should Never Do, Part I
  6. Tips for Getting Your Android Apps Looking Good on Amazon Fire TV
  7. Developers’ Guide to Static Code Analysis
  8. Code School and the Google Maps SDK for iOS
  9. Git and project dependencies
  10. A Simple Explanation for git rebase
  11. 5 ways to improve battery life in your app
  12. The Magic of Modularity

Agile

  1. Testability and Cost of Change
  2. Continuous Delivery: The price of admission..
  3. The advantage of Scrum in evaluating “new stuff”

Java

  1. Using jOOQ with Spring: CRUD
  2. Webinar Replay: Building ‘Bootiful’ Applications with Spring Boot
  3. New BigInteger methods in Java 8
  4. Using Selenium with JMeter’s WebDriver Sampler
  5. How to do Continuous Integration with Java 8, NetBeans Platform 8, Jenkins, Jacoco and Sonar
  6. Inject any custom service into Liferay WCM templates

Scala

  1. Changes in Scala 2.11
  2. Welcome to Scala 2.11
  3. Webinar: Welcome to Scala 2.11
  4. Typesafe announces Akka Streams, a part of the Reactive Streams Initiative
  5. Primitive recursion with fix and Mu

In Russian

  1. Разномыслие, как ни странно, началось при Сталине… | ПостНаука
  2. Новый метод позволил наложить рекордное ограничение на время жизни хиггсовского бозона

Reading List 2014-April-17

Software development

  1. Seven Databases in Seven Days – Riak
  2. Design, Develop, and Distribute at I/O 2014 | Google Developers Blog
  3. Coloring Different Data Sources in IntelliJ IDEA
  4. Todon’t
  5. How to Level Up

Video

  1. Fireside Chat: Android Design

Java

  1. List of all JEPs for JDK8
  2. JEP 174: Nashorn JavaScript Engine
  3. Asynchronous CDI Events? (The Aquarium)
  4. Conway’s Game of Life and the Flyweight Pattern
  5. We’re Hacking JDBC, so You Don’t Have To
  6. The Real Cost of Logging
  7. JSON Schema (The Aquarium)
  8. Spring MVC Test with Geb
  9. Some new Guava classes targeted for release 10 | Google Groups

Some background discussions on Java 8 Lambda, Optional and default methods in interfaces

  1. Optional require(s) NonNull
  2. When lambdas become objects
  3. Allow default methods to override Object’s methods
  4. Checked exceptions within Block
  5. Allow lambdas to implement abstract classes

Reading List 2014-April-16

Announcements

  1. Apache Hadoop 2.4.0
  2. Apache Tomcat Native 1.1.30 released | Mladen Turk
  3. Apache Tomcat Connectors 1.2.40 released | Mladen Turk
  4. Second Service Release For Spring Data Release Train Codd Released
  5. Announcing the Release of Google App Engine 1.9.3
  6. Google Cloud Platform expands to Asia Pacific
  7. Announcing Google BigQuery and Datastore Connectors for Hadoop
  8. Spring Integration 4.0 Release Candidate Available
  9. Final Draft of OSGi Core Release 6 available for download

Software development

  1. The Four Parts of a Minimal Viable Product
  2. Better code through code reviews
  3. Social Processes and Heartbleed, Part 1
  4. Angular and Durandal Converge
  5. What Heartbleed Tells Us About the Need for IT Automation
  6. No More Passwords for Apps using Login with Amazon on Kindle Fire
  7. Innodb redo log archiving

Java

  1. 10 Books Every Java Developer Should Read
  2. New BigInteger Methods in Java 8
  3. Java 8 Friday: No More Need for ORMs
  4. Everything about Java 8
  5. Maven and Java multi-version modules
  6. JDK 8 Security Enhancements
  7. Java 8 Nashorn Tutorial
  8. 10 Books Every Java Developer Should Read
  9. Using jOOQ with Spring: CRUD
  10. trackr: An AngularJS app with a Java 8 backend – Part I
  11. Spring expression language (spel) and Spring boot in action
  12. TimeUnit Enum in Java
  13. We hate/love lambda
  14. Inject any custom class or service into web content templates | Liferay blogs
  15. Covariant Blabbering : Damn smart idea (2) : DynamicVariable

In Russian

  1. Эксперимент LHCb окончательно доказал реальность экзотического мезона Z(4430)
  2. FAQ: Биоархеология и трепанация
  3. Как открыли новую экзотическую частицу?

Using Unitils ReflectionAssert

Often it is needed to compare two different instances of the class inside test. I.e. we save object into database, then fetch it back from db and we want to be sure if nothing was lost during saving/reading.

In order to make such assertions more easier and maintainable one can use great Unitils library which has useful class ReflectionAssert

First, update parent’s pom.xml:

pom.xml changes in parent module
1
2
3
4
5
6
7
8
9
<properties>
    <unitils.version>3.4</unitils.version>
</properties>
<dependency>
    <groupId>org.unitils</groupId>
    <artifactId>unitils-core</artifactId>
    <version>${unitils.version}</version>
    <scope>test</scope>
</dependency>

Then, add dependency to the child module:

pom.xml changes in child module
1
2
3
4
<dependency>
    <groupId>org.unitils</groupId>
    <artifactId>unitils-core</artifactId>
</dependency>

Usage is very simple: Add static import to the class.

pom.xml changes in child module
1
import static org.unitils.reflectionassert.ReflectionAssert.assertReflectionEquals;

and use it instead of regular JUnit assert:

1
assertReflectionEquals(expected, actual);

It is possible to pass reflection comparator modes as optional parameters to the above method.

Be ware that this method is not very useful if you want to compare objects which has floating point or double parameters – ReflectionAssert compares double and float values using ==, so it is not very useful. It is not possible to pass epsilon for comparison.

excerpt from org.unitils.reflectionassert.comparator.impl.LenientNumberComparator#compare
1
2
3
4
5
6
7
// ...
Double leftDouble = getDoubleValue(left);
Double rightDouble = getDoubleValue(right);
if (!leftDouble.equals(rightDouble)) {
    return new Difference(differenceMessage, left, right);
}
// ...

If you need to compare double values in JUnit assertions then it is better to use hamcrest library:

1
2
3
4
5
import static org.hamcrest.number.IsCloseTo.closeTo;
import static org.junit.Assert.assertThat;

// in @Test method:
assertThat(actual.getFederalIncomeTax(), closeTo(expected.getFederalIncomeTax(), EPSILON))

Happy hacking!

Using AssertJ

AssertJ is a library which provides fluent strongly-typed assertions to use in unit tests.

Example of assertions written with AssertJ:

1
2
3
4
5
6
7
8
import io.github.uthark.blog.assertj.Assertions.assertThat;

// ... within @Test
User result = userDao.findByLogin("username");
assertThat(result).
    isNotNull().
    isActive().
    hasLogin("username");

As you can see assertions look much more readable. The integration of assertj into Maven project is very easy:

  1. Update pom.xml in parent module
pom.xml changes in parent module.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<properties>
    <assertj-core.version>1.6.0</assertj-core.version>
    <assertj-assertions-generator-maven-plugin.version>1.2.0</assertj-assertions-generator-maven-plugin.version>
</properties>

<dependencyManagement>
    <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>${assertj-core.version}</version>
        <scope>test</scope>
    </dependency>
</dependencyManagement>

<pluginManagement>
    <plugin>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-assertions-generator-maven-plugin</artifactId>
        <version>${assertj-assertions-generator-maven-plugin.version}</version>
        <executions>
            <execution>
                <id>generate-assertions</id>
                <phase>generate-test-sources</phase>
                <goals>
                    <goal>generate-assertions</goal>
                </goals>
            </execution>
        </executions>
    </plugin>

</pluginManagement>
  1. Update pom.xml in child module
Changes in child module.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<dependencies>
    <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-assertions-generator-maven-plugin</artifactId>
            <configuration>
                <!-- you can define collection packages: -->
                <packages>
                    <param>io.github.uthark.blog.assertj</param>
                </packages>

                <!-- Or specify classes one by one. -->
                <classes>
                    <param>io.github.uthark.blog.assertj.User</param>
                </classes>
            </configuration>
        </plugin>
    </plugins>
</build>

After this changes it is possible to generate assertions for the classes you want test:

1
mvn assertj:generate-assertions

By default assertj will generate assertion classes in target/generated-test-sources/assertj-assertions/, it is possible to override this behaviour by passing configuration element targetDir to plugin.

Additonal documentation for Maven plugin can be found here

Happy hacking!

Reading List 2014-April-15

Software development

  1. Building Carousel, Part I: How we made our networked mobile app feel fast and local
  2. Write line notes from your phone · GitHub
  3. Scaling the Facebook data warehouse to 300 PB
  4. Why did we lose the XP Practices?
  5. EC2 Update – Previous Generation Instances | Amazon Web Services Blog
  6. Working with Google Analytics API v4 for Android
  7. The Grails Depedency Injection Inheritance Pitfall

DevOps

  1. Adaptive IT — Why Vagrant is the Best DevOps Tool Ever
  2. Using Chef to Automate Google Compute Engine

Java

  1. 10 JDK 7 Features to Revisit, Before You Welcome Java 8
  2. 5 Features In Java 8 That WILL Change How You Code
  3. Cache Abstraction: JCache (JSR-107) Annotations Support
  4. Oracle Nashorn: A Next-Generation JavaScript Engine for the JVM
  5. Use Nashorn and WebJars to execute Javascript server-side
  6. What’s New in Java 8: Lambdas
  7. JEP 180: Handle Frequent HashMap Collisions with Balanced Trees
  8. JEP 155: Concurrency updates (jsr166e)

Scala

  1. The other 99% — Monadic
  2. Reflections on Akka

Reading List 2014-April-14

Releases

  1. Our New Reader View in Pocket 5.4 for Android
  2. Spring Batch 2.2.6.RELEASE is now available
  3. MongoDB 2.6 is out

Software development

  1. New user and sequence based segments in the Core Reporting API
  2. Looking for PostgreSQL Performance Issues
  3. Why Google Is Broken for Debugging
  4. 13 | Joel on Software
  5. Recursion: Dream Within a Dream
  6. What to Think About During Exercise
  7. ScaleArc: Benchmarking with sysbench

Java

  1. Five Synchronizers in Java
  2. Oracle Drops Collection Literals in JDK 8
  3. Creating Object Pool in Java
  4. Why JSR-310 isn’t Joda-Time
  5. Non-blocking IO in Servlet 3.1 By Example
  6. 15 Must Read Java 8 Tutorials
  7. Open source Java projects
  8. JSF + AngularJS = AngularFaces? (The Aquarium)
  9. Lambda Expressions
  10. Attempt to map WCF to Java terms
  11. Yet another way to handle exceptions in JUnit: catch-exception
  12. Non-blocking I/Os in Servlet 3.1 (The Aquarium)
  13. Liferay CometD Ajax Push / Liferay Reverse Ajax
  14. Java Q&A: The ultimate superclass, Part 2

Reading List 2014-April-11

Software development

  1. Dart improves async and server-side performance
  2. Federal Government Releases Health Care Provider Reference Architecture
  3. The Cost of Context Switching
  4. How Overloading Interacts With C Compatibility
  5. Write Code Every Day
  6. Consumer Release Testing
  7. Google Finds: Centralized Control, Distributed Data Architectures Work Better than Fully Decentralized Architectures
  8. Do Developers Love To Build On MongoDB?
  9. 10 Reasons Not To Use Infinite Scroll On Your Website
  10. First look: MongoDB 2.6, the all-grown-up version

Cloud

  1. Now Available – New Memory-Optimized EC2 Instances (R3)

Java

  1. JEP 169: Value Objects
  2. A Docker Maven Plugin for Integration Testing
  3. Reactive Programming Patterns in Akka using Java 8
  4. Executing Diagnostic Commands Using Attach
  5. Final Results from our Java EE 8 Community Survey (Linda DeMichiel’s Blog)
  6. CSRF protection in Spring MVC, Thymeleaf, Spring Security application

Android

  1. Anti-Malware Monitoring for Android Apps
  2. Expanding Google’s security services for Android

Scala

  1. Memoization of Scala Streams

Reading List 2014-April-10

General

  1. The Job After Steve Jobs: Tim Cook and Apple
  2. In depth: Descriptive Search in Evernote
  3. A Powerful New Way to Edit DNA
  4. XKCD What if? | Faucet Power
  5. Expanding Google’s security services for Android

Cloud

  1. The New Cost Explorer for AWS

Software development

  1. Dart improves async and server-side performance
  2. Don’t Estimate Spikes
  3. Heartbleed
  4. What To Return: IEnumerable or IList?

Java

  1. For Each loop Puzzle in Java
  2. Constructor/Method Parameters Metadata Available Via Reflection in JDK 8
  3. How much faster is Java 8?
  4. New Parallelism APIs in Java 8: Behind The Glitz and Glamour
  5. Why There’s Interface Pollution in Java 8
  6. Dubious Aspects of Features of JDK 8

In Russian

  1. LHCb изучает эффекты адронной дифракции

Reading List 2014-April-09

Security

  1. Security Release of omnibus-gitlab due to CVE-2014-0160 (‘Heartbleed’)
  2. Heartbleed Security Bug: Update for Puppet Users
  3. Dealing with OpenSSL bug CVE-2014-0160 (Heartbleed)
  4. Secure DevOps – Seems Simple

Announcements

  1. Hibernate ORM 4.2.12.Final Released
  2. Akka 2.3.2 Released!
  3. New book: EJB 3 in Action, Second Edition

Scala

  1. Scala Style Guide — Scala Style Guide v1.3.1 documentation

General

  1. DynDNS: Why We Decided To Stop Offering Free Accounts
  2. Yahoo breaks every mailing list in the world including the IETF’s
  3. The Prototype of Future Knowledge Workers

Software development

  1. Software Estimation: How Misperceptions Mean We Almost Always Get It Wrong
  2. Performance Tuning On Android — The Venmo Blog
  3. Spring Test Context Caching + AspectJ @Transactional + Ehcache pain
  4. Liferay: Searching entities through custom attribute value.
  5. Services, Microservices, Nanoservices… oh my!

In russian

  1. Главы | Отходы

Reading List 2014-April-08

Announces

  1. Spring Boot 1.0.1.RELEASE Available Now
  2. Scala 2.11.0-RC4 is now available!
  3. MongoDB 2.6: Our Biggest Release Ever | MongoDB Blog
  4. Announcing Play 2.3-M1 | Google Groups

General

  1. Fire TV: Amazon gets into the set-top box fray with a powerful media and gaming box
  2. How Gmail Happened: The Inside Story of Its Launch 10 Years Ago
  3. Can you hear me now? No, I don’t have that app.

General Software development

  1. Handling multiple branches in continuous integration
  2. If you want fast code, don’t use assembly
  3. Using Android Location API in Weather App – Search city
  4. Numbers Every Programmer Should Know By Year
  5. How (NOT TO) measure latency
  6. Who Solves Which Problems?
  7. Why Abstraction is Really Important
  8. Multi-Level Argparse in Python (Parsing Commands Like Git)
  9. Cassandra lowers the barriers to big data
  10. ReportingDatabase
  11. AngularDart vs. Coffeescript + AngularJS: How Dart won over Coffeescript halfway through the game

Java

  1. Java.next: Contrasting concurrency
  2. Java 8 Friday: The Dark Side of Java 8
  3. Creating your own loop structure in Java 8 lambda
  4. Apache CXF 3.0: JAX-RS 2.0 and Bean Validation 1.1 finally together
  5. Wildfly 8.0 provides seamless JSON support via its JAXRS 2.0 implementation
  6. CompletableFuture for OSGi Remote Services

In russian

  1. Коллаборация CMS продолжает уточнять массу топ-кварка

Reading List 2014-April-07

Software development

  1. Why Hire Older Engineers
  2. Am I really a developer or just a good googler?
  3. Facebook open sources code for managing A/B tests — Tech News and Analysis
  4. AngularJS Tip – Avoid Multiple Variables in ng-src
  5. Introducing Pyston: an upcoming, JIT-based Python implementation
  6. The Power of HTML
  7. Microsoft TypeScript 1.0 Arrives
  8. BlueGreenDeployment
  9. Five Funny Moments in Developer History
  10. Domain-Driven Design Revisited
  11. Application Security – Can you Rely on the Honeymoon Effect?
  12. Differences in Map/Reduce between RavenDB & MongoDB
  13. Microsoft Announces Windows Phone 8.1 With New Action Center, Cortana, Start Screen Improvements
  14. Consume Webservice in Android using intentService
  15. Btrees Are the New Black
  16. Why Ruby Class Methods Resist Refactoring
  17. Subtly Bad Things Linux May Be Doing To PostgreSQL

Agile

  1. Lean is Clean without the C for Complexity
  2. Conquering job hell and multiple app branches using Jenkins & Mercurial

Cloud

  1. The platform-as-a-service winner is … Puppet?
  2. Integration platform as a service, the cloud, and… baby unicorns

Java

  1. Common Misconceptions About Java
  2. javac’s -Xprint Option
  3. javac’s -Xlint Options
  4. Java 8 default methods: what can and can not do?
  5. Hack Computer Boards with Java! (The Java Source)
  6. Why I Like The Verbosity of Java
  7. How not to use Java 8 default methods
  8. Java 8 Adoption Poll Results
  9. 10 Example of Lambda Expressions and Streams in Java 8
  10. In Relation To… Third milestone on the path for Hibernate Search 5
  11. Using AmazonS3EncryptionClient to Send Secure Data Between Two Parties
  12. Dealing with org.hibernate.LazyInitializationException: could not initialize proxy – no Session in Hibernate Java

In Russian

  1. FAQ: Святилища Кавказа

Reading List 2014-April-04

Software development

  1. How WhatsApp Grew to Nearly 500 Million Users, 11,000 cores, and 70 Million Messages a Second
  2. MongoDB on Google Compute Engine – tips and benchmarks
  3. Going Reactive – Asynchronous JavaScript at Netflix
  4. Greenpeace Blasts ‘Dirty’ Amazon Web Services
  5. Eclipse is dead for Android development and I helped kill it — Infinum

Java

  1. How to process stream and read text file in Java 8
  2. Integration Testing for Spring Applications with JNDI Connection Pools
  3. Project Sagan: zero-downtime deployments
  4. Java: How to Schedule a task to run in an interval
  5. Understanding the JDBC architecture.
  6. Java Tip: Hibernate validation in a standalone implementation

In Russian

  1. Получены первые намеки на эффект Михеева–Смирнова–Вольфенштейна при движении нейтрино сквозь Землю
  2. Проект Lazybones — «Лентяй», который работает за вас
  3. Москва: город, агломерация, жители, система управления

Reading List 2014-April-03

General

  1. Introducing the Coursera App for Android
  2. First Asteroid-Like Object Discovered With Rings
  3. Why is Warren Buffett Offering a Billion Dollar Bracket?
  4. This video creates natural hallucinations for a…

Software development

  1. Getters and setters gone wrong
  2. Don’t “Control” Agile Projects
  3. Use Frequent Branches to Tell a Story and Simplify Code Reviews
  4. Custom Git Commands in 3 Steps
  5. Collaborating with Lists · GitHub
  6. Adding properties to domain classes on the fly using groovy propertyMissing feature
  7. How to Cache Stored Procedure Results
  8. Basic Concepts of High Availability Linux
  9. Chris’s Wiki : blog/linux/KillAllNotRecoverable
  10. Just what we need…another package manager
  11. Good Vs Evil
  12. Bringing together the best of PaaS and IaaS
  13. Fail SAFe ~ Geek Out of Water
  14. Adding properties to domain classes on the fly using groovy propertyMissing feature
  15. Continuous integration on Liferay: running your Selenium 2 tests on the Tomcat 6 bundle
  16. Transforming the Web (through transformation)
  17. db.person.find( { “role” : “DBA” } ) : Java Code Geeks
  18. MariaDB adds NoSQL features to relational database roots — Tech News and Analysis
  19. Notes to students doing research about Agile
  20. Automated bug finding with git bisect and mvn test
  21. Learn To Build
  22. SSDs and MapReduce performance
  23. The Truth About MapReduce Performance on SSDs
  24. Big heads & Little heads
  25. Are integration tests worth the hassle?

Cloud

  1. New Instance Types for Amazon Elastic MapReduce
  2. PaaS or IaaS? Choosing a Platform in 2014
  3. Updates to Google BigQuery following Cloud Platform Live

Java

  1. Hibernate ORM 4.3.5.Final Released
  2. Spring Shell 1.1 RC1 Released
  3. Spring for Apache Hadoop 2.0 RC2 released
  4. Spring Tool Suite and Groovy/Grails Tool Suite 3.5.0 released
  5. First Milestone of Spring Data Release Train Dijkstra Available
  6. JAX-RS 2.0 : Custom Content Handling
  7. Java 8 Date Time API Tutorial : LocalDateTime
  8. Play Framework with Java 8
  9. What’s new in Spring Integration 4.0?
  10. Spring MVC Handler Mapping Example
  11. Spring MVC Test with WebDriver
  12. Hacking with Raspberry Pi and Java (The Java Source)
  13. Java 8’s Functional Fomentation
  14. JUnit ExpectedException rule: beyond basics
  15. Spring MVC Handler Interceptors Example
  16. Hibernate ORM JIRA Policies and Clean-Up Tactics
  17. What is JDBC RowSet ?
  18. When comparing Java 8 and Scala, be aware of these issues
  19. Java SE 8 Beyond Lambdas: The Big Picture
  20. Default methods an approach to extend legacy code

Scala

  1. Stackifier for Scala
  2. Spring-boot and Scala
  3. Specializing for primitive types
  4. Type Programming: Recursive types
  5. What is the Scala type-programming analogy for the this keyword?
  6. learning Scalaz
  7. scala type programming resources
  8. pathikrit/dijon · GitHub

Reading List 2014-April-02

Software development

  1. IAM Best Practices
  2. Every Great Product Owner Needs a Great ScrumMaster
  3. Manhattan, our real-time, multi-tenant distributed database for Twitter scale
  4. The Cache and Multithreading

Android

  1. Useful Tools for Android Apps Test Automation
  2. Fixing The Android Camera API

Java

  1. Apache Tomcat 7.0.53 Released
  2. Spring Boot 1.0 GA Released
  3. Java 8 Friday: Optional Will Remain an Option in Java
  4. Eclipse Foundation Announces Java 8 Support
  5. Method 2 of N for crashing your JVM :–)
  6. Abstract Class Versus Interface in the JDK 8 Era
  7. Add Java 8 support to Eclipse Kepler
  8. Difference between Stub and Mock object in Java Unit testing – JUnit
  9. Introduction to Nashorn

Scala

  1. IntelliJ, Scala and Gradle: Revisiting Hell
  2. Spring-boot and Scala

In Russian

  1. Новости Большого адронного коллайдера
  2. Одиночное рождение топ-кварка позволило еще тщательнее проверить Стандартную модель