07 December 2020

API Integrations Summary

The concept of API integrations is broad. This must consider a function and non-functional requirements (today called quality attributes).

There several ways to integrate to an API


One way that integrating with third-party, or partner, APIs can be easier is by using a client or SDK. API clients handle much of the overhead when interacting with an API. They can handle common tasks like:

  • Authentication
  • Error handling
  • Encoding requests and parsing responses
  • Simplifying requests
  • Offering a better user experience than direct usage
  1. API integration of workflow !
  2. different user story --> workflows !


Track performance

The work isn’t over once you set up your API integrations. While we all would like to “set and forget” an integration, the truth is that any dependency is also a liability. You can start by monitoring your API usage. Specifically, here are the metrics we think are the most important:

  •     Latency
  •     Response Time
  •     Availability
  •     Consumption
  •     Failure Rate
  •     Status Codes

 

  1. https://blog.cloud-elements.com/10-step-guide-designing-api-integration
  2. https://www.infoq.com/articles/api-first-integration/
  3. https://blog.bearer.sh/api-integration-best-practices/




Modern C for Absolute Beginners

Technical proofed/reviewed:

Modern C for Absolute Beginners
A Friendly Introduction to the C Programming Language

https://www.apress.com/gp/book/9781484266427


Authors: Dmitrovic, Slobodan



05 December 2020

Posix Threads C11

simple example of Posix threads in C11, which doesn't have impl in gcc/clang. Remember to use -pthread as argument.

03 December 2020

Beginning C 6th edition

I am proud to participate as co-author in Beginning C - From Beginner to Pro, 6th Edition, press 2020.

https://www.apress.com/de/book/9781484259757

Beginning C

From Beginner to Pro - 6th Edition

Authors: Gonzalez-Morris, German, Horton, Ivor
© 2020

 

05 November 2020

Apofenia

La apofenia (del griego ἀπό, apó, "separar, alejar", y φαίνειν, phaínein, "aparecer, manifestar(se) como fenómeno, fantasía") es la experiencia que consiste en ver patrones, conexiones o ambos en sucesos aleatorios o en datos sin sentido. 

Este término tiene acepciones diferentes en los ámbitos de la psicología y de la estadística, donde también suele utilizarse.[cita requerida]

https://es.wikipedia.org/wiki/Apofenia

 


Estadística

En estadística, la apofenia suele estar relacionada con un error de tipo I, que puede llevar a conclusiones falsas en una investigación. La probabilidad de encontrar una asociación espuria o casual entre dos variables, y creer erróneamente que se ha encontrado una asociación real, se incrementa cuando en lugar de aplicar el método científico se realiza el hackeo estadístico de una base de datos (P-hacking). Esta mala práctica consiste en jugar con una base de datos y relacionar la variable dependiente con todas las posibles variables independientes hasta encontrar una asociación estadísticamente significativa, sin haber establecido previamente un marco conceptual y una hipótesis de investigación que justifiquen por qué se van a estudiar estas relaciones.2​ La publicación de estos resultados en revistas científicas es una de las causas de la pérdida de credibilidad y reproducibilidad de la ciencia, lo que ha llevado a muchos científicos a realizar manifiestos de alerta.3​



30 October 2020

Sofisma

 

Del lat. sophisma, y este del gr. σόφισμα sóphisma.

1. m. Razón o argumento falso con apariencia de verdad.

 

23 October 2020

Java SIGBUS

 Core dump of a lack of space at /tmp

:S

Aborted (core dumped)
#
#   https://github.com/AdoptOpenJDK/openjdk-support/issues
# If you would like to submit a bug report, please visit:"
#
#  SIGBUS (0x7) at pc=0x00007f1240764eac, pid=6, tid=48#
# JRE version: OpenJDK Runtime Environment AdoptOpenJDK (11.0.8+10) (build 11.0.8+10)
# Java VM: OpenJDK 64-Bit Server VM AdoptOpenJDK (11.0.8+10, mixed mode, tiered, compressed oops, serial gc, linux-amd64)# C  [libc.so.6+0x18eeac]
# Problematic frame:
#
# Core dump will be written. Default location: /usr/app/core.6
#
# An error report file with more information is saved as:
# /usr/app/hs_err_pid6.log
#
# A fatal error has been detected by the Java Runtime Environment:
#

it is interesting that docker also has shared memory device configuration /dev/shm
through shm_size

https://efod.se/java-sigbus/

https://confluence.atlassian.com/confkb/java-vm-dies-with-sigbus-0x7-when-temp-directory-is-full-on-linux-815584538.html

https://bugs.freedesktop.org/show_bug.cgi?id=100432

https://buddy.works/docs/on-premises/solving-problems/shared-memory


Socket 101

 A connection between two computers uses a socket.





https://www.silabs.com/products/development-tools/software/micrium-os/micrium-tcp-ip-networking

http://personales.upv.es/rmartin/TcpIp/cap02s12.html

https://docs.oracle.com/javase/tutorial/networking/sockets/definition.html

https://cwiki.apache.org/confluence/display/HADOOP2/SocketTimeout

https://apur1e.wordpress.com/2018/03/23/299-tcp-ip-http-get-post/

https://en.wikipedia.org/wiki/Network_socket
 

15 October 2020

Gradle cheat sheet

 Despite my preference for Maven, here it is a quick list of gradle (6.x) commands:

In gradle 7 has removed several tasks, and replaced by implementation, runtimeOnly, testImplementation, and testRuntimeOnly.

├── gradle
│ └── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── settings.gradle
└── lib
 ├── build.gradle
 └── src
 ├── main
 │ └── java
 │ └── demo
 │ └── Library.java
 └── test
 └── java
 └── demo
 └── LibraryTest.java

1. basic build

gradle clean build

gradle assemble

gradle test

gradle init

2. eclipse java14 plugin

It has issues with wrapped gradle for older gradle (6.2--) gradle-wrapper.properties

Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7

plugins {
 id 'eclipse'
}

gradle cleanEclipse eclipse

3. tasks (list of possible task to execute)

./gradlew tasks

4. springboot 

gradle bootRun

5. version

./gradlew -version

6. sonarqube

plugins {
 id "org.sonarqube" version "3.0"
}

sonarqube {
 properties {
 property "sonar.sourceEncoding", "UTF-8"
 }
}

gradle sonarqube

7. debug/stacktrace

--stacktrace
--debug
--warning-mode=(all,fail,none,summary)

8. publish local maven

gradle publishToMavenLocal

available with:

apply plugin: 'maven-publish'

Another approach:

apply plugin: "maven"
group = "mygroupid"
version = "1.0.0"

repositories {
   mavenLocal()
}


$ gradle clean build install

 

9. skip test 

gradle build -x test

 

10. jar building

gradle jar

jar {
 manifest {
 attributes "Main-Class": "com.baeldung.fatjar.Application"
 }
 from {
 configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
 }
}


11. lombok

dependencies {
    compileOnly 'org.projectlombok:lombok:1.18.20'
    annotationProcessor 'org.projectlombok:lombok:1.18.20'
    
    testCompileOnly 'org.projectlombok:lombok:1.18.20'
    testAnnotationProcessor 'org.projectlombok:lombok:1.18.20'
}

12. dependencies

gradle dependencies
 

Blog Archive

Disclaimer

Qux