Category: Blog

  • instaSafe

    instaSAFE

    A decentralized insurance system where all users can receive payments instantly after a cyclone strikes without having to contact centralized companies and obtain confirmation of funds directly into your wallet.

    gg2

    Team Members

    • Hritwik Tripathi (LIT2019012)
    • Vineet Kumar (LIT2019032)
    • Mayank Verma (LIT2019038)
    • Gautam Patodi (LIT2019019)
    • Vaibhav Ekka (LCS2019030)

    Technology Stack:

    • Frontend: ReactJs
    • Oracle: ChainLink
    • Login: Metamask/Portis
    • Smart Contracts Framework: Hardhat
    • Premium Streaming: SuperFluid
    • Deployment: Görli/Goerli Testnet(Ethereum)
    • API development: Express and Nodejs

    What we Provide:

    Apply for insurance against cyclones and hurricanes through our app using your permanent location. Connect your MetaMask/ Portis wallet to our site The Chainlink oracles connected to the OpenWeatherAPI fetch the climate conditions of your permanent location and decide the premium amount SuperFluid starts streaming premium amount to us from your wallet To opt out, you can stop the stream Chainlink Alarm Clock schedules weekly checks to check if you are eligible for a payout Chainlink oracles fetch the current weather conditions for each active user A fixed amount in DAI is paid to the users eligible.

    Run(Steps)

    • Clone this repository
    • cd frontend
    • Install dependencies: yarn install
    • Run the React app: npm start
    • Just make sure you are connected to Görli/Goerli Testnet
    • More detailed walkthrough given in report.

    ScreenShots

    gg1

    Visit original content creator repository https://github.com/IIITL-DeV/instaSafe
  • TrackNet

    TrackNet

    Pytorch implementation based on TrackNetv2.


    Supported logging options:

    Installation

    git clone https://github.com/mareksubocz/TrackNet
    cd /TrackNet
    pip install -r requirements.txt
    

    Training

    python train.py --dataset PATH_TO_DATASET --device cuda
    

    Prediction

    python predict.py PATH_TO_VIDEO --weights PATH_TO_TRAINED_WEIGHTS --device cuda
    

    Dataset Labelling

    Keybindings:

    • l / : next frame
    • h / : previous frame
    • v : annotate well-visible ball
    • o : annotate occluded ball
    • m : annotate ball in motion (blurred)
    • f : fast-forward/pause video
    • n : go to next annotated frame
    • x : remove annotation
    • = / + : enlarge the annotation mark size
    • - : reduce the annotation mark size
    • q : finish annotating and save results
    python labellingTool.py video.mp4
    

    animated

    Labelling tool in use. Fast-forward function is distorted due to gif compression.

    train.py Parameters cheatsheet

    Argument name Type Default value Description
    weights str None Path to initial weights the model should be loaded with. If not specified, the model will be initialized with random weights.
    checkpoint str None Path to a checkpoint, chekpoint differs from weights by to including information about current loss, epoch and optimizer state.
    batch_size int 2 Batch size of the training dataset.
    val_batch_size int 1 Batch size of the validation dataset.
    shuffle bool True Should the dataset be shuffled before training?
    epochs int 10 Number of epochs.
    train_size float 0.8 Training dataset size.
    lr float 0.01 Learning rate.
    momentum float 0.9 Momentum.
    dropout float 0.0 Dropout rate. If equals to 0.0, no dropout is used.
    dataset str ‘dataset/’ Path to dataset.
    device str ‘cpu’ Device to use (cpu, cuda, mps).
    type str ‘auto’ Type of dataset to create (auto, image, video). If auto, the dataset type will be inferred from the dataset directory, defaulting to image.
    save_period int 10 Save checkpoint every x epochs (disabled if <1).
    save_weights_only bool False Save only weights, not the whole checkpoint
    save_path str ‘weights/’ Path to save checkpoints at.
    no_shuffle Don’t shuffle the training dataset.
    tensorboard Use tensorboard to log training progress.’)
    one_output_frame Demand only one output frame instead of three.’)
    no_save_output_examples Don’t save output examples to results folder.
    grayscale Use grayscale images instead of RGB.’)
    single_batch_overfit Overfit the model on a single batch.’)

    Arguments without type or default value are used without an additional value, e.x.

    python train.py --dataset dataset/ --grayscale --one_output_frame
    Visit original content creator repository https://github.com/mareksubocz/TrackNet
  • evaluation_2_OOP

    Second Evaluation of Object-Oriented Programming

    This project was build using Apache Netbeans IDE version 12.4.

    Este projeto valia 10 pontos na matéria, consegui 9,00. (This project was worth 10 points in the matter, I got 9.00 points.)

    Português – Trabalho de faculdade que foi feito usando programação orientada a objeto.

    Os objetivos eram:

    1. Criar uma superclasse que atenda as subclasses “LANCHA“, “AVIAO” e “CARRO“;
    2. Reaproveitamento de métodos da superclasse;
    3. Estender ações de classes agregadas;
    4. Criar, na aplicação “aplicacao_aia_a2” um laço for que crie até 5 objetos de cada tipo;
    5. Criar uma classe para que seja lido o “MOTOR” de cada meio de locomoção;
    6. Tratar exceções e entrada de dados;
    7. Boas práticas de programação Java.

    English – College work that was done using object-oriented programming.

    The goals were:

    1. Create a superclass that meets the subclasses “LANCHA“, “AVIAO” and “CARRO“;
    2. Reuse of superclass methods;
    3. Extend aggregate class actions;
    4. Create, in the application “aplicacao_aia_a2” a for loop that creates up to 5 objects of each type;
    5. Create a class so that the “MOTOR” of each means of locomotion is read;
    6. Handle exceptions and data entry;
    7. Good Java programming practices.

    Visit original content creator repository
    https://github.com/henrique-souza/evaluation_2_OOP

  • leola-web

    leola-web

    An embedded web server and web framework for the Leola Programming Language.

    Why should you use this?
    You probably shouldn’t. There are more robust and feature complete web frameworks out there (Flask, Rails, etc.). If you still feel like using leola-web, please read on. I believe there are some cool features that make developing web sites and/or REST API’s relatively painless and dare I say fun.

    Hello World

    A simple Hello World application.

    require("lib/web", "web")
    
    var app = web:newWebApp()
    
    app.route
    
        ({path -> "/hello"},
        def(context) {            
            return web:ok().text("Hello World")
        })
    
    app.start()

    Creating the Application

    Create a WebApp that allows you to bind HTTP request URL’s (i.e., Routes) to functions.

    require("lib/web", "web" )  // path to the leola-web.jar
    
    var app = web:newWebApp({
    
        /* The directory in which this application is installed, more percisely, where the
        application should look for the CSS, JS and HTML files */
        resourceBase -> "./",
        
        /* The application context of the REST calls, i.e., http://localhost/[context]/ */
        context -> "api",
        
        /* The port that this server will use */
        port -> 8121,
        
        /* Listen for file edits, and reload the application (should only be enabled for development) */
        autoReload -> true,
    })

    Binding Routes

    All leola-web really does is start an embedded web server (Jetty) and allows you to bind a Leola function to HTTP requests (i.e, a Route). There are two things to consider when binding a Route, 1) the URL path 2) the method type it accepts.

    app.route
    
        ({path -> "/api/echo", methods -> ["GET"]},
        def(context) {            
            // this Route expects a parameter of 'message'
            var message = context.param("message")                
            return web:ok().json({
                echo -> message
            })
        })
        
    app.route
    
       ({path -> "/api/{team}/roster", methods -> ["GET"]},
       def(context) {
         // use the path parameters from the request, as an example: 
         //   GET http://localhost:8121/api/GreenBayPackers/roster
         var team = context.pathParam("team")
         if team == "GreenBayPackers" {
            return web:ok().json({
               roster -> [
                  { name -> "Brett Favre", position -> "QB" },
                  { name -> "Donald Driver", position -> "WR" }
               ]
            })
         }
         else {
            return web:notAcceptable().json({
               message -> "No other team matters"
            })
         }
       })

    Responses

    There are a number of ways to make an HTTP response.

    // There are a number of factory methods from the 'web' namespace that map to common used HTTP response 
    // types
    web:ok() // 200
    web:created()
    web:noContent()
    web:serverError() // 500
    web:status(status) // custom status
    
    // These factory methods return a WebResponse which then allows you to construct different payloads:
    var response = web:ok().json( {} ) // accepts map which gets converted to a Json string
    response.cookie("name", "value" )
            .header("name", " value" )
            .characterEncoding("UTF-8")
    
    var templateObj = {
     // add values here to be used by the template engine (mustache)
    }        
    response.template( "/ui/index.html", templateObj ) // return back the html file (uses mustache as a template engine)
    // 

    When things go wrong

    When an exception occurs, you can bind a Leola function and handle it by returning a custom response back to the client.

    app.errorHandler
    
        (def(context, error) {
          return web:serverError().json({
                "error" -> toString(error),
                "message" -> "Sorry, there was an internal error"
          })  
        })

    Web Sockets

    Web Sockets are pretty hip, leola-web has support for those too. Create a set of callback functions when a WebSocket is initiated.

    app.webSocket
    
        ({
            // the path to the socket (ws://localhost:8121/api/testSocket)
            route -> "/testSocket",
            
            onOpen -> def(session) {
            },
            
            onClose -> def(session, reason) {
            },
            
            onMessage -> def(session, message) {            
            },
            
            onError -> def(session, exception) {
            }        
        })

    Starting the Web Server

    Finally, start the web server. This will block, so it should be the last statement of your script.

    app.start()    

    Visit original content creator repository
    https://github.com/tonysparks/leola-web

  • TrybeWallet

    Boas vindas ao repositório do projeto Trybe Wallet!

    Instruções para rodar o projeto no seu computador

    ANTES…

    • O código desse projeto em questão e outros refletem os diferentes níveis de aprendizado ao longo da minha jornada estudante de desenvolvimento web pois estou de vez em quando buscando refatorar códigos dos meus projetos afim de exercitar as boas práticas em CLEAN CODE e ESCALABILIDADE!

    COMO RODAR A APLICAÇÃO

    1. Clone o repositório
    • git clone git@github.com:tryber/sd-017-project-trybewallet.git
    • Entre na pasta do repositório que você acabou de clonar:
      • cd sd-017-project-trybewallet
    1. Instale as dependências e inicialize o projeto
    • Instale as dependências:
      • npm install
    • Inicialize o projeto:
      • npm start (uma nova página deve abrir no seu navegador com um texto simples)
    • Caso queira rodar os testes pode usar o comando abaixo:
      • npm test(Obs.: talvez apareça uma tela com uma messagem: “tests not found”, se aparecer, tecle a e todos os testes serão rodados)

    Habilidades

    Neste projeto, reforcei meus conhecimentos de Redux, ao:

    • Criar um store Redux em aplicações React

    • Criar reducers no Redux em aplicações React

    • Criar actions no Redux em aplicações React

    • Criar dispatchers no Redux em aplicações React

    • Conectar Redux aos componentes React

    • Criar actions assíncronas na sua aplicação React que faz uso de Redux.


    O que foi desenvolvido

    Neste projeto desenvolvi uma carteira de controle de gastos com conversor de moedas, ao utilizar essa aplicação um usuário deverá ser capaz de:

    • Adicionar, remover e editar um gasto;
    • Visualizar uma tabela com seus gastos;
    • Visualizar o total de gastos convertidos para uma moeda de escolha;

    Desenvolvimento

    Desenvolvi uma aplicação em React que usa Redux como ferramenta de manipulação de estado.

    Através dessa aplicação, será possível realizar as operações básicas de criação e manipulação de um estado de redux.

    Visit original content creator repository
    https://github.com/abnerfds/TrybeWallet

  • whatlurkswithin

    WHAT LURKS WITHIN

    An interactive novel experience where every choice matters.

    “many a secret lay within the walls.”

    “beliefs twisted around their lies, slowly infesting the expanse like a parasite.”

    “only a choice can defer this cruel fate from befalling the masses.”

    “I hope, for all our sakes, you make that choice, Commander.”


    documentation coming later. stay tuned!

    POSTSCRIPT

    Making a game has always been my dream. From the moment I started programming, I knew I wanted to make one eventually.

    But, to my dismay, I lack the skills to do anything but write or program. This has been a major obstacle, forcing me to work on smaller projects such as koulouri or ZRpB.

    WHAT LURKS WITHIN is my attempt to shatter that obstacle. All of the skills I’ve learned from my former projects, including my beloved koulouri and every story my precious friends have wrote with me have built up to this moment. Already, it is my biggest project yet (in terms of code), and it will only get bigger.

    I may not be able to give you visuals or sound, but I promise to at the very least try and deliver an experience worth your time.

    Stay tuned, Commander. Arcallis will soon await your arrival.

    PROJECT ALPHA WARNING – PLEASE READ!

    WLW is a VERY new project (perhaps even before the Alpha stage), and everything you see is subject to change!

    This repository was made public for recordkeeping purposes, and the game is currently in no way stable. I am not responsible for any save data loss or other issues caused by WLW!

    Visit original content creator repository
    https://github.com/zeropointnothing/whatlurkswithin

  • cosmos-devops

    Cosmos-DevOps

    This repository is a collection of my cosmos DevOps journey. I’ll be putting my progress, code samples, and experiments in this repository.

    Setups

    Each scenario directory contains a detailed README file that provides instructions on how to set up and use the Docker Compose configuration for that specific scenario.

    Usage

    1. Clone this repository and navigate to the desired scenario directory.
    2. Follow the instructions in the respective README file to start the Docker Compose services.
    3. Access the deployed services or integrate them into your web3 development workflow as needed.
    4. To stop the services, use the appropriate docker-compose down command as mentioned in each scenario’s README file.

    Visit original content creator repository
    https://github.com/shyamvyas5/cosmos-devops

  • StandardCSS

    StandardCSS

    A dead-simple CSS boilerplate; it only uses element selectors to standardize styling across
    browsers and reduce unnecessary class construction. Think NormalizeCSS or ResetCSS, but
    customizable.

    How does it work?

    The boilerplate provides styling for commonly utilized features: scrollbar, anchors,
    form input groups, validation, quote boxes, code, etc. They’re applied with element selectors
    only to reduce overhead. Stylesheet props var() is used so the boilerplate can be scaled
    and customized easily.

    Example of :root props.

    --fontSize: 16px;
    --lineHeight: 1.75; /* Keep this number unitless to avoid overlap and inheritance issues. */
    
    --headerFont: 'Geneva';
    --bodyFont: 'Arial';
    --monoFont: 'Lucida Console';
    
    --font: #000000;
    --foreground: #EAEAEA;
    --background: #FFFFFF;
    ...
    

    Example of cross-browser standardization using props.

    ...
    html, body {
        padding: 0; /* Remove unnecessary padding. */
        margin: 0; /* Remove unnecessary margin. */
    }
    body {
        -webkit-text-size-adjust: 100%; /* Prevent adjustments of font size after orientation changes in iOS. */
    
        /* Default Background */
        background-color: var(--background, #FFFFFF);
    
        /* Global Inherited Defaults */
        font-family: var(--headerFont, 'Geneva'), 'Helvetica', serif;
        font-size: var(--fontSize, 16px);
        line-height: var(--lineHeight, 1.75);
        color: var(--font, #000000);
    }
    html:focus, body:focus {
        outline: none; /* Remove default agent outline focus from most browsers. */
    }
    ...
    

    Example of Input Validation using props.

    fieldset:invalid {
        border-color: var(--warning, #E86363);
    }
    fieldset:invalid > legend {
        color: var(--warning, #E86363);
    }
    input:not([value='']):not(:focus):invalid, select:not(:focus):invalid, textarea:not(:focus):invalid {
        border-color: var(--warning, #E86363);
    }
    input:not(:focus):required:valid, select:not(:focus):required:valid, textarea:not(:focus):required:valid {
        border-color: var(--success, #7CDC7C)
    }
    

    Why Use This?

    StandardCSS is designed to act as a bedrock / foundational layer for new themes and frameworks. If you are building
    your stylesheets from scratch and want a customizable cross-browser supported boilerplate, then StandardCSS is for you.
    If importing a framework or extending one, then StandardCSS is not for you.

    What is included in the Foundation layer?

    The foundation layer includes only few groups at the moment. However, there are plans to expand this has HTML and CSS
    adopts more commonly built features. However, everything here is fully customizable via props or by messing with their
    properties. Yes that also means custom checkbox, radio, quotes and search without any extra HTML markup. CSS handles
    it all.

    • Page Building (Containers)
      • Headers
      • Main, Article, Sections
      • Footers
    • Content Handling
      • Header
      • Paragraph, Span,
      • Image
      • Delete, Emphasis, Strong, etc.
      • Citations
      • Anchors
      • Preformatted Text (ex. pre, code, sample)
      • Quotes and Blockquotes
      • etc…
    • Scrollbar (webkit browsers only)
    • Form Control
      • Various Inputs
        • Text, Textarea, Select, Search, Radio, Checkbox, etc.
      • Input Groups
      • Validation & Invalidation

    Compatability

    This HTML boilerplate is designed to work with the latest technology that is accepted by all modern browsers.
    As of 7/25/2023, 94% of all users browsers’, according to CanIUse, support everything in document. Except the scrollbar,
    as only webkit supported browsers support this.

    Accessibility

    All styling following the recommendations of W3C or integrates a commonly used browser style agent implementation. Since
    all elements being modified are still displayed by default, even if their appearance and aesthetic is overwritten
    (ex. checkbox and radio), they still retain the accessible properties.

    Licensing

    Please see the LICENSE for this project regarding use.

    Visit original content creator repository
    https://github.com/MatthewRDangle/StandardCSS

  • rpi-fft-led

    rpi-fft-led

    This is a Raspberry Pi Projekt for the German Jugend Forscht competition.
    This Code controlls WS2812B LEDs using the SPI port of the Raspberry Pi by calculating a Fast Fourier Transform.
    The code I wrote makes use of the GPU_FFT library (http://www.aholme.co.uk/GPU_FFT/Main.htm) and
    code to steer the WS2812b LEDs (https://github.com/penfold42/stuff/blob/master/ws2812_spi.c).

    fft.c is the main file and requires 1 to 3 arguments, the

    • 1st is a mono .wav file to play or “mic” if you want to use an external microphone
    • 2nd is the mode 1-4 to for displaying the sound
    • 3nd is optional. If set to “log” displays Bins logarythmically on LED-Strip. If set as something else the frequency spectrum of each time frame should be scaled to 1 for the highest FFT amplitude.

    The Modes are in the led_modes.c file

    • Mode 1 maps each LED a number of bins and displays a color spectrum and the brightness is the amplitude(has to be optimized).
    • Mode 2 maps each LED a number of bins and the color is the amplitude.
    • Mode 3 is the same as mode 2 but the base is additional brightness.
    • Mode 4 displays a snake that always adds the frequency with the highest amplitude to the beginning.
    • Mode 5 displays the current volume using the number of LEDs. The color is represented by the most domiante frequency

    Install and build

    #Update system
    sudo apt-get update && sudo apt-get upgrade
    
    #Install missing librarys
    sudo apt-get install libsndfile1 libsndfile1-dev
    
    #Clone Project
    git clone https://github.com/mariusdkm/rpi-fft-led
    
    cd rpi-fft-led
    
    #Build Project
    make fft.bin
    

    An example call would be:

    sudo ./fft.bin example.wav 4

    or

    sudo ./fft.bin mic 2

    Run the code using sudo since the GPU_FFT code makes use of the GPU, which requires root permissions.

    The Langfassung.pdf is the Document I wrote for the Jugend Forscht Contest.
    It is in German but goes a bit deeper into how and why I’ve built this Project.

    In developing this, I made use of the following information:
    http://www.aholme.co.uk/GPU_FFT/Main.htm
    https://stackoverflow.com/questions/3407942/rgb-values-of-visible-spectrum
    https://github.com/penfold42/stuff/blob/master/ws2812_spi.c
    https://www.linuxjournal.com/article/6735
    https://ubuntuforums.org/showthread.php?t=968690

    For the spi interface Copyright (c) 2016 penfold42

    For the GPU_FFT Copyright (c) 2014 Andrew Holme.

    Copyright (c) 2018 mariusdkm

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Softare Foundation, version 2.

    Visit original content creator repository
    https://github.com/mariusdkm/rpi-fft-led

  • StravaActivityMerger

    This is a Spring Boot Groovy App with Angular Frontend that displays Strava activities and enables you to merge activites into a new one.

    How it looks

    You can login to Strava with OAuth, no additional credentials required.

    login

    As soon as you are authorized, a table view will open, showing your most recent activities. Clicking on a row will show details and a map.

    table

    You can select multiple rows/activities with the checkboxes at the left side. Whenever you have 2 or more activities selected, the merge button will become active. Clicking on merge might take some seconds (~8s) before the table is reloaded and shows the new activity. Merged activities get a noticeable pink border.

    merge

    It is deployed to Google Cloud and can be accessed over http://activity-merger.ddns.net

    Setup

    Get Strava API specification

    To get the spec, simply run the Gradle task downloadStravaApi. You can do this either directly in IntelliJ or with ./gradlew downloadStravaApi on command line.

    Generate OpenAPI client code

    Unfortunately the Groovy support is really poor for Swagger/OpenAPI, so it’s required to generate Java code. But since it is generated code and shall not be touched, it doesn’t really matter. To generate use the IntelliJ plugin. Simply open build/generated/strava-api-definition/api.json and in the Editor click on the edit button:

    openapi generate edit

    And there set the settings as below:

    openapi generate edit dialog

    It is important to choose the correct path (according to gradle settings it is src-api) and to set the correct generator version -→ The generator will be downloaded automatically.

    OR! just run Gradle task build to get everything properly generated.

    Install NodeJS

    In order to run the Angular frontend, you need to install NodeJS from https://nodejs.org/en/download/ and run

    npm install
    npm install @angular/cdk
    npm install -g karma-cli

    in the repository.

    run it

    For local purpose no special deployment is required.

    But you need a secret file (src/main/resources/.secrets) with content which is not allowed to be shared. Get both the client id and secret at https://www.strava.com/settings/api by creating your own application. The Google API key must be generated at https://console.cloud.google.com/google/maps-apis/overview. Then enter all 3 values like this:

    {
        "client_id": "<your strava client id>",
        "client_secret": "<your strava client secret>",
        "google_api_key": "<your Google static maps api key>"
    }

    Just run:

    • ./gradlew bootRun to start the backend services

    • cd web-app and ng serve --open to open the web UI in your browser

    Done.

    API description

    Visit original content creator repository https://github.com/besessener/StravaActivityMerger