Coder Social home page Coder Social logo

instantlookupset.ahk's Introduction

instantlookupset.ahk logo

instantlookupset.ahk

===========

A package for instant lookup style arrays.

Installation

In a terminal or command line navigated to your project folder:

npm install instantlookupset.ahk

In your code:

#Include %A_ScriptDir%\node_modules
#Include instantlookupset.ahk\export.ahk
table := new instantlookupset()

table.push("leo", "donny", "raph")
table.read("raph")
; => 3

table.find("raph")
; => true

You may also review or copy the library from ./export.ahk on GitHub; #Include as you would normally when manually downloading.

Usage

Grants access to a class named instantlookupset with the following methods: .create, .push, .read, .find, .indexOf, .allData, .update, .reIndex, .delete, and .clear

Reasoning

AutoHotkey array traversing is not exactly quick. One common solution when speed is a big concern is to store the data as the key, and a 1 as the value. Then checking if the key exists and has a value is semi-instant.

This creates a small readability problem because often it is used in conjunction with a regular array for the data; since keys are always turned lowercase. So it can read a bit confusing having two arrays with one being used in an unusual way.

The goal of this package is to get similiar functionality; without having to use an array backwards.

API

Follows CRUD operations (create, read, update, delete)

Create

.create and .push

Read

.read, .find, .indexOf, and .allData

Update

.update and .reIndex

Delete

.delete and .clear

instantlookupset.ahk's People

Contributors

chunjee avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.