When you do have money, the money gives you power… because you don’t have to answer to anybody. - Ben Mallah
It is not the employer who pays the wages. Employers only handle the money. It is the customer who pays the wages. - Henry Ford
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).
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:
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’
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.
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):
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 forms are challenging for users because we often ask them to enter complex strings which they are usually not allowed to see. Additionally, 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 add visual queues to a form that will allow users to get a better experience with passwords.
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 { // .