Blog

  • outermost

    Outermost

    License

    ⚠️ This theme is not intended for use on a production site.

    Outermost is an experimental Full-Site Editing (FSE) WordPress theme. It is being developed by me, Nick Diego, as the base theme for all of my projects. This gives me the opportunity to continually test all of the exciting changes and new features that are coming with FSE in a live environment.

    Feel free to test the theme out yourself, but remember, this is all experimental. Things will likely break with new versions of WordPress/Gutenberg. I will be continually updating the theme to keep up with all the changes, but use with caution.

    Features

    • Support for an Articles custom post type and corresponding templates.
    • Custom page/post templates. Currently there are two, Freeform and Landing.
    • Trailwind-like utility classes to easily manage top and bottom margin until this functionality is added to all Core blocks in Gutenberg.
    • A handful of block patterns and styles (more to come).

    Issues

    Given that FSE is still very much in development, there are a number of issues with this theme that hopefully will be addressed as time progresses. The notable issues are detailed below.

    • The Navigation block does not have mobile styling yet, so it is a bit rough. I would like to see a mobile option that adds a “hamburger” icon on mobile in the future, or something similar.
    • The spacing (margin & padding) control on Core blocks is desperately needed and is currently managed using the utility classes noted in the Features section above. This is not ideal and hopefully we will get full spacing control in all Core blocks. This will allow for “true” FSE.
    • There is currently no easy way to edit custom post types in the Site Editor. This should change relatively soon, but just an FYI.
    • This theme experiments with sidebar layouts, but there are many ways of approaching this, and the implementation is not ideal. Being able to add columns at the post/page level is great, but there is also a need for a more dynamic sidebar on all post/pages as you would find with Widget Areas in standard WordPress.
    • There currently is not an Archive Title or Archive Description block. This is desperately needed, as there is no way to create a dynamic archive page with a category/tag specific title/description. You have to manually create create an archive template for each one in the Site Editor, or resort to a more generic title like “Archive”. Same is true for Search Archives. This begs the question of whether template should actually be .html files or .php files, follow along here: WordPress/gutenberg#27144.

    Installation

    This theme currently integrates with the GitHub Updater plugin to provide automatic updates with each official release. Ultimately, this theme may be made available on WordPress.org, but it is still way too experimental and buggy for general distribution.

    Outermost

    1. Download the latest release.
    2. Go to the Appearance → Themes → Add New screen and click the Upload Theme button.
    3. Upload the zipped release directly.
    4. Go to the Themes screen and click Activate.

    GitHub Updater

    1. Install and activate the GitHub Updater plugin using the installation instructions.
    2. Follow the General Usage instructions to add a personal access token (optional).

    Changelog

    0.6.0 – 2021-07-19

    Added

    • Added CSS for pricing table Columns block styling.
    • Added CSS for newsletter signup in EDD checkout shortcode.

    0.5.0 – 2021-07-19

    Added

    • Added styling for the EDD checkout shortcode.
    • Add the “tag” term for the Article post type.

    0.4.2 – 2021-07-11

    Added

    • Added additional styling for Easy Digital Downloads to make it look a little better.

    0.4.1 – 2021-07-09

    Added

    • Added additional styling for SimpleToc to make it look a little better.
    Fixed

    • Fixed subnav styling.
    Fixed

    • Fixed navigation menu margin which caused it to be non-functional.

    0.4.0 – 2021-07-09

    Added

    • Added styling support for SimpleToc and Outermost EDD Utilities.
    Changed

    • Updated theme.json to be compatible with all the new features in Gutenberg 11.0+.
    • Substantial overhaul of all templates to be more dynamic and enhance reliance on theme.json.
    • Changed all query-loop blocks to post-template blocks for Gutenberg 11.0+ compatibility.
    • Changed all post-tags block to post-terms blocks.
    Removed

    • Remove the Roboto Google font.

    0.3.1 – 2021-06-06

    Added

    • Added more EDD styling throughout.

    0.3.0 – 2021-06-06

    Added

    • Added the the Account template for improved EDD support.
    • Added EDD email templates.
    • Added EDD styling throughout.
    • Added styling for tables and fieldsets.
    • Added Termageddon styling.
    Fixed

    • Fixed the missing footer to the Landing Page template.

    0.2.9 – 2021-05-21

    Fixed

    • Converted post-hierarcical-terms blocks to post-terms blocks due to Gutenberg change.
    • Updated styling the broke due to Gutenberg changes.

    0.2.8 – 2021-05-04

    Fixed

    • Fixed layout of footer template part on the index.html template.

    0.2.7 – 2021-05-04

    Changed

    • Changed the layout for the index.html to be consistent with the archive.html template.

    0.2.6 – 2021-05-02

    Changed

    • Changed default heading sizes.
    Fixed

    • Link styling and sizing for the site logo.
    • Post title styling for the custom homepage grid layout.

    0.2.5 – 2021-05-01

    Added

    • Added Article Categories block variation to the navigation link block.
    • Added Material Icons Outlined support.
    Changed

    • Updated all templates to be compatible with Gutenberg 10.3+.
    • Articles are now included in search queries.
    • Changed link styling to be much simpler.
    Removed

    • Removed all template parts except for main-navigation.html and footer.html.

    0.2.4 – 2021-03-21

    Fixed

    • Fixed error in image block styling.

    Changelog

    0.2.3 – 2021-03-21

    Added

    • Condensed list block variation.
    Changed

    • Improved vertical spacing on image blocks in the post/page content area.
    Fixed

    • Paragraph styles for the EDD Free Downloads modal.

    0.2.2 – 2021-03-21

    Added

    • Custom styling for the EDD Free Downloads modal to be consistent with theme styles.
    Fixed

    • Editor styles for un-ordered lists.
    Changed

    • Updated list styles.

    0.2.1 – 2021-03-21

    Changed

    • Updated list styles.

    0.2.0 – 2021-03-07

    Added

    • Support for Material UI icons
    • Added utility classes for Material UI icons
    • Added utility classes for alternative link styles
    • Added utility classes for opacity
    Changed

    • Change article-category to knowledge-base-category
    • Site logo is now restricted to 250px with CSS. Fixes a rendering issue in FSE.
    Fixed

    • Margin styling for sidebars so it does not impact additional columns blocks.
    • Cover blocks were not respecting the rounded utility classes, so fixed that.
    • Fixed error with incorrect file reference for block variations

    Visit original content creator repository

  • hello-world.rs

    🚀 hello-world.rs 🚀

    🚀 Memory safe, blazing fast, minimal and configurable hello world project written in the rust(🚀) programming language 🚀

    🚀 While this depends on more c code than rust(🚀) code to compile, because rust(🚀) is magically memory safe, now all c code is memory safe too 🚀

    🚀 This project is very minimal, it only requires 1247 crates 🚀

    Building

    To compile this project you need only one library 🚀:

    1. alsa-lib 🚀
    1. glfw 🚀
    1. freetype 🚀
    1. libglib 🚀
    1. pango 🚀
    1. atk 🚀
    1. pixbuf 🚀
    1. gdk 🚀
    1. vulkan(moltenVK on mac) 🚀

    Just a single library 🚀

    You probably have most of them already, if it says something along the words, you know what to search for now

    Then you can just make and the compiled executable should be located in ./target/release/hello-world run it or install it with make install.

    Due to the lightweightness of rust(🚀), unlike node_modules being fairly large for few dependencies, rust(🚀) manages compile caches efficiently and stores them to storage to save compile times! Just 37G target folder on couple of compilation(dev+release), the compile time is only around 2 hours and 30 minutes on my mac air on release mode

    🚀

    A clean build makes it take around 4.7G

    🚀

    The CPU usage is pretty minimal too (release mode)

    🚀

    It is slower than echo but memory safety comes at a cost! We need to be memory chad and blazing pure and lightning based

    🚀

    Benchmark by cypercine

    Installation

    Arch Linux

    $ makepkg -si
    $ pacman -U <package>.pkg.tar.xz

    Docker

    $ docker build -t hello-world .
    $ docker run -it --rm --name hwrs hello-world

    Nix

    $ nix-env -i -f default.nix

    Shade

    $ wget "https://raw.githubusercontent.com/mTvare6/hello-world.rs/master/hello-world.rs-buildscript" -O <prefix>/user/main/hello-world.rs
    $ shade install hello-world.rs

    Why rust(🚀) while its only 1 line and depends on 600 c bind crates?

    Here are my takes on that matter

    C in “c language” stands for Cringe and CVE and Cervical Capricious Catastrophic Chthonic Clumsy Clueless Complex and Cryptic 🤮

    R in “rust(🚀) systems programming language” stands for Rewrite, Robust, Reliable, Rambunctious, Reprehensibl[ly great] and Secure🚀

    Since hello-world.rs is written in blazingly pure, configurable, lightweight and memory pure rust(🚀) – the CVEs are secure, memory chad and blazing pure 🚀

    Here are the comments from few of my fellow Rustaceans 🚀

    People ask the question “what’s rust(🚀) good for?” pretty frequently, and little terminal apps like this are precisely the reason. […]. It enables a kind of workflow that simply didn’t exist before: I could have a fully safe, “correct”, LLVM-optimized binary installed on my desktop in an afternoon.🚀

    Modern rust(🚀) appears pretty similar to modern JavaScript. You declare your variables with let🚀

    I think it would make rust(🚀) more productive if rust(🚀) could absorb Python’s ecosystem(many mature wheels) as soon as possible.🚀

    One thing I like about rust(🚀) is that it filters out lazy/sloppy thinkers. Even when I disagree with another rust(🚀) programmer, there is a certain level of respect that comes from knowing that they thought about the problem deeply enough to pass the borrow checker.🚀

    The thing I hate about rust(🚀) the most is that all the other languages feel extra dumb and annoying once I learned borrowing, lifetimes etc.🚀

    “I feel like the discovery of rust(🚀) is transporting me back to my younger self […]” “When I started learning rust(🚀) in earnest in 2018, I thought this was a fluke. It is just the butterflies you get when you think you fall in love, I told myself.”🚀

    rust(🚀)’s product is not a programming language or a compiler. rust(🚀)’s product is the experience of being a rust(🚀) developer🚀

    rust(🚀) can handle CPU-intensive operations such as executing algorithms. 🚀

    Because it’s typically typed, rust(🚀) catches errors at compile time. […] Also, it compiles code down to machine learning, allowing for extra efficiency.🚀

    Many people try to compare rust(🚀) to Go, but this is flawed. Go is an ancient board game that emphasizes strategy. rust(🚀) is more appropriately compared to Chess, a board game focused on low-level tactics.🚀

    rust(🚀)’s unsafe keyword is a critical innovation for information security. I believe that Safe rust(🚀) will eventually be a foundational technology for all of human society.🚀

    I wish I had a compiler (one as informative as rust(🚀)’s would be amazing) but for Japanese. If I could learn Japanese the way I learn programming I’d be conversationally fluent by now.🚀

    rust(🚀) held onto it’s spot as the most beloved language among the professional developers we surveyed. That said, the majority of developers who took the survey aren’t familiar with the language.🚀

    I’ve experienced modern package management through Cargo and anything below that level now seems like returning to stone age.🚀

    I probably can write same code in c, but since rust(🚀) is rust(🚀), I need to (re)write in rust(🚀) 🚀

    Wait its only time until rust(🚀) makes assembly memroy safe.🚀

    Done lots of C/C++/Python is the past, just started learning node/JS recently. Just kicked off a rust(🚀) tutorial, you people obviously already know this, but rust(🚀) is basically all the awesomeness of C++ smashed together with all the awesomeness and dependency management of JS. Looking forward to learning more rust(🚀) in the future! 🚀

    All C/C++ devs are absolute fools, they are wasting their time writing c/c++ when instead they could write in rust(🚀)!

    C devs are people who use leeches to cure diseases 🚀

    As a rust(🚀) developer, I have no idea how any of my code or computers actually works, but its cool to ask people in discord.gg/rust(🚀) for all help and write code🚀

    I’ve recently added source to where I’ve got these quotes from, when I get time I will add sources to where there messages are from, for now some sources aren’t marked

    Visit original content creator repository
  • SFND_Lidar_Obstacle_Detection

    Sensor Fusion Self-Driving Car Course

    Udacity Nanodegree – ongoing since January 2022

    Technologies Used: C#, OpenCV

    Table of Contents

    Course Overview

    In this course, I am learning about three sensor technologies integral for self-driving vehicles: LiDAR, camera, and radar. When outputs from each sensor are fused, vehicles can detect and track non-linear motion and objects in the environment. This fusion of multiple sensors is the basis for collision detection, cruise control, and other decision trees for self-driving vehicles.

    The course contains four projects with each adding one additional sensor technology. Currently, I completed one of the four:

    1. Lidar Obstacle Detection: using LiDAR and machine learning algorithms to detect objects in a point cloud stream

    Sensors

    LiDAR, camera, and radar are fused together to overcome each of their weaknesses (Figure 1).


    Figure 1: Comparison of sensors

    Below is a list of each sensor with their descriptions and weaknesses:

    • LiDAR: emits infrared light from a rotating sensor to scan 3D points of the environment into a “point cloud” (Figure 2). The scan resolution is dependent on the reflective properties of materials and reduced in adverse environmental conditions such as snow, heavy rain or fog. Sometimes the resulting point cloud is not dense enough for object detection algorithms to locate vehicles or pedestrians.
    • Camera: focus on both close and far-field, watch for braking vehicles, crossing pedestrians, traffic lights, and signage. High-resolution cameras produce precise images of a vehicle’s surroundings. Like human eyes, however, performance at night is significantly reduced, making them less reliable in locating objects with the required detection rates and positional accuracy.
    • Radar: emits radio waves which reflect off objects. Reflected waves are analyzed to calculate distance and relative speed of surrounding vehicles. It is robust against adverse weather conditions like heavy snow and thick fog. However, radar does not produce imagery and drops performance when detecting small or organic objects.

    Figure 2: Point cloud sample from Project 1

    Completed Projects

    Below are descriptions of completed projects. Each project uses C++ and the OpenCV C++ library.

    Project 1: Lidar Obstacle Detection

    The goal of this project was to detect objects from a point cloud stream of traffic on a street (Figure 3). For this detection pipeline, I implemented the following algorithms:

    1. RANSAC: used to separate the point cloud between road plane and obstacle plane
    2. KD-Tree: a quick and efficient search algorithm that identifies regions within the point cloud that are point clusters
    3. Euclidean clustering: establishes individual indices on the KD-tree clusters and encompasses the clusters with a bounding box

    For more details, please check out the repo here.

    Figure 3: Object detection from point cloud stream
    Visit original content creator repository
  • Datareader_TMX

    If you are looking for the original repo please checkout og branch.

    Montreal Exchange (TMX)

    The Montreal Exchange is the oldest exchange in Canada and has a very important history to Canada’s economy. Taken from Wikipedia,

    The Montreal Exchange, formerly the Montreal Stock Exchange (MSE), is a derivatives exchange, located in Montreal, Quebec, Canada that trades futures contracts and options on equities, indices, currencies, ETFs, energy and interest rates. Since 1965, it has been located in the Tour de la Bourse (Stock Exchange Tower), Montreal’s third-tallest building. It is owned by the Toronto-based TMX Group.

    This README file is to showcase the functionality of this small web scraping module. It can be used to get options prices, both calls and puts for index and ETF options, equity options, currency options, and weekly options.

    These prices are then displayed in a Pandas Dataframe for further analysis. This could include simple plots for visualizing the data or creating machine learning model or neural network to predict future prices. One could also use Black-Scholes model to gain further insight.


    Requirements

    1. Python 3.11.5
    2. Pandas 2.1.0 (older version will probably work)
    3. Requests 2.31.0 (older version will probably work)
    4. bs4 4.12.2 (for BeautifulSoup)
      • lxml 5.3.0 used with bs4 to process xml and html

    We start by showing a list of options available from TMX. There is one parameter for the function get_list() and it can take one of four stings:

    ‘Index”https://github.com/”ETF’, ‘Equity’, ‘Currency’, or ‘Weekly’.

    The webpage looks like: Options list from Montreal Exchance (TMX)

    get_list('equity')
    Name of underlying instrument Option symbol Underlying symbol
    0 Aecon Group Inc. ARE ARE
    1 AGF Management Ltd., Cl. B AGF AGF.B
    2 Agnico Eagle Mines Limited AEM AEM
    3 Air Canada AC AC
    4 Alamos Gold Inc. AGI AGI
    264 Wheaton Precious Metals Corp. WPM WPM
    265 Whitecap Resources Inc. WCP WCP
    266 Winpak Ltd. WPK WPK
    267 WSP Global Inc. WSP WSP
    268 Yamana Gold Inc. YRI YRI

    269 rows × 3 columns

    The above DataFrame that we get with get_list('equity') is from: Equity Options list from Montreal Exchance (TMX)

    Now we can grab stock prices for Air Canada (ticker symbol AC) so we can compare them to the stock options:

    get_stock('AC')
    TICKER Last price Net change Bid price Ask price
    0 AC 15.520 0.000 15.520 15.550

    We can also input a list of stock symbols to get a Pandas DataFrame of said stocks:

    get_stock(['AC','ARE'])
    TICKER Last price Net change Bid price Ask price
    0 AC 15.520 0.000 15.520 15.550
    1 ARE 14.220 0.100 14.200 14.250

    Finally, we obtain the a Pandas Dataframe of TMX stock options for Air Canada which comes from:

    Equity Options list from Montreal Exchance (TMX)

    get('AC')
    Call Bid price Ask price Last price Impl. vol. Open int. Vol. Strike Put Bid price_ Ask price_ Last price.1 Impl. vol_ Open int_ Vol_
    0 Oct 23, 2020-W 2.05 2.20 2.20 86.5% 10 0 13.5 Oct 23, 2020-W 0.01 0.12 0.12 75.8% 17 0
    1 Oct 23, 2020-W 1.57 1.77 1.77 79.0% 0 0 14.0 Oct 23, 2020-W 0.08 0.14 0.14 71.0% 30 0
    2 Oct 23, 2020-W 1.12 1.24 1.24 62.5% 10 0 14.5 Oct 23, 2020-W 0.10 0.18 0.18 59.2% 23 10
    3 Oct 23, 2020-W 0.73 0.84 0.84 57.0% 7 0 15.0 Oct 23, 2020-W 0.19 0.29 0.29 53.8% 57 7
    4 Oct 23, 2020-W 0.44 0.54 0.54 56.0% 47 141 15.5 Oct 23, 2020-W 0.37 0.53 0.53 53.7% 46 1
    153 Jan 20, 2023 3.55 7.35 7.35 76.4% 2 0 21.0 Jan 20, 2023 8.85 12.50 12.50 74.4% 0 0
    154 Jan 20, 2023 3.30 7.20 7.20 76.3% 0 0 22.0 Jan 20, 2023 9.60 13.30 13.30 74.2% 0 0
    155 Jan 20, 2023 3.10 7.00 7.00 76.2% 0 0 23.0 Jan 20, 2023 10.35 14.10 14.10 73.8% 0 0
    156 Jan 20, 2023 2.84 6.80 6.80 75.6% 0 0 24.0 Jan 20, 2023 11.10 14.85 14.85 73.0% 0 0
    157 Jan 20, 2023 3.15 5.00 5.00 69.3% 32 7 25.0 Jan 20, 2023 11.90 15.75 15.75 73.3% 0 0

    158 rows × 15 columns

    import pandas as pd
    import requests
    from bs4 import BeautifulSoup
    """
    Get a list of options from https://m-x.ca/nego_liste_en.php
    TMX website
    
    Index and ETF options
    Equity options
    Currency options
    Weekly options
    """
    def get_list(market=str) -> pd.DataFrame:
        tmx = "https://m-x.ca/nego_liste_en.php" # TMX website, where data is taken from
        
        #check that parameter is of type string
        is_str1 = isinstance(market, str)
        if not is_str1:
            raise TypeError("market parameter must be of type string")
            
        try:
            market = market.lower()
        except Exception as e:
            print(e)
        else:
            if market == 'index' or market == 'etf':
                market = 0
            elif market == 'equity':
                market = 1
            elif market == 'currency':
                market = 2
            elif market == 'weekly':
                market = 3
            else:
                raise Exception("Did not enter market type, choose from Index or ETF, Equity, Currency, Weekly.")
            df = pd.read_html(tmx)
            return df[market]
    """
    Get options prices at predetermined dates from TMX website
    Call/Puts
    strike price
    Bid/Ask spreads
    open interest
    implied volatility
    volume
    """
    def get(ticker_symbol=str) -> pd.DataFrame:
        tmx = "https://m-x.ca/nego_cotes_en.php" # TMX website, where data is taken from
    
        is_str1 = isinstance(ticker_symbol, str)
        if not is_str1:
            raise TypeError("ticker_symbol parameter must be of type string")
            
        try:
            ticker_symbol = ticker_symbol.upper()
        except Exception as e:
            print(e)
        else:
            url = tmx + '?symbol=' + ticker_symbol + '*'
            df = pd.read_html(url)
            df[0].rename(columns={'Bid price.1':'Bid price_', 'Ask price.1':'Ask price_', 'Last Price.1':'Last Price_',
                                 'Impl. vol..1':'Impl. vol_', 'Open int..1':'Open int_', 'Vol..1':'Vol_'}, inplace=True)
            return df[0].iloc[:-1] #do not include last row, rubbish information
    """
    Get stock price from TMX to compare to strike price
    can accept string or list of strings
    """
    def get_stock(ticker_symbol=str) -> pd.DataFrame:
        tmx = "https://m-x.ca/nego_cotes_en.php" # TMX website, where data is taken from
        
        #check that parameter is of type string
        is_str1 = checktype(ticker_symbol)
        if not is_str1:
            raise TypeError("market parameter must be of type string")
    
        #download stock price, remember it is 15 minutes delayed
        try:
            symbols = []
            for n in ticker_symbol: 
                symbols.append(n.upper())
    
        except Exception as e:
            print(e)
        else:
            price_dict = {}
            is_list = isinstance(ticker_symbol, list)
            if is_list:
                df_list = []
                for m in symbols:
                    URL = tmx + '?symbol=' + m + '*'
                    response = requests.get(URL)
                    soup = BeautifulSoup(response.text, 'html.parser')
                    x = soup.find('div', class_ = 'quote-info', attrs = 'ul')
                    y = x.ul.text.split('\n')[1:-2]
                    
                    price_dict['TICKER'] = m
                    for z in y:
                        key, value = z.split(':')
                        price_dict[key] = value
                    tmp_df = pd.DataFrame.from_dict(price_dict, orient='index').T
                    df_list.append(tmp_df)
                return pd.concat(df_list, ignore_index=True)
            else:
                ticker_symbol = ticker_symbol.upper()
                URL = tmx + '?symbol=' + ticker_symbol + '*'
                response = requests.get(URL)
                soup = BeautifulSoup(response.text, 'html.parser')
                x = soup.find('div', class_ = 'quote-info', attrs = 'ul')
                y = x.ul.text.split('\n')[1:-2]
    
                price_dict['TICKER'] = ticker_symbol
                for z in y:
                    key, value = z.split(':')
                    price_dict[key] = value
                tmp_df = pd.DataFrame.from_dict(price_dict, orient='index').T
                return tmp_df
                
    def checktype(obj):
            return bool(obj) and all(isinstance(elem, str) for elem in obj)
    Visit original content creator repository
  • absurdum

    Absurdum Logo


    Absurdum is a Javascript utility library built with a focus on providing idempotent side-effect free functions and clear/readable modular source for tree shaking.

    GitHub Release NPM Release Bundlephobia Latest Status Release Status

    Discord

    Features

    • Explores the flexibility of Reduce
    • Abstraction Free -> tree-shake friendly
    • Functional -> all operators are side-effect free
    • Polyfills -> includes operator polyfills for older browsers
    • Isomorphic -> works consistently across all JS runtimes
    • Typescript -> typings are provided for all operators
    • Intellisense -> supports code completions + inline documentation
    • Well Tested -> includes 600+ tests covering every aspect

    Imports

    This package works isomorphically in browsers and server-side JavaScript runtimes

    Browsers

    Import directly from the local path or a CDN

    Top-level operator namespaces (ie [arrays, objects, strings]) can be imported from the index

    <script type="module">
    import { arrays, objects, strings } from 'path/to/absurdum/index.js'
    </script>

    The minified version can be imported from

    <script type="module">
    import { arrays, objects, strings } from 'path/to/absurdum/index.min.js'
    </script>

    Node

    Install the package

    npm install @vanillaes/absurdum

    Top-level operator namespaces are provided

    import { arrays, objects, strings } from '@vanillaes/absurdum';

    Individual operators can also be imported from their parent namespaces

    import { chunk, find } from '@vanillaes/absurdum/arrays';
    import { assign, invert } from '@vanillaes/absurdum/objects';
    import { camelCase, repeat } from '@vanillaes/absurdum/strings';

    Note: Webpack’s tree-shaking algorithm doesn’t work with multi-layered exports. To optimize bundle size, prefer individual operator imports.

    Usage

    Import an operator and feed it some inputs

    const input = ['a', 'b', 'c', 'd'];
    const output = reverse(input);
    console.log(output);
    // > ['d', 'c', 'b', 'a']

    Tip: For VSCode users. Input type-checking, intellisense, and inline documentation are all supported.

    API Documentation

    Arrays

    Operator Lodash Polyfills
    chunk _.chunk
    compact _.compact
    difference _.difference
    drop _.drop
    dropRight _.dropRight
    fill _.fill Array.prototype.fill
    filter _.filter
    find _.find Array.prototype.find
    findIndex _.findIndex Array.prototype.findIndex
    findLastIndex _.findLastIndex
    flat _.flatten Array.prototype.flat
    frequency
    intersection _.intersection
    map _.map
    pull _.pull
    take _.take
    takeRight _.takeRight
    union _.union
    unique _.uniq
    unzip _.unzip
    without _.without
    xor _.xor
    zip _.zip

    Objects

    Operator Lodash Polyfills
    assign _.assign Object.assign
    at _.at
    defaults _.defaults
    defaultsDeep _.defaultsDeep
    entries _.toPairs Object.entries
    filter _.filter
    findKey _.findKey
    findLastKey _.findLastKey
    forIn _.forIn
    fromEntries _.fromPairs Object.fromEntries
    get _.get
    has _.has
    invert _.invert
    mapKeys _.mapKeys
    mapValues _.mapValues
    merge _.merge
    pick _.pick
    result _.result
    transform _.transform
    values _.values Object.values

    Strings

    Operator Lodash Polyfills
    camelCase _.camelCase
    chomp
    deburr _.deburr
    endsWith _.endsWith String.prototype.endsWith
    includes String.prototype.includes
    kebabCase _.kebabCase
    pad _.pad
    padEnd _.padEnd String.prototype.padEnd
    padStart _.padStart String.prototype.padStart
    pascalCase _.startCase
    repeat _.repeat String.prototype.repeat
    reverse
    snakeCase _.snakeCase
    startsWith _.startsWith String.prototype.startsWith
    trimEnd _.trimEnd String.prototype.trimEnd
    trimStart _.trimStart String.prototype.trimStart
    truncate _.truncate
    words _.words
    Visit original content creator repository
  • CKY-Parser

    CKY Parser

    Project Website

    Project Goal

    • Use the CKY parsing algorithm (alternatively called CYK parsing algorithm) to parse a particular input string and check whether it is derivable by the grammar or not.

    Project Description

    • Context Free Grammar(CFG) is converted into Chomsky Normal Form Grammar(CNFG).
    • CNFG so obtained is fed into the CKY parsing algorithm

    Assumptions

    • The CFG used in the project is described in the section below. Any other CFG can also be used.
    • Conversion of CFG to CNFG is done manually. The program recognizes and accepts only CNFG and not CFG directly.
    • The program employs the lower-triangular form of the CKY parsing matrix. Both upper-triangular and lower-triangular matrix form yield the same answers.

    CFG

    S -> NP VP
    S -> VP
    NP -> Pronoun
    NP -> Proper Noun
    Nominal -> Noun
    Nominal -> Nominal Noun
    Nominal -> Nominal PP
    VP -> Verb
    VP -> Verb NP
    VP -> Verb NP PP
    VP -> Verb PP
    VP -> VP PP
    PP -> Preposition NP

    Lexicon

    Det -> The | the | a | the | send | reached | seven | they
    Noun -> parcel | weight | beautiful | document | feasible | discount | warehouse | for | away | location | belonged | little | beds
    Verb -> was | gave | gives | told | thought | slowly | found
    Pronoun -> There | it | he | the | expensive
    Proper Noun -> Snow-White | goods | heavy | big |cheap | timely | children
    Preposition -> in | named | and | to | into

    CNFG

    S -> NP VP
    S -> Verb NP
    S -> X2 PP
    S -> Verb PP
    S -> VP PP
    S -> was
    S -> gave
    S -> gives
    S -> told
    S -> slowly
    S -> found
    S -> thought
    S -> ordered
    NP -> There
    NP -> It
    NP -> big
    NP -> cheap
    NP -> goods
    NP -> He
    NP -> the
    NP -> her
    NP -> timely
    NP -> expensive
    NP -> children
    NP -> FedEx
    NP -> heavy
    NP -> Det Nominal
    Nominal -> Nominal Noun
    Nominal -> Nominal PP
    Nominal -> beautiful
    Nominal -> feasible
    Nominal -> parcel
    Nominal -> weight
    Nominal -> far
    Nominal -> location
    Nominal -> little
    Nominal -> belonged
    Nominal -> envelope
    Nominal -> important
    Nominal -> warehouse
    VP -> was
    VP -> gave
    VP -> gives
    VP -> told
    VP -> slowly
    VP -> found
    VP -> thought
    VP -> ordered
    VP -> Verb NP
    VP -> X2 PP
    X2 -> Verb NP
    VP -> Verb PP
    VP -> VP PP
    PP -> Preposition NP
    Verb -> was
    Verb -> gave
    Verb -> gives
    Verb -> told
    Verb -> slowly
    Verb -> found
    Verb -> thought
    Verb -> ordered
    Det -> a
    Det -> The
    Det -> the
    Det -> her
    Det -> send
    Det -> reached
    Det -> seven
    Det -> they
    Noun -> document
    Noun -> discount
    Noun -> away
    Noun -> beds
    Noun -> beautiful
    Noun -> feasible
    Noun -> parcel
    Noun -> weight
    Noun -> far
    Noun -> location
    Noun -> little
    Noun -> belonged
    Noun -> envelope
    Noun -> important
    Noun -> warehouse
    Preposition -> named
    Preposition -> and
    Preposition -> in
    Preposition -> into
    Preposition -> to
    Preposition -> send

    Future Scope

    • Write documentation to use the program including clear instructions for users on how to specify grammar in the program input box / textarea with proper syntax rules.
    • Add functionality in program to do automatic conversion of CFG to CNFG. The program should be able to recognize and accept both CNFG and CFG.
    • Ask user to specify which triangular form to use to generate the CKY parsing matrix. The program should be able to employ both the lower-triangular and upper-triangular form of the CKY parsing matrix.

    References

    1. Original parser

    Author: Martin Lazarov
    Year published: 2017
    Page title: CKY parsing algorithm demo
    URL: http://lxmls.it.pt/2015/cky.html
    Access date: 03 May 2017

    2. Webpage Template

    Author: David Miller
    Year published: 2013
    Page title: Freelancer – Start Bootstrap Theme
    URL: https://blackrockdigital.github.io/startbootstrap-freelancer/

    3. Lion Head Logo

    Page title: Tamuc.edu
    URL: http://www.tamuc.edu/facultyStaffServices/marketingCommunications/standards/logos/documents/2013-Lion-Head.png

    Visit original content creator repository

  • ts-collections

    TS-Collections

    Installation

    Add this library using npm or yarn from your terminal.

    NPM

    npm i ts-collection-set
    YARN

    yarn add ts-collection-set

    Usage

    Import the collections library to your typescript file.

    import * as Collections from "ts-collection-set"

    Dictionary (HashMap)

    Initialize a dictionary instance as follows.

    const englishDictionary: Collections.Dictionary<string, string> = new Collections.Dictionary();

    Add new elements to your dictionary instance as follows. The first parameter being the elements key and the second being its value.

    englishDictionary.setValue("A", "First english alphabet character.");
    englishDictionary.setValue("Grey", "A metallic shade of black");
    englishDictionary.setValue("Doctor", "An expert in a particular field of training");

    Check if the dictionary contains a particular key using this method.

    englishDictionary.containsKey("key");

    Remove an element from the dictionary instance using its key as follows.

    englishDictionary.remove("Key");

    Get an array of key elements as follows.

    englishDictionary.keys();

    Set (ArrayList)

    Initialize a set instance as follows.

    const numArray: Collections.Set<string> = new Collections.Set();

    Add elements to your set instance as follows.

    numArray.add("1");
    numArray.add("2");
    numArray.add("3");
    numArray.add("4");

    Remove an element from your set instance as follows.

    numArray.remove("2");

    Check to see if is your set instance contains a particular element using the following method.

    numArray.contains("1");

    License

    MIT License

    Copyright (c) 2020 Ian Mugambi

    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the “Software”), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all
    copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    SOFTWARE.

    Visit original content creator repository

  • sumologic-sdk-ruby

    Sumo Logic Ruby SDK

    Gem Version Build Status Code Climate Scrutinizer Code Quality Docs License

    Ruby interface to the Sumo Logic REST API.

    Usage

    The Ruby SDK is ported from the Sumo Logic Python SDK.

    The following methods are currently implemented:

    sumo = SumoLogic::Client.new access_id, access_key
    
    # Search
    r = sumo.search query [, from, to, time_zone]
    
    r = sumo.search_job query [, from, to, time_zone]
    
    r = sumo.search_job_messages {'id' => search_job_id}, limit, offset
    
    r = sumo.search_job_records {'id' => search_job_id}, limit, offset
    
    r = sumo.search_job_status {'id' => search_job_id}
    
    # Dashboards
    r = sumo.dashboards
    
    r = sumo.dashboard dashboard_id
    
    r = sumo.dashboard_data dashboard_id
    
    # Collectors
    r = sumo.collectors [limit, offset]
    
    r = sumo.collector collector_id
    
    r = sumo.update_collector collector, etag
    
    r = sumo.delete_collector collector
    
    # Sources
    r = sumo.sources collector_id [, limit, offset]
    
    r = sumo.source collector_id, source_id
    
    r = sumo.update_source collector_id, source, etag
    
    r = sumo.delete_source collector_id, source
    
    # Content
    r = sumo.create_content path, data
    
    r = sumo.get_content path
    
    r = sumo.delete_content path
    
    # Low-Level
    r = sumo.post path, data

    Note, for the search methods, the query parameter can be exactly the same query that is entered into the Sumo Logic web console.

    Example scripts are located in the scripts directory of the GitHub repo.

    Change Log

    See CHANGELOG.md.

    Links

    Project Repo

    Sumo Logic API Documentation

    Sumo Logic Python SDK

    Contributions

    Please add your scripts and programs to the scripts folder.

    Any reports of problems, comments or suggestions are most welcome.

    Please report these on Github

    License

    Sumo Logic Ruby SDK is available under an MIT-style license. See LICENSE.md for details.

    Sumo Logic Ruby SDK © 2015-2023 by John Wang

    Visit original content creator repository
  • RISCV-Simulator

    RISCV-Simulator

    An instruction set simulator for the RISC-V architecture written in Java.
    Written as the last assignment for the course “02155: Computer Architecture and Engineering” at the Technical University of Denmark

    Simulates the RV32I Base Instruction Set (excluding EBREAK, CSR*, fence* and some environment calls)

    Environment Calls

    ID x10 Name Description
    1 print_int Prints integer in x11
    4 print_string Prints null-terminated string whose address is in x11
    10 exit Stops execution
    11 print_char Prints character in x11

    Compiling and running

    Install packages

    If you haven’t run a JavaFX application on Ubuntu before run the following command:

    sudo apt-get install openjfx
    

    Java Development Kit 8

    Compile

    Assuming no other Java files present:

    cd path/to/package/files
    javac *.java
    

    Run

    Assuming current work directory contains RISCVSimulator package directory:

    cd path/to/package/
    java RISCVSimulator.Main
    

    OpenJDK 11

    As OpenJDK no longer supplies a runtime environment or JavaFX, it is required to have OpenJFX downloaded.
    The path to OpenJFX will be referred to as %PATH_TO_FX%.

    Compile

    cd path/to/package/files
    javac --module-path %PATH_TO_FX% --add-modules javafx.fxml,javafx.base,javafx.controls,javafx.graphics *.java
    

    Run

    Requires a Java 11 Runtime Environment. This is easily obtained on Ubuntu through apt, but Windows users will need to use jlink to build their own. See Releases for example.
    Assuming current work directory contains RISCVSimulator package directory:

    cd path/to/package
    java --module-path %PATH_TO_FX% --add-modules javafx.fxml,javafx.base,javafx.controls,javafx.graphics RISCVSimulator.Main
    

    Unfortunately, the program was not written with modular Java support in mind. For this reason, there is no better way of running the program, as it’s not possible to use jlink in order to build the application with all dependencies bundled. Writing batch files or shell scripts is adviced.

    Visit original content creator repository