Static analysis with Infer

Infer is a Java and C-family static analysis tool with the ability to identify potential memory leaks in code, null pointers and thread safety whilst being easy to extend.

run_infer.shhello-world
1
2
3
4
5

$ infer run -- gcc -c app.c
app.c:5: error: NULL_DEREFERENCE
pointer s last assigned on line 4 could be null and is dereferenced at line 5, column 10

Updating Docker Containers with Ouroboros

Ouroboros is an automation engine that updates running Docker containers with the latest image from a specified contaner registry.

The updated containers will preserve all parameters and tags as the previously run container.

docker-compose.ymldocker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
version: '3'
services:
ouroboros:
container_name: ouroboros
hostname: ouroboros
image: pyouroboros/ouroboros
environment:
- CLEANUP=true
- INTERVAL=300
- LOG_LEVEL=info
- SELF_UPDATE=true
- IGNORE=mongo influxdb postgres mariadb
- TZ=America/Chicago
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock

Testing with Catch2

C++ Automated Test Cases in a Header - Catch2 - is a C++ test framework with support for C and Objective-C distributed as a single header file.

Catch2 is extremely portable with no external dependencies.

mytest.cc010-TestCase.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
#define CATCH_CONFIG_MAIN  // This tells Catch to provide a main() - only do this in one cpp file
#include "catch.hpp"

unsigned int Factorial( unsigned int number ) {
return number <= 1 ? number : Factorial(number-1)*number;
}

TEST_CASE( "Factorials are computed", "[factorial]" ) {
REQUIRE( Factorial(1) == 1 );
REQUIRE( Factorial(2) == 2 );
REQUIRE( Factorial(3) == 6 );
REQUIRE( Factorial(10) == 3628800 );
}

Buck

Buck is a flexible and a highly configurable build system aimed at speeding up build times by creating small reusable modules.

Buck uses Python to generate build targets.

.buckconfigandroid_resource
1
2
3
4
5
6
7
8
9
android_resource(
name = 'newsfeed-res',
package = 'com.facebook',
res = 'my-res-dir',
deps = [
'//res/com/facebook/comments:res',
'//res/com/facebook/story:res',
],
)

Building with Gradle

Gradle is build automation tool known for its fast dependency resolution, fast build-times and scalability.

Gradle is very extensible and offers support for popular programming languages besides being the official Android build tool.

build.gradlebuild.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
tasks.register("hello") {
doLast {
println("Hello world!")
}
}
tasks.register("intro") {
dependsOn("hello")
doLast {
println("I'm Gradle")
}
}
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×