text:
package net.sandstorm.castlauncher;

import android.app.Activity;
import android.app.Presentation;
import android.content.ClipData;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
import android.graphics.PixelFormat;
import android.os.Bundle;
import android.view.Display;
import android.view.DragEvent;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Brian Wing on 2/14/2016.
 * Sandstorm Technologies
 * brian@sandstorm.net
 */
public class Workspace {

    private Context context;
    private Display display;
    private StartMenu startMenu;
    private Taskbar taskbar;

    public Workspace(Context context, Display display){
        this.context = context;
        this.display = display;

        final Activity activity = this;
        taskbar = new Taskbar(activity);
        startMenu = new StartMenu(activity, taskbar, getAppsList());

        RelativeLayout desktop = (RelativeLayout) this.findViewById(R.id.desktop);
        desktop.setOnDragListener(new View.OnDragListener() {
            @Override
            public boolean onDrag(View v, DragEvent event) {
                switch (event.getAction()) {
                    case DragEvent.ACTION_DRAG_STARTED:
                        //no action necessary
                        break;
                    case DragEvent.ACTION_DRAG_ENTERED:
                        //no action necessary
                        break;
                    case DragEvent.ACTION_DRAG_EXITED:
                        //no action necessary
                        break;
                    case DragEvent.ACTION_DROP:
                        //handle the dragged view being dropped over a drop view
                        RelativeLayout view = (RelativeLayout) event.getLocalState();
                        RelativeLayout target = (RelativeLayout) v;
                        View convertView = activity.getLayoutInflater().inflate(R.layout.desktop_item, null);
                        ImageView iv = (ImageView)convertView.findViewById(R.id.desktop_app_icon);
                        iv.setImageDrawable(((ImageView) view.findViewWithTag("icon")).getDrawable());
                        TextView tv = (TextView)convertView.findViewById(R.id.desktop_app_label);
                        tv.setText(((TextView) view.findViewWithTag("label")).getText().toString());
                        convertView.setX(event.getX() - convertView.getWidth());
                        convertView.setY(event.getY() - convertView.getHeight());

                        //Enable dragging of icons on desktop.
                        convertView.setOnLongClickListener(new View.OnLongClickListener() {
                            @Override
                            public boolean onLongClick(View view) {
                                ClipData dragData = ClipData.newPlainText("", "");
                                View.DragShadowBuilder myShadow = new View.DragShadowBuilder(view);
                                view.startDrag(dragData, myShadow, view, 0);
                                return true;
                            }
                        });

                        /*
                        //Enable launching app from desktop icon.
                        convertView.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View v) {
                                //Launch app.
                                PackageManager manager = act.getPackageManager();
                                Intent i = manager.getLaunchIntentForPackage(getAppsList().get(pos).name.toString());
                                taskbar.addToTaskbar(getAppsList().get(pos));
                                act.startActivity(i);
                            }
                        });*/

                        target.addView(convertView);
                        break;
                    case DragEvent.ACTION_DRAG_ENDED:
                        //no action necessary
                        break;
                    default:
                        break;
                }
                return true;
            }
        });

        //TODO: Load desktop icons from file.
    }

    /**
     * Override dispatchTouchEvent method to provide closing functionality for the start menu when a touch is detected outside of the bounds of the menu.
     *
     * @param ev The touch event.
     */
    public boolean dispatchTouchEvent(MotionEvent ev) {
        if(startMenu.isVisible()) {
            Bounds bounds = startMenu.getBounds();
            if (ev.getY() < bounds.getTop() || ev.getY() > bounds.getBottom() || ev.getX() > bounds.getRight() || ev.getX() < bounds.getLeft()) {
                //TODO: Check if click is not within start menu button.
                startMenu.hide();
            }
        }
        return super.dispatchTouchEvent(ev);
    }

    /**
     * Returns a list of all apps installed on the device as a {@link AppInfo AppInfo} list.
     * @return A list of all apps installed on the device.
     */
    public List<AppInfo> getAppsList(){
        List<AppInfo> appsList = new ArrayList<AppInfo>();
        //Populate appList with all available apps.
        Intent i = new Intent(Intent.ACTION_MAIN, null);
        i.addCategory(Intent.CATEGORY_LAUNCHER);
        PackageManager manager = context.getPackageManager();
        List<ResolveInfo> allActivities = manager.queryIntentActivities(i, 0);
        for(ResolveInfo info : allActivities){
            AppInfo app = new AppInfo(info.loadLabel(manager), info.activityInfo.packageName, info.activityInfo.loadIcon(manager));
            appsList.add(app);
        }

        return appsList;
    }
}


text:
<!DOCTYPE HTML>

        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">

        <title>Simple Calculator</title>

        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="author" content="Edson-Jacob-Mendieta">
        <meta name="description" content="A simple calculator for easy use.">
        <meta name="robots" content="all">

        <link rel="stylesheet" media="screen" href="styles.css">

÷

Simple Calculator

                <button class="circle" id="AC" type="button">AC</button>
                <button class="circle" id="CE" type="button">CE</button>
                <button class="circle" id="zero" type="button">0</button>
                <button class="circle operator" id="divideAmp" type="button">÷</button>

                <button class="circle nonZero"  type="button">1</button>
                <button class="circle nonZero"  type="button">2</button>
                <button class="circle nonZero"  type="button">3</button>
                <button class="circle operator" type="button">x</button>

                <button class="circle nonZero"  type="button">4</button>
                <button class="circle nonZero"  type="button">5</button>
                <button class="circle nonZero"  type="button">6</button>
                <button class="circle operator" type="button">-</button>

                <button class="circle nonZero"  type="button">7</button>
                <button class="circle nonZero"  type="button">8</button>
                <button class="circle nonZero"  type="button">9</button>
                <button class="circle operator" type="button">+</button>

                <button class="circle" id="dot" type="button">.</button>
                <button class="circle" id="equals" type="button">=</button>

Designed & Built by Edson Mendieta

redpajama_set_name: RedPajamaGithub


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycotaxon 72: 238 (1999)

#### Original name
Anguillospora rubescens Gulis & Marvanová

### Remarks
null


text:
var should = require('should');
var goodreads = require('../../lib/main')

describe('#client', function() {
    describe('public endpoint', function(){
        var client;
        before(function(done){
            var provider = new goodreads.provider({
                'client_key': process.env.OAUTH_GOODREADS_CLIENT_KEY || 'PLACEHOLDER_CLIENT_KEY',
                'client_secret' : process.env.OAUTH_GOODREADS_CLIENT_SECRET || 'PLACEHOLDER_CLIENT_SECRET'
            })
            provider.CreateClient()
                .then(function(_client){
                    client = _client
                })
                .then(done, done)
        })

        describe('UserGroups()', function() {
            it('should correctly respond with user groups', function(done) {

                client.UserGroups("8488829")
                    .then(function(data){
                        data.GoodreadsResponse.groups[0].list.should.be.a.List
                    })
                    .then(done, done)
            });
        });

        describe('AuthorBooks()', function() {
            it('should correctly respond with author\'s books', function(done) {
                client.AuthorBooks("4763")
                    .then(function(data){
                        data.GoodreadsResponse.author[0].name[0].should.be.eql('John Scalzi')
                    })
                    .then(done, done)
            });
        });

        describe('AuthorId()', function() {
            it('should correctly respond with author\'s info', function(done) {
                client.AuthorId("4763")
                    .then(function(data){
                        data.GoodreadsResponse.author[0].name[0].should.be.eql('John Scalzi')
                    })
                    .then(done, done)
            });
        });

        describe('BookIsbnToId()', function() {
            it('should correctly respond with book id when given ISBN', function(done) {
                client.BookIsbnToId("0765348276")
                    .then(function(data){
                        data.should.eql('51964')
                    })
                    .then(done, done)
            });
        });

        describe('BookReviewCounts()', function() {
            it('should correctly respond with book review counts', function(done) {
                client.BookReviewCounts("0765348276")
                    .then(function(data){
                        data.hash.status[0].should.be.a.String
                    })
                    .then(done, done)
            });
        });

        describe('BookShow()', function() {
            it('should correctly respond with book info', function(done) {
                client.BookShow("51964")
                    .then(function(data){
                        data.GoodreadsResponse.book[0].id[0].should.be.eql('51964')
                        data.GoodreadsResponse.book[0].title[0].should.be.eql( 'Old Man\'s War (Old Man\'s War, #1)')
                    })
                    .then(done, done)
            });
        });

        describe('ReviewsForBookByIsbn()', function() {
            it('should correctly respond with book reviews', function(done) {
                client.ReviewsForBookByIsbn("0765348276")
                    .then(function(data){
                        data.GoodreadsResponse.book[0].id[0].should.be.eql('51964')
                        data.GoodreadsResponse.book[0].title[0].should.be.eql( 'Old Man\'s War (Old Man\'s War, #1)')
                    })
                    .then(done, done)
            });
        });

        describe('SearchForBookTitleAuthor()', function() {
            it('should correctly respond with book', function(done) {
                client.SearchForBookTitleAuthor('Old Man\'s War')
                    .then(function(data){
                        data.GoodreadsResponse.book[0].id[0].should.be.eql('51964')
                        data.GoodreadsResponse.book[0].title[0].should.be.eql( 'Old Man\'s War (Old Man\'s War, #1)')
                    })
                    .then(done, done)
            });
        });

        describe('GroupMembers()', function() {
            it('should correctly respond with group members', function(done) {
                client.GroupMembers('8095')
                    .then(function(data){
                        data.GoodreadsResponse.group_users[0].group_user.should.be.a.List
                    })
                    .then(done, done)
            });
        });

        describe('GroupShow()', function() {
            it('should correctly respond with group info', function(done) {
                client.GroupShow('8095')
                    .then(function(data){
                        data.GoodreadsResponse.group[0].title[0].should.be.eql('Goodreads Developers')
                    })
                    .then(done, done)
            });
        });

        // describe('ListBook()', function() {
        //     it('should correctly respond with lists which contain book', function(done) {
        //         client.ListBook('51964')
        //             .then(function(data){
        //                 console.dir(data.GoodreadsResponse)
        //                 data.GoodreadsResponse.group[0].title[0].should.be.eql('Goodreads Developers')
        //             })
        //             .then(done, done)
        //     });
        // });

        describe('ReviewRecentReviews()', function() {
            it('should correctly respond with recent reviews', function(done) {
                client.ReviewRecentReviews()
                    .then(function(data){
                        data.GoodreadsResponse.reviews.should.be.a.List
                    })
                    .then(done, done)
            });
        });

        describe('ReviewShow()', function() {
            it('should correctly respond with recent reviews', function(done) {
                client.ReviewShow(22)
                    .then(function(data){
                        data.GoodreadsResponse.review.should.be.a.List
                    })
                    .then(done, done)
            });
        });

        describe('ReviewShowByUserAndBook()', function() {
            it('should correctly respond with recent reviews', function(done) {
                client.ReviewShowByUserAndBook(1, 50)
                    .then(function(data){
                        data.GoodreadsResponse.review.should.be.a.List
                    })
                    .then(done, done)
            });
        });

        describe('SearchGroup()', function() {
            it('should correctly respond with search results', function(done) {
                client.SearchGroup('adventure')
                    .then(function(data){
                        data.GoodreadsResponse.groups[0].list.should.be.a.List
                    })
                    .then(done, done)
            });
        });

        describe('SearchAuthorByName()', function() {
            it('should correctly respond with search results', function(done) {
                client.SearchAuthorByName('Orson Scott Card')
                    .then(function(data){
                        data.GoodreadsResponse.author[0].name[0].should.be.eql('Orson Scott Card')
                    })
                    .then(done, done)
            });
        });

        describe('SearchBooks()', function() {
            it('should correctly respond with search results', function(done) {
                client.SearchBooks('Ender\'s Game')
                    .then(function(data){
                        data.GoodreadsResponse.search[0].results.should.be.a.List
                    })
                    .then(done, done)
            });
        });

        describe('SeriesShow()', function() {
            it('should correctly respond with search results', function(done) {
                client.SeriesShow('40321-drina')
                    .then(function(data){
                        console.dir(data.GoodreadsResponse)
                        data.GoodreadsResponse.series[0].title[0].trim().should.be.eql('Drina')
                    })
                    .then(done, done)
            });
        });

        describe('SeriesShow()', function() {
            it('should correctly respond with series data', function(done) {
                client.SeriesShow('40321-drina')
                    .then(function(data){
                        data.GoodreadsResponse.series[0].title[0].trim().should.be.eql('Drina')
                    })
                    .then(done, done)
            });
        });

        describe('SeriesByAuthor()', function() {
            it('should correctly respond with series data', function(done) {
                client.SeriesByAuthor('227840')
                    .then(function(data){
                        data.GoodreadsResponse.series_works[0].series_work[0].id[0].should.be.eql('331195')
                    })
                    .then(done, done)
            });
        });

        describe('SeriesByBook()', function() {
            it('should correctly respond with series data', function(done) {
                client.SeriesByBook('118-drina-ballerina')
                    .then(function(data){
                        console.dir(data.GoodreadsResponse.series_works[0].series_work[0])
                        data.GoodreadsResponse.series_works[0].series_work[0].id[0].should.be.eql('144392')
                    })
                    .then(done, done)
            });
        });
    })

});


text:
#pragma once

#include <functional>
#include <infrastructure/meshes.h>

namespace aas {

	class AasSystem;

	class AnimatedModelFactory : public gfx::AnimatedModelFactory {
	public:
		explicit AnimatedModelFactory(std::function<std::string(int)> getSkeletonFilename,
			std::function<std::string(int)> getMeshFilename,
			std::function<void(const std::string&)> runScript,
			std::function<int(const std::string&)> resolveMaterial);
		~AnimatedModelFactory();

		gfx::AnimatedModelPtr FromIds(
			int meshId,
			int skeletonId,
			gfx::EncodedAnimId idleAnimId,
			const gfx::AnimatedModelParams& params,
			bool borrow = false) override;

		gfx::AnimatedModelPtr FromFilenames(
			const std::string& meshFilename,
			const std::string& skeletonFilename,
			gfx::EncodedAnimId idleAnimId,
			const gfx::AnimatedModelParams& params) override;

		/*
		Gets an existing animated model by its handle.
		The returned model will not free the actual animation when it is
		destroyed.
		*/
		std::unique_ptr<gfx::AnimatedModel> BorrowByHandle(uint32_t handle) override;

		void FreeAll() override;

		void FreeHandle(uint32_t handle) override;

	private:
		// This is the mapping loaded from meshes.mes
		std::unordered_map<int, std::string> fileIdMapping_;

		std::unique_ptr<AasSystem> aasSystem_;
	};

}


text:
// Copyright 2014 The Bazel Authors. All rights reserved.
//
// Licensed 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 com.google.devtools.build.lib.query2.query;

import com.google.devtools.build.lib.bugreport.BugReport;
import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.concurrent.ThreadSafety;
import com.google.devtools.build.lib.packages.Attribute;
import com.google.devtools.build.lib.packages.NoSuchThingException;
import com.google.devtools.build.lib.packages.Rule;
import com.google.devtools.build.lib.packages.Target;
import com.google.devtools.build.lib.pkgcache.TargetEdgeObserver;
import com.google.devtools.build.lib.server.FailureDetails.FailureDetail;
import com.google.devtools.build.lib.util.DetailedExitCode;
import java.util.concurrent.atomic.AtomicReference;
import javax.annotation.Nullable;

/**
 * Record errors, such as missing package/target or rules containing errors, encountered during
 * visitation. Emit an error message upon encountering missing edges
 *
 *
The accessor {@link #hasErrors}) may not be called until the concurrent phase is over, i.e.
 * all external calls to visit() methods have completed.
 *
 *
If you need to report errors to the console during visitation, use the subclass {@link
 * ErrorPrintingTargetEdgeErrorObserver}.
 */
class TargetEdgeErrorObserver implements TargetEdgeObserver {

  /**
   * True iff errors were encountered. Note, may be set to "true" during the concurrent phase.
   * Volatile, because it is assigned by worker threads and read by the main thread without monitor
   * synchronization.
   */
  private volatile boolean hasErrors = false;

  private final AtomicReference<DetailedExitCode> errorCode = new AtomicReference<>();

  /**
   * Reports an unresolved label error and records the fact that an error was encountered.
   *
   * @param target the target that referenced the unresolved label
   * @param label the label that could not be resolved
   * @param e the exception that was thrown when the label could not be resolved
   */
  @ThreadSafety.ThreadSafe
  @Override
  public void missingEdge(Target target, Label label, NoSuchThingException e) {
    hasErrors = true;
    errorCode.compareAndSet(/*expect=*/ null, /*update=*/ e.getDetailedExitCode());
  }

  /**
   * Returns true iff any errors (such as missing targets or packages, or rules with errors) have
   * been encountered during any work.
   *
   *
Not thread-safe; do not call during visitation.
   *
   * @return true iff no errors (such as missing targets or packages, or rules with errors) have
   *     been encountered during any work.
   */
  public boolean hasErrors() {
    return hasErrors;
  }

  /** Returns the first {@link DetailedExitCode} encountered, or {@code null} if there were none. */
  @Nullable
  public DetailedExitCode getDetailedExitCode() {
    return errorCode.get();
  }

  @Override
  public void edge(Target from, Attribute attribute, Target to) {
    // No-op.
  }

  @Override
  public void node(Target node) {
    if (node.getPackage().containsErrors()
        || ((node instanceof Rule) && ((Rule) node).containsErrors())) {
      this.hasErrors = true;
      FailureDetail failureDetail = node.getPackage().getFailureDetail();
      if (failureDetail != null) {
        errorCode.compareAndSet(/*expect=*/ null, /*update=*/ DetailedExitCode.of(failureDetail));
      } else {
        BugReport.sendBugReport(
            new IllegalStateException("Undetailed error from package: " + node));
      }
    }
  }
}


text:
import React from 'react'
import { Component } from 'react'
import PropTypes from 'prop-types'
import * as cmsUtils from '../../utils/cmsUtils'
import './ApiError.scss'

/**
 * A component to use to make API messages sent to the messenger look pretty and be html and stylable
 *
 * @prop message The Message for this app to provide context to the user for what action failed
 * @prop response The Axios response
 */
export default class ApiError extends Component {
    static propTypes = {
        message: PropTypes.string.isRequired,
        response: PropTypes.object.isRequired
    }

    render() {
        const {message, response} = this.props
        return (

An API error has occurred

{message}

Server Status:

{response.status}, {response.statusText}

Server Message:

{cmsUtils.parseCMSError(response)}

        )
    }
}


text:
require 'fileutils'
require 'open-uri'
require File.expand_path(File.dirname(__FILE__) + '/misc/test_support')

include FileUtils

def create_app_dir(source, startup_file, dir_name)
  app_root = "/home/app/#{dir_name}"
  rm_rf(app_root)
  mkdir(app_root)
  cp("/system/internal/test/misc/#{source}", "#{app_root}/#{startup_file}")
  mkdir("#{app_root}/public")
  mkdir("#{app_root}/tmp")
  chown_R("app", "app", app_root)
  app_root
end

def create_app_dirs
  app_dirs = []
  app_dirs << create_app_dir("ruby_test_app.rb", "config.ru", "ruby_test_app")
  app_dirs << create_app_dir("python_test_app.py", "passenger_wsgi.py", "python_test_app")
  app_dirs << create_app_dir("nodejs_test_app.js", "app.js", "nodejs_test_app")
  app_dirs
end

shared_examples_for "Hello world Ruby application" do
  it "works" do
    open("http://passenger.test/", "rb") do |io|
      expect(io.read).to eql("Hello Ruby\n")
    end
  end
end

shared_examples_for "Hello world Python application" do
  it "works" do
    open("http://1.passenger.test/", "rb") do |io|
      expect(io.read).to eql("Hello Python\n")
    end
  end
end

shared_examples_for "Hello world Node.js application" do
  it "works" do
    open("http://2.passenger.test/", "rb") do |io|
      expect(io.read).to eql("Hello Node.js\n")
    end
  end
end

describe "The system's Apache with Passenger enabled" do
  before :all do
    @app_dirs = create_app_dirs
    cp("/system/internal/test/apache/vhost.conf", "/etc/apache2/sites-enabled/001-testapp.conf")
    chmod(0644, "/etc/apache2/sites-enabled/001-testapp.conf")
    sh("service apache2 start")
    eventually do
      ping_tcp_socket("127.0.0.1", 80)
    end
  end

  after :all do
    sh("service apache2 stop")
    eventually do
      !ping_tcp_socket("127.0.0.1", 80)
    end
    @app_dirs.each do |path|
      rm_rf(path)
    end
    rm("/etc/apache2/sites-enabled/001-testapp.conf")
  end

  before :each do
    sh("passenger-config restart-app / --ignore-app-not-running")
  end

  describe "Ruby support" do
    include_examples "Hello world Ruby application"
  end

  describe "Python support" do
    include_examples "Hello world Python application"
  end

  describe "Node.js support" do
    include_examples "Hello world Node.js application"
  end
end

describe "The system's Nginx with Passenger enabled" do
  before :all do
    @app_dirs = create_app_dirs
    cp("/system/internal/test/nginx/vhost.conf", "/etc/nginx/sites-enabled/001-testapp.conf")
    chmod(0644, "/etc/nginx/sites-enabled/001-testapp.conf")
    sh("sed -i 's/# passenger_root/passenger_root/' /etc/nginx/nginx.conf")
    sh("sed -i 's/# passenger_ruby/passenger_ruby/' /etc/nginx/nginx.conf")
    sh("service nginx start")
    eventually do
      ping_tcp_socket("127.0.0.1", 80)
    end
  end

  after :all do
    sh("service nginx stop")
    eventually do
      !ping_tcp_socket("127.0.0.1", 80)
    end
    @app_dirs.each do |path|
      rm_rf(path)
    end
    rm("/etc/nginx/sites-enabled/001-testapp.conf")
    sh("sed -i 's/\tpassenger_root/\t# passenger_root/' /etc/nginx/nginx.conf")
    sh("sed -i 's/\tpassenger_ruby/\t# passenger_ruby/' /etc/nginx/nginx.conf")
  end

  describe "Ruby support" do
    include_examples "Hello world Ruby application"
  end

  describe "Python support" do
    include_examples "Hello world Python application"
  end

  describe "Node.js support" do
    include_examples "Hello world Node.js application"
  end
end


text:
import random
from goldminer import texts
from goldminer.stat import Stat

class Fighter:
    def __init__(self, owner):
        self.owner = owner
        self.hp = Stat("Health:", 10)
        self.water = Stat("Hydration:", 10)
        self.food = Stat("Feeding:", 10)
        self.fatigue = Stat("Fatigue:", 10)
        self.damage = 1

        self.last_complain = random.randint(0, 25)

    def heal(self, amount):
        self.hp.value += amount
        if self.hp.value < 0:
            self.hp.value = 0

    def take_damage(self, amount):
        self.hp.value -= amount
        if self.hp.value <= 0:
            self.owner.dead = True

    def waste(self, amount=1):
        self.fatigue.value -= amount / 100
        self.water.value -= amount / 1000
        self.food.value -= amount / 10000

        if self.fatigue.value <= 0:
            self.owner.think(texts.im_losing_consciousness)
            self.owner.resting = True
            return

        if self.fatigue.value < 4:
            self.owner.think(texts.im_tired, 0.015)

        if self.water.value < 4:
            self.owner.think(texts.im_thirsty, 0.015)

        if self.food.value < 2:
            self.owner.think(texts.im_hungry, 0.005)

    def restore(self, amount=1):
        self.fatigue.value += amount / 10
        if self.fatigue.value > .25 and random.random() <= 0.01 + self.fatigue.value:
            self.owner.resting = False
            self.owner.think(texts.im_wake_up)

    def attack(self, other):
        if other.defense < self.damage:
            other.take_damage(self.damage)
        self.waste()


text:
$(document).ready(function() {
    $('.check-suppress-alert').enableLabelCheck({
        checkedClass: 'bell-slash-o',
        uncheckedClass: 'bell',
        onClick: function(self) {
            $.post('/set_alarm/' + self.data('ntype'), {
                host: self.data('host'),
                port: self.data('port'),
                suppress: self.prop('checked') ? '1' : '0'
            });
        }
    });
    $('.delete-proxy-btn').click(function() {
        var btn = $(this);
        btn.attr('disabled', 'disabled').text(_('Please wait'));
        $.ajax({
            url: '/cluster/delete_proxy',
            type: 'POST',
            data: {
                host: btn.data('host'),
                port: btn.data('port')
            },
            success: function() {
                btn.text(_('Proxy unregistered'));
            },
            error: function(e) {
                btn.text(_('failed') + ': ' + e.responseText);
            }
        });
    })

    $('.panel-heading-hide-content').click(function() {
       $(this).next().slideToggle();
    });
});

window.TRANSLATIONS = window.TRANSLATIONS || {};
window._ = function(text) {
    return window.TRANSLATIONS[text] || text;
};


text:
To test: * Install tz.cpp by downloading the IANA timezone database
at: http://www.iana.org/time-zones You only need the data, not the
code.

* Change the string `install` in tz.cpp to point to your downloaded
IANA database.

* Compile validate.cpp along with tz.cpp.

* Run the binary and direct the terminal output to a temporary file.

* Unzip the tzdata file that has the version corresponding to the IANA
database you downloaded (e.g. tzdata2015f.txt.zip).

* Compare the unzipped txt file with the output of your validate test
program. If they are identical, the test passes, else it fails.

Miscellaneous:

You can also compare one version of the tzdatabase with another using
these uncompressed text files.  The text files contain for each
timezone its initial state, and each {offset, abbreviation} change
contained in the database up through the year 2035.  As the database
versions change, minor updates to the set of these transitions are
typically made, typically due to changes in government policies.

The tests in this section will run much faster with optimizations
cranked up.


text:
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>

#include "mast.h"

#define SYNC_TO_DISC_PERIOD  (10)

// Globals
const char * ifname = NULL;
const char* filename = "recording-%Y%m%d-%H%M%S.wav";
mast_sdp_t sdp;

static void usage()
{
    fprintf(stderr, "MAST Recorder version %s\n\n", PACKAGE_VERSION);
    fprintf(stderr, "Usage: mast-recorder [options] [<file.sdp>]\n");
    fprintf(stderr, "   -o <filename>  Output file name (default %s)\n", filename);
    fprintf(stderr, "   -a <address>   IP Address\n");
    fprintf(stderr, "   -i <iface>     Interface Name to listen on\n");
    fprintf(stderr, "   -p <port>      Port Number (default %s)\n", MAST_DEFAULT_PORT);
    fprintf(stderr, "   -r <rate>      Sample Rate (default %d)\n", MAST_DEFAULT_SAMPLE_RATE);
    fprintf(stderr, "   -e <encoding>  Encoding (default %s)\n", mast_encoding_name(MAST_DEFAULT_ENCODING));
    fprintf(stderr, "   -c <channels>  Channel Count (default %d)\n", MAST_DEFAULT_CHANNEL_COUNT);
    fprintf(stderr, "   -v             Verbose Logging\n");
    fprintf(stderr, "   -q             Quiet Logging\n");

    exit(EXIT_FAILURE);
}

static void parse_opts(int argc, char **argv)
{
    int ch;

    // Parse the options/switches
    while ((ch = getopt(argc, argv, "o:a:p:i:r:f:c:vq?h")) != -1) {
        switch (ch) {
        case 'o':
            filename = optarg;
            break;
        case 'a':
            mast_sdp_set_address(&sdp, optarg);
            break;
        case 'p':
            mast_sdp_set_port(&sdp, optarg);
            break;
        case 'i':
            ifname = optarg;
            break;
        case 'r':
            sdp.sample_rate = atoi(optarg);
            break;
        case 'f':
            sdp.encoding = mast_encoding_lookup(optarg);
            if (sdp.encoding < 0) mast_error("Invalid encoding format: %s", optarg);
            break;
        case 'c':
            sdp.channel_count = atoi(optarg);
            break;
        case 'v':
            verbose = TRUE;
            break;
        case 'q':
            quiet = TRUE;
            break;
        case '?':
        case 'h':
        default:
            usage();
        }
    }

    // Check remaining arguments
    argc -= optind;
    argv += optind;
    if (argc == 1) {
        mast_sdp_parse_file(argv[0], &sdp);
    } else if (argc > 1) {
        usage();
    }

    // Validate parameters
    if (quiet && verbose) {
        mast_error("Can't be quiet and verbose at the same time.");
        usage();
    }

    if (strlen(sdp.address) < 1) {
        mast_error("No address specified");
        usage();
    }
}

static int sync_sndfile(SNDFILE *sndfile)
{
    // Write the header to file, so other processes can read it
    sf_command(sndfile, SFC_UPDATE_HEADER_NOW, NULL, 0);

    // Force sync to disk
    sf_write_sync(sndfile);

    return 0;
}

int main(int argc, char *argv[])
{
    SNDFILE * file = NULL;
    unsigned int time = 0;
    mast_socket_t sock;
    int result;

    mast_sdp_set_defaults(&sdp);
    parse_opts(argc, argv);
    setup_signal_hander();

    mast_info(
        "Recording: %s [%s/%d/%d]",
        sdp.session_name,
        mast_encoding_name(sdp.encoding), sdp.sample_rate, sdp.channel_count
    );

    result = mast_socket_open_recv(&sock, sdp.address, sdp.port, ifname);
    if (result) {
        return EXIT_FAILURE;
    }

    while(running) {
        mast_rtp_packet_t packet;

        int result = mast_rtp_recv(&sock, &packet);
        if (result < 0) break;

        // Is the Payload Type what we were expecting?
        if (sdp.payload_type == -1) {
            mast_info("Payload type of first packet: %d", packet.payload_type);
            mast_sdp_set_payload_type(&sdp, packet.payload_type);
        } else if (sdp.payload_type != packet.payload_type) {
            mast_warn("Received unexpected Payload Type: %d", packet.payload_type);
        }

        mast_debug("RTP packet ts=%lu seq=%u", packet.timestamp, packet.sequence);

        if (!file) {
            file = mast_writer_open(filename, &sdp);
        }

        if (file) {
            mast_writer_write(file, packet.payload, packet.payload_length);
        } else {
            mast_error("Failed to open output file");
        }

        time += mast_rtp_packet_duration(&packet, &sdp);
        if (time > (SYNC_TO_DISC_PERIOD * 1000000)) {
            mast_debug("Syncing file to disc");
            sync_sndfile(file);
            time = 0;
        }
    }

    if (file) {
        sf_close(file);
    }

    mast_socket_close(&sock);

    return exit_code;
}


text:
This repository contains the materials used by Geert Barentsen
to give a trial talk at the Athenaeum house in Atherton, California,
on Friday May 19th, 2017, titled "How to find a planet?".

The talk consisted of both a slide deck and a Jupyter notebook.
It aimed explain how one may go about finding a planet
in the original Kepler pixel data, using nothing more than a
handful lines of Python code.

The audience consisted of engineers with strong computing skills
but without (professional) astronomy experience.
This is an audience I would like to target in the future
for the sake of recruiting more talent into astronomy!


text:
<?php if (!defined('APPLICATION')) {
    exit();
      }

// DO NOT EDIT THIS FILE
// All of the settings defined here can be overridden in the /conf/*.php files.

$Configuration['Garden']['Profile']['EditUsernames'] = false;
$Configuration['Garden']['Activities']['PerPage'] = 30;


text:
title: How to Include Multiple Fields in the RadDropDownList's DisplayMember
description: Learn how to include multiple fields in the DislayMember for the WinForms DropDownList.
type: how-to
page_title: How to Include Multiple Fields in the RadDropDownList's DisplayMember
slug: multiple-display-members-in-dropdownlist
position: 39
tags: dropdown, combobox, displaymember, datasource
res_type: kb
---

## Environment

|Product Version|Product|Author|
|----|----|----|
|2022.2.622|RadDropDownList for WinForms|[Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova)|

## Description

When using [data binding]({%slug winforms/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/populating-with-data/data-binding%}) for populating **RadDropDownList** with data, note that the **DisplayMember** property allows you to specify the particular field in the data source which will be used by the items in RadDropDownList for their Text. However, it is possible to specify only a single field.

````C#

DataTable dt = new DataTable();
dt.Columns.Add("Id", typeof(int));
dt.Columns.Add("FirstName", typeof(string));
dt.Columns.Add("LastName", typeof(string));

dt.Rows.Add(1, "Thomas", "Hardy");
dt.Rows.Add(2, "John", "Brown");
dt.Rows.Add(3, "Anna", "Smith");

this.radDropDownList1.DisplayMember = "LastName";
this.radDropDownList1.ValueMember = "Id";
this.radDropDownList1.DataSource = dt;

````
````VB.NET

Dim dt As DataTable = New DataTable()
dt.Columns.Add("Id", GetType(Integer))
dt.Columns.Add("FirstName", GetType(String))
dt.Columns.Add("LastName", GetType(String))
dt.Rows.Add(1, "Thomas", "Hardy")
dt.Rows.Add(2, "John", "Brown")
dt.Rows.Add(3, "Anna", "Smith")
Me.RadDropDownList1.DisplayMember = "LastName"
Me.RadDropDownList1.ValueMember = "Id"
Me.RadDropDownList1.DataSource = dt

````

>caption Default DisplayMember

![multiple-display-members-in-dropdownlist 001](images/multiple-display-members-in-dropdownlist001.png)

A common requirement is to include more than one property in the **DisplayMember**, e.g. "FirstName" + "LastName". This article shows a sample approach how to do it.

## Solution

1\. Subscribe to the RadDropDownList.**VisualListItemFormatting** event and set the VisualItem.**Text** to the desired combined text extracted from the **DataBoundItem**.

````C#

private void radDropDownList1_VisualListItemFormatting(object sender, VisualItemFormattingEventArgs args)
{
    DataRowView row = args.VisualItem.Data.DataBoundItem as DataRowView;
    args.VisualItem.Text = row["FirstName"] + " " + row["LastName"];
}

````
````VB.NET

Private Sub radDropDownList1_VisualListItemFormatting(ByVal sender As Object, ByVal args As VisualItemFormattingEventArgs)
    Dim row As DataRowView = TryCast(args.VisualItem.Data.DataBoundItem, DataRowView)
    args.VisualItem.Text = row("FirstName") & " " & row("LastName")
End Sub

````

Thus, the popup items will show the complete name. But the editable part still will show only the field specified as DisplayMember:

>caption Combined Text in the DropDown Items

![multiple-display-members-in-dropdownlist 002](images/multiple-display-members-in-dropdownlist002.png)

2\. Create a field in the data source collection that combines multiple fields (e.g. "FirstName" + "LastName"). Then, set that combined field as DisplayMember.

````C#

DataTable dt = new DataTable();
dt.Columns.Add("Id", typeof(int));
dt.Columns.Add("FirstName", typeof(string));
dt.Columns.Add("LastName", typeof(string));
dt.Columns.Add("FullName", typeof(string));

dt.Rows.Add(1, "Thomas", "Hardy");
dt.Rows.Add(2, "John", "Brown");
dt.Rows.Add(3, "Anna", "Smith");

foreach (DataRow row in dt.Rows)
{
    row["FullName"]= row["FirstName"]+" "+row["LastName"];
}

this.radDropDownList1.DisplayMember = "FullName";
this.radDropDownList1.ValueMember = "Id";
this.radDropDownList1.DataSource = dt;

````
````VB.NET

Dim dt As DataTable = New DataTable()
dt.Columns.Add("Id", GetType(Integer))
dt.Columns.Add("FirstName", GetType(String))
dt.Columns.Add("LastName", GetType(String))
dt.Columns.Add("FullName", GetType(String))
dt.Rows.Add(1, "Thomas", "Hardy")
dt.Rows.Add(2, "John", "Brown")
dt.Rows.Add(3, "Anna", "Smith")

For Each row As DataRow In dt.Rows
    row("FullName") = row("FirstName") & " " & row("LastName")
Next

Me.RadDropDownList1.DisplayMember = "FullName"
Me.RadDropDownList1.ValueMember = "Id"
Me.RadDropDownList1.DataSource = dt

````

Thus, the editable part will also show the full name:

![multiple-display-members-in-dropdownlist 003](images/multiple-display-members-in-dropdownlist003.png)

# See Also

* [Data Binding]({%slug winforms/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/populating-with-data/data-binding%})


text:
#include <mrpt/hwdrivers.h>  // Only for precomp. headers, include all libmrpt-core headers.

#include <mrpt/hwdrivers/CStereoGrabber_SVS.h>

// Universal include for all versions of OpenCV
#include <mrpt/otherlibs/do_opencv_includes.h>

#if MRPT_HAS_SVS
#	include <svsclass.h>
#	include <dcs.h>
#endif

using namespace std;
using namespace mrpt;
using namespace mrpt::slam;
using namespace mrpt::hwdrivers;

/*-------------------------------------------------------------
					Constructor
 -------------------------------------------------------------*/
CStereoGrabber_SVS::CStereoGrabber_SVS( int cameraIndex, const TCaptureOptions_SVS &options ) :
        m_bInitialized(false),
        m_videoObject(NULL),
        m_stereoImage(NULL),
        m_disparityParams(NULL),
        m_resolutionX( options.frame_width ),
        m_resolutionY( options.frame_height ),
        m_procesOnChip(options.m_procesOnChip),
        m_calDisparity(options.m_calDisparity),
        m_options( options )
{
#if MRPT_HAS_SVS

    // get the svsVideoImages object from the currently loaded camera interface
    m_videoObject =static_cast<svsVideoImages*>( getVideoObject());
    cout<<"Using live images:"<<endl;
    cout<<"svsVideoIdent"<<endl;

    // Open the stereo device
    bool ret;
    ret = static_cast<svsVideoImages*>(m_videoObject)->Open();
    if (ret)
    {
        cout<<" stereo device Opened"<<endl;

        static_cast<svsVideoImages*>(m_videoObject)->SetSize(m_resolutionX,m_resolutionY); // width x height image

        m_disparityParams = static_cast<svsVideoImages*>(m_videoObject)->GetDP();
        static_cast<svsVideoImages*>(m_videoObject)->SetNDisp(m_options.m_NDisp);	// 32 disparities
        static_cast<svsVideoImages*>(m_videoObject)->SetCorrsize(m_options.m_Corrsize); // correlation window size
        static_cast<svsVideoImages*>(m_videoObject)->SetLR(m_options.m_LR);	// no left-right check, not available
        static_cast<svsVideoImages*>(m_videoObject)->SetThresh(m_options.m_Thresh);	// texture filter
        static_cast<svsVideoImages*>(m_videoObject)->SetUnique(m_options.m_Unique);	// uniqueness filter
        static_cast<svsVideoImages*>(m_videoObject)->SetHoropter(m_options.m_Horopter);	// horopter offset

        if(!(static_cast<svsVideoImages*>(m_videoObject)->SetExposure(0,0,true,true)))
        {
            cout<<"Can't set Auto exposure"<<endl;
        }else
        {
            cout<<"Autoexposure set to 0 0"<<endl;
        }

        /*	videoObject->SetBrightness(true, 0);
           videoObject->SetAutoExpParams(0.0, -2.0);
       */
        ///videoObject->SetGamma(); search for auto gamma ?

        static_cast<svsVideoImages*>(m_videoObject)->SetRate(m_options.framerate);
        static_cast<svsVideoImages*>(m_videoObject)->SetSpeckleSize(m_options.m_SpeckleSize); //TODO add in config

        //TODO call CheckParam
        if(static_cast<svsVideoImages*>(m_videoObject)->CheckParams())
        {
            cout<<"Params OK !"<<endl;
            m_initialized =true;
            m_status = true;
            bool ret = static_cast<svsVideoImages*>(m_videoObject)->Start();
            if (ret){

                cout<<" Start Continuous mode"<<endl;

                // NOTE: to do rectification, we have to turn it on...
                // Here we optionally set up acquisition to rectify the image

                ret = static_cast<svsVideoImages*>(m_videoObject)->SetRect(true);
                if (ret){
                    cout<<"Images will be rectified"<<endl;
                }else{
                    cout<<"Can't set rectification"<<endl;
                }
                if(m_procesOnChip)
                {
                    // NOTE: for STOC device, turn on stereo processing on-chip
                    if (static_cast<svsVideoImages*>(m_videoObject) && static_cast<svsVideoImages*>(m_videoObject)->is_proc_capable) // can we process on-camera?
                    {
                        static_cast<svsVideoImages*>(m_videoObject)->SetProcMode(PROC_MODE_DISPARITY);
                        cout<<"Setting STOC disparity mode"<<endl;
                    }
                }
                else
                {
                    if (m_processObject) m_processObject = new svsStereoProcess();
                    // NOTE: for STOC device, turn off stereo processing on-chip
                    if (static_cast<svsVideoImages*>(m_videoObject) && static_cast<svsVideoImages*>(m_videoObject)->is_proc_capable) // can we process on-camera?
                    {
                        static_cast<svsVideoImages*>(m_videoObject)->SetProcMode(PROC_MODE_OFF);
                        cout<<"Setting STOC stereo mode"<<endl;
                    }
                }
            }
            else
            {
                cout<<"Can't start continuous capture"<<endl;
                m_status = false;

            }

        }
        else
        {
            m_initialized =false;
            m_status = false;
            cout<<"Params Unconsistents !"<<endl;
        }

    }
    else

        //TODO essayer de faire un close...
        cout<<"Can't open stereo device"<<endl;

    m_status = false;

#else
	THROW_EXCEPTION("This class requires MRPT built with Videre SVS library.")
#endif
}

/*-------------------------------------------------------------
					Destructor
 -------------------------------------------------------------*/
CStereoGrabber_SVS::~CStereoGrabber_SVS()
{
#if MRPT_HAS_SVS
    static_cast<svsVideoImages*>(m_videoObject)->Close();
#endif // No need to raise an exception on "#else" since it's already raised upon construction.
}

/*-------------------------------------------------------------
					get the image
 -------------------------------------------------------------*/
bool  CStereoGrabber_SVS::getStereoObservation( mrpt::slam::CObservationStereoImages &out_observation )
{
#if MRPT_HAS_SVS
    if ( (m_stereoImage = static_cast<svsVideoImages*>(m_videoObject)->GetImage(500)) &&  static_cast<svsStereoImage*>(m_stereoImage)->haveImages ) // 500 ms timeout //TODO adjust timeout with framerate
    {

                //get disparity params
                m_disparityParams = static_cast<svsVideoImages*>(m_videoObject)->GetDP();

                const size_t sizeOfMat = m_resolutionX * m_resolutionY;

                IplImage* ImageLeft =  cvCreateImageHeader(cvSize(m_resolutionX,m_resolutionY),IPL_DEPTH_8U,1);

                ImageLeft->widthStep=ImageLeft->width; // JL: The next line assumes this
                ImageLeft->imageData =(char*) static_cast<svsStereoImage*>(m_stereoImage)->Left();

                if(m_procesOnChip)
                {
                    IplImage* ImageDisparity = cvCreateImage(cvSize(m_resolutionX,m_resolutionY),IPL_DEPTH_8U,1);

                    unsigned char *ptrOutDisp;
                    short int *ptrDisp;

                    ptrDisp = static_cast<svsStereoImage*>(m_stereoImage)->Disparity();
                    ptrOutDisp = (unsigned char*) ImageDisparity->imageData;

                    ASSERT_(ImageDisparity->widthStep==ImageDisparity->width);  // JL: The code below assumes image_width == widthStep

                    for(int pix = 0;pix<sizeOfMat;pix++,ptrOutDisp++,ptrDisp++ )
                    {
                        if(*(ptrDisp)>0)
                        *(ptrOutDisp) =  (unsigned char)((*(ptrDisp)>>2)&0x00FF);
                        else
                            *(ptrOutDisp) = 0;
                    }

                    // Create the object to be return (it will have a fresh timestamp if it's created now and here):
                    CObservationStereoImages ret_obj(
                                            cvCloneImage( ImageLeft ),  // Create a new IplImage* which will be owned by the observation object.
                                            NULL /*has no right*/,
                                            ImageDisparity,
                                            true /* own the memory, so we don't have to free it here */);

                    out_observation.swap(ret_obj); // Send as output (faster than a "=").
                }
                else if (m_calDisparity)
                {
                    static_cast<svsStereoProcess*>(m_processObject)->CalcStereo(static_cast<svsStereoImage*>(m_stereoImage));
                    IplImage* ImageDisparity = cvCreateImage(cvSize(m_resolutionX,m_resolutionY),IPL_DEPTH_8U,1);

                    unsigned char *ptrOutDisp;
                    short int *ptrDisp;

                    ptrDisp = static_cast<svsStereoImage*>(m_stereoImage)->Disparity();
                    ptrOutDisp = (unsigned char*) ImageDisparity->imageData;

                    ASSERT_(ImageDisparity->widthStep==ImageDisparity->width);  // JL: The code below assumes image_width == widthStep

                    for(int pix = 0;pix<sizeOfMat;pix++,ptrOutDisp++,ptrDisp++ )
                    {
                        if(*(ptrDisp)>0)
                        *(ptrOutDisp) =  (unsigned char)((*(ptrDisp)>>2)&0x00FF);
                        else
                            *(ptrOutDisp) = 0;
                    }

                    // Create the object to be return (it will have a fresh timestamp if it's created now and here):
                    CObservationStereoImages ret_obj(
                                            cvCloneImage( ImageLeft ),  // Create a new IplImage* which will be owned by the observation object.
                                            NULL /*has no right*/,
                                            ImageDisparity,
                                            true /* own the memory, so we don't have to free it here */);

                    out_observation.swap(ret_obj); // Send as output (faster than a "=").

                }
                else
                {

                    IplImage* ImageRight =  cvCreateImageHeader(cvSize(m_resolutionX,m_resolutionY),IPL_DEPTH_8U,1);
                    ImageRight->widthStep=ImageRight->width; // JL: The next line assumes this
                    ImageRight->imageData =(char*) static_cast<svsStereoImage*>(m_stereoImage)->Right();

                    // Create the object to be return (it will have a fresh timestamp if it's created now and here):
                    CObservationStereoImages ret_obj(
                                            cvCloneImage( ImageLeft ),  // Create a new IplImage* which will be owned by the observation object.
                                            cvCloneImage( ImageRight ),
                                            NULL /*has no disparity*/,
                                            true /* own the memory, so we don't have to free it here */);

                    out_observation.swap(ret_obj); // Send as output (faster than a "=").

                }

                // cvReleaseImage(&Image Disparity); // No need anymore to release images...
    return true;
    }

    return false;
     // All ok
#else
	// No need to raise an exception on "#else" since it's already raised upon construction.
	return false;	// This shouldn't actually be never reached, just to please the compiler.
#endif
}

/*-------------------------------------------------------------
                        TCaptureOptions_bumblebee Constructor
 -------------------------------------------------------------*/
TCaptureOptions_SVS::TCaptureOptions_SVS(int _frame_width, int _frame_height , double _framerate, int _NDisp,
                                         int _Corrsize, int _LR , int _Thresh, int _Unique, int _Horopter,int _SpeckleSize,bool _procesOnChip,bool _calDisparity)
{
    frame_width     = _frame_width;
    frame_height    = _frame_height;
    framerate       = _framerate;
    m_NDisp         = _NDisp;	// 32 disparities
    m_Corrsize      =_Corrsize; // correlation window size
    m_LR            =_LR;// no left-right check, not available
    m_Thresh        =_Thresh;	// texture filter
    m_Unique        =_Unique;	// uniqueness filter
    m_Horopter      =_Horopter;
    m_SpeckleSize   =_SpeckleSize;
    m_procesOnChip  =_procesOnChip;
    m_calDisparity  =_calDisparity;

}


text:
<?php

namespace App\Form\Type;

use App\Entity\StaticPage;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class StaticPageType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('title', TextType::class)
            ->add('slug', TextType::class)
            ->add('enabled', CheckboxType::class)
            ->add('orderNum', IntegerType::class)
            ->add('metaKeys', TextType::class)
            ->add('metaDescription', TextType::class)
            ->add('content', TextareaType::class);
    }

    /**
     * @param OptionsResolver $resolver
     */
    public function configureOptions(OptionsResolver $resolver): void
    {
        $resolver->setDefaults(['data_class' => StaticPage::class]);
    }

    /**
     * @return string
     */
    public function getBlockPrefix(): string
    {
        return 'eshop_shopbundle_staticpage';
    }
}


text:
package org.isisaddons.wicket.wizard.fixture.scripts.todo;

public class RecreateToDoItemsAndCompleteSeveralForCurrent extends ToDoItemsRecreateAndCompleteSeveral {

    public RecreateToDoItemsAndCompleteSeveralForCurrent() {
        super(null);
        withDiscoverability(Discoverability.DISCOVERABLE);
    }

}


text:
import React from 'react';
import ReactDOM from 'react-dom';

// var React = require('react');
// var ReactDOM = require('react-dom');

export default class App extends React.Component {
    render() {
        return (

App Class

        );
    }
}


text:
/*
 * \file spg-solve.c
 *
 *  Created on: 23 Jan 2012
 *      Author: kant
 */
#include <limits.h>
#if HAVE_PROFILER
#include <gperftools/profiler.h>
#endif
#include <assert.h>

#include <hre/config.h>
#include <hre/user.h>
#include <bignum/bignum.h>
#include <util-lib/dfs-stack.h>
#include <util-lib/treedbs.h>
#include <util-lib/util.h>
#include <spg-lib/spg-solve.h>

static void report_game(const parity_game* g, const spg_attr_options* options, int indent)
{
    if (log_active(infoLong))
    {
        RTstopTimer(options->timer);
        long   total_count;
        double e_count;
        long   n_count;
        vset_count(g->v, &n_count, &e_count);
        total_count = n_count;
        Print(infoLong, "[%7.3f] " "%*s" "parity_game: g->v has %.*g elements (%ld nodes)",
              RTrealTime(options->timer), indent, "", DBL_DIG, e_count, n_count);
        //Print(infoLong, "parity_game: min_priority = %d, max_priority = %d", g->min_priority, g->max_priority);
        for(int i=g->min_priority; i<= g->max_priority; i++)
        {
            vset_count(g->v_priority[i], &n_count, &e_count);
            total_count += n_count;
            Print(infoLong, "[%7.3f] " "%*s" "parity_game: g->v_priority[%d] has %.*g elements (%ld nodes)",
                  RTrealTime(options->timer), indent, "", i, DBL_DIG, e_count, n_count);
        }
        for(int i=0; i < 2; i++)
        {
            vset_count(g->v_player[i], &n_count, &e_count);
            total_count += n_count;
            Print(infoLong, "[%7.3f] " "%*s" "parity_game: g->v_player[%d] has %.*g elements (%ld nodes)",
                  RTrealTime(options->timer), indent, "", i, DBL_DIG, e_count, n_count);
        }
        Print(infoLong, "[%7.3f] " "%*s" "parity_game: %ld nodes total",
              RTrealTime(options->timer), indent, "", total_count);
        RTstartTimer(options->timer);
    }
}

/**
 * \brief Determines if player 0 is the winner of the game.
 */
bool spg_solve(parity_game* g, recursive_result* result, spgsolver_options* options)
{
    //test_vset_restrict();
    spgsolver_options* opts;
    if (options==NULL || options==0) {
        opts = spg_get_solver_options();
    } else {
        opts = options;
    }
    int src[g->state_length];
    for(int i=0; i<g->state_length; i++)
    {
        src[i] = g->src[i];
    }
#if HAVE_PROFILER
    //Print(infoLong, "Start profiling now.");
    //ProfilerStart("spgsolver.perf");
#endif
    RTstartTimer(opts->attr_options->timer);
    *result = spg_solve_recursive(g, opts, 0);  // Note: g will be destroyed
    RTstopTimer(opts->attr_options->timer);
#if HAVE_PROFILER
    //ProfilerStop();
    //Print(infoLong, "Done profiling.");
#endif

    bool player_wins = vset_member(result->win[options->player], src);
    return player_wins;
}

/**
 * \brief Recursively computes the winning sets for both players.
 * As a side-effect destroys the game g.
 */
recursive_result spg_solve_recursive(parity_game* g,  const spgsolver_options* options, int depth)
{
    // Output game information
    int indent = 2 * depth;
    RTstopTimer(options->attr_options->timer);
    if (log_active(infoLong))
    {
        long   n_count;
        VSET_COUNT_NODES(g->v, n_count)
        Print(infoLong, "[%7.3f] " "%*s" "solve_recursive: game has %ld nodes",
              RTrealTime(options->attr_options->timer), indent, "", n_count);
        report_game(g, options->attr_options, indent);
    }
    else
    {
        Print(info, "[%7.3f] " "%*s" "solve_recursive",
              RTrealTime(options->attr_options->timer), indent, "");
    }
    RTstartTimer(options->attr_options->timer);

    SPG_OUTPUT_DOT(options->attr_options->dot,g->v,"spg_set_%05zu_v.dot",options->attr_options->dot_count++)

    recursive_result result = recursive_result_create(g->domain);

    // Check if game is empty
    if (vset_is_empty(g->v)) {
        RTstopTimer(options->attr_options->timer);
        Print(info, "[%7.3f] " "%*s" "solve_recursive: game is empty.", RTrealTime(options->attr_options->timer), indent, "");
        RTstartTimer(options->attr_options->timer);
        return result;
    }

    // Find deadlock states, determine least priority and player
    int player;
    vset_t u = vset_create(g->domain, -1, NULL);
    {
        bool have_deadlock_states[2];
        vset_t deadlock_states[2];
        for (int p=0; p<2; p++)
        {
            have_deadlock_states[p] = false;
            deadlock_states[p] = vset_create(g->domain, -1, NULL);
            vset_copy(deadlock_states[p], g->v_player[p]);
        }
        {
            vset_t t = vset_create(g->domain, -1, NULL);
            for(int group=0; group<g->num_groups; group++) {
                vset_clear(t);
                vset_prev(t, g->v, g->e[group], g->v);
                for(int p=0; p<2; p++)
                {
                    vset_minus(deadlock_states[p], t);
                }
            }
            vset_destroy(t);
        }
        for(int p=0; p<2; p++)
        {
            if (!vset_is_empty(deadlock_states[p]))
            {
                SPG_REPORT_DEADLOCK_STATES(options->attr_options, indent, p);
                have_deadlock_states[p] = true;
            }
        }

        // compute U <- {v \in V | p(v) = m}
        int m = g->min_priority;
        vset_copy(u, g->v_priority[m]);
        while (vset_is_empty(u)) {
            m++;
            if (m > g->max_priority) {
                Abort("no min priority found!");
            }
            vset_clear(u);
            vset_copy(u, g->v_priority[m]);
        }
        if (m > 0 && have_deadlock_states[1]) // deadlock states of player 1 (and) result in true: nu X0 = X0
        {
            m = 0;
        }
        else if (m > 1 && have_deadlock_states[0]) // deadlock states of player 0 (or) result in false: mu X1 = X1
        {
            m = 1;
        }

        player = m % 2;

        RTstopTimer(options->attr_options->timer);
        Print(info, "[%7.3f] " "%*s" "solve_recursive: min=%d, max=%d, m=%d, player=%d",
              RTrealTime(options->attr_options->timer), indent, "", g->min_priority, g->max_priority, m, player);
        RTstartTimer(options->attr_options->timer);

        // Add deadlock states
        if (m < 2)
        {
            RTstopTimer(options->attr_options->timer);
            Print(infoLong, "[%7.3f] " "%*s" "solve_recursive: adding deadlock states (m=%d).",
                  RTrealTime(options->attr_options->timer), indent, "", m);
            RTstartTimer(options->attr_options->timer);
            if (m >= g->min_priority)
            {
                vset_copy(u, g->v_priority[m]);
            }
            vset_union(u, deadlock_states[1-player]);
        }
        for(int p=0; p<2; p++)
        {
            vset_destroy(deadlock_states[p]);
        }
        SPG_REPORT_MIN_PRIORITY(options->attr_options, indent, m, u);
    }

    // First attractor computating (for player)
    // U = attr_player(G, U)
    options->attr(player, g, &result, u, options->attr_options, depth);

    recursive_result x;
    {
        parity_game* g_minus_u = spg_copy(g);

        spg_game_restrict(g_minus_u, u, options);

        // First recursion step
        x = spg_solve_recursive(g_minus_u, options, depth+1);
        //spg_destroy(g_minus_u); // has already been destroyed in spg_solve_recursive
    }

    if (vset_is_empty(x.win[1-player])) {
        RTstopTimer(options->attr_options->timer);
        Print(info, "[%7.3f] " "%*s" "solve_recursive: x.win[%d] empty.", RTrealTime(options->attr_options->timer), indent, "", 1-player);
        RTstartTimer(options->attr_options->timer);

        // U := U \/ X[player]
        vset_union(u, x.win[player]);
        vset_destroy(x.win[player]);
        vset_destroy(x.win[1-player]);

        // sigma[player] := alpha ++ ksi[player]
        // sigma[1-player] := [] (because ksi[1-player] is empty)
        if (options->attr_options->compute_strategy) {
            concat_strategy_levels(g->domain, result.strategy_levels, result.strategy_levels_count, result.strategy_boundaries, result.strategy_boundary_count,
                                           x.strategy_levels, x.strategy_levels_count, x.strategy_boundaries, x.strategy_boundary_count);
        }
        recursive_result_destroy(x);
        // W[player] := U
        vset_copy(result.win[player], u);
        vset_destroy(u);
        // W[1-player] := emptyset
        vset_clear(result.win[1-player]);
    } else {
        RTstopTimer(options->attr_options->timer);
        Print(info, "[%7.3f] " "%*s" "solve_recursive: x.win[%d] not empty.", RTrealTime(options->attr_options->timer), indent, "", 1-player);
        RTstartTimer(options->attr_options->timer);

        vset_destroy(u);
        vset_destroy(x.win[player]);

        vset_t b = vset_create(g->domain, -1, NULL);
        vset_copy(b, x.win[1-player]);
        vset_destroy(x.win[1-player]);

        // Clear the result
        recursive_result_destroy(result);
        result = recursive_result_create(g->domain);

        // sigma_{1-player} := xi_{1-player}
        concat_strategy_levels_player(1-player, g->domain,
                                      result.strategy_levels, result.strategy_levels_count, result.strategy_boundaries, result.strategy_boundary_count,
                                      x.strategy_levels, x.strategy_levels_count, x.strategy_boundaries, x.strategy_boundary_count);
        recursive_result_destroy(x);

        // Second attractor computating (for 1-player)
        options->attr(1-player, g, &result, b, options->attr_options, depth);

        {
            parity_game* g_minus_b = spg_copy(g);
            spg_destroy(g);
            spg_game_restrict(g_minus_b, b, options);

            // Second recursion step
            recursive_result y = spg_solve_recursive(g_minus_b, options, depth+1);

            // merge strategies
            concat_strategy_levels(g->domain, result.strategy_levels, result.strategy_levels_count, result.strategy_boundaries, result.strategy_boundary_count,
                                   y.strategy_levels, y.strategy_levels_count, y.strategy_boundaries, y.strategy_boundary_count);

            //spg_destroy(g_minus_b); // has already been destroyed in spg_solve_recursive
            vset_copy(result.win[player], y.win[player]);
            vset_union(b, y.win[1-player]);
            for (int p=0; p < 2; p++) {
                vset_destroy(y.win[p]);
            }
            recursive_result_destroy(y);
            vset_copy(result.win[1-player], b);
        }
        vset_destroy(b);
    }
    SPG_REPORT_RECURSIVE_RESULT(options->attr_options,indent,result);

    SPG_OUTPUT_DOT(options->attr_options->dot,result.win[0],"spg_set_%05zu_win0.dot",options->attr_options->dot_count++);
    SPG_OUTPUT_DOT(options->attr_options->dot,result.win[1],"spg_set_%05zu_win1.dot",options->attr_options->dot_count++);
    return result;
}

/**
 * \brief Computes and returns G = G - A.
 */
void spg_game_restrict(parity_game *g, vset_t a, const spgsolver_options* options)
{
    vset_minus(g->v, a); // compute V - A:
    for(int i=0; i<2; i++) {
        vset_minus(g->v_player[i], a); // compute V - A:
    }
    for(int i=g->min_priority; i<=g->max_priority; i++) {
        vset_minus(g->v_priority[i], a); // compute V - A:
        if (i==g->min_priority && i < g->max_priority && vset_is_empty(g->v_priority[i])) {
            g->min_priority++;
        }
    }
    while(g->max_priority > g->min_priority
            && vset_is_empty(g->v_priority[g->max_priority])) {
        g->max_priority--;
    }
    // TODO: compute E \intersects (V-A x V-A)? -- needs extension of the vset interface
    (void)options;
}


text:
/******************************************************************************
 *
 * Module Name: dsmethod - Parser/Interpreter interface - control method parsing
 *              $Revision: 1.140 $
 *
 *****************************************************************************/

/******************************************************************************
 *
 * 1. Copyright Notice
 *
 * Some or all of this work - Copyright (c) 1999 - 2008, Intel Corp.
 * All rights reserved.
 *
 * 2. License
 *
 * 2.1. This is your license from Intel Corp. under its intellectual property
 * rights.  You may have additional license terms from the party that provided
 * you this software, covering your right to use that party's intellectual
 * property rights.
 *
 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
 * copy of the source code appearing in this file ("Covered Code") an
 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
 * base code distributed originally by Intel ("Original Intel Code") to copy,
 * make derivatives, distribute, use and display any portion of the Covered
 * Code in any form, with the right to sublicense such rights; and
 *
 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
 * license (with the right to sublicense), under only those claims of Intel
 * patents that are infringed by the Original Intel Code, to make, use, sell,
 * offer to sell, and import the Covered Code and derivative works thereof
 * solely to the minimum extent necessary to exercise the above copyright
 * license, and in no event shall the patent license extend to any additions
 * to or modifications of the Original Intel Code.  No other license or right
 * is granted directly or by implication, estoppel or otherwise;
 *
 * The above copyright and patent license is granted only if the following
 * conditions are met:
 *
 * 3. Conditions
 *
 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
 * Redistribution of source code of any substantial portion of the Covered
 * Code or modification with rights to further distribute source must include
 * the above Copyright Notice, the above License, this list of Conditions,
 * and the following Disclaimer and Export Compliance provision.  In addition,
 * Licensee must cause all Covered Code to which Licensee contributes to
 * contain a file documenting the changes Licensee made to create that Covered
 * Code and the date of any change.  Licensee must include in that file the
 * documentation of any changes made by any predecessor Licensee.  Licensee
 * must include a prominent statement that the modification is derived,
 * directly or indirectly, from Original Intel Code.
 *
 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
 * Redistribution of source code of any substantial portion of the Covered
 * Code or modification without rights to further distribute source must
 * include the following Disclaimer and Export Compliance provision in the
 * documentation and/or other materials provided with distribution.  In
 * addition, Licensee may not authorize further sublicense of source of any
 * portion of the Covered Code, and must include terms to the effect that the
 * license from Licensee to its licensee is limited to the intellectual
 * property embodied in the software Licensee provides to its licensee, and
 * not to intellectual property embodied in modifications its licensee may
 * make.
 *
 * 3.3. Redistribution of Executable. Redistribution in executable form of any
 * substantial portion of the Covered Code or modification must reproduce the
 * above Copyright Notice, and the following Disclaimer and Export Compliance
 * provision in the documentation and/or other materials provided with the
 * distribution.
 *
 * 3.4. Intel retains all right, title, and interest in and to the Original
 * Intel Code.
 *
 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
 * Intel shall be used in advertising or otherwise to promote the sale, use or
 * other dealings in products derived from or relating to the Covered Code
 * without prior written authorization from Intel.
 *
 * 4. Disclaimer and Export Compliance
 *
 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
 * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
 * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
 * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
 * PARTICULAR PURPOSE.
 *
 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
 * LIMITED REMEDY.
 *
 * 4.3. Licensee shall not export, either directly or indirectly, any of this
 * software or system incorporating such software without first obtaining any
 * required license or other approval from the U. S. Department of Commerce or
 * any other agency or department of the United States Government.  In the
 * event Licensee exports any such software from the United States or
 * re-exports any such software from a foreign destination, Licensee shall
 * ensure that the distribution and export/re-export of the software is in
 * compliance with all laws, regulations, orders, or other restrictions of the
 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
 * any of its subsidiaries will export/re-export any technical data, process,
 * software, or service, directly or indirectly, to any country for which the
 * United States government or any agency thereof requires an export license,
 * other governmental approval, or letter of assurance, without first obtaining
 * such license, approval or letter.
 *
 *****************************************************************************/

#define __DSMETHOD_C__

#include "acpi.h"
#include "amlcode.h"
#include "acdispat.h"
#include "acinterp.h"
#include "acnamesp.h"
#include "acdisasm.h"

#define _COMPONENT          ACPI_DISPATCHER
        ACPI_MODULE_NAME    ("dsmethod")

/* Local prototypes */

static ACPI_STATUS
AcpiDsCreateMethodMutex (
    ACPI_OPERAND_OBJECT     *MethodDesc);

/*******************************************************************************
 *
 * FUNCTION:    AcpiDsMethodError
 *
 * PARAMETERS:  Status          - Execution status
 *              WalkState       - Current state
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Called on method error. Invoke the global exception handler if
 *              present, dump the method data if the disassembler is configured
 *
 *              Note: Allows the exception handler to change the status code
 *
 ******************************************************************************/

ACPI_STATUS
AcpiDsMethodError (
    ACPI_STATUS             Status,
    ACPI_WALK_STATE         *WalkState)
{
    ACPI_FUNCTION_ENTRY ();

    /* Ignore AE_OK and control exception codes */

    if (ACPI_SUCCESS (Status) ||
        (Status & AE_CODE_CONTROL))
    {
        return (Status);
    }

    /* Invoke the global exception handler */

    if (AcpiGbl_ExceptionHandler)
    {
        /* Exit the interpreter, allow handler to execute methods */

        AcpiExExitInterpreter ();

        /*
         * Handler can map the exception code to anything it wants, including
         * AE_OK, in which case the executing method will not be aborted.
         */
        Status = AcpiGbl_ExceptionHandler (Status,
                    WalkState->MethodNode ?
                        WalkState->MethodNode->Name.Integer : 0,
                    WalkState->Opcode, WalkState->AmlOffset, NULL);
        AcpiExEnterInterpreter ();
    }

    AcpiDsClearImplicitReturn (WalkState);

#ifdef ACPI_DISASSEMBLER
    if (ACPI_FAILURE (Status))
    {
        /* Display method locals/args if disassembler is present */

        AcpiDmDumpMethodInfo (Status, WalkState, WalkState->Op);
    }
#endif

    return (Status);
}

/*******************************************************************************
 *
 * FUNCTION:    AcpiDsCreateMethodMutex
 *
 * PARAMETERS:  ObjDesc             - The method object
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Create a mutex object for a serialized control method
 *
 ******************************************************************************/

static ACPI_STATUS
AcpiDsCreateMethodMutex (
    ACPI_OPERAND_OBJECT     *MethodDesc)
{
    ACPI_OPERAND_OBJECT     *MutexDesc;
    ACPI_STATUS             Status;

    ACPI_FUNCTION_TRACE (DsCreateMethodMutex);

    /* Create the new mutex object */

    MutexDesc = AcpiUtCreateInternalObject (ACPI_TYPE_MUTEX);
    if (!MutexDesc)
    {
        return_ACPI_STATUS (AE_NO_MEMORY);
    }

    /* Create the actual OS Mutex */

    Status = AcpiOsCreateMutex (&MutexDesc->Mutex.OsMutex);
    if (ACPI_FAILURE (Status))
    {
        return_ACPI_STATUS (Status);
    }

    MutexDesc->Mutex.SyncLevel = MethodDesc->Method.SyncLevel;
    MethodDesc->Method.Mutex = MutexDesc;
    return_ACPI_STATUS (AE_OK);
}

/*******************************************************************************
 *
 * FUNCTION:    AcpiDsBeginMethodExecution
 *
 * PARAMETERS:  MethodNode          - Node of the method
 *              ObjDesc             - The method object
 *              WalkState           - current state, NULL if not yet executing
 *                                    a method.
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Prepare a method for execution.  Parses the method if necessary,
 *              increments the thread count, and waits at the method semaphore
 *              for clearance to execute.
 *
 ******************************************************************************/

ACPI_STATUS
AcpiDsBeginMethodExecution (
    ACPI_NAMESPACE_NODE     *MethodNode,
    ACPI_OPERAND_OBJECT     *ObjDesc,
    ACPI_WALK_STATE         *WalkState)
{
    ACPI_STATUS             Status = AE_OK;

    ACPI_FUNCTION_TRACE_PTR (DsBeginMethodExecution, MethodNode);

    if (!MethodNode)
    {
        return_ACPI_STATUS (AE_NULL_ENTRY);
    }

    /* Prevent wraparound of thread count */

    if (ObjDesc->Method.ThreadCount == ACPI_UINT8_MAX)
    {
        ACPI_ERROR ((AE_INFO,
            "Method reached maximum reentrancy limit (255)"));
        return_ACPI_STATUS (AE_AML_METHOD_LIMIT);
    }

    /*
     * If this method is serialized, we need to acquire the method mutex.
     */
    if (ObjDesc->Method.MethodFlags & AML_METHOD_SERIALIZED)
    {
        /*
         * Create a mutex for the method if it is defined to be Serialized
         * and a mutex has not already been created. We defer the mutex creation
         * until a method is actually executed, to minimize the object count
         */
        if (!ObjDesc->Method.Mutex)
        {
            Status = AcpiDsCreateMethodMutex (ObjDesc);
            if (ACPI_FAILURE (Status))
            {
                return_ACPI_STATUS (Status);
            }
        }

        /*
         * The CurrentSyncLevel (per-thread) must be less than or equal to
         * the sync level of the method. This mechanism provides some
         * deadlock prevention
         *
         * Top-level method invocation has no walk state at this point
         */
        if (WalkState &&
            (WalkState->Thread->CurrentSyncLevel > ObjDesc->Method.Mutex->Mutex.SyncLevel))
        {
            ACPI_ERROR ((AE_INFO,
                "Cannot acquire Mutex for method [%4.4s], current SyncLevel is too large (%d)",
                AcpiUtGetNodeName (MethodNode),
                WalkState->Thread->CurrentSyncLevel));

            return_ACPI_STATUS (AE_AML_MUTEX_ORDER);
        }

        /*
         * Obtain the method mutex if necessary. Do not acquire mutex for a
         * recursive call.
         */
        if (!WalkState ||
            !ObjDesc->Method.Mutex->Mutex.ThreadId ||
            (WalkState->Thread->ThreadId != ObjDesc->Method.Mutex->Mutex.ThreadId))
        {
            /*
             * Acquire the method mutex. This releases the interpreter if we
             * block (and reacquires it before it returns)
             */
            Status = AcpiExSystemWaitMutex (ObjDesc->Method.Mutex->Mutex.OsMutex,
                        ACPI_WAIT_FOREVER);
            if (ACPI_FAILURE (Status))
            {
                return_ACPI_STATUS (Status);
            }

            /* Update the mutex and walk info and save the original SyncLevel */

            if (WalkState)
            {
                ObjDesc->Method.Mutex->Mutex.OriginalSyncLevel =
                    WalkState->Thread->CurrentSyncLevel;

                ObjDesc->Method.Mutex->Mutex.ThreadId = WalkState->Thread->ThreadId;
                WalkState->Thread->CurrentSyncLevel = ObjDesc->Method.SyncLevel;
            }
            else
            {
                ObjDesc->Method.Mutex->Mutex.OriginalSyncLevel =
                    ObjDesc->Method.Mutex->Mutex.SyncLevel;
            }
        }

        /* Always increase acquisition depth */

        ObjDesc->Method.Mutex->Mutex.AcquisitionDepth++;
    }

    /*
     * Allocate an Owner ID for this method, only if this is the first thread
     * to begin concurrent execution. We only need one OwnerId, even if the
     * method is invoked recursively.
     */
    if (!ObjDesc->Method.OwnerId)
    {
        Status = AcpiUtAllocateOwnerId (&ObjDesc->Method.OwnerId);
        if (ACPI_FAILURE (Status))
        {
            goto Cleanup;
        }
    }

    /*
     * Increment the method parse tree thread count since it has been
     * reentered one more time (even if it is the same thread)
     */
    ObjDesc->Method.ThreadCount++;
    AcpiMethodCount++;
    return_ACPI_STATUS (Status);

Cleanup:
    /* On error, must release the method mutex (if present) */

    if (ObjDesc->Method.Mutex)
    {
        AcpiOsReleaseMutex (ObjDesc->Method.Mutex->Mutex.OsMutex);
    }
    return_ACPI_STATUS (Status);
}

/*******************************************************************************
 *
 * FUNCTION:    AcpiDsCallControlMethod
 *
 * PARAMETERS:  Thread              - Info for this thread
 *              ThisWalkState       - Current walk state
 *              Op                  - Current Op to be walked
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Transfer execution to a called control method
 *
 ******************************************************************************/

ACPI_STATUS
AcpiDsCallControlMethod (
    ACPI_THREAD_STATE       *Thread,
    ACPI_WALK_STATE         *ThisWalkState,
    ACPI_PARSE_OBJECT       *Op)
{
    ACPI_STATUS             Status;
    ACPI_NAMESPACE_NODE     *MethodNode;
    ACPI_WALK_STATE         *NextWalkState = NULL;
    ACPI_OPERAND_OBJECT     *ObjDesc;
    ACPI_EVALUATE_INFO      *Info;
    UINT32                  i;

    ACPI_FUNCTION_TRACE_PTR (DsCallControlMethod, ThisWalkState);

    ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Calling method %p, currentstate=%p\n",
        ThisWalkState->PrevOp, ThisWalkState));

    /*
     * Get the namespace entry for the control method we are about to call
     */
    MethodNode = ThisWalkState->MethodCallNode;
    if (!MethodNode)
    {
        return_ACPI_STATUS (AE_NULL_ENTRY);
    }

    ObjDesc = AcpiNsGetAttachedObject (MethodNode);
    if (!ObjDesc)
    {
        return_ACPI_STATUS (AE_NULL_OBJECT);
    }

    /* Init for new method, possibly wait on method mutex */

    Status = AcpiDsBeginMethodExecution (MethodNode, ObjDesc,
                ThisWalkState);
    if (ACPI_FAILURE (Status))
    {
        return_ACPI_STATUS (Status);
    }

    /* Begin method parse/execution. Create a new walk state */

    NextWalkState = AcpiDsCreateWalkState (ObjDesc->Method.OwnerId,
                        NULL, ObjDesc, Thread);
    if (!NextWalkState)
    {
        Status = AE_NO_MEMORY;
        goto Cleanup;
    }

    /*
     * The resolved arguments were put on the previous walk state's operand
     * stack. Operands on the previous walk state stack always
     * start at index 0. Also, null terminate the list of arguments
     */
    ThisWalkState->Operands [ThisWalkState->NumOperands] = NULL;

    /*
     * Allocate and initialize the evaluation information block
     * TBD: this is somewhat inefficient, should change interface to
     * DsInitAmlWalk. For now, keeps this struct off the CPU stack
     */
    Info = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EVALUATE_INFO));
    if (!Info)
    {
        return_ACPI_STATUS (AE_NO_MEMORY);
    }

    Info->Parameters = &ThisWalkState->Operands[0];
    Info->ParameterType = ACPI_PARAM_ARGS;

    Status = AcpiDsInitAmlWalk (NextWalkState, NULL, MethodNode,
                ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength,
                Info, ACPI_IMODE_EXECUTE);

    ACPI_FREE (Info);
    if (ACPI_FAILURE (Status))
    {
        goto Cleanup;
    }

    /*
     * Delete the operands on the previous walkstate operand stack
     * (they were copied to new objects)
     */
    for (i = 0; i < ObjDesc->Method.ParamCount; i++)
    {
        AcpiUtRemoveReference (ThisWalkState->Operands [i]);
        ThisWalkState->Operands [i] = NULL;
    }

    /* Clear the operand stack */

    ThisWalkState->NumOperands = 0;

    ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
        "**** Begin nested execution of [%4.4s] **** WalkState=%p\n",
        MethodNode->Name.Ascii, NextWalkState));

    /* Invoke an internal method if necessary */

    if (ObjDesc->Method.MethodFlags & AML_METHOD_INTERNAL_ONLY)
    {
        Status = ObjDesc->Method.Implementation (NextWalkState);
    }

    return_ACPI_STATUS (Status);

Cleanup:

    /* On error, we must terminate the method properly */

    AcpiDsTerminateControlMethod (ObjDesc, NextWalkState);
    if (NextWalkState)
    {
        AcpiDsDeleteWalkState (NextWalkState);
    }

    return_ACPI_STATUS (Status);
}

/*******************************************************************************
 *
 * FUNCTION:    AcpiDsRestartControlMethod
 *
 * PARAMETERS:  WalkState           - State for preempted method (caller)
 *              ReturnDesc          - Return value from the called method
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Restart a method that was preempted by another (nested) method
 *              invocation.  Handle the return value (if any) from the callee.
 *
 ******************************************************************************/

ACPI_STATUS
AcpiDsRestartControlMethod (
    ACPI_WALK_STATE         *WalkState,
    ACPI_OPERAND_OBJECT     *ReturnDesc)
{
    ACPI_STATUS             Status;
    int                     SameAsImplicitReturn;

    ACPI_FUNCTION_TRACE_PTR (DsRestartControlMethod, WalkState);

    ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
        "****Restart [%4.4s] Op %p ReturnValueFromCallee %p\n",
        AcpiUtGetNodeName (WalkState->MethodNode),
        WalkState->MethodCallOp, ReturnDesc));

    ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
        "    ReturnFromThisMethodUsed?=%X ResStack %p Walk %p\n",
        WalkState->ReturnUsed,
        WalkState->Results, WalkState));

    /* Did the called method return a value? */

    if (ReturnDesc)
    {
        /* Is the implicit return object the same as the return desc? */

        SameAsImplicitReturn = (WalkState->ImplicitReturnObj == ReturnDesc);

        /* Are we actually going to use the return value? */

        if (WalkState->ReturnUsed)
        {
            /* Save the return value from the previous method */

            Status = AcpiDsResultPush (ReturnDesc, WalkState);
            if (ACPI_FAILURE (Status))
            {
                AcpiUtRemoveReference (ReturnDesc);
                return_ACPI_STATUS (Status);
            }

            /*
             * Save as THIS method's return value in case it is returned
             * immediately to yet another method
             */
            WalkState->ReturnDesc = ReturnDesc;
        }

        /*
         * The following code is the optional support for the so-called
         * "implicit return". Some AML code assumes that the last value of the
         * method is "implicitly" returned to the caller, in the absence of an
         * explicit return value.
         *
         * Just save the last result of the method as the return value.
         *
         * NOTE: this is optional because the ASL language does not actually
         * support this behavior.
         */
        else if (!AcpiDsDoImplicitReturn (ReturnDesc, WalkState, FALSE) ||
                 SameAsImplicitReturn)
        {
            /*
             * Delete the return value if it will not be used by the
             * calling method or remove one reference if the explicit return
             * is the same as the implicit return value.
             */
            AcpiUtRemoveReference (ReturnDesc);
        }
    }

    return_ACPI_STATUS (AE_OK);
}

/*******************************************************************************
 *
 * FUNCTION:    AcpiDsTerminateControlMethod
 *
 * PARAMETERS:  MethodDesc          - Method object
 *              WalkState           - State associated with the method
 *
 * RETURN:      None
 *
 * DESCRIPTION: Terminate a control method.  Delete everything that the method
 *              created, delete all locals and arguments, and delete the parse
 *              tree if requested.
 *
 * MUTEX:       Interpreter is locked
 *
 ******************************************************************************/

void
AcpiDsTerminateControlMethod (
    ACPI_OPERAND_OBJECT     *MethodDesc,
    ACPI_WALK_STATE         *WalkState)
{

    ACPI_FUNCTION_TRACE_PTR (DsTerminateControlMethod, WalkState);

    /* MethodDesc is required, WalkState is optional */

    if (!MethodDesc)
    {
        return_VOID;
    }

    if (WalkState)
    {
        /* Delete all arguments and locals */

        AcpiDsMethodDataDeleteAll (WalkState);

        /*
         * If method is serialized, release the mutex and restore the
         * current sync level for this thread
         */
        if (MethodDesc->Method.Mutex)
        {
            /* Acquisition Depth handles recursive calls */

            MethodDesc->Method.Mutex->Mutex.AcquisitionDepth--;
            if (!MethodDesc->Method.Mutex->Mutex.AcquisitionDepth)
            {
                WalkState->Thread->CurrentSyncLevel =
                    MethodDesc->Method.Mutex->Mutex.OriginalSyncLevel;

                AcpiOsReleaseMutex (MethodDesc->Method.Mutex->Mutex.OsMutex);
                MethodDesc->Method.Mutex->Mutex.ThreadId = 0;
            }
        }

        /*
         * Delete any namespace objects created anywhere within
         * the namespace by the execution of this method
         */
        AcpiNsDeleteNamespaceByOwner (MethodDesc->Method.OwnerId);
    }

    /* Decrement the thread count on the method */

    if (MethodDesc->Method.ThreadCount)
    {
        MethodDesc->Method.ThreadCount--;
    }
    else
    {
        ACPI_ERROR ((AE_INFO,
            "Invalid zero thread count in method"));
    }

    /* Are there any other threads currently executing this method? */

    if (MethodDesc->Method.ThreadCount)
    {
        /*
         * Additional threads. Do not release the OwnerId in this case,
         * we immediately reuse it for the next thread executing this method
         */
        ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
            "*** Completed execution of one thread, %d threads remaining\n",
            MethodDesc->Method.ThreadCount));
    }
    else
    {
        /* This is the only executing thread for this method */

        /*
         * Support to dynamically change a method from NotSerialized to
         * Serialized if it appears that the method is incorrectly written and
         * does not support multiple thread execution. The best example of this
         * is if such a method creates namespace objects and blocks. A second
         * thread will fail with an AE_ALREADY_EXISTS exception
         *
         * This code is here because we must wait until the last thread exits
         * before creating the synchronization semaphore.
         */
        if ((MethodDesc->Method.MethodFlags & AML_METHOD_SERIALIZED) &&
            (!MethodDesc->Method.Mutex))
        {
            (void) AcpiDsCreateMethodMutex (MethodDesc);
        }

        /* No more threads, we can free the OwnerId */

        AcpiUtReleaseOwnerId (&MethodDesc->Method.OwnerId);
    }

    return_VOID;
}


text:
/*
 * aes256 File Encryption for PaStash Commands
 * (C) 2019 QXIP BV
 */

const encryptor = require('file-encryptor');
let conf;
const defaultConf = {
  algorithm: 'aes256',
  pluginFieldName: 'FileEcryptor'
};

module.exports = function plugin(userConf) {
  conf = { ...defaultConf, ...userConf };
  const options = {
    algorithm: conf.algorithm,
  };

  this.main.encryptFile = function encryptFile(next) {
    const data = this.data[conf.pluginFieldName];
    encryptor.encryptFile(data[conf.inputFileField], data[conf.outputFileField], data[conf.keyField], options, function (err) {
      next();
    });
  }

  this.main.decryptFile = function decryptFile(next) {
    const data = this.data[conf.pluginFieldName];
    encryptor.decryptFile(data[conf.inputFileField], data[conf.outputFileField], data[conf.keyField], options, function (err) {
      next();
    });
  }

}


text:
Api rest to signUp and manage products whit authentication

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development but not testing purposes.

### Prerequisites

We need git, node js and npm to clone, install and run the application.

### Installing

Clone the proyect from this repository in your local folder.

```
git clone https://github.com/EliasFunes/productsFinder
```

then in your local directory, install all of the dependencies

```
npm install
```

## Run Locally

```
npm start
```

## Serve Locally

To serve locally we need a dev dependencies called nodemon

```
npm install nodemon
then
npm run serve
```

## GUI Documentation

Once if you proyect is started, open this url in your browser
http://localhost:3000

## Note
Actually the proyect use a mongodb database in the cloud to serve a storage.

## Built With

* [NODEJS](https://nodejs.org/en/docs/) - The web langague used.
* [EXPRESS](http://expressjs.com/en/4x/api.html) - The web framework used.
* [NPM](https://docs.npmjs.com/) - Dependency Management.
* [MONGODB](https://docs.mongodb.com/) - Used to storage Data.

## Authors

* **Elias Funes** - *Initial work* - [Elias Funes](https://github.com/EliasFunes)

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details


text:
import Ember from 'ember';

export default Ember.Component.extend({
  tagName: 'a',
  layoutName: 'components/gc-table/gc-action'
});


text:
require 'spec_helper'

describe 'osx::time_machine::ask_to_use_new_disks_for_backup' do
  let(:facts) { {:boxen_user => 'ilikebees' } }
  describe('enabled') do
    let(:params) { {:ensure => 'present'} }
    it 'should set the value to true' do
      should contain_boxen__osx_defaults('Toggle Whether Time Machine Asks to Use New Disks for Backup').with({
        :user   => facts[:boxen_user],
        :key    => 'DoNotOfferNewDisksForBackup',
        :domain => 'com.apple.TimeMachine',
        :value  => true,
      })
    end
  end

  describe('disabled') do
    let(:params) { {:ensure => 'absent'} }
    it 'should set the value to false' do
      should contain_boxen__osx_defaults('Toggle Whether Time Machine Asks to Use New Disks for Backup').with({
        :user   => facts[:boxen_user],
        :key    => 'DoNotOfferNewDisksForBackup',
        :domain => 'com.apple.TimeMachine',
        :value  => false,
      })
    end
  end

end


text:
layout: default.html.ejs
title: Tags Array
tags: Tag-string-1, Tag-string-2, Tag-string-3
---


text:
package org.optaplanner.operator.impl.solver.model.keda;

import io.fabric8.kubernetes.api.model.SecretKeySelector;

public final class SecretTargetRef {

    public static SecretTargetRef fromSecretKeySelector(String parameter, SecretKeySelector secretKeySelector) {
        return new SecretTargetRef(parameter, secretKeySelector.getName(), secretKeySelector.getKey());
    }

    private String parameter;
    private String name;
    private String key;

    public SecretTargetRef() {
        // Required by Jackson.
    }

    public SecretTargetRef(String parameter, String name, String key) {
        this.parameter = parameter;
        this.name = name;
        this.key = key;
    }

    public String getParameter() {
        return parameter;
    }

    public void setParameter(String parameter) {
        this.parameter = parameter;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }
}