Blog

  • BONAI

    BONAI

    This is the official code for the BONAI (TPAMI 2022). BONAI (Buildings in Off-Nadir Aerial Images) is a dataset for building footprint extraction (BFE) in off-nadir aerial images.

    [Paper] [Dataset]

    Description

    BONAI contains 268,958 building instances across 3,300 aerial images with fully annotated instance-level roof and footprint for each building as well as the corresponding offset vector. Compared to BONAI, existing BFE datasets only annotate building footprints.

    The images of BONAI are taken from six representative cities of China, i.e., Shanghai, Beijing, Harbin, Jinan, Chengdu, and Xi’an, the detailed number of images and object instances per image set and city are reported in the below table.

    Download

    You can download the dataset on Google Driver.

    Evaluation

    Training, Validation and Testing sets are publicly available. The evaluation code has been updated in bonai_evaluation.py. You can evaluate the model by:

    python tools/bonai/bonai_evaluation.py --version bc_v100.02.08 --model bc_v100.02.08_offset_rcnn_r50_2x_public_20201028_rotate_offset_4_angles_without_image_rotation --city shanghai_xian_public
    

    Note: Installing the bstool code library is required to run the evaluation code.

    LOFT & FOA

    The codes of LOFT and FOA is now publicly available. You can refer to MMDetection to install and run this project.

    Contact

    This repo is currently maintained by Jinwang Wang (jwwangchn@whu.edu.cn).

    Citing

    If you use BONAI dataset, codebase or models in your research, please consider cite.

    @article{wang2022bonai,
      author={Wang, Jinwang and Meng, Lingxuan and Li, Weijia and Yang, Wen and Yu, Lei and Xia, Gui-Song},
      journal={IEEE Transactions on Pattern Analysis and Machine Intelligence}, 
      title={Learning to Extract Building Footprints from Off-Nadir Aerial Images}, 
      year={2022},
      volume={},
      number={},
      pages={1-1},
      doi={10.1109/TPAMI.2022.3162583}}
    
    Visit original content creator repository https://github.com/jwwangchn/BONAI
  • BONAI

    BONAI

    This is the official code for the BONAI (TPAMI 2022). BONAI (Buildings in Off-Nadir Aerial Images) is a dataset for building footprint extraction (BFE) in off-nadir aerial images.

    [Paper] [Dataset]

    Description

    BONAI contains 268,958 building instances across 3,300 aerial images with fully annotated instance-level roof and footprint for each building as well as the corresponding offset vector. Compared to BONAI, existing BFE datasets only annotate building footprints.

    The images of BONAI are taken from six representative cities of China, i.e., Shanghai, Beijing, Harbin, Jinan, Chengdu, and Xi’an, the detailed number of images and object instances per image set and city are reported in the below table.

    Download

    You can download the dataset on Google Driver.

    Evaluation

    Training, Validation and Testing sets are publicly available. The evaluation code has been updated in bonai_evaluation.py. You can evaluate the model by:

    python tools/bonai/bonai_evaluation.py --version bc_v100.02.08 --model bc_v100.02.08_offset_rcnn_r50_2x_public_20201028_rotate_offset_4_angles_without_image_rotation --city shanghai_xian_public
    

    Note: Installing the bstool code library is required to run the evaluation code.

    LOFT & FOA

    The codes of LOFT and FOA is now publicly available. You can refer to MMDetection to install and run this project.

    Contact

    This repo is currently maintained by Jinwang Wang (jwwangchn@whu.edu.cn).

    Citing

    If you use BONAI dataset, codebase or models in your research, please consider cite.

    @article{wang2022bonai,
      author={Wang, Jinwang and Meng, Lingxuan and Li, Weijia and Yang, Wen and Yu, Lei and Xia, Gui-Song},
      journal={IEEE Transactions on Pattern Analysis and Machine Intelligence}, 
      title={Learning to Extract Building Footprints from Off-Nadir Aerial Images}, 
      year={2022},
      volume={},
      number={},
      pages={1-1},
      doi={10.1109/TPAMI.2022.3162583}}
    

    Visit original content creator repository
    https://github.com/jwwangchn/BONAI

  • parking-sensor

    A parking sensor

    This is my first foray into this kind of computing. I’ve had a couple of Arduinos for years and have never done anything with them other than blink. My best buddy is a teacher in the Pacific Northwest and built a split-flap display. He has to jump through some hoops to use it, and I think I could make it much more efficient. But to help him, I needed to gain some experience with this kind of programming. This is the result.

    I occasionally have difficulty judging how far into the garage I am. Sure, I could command tape a marker to the garage wall or use the car’s own parking sensor to tell me I’m getting close to the wall. But that’s no fun.

    parking.sensor.demo.mp4

    The Device

    sideOn

    Here’s a list of the parts I used:

    Name Link Notes
    SparkFun Thing Plus – Artemis https://www.sparkfun.com/products/15574
    SparkFun Qwiic Mini dToF Imager – TMF8820 https://www.sparkfun.com/products/19218
    SparkFun Qwiic LED Stick – APA102C https://www.sparkfun.com/products/18354
    Waterproof Outdoor Electrical Box https://www.amazon.com/dp/B0D2H8ZPG7 The mounting board inside makes it easy to add stand-offs. The distance sensor couldn’t see through the cover, hence the rough opening.
    SparkFun Qwiic Alphanumeric Display – Red https://www.sparkfun.com/products/16916 Debug display, not required.
    16-foot USB-A to USB-C right-angle cable. https://www.amazon.com/dp/B09ZTWHFHF The right-angle feature isn’t required.

    Notes:

    debugDisplay

    The alphanumeric display is helpful for testing but not required for “production.”

    I attempted to use a POE cable set, but it never seemed to provide enough power to operate the whole device.

    The Code

    The source code is very straightforward, and the libraries to control things are easy to use. But I did run into a couple of interesting issues:

    • Getting the light to turn off after the car has been parked
    • Tuning the distance sensor’s confidence values to judge if there’s something in it’s field of view and not a weird reflection
    • Getting the animations to look right
    Visit original content creator repository https://github.com/lazymutt/parking-sensor
  • parking-sensor

    A parking sensor

    This is my first foray into this kind of computing. I’ve had a couple of Arduinos for years and have never done anything with them other than blink. My best buddy is a teacher in the Pacific Northwest and built a split-flap display. He has to jump through some hoops to use it, and I think I could make it much more efficient. But to help him, I needed to gain some experience with this kind of programming. This is the result.

    I occasionally have difficulty judging how far into the garage I am. Sure, I could command tape a marker to the garage wall or use the car’s own parking sensor to tell me I’m getting close to the wall. But that’s no fun.


    parking.sensor.demo.mp4


    The Device

    sideOn

    Here’s a list of the parts I used:

    Name Link Notes
    SparkFun Thing Plus – Artemis https://www.sparkfun.com/products/15574
    SparkFun Qwiic Mini dToF Imager – TMF8820 https://www.sparkfun.com/products/19218
    SparkFun Qwiic LED Stick – APA102C https://www.sparkfun.com/products/18354
    Waterproof Outdoor Electrical Box https://www.amazon.com/dp/B0D2H8ZPG7 The mounting board inside makes it easy to add stand-offs. The distance sensor couldn’t see through the cover, hence the rough opening.
    SparkFun Qwiic Alphanumeric Display – Red https://www.sparkfun.com/products/16916 Debug display, not required.
    16-foot USB-A to USB-C right-angle cable. https://www.amazon.com/dp/B09ZTWHFHF The right-angle feature isn’t required.

    Notes:

    debugDisplay

    The alphanumeric display is helpful for testing but not required for “production.”

    I attempted to use a POE cable set, but it never seemed to provide enough power to operate the whole device.

    The Code

    The source code is very straightforward, and the libraries to control things are easy to use. But I did run into a couple of interesting issues:

    • Getting the light to turn off after the car has been parked
    • Tuning the distance sensor’s confidence values to judge if there’s something in it’s field of view and not a weird reflection
    • Getting the animations to look right

    Visit original content creator repository
    https://github.com/lazymutt/parking-sensor

  • rpi-k3s

    k3s on a Raspberry Pi

    Build Status

    This repository contains Packer templates and scripts to build a Raspbian image with k3s pre-installed.

    k3s: Lightweight Kubernetes. Easy to install, half the memory, all in a binary less than 100 MB.

    Beside k3s, also cloud-init is available to initialize and configure a Raspian instance. With cloud-init you can customize e.g. hostname, authorized ssh keys, a static ip, token for k3s, …

    This setup includes the following images:

    • k3s-agent.img: a Raspbian image with k3s as a systemd service, configured to run as agent (k3s agent).

    • k3s-server.img: a Raspbian image with k3s as a systemd service, configured to run as server (k3s server).

    How to use these images

    1. Download the image of the latest release or build the image.

    2. Flash the image to an SD card.

    3. Customize the /boot/user-data with e.g. authorized ssh keys, k3s environment variables …

    4. Insert the SD card into the Raspberry Pi and power it up.

    5. A few moments later, the k3s will be up and running

    Building a k3s cluster

    Preparing the master node

    After downloading and writing the image to an SD card, edit the cloud-init /boot/user-data file to:

    • configure a hostname

    • configure the k3s token

    • configure a static ip address

    E.g.

    #cloud-config
    # vim: syntax=yaml
    #
    
    # Set your hostname here, the manage_etc_hosts will update the hosts file entries as well
    hostname: k3s-server
    manage_etc_hosts: true
    
    write_files:
    # Configure k3s environment file
    - path: /etc/systemd/system/k3s.service.env
      content: |
        K3S_TOKEN=i1F2tDzvHQsWvy5MnDsF
        K3S_KUBECONFIG_OUTPUT=/etc/k3s/kubeconfig.yaml
        K3S_KUBECONFIG_MODE=666
    # Configure a static ip address for the master
    - path: /etc/dhcpcd.conf
      content: |
        persistent
        # Generate Stable Private IPv6 Addresses instead of hardware based ones
        slaac private
    
        # static IP configuration:
        interface eth0
        static ip_address=192.168.0.30/24
        static routers=192.168.0.1
        static domain_name_servers=192.168.0.1 8.8.8.8
    

    Preparing the agent nodes

    After downloading and writing the image to an SD card, edit the cloud-init /boot/user-data file to:

    • configure a hostname

    • configure the k3s token

    • configure the k3s url (to join the master node)

    E.g.

    #cloud-config
    # vim: syntax=yaml
    #
    
    # Set your hostname here, the manage_etc_hosts will update the hosts file entries as well
    hostname: k3s-agent
    manage_etc_hosts: true
    
    write_files:
    # Configure k3s environment file
    - path: /etc/systemd/system/k3s.service.env
      content: |
        K3S_TOKEN=i1F2tDzvHQsWvy5MnDsF
        K3S_URL=https://192.168.0.30:6443
    

    If you are adding multiple agents, make sure you give them unique hostnames!

    pro tip:

    flash is a command line script to write SD card images of any kind, with handy features like adding user-data and setting the hostname.

    E.g.

    flash --hostname k3s-server --user-data example/k3s-server.yaml dist/k3s-server.img
    flash --hostname k3s-agent-001 --user-data example/k3s-agent.yaml dist/k3s-agent.img
    flash --hostname k3s-agent-002 --user-data example/k3s-agent.yaml dist/k3s-agent.img
    flash --hostname k3s-agent-003 --user-data example/k3s-agent.yaml dist/k3s-agent.img
    

    Accessing your cluster

    After booting the master and agents, ssh into your master node to get the kubeconfig file located at e.g. /etc/k3s/kubeconfig.yaml, depending on the K3S_KUBECONFIG_OUTPUT variable. Use this file to configure kubectl and you are good to go.

    Building the images

    This project includes a Vagrant file and some scripts to build the images in an isolated environment.

    To use the Vagrant environment, start by cloning this repository:

    git clone https://github.com/jsiebens/rpi-k3s
    cd rpi-k3s
    

    Next, start the Vagrant box and ssh into it:

    vagrant up
    vagrant ssh
    

    When connected with the Vagrant box, run make in the /vagrant directory:

    cd /vagrant
    make
    

    Visit original content creator repository
    https://github.com/jsiebens/rpi-k3s

  • meomatch

    Meoʍatch: Flip & Match the Cats

    meomatch_readmepic

    Meoʍatch is a cat-themed memory game where players flip cards to match random cat images or gifs. It features local multiplayer for shared fun, score tracking, card shuffling for a fresh challenge each round, and a helpful guide to get started. You can also switch between light and dark themes. Website also works perfectly in mobile devices Meoʍatch

    Features

    • 🐱 Cat-Themed Matching: Flip cards to match random cat images and gifs.
    • 👥 Local Multiplayer: Play with a friend in turn-based mode.
    • 🏆 Score Tracking: Keep track of your best scores.
    • 🔄 Shuffle Cards: Shuffle the deck for a fresh start.
    • 🌓 Light/Dark Mode: Toggle between black and white themes for a personalized look.

    Getting Started

    Prerequisites

    • Node.js (version 12.x or later)
    • npm or yarn

    Installation

    1. Clone the repository:

      git clone https://github.com/tahrijouteyamer/meomatch.git
      cd meomatch
    2. Install dependencies:

      npm install
      # OR
      yarn install
    3. Run the project:

      npm run dev
      # OR
      yarn dev

    License

    This project is licensed under the MIT License. See the LICENSE file for more details.

    Acknowledgements

    Thanks to TheCatAPI for providing the images and gifs used in the game!

    Visit original content creator repository
    https://github.com/tahrijouteyamer/meomatch

  • ruui

    React Universal UI

    Build Status npm version

    Cross-platform (React Native and Web Browser) React, React Native‘s UI components to re-use everywhere.

    Platforms

    Native platforms: iOs, Android (for Mac, Windows or Linux we could just use Atom to bring our React Native code on it’s web and have that same code-base run on Native environment when they got better support for React Native building block).

    Browser support: Chrome, Firefox, Safari >= 7, IE 10, Edge.

    Overview

    React Universal UI” is a cross-platform React’s UI Kit – which could be run on both Web Browser and React Native environment, write once and use everywhere.

    See home page for detailed documentation and tutorials (the site is under construction and will be ready soon)

    require env

    require yarn, react-native-cli

    npm install -g yarn react-native-cli
    

    Quick start

    Existing Web or React Native project:

    1. Install react-universal-ui package (no further config required)
    npm install --save react-universal-ui
    
    1. Install and configure react-native-web using their instruction (optional, only need on Web project)

    2. Wrap your root component under RuuiProvider

    import { RuuiProvider } from 'react-universal-ui';
    import App from './app';
    
    const AppContainer = () => {
      return <RuuiProvider>
        <App/>
      </RuuiProvider>;
    };
    

    New project:

    React Universal UI come with it’s own cli (command line interface), install it by..

    npm install -g ruui-cli
    

    With ruui-cli installed globally.. we should now able to use ruui command to create a new project:

    ruui init SuperCoolProject
    

    This will take a while when cli create the project structure for us as well as install necessary dependencies..

    Run ruui dev under your React Universal UI project folder..

    cd SuperCoolProject
    ruui dev
    

    *note: the project totally generated using react-native-cli, which mean it is a valid React Native project.. we could run it normally with:

    react-native run-ios
    react-native run-android
    

    How it work

    React Native:

    Essentially this is just a normal React Native UI Library – which absolutely work with React Native‘s ecosystem. Feel free to use those UI with your favorite React Native library even if you don’t care about Browser yet (but believe me, you’ll love it – Browser run give us tons of cool stuff).

    Browser:

    React Native Web let us run our React Native code on Browser and React Universal UI (this project) cares about behavior of those components on Browser.

    Universal:

    There’re some differences between React Native and Web building block – such as Routing, Touch/Mouse handling… this project cares and provide support for those differences (there’re helpers under utils module), which save your time and let you focus on write your Universal App.

    Components and status

    • Cross-platform Navigation, Routing integration
      • Native Navigation (based on React Native’s ExperimentalNavigation)
      • React-Router for Web/Native (Full-featured Browser support, fallback to Memory Navigation History for React Native)
      • Redux helpers
    • Context Provider
    • Reactive device common info (e.g Network info, Screen size..)
    • Configurable theme (skin)
    • Switches (exposed from react-native-web)
    • Button Component
      • Ripple effect
      • Fade effect
      • Raised style
      • Icon Button
      • Tooltip (from 12 directions – Web only)
    • Text Input Component (Material-inspired, but highly customizable)
      • Underline effect
      • Floating label
      • Force label-floating
      • Field Error
      • Hint
      • Multi-line
      • Number, currency, datetime masking
      • Tooltip (Web only – Alpha implementation)
    • Multi layer modals
      • Pop-up style (Alert, Prompt..)
      • Full-screen style
    • Dropdown
      • DropdownContainer (similar to a View, but could host a Dropdown component)
      • Configurable dropdown from 12 directions, passing context..
    • Loading Mask
    • Snackbar
    • Selector Api, Select component
    • Animated Tab View
      • Essential module export – for generic use case
      • App intro slider
      • Tab View scene with headers
      • Image slider
    • Action sheets
    • Swipe-able segments
    • Datetime picker
    • Radio
    • Checkbox
    • Range Slider
    • Connection status (mask)

    Related projects

    License

    This project is licensed under the MIT License.

    Contributing

    This project under main support of Rooxim Company.

    We’re exciting to see more contribution from community, by contributing your code to ruui you agree to license your contribution under the MIT license.

    Visit original content creator repository https://github.com/cloudle/ruui
  • ruui

    React Universal UI

    Build Status npm version

    Cross-platform (React Native and Web Browser) React, React Native‘s UI components to re-use everywhere.

    Platforms

    Native platforms: iOs, Android (for Mac, Windows or Linux we could just use Atom to bring our React Native code on it’s web and have that same code-base run on Native environment when they got better support for React Native building block).

    Browser support: Chrome, Firefox, Safari >= 7, IE 10, Edge.

    Overview

    React Universal UI” is a cross-platform React’s UI Kit – which could be run on both Web Browser and React Native environment, write once and use everywhere.

    See home page for detailed documentation and tutorials (the site is under construction and will be ready soon)

    require env

    require yarn, react-native-cli

    npm install -g yarn react-native-cli
    

    Quick start

    Existing Web or React Native project:

    1. Install react-universal-ui package (no further config required)
    npm install --save react-universal-ui
    
    1. Install and configure react-native-web using their instruction (optional, only need on Web project)

    2. Wrap your root component under RuuiProvider

    import { RuuiProvider } from 'react-universal-ui';
    import App from './app';
    
    const AppContainer = () => {
      return <RuuiProvider>
        <App/>
      </RuuiProvider>;
    };
    

    New project:

    React Universal UI come with it’s own cli (command line interface), install it by..

    npm install -g ruui-cli
    

    With ruui-cli installed globally.. we should now able to use ruui command to create a new project:

    ruui init SuperCoolProject
    

    This will take a while when cli create the project structure for us as well as install necessary dependencies..

    Run ruui dev under your React Universal UI project folder..

    cd SuperCoolProject
    ruui dev
    

    *note: the project totally generated using react-native-cli, which mean it is a valid React Native project.. we could run it normally with:

    react-native run-ios
    react-native run-android
    

    How it work

    React Native:

    Essentially this is just a normal React Native UI Library – which absolutely work with React Native‘s ecosystem. Feel free to use those UI with your favorite React Native library even if you don’t care about Browser yet (but believe me, you’ll love it – Browser run give us tons of cool stuff).

    Browser:

    React Native Web let us run our React Native code on Browser and React Universal UI (this project) cares about behavior of those components on Browser.

    Universal:

    There’re some differences between React Native and Web building block – such as Routing, Touch/Mouse handling… this project cares and provide support for those differences (there’re helpers under utils module), which save your time and let you focus on write your Universal App.

    Components and status

    • Cross-platform Navigation, Routing integration
      • Native Navigation (based on React Native’s ExperimentalNavigation)
      • React-Router for Web/Native (Full-featured Browser support, fallback to Memory Navigation History for React Native)
      • Redux helpers
    • Context Provider
    • Reactive device common info (e.g Network info, Screen size..)
    • Configurable theme (skin)
    • Switches (exposed from react-native-web)
    • Button Component
      • Ripple effect
      • Fade effect
      • Raised style
      • Icon Button
      • Tooltip (from 12 directions – Web only)
    • Text Input Component (Material-inspired, but highly customizable)
      • Underline effect
      • Floating label
      • Force label-floating
      • Field Error
      • Hint
      • Multi-line
      • Number, currency, datetime masking
      • Tooltip (Web only – Alpha implementation)
    • Multi layer modals
      • Pop-up style (Alert, Prompt..)
      • Full-screen style
    • Dropdown
      • DropdownContainer (similar to a View, but could host a Dropdown component)
      • Configurable dropdown from 12 directions, passing context..
    • Loading Mask
    • Snackbar
    • Selector Api, Select component
    • Animated Tab View
      • Essential module export – for generic use case
      • App intro slider
      • Tab View scene with headers
      • Image slider
    • Action sheets
    • Swipe-able segments
    • Datetime picker
    • Radio
    • Checkbox
    • Range Slider
    • Connection status (mask)

    Related projects

    License

    This project is licensed under the MIT License.

    Contributing

    This project under main support of Rooxim Company.

    We’re exciting to see more contribution from community, by contributing your code to ruui you agree to license your contribution under the MIT license.

    Visit original content creator repository https://github.com/cloudle/ruui
  • stashvision

    stashvision

    unsplash.com/@romankraft

    Stashvision is a proof-of-concept private stash indexing tool and overlay for Path of Exile.

    Rationale

    Better search

    Naive stash searching is something many players have complained about over the years, with few solutions other than just dealing with it until GGG develops more powerful searching functionality.

    A number of open source tools exist for searching the stash locally, outside of the game, but it’s just as painful having to lookup the item position in-game.

    Recipe discovery

    Chaos recipes are great for passively making currency, but a time investment trade-off must be made; either play stash tab tetris prior to mapping in an effort to “optimize” rapid stashing of items post-grind, or spend a considerable amount of time (only after your tab(s) are full, granted) searching for the right item classes for each set.

    Maybe GGG will implement some form of a premium recipe fulfilling tab in the distant dystopian future, but until then, the only way to truly optimize vendor recipe discovery (WITHOUT buying 10 quad tabs) is to augment your brain with an AI implant, improving chaos recipe item recognition by a factor of 10. As an added bonus, the AI will be able to discern what killed you in Blight encounters when your screen looks like a bowl of spaghetti.

    Or just use Stashvision.


    Stashvision provides a stash tab item indexing framework and CLI utility for indexing, querying, and recipe scanning your private stash tabs, as well as an AutoHotkey-based overlay that highlights the items at the press of a hotkey.

    No auto-clicking is involved, so Stashvision should be 100% ToS compliant.

    Features

    • Private stash tab indexing and full-text search (powered by Bleve).
    • Customizable stash tab item highlighting for search results and recipes.
    • Portable as heck, the user is not expected to install any developer frameworks or runtimes other than AutoHotkey, which many PoE players have installed regardless for PoE-TradeMacro.
    • Non-intrusive to the game client. Completely hotkey-driven, and absolutely no auto-clicking.

    Caveats

    • Avoid manipulating your stash tabs (or at least the one being scanned) excessively, as updates are nowhere close to real-time. For chaos recipes, the ideal workflow would be to start with a full quad tab, highlight the recipe, move items from the stash to your inventory, vendor, cycle to the next set of items, rinse and repeat, all without moving any items around, or adding new ones to the stash tab.
    • The overlay only works if your game is running in windowed borderless mode. The language will also likely need to be set to English, much like PoE-TradeMacro and other tools that consume PoE’s stash API.

    Screenshots

    Search capability Chaos recipe highlighting

    Quickstart

    1. Download the current version of AutoHotkey (not V2).
    2. Download and extract the latest release of Stashvision.
    3. Copy stashvision.ini.example to stashvision.ini, and fill in your POESESSID, account name, and any other desired configuration.
    4. Run stashvision.ahk.

    Note: Ensure your game client is running in borderless mode, and the language is set to English.

    Default Hotkeys

    shift + alt + c: Highlight chaos recipe in configured stash tab. Subsequent triggers will cycle through multiple recipe item sets. After all sets have been cycled through, a new index scan will occur.

    shift + alt + s: Search and highlight items in configured stash tab.

    escape: Close the overlay or search window.

    Configuration (stashvision.ini)

    Account settings

    [General]
    SessionId = xxx
    AccountName = xxx

    SessionId is your POESESSID.

    Stash settings

    [Stash]
    DumpTabIndex = 0
    DumpTabQuad = true

    Currently, Stashvision only supports searching and highlighting one tab at a time.

    Display

    [Display]
    DefaultHighlightBorder = 0xff1aff1a

    Expected color code format is AARRGGBB.

    Hotkeys

    [Bindings]
    ChaosRecipe = +!c
    Search = +!s

    See AutoHotkey’s documentation on hotkey modifier symbols for more information.

    Indexer application

    Stashvision provides a Golang-based indexer application that can be invoked separately from the AutoHotkey script, to manually manage a local index, search for items, or scan a stash index for sets of items that meet vendor recipe criteria.

    $ ./stashvision.exe
    stashvision - Index and analyze your Path of Exile stash.
    
    commands:
      q, query     query stash items index
      r, recipe    evaluate recipes against index
      s, server    run stash indexing server
    
    usage:
      stashvision query [--json] -s=<querystring>
      stashvision server -s=<poesessionid> -a=<account_name>
    
    arguments:
      --help             show this screen
      --version          show version
    
    

    Search

    See Bleve’s query string syntax for specifics about query string format. Features at a glance include:

    • Boolean queries (prefix items with + or -)
    • Phrase queries (quote phrases with double quotes)
    • Numeric queries (e.g. field:>8, field:<=9, or field:10)

    In addition to robust searching capability, Stashvision adds a number of fields to item metadata that are not easily searchable in-game.

    Note: Due to shortcomings of the indexing library used, Stashvision stores boolean fields as integers. So a query string for identified:true should actually be identified:1.

    Fields

    class
    corrupted
    frameType
    h
    icon
    id
    identified
    ilvl
    inventoryId
    league
    name
    numLinks
    numSockets
    properties
    tabIndex
    typeLine
    verified
    w
    x
    y
    

    Convenience fields

    class: The class name of an item, e.g. Gloves, Body Armour, or Boots.

    numSockets: The total number of sockets on an item.

    numLinks: The name is a bit of a misnomer, as this is really just the maximum number of links across all socket groups.

    Roadmap

    In no particular order…

    • Settings GUI
    • Autocomplete search
    • OAuth
    • Multiple stash tab support
    • Detect in-game stash tab state non-intrusively
    • More vendor recipe support
    • Automatically find item sets (i.e. ring + ring + amulet) that fulfill missing resistance values
    • Total potential chaos recipe reward displayed as another overlay
    Visit original content creator repository https://github.com/darvid/stashvision
  • laravel-queue-rabbitmq

    RabbitMQ Queue driver for Laravel

    Latest Stable Version Build Status Total Downloads License

    Support Policy

    Only the latest version will get new features. Bug fixes will be provided using the following scheme:

    Package Version Laravel Version Bug Fixes Until
    13 9 August 8th, 2023 Documentation

    Installation

    You can install this package via composer using this command:

    composer require vladimir-yuldashev/laravel-queue-rabbitmq
    

    The package will automatically register itself.

    Configuration

    Add connection to config/queue.php:

    This is the minimal config for the rabbitMQ connection/driver to work.

    'connections' => [
        // ...
    
        'rabbitmq' => [
        
           'driver' => 'rabbitmq',
           'hosts' => [
               [
                   'host' => env('RABBITMQ_HOST', '127.0.0.1'),
                   'port' => env('RABBITMQ_PORT', 5672),
                   'user' => env('RABBITMQ_USER', 'guest'),
                   'password' => env('RABBITMQ_PASSWORD', 'guest'),
                   'vhost' => env('RABBITMQ_VHOST', '/'),
               ],
               // ...
           ],
    
           // ...
        ],
    
        // ...    
    ],

    Optional Queue Config

    Optionally add queue options to the config of a connection. Every queue created for this connection, gets the properties.

    When you want to prioritize messages when they were delayed, then this is possible by adding extra options.

    • When max-priority is omitted, the max priority is set with 2 when used.
    'connections' => [
        // ...
    
        'rabbitmq' => [
            // ...
    
            'options' => [
                'queue' => [
                    // ...
    
                    'prioritize_delayed' =>  false,
                    'queue_max_priority' => 10,
                ],
            ],
        ],
    
        // ...    
    ],

    When you want to publish messages against an exchange with routing-keys, then this is possible by adding extra options.

    • When the exchange is omitted, RabbitMQ will use the amq.direct exchange for the routing-key
    • When routing-key is omitted the routing-key by default is the queue name.
    • When using %s in the routing-key the queue_name will be substituted.

    Note: when using an exchange with routing-key, you probably create your queues with bindings yourself.

    'connections' => [
        // ...
    
        'rabbitmq' => [
            // ...
    
            'options' => [
                'queue' => [
                    // ...
    
                    'exchange' => 'application-x',
                    'exchange_type' => 'topic',
                    'exchange_routing_key' => '',
                ],
            ],
        ],
    
        // ...    
    ],

    In Laravel failed jobs are stored into the database. But maybe you want to instruct some other process to also do something with the message. When you want to instruct RabbitMQ to reroute failed messages to a exchange or a specific queue, then this is possible by adding extra options.

    • When the exchange is omitted, RabbitMQ will use the amq.direct exchange for the routing-key
    • When routing-key is omitted, the routing-key by default the queue name is substituted with '.failed'.
    • When using %s in the routing-key the queue_name will be substituted.

    Note: When using failed_job exchange with routing-key, you probably need to create your exchange/queue with bindings yourself.

    'connections' => [
        // ...
    
        'rabbitmq' => [
            // ...
    
            'options' => [
                'queue' => [
                    // ...
    
                    'reroute_failed' => true,
                    'failed_exchange' => 'failed-exchange',
                    'failed_routing_key' => 'application-x.%s',
                ],
            ],
        ],
    
        // ...    
    ],

    Horizon support

    Starting with 8.0, this package supports Laravel Horizon out of the box. Firstly, install Horizon and then set RABBITMQ_WORKER to horizon.

    Horizon is depending on events dispatched by the worker. These events inform Horizon what was done with the message/job.

    This Library supports Horizon, but in the config you have to inform Laravel to use the QueueApi compatible with horizon.

    'connections' => [
        // ...
    
        'rabbitmq' => [
            // ...
    
            /* Set to "horizon" if you wish to use Laravel Horizon. */
           'worker' => env('RABBITMQ_WORKER', 'default'),
        ],
    
        // ...    
    ],

    Use your own RabbitMQJob class

    Sometimes you have to work with messages published by another application.
    Those messages probably won’t respect Laravel’s job payload schema. The problem with these messages is that, Laravel workers won’t be able to determine the actual job or class to execute.

    You can extend the build-in RabbitMQJob::class and within the queue connection config, you can define your own class. When you specify a job key in the config, with your own class name, every message retrieved from the broker will get wrapped by your own class.

    An example for the config:

    'connections' => [
        // ...
    
        'rabbitmq' => [
            // ...
    
            'options' => [
                'queue' => [
                    // ...
    
                    'job' => \App\Queue\Jobs\RabbitMQJob::class,
                ],
            ],
        ],
    
        // ...    
    ],

    An example of your own job class:

    <?php
    
    namespace App\Queue\Jobs;
    
    use VladimirYuldashev\LaravelQueueRabbitMQ\Queue\Jobs\RabbitMQJob as BaseJob;
    
    class RabbitMQJob extends BaseJob
    {
    
        /**
         * Fire the job.
         *
         * @return void
         */
        public function fire()
        {
            $payload = $this->payload();
    
            $class = WhatheverClassNameToExecute::class;
            $method = 'handle';
    
            ($this->instance = $this->resolve($class))->{$method}($this, $payload);
    
            $this->delete();
        }
    }

    Or maybe you want to add extra properties to the payload:

    <?php
    
    namespace App\Queue\Jobs;
    
    use VladimirYuldashev\LaravelQueueRabbitMQ\Queue\Jobs\RabbitMQJob as BaseJob;
    
    class RabbitMQJob extends BaseJob
    {
       /**
         * Get the decoded body of the job.
         *
         * @return array
         */
        public function payload()
        {
            return [
                'job'  => 'WhatheverFullyQualifiedClassNameToExecute@handle',
                'data' => json_decode($this->getRawBody(), true)
            ];
        }
    }

    If you want to handle raw message, not in JSON format or without ‘job’ key in JSON, you should add stub for getName method:

    <?php
    
    namespace App\Queue\Jobs;
    
    use Illuminate\Support\Facades\Log;
    use VladimirYuldashev\LaravelQueueRabbitMQ\Queue\Jobs\RabbitMQJob as BaseJob;
    
    class RabbitMQJob extends BaseJob
    {
        public function fire()
        {
            $anyMessage = $this->getRawBody();
            Log::info($anyMessage);
    
            $this->delete();
        }
    
        public function getName()
        {
            return '';
        }
    }

    Use your own Connection

    You can extend the built-in PhpAmqpLib\Connection\AMQPStreamConnection::class or PhpAmqpLib\Connection\AMQPSLLConnection::class and within the connection config, you can define your own class. When you specify a connection key in the config, with your own class name, every connection will use your own class.

    An example for the config:

    'connections' => [
        // ...
    
        'rabbitmq' => [
            // ...
    
            'connection' = > \App\Queue\Connection\MyRabbitMQConnection::class,
        ],
    
        // ...    
    ],

    Use your own Worker class

    If you want to use your own RabbitMQQueue::class this is possible by extending VladimirYuldashev\LaravelQueueRabbitMQ\Queue\RabbitMQQueue. and inform laravel to use your class by setting RABBITMQ_WORKER to \App\Queue\RabbitMQQueue::class.

    Note: Worker classes must extend VladimirYuldashev\LaravelQueueRabbitMQ\Queue\RabbitMQQueue

    'connections' => [
        // ...
    
        'rabbitmq' => [
            // ...
    
            /* Set to a class if you wish to use your own. */
           'worker' => \App\Queue\RabbitMQQueue::class,
        ],
    
        // ...    
    ],
    <?php
    
    namespace App\Queue;
    
    use VladimirYuldashev\LaravelQueueRabbitMQ\Queue\RabbitMQQueue as BaseRabbitMQQueue;
    
    class RabbitMQQueue extends BaseRabbitMQQueue
    {
        // ...
    }

    For Example: A reconnect implementation.

    If you want to reconnect to RabbitMQ, if the connection is dead. You can override the publishing and the createChannel methods.

    Note: this is not best practice, it is an example.

    <?php
    
    namespace App\Queue;
    
    use PhpAmqpLib\Exception\AMQPChannelClosedException;
    use PhpAmqpLib\Exception\AMQPConnectionClosedException;
    use VladimirYuldashev\LaravelQueueRabbitMQ\Queue\RabbitMQQueue as BaseRabbitMQQueue;
    
    class RabbitMQQueue extends BaseRabbitMQQueue
    {
    
        protected function publishBasic($msg, $exchange = '', $destination = '', $mandatory = false, $immediate = false, $ticket = null): void
        {
            try {
                parent::publishBasic($msg, $exchange, $destination, $mandatory, $immediate, $ticket);
            } catch (AMQPConnectionClosedException|AMQPChannelClosedException) {
                $this->reconnect();
                parent::publishBasic($msg, $exchange, $destination, $mandatory, $immediate, $ticket);
            }
        }
    
        protected function publishBatch($jobs, $data = '', $queue = null): void
        {
            try {
                parent::publishBatch($jobs, $data, $queue);
            } catch (AMQPConnectionClosedException|AMQPChannelClosedException) {
                $this->reconnect();
                parent::publishBatch($jobs, $data, $queue);
            }
        }
    
        protected function createChannel(): AMQPChannel
        {
            try {
                return parent::createChannel();
            } catch (AMQPConnectionClosedException) {
                $this->reconnect();
                return parent::createChannel();
            }
        }
    }

    Default Queue

    The connection does use a default queue with value ‘default’, when no queue is provided by laravel. It is possible to change te default queue by adding an extra parameter in the connection config.

    'connections' => [
        // ...
    
        'rabbitmq' => [
            // ...
                
            'queue' => env('RABBITMQ_QUEUE', 'default'),
        ],
    
        // ...    
    ],

    Heartbeat

    By default, your connection will be created with a heartbeat setting of 0. You can alter the heartbeat settings by changing the config.

    'connections' => [
        // ...
    
        'rabbitmq' => [
            // ...
    
            'options' => [
                // ...
    
                'heartbeat' => 10,
            ],
        ],
    
        // ...    
    ],

    SSL Secure

    If you need a secure connection to rabbitMQ server(s), you will need to add these extra config options.

    'connections' => [
        // ...
    
        'rabbitmq' => [
            // ...
    
            'secure' = > true,
            'options' => [
                // ...
    
                'ssl_options' => [
                    'cafile' => env('RABBITMQ_SSL_CAFILE', null),
                    'local_cert' => env('RABBITMQ_SSL_LOCALCERT', null),
                    'local_key' => env('RABBITMQ_SSL_LOCALKEY', null),
                    'verify_peer' => env('RABBITMQ_SSL_VERIFY_PEER', true),
                    'passphrase' => env('RABBITMQ_SSL_PASSPHRASE', null),
                ],
            ],
        ],
    
        // ...    
    ],

    Events after Database commits

    To instruct Laravel workers to dispatch events after all database commits are completed.

    'connections' => [
        // ...
    
        'rabbitmq' => [
            // ...
    
            'after_commit' => true,
        ],
    
        // ...    
    ],

    Lazy Connection

    By default, your connection will be created as a lazy connection. If for some reason you don’t want the connection lazy you can turn it off by setting the following config.

    'connections' => [
        // ...
    
        'rabbitmq' => [
            // ...
    
            'lazy' = > false,
        ],
    
        // ...    
    ],

    Network Protocol

    By default, the network protocol used for connection is tcp. If for some reason you want to use another network protocol, you can add the extra value in your config options. Available protocols : tcp, ssl, tls

    'connections' => [
        // ...
    
        'rabbitmq' => [
            // ...
    
            'network_protocol' => 'tcp',
        ],
    
        // ...    
    ],

    Network Timeouts

    For network timeouts configuration you can use option parameters. All float values are in seconds and zero value can mean infinite timeout. Example contains default values.

    'connections' => [
        // ...
    
        'rabbitmq' => [
            // ...
    
            'options' => [
                // ...
    
                'connection_timeout' => 3.0,
                'read_timeout' => 3.0,
                'write_timeout' => 3.0,
                'channel_rpc_timeout' => 0.0,
            ],
        ],
    
        // ...
    ],

    Octane support

    Starting with 13.3.0, this package supports Laravel Octane out of the box. Firstly, install Octane and don’t forget to warm ‘rabbitmq’ connection in the octane config.

    See: #460 (comment)

    Laravel Usage

    Once you completed the configuration you can use the Laravel Queue API. If you used other queue drivers you do not need to change anything else. If you do not know how to use the Queue API, please refer to the official Laravel documentation: http://laravel.com/docs/queues

    Lumen Usage

    For Lumen usage the service provider should be registered manually as follow in bootstrap/app.php:

    $app->register(VladimirYuldashev\LaravelQueueRabbitMQ\LaravelQueueRabbitMQServiceProvider::class);

    Consuming Messages

    There are two ways of consuming messages.

    1. queue:work command which is Laravel’s built-in command. This command utilizes basic_get. Use this if you want to consume multiple queues.

    2. rabbitmq:consume command which is provided by this package. This command utilizes basic_consume and is more performant than basic_get by ~2x, but does not support multiple queues.

    Testing

    Setup RabbitMQ using docker-compose:

    docker compose up -d

    To run the test suite you can use the following commands:

    # To run both style and unit tests.
    composer test
    
    # To run only style tests.
    composer test:style
    
    # To run only unit tests.
    composer test:unit

    If you receive any errors from the style tests, you can automatically fix most, if not all the issues with the following command:

    composer fix:style

    Contribution

    You can contribute to this package by discovering bugs and opening issues. Please, add to which version of package you create pull request or issue. (e.g. [5.2] Fatal error on delayed job)

    Visit original content creator repository https://github.com/vyuldashev/laravel-queue-rabbitmq