chart.js in Angular

setupDurationGraphOptions() {
        this.durationChartOptions = {
            indexAxis: "y",
            scales: {
                x: {
                    ticks: {
                        callback: (param) => {
                            return this.convertSeconds(param);
                        },
                    },
                },
            },
            plugins: {
                tooltip: {
                    enabled: true,
                    callbacks: {
                        label: (tooltipItem) => {
                            return this.convertSeconds(tooltipItem.raw);
                        },
                    },
                },
            },
        };
    }

Védett: Node-red workflow

Ez a tartalom jelszóval védett. Megtekintéséhez meg kell adni a jelszót:

Kategória: DEV, Tool | A hozzászólások megtekintéséhez meg kell adni a jelszót.

Merge Multiple date ranges in SQL

WITH ftable as  (
SELECT * FROM faults
WHERE 
stop > CAST('2022-04-11' AS DATETIME) AND start < CAST('2022-05-17' AS DATETIME)
)
WITH ftable as  (
SELECT start, IFNULL(stop,NOW()) as stop FROM faults
WHERE 
(stop > CAST('2022-04-11' AS DATETIME) 
-- If you need with not-ending uncomment this 2 lines
-- OR stop is NULL
) AND start < CAST('2022-05-17' AS DATETIME)
)

SELECT  GREATEST(s1.start, CAST('2022-04-11' AS DATETIME)) as start,
   LEAST(min(t1.stop),CAST('2022-05-17' AS DATETIME)) as stop
FROM ftable s1 
INNER JOIN ftable t1 ON s1.start<= IFNULL(t1.stop, NOW())
  AND NOT EXISTS(SELECT * FROM ftable t2 
                 WHERE IFNULL(t1.stop, NOW()) >= t2.start AND IFNULL(t1.stop, NOW()) < IFNULL(t2.stop, NOW())) 
WHERE NOT EXISTS(SELECT * FROM ftable s2 
                 WHERE s1.start> s2.start AND s1.start<= IFNULL(s2.stop, NOW()))
GROUP BY s1.start
ORDER BY s1.start 

Védett: Json leaf in path

Ez a tartalom jelszóval védett. Megtekintéséhez meg kell adni a jelszót:

Kategória: DEV | A hozzászólások megtekintéséhez meg kell adni a jelszót.

Batch errorhandling

Talán ez a jó cikk magyarázatnak. Átalakítottam végül a programom.

https://stackoverflow.com/questions/1164049/batch-files-error-handling

IF [%1]==[] GOTO BLANK
IF [%1]==[/?] GOTO BLANK
IF /I "%1"=="api" GOTO API
IF /I "%1"=="train" GOTO TRAIN

:BLANK
ECHO "Usage: cfpushing [ api | train ]"
EXIT /B

:API
CALL :BGCHANGE greenapi to blueapi copyfolder
IF /I "%ERRORLEVEL%" EQU "2" (
    CALL :BGCHANGE blueapi to greenapi copyfolder
    IF /I "%ERRORLEVEL%" EQU "2" (
        XCOPY /R /E /Y origin copyfolder\origin\
        cf push -f blueapi.yml
        RMDIR /S /Q copyfolder\origin\
    )
)
GOTO FINISH

:BGCHANGE
echo %1 to %3 with %~4

cf app %~1 | grep running
IF /I "%ERRORLEVEL%" EQU "0" (
    XCOPY /R /E /Y origin %~4\origin\
    cf push -f %3.yml || (
        RMDIR /S /Q %~4\origin 
        ECHO Error in pushing
        EXIT /B 1
    )
    RMDIR /S /Q %~4\origin 
    cf stop %~1
    EXIT /B 0
)
EXIT /B 2

:FINISH
ECHO "PUSHED"

SpringBoot2.0 Kotlin build.gradle IntelliJ IDEA

buildscript {
ext {
kotlinVersion = ‘1.2.70’
springBootVersion = ‘2.0.5.RELEASE’
}
repositories {
mavenCentral()
}
dependencies {
classpath(„org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}”)
classpath(„org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.70”)
classpath(„org.jetbrains.kotlin:kotlin-allopen:${kotlinVersion}”)
}
}

apply plugin: ‘kotlin’
apply plugin: ‘kotlin-spring’
apply plugin: ‘org.springframework.boot’
apply plugin: ‘io.spring.dependency-management’
group ‘home’
version ‘1.0-SNAPSHOT’

repositories {
mavenCentral()
}

dependencies {
compile(‘org.springframework.boot:spring-boot-starter-web’)
compile(„org.jetbrains.kotlin:kotlin-stdlib-jdk8”)
compile(„org.jetbrains.kotlin:kotlin-reflect”)
testCompile(‘org.springframework.boot:spring-boot-starter-test’)
}

sourceCompatibility = 1.8
compileKotlin {
kotlinOptions {
freeCompilerArgs = [„-Xjsr305=strict”]
jvmTarget = „1.8”
}
}
compileTestKotlin {
kotlinOptions {
freeCompilerArgs = [„-Xjsr305=strict”]
jvmTarget = „1.8”
}
}