Chariot’s Tech Blog

Page 1 of 25123451020Last »

Posted on Mar 21, 2016 by

Sending Mail via GMail with JavaMail

If you use JavaMail and/or the Spring MailSender bean to send mail through a GMail account with JavaMail these days, you get an authentication error saying GMail blocks less secure apps. At that point there are two options: Configure your GMail account to accept low-security connections (e.g. https://www.google.com/settings/security/lesssecureapps) Configure your JavaMail sender to use OAuth […]

Tags:, ,

View post

Posted on Mar 14, 2016 by

SBT: Group annotated tests to run in forked JVMs

SbtTestGrouping Running tests that use a HiveContext On our current project, we utilize Spark SQL and have several ScalaTest based suites which require a SparkContext and HiveContext. These are started before a suite runs and shut down after it completes via the BeforeAfterAll mixin trait. Unfortunately due to this bug (also see this related pull […]

Tags:, , ,

View post

Posted on Mar 14, 2016 by

Slick 3.1.0, Oracle 11g, and UUID columns

SlickUUIDs UUIDs to the rescue I recently decided to change our primary key strategy from an auto-incrementing Long to UUID (aka globally unique IDs). Early on in a project, this should be a relatively simple refactoring (neither the software nor any data has been released yet). First of all and most importantly, UUIDs provide uniqueness […]

Tags:, , ,

View post

Posted on Mar 14, 2016 by

Binding custom types in plain SQL queries in Slick

Hierarchical Queries Hierarchical Queries and Oracle Not everything is as fun as the first time you discover the power of monads and for-comprehensions, or realize the state machine you wrote with pattern matching is super easy to read and follow! Some days its business as usual, which as a software developer means you’re usually trying […]

Tags:, , , ,

View post

Posted on Feb 28, 2016 by

Testing Angular 2 Components with Unit Tests and the TestComponentBuilder

Testing Components In my last post, I discussed how to write tests in Angular 2 based on the new angular-testing API. We learned how to stand up a test and use the test injector, and how to mock the network requests to the Http service using the MockBackend. In this post, we'll learn how to […]

Tags:, , ,

View post

Posted on Feb 01, 2016 by

Sensu: Finally the Nagios Replacement I Have Been Looking For!

Nagios, the popular open source system and networking monitoring service, is awesome. It gives you so much flexibility that expensive commercial software like Solarwinds and Spiceworks just doesn't have. However after I moved my infrastructure to Chef, Nagios was constantly giving me issues. The configuration scheme just doesn't fit well in an autonomous environment. In this blog article I review how I found a replacement for Nagios,

Tags:, , ,

View post

Posted on Jan 19, 2016 by

Using java.time with ResultSet and PreparedStatement

John Shepard shows us how to use the java.time API in Java 8. While not absolutely complete, and improvements seem to be on deck for Java 9 and 10, there is support for the new time API.

Tags:, , ,

View post

Posted on Jan 09, 2016 by

Testing Http Services in Angular 2 with Jasmine

Right now it's hard to find samples of tests against Angular 2 observable Http code for developers in the current beta. Some of the things you have to watch out for are non-obvious. I expect this will improve vastly over time, but for now hopefully you'll get some working code samples from me to get you going. This post will show you how it's done.

Tags:, ,

View post

Posted on Jan 04, 2016 by

Making a Java SafeString that works with all unicode characters

In Java, there is an issue with String when using characters that take up more than 2 bytes in UTF-16. substring() and similar methods can split the character in the middle. I was thinking switching Strings to UTF-8 might be good, and there are currently two JEPs for Java 9 somewhat related to this. 226: UTF-8 Property Files and 254: Compact Strings. But thinking about this a little more, I don't necessarily want a UTF-8 String class, but a String class that works with all unicode characters. Here's how I did it.

Tags:, ,

View post

Posted on Dec 21, 2015 by

Angular 2 Beta 0 (somnambulant-inauguration) lands – Small App with Rxjs, TypeScript

Now that sonambulent-inauguration, properly known as Angular 2.0.0-beta.0, has dropped, let's see what the public API is shaping up to be. We'll review how to create a component from the application bootstrap, using the Http API to fetch a JSON object from HTTP, and see how the template API has changed now that we have to use camelCased property names.

Tags:, , , ,

View post
Page 1 of 25123451020Last »