Blog

  • arduino-libsbc

    arduino-libsbc

    SBC, or low-complexity subband codec, is an audio subband codec specified by the Bluetooth Special Interest Group (SIG) for the Advanced Audio Distribution Profile (A2DP). SBC is a digital audio encoder and decoder used to transfer data to Bluetooth audio output devices like headphones or loudspeakers. It can also be used on the Internet. It was designed with Bluetooth bandwidth limitations and processing power in mind to obtain a reasonably good audio quality at medium bit rates with low computational complexity. As of A2DP version 1.3, the Low Complexity Subband Coding remains the default codec and its implementation is mandatory for devices supporting that profile, but vendors are free to add their own codecs to match their needs.

    The current implementation can be found as part of many other projects. Unfortunately I did not find any stand alone library with only the codec, so I decided to create this project and make it Arduino compliant.

    Installation

    For Arduino, you can download the library as zip and call include Library -> zip library. Or you can git clone this project into the Arduino libraries folder e.g. with

    cd  ~/Documents/Arduino/libraries
    git clone pschatzmann/arduino-libsbc.git
    

    This has the advantage that you can easily get the latest code updates by just executing the command git pull

    Documentation

    I recommend to use this library together with my Arduino Audio Tools.
    This is just one of many codecs that I have collected so far: Further details can be found in the Encoding and Decoding Wiki of the Audio Tools.
    Last but not least here is also a link to the official SBC documentation

    Visit original content creator repository
    https://github.com/pschatzmann/arduino-libsbc

  • unity-apptrackingtransparency

    App Tracking Transparency for Unity Plugin

    Overview

    This repository contains a plugin to support the App Tracking Transparency framework for iOS in Unity 3D.

    Introduced on iOS 14.0, Apple wants all developers that want to retrieve the IDFA for a user, to ask permission for it. If the user does not provide permission, an anonymous IDFA is provided instead (00000000-0000-0000-0000-000000000000)

    Starting from iOS 14.0, the API was made available for developers, but the restriction was not applied yet.

    Starting from iOS 14.5, Apple started enforcing this rule, so all users have to give their permission to obtain the IDFA.

    Configuration

    This plugin supports the following platforms:

    • iOS
    • tvOS (Experimental)

    Features

    • Support for iOS
    • Support for tvOS (Experimental)
    • Support to get the current App Tracking Transparency Status to get the IDFA
    • Support to request authorization for the IDFA
    • Editor implementation for the feature, imitating the native implementation.
    • Configurable automatic postprocessing, add required frameworks and required Info.plist entries

    Installation

    Current version is v0.7.0

    Here is a list of available options to install the plugin

    Unity Package Manager with Git URL

    Just add this line to the Packages/manifest.json file of your Unity Project:

    "dependencies": {
        "com.lupidan.unity-apptrackingtransparency": "https://github.com/lupidan/unity-apptrackingtransparency.git?path=/com.lupidan.unity-apptrackingtransparency#v0.7.0"
    }

    Unity Package File

    1. Download the most recent Unity package release here
    2. Import the downloaded Unity package in your app.

    Implementing the AppTrackingTransparency code

    Setup the manager

    To setup the plugin, you need to:

    1. Create the manager
    2. Update it in an Update method or similar update loop.

    You can create and update the component in a MonoBehaviour of your choice. The MonoBehaviour can be a dedicated one, just for this manager, or a MonoBehaviour containing other managers.

    Calling Update is required if you want to receive any asynchronous callbacks to be handled correctly inside Unity’s update loop.

    using AppTrackingTransparency;
    using AppTrackingTransparency.Common;
    
    ...
    
    public AppTrackingTransparencyHandler : MonoBehaviour
    {
        public IAppTrackingTransparencyManager AppTrackingTransparencyManager;
    
        private void Start()
        {
            if (AppTrackingTransparencyModule.IsSupported)
            {
                this.AppTrackingTransparencyManager = AppTrackingTransparencyModule.CreateManager();
            }
        }
    
        private void Update()
        {
            if (this.AppTrackingTransparencyManager != null)
            {
                this.AppTrackingTransparencyManager.Update();
            }
        }
    }
    

    Get the current tracking authorization status

    Initially, the value is not determined. After requesting authorization, it becomes either Denied or Authorized.

    this.AppTrackingTransparencyManager.TrackingAuthorizationStatus;
    

    Get the IDFA

    Starting from iOS 14.5, if the status is Authorized, you should get the user’s IDFA. Otherwise, you should get an anonymous IDFA (00000000-0000-0000-0000-000000000000) In previous iOS versions you should get the user’s IDFA.

    this.AppTrackingTransparencyManager.Idfa;
    

    Request tracking authorization

    You should request permission when the tracking authorization status is not determined.

    ⚠️ The callback won’t execute if you are not calling Update on the AppTrackingTransparencyManager. Make sure you are periodically calling Update on it.

    this.AppTrackingTransparencyManager.RequestTrackingAuthorization(authStatus =>
    {
        Debug.Log("Authorization status changed: " + authStatus);
    });
    

    Plugin configuration

    To access the plugin configuration just go to the menu present in Assets -> AppTrackingTransparency -> Configuration You should see a window like this:

    Configuration

    Editor manager status

    In this section you can control the current status of the editor implementation for the plugin.

    • Authorization Status: Current authorization status returned by the editor implementation
    • IDFA: Current IDFA value returned by the editor implementation when the status is Authorized.
    • Random IDFA: Generates a new random IDFA value
    • Reset status: Completely reset the status of the editor implementation, simulating the status after a fresh app install.

    iOS Build settings

    The plugin offers automated options for post-processing on iOS. The first time you modify the iOS Build Settings, settings are saved in:

    ProjectSettings/com.lupidan.unity-apptrackingtransparency/AppTrackingTransparencySettings.json

    ⚠️ This is a file you will want to commit to your repository, to keep your plugin configuration saved.

    This section allow you to configure what parts of the automatic post-processing you want to have for your project.

    • Automatic postprocessing: If enabled the automatic postprocessing for iOS will be run. If disabled, it will be completely ignored.
    • Postprocessing Callback Order: The order in which the postprocessing will be run. You can change the number so it works along other postprocessing scripts you may have in your project. The default value is 10.
    • Add AppTrackingTransparency.framework: If enabled, the automatic post-processing will automatically add the AppTrackingTrasnparency.framework as optional for compatibility with previous iOS versions.
    • Add NSUserTrackingUsageDescription: If enabled, the automatic post-processing will automatically add the required description to be displayed when requesting permission to the user.
    • Tracking Usage Description: String of text to be added as NSUserTrackingUsageDescription so it’s displayed to the user when requesting permission.
    • Auto-detect Info.plist file: The NSUserTrackingUsageDescription value needs to be added to the main target’s Info.plist file. When enabled, the auto post-processing will detect the current file and add the value in it. If disabled, you will have the option to specify the relative path for the Info.plist file you want to modify.

    Any code samples?

    There is a folder inside the plugin code containing some samples. You can also import the sample code into your project by going to the Unity Package Manager, selecting the packages In Project, and selecting the AppTrackingTransparency for Unity package. You should see an option to import a sample:

    Configuration

    Visit original content creator repository https://github.com/lupidan/unity-apptrackingtransparency
  • ONNX-YOLOv7-Object-Detection

    ONNX YOLOv7 Object Detection

    Python scripts performing object detection using the YOLOv7 model in ONNX.

    ! ONNX YOLOv7 Object Detection Original image: https://www.flickr.com/photos/nicolelee/19041780

    Important

    • The input images are directly resized to match the input size of the model. I skipped adding the pad to the input image, it might affect the accuracy of the model if the input image has a different aspect ratio compared to the input size of the model. Always try to get an input size with a ratio close to the input images you will use.

    Requirements

    • Check the requirements.txt file.
    • For ONNX, if you have a NVIDIA GPU, then install the onnxruntime-gpu, otherwise use the onnxruntime library.

    Installation

    git clone https://github.com/ibaiGorordo/ONNX-YOLOv7-Object-Detection.git
    cd ONNX-YOLOv7-Object-Detection
    pip install -r requirements.txt
    

    ONNX Runtime

    For Nvidia GPU computers: pip install onnxruntime-gpu

    Otherwise: pip install onnxruntime

    ONNX model

    The original models were converted to different formats (including .onnx) by PINTO0309. Download the models from his repository. For that, you can either run the download_single_batch.sh or copy the google drive link inside that script in your browser to manually download the file. Then, extract and copy the downloaded onnx models (for example yolov7-tiny_480x640.onnx) to your models directory, and fix the file name in the python scripts accordingly.

    • The License of the models is GPL-3.0 license: License

    Original YOLOv7 model

    The original YOLOv7 model can be found in this repository: YOLOv7 Repository

    Examples

    • Image inference:
    python image_object_detection.py
    
    • Webcam inference:
    python webcam_object_detection.py
    
    python video_object_detection.py
    

    !YOLOv7 detection video

    Original video: https://youtu.be/zPre8MgmcHY

    python comparison_with_yolov5_v6.py
    

    !YOLOv7 Vs YOLOv5 detection video !YOLOv7 Vs YOLOv6 detection video Original video: https://youtu.be/zPre8MgmcHY

    • Replace the yolov5_v6_path with the actual path to the YOLOv5 or YOLOv6 model.
    • Convert YOLOv5 model to ONNX Open In Colab
    • Convert YOLOv6 model to ONNX Open In Colab

    References:

    Visit original content creator repository https://github.com/ibaiGorordo/ONNX-YOLOv7-Object-Detection
  • ONNX-YOLOv7-Object-Detection

    ONNX YOLOv7 Object Detection

    Python scripts performing object detection using the YOLOv7 model in ONNX.

    ! ONNX YOLOv7 Object Detection Original image: https://www.flickr.com/photos/nicolelee/19041780

    Important

    • The input images are directly resized to match the input size of the model. I skipped adding the pad to the input image, it might affect the accuracy of the model if the input image has a different aspect ratio compared to the input size of the model. Always try to get an input size with a ratio close to the input images you will use.

    Requirements

    • Check the requirements.txt file.
    • For ONNX, if you have a NVIDIA GPU, then install the onnxruntime-gpu, otherwise use the onnxruntime library.

    Installation

    git clone https://github.com/ibaiGorordo/ONNX-YOLOv7-Object-Detection.git
    cd ONNX-YOLOv7-Object-Detection
    pip install -r requirements.txt
    

    ONNX Runtime

    For Nvidia GPU computers: pip install onnxruntime-gpu

    Otherwise: pip install onnxruntime

    ONNX model

    The original models were converted to different formats (including .onnx) by PINTO0309. Download the models from his repository. For that, you can either run the download_single_batch.sh or copy the google drive link inside that script in your browser to manually download the file. Then, extract and copy the downloaded onnx models (for example yolov7-tiny_480x640.onnx) to your models directory, and fix the file name in the python scripts accordingly.

    • The License of the models is GPL-3.0 license: License

    Original YOLOv7 model

    The original YOLOv7 model can be found in this repository: YOLOv7 Repository

    Examples

    • Image inference:
    python image_object_detection.py
    
    • Webcam inference:
    python webcam_object_detection.py
    
    python video_object_detection.py
    

    !YOLOv7 detection video

    Original video: https://youtu.be/zPre8MgmcHY

    python comparison_with_yolov5_v6.py
    

    !YOLOv7 Vs YOLOv5 detection video !YOLOv7 Vs YOLOv6 detection video Original video: https://youtu.be/zPre8MgmcHY

    • Replace the yolov5_v6_path with the actual path to the YOLOv5 or YOLOv6 model.
    • Convert YOLOv5 model to ONNX Open In Colab
    • Convert YOLOv6 model to ONNX Open In Colab

    References:

    Visit original content creator repository https://github.com/ibaiGorordo/ONNX-YOLOv7-Object-Detection
  • querydsl-object-binder

    QueryDsl Object Binder

    Lib for bind/aggregate/group QueryDsl results in multiple level objects.

    What is QueryDsl

    QueryDsl is a framework for JPA/Java to write queries with generated QType objects. A plugin read your JPA entities and generates these files.

    Problem to solve

    A frequently task in development queries is aggregate a query result into related objects, that may be into entity objects or other objects, like DTO and object values.

    QueryDsl has a functionality to aggregate a result into a parent and children objects, documented in http://www.querydsl.com/static/querydsl/latest/reference/html/ch03s02.html.

    In “3.2.4. Result aggregation” section, a query example with posts and comments is presented. But QueryDsl not provide a way to aggregate objects with more deep children levels, like explaned in https://stackoverflow.com/questions/59655149/querydsl-multilevel-result-aggregation.

    A similar question in QueryDsl mailing https://groups.google.com/g/querydsl/c/DqkGu-6128I/m/jnOUWinWAwAJ. The answer in 2015 is “Querydsl group by projection doesn’t yet fully support multiple levels”. A issue with this problem also still open on github: querydsl/querydsl#1794.

    There is no way to deal with a query like:

    List<City> cities = query.from(_city)
    		.join(_city.state, _state)
    		.join(_state.country, _country)
    		//some way to select fields and bind/groupby/aggregate values in multiple object levels
    		;

    Sometimes we need this result in a object-structure like:

    public class City {
    
        private Long id;       
        private String name;
        
        private State state;
    }
    
    public class State {
    
        private Long id;
        private String name;
     
        private Country country;
    }
    
    public class Country {
    
        private Long id;    
        private String name;
        
        private List<State> states;
    }

    I researched for a solution or way to solve this need, but seemingly no exist a way to do this only with Querydsl/Spring JPA. Without the approach below, the problem could be solved manually managing these results or making separated queries.

    Solution

    This lib offers a way to convert/bind/aggregate QueryDsl results into objects with n children levels. See a example below:

    JPAQuery<Tuple> query = new JPAQuery<Tuple>(em);
    
    query.from(_city)
    		.join(_city.state, _state)
    		.join(_state.country, _country);
    
    List<Tuple> tupleResult = query.select(_city.id, _city.name,
    		_state.id, _state.name,
    		_country.id, _country.name).orderBy(_city.id.asc()).fetch();
    
    List<City> cities = QueryDslBinder.to(tupleResult, City.class,
    		new GroupByBinder()
    			.key("id", _city.id).
    			field("name", _city.name)
    			.single("state", new GroupByBinder()
    					.key("id", _state.id)
    					.field("name", _state.name)
    					.single("country", new GroupByBinder()
    							.key("id", _country.id)
    							.field("name", _country.name)					
    							.collection("states", new GroupByBinder()
    									.key("id", _state.id)))));

    The method QueryDslBinder.to convert a list of querydsl tuple into desired list of City objects. The third parameter is the bind specification, where “key” and “field” properties inside class City are associated with respective querydsl expression used in select statement. Can be specified more than one “keys” for composite keys, “fields”, “single” relations and “collection” relations in any level.

    When we want a grouping, like State on class City, we specify a “single” object with the field name on class City, and specify your fields.

    When we want a grouping list, like the object Country with a list of States, we specify a “collection” and their fields. In example case, a state and your fields are already specified on parent, so “states” attribute of country will contain a list of States with fields id and name already filled, althought field “name” was not specified at this moment. Objects will have the same reference memory. Objects are instanciated only one time, according with specified “key” and type class that belongs.

    With this lib, a result can be aggregated with any children level, in different manners. Children with backward parent reference, with each object and your unique key will have only one and same reference.

    A complete working automation test can be found in file QuerySqlBinderIntegrationTest.java, that run with Spring Boot, JPA, QueryDsl and H2 database. This code demonstrate a simple example, but this lib was used in many queries in private company project, supporting a variety of queries and needs.

    Visit original content creator repository
    https://github.com/zisluiz/querydsl-object-binder

  • ClusterRunner

    Project Status Build Status Build status Coverage Status

    ClusterRunner

    ClusterRunner makes it easy to execute test suites across your infrastructure in the fastest and most efficient way possible.

    By using ClusterRunner in your testing pipeline, you will be able to easily:

    • Make long-running, single-threaded test jobs run in parallel.
    • Consistently utilize 100% of your testing infrastructure.
    • Get test feedback faster.
    • Completely isolate tests from each other, avoiding nasty global state.

    The entire process of installing, initializing, and executing tests through ClusterRunner should take about 8 minutes!

    Give it a shot by starting at our documentation site.

    Read the Docs

    You can find all our official documentation at clusterrunner.com.

    For a quick visual overview, check out the infographic we presented at the PyCon 2015 poster session:

    Visualize

    ClusterRunner currently has no built-in UI, but its extensive API allows you to create detailed dashboards so you can monitor your cluster and see what it’s doing.

    We’ve open-sourced a few of the dashboards we use internally at Box for monitoring our own clusters. Check out the ClusterRunner-Dashboard repo for the code and documentation.

    Contribute

    We ❤️ external contributors! You can run ClusterRunner entirely locally and it has a comprehensive functional test suite, so it’s easy to get started. Take a look at our open issues to get an idea of where you can help out.

    Get Help

    We’re happy to answer any questions you have around setting up ClusterRunner in your own org. Create a new issue on this repo, or email oss@box.com and be sure to include “ClusterRunner” in the subject.

    Copyright and License

    Copyright 2014 Box, Inc. All rights reserved.

    Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

    Visit original content creator repository https://github.com/box/ClusterRunner
  • Macaw-Examples

         

    Macaw-Examples

    Macaw Examples is a place where you can find various usages of the Macaw library.

    Launching Example

    • clone the repo git@github.com:exyte/Macaw-Examples.git
    • open terminal and run cd <MacawExamplesRepo>/{ExampleName}/
    • run pod install to install all dependencies
    • run open {ExampleName}.xcworkspace/ to open project in the Xcode

    Examples

    GettingStarted

    A simple application with animated bar charts. Step by step tutorial is presented on the Getting Started wiki page.

    HealthStat

    Activity Monitor app concept shows number of steps, running level and daily summary.

    PeriodicTable

    Do you like chemistry? This iPad application shows full power of Macaw: affine transformations, user events, animation and various effects.

    DesignAwardedApps

    Recreating Auxy, Streaks and Zova interfaces with Macaw.

    LiquidSwipe

    Liquid Swipe concept showing amination with smooth tranformation for forward and backward swiping. Inspired with Cuberto’s framework.

    FanMenu

    FanMenu – an animated circular menu control.

    Requirements

    • iOS 8.0+ / Mac OS X 10.9+
    • Xcode 8.0+

    License

    Macaw Examples are available under the MIT license. See the LICENSE file for more info.

    Visit original content creator repository https://github.com/exyte/Macaw-Examples
  • Macaw-Examples

         

    Macaw-Examples

    Macaw Examples is a place where you can find various usages of the Macaw library.

    Launching Example

    • clone the repo git@github.com:exyte/Macaw-Examples.git
    • open terminal and run cd <MacawExamplesRepo>/{ExampleName}/
    • run pod install to install all dependencies
    • run open {ExampleName}.xcworkspace/ to open project in the Xcode

    Examples

    GettingStarted

    A simple application with animated bar charts. Step by step tutorial is presented on the Getting Started wiki page.

    HealthStat

    Activity Monitor app concept shows number of steps, running level and daily summary.

    PeriodicTable

    Do you like chemistry? This iPad application shows full power of Macaw: affine transformations, user events, animation and various effects.

    DesignAwardedApps

    Recreating Auxy, Streaks and Zova interfaces with Macaw.

    LiquidSwipe

    Liquid Swipe concept showing amination with smooth tranformation for forward and backward swiping. Inspired with Cuberto’s framework.

    FanMenu

    FanMenu – an animated circular menu control.

    Requirements

    • iOS 8.0+ / Mac OS X 10.9+
    • Xcode 8.0+

    License

    Macaw Examples are available under the MIT license. See the LICENSE file for more info.

    Visit original content creator repository https://github.com/exyte/Macaw-Examples
  • Project_3

    Visit original content creator repository
    https://github.com/rajib1007/Project_3

  • golangsignedbins

    golangsignedbins

    Motivation

    The motivation for this project stems from the crucial need to ensure the integrity and authenticity of binaries in software distribution and deployment. In the realm of Go (Golang) development, the security of executable binaries is paramount, especially when distributing them over networks or deploying them in various environments. This repository provides a high-level solution for signing and verifying Go binaries using RSA digital signatures, a method to confirm that binaries have not been tampered with and are indeed from a trusted source. The codebase covers key aspects such as generating RSA keys, signing binaries with a private key, and verifying those signatures with the corresponding public key. These practices are essential for any developer looking to enhance the security posture of their Go applications, ensuring that the binaries remain secure and trustworthy throughout their lifecycle.

    Process

    Signing a binary in Go (or any other language) typically involves creating a hash of the binary file and then encrypting this hash with a private key. The encrypted hash constitutes the digital signature.

    Here’s a step-by-step guide and companion article on how to sign a Go binary: Golang: Verifying Application Integrity by Signing Binaries

    Repository

    git clone git@github.com:mwiater/golangsignedbins.git

    cd golangsignedbins

    go mod tidy

    Setup Heartbeat Test Application

    1. Build the heartbeat binary

    Execute before compiling:

    go run heartbeat/heartbeat.go

    2023-11-19T23:31:58Z Heartbeat...
    2023-11-19T23:32:03Z Heartbeat...
    2023-11-19T23:32:08Z Heartbeat...
    2023-11-19T23:32:13Z Heartbeat...
    2023-11-19T23:32:18Z Heartbeat...
    2023-11-19T23:32:23Z Heartbeat...
    

    Build:

    go build -o heartbeat/bin/heartbeat ./heartbeat

    Execute binary:

    ./heartbeat/bin/heartbeat

    Signing the Binary

    1. Generate a Private/Public Key Pair

    Generate a RSA private/public key pair using OpenSSL:

    openssl genpkey -algorithm RSA -out ./keys/private_key.pem
    openssl rsa -pubout -in ./keys/private_key.pem -out ./keys/public_key.pem

    This will create a ./keys/private_key.pem and ./keys/public_key.pem file.

    2. Sign the Binary

    Run: go run signer/signer.go

    This will sign the binary by creating and saving the signature file: ./signatures/heartbeat.sig

    3. Verify and Run the Binary

    Run: go run runner/runner.go

    This will verify the signed binary using the ./signatures/heartbeat.sig file and run the signed and verified binary.

    3. Tamper and Fail

    To check for an invalid binary, I’ve included a file to modify the binary after signing. To see the results, after signing the binary, add some extra data to the binary and try running it again:

    1. Run: go run signer/signer.go
    2. Run: go run tamper/tamper.go
    3. Run: go run runner/runner.go

    This will now fail with the error message: [Error] verify signature: crypto/rsa: verification error

    To bring the signed binary back to a valid state, just run this again: go run signer/signer.go

    Testing

    go test ./common/common.go ./common/common_test.go

    ok      command-line-arguments  0.038s
    

    Visit original content creator repository
    https://github.com/mwiater/golangsignedbins