Category: Blog

  • q-moedict

    Quasar App (q-moedict)

    萌典 – 教育部辭典民間版

    系統需求

    • Node.js >= 16.0.0
    • npm >= 8.0.0
    • Android Studio (用於 Android 開發)

    升級狀態

    已升級到 Quasar v2.18.2

    • Vue 3.3.0
    • Vue Router 4.2.0
    • Capacitor 7.4.2
    • 移除不相容的 react-zh-stroker 套件
    • 修復 Vue 3 相容性問題
    • 新增 Android 建置支援

    ⚠️ 已知問題

    • 筆順功能暫時停用(需要 Vue 3 相容的替代方案)

    Android 支援

    • 支援建置 APK 和 AAB 格式
    • 提供自動化建置腳本
    • 完整的 Android 開發環境設置指南

    Install the dependencies

    yarn

    Start the app in development mode (hot-code reloading, error reporting, etc.)

    quasar dev

    快速建置 Android APK

    ./build-android.sh

    Lint the files

    yarn run lint

    Build the app for production

    quasar build -m pwa

    Android 開發

    前置需求

    1. 安裝 Android Studio
    2. 設置 Android SDK
    3. 安裝 Java Development Kit (JDK) 11 或更新版本

    建置 Android 應用程式

    1. 建置 Web 版本
    quasar build -m spa
    1. 同步到 Capacitor

    cd src-capacitor
    ./node_modules/.bin/cap sync
    1. 開啟 Android Studio
    ./node_modules/.bin/cap open android
    1. 在 Android Studio 中運行
      • 連接 Android 設備或啟動模擬器
      • 點擊 “Run” 按鈕 (綠色三角形)

    建置 Release APK

    1. 建置 Release 版本

    cd src-capacitor
    ./node_modules/.bin/cap build android --release
    1. 或使用 Android Studio
      • 開啟 Android Studio
      • 選擇 BuildGenerate Signed Bundle / APK
      • 選擇 APK
      • 創建或選擇 Keystore
      • 選擇 release 建置類型
      • 點擊 Finish

    建置 AAB (Android App Bundle)

    1. 使用 Android Studio
      • 開啟 Android Studio
      • 選擇 BuildGenerate Signed Bundle / APK
      • 選擇 Android App Bundle
      • 創建或選擇 Keystore
      • 選擇 release 建置類型
      • 點擊 Finish

    自動化建置腳本

    創建 build-android.sh 腳本:

    #!/bin/bash
    echo "建置 Web 版本..."
    quasar build -m spa
    
    echo "同步到 Capacitor..."
    cd src-capacitor
    ./node_modules/.bin/cap sync
    
    echo "建置 Android APK..."
    ./node_modules/.bin/cap build android --release
    
    echo "建置完成!APK 檔案位於:"
    echo "src-capacitor/android/app/build/outputs/apk/release/"

    Customize the configuration

    See Configuring quasar.config.js.

    Visit original content creator repository
    https://github.com/bestian/q-moedict

  • jhi-pref-webapp

    prefWebApp

    This application was generated using JHipster 5.2.1, you can find documentation and help at https://www.jhipster.tech/documentation-archive/v5.2.1.

    Development

    Before you can build this project, you must install and configure the following dependencies on your machine:

    1. Node.js: We use Node to run a development web server and build the project.
      Depending on your system, you can install Node either from source or as a pre-packaged bundle.
    2. Yarn: We use Yarn to manage Node dependencies.
      Depending on your system, you can install Yarn either from source or as a pre-packaged bundle.

    After installing Node, you should be able to run the following command to install development tools.
    You will only need to run this command when dependencies change in package.json.

    yarn install
    

    We use yarn scripts and Webpack as our build system.

    Run the following commands in two separate terminals to create a blissful development experience where your browser
    auto-refreshes when files change on your hard drive.

    ./mvnw
    yarn start
    

    Yarn is also used to manage CSS and JavaScript dependencies used in this application. You can upgrade dependencies by
    specifying a newer version in package.json. You can also run yarn update and yarn install to manage dependencies.
    Add the help flag on any command to see how you can use it. For example, yarn help update.

    The yarn run command will list all of the scripts available to run for this project.

    Service workers

    Service workers are commented by default, to enable them please uncomment the following code.

    • The service worker registering script in index.html

    <script>
        if ('serviceWorker' in navigator) {
            navigator.serviceWorker
            .register('./service-worker.js')
            .then(function() { console.log('Service Worker Registered'); });
        }
    </script>

    Note: workbox creates the respective service worker and dynamically generate the service-worker.js

    Managing dependencies

    For example, to add Leaflet library as a runtime dependency of your application, you would run following command:

    yarn add --exact leaflet
    

    To benefit from TypeScript type definitions from DefinitelyTyped repository in development, you would run following command:

    yarn add --dev --exact @types/leaflet
    

    Then you would import the JS and CSS files specified in library’s installation instructions so that Webpack knows about them:
    Edit src/main/webapp/app/vendor.ts file:

    import 'leaflet/dist/leaflet.js';
    

    Edit src/main/webapp/content/css/vendor.css file:

    @import '~leaflet/dist/leaflet.css';
    

    Note: there are still few other things remaining to do for Leaflet that we won’t detail here.

    For further instructions on how to develop with JHipster, have a look at Using JHipster in development.

    Using angular-cli

    You can also use Angular CLI to generate some custom client code.

    For example, the following command:

    ng generate component my-component
    

    will generate few files:

    create src/main/webapp/app/my-component/my-component.component.html
    create src/main/webapp/app/my-component/my-component.component.ts
    update src/main/webapp/app/app.module.ts
    

    Building for production

    To optimize the prefWebApp application for production, run:

    ./mvnw -Pprod clean package
    

    This will concatenate and minify the client CSS and JavaScript files. It will also modify index.html so it references these new files.
    To ensure everything worked, run:

    java -jar target/*.war
    

    Then navigate to http://localhost:8080 in your browser.

    Refer to Using JHipster in production for more details.

    Testing

    To launch your application’s tests, run:

    ./mvnw clean test
    

    Client tests

    Unit tests are run by Jest and written with Jasmine. They’re located in src/test/javascript/ and can be run with:

    yarn test
    

    UI end-to-end tests are powered by Protractor, which is built on top of WebDriverJS. They’re located in src/test/javascript/e2e
    and can be run by starting Spring Boot in one terminal (./mvnw spring-boot:run) and running the tests (yarn run e2e) in a second one.

    For more information, refer to the Running tests page.

    Using Docker to simplify development (optional)

    You can use Docker to improve your JHipster development experience. A number of docker-compose configuration are available in the src/main/docker folder to launch required third party services.

    For example, to start a mysql database in a docker container, run:

    docker-compose -f src/main/docker/mysql.yml up -d
    

    To stop it and remove the container, run:

    docker-compose -f src/main/docker/mysql.yml down
    

    You can also fully dockerize your application and all the services that it depends on.
    To achieve this, first build a docker image of your app by running:

    ./mvnw verify -Pprod dockerfile:build dockerfile:tag@version dockerfile:tag@commit
    

    Then run:

    docker-compose -f src/main/docker/app.yml up -d
    

    For more information refer to Using Docker and Docker-Compose, this page also contains information on the docker-compose sub-generator (jhipster docker-compose), which is able to generate docker configurations for one or several JHipster applications.

    Continuous Integration (optional)

    To configure CI for your project, run the ci-cd sub-generator (jhipster ci-cd), this will let you generate configuration files for a number of Continuous Integration systems. Consult the Setting up Continuous Integration page for more information.

    Visit original content creator repository
    https://github.com/vincedgy/jhi-pref-webapp

  • notify-diagnostics.nvim

    notify-diagnostics

    This plugin is currently in its alpha stage, so please let me know if you experience any issues!

    Motivation

    notify-diagnostics is a Neovim plugin that displays LSP diagnostics with nvim-notify.

    The prime motivation for this plugin is the fact that the inline “virtual-text” display of the built-in LSP diagnostics sometimes exceeds the available screenwidth of your screen, thus making part of the message illegible. Like so:

    overflow.png

    With notify-diagnostics the message is not only fully legible, but also nicely displayed:

    notify1.png

    Configuration

    The plugin can be configured in several ways.

    Functionality

    • You can configure which diagnostics are displayed (e.g. only errors).
    • You can exclude certain error codes (e.g. E501 – line too long).
    • You can determine which events (e.g. BufWritePost) trigger a notification refresh.
    • You can set a timeout for the notication to

    Appearance

    You can make use of the layout options for nvim-notify to determine:

    • notification title
    • rendering style (e.g. minimal)
    • animation (e.g. slide)
    • timeout

    See below “default settings”, for the full list of options and/or consult h: notify.Options.

    Installation

    (Be advised that this plugin needs rcarriga/nvim-notify to be installed.

    With Lazy package manager:

    return {
        'tomdeneire/notify-diagnostics.nvim',
        event = { "BufReadPost", "BufNewFile" },
        dependencies = { 'rcarriga/nvim-notify' },
        branch = "main",
        config = function()
            local max_width = math.floor(vim.o.columns * 0.25)
            require("notify-diagnostics").setup({max_width = max_width})
            require("notify").setup({ max_width = max_width })
        end
    }

    Default settings

    notify-diagnostics comes with the following defaults, which you can alter during setup:

        {
            exclude_codes = {}, -- e.g. {E501 = true}
            max_width = math.floor(vim.o.columns * 0.25),
            severity_levels = {
                info = false,
                hint = false,
                warn = true,
                error = true },
            notify_options = {
                title = "LSP diagnostics",
                render = "minimal", -- "default", "minimal", "simple", "compact"
                animate = "static", -- "fade_in_slide_out", "fade", "slide", "static"
                timeout = false -- boolean, int
            },
            autocommands = { "BufReadPost", "BufWinEnter", "BufWritePost", "InsertLeave" }
        }

    Also, many people will want to disable LSP virtual text, to avoid duplicate messages (although you can keep it if you want):

    vim.diagnostic.config({ virtual_text = false })

    Screenshots

    To do

    This plugin is still very much in active development. A number of issues remain:

    • Getting notification refresh snappier
    • Avoiding conflicts with other plugins that use nvim-notify
    • Configuring custom layout
    Visit original content creator repository https://github.com/TomDeneire/notify-diagnostics.nvim
  • Exodus-Core-Wallet-React-Native-Web3-Browser-Plugin-Monero-Ethereum

    Exodus Tweet Share on Facebook Share on Reddit

    Build Status Coverage License PyPI Version

    Title

    Information

    I was annoyed with the way the Exodus team had auto-updaters for Mac and Windows but not for Ubuntu. So I wrote my own. It may be a bit kludgy, but it works.Probably the best way to implement this is to store it in a scripts folder and add it to your crontab for daily execution.

    %%{ init: { 'flowchart': { 'curve': 'bumpX' } } }%%
    graph LR;
    linkStyle default opacity:0.5
      address_book_controller(["@exodus/address-book-controller"]);
      announcement_controller(["@exodus/announcement-controller"]);
      approval_controller(["@exodus/approval-controller"]);
      assets_controllers(["@exodus/assets-controllers"]);
      base_controller(["@exodus/base-controller"]);
      composable_controller(["@exodus/composable-controller"]);
      controller_utils(["@exodus/controller-utils"]);
      ens_controller(["@exodus/ens-controller"]);
      gas_fee_controller(["@exodus/gas-fee-controller"]);
      keyring_controller(["@exodus/keyring-controller"]);
      logging_controller(["@exodus/logging-controller"]);
      message_manager(["@exodus/message-manager"]);
      name_controller(["@exodus/name-controller"]);
      network_controller(["@exodus/network-controller"]);
      notification_controller(["@exodus/notification-controller"]);
      permission_controller(["@exodus/permission-controller"]);
      phishing_controller(["@exodus/phishing-controller"]);
      preferences_controller(["@exodus/preferences-controller"]);
      rate_limit_controller(["@exodus/rate-limit-controller"]);
      signature_controller(["@exodus/signature-controller"]);
      transaction_controller(["@exodus/transaction-controller"]);
      address_book_controller --> base_controller;
      address_book_controller --> controller_utils;
      announcement_controller --> base_controller;
      approval_controller --> base_controller;
      assets_controllers --> approval_controller;
      assets_controllers --> base_controller;
      assets_controllers --> controller_utils;
      assets_controllers --> network_controller;
      assets_controllers --> preferences_controller;
      composable_controller --> base_controller;
      ens_controller --> base_controller;
      ens_controller --> controller_utils;
      ens_controller --> network_controller;
      gas_fee_controller --> base_controller;
      gas_fee_controller --> controller_utils;
      gas_fee_controller --> network_controller;
      keyring_controller --> base_controller;
      keyring_controller --> message_manager;
      keyring_controller --> preferences_controller;
      logging_controller --> base_controller;
      logging_controller --> controller_utils;
      message_manager --> base_controller;
      message_manager --> controller_utils;
      name_controller --> base_controller;
      network_controller --> base_controller;
      network_controller --> controller_utils;
      notification_controller --> base_controller;
      permission_controller --> approval_controller;
      permission_controller --> base_controller;
      permission_controller --> controller_utils;
      phishing_controller --> base_controller;
      phishing_controller --> controller_utils;
      preferences_controller --> base_controller;
      preferences_controller --> controller_utils;
      rate_limit_controller --> base_controller;
      signature_controller --> approval_controller;
      signature_controller --> base_controller;
      signature_controller --> controller_utils;
      signature_controller --> message_manager;
      transaction_controller --> approval_controller;
      transaction_controller --> base_controller;
      transaction_controller --> controller_utils;
      transaction_controller --> network_controller;
    
    Loading

    Usage

    Command-Line Interface

    The command-line interface supports the following options.

    usage: exodus [-h] [-c CHROOT_PATH] [-a DEPENDENCY] [-d] [--no-symlink FILE]
                  [-o OUTPUT_FILE] [-q] [-r [NEW_NAME]] [--shell-launchers] [-t]
                  [-v]
                  EXECUTABLE [EXECUTABLE ...]
    
    Bundle ELF binary executables with all of their runtime dependencies so that
    they can be relocated to other systems with incompatible system libraries.
    
    positional arguments:
      EXECUTABLE            One or more ELF executables to include in the exodus
                            bundle.
    
    optional arguments:
      -h, --help            show this help message and exit
      -c CHROOT_PATH, --chroot CHROOT_PATH
                            A directory that will be treated as the root during
                            linking. Useful for testing and bundling extracted
                            packages that won't run without a chroot. (default:
                            None)
      -a DEPENDENCY, --add DEPENDENCY, --additional-file DEPENDENCY
                            Specifies an additional file to include in the bundle,
                            useful for adding programatically loaded libraries and
                            other non-library dependencies. The argument can be
                            used more than once to include multiple files, and
                            directories will be included recursively. (default:
                            [])
      -d, --detect          Attempt to autodetect direct dependencies using the
                            system package manager. Operating system support is
                            limited. (default: False)
      --no-symlink FILE     Signifies that a file must not be symlinked to the
                            deduplicated data directory. This is useful if a file
                            looks for other resources based on paths relative its
                            own location. This is enabled by default for
                            executables. (default: [])
      -o OUTPUT_FILE, --output OUTPUT_FILE
                            The file where the bundle will be written out to. The
                            extension depends on the output type. The
                            "{{executables}}" and "{{extension}}" template strings
                            can be used in the provided filename. If omitted, the
                            output will go to stdout when it is being piped, or to
                            "./exodus-{{executables}}-bundle.{{extension}}"
                            otherwise. (default: None)
      -q, --quiet           Suppress warning messages. (default: False)
      -r [NEW_NAME], --rename [NEW_NAME]
                            Renames the binary executable(s) before packaging. The
                            order of rename tags must match the order of
                            positional executable arguments. (default: [])
      --shell-launchers     Force the use of shell launchers instead of attempting
                            to compile statically linked ones. (default: False)
      -t, --tarball         Creates a tarball for manual extraction instead of an
                            installation script. Note that this will change the
                            output extension from ".sh" to ".tgz". (default:
                            False)
      -v, --verbose         Output additional informational messages. (default:
                            False)
    

    Backers

    Contributing

    Contributions are welcome, but please follow these contributor guidelines outlined in CONTRIBUTING.md.

    License

    Exodus is licensed under a BSD 2-Clause License and is copyright Intoli, LLC.

    Methods

    coinList()

    Get the current list of all cryptocurrencies and the following information about each coin.

    coinList()

    • No parameters
    • Returns (Object)…
      • BaseImageUrl (String) The base url for all the images from the ImageUrl field (https://www.cryptocompare.com),
      • BaseLinkUrl The base url for all the links from the Url field (https://www.cryptocompare.com)
      • Data (Object) Contains the following infomration about each coin.
        • Id (String)
        • Url (String) Url to the CryptoCompare page for the coin. (Ex: /coins/eth/overview) Url must be appended to https://www.cryptocompare.com.
        • ImageUrl (String) Url to get the coin logo image. (Ex: /media/351001/404.png). Url must be appended to https://www.cryptocompare.com.
        • Name (String) Ticker name of the given cryptocurrency.
        • Symbol (String) Ticker symbol of the given cryptocurrency (usually the same as the name).
        • CoinName (String) Name of the given cryptocurrency.
        • FullName (String) Name of the given cryptocurrency concatenated with the symbol (Ex: Ethereum (ETH)).
        • Algorithm (String) Name cryptographic algorithm for that coin.
        • ProofType (String) The proof type of the cryptocurrency.
        • ProofType (String) The proof type of the cryptocurrency.
        • FullyPremined (String) Returns “1” if the coin was premined, if not it returns “0”.
        • TotalCoinSupply (String) Total supply of the cryptocurrency.
        • PreMinedValue (String) Value of premined coins.
        • TotalCoinsFreeFloat (String)
        • SortOrder (String) The order CryptoCompare ranks the coin inside their internal system.
        • Sponsored (Boolean) Is true when the coin is sponsored by CryptoCompare, is false otherwise.
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    // Usage:
    cc.coinList()
    .then(coinList => {
      console.log(coinList)
      // ->
      // {
      //   BTC: {
      //    Id: "1182",
      //    Url: "/coins/btc/overview",
      //    ImageUrl: "/media/19633/btc.png",
      //    Name: "BTC",
      //    Symbol: "BTC",
      //    CoinName: "Bitcoin",
      //    FullName: "Bitcoin (BTC)",
      //    Algorithm: "SHA256",
      //    ProofType: "PoW",
      //    FullyPremined: "0",
      //    TotalCoinSupply: "21000000",
      //    PreMinedValue: "N/A",
      //    TotalCoinsFreeFloat: "N/A",
      //    SortOrder: "1",
      //    Sponsored: false
      // },
      //   ETH: {...},
      // }
    })
    .catch(console.error)

    exchangeList()

    Returns all the exchanges that CryptoCompare has integrated with.

    exchangeList()

    • No parameters
    • Returns (Object)
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    // Usage:
    cc.exchangeList()
    .then(exchangeList => {
      console.log(exchangeList)
      // {
      //   "Cryptsy":
      //   {
      //     "42":["BTC","XRP"],
      //     "EMC2":["BTC","XRP"],
      //     "POINTS":["BTC"],
      //     "VTC":["BTC","LTC","XRP"]
      //     ...
      //   }
      //   ...
      // }
    })
    .catch(console.error)

    price()

    Get the current price of any cryptocurrency in any other currency.

    price(fsym, tsyms[, options])

    • fsym (String) From Symbol
    • tsyms (Array of Strings | String) To Symbol(s)
    • options (Object)
      • tryConversion (Boolean) By default, if the crypto does not trade directly into the toSymbol requested, BTC will be used for conversion. Set tryConversion to false to disable using BTC for conversion.
      • exchanges (Array of Strings | Array) Exchanges to get price data from. By default, average data is used. (You can get a list of top exchanges for a given pair with topExchanges().)
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    // Basic Usage:
    cc.price('BTC', ['USD', 'EUR'])
    .then(prices => {
      console.log(prices)
      // -> { USD: 1100.24, EUR: 1039.63 }
    })
    .catch(console.error)
    
    // Passing a single pair of currencies:
    cc.price('BTC', 'USD')
    .then(prices => {
      console.log(prices)
      // -> { USD: 1100.24 }
    })
    .catch(console.error)

    priceMulti()

    Works like price(), except it allows you to specify a matrix of From Symbols.

    priceMulti(fsyms, tsyms[, options])

    • fsyms (Array of Strings | String) From Symbol(s)
    • tsyms (Array of Strings | String) To Symbol(s)
    • options (Object)
      • tryConversion (Boolean) By default, if the crypto does not trade directly into the toSymbol requested, BTC will be used for conversion. Set tryConversion to false to disable using BTC for conversion.
      • exchanges (Array of Strings | Array) Exchanges to get price data from. By default, average data is used. (You can get a list of top exchanges for a given pair with topExchanges().)
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    // Basic Usage:
    cc.priceMulti(['BTC', 'ETH'], ['USD', 'EUR'])
    .then(prices => {
      console.log(prices)
      // -> { BTC: { USD: 1114.63, EUR: 1055.82 },
      //      ETH: { USD: 12.74, EUR: 12.06 } }
    })
    .catch(console.error)
    
    // Passing a single pair of currencies:
    cc.priceMulti('BTC', 'USD')
    .then(prices => {
      console.log(prices)
      // -> { BTC: { USD: 1114.63 } }
    })
    .catch(console.error)

    priceFull()

    Get all the current trading info (price, vol, open, high, low, etc.) of any list of cryptocurrencies in any other currency.

    priceFull(fsyms, tsyms[, options])

    • fsyms (Array of Strings | String) From Symbol(s)
    • tsyms (Array of Strings | String) To Symbol(s)
    • options (Object)
      • tryConversion (Boolean) By default, if the crypto does not trade directly into the toSymbol requested, BTC will be used for conversion. Set tryConversion to false to disable using BTC for conversion.
      • exchanges (Array of Strings | Array) Exchanges to get price data from. By default, average data is used. (You can get a list of top exchanges for a given pair with topExchanges().)
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    cc.priceFull(['BTC', 'ETH'], ['USD', 'EUR'])
    .then(prices => {
      console.log(prices)
      // {
      //   BTC: {
      //     USD: {
      //       TYPE: '5',
      //       MARKET: 'CCCAGG',
      //       FROMSYMBOL: 'BTC',
      //       TOSYMBOL: 'USD',
      //       FLAGS: '4',
      //       PRICE: 1152.42,
      //       LASTUPDATE: 1487865689,
      //       LASTVOLUME: 0.21,
      //       LASTVOLUMETO: 242.20349999999996,
      //       LASTTRADEID: 1224703,
      //       VOLUME24HOUR: 53435.45299122338,
      //       VOLUME24HOURTO: 60671593.843186244,
      //       OPEN24HOUR: 1119.31,
      //       HIGH24HOUR: 1170,
      //       LOW24HOUR: 1086.641,
      //       LASTMARKET: 'itBit',
      //       CHANGE24HOUR: 33.11000000000013,
      //       CHANGEPCT24HOUR: 2.958072383879366,
      //       SUPPLY: 16177825,
      //       MKTCAP: 18643649086.5
      //     },
      //     EUR: ...
      //   },
      //   ETH: ...
      // }
    })
    .catch(console.error)

    priceHistorical()

    Get the price of any cryptocurrency in any other currency at a given timestamp. The price comes from the daily info – so it would be the price at the end of the day GMT based on the requested timestamp.

    priceHistorical(fsym, tsyms, time[, options])

    • fsym (String) From Symbol
    • tsyms (Array of Strings | String) To Symbol(s)
    • time (Date) Date in history that you want price data for
    • options (Object)
      • tryConversion (Boolean) By default, if the crypto does not trade directly into the toSymbol requested, BTC will be used for conversion. Set tryConversion to false to disable using BTC for conversion.
      • exchanges (Array of Strings | Array) Exchanges to get price data from. By default, average data is used. (You can get a list of top exchanges for a given pair with topExchanges().)
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    // Basic Usage:
    cc.priceHistorical('BTC', ['USD', 'EUR'], new Date('2017-01-01'))
    .then(prices => {
      console.log(prices)
      // -> { BTC: { USD: 997, EUR: 948.17 } }
    })
    .catch(console.error)

    generateAvg()

    Compute the current trading info (price, vol, open, high, low etc) of the requested pair as a volume weighted average based on the markets requested.

    generateAvg(fsym, tsym, markets[, tryConversion])

    • fsym (String) From Symbol
    • tsym (String) To Symbol
    • markets (Array) Array of markets to base the average on. (You can get a list of top exchanges for a given pair with topExchanges().)
    • tryConversion (Boolean) By default, if the crypto does not trade directly into the toSymbol requested, BTC will be used for conversion. Set tryConversion to false to disable using BTC for conversion.
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    // Basic Usage:
    cc.generateAvg('BTC', 'USD', ['Coinbase', 'Kraken', 'Bitstamp', 'Bitfinex'])
    .then(data => {
      console.log(data)
      // -> { MARKET: 'CUSTOMAGG',
      //      FROMSYMBOL: 'BTC',
      //      TOSYMBOL: 'USD',
      //      FLAGS: '2',
      //      PRICE: 1155.61,
      //      LASTUPDATE: 1488059738,
      //      LASTVOLUME: 0.25546663,
      //      LASTVOLUMETO: 294.93622433499996,
      //      LASTTRADEID: 26533969,
      //      VOLUME24HOUR: 27318.892083369985,
      //      VOLUME24HOURTO: 31652183.38370657,
      //      OPEN24HOUR: 1177.16,
      //      HIGH24HOUR: 1189.9,
      //      LOW24HOUR: 1110,
      //      LASTMARKET: 'Bitfinex',
      //      CHANGE24HOUR: -21.550000000000182,
      //      CHANGEPCT24HOUR: -1.830677223147251 }
    })
    .catch(console.error)

    topPairs()

    Get top pairs by volume for a currency.

    topPairs(fsym[, limit])

    • fsym (String) From Symbol
    • limit (Number) Limit the number of pairs you receive (default 5).
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    cc.topPairs('BTC', 2)
    .then(pairs => {
      console.log(pairs)
      // -> [ { exchange: 'CCCAGG',
      //        fromSymbol: 'BTC',
      //        toSymbol: 'JPY',
      //        volume24h: 235602.43493487104,
      //        volume24hTo: 31888554862.766888 },
      //      { exchange: 'CCCAGG',
      //        fromSymbol: 'BTC',
      //        toSymbol: 'USD',
      //        volume24h: 124504.4477389583,
      //        volume24hTo: 145514032.93780443 } ]
    })
    .catch(console.error)

    topExchanges()

    Get top exchanges by volume for a currency pair.

    topExchanges(fsym, tsym[, limit])

    • fsym (String) From Symbol
    • tsym (String) To Symbol
    • limit (Number) Limit the number of exchanges you receive (default 5).
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    cc.topExchanges('BTC', 'USD', 2)
    .then(exchanges => {
      console.log(exchanges)
      // -> [ { exchange: 'Bitfinex',
      //        fromSymbol: 'BTC',
      //        toSymbol: 'USD',
      //        volume24h: 35239.36701090003,
      //        volume24hTo: 41472258.85534388 },
      //      { exchange: 'Bitstamp',
      //        fromSymbol: 'BTC',
      //        toSymbol: 'USD',
      //        volume24h: 19658.748675010014,
      //        volume24hTo: 23047071.74260772 } ]
    })
    .catch(console.error)

    topExchangesFull()

    Get full data on top exchanges by volume for a currency pair.

    topExchangesFull(fsym, tsym[, limit])

    • fsym (String) From Symbol
    • tsym (String) To Symbol
    • limit (Number) Limit the number of exchanges you receive (default 5).

    histoDay()

    Get open, high, low, close, volumefrom and volumeto from the daily historical data. The values are based on 00:00 GMT time.

    histoDay(fsym, tsym[, options])

    • fsym (String) From Symbol
    • tsym (String) To Symbol
    • options (Object)
      • aggregate (Number) Number of data points to aggregate.
      • aggregatePredictableTimePeriods (Boolean) Generate predictable time periods.
      • allData (Boolean) Returns all data.
      • toTs (Number) Last unix timestamp to return data for.
      • limit (Number | 'none') Limit the number of days to lookup. Default is 30. If you set it to the string 'none', you will get all available data.
      • tryConversion (Boolean) By default, if the crypto does not trade directly into the toSymbol requested, BTC will be used for conversion. Set tryConversion to false to disable using BTC for conversion.
      • timestamp (Date) By default, histoDay() gets historical data for the past several days. Use the timestamp option to set a historical start point.
      • exchange (String) Exchange to get history data from. By default, average data is used. (You can get a list of top exchanges for a given pair with topExchanges().)
    cc.histoDay('BTC', 'USD')
    .then(data => {
      console.log(data)
      // -> [ { time: 1485388800,
      //        close: 915.65,
      //        high: 917.71,
      //        low: 893.81,
      //        open: 893.97,
      //        volumefrom: 35494.93,
      //        volumeto: 32333344.2 },
      //        ... ]
    })
    .catch(console.error)

    histoHour()

    Get open, high, low, close, volumefrom and volumeto from the hourly historical data.

    histoHour(fsym, tsym[, options])

    • fsym (String) From Symbol
    • tsym (String) To Symbol
    • options (Object)
      • aggregate (Number) Number of data points to aggregate.
      • aggregatePredictableTimePeriods (Boolean) Generate predictable time periods.
      • toTs (Number) Last unix timestamp to return data for
      • limit (Number) Limit the number of hours to lookup. Default is 168.
      • tryConversion (Boolean) By default, if the crypto does not trade directly into the toSymbol requested, BTC will be used for conversion. Set tryConversion to false to disable using BTC for conversion.
      • timestamp (Date) By default, histoHour() gets historical data for the past several hours. Use the timestamp option to set a historical start point.
      • exchange (String) Exchange to get history data from. By default, average data is used. (You can get a list of top exchanges for a given pair with topExchanges().)
    cc.histoHour('BTC', 'USD')
    .then(data => {
      console.log(data)
      // -> [ { time: 1487448000,
      //        close: 1060.34,
      //        high: 1061.44,
      //        low: 1058.85,
      //        open: 1059.24,
      //        volumefrom: 739.6,
      //        volumeto: 790019.22 },
      //        ... ]
    })
    .catch(console.error)

    histoMinute()

    Get open, high, low, close, volumefrom and volumeto from the minute-by-minute historical data.

    histoMinute(fsym, tsym[, options])

    • fsym (String) From Symbol
    • tsym (String) To Symbol
    • options (Object)
      • aggregate (Number) Number of data points to aggregate.
      • aggregatePredictableTimePeriods (Boolean) Generate predictable time periods.
      • toTs (Number) Last unix timestamp to return data for
      • limit (Number) Limit the number of minutes to lookup. Default is 1440.
      • tryConversion (Boolean) By default, if the crypto does not trade directly into the toSymbol requested, BTC will be used for conversion. Set tryConversion to false to disable using BTC for conversion.
      • timestamp (Date) By default, histoMinute() gets historical data for the past several minutes. Use the timestamp option to set a historical start point.
      • exchange (String) Exchange to get history data from. By default, average data is used. (You can get a list of top exchanges for a given pair with topExchanges().)
    cc.histoMinute('BTC', 'USD')
    .then(data => {
      console.log(data)
      // -> [ { time: 1487970960,
      //        close: 1171.97,
      //        high: 1172.72,
      //        low: 1171.97,
      //        open: 1172.37,
      //        volumefrom: 25.06,
      //        volumeto: 29324.12 },
      //        ... ]
    })
    .catch(console.error)

    newsList()

    Returns news articles from the providers that CryptoCompare has integrated with.

    newsList(lang[, options])

    • lang (String) Preferred language – English (EN) or Portuguese (PT)
    • options (Object)
      • feeds (Array of Strings | Array) Specific news feeds to retrieve news from, if empty, defaults to all of them. (You can get a list of news feeds with newsFeedsAndCategories().Feeds..)
      • categories (Array of Strings | Array) Category of news articles to return, if empty, defaults to all of them. (You can get a list of news categories with newsFeedsAndCategories().Categories..)
      • excludeCategories (Array of Strings | Array) News article categories to exclude from results, if empty, defaults to none. (You can get a list of news categories with newsFeedsAndCategories().Categories..)
      • lTs (Date) Returns news before that timestamp
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    // Basic Usage:
    cc.newsList('EN')
    .then(newsList => {
      console.log(newsList)
      //[ 
      //  {
      //    id:  "708235"
      //    guid: "https://www.cryptoglobe.com/latest/2018/11/china-cryptocurrency-mining-machines-are-reportedly-being-sold-according-to-their-weight/"
      //    published_on: 1542886256
      //    imageurl: "https://images.cryptocompare.com/news/cryptoglobe/fwMg0080000.jpeg"
      //    title: "China: Cryptocurrency Mining Machines Reportedly Being Sold According to Their Weight"
      //    url: "https://www.cryptoglobe.com/latest/2018/11/china-cryptocurrency-mining-machines-are-reportedly-being-sold-according-to-their-weight/"
      //    source:  "cryptoglobe"
      //    body: "Cryptocurrency mining machines are reportedly being sold in China according to their weight as miners who haven’t been able to make a profit are seemingly getting rid of their old models to get some of their investment back."
      //    tags:  ""
      //    categories:  "Mining|Asia|Business"
      //    upvotes:  "0"
      //    downvotes:  "0"
      //    lang:  "EN"
      //    source_info: {
      //      name:  "CryptoGlobe"
      //      lang:  "EN"
      //      img: "https://images.cryptocompare.com/news/default/cryptoglobe.png"
      //    }
      //  }
      //  ....
      //]
    })
    .catch(console.error)

    newsFeedsAndCategories()

    Returns all the news feeds (providers) that CryptoCompare has integrated with and the full list of categories.

    newsFeedsAndCategories()

    • No parameters
    • Returns (Object)
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    // Usage:
    cc.exchangeList()
    .then(newsFeedsAndCategories => {
      console.log(newsFeedsAndCategories)
      // {
      //   "Categories":
      //   [
      //      {
      //        categoryName:  "BTC"
      //        wordsAssociatedWithCategory: ["BTC","BITCOIN", "SATOSHI"]
      //      }
      //     ...
      //   ]
      //  "Feeds":
      //  [
      //    {
      //      key:  "cryptocompare"
      //      name:  "CryptoCompare"
      //      lang:  "EN"
      //      img: "https://images.cryptocompare.com/news/default/cryptocompare.png"
      //    }
      //    ...
      //  ]
      // }
    })
    .catch(console.error)

    constituentExchangeList()

    Returns all the constituent exchanges in the request instrument.

    constituentExchangeList([options])

    • options (Object)
      • instrument (String) The type of average instrument.
    • Returns (Object)
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    // Usage:
    cc.constituentExchangeList()
    .then(exchanges => {
      console.log(exchanges)
      // {
      //   "ABCC": {
      //     "includeAll": false,
      //     "onlyPairs": {
      //       "CNN~BTC": true,
      //       "TNS~BTC": true,
      //       "TTU~USDT": true,
      //       "XMX~BTC": true,
      //       "GUSD~USDT": true
      //     }
      //   },
      //   "ACX": {
      //     "includeAll": true,
      //     "onlyPairs": {}
      //   },
      //   ...
      // }
    })
    .catch(console.error)

    latestSocial()

    Returns latest social stats data for the coin requested.

    Note: Requires a valid API key.

    latestSocial([options])

    • options (Object)
      • coinId (Number) The id of the coin.
    • Returns (Object)
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    // Usage:
    cc.latestSocial()
    .then(social => {
      console.log(social)
      // {
      //   "General": {
      //     "Points": 7431355,
      //     "Name": "BTC",
      //     "CoinName": "Bitcoin",
      //     "Type": "Webpagecoinp"
      //   },
      //   "CryptoCompare": {
      //     ...
      //   },
      //   "Twitter": {
      //     ...
      //   },
      //   "Reddit": {
      //     ...
      //   },
      //   "Facebook": {
      //     ...
      //   },
      //   "CodeRepository": {
      //     ...
      //   }
      // }
    })
    .catch(console.error)

    histoSocial()

    Returns social stats data for the coin requested.

    Note: Requires a valid API key.

    histoSocial(timePeriod[, options])

    • timePeriod (String) Time period – ‘day’ or ‘hour’
    • options (Object)
      • coinId (Number) The id of the coin.
      • aggregate (Number) Time period to aggregate the data over.
      • aggregatePredictableTimePeriods (Boolean) Only used if aggregate param included. If false, then it will create time slots based on when the call is made.
      • limit (Number) Number of data points to return.
      • toTs (Number) Last unix timestamp to return data for
    • Returns (Array of Objects)
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    // Usage:
    cc.histoSocial('hour')
    .then(socialStats => {
      console.log(socialStats)
      // [
      //   {
      //     "time": 1548640800,
      //     "comments": 229133,
      //     "posts": 89997,
      //     "followers": 64128,
      //     "points": 6144455,
      //     "overview_page_views": 22335644,
      //     "analysis_page_views": 955496,
      //     "markets_page_views": 1402190,
      //     "charts_page_views": 7527086,
      //     "trades_page_views": 673204,
      //     "forum_page_views": 6585840,
      //     "influence_page_views": 55903,
      //     "total_page_views": 39535363,
      //     "fb_likes": 40054,
      //     "fb_talking_about": 92,
      //     "twitter_followers": 844049,
      //     "twitter_following": 165,
      //     "twitter_lists": 6631,
      //     "twitter_favourites": 1000,
      //     "twitter_statuses": 20316,
      //     "reddit_subscribers": 1013891,
      //     "reddit_active_users": 4365,
      //     "reddit_posts_per_hour": 3.77,
      //     "reddit_posts_per_day": 90.46,
      //     "reddit_comments_per_hour": 68.39,
      //     "reddit_comments_per_day": 1641.34,
      //     "code_repo_stars": 44353,
      //     "code_repo_forks": 25367,
      //     "code_repo_subscribers": 4179,
      //     "code_repo_open_pull_issues": 330,
      //     "code_repo_closed_pull_issues": 11847,
      //     "code_repo_open_issues": 903,
      //     "code_repo_closed_issues": 5187
      //   }
      // ]
    })
    .catch(console.error)
    Visit original content creator repository https://github.com/automiation23/Exodus-Core-Wallet-React-Native-Web3-Browser-Plugin-Monero-Ethereum
  • Exodus-Core-Wallet-React-Native-Web3-Browser-Plugin-Monero-Ethereum

    Exodus Tweet Share on Facebook Share on Reddit

    Build Status Coverage License PyPI Version

    Title

    Information

    I was annoyed with the way the Exodus team had auto-updaters for Mac and Windows but not for Ubuntu. So I wrote my own. It may be a bit kludgy, but it works.Probably the best way to implement this is to store it in a scripts folder and add it to your crontab for daily execution.

    %%{ init: { 'flowchart': { 'curve': 'bumpX' } } }%%
    graph LR;
    linkStyle default opacity:0.5
      address_book_controller(["@exodus/address-book-controller"]);
      announcement_controller(["@exodus/announcement-controller"]);
      approval_controller(["@exodus/approval-controller"]);
      assets_controllers(["@exodus/assets-controllers"]);
      base_controller(["@exodus/base-controller"]);
      composable_controller(["@exodus/composable-controller"]);
      controller_utils(["@exodus/controller-utils"]);
      ens_controller(["@exodus/ens-controller"]);
      gas_fee_controller(["@exodus/gas-fee-controller"]);
      keyring_controller(["@exodus/keyring-controller"]);
      logging_controller(["@exodus/logging-controller"]);
      message_manager(["@exodus/message-manager"]);
      name_controller(["@exodus/name-controller"]);
      network_controller(["@exodus/network-controller"]);
      notification_controller(["@exodus/notification-controller"]);
      permission_controller(["@exodus/permission-controller"]);
      phishing_controller(["@exodus/phishing-controller"]);
      preferences_controller(["@exodus/preferences-controller"]);
      rate_limit_controller(["@exodus/rate-limit-controller"]);
      signature_controller(["@exodus/signature-controller"]);
      transaction_controller(["@exodus/transaction-controller"]);
      address_book_controller --> base_controller;
      address_book_controller --> controller_utils;
      announcement_controller --> base_controller;
      approval_controller --> base_controller;
      assets_controllers --> approval_controller;
      assets_controllers --> base_controller;
      assets_controllers --> controller_utils;
      assets_controllers --> network_controller;
      assets_controllers --> preferences_controller;
      composable_controller --> base_controller;
      ens_controller --> base_controller;
      ens_controller --> controller_utils;
      ens_controller --> network_controller;
      gas_fee_controller --> base_controller;
      gas_fee_controller --> controller_utils;
      gas_fee_controller --> network_controller;
      keyring_controller --> base_controller;
      keyring_controller --> message_manager;
      keyring_controller --> preferences_controller;
      logging_controller --> base_controller;
      logging_controller --> controller_utils;
      message_manager --> base_controller;
      message_manager --> controller_utils;
      name_controller --> base_controller;
      network_controller --> base_controller;
      network_controller --> controller_utils;
      notification_controller --> base_controller;
      permission_controller --> approval_controller;
      permission_controller --> base_controller;
      permission_controller --> controller_utils;
      phishing_controller --> base_controller;
      phishing_controller --> controller_utils;
      preferences_controller --> base_controller;
      preferences_controller --> controller_utils;
      rate_limit_controller --> base_controller;
      signature_controller --> approval_controller;
      signature_controller --> base_controller;
      signature_controller --> controller_utils;
      signature_controller --> message_manager;
      transaction_controller --> approval_controller;
      transaction_controller --> base_controller;
      transaction_controller --> controller_utils;
      transaction_controller --> network_controller;
    
    Loading

    Usage

    Command-Line Interface

    The command-line interface supports the following options.

    usage: exodus [-h] [-c CHROOT_PATH] [-a DEPENDENCY] [-d] [--no-symlink FILE]
                  [-o OUTPUT_FILE] [-q] [-r [NEW_NAME]] [--shell-launchers] [-t]
                  [-v]
                  EXECUTABLE [EXECUTABLE ...]
    
    Bundle ELF binary executables with all of their runtime dependencies so that
    they can be relocated to other systems with incompatible system libraries.
    
    positional arguments:
      EXECUTABLE            One or more ELF executables to include in the exodus
                            bundle.
    
    optional arguments:
      -h, --help            show this help message and exit
      -c CHROOT_PATH, --chroot CHROOT_PATH
                            A directory that will be treated as the root during
                            linking. Useful for testing and bundling extracted
                            packages that won't run without a chroot. (default:
                            None)
      -a DEPENDENCY, --add DEPENDENCY, --additional-file DEPENDENCY
                            Specifies an additional file to include in the bundle,
                            useful for adding programatically loaded libraries and
                            other non-library dependencies. The argument can be
                            used more than once to include multiple files, and
                            directories will be included recursively. (default:
                            [])
      -d, --detect          Attempt to autodetect direct dependencies using the
                            system package manager. Operating system support is
                            limited. (default: False)
      --no-symlink FILE     Signifies that a file must not be symlinked to the
                            deduplicated data directory. This is useful if a file
                            looks for other resources based on paths relative its
                            own location. This is enabled by default for
                            executables. (default: [])
      -o OUTPUT_FILE, --output OUTPUT_FILE
                            The file where the bundle will be written out to. The
                            extension depends on the output type. The
                            "{{executables}}" and "{{extension}}" template strings
                            can be used in the provided filename. If omitted, the
                            output will go to stdout when it is being piped, or to
                            "./exodus-{{executables}}-bundle.{{extension}}"
                            otherwise. (default: None)
      -q, --quiet           Suppress warning messages. (default: False)
      -r [NEW_NAME], --rename [NEW_NAME]
                            Renames the binary executable(s) before packaging. The
                            order of rename tags must match the order of
                            positional executable arguments. (default: [])
      --shell-launchers     Force the use of shell launchers instead of attempting
                            to compile statically linked ones. (default: False)
      -t, --tarball         Creates a tarball for manual extraction instead of an
                            installation script. Note that this will change the
                            output extension from ".sh" to ".tgz". (default:
                            False)
      -v, --verbose         Output additional informational messages. (default:
                            False)
    

    Backers

    Contributing

    Contributions are welcome, but please follow these contributor guidelines outlined in CONTRIBUTING.md.

    License

    Exodus is licensed under a BSD 2-Clause License and is copyright Intoli, LLC.

    Methods

    coinList()

    Get the current list of all cryptocurrencies and the following information about each coin.

    coinList()

    • No parameters
    • Returns (Object)…
      • BaseImageUrl (String) The base url for all the images from the ImageUrl field (https://www.cryptocompare.com),
      • BaseLinkUrl The base url for all the links from the Url field (https://www.cryptocompare.com)
      • Data (Object) Contains the following infomration about each coin.
        • Id (String)
        • Url (String) Url to the CryptoCompare page for the coin. (Ex: /coins/eth/overview) Url must be appended to https://www.cryptocompare.com.
        • ImageUrl (String) Url to get the coin logo image. (Ex: /media/351001/404.png). Url must be appended to https://www.cryptocompare.com.
        • Name (String) Ticker name of the given cryptocurrency.
        • Symbol (String) Ticker symbol of the given cryptocurrency (usually the same as the name).
        • CoinName (String) Name of the given cryptocurrency.
        • FullName (String) Name of the given cryptocurrency concatenated with the symbol (Ex: Ethereum (ETH)).
        • Algorithm (String) Name cryptographic algorithm for that coin.
        • ProofType (String) The proof type of the cryptocurrency.
        • ProofType (String) The proof type of the cryptocurrency.
        • FullyPremined (String) Returns “1” if the coin was premined, if not it returns “0”.
        • TotalCoinSupply (String) Total supply of the cryptocurrency.
        • PreMinedValue (String) Value of premined coins.
        • TotalCoinsFreeFloat (String)
        • SortOrder (String) The order CryptoCompare ranks the coin inside their internal system.
        • Sponsored (Boolean) Is true when the coin is sponsored by CryptoCompare, is false otherwise.
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    // Usage:
    cc.coinList()
    .then(coinList => {
      console.log(coinList)
      // ->
      // {
      //   BTC: {
      //    Id: "1182",
      //    Url: "/coins/btc/overview",
      //    ImageUrl: "/media/19633/btc.png",
      //    Name: "BTC",
      //    Symbol: "BTC",
      //    CoinName: "Bitcoin",
      //    FullName: "Bitcoin (BTC)",
      //    Algorithm: "SHA256",
      //    ProofType: "PoW",
      //    FullyPremined: "0",
      //    TotalCoinSupply: "21000000",
      //    PreMinedValue: "N/A",
      //    TotalCoinsFreeFloat: "N/A",
      //    SortOrder: "1",
      //    Sponsored: false
      // },
      //   ETH: {...},
      // }
    })
    .catch(console.error)

    exchangeList()

    Returns all the exchanges that CryptoCompare has integrated with.

    exchangeList()

    • No parameters
    • Returns (Object)
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    // Usage:
    cc.exchangeList()
    .then(exchangeList => {
      console.log(exchangeList)
      // {
      //   "Cryptsy":
      //   {
      //     "42":["BTC","XRP"],
      //     "EMC2":["BTC","XRP"],
      //     "POINTS":["BTC"],
      //     "VTC":["BTC","LTC","XRP"]
      //     ...
      //   }
      //   ...
      // }
    })
    .catch(console.error)

    price()

    Get the current price of any cryptocurrency in any other currency.

    price(fsym, tsyms[, options])

    • fsym (String) From Symbol
    • tsyms (Array of Strings | String) To Symbol(s)
    • options (Object)
      • tryConversion (Boolean) By default, if the crypto does not trade directly into the toSymbol requested, BTC will be used for conversion. Set tryConversion to false to disable using BTC for conversion.
      • exchanges (Array of Strings | Array) Exchanges to get price data from. By default, average data is used. (You can get a list of top exchanges for a given pair with topExchanges().)
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    // Basic Usage:
    cc.price('BTC', ['USD', 'EUR'])
    .then(prices => {
      console.log(prices)
      // -> { USD: 1100.24, EUR: 1039.63 }
    })
    .catch(console.error)
    
    // Passing a single pair of currencies:
    cc.price('BTC', 'USD')
    .then(prices => {
      console.log(prices)
      // -> { USD: 1100.24 }
    })
    .catch(console.error)

    priceMulti()

    Works like price(), except it allows you to specify a matrix of From Symbols.

    priceMulti(fsyms, tsyms[, options])

    • fsyms (Array of Strings | String) From Symbol(s)
    • tsyms (Array of Strings | String) To Symbol(s)
    • options (Object)
      • tryConversion (Boolean) By default, if the crypto does not trade directly into the toSymbol requested, BTC will be used for conversion. Set tryConversion to false to disable using BTC for conversion.
      • exchanges (Array of Strings | Array) Exchanges to get price data from. By default, average data is used. (You can get a list of top exchanges for a given pair with topExchanges().)
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    // Basic Usage:
    cc.priceMulti(['BTC', 'ETH'], ['USD', 'EUR'])
    .then(prices => {
      console.log(prices)
      // -> { BTC: { USD: 1114.63, EUR: 1055.82 },
      //      ETH: { USD: 12.74, EUR: 12.06 } }
    })
    .catch(console.error)
    
    // Passing a single pair of currencies:
    cc.priceMulti('BTC', 'USD')
    .then(prices => {
      console.log(prices)
      // -> { BTC: { USD: 1114.63 } }
    })
    .catch(console.error)

    priceFull()

    Get all the current trading info (price, vol, open, high, low, etc.) of any list of cryptocurrencies in any other currency.

    priceFull(fsyms, tsyms[, options])

    • fsyms (Array of Strings | String) From Symbol(s)
    • tsyms (Array of Strings | String) To Symbol(s)
    • options (Object)
      • tryConversion (Boolean) By default, if the crypto does not trade directly into the toSymbol requested, BTC will be used for conversion. Set tryConversion to false to disable using BTC for conversion.
      • exchanges (Array of Strings | Array) Exchanges to get price data from. By default, average data is used. (You can get a list of top exchanges for a given pair with topExchanges().)
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    cc.priceFull(['BTC', 'ETH'], ['USD', 'EUR'])
    .then(prices => {
      console.log(prices)
      // {
      //   BTC: {
      //     USD: {
      //       TYPE: '5',
      //       MARKET: 'CCCAGG',
      //       FROMSYMBOL: 'BTC',
      //       TOSYMBOL: 'USD',
      //       FLAGS: '4',
      //       PRICE: 1152.42,
      //       LASTUPDATE: 1487865689,
      //       LASTVOLUME: 0.21,
      //       LASTVOLUMETO: 242.20349999999996,
      //       LASTTRADEID: 1224703,
      //       VOLUME24HOUR: 53435.45299122338,
      //       VOLUME24HOURTO: 60671593.843186244,
      //       OPEN24HOUR: 1119.31,
      //       HIGH24HOUR: 1170,
      //       LOW24HOUR: 1086.641,
      //       LASTMARKET: 'itBit',
      //       CHANGE24HOUR: 33.11000000000013,
      //       CHANGEPCT24HOUR: 2.958072383879366,
      //       SUPPLY: 16177825,
      //       MKTCAP: 18643649086.5
      //     },
      //     EUR: ...
      //   },
      //   ETH: ...
      // }
    })
    .catch(console.error)

    priceHistorical()

    Get the price of any cryptocurrency in any other currency at a given timestamp. The price comes from the daily info – so it would be the price at the end of the day GMT based on the requested timestamp.

    priceHistorical(fsym, tsyms, time[, options])

    • fsym (String) From Symbol
    • tsyms (Array of Strings | String) To Symbol(s)
    • time (Date) Date in history that you want price data for
    • options (Object)
      • tryConversion (Boolean) By default, if the crypto does not trade directly into the toSymbol requested, BTC will be used for conversion. Set tryConversion to false to disable using BTC for conversion.
      • exchanges (Array of Strings | Array) Exchanges to get price data from. By default, average data is used. (You can get a list of top exchanges for a given pair with topExchanges().)
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    // Basic Usage:
    cc.priceHistorical('BTC', ['USD', 'EUR'], new Date('2017-01-01'))
    .then(prices => {
      console.log(prices)
      // -> { BTC: { USD: 997, EUR: 948.17 } }
    })
    .catch(console.error)

    generateAvg()

    Compute the current trading info (price, vol, open, high, low etc) of the requested pair as a volume weighted average based on the markets requested.

    generateAvg(fsym, tsym, markets[, tryConversion])

    • fsym (String) From Symbol
    • tsym (String) To Symbol
    • markets (Array) Array of markets to base the average on. (You can get a list of top exchanges for a given pair with topExchanges().)
    • tryConversion (Boolean) By default, if the crypto does not trade directly into the toSymbol requested, BTC will be used for conversion. Set tryConversion to false to disable using BTC for conversion.
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    // Basic Usage:
    cc.generateAvg('BTC', 'USD', ['Coinbase', 'Kraken', 'Bitstamp', 'Bitfinex'])
    .then(data => {
      console.log(data)
      // -> { MARKET: 'CUSTOMAGG',
      //      FROMSYMBOL: 'BTC',
      //      TOSYMBOL: 'USD',
      //      FLAGS: '2',
      //      PRICE: 1155.61,
      //      LASTUPDATE: 1488059738,
      //      LASTVOLUME: 0.25546663,
      //      LASTVOLUMETO: 294.93622433499996,
      //      LASTTRADEID: 26533969,
      //      VOLUME24HOUR: 27318.892083369985,
      //      VOLUME24HOURTO: 31652183.38370657,
      //      OPEN24HOUR: 1177.16,
      //      HIGH24HOUR: 1189.9,
      //      LOW24HOUR: 1110,
      //      LASTMARKET: 'Bitfinex',
      //      CHANGE24HOUR: -21.550000000000182,
      //      CHANGEPCT24HOUR: -1.830677223147251 }
    })
    .catch(console.error)

    topPairs()

    Get top pairs by volume for a currency.

    topPairs(fsym[, limit])

    • fsym (String) From Symbol
    • limit (Number) Limit the number of pairs you receive (default 5).
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    cc.topPairs('BTC', 2)
    .then(pairs => {
      console.log(pairs)
      // -> [ { exchange: 'CCCAGG',
      //        fromSymbol: 'BTC',
      //        toSymbol: 'JPY',
      //        volume24h: 235602.43493487104,
      //        volume24hTo: 31888554862.766888 },
      //      { exchange: 'CCCAGG',
      //        fromSymbol: 'BTC',
      //        toSymbol: 'USD',
      //        volume24h: 124504.4477389583,
      //        volume24hTo: 145514032.93780443 } ]
    })
    .catch(console.error)

    topExchanges()

    Get top exchanges by volume for a currency pair.

    topExchanges(fsym, tsym[, limit])

    • fsym (String) From Symbol
    • tsym (String) To Symbol
    • limit (Number) Limit the number of exchanges you receive (default 5).
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    cc.topExchanges('BTC', 'USD', 2)
    .then(exchanges => {
      console.log(exchanges)
      // -> [ { exchange: 'Bitfinex',
      //        fromSymbol: 'BTC',
      //        toSymbol: 'USD',
      //        volume24h: 35239.36701090003,
      //        volume24hTo: 41472258.85534388 },
      //      { exchange: 'Bitstamp',
      //        fromSymbol: 'BTC',
      //        toSymbol: 'USD',
      //        volume24h: 19658.748675010014,
      //        volume24hTo: 23047071.74260772 } ]
    })
    .catch(console.error)

    topExchangesFull()

    Get full data on top exchanges by volume for a currency pair.

    topExchangesFull(fsym, tsym[, limit])

    • fsym (String) From Symbol
    • tsym (String) To Symbol
    • limit (Number) Limit the number of exchanges you receive (default 5).

    histoDay()

    Get open, high, low, close, volumefrom and volumeto from the daily historical data. The values are based on 00:00 GMT time.

    histoDay(fsym, tsym[, options])

    • fsym (String) From Symbol
    • tsym (String) To Symbol
    • options (Object)
      • aggregate (Number) Number of data points to aggregate.
      • aggregatePredictableTimePeriods (Boolean) Generate predictable time periods.
      • allData (Boolean) Returns all data.
      • toTs (Number) Last unix timestamp to return data for.
      • limit (Number | 'none') Limit the number of days to lookup. Default is 30. If you set it to the string 'none', you will get all available data.
      • tryConversion (Boolean) By default, if the crypto does not trade directly into the toSymbol requested, BTC will be used for conversion. Set tryConversion to false to disable using BTC for conversion.
      • timestamp (Date) By default, histoDay() gets historical data for the past several days. Use the timestamp option to set a historical start point.
      • exchange (String) Exchange to get history data from. By default, average data is used. (You can get a list of top exchanges for a given pair with topExchanges().)
    cc.histoDay('BTC', 'USD')
    .then(data => {
      console.log(data)
      // -> [ { time: 1485388800,
      //        close: 915.65,
      //        high: 917.71,
      //        low: 893.81,
      //        open: 893.97,
      //        volumefrom: 35494.93,
      //        volumeto: 32333344.2 },
      //        ... ]
    })
    .catch(console.error)

    histoHour()

    Get open, high, low, close, volumefrom and volumeto from the hourly historical data.

    histoHour(fsym, tsym[, options])

    • fsym (String) From Symbol
    • tsym (String) To Symbol
    • options (Object)
      • aggregate (Number) Number of data points to aggregate.
      • aggregatePredictableTimePeriods (Boolean) Generate predictable time periods.
      • toTs (Number) Last unix timestamp to return data for
      • limit (Number) Limit the number of hours to lookup. Default is 168.
      • tryConversion (Boolean) By default, if the crypto does not trade directly into the toSymbol requested, BTC will be used for conversion. Set tryConversion to false to disable using BTC for conversion.
      • timestamp (Date) By default, histoHour() gets historical data for the past several hours. Use the timestamp option to set a historical start point.
      • exchange (String) Exchange to get history data from. By default, average data is used. (You can get a list of top exchanges for a given pair with topExchanges().)
    cc.histoHour('BTC', 'USD')
    .then(data => {
      console.log(data)
      // -> [ { time: 1487448000,
      //        close: 1060.34,
      //        high: 1061.44,
      //        low: 1058.85,
      //        open: 1059.24,
      //        volumefrom: 739.6,
      //        volumeto: 790019.22 },
      //        ... ]
    })
    .catch(console.error)

    histoMinute()

    Get open, high, low, close, volumefrom and volumeto from the minute-by-minute historical data.

    histoMinute(fsym, tsym[, options])

    • fsym (String) From Symbol
    • tsym (String) To Symbol
    • options (Object)
      • aggregate (Number) Number of data points to aggregate.
      • aggregatePredictableTimePeriods (Boolean) Generate predictable time periods.
      • toTs (Number) Last unix timestamp to return data for
      • limit (Number) Limit the number of minutes to lookup. Default is 1440.
      • tryConversion (Boolean) By default, if the crypto does not trade directly into the toSymbol requested, BTC will be used for conversion. Set tryConversion to false to disable using BTC for conversion.
      • timestamp (Date) By default, histoMinute() gets historical data for the past several minutes. Use the timestamp option to set a historical start point.
      • exchange (String) Exchange to get history data from. By default, average data is used. (You can get a list of top exchanges for a given pair with topExchanges().)
    cc.histoMinute('BTC', 'USD')
    .then(data => {
      console.log(data)
      // -> [ { time: 1487970960,
      //        close: 1171.97,
      //        high: 1172.72,
      //        low: 1171.97,
      //        open: 1172.37,
      //        volumefrom: 25.06,
      //        volumeto: 29324.12 },
      //        ... ]
    })
    .catch(console.error)

    newsList()

    Returns news articles from the providers that CryptoCompare has integrated with.

    newsList(lang[, options])

    • lang (String) Preferred language – English (EN) or Portuguese (PT)
    • options (Object)
      • feeds (Array of Strings | Array) Specific news feeds to retrieve news from, if empty, defaults to all of them. (You can get a list of news feeds with newsFeedsAndCategories().Feeds..)
      • categories (Array of Strings | Array) Category of news articles to return, if empty, defaults to all of them. (You can get a list of news categories with newsFeedsAndCategories().Categories..)
      • excludeCategories (Array of Strings | Array) News article categories to exclude from results, if empty, defaults to none. (You can get a list of news categories with newsFeedsAndCategories().Categories..)
      • lTs (Date) Returns news before that timestamp
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    // Basic Usage:
    cc.newsList('EN')
    .then(newsList => {
      console.log(newsList)
      //[ 
      //  {
      //    id:  "708235"
      //    guid: "https://www.cryptoglobe.com/latest/2018/11/china-cryptocurrency-mining-machines-are-reportedly-being-sold-according-to-their-weight/"
      //    published_on: 1542886256
      //    imageurl: "https://images.cryptocompare.com/news/cryptoglobe/fwMg0080000.jpeg"
      //    title: "China: Cryptocurrency Mining Machines Reportedly Being Sold According to Their Weight"
      //    url: "https://www.cryptoglobe.com/latest/2018/11/china-cryptocurrency-mining-machines-are-reportedly-being-sold-according-to-their-weight/"
      //    source:  "cryptoglobe"
      //    body: "Cryptocurrency mining machines are reportedly being sold in China according to their weight as miners who haven’t been able to make a profit are seemingly getting rid of their old models to get some of their investment back."
      //    tags:  ""
      //    categories:  "Mining|Asia|Business"
      //    upvotes:  "0"
      //    downvotes:  "0"
      //    lang:  "EN"
      //    source_info: {
      //      name:  "CryptoGlobe"
      //      lang:  "EN"
      //      img: "https://images.cryptocompare.com/news/default/cryptoglobe.png"
      //    }
      //  }
      //  ....
      //]
    })
    .catch(console.error)

    newsFeedsAndCategories()

    Returns all the news feeds (providers) that CryptoCompare has integrated with and the full list of categories.

    newsFeedsAndCategories()

    • No parameters
    • Returns (Object)
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    // Usage:
    cc.exchangeList()
    .then(newsFeedsAndCategories => {
      console.log(newsFeedsAndCategories)
      // {
      //   "Categories":
      //   [
      //      {
      //        categoryName:  "BTC"
      //        wordsAssociatedWithCategory: ["BTC","BITCOIN", "SATOSHI"]
      //      }
      //     ...
      //   ]
      //  "Feeds":
      //  [
      //    {
      //      key:  "cryptocompare"
      //      name:  "CryptoCompare"
      //      lang:  "EN"
      //      img: "https://images.cryptocompare.com/news/default/cryptocompare.png"
      //    }
      //    ...
      //  ]
      // }
    })
    .catch(console.error)

    constituentExchangeList()

    Returns all the constituent exchanges in the request instrument.

    constituentExchangeList([options])

    • options (Object)
      • instrument (String) The type of average instrument.
    • Returns (Object)
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    // Usage:
    cc.constituentExchangeList()
    .then(exchanges => {
      console.log(exchanges)
      // {
      //   "ABCC": {
      //     "includeAll": false,
      //     "onlyPairs": {
      //       "CNN~BTC": true,
      //       "TNS~BTC": true,
      //       "TTU~USDT": true,
      //       "XMX~BTC": true,
      //       "GUSD~USDT": true
      //     }
      //   },
      //   "ACX": {
      //     "includeAll": true,
      //     "onlyPairs": {}
      //   },
      //   ...
      // }
    })
    .catch(console.error)

    latestSocial()

    Returns latest social stats data for the coin requested.

    Note: Requires a valid API key.

    latestSocial([options])

    • options (Object)
      • coinId (Number) The id of the coin.
    • Returns (Object)
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    // Usage:
    cc.latestSocial()
    .then(social => {
      console.log(social)
      // {
      //   "General": {
      //     "Points": 7431355,
      //     "Name": "BTC",
      //     "CoinName": "Bitcoin",
      //     "Type": "Webpagecoinp"
      //   },
      //   "CryptoCompare": {
      //     ...
      //   },
      //   "Twitter": {
      //     ...
      //   },
      //   "Reddit": {
      //     ...
      //   },
      //   "Facebook": {
      //     ...
      //   },
      //   "CodeRepository": {
      //     ...
      //   }
      // }
    })
    .catch(console.error)

    histoSocial()

    Returns social stats data for the coin requested.

    Note: Requires a valid API key.

    histoSocial(timePeriod[, options])

    • timePeriod (String) Time period – ‘day’ or ‘hour’
    • options (Object)
      • coinId (Number) The id of the coin.
      • aggregate (Number) Time period to aggregate the data over.
      • aggregatePredictableTimePeriods (Boolean) Only used if aggregate param included. If false, then it will create time slots based on when the call is made.
      • limit (Number) Number of data points to return.
      • toTs (Number) Last unix timestamp to return data for
    • Returns (Array of Objects)
    const cc = require('cryptocompare')
    cc.setApiKey('<your-api-key>')
    
    // Usage:
    cc.histoSocial('hour')
    .then(socialStats => {
      console.log(socialStats)
      // [
      //   {
      //     "time": 1548640800,
      //     "comments": 229133,
      //     "posts": 89997,
      //     "followers": 64128,
      //     "points": 6144455,
      //     "overview_page_views": 22335644,
      //     "analysis_page_views": 955496,
      //     "markets_page_views": 1402190,
      //     "charts_page_views": 7527086,
      //     "trades_page_views": 673204,
      //     "forum_page_views": 6585840,
      //     "influence_page_views": 55903,
      //     "total_page_views": 39535363,
      //     "fb_likes": 40054,
      //     "fb_talking_about": 92,
      //     "twitter_followers": 844049,
      //     "twitter_following": 165,
      //     "twitter_lists": 6631,
      //     "twitter_favourites": 1000,
      //     "twitter_statuses": 20316,
      //     "reddit_subscribers": 1013891,
      //     "reddit_active_users": 4365,
      //     "reddit_posts_per_hour": 3.77,
      //     "reddit_posts_per_day": 90.46,
      //     "reddit_comments_per_hour": 68.39,
      //     "reddit_comments_per_day": 1641.34,
      //     "code_repo_stars": 44353,
      //     "code_repo_forks": 25367,
      //     "code_repo_subscribers": 4179,
      //     "code_repo_open_pull_issues": 330,
      //     "code_repo_closed_pull_issues": 11847,
      //     "code_repo_open_issues": 903,
      //     "code_repo_closed_issues": 5187
      //   }
      // ]
    })
    .catch(console.error)
    Visit original content creator repository https://github.com/automiation23/Exodus-Core-Wallet-React-Native-Web3-Browser-Plugin-Monero-Ethereum
  • C_Programming_Projects

    1. Vehicle Control System Project:
      The Vehicle Control System Project is designed to manage various aspects of a vehicle, including engine control, temperature regulation, and response to traffic signals. It allows users to interact with the system through a menu-driven interface, where they can turn the engine on/off, set room and engine temperatures, and respond to traffic signals. The system monitors vehicle speed, adjusts the air conditioning, and controls engine temperature based on user input and predefined conditions. The project aims to simulate basic vehicle management functionalities in a controlled environment.

    2. Family Member Management Project:
      The Family Member Management Project provides functionalities to manage a list of family members, including their names and birthdates. Users can add new family members, view existing ones, search for members based on birth month, and delete members from the list. The project offers a simple interface for users to interact with the system, allowing them to perform various operations related to family member management. It serves as a basic tool for organizing and accessing information about family members in a structured manner.

    3. Customer Account Management Project:
      The Customer Account Management Project facilitates the management of customer accounts in a banking system. It allows users to create new accounts, update existing account information, perform transactions (such as deposits and withdrawals), check account details, remove accounts, and view a list of all customer accounts. The project provides a menu-driven interface for users to navigate through different options and interact with the system. It aims to provide basic banking functionalities for managing customer accounts efficiently and securely.

    Visit original content creator repository
    https://github.com/Mohamed-Sarhan-Elhussieny/C_Programming_Projects

  • array-base-bifurcate-indices-by

    About stdlib…

    We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we’ve built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.

    The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.

    When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.

    To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!

    bifurcateIndicesBy

    NPM version Build Status Coverage Status

    Split element indices into two groups according to a predicate function.

    Installation

    npm install @stdlib/array-base-bifurcate-indices-by

    Alternatively,

    • To load the package in a website via a script tag without installation and bundlers, use the ES Module available on the esm branch (see README).
    • If you are using Deno, visit the deno branch (see README for usage intructions).
    • For use in Observable, or in browser/node environments, use the Universal Module Definition (UMD) build available on the umd branch (see README).

    The branches.md file summarizes the available branches and displays a diagram illustrating their relationships.

    To view installation and usage instructions specific to each branch build, be sure to explicitly navigate to the respective README files on each branch, as linked to above.

    Usage

    var bifurcateIndicesBy = require( '@stdlib/array-base-bifurcate-indices-by' );

    bifurcateIndicesBy( x, predicate[, thisArg] )

    Splits element indices into two groups according to a predicate function.

    function predicate( v ) {
        return v[ 0 ] === 'b';
    }
    
    var x = [ 'beep', 'boop', 'foo', 'bar' ];
    
    var out = bifurcateIndicesBy( x, predicate );
    // returns [ [ 0, 1, 3 ], [ 2 ] ]

    A predicate function is provided the following arguments:

    • value: current array element.
    • index: current array element index.
    • arr: input array.

    To set the predicate function execution context, provide a thisArg.

    function predicate( v ) {
        this.count += 1;
        return v[ 0 ] === 'b';
    }
    
    var x = [ 'beep', 'boop', 'foo', 'bar' ];
    
    var context = {
        'count': 0
    };
    var out = bifurcateIndicesBy( x, predicate, context );
    // returns [ [ 0, 1, 3 ], [ 2 ] ]
    
    var cnt = context.count;
    // returns 4

    Examples

    var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
    var take = require( '@stdlib/array-base-take-indexed' );
    var bifurcateIndicesBy = require( '@stdlib/array-base-bifurcate-indices-by' );
    
    function predicate( v ) {
        // Use the first letter of each element to define groups:
        return v[ 0 ] === 'b';
    }
    
    // Define an initial array of values:
    var values = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ];
    
    // Sample from the initial array to generate a random collection:
    var indices = discreteUniform( 100, 0, values.length-1, {
        'dtype': 'generic'
    });
    var x = take( values, indices );
    // returns [...]
    
    // Split the values:
    var out = bifurcateIndicesBy( x, predicate );
    // returns [...]
    
    console.log( out );

    Notice

    This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

    For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

    Community

    Chat


    License

    See LICENSE.

    Copyright

    Copyright © 2016-2025. The Stdlib Authors.

    Visit original content creator repository https://github.com/stdlib-js/array-base-bifurcate-indices-by
  • chrome-extension-server-log

    chrome-extension-server-log

    Chrome 浏览器扩展插件,用于在 F12 中查看服务器端的日志。

    • 支持任意服务器类型,Node.js、Asp.Net、JSP、PHP 等均可。
    • 支持 3 种日志级别:Info,Warn,Error。
    • 支持快速复制日志。
    • 自动识别并将日志中的 URL 包装为链接。

    预览

    image

    安装

    1. 打开 Chrome 浏览器,在地址栏输入 chrome://extensions/ 进入 Chrome 扩展页面,勾选”开发者模式”;
    2. 将下载后的源码文件夹拖到页面中,点击”添加扩展程序”按钮;
    3. 按 F12 打开开发者工具,点击 ServerLog 面板,后端日志将会展示在这里。

    原理

    服务器端按照 约定,将日志插入响应头 X-Server-Log 中;

    扩展会监听 Network 中接收到的网络请求,当发现请求的响应头中包含 X-Server-Log,则进行解析并将得到的日志信息输出到开发者工具的 ServerLog 面板中。

    约定

    服务器端可以使用任何语言或技术,只需要遵循如下约定:

    1. 日志集合必须是一个数组,该数组的元素类型为对象,每一个对象代表一条日志,对象必须包含 timetypemessage 3个属性,分别表示时间、日志级别(info、warn、error)、日志内容,日志内容也需要是一个数组。

      示例:

      [{
          "time": "2017-07-01 09:30:00.200",
          "type": "info",
          "message": ["hello", "world"]
      }, {
          "time": "2017-07-01 09:30:01.300",
          "type": "error",
          "message": ["error occurs!"]
      }]
    2. 数组需要转为字符串类型,并进行编码。

      示例(JavaScript):

      const result = encodeURIComponent(JSON.stringify(logArr));
    3. 上述结果需要放在响应头 X-Server-Log 中。

    后端示例

    这里 提供了一个简单的基于 Node.js 的后端实现,可供参考。

    许可

    MIT License

    Copyright (c) 2018 孙正华

    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 https://github.com/eshengsky/chrome-extension-server-log
  • asr-evaluation

    asr_evaluation

    Build Status PyPI version codecov

    Python module for evaluting ASR hypotheses (i.e. word error rate and word recognition rate).

    This module depends on the editdistance project, for computing edit distances between arbitrary sequences.

    The formatting of the output of this program is very loosely based around the same idea as the align.c program commonly used within the Sphinx ASR community. This may run a bit faster if neither instances nor confusions are printed.

    Please let me know if you have any comments, questions, or problems.

    Output

    The program outputs three standard measurements:

    • Word error rate (WER)
    • Word recognition rate (the number of matched words in the alignment divided by the number of words in the reference).
    • Sentence error rate (SER) (the number of incorrect sentences divided by the total number of sentences).

    Installing & uninstalling

    The easiest way to install is using pip:

    pip install asr-evaluation
    

    Alternatively you can clone this git repo and install using distutils:

    git clone git@github.com:belambert/asr-evaluation.git
    cd asr-evaluation
    python setup.py install
    

    To uninstall with pip:

    pip uninstall asr-evaluation
    

    Command line usage

    For command line usage, see:

        wer --help
    

    It should display something like this:

    usage: wer [-h] [-i | -r] [--head-ids] [-id] [-c] [-p] [-m count] [-a] [-e]
               ref hyp
    
    Evaluate an ASR transcript against a reference transcript.
    
    positional arguments:
      ref                   Reference transcript filename
      hyp                   ASR hypothesis filename
    
    optional arguments:
      -h, --help            show this help message and exit
      -i, --print-instances
                            Print all individual sentences and their errors.
      -r, --print-errors    Print all individual sentences that contain errors.
      --head-ids            Hypothesis and reference files have ids in the first
                            token? (Kaldi format)
      -id, --tail-ids, --has-ids
                            Hypothesis and reference files have ids in the last
                            token? (Sphinx format)
      -c, --confusions      Print tables of which words were confused.
      -p, --print-wer-vs-length
                            Print table of average WER grouped by reference
                            sentence length.
      -m count, --min-word-count count
                            Minimum word count to show a word in confusions.
      -a, --case-insensitive
                            Down-case the text before running the evaluation.
      -e, --remove-empty-refs
                            Skip over any examples where the reference is empty.
    

    Contributing and code of conduct

    For contributions, it’s best to Github issues and pull requests. Proper testing and documentation suggested.

    Code of conduct is expected to be reasonable, especially as specified by the Contributor Covenant

    Visit original content creator repository https://github.com/belambert/asr-evaluation
  • babylonjs-typescript-starter

    BABYLON.js Typescript Starter

    This repository contains a sample BABYLON.js application.

    Setup

    Run the following commands from within the repository’s root folder to setup the
    application:

    1. npm install

    Running

    Run the following commands from within the repository’s root folder to run the
    project using webpack-dev-server:

    1. npm start

    Then open http://localhost:9000 in your browser

    Build

    Run the following commands from within the repository’s root folder to build the
    project using webpack:

    1. npm run build

    Automatic Deployment

    Every push on master triggers a build and deploy workflow. The build output is
    published to itch.io.

    This workflow should be easily changeable to run on different triggers, e.g.
    creating a release or pushing a tag.

    For this deployment to work, you have to create your project on itch.io
    beforehand.

    When you use this template, create a secret ITCH_API_KEY in your repository’s
    secret settings. You also have to adjust your username and project name in the
    workflow file.

    After the build was published, you have to configure it on itch.io to run in the
    browser.

    A demonstration of the deployment for this repository can be found at
    https://oktinaut.itch.io/babylon-example.

    Structure

    • src/ source code folder

      • index.ts application entry point

      • glsl.d.ts typescript definition file to resolve .glsl files

      • Materials/ folder for custom materials/shaders

        • SampleMaterial.ts sample custom material

        • Shaders/ folder containing GLSL shader code

          • Sample/ folder containing sample shader

            • sample.fragment.glsl sample fragment shader

            • sample.vertex.glsl sample vertex shader

    • public folder containing static assets

      • index.html HTML entry point
    • dist folder containing output of build process

    Visit original content creator repository
    https://github.com/oktinaut/babylonjs-typescript-starter