text:
/**********************************************************//**
 * @file test_list.c
 * @brief Test suite for LIST objects.
 * @author Rena Shinomiya
 * @version 1.0
 * @date December 2016
 **************************************************************/

// Standard library
#include <stdlib.h>     // rand
#include <stdbool.h>    // bool

// This project
#include "debug.h"      // assert, eprintf
#include "list.h"       // LIST

/**********************************************************//**
 * @brief Test the list_Create and list_Destroy functions.
 * @return Whether the test passed.
 **************************************************************/
static bool TestCreate(void) {
    // Test creating a list
    LIST temp;
    bool success;

    // Make a basic list
    success = list_Create(&temp, sizeof(char), 10);
    if (!success) {
        eprintf("Failed to construct the list.\n");
        return false;
    }
    list_Destroy(&temp);

    // Make a complex list
    success = list_Create(&temp, 40, 10);
    if (!success) {
        eprintf("Failed to construct the list.\n");
        return false;
    }
    list_Destroy(&temp);

    // Passed the test
    return true;
}

/**********************************************************//**
 * @brief Test the list_Append function.
 * @return Whether the test passed.
 **************************************************************/
static bool TestAppend(void) {
    // Test adding to a list
    LIST temp;
    bool success;

    // Make a basic list
    success = list_Create(&temp, sizeof(int), 10);
    if (!success) {
        eprintf("Failed to construct the list.\n");
        return false;
    }

    // Add information to the list
    int howMany = 1000;
    for (int i = 0; i < howMany; i++) {
        if (!list_Append(&temp, &i)) {
            list_Destroy(&temp);
            eprintf("Failed to append \"%d\" to the list.\n", i);
            return false;
        }
        if (list_Length(&temp) != i+1) {
            list_Destroy(&temp);
            eprintf("Incorrect size of list while adding.\n");
            return false;
        }
    }

    // Completed Test
    list_Destroy(&temp);
    return true;
}

/**********************************************************//**
 * @brief Test the list_Get and list_Set functions.
 * @return Whether the test passed.
 **************************************************************/
static bool TestGet(void) {
    // Test adding to a list
    LIST temp;
    bool success;

    // Make a basic list
    success = list_Create(&temp, sizeof(int), 10);
    if (!success) {
        eprintf("Failed to construct the list.\n");
        return false;
    }

    // Add information to the list
    int howMany = 1000;
    for (int i = 0; i < howMany; i++) {
        if (!list_Append(&temp, &i)) {
            list_Destroy(&temp);
            eprintf("Failed to append \"%d\" to the list.\n", i);
            return false;
        }
    }

    // Verify the data
    for (int i = 0; i < howMany; i++) {
        int data;

        // Get the original item
        if (!list_Get(&temp, i, &data)) {
            list_Destroy(&temp);
            eprintf("Failed to get the %d item.\n", i);
            return false;
        }

        // Validate the original item
        if (data != i) {
            list_Destroy(&temp);
            eprintf("Failed to verify the %d item.\n", i);
            return false;
        }

        // Increment it and set it back
        data += 1;
        if (!list_Set(&temp, i, &data)) {
            list_Destroy(&temp);
            eprintf("Failed to set the %d item.\n", i);
            return false;
        }

        // Get it back once more
        if (!list_Get(&temp, i, &data)) {
            list_Destroy(&temp);
            eprintf("Failed to get the %d item.\n", i);
            return false;
        }

        // Check if it's still incremented
        if (data != i+1) {
            list_Destroy(&temp);
            eprintf("Failed to verify the %d item.\n", i);
            return false;
        }
    }

    // Completed Test
    list_Destroy(&temp);
    return true;
}

/**********************************************************//**
 * @brief Test the list_Copy function.
 * @return Whether the test passed.
 **************************************************************/
static bool TestCopy(void) {
    // Test adding to a list
    LIST temp;
    bool success;

    // Make a basic list
    success = list_Create(&temp, sizeof(int), 10);
    if (!success) {
        eprintf("Failed to construct the list.\n");
        return false;
    }

    // Add information to the list
    int howMany = 1000;
    for (int i = 0; i < howMany; i++) {
        int data = rand();
        if (!list_Append(&temp, &data)) {
            list_Destroy(&temp);
            eprintf("Failed to append \"%d\" to the list.\n", i);
            return false;
        }
    }

    // Copy the data
    LIST copy;
    if (!list_Copy(&copy, &temp)) {
        eprintf("Failed to copy the list.\n");
        return false;
    }

    // Verify the data
    for (int i = 0; i < howMany; i++) {
        int first, second;
        if (!list_Get(&temp, i, &first)) {
            eprintf("Failed to get the %d item of the original list.\n", i);
            return false;
        }
        if (!list_Get(&copy, i, &second)) {
            eprintf("Failed to get the %d item of the copy.\n", i);
            return false;
        }
        if (first != second) {
            eprintf("Failed to verify the %d item.\n", i);
            return false;
        }
    }

    // Completed Test
    list_Destroy(&copy);
    list_Destroy(&temp);
    return true;
}

/**********************************************************//**
 * @brief Test the list_Compress function.
 * @return Whether the test passed.
 **************************************************************/
static bool TestCompress(void) {
    // Test adding to a list
    LIST temp;
    bool success;

    // Make a basic list
    success = list_Create(&temp, sizeof(int), 10);
    if (!success) {
        eprintf("Failed to construct the list.\n");
        return false;
    }

    // Add information to the list
    int howMany = 1000;
    for (int i = 0; i < howMany; i++) {
        if (!list_Append(&temp, &i)) {
            list_Destroy(&temp);
            eprintf("Failed to append \"%d\" to the list.\n", i);
            return false;
        }
    }

    // Compress the list
    if (!list_Compress(&temp)) {
        return false;
    }

    // Verify the data
    for (int i = 0; i < howMany; i++) {
        int data;
        if (!list_Get(&temp, i, &data)) {
            eprintf("Failed to get the %d item.\n", i);
            return false;
        }
        if (data != i) {
            eprintf("Failed to verify the %d item.\n", i);
            return false;
        }
    }

    // Completed Test
    list_Destroy(&temp);
    return true;
}

/**********************************************************//**
 * @brief Test the list_Remove function.
 * @return Whether the test passed.
 **************************************************************/
static bool TestRemove(void) {
    // Test removing elements
    LIST temp;
    bool success;

    // Make a basic list
    success = list_Create(&temp, sizeof(int), 10);
    if (!success) {
        eprintf("Failed to construct the list.\n");
        return false;
    }

    // Add information to the list
    int howMany = 1000;
    for (int i = 0; i < howMany; i++) {
        if (!list_Append(&temp, &i)) {
            list_Destroy(&temp);
            eprintf("Failed to append \"%d\" to the list.\n", i);
            return false;
        }
    }

    // Remove everything
    while (list_Length(&temp) > 0) {
        int index = rand() % list_Length(&temp);
        if (!list_Remove(&temp, index, NULL)) {
            list_Destroy(&temp);
            eprintf("Failed to remove an item from the list.\n");
            return false;
        }
    }

    list_Destroy(&temp);
    return true;
}

/**********************************************************//**
 * @brief Test the list_Data function.
 * @return Whether the test passed.
 **************************************************************/
static bool TestData(void) {
    // Test the Data and At functions
    LIST temp;
    bool success;

    // Make a basic list
    success = list_Create(&temp, sizeof(int), 10);
    if (!success) {
        eprintf("Failed to construct the list.\n");
        return false;
    }

    // Add information to the list
    int howMany = 1000;
    for (int i = 0; i < howMany; i++) {
        if (!list_Append(&temp, &i)) {
            list_Destroy(&temp);
            eprintf("Failed to append \"%d\" to the list.\n", i);
            return false;
        }
    }

    // Get pointers
    int *data = list_Data(&temp);
    for (int i = 0; i < howMany; i++) {
        if (&data[i] != list_At(&temp, i)) {
            list_Destroy(&temp);
            eprintf("Pointer arithmetic is incorrect.\n");
            return false;
        }
    }

    list_Destroy(&temp);
    return true;
}

/**********************************************************//**
 * @brief Test the list_Join function.
 * @return Whether the test passed.
 **************************************************************/
static bool TestJoin(void) {
    // Test the Join function
    LIST first, second;
    bool success;

    // Make a basic list
    success = list_Create(&first, sizeof(int), 10);
    if (!success) {
        eprintf("Failed to construct the list.\n");
        return false;
    }

    // Make another basic list
    success = list_Create(&second, sizeof(int), 10);
    if (!success) {
        eprintf("Failed to construct the list.\n");
        return false;
    }

    // Add information to the first list
    for (int i = 0; i < 500; i++) {
        if (!list_Append(&first, &i)) {
            list_Destroy(&first);
            list_Destroy(&second);
            eprintf("Failed to append \"%d\" to the list.\n", i);
            return false;
        }
    }

    // Add information to the second list
    for (int i = 500; i < 1000; i++) {
        if (!list_Append(&second, &i)) {
            list_Destroy(&first);
            list_Destroy(&second);
            eprintf("Failed to append \"%d\" to the list.\n", i);
            return false;
        }
    }

    // Join the lists
    if (!list_Join(&first, &second)) {
        list_Destroy(&first);
        list_Destroy(&second);
        eprintf("Failed to join the two lists.\n");
        return false;
    }

    // Check the length
    if (list_Length(&first) != 1000) {
        list_Destroy(&first);
        list_Destroy(&second);
        eprintf("The joined list has incorrect length.\n");
        return false;
    }

    // Verify the data
    for (int i = 0; i < 1000; i++) {
        int data;
        if (!list_Get(&first, i, &data)) {
            eprintf("Failed to get the %d item.\n", i);
            return false;
        }
        if (data != i) {
            eprintf("Failed to verify the %d item.\n", i);
            return false;
        }
    }

    // Done
    list_Destroy(&first);
    list_Destroy(&second);
    return true;
}

/**********************************************************//**
 * @brief Test suite driver function
 **************************************************************/
int main(void) {

    // Test suite
    assert(TestCreate());
    assert(TestAppend());
    assert(TestGet());
    assert(TestCopy());
    assert(TestCompress());
    assert(TestRemove());
    assert(TestData());
    assert(TestJoin());

    // Finish
    printf("Passed all tests!\n");
    return EXIT_SUCCESS;
}

/*============================================================*/


text:
<?php

use alsvanzelf\jsonapi\objects\ResourceObject;
use alsvanzelf\jsonapi\extensions\AtomicOperationsDocument;

require 'bootstrap_examples.php';

/**
 * use the atomic operations extension as extension to the document
 */

$document = new AtomicOperationsDocument();

$user1  = new ResourceObject('user', 1);
$user2  = new ResourceObject('user', 2);
$user42 = new ResourceObject('user', 42);

$user1->add('name',  'Ford');
$user2->add('name',  'Arthur');
$user42->add('name', 'Zaphod');

$document->addResults($user1);
$document->addResults($user2);
$document->addResults($user42);

/**
 * get the json
 */

$options = [
	'prettyPrint' => true,
];
echo '<pre>'.$document->toJson($options);

redpajama_set_name: RedPajamaGithub


text:
require 'pathname'

module Wisper
  describe CelluloidBroadcaster do
    FILE_PATH = Pathname(File.dirname(__FILE__)).join('test_file')
    SLEEP_FOR = 2

    after do
      system("rm #{FILE_PATH}") if File.exist?(FILE_PATH)
    end

    let(:publisher) { MyPublisher.new }

    class MyPublisher
      include Wisper::Publisher

      def ping
        broadcast(:pong)
      end
    end

    class MyListener
      def pong
        touch_file
        sleep(SLEEP_FOR)
      end

      private

      def touch_file
        File.open(FILE_PATH, 'w') { |file| file.write(Thread.current.object_id) }
      end
    end

    # for sanity...
    describe 'without CelluloidBroadcaster' do
      it "takes longer than #{SLEEP_FOR} seconds" do
        publisher.subscribe(MyListener.new)
        duration = time { publisher.ping }
        expect(duration).to be > SLEEP_FOR
        expect(file_touched?).to eql true
        expect(file_thread_id).to eql Thread.current.object_id.to_s
      end
    end

    it "takes less than #{SLEEP_FOR} seconds" do
      publisher.subscribe(MyListener.new, async: subject)
      duration = time { publisher.ping }
      expect(duration).to be < SLEEP_FOR
      expect(file_touched?).to eql true
      expect(file_thread_id).to_not eql Thread.current.object_id.to_s
    end

    def time(&block)
      start = Time.now
      yield
      Time.now - start
    end

    def file_touched?
      resolution = 0.1
      (SLEEP_FOR / resolution).to_i.times do
        return true if File.exist?(FILE_PATH)
        sleep(resolution)
      end
      return false
    end

    def file_thread_id
      File.read(FILE_PATH)
    end
  end
end


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>nucleo-dynamixel: Initialization and de-initialization functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

nucleo-dynamixel
    0.0.1

A library for controlling dynamixel servomotors, designed for nucleo stm32

Main Page

Related Pages

Modules

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Functions

Initialization and de-initialization functions
STM32F4xx_HAL_Driver » CRC » CRC Exported Functions

Functions

HAL_StatusTypeDef 	HAL_CRC_Init (CRC_HandleTypeDef *hcrc)

HAL_StatusTypeDef 	HAL_CRC_DeInit (CRC_HandleTypeDef *hcrc)

void 	HAL_CRC_MspInit (CRC_HandleTypeDef *hcrc)

void 	HAL_CRC_MspDeInit (CRC_HandleTypeDef *hcrc)

Detailed Description

Generated by

     1.8.11


text:
import './split-issue-pr-search-results.css';
import React from 'dom-chef';
import select from 'select-dom';
import features from '../libs/features';
import SearchQuery from '../libs/search-query';

function cleanLinks(): void {
	for (const link of select.all<HTMLAnchorElement>('.menu-item')) {
		new SearchQuery(link).remove('is:pr', 'is:issue');
	}
}

type GitHubDiscussionType = 'pr' | 'issue';

function createUrl(type: GitHubDiscussionType, pathname = location.pathname): string {
	const url = new URL(pathname, location.origin);
	url.searchParams.set('q', pageSearchQuery.get() + ` is:${type}`);
	url.searchParams.set('type', 'Issues');
	return String(url);
}

let pageSearchQuery: SearchQuery;

function init(): void {
	cleanLinks();
	pageSearchQuery = new SearchQuery(location);

	const issueLink = select<HTMLAnchorElement>('nav.menu a[href*="&type=Issues"]')!;
	issueLink.textContent = 'Issues'; // Drops any possible counter
	issueLink.href = createUrl('issue');
	issueLink.append(
		<include-fragment src={createUrl('issue', location.pathname + '/count')}/>
	);

	const prLink = issueLink.cloneNode(true);
	prLink.textContent = 'Pull requests';
	prLink.href = createUrl('pr');
	prLink.append(
		<include-fragment src={createUrl('pr', location.pathname + '/count')}/>
	);

	issueLink.after(prLink);

	const title = select('.codesearch-results h3')!.firstChild!;
	if (pageSearchQuery.includes('is:pr')) {
		// Update UI in PR searches
		issueLink.classList.remove('selected');
		title.textContent = title.textContent!.replace('issue', 'pull request');
	} else if (!pageSearchQuery.includes('is:issue') && /\btype=Issues\b/.test(location.search)) {
		// Update UI in combined searches (where there's no `is:<type>` query)
		title.textContent = title.textContent!
			.replace(/issue\b/, 'issue or pull request')
			.replace('issues', 'issues and pull requests');

		// `.selected` overrides `:hover`, so we need to reapply `:hover`'s style
		prLink.classList.add('rgh-split-issue-pr-combined');
		issueLink.classList.add('rgh-split-issue-pr-combined');
	} else {
		prLink.classList.remove('selected');
	}
}

features.add({
	id: __featureName__,
	description: 'Separates issues from PRs in the global search.',
	screenshot: 'https://user-images.githubusercontent.com/1402241/52181103-35a09f80-2829-11e9-9c6f-57f2e08fc5b2.png',
	include: [
		features.isRepoSearch,
		features.isGlobalSearchResults
	],
	load: features.onAjaxedPages,
	init
});


text:
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEngine;

namespace Microsoft.MixedReality.Toolkit.Utilities.Editor
{
    [InitializeOnLoad]
    static class OnLoadUtilities
    {
        private const string ShaderSentinelGuid = "05852dd420bb9ec4cb7318bfa529d37c";
        private const string ShaderSentinelFile = "MRTK.Shaders.sentinel";

        private const string ShaderImportDestination = "MRTK/Shaders";

        private const string IgnoreFileName = "IgnoreUpdateCheck.sentinel";

        static OnLoadUtilities()
        {
            EnsureShaders(false);
        }

        /// <summary>
        /// Checks for updated shaders and bypasses the ignore update check.
        /// </summary>
        [MenuItem("Mixed Reality/Toolkit/Utilities/Check for Shader Updates")]
        private static void CheckForShaderUpdates()
        {
            EnsureShaders(true);
        }

        /// <summary>
        /// Ensures that MRTK shader files are present in a writable location. To support the
        /// Universal Render Pipeline, shader modifications must be persisted.
        /// </summary>
        /// <param name="bypassIgnore">Causes the shader update code to disregard the ignore file.</param>
        private static void EnsureShaders(bool bypassIgnore)
        {
            DirectoryInfo packageShaderFolder = FindShaderFolderInPackage();

            if (bypassIgnore)
            {
                // The customer is manually checking for updates, delete the ignore file
                string sentinelPath = AssetDatabase.GUIDToAssetPath(ShaderSentinelGuid);
                if (!string.IsNullOrWhiteSpace(sentinelPath))
                {
                    FileInfo ignoreFile = new FileInfo(Path.Combine(new FileInfo(sentinelPath).Directory.FullName, IgnoreFileName));
                    if (ignoreFile.Exists)
                    {
                        ignoreFile.Delete();
                    }
                    ignoreFile.Refresh();
                }
            }

            if (!AssetsContainsShaders(packageShaderFolder))
            {
                ImportShaderFiles(packageShaderFolder);
            }
        }

        /// <summary>
        /// Checks to see if the Assets or Packages (if embedded) folder trees contains the MRTK shaders.
        /// </summary>
        /// <returns>True if the shader sentinel file is found, otherwise false.</returns>
        private static bool AssetsContainsShaders(DirectoryInfo packageShaderFolder)
        {
            string sentinelPath = AssetDatabase.GUIDToAssetPath(ShaderSentinelGuid);

            // If we do not find the sentinel, we need to import the shaders.
            if (string.IsNullOrWhiteSpace(sentinelPath))
            {
                return false;
            }

            // Getting here indicates that the project's Assets folder contains the shader sentinel.

            // Check for the "ignore this check" file, if present we do NOT import
            FileInfo ignoreFile = new FileInfo(Path.Combine(new FileInfo(sentinelPath).Directory.FullName, IgnoreFileName));
            if (ignoreFile.Exists)
            {
                return true;
            }

            // If the package shader folder does not exist, there is nothing for us to do.
            if ((packageShaderFolder == null) || !packageShaderFolder.Exists)
            {
                return true;
            }

            // Get the versions of the sentinel files,
            int packageVer = ReadSentinelVersion(Path.Combine(packageShaderFolder.FullName, ShaderSentinelFile));
            int assetVer = ReadSentinelVersion(sentinelPath);

            // No need to copy if the versions are the same.
            if (packageVer == assetVer)
            {
                return true;
            }

            string message = (packageVer < assetVer) ?
                "The MRTK shaders older than those in your project, do you wish to overwrite the existing shaders?" :
                "Updated MRTK shaders are available, do you wish to overwrite the existing shaders?";

            int dialogResponse = EditorUtility.DisplayDialogComplex(
                "Mixed Reality Toolkit Standard Assets",
                message +
                "\n\nNOTE: Overwriting will lose any customizations and may require reconfiguring the render pipeline.",
                "Yes",      // returns 0
                "Ignore",   // returns 1 - placed in the cancel slot to force the button order as Yes, No, Ignore
                "No");      // returns 2

            if (dialogResponse == 1)
            {
                // Write an "ignore this check" file to prevent future prompting
                if (!ignoreFile.Directory.Exists)
                {
                    ignoreFile.Directory.Create();
                }
                ignoreFile.Create();
            }
            ignoreFile.Refresh();

            // Return the inverse of the dialog result. Result of true means we want to overwrite, this method returns false
            // to cause an overwrite.
            return (dialogResponse != 0);
        }

        /// <summary>
        /// Finds the shader folder within an installed or embedded package.
        /// </summary>
        /// <returns>
        /// DirectoryInfo object representing the shader folder in the package cache.
        /// If not found, returns null.
        /// </returns>
        private static DirectoryInfo FindShaderFolderInPackage()
        {
            List<string> searchPaths = new List<string>
            {
                Path.GetFullPath(Path.Combine("Library", "PackageCache")),
                Path.GetFullPath("Packages")
            };

            foreach (string path in searchPaths)
            {
                DirectoryInfo di = new DirectoryInfo(path);
                if (!di.Exists) { continue; }

                FileInfo[] files = di.GetFiles(ShaderSentinelFile, SearchOption.AllDirectories);
                if (files.Length > 0)
                {
                    return new DirectoryInfo(files[0].DirectoryName);
                }
            }

            return null;
        }

        /// <summary>
        /// Copies the shader files from the package cache to the Assets folder tree.
        /// </summary>
        private static void ImportShaderFiles(DirectoryInfo packageShaderFolder)
        {
            if (packageShaderFolder == null)
            {
                Debug.LogError("Unable to locate the shader source folder in the package");
                return;
            }

            DirectoryInfo destination = new DirectoryInfo(Path.Combine(Application.dataPath, ShaderImportDestination));
            if (!destination.Exists)
            {
                destination.Create();
            }

            FileInfo[] sourceFiles = packageShaderFolder.GetFiles();
            foreach (FileInfo fi in sourceFiles)
            {
                fi.CopyTo(Path.Combine(destination.FullName, fi.Name), true);
            }
        }

        /// <summary>
        /// Reads the version number out of the shader
        /// </summary>
        /// <param name="sentinelPath">The path to the sentinel file.</param>
        /// <returns>The version number found in the file, or -1.</returns>
        private static int ReadSentinelVersion(string sentinelPath)
        {
            using (FileStream fs = new FileStream(sentinelPath, FileMode.Open, FileAccess.Read))
            {
                using (StreamReader reader = new StreamReader(fs))
                {
                    const string token = "ver:";

                    while (!reader.EndOfStream)
                    {
                        string line = reader.ReadLine();
                        if (line.StartsWith(token))
                        {
                            line = line.Substring(token.Length).Trim();
                            if (!int.TryParse(line, out int ver))
                            {
                                break;
                            }
                            return ver;
                        }
                    }
                }
            }

            return -1;
        }
    }
}


text:
<!doctype html>

    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>Три лимона. Семья, события, спорт.</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href='fonts/Branding-with-Type-Bw-Quinta-Pro-Medium.otf' rel='stylesheet' type='text/css'>
    <link rel="apple-touch-icon" href="apple-touch-icon.png">

    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="css/main.css">
    <link rel="stylesheet" href="css/contacts.css">
    <link rel="stylesheet" href="css/jquery.bxslider.css">

+7 (499) 641 09 98
 +7 (499) 641 08 38
 ok@3lemons.ru

О нас

Наши
 проекты

Партнеры

Контакты

Контакты

+7 (499) 641 09 98
 +7 (499) 641 08 38

г. Москва
 ул. 1-я Ямского поля, 10

ok@3lemons.ru

+7 (499) 641 09 98
 +7 (499) 641 08 38

г. Москва
 ул. 1-я Ямского поля, 10

ok@3lemons.ru


text:
/* $Id: IXMLHandler.java 1005681 2010-10-08 00:27:46Z kwright $ */

/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.manifoldcf.crawler.connectors.webcrawler;

import org.apache.manifoldcf.core.interfaces.*;

/** This interface describes the functionality needed by an XML processor in order to handle an XML document.
*/
public interface IXMLHandler extends IDiscoveredLinkHandler
{
  /** Inform the world of a discovered ttl value.
  *@param rawTtlValue is the raw discovered ttl value.
  */
  public void noteDiscoveredTtlValue(String rawTtlValue)
    throws ManifoldCFException;

}


text:
package com.hironytic.moltonf.controller;

import java.util.Set;

import com.hironytic.moltonf.model.Avatar;
import com.hironytic.moltonf.model.EventFamily;
import com.hironytic.moltonf.model.TalkType;
import com.hironytic.moltonf.view.PeriodView;
import com.hironytic.moltonf.view.event.FilterChangeListener;
import com.hironytic.moltonf.view.event.FilterChangedEvent;
import com.hironytic.moltonf.view.sidebar.FilterSideBar;

/**
 * フィルタ状態を管理するクラス
 */
public class FilterManager implements FilterChangeListener {

    /** コントローラー */
    private MoltonfController controller;

    /**
     * コンストラクタ
     */
    public FilterManager(MoltonfController controller) {
        this.controller = controller;
    }

    /**
     * @see com.hironytic.moltonf.view.event.FilterChangeListener#filterChanged(com.hironytic.moltonf.view.event.FilterChangedEvent)
     */
    @Override
    public void filterChanged(FilterChangedEvent e) {
        PeriodView periodView = controller.getCurrentPeriodView();
        FilterSideBar filterSideBar = controller.getFilterSideBar();
        boolean isDoWithPeriodView = (periodView != null);
        boolean isDoWithFilterSideBar = (!(e.getSource() instanceof FilterSideBar) && filterSideBar != null);

        switch (e.getFilterType()) {
        case TALK_TYPE:
            {
                Set<TalkType> filterValue = e.getTalkTypeFilterValue();
                if (isDoWithPeriodView) {
                    if (filterValue.isEmpty()) {
                        periodView.setTalkTypeFilter(null);
                    } else {
                        periodView.setTalkTypeFilter(filterValue);
                    }
                }
                if (isDoWithFilterSideBar) {
                    filterSideBar.setTalkTypeFilter(filterValue);
                }
            }
            break;
        case EVENT_FAMILY:
            {
                Set<EventFamily> filterValue = e.getEventFamilyFilterValue();
                if (isDoWithPeriodView) {
                    if (filterValue.isEmpty()) {
                        periodView.setEventFamilyFilter(null);
                    } else {
                        periodView.setEventFamilyFilter(filterValue);
                    }
                }
                if (isDoWithFilterSideBar) {
                    filterSideBar.setEventFamilyFilter(filterValue);
                }
            }
            break;
        case SPEAKER:
            {
                Set<Avatar> filterValue = e.getSpeakerFilterValue();
                if (isDoWithPeriodView) {
                    if (filterValue.isEmpty()) {
                        periodView.setSpeakerFilter(null);
                    } else {
                        periodView.setSpeakerFilter(filterValue);
                    }
                }
                if (isDoWithFilterSideBar) {
                    filterSideBar.setSpeakerFilter(filterValue);
                }
            }
            break;
        }
        if (isDoWithPeriodView) {
            periodView.updateView();
        }
        if (isDoWithFilterSideBar) {
            filterSideBar.updateView();
        }
    }
}


text:
package de.muse.recommendation.recommenders.content;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import de.muse.api.AbstractRecommender;
import de.muse.api.DataRepository;
import de.muse.api.Recommendation;
import de.muse.api.User;
import de.muse.recommendation.MuseRecommendation;
import de.muse.recommendation.MuseSong;
import de.muse.utility.Database;
import de.muse.utility.MathHelper;

public class ContentBasedRecommender extends AbstractRecommender {
	// Configured logger
	private static transient final Logger LOG = LoggerFactory
			.getLogger(ContentBasedRecommender.class.getName());

	// Meta information
	private static final String NAME = "Content Based";
	private static final String EXPLANATION = "Recommendations are based on items that are similar to items you like.";
	private static final Map<String, Double> tagDistribution = new HashMap<String, Double>();
	static {
		tagDistribution.put("Accuracy", 70.0);
		tagDistribution.put("Novelty", 20.0);
		tagDistribution.put("Diversity", 0.0);
		tagDistribution.put("Serendipity", 10.0);
	}

	/**
	 * Create recommender object
	 *
	 * @param ID
	 *            The internal ID of the recommender
	 * @param dataRepository
	 *            The data repository
	 */
	public ContentBasedRecommender(int ID, DataRepository dataRepository) {
		super(ID, dataRepository);
	}

	@Override
	public List<Recommendation> getRecommendations(User user, int howMany) {
		List<Recommendation> recommendations = new ArrayList<Recommendation>();

		// Connect to database
		Connection conn = null;
		Statement stmt = null;
		ResultSet result = null;

		try {
			conn = Database.getConnection();
			stmt = conn.createStatement();

			// 1) Get the tracks with highest predicted rating
			result = stmt
					.executeQuery("SELECT DISTINCT track_id, score, explanation "
							+ "FROM user_track_score WHERE track_id "
							+ "NOT IN(SELECT track_id FROM recommendation WHERE consumer = '"
							+ user.getName()
							+ "')"
							+ " AND user_name = '"
							+ user.getName() + "' ORDER BY score DESC ");

			// Save tracks in HashMap to lookup the score and in a list to keep
			// the ordering
			HashMap<Integer, Double> candidates = new HashMap<Integer, Double>();
			HashMap<Integer, String> explanations = new HashMap<Integer, String>();
			List<Integer> topN = new ArrayList<Integer>();

			while (result.next() && topN.size() < howMany) {
				// Track data
				int trackId = result.getInt("track_id");
				double score = result.getDouble("score");
				String explanationArtists = result.getString("explanation");

				if (!candidates.keySet().contains(trackId)) {
					candidates.put(trackId, score);
					explanations.put(trackId, explanationArtists);
					topN.add(trackId);
				}
			}

			/*
			 * 4) Query information about topN tracks and return as
			 * recommendations
			 */
			recommendations = mapTracksToRecommendations(topN, candidates,
					explanations);

		} catch (SQLException e) {
			LOG.warn(
					"Couldn't get recommendations for user: " + user.getName(),
					e);
		} finally {
			Database.quietClose(conn, stmt, result);
		}
		return recommendations;
	}

	private List<Recommendation> mapTracksToRecommendations(List<Integer> ids,
			HashMap<Integer, Double> candidates,
			HashMap<Integer, String> explanations) {
		List<Recommendation> recommendations = new ArrayList<Recommendation>();

		// Connect to database
		Connection conn = null;
		PreparedStatement pstmt = null;
		ResultSet result = null;

		try {
			conn = Database.getConnection();

			// Get information of each track
			pstmt = conn
					.prepareStatement("SELECT artist, name FROM tracks WHERE id = ?");
			for (int id : ids) {
				pstmt.setInt(1, id);
				result = pstmt.executeQuery();
				while (result.next()) {
					String artist = result.getString("artist");
					String name = result.getString("name");
					MuseSong song = new MuseSong(artist, name);
					song.setID(id);
					double score = candidates.get(id);
					String explanation = "You liked: " + explanations.get(id);

					MuseRecommendation rec = new MuseRecommendation();
					rec.setSong(song);
					rec.setScore(score);
					rec.setExplanation(explanation);
					rec.setRecommenderID(getID());
					recommendations.add(rec);
				}
			}

		} catch (SQLException e) {
			LOG.warn("Couldn't create recommendations out of ids.", e);
		} finally {
			Database.quietClose(conn, pstmt, result);
		}
		return recommendations;
	}

	/**
	 * Precompute prediction scores for the given user.
	 *
	 * @param neighborhoodSize
	 *            The number of neighbors to consider for the score computation.
	 * @param user
	 *            The name of the user.
	 *
	 */
	public void refreshUserItemMatrix(String user, int neighborhoodSize) {
		// Connect to database
		Connection conn = null;
		PreparedStatement pstmt = null;
		PreparedStatement pstmt2 = null;
		Statement stmt = null;
		ResultSet result = null;
		ResultSet result2 = null;

		try {
			conn = Database.getConnection();
			stmt = conn.createStatement();
			pstmt = conn
					.prepareStatement("INSERT INTO user_track_score VALUES(?,?,?,?)");
			pstmt2 = conn
					.prepareStatement("SELECT track_id_1,track_id_2, similarity FROM "
							+ "(SELECT track_id_1, track_id_2, similarity "
							+ "FROM track_similarities "
							+ "WHERE track_id_1 = ? OR track_id_2 = ?"
							+ "ORDER BY similarity DESC) WHERE ROWNUM <= ?");

			// Compute prediction scores
			LOG.info("...Precomputing scores for user: " + user);

			// Get already rated songs of the current user
			LinkedHashMap<Integer, Double> ratedSongs = getDataRepository()
					.getRatingsFromUser(user);

			// Compute prediction score for neighbors of each rated song
			for (int songID : ratedSongs.keySet()) {
				// Check for positive rating
				if (ratedSongs.get(songID) != 2 && ratedSongs.get(songID) != 1) {
					// There are no more songs that the user likes
					break;
				}

				pstmt2.setInt(1, songID);
				pstmt2.setInt(2, songID);
				pstmt2.setInt(3, neighborhoodSize);
				result = pstmt2.executeQuery();

				while (result.next()) {
					// Get similarity of the neighbor
					Double similarity = result.getDouble("similarity");
					int neighborId = result.getInt("track_id_1");
					if (neighborId == songID) {
						neighborId = result.getInt("track_id_2");
					}

					// Check song was already rated by the user
					double score = 0;
					String artist = "";
					if (!ratedSongs.containsKey(neighborId)) {
						score = similarity * ratedSongs.get(songID);

						// Get artist name for explanation
						result2 = stmt
								.executeQuery("SELECT artist FROM tracks WHERE id = "
										+ songID);
						while (result2.next()) {
							artist = result2.getString("artist");
						}

						// 3) Save prediction score to database
						pstmt.setString(1, user);
						pstmt.setInt(2, neighborId);
						pstmt.setDouble(3, score);
						pstmt.setString(4, artist);
						pstmt.addBatch();

					}
					LOG.info("Computed prediction " + score + " for user "
							+ user + " and " + neighborId + ".");
				}
				pstmt.executeBatch();
			}
		} catch (SQLException e) {
			LOG.warn("Couldn't save similarities to the database: ", e);
		} finally {
			Database.quietClose(result2);
			Database.quietClose(result);
			Database.quietClose(pstmt);
			Database.quietClose(pstmt2);
			Database.quietClose(stmt);
			Database.quietClose(conn);
		}
	}

	/**
	 * Compute and save content based similarities for each song
	 */
	public static void refreshTrackSimilarities() {
		List<MuseSong> songs = getAllTracksMissingTrackSimilarities();
		HashSet<MuseSong> done = new HashSet<MuseSong>();

		// Connect to database
		Connection conn = null;
		PreparedStatement pstmt = null;

		try {
			conn = Database.getConnection();
			pstmt = conn
					.prepareStatement("INSERT INTO track_similarities VALUES(?,?,?)");

			// Compute the similarity
			for (MuseSong songOne : songs) {
				LOG.info("Compute similarities for song: " + songOne.toString());
				int count = 0;
				for (MuseSong songTwo : songs) {
					LOG.info(" - Compute similarity to " + songTwo.toString()
							+ ".");

					// Avoid duplicate computations
					if (songOne.equals(songTwo) || done.contains(songTwo))
						continue;

					// Compute similarity and save if not zero
					double similarity = MathHelper.computeCosineDistance(
							songOne.getTags(), songTwo.getTags());
					if (similarity == 0.0)
						continue;

					// If not zero save similarity to database
					pstmt.setInt(1, songOne.getID());
					pstmt.setInt(2, songTwo.getID());
					pstmt.setDouble(3, similarity);
					pstmt.addBatch();

					// Save stacks of size 1000 to the database
					count++;
					if (count == 1000) {
						pstmt.executeBatch();
						count = 0;
					}
				}
				pstmt.executeBatch();
				done.add(songOne);
			}
			LOG.info("Computed similarities for " + done.size() + " tracks.");

		} catch (SQLException e) {
			LOG.warn("Couldn't save track similarities to the database. ", e);
		} finally {
			Database.quietClose(pstmt);
			Database.quietClose(conn);
		}
	}

	/**
	 * Get all tracks including the corresponding tags from the database for
	 * which no content based similarity is computed.
	 *
	 * @return A list of all tracks including corresponding tags
	 */
	public static List<MuseSong> getAllTracksMissingTrackSimilarities() {
		LOG.info("Fetching all tracks from the database.");
		List<MuseSong> tracks = new ArrayList<MuseSong>();

		// Connect to database
		Connection conn = null;
		Statement stmt = null;
		ResultSet result = null;

		try {
			conn = Database.getConnection();
			stmt = conn.createStatement();
			result = stmt
					.executeQuery("SELECT id, name, artist FROM tracks "
							+ "WHERE id NOT IN (SELECT track_id_1 FROM track_similarities) "
							+ "AND id NOT IN(SELECT track_id_2 FROM track_similarities)");

			// Get all the tracks from the database
			while (result.next()) {
				String name = result.getString("name");
				String artist = result.getString("artist");
				MuseSong song = new MuseSong(artist, name);
				song.setID(result.getInt("id"));
				tracks.add(song);
			}

			// Get all corresponding tags for each of the tracks
			for (MuseSong song : tracks) {
				int id = song.getID();
				result = stmt.executeQuery("SELECT tag, count FROM "
						+ "track_tags WHERE track_id = " + id);

				HashMap<String, Double> tags = new HashMap<String, Double>();
				while (result.next()) {
					tags.put(result.getString("tag"), result.getDouble("count"));
				}
				song.setTags(tags);
			}

		} catch (SQLException e) {
			LOG.warn("Couldn't get list of tracks from the database.", e);
		} finally {
			Database.quietClose(conn, stmt, result);
		}
		return tracks;
	}

	@Override
	public String getName() {
		return NAME;
	}

	@Override
	public String getExplanation() {
		return EXPLANATION;
	}

	@Override
	public Map<String, Double> getTagDistribution() {
		return tagDistribution;
	}

}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Trachydium hamelianum Farille & S.B.Malla

### Remarks
null


text:
class UsersController < ApplicationController
  before_filter :permission_filter, :except => [:create, :update, :show]
  before_filter :session_filter, :only => [:create, :update]
  # GET /users
  # GET /users.json
  def index
    @users = User.all

    respond_to do |format|
      format.html # index.html.erb
      format.json { render json: @users }
    end
  end

  # GET /users/1
  # GET /users/1.json
  def show
    @user = User.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.json { render json: @user }
    end
  end

  # GET /users/new
  # GET /users/new.json
  def new
    @user = User.new

    respond_to do |format|
      format.html # new.html.erb
      format.json { render json: @user }
    end
  end

  # GET /users/1/edit
  def edit
    @user = User.find(params[:id])
  end

  # POST /users
  # POST /users.json
  def create
    @user = User.new(params[:user])

    respond_to do |format|
      if @user.save
        format.html { redirect_to users_path, notice: 'El usuario #{@user.username} se creo correctamente' }
        format.json { render json: @user, status: :created, location: @user }
      else
        format.html { render action: "new" }
        format.json { render json: @user.errors, status: :unprocessable_entity }
      end
    end
  end

  # PUT /users/1
  # PUT /users/1.json
  def update
    @user = User.find(params[:id])

    respond_to do |format|
      if @user.update_attributes(params[:user])
        format.html { redirect_to users_path, notice: 'El usuario #{@user.username} se creo correctamente.' }
        format.json { head :no_content }
      else
        format.html { render action: "edit" }
        format.json { render json: @user.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /users/1
  # DELETE /users/1.json
  def destroy
    @user = User.find(params[:id])
    @user.destroy

    respond_to do |format|
      format.html { redirect_to users_url }
      format.json { head :no_content }
    end
  end
end


text:
[![Build app](https://github.com/giggio/node-chromedriver/actions/workflows/build.yml/badge.svg)](https://github.com/giggio/node-chromedriver/actions/workflows/build.yml)
[![npm](https://img.shields.io/npm/dt/chromedriver.svg)](https://www.npmjs.com/package/chromedriver)

An NPM wrapper for Selenium [ChromeDriver](https://sites.google.com/chromium.org/driver/).

## Building and Installing

```shell
npm install chromedriver
```

Or grab the source and

```shell
node ./install.js
```

What this is really doing is just grabbing a particular "blessed" (by
this module) version of ChromeDriver. As new versions are released
and vetted, this module will be updated accordingly.

The package has been set up to fetch and run ChromeDriver for MacOS (darwin),
Linux based platforms (as identified by Node.js), and Windows.  If you
spot any platform weirdness, let us know or send a patch.

## Force download

By default this package, when installed, will search for an existing
Chromedriver binary in your configured temp directory. If found, and it is the
correct version, it will simply copy it to your node_modules directory. You can
force it always download by configuring it:

```shell
npm install chromedriver --chromedriver-force-download
```

Or add property into your [`.npmrc`](https://docs.npmjs.com/files/npmrc) file.

```
chromedriver_force_download=true
```

Another option is to use PATH variable `CHROMEDRIVER_FORCE_DOWNLOAD`.

```shell
CHROMEDRIVER_FORCE_DOWNLOAD=true npm install chromedriver
```

## Custom binaries url

To use a mirror of the ChromeDriver binaries use npm config property `chromedriver_cdnurl`.
Default is `https://chromedriver.storage.googleapis.com`.

```shell
npm install chromedriver --chromedriver_cdnurl=https://npmmirror.com/mirrors/chromedriver
```

Or add property into your [`.npmrc`](https://docs.npmjs.com/files/npmrc) file.

```
chromedriver_cdnurl=https://npmmirror.com/mirrors/chromedriver
```

Another option is to use PATH variable `CHROMEDRIVER_CDNURL`.

```shell
CHROMEDRIVER_CDNURL=https://npmmirror.com/mirrors/chromedriver npm install chromedriver
```

## Custom binaries file

To get the chromedriver from the filesystem instead of a web request use the npm config property `chromedriver_filepath`.

```shell
npm install chromedriver --chromedriver_filepath=/path/to/chromedriver_mac64.zip
```

Or add property into your [`.npmrc`](https://docs.npmjs.com/files/npmrc) file.

```
chromedriver_filepath=/path/to/chromedriver_mac64.zip
```

Another option is to use the PATH variable `CHROMEDRIVER_FILEPATH`

```shell
CHROMEDRIVER_FILEPATH=/path/to/chromedriver_mac64.zip
```

This variable can be used to set either a `.zip` file or the binary itself, eg:

```shell
CHROMEDRIVER_FILEPATH=/bin/chromedriver
```

## Custom download options

Install through a proxy.

```shell
npm config set proxy http://[user:pwd]@domain.tld:port
npm config set https-proxy http://[user:pwd]@domain.tld:port
```

Use different User-Agent.

```shell
npm config set user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0"
```

## Skipping chromedriver download

You may wish to skip the downloading of the chromedriver binary file, for example if you know for certain that it is already there or if you want to use a system binary and just use this module as an interface to interact with it.

To achieve this you can use the npm config property `chromedriver_skip_download`.

```shell
npm install chromedriver --chromedriver_skip_download=true
```

Or add property into your [`.npmrc`](https://docs.npmjs.com/files/npmrc) file.

```
chromedriver_skip_download=true
```

Another option is to use the PATH variable `CHROMEDRIVER_SKIP_DOWNLOAD`

```shell
CHROMEDRIVER_SKIP_DOWNLOAD=true
```

## Running

```shell
bin/chromedriver [arguments]
```

And npm will install a link to the binary in `node_modules/.bin` as
it is wont to do.

## Running with Selenium WebDriver

```javascript
require('chromedriver');
var webdriver = require('selenium-webdriver');
var driver = new webdriver.Builder()
  .forBrowser('chrome')
  .build();
```

(Tested for selenium-webdriver version `2.48.2`)

The path will be added to the process automatically, you don't need to configure it.
But you can get it from `require('chromedriver').path` if you want it.

## Running via node

The package exports a `path` string that contains the path to the
chromedriver binary/executable.

Below is an example of using this package via node.

```javascript
var childProcess = require('child_process');
var chromedriver = require('chromedriver');
var binPath = chromedriver.path;

var childArgs = [
  'some argument'
];

childProcess.execFile(binPath, childArgs, function(err, stdout, stderr) {
  // handle results
});

```

You can also use the start and stop methods:

```javascript
var chromedriver = require('chromedriver');

args = [
 // optional arguments
];
chromedriver.start(args);
// run your tests
chromedriver.stop();

```

With the latest version, you can optionally receive a Promise from the `chromedriver.start` function:

```javascript
var returnPromise = true;
chromedriver
  .start(args, returnPromise)
  .then(() => {
    console.log('chromedriver is ready');
  });
```

Note: if your tests are ran asynchronously, chromedriver.stop() will have to be
executed as a callback at the end of your tests

## Versioning

The NPM package version tracks the version of chromedriver that will be installed,
with an additional build number that is used for revisions to the installer.
You can use the package version number to install a specific version, or use the
setting to a specific version. If there is a new Chromedriver version available which is not yet available as a version of `node-chromedriver`, the npm command `npm run update-chromedriver` in this repository can be used to make the required updates to this module, please submit the change as a PR. To always install the latest version of Chromedriver,
use `LATEST` as the version number:

```shell
npm install chromedriver --chromedriver_version=LATEST
```

Or add property into your [`.npmrc`](https://docs.npmjs.com/files/npmrc) file.

```
chromedriver_version=LATEST
```

Another option is to use env variable `CHROMEDRIVER_VERSION`.

```shell
CHROMEDRIVER_VERSION=LATEST npm install chromedriver
```

You can force the latest release for a specific major version by specifying `LATEST_{VERSION_NUMBER}`:

```shell
CHROMEDRIVER_VERSION=LATEST_80 npm install chromedriver
```

You can also force a different version of chromedriver by replacing `LATEST` with a version number:

```shell
CHROMEDRIVER_VERSION=75.0.3770.140 npm install chromedriver
```

## Detect ChromeDriver Version

The NPM package version may not be always compatible to your Chrome version.
To get the chromedriver that corresponds to the version of Chrome installed,
you can use the npm config property `detect_chromedriver_version`.

```shell
npm install chromedriver --detect_chromedriver_version
```

Or add property into your [`.npmrc`](https://docs.npmjs.com/files/npmrc) file.

```
detect_chromedriver_version=true
```

Another option is to use environment variable `DETECT_CHROMEDRIVER_VERSION`.

```shell
DETECT_CHROMEDRIVER_VERSION=true npm install chromedriver
```

**Note:** When the property `detect_chromedriver_version` is provided,
`chromedriver_version` and `chromedriver_filepath` properties are ignored.

## Include Chromium

If you don't have Chrome installed, you can check for Chromium version instead by setting the argument `include_chromium` to `true`.

```shell
npm install chromedriver --include_chromium
```

Or add property into your [`.npmrc`](https://docs.npmjs.com/files/npmrc) file.

```
include_chromium=true
```

Another option is to use environment variable `INCLUDE_CHROMIUM`.

```shell
INCLUDE_CHROMIUM=true npm install chromedriver
```

**Note:** The property `INCLUDE_CHROMIUM` is ignored if the property `DETECT_CHROMEDRIVER_VERSION` is not used.

## A Note on chromedriver

Chromedriver is not a library for NodeJS.

This is an _NPM wrapper_ and can be used to conveniently make ChromeDriver available.
It is not a Node.js wrapper.

## Supported Node.js versions

We will do our best to support every supported Node.js versions.
See [nodejs/Release](https://github.com/nodejs/Release) for
the current supported versions. You can also view our
[build scripts](https://github.com/giggio/node-chromedriver/blob/main/.github/workflows/build.yml#L41) and check the versions there.

## Contributing

Questions, comments, bug reports, and pull requests are all welcome.  Submit them at
[the project on GitHub](https://github.com/giggio/node-chromedriver/).

Bug reports that include steps-to-reproduce (including code) are the
best. Even better, make them in the form of pull requests.

We have added
[VS Code Remote support with containers](https://code.visualstudio.com/docs/remote/containers).
If you are on Windows, set `git config core.autocrlf input` so you don't get git errors.

## Author

[Giovanni Bassi](https://github.com/giggio), with collaboration from
[lots of good people](https://github.com/giggio/node-chromedriver/graphs/contributors).

Thanks for Obvious and their PhantomJS project for heavy inspiration! Check their project on [Github](https://github.com/Obvious/phantomjs/).

## License

Licensed under the Apache License, Version 2.0.


text:
package com.vmware.vim25;

/**
* @author Steve Jin (http://www.doublecloud.org)
* @version 5.1
*/

@SuppressWarnings("all")
public class ProfileDescription extends DynamicData {
  public ProfileDescriptionSection[] section;

  public ProfileDescriptionSection[] getSection() {
    return this.section;
  }

  public void setSection(ProfileDescriptionSection[] section) {
    this.section=section;
  }
}


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Aecidium meliosmatis-myrianthi Henn. & Shirai

### Remarks
null


text:
<?php namespace Mitch\LaravelDoctrine\Console\Migrations;

use Symfony\Component\Console\Input\InputOption;
use Doctrine\DBAL\Migrations\Configuration\Configuration;

class GenerateCommand extends AbstractCommand {

    private static $_template =
        '<?php

namespace <namespace>;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

/**
 * Auto-generated Migration: Please modify to your needs!
 */
class Version<version> extends AbstractMigration
{
    /**
     * @param Schema $schema
     */
    public function up(Schema $schema)
    {
        // this up() migration is auto-generated, please modify it to your needs
<up>
    }

    /**
     * @param Schema $schema
     */
    public function down(Schema $schema)
    {
        // this down() migration is auto-generated, please modify it to your needs
<down>
    }
}
';

    /**
     * The console command name.
     *
     * @var string
     */
    protected $name = 'doctrine:migrations:generate';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Generate a blank migration class.';

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function fire()
    {
        $configuration = $this->getMigrationConfiguration();

        $version = date('YmdHis');
        $path = $this->generateMigration($configuration, $version);

        $this->info(sprintf('Generated new migration class to "<info>%s</info>"', $path));
    }

    /**
     * Get the console command options.
     *
     * @return array
     */
    protected function getOptions()
    {
        return [
            [
                'editor-cmd',
                null,
                InputOption::VALUE_OPTIONAL,
                'Open file with this command upon creation.'
            ]
        ];
    }

    protected function generateMigration(Configuration $configuration, $version, $up = null, $down = null)
    {
        $placeHolders = array(
            '<namespace>',
            '<version>',
            '<up>',
            '<down>'
        );

        $replacements = array(
            $configuration->getMigrationsNamespace(),
            $version,
            $up ? "        " . implode("\n        ", explode("\n", $up)) : null,
            $down ? "        " . implode("\n        ", explode("\n", $down)) : null
        );

        $code = str_replace($placeHolders, $replacements, self::$_template);
        $code = preg_replace('/^ +$/m', '', $code);
        $dir = $configuration->getMigrationsDirectory();
        $dir = $dir ? $dir : getcwd();
        $dir = rtrim($dir, '/');
        $path = $dir . '/Version' . $version . '.php';

        if ( ! file_exists($dir)) {
            throw new \InvalidArgumentException(sprintf('Migrations directory "%s" does not exist.', $dir));
        }

        file_put_contents($path, $code);

        if ($editorCmd = $this->option('editor-cmd')) {
            proc_open($editorCmd . ' ' . escapeshellarg($path), array(), $pipes);
        }

        return $path;
    }

}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<typeLibraryDependencyType xmlns:ns2="http://www.ebayopensource.org/turmeric/common/config" version="1.1.1" libraryName="ErrorTestServiceV1">
    <ns2:type version="1.0.0" name="TurmericWSDLType">
        <ns2:referredTypeLibrary version="1.0.0" name="common-type-library">
            <ns2:referredType version="1.0.0" name="ErrorSeverity"/>
            <ns2:referredType version="1.0.0" name="ErrorMessage"/>
            <ns2:referredType version="1.0.0" name="ErrorData"/>
            <ns2:referredType version="1.0.0" name="ErrorParameter"/>
            <ns2:referredType version="1.0.0" name="ErrorCategory"/>
        </ns2:referredTypeLibrary>
    </ns2:type>
</typeLibraryDependencyType>


text:
package org.jetbrains.plugins.scala
package lang.refactoring.introduceField

import com.intellij.internal.statistic.UsageTrigger
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.editor.markup.RangeHighlighter
import com.intellij.openapi.editor.{Document, Editor}
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.TextRange
import com.intellij.psi.{PsiDocumentManager, PsiElement, PsiFile}
import com.intellij.refactoring.HelpID
import com.intellij.refactoring.util.CommonRefactoringUtil
import org.jetbrains.plugins.scala.extensions.childOf
import org.jetbrains.plugins.scala.lang.psi.ScalaPsiUtil
import org.jetbrains.plugins.scala.lang.psi.api.expr._
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.ScEarlyDefinitions
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.templates.{ScExtendsBlock, ScTemplateParents}
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.{ScMember, ScTemplateDefinition}
import org.jetbrains.plugins.scala.lang.psi.impl.ScalaPsiElementFactory._
import org.jetbrains.plugins.scala.lang.psi.types.ScType
import org.jetbrains.plugins.scala.lang.refactoring.introduceField.ScalaIntroduceFieldHandlerBase._
import org.jetbrains.plugins.scala.lang.refactoring.util.ScalaRefactoringUtil._
import org.jetbrains.plugins.scala.util.ScalaUtils

/**
 * Nikolay.Tropin
 * 6/27/13
 */
class ScalaIntroduceFieldFromExpressionHandler extends ScalaIntroduceFieldHandlerBase {

  private var occurrenceHighlighters = Seq.empty[RangeHighlighter]

  def invoke(project: Project, editor: Editor, file: PsiFile, startOffset: Int, endOffset: Int) {
    try {
      UsageTrigger.trigger(ScalaBundle.message("introduce.field.id"))
      PsiDocumentManager.getInstance(project).commitAllDocuments()
      checkFile(file, project, editor, REFACTORING_NAME)

      val (expr: ScExpression, types: Array[ScType]) = getExpression(project, editor, file, startOffset, endOffset) match {
        case Some((e, tps)) => (e, tps)
        case None =>
          showErrorMessage(ScalaBundle.message("cannot.refactor.not.expression"), project, editor)
          return
      }

      afterClassChoosing[ScExpression](expr, types, project, editor, file, "Choose class for Introduce Field") {
        convertExpressionToField
      }
    }
    catch {
      case _: IntroduceException =>
    }
  }

  override def invoke(project: Project, editor: Editor, file: PsiFile, dataContext: DataContext) {
    val canBeIntroduced: (ScExpression) => Boolean = checkCanBeIntroduced(_)
    afterExpressionChoosing(project, editor, file, dataContext, REFACTORING_NAME, canBeIntroduced) {
      trimSpacesAndComments(editor, file)
      invoke(project, editor, file, editor.getSelectionModel.getSelectionStart, editor.getSelectionModel.getSelectionEnd)
    }
  }

  override def invoke(project: Project, elements: Array[PsiElement], dataContext: DataContext) {
    //nothing
  }

  def convertExpressionToField(ifc: IntroduceFieldContext[ScExpression]) {

    val possiblePlace = checkCanBeIntroduced(ifc.element, showErrorMessage(_, ifc.project, ifc.editor))
    if (!possiblePlace) return

    def runWithDialog() {
      val settings = new IntroduceFieldSettings(ifc)
      if (!settings.canBeInitInDeclaration && !settings.canBeInitLocally) {
        showErrorMessage("Cannot create field from this expression", ifc.project, ifc.editor)
      } else {
        val dialog = getDialog(ifc, settings)
        if (dialog.isOK) {
          runRefactoring(ifc, settings)
        }
      }
    }

    runWithDialog()
  }

  private def runRefactoringInside(ifc: IntroduceFieldContext[ScExpression], settings: IntroduceFieldSettings[ScExpression]) {
    val expression = expressionToIntroduce(ifc.element)
    val mainOcc = ifc.occurrences.filter(_.getStartOffset == ifc.editor.getSelectionModel.getSelectionStart)
    val occurrencesToReplace = if (settings.replaceAll) ifc.occurrences else mainOcc
    val aClass = ifc.aClass
    val checkAnchor: PsiElement = anchorForNewDeclaration(expression, occurrencesToReplace, aClass)
    if (checkAnchor == null) {
      showErrorMessage("Cannot find place for the new field", ifc.project, ifc.editor)
      return
    }
    implicit val projectContext = aClass.projectContext
    val name = settings.name
    val typeName = Option(settings.scType).map(_.canonicalText).getOrElse("")
    val replacedOccurences = replaceOccurences(occurrencesToReplace, name, ifc.file)

    val anchor = anchorForNewDeclaration(expression, replacedOccurences, aClass)
    val initInDecl = settings.initInDeclaration
    var createdDeclaration: PsiElement = null
    if (initInDecl) {
      createdDeclaration = createDeclaration(name, typeName, settings.defineVar, expression)
    } else {
      val underscore = createExpressionFromText("_")
      createdDeclaration = createDeclaration(name, typeName, settings.defineVar, underscore)

      anchorForInitializer(replacedOccurences, ifc.file) match {
        case Some(anchorForInit) =>
          val parent = anchorForInit.getParent
          val assignStmt = createExpressionFromText(s"$name = ${expression.getText}")
          parent.addBefore(assignStmt, anchorForInit)
          parent.addBefore(createNewLine(), anchorForInit)
        case None => throw new IntroduceException

      }
    }

    settings.visibilityLevel match {
      case "" =>
      case other =>
        val modifier = createModifierFromText(other)
        createdDeclaration.asInstanceOf[ScMember].getModifierList.add(modifier)
    }

    lazy val document: Document = ifc.editor.getDocument

    anchor match {
      case (_: ScTemplateParents) childOf (extBl: ScExtendsBlock) =>
        val earlyDef = extBl.addEarlyDefinitions()
        createdDeclaration = earlyDef.addAfter(createdDeclaration, earlyDef.getFirstChild)
      case _ childOf (ed: ScEarlyDefinitions) if onOneLine(document, ed.getTextRange) =>
        def isBlockStmtOrMember(elem: PsiElement) = elem != null && (elem.isInstanceOf[ScBlockStatement] || elem.isInstanceOf[ScMember])
        var declaration = createdDeclaration.getText
        if (isBlockStmtOrMember(anchor)) declaration += "; "
        if (isBlockStmtOrMember(anchor.getPrevSibling)) declaration = "; " + declaration
        document.insertString(anchor.getTextRange.getStartOffset, declaration)
        PsiDocumentManager.getInstance(ifc.project).commitDocument(document)
      case _ childOf parent =>
        createdDeclaration = parent.addBefore(createdDeclaration, anchor)
        parent.addBefore(createNewLine(), anchor)
    }

    ScalaPsiUtil.adjustTypes(createdDeclaration)
  }

  def runRefactoring(ifc: IntroduceFieldContext[ScExpression], settings: IntroduceFieldSettings[ScExpression]) {
    val runnable = new Runnable {
      def run(): Unit = runRefactoringInside(ifc, settings)
    }
    ScalaUtils.runWriteAction(runnable, ifc.project, REFACTORING_NAME)
    ifc.editor.getSelectionModel.removeSelection()
  }

  protected def getDialog(ifc: IntroduceFieldContext[ScExpression], settings: IntroduceFieldSettings[ScExpression]): ScalaIntroduceFieldDialog = {
    val occCount = ifc.occurrences.length
    // Add occurrences highlighting
    if (occCount > 1)
      occurrenceHighlighters = highlightOccurrences(ifc.project, ifc.occurrences, ifc.editor)

    val dialog = new ScalaIntroduceFieldDialog(ifc, settings)
    dialog.show()
    if (!dialog.isOK) {
      if (occCount > 1) {
        occurrenceHighlighters.foreach(_.dispose())
        occurrenceHighlighters = Seq.empty
      }
    }
    dialog
  }

  protected override def isSuitableClass(elem: PsiElement, clazz: ScTemplateDefinition): Boolean = true

  private def onOneLine(document: Document, range: TextRange): Boolean = {
    document.getLineNumber(range.getStartOffset) == document.getLineNumber(range.getEndOffset)
  }

  private def showErrorMessage(text: String, project: Project, editor: Editor) = {
    CommonRefactoringUtil.showErrorHint(project, editor, text, REFACTORING_NAME, HelpID.INTRODUCE_FIELD)
  }

}


text:
$Global:CSNUIInvoke=Split-Path -Parent $MyInvocation.MyCommand.Definition
$env:PSModulePath="$env:PSModulePath;${CSNUIInvoke}\Modules"
<#Import-Module WPK
[System.Reflection.Assembly]::LoadWithPartialName('System.Windows')|Out-Null
[System.Reflection.Assembly]::LoadWithPartialName('System.Diagnostics')|Out-Null
[System.Reflection.Assembly]::LoadWithPartialName('System.XML')|Out-Null
[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Markup')|Out-Null
#>

Function Global:Show-LauncherWindow{

#[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Markup.XAMLReader')|Out-Null
$xaml = @"
<Window
 xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'>

 <Border BorderThickness="25" BorderBrush="White" CornerRadius="9" Background='White'>
  <StackPanel>
   <Label FontSize="50" FontFamily='Segoe UI' Background='White' Foreground='Black' BorderThickness='1'>
    ClangSetup Environment vNext
   </Label>

   <Label HorizontalAlignment="Center" FontSize="15" FontFamily='Consolas' Background='Aqua' Foreground='Black' BorderThickness='0'>
    ClangSetup vNext
   </Label>
  </StackPanel>
 </Border>
</Window>
"@
Add-Type -assemblyName PresentationFramework
$reader = [System.XML.XMLReader]::Create([System.IO.StringReader] $xaml)
$window = [System.Windows.Markup.XAMLReader]::Load($reader)
$Window.AllowsTransparency = $True
$window.SizeToContent = 'WidthAndHeight'
$window.ResizeMode = 'NoResize'
$Window.Opacity = .7
$window.Topmost = $true
$window.WindowStartupLocation = 'CenterScreen'
$window.WindowStyle = 'None'
# show message for 5 seconds:
#$Host.UI.RawUI.WindowPosition
$null = $window.Show()
Start-Sleep -Seconds 2
$window.Close()
}

Function Global:Get-ReadMeWindow(){
$ReadMeDir=Split-Path -Parent $CSNUIInvoke
$text = Get-Content "${CSNUIInvoke}\ReadMe.txt" -ReadCount 0 | Out-String
Add-Type -AssemblyName Microsoft.PowerShell.GraphicalHost
$HelpWindow = New-Object Microsoft.Management.UI.HelpWindow $text -Property @{
    Title="ClangSetup vNext ReadMe"
    Background='#011f51'
    FontSize='14'
    Foreground='#FFFFFFFF'
}

$HelpWindow.ShowDialog()
}

Function Global:Show-OpenFileDialog
{
  param
  (
    $StartFolder = [Environment]::GetFolderPath('MyDocuments'),

    $Title = 'Open Files',

    $Filter = 'All|*.*|Scripts|*.ps1|Texts|*.txt|Logs|*.log'
  )

  Add-Type -AssemblyName PresentationFramework

  $dialog = New-Object -TypeName Microsoft.Win32.OpenFileDialog

  $dialog.Title = $Title
  $dialog.InitialDirectory = $StartFolder
  $dialog.Filter = $Filter

  $resultat = $dialog.ShowDialog()
  if ($resultat -eq $true)
  {
    $dialog.FileName
  }
}

Function Global:Out-ClangSetupTipsVoice([String]$voicestr){
Add-Type -AssemblyName System.Speech

$synthesizer = New-Object -TypeName System.Speech.Synthesis.SpeechSynthesizer
$synthesizer.Speak($voicestr)
}

Function Global:Select-MenuShow(){
$title = "ClangSetup vNext Select"
$message = "Do you want to Create Shortcut ?"

$yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", `
    "continue."
$no = New-Object System.Management.Automation.Host.ChoiceDescription "&No", `
    "End options"
$options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no)

$result = $Host.UI.PromptForChoice($title, $message, $options, 0)

switch ($result)
    {
        0 {"You selected Yes."
           Echo "Yes"
          }
        1 {"You selected No."}
    }
}

Function Global:New-PopuShow {

<#
.Synopsis
Display a Popup Message
.Description
This command uses the Wscript.Shell PopUp method to display a graphical message
box. You can customize its appearance of icons and buttons. By default the user
must click a button to dismiss but you can set a timeout value in seconds to
automatically dismiss the popup.

The command will write the return value of the clicked button to the pipeline:
  OK     = 1
  Cancel = 2
  Abort  = 3
  Retry  = 4
  Ignore = 5
  Yes    = 6
  No     = 7

If no button is clicked, the return value is -1.
.Example
PS C:\> new-popup -message "The update script has completed" -title "Finished" -time 5

This will display a popup message using the default OK button and default
Information icon. The popup will automatically dismiss after 5 seconds.
.Notes
Last Updated: April 8, 2013
Version     : 1.0

.Inputs
None
.Outputs
integer

Null   = -1
OK     = 1
Cancel = 2
Abort  = 3
Retry  = 4
Ignore = 5
Yes    = 6
No     = 7
#>

Param (
[Parameter(Position=0,Mandatory=$True,HelpMessage="Enter a message for the popup")]
[ValidateNotNullorEmpty()]
[string]$Message,
[Parameter(Position=1,Mandatory=$True,HelpMessage="Enter a title for the popup")]
[ValidateNotNullorEmpty()]
[string]$Title,
[Parameter(Position=2,HelpMessage="How many seconds to display? Use 0 require a button click.")]
[ValidateScript({$_ -ge 0})]
[int]$Time=0,
[Parameter(Position=3,HelpMessage="Enter a button group")]
[ValidateNotNullorEmpty()]
[ValidateSet("OK","OKCancel","AbortRetryIgnore","YesNo","YesNoCancel","RetryCancel")]
[string]$Buttons="OK",
[Parameter(Position=4,HelpMessage="Enter an icon set")]
[ValidateNotNullorEmpty()]
[ValidateSet("Stop","Question","Exclamation","Information" )]
[string]$Icon="Information"
)

#convert buttons to their integer equivalents
Switch ($Buttons) {
    "OK"               {$ButtonValue = 0}
    "OKCancel"         {$ButtonValue = 1}
    "AbortRetryIgnore" {$ButtonValue = 2}
    "YesNo"            {$ButtonValue = 4}
    "YesNoCancel"      {$ButtonValue = 3}
    "RetryCancel"      {$ButtonValue = 5}
}

#set an integer value for Icon type
Switch ($Icon) {
    "Stop"        {$iconValue = 16}
    "Question"    {$iconValue = 32}
    "Exclamation" {$iconValue = 48}
    "Information" {$iconValue = 64}
}

#create the COM Object
Try {
    $wshell = New-Object -ComObject Wscript.Shell -ErrorAction Stop
    #Button and icon type values are added together to create an integer value
    $wshell.Popup($Message,$Time,$Title,$ButtonValue+$iconValue)
}
Catch {
    #You should never really run into an exception in normal usage
    Write-Warning "Failed to create Wscript.Shell COM object"
    Write-Warning $_.exception.message
}

} #end function

Function Global:Bmp2Icons([string]$bmpPath,[string]$iconPath)
{
    Add-Type -AssemblyName "System.Drawing"
    $bmp=[Drawing.Bitmap]::fromFile($bmpPath)
    $icon=[Drawing.icon]::FromHandle($bmp.GetHicon())
    $fs=New-Object IO.FileStream $iconPath,"OpenOrCreate"
    $icon.save($fs)
    $fs.Close()
    $icon.Dispose()

}


text:
@interface BNSViewController : UIViewController

@end


text:
using YAF.Lucene.Net.Index;
using YAF.Lucene.Net.QueryParsers.Flexible.Core.Nodes;
using YAF.Lucene.Net.QueryParsers.Flexible.Standard.Nodes;
using YAF.Lucene.Net.QueryParsers.Flexible.Standard.Processors;
using YAF.Lucene.Net.Search;

namespace YAF.Lucene.Net.QueryParsers.Flexible.Standard.Builders
{

    /// <summary>
    /// Builds a <see cref="RegexpQuery"/> object from a <see cref="RegexpQueryNode"/> object.
    /// </summary>
    public class RegexpQueryNodeBuilder : IStandardQueryBuilder
    {
        public RegexpQueryNodeBuilder()
        {
            // empty constructor
        }

        public virtual Query Build(IQueryNode queryNode)
        {
            RegexpQueryNode regexpNode = (RegexpQueryNode)queryNode;

            RegexpQuery q = new RegexpQuery(new Term(regexpNode.GetFieldAsString(),
                regexpNode.TextToBytesRef()));

            MultiTermQuery.RewriteMethod method = (MultiTermQuery.RewriteMethod)queryNode
                .GetTag(MultiTermRewriteMethodProcessor.TAG_ID);
            if (method != null)
            {
                q.MultiTermRewriteMethod = method;
            }

            return q;
        }
    }
}