Author: yzowwrh2fkpj

  • pgn-tactics-generator

    pgn-tactics-generator

    About

    This is a python application dedicated to creating chess puzzles/tactics from a pgn file.
    Also it can download your games from lichess.org and use that file.

    It’s based on the great https://github.com/clarkerubber/Python-Puzzle-Creator by @clarkerubber

    Things that I changed:

    • Use a local pgn file with games as a source.
    • Write results to a file called tactics.pgn
    • Default engine depth to 8, so it’s faster. Before it was nodes=3500000 this is a depth around 20. So it took several minutes to analyze a game. With depth 8 it takes seconds.
    • You can use the depth argument to change the depth if you want more precision.
    • chess.pop_count to chess.popcount, because it was failing

    This is too complex, give something easy.

    There is another option if you don’t want to install and manage python scripts
    I created a more user friendly tactics generator and it’s online http://chesstacticsgenerator.vitomd.com
    It uses a different approach to create tactics, so probably it will generate a different set of tactics.

    Installation

    This script requires the Requests and Python-Chess libraries to run, as well as a copy of Stockfish
    Is recommended that you use Python 3 and pip3. But it could work with Python 2.7 and pip (probably you will need to install futures pip install futures )

    Please, take a look at development doc for details.

    Install requirements

    pip3 install -r requirements.txt --user

    Setup

    MacOS / Linux : sh build-stockfish.sh to obtain the current lichess Stockfish instance.

    Launching Application

    Downloading games for a specific user

    You can download games from a specific user using this command:
    python3 download_games.py <lichess username>

    By default, it will download the last 60 games from blitz, rapid and classical.

    Arguments

    You can use the max argument to get more games and use the lichess api token with the token argument to make the download faster. https://lichess.org/api#operation/apiGamesUser

    It will save the games in the games.pgn file

    Example to get 100 games using the token

    python3 download_games.py <lichess username> --max 100 --token 123456789

    Downloading games from tournaments

    You can download games from multiple tournaments using this command:

    python3 download_tournaments.py E14kHVwX tdntXNhy

    The arguments are the tournaments ids separate by a space

    It will save the games in the games.pgn file

    Generate tactics

    To execute the generator execute this command. By default it will look for the games.pgn file:

    python3 main.py

    Arguments

    • --quiet to reduce the screen output.
    • --depth=8 select the Stockfish depth analysis. Default is 8 and will take some seconds to analyze a game, with --depth=18 will take around 6 minutes.
    • --games=ruy_lopez.pgn to select a specific pgn file. Default is games.pgn
    • --strict=False Use False to generate more tactics but a little more ambiguous. Default is True
    • --threads=4 Stockfish argument, number of engine threads, default 4
    • --memory=2048 Stockfish argument, memory in MB to use for engine hashtables, default 2048
    • --includeBlunder=False If False then generated puzzles won’t include initial blunder move, default is True
    • --stockfish=./stockfish-x86_64-bmi2 Path to Stockfish binary.
      Optional. If omitted, the program will try to locate Stockfish in current directory or download it from the net

    Example:
    python3 main.py --quiet --depth=12 --games=ruy_lopez.pgn --strict=True --threads=2 --memory=1024

    Tactics output

    The resulting file will be a pgn file called tactics.pgn. Each tactic contains the headers from the source game.
    The result header is the tactic result and not the game result. It can be loaded to a Lichess study or to an app like iChess to practice tactics.

    Problems?

    Stockfish errors

    Want to see all my chess related projects?

    Check My projects for a full detailed list.

    Visit original content creator repository

  • falcon-base-services

    Falcon Base Services

    Many WordPress developers long for features like Eloquent, Blade, Service Container, and Service Provider to help them build powerful plugins. Falcon is here to change the game and bring these capabilities to your fingertips.

    Please note: This plugin provides a series of services and is not intended to be used as a base for creating new plugins.

    Features

    • Powerful Service Container and Service Provider
    • Query Builder
    • Eloquent
    • Template Engine (Blade, Twig)
    • Logger (Monolog)
    • Email (PHPMailer)
    • Laravel Validation
    • Request Handling
    • Scheduler
    • Environment Management
    • Symfony Var-Dumper (dd, dump)
    • Carbon
    • Additional Helpers to develop your plugin fast.

    Minimum PHP version: 8.2

    Installation

    1. Create Directory: In the wp-content folder, if the mu-plugins folder does not exist, create it. Place the falcon-base-services folder inside it.

    2. Create Loader File: In the root of the mu-plugins folder, create a PHP file with a name of your choice and add the following code:

      <?php
      require 'falcon-base-services/falcon-base-services.php';

      Note that the contents of the mu-plugins folder do not need to be activated in the WordPress admin and are executed before all other plugins. Also, WordPress does not scan the folders inside mu-plugins unless explicitly instructed.

    3. Install Dependencies: Open the terminal in the falcon-base-services folder and run the following command:

      composer install

      If you haven’t installed Composer, you can download and install it from this link.

    The plugin is now ready to use. Let’s explore its features and how to use them.

    Maintenance Mode

    If you need to put the site in maintenance mode, simply rename the maintenance.example.php file in the storage folder to maintenance.php. You can also edit the contents of the file as needed.

    Environment Variables (ENV)

    Items mentioned in the .env.example file are important. Rename the file to .env.

    get

    You can set your variables in the .env file and use them anywhere in your code like this:

    $_ENV['item'];
    //or
    env('item')

    set

    To set an item in the global $_ENV var, you can use:

    setEnv($key, $value);

    Config

    You can also use configuration files in your project that return an array.
    Place the configuration file in the config folder and access the desired values using the falconConfig($file, $key = null, $folder_path = null) function.

    • $file: The name of the configuration file.

    • $key: The key of the requested array. If null, the entire file content is returned.

    • $folder_path: By default, the path to the configuration files is in the config folder. If you want to have new configurations in your project, you can also specify the path to the new folder.

    Service Container – Service Provider

    The plugin uses a powerful service container with autowiring capabilities.

    • Singleton Services: Register a singleton service using:

      FALCON_CONTAINER->singleton(Test::class);
      // or
      FALCON_CONTAINER->singleton('test', Test::class);
    • Non-Singleton Services: Register a non-singleton service using:

      FALCON_CONTAINER->bind(Test::class);
      // or
      FALCON_CONTAINER->bind('test', Test::class);
    • Using Closures: You can also use closures:

      FALCON_CONTAINER->bind('test', function() { return Test::class; });
    • Using the Services: Use the get method to retrieve the services:

      FALCON_CONTAINER->get('test');
      FALCON_CONTAINER->get(Test::class);
    • Resolving Methods: Resolve a method from a class using:

      FALCON_CONTAINER->getMethod(Test::class, 'run');

      This will automatically resolve any dependencies required by both the class and the method.

    To create a service provider, create a class in the app/providers folder and extend the ServiceProvider class. Use the register and boot methods as needed. Then, add the provider’s address in the providers.php file located in the bootstrap folder.

    Eloquent, QueryBuilder

    All default WordPress tables are available as models in the app/Model folder. WooCommerce tables will be added soon. You can use both the powerful Query Builder and Eloquent to interact with these tables.

    • Eloquent:
    (new \FalconBaseServices\Model\Post())->published()->with('author')->get();
    • Query Builder:

    falconDB()::table('wp_posts')
        ->where('post_status', 'publish')
        ->leftJoin('wp_users', 'wp_posts.post_author', '=', 'wp_users.ID')
        ->select('wp_posts.*', 'wp_users.user_nicename')
        ->get();

    If you want to use a new table as a model, create its class by extending the FalconBaseServices\Model\BaseModel class. If the table does not use the default prefix, set $with_prefix to false:

    protected $with_prefix = false;

    The rules and usage of models and Query Builder/Eloquent are exactly like the Laravel documentation.

    Template

    By default, Blade is used as the template engine, which is slightly different in usage from the standard. Pay attention to the example:

    falconTemplate()->setViewDir('path to dir')->setView('name of file without extension')
    ->share(['item' => 'value'])->render();

    You can also use Twig. The class derived from the interface app/Services/TemplateEngine/Template.php is available in the path app/Services/TemplateEngine/Implements/Twig.php. Simply add Twig to the plugin via Composer and then edit the file app/Providers/TemplateServiceProvider.php.
    The usage is similar to the above example.

    Logger

    To use the logger, use falconLogger():

    falconLogger()->error('message', ['data' => 'value']);

    If you want the ProcessIdProcessor, GitProcessor, and MemoryUsageProcessor to be included in the log, set related items in .env file to true.

    Email

    To use email, you can use falconEmail():

    falconEmail()->send($to, $subject, $content, $from = null, $bcc = null);

    For more information on how to use email, refer to the file app/Services/Sender/Implements/Email/PHPMailer.php.

    Happy coding! 🚀

    Visit original content creator repository

  • NoteWizard

    Note Wizard Banner

    NoteWizard

    Welcome to NoteWizard! This web application is designed to help students stay organized and informed by providing features such as college notes, syllabus tracking, timetables, and important event notifications.

    Table of Contents

    Introduction
    Technologies Used
    Features
    Getting Started
    Usage
    Contributing
    Contact
    Introduction

    NoteWizard is a powerful tool for students to manage their academic life efficiently. It offers a range of features that assist in organizing and accessing important information such as class notes, syllabi, timetables, and event notifications. This web application aims to enhance productivity and provide a centralized platform for students to stay on top of their studies.

    Technologies Used

    The following technologies were used to develop NoteWizard:

    HTML5
    CSS3
    JavaScript
    Features

    NoteWizard offers the following features:

    College Notes: A section where students can upload and access their class notes, organized by subject or course.
    Syllabus Tracking: Students can input their course syllabi, track important deadlines, and receive reminders for assignments, exams, and projects.
    Timetable: A customizable timetable that allows students to schedule their classes, study sessions, and extracurricular activities.
    Event Notifications: Important event notifications, such as registration deadlines, seminars, or guest lectures, can be displayed to keep students informed.
    Feel free to customize and expand upon these features based on your specific requirements.

    Getting Started

    To set up NoteWizard locally, follow these steps:

    Clone the repository or download the source code.
    Open the project folder in your preferred code editor.
    Modify the HTML, CSS, and JavaScript files to customize the application’s content, styling, and functionality.
    Save your changes.
    Open the index.html file in your web browser to view the application locally.
    Usage

    Customize NoteWizard to meet the needs of your users. You can enhance existing features, add new functionality, or modify the design and layout. Ensure that the application remains user-friendly and intuitive for students to navigate and utilize effectively.

    Contributing

    We appreciate your interest in contributing to NoteWizard! If you have any bug reports, suggestions, or enhancements, please feel free to open an issue or submit a pull request. Your contributions will be invaluable in improving the application for the benefit of all users.

    Contact

    If you have any questions, feedback, or need support, please feel free to contact us via email or any other preferred method.

    Arjun Singh
    arjunsingh15102003@gmail.com
    https://www.linkedin.com/in/arjun-singh-62b7761b6

    Visit original content creator repository

  • crowdfunding

    Frontend Mentor – Crowdfunding product page

    Design preview for the Crowdfunding product page coding challenge

    Welcome! 👋

    Thanks for checking out this front-end coding challenge.

    Frontend Mentor challenges help you improve your coding skills by building realistic projects.

    To do this challenge, you need a basic understanding of HTML, CSS and JavaScript.

    The challenge

    Your challenge is to build out this crowdfunding product page and get it looking as close to the design as possible.

    You can use any tools you like to help you complete the challenge. So if you’ve got something you’d like to practice, feel free to give it a go.

    Your users should be able to:

    • View the optimal layout depending on their device’s screen size
    • See hover states for interactive elements
    • Make a selection of which pledge to make
    • See an updated progress bar and total money raised based on their pledge total after confirming a pledge
    • See the number of total backers increment by one after confirming a pledge
    • Toggle whether or not the product is bookmarked

    Want some support on the challenge? Join our Slack community and ask questions in the #help channel.

    Where to find everything

    Your task is to build out the project to the designs inside the /design folder. You will find both a mobile and a desktop version of the design.

    The designs are in JPG static format. Using JPGs will mean that you’ll need to use your best judgment for styles such as font-size, padding and margin.

    If you would like the design files (we provide Sketch & Figma versions) to inspect the design in more detail, you can subscribe as a PRO member.

    You will find all the required assets in the /images folder. The assets are already optimized.

    There is also a style-guide.md file containing the information you’ll need, such as color palette and fonts.

    Building your project

    Feel free to use any workflow that you feel comfortable with. Below is a suggested process, but do not feel like you need to follow these steps:

    1. Initialize your project as a public repository on GitHub. Creating a repo will make it easier to share your code with the community if you need help. If you’re not sure how to do this, have a read-through of this Try Git resource.
    2. Configure your repository to publish your code to a web address. This will also be useful if you need some help during a challenge as you can share the URL for your project with your repo URL. There are a number of ways to do this, and we provide some recommendations below.
    3. Look through the designs to start planning out how you’ll tackle the project. This step is crucial to help you think ahead for CSS classes to create reusable styles.
    4. Before adding any styles, structure your content with HTML. Writing your HTML first can help focus your attention on creating well-structured content.
    5. Write out the base styles for your project, including general content styles, such as font-family and font-size.
    6. Start adding styles to the top of the page and work down. Only move on to the next section once you’re happy you’ve completed the area you’re working on.

    Deploying your project

    As mentioned above, there are many ways to host your project for free. Our recommend hosts are:

    You can host your site using one of these solutions or any of our other trusted providers. Read more about our recommended and trusted hosts.

    Create a custom README.md

    We strongly recommend overwriting this README.md with a custom one. We’ve provided a template inside the README-template.md file in this starter code.

    The template provides a guide for what to add. A custom README will help you explain your project and reflect on your learnings. Please feel free to edit our template as much as you like.

    Once you’ve added your information to the template, delete this file and rename the README-template.md file to README.md. That will make it show up as your repository’s README file.

    Submitting your solution

    Submit your solution on the platform for the rest of the community to see. Follow our “Complete guide to submitting solutions” for tips on how to do this.

    Remember, if you’re looking for feedback on your solution, be sure to ask questions when submitting it. The more specific and detailed you are with your questions, the higher the chance you’ll get valuable feedback from the community.

    Sharing your solution

    There are multiple places you can share your solution:

    1. Share your solution page in the #finished-projects channel of the Slack community.
    2. Tweet @frontendmentor and mention @frontendmentor, including the repo and live URLs in the tweet. We’d love to take a look at what you’ve built and help share it around.
    3. Share your solution on other social channels like LinkedIn.
    4. Blog about your experience building your project. Writing about your workflow, technical choices, and talking through your code is a brilliant way to reinforce what you’ve learned. Great platforms to write on are dev.to, Hashnode, and CodeNewbie.

    We provide templates to help you share your solution once you’ve submitted it on the platform. Please do edit them and include specific questions when you’re looking for feedback.

    The more specific you are with your questions the more likely it is that another member of the community will give you feedback.

    Got feedback for us?

    We love receiving feedback! We’re always looking to improve our challenges and our platform. So if you have anything you’d like to mention, please email hi[at]frontendmentor[dot]io.

    This challenge is completely free. Please share it with anyone who will find it useful for practice.

    Have fun building! 🚀

    Visit original content creator repository

  • SetupWindows

    Lets Skip the Boring Bit! 🤪

    This is a collection of Windows scripts to make it easy to setup Windows. This includes application installation, taskbar settings, start menu changes, locale settings, default applications, and more coming soon!

    Prerequisites

    You may not be able to run the .ps1 script directly on the system due to your Execution Policy. You can run the start.bat file making it easy begin. It’ll only run the installApps.ps1 script by default.

    Alternatively, you can run the following in an Administrator Powershell window to allow execution of scripts on your system permanently (Not Recommended).

    Set-ExecutionPolicy -ExecutionPolicy Bypass

    Getting Started

    1. Download the codebase as a .ZIP.
    2. Run start.bat OR one or both of the below commands in a regular CMD window.
    powershell -noexit -ExecutionPolicy Bypass -File installApps.ps1
    powershell -noexit -ExecutionPolicy Bypass -File setupProfile.ps1

    Full Automation

    The scripts accept two optional switch parameters which allow setting up ‘sets’ of programs to install and not asking the operator to confirm installation. They are -AppSet and -NoInterrupt respectively.

    You can run the following command to install basic applications without prompting for the optional programs.

    powershell -noexit -ExecutionPolicy Bypass -File installApps.ps1 -NoInterrupt

    Alternatively, you can run the following to install basic applications, plus CustomSet1 (defined in the appCollection.ps1 file), without interruptions.

    powershell -noexit -ExecutionPolicy Bypass -File installApps.ps1 -NoInterrupt -AppSet CustomSet1

    Creating a Custom Application Set

    Sets of optional applications are defined in the appCollection.ps1 file. This file must be placed in the same root directory as the installApps.ps1 script is being run. The format of the file must be a valid Hash Table.

    Defining Applications

    Application names and associated chocolatey package names are located in the installApps.ps1 script. Simply add additional line or two with optional packages, the script will then ask if you want to install it on the next execution.


    This script uses and depends on Chocolatey for application installations, and SetUserFTA for setting default applications.

    Visit original content creator repository

  • webpack-template

    Webpack work template

    Webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable of transforming, bundling, or packaging just about any resource or asset.

    Author: Vedees | Youtube guide (ru)

    Features:

    • separated configs for dev and prod
    • typescript / javascript full support
    • sass / css full support
    • full babel & postcss setup
    • 0 dependencies
    • the best optimization for your production
    • easy webpack and babel customization

    Everybody knows that developing runs on coffee! Thanks for your support!

    Buy me a coffee

    Build Setup:

    # Download repository:
    git clone https://github.com/vedees/webpack-template webpack-template
    
    # Go to the app:
    cd webpack-template
    
    # Install dependencies:
    # npm install
    # or:
    yarn
    
    # Server with hot reload at http://localhost:8084/
    # npm run start
    # or:
    yarn start
    
    # Output will be at dist/ folder
    # npm run build
    # or:
    yarn build

    Project Structure:

    • public/*.html – HTML files
    • src/app – core app
    • src/shared – shared files
    • src/shared/img – images folder (! for html calls use correct path: static/img/some.jpg)
    • src/shared/misc – misc files (i.g. favicon, sitemap, etc.)
    • src/index.ts – main app entity

    Configs:

    • /babel-defines.js – config for babel
    • /webpack/webpack-pages.js – config for html pages
    • /webpack/webpack-defines.js – config for entire webpack

    Main entry point:

    • src/app/index.ts – core entry point

    Defines:

    Core webpack config from /webpack/webpack-defines.js:

    const PATHS = {
      // path to the src dir
      src: path.join(__dirname, '../src'),
      // path to the output dir
      dist: path.join(__dirname, '../dist'),
      // path to the public files (html files)
      public: path.join(__dirname, '../public'),
    
      // path to output sub dir (js, css, fonts, etc.)
      assets: 'assets/',
      // path to output sub dir (img, icons, etc.)
      static: 'static/'
    }

    Pages config:

    Pages config from /webpack/webpack-pages.js:

    const pages = [
      {
        // page title
        title: 'Home page',
        // template name `public/index.html`
        template: 'index.html',
        // output filename `dist/index.html`
        filename: 'index.html',
    
        // other options can be here
      },
      {
        title: 'About page',
        template: 'about.html',
        filename: 'about.html',
      }
    ]

    You can pass a hash of configuration options to html-webpack-plugin.

    Allowed values are as follows: https://github.com/jantimon/html-webpack-plugin#options

    Manual pages setup:

    In case if you don’t want to use Pages config:

    1. Create another html file in ./public
    2. Go to ./webpack/webpack.common.js
    3. Add new page to the config:
        // index page:
        new HtmlWebpackPlugin({
          title: 'Home page',
          favicon: defines.src + '/shared/misc/favicon.ico',
          template: defines.public + '/index.html', // public/index.html page
          filename: 'index.html' // output file
        }),
        // about page:
        new HtmlWebpackPlugin({
          title: 'About page',
          favicon: defines.src + '/shared/misc/favicon.ico',
          template: defines.public + '/about.html', // public/about.html page
          filename: 'about.html' // output file
        }),

    Import libs example:

    Install it:

    yarn add bootstrap react react-dom

    Import libs to src/app/index.ts:

    // React example
    import React from 'react'
    
    // Bootstrap example (with custom js imports)
    import Bootstrap from 'bootstrap/dist/js/bootstrap.min.js'
    import 'bootstrap/dist/js/bootstrap.min.js'

    Import SASS / CSS libs example:

    Import libs to src/app/index.scss:

    // sass lib import example:
    @import '../../node_modules/spinners/stylesheets/spinners';
    // css lib import example:
    @import '../../node_modules/flickity/dist/flickity.css';

    React example:

    Here’s an example with React + i18n Provider.

    Install react:

    yarn add react react-dom

    Create div with id app in public/index.html:

    <div id="app"></div>

    Init the app in src/app/index.ts:

    import React from 'react'
    import { createRoot } from 'react-dom/client'
    
    // app styles
    import './index.scss'
    
    // local providers:
    import { I18nProvider } from './providers/I18nProvider'
    
    const container = document.getElementById('app') as HTMLElement
    const root = createRoot(container)
    
    root.render(
      <React.StrictMode>
        <I18nProvider>...</I18nProvider>
      </React.StrictMode>
    )

    File src/app/providers/I18nProvider.tsx:

    import React, { FC, PropsWithChildren } from 'react'
    
    export const I18nProvider: FC<PropsWithChildren> = ({ children }) => {
      // ...
    
      return <I18n locale={detectedLocale}>{children}</I18n>
    }

    Vue example:

    Install vue:

    yarn add vue

    Init the app in src/app/index.ts:

    // vue example (react one is above):
    const app = new Vue({
      el: '#app'
    })

    Create div with id app in public/index.html:

    <div id="app"></div>

    Adding Vue Components:

    Create your component in src/app/components/.

    HTML Usage (in *.html files):

    Init component in src/app/index.ts:

    Vue.component('example-component', require('./components/Example.vue').default)

    In any html files:

    <example-component />

    VUE Usage (in *.vue files):

    Import component:

    import ExampleComponent from '@/components/Example.vue'

    Init component (template):

    <Example />

    Register component (script):

    components: {
      Example: ExampleComponent
    }

    Adding Google Fonts:

    Connect fonts to public/index.html:

    <link rel="preconnect" href="https://fonts.googleapis.com" />
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
    <link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500&display=swap" rel="stylesheet" />

    Change the font in src/app/styles/body.scss:

    html {
      font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, 'Apple Color Emoji', Arial, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol' !important;
    }

    Adding local fonts:

    In case if you don’t want to use Google Fonts:

    • Download fonts
    • Add fonts to the (i.g. /src/shared/fonts/OpenSans/...).

    Then add @font-face in some .scss file (i.g. /src/app/styles/font.scss):

    // Open Sans example:
    @font-face {
      font-family: 'Open Sans';
      font-style: normal;
      font-weight: 400;
      font-stretch: 100%;
      font-display: swap;
      src: url('/static/fonts/OpenSans/Open-Sans.woff2') format('woff2');
      unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
    }

    The last step is to copy these fonts into the /dist folder every time you build the project.

    Add another config for CopyWebpackPlugin to /webpack/webpack.common.js:

    new CopyWebpackPlugin({
      // ...
    
      // `shared/fonts` to `dist/static/fonts`
      {
        from: `${defines.src}/shared/fonts`,
        to: `${defines.dist}/${defines.static}/fonts`
      },
    })

    Change the font in src/app/styles/body.scss:

    html {
      font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, 'Apple Color Emoji', Arial, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol' !important;
    }

    License:

    MIT

    Copyright (c) 2018-present, Evgenii Vedegis

    Visit original content creator repository
  • CucumberAutomationReports

    Cucumber-Java-JUnit Archetype

    This is the simplest possible build script setup for Cucumber using Java.
    There is nothing fancy like a webapp or browser testing. All this does is to show you how
    to install and run Cucumber!

    Usage

    Open a command window and run:

    mvn test
    

    This runs Cucumber features using Cucumber’s JUnit runner. The @RunWith(Cucumber.class) annotation on the RunCukesTest
    class tells JUnit to kick off Cucumber.

    Overriding options

    The Cucumber runtime parses command line options to know what features to run, where the glue code lives, what plugins to use etc.
    When you use the JUnit runner, these options are generated from the @CucumberOptions annotation on your test.

    Sometimes it can be useful to override these options without changing or recompiling the JUnit class. This can be done with the
    cucumber.options system property. The general form is:

    mvn -Dcucumber.options="..." test
    

    Let’s look at some things you can do with cucumber.options. Try this:

    -Dcucumber.options="--help"
    

    That should list all the available options.

    IMPORTANT

    When you override options with -Dcucumber.options, you will completely override whatever options are hard-coded in
    your @CucumberOptions or in the script calling cucumber.api.cli.Main. There is one exception to this rule, and that
    is the --plugin option. This will not override, but add a plugin. The reason for this is to make it easier
    for 3rd party tools (such as Cucumber Pro) to automatically configure additional plugins by appending arguments to a cucumber.properties
    file.

    Run a subset of Features or Scenarios

    Specify a particular scenario by line (and use the pretty plugin, which prints the scenario back)

    -Dcucumber.options="classpath:skeleton/belly.feature:4 --plugin pretty"
    

    This works because Maven puts ./src/test/resources on your classpath.
    You can also specify files to run by filesystem path:

    -Dcucumber.options="src/test/resources/skeleton/belly.feature:4 --plugin pretty"
    

    You can also specify what to run by tag:

    -Dcucumber.options="--tags @bar --plugin pretty"
    

    Running only the scenarios that failed in the previous run

    -Dcucumber.options="@target/rerun.txt"
    

    This works as long as you have the rerun formatter enabled.

    Specify a different formatter:

    For example a JUnit formatter:

    -Dcucumber.options="--plugin junit:target/cucumber-junit-report.xml"
    

    Visit original content creator repository

  • hacky-game

    Hacky Game

    This is the start of a game involving some crazy technical jazz,
    for the sake of magical minimalism.

    The game will be a platformer,
    with lots of interconnected rooms and various enemies,
    taking some inspiration from Kirby & the Amazing Mirror.

    (Some basics are implemented, like blocks, slopes, one-way platforms, and doors.
    There are several rooms, but they’re pretty boring,
    and the art is very preliminary.)

    The game supports LAN multiplayer,
    and the client’s world is simulated in between updates from the server,
    a basic implementation of client-side prediction.

    Single player is treated the same: the client hosts a server and communicates with it locally over TCP.
    This might change.

    When other servers are discovered,
    a door is opened to another world.

    Players can travel between worlds,
    and you can even have two players in each other’s worlds.
    (But the player’s client has to be online for their world to be available.)

    You should be able to get a feel for the game in single-player,
    with a substantial world to explore, but
    I think multiplayer will be the real focus of the game
    and I think it would be interesting to have parts of the world that you can only explore with a friend.

    Oh, did I mention the worlds are gonna be procedurally generated?
    That’s probably kind of important.
    It might have some areas that are the same in all worlds, like a tutorial level,
    or perhaps just fairly similar and functionally identical.

    Both players should gain from exploring either players world.
    It should be like the worlds combined make up the space to explore,
    and which one to do first shouldn’t feel contentious.

    There could be doors that require multiple keys, that you need to get from several people.
    There could be keys that belong to random other worlds and you have to find the one player whose world contains the door.
    There could be halves of items (including keys).

    Keys could be 2D “pin arrays”, where locks run a game-of-life simulation for a number of iterations.
    This would work well for a 1BPP game, as alternative to using color to distinguish keys.

    There could be portals that you can pick up and place, including between worlds.

    There should be limits on the viewport,
    maybe fixed but not necessarily;
    it could have a maximum viewport size, and the ability to look in a direction,
    and then the total amount you could look could be fixed
    while allowing for a range of screen sizes on handheld systems etc.

    The game runs in nw.js (so it can include both client and server),
    but the final game.exe is a wrapper.
    The wrapper currently built with nexe,
    although this essentially means distributing two Node.js runtimes,
    which is a considerable amount of overhead which could ultimately be avoided.
    It downloads the nw.js runtime (on first load)
    and extracts a zip file from a resource in the executable containing the main application.
    Then it launches the game, passing in the path to the executable.
    It does all this so it can read and write game state from the end of the exe file.
    (At the moment this functionality is disabled.
    I did a tech demo of this first, but there are no persistent elements to the world yet.)

    Open Doors to Other Worlds

    • Local multiplayer

      • Discovers other clients through tiny JSON files stored with ports and PIDs.
        Discovers other clients through SSDP

      • TODO:
        Manage input methods for multiple players.
        You should be able to play with two people on one keyboard,
        without some program to send input to two windows at once.

      • Could try to do single window splitscreen (“normal” local multiplayer) instead.

    • Multiplayer over LAN

      • Discovers other clients with SSDP

      • You can use Hamachi to establish connections between computers if LAN doesn’t work for you

      • TODO:
        When booted from a server, have the world door sputter out behind you

      • TODO:
        Get booted if server doesn’t respond for some time

    • TODO:
      Implement client-side prediction smoothing

    • FIXME:
      There is a race condition when going back and forth between rooms
      where you can get viewing a room that you aren’t in.
      Entering a door involves sending a command to the server
      but you switch the room you’re viewing instantly.

    • TODO:
      Remove the need for client-side prediction on the client’s own server;
      maybe merge the client and the server so they use one World

    • TODO:
      Use random seeds to render the exact same blades of grass etc. as another client for the same world.
      (Also, with pixi.js, it’ll probably be fast enough to render the grass dynamically, so there could be wind and stuff,
      rustling through the grass as you move,
      explosions sending waves of air…)

    Install

    Final builds of the game will be standalone executables,
    but there’s not much of a point yet to trying to release builds.

    You’ll need Node.js.
    Clone the project
    and then, in a terminal/command prompt in the project’s directory,
    run:

    npm install ; cd game ; npm install ; cd ..
    

    Run

    After installing, you can run the game with:

    npm start
    

    On the first run, it’ll download the nw.js runtime.

    There are also scripts to run multiple instances of the game:

    npm run start-secondary
    npm run start-tertiary
    

    These only work on Windows, but I could make a CLI script that works cross-platform,
    and allows any number of instances,
    plus other options like --enable-logging.

    Build

    The game implements hackily saving game data directly to the executable binary,
    which is rather platform specific.
    This is only implemented for Windows so far,
    but it should be feasible on at least some other systems.

    On Windows:

    npm run build
    

    On other platforms, for now:

    npm run build-simple
    

    Visit original content creator repository

  • quotes_statistics

    С приложением можно ознакомиться по адресу: https://quotestats.netlify.app

    Available Scripts

    In the project directory, you can run:

    npm start

    Runs the app in the development mode.
    Open http://localhost:3000 to view it in the browser.

    The page will reload if you make edits.
    You will also see any lint errors in the console.

    npm run build

    Builds the app for production to the build folder.
    It correctly bundles React in production mode and optimizes the build for the best performance.

    The build is minified and the filenames include the hashes.
    Your app is ready to be deployed!

    See the section about deployment for more information.

    1. Условие:
      необходимо создать веб-приложение, которое максимально быстро считает
      статистические параметры по котировкам с биржи.
      Для этого необходимо создать интерфейс который содержит кнопки “Старт” и “Статистика”.
      По нажатию на “Старт” должно происходить подключение к эмулятору котировок по адресу
      вебсокета wss://trade.trademux.net:8800/?password=1234 для получения котировок онлайн.
      При
      нажатии на кнопку “Статистика” отображает на странице такие статистические значения:
      среднее,
      стандартное отклонение,
      моду (при мультимодности достаточно только одну моду),
      медиану,
      количество потерянных котировок если такие есть,
      время расчетов.
      Расчеты должны
      осуществляться по всем полученным данным от момента старта до текущего момента нажатия
      кнопки “Статистика”, кнопку можно нажимать сколько угодно раз для получения новых
      результатов на текущее время.
      Формат “котировки” json, поля : {id : idкотировки, value : значениекотировки}
      Технические требования:
      • Приложение должно быть максимально оптимизировано по скорости работы.
      • Время между нажатием Старт и Статистика может быть очень большим (несколько
      дней)
      • Интерфейс должен быть удобен для использования.
      • Стиль кнопок должен быть:
      бордер ровно 1пкс черный,
      фон кнопки серый,
      при
      наведении мыши на кнопку фон должен становится белым,
      при клике на кнопку фон
      должен становится желтым
      (использовать для этого только CSS / SCSS).
      • Принятые числа отображать не нужно.
      Уровни сложности задания:
      junior уровень: посчитать только среднее и стандартное отклонение
      Более высокий уровень: посчитать также моду и медиану
      2.
      Условие:
      Написать “пингователь” любого сервера на JavaScript, который покажет
      примерное время пинга до сервера указанного в поле ввода.
      Технические требования:
      • стиль кнопок должен быть:
      бордер ровно 1пкс черный,
      фон кнопки серый,
      при
      наведении мыши на кнопку фон должен становится белым,
      при клике на кнопку фон
      должен становится желтым
      (использовать для этого только CSS / SCSS).
      • стиль полей ввода должен быть:
      бордер ровно 1пкс черный,
      фон белый,
      при наведении
      мыши на поле ввода фон должен становится серым,
      при клике на поле фон должен
      становится желтым
      (использовать для этого только CSS / SCSS)
      Задания делать на ReactJS.

    Visit original content creator repository