text:
require 'bundler'
Bundler.require
require 'forwardable'
require 'yaml'
require 'json'

class NilClass; alias_method :empty?, :nil?; end

PLUGINS = [
  {:file => 'ping', :class => 'Ping'},
  {:file => 'conference', :class => 'Conference'},
  {:file => 'speakerqueue', :class => 'SpeakerQueue'},
  {:file => 'join_on_invite', :class => 'JoinOnInvite'},
]

# Load the config file
require File.expand_path "../lib/config", __FILE__
require File.expand_path "../../lib/conference", __FILE__

TwilioClient = Twilio::REST::Client.new CONFIG[:twilio][:sid], CONFIG[:twilio][:token]

# Need to make a new connection per thread, so provide an easy method to use
def db_connect
  Sequel.connect(CONFIG[:db])
end

module Bot

  # Load the plugins
  PLUGINS.each do |p|
    require File.expand_path "../plugins/#{p[:file]}", __FILE__
  end

  # Set up the R object so plugins can use Redis
  require File.expand_path "../lib/redis-send", __FILE__

  # Set up the separate thread for listening on the "input" Redis channel
  require File.expand_path "../lib/redis-api", __FILE__

  class << self
    include Cinch::Helpers

    def report msg
      Channel(CONFIG[:irc][:admin_channel]).send msg
    end

    def bot
      unless @bot
        @bot = Cinch::Bot.new do
          configure do |c|
            c.channels = (CONFIG[:irc][:channels] + [CONFIG[:irc][:admin_channel]]).uniq
            c.nick = CONFIG[:irc][:nick]
            c.plugins.plugins = PLUGINS.map {|p| Bot.const_get p[:class]}
            c.server = CONFIG[:irc][:server]
          end

          on :connect do
            # Subscribe to the Redis channel to set up the API
            Bot::SubscriptionReactor.singleton.async.redis_subscribe unless Bot::SubscriptionReactor.singleton.subscribed?
          end
        end

        # Configure logging
        if CONFIG[:irc][:log_file]
          root = File.expand_path '../..', __FILE__
          log_file = File.open File.join(root, CONFIG[:irc][:log_file]), "a"
          @bot.loggers[0] = Cinch::Logger::FormattedLogger.new(log_file)
          Celluloid.logger = Logger.new log_file
        end
      end
      @bot
    end
  end

end

Bot.bot.start


text:
require 'rspec/fire'

RSpec.configure do |config|
  config.include(RSpec::Fire)

  def fail_matching(*messages)
    raise_error(RSpec::Expectations::ExpectationNotMetError) {|error|
      messages.each {|message|
        error.message.should =~ /#{Regexp.escape(message.to_s)}/
      }
    }
  end
end

redpajama_set_name: RedPajamaGithub


text:
import { Controller } from '@hotwired/stimulus';

import { EventDispatcher } from '../utils/event-dispatcher';
import fetcher from '../utils/fetcher';

export default class extends Controller {
  static values = {
    payload: Object,
    eventName: String,
    method: String,
    url: String,
  };

  payloadValue!: object;
  eventNameValue!: string;
  methodValue!: string;
  urlValue!: string;

  async connect() {
    let data;

    if (this.methodValue === 'get') {
      data = await fetcher.get(this.urlValue);
    } else if (this.methodValue === 'post') {
      data = await fetcher.post(this.urlValue, this.payloadValue);
    }

    new EventDispatcher(this.eventNameValue, data).dispatch();
  }
}


text:
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/nacl/browser/nacl_host_message_filter.h"

#include "base/sys_info.h"
#include "components/nacl/browser/nacl_browser.h"
#include "components/nacl/browser/nacl_file_host.h"
#include "components/nacl/browser/nacl_process_host.h"
#include "components/nacl/browser/pnacl_host.h"
#include "components/nacl/common/nacl_host_messages.h"
#include "ipc/ipc_platform_file.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
#include "url/gurl.h"

namespace nacl {

NaClHostMessageFilter::NaClHostMessageFilter(
    int render_process_id,
    bool is_off_the_record,
    const base::FilePath& profile_directory,
    net::URLRequestContextGetter* request_context)
    : BrowserMessageFilter(NaClHostMsgStart),
      render_process_id_(render_process_id),
      off_the_record_(is_off_the_record),
      profile_directory_(profile_directory),
      request_context_(request_context),
      weak_ptr_factory_(this) {
}

NaClHostMessageFilter::~NaClHostMessageFilter() {
}

void NaClHostMessageFilter::OnChannelClosing() {
  pnacl::PnaclHost::GetInstance()->RendererClosing(render_process_id_);
}

bool NaClHostMessageFilter::OnMessageReceived(const IPC::Message& message,
                                              bool* message_was_ok) {
  bool handled = true;
  IPC_BEGIN_MESSAGE_MAP_EX(NaClHostMessageFilter, message, *message_was_ok)
#if !defined(DISABLE_NACL)
    IPC_MESSAGE_HANDLER_DELAY_REPLY(NaClHostMsg_LaunchNaCl, OnLaunchNaCl)
    IPC_MESSAGE_HANDLER_DELAY_REPLY(NaClHostMsg_GetReadonlyPnaclFD,
                                    OnGetReadonlyPnaclFd)
    IPC_MESSAGE_HANDLER_DELAY_REPLY(NaClHostMsg_NaClCreateTemporaryFile,
                                    OnNaClCreateTemporaryFile)
    IPC_MESSAGE_HANDLER(NaClHostMsg_NexeTempFileRequest,
                        OnGetNexeFd)
    IPC_MESSAGE_HANDLER(NaClHostMsg_ReportTranslationFinished,
                        OnTranslationFinished)
    IPC_MESSAGE_HANDLER(NaClHostMsg_MissingArchError,
                        OnMissingArchError)
    IPC_MESSAGE_HANDLER_DELAY_REPLY(NaClHostMsg_OpenNaClExecutable,
                                    OnOpenNaClExecutable)
    IPC_MESSAGE_HANDLER(NaClHostMsg_NaClGetNumProcessors,
                        OnNaClGetNumProcessors)
#endif
    IPC_MESSAGE_UNHANDLED(handled = false)
  IPC_END_MESSAGE_MAP()

  return handled;
}

net::HostResolver* NaClHostMessageFilter::GetHostResolver() {
  return request_context_->GetURLRequestContext()->host_resolver();
}

#if !defined(DISABLE_NACL)
void NaClHostMessageFilter::OnLaunchNaCl(
    const nacl::NaClLaunchParams& launch_params,
    IPC::Message* reply_msg) {
  NaClProcessHost* host = new NaClProcessHost(
      GURL(launch_params.manifest_url),
      launch_params.render_view_id,
      launch_params.permission_bits,
      launch_params.uses_irt,
      launch_params.uses_nonsfi_mode,
      launch_params.enable_dyncode_syscalls,
      launch_params.enable_exception_handling,
      launch_params.enable_crash_throttling,
      off_the_record_,
      profile_directory_);
  GURL manifest_url(launch_params.manifest_url);
  base::FilePath manifest_path;
  // We're calling MapUrlToLocalFilePath with the non-blocking API
  // because we're running in the I/O thread. Ideally we'd use the other path,
  // which would cover more cases.
  nacl::NaClBrowser::GetDelegate()->MapUrlToLocalFilePath(
      manifest_url, false /* use_blocking_api */, &manifest_path);
  host->Launch(this, reply_msg, manifest_path);
}

void NaClHostMessageFilter::OnGetReadonlyPnaclFd(
    const std::string& filename, IPC::Message* reply_msg) {
  // This posts a task to another thread, but the renderer will
  // block until the reply is sent.
  nacl_file_host::GetReadonlyPnaclFd(this, filename, reply_msg);

  // This is the first message we receive from the renderer once it knows we
  // want to use PNaCl, so start the translation cache initialization here.
  pnacl::PnaclHost::GetInstance()->Init();
}

// Return the temporary file via a reply to the
// NaClHostMsg_NaClCreateTemporaryFile sync message.
void NaClHostMessageFilter::SyncReturnTemporaryFile(
    IPC::Message* reply_msg,
    base::File file) {
  if (file.IsValid()) {
    NaClHostMsg_NaClCreateTemporaryFile::WriteReplyParams(
        reply_msg,
        IPC::TakeFileHandleForProcess(file.Pass(), PeerHandle()));
  } else {
    reply_msg->set_reply_error();
  }
  Send(reply_msg);
}

void NaClHostMessageFilter::OnNaClCreateTemporaryFile(
    IPC::Message* reply_msg) {
  pnacl::PnaclHost::GetInstance()->CreateTemporaryFile(
      base::Bind(&NaClHostMessageFilter::SyncReturnTemporaryFile,
                 this,
                 reply_msg));
}

void NaClHostMessageFilter::AsyncReturnTemporaryFile(
    int pp_instance,
    base::PlatformFile fd,
    bool is_hit) {
  Send(new NaClViewMsg_NexeTempFileReply(
      pp_instance,
      is_hit,
      // Don't close our copy of the handle, because PnaclHost will use it
      // when the translation finishes.
      IPC::GetFileHandleForProcess(fd, PeerHandle(), false)));
}

void NaClHostMessageFilter::OnNaClGetNumProcessors(int* num_processors) {
  *num_processors = base::SysInfo::NumberOfProcessors();
}

void NaClHostMessageFilter::OnGetNexeFd(
    int render_view_id,
    int pp_instance,
    const nacl::PnaclCacheInfo& cache_info) {
  if (!cache_info.pexe_url.is_valid()) {
    LOG(ERROR) << "Bad URL received from GetNexeFd: " <<
        cache_info.pexe_url.possibly_invalid_spec();
    BadMessageReceived();
    return;
  }

  pnacl::PnaclHost::GetInstance()->GetNexeFd(
      render_process_id_,
      render_view_id,
      pp_instance,
      off_the_record_,
      cache_info,
      base::Bind(&NaClHostMessageFilter::AsyncReturnTemporaryFile,
                 this,
                 pp_instance));
}

void NaClHostMessageFilter::OnTranslationFinished(int instance, bool success) {
  pnacl::PnaclHost::GetInstance()->TranslationFinished(
      render_process_id_, instance, success);
}

void NaClHostMessageFilter::OnMissingArchError(int render_view_id) {
  nacl::NaClBrowser::GetDelegate()->
      ShowMissingArchInfobar(render_process_id_, render_view_id);
}

void NaClHostMessageFilter::OnOpenNaClExecutable(int render_view_id,
                                                 const GURL& file_url,
                                                 IPC::Message* reply_msg) {
  nacl_file_host::OpenNaClExecutable(this, render_view_id, file_url,
                                     reply_msg);
}
#endif

}  // namespace nacl


text:
this_dir=$(dirname "${BASH_SOURCE[0]}")
source "$this_dir/system_test_helpers.sh" || exit 1

# Exit the script on an undefined variable or a failed command.  Note that this
# means we must run all commands that are intended to fail inside "check_not" or
# "check_not_from", which will prevent the script from exiting.
set -e
set -u
trap 'handle_failure Line:${LINENO}' ERR

# General system tests

IMAGES_QUALITY="PageSpeedImageRecompressionQuality"
JPEG_QUALITY="PageSpeedJpegRecompressionQuality"
WEBP_QUALITY="PageSpeedWebpRecompressionQuality"

run_test gce_public_cache
run_test initial_header_check
run_test initial_sanity_checks
run_test query_params_in_resource_flow
run_test ipro
run_test add_instrumentation
run_test canonicalize_javascript_libraries
run_test combiners
run_test elide_attributes
run_test extend_cache
run_test js_blacklist
run_test move_css
run_test inliners
run_test outliners
run_test char_tweaks
run_test rewrite_css
run_test rewrite_images
run_test image_quality_generic
run_test image_quality_jpeg
run_test image_quality_webp
run_test image_resize
run_test broken_images
run_test make_show_ads_async
# Disable mobilizer tests.
# run_test mobilizer
run_test responsive_images
run_test shortcut_icons

# These have to run after image_rewrite tests. Otherwise it causes some images
# to be loaded into memory before they should be.
# TODO(jefftk): Is this actually a problem?
wait_for_async_tests
run_test css_images
run_test fallback_rewrite_css_urls
run_test images_in_styles
run_test rewrite_css_images
run_test css_sprite_images
run_test rewrite_javascript
run_test https
run_test convert_meta_tags
run_test lazyload_images
run_test rewrite_compressed_js
run_test no_cache
run_test defer_javascript
run_test inline_preview_images
run_test local_storage_cache
run_test flatten_css_imports
run_test insert_dns_prefetch
run_test dedup_inlined_images

if [ "$SECONDARY_HOSTNAME" != "" ]; then
  run_test cookie_options
  run_test sticky_cookie_options
  run_test signed_urls
  run_test redirect_with_ps_params
  run_test invalid_host_header
  run_test optimize_to_webp
  run_test image_quality_and_response
fi

run_test content_length
run_test keep_data_urls
run_test rel_canonical
run_test resource_content_type_html

wait_for_async_tests

# Remaining tests aren't converted to async, so we need to define the fetch
# variables for them and cleanup the now-shared OUTDIR.
define_fetch_variables

rm -rf $OUTDIR


text:
<?php

declare(strict_types=1);

namespace Sphp\Bootstrap\Components;

use Sphp\Config\ErrorHandling\ExceptionListener;
use Stringable;
use Throwable;
use Sphp\Config\ErrorHandling\Views\ThrowableSectionBuilder;

/**
 * Implements Foundation Callout for Exception presentation
 *
 * @author  Sami Holck <sami.holck@gmail.com>
 * @link    https://foundation.zurb.com/sites/docs/callout.html Foundation Callout
 * @license https://opensource.org/licenses/MIT The MIT License
 * @link    https://github.com/samhol/SPHP-framework GitHub repository
 * @filesource
 */
class ThrowableAlertBuilder implements ExceptionListener {

  private ThrowableSectionBuilder $sect;
  private bool $closable = false;

  /**
   * Constructor
   *
   * @param  ThrowableSectionBuilder|null $sect
   */
  public function __construct(?ThrowableSectionBuilder $sect = null) {
    if ($sect === null) {
      $sect = new ThrowableSectionBuilder();
    }
    $this->sect = $sect;
  }

  /**
   * Destructs the instance
   */
  public function __destruct() {
    unset($this->sect);
  }

  /**
   * Invokes the builder
   *
   * @param  Throwable $e
   * @return void
   */
  public function __invoke(Throwable $e): Stringable|string {
    return $this->build($e);
  }

  /**
   * Sets the visibility of the file
   *
   * @param  bool $closable true for visible file
   * @return $this for a fluent interface
   */
  public function setClosable(bool $closable) {
    $this->closable = $closable;
    return $this;
  }

  public function getBuilder(): ThrowableSectionBuilder {
    return $this->sect;
  }

  /**
   * Sets the visibility of the file
   *
   * @param  bool $show true for visible file
   * @return $this for a fluent interface
   */
  public function showInitialFile(bool $show) {
    $this->getBuilder()->showInitialFile($show);
    return $this;
  }

  /**
   * Sets the trace visibility
   *
   * @param  bool $show true for visible trace
   * @return $this for a fluent interface
   */
  public function showTrace(bool $show) {
    $this->getBuilder()->showTrace($show);
    return $this;
  }

  /**
   * Sets the previous exception visibility
   *
   * @param  bool $show true for visible previous exception
   * @return $this for a fluent interface
   */
  public function showPreviousException(bool $show) {
    $this->getBuilder()->showPreviousException($show);
    return $this;
  }

  /**
   * Creates the callout object
   *
   * @param  Throwable $e object thrown
   * @return Alert the object created
   */
  public function build(Throwable $e): Alert {
    $alert = new Alert('alert-danger');
    $alert->showDismissButton($this->closable);
    $alert->cssClasses()->protectValue('sphp-throwable-alert');
    $alert->append($this->getBuilder()->build($e));
    return $alert;
  }

  public function onException(Throwable $e): void {
    $this->build($e)->printHtml();
  }

}


text:
#pragma once

#include <armadillo>

namespace librender {
using arma::fmat;
using arma::umat;

enum class ShapeType { kTriangles, kLines, kPoints };

struct Shape {
  ShapeType type;

  fmat v;    // vertex position
  fmat vn;   // vertex normal
  fmat vc;   // vertex color
  fmat uv;   // vertex texture coordinate
  umat ind;  // index
};
}


text:
package edu.usfca.ds.views;

import edu.usfca.xj.appkit.gview.base.Vector2D;
import edu.usfca.xj.appkit.gview.object.GElement;
import edu.usfca.xj.appkit.gview.object.GElementArrow;
import edu.usfca.xj.appkit.gview.object.GElementLabel;

import java.awt.*;

public class DSViewListArray extends DSView {

    public final int LENGTH = 1;

    public final static int FIRST = 2;
    public final static int NEXT = 3;
    public final static int CURRENT = 4;
    public final static int INLIST = 5;
    public final static int INSERTBEFORE = 6;
    public final static int INSERTAFTER = 7;
    public final static int DELETE = 8;
    public final static int SETCURRENT = 9;
    public final static int ADDITERATOR = 10;
    public final static int ADD = 11;

    public final static Color iteratorColors[] = {Color.GREEN, Color.MAGENTA};

    protected GElement index[];
    protected int current[];
    protected GElement list[];
    protected GElementArrow currentarrow[];
    protected GElementLabel currentlabel[];
    public final int MAXLIST = 18;
    public final int NUMSTEPS = 25;
    protected int numiterator;
    protected int length;
    protected GElementLabel lengthlabel;

    public DSViewListArray() {
        //   super(container);

        int i;

        current = new int[2];
        currentarrow = new GElementArrow[2];
        currentlabel = new GElementLabel[2];
        GElementLabel indexlabel;
        current[0] = -1;
        current[1] = -1;
        length = 0;

        waitscalefactor /= 2;
        list = new GElement[MAXLIST];
        index = new GElementLabel[MAXLIST];
        for (i = 0; i < MAXLIST; i++) {
            list[i] = createRectangle("", i * 50 + 50, 250, 50, 50, false);
            index[i] = createLabel(String.valueOf(i), i * 50 + 50, 287, false);
            index[i].setLabelColor(Color.BLUE);

        }
        createLabel("Length:", 50, 120);
        lengthlabel = createLabel("0", 80, 120);

    }

    protected void CallFunction(int function) {
        switch (function) {
            case LENGTH:
                length();
                break;
            case ADDITERATOR:
                addIterator();
                break;
        }

    }

    protected void CallFunction(int function, Object param1) {

        switch (function) {

            case FIRST:
                first(((Integer) param1).intValue());
                break;
            case NEXT:
                next(((Integer) param1).intValue());
                break;
            case CURRENT:
                current(((Integer)param1).intValue());
                break;
            case INLIST:
                inlist(((Integer)param1).intValue());
                break;
            case DELETE:
                delete(((Integer)param1).intValue());
                break;
            case ADD:
                addtoend((String) param1);
                break;

        }
    }

    protected void CallFunction(int function, Object param1, Object param2) {
        Integer p1, p2i;
        String p2s;
        switch (function) {

            case INSERTBEFORE:

                p1 = (Integer) param1;
                p2s = (String) param2;
                insertBefore(p1.intValue(), p2s);
                break;

            case INSERTAFTER:

                p1 = (Integer) param1;
                p2s = (String) param2;
                insertAfter(p1.intValue(), p2s);
                break;

            case SETCURRENT:

                p1 = (Integer) param1;
                p2i = (Integer) param2;
                setCurrent(p1.intValue(), p2i.intValue());
                break;

        }
    }

    private void addtoend(String elem) {
        int j;
        Vector2D path[];

        if (length < MAXLIST) {
            GElementLabel l = createLabel("Adding: ", 100, 10);
            GElementLabel l2 = createLabel(elem, 140, 10);

            lengthlabel.setLabelColor(Color.RED);
            index[length].setLabelColor(Color.RED);
            repaintwait();
            path = createPath(l2.getPosition(), list[length].getPosition(), NUMSTEPS);

            for (j = 0; j < path.length; j++) {
                l2.setPosition(path[j]);
                repaintwaitmin();
            }
            list[length].setLabel(elem);
            removeAny(l);
            removeAny(l2);
            lengthlabel.setLabelColor(Color.BLACK);
            index[length].setLabelColor(Color.BLUE);

            length++;
            if (length == 1) {
                if (current[0] == 0) {
                    currentarrow[0] = createArrow(50, 170, 50, 225, 20);
                    currentarrow[0].setColor(iteratorColors[0]);
                }
                if (current[1] == 0) {
                    currentarrow[1] = createArrow(50, 345, 50, 300, 20);
                    currentarrow[1].setColor(iteratorColors[1]);

                }
            }
            lengthlabel.setLabel(String.valueOf(length));
        } else {
            GElementLabel error = createLabel("List is full", 200, 20);
            HoldoverGraphics.add(error);

        }

    }

    private void delete(int itr) {
        int i, j;
        if ((current[itr] < 0) || (current[itr] >= length)) {
            GElementLabel l = createLabel("Iterator not in the list:  Delete not valid", 200, 20);
            l.setLabelColor(iteratorColors[itr]);
            HoldoverGraphics.add(l);
        } else {
            list[current[itr]].setLabel("");
            for (i = current[itr] + 1; i < length; i++) {
                GElement l = createLabel(list[i].getLabel(), 50 + i * 50, 250, false);
                list[i].setLabel("");
                for (j = 0; j < NUMSTEPS; j++) {
                    l.move(-50 / NUMSTEPS, 0);
                    if (i == current[0]) {
                        currentarrow[0].move(-50 / NUMSTEPS, 0);
                        currentlabel[0].move(-50 / NUMSTEPS, 0);
                    }
                    if ((numiterator == 2) && (i == current[1])) {
                        currentarrow[1].move(-50 / NUMSTEPS, 0);
                        currentlabel[1].move(-50 / NUMSTEPS, 0);
                    }
                    repaintwaitmin();
                }
                if (i == current[0])
                    current[0]--;
                if (i == current[1])
                    current[1]--;
                list[i - 1].setLabel(l.getLabel());
                removeAny(l);

            }
            length--;
            for (j = 0; j < 2; j++) {
                if (current[j] == length) {
                    current[j] = -1;
                    removeAny(currentarrow[j]);
                    currentarrow[j] = null;
                    currentlabel[j].move(50 - currentlabel[j].getPositionX(), 0);

                }
            }
            lengthlabel.setLabel(String.valueOf(length));
        }
    }

    private void inlist(int itr) {
        GElementLabel l;
        if (current[itr] >= 0 && current[itr] < length)
            l = createLabel("Iterator is in the list", 200, 20);
        else
            l = createLabel("Iterator is not in the list", 200, 20);

        l.setLabelColor(iteratorColors[itr]);
        HoldoverGraphics.add(l);
    }

    private void current(int itr) {
        int j;
        if ((current[itr] < 0) || (current[itr] >= length)) {
            GElementLabel l = createLabel("Iterator not in the list:  Current not valid", 200, 20);
            l.setLabelColor(iteratorColors[itr]);
            HoldoverGraphics.add(l);
        } else {
            GElementLabel l = createLabel("Current Element: ", 200, 20);
            l.setLabelColor(iteratorColors[itr]);
            GElementLabel eleml = createLabel(list[current[itr]].getLabel(),
                                              list[current[itr]].getPositionX(),
                                              list[current[itr]].getPositionY());
            Vector2D[] path = createPath(eleml.getPosition(),
                                         new Vector2D(285, 20), NUMSTEPS);
            for (j = 0; j < NUMSTEPS; j++) {
                eleml.setPosition(path[j]);
                repaintwaitmin();
            }
            GElement lst[] = {l,eleml};
            LineupHorizontal(lst);
            HoldoverGraphics.add(l);
            HoldoverGraphics.add(eleml);
        }
    }

    private void next(int itr) {

        int j;
        if ((current[itr] < 0) || (current[itr] >= length)) {
            GElement l = createLabel("Iterator is not in the list, cannot advance", 200, 20);
            l.setLabelColor(iteratorColors[itr]);
            HoldoverGraphics.add(l);
        } else {
            if (current[itr] == length - 1) {
                current[itr] = -1;
                removeAny(currentarrow[itr]);
                currentarrow[itr] = null;
                currentlabel[itr].move(50 - currentlabel[itr].getPositionX(), 0);
            } else {
                for (j = 0; j < NUMSTEPS; j++) {
                    currentlabel[itr].move(50 / NUMSTEPS, 0);
                    currentarrow[itr].move(50 / NUMSTEPS, 0);
                    repaintwaitmin();
                }
                current[itr]++;

            }

        }
        repaint();
    }

    private void first(int itr) {

        if (currentarrow[itr] != null) {
            removeAny(currentarrow[itr]);
            currentarrow[itr] = null;
        }
        if (length > 0) {
            currentlabel[itr].move(50 - currentlabel[itr].getPositionX(), 0);
            if (itr == 0) {
                currentarrow[0] = createArrow(50, 170, 50, 225, 20);

            } else { /* itr == 1 */
                currentarrow[1] = createArrow(50, 345, 50, 300, 20);
            }
            currentarrow[itr].setColor(iteratorColors[itr]);
        }
        current[itr] = 0;
        repaint();
    }

    private void addIterator() {
        if (numiterator == 0) {
            currentlabel[0] = createLabel("current", 50, 150);
            currentlabel[0].setLabelColor(iteratorColors[0]);
            numiterator = 1;
            current[0] = 0;
            if (length > 0) {
                currentarrow[0] = createArrow(50, 170, 50, 225, 20);
                currentarrow[0].setColor(iteratorColors[0]);

            }
        } else if (numiterator == 1) {
            currentlabel[1] = createLabel("current", 50, 355);
            currentlabel[1].setLabelColor(iteratorColors[1]);
            numiterator = 2;
            current[1] = 0;
            current[0] = 0;
            if (length > 0) {
                currentarrow[1] = createArrow(50, 345, 50, 300, 20);
                currentarrow[1].setColor(iteratorColors[1]);
            }
        }
    }

    private void length() {
        Vector2D[] path;
        int j;
        GElementLabel l = createLabel("Length = ", 100, 10);
        GElementLabel l2 = createLabel(lengthlabel.getLabel(), lengthlabel.getPositionX(), lengthlabel.getPositionY());

        path = createPath(l2.getPosition(), new Vector2D(140, 10), NUMSTEPS);
        for (j = 0; j < path.length; j++) {
            l2.setPosition(path[j]);
            repaintwaitmin();
        }
        HoldoverGraphics.add(l);
        HoldoverGraphics.add(l2);
    }

    private void setCurrent(int itr, int indx) {
        int j;
        if ((indx < 0) || (indx >= length)) {
            GElement l = createLabel("Index " + indx + " is not in the list, cannot set iterator", 200, 20);
            l.setLabelColor(iteratorColors[itr]);
            HoldoverGraphics.add(l);
        } else {
            GElementLabel l = createLabel("Setting Current:",100,10);
            l.setLabelColor(iteratorColors[itr]);
            GElementLabel l2 = createLabel(String.valueOf(indx), 180, 10);
            repaintwait();
            l2.setLabelColor(Color.RED);
            index[indx].setLabelColor(Color.RED);
            repaintwait();

            if ((current[itr] < 0) || (current[itr] >= length)) {
                currentlabel[itr].move(indx * 50 + 50 - currentlabel[itr].getPositionX(), 0);
                current[itr] = indx;
                if (itr == 0) {
                    currentarrow[itr] = createArrow(indx * 50 + 50, 170, indx * 50 + 50, 225, 20, false);

                } else {

                    currentarrow[itr] = createArrow(indx * 50 + 50, 330, indx * 50 + 50, 285, 20, false);

                }
                currentarrow[itr].setColor(iteratorColors[itr]);
            } else {
                current[itr] = indx;
                int arrowmovedelta = (int) (indx * 50 + 50 - currentarrow[itr].getPositionX()) / NUMSTEPS;
                int labelmovedelta = (int) (indx * 50 + 50 - currentlabel[itr].getPositionX()) / NUMSTEPS;
                for (j = 0; j < NUMSTEPS; j++) {
                    currentarrow[itr].move(arrowmovedelta, 0);
                    currentlabel[itr].move(labelmovedelta, 0);
                    repaintwaitmin();

                }
            }
            index[indx].setLabelColor(Color.BLUE);
            removeAny(l);
            removeAny(l2);
        }
    }

    private void shiftElementsRight(int firstmove) {
        boolean otherfix = false;
        int i, j;

        for (i = length - 1; i >= firstmove; i--) {
            GElement l = createLabel(list[i].getLabel(), 50 + i * 50, 250, false);
            list[i].setLabel("");
            for (j = 0; j < NUMSTEPS; j++) {
                l.move(50 / NUMSTEPS, 0);
                if (i == current[0]) {
                    currentarrow[0].move(50 / NUMSTEPS, 0);
                    currentlabel[0].move(50 / NUMSTEPS, 0);
                }
                if ((numiterator == 2) && (i == current[1])) {
                    currentarrow[1].move(50 / NUMSTEPS, 0);
                    currentlabel[1].move(50 / NUMSTEPS, 0);
                }
                repaintwaitmin();
            }
            if (i == current[0])
                current[0]++;
            if (i == current[1])
                current[1]++;
            list[i + 1].setLabel(l.getLabel());
            removeAny(l);
            repaint();

        }
    }

    private void insertAfter(int itr, String elem) {
        if (current[itr] >= 0 && current[itr] < length && length < MAXLIST) {
            shiftElementsRight(current[itr] + 1);
            list[current[itr] + 1].setLabel(String.valueOf(elem));
            length++;
        } else if (length == MAXLIST) {
            GElementLabel l = createLabel("List is full", 200, 20);
            l.setLabelColor(iteratorColors[itr]);
            HoldoverGraphics.add(l);
        } else {
            GElementLabel l = createLabel("Iterator not in the list, cannot insert", 200, 20);
            l.setLabelColor(iteratorColors[itr]);
            HoldoverGraphics.add(l);
        }
        lengthlabel.setLabel(String.valueOf(length));

        repaint();

    }

    private void insertBefore(int itr, String elem) {
        int j;
        Vector2D path[];

        if (current[itr] >= 0 && current[itr] < length && length < MAXLIST) {
            GElementLabel l = createLabel("Inserting: ", 100, 10);
            l.setLabelColor(iteratorColors[itr]);
            GElementLabel l2 = createLabel(elem, 140, 10);

            shiftElementsRight(current[itr]);

            path = createPath(l2.getPosition(),list[current[itr]-1].getPosition(),NUMSTEPS);
            for (j=0; j < path.length; j++) {
                l2.setPosition(path[j]);
                repaintwaitmin();
            }
            removeAny(l2);
            removeAny(l);

            list[current[itr] - 1].setLabel(String.valueOf(elem));
            length++;
        } else if (length == MAXLIST) {
            GElementLabel l = createLabel("List is full", 100, 10);
            l.setLabelColor(iteratorColors[itr]);
            HoldoverGraphics.add(l);
        } else {
            GElementLabel l = createLabel("Iterator not in the list, cannot insert", 200, 20);
            l.setLabelColor(iteratorColors[itr]);
            HoldoverGraphics.add(l);
        }
        lengthlabel.setLabel(String.valueOf(length));

        repaint();

    }

}


text:
<?php
use yii\helpers\Url;
use yii\helpers\Html;
?>

        ×

<?=Yii::t('app','Withdrawals')?>

        <?php if(is_null($paymentProfile) || $paymentProfile->checkFieldsEmpty() === FALSE) { ?>

<?=Yii::t('app','You has not any payee data. Setup it in  users cabinet')?>

        <?php }else{ ?>

        <form id="withdrawals_form" method="post" action="<?=Url::to(['/user/withdrawals'], true)?>">
            <fieldset>
                ×
<?=Html::hiddenInput('user_id', $profile->user_id)?>
<?=Html::dropDownList('choise', $paymentProfile->choise, $paymentProfile->varriantsListCreate(), ['style'=>'width:50%'])?>

Amount

<?=Html::textInput('amount') ?>

            <input id="wd-submit" class="btn btn-average btn-width" type="submit" value="SEND">
            </fieldset>
        </form>
       <?php } ?>


text:
laughing-shame
==============

Small bitstamp bitcoin ticker in python


text:
require 'guard/compat/plugin'
require 'guard/test/version'
require 'test/unit/version'

module Guard
  class Test < Plugin

    require 'guard/test/runner'
    require 'guard/test/inspector'

    def initialize(options = {})
      super
      @options = {
        all_on_start:   true,
        all_after_pass: true,
        keep_failed:    true,
        test_paths:     ['test']
      }.update(options)
      @last_failed  = false
      @failed_paths = []

      @runner = Runner.new(options)
    end

    def start
      Compat::UI.info("Guard::Test #{TestVersion::VERSION} is running, " +
                       "with Test::Unit #{::Test::Unit::VERSION}!", reset: true)
      run_all if @options[:all_on_start]
    end

    def run_all
      Inspector.test_paths = @options[:test_paths]
      test_paths = @options[:test_paths].clone # because clean - cleaning variable
      passed = @runner.run(Inspector.clean(test_paths), message: 'Running all tests')

      @failed_paths = [] if passed
      @last_failed  = !passed
    end

    def reload
      @failed_paths = []
    end

    def run_on_modifications(paths)
      Inspector.test_paths = @options[:test_paths]
      paths += @failed_paths if @options[:keep_failed]
      paths  = Inspector.clean(paths)
      passed = @runner.run(paths)

      if passed
        # clean failed paths memory
        @failed_paths -= paths if @options[:keep_failed]

        # run all the tests if the changed tests failed, like autotest
        run_all if @last_failed && @options[:all_after_pass]
      else
        # remember failed paths for the next change
        @failed_paths += paths if @options[:keep_failed]

        # track whether the changed tests failed for the next change
        @last_failed = true
      end
    end

  end
end


text:
% VL_FISHER    Fisher vector feature encoding
%   ENC = VL_FISHER(X, MEANS, COVARIANCES, PRIORS) computes the
%   Fisher vector encoding of the vectors X relative to the Gaussian
%   mixture model with means MEANS, covariances COVARIANCES, and pror
%   mode probabilities PRIORS.
%
%   X has one column per data vector (e.g. a SIFT descriptor), and
%   MEANS and COVARIANCES one column per GMM component (covariance
%   matrices are assumed diagonal). PRIORS has size equal to the
%   number of GMM components. All data must be of the smae class,
%   either SINGLE or DOUBLE.
%
%   ENC is a vector of the same class of X of size equal to the
%   product of the data dimension and the number of components.
%
%   By default, the standard Fisher vector is computed. VL_FISHER()
%   accepts the following options:
%
%   Normalized::
%     If specified, L2 normalize the Fisher vector.
%
%   SquareRoot::
%     If specified, the signed square root function is applied to
%     ENC before normalization.
%
%   Verbose::
%     Increase the verbosity level (may be specified multiple times).
%
%   See: Fisher vectors, VL_HELP().

% Authors: David Novotny, Andrea Vedaldi

% Copyright (C) 2013 David Novotny and Andrea Vedaldi
% All rights reserved.
%
% This file is part of the VLFeat library and is made available under
% the terms of the BSD license (see the COPYING file).


text:
defined?(Footnotes) && Footnotes.setup do |f|
  # Wether or not to enable footnotes
  f.enabled = Rails.env.development?
  f.lock_top_right = true
  # You can also use a lambda / proc to conditionally toggle footnotes
  # Example :
  # f.enabled = -> { User.current.admin? }
  # Beware of thread-safety though, Footnotes.enabled is NOT thread safe
  # and should not be modified anywhere else.

  # Only toggle some notes :
  # f.notes = [:session, :cookies, :params, :filters, :routes, :env, :queries, :log, :general]

  # Change the prefix :
  # f.prefix = 'mvim://open?url=file://%s&line=%d&column=%d'

  # Disable style :
  # f.no_style = true

  # Lock notes to top right :
  # f.lock_top_right = true

  # Change font size :
  # f.font_size = '11px'

  # Allow to open multiple notes :
  # f.multiple_notes = true
end


text:
using System.Collections.Generic;
using System.Linq;
using DZ.Tools.Interfaces;

namespace DZ.Tools
{
    /// <summary>
    /// Represents training model data container
    /// </summary>
    public sealed class TagsCorpus<TTag>
    {
        /// <summary>
        /// Creates new instance
        /// </summary>
        public TagsCorpus(List<Tag<TTag>> tags = null)
        {
            Tags = tags ?? new List<Tag<TTag>>();
            ClearedText = string.Empty;
        }

        /// <summary>
        /// Creates new instance
        /// </summary>
        public TagsCorpus(params Tag<TTag>[] tags)
        {
            Tags = tags.ToList();
            ClearedText = string.Empty;
        }

        /// <summary>
        /// List of tags in model sorted by position
        /// </summary>
        public List<Tag<TTag>> Tags { get; private set; }

        /// <summary>
        /// Cleared text that should be input for the training
        /// </summary>
        public string ClearedText { get; set; }

        /// <summary>
        /// Renders model into string
        /// </summary>
        /// <returns></returns>
        public string Render(ITagsRenderer<TTag> renderer)
        {
            return renderer.Render(ClearedText, Tags);
        }
    }
}


text:
package provingground.learning
import provingground.{FiniteDistribution => FD, _}
import shapeless.HList._
import shapeless._

import scala.collection.immutable

object TruncatedFiniteDistribution {
  import GeometricDistribution._

  object Geom
      extends TruncatedFiniteDistribution[VarValueSet[FD]](
        nodeCoeffSeq,
        0.3
      )

  def geomFD(epsilon: Double): FD[Int] =
    Geom.varDist(initState)(GeomVar, epsilon)
}

abstract class GenTruncatedFiniteDistribution[State](
    nodeCoeffSeq: NodeCoeffSeq[State, Double])(
    implicit sd: StateDistribution[State, FD]) {
  import NodeCoeffs._
  import nodeCoeffSeq.find

  /**
    * finite distribution for a random variable
    * @param initState initial state
    * @param randomVar random variable whose distribution is returned
    * @param epsilon cutoff
    * @tparam Y values of the random variable
    * @return finite distribution for the given random variable
    */
  def varDist[Y](initState: State)(randomVar: RandomVar[Y],
                                   epsilon: Double): FD[Y] =
    if (epsilon > 1) FD.empty[Y]
    else
      randomVar match {
        case RandomVar.AtCoord(randomVarFmly, fullArg) =>
          varFamilyDist(initState)(randomVarFmly, epsilon)
            .getOrElse(fullArg, FD.empty[Y])
            .flatten
            .safeNormalized
        case _ =>
          find(randomVar)
            .map { nc =>
              nodeCoeffDist(initState)(nc, epsilon).flatten.safeNormalized
            }
            .getOrElse(FD.empty[Y])
      }

  /**
    * finite distribution for a list of random variables
    * @param initState initial state
    * @param vl list of random variables
    * @param epsilon cutoff
    * @tparam Dom the `HList` giving the type of the variable list
    * @return finite distribution of `Dom`
    */
  def varListDist[Dom <: HList](initState: State)(vl: RandomVarList[Dom],
                                                  epsilon: Double): FD[Dom] =
    vl match {
      case RandomVarList.Nil => FD.unif(HNil)
      case RandomVarList.Cons(head, tail) =>
        varDist(initState)(head, epsilon)
          .zip(varListDist(initState)(tail, epsilon))
          .map { case (x, y) => x :: y }
    }

  def nodeCoeffDist[Y](initState: State)(
      nodeCoeffs: NodeCoeffs[State, Double, HNil, Y],
      epsilon: Double): FD[Y] =
    if (epsilon > 1) FD.empty[Y]
    else
      nodeCoeffs match {
        case Target(_) => FD.empty[Y]
        case bc: Cons[State, Double, HNil, Y] =>
          val p: Double = bc.headCoeff
          val d: FD[Y] =
            bc.headGen match {
              case gen: GeneratorNode[Y] =>
                nodeDist(initState)(gen, epsilon / p) * p
              case _ =>
                throw new IllegalArgumentException(
                  "found node family for generating a simple random variable")
            }
          d ++ nodeCoeffDist(initState)(bc.tail, epsilon)
      }

  def mapsSum[X, Y](first: Map[X, FD[Y]],
                    second: Map[X, FD[Y]]): Map[X, FD[Y]] =
    (for {
      k <- first.keySet union second.keySet
      v = first.getOrElse(k, FD.empty[Y]) ++ second.getOrElse(k, FD.empty[Y])
    } yield (k, v)).toMap

  def nodeCoeffFamilyMap[Dom <: HList, Y](initState: State)(
      nodeCoeffs: NodeCoeffs[State, Double, Dom, Y],
      baseDist: FD[Dom],
      epsilon: Double): Map[Dom, FD[Y]] =
    if (epsilon > 1) Map()
    else
      nodeCoeffs match {
        case Target(_) => Map()
        case bc: BaseCons[State, Double, Dom, Y] =>
          val p = bc.headCoeff
          mapsSum(nodeFamilyDist(initState)(bc.headGen, baseDist, epsilon),
                  nodeCoeffFamilyMap(initState)(bc.tail,
                                                baseDist,
                                                epsilon / (1.0 - p)))
        case rc: RecCons[State, Double, Dom, Y] =>
          val p = rc.headCoeff
          mapsSum(nodeFamilyDist(initState)(rc.headGen, baseDist, epsilon),
                  nodeCoeffFamilyMap(initState)(rc.tail,
                                                baseDist,
                                                epsilon / (1.0 - p)))
      }

  def varFamilyDist[RDom <: HList, Y](initState: State)(
      randomVarFmly: RandomVarFamily[RDom, Y],
      epsilon: Double): Map[RDom, FD[Y]] =
    if (epsilon > 1) Map()
    else
      find(randomVarFmly)
        .map { nc =>
          val base = varListDist(initState)(nc.output.polyDomain, epsilon)
          nodeCoeffFamilyMap(initState)(nc, base, epsilon)
        }
        .getOrElse(Map())

  def nodeFamilyDist[Dom <: HList, Y](initState: State)(
      generatorNodeFamily: GeneratorNodeFamily[Dom, Y],
      baseDist: FD[Dom],
      epsilon: Double): Map[Dom, FD[Y]] =
    generatorNodeFamily match {
      case node: GeneratorNode[Y] =>
        Map(HNil -> nodeDist(initState)(node, epsilon))
      case fml: GeneratorNodeFamily.Pi[Dom, Y] =>
        val kvs: Vector[(Dom, FD[Y])] =
          for {
            Weighted(arg, p) <- baseDist.pmf
            d = nodeDist(initState)(fml.nodes(arg), epsilon / p)
          } yield arg -> d
        kvs.toMap
      case fml: GeneratorNodeFamily.PiOpt[Dom, Y] =>
        val kvs: Vector[(Dom, FD[Y])] =
          for {
            Weighted(arg, p) <- baseDist.pmf
            node             <- fml.nodesOpt(arg)
            d = nodeDist(initState)(node, epsilon / p)
          } yield arg -> d
        kvs.toMap
    }

  def nodeDist[Y](initState: State)(generatorNode: GeneratorNode[Y],
                                    epsilon: Double): FD[Y]

}

/**
  * resolving a general specification of a recursive generative model as finite distributions, depending on truncation;
  * the coefficients of the various generator nodes should be `Double`
  *
  * @param nodeCoeffSeq the various generator nodes with coefficients for various random variables and families
  * @param sd finite distributions from the initial state corresponding to random variables and families
  * @tparam State scala type of the initial state
  */
case class TruncatedFiniteDistribution[State](
    nodeCoeffSeq: NodeCoeffSeq[State, Double], varWeight: Double)(
    implicit sd: StateDistribution[State, FD])
    extends GenTruncatedFiniteDistribution[State](nodeCoeffSeq) {

  /**
    * update coefficients, to be used in complex islands
    * @param dataSeq the new coefficients
    * @return [[TruncatedFiniteDistribution]] with updated coefficients
    */
  def updateAll(
      dataSeq: Seq[GeneratorNodeFamily.Value[_ <: HList, _, Double]]) =
    TruncatedFiniteDistribution(nodeCoeffSeq.updateAll(dataSeq), varWeight)

  import StateDistribution._

  /**
    * recursively determines the finite distribution given a generator node;
    * the main work is done here
    *
    * @param initState  initial state
    * @param generatorNode generator node to resolve
    * @param epsilon cutoff
    * @tparam Y values of the corresponding random variable
    * @return distribution corresponding to the `output` random variable
    */
  def nodeDist[Y](initState: State)(generatorNode: GeneratorNode[Y],
                                    epsilon: Double): FD[Y] =
    if (epsilon > 1) FD.empty[Y]
    else {
      import GeneratorNode._
      generatorNode match {
        case Atom(x, input) =>
          FD.unif(x)
        case Init(input) =>
          value(initState)(input).purge(epsilon)
        case Map(f, input, _) =>
          varDist(initState)(input, epsilon).map(f).purge(epsilon)
        case MapOpt(f, input, _) =>
          varDist(initState)(input, epsilon).condMap(f).purge(epsilon)
        case ZipMap(f, input1, input2, _) =>
          val d1 = varDist(initState)(input1, epsilon).flatten
          val d2 = varDist(initState)(input2, epsilon).flatten
          d1.zip(d2).map { case (x, y) => f(x, y) }.purge(epsilon)
        case ZipMapOpt(f, input1, input2, _) =>
          val d1 = varDist(initState)(input1, epsilon).flatten
          val d2 = varDist(initState)(input2, epsilon).flatten
          d1.zip(d2).condMap { case (x, y) => f(x, y) }.purge(epsilon)
        case ZipFlatMap(baseInput, fiberVar, f, _) =>
          val baseDist = varDist(initState)(baseInput, epsilon).flatten
          val pmf =
            for {
              Weighted(x1, p1) <- baseDist.pmf
              fiberDist = varDist(initState)(fiberVar(x1), epsilon / p1).flatten
              Weighted(x2, p2) <- fiberDist.pmf
            } yield Weighted(f(x1, x2), p1 * p2)
          FD(pmf).flatten.purge(epsilon)
        case FlatMap(baseInput, fiberNode, _) =>
          val baseDist = varDist(initState)(baseInput, epsilon).flatten
          val pmf =
            for {
              Weighted(x1, p1) <- baseDist.pmf
              fiberDist = nodeDist(initState)(fiberNode(x1), epsilon / p1).flatten
              Weighted(x2, p2) <- fiberDist.pmf
            } yield Weighted(x2, p1 * p2)
          FD(pmf).flatten.purge(epsilon)
        case FlatMapOpt(baseInput, fiberNodeOpt, _) =>
          val baseDist = varDist(initState)(baseInput, epsilon).flatten
          val pmf =
            for {
              Weighted(x1, p1) <- baseDist.pmf
              node             <- fiberNodeOpt(x1).toVector
              fiberDist = nodeDist(initState)(node, epsilon / p1).flatten
              Weighted(x2, p2) <- fiberDist.pmf
            } yield Weighted(x2, p1 * p2)
          FD(pmf).flatten.purge(epsilon)
        case FiberProductMap(quot, fiberVar, f, baseInput, _) =>
          val d1          = varDist(initState)(baseInput, epsilon).flatten
          val byBase      = d1.pmf.groupBy { case Weighted(x, p) => quot(x) } // pmfs grouped by terms in quotient
          val baseWeights = byBase.view.mapValues(v => v.map(_.weight).sum) // weights of terms in the quotient
          val pmf: immutable.Iterable[Weighted[Y]] =
            for {
              (z, pmf1) <- byBase // `z` is in the base, `pmf1` is all terms above `z`
              d2 = varDist(initState)(fiberVar(z), epsilon / baseWeights(z)).flatten // distribution of the fiber at `z`
              d = FD(pmf1)
                .zip(d2)
                .map { case (x1, x2) => f(x1, x2) }
                .flatten // mapped distribution over `z`
              wtd <- d.pmf // terms in pmf over z, should be flatMapped over `z`
            } yield wtd
          FD(pmf.toVector).purge(epsilon)
        case tc: ThenCondition[o, Y] =>
          import tc._
          val base = nodeDist(initState)(gen, epsilon)
          import Sort._
          condition match {
            case _: All[_]    => base
            case c: Filter[_] => base.conditioned(c.pred).purge(epsilon)
            case Restrict(f)  => base.condMap(f).purge(epsilon)
          }
        case isle: Island[y, State, o, b] =>
          import isle._
          val (isleInit, boat) = initMap(initState)(varWeight)                             // initial condition for island, boat to row back
          val isleOut          = varDist(isleInit)(islandOutput(boat), epsilon) //result for the island
          isleOut
            .map(export(boat, _) : Y)
            .purge(epsilon) // exported result seen outside
      }
    }
}


text:
package com.viesis.viescraft.client.gui;

import com.viesis.viescraft.api.References;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation;

public class GuiButtonConfirmVC extends GuiButton {

	protected static final ResourceLocation BUTTON_TEXTURES = new ResourceLocation(References.MOD_ID_COLON + "textures/gui/buttons_general.png");

	public GuiButtonConfirmVC(int buttonId, int x, int y, int widthIn, int heightIn, String buttonText)
	{
		super(buttonId, x, y, widthIn, heightIn, buttonText);

		this.width = 200;
        this.height = 20;
        this.enabled = true;
        this.visible = true;
        this.id = buttonId;
        this.xPosition = x;
        this.yPosition = y;
        this.width = widthIn;
        this.height = heightIn;
        this.displayString = buttonText;
	}

	@Override
	public void drawButton(Minecraft mc, int mouseX, int mouseY)
	{
		if (this.visible)
        {
			FontRenderer fontrenderer = mc.fontRendererObj;
            mc.getTextureManager().bindTexture(BUTTON_TEXTURES);
            GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
            this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
            int i = this.getHoverState(this.hovered);
            GlStateManager.enableBlend();
            GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
            GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);

            //First half of the button
            this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 54 + i * 20, this.width / 2, this.height);
            //Second half of the button
            this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 54 + i * 20, this.width / 2, this.height);
            //Test overlay

            //GlStateManager.pushMatrix();
			//{
			//	GlStateManager.translate(this.xPosition+1, this.yPosition+1, 0);
			//	GlStateManager.scale(.25, .25, .25);

			//	this.drawTexturedModalRect(0, 0, 0, 74, 136, 48);
			//}
			//GlStateManager.popMatrix();

            this.mouseDragged(mc, mouseX, mouseY);
            int j = 14737632;

            if (packedFGColour != 0)
            {
                j = packedFGColour;
            }
            else
            if (!this.enabled)
            {
                j = 10526880;
            }
            else if (this.hovered)
            {
                j = 16777120;
            }

            GlStateManager.pushMatrix();
			{
				GlStateManager.translate(this.xPosition + this.width / 2, this.yPosition + (this.height - 6) / 2, 0); //-6 was a -8 by default
				GlStateManager.scale(.8, .8, .8);

				this.drawCenteredString(fontrenderer, this.displayString, 0, 0, j);
			}
			GlStateManager.popMatrix();
        }
	}
}


text:
#ifndef _NIC_H
#define _NIC_H

//Dependencies
#include "core/net.h"

//Tick interval to handle NIC periodic operations
#ifndef NIC_TICK_INTERVAL
   #define NIC_TICK_INTERVAL 1000
#elif (NIC_TICK_INTERVAL < 100)
   #error NIC_TICK_INTERVAL parameter is not valid
#endif

//Size of the NIC driver context
#ifndef NIC_CONTEXT_SIZE
   #define NIC_CONTEXT_SIZE 8
#elif (NIC_CONTEXT_SIZE < 1)
   #error NIC_CONTEXT_SIZE parameter is not valid
#endif

/**
 * @brief NIC types
 **/

typedef enum
{
   NIC_TYPE_ETHERNET = 0, ///<Ethernet interface
   NIC_TYPE_PPP      = 1, ///<PPP interface
   NIC_TYPE_6LOWPAN  = 2  ///<6LoWPAN interface
} NicType;

//NIC abstraction layer
typedef error_t (*NicInit)(NetInterface *interface);
typedef void (*NicTick)(NetInterface *interface);
typedef void (*NicEnableIrq)(NetInterface *interface);
typedef void (*NicDisableIrq)(NetInterface *interface);
typedef void (*NicEventHandler)(NetInterface *interface);
typedef error_t (*NicSetMacFilter)(NetInterface *interface);
typedef error_t (*NicSendPacket)(NetInterface *interface, const NetBuffer *buffer, size_t offset);
typedef void (*NicWritePhyReg)(uint8_t phyAddr, uint8_t regAddr, uint16_t data);
typedef uint16_t (*NicReadPhyReg)(uint8_t phyAddr, uint8_t regAddr);

//PHY abstraction layer
typedef error_t (*PhyInit)(NetInterface *interface);
typedef void (*PhyTick)(NetInterface *interface);
typedef void (*PhyEnableIrq)(NetInterface *interface);
typedef void (*PhyDisableIrq)(NetInterface *interface);
typedef bool_t (*PhyEventHandler)(NetInterface *interface);

//SPI abstraction layer
typedef error_t (*SpiInit)(void);
typedef error_t (*SpiSetMode)(uint_t mode);
typedef error_t (*SpiSetBitrate)(uint_t bitrate);
typedef void (*SpiAssertCs)(void);
typedef void (*SpiDeassertCs)(void);
typedef uint8_t (*SpiTransfer)(uint8_t data);

//UART abstraction layer
typedef error_t (*UartInit)(void);
typedef void (*UartEnableIrq)(void);
typedef void (*UartDisableIrq)(void);
typedef void (*UartStartTx)(void);

//External interrupt line abstraction layer
typedef error_t (*ExtIntInit)(void);
typedef void (*ExtIntEnableIrq)(void);
typedef void (*ExtIntDisableIrq)(void);

/**
 * @brief NIC driver
 **/

typedef struct
{
   NicType type;
   size_t mtu;
   NicInit init;
   NicTick tick;
   NicEnableIrq enableIrq;
   NicDisableIrq disableIrq;
   NicEventHandler eventHandler;
   NicSetMacFilter setMacFilter;
   NicSendPacket sendPacket;
   NicWritePhyReg writePhyReg;
   NicReadPhyReg readPhyReg;
   bool_t autoPadding;
   bool_t autoCrcGen;
   bool_t autoCrcCheck;
} NicDriver;

/**
 * @brief PHY driver
 **/

typedef struct
{
   PhyInit init;
   PhyTick tick;
   PhyEnableIrq enableIrq;
   PhyDisableIrq disableIrq;
   PhyEventHandler eventHandler;
} PhyDriver;

/**
 * @brief SPI driver
 **/

typedef struct
{
   SpiInit init;
   SpiSetMode setMode;
   SpiSetBitrate setBitrate;
   SpiAssertCs assertCs;
   SpiDeassertCs deassertCs;
   SpiTransfer transfer;
} SpiDriver;

/**
 * @brief UART driver
 **/

typedef struct
{
   UartInit init;
   UartEnableIrq enableIrq;
   UartDisableIrq disableIrq;
   UartStartTx startTx;
} UartDriver;

/**
 * @brief External interrupt line driver
 **/

typedef struct
{
   ExtIntInit init;
   ExtIntEnableIrq enableIrq;
   ExtIntDisableIrq disableIrq;
} ExtIntDriver;

//NIC abstraction layer
void nicTick(NetInterface *interface);
error_t nicSetMacFilter(NetInterface *interface);
error_t nicSendPacket(NetInterface *interface, const NetBuffer *buffer, size_t offset);
void nicProcessPacket(NetInterface *interface, void *packet, size_t length);
void nicNotifyLinkChange(NetInterface *interface);

#endif


text:
/// Copyright (c) 2012 Ecma International.  All rights reserved.
/**
 * @path ch15/15.2/15.2.3/15.2.3.5/15.2.3.5-4-209.js
 * @description Object.create - 'writable' property of one property in 'Properties' is +0 (8.10.5 step 6.b)
 */

function testcase() {

        var newObj = Object.create({}, {
            prop: {
                writable: +0
            }
        });
        var hasProperty = newObj.hasOwnProperty("prop") && typeof newObj.prop === "undefined";

        newObj.prop = 121;

        return hasProperty && typeof newObj.prop === "undefined";
    }
runTestCase(testcase);


text:
  <TITLE>
  EMBOSS: whichdb
  </TITLE>

whichdb

Wiki

The master copies of EMBOSS documentation are available
at
http://emboss.open-bio.org/wiki/Appdocs
on the EMBOSS Wiki.

Please help by correcting and extending the Wiki pages.

    Function

Search all sequence databases for an entry and retrieve it

    Description

whichdb searches all available sequence databases for sequences with a specified ID name or accession number.  The uniform sequence address (USA) of matching database entries is written to an output file. whichdb will, optionally, write out the sequences it finds to files.  An "available" database is one that has been defined in the EMBOSS system file (<tt>.embossrc</tt> or <tt>emboss.login</tt>) and is available from the system you are running EMBOSS. If you do not know which database(s) contain the entry you are interested in, whichdb will tell you.

    Usage

Here is a sample session with whichdb

% whichdb -showall
Search all sequence databases for an entry and retrieve it
ID or Accession number: x65923
Output file [outfile.whichdb]:

Go to the output files for this example

    Command line arguments

Search all sequence databases for an entry and retrieve it
Version: EMBOSS:6.6.0.0

   Standard (Mandatory) qualifiers (* if not always prompted):
  [-entry]             string     ID or Accession number (Any string)
*  -outfile            outfile    [*.whichdb] Output file name

   Additional (Optional) qualifiers: (none)
   Advanced (Unprompted) qualifiers:
   -get                toggle     [N] Retrieve sequences
   -showall            boolean    [N] Show failed attempts

   Associated qualifiers:

   "-outfile" associated qualifiers
   -odirectory         string     Output directory

   General qualifiers:
   -auto               boolean    Turn off prompts
   -stdout             boolean    Write first file to standard output
   -filter             boolean    Read first file from standard input, write
                                  first file to standard output
   -options            boolean    Prompt for standard and additional values
   -debug              boolean    Write debug output to program.dbg
   -verbose            boolean    Report some/full command line options
   -help               boolean    Report command line options and exit. More
                                  information on associated and general
                                  qualifiers can be found with -help -verbose
   -warning            boolean    Report warnings
   -error              boolean    Report errors
   -fatal              boolean    Report fatal errors
   -die                boolean    Report dying program messages
   -version            boolean    Report version number and exit

Qualifier
Type
Description
Allowed values
Default

Standard (Mandatory) qualifiers

[-entry]
(Parameter 1)
string
ID or Accession number
Any string

-outfile
outfile
Output file name
Output file
<*>.whichdb

Additional (Optional) qualifiers

(none)

Advanced (Unprompted) qualifiers

-get
toggle
Retrieve sequences
Toggle value Yes/No
No

-showall
boolean
Show failed attempts
Boolean value Yes/No
No

Associated qualifiers

"-outfile" associated outfile qualifiers

 -odirectory
string
Output directory
Any string

General qualifiers

 -auto
boolean
Turn off prompts
Boolean value Yes/No
N

 -stdout
boolean
Write first file to standard output
Boolean value Yes/No
N

 -filter
boolean
Read first file from standard input, write first file to standard output
Boolean value Yes/No
N

 -options
boolean
Prompt for standard and additional values
Boolean value Yes/No
N

 -debug
boolean
Write debug output to program.dbg
Boolean value Yes/No
N

 -verbose
boolean
Report some/full command line options
Boolean value Yes/No
Y

 -help
boolean
Report command line options and exit. More information on associated and general qualifiers can be found with -help -verbose
Boolean value Yes/No
N

 -warning
boolean
Report warnings
Boolean value Yes/No
Y

 -error
boolean
Report errors
Boolean value Yes/No
Y

 -fatal
boolean
Report fatal errors
Boolean value Yes/No
Y

 -die
boolean
Report dying program messages
Boolean value Yes/No
Y

 -version
boolean
Report version number and exit
Boolean value Yes/No
N

    Input file format

None.

    Output file format

Output files for usage example

File: outfile.whichdb

# Trying 'bpembl:x65923'
bpembl:x65923
# Trying 'bpgb:x65923'
bpgb:x65923
# Trying 'bpsw:x65923'
# Failed 'bpsw:x65923'
# Trying 'bpworm:x65923'
# Failed 'bpworm:x65923'
# Trying 'ena:x65923'
ena:x65923
# Trying 'qanfasta:x65923'
# Failed 'qanfasta:x65923'
# Trying 'qanfastaall:x65923'
# Failed 'qanfastaall:x65923'
# Trying 'qanflat:x65923'
# Failed 'qanflat:x65923'
# Trying 'qanflatall:x65923'
qanflatall:x65923
# Trying 'qanflatexc:x65923'
qanflatexc:x65923
# Trying 'qanflatinc:x65923'
# Failed 'qanflatinc:x65923'
# Trying 'qangcg:x65923'
qangcg:x65923
# Trying 'qangcgall:x65923'
qangcgall:x65923
# Trying 'qangcgexc:x65923'
qangcgexc:x65923
# Trying 'qangcginc:x65923'
# Failed 'qangcginc:x65923'
# Trying 'qanxfasta:x65923'
# Failed 'qanxfasta:x65923'
# Trying 'qanxfastaall:x65923'
# Failed 'qanxfastaall:x65923'
# Trying 'qanxflat:x65923'
# Failed 'qanxflat:x65923'
# Trying 'qanxflatall:x65923'
qanxflatall:x65923
# Trying 'qanxflatexc:x65923'
qanxflatexc:x65923
# Trying 'qanxflatinc:x65923'
# Failed 'qanxflatinc:x65923'
# Trying 'qanxgcg:x65923'
qanxgcg:x65923
# Trying 'qanxgcgall:x65923'
qanxgcgall:x65923
# Trying 'qanxgcgexc:x65923'
qanxgcgexc:x65923
# Trying 'qanxgcginc:x65923'
# Failed 'qanxgcginc:x65923'

  [Part of this file has been deleted for brevity]

# Failed 'qapir:x65923'
# Trying 'qapirall:x65923'
# Failed 'qapirall:x65923'
# Trying 'qapirexc:x65923'
# Failed 'qapirexc:x65923'
# Trying 'qapirinc:x65923'
# Failed 'qapirinc:x65923'
# Trying 'qapxfasta:x65923'
# Failed 'qapxfasta:x65923'
# Trying 'qapxflat:x65923'
# Failed 'qapxflat:x65923'
# Trying 'qasrswww:x65923'
# Failed 'qasrswww:x65923'
# Trying 'qawfasta:x65923'
# Failed 'qawfasta:x65923'
# Trying 'qawxfasta:x65923'
# Failed 'qawxfasta:x65923'
# Trying 'qaxembl:x65923'
qaxembl:x65923
# Trying 'qaxpir:x65923'
# Failed 'qaxpir:x65923'
# Trying 'qaxpirall:x65923'
# Failed 'qaxpirall:x65923'
# Trying 'qaxpirexc:x65923'
# Failed 'qaxpirexc:x65923'
# Trying 'qaxpirinc:x65923'
# Failed 'qaxpirinc:x65923'
# Trying 'tembl:x65923'
tembl:x65923
# Trying 'temblall:x65923'
temblall:x65923
# Trying 'temblrest:x65923'
# Failed 'temblrest:x65923'
# Trying 'temblvrt:x65923'
temblvrt:x65923
# Trying 'tensembldasgrch37:x65923'
# Failed 'tensembldasgrch37:x65923'
# Trying 'testdb:x65923'
# Failed 'testdb:x65923'
# Trying 'tgb:x65923'
tgb:x65923
# Trying 'tgenbank:x65923'
tgenbank:x65923
# Trying 'tgenedashuman:x65923'
# Failed 'tgenedashuman:x65923'
# Trying 'tpir:x65923'
# Failed 'tpir:x65923'
# Trying 'tsw:x65923'
# Failed 'tsw:x65923'
# Trying 'tswnew:x65923'
# Failed 'tswnew:x65923'

The reported database entries are written out to the specified output file.

Each database that is defined in the local implementation of EMBOSS
which contains an entry called 'x65923' is reported.

Note that where a database is defined under several names ('embl',
'em'), each definition of that database containing the entry is
reported.

When the '-get' option is used to output the sequences, they are written
to separate files.  The sequence format they are written in is always
'Fasta' format.  The normal command-line qualifiers for changing the
output formats etc.  will not work in this program.

The names of the files that the sequences are written to is reported as
they are written, for example:

Writing x65923.embl
Writing x65923.human
Writing x65923.tembl
Writing x65923.em
Writing x65923.genbank
Writing x65923.gb

    Data files

None.

    Notes

The Uniform Sequence Addresss (USA) method used by EMBOSS for referencing sequences does not allow database entries to be specified by just the ID name or accession number. You must specify both the name of the database and the entry, for example <tt>embl:x65923</tt>, not just <tt>x65923</tt>.  whichdb is useful where you do not know the database that a sequence entry is found in.

IDs and Accessions

An entry in a database must have some way of being uniquely identified in that database. Most sequence databases have two such identifiers for each sequence - an ID name and an Accession number.

Why are there two such identifiers? The ID name was originally intended to be a human-readable name that had some indication of the function of its sequence. In the early years of EMBL and GenBank the first two (or three) letters indicated the species and the rest indicated the function, for example <tt>HSFAU</tt> was the <tt>Homo Sapiens FAU pseudogene</tt>. This naming scheme started to be a problem when the number of entries added each day was so vast that people could not make up the ID names fast enough. Instead, the Accession numbers were used as the ID name. Therefore you will now find ID names like <tt>X65923</tt>, the same as the Accession number for that sequence in EMBL. The protein sequence databases continue to use recognizable names for entries (for example <tt>AMIR_PSEAE</tt> for the AmiR gene product of Pseudomonas aeruginosa in UniProt/SwissProt).

ID names are not guaranteed to remain the same between different versions of a database (although in practice they usually do). In contrast, accession numbers are unique alphanumeric identifiers that are guaranteed to remain with that sequence through the rest of the life of the database. If two sequences are merged into one, then the new sequence will get a new Accession number and the Accession numbers of the merged sequences will be retained as 'secondary' Accession numbers. EMBL, GenBank and UniProt/SwissProt share an Accession numbering scheme - an Accession number uniquely identifies a sequence within these three databases.

    References

None.

    Warnings

None.

    Diagnostic Error Messages

None.

    Exit status

It always exits with status 0.

    Known bugs

None.

See also

Program name
Description

abiview
Display the trace in an ABI sequencer file

coderet
Extract CDS, mRNA and translations from feature tables

entret
Retrieve sequence entries from flatfile databases and files

extractalign
Extract regions from a sequence alignment

infoalign
Display basic information about a multiple sequence alignment

infoseq
Display basic information about sequences

refseqget
Get reference sequence

seqxref
Retrieve all database cross-references for a sequence entry

seqxrefget
Retrieve all cross-referenced data for a sequence entry

showalign
Display a multiple sequence alignment in pretty format

variationget
Get sequence variations

    Author(s)

Alan Bleasby

European Bioinformatics Institute, Wellcome Trust Genome Campus, Hinxton, Cambridge CB10 1SD, UK

Please report all bugs to the EMBOSS bug team (emboss-bug © emboss.open-bio.org) not to the original author.

    History

Written (Jan 2002) - Alan Bleasby.

    Target users

This program is intended to be used by everyone and everything, from naive users to embedded scripts.

    Comments

None


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BGuest.Integration.Console.Net20.Model;

namespace BGuest.Integration.Console.Net20
{
    internal class ResultItems
    {
        public ResultItems(string item1, string item2, string item3, string item4, string item5)
        {
            Item1 = item1;
            Item2 = item2;
            Item3 = item3;
            Item4 = item4;
            Item5 = item5;
        }
        public string Item1 { get; set; }
        public string Item2 { get; set; }
        public string Item3 { get; set; }
        public string Item4 { get; set; }
        public string Item5 { get; set; }
    }
    public class StringBuildResults : ResultLogger
    {
        Dictionary<bool, List<ResultItems>> _report = new Dictionary<bool, List<ResultItems>>();
        public override void AddResponse(StayImportResultDto response)
        {
            if (!_report.ContainsKey(response.Success))
                _report.Add(response.Success,
                    new List<ResultItems>());
            _report[response.Success].Add(new ResultItems(response.ExternalKey, response.Id, response.GuestEmail, response.Message, response.Data));
        }

        public override string ToString()
        {
            StringBuilder builder = new StringBuilder();
            var items = from pair in _report
                orderby pair.Key ascending
                select pair;
            foreach (var item in items)
            {
                builder.AppendLine();
                builder.AppendFormat("Success: {0} Count({1})\n", item.Key, item.Value.Count);
                builder.AppendLine();
                builder.AppendLine("ExternalKey\tId\tGuestEmail\tMessage\tData\n");
                foreach(var values in item.Value) {
                    builder.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\n", values.Item1, values.Item2, values.Item3, values.Item4, values.Item5);
                    builder.AppendLine();
                }
            }
            return builder.ToString();
        }
    }
}


text:
package net.dzikoysk.ups.modules.functionality.network.states.status;

import net.dzikoysk.ups.modules.required.network.protocol.PacketListener;
import net.dzikoysk.ups.modules.required.network.protocol.serverbound.status.RequestServerboundPacket;
import net.dzikoysk.ups.network.NetworkManager;

public class StatusListener implements PacketListener<RequestServerboundPacket> {

    @Override
    public void handle(NetworkManager networkManager, RequestServerboundPacket packet) {

    }

}


text:
using System;
using System.Runtime.InteropServices;
using System.Text;
using System.Drawing;

namespace Fluid.Drawing.GdiPlus
{
    internal partial class GdiPlus
    {
        [DllImport(dllName)]
        internal static extern GpStatus GdipCreatePath(FillMode brushMode, out GpPath path);

        [DllImport(dllName)]
        internal static extern GpStatus GdipClonePath(GpPath path, out GpPath clonePath);

        [DllImport(dllName)]
        internal static extern GpStatus GdipDeletePath(GpPath path);

        [DllImport(dllName)]
        internal static extern GpStatus GdipResetPath(GpPath path);

        [DllImport(dllName)]
        internal static extern GpStatus GdipGetPointCount(GpPath path, out int count);

        [DllImport(dllName)]
        internal static extern GpStatus GdipGetPathTypes(GpPath path, byte[] types, int count);

        [DllImport(dllName)]
        internal static extern GpStatus GdipGetPathPoints(GpPath path, PointF[] points, int count);

        [DllImport(dllName)]
        internal static extern GpStatus GdipGetPathPointsI(GpPath path, Point[] points, int count);

        [DllImport(dllName)]
        internal static extern GpStatus GdipGetPathFillMode(GpPath path, out FillMode fillmode);

        [DllImport(dllName)]
        internal static extern GpStatus GdipSetPathFillMode(GpPath path, FillMode fillmode);

        [DllImport(dllName)]
        internal static extern GpStatus GdipStartPathFigure(GpPath path);

        [DllImport(dllName)]
        internal static extern GpStatus GdipClosePathFigure(GpPath path);

        [DllImport(dllName)]
        internal static extern GpStatus GdipClosePathFigures(GpPath path);

        [DllImport(dllName)]
        internal static extern GpStatus GdipGetPathLastPoint(GpPath path, out PointF lastPoint);

        [DllImport(dllName)]
        internal static extern GpStatus GdipAddPathLine(GpPath path, float x1, float y1, float x2, float y2);

        [DllImport(dllName)]
        internal static extern GpStatus GdipAddPathLine2(GpPath path, PointF[] points, int count);

        [DllImport(dllName)]
        internal static extern GpStatus GdipAddPathArc(GpPath path, float x, float y, float width, float height, float startAngle, float sweepAngle);

        [DllImport(dllName)]
        internal static extern GpStatus GdipAddPathBeziers(GpPath path, PointF[] points, int count);

        [DllImport(dllName)]
        internal static extern GpStatus
        GdipAddPathRectangle(GpPath path, float x, float y, float width, float height);

        [DllImport(dllName)]
        internal static extern GpStatus GdipAddPathRectangles(GpPath path, RectangleF[] rects, int count);

        [DllImport(dllName)]
        internal static extern GpStatus GdipAddPathEllipse(GpPath path, float x, float y, float width, float height);

        [DllImport(dllName)]
        internal static extern GpStatus GdipAddPathPie(GpPath path, float x, float y, float width, float height, float startAngle, float sweepAngle);

        [DllImport(dllName)]
        internal static extern GpStatus GdipAddPathPolygon(GpPath path, PointF[] points, int count);

        [DllImport(dllName)]
        internal static extern GpStatus GdipAddPathPath(GpPath path, GpPath addingPath, bool connect);

        [DllImport(dllName)]
        internal static extern GpStatus GdipAddPathLine2I(GpPath path, Point[] points, int count);

        [DllImport(dllName)]
        internal static extern GpStatus GdipAddPathArcI(GpPath path, int x, int y, int width, int height, float startAngle, float sweepAngle);

        [DllImport(dllName)]
        internal static extern GpStatus GdipAddPathBeziersI(GpPath path, Point[] points, int count);

        [DllImport(dllName)]
        internal static extern GpStatus GdipAddPathRectangleI(GpPath path, int x, int y, int width, int height);

        [DllImport(dllName)]
        internal static extern GpStatus GdipAddPathRectanglesI(GpPath path, Rectangle[] rects, int count);

        [DllImport(dllName)]
        internal static extern GpStatus GdipAddPathEllipseI(GpPath path, int x, int y, int width, int height);

        [DllImport(dllName)]
        internal static extern GpStatus GdipAddPathPieI(GpPath path, int x, int y, int width, int height, float startAngle, float sweepAngle);

        [DllImport(dllName)]
        internal static extern GpStatus GdipIsVisiblePathPoint(GpPath path, float x, float y, GpGraphics graphics, out bool result);

        [DllImport(dllName)]
        internal static extern GpStatus GdipIsVisiblePathPointI(GpPath path, int x, int y, GpGraphics graphics, out bool result);

        [DllImport(dllName)]
        internal static extern GpStatus GdipIsOutlineVisiblePathPoint(GpPath path, float x, float y, GpPen pen, GpGraphics graphics, out bool result);

    }
}


text:
package server

import (
	"context"
	"fmt"

	tasks "github.com/containerd/containerd/api/services/tasks/v1"
	runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
)

// ContainerStats returns stats of the container. If the container does not
// exist, the call returns an error.
func (c *criService) ContainerStats(ctx context.Context, in *runtime.ContainerStatsRequest) (*runtime.ContainerStatsResponse, error) {
	cntr, err := c.containerStore.Get(in.GetContainerId())
	if err != nil {
		return nil, fmt.Errorf("failed to find container: %w", err)
	}
	request := &tasks.MetricsRequest{Filters: []string{"id==" + cntr.ID}}
	resp, err := c.client.TaskService().Metrics(ctx, request)
	if err != nil {
		return nil, fmt.Errorf("failed to fetch metrics for task: %w", err)
	}
	if len(resp.Metrics) != 1 {
		return nil, fmt.Errorf("unexpected metrics response: %+v", resp.Metrics)
	}

	cs, err := c.containerMetrics(cntr.Metadata, resp.Metrics[0])
	if err != nil { //nolint:staticcheck // Ignore SA4023 as some platforms always return nil (stats unimplemented)
		return nil, fmt.Errorf("failed to decode container metrics: %w", err)
	}
	return &runtime.ContainerStatsResponse{Stats: cs}, nil
}


text:
#include "berryExtensionHandle.h"
#include "berryExtension.h"
#include "berryIConfigurationElement.h"
#include "berryIContributor.h"
#include "berryRegistryObjectManager.h"
#include "berryInvalidRegistryObjectException.h"

namespace berry {

ExtensionHandle::ExtensionHandle(const SmartPointer<const IObjectManager> &objectManager, int id)
  : Handle(objectManager, id)
{
}

ExtensionHandle::ExtensionHandle(const IObjectManager *objectManager, int id)
  : Handle(objectManager, id)
{
}

QString ExtensionHandle::GetNamespaceIdentifier() const
{
  return GetExtension()->GetNamespaceIdentifier();
}

SmartPointer<IContributor> ExtensionHandle::GetContributor() const
{
  return GetExtension()->GetContributor();
}

QString ExtensionHandle::GetExtensionPointUniqueIdentifier() const
{
  return GetExtension()->GetExtensionPointIdentifier();
}

QString ExtensionHandle::GetLabel() const
{
  return GetExtension()->GetLabel();
}

QString ExtensionHandle::GetLabelAsIs() const
{
  return GetExtension()->GetLabelAsIs();
}

QString ExtensionHandle::GetLabel(const QLocale& locale) const
{
  return GetExtension()->GetLabel(locale);
}

QString ExtensionHandle::GetSimpleIdentifier() const
{
  return GetExtension()->GetSimpleIdentifier();
}

QString ExtensionHandle::GetUniqueIdentifier() const
{
  return GetExtension()->GetUniqueIdentifier();
}

QList<SmartPointer<IConfigurationElement> > ExtensionHandle::GetConfigurationElements() const
{
  QList<Handle::Pointer> handles = objectManager->GetHandles(GetExtension()->GetRawChildren(),
                                                             RegistryObjectManager::CONFIGURATION_ELEMENT);
  QList<IConfigurationElement::Pointer> result;
  foreach (Handle::Pointer handle, handles)
  {
    result.push_back(handle.Cast<IConfigurationElement>());
  }
  return result;
}

bool ExtensionHandle::IsValid() const
{
  try
  {
    GetExtension();
  }
  catch (const InvalidRegistryObjectException& /*e*/)
  {
    return false;
  }
  return true;
}

SmartPointer<Extension> ExtensionHandle::GetExtension() const
{
  return objectManager->GetObject(GetId(), RegistryObjectManager::EXTENSION).Cast<Extension>();
}

bool ExtensionHandle::ShouldPersist() const
{
  return GetExtension()->ShouldPersist();
}

QString ExtensionHandle::GetContributorId() const
{
  return GetExtension()->GetContributorId();
}

SmartPointer<RegistryObject> ExtensionHandle::GetObject() const
{
  return GetExtension();
}

}