Who pays wages?

It is not the employer who pays the wages. Employers only handle the money. It is the customer who pays the wages. - Henry Ford

Error handling for JS fetch requests

The following example handles server and connectivity errors for javascript fetch requests. function handleErrors(response) { if (!response.ok) throw new Error(response.status) return response } fetch('https://jsonplaceholder.typicode.com/todos/1') // handle network err/success .then(handleErrors) // use response of network on fetch Promise resolve .then(response => console.log("ok")) // handle fetch Promise error .catch(error => console.log('found an error: ', error)) handleErrors can be updated for handling different types of errors in different ways. This function is called whenever we get a response from the server (successful or failed).

A purely functional example using Scala

On this tutorial we’re going to explore the basics of purely functional programming using Scala. One of the principles with purely functional style, is that we have to define concepts in terms of functions. The basics: Comparing a number We’re going to create a simple function that lets us compare a number to a previously stored number in a purely functional way. For that, we can define the following function:

Examples of ‘for’ queries with Scala

On this page you are going to find some examples of ‘for’ queries. Let’s start by defining the following database: case class Book(title: String, authors: List[String]) val books: List[Book] = List( Book("structure and interpretation of computer programs", List("abelson, harald", "sussman, gerald j.")), Book("introduction to functional programming", List("bird, richard", "wadler, phil")), Book("effective java", List("bloch, joshua")), Book("java puzzlers", List("bloch, joshua", "gafter, neal")), Book("programming in scala", List("odersky, martin", "spoon, lex", "venners, bill")) ) Find the titles of books whose author’s name is ‘bird’

Enterprise Architect – Synchronize model from a live database

Synchronize a model from a live database to Enterprise Architect. Select your database from the Database Model folder in Project Browser. Go to Tools > Database Builder Right click on Tables > Show Differences. We can also click on a different type of object. a. An active connection is needed to complete the previous step. If no one exists Enterprise Architect will ask us to create one. The list of differences will show up on the Database Compare tab Select the ones you want to import or click the Set Import All button.

Running Pentaho Data Integration on Mac OSX

Run Pentaho Data Integration on Mac OSX. The following procedure works with all the latest OSX versions. My local configuration OSX Mojave OpenJDK 11 Procedure Download pdi-ce-8.1.0.0-365.zip from https://sourceforge.net/projects/pentaho/ Unzip it Using the terminal, cd into the unzipped directory Run the application open Data\ Integration.app If you get the following error: LSOpenURLsWithRole() failed with error -10810 for the file Data Integration.app then run the following command (it is permissions related):

PlayFramework – Java

So far I have really liked this concept. The only con is that some times is difficult to find full examples that use the latest version. Installing sbt We need sbt for compiling and running Play applications. brew install sbt@1 Executing a first application Check the tutorials page to see how to create a first project. Pretty much: sbt new playframework/play-java-seed.g8 sbt run And then visit localhost:9000 Play 2.

Password Requirements Validation with JQuery

Password screens are challenging for users because we often ask them to enter complex strings which most times are not even able to see. Adding to it, these strings have to meet different criteria – like having upper and lower case characters, numbers and so on – to keep our applications secure. In this post, we are going to improve a screen with visual queues that will allow users to get a better experience with passwords.

How to run a custom update using Java JPA

From time to time it is necessary to execute a query without using Java’s JPA infrastructure. In order to do it, we have to define a NamedQuery to execute. In this example, I will run an update against the database. @Entity @NamedQueries ({ @NamedQuery ( name = "SomeEntity.TestQuery", query = "update SomeEntity se set se.myField = '' where se.id = 0" ) }) public class SomeEntity implements Serializable { // .

Quick lessons on working with Java’s BigDecimal

Today I bring an example of the different results you can expect when using Java’s BigDecimal class. From instantiation to applying different arithmetic operations, it is important to understand how they affect the resulting instances. The following program shows different scenarios and results applied to BigDecimal’s. package test; import java.math.BigDecimal; import java.math.RoundingMode; public class Test { public static void main(String[] args) { BigDecimal a = new BigDecimal("1.204165"); System.out.println("a (from string): " + a); a = new BigDecimal(1); System.