Blog

  • AUV-Simulator

    AUV-Simulator

    Screenshot

    A simulator used to test control algorithms written for an Autonomous Underwater Vehicle

    This simulator was developed as a part of my work in Team Tiburon, the autonomous underwater vehicle team of NIT Rourkela. It is developed using Unity3D and written in C#.

    The simulator works by communicating with a control algorithm through TCP sockets. The control algorithm may run on a seperate machine.

    The simulator receives from the control algorithm, the values of the forces to be applied to the individual thrusters. It send simulated sensor data to the control algorithm as feedback. Amongst the sensors used are cameras. Camera images are sent to the control algorithm every frame. To ensure optimal communication frequency, edge detection is performed on the images before sending.

    The code for simulating underwater forces like planing force, slamming force etc., i.e. the contents of ./Underwater Forces, is experimental and not currently in use. This code was taken from the tutorial posted by Erik Nordeus, ‘Make a realistic boat in Unity with C#’, and all rights for that part of the code belong to him.

    http://www.habrador.com/tutorials/unity-boat-tutorial/

    To use:

    • Once the IP addresses and Port numbers are set correctly, run the simulator. Then, run the control algorithm, set up a client connection to the simulator, and run its server. Finally, press the space bar on the simulator to set up its client connection with the control algorithm.
    • The control algorithm must send to the simulator forces to be applied at each thruster, as float values. The number, position, and orientation of thrusters on the vehicle can easily be changed.
    • The simulator provides simulated sensor values as feedback. A total of 8 floating point values are sent, with two digit decimal places, three digits before the decimal, and the sign. This is mentioned for easy decoding of the feedback. The eight values are: the orientation of the vehicle in the x, y, and z axes respectively, the acceleration of the vehicle in the x, y, and z axes respectively, the depth of the vehicle under water, and the forward velocity of the vehicle in its local frame.
    • To use camera images as feedback, uncomment the like ‘#usePics’ in ControlThrusters.cs. You must decode the image from the values of the edges.

    steps:
    Add these dependencies if not added
    ROS Qt Build – sudo apt-get install ros-kinetic-qt-build
    Point Grey Camera Driver – sudo apt-get install ros-kinetic-pointgrey-camera-driver
    Install rosbridge-sudo apt-get install ros-kinetic-rosbridge-server

    Install AUV Simulator using the installer available in Builds.zip.

    start AUV simulator.exe
    enter the IP address

    run the command roslaunch rosbridge_server rosbridge_websocket.launch
    *(pre-requisite rosbridge library should be installed on your linux distribution )

    run rosun watchdog watchdog

    run simulator_receive_image simulator_receive_image

    in AUV simulator.exe : *IN THE MENU YOU CAN TYPE THE IP ADDRESS OR JUST CLICK ON THE LOCAL HOST BUTTON FOR SETTING UP THE WEBSOCKET CONNECTION.

    *USE MOUSE AND ARROW KEYS TO MOVE AROUND THE ARENA.

    *TO VIEW THE LOG VIEWER/CONSOLE LOGS ,USING MOUSE- CLICK AND DRAG TO MAKE A CIRCULAR GESTURE.

    Visit original content creator repository

  • netPI-raspbian

    Raspbian

    Made for Raspberry Pi 3B architecture based devices and compatibles

    Docker repository

    https://hub.docker.com/r/hilschernetpi/netpi-raspbian/

    Container features

    The image provided hereunder deploys a Debian based container with SSH server, pre-compiled software/packages found installed on Raspbian OS (inclusive userland tools) and a default user which is pi.

    Base of this image builds debian with enabled SSH, installed userland tools, created user ‘pi’ and preinstalled packages of a Raspbian lite operating system (headless).

    Container hosts

    The container has been successfully tested on the following hosts

    • netPI, model RTE 3, product name NIOT-E-NPI3-51-EN-RE
    • netPI, model CORE 3, product name NIOT-E-NPI3-EN
    • netFIELD Connect, product name NIOT-E-TPI51-EN-RE/NFLD
    • Raspberry Pi, model 3B
    • Raspberry Pi, model 4B (arm32v7,arm64v8)

    netPI devices specifically feature a restricted Docker protecting the Docker host system software’s integrity by maximum. The restrictions are

    • privileged mode is not automatically adding all host devices /dev/ to a container
    • volume bind mounts to rootfs is not supported
    • the devices /dev,/dev/mem,/dev/sd*,/dev/dm*,/dev/mapper,/dev/mmcblk* cannot be added to a container

    Container setup

    Environment variable (optional)

    The container binds the SSH server port to 22 by default.

    For an alternative port use the variable SSHPORT with the desired port number as value.

    Network mode

    The container supports the bridged or host network mode. More details at Container networking.

    Bridged

    Any unused Docker host port needs to be mapped to the default container port 22 or the one set by SSHPORT to expose the container SSH server to the Docker host.

    Remark: Container bluetooth functionality is supported in host network mode only.

    Host

    Port mapping is unnecessary since all the used container ports (like 22 or SSHPORT) are exposed to the host automatically.

    Remark: Host network mode is mandatory for using container bluetooth functions.

    Hostname (optional)

    For an equal default Raspbian OS hostname set the container hostname to raspberrypi.

    Privileged mode (optional)

    The privileged mode lifts the standard Docker enforced container limitations: applications inside a container are getting (almost) all capabilities as if running on the host directly.

    Enabling the privileged mode is optional but mandatory for the following container functions:

    • bluetooth
    • userland tools

    Host devices (optional)

    For bluetooth functionality the /dev/ttyAMA0 Docker host device needs to be added to the container. In conjunction the /dev/vcio Docker host device needs be added to the container as well to allow bluetooth controller resets.

    For using userland tools like vcmailbox the /dev/vcio and /dev/vchiq and /dev/vc-mem Docker host devices need to be added to the container.

    Container deployment

    Pulling the image may take 10 minutes.

    netPI example

    STEP 1. Open netPI’s web UI in your browser (https).

    STEP 2. Click the Docker tile to open the Portainer.io Docker management user interface.

    STEP 3. Enter the following parameters under Containers > + Add Container

    Parameter Value Remark
    Image hilschernetpi/netpi-raspbian a :tag may be added as well
    Network > Network bridge or host use either or
    Network > Hostname raspberrypi optional
    Restart policy always
    Adv.con.set. > Env > +add env.var. name SSHPORT -> value any number value optional for different SSH port
    Port mapping host unused port -> container 22 / SSHPORT in bridged mode only
    Adv.con.set. > Devices > +add device Host path /dev/ttyAMA0 -> Container path /dev/ttyAMA0 optional for bluetooth
    Adv.con.set. > Devices > +add device Host path /dev/vcio -> Container path /dev/vcio optional for bluetooth, userland tools
    Adv.con.set. > Devices > +add device Host path /dev/vchiq -> Container path /dev/vchiq optional for userland tools
    Adv.con.set. > Devices > +add device Host path /dev/vc-mem -> Container path /dev/vc-mem optional for userland tools
    Adv.con.set. > Privileged mode On optional for bluetooth, userland tools

    STEP 4. Press the button Actions > Start/Deploy container

    Docker command line example

    docker run -d --privileged --network=host --restart=always -e SSHPORT=22 --device=/dev/ttyAMA0:/dev/ttyAMA0 --device=/dev/vcio:/dev/vcio --device=/dev/vchiq:/dev/vchiq --device=/dev/vc-mem:/dev/vc-mem -p 22:22/tcp hilschernetpi/netpi-raspbian

    Docker compose example

    A docker-compose.yml file could look like this

    version: "2"
    
    services:
     nodered:
       image: hilschernetpi/netpi-raspbian
       restart: always
       privileged: true
       network_mode: host
       ports:
         - 22:22
       devices:
         - "/dev/ttyAMA0:/dev/ttyAMA0"
         - "/dev/vcio:/dev/vcio"
         - "/dev/vchiq:/dev/vchiq"
         - "/dev/vc-mem:/dev/vc-mem"
       environment:
         - SSHPORT=22
    

    Container access

    The container starts the SSH server automatically when deployed.

    For an SSH terminal session use an SSH client such as putty with the Docker host IP address (@port number 22 or SSHPORT or bridge mode mapped one).

    Use the credentials pi as user and raspberry as password when asked and you are logged in as non-root user pi.

    Continue to use Linux commands in the terminal as usual.

    Container on Youtube

    Tutorial

    License

    Copyright (c) Hilscher Gesellschaft fuer Systemautomation mbH. All rights reserved.
    Licensed under the LISENSE.txt file information stored in the project’s source code repository.

    As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).
    As for any pre-built image usage, it is the image user’s responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.

    N|Solid Hilscher Gesellschaft fuer Systemautomation mbH www.hilscher.com

    Visit original content creator repository

  • tabnine-swift-arduino

    TabNine For Swift for Arduino

    This repository is a placeholder, used to gauge the level of interest of Swift for Arduino users in a TabNine extension.

    TabNine Overview:


    This is the Swift for Arduino TabNine client, advanced AI based autocomplete for all programming languages. TabNine Indexes your entire project by reading your .gitignore or others, and determines which files to index.

    • Enter long variable names using minimal keystrokes and leverage a mnemonic completion engine.
    • Zero configuration. TabNine works out of the box.
    • Highly responsive: Produces a list of suggestions in less than 10 milliseconds on average.

    TabNine is part of Codota

    Deep Completion:


    Deep TabNine is trained on around 2 million files from GitHub. During training,
    TabNine’s goal is to predict the next token given the tokens that came before.
    To achieve this goal, TabNine learns complex behaviour, such as type inference
    in dynamically typed languages.

    Deep TabNine can use subtle clues that are difficult for traditional tools to access. For example,
    the return type of app.get_user()is assumed to be an object
    with setter methods, while the return type of app.get_users() is assumed to be a list.

    Deep TabNine is based on GPT-2, which uses the Transformer network architecture. This architecture was first developed to solve problems in natural language processing. Although modelling code and modelling natural language might appear to be unrelated tasks, modelling code requires understanding English in some unexpected ways.

    TabNine Deep Cloud:


    TabNine requires consumption of memory resources when being run locally on your computer. It may incur some latency that is not optimal to all PC’s. With that in mind, TabNine has developed a Cloud solution, called TabNine Deep Cloud.

    We understand that users concerned with their privacy prefer to keep their code on their own machine. Rest assured that we’re taking the following steps to address this concern:
    For individual developers, we are working on a reduced-size model which can run on a laptop with reasonable latency. Update: we’ve released TabNine Local.
    For enterprise users, we will soon roll-out the option to license the model and run it on your own hardware. We can also train a custom model for you which understands the unique patterns and style within your codebase. If this could be relevant to you or your team, we would love to hear more about your use case at enterprise@tabnine.com.
    Enabling TabNine Deep Cloud sends small parts of your code to our servers to provide GPU-accelerated completions.
    Other than for the purpose of fulfilling your query, your data isn’t used, saved or logged in any way.

    You can enable TabNine Deep Cloud for free by signing up TabNine Professional

    You can read more about Deep Completion

    Frequently Asked Questions:


    Is TabNine simple to use?

    TabNine works for all programming languages.
    TabNine does not require any configuration in order to work.
    TabNine does not require any external software (though it can integrate with it).
    Since TabNine does not parse your code, it will never stop working because of a mismatched bracket.

    Will TabNine leak my source code?

    By default, TabNine makes web requests only for the purposes of downloading updates and validating registration keys. In this case your code is not sent anywhere, even to TabNine servers.
    You may opt in to TabNine Deep Cloud, which allows you to use TabNine’s servers for GPU-accelerated completions powered by a deep learning model. If sending code to a cloud service is not possible, we also offer a self-hosted option.
    Contact us at enterprise@tabnine.com.

    Note:


    A note on licensing: this repo includes source code as well as packaged TabNine binaries. The MIT license only applies to the source code, not the binaries. The binaries are covered by the TabNine End User License Agreement.

    Visit original content creator repository

  • elderjs

    Elder.js

    Elder.js: an SEO first Svelte Framework & Static Site Generator


    Elder.js is an opinionated static site generator and web framework built with SEO in mind. (Supports SSR and Static Site Generation.)

    Features:

    • Build hooks allow you to plug into any part of entire page generation process and customize as needed.
    • A Highly Optimized Build Process: that will span as many CPU cores as you can throw at it to make building your site as fast as possible. For reference Elder.js easily generates a data intensive 18,000 page site in 8 minutes using a budget 4 core VM.
    • Svelte Everywhere: Use Svelte for your SSR templates and with partial hydration on the client for tiny html/bundle sizes.
    • Straightforward Data Flow: By simply associating a data function in your route.js, you have complete control over how you fetch, prepare, and manipulate data before sending it to your Svelte template. Anything you can do in Node.js, you can do to fetch your data. Multiple data sources, no problem.
    • Community Plugins: Easily extend what your Elder.js site can do by adding prebuilt plugins to your site.
    • Shortcodes: Future proof your content, whether it lives in a CMS or in static files using smart placeholders. These shortcodes can be async!
    • 0KB JS: Defaults to 0KB of JS if your page doesn’t need JS.
    • Partial Hydration: Unlike most frameworks, Elder.js lets you hydrate just the parts of the client that need to be interactive allowing you to dramatically reduce your payloads while still having full control over component lazy-loading, preloading, and eager-loading.

    Context

    Elder.js is the result of our team’s work to build this site (ElderGuide.com) and was purpose built to solve the unique challenges of building flagship SEO sites with 10-100k+ pages.

    Elder Guide Co-Founder Nick Reese has built or managed 5 major SEO properties over the past 14 years. After leading the transition of several complex sites to static site generators he loved the benefits of the JAM stack, but wished there was a better solution for complex, data intensive, projects. Elder.js is his vision for how static site generators can become viable for sites of all sizes regardless of the number of pages or how complex the data being presented is.

    We hope you find this project useful whether you’re building a small personal blog or a flagship SEO site that impacts millions of users.

    Project Status: Stable

    Elder.js is stable and production ready.

    It is being used on ElderGuide.com and 2 other flagship SEO properties that are managed by the maintainers of this project.

    We believe Elder.js has reached a level of maturity where we have achieved the majority of the vision we had for the project when we set out to build a static site generator.

    Our goal is to keep the hookInterface, plugin interface, and general structure of the project as static as possible.

    This is a lot of words to say we’re not looking to ship a bunch of breaking changes any time soon, but will be shipping bug fixes and incremental changes that are mostly “under the hood.”

    The ElderGuide.com team expects to maintain this project until 2023-2024. For a clearer vision of what we mean by this and what to expect from the Elder.js team as far as what is considered “in scope” and what isn’t, please see this comment.

    Getting Started:

    The quickest way to get started is to get started with the Elder.js template using degit:

    npx degit Elderjs/template elderjs-app
    
    cd elderjs-app
    
    npm install # or "yarn"
    
    npm start
    
    open http://localhost:3000

    This spawns a development server, so simply edit a file in src, save it, and reload the page to see your changes.

    Here is a demo of the template: https://elderjs.pages.dev/

    To Build/Serve HTML Locally:

    npm run build

    Let the build finish.

    npx sirv-cli public

    Full documentation here: https://elderguide.com/tech/elderjs/

    Visit original content creator repository
  • new_metric_for_demographic_parity

    Implmentation for TMLR paper: Retiring ΔDP: New Distribution-Level Metrics for Demographic Parity, [Openreview], [Arxiv], by Xiaotian Han*, Zhimeng Jiang*, Hongye Jin*, Zirui Liu, Na Zou, Qifan Wang, Xia Hu

    1. Introduction

    Lots of fairness definitions (e.g., demographic parity, equalized opportunity) has been proposed to solve different types of fairness issues. In this paper, we focus on the measurement of demographic parity, $\Delta DP$, which requires the predictions of a machine learning model should be independent on sensitive attributes.

    1.1 Drawbacks of commonly used $\Delta DP$

    In this paper, we rethink the rationale of $\Delta DP$ and investigate its limitations on measuring the violation of demographic parity. There are two commonly used implementations of $\Delta DP$, including $\Delta DP_c$ (i.e., the difference of the mean of the predictive probabilities between different groups, and $\Delta DP_b$ (i.e., the difference of the proportion of positive prediction between different groups. We argue that $\Delta DP$, as a metric, has the following drawbacks:

    1. Zero-value $\Delta DP$ does not guarantee zero violation of demographic parity.

    1. $\Delta DP$ value is highly correlated to the selection of the threshold for the classification task.

    1.2 The Proposed ABPC & ABCC

    We propose two distribution-level metrics, namely Area Between Probability density function Curves (ABPC) and Area Between Cumulative density function Curves (ABCC), to retire $\Delta DP_{c}$ and $\Delta DP_{b}$ as follows:

    $$ABPC = TV(f_0(x), f_1(x)) = ∫_{0}^{1}|f_0(x) – f_1(x) | dx,$$ $$ABCC = TV(F_0(x), F_1(x)) = ∫_{0}^{1}|F_0(x) – F_1(x)| dx,$$

    ABPC and ABCC have following advantages:

    1. Zero-value ABPC/ABCC is a necessary and sufficient condition to achieve demographic parity.

    2. The prediction independency to sensitive attributes can be guaranteed over any threshold.

    2. Implementation

    2.1 Python package

    torch                         1.10.0
    statsmodels                   0.13.1
    scikit-learn                  1.0.1
    pandas                        1.3.4
    numpy                         1.21.2
    aif360                        0.4.0
    

    2.2 Run cmd

    run the following commands at current directy

    bash run.sh
    
    python -u ./src/bs_tabular_mlp.py --data_path ./data/adult  --dataset adult --sensitive_attr sex --exp_name adult_mlp --batch_size 256 --epoch 10 --seed 31314
    python -u ./src/bs_tabular_reg.py --data_path ./data/adult  --dataset adult --sensitive_attr sex --exp_name adult_reg --batch_size 256 --epoch 10 --seed 31314 --lam 1
    python -u ./src/bs_tabular_adv.py --data_path ./data/adult --dataset adult --sensitive_attr sex --exp_name adult_adv --batch_size 256 --epoch 40 --seed 31314 --lam 170

    2.3 Python Implementation for ABPC and ABCC

    def ABPC( y_pred, y_gt, z_values, bw_method = "scott", sample_n = 5000 ):
    
        y_pred = y_pred.ravel()
        y_gt = y_gt.ravel()
        z_values = z_values.ravel()
    
        y_pre_1 = y_pred[z_values == 1]
        y_pre_0 = y_pred[z_values == 0]
    
        # KDE PDF     
        kde0 = gaussian_kde(y_pre_0, bw_method = bw_method)
        kde1 = gaussian_kde(y_pre_1, bw_method = bw_method)
    
        # integration
        x = np.linspace(0, 1, sample_n)
        kde1_x = kde1(x)
        kde0_x = kde0(x)
        abpc = np.trapz(np.abs(kde0_x - kde1_x), x)
    
        return abpc
    def ABCC( y_pred, y_gt, z_values, sample_n = 10000 ):
    
        y_pred = y_pred.ravel()
        y_gt = y_gt.ravel()
        z_values = z_values.ravel()
    
        y_pre_1 = y_pred[z_values == 1]
        y_pre_0 = y_pred[z_values == 0]
    
        # empirical CDF 
        ecdf0 = ECDF(y_pre_0)
        ecdf1 = ECDF(y_pre_1)
    
        # integration
        x = np.linspace(0, 1, sample_n)
        ecdf0_x = ecdf0(x)
        ecdf1_x = ecdf1(x)
        abcc = np.trapz(np.abs(ecdf0_x - ecdf1_x), x)
    
        return abcc

    3. Citation

    Please kindly cite the following paper if you found our code helpful!

      @article{han2023retiring,
        title={Retiring $$\backslash$Delta $ DP: New Distribution-Level Metrics for Demographic Parity},
        author={Han, Xiaotian and Jiang, Zhimeng and Jin, Hongye and Liu, Zirui and Zou, Na and Wang, Qifan and Hu, Xia},
        journal={arXiv preprint arXiv:2301.13443},
        year={2023}
      }

    4. Credit

    We use Github Copilot to generate some comments in important code.

    Visit original content creator repository
  • pitchfork-npm

    #Pitchfork Client

    Travis CI

    An unofficial Node.js client for Pitchfork reviews based on the Pitchfork API Client for Python.

    Install

    Using NPM

    npm install pitchfork

    Using Github

    git clone git@github.com:omardelarosa/pitchfork-npm.git

    You can then use it as a command-line tool or as a node module

    ##API

    You can require pitchfork and use it inside of any Node.JS application.

    var p4k = require('pitchfork')

    Search

    A Search constructor that extends EventEmitter. Listeners can be attached to the ‘ready’ event which will fire when all reviews have been fetched and parsed. For example:

    var p = require('pitchfork')
    var s = new p.Search('wilco')
    
    s.on('ready', function(results){
      console.log("results", results)
    })
    
    //=> [ {Review}, {Review}, {Review}, ... ]

    .results

    An Array of Review objects.

    .init()

    Called once when Search is instantiated to fetch results. Not usually called directly

    Page

    A Page constructor that extends EventEmitter. This constructor takes an integer argument specifying which page of reviews you wish to fetch from /reviews/albums/:page_num. Listeners can be attached to the ‘ready’ event which will fire when all reviews have been fetched and parsed. For example, this would return all the most recent reviews:

    var p = require('pitchfork')
    var s = new p.Page(1)
    
    s.on('ready', function(results){
      console.log("results", results)
    })
    
    //=> [ {Review}, {Review}, {Review}, ... ]

    Review

    The Review constructor encapsulates methods and data relating to the Pitchfork review. The Review extends EventEmitter and fires a ‘ready’ event when the review has been fetched and parsed.

    .attributes

    An Object with information about the album and its text. Sample below:

    {
      "url": "/reviews/albums/9419-the-letting-go/",
      "name": "Bonnie \"Prince\" Billy - The Letting Go",
      "artist": "Bonnie \"Prince\" Billy",
      "album": "The Letting Go",
      "title": "Bonnie \"Prince\" Billy: The Letting Go | Album Reviews | Pitchfork",
      "label": "Palace / Drag City",
      "year": "2006",
      "score": 8.2,
      "cover": "http://cdn.pitchfork.com/albums/9255/homepage_large.e8a2bd20.jpg",
      "author": "Mark Richardson",
      "date": "September 18, 2006",
      "editorial": {
        "text": "...",
        "html": "..."
    }

    .fetch()

    This method is automatically called when the Review is instantiated and returns a Promise. This generally isn’t called directly.

    .promise

    This stores the thennable promise object generated by .fetch for attaching .then-style callbacks.

    .verbose()

    The full Review instance represented as JSON.

    {
      "url": "/reviews/albums/9419-the-letting-go/",
      "name": "Bonnie \"Prince\" Billy - The Letting Go",
      "artist": "Bonnie \"Prince\" Billy",
      "album": "The Letting Go",
      "title": "Bonnie \"Prince\" Billy: The Letting Go | Album Reviews | Pitchfork",
      "label": "Palace / Drag City",
      "year": "2006",
      "score": 8.2,
      "cover": "http://cdn.pitchfork.com/albums/9255/homepage_large.e8a2bd20.jpg",
      "author": "Mark Richardson",
      "date": "September 18, 2006",
      "editorial": {
        "html": " <p>Though Will Oldham began his musical career while in his early twenties, ... deep absorption or self-reflection so much as a kind of fond familiarity. </p> ",
        "text": " Though Will Oldham began his musical career while in his early twenties ... deep absorption or self-reflection so much as a kind of fond familiarity.  "
      }
    }

    .truncated()

    The attributes of the Review instance with editorial.html/editorial.text condensed into the first 300 characters of of the text assigned to the key ‘.text’.

    {
      "url": "/reviews/albums/9419-the-letting-go/",
      "name": "Bonnie \"Prince\" Billy - The Letting Go",
      "artist": "Bonnie \"Prince\" Billy",
      "album": "The Letting Go",
      "title": "Bonnie \"Prince\" Billy: The Letting Go | Album Reviews | Pitchfork",
      "label": "Palace / Drag City",
      "year": "2006",
      "score": 8.2,
      "cover": "http://cdn.pitchfork.com/albums/9255/homepage_large.e8a2bd20.jpg",
      "author": "Mark Richardson",
      "date": "September 18, 2006",
      "text": " Though Will Oldham began his musical career while in his early twenties, he's never exactly sounded young. From his first releases as Palace Music, Oldham's whiskey-soaked vocals and lyrical obsessions with death, sex, and religion have made \"maturity\" something of a non-issue. And yet, with his mo..."
    }

    .text_pretty_print()

    Prints a plain-text representation of the review.

    
    

    CLI (Command-Line Interface)

    Returns a review for a given artist and album title.

    $ pitchfork wilco 'yankee hotel foxtrot'
    # { ... pretty-printed, colorized quasi-JSON object... }

    or you can use -a and -t flags.

    $ pitchfork -a wilco -t 'yankee hotel foxtrot'
    # { ... pretty-printed, colorized quasi-JSON object... }

    Returns a list of reviews for a given artist with no album.

    $ pitchfork -a 'wilco'
    # [ 
    #    { ... pretty-printed, colorized quasi-JSON object... },
    #    { ... pretty-printed, colorized quasi-JSON object... },
    #    { ... pretty-printed, colorized quasi-JSON object... }
    # ]

    For valid, uncolored JSON, use the –json flag:

    $ pitchfork -a 'wilco' -t 'yankee hotel foxtrot' --json
    # { ... valid JSON object... }

    Flags

    flag(s) required argument description
    -a y artist_name returns a review by given artist
    -t album_title returns a review by given album title
    -j,–json returns review attributes as un-prettified json
    -v, –verbose returns review entire object as json
    -V, –version returns version number
    -T,–truncated returns a truncated json object of the review attributes
    -tx,–text returns a text version of review (ex: to pipe output to ‘less’ )
    -p page_number returns a list of reviews located on the specified page


    Visit original content creator repository

  • aemdesign-aem-support

    aemdesign-aem-support

    build_status Quality Gate Status codecov Maven Central github license github issues github last commit github repo size github repo size github release Visit AEM.Design Gitter

    A set of content and support projects that should be deploy alongside aemdesign-aem-support.

    Documentation

    Contributing

    Contributions are welcome! Read the Contributing Guide for more information.

    Available Components

    Detailed table of component can be found here Component List.

    Component Category Link
    Cloud Services / Rest Rest
    Cloud Services / Salesforce API Salesforce API
    Common / Redirection Notification Redirection Notification
    Common / Static Content Include Static Content Include
    Common / Timing Component Timing Component
    Content / File Download Link File Download Link
    Content / Embed Source Embed Source
    Content / External External
    Content / Link Link
    Content / Content Reference Content Reference
    Content / Table Table
    Content / Rich Text Rich Text
    Content / Tool Tip Tool Tip
    Content / Page Author Page Author
    Content / Page Date Page Date
    Content / Page Description Page Description
    Content / Page Tags Page Tags
    Content / Page Title Page Title
    Details / Contact Details Contact Details
    Details / Event Details Event Details
    Details / Location Details Location Details
    Details / News Details News Details
    Details / Page Details Page Details
    Layout / Article Article
    Layout / Aside Aside
    Layout / Breadcrumb Breadcrumb
    Layout / Columns Columns
    Layout / Content Block Content Block
    Layout / Content Block Lock Content Block Lock
    Layout / Content Block Menu Content Block Menu
    Layout / Content Tabs Content Tabs
    Layout / Footer Footer
    Layout / Header Header
    Layout / Nav Bar Nav Bar
    Layout / Container Container
    Lists / Asset List Asset List
    Lists / Contact List Contact List
    Lists / Event List Event List
    Lists / Lang Nav Lang Nav
    Lists / List List
    Lists / List Nav List Nav
    Lists / Location List Location List
    Lists / News List News List
    Lists / Page List Page List
    Lists / Search Results List Search Results List
    Lists / Tag List Tag List
    Lists / Nav List Nav List
    Media / Audio Audio
    Media / Image Image
    Media / Video Video
    Analytics / Analytics Data Layer Analytics Data Layer
    Template / AEM.Design Base Page AEM.Design Base Page
    Template / Cloud Config / AddThis AddThis
    Template / Cloud Config / Google Analytics Google Analytics
    Template / Cloud Config / Google Maps Google Maps
    Template / Column / AEM.Design One Column Page AEM.Design One Column Page
    Template / Column / AEM.Design Three Column Page AEM.Design Three Column Page
    Template / Column / AEM.Design Two Column Page AEM.Design Two Column Page
    Template / Common / Design Importer Design Importer
    Template / Experience Fragment / AEM.Design Experience Fragment AEM.Design Experience Fragment
    Widgets / AddThis / Addthis Button Addthis Button
    Widgets / Online Media Online Media
    Widgets / Search Box Search Box
    Workflow / Process Payload Process Payload
    Workflow / Project Task Manager Project Task Manager
    Workflow / Project Update Project Update
    Workflow / Rest Rest
    Workflow / Salesforce API Salesforce API
    Workflow / Send Email Send Email
    Coral / Common/Form / Tag Field Tag Field
    Coral / Datasources / Forms Forms
    Coral / Datasources / Tags Tags
    Coral / Foundation / Accordion Accordion
    Coral / Widgets/Form / Asset Options Asset Options

    Component Versioning

    The components’ versioning scheme is documented on the AEM Core WCM Components’ versioning policies wiki page.

    System Requirements

    The latest version of the Core Components, require the below system requirements:

    AEM Version 2.0.0
    6.4 yes
    6.5 yes

    Installation

    To install everything, excluding examples, the released aggregate package aemdesign-aem-support-deploy can be installed via the AEM Package Manager.

    For more information about the Package Manager please have a look at How to Work With Packages documentation page.

    Package Dependencies

    Following packages are dependencies and should be installed on your AEM instance before installing AEM.Design:

    Build

    The project has the following requirements:

    • Java SE Development Kit 8 or Java SE Development Kit 11
    • Apache Maven 3.3.1 or newer

    For ease of build and installation the following profiles are provided:

    • deploymentpackage – activates packaging of aemdesign-aem-support-deploy
    • installdeploymentpackage – installs the deploy package/bundle to an existing AEM author instance

    You can use helper script for ease of local deployment

    • deploy-local – deploy aemdesign-aem-support-deploy package to your local AEM instance running on port 4502
    • deploy-local-publish – deploy aemdesign-aem-support-deploy package to your local AEM instance running on port 4503

    UberJar

    This project relies on the AEM 6.4 cq-quickstart. This is publicly available on https://repo.adobe.com

    For more details about the UberJar please head over to the How to Build AEM Projects using Apache Maven documentation page.

    Include core components into your own project maven build

    To add core components to your project, you will need to add it to your maven build. The released version of the framework are available on the public maven repository at https://repo1.maven.org/maven2/design/aem/aemdesign-aem-support-deploy/

    To include the deploy package into your own project’s maven build using maven you can add the dependency to your pom.xml like this

    <dependency>
        <groupId>design.aem</groupId>
        <artifactId>aemdesign-aem-support-deploy</artifactId>
        <type>zip</type>
        <version>2.0.100</version>
    </dependency>
    

    and then add this subpackage to your sub package section

     <subPackage>
         <groupId>design.aem</groupId>
         <artifactId>aemdesign-aem-support-deploy</artifactId>
         <filter>true</filter>
     </subPackage>
    

    inside the configuration of the content-package-maven-plugin.

    Development Notes

    Following section describes some of the development topics

    Release Versions

    Release versions are automated and based on Tags and Commit count from Tag using the git describe command

    To test git versioning run

    git describe

    this will show you generated version message with latest tag and how many commits since tag.

    If you get an error:

    fatal: No annotated tags can describe

    create or overwrite an existing tag with a message:

    git tag 1.0 1.0^{} -f -m "initial tag"

    Version Convention

    Version numbers for Git Tags should follow semver format:

    • MAJOR version when you make incompatible API changes,
    • MINOR version when you add functionality in a backwards-compatible manner, and
    • PATCH version is automatically generated based on git commit count from last Tag

    Please use MAJOR and MINOR version in Tags, PATCH version will be automatically added as a commit count since the last tag using the git describe.

    Release history

    Please review Versions for all version history

    Visit original content creator repository
  • oui-lookup

    MAC address OUI lookup script

    Recipe for a self-contained script to look up OUIs.

    Simply:

    make
    

    This will create a oui-lookup.sh script. The script comes with a greppable OUI
    database appended to itself and requires no external dependencies to run, aside
    from standard Unix utilities.

    To generate the script and also install it locally as oui-lookup:

    make install                    # will install at ~/.local/bin
    

    To choose a custom install prefix:

    PREFIX=/usr/local make install  # will install at /usr/local/bin
    

    Usage

    To search for a prefix, use hexadecimal notation. Regexps are not accepted.

    % oui-lookup 001122
    001122  CIMSYS Inc
    

    The prefix needs not be 3 octets long. It can be shorter, which will match many
    entries. Or it can be longer, so you can mindlessly pass full addresses.

    # Full address search.
    % oui-lookup 001122334455
    001122  CIMSYS Inc
    
    # Shorter prefix search.
    % oui-lookup 001 | sort | head
    001000  CABLE TELEVISION LABORATORIES, INC.
    001001  Citel
    001002  ACTIA
    001003  IMATRON, INC.
    001004  THE BRANTLEY COILE COMPANY,INC
    001005  UEC COMMERCIAL
    001006  Thales Contact Solutions Ltd.
    001007  Cisco Systems, Inc
    001008  VIENNA SYSTEMS CORPORATION
    001009  HORANET
    

    The format accepts common separators between any two octets.

    % oui-lookup 00-11-22-33-44-55
    001122  CIMSYS Inc
    % oui-lookup 00:11:22:33:44:55
    001122  CIMSYS Inc
    % oui-lookup 0011.2233.4455
    001122  CIMSYS Inc
    % oui-lookup 0011.22-3344:55
    001122  CIMSYS Inc
    

    You can also search by organization. Regexps are accepted in this case, and
    they are implicitly case-insensitive and left-anchored.

    % oui-lookup -O xerox | sort | head -n3
    000000  XEROX CORPORATION
    000001  XEROX CORPORATION
    000002  XEROX CORPORATION
    
    % oui-lookup -O corp
    8427CE  Corporation of the Presiding Bishop of The Church of Jesus Christ of Latter-day Saints
    28CCFF  Corporacion Empresarial Altra SL
    00C0B5  CORPORATE NETWORK SYSTEMS,INC.
    
    # Explicitly right-anchored using .* and $.
    % oui-lookup -O '.*[ ]spa$' | sort | head -n3
    00020A  Gefran Spa
    000313  Access Media SPA
    000350  BTICINO SPA
    

    Update the OUI database

    To update the script to the latest OUI database available from the Internet:

    make -B
    

    To update and reinstall in one step:

    make -B install
    

    Pre-compiled

    You can find a pre-compiled but not up-to-date copy of oui-lookup.sh in
    the releases page.

    Copying

    Public Domain.

    Visit original content creator repository

  • would-you-rather

    Would You Rather

    Netlify Status

    Would You Rather is a Questionnaire App that allows you to ask and answer questions about what you rather between only two options, you can answer your own question or any other user’s question, add and ask a new question to other users, also you can access the leaderboard page to see the active state of the users according to their score.

    You can view the App from here

    Screenshot

    Demo

    would-you-rather-ask-answer-quetions-google-chrome-2021-09-07-21-25-49_P1qz9veA.mp4

    Instructions, Building & Get Started

    - 1- Fork, clone or download this repository to your local machine.
    - 2- Be sure that you install the Node.js environment in your machine.
    - 3- Open your terminal and be sure that you are inside the correct destination of the App, while you must be in the same path of the package.json file.
    - 4- Inside your terminal run these commands:-
    
        * to install dependencies.
        ```
        npm install
        ```
        * to start the server.
        ```
        npm start
        ```
    - 5- Once the App server is running, visit (localhost:3000) in the browser to view the App and now you can treat with it as shown above in the Demo.
    - 6- You can also see a live preview of the App from this Link (https://would-you-rather14.netlify.app/)
    

    Pages

    • Login
    • Dashboard
    • Leaderboard
    • New Question
    • Question
    • 404

    Built with

    • HTML
    • CSS
    • JS

    Libraries & Packages

    Frameworks

    Notices & Overview about the App

    • This App is a practical project from Udacity Course Nanodegree Program – Web Development Advanced Track

    • The App depends on a fake static database, using customized methods to send requests and get questions from this database.

    • You have the ability to login with the option of 3 users in the login form, and you have to choose one user to be able to access the internal pages of the App.

    • The App contains of 404 page which will be rendered if the user tries to access a not available page.

    • Due to dealing with fake static database, so if you try to reload the App at any time, your progress in the App about adding or answering questions will be lost, and the data will be reset to its initial state.

    • The _DATA.js file represents the fake static database and the methods that let you access this database.

    • There are two types of objects stored in the fake static database: [Questions & Users]

    • The App contacts with the database via 4 methods:

      • _getUsers()
      • _getQuestions()
      • _saveQuestion(question)
      • _saveQuestionAnswer(object)

      1. _getUsers() Method: Description: Get all of the existing users from the database.
        Return Value: Object where the key is the user’s id and the value is the user object.

      2. _getQuestions() Method: Description: Get all of the existing questions from the database.
        Return Value: Object where the key is the question’s id and the value is the question object.

      3. _saveQuestion(question) Method: Description: Save the polling question in the database.
        Parameters: Object that includes the following properties: author, optionOneText, and optionTwoText. Return Value: An object that has the following properties: id, author, optionOne, optionTwo, timestamp.

      4. _saveQuestionAnswer(object) Method: Description: Save the answer to a particular polling question in the database. Parameters: Object that contains the following properties: authedUser, qid, and answer.

    • Finally, you can consider this App as a reference and strong practical & revision to understand the working logic of redux, react-redux & middleware like redux-thunk and how they interact with a react App.

    Certificate

    Course Certificate

    Author

    Contact me through my social accounts

    License

    Licensed under the MIT License

    Visit original content creator repository
  • conflict-juggler.nvim

    conflict-juggler.nvim

    This project took inspiration from the VSCode extension Conflict Squeezer.

    Over the years working with Git, I’ve had to resolve many merge conflicts. When I used VSCode, the Conflict Squeezer extension saved me a lot of time on the more challenging merge conflicts. After moving on to Neovim, I started missing this functionality so much that I decided to rewrite it. One late night later and a bit less hair on my head, here it is!

    Features

    This plugin creates a command called ConflictJuggler that:

    • Scans the current buffer and removes the conflict markers when both sides of the conflict are the same.

    • Simplifies the conflict when the start or the end are the same, moving the matching lines out of the block.

    • Supports nested conflict markers (WOW! 🤩)

    Installation

    You can install this plugin with the plugin manager of your choice. Here are a few examples:

    Lazy

    { 'pv-hernandez/conflict-juggler.nvim' }

    Plug

    Plug 'pv-hernandez/conflict-juggler.nvim'

    Usage

    To use this plugin you just need to run the command :ConflictJuggler on a buffer with conflict markers. The conflict block will get simplified.

    The conflict below:

    <<<<<<< HEAD
    aaa
    bbb
    =======
    bbb
    >>>>>>> remote
    

    Becomes:

    <<<<<<< HEAD
    aaa
    =======
    >>>>>>> remote
    bbb
    

    The strategy is to make both sides of the conflict match so that the lines get moved by the plugin. So say we want the final file to have the “aaa” line. We add that line to the “remote” part of the conflict:

    <<<<<<< HEAD
    aaa
    =======
    aaa
    >>>>>>> remote
    bbb
    

    And run the command again:

    aaa
    bbb
    

    This is a small example but it get really useful when the conflict blocks span tens or hundreds of lines, most of them are the same with indentation changes or some other small change that is hard to spot quickly.

    Real world example

    A Flutter project is an example of code base where this kind of conflict happens frequently, because of the amount of nested objects you create. In this example one change added a Theme around the widget tree, and another change added a Column around the widget tree. The entire tree got indented by a different amount in each change, so the conflict block spans the entire build method:

    Widget build(BuildContext context) {
    <<<<<<< HEAD
        return Theme(
            data: ...,
            child: A(
                child: B(
                    children: [
                        C(),
                        // Many items
                        C(),
                    ],
                ),
            ),
    |||||||
        return A(
            child: B(
                children: [
                    C(),
                    // Many items
                    C(),
                ],
            ),
    =======
        return Column(
            children: [
                A(
                    child: B(
                        children: [
                            C(),
                            // Many items
                            C(),
                        ],
                    ),
                ),
            ],
    >>>>>>> remote
        );
    }

    It is difficult to know if there are more changes in the middle of the widget tree by just looking at the conflict block, so we make the start and the end of the changes the same and run the command :ConflictJuggler:

    Widget build(BuildContext context) {
    <<<<<<< HEAD
        return Theme(
            data: ...,
            child: Column(
                children: [
                    A(
                        child: B(
                            children: [
                                C(),
                                // Many items
                                C(),
                            ],
                        ),
                    ),
                ],
            ),
    |||||||
        return A(
            child: B(
                children: [
                    C(),
                    // Many items
                    C(),
                ],
            ),
    =======
        return Theme(
            data: ...,
            child: Column(
                children: [
                    A(
                        child: B(
                            children: [
                                C(),
                                // Many items
                                C(),
                            ],
                        ),
                    ),
                ],
            ),
    >>>>>>> remote
        );
    }

    Widget build(BuildContext context) {
        return Theme(
            data: ...,
            child: Column(
                children: [
                    A(
                        child: B(
                            children: [
                                C(),
    <<<<<<< HEAD
                                // Many items
    |||||||
        return A(
            child: B(
                children: [
                    C(),
                    // Many items
                    C(),
                ],
            ),
    =======
                                // Many items
    >>>>>>> remote
                                C(),
                            ],
                        ),
                    ),
                ],
            ),
        );
    }

    The conflict makers move closer together, around one part of the widget tree that is different between both sides. Now you can keep making both sides match and running the command until the conflict is gone.

    This process avoids missing on small changes in the middle of the conflict block.

    If you like this plugin, don’t forget to share it with others!

    Visit original content creator repository