text:
namespace TutorialI2
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.lblText = new System.Windows.Forms.Label();
            this.timerEvent = new System.Windows.Forms.Timer(this.components);
            this.lblRightEngine = new System.Windows.Forms.Label();
            this.lblLeftEngine = new System.Windows.Forms.Label();
            this.SuspendLayout();
            //
            // lblText
            //
            this.lblText.AutoSize = true;
            this.lblText.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblText.Location = new System.Drawing.Point(12, 26);
            this.lblText.Name = "lblText";
            this.lblText.Size = new System.Drawing.Size(374, 24);
            this.lblText.TabIndex = 0;
            this.lblText.Text = "User Left and Right Trigger to Start Vibration";
            //
            // timerEvent
            //
            this.timerEvent.Enabled = true;
            this.timerEvent.Tick += new System.EventHandler(this.timerEvent_Tick);
            //
            // lblRightEngine
            //
            this.lblRightEngine.AutoSize = true;
            this.lblRightEngine.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblRightEngine.Location = new System.Drawing.Point(214, 74);
            this.lblRightEngine.Name = "lblRightEngine";
            this.lblRightEngine.Size = new System.Drawing.Size(58, 24);
            this.lblRightEngine.TabIndex = 1;
            this.lblRightEngine.Text = "Right:";
            //
            // lblLeftEngine
            //
            this.lblLeftEngine.AutoSize = true;
            this.lblLeftEngine.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblLeftEngine.Location = new System.Drawing.Point(12, 74);
            this.lblLeftEngine.Name = "lblLeftEngine";
            this.lblLeftEngine.Size = new System.Drawing.Size(44, 24);
            this.lblLeftEngine.TabIndex = 2;
            this.lblLeftEngine.Text = "Left:";
            //
            // Form1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(396, 195);
            this.Controls.Add(this.lblLeftEngine);
            this.Controls.Add(this.lblRightEngine);
            this.Controls.Add(this.lblText);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "Form1";
            this.Text = "Input - Vibration";
            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
            this.Load += new System.EventHandler(this.Form1_Load);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Label lblText;
        private System.Windows.Forms.Timer timerEvent;
        private System.Windows.Forms.Label lblRightEngine;
        private System.Windows.Forms.Label lblLeftEngine;
    }
}


text:
The default template to wrap fields with.  Override with your own if you
don't like this one.

redpajama_set_name: RedPajamaGithub


text:
<?php
namespace Acme\DemoBundle\Security\Authentication\Token;

use Symfony\Component\Security;

class WsseUserToken extends Security\Core\Authentication\Token\AbstractToken
{
    public $createdAt;

    public $digest;

    public $nonce;

    public function __construct(array $roles = array())
    {
        parent::__construct($roles);
        // Si l'utilisateur a des rôles, on le considère comme authentifié
        $this->setAuthenticated(count($roles) > 0);
    }

    public function getCredentials()
    {
        return '';
    }
}


text:
package com.binarymystery.pista.timetable;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ScrollView;

/**
 * Trieda umožňuje vertikálne skrolovanie v moduli Rozvrh.
 */
public class ObservableScrollView extends ScrollView {

    private ScrollViewListener scrollListener = null;

    public ObservableScrollView(Context context) {
        super(context);
    }

    public ObservableScrollView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public ObservableScrollView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    public void setScrollListener(ScrollViewListener scrollListener) {
        this.scrollListener = scrollListener;
    }

    @Override
    protected void onScrollChanged(int x, int y, int oldx, int oldy) {
        super.onScrollChanged(x, y, oldx, oldy);
        if (scrollListener != null) {
            scrollListener.onScrollChanged(this, x, y, oldx, oldy);
        }
    }

    public void onOverScrolled(int scrollX, int scrollY, boolean clampedX, boolean clampedY) {
        super.onOverScrolled(scrollX, scrollY, clampedX, clampedY);
    }

}


text:
namespace net {

namespace {

std::unique_ptr<base::ListValue> SPKIHashesToListValue(
    const HashValueVector& hashes) {
  auto pins = std::make_unique<base::ListValue>();
  for (size_t i = 0; i != hashes.size(); i++)
    pins->AppendString(hashes[i].ToString());
  return pins;
}

void SPKIHashesFromListValue(const base::ListValue& pins,
                             HashValueVector* hashes) {
  size_t num_pins = pins.GetSize();
  for (size_t i = 0; i < num_pins; ++i) {
    std::string type_and_base64;
    HashValue fingerprint;
    if (pins.GetString(i, &type_and_base64) &&
        fingerprint.FromString(type_and_base64)) {
      hashes->push_back(fingerprint);
    }
  }
}

// This function converts the binary hashes to a base64 string which we can
// include in a JSON file.
std::string HashedDomainToExternalString(const std::string& hashed) {
  std::string out;
  base::Base64Encode(hashed, &out);
  return out;
}

// This inverts |HashedDomainToExternalString|, above. It turns an external
// string (from a JSON file) into an internal (binary) string.
std::string ExternalStringToHashedDomain(const std::string& external) {
  std::string out;
  if (!base::Base64Decode(external, &out) ||
      out.size() != crypto::kSHA256Length) {
    return std::string();
  }

  return out;
}

const char kIncludeSubdomains[] = "include_subdomains";
const char kStsIncludeSubdomains[] = "sts_include_subdomains";
const char kPkpIncludeSubdomains[] = "pkp_include_subdomains";
const char kMode[] = "mode";
const char kExpiry[] = "expiry";
const char kDynamicSPKIHashesExpiry[] = "dynamic_spki_hashes_expiry";
const char kDynamicSPKIHashes[] = "dynamic_spki_hashes";
const char kForceHTTPS[] = "force-https";
const char kStrict[] = "strict";
const char kDefault[] = "default";
const char kPinningOnly[] = "pinning-only";
const char kCreated[] = "created";
const char kStsObserved[] = "sts_observed";
const char kPkpObserved[] = "pkp_observed";
const char kReportUri[] = "report-uri";
// The keys below are contained in a subdictionary keyed as
// |kExpectCTSubdictionary|.
const char kExpectCTSubdictionary[] = "expect_ct";
const char kExpectCTExpiry[] = "expect_ct_expiry";
const char kExpectCTObserved[] = "expect_ct_observed";
const char kExpectCTEnforce[] = "expect_ct_enforce";
const char kExpectCTReportUri[] = "expect_ct_report_uri";

std::string LoadState(const base::FilePath& path) {
  std::string result;
  if (!base::ReadFileToString(path, &result)) {
    return "";
  }
  return result;
}

bool IsDynamicExpectCTEnabled() {
  return base::FeatureList::IsEnabled(
      TransportSecurityState::kDynamicExpectCTFeature);
}

// Populates |host| with default values for the STS and PKP states.
// These default values represent "null" states and are only useful to keep
// the entries in the resulting JSON consistent. The deserializer will ignore
// "null" states.
// TODO(davidben): This can be removed when the STS and PKP states are stored
// independently on disk. https://crbug.com/470295
void PopulateEntryWithDefaults(base::DictionaryValue* host) {
  host->Clear();

  // STS default values.
  host->SetBoolean(kStsIncludeSubdomains, false);
  host->SetDouble(kStsObserved, 0.0);
  host->SetDouble(kExpiry, 0.0);
  host->SetString(kMode, kDefault);

  // PKP default values.
  host->SetBoolean(kPkpIncludeSubdomains, false);
  host->SetDouble(kPkpObserved, 0.0);
  host->SetDouble(kDynamicSPKIHashesExpiry, 0.0);
}

// Serializes STS data from |state| into |toplevel|. Any existing state in
// |toplevel| for each item is overwritten.
void SerializeSTSData(TransportSecurityState* state,
                      base::DictionaryValue* toplevel) {
  TransportSecurityState::STSStateIterator sts_iterator(*state);
  for (; sts_iterator.HasNext(); sts_iterator.Advance()) {
    const std::string& hostname = sts_iterator.hostname();
    const TransportSecurityState::STSState& sts_state =
        sts_iterator.domain_state();

    const std::string key = HashedDomainToExternalString(hostname);
    std::unique_ptr<base::DictionaryValue> serialized(
        new base::DictionaryValue);
    PopulateEntryWithDefaults(serialized.get());

    serialized->SetBoolean(kStsIncludeSubdomains, sts_state.include_subdomains);
    serialized->SetDouble(kStsObserved, sts_state.last_observed.ToDoubleT());
    serialized->SetDouble(kExpiry, sts_state.expiry.ToDoubleT());

    switch (sts_state.upgrade_mode) {
      case TransportSecurityState::STSState::MODE_FORCE_HTTPS:
        serialized->SetString(kMode, kForceHTTPS);
        break;
      case TransportSecurityState::STSState::MODE_DEFAULT:
        serialized->SetString(kMode, kDefault);
        break;
      default:
        NOTREACHED() << "STSState with unknown mode";
        continue;
    }

    toplevel->Set(key, std::move(serialized));
  }
}

// Serializes PKP data from |state| into |toplevel|. For each PKP item in
// |state|, if |toplevel| already contains an item for that hostname, the item
// is updated with the PKP data.
void SerializePKPData(TransportSecurityState* state,
                      base::DictionaryValue* toplevel) {
  base::Time now = base::Time::Now();
  TransportSecurityState::PKPStateIterator pkp_iterator(*state);
  for (; pkp_iterator.HasNext(); pkp_iterator.Advance()) {
    const std::string& hostname = pkp_iterator.hostname();
    const TransportSecurityState::PKPState& pkp_state =
        pkp_iterator.domain_state();

    // See if the current |hostname| already has STS state and, if so, update
    // that entry.
    const std::string key = HashedDomainToExternalString(hostname);
    base::DictionaryValue* serialized = nullptr;
    if (!toplevel->GetDictionary(key, &serialized)) {
      std::unique_ptr<base::DictionaryValue> serialized_scoped(
          new base::DictionaryValue);
      serialized = serialized_scoped.get();
      PopulateEntryWithDefaults(serialized);
      toplevel->Set(key, std::move(serialized_scoped));
    }

    serialized->SetBoolean(kPkpIncludeSubdomains, pkp_state.include_subdomains);
    serialized->SetDouble(kPkpObserved, pkp_state.last_observed.ToDoubleT());
    serialized->SetDouble(kDynamicSPKIHashesExpiry,
                          pkp_state.expiry.ToDoubleT());

    // TODO(svaldez): Historically, both SHA-1 and SHA-256 hashes were
    // accepted in pins. Per spec, only SHA-256 is accepted now, however
    // existing serialized pins are still processed. Migrate historical pins
    // with SHA-1 hashes properly, either by dropping just the bad hashes or
    // the entire pin. See https://crbug.com/448501.
    if (now < pkp_state.expiry) {
      serialized->Set(kDynamicSPKIHashes,
                      SPKIHashesToListValue(pkp_state.spki_hashes));
    }

    serialized->SetString(kReportUri, pkp_state.report_uri.spec());
  }
}

// Serializes Expect-CT data from |state| into |toplevel|. For each Expect-CT
// item in |state|, if |toplevel| already contains an item for that hostname,
// the item is updated to include a subdictionary with key
// |kExpectCTSubdictionary|; otherwise an item is created for that hostname with
// a |kExpectCTSubdictionary| subdictionary.
void SerializeExpectCTData(TransportSecurityState* state,
                           base::DictionaryValue* toplevel) {
  if (!IsDynamicExpectCTEnabled())
    return;
  TransportSecurityState::ExpectCTStateIterator expect_ct_iterator(*state);
  for (; expect_ct_iterator.HasNext(); expect_ct_iterator.Advance()) {
    const std::string& hostname = expect_ct_iterator.hostname();
    const TransportSecurityState::ExpectCTState& expect_ct_state =
        expect_ct_iterator.domain_state();

    // See if the current |hostname| already has STS/PKP state and, if so,
    // update that entry.
    const std::string key = HashedDomainToExternalString(hostname);
    base::DictionaryValue* serialized = nullptr;
    if (!toplevel->GetDictionary(key, &serialized)) {
      std::unique_ptr<base::DictionaryValue> serialized_scoped(
          new base::DictionaryValue);
      serialized = serialized_scoped.get();
      PopulateEntryWithDefaults(serialized);
      toplevel->Set(key, std::move(serialized_scoped));
    }

    std::unique_ptr<base::DictionaryValue> expect_ct_subdictionary(
        new base::DictionaryValue());
    expect_ct_subdictionary->SetDouble(
        kExpectCTObserved, expect_ct_state.last_observed.ToDoubleT());
    expect_ct_subdictionary->SetDouble(kExpectCTExpiry,
                                       expect_ct_state.expiry.ToDoubleT());
    expect_ct_subdictionary->SetBoolean(kExpectCTEnforce,
                                        expect_ct_state.enforce);
    expect_ct_subdictionary->SetString(kExpectCTReportUri,
                                       expect_ct_state.report_uri.spec());
    serialized->Set(kExpectCTSubdictionary, std::move(expect_ct_subdictionary));
  }
}

// Populates |state| with the values in the |kExpectCTSubdictionary|
// subdictionary in |parsed|. Returns false if |parsed| is malformed
// (e.g. missing a required Expect-CT key) and true otherwise. Note that true
// does not necessarily mean that Expect-CT state was present in |parsed|.
bool DeserializeExpectCTState(const base::DictionaryValue* parsed,
                              TransportSecurityState::ExpectCTState* state) {
  const base::DictionaryValue* expect_ct_subdictionary;
  if (!parsed->GetDictionary(kExpectCTSubdictionary,
                             &expect_ct_subdictionary)) {
    // Expect-CT data is not required, so this item is not malformed.
    return true;
  }
  double observed;
  bool has_observed =
      expect_ct_subdictionary->GetDouble(kExpectCTObserved, &observed);
  double expiry;
  bool has_expiry =
      expect_ct_subdictionary->GetDouble(kExpectCTExpiry, &expiry);
  bool enforce;
  bool has_enforce =
      expect_ct_subdictionary->GetBoolean(kExpectCTEnforce, &enforce);
  std::string report_uri_str;
  bool has_report_uri =
      expect_ct_subdictionary->GetString(kExpectCTReportUri, &report_uri_str);

  // If an Expect-CT subdictionary is present, it must have the required keys.
  if (!has_observed || !has_expiry || !has_enforce)
    return false;

  state->last_observed = base::Time::FromDoubleT(observed);
  state->expiry = base::Time::FromDoubleT(expiry);
  state->enforce = enforce;
  if (has_report_uri) {
    GURL report_uri(report_uri_str);
    if (report_uri.is_valid())
      state->report_uri = report_uri;
  }
  return true;
}

}  // namespace

TransportSecurityPersister::TransportSecurityPersister(
    TransportSecurityState* state,
    const base::FilePath& profile_path,
    const scoped_refptr<base::SequencedTaskRunner>& background_runner)
    : transport_security_state_(state),
      writer_(profile_path.AppendASCII("TransportSecurity"), background_runner),
      foreground_runner_(base::ThreadTaskRunnerHandle::Get()),
      background_runner_(background_runner),
      weak_ptr_factory_(this) {
  transport_security_state_->SetDelegate(this);

  base::PostTaskAndReplyWithResult(
      background_runner_.get(), FROM_HERE,
      base::Bind(&LoadState, writer_.path()),
      base::Bind(&TransportSecurityPersister::CompleteLoad,
                 weak_ptr_factory_.GetWeakPtr()));
}

TransportSecurityPersister::~TransportSecurityPersister() {
  DCHECK(foreground_runner_->RunsTasksInCurrentSequence());

  if (writer_.HasPendingWrite())
    writer_.DoScheduledWrite();

  transport_security_state_->SetDelegate(NULL);
}

void TransportSecurityPersister::StateIsDirty(TransportSecurityState* state) {
  DCHECK(foreground_runner_->RunsTasksInCurrentSequence());
  DCHECK_EQ(transport_security_state_, state);

  writer_.ScheduleWrite(this);
}

bool TransportSecurityPersister::SerializeData(std::string* output) {
  DCHECK(foreground_runner_->RunsTasksInCurrentSequence());

  base::DictionaryValue toplevel;

  // TODO(davidben): Fix the serialization format by splitting the on-disk
  // representation of the STS and PKP states. https://crbug.com/470295.
  SerializeSTSData(transport_security_state_, &toplevel);
  SerializePKPData(transport_security_state_, &toplevel);
  SerializeExpectCTData(transport_security_state_, &toplevel);

  base::JSONWriter::WriteWithOptions(
      toplevel, base::JSONWriter::OPTIONS_PRETTY_PRINT, output);
  return true;
}

bool TransportSecurityPersister::LoadEntries(const std::string& serialized,
                                             bool* dirty) {
  DCHECK(foreground_runner_->RunsTasksInCurrentSequence());

  transport_security_state_->ClearDynamicData();
  return Deserialize(serialized, dirty, transport_security_state_);
}

// static
bool TransportSecurityPersister::Deserialize(const std::string& serialized,
                                             bool* dirty,
                                             TransportSecurityState* state) {
  std::unique_ptr<base::Value> value = base::JSONReader::Read(serialized);
  base::DictionaryValue* dict_value = NULL;
  if (!value.get() || !value->GetAsDictionary(&dict_value))
    return false;

  const base::Time current_time(base::Time::Now());
  bool dirtied = false;

  for (base::DictionaryValue::Iterator i(*dict_value);
       !i.IsAtEnd(); i.Advance()) {
    const base::DictionaryValue* parsed = NULL;
    if (!i.value().GetAsDictionary(&parsed)) {
      LOG(WARNING) << "Could not parse entry " << i.key() << "; skipping entry";
      continue;
    }

    TransportSecurityState::STSState sts_state;
    TransportSecurityState::PKPState pkp_state;
    TransportSecurityState::ExpectCTState expect_ct_state;

    // kIncludeSubdomains is a legacy synonym for kStsIncludeSubdomains and
    // kPkpIncludeSubdomains. Parse at least one of these properties,
    // preferably the new ones.
    bool include_subdomains = false;
    bool parsed_include_subdomains = parsed->GetBoolean(kIncludeSubdomains,
                                                        &include_subdomains);
    sts_state.include_subdomains = include_subdomains;
    pkp_state.include_subdomains = include_subdomains;
    if (parsed->GetBoolean(kStsIncludeSubdomains, &include_subdomains)) {
      sts_state.include_subdomains = include_subdomains;
      parsed_include_subdomains = true;
    }
    if (parsed->GetBoolean(kPkpIncludeSubdomains, &include_subdomains)) {
      pkp_state.include_subdomains = include_subdomains;
      parsed_include_subdomains = true;
    }

    std::string mode_string;
    double expiry = 0;
    if (!parsed_include_subdomains ||
        !parsed->GetString(kMode, &mode_string) ||
        !parsed->GetDouble(kExpiry, &expiry)) {
      LOG(WARNING) << "Could not parse some elements of entry " << i.key()
                   << "; skipping entry";
      continue;
    }

    // Don't fail if this key is not present.
    double dynamic_spki_hashes_expiry = 0;
    parsed->GetDouble(kDynamicSPKIHashesExpiry,
                      &dynamic_spki_hashes_expiry);

    const base::ListValue* pins_list = NULL;
    if (parsed->GetList(kDynamicSPKIHashes, &pins_list)) {
      SPKIHashesFromListValue(*pins_list, &pkp_state.spki_hashes);
    }

    if (mode_string == kForceHTTPS || mode_string == kStrict) {
      sts_state.upgrade_mode =
          TransportSecurityState::STSState::MODE_FORCE_HTTPS;
    } else if (mode_string == kDefault || mode_string == kPinningOnly) {
      sts_state.upgrade_mode = TransportSecurityState::STSState::MODE_DEFAULT;
    } else {
      LOG(WARNING) << "Unknown TransportSecurityState mode string "
                   << mode_string << " found for entry " << i.key()
                   << "; skipping entry";
      continue;
    }

    sts_state.expiry = base::Time::FromDoubleT(expiry);
    pkp_state.expiry = base::Time::FromDoubleT(dynamic_spki_hashes_expiry);

    // Don't fail if this key is not present.
    std::string report_uri_str;
    parsed->GetString(kReportUri, &report_uri_str);
    GURL report_uri(report_uri_str);
    if (report_uri.is_valid())
      pkp_state.report_uri = report_uri;

    double sts_observed;
    double pkp_observed;
    if (parsed->GetDouble(kStsObserved, &sts_observed)) {
      sts_state.last_observed = base::Time::FromDoubleT(sts_observed);
    } else if (parsed->GetDouble(kCreated, &sts_observed)) {
      // kCreated is a legacy synonym for both kStsObserved and kPkpObserved.
      sts_state.last_observed = base::Time::FromDoubleT(sts_observed);
    } else {
      // We're migrating an old entry with no observation date. Make sure we
      // write the new date back in a reasonable time frame.
      dirtied = true;
      sts_state.last_observed = base::Time::Now();
    }
    if (parsed->GetDouble(kPkpObserved, &pkp_observed)) {
      pkp_state.last_observed = base::Time::FromDoubleT(pkp_observed);
    } else if (parsed->GetDouble(kCreated, &pkp_observed)) {
      pkp_state.last_observed = base::Time::FromDoubleT(pkp_observed);
    } else {
      dirtied = true;
      pkp_state.last_observed = base::Time::Now();
    }

    if (!DeserializeExpectCTState(parsed, &expect_ct_state)) {
      continue;
    }

    bool has_sts =
        sts_state.expiry > current_time && sts_state.ShouldUpgradeToSSL();
    bool has_pkp =
        pkp_state.expiry > current_time && pkp_state.HasPublicKeyPins();
    bool has_expect_ct =
        expect_ct_state.expiry > current_time &&
        (expect_ct_state.enforce || !expect_ct_state.report_uri.is_empty());
    if (!has_sts && !has_pkp && !has_expect_ct) {
      // Make sure we dirty the state if we drop an entry. The entries can only
      // be dropped when all the STS, PKP, and Expect-CT states are expired or
      // invalid.
      dirtied = true;
      continue;
    }

    std::string hashed = ExternalStringToHashedDomain(i.key());
    if (hashed.empty()) {
      dirtied = true;
      continue;
    }

    // Until the on-disk storage is split, there will always be 'null' entries.
    // We only register entries that have actual state.
    if (has_sts)
      state->AddOrUpdateEnabledSTSHosts(hashed, sts_state);
    if (has_pkp)
      state->AddOrUpdateEnabledPKPHosts(hashed, pkp_state);
    if (has_expect_ct)
      state->AddOrUpdateEnabledExpectCTHosts(hashed, expect_ct_state);
  }

  *dirty = dirtied;
  return true;
}

void TransportSecurityPersister::CompleteLoad(const std::string& state) {
  DCHECK(foreground_runner_->RunsTasksInCurrentSequence());

  if (state.empty())
    return;

  bool dirty = false;
  if (!LoadEntries(state, &dirty)) {
    LOG(ERROR) << "Failed to deserialize state: " << state;
    return;
  }
  if (dirty)
    StateIsDirty(transport_security_state_);
}

}  // namespace net


text:
/***************************************************************************/
/*                                                                         */
/*  afwrtsys.h                                                             */
/*                                                                         */
/*    Auto-fitter writing systems (specification only).                    */
/*                                                                         */
/*  Copyright 2013-2016 by                                                 */
/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
/*                                                                         */
/*  This file is part of the FreeType project, and may only be used,       */
/*  modified, and distributed under the terms of the FreeType project      */
/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
/*  this file you indicate that you have read the license and              */
/*  understand and accept it fully.                                        */
/*                                                                         */
/***************************************************************************/

#ifndef AFWRTSYS_H_
#define AFWRTSYS_H_

  /* Since preprocessor directives can't create other preprocessor */
  /* directives, we have to include the header files manually.     */

#include "afdummy.h"
#include "aflatin.h"
#include "afcjk.h"
#include "afindic.h"
#ifdef FT_OPTION_AUTOFIT2
#include "aflatin2.h"
#endif

#endif /* AFWRTSYS_H_ */

  /* The following part can be included multiple times. */
  /* Define `WRITING_SYSTEM' as needed.                 */

  /* Add new writing systems here.  The arguments are the writing system */
  /* name in lowercase and uppercase, respectively.                      */

  WRITING_SYSTEM( dummy,  DUMMY  )
  WRITING_SYSTEM( latin,  LATIN  )
  WRITING_SYSTEM( cjk,    CJK    )
  WRITING_SYSTEM( indic,  INDIC  )
#ifdef FT_OPTION_AUTOFIT2
  WRITING_SYSTEM( latin2, LATIN2 )
#endif

/* END */


text:
require 'rails_helper'

RSpec.describe PupilStatus, :type => :model do
  pending "add some examples to (or delete) #{__FILE__}"
end


text:
cd "`dirname "$0"`"
top="`pwd`"
stage="$top/stage"

# turn on verbose debugging output for parabuild logs.
set -x
# make errors fatal
set -e

if [ -z "$AUTOBUILD" ] ; then
    fail
fi

if [ "$OSTYPE" = "cygwin" ] ; then
    export AUTOBUILD="`cygpath -u $AUTOBUILD`"
fi

# load autbuild provided shell functions and variables
set +x
eval "`"$AUTOBUILD" source_environment`"
set -x

build_linux()
{
    prefix="$1"
    bits="$2"
    shift; shift

    VIEWER_FLAGS="-m$bits -fno-stack-protector"
    ./configure --prefix="$top/stage$prefix" --libdir="$top/stage$prefix/lib/release" --disable-processor CFLAGS="$VIEWER_FLAGS" CXXFLAGS="$VIEWER_FLAGS" LDFLAG="-m$bits"

    make
    make -C src/tools/linux/dump_syms/ dump_syms CXXFLAGS="-g3 -O2 -Wall -m$bits"
    make install

    INCLUDE_DIRECTORY="$stage$prefix/include/google_breakpad"
    mkdir -p "$INCLUDE_DIRECTORY"
    mkdir -p "$INCLUDE_DIRECTORY/client/linux/handler"
    mkdir -p "$INCLUDE_DIRECTORY/client/linux/crash_generation"
    mkdir -p "$INCLUDE_DIRECTORY/client/linux/minidump_writer"
    mkdir -p "$INCLUDE_DIRECTORY/client/linux/log"
    mkdir -p "$INCLUDE_DIRECTORY/common"
    mkdir -p "$INCLUDE_DIRECTORY/google_breakpad/common"
    mkdir -p "$INCLUDE_DIRECTORY/processor"
    mkdir -p "$INCLUDE_DIRECTORY/third_party/lss"

    # Replicate breakpad headers
    cp src/common/*.h "$INCLUDE_DIRECTORY/common"
    cp src/google_breakpad/common/*.h "$INCLUDE_DIRECTORY/google_breakpad/common"
    cp src/client/linux/crash_generation/*.h "$INCLUDE_DIRECTORY/client/linux/crash_generation"
    cp src/client/linux/handler/*.h "$INCLUDE_DIRECTORY/client/linux/handler"
    cp src/client/linux/minidump_writer/*.h "$INCLUDE_DIRECTORY/client/linux/minidump_writer"
    cp src/client/linux/log/*.h "$INCLUDE_DIRECTORY/client/linux/log"
    cp src/third_party/lss/*.h "$INCLUDE_DIRECTORY/third_party/lss"

    # And then cherry-pick some so they are found as used by the viewer
    cp src/common/using_std_string.h "$INCLUDE_DIRECTORY"
    cp src/client/linux/handler/exception_handler.h "$INCLUDE_DIRECTORY"
    cp src/client/linux/handler/exception_handler.h "$INCLUDE_DIRECTORY/google_breakpad/"
    cp src/client/linux/handler/minidump_descriptor.h "$INCLUDE_DIRECTORY"
    cp src/client/linux/handler/minidump_descriptor.h "$INCLUDE_DIRECTORY/google_breakpad/"
    cp src/processor/scoped_ptr.h "$INCLUDE_DIRECTORY/processor/scoped_ptr.h"
}

case "$AUTOBUILD_PLATFORM" in
    "windows")
        # patch vcproj generator to use Multi-Threaded DLL for +3 link karma
        #
	# modified gyp is checked in now...patch is in repo for reference
	#
        #patch -p 1 < gyp.patch
        (
            cd src/client/windows
            ../../tools/gyp/gyp --no-circular-check -f msvs -G msvs-version=2005
        )

        load_vsvars

        devenv.com src/client/windows/breakpad_client.sln /Upgrade
        devenv.com src/tools/windows/dump_syms/dump_syms.vcproj /Upgrade

        devenv.com src/client/windows/breakpad_client.sln /build "release" /project exception_handler
        devenv.com src/client/windows/breakpad_client.sln /build "debug" /project exception_handler
        devenv.com src/client/windows/breakpad_client.sln /build "release" /project crash_generation_client
        devenv.com src/client/windows/breakpad_client.sln /build "debug"  /project crash_generation_client
        devenv.com src/client/windows/breakpad_client.sln /build "release" /project crash_generation_server
        devenv.com src/client/windows/breakpad_client.sln /build "debug"  /project crash_generation_server
        devenv.com src/client/windows/breakpad_client.sln /build "release"  /project common
        devenv.com src/client/windows/breakpad_client.sln /build "debug"  /project common

        #using devenv directly - buildconsole doesn't support building vs2010 vcxproj files directly, yet
        devenv.com src/tools/windows/dump_syms/dump_syms.vcxproj /build "release|win32"

        mkdir -p "$INCLUDE_DIRECTORY/client/windows/"{common,crash_generation}
        mkdir -p "$INCLUDE_DIRECTORY/common/windows"
        mkdir -p "$INCLUDE_DIRECTORY/google_breakpad/common"
        mkdir -p "$INCLUDE_DIRECTORY/processor"

        cp ./src/client/windows/handler/exception_handler.h "$INCLUDE_DIRECTORY"
        cp ./src/client/windows/common/*.h "$INCLUDE_DIRECTORY/client/windows/common"
        cp ./src/common/windows/*.h "$INCLUDE_DIRECTORY/common/windows"
        cp ./src/client/windows/crash_generation/*.h "$INCLUDE_DIRECTORY/client/windows/crash_generation"
        cp ./src/google_breakpad/common/*.h "$INCLUDE_DIRECTORY/google_breakpad/common"
        cp ./src/client/windows/Debug/lib/*.lib "$LIBRARY_DIRECTORY_DEBUG"
        cp ./src/client/windows/Release/lib/*.lib "$LIBRARY_DIRECTORY_RELEASE"
        cp ./src/tools/windows/dump_syms/Release/dump_syms.exe "$BINARY_DIRECTORY"
        cp src/processor/scoped_ptr.h "$INCLUDE_DIRECTORY/processor/scoped_ptr.h"
        cp src/common/scoped_ptr.h "$INCLUDE_DIRECTORY/common/scoped_ptr.h"
    ;;
    darwin)
        (
            cd src/
	    rm CMakeCache.txt
            cmake -G Xcode CMakeLists.txt
            xcodebuild -arch i386 -project google_breakpad.xcodeproj -configuration Release
        )
        xcodebuild -arch i386 -project src/tools/mac/dump_syms/dump_syms.xcodeproj MACOSX_DEPLOYMENT_TARGET=10.6 -configuration Release
        mkdir -p "$INCLUDE_DIRECTORY/processor"
        mkdir -p "$INCLUDE_DIRECTORY/google_breakpad/common"
        mkdir -p "$INCLUDE_DIRECTORY/client/mac/crash_generation"
        mkdir -p "$INCLUDE_DIRECTORY/client/mac/crash_generation/common/mac"
        cp ./src/client/mac/handler/exception_handler.h "$INCLUDE_DIRECTORY"
        cp ./src/client/mac/crash_generation/crash_generation_client.h "$INCLUDE_DIRECTORY/client/mac/crash_generation"
        cp ./src/common/mac/MachIPC.h "$INCLUDE_DIRECTORY/client/mac/crash_generation/common/mac"
        cp ./src/client/mac/handler/Release/libexception_handler.dylib "$LIBRARY_DIRECTORY_RELEASE"
        cp ./src/tools/mac/dump_syms/build/Release/dump_syms "$BINARY_DIRECTORY"
        cp src/processor/scoped_ptr.h "$INCLUDE_DIRECTORY/processor/scoped_ptr.h"
        cp src/common/scoped_ptr.h "$INCLUDE_DIRECTORY/common/scoped_ptr.h"
    ;;
    "linux")
	build_linux /libraries/i686-linux 32
    ;;
    "linux64")
	build_linux /libraries/x86_64-linux 64
    ;;
esac

mkdir -p "$stage/LICENSES"
cp COPYING "$stage/LICENSES/google_breakpad.txt"

cd "$top"

pass


text:
Install `workbox-webpack-plugin`

Start by installing `workbox-webpack-plugin` from npm.

npm install workbox-webpack-plugin --save-dev


text:
package com.mundosica.coffx.Datasource;

import static com.mundosica.coffx.utility.Util.*;
import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author fitorec: Miguel Marcial
 *
 * Esta clase es una clase del tipo 'Factory' que básicamente se va encargando
 * de obtener la información de las tablas.
 */
public class BDMetadata {
    /**
     * Contiene las tablas ya cargadas.
     */
    private static final Map<String, TableMetadata> tables = new HashMap();

    /**
     * Devuelve un objeto TableInfo de información de una tabla en especifica,
     *  si no puede cargar la información de la tabla devuelve null.
     *
     * @param tableName
     * @return
     */
    public static TableMetadata get(String tableName) {
        if (BDMetadata.tables.containsKey(tableName)) {
            return BDMetadata.tables.get(tableName);
        }
        String className = null;
        try {
            className = "com.mundosica.coffx.Datasource."
                + camel(BD.configVal("type").toLowerCase() + " table info");
           TableMetadata tableInfo = (TableMetadata) Class.forName(className).newInstance();
           tableInfo.load(tableName);
            return tableInfo;
        } catch (Exception e) {
            echo("No se pudo cargar la clase: " + className);
            e.printStackTrace();
        }
        return null;
    }

    public static boolean put(String tableName) {
        if (BDMetadata.tables.containsKey(tableName)) {
            return false;
        }
        return true;
    }
}


text:
import {
  fakeAsync,
  inject,
  tick,
  TestBed
} from '@angular/core/testing';
import { Component } from '@angular/core';
import { BaseRequestOptions, Http } from '@angular/http';
import { By } from '@angular/platform-browser/src/dom/debug/by';
import { MockBackend } from '@angular/http/testing';

// Load the implementations that should be tested
import { XLargeDirective } from './x-large.directive';

describe('x-large directive', () => {
  // Create a test component to test directives
  @Component({
    template: '<div x-large>Content</div>'
  })
  class TestComponent {
  }

  beforeEach(() => {
    TestBed.configureTestingModule({
      declarations: [
        XLargeDirective,
        TestComponent
      ]
    });
  });

  it('should sent font-size to x-large', fakeAsync(() => {
    TestBed.compileComponents().then(() => {

      const fixture = TestBed.createComponent(TestComponent);
      fixture.detectChanges();
      tick();
      const element = fixture.debugElement.query(By.css('div'));

      expect(element.nativeElement.style.fontSize).toBe('x-large');

    });
  }));

});


text:
package org.killbill.billing.jaxrs.json;

import java.util.List;

import org.joda.time.LocalDate;
import org.killbill.billing.usage.api.RolledUpUnit;
import org.killbill.billing.usage.api.RolledUpUsage;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import com.wordnik.swagger.annotations.ApiModelProperty;

public class RolledUpUsageJson {

    @ApiModelProperty(dataType = "java.util.UUID")
    private final String subscriptionId;
    private final LocalDate startDate;
    private final LocalDate endDate;
    private final List<RolledUpUnitJson> rolledUpUnits;

    @JsonCreator
    public RolledUpUsageJson(@JsonProperty("subscriptionId") final String subscriptionId,
                             @JsonProperty("startDate") final LocalDate startDate,
                             @JsonProperty("endDate") final LocalDate endDate,
                             @JsonProperty("rolledUpUnits") final List<RolledUpUnitJson> rolledUpUnits) {
        this.subscriptionId = subscriptionId;
        this.startDate = startDate;
        this.endDate = endDate;
        this.rolledUpUnits = rolledUpUnits;
    }

    public RolledUpUsageJson(final RolledUpUsage input) {
        this(input.getSubscriptionId().toString(), input.getStart(), input.getEnd(), ImmutableList.copyOf(Iterables.transform(input.getRolledUpUnits(), new Function<RolledUpUnit, RolledUpUnitJson>() {
            @Override
            public RolledUpUnitJson apply(final RolledUpUnit input) {
                return new RolledUpUnitJson(input);
            }
        })));
    }

    public String getSubscriptionId() {
        return subscriptionId;
    }

    public LocalDate getStartDate() {
        return startDate;
    }

    public LocalDate getEndDate() {
        return endDate;
    }

    public List<RolledUpUnitJson> getRolledUpUnits() {
        return rolledUpUnits;
    }

    public static class RolledUpUnitJson {

        private final String unitType;
        private final Long amount;

        @JsonCreator
        public RolledUpUnitJson(@JsonProperty("unitType") final String unitType,
                                @JsonProperty("amount") final Long amount) {
            this.unitType = unitType;
            this.amount = amount;
        }

        public RolledUpUnitJson(final RolledUpUnit input) {
            this(input.getUnitType(), input.getAmount());
        }

        public String getUnitType() {
            return unitType;
        }

        public Long getAmount() {
            return amount;
        }
    }
}


text:
// This code emulates the 64x16/80x24 display controller.
//
// If the realtime mode is enabled, the timing of the original display
// controller is approximated.  Basically the ucode always checks to see
// if the card is busy before it sends any byte.  When a byte is received,
// the card asserts its busy flag until the requested operation is done.
// The timing to complete each operation is as follows
//    printable characters:
//        (see p. 6-8 and p. 6-13 of the 2200 service manual)
//        printable characters must wait until horizontal blanking
//        before they get saved into the display RAM, then busy is cleared.
//    screen clear:
//        (see p. 6-7 and p. 6-11 of the 2200 service manual)
//        the controller waits for vertical blanking, then it writes
//        a space to each character at the rate it would normally be
//        reading the bytes for display.  after all characters have
//        been written to spaces, the busy flag is cleared.
//    scroll event:
//        (see p. 6-11 of the 2200 service manual, called a "roll")
//        the description of the actions is hard to figure out without
//        detailed study of the schematic as several one-shots are
//        involved and I'm too lazy to decipher it.  it sounds like
//        after a short delay, a state machine writes the 64 characters
//        of the exposed row to spaces and then clears the busy flag.
//        instead, what the emulator implements is this:
//        the controller waits for a horizontal sync, then it writes
//        one row of characters to all spaces in the time it would
//        normally use to display one row of dots -- that is one
//        horizontal sweep period -- then busy is dropped.

/* character generation details
   + see p. 5-2 of the service manual (p 170 of 414)
        for 64x16
            - 5x7 dot matrix in a 7x15 character cell
                - scanline 1 is blank
                - scanlines 2-8 are 7 rows of character data
                - scanlines 9 is always blank
                - scanline 10 is optional cursor, which is 7 dots wide
                - scanlines 11-15 are blank
                - no underline
            - field is 256 rows; 1-240 are data, 241-256 are vblank
            - 60 Hz update rate
            - dot clock is 116 ns; char clock is 812 ns (7 dots)
            - 80 character times per scanline (65 uS)
        for 80x24
            - 8 rows of pixel data
            - 1 row of optional underline (>=0x80)
            - 1 row of cursor
            - 1 blank row
*/

#include "Cpu2200.h"
#include "IoCardDisplay.h"
#include "Scheduler.h"        // for Timer...() functions
#include "Terminal.h"
#include "Ui.h"
#include "host.h"             // for dbglog
#include "system2200.h"

#ifdef _MSC_VER
    #pragma warning( disable: 4127 )  // conditional expression is constant
#endif

static const bool do_dbg = false;  // turn on some debugging messages

// number of scanlines per display field
static const int num_scanlines = 256;

// horizontal refresh period = (1M us/s) / (60 frames/s * 256 rows/frame)
#define HSYNC_PERIOD (TIMER_US(65))

// vertical refresh period
#define VSYNC_PERIOD (HSYNC_PERIOD * num_scanlines)

// the logic of the card busy status is as follows.
//
// (1) the m_tmr_hsync timer is always running, no matter whether the user
//     wants realtime operation or not.  having this timer fire every 65 uS
//     hurts performance about 10% on my celeron 667 machine.  to minimize
//     this cost, once per vblank the state of the "realtime or not" boolean
//     is checked.  if realtime isn't requested, then the timer is set to
//     fire at the next vblank.  this cuts down on overhead by 256x.  the
//     reason for insisting it always run is that it cuts down on
//     complications of starting it/stopping it at arbitrary times.
//
// (2) the busy flag is always set on OBS.
//
// (3) as the character received by OBS is analyzed, some control codes
//     are acted upon and clear the busy state.  otherwise, the character's
//     effect is handled immediately and a small state machine is set up to
//     determine when to clear the busy state.  this state is advanced by
//     the m_tmr_hsync timer event.

// instance constructor
IoCardDisplay::IoCardDisplay(std::shared_ptr<Scheduler> scheduler,
                             std::shared_ptr<Cpu2200>   cpu,
                             int base_addr, int card_slot,
                             ui_screen_t screen_type) :
    m_scheduler(scheduler),
    m_cpu(cpu),
    m_base_addr(base_addr),
    m_slot(card_slot),
    m_screen_type(screen_type)
{
    if (m_slot < 0) {
        // this is just a probe to query properties, so don't make a window
        return;
    }

    reset(true);

    m_terminal = std::make_unique<Terminal>(scheduler, nullptr,
                                            base_addr, 0, screen_type, false);
    assert(m_terminal);
}

// instance destructor
IoCardDisplay::~IoCardDisplay()
{
    if (m_slot >= 0) {
        reset(true);    // turns off handshakes in progress
        m_terminal = nullptr;
    }
}

std::string
IoCardDisplay::getDescription() const
{
    return (m_screen_type == UI_SCREEN_64x16) ? "64x16 CRT Controller"
                                              : "80x24 CRT Controller";
}

std::string
IoCardDisplay::getName() const
{
    return (m_screen_type == UI_SCREEN_64x16) ? "6312A" : "7011";
}

// return a list of the various base addresses a card can map to
// list of common I/O addresses for this device taken from p. 2-5 of
// the default comes first.
std::vector<int>
IoCardDisplay::getBaseAddresses() const
{
    std::vector<int> v { 0x005, 0x006, 0x007 };
    return v;
}

// return the list of addresses that this specific card responds to
std::vector<int>
IoCardDisplay::getAddresses() const
{
    std::vector<int> v;
    v.push_back(m_base_addr);
    return v;
}

void
IoCardDisplay::reset(bool hard_reset)
{
    // reset card state
    m_busy_state = busy_state::IDLE;
    m_selected   = false;
    m_card_busy  = false;

    if (m_terminal) {
        // it might not exist if this was just a temporary card
        m_terminal->reset(hard_reset);
    }

    // get the horizontal sync timer going
    m_tmr_hsync = nullptr;
    m_hsync_count = 0;
    tcbHsync(0);
}

void
IoCardDisplay::select()
{
    if (do_dbg) {
        dbglog("display ABS\n");
    }

    m_selected = true;
    m_cpu->setDevRdy(!m_card_busy);
}

void
IoCardDisplay::deselect()
{
    if (do_dbg) {
        dbglog("display -ABS\n");
    }
    m_cpu->setDevRdy(false);

    m_selected = false;
}

void
IoCardDisplay::strobeOBS(int val)
{
    assert(m_busy_state == busy_state::IDLE);

    const uint8 val8 = val & 0xFF;

    if (do_dbg) {
        const char ch = (0x20 <= val8 && val8 < 0x7F) ? val8 : '.';
        dbglog("display OBS: Output of byte 0x%02x (%c)\n", val8, ch);
    }

    m_terminal->processChar(val8);

    if (system2200::isCpuSpeedRegulated()) {
        if (val8 == 0x03) {
            m_busy_state = busy_state::CLEAR1;
            m_card_busy = true;
#if 0
        } else if (val8 == 0x0A && cur_row == 15) {
            m_busy_state = busy_state::ROLL1;
            m_card_busy = true;
#endif
        } else if (val8 >= 0x10) {
            m_busy_state = busy_state::CHAR;
            m_card_busy = true;
        }
    }

    m_cpu->setDevRdy(!m_card_busy);
}

void
IoCardDisplay::strobeCBS(int val)
{
    val &= 0xFF;
#ifdef _DEBUG
    UI_warn("unexpected display CBS: Output of byte 0x%02x", val);
#endif
}

int
IoCardDisplay::getIB() const noexcept
{
    // the system uses this to determine screen size so effectively either
    //    SELECT PRINT 005(64), CO 005(64), LIST 005(64)
    // or
    //    SELECT PRINT 005(80), CO 005(80), LIST 005(80)
    // is performed on reset.
    return (m_screen_type == UI_SCREEN_80x24) ? 0x10 : 0x00;
}

// change of CPU Busy state
// because the display is write-only, we don't expect the CPU
// to poll us for input.
void
IoCardDisplay::setCpuBusy(bool busy)
{
    // it appears that except for reset, ucode only ever clears it,
    // and of course the IBS sets it back.
    if (do_dbg) {
        dbglog("display CPB%c\n", busy ? '+' : '-');
    }

    m_cpu->setDevRdy(!m_card_busy);
}

// horizontal sync timer callback
void
IoCardDisplay::tcbHsync(int arg)
{
    const bool regulated = system2200::isCpuSpeedRegulated();

    m_hsync_count++;

    int64 new_period = HSYNC_PERIOD;
    if (!regulated || (m_hsync_count >= num_scanlines)) {
        // once per vertical refresh -- just to keep the timer alive
        new_period = VSYNC_PERIOD;
        m_hsync_count = 1;
    }

    // retrigger the timer
#if 0
    m_tmr_hsync = m_scheduler->createTimer(new_period,
                                            [&](){ tcbHsync(arg); });
#else
    m_tmr_hsync = m_scheduler->createTimer(new_period,
                            std::bind(&IoCardDisplay::tcbHsync, this, arg));
#endif

    // advance state machine
    switch (m_busy_state) {

        case busy_state::IDLE:
            break;

        case busy_state::CHAR:
            m_card_busy = false;
            m_busy_state = busy_state::IDLE;
            m_cpu->setDevRdy(true);
            break;

        case busy_state::CLEAR1:
            if (m_hsync_count == 1) {    // vblank
                m_busy_state = busy_state::CLEAR2;
            }
            break;
        case busy_state::CLEAR2:
            if (m_hsync_count == 1) {    // vblank
                m_card_busy = false;
                m_busy_state = busy_state::IDLE;
                m_cpu->setDevRdy(true);
            }
            break;

        case busy_state::ROLL1:
            m_busy_state = busy_state::ROLL2;
            break;
        case busy_state::ROLL2:
            m_card_busy = false;
            m_busy_state = busy_state::IDLE;
            m_cpu->setDevRdy(true);
            break;

        default:
            assert(false);
            break;
    }
}

// vim: ts=8:et:sw=4:smarttab


text:
id: 56533eb9ac21ba0edf2244ab
title: Understanding Case Sensitivity in Variables
challengeType: 1
videoUrl: ''
localeTitle: ''
---

## Description
undefined

## Instructions
undefined

## Tests

```yml
tests:
  - text: ''
    testString: 'assert(typeof studlyCapVar !== "undefined" && studlyCapVar === 10, "<code>studlyCapVar</code> is defined and has a value of <code>10</code>");'
  - text: ''
    testString: 'assert(typeof properCamelCase !== "undefined" && properCamelCase === "A String", "<code>properCamelCase</code> is defined and has a value of <code>"A String"</code>");'
  - text: ''
    testString: 'assert(typeof titleCaseOver !== "undefined" && titleCaseOver === 9000, "<code>titleCaseOver</code> is defined and has a value of <code>9000</code>");'
  - text: ''
    testString: 'assert(code.match(/studlyCapVar/g).length === 2, "<code>studlyCapVar</code> should use camelCase in both declaration and assignment sections.");'
  - text: ''
    testString: 'assert(code.match(/properCamelCase/g).length === 2, "<code>properCamelCase</code> should use camelCase in both declaration and assignment sections.");'
  - text: ''
    testString: 'assert(code.match(/titleCaseOver/g).length === 2, "<code>titleCaseOver</code> should use camelCase in both declaration and assignment sections.");'

```

## Challenge Seed

```js
// Declarations
var StUdLyCapVaR;
var properCamelCase;
var TitleCaseOver;

// Assignments
STUDLYCAPVAR = 10;
PRoperCAmelCAse = "A String";
tITLEcASEoVER = 9000;

```

## Solution

```js
// solution required
```


text:
<?php

namespace Puli\Cli\Updater;

use Humbug\SelfUpdate\Exception\HttpRequestException;
use Humbug\SelfUpdate\Strategy\StrategyInterface;
use Humbug\SelfUpdate\Updater;
use Humbug\SelfUpdate\VersionParser;
use InvalidArgumentException;
use Puli\Cli\PuliApplicationConfig;

class PuliStrategy implements StrategyInterface
{
    const ANY = 'any';
    const STABLE = 'stable';
    const UNSTABLE = 'unstable';

    const MANIFEST = 'https://puli.io/download/versions.json';
    const REMOTE_PHAR = 'https://puli.io/download/%s/puli.phar';

    /**
     * @var array
     */
    private static $stabilities = array(
        self::STABLE,
        self::UNSTABLE,
        self::ANY,
    );

    /**
     * @var string
     */
    private $stability = self::ANY;

    /**
     * Download the remote Phar file.
     *
     * @param Updater $updater
     */
    public function download(Updater $updater)
    {
        /* Switch remote request errors to HttpRequestExceptions */
        set_error_handler(array($updater, 'throwHttpRequestException'));

        $remoteUrl = sprintf(
            self::REMOTE_PHAR,
            $this->getCurrentRemoteVersion($updater)
        );

        $result = humbug_get_contents($remoteUrl);
        restore_error_handler();

        if (false === $result) {
            throw new HttpRequestException(sprintf(
                'Request to URL failed: %s', $remoteUrl
            ));
        }

        file_put_contents($updater->getTempPharFile(), $result);
    }

    /**
     * Retrieve the current version available remotely.
     *
     * @param Updater $updater
     *
     * @return string
     */
    public function getCurrentRemoteVersion(Updater $updater)
    {
        /* Switch remote request errors to HttpRequestExceptions */
        set_error_handler(array($updater, 'throwHttpRequestException'));
        $versions = json_decode(humbug_get_contents(self::MANIFEST), true);
        restore_error_handler();

        if (false === $versions) {
            throw new HttpRequestException(sprintf(
                'Request to URL failed: %s', self::MANIFEST
            ));
        }

        $versionParser = new VersionParser($versions);

        if ($this->getStability() === self::STABLE) {
            return $versionParser->getMostRecentStable();
        }

        if ($this->getStability() === self::UNSTABLE) {
            return $versionParser->getMostRecentUnstable();
        }

        return $versionParser->getMostRecentAll();
    }

    /**
     * Retrieve the current version of the local phar file.
     *
     * @param Updater $updater
     *
     * @return string
     */
    public function getCurrentLocalVersion(Updater $updater)
    {
        return PuliApplicationConfig::VERSION;
    }

    /**
     * Set target stability.
     *
     * @param string $stability
     */
    public function setStability($stability)
    {
        if (!in_array($stability, self::$stabilities, true)) {
            throw new InvalidArgumentException(
                'Invalid stability value. Must be one of "stable", "unstable" or "any".'
            );
        }

        $this->stability = $stability;
    }

    /**
     * Get target stability.
     *
     * @return string
     */
    public function getStability()
    {
        return $this->stability;
    }
}


text:
<!--
  ~ Copyright (c) 2015-present, Parse, LLC.
  ~ All rights reserved.
  ~
  ~ This source code is licensed under the BSD-style license found in the
  ~ LICENSE file in the root directory of this source tree. An additional grant
  ~ of patent rights can be found in the PATENTS file in the same directory.
  -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:paddingLeft="@dimen/activity_horizontal_margin"
                android:paddingRight="@dimen/activity_horizontal_margin"
                android:paddingTop="@dimen/activity_vertical_margin"
                android:paddingBottom="@dimen/activity_vertical_margin"
                tools:context=".MainActivity"
    android:theme="@android:style/Theme.Holo.Light.NoActionBar">
    <ImageView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/imageView"

        android:layout_alignWithParentIfMissing="false"
        android:adjustViewBounds="false"
        android:scaleType="centerCrop"
        android:src="@mipmap/logo"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true" />

    <TextView
        android:text="@string/lblCity"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/lblCity"
        android:layout_below="@+id/imageView"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true" />

    <Spinner
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/cbCities"
        android:spinnerMode="dropdown"
        android:layout_below="@+id/lblCity"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        />

    <ListView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/lstNotifications"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:choiceMode="singleChoice"
        android:layout_below="@+id/textView" />

    <TextView
        android:text="Últimas notificaciones:"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/textView"
        android:layout_below="@+id/cbCities"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true" />

</RelativeLayout>
<!-- From: file:/C:/DEV/AlertasBC/ParseStarterProject/src/main/res/layout/activity_main.xml -->


text:
#include <aws/lambda/model/LastUpdateStatusReasonCode.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

using namespace Aws::Utils;

namespace Aws
{
  namespace Lambda
  {
    namespace Model
    {
      namespace LastUpdateStatusReasonCodeMapper
      {

        static const int EniLimitExceeded_HASH = HashingUtils::HashString("EniLimitExceeded");
        static const int InsufficientRolePermissions_HASH = HashingUtils::HashString("InsufficientRolePermissions");
        static const int InvalidConfiguration_HASH = HashingUtils::HashString("InvalidConfiguration");
        static const int InternalError_HASH = HashingUtils::HashString("InternalError");
        static const int SubnetOutOfIPAddresses_HASH = HashingUtils::HashString("SubnetOutOfIPAddresses");
        static const int InvalidSubnet_HASH = HashingUtils::HashString("InvalidSubnet");
        static const int InvalidSecurityGroup_HASH = HashingUtils::HashString("InvalidSecurityGroup");
        static const int ImageDeleted_HASH = HashingUtils::HashString("ImageDeleted");
        static const int ImageAccessDenied_HASH = HashingUtils::HashString("ImageAccessDenied");
        static const int InvalidImage_HASH = HashingUtils::HashString("InvalidImage");

        LastUpdateStatusReasonCode GetLastUpdateStatusReasonCodeForName(const Aws::String& name)
        {
          int hashCode = HashingUtils::HashString(name.c_str());
          if (hashCode == EniLimitExceeded_HASH)
          {
            return LastUpdateStatusReasonCode::EniLimitExceeded;
          }
          else if (hashCode == InsufficientRolePermissions_HASH)
          {
            return LastUpdateStatusReasonCode::InsufficientRolePermissions;
          }
          else if (hashCode == InvalidConfiguration_HASH)
          {
            return LastUpdateStatusReasonCode::InvalidConfiguration;
          }
          else if (hashCode == InternalError_HASH)
          {
            return LastUpdateStatusReasonCode::InternalError;
          }
          else if (hashCode == SubnetOutOfIPAddresses_HASH)
          {
            return LastUpdateStatusReasonCode::SubnetOutOfIPAddresses;
          }
          else if (hashCode == InvalidSubnet_HASH)
          {
            return LastUpdateStatusReasonCode::InvalidSubnet;
          }
          else if (hashCode == InvalidSecurityGroup_HASH)
          {
            return LastUpdateStatusReasonCode::InvalidSecurityGroup;
          }
          else if (hashCode == ImageDeleted_HASH)
          {
            return LastUpdateStatusReasonCode::ImageDeleted;
          }
          else if (hashCode == ImageAccessDenied_HASH)
          {
            return LastUpdateStatusReasonCode::ImageAccessDenied;
          }
          else if (hashCode == InvalidImage_HASH)
          {
            return LastUpdateStatusReasonCode::InvalidImage;
          }
          EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
          if(overflowContainer)
          {
            overflowContainer->StoreOverflow(hashCode, name);
            return static_cast<LastUpdateStatusReasonCode>(hashCode);
          }

          return LastUpdateStatusReasonCode::NOT_SET;
        }

        Aws::String GetNameForLastUpdateStatusReasonCode(LastUpdateStatusReasonCode enumValue)
        {
          switch(enumValue)
          {
          case LastUpdateStatusReasonCode::EniLimitExceeded:
            return "EniLimitExceeded";
          case LastUpdateStatusReasonCode::InsufficientRolePermissions:
            return "InsufficientRolePermissions";
          case LastUpdateStatusReasonCode::InvalidConfiguration:
            return "InvalidConfiguration";
          case LastUpdateStatusReasonCode::InternalError:
            return "InternalError";
          case LastUpdateStatusReasonCode::SubnetOutOfIPAddresses:
            return "SubnetOutOfIPAddresses";
          case LastUpdateStatusReasonCode::InvalidSubnet:
            return "InvalidSubnet";
          case LastUpdateStatusReasonCode::InvalidSecurityGroup:
            return "InvalidSecurityGroup";
          case LastUpdateStatusReasonCode::ImageDeleted:
            return "ImageDeleted";
          case LastUpdateStatusReasonCode::ImageAccessDenied:
            return "ImageAccessDenied";
          case LastUpdateStatusReasonCode::InvalidImage:
            return "InvalidImage";
          default:
            EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
            if(overflowContainer)
            {
              return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
            }

            return {};
          }
        }

      } // namespace LastUpdateStatusReasonCodeMapper
    } // namespace Model
  } // namespace Lambda
} // namespace Aws


text:
'use strict';

/**
 * Module dependencies.
 */
var mongoose = require('mongoose'),
	Schema = mongoose.Schema;

/**
 * Household Schema
 */
var HouseholdSchema = new Schema({
	name: {
		type: String,
		default: '',
		required: 'Please fill Household name',
		trim: true
	},
	created: {
		type: Date,
		default: Date.now
	},
	users: [{
		type: Schema.ObjectId,
		ref: 'User'
	}]
});

mongoose.model('Household', HouseholdSchema);


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.leonds.blog.console.mapper">

    <select id="getSequence" parameterType="hashmap" resultType="string">
       SELECT nextval(#{name})
    </select>

</mapper>


text:
"use strict";
var fs = require("fs");
var prh = require("textlint-rule-prh");
var reporter = function (context) {
    // 辞書ベースのカタカタ表記のチェックを行う
    var ruleContent = fs.readFileSync(__dirname + "/../dict/web+db_press.yml", "utf-8");
    return prh.fixer(context, {
        ruleContents: [ruleContent]
    });
};
module.exports = {
    linter: reporter,
    fixer: reporter
};


text:
package chapter14;

public class House implements Cloneable, Comparable<Object> {
	private int id;
	private double area;
	private java.util.Date whenBuilt;

	public House(int id, double area) {
		this.id = id;
		this.area = area;
		whenBuilt = new java.util.Date();
	}

	public double getId() {
		return id;
	}

	public double getArea() {
		return area;
	}

	public java.util.Date getWhenBuilt() {
		return whenBuilt;
	}

	/**
	 * Override the protected clone method defined in the Object class, and
	 * strengthen its accessibility
	 */
	public Object clone() throws CloneNotSupportedException {
		return super.clone();
	}

	/** Implement the compareTo method defined in Comparable */
	public int compareTo(Object o) {
		if (area > ((House) o).area)
			return 1;
		else if (area < ((House) o).area)
			return -1;
		else
			return 0;
	}
}


text:
package org.apache.drill.exec.expr.fn.registry;

import org.apache.drill.shaded.guava.com.google.common.collect.ArrayListMultimap;
import org.apache.drill.shaded.guava.com.google.common.collect.ListMultimap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.drill.common.AutoCloseables.Closeable;
import org.apache.drill.common.concurrent.AutoCloseableLock;
import org.apache.drill.exec.expr.fn.DrillFuncHolder;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Queue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;

/**
 * Function registry holder stores function implementations by jar name, function name.
 * Contains two maps that hold data by jars and functions respectively.
 * Jars map contains each jar as a key and map of all its functions with collection of function signatures as value.
 * Functions map contains function name as key and map of its signatures and function holder as value.
 * All maps and collections used are concurrent to guarantee memory consistency effects.
 * Such structure is chosen to achieve maximum speed while retrieving data by jar or by function name,
 * since we expect infrequent registry changes.
 * Holder is designed to allow concurrent reads and single writes to keep data consistent.
 * This is achieved by {@link ReadWriteLock} implementation usage.
 * Holder has number version which indicates remote function registry version number it is in sync with.
 *

 * Structure example:
 *
 *

 * JARS
 * built-in   -> upper          -> upper(VARCHAR-REQUIRED)
 *            -> lower          -> lower(VARCHAR-REQUIRED)
 *
 * First.jar  -> upper          -> upper(VARCHAR-OPTIONAL)
 *            -> custom_upper   -> custom_upper(VARCHAR-REQUIRED)
 *                              -> custom_upper(VARCHAR-OPTIONAL)
 *
 * Second.jar -> lower          -> lower(VARCHAR-OPTIONAL)
 *            -> custom_upper   -> custom_upper(VARCHAR-REQUIRED)
 *                              -> custom_upper(VARCHAR-OPTIONAL)
 *
 * FUNCTIONS
 * upper        -> upper(VARCHAR-REQUIRED)        -> function holder for upper(VARCHAR-REQUIRED)
 *              -> upper(VARCHAR-OPTIONAL)        -> function holder for upper(VARCHAR-OPTIONAL)
 *
 * lower        -> lower(VARCHAR-REQUIRED)        -> function holder for lower(VARCHAR-REQUIRED)
 *              -> lower(VARCHAR-OPTIONAL)        -> function holder for lower(VARCHAR-OPTIONAL)
 *
 * custom_upper -> custom_upper(VARCHAR-REQUIRED) -> function holder for custom_upper(VARCHAR-REQUIRED)
 *              -> custom_upper(VARCHAR-OPTIONAL) -> function holder for custom_upper(VARCHAR-OPTIONAL)
 *
 * custom_lower -> custom_lower(VARCHAR-REQUIRED) -> function holder for custom_lower(VARCHAR-REQUIRED)
 *              -> custom_lower(VARCHAR-OPTIONAL) -> function holder for custom_lower(VARCHAR-OPTIONAL)
 *

 * where
 *
First.jar is jar name represented by {@link String}.

 *
upper is function name represented by {@link String}.

 *
upper(VARCHAR-REQUIRED) is signature name represented by String which consist of function name, list of input parameters.

 *
function holder for upper(VARCHAR-REQUIRED) is {@link DrillFuncHolder} initiated for each function.

 *
 */
public class FunctionRegistryHolder implements AutoCloseable {
  private static final Logger logger = LoggerFactory.getLogger(FunctionRegistryHolder.class);

  private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
  private final AutoCloseableLock readLock = new AutoCloseableLock(readWriteLock.readLock());
  private final AutoCloseableLock writeLock = new AutoCloseableLock(readWriteLock.writeLock());
  // remote function registry number, it is in sync with
  private int version;

  // jar name, Map<function name, Queue<function signature>
  private final Map<String, Map<String, Queue<String>>> jars;

  // function name, Map<function signature, function holder>
  private final Map<String, Map<String, DrillFuncHolder>> functions;

  public FunctionRegistryHolder() {
    this.functions = new ConcurrentHashMap<>();
    this.jars = new ConcurrentHashMap<>();
  }

  /**
   * This is read operation, so several users at a time can get this data.
   * @return local function registry version number
   */
  public int getVersion() {
    try (@SuppressWarnings("unused") Closeable lock = readLock.open()) {
      return version;
    }
  }

  /**
   * Adds jars to the function registry.
   * If jar with the same name already exists, it and its functions will be removed.
   * Then jar will be added to {@link #jars}
   * and each function will be added using {@link #addFunctions(Map, List)}.
   * Registry version is updated with passed version if all jars were added successfully.
   * This is write operation, so one user at a time can call perform such action,
   * others will wait till first user completes his action.
   *
   * @param newJars jars and list of their function holders, each contains function name, signature and holder
   */
  public void addJars(Map<String, List<FunctionHolder>> newJars, int version) {
    try (@SuppressWarnings("unused") Closeable lock = writeLock.open()) {
      for (Map.Entry<String, List<FunctionHolder>> newJar : newJars.entrySet()) {
        String jarName = newJar.getKey();
        removeAllByJar(jarName);
        Map<String, Queue<String>> jar = new ConcurrentHashMap<>();
        jars.put(jarName, jar);
        addFunctions(jar, newJar.getValue());
      }
      this.version = version;
    }
  }

  /**
   * Removes jar from {@link #jars} and all associated with jar functions from {@link #functions}
   * This is write operation, so one user at a time can call perform such action,
   * others will wait till first user completes his action.
   *
   * @param jarName jar name to be removed
   */
  public void removeJar(String jarName) {
    try (@SuppressWarnings("unused") Closeable lock = writeLock.open()) {
      removeAllByJar(jarName);
    }
  }

  /**
   * Retrieves list of all jars name present in {@link #jars}
   * This is read operation, so several users can get this data.
   *
   * @return list of all jar names
   */
  public List<String> getAllJarNames() {
    try (@SuppressWarnings("unused") Closeable lock = readLock.open()) {
      return new ArrayList<>(jars.keySet());
    }
  }

  /**
   * Retrieves all functions (holders) associated with all the jars
   * This is read operation, so several users can perform this operation at the same time.
   * @return list of all functions, mapped by their sources
   */
  public Map<String, List<FunctionHolder>> getAllJarsWithFunctionHolders() {
    Map<String, List<FunctionHolder>> allFunctionHoldersByJar = new HashMap<>();

    try (@SuppressWarnings("unused") Closeable lock = readLock.open()) {
      for (String jarName : jars.keySet()) {
        //Capture functionHolders here
        List<FunctionHolder> drillFuncHolderList = new LinkedList<>();

        Map<String, Queue<String>> functionsInJar = jars.get(jarName);
        for (Map.Entry<String, Queue<String>> functionEntry : functionsInJar.entrySet()) {
          String fnName = functionEntry.getKey();
          Queue<String> fnSignatureList = functionEntry.getValue();
          //Get all FunctionHolders (irrespective of source)
          Map<String, DrillFuncHolder> functionHolders = functions.get(fnName);
          //Iterate for matching entries and populate new Map
          for (Map.Entry<String, DrillFuncHolder> entry : functionHolders.entrySet()) {
            if (fnSignatureList.contains(entry.getKey())) {
              drillFuncHolderList.add(new FunctionHolder(fnName, entry.getKey(), entry.getValue()));
            }
          }
        }
        allFunctionHoldersByJar.put(jarName, drillFuncHolderList);
      }
    }
    return allFunctionHoldersByJar;
  }

  /**
   * Retrieves all function names associated with the jar from {@link #jars}.
   * Returns empty list if jar is not registered.
   * This is a read operation, so several users can perform this operation at the same time.
   *
   * @param jarName jar name
   * @return list of functions names associated from the jar
   */
  public List<String> getFunctionNamesByJar(String jarName) {
    try (@SuppressWarnings("unused") Closeable lock = readLock.open()){
      Map<String, Queue<String>> functions = jars.get(jarName);
      return functions == null ? new ArrayList<>() : new ArrayList<>(functions.keySet());
    }
  }

  /**
   * Returns list of functions with list of function holders for each functions.
   * Uses guava {@link ListMultimap} structure to return data.
   * If no functions present, will return empty {@link ListMultimap}.
   * If version holder is not null, updates it with current registry version number.
   * This is a read operation, so several users can perform this operation at the same time.
   *
   * @param version version holder
   * @return all functions which their holders
   */
  public ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicInteger version) {
    try (@SuppressWarnings("unused") Closeable lock = readLock.open()) {
      if (version != null) {
        version.set(this.version);
      }
      ListMultimap<String, DrillFuncHolder> functionsWithHolders = ArrayListMultimap.create();
      for (Map.Entry<String, Map<String, DrillFuncHolder>> function : functions.entrySet()) {
        functionsWithHolders.putAll(function.getKey(), new ArrayList<>(function.getValue().values()));
      }
      return functionsWithHolders;
    }
  }

  /**
   * Returns list of functions with list of function holders for each functions without version number.
   * This is a read operation, so several users can perform this operation at the same time.
   *
   * @return all functions which their holders
   */
  public ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders() {
    return getAllFunctionsWithHolders(null);
  }

  /**
   * Returns list of functions with list of function signatures for each functions.
   * Uses guava {@link ListMultimap} structure to return data.
   * If no functions present, will return empty {@link ListMultimap}.
   * This is a read operation, so several users can perform this operation at the same time.
   *
   * @return all functions which their signatures
   */
  public ListMultimap<String, String> getAllFunctionsWithSignatures() {
    try (@SuppressWarnings("unused") Closeable lock = readLock.open()) {
      ListMultimap<String, String> functionsWithSignatures = ArrayListMultimap.create();
      for (Map.Entry<String, Map<String, DrillFuncHolder>> function : functions.entrySet()) {
        functionsWithSignatures.putAll(function.getKey(), new ArrayList<>(function.getValue().keySet()));
      }
      return functionsWithSignatures;
    }
  }

  /**
   * Returns all function holders associated with function name.
   * If function is not present, will return empty list.
   * If version holder is not null, updates it with current registry version number.
   * This is a read operation, so several users can perform this operation at the same time.
   *
   * @param functionName function name
   * @param version version holder
   * @return list of function holders
   */
  public List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicInteger version) {
    try (@SuppressWarnings("unused") Closeable lock = readLock.open()) {
      if (version != null) {
        version.set(this.version);
      }
      Map<String, DrillFuncHolder> holders = functions.get(functionName);
      return holders == null ? new ArrayList<>() : new ArrayList<>(holders.values());
    }
  }

  /**
   * Returns all function holders associated with function name without version number.
   * This is a read operation, so several users can perform this operation at the same time.
   *
   * @param functionName function name
   * @return list of function holders
   */
  public List<DrillFuncHolder> getHoldersByFunctionName(String functionName) {
    return getHoldersByFunctionName(functionName, null);
  }

  /**
   * Checks is jar is present in {@link #jars}.
   * This is a read operation, so several users can perform this operation at the same time.
   *
   * @param jarName jar name
   * @return true if jar exists, else false
   */
  public boolean containsJar(String jarName) {
    try (@SuppressWarnings("unused") Closeable lock = readLock.open()) {
      return jars.containsKey(jarName);
    }
  }

  /**
   * Returns quantity of functions stored in {@link #functions}.
   * This is a read operation, so several users can perform this operation at the same time.
   *
   * @return quantity of functions
   */
  public int functionsSize() {
    try (@SuppressWarnings("unused") Closeable lock = readLock.open()) {
      return functions.size();
    }
  }

  /**
   * Looks which jar in {@link #jars} contains passed function signature.
   * First looks by function name and if found checks if such function has passed function signature.
   * Returns jar name if found matching function signature, else null.
   * This is a read operation, so several users can perform this operation at the same time.
   *
   * @param functionName function name
   * @param functionSignature function signature
   * @return jar name
   */
  public String getJarNameByFunctionSignature(String functionName, String functionSignature) {
    try (@SuppressWarnings("unused") Closeable lock = readLock.open()) {
      for (Map.Entry<String, Map<String, Queue<String>>> jar : jars.entrySet()) {
        Queue<String> functionSignatures = jar.getValue().get(functionName);
        if (functionSignatures != null && functionSignatures.contains(functionSignature)) {
          return jar.getKey();
        }
      }
    }
    return null;
  }

  /**
   * Adds all function names and signatures to passed jar,
   * adds all function names, their signatures and holders to {@link #functions}.
   *
   * @param jar jar where function to be added
   * @param newFunctions collection of function holders, each contains function name, signature and holder.
   */
  private void addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions) {
    for (FunctionHolder function : newFunctions) {
      final String functionName = function.getName();
      Queue<String> jarFunctions = jar.get(functionName);
      if (jarFunctions == null) {
        jarFunctions = new ConcurrentLinkedQueue<>();
        jar.put(functionName, jarFunctions);
      }
      final String functionSignature = function.getSignature();
      jarFunctions.add(functionSignature);

      Map<String, DrillFuncHolder> signatures = functions.computeIfAbsent(functionName, k -> new ConcurrentHashMap<>());
      signatures.put(functionSignature, function.getHolder());
    }
  }

  /**
   * Removes jar from {@link #jars} and all associated with jars functions from {@link #functions}
   * Since each jar is loaded with separate class loader before
   * removing we need to close class loader to release opened connection to jar.
   * All jar functions have the same class loader, so we need to close only one time.
   *
   * @param jarName jar name to be removed
   */
  private void removeAllByJar(String jarName) {
    Map<String, Queue<String>> jar = jars.remove(jarName);
    if (jar == null) {
      return;
    }

    boolean isClosed  = false;
    for (Map.Entry<String, Queue<String>> functionEntry : jar.entrySet()) {
      final String function = functionEntry.getKey();
      Map<String, DrillFuncHolder> functionHolders = functions.get(function);
      Queue<String> functionSignatures = functionEntry.getValue();
      // closes class loader only one time
      isClosed = !isClosed && closeClassLoader(function, functionSignatures);
      functionHolders.keySet().removeAll(functionSignatures);

      if (functionHolders.isEmpty()) {
        functions.remove(function);
      }
    }
  }

  @Override
  public void close() {
    try (@SuppressWarnings("unused") Closeable lock = writeLock.open()) {
      jars.forEach((jarName, jar) -> {
        if (!LocalFunctionRegistry.BUILT_IN.equals(jarName)) {
          for (Map.Entry<String, Queue<String>> functionEntry : jar.entrySet()) {
            if (closeClassLoader(functionEntry.getKey(), functionEntry.getValue())) {
              // class loader is closed, iterates to another jar
              break;
            }
          }
        }
      });
    }
  }

  /**
   * Produces search of {@link DrillFuncHolder} which corresponds to specified {@code String functionName}
   * with signature from {@code Queue<String> functionSignatures},
   * closes its class loader if {@link DrillFuncHolder} is found and returns true. Otherwise false is returned.
   *
   * @param functionName       name of the function
   * @param functionSignatures function signatures
   * @return {@code true} if {@link DrillFuncHolder} was found and attempted to close class loader disregarding the result
   */
  private boolean closeClassLoader(String functionName, Queue<String> functionSignatures) {
    return getDrillFuncHolder(functionName, functionSignatures)
        .map(drillFuncHolder -> {
          ClassLoader classLoader = drillFuncHolder.getClassLoader();
          try {
            ((AutoCloseable) classLoader).close();
          } catch (Exception e) {
            logger.warn("Problem during closing class loader", e);
          }
          return true;
        })
        .orElse(false);
  }

  /**
   * Produces search of {@link DrillFuncHolder} which corresponds to specified {@code String functionName}
   * with signature from {@code Queue<String> functionSignatures} and returns first found instance.
   *
   * @param functionName       name of the function
   * @param functionSignatures function signatures
   * @return {@link Optional} with first found {@link DrillFuncHolder} instance
   */
  private Optional<DrillFuncHolder> getDrillFuncHolder(String functionName, Queue<String> functionSignatures) {
    Map<String, DrillFuncHolder> functionHolders = functions.get(functionName);
    return functionSignatures.stream()
        .map(functionHolders::get)
        .filter(Objects::nonNull)
        .findAny();
  }
}


text:
require "ncurses"
include Ncurses


text:
Презентация по предмету хз, скородумов, использовано [shwr.me](http://shwr.me/)

Licensed under [MIT License](http://en.wikipedia.org/wiki/MIT_License), see
[license page](https://github.com/shower/shower/wiki/MIT-License) for details.


text:
cask "zoom" do
  version "5.8.1.1983"

  if Hardware::CPU.intel?
    sha256 "0dbad89f49285db7b42bcb9853e818b2fc9d3d7191cf539decdf848b729a7e17"

    url "https://cdn.zoom.us/prod/#{version}/Zoom.pkg"
  else
    sha256 "eeaf6961881a46aaac266f06114adfecc23d7b4273906491751e03a07bd9c26d"

    url "https://cdn.zoom.us/prod/#{version}/arm64/Zoom.pkg"
  end

  name "Zoom.us"
  desc "Video communication and virtual meeting platform"
  homepage "https://www.zoom.us/"

  livecheck do
    url "https://zoom.us/client/latest/Zoom.pkg"
    strategy :header_match
  end

  # Do not add `auto_updates`. While supporting an auto-update mechanism, this software is more inconvenient than most
  # See https://github.com/Homebrew/homebrew-cask/pull/93083

  conflicts_with cask: "zoom-for-it-admins"

  pkg "Zoom.pkg"

  postflight do
    # Description: Ensure console variant of postinstall is non-interactive.
    # This is because `open "$APP_PATH"&` is called from the postinstall
    # script of the package and we don't want any user intervention there.
    retries ||= 3
    ohai "The Zoom package postinstall script launches the Zoom app" unless retries < 3
    ohai "Attempting to close zoom.us.app to avoid unwanted user intervention" unless retries < 3
    return unless system_command "/usr/bin/pkill", args: ["-f", "/Applications/zoom.us.app"]

    rescue RuntimeError
      sleep 1
      retry unless (retries -= 1).zero?
      opoo "Unable to forcibly close zoom.us.app"
  end

  uninstall signal:  ["KILL", "us.zoom.xos"],
            pkgutil: "us.zoom.pkg.videomeeting",
            delete:  [
              "/Applications/zoom.us.app",
              "/Library/Internet Plug-Ins/ZoomUsPlugIn.plugin",
              "/Library/Logs/DiagnosticReports/zoom.us*",
            ]

  zap trash: [
    "~/.zoomus",
    "~/Desktop/Zoom",
    "~/Documents/Zoom",
    "~/Library/Application Support/CloudDocs/session/containers/iCloud.us.zoom.videomeetings",
    "~/Library/Application Support/CloudDocs/session/containers/iCloud.us.zoom.videomeetings.plist",
    "~/Library/Application Support/CrashReporter/zoom.us*",
    "~/Library/Application Support/zoom.us",
    "~/Library/Caches/us.zoom.xos",
    "~/Library/Cookies/us.zoom.xos.binarycookies",
    "~/Library/Internet Plug-Ins/ZoomUsPlugIn.plugin",
    "~/Library/Logs/zoom.us",
    "~/Library/Logs/zoominstall.log",
    "~/Library/Logs/ZoomPhone",
    "~/Library/Group Containers/BJ4HAAB9B3.ZoomClient3rd",
    "~/Library/Mobile Documents/iCloud~us~zoom~videomeetings",
    "~/Library/Preferences/ZoomChat.plist",
    "~/Library/Preferences/us.zoom.airhost.plist",
    "~/Library/Preferences/us.zoom.caphost.plist",
    "~/Library/Preferences/us.zoom.Transcode.plist",
    "~/Library/Preferences/us.zoom.xos.Hotkey.plist",
    "~/Library/Preferences/us.zoom.xos.plist",
    "~/Library/Safari/PerSiteZoomPreferences.plist",
    "~/Library/SafariTechnologyPreview/PerSiteZoomPreferences.plist",
    "~/Library/Saved Application State/us.zoom.xos.savedState",
  ]
end


text:
Meteor.publish('popular', function () {
  var self = this,
      handle = Events.aggregate([
        {$match: {entity_type: 'Concept'}},
        {$group: {_id: {slug: '$entity_slug', title: '$entity_title'}, count: {$sum: 1}}},
        {$sort: {count: -1}},
        {$limit: 10}
      ]).forEach(function (c) {
          self.added('popular', c._id.slug, {
              slug: c._id.slug,
              title: c._id.title,
              count: c.count
          });
      });
    this.ready();
});

// Concepts
Meteor.publish('concepts', function (/* args */) {
  var data = Concepts.find({}, {fields: {title: 1, slug: 1, category: 1}, sort: {title: 1}});
  if (data) {
    return data;
  }
  this.ready();
});

Meteor.publishComposite('conceptDetail', function (slug) {
  return {
      collectionName: 'conceptDetail',
      find: function () {
          return Concepts.find({'slug': slug});
      },
      children: []
  };
});

// Publications
Meteor.publish('publications', function (/* args */) {
  return Publications.find({}, {fields: {title: 1, slug: 1}});
});

Meteor.publish('publication', function (slug) {
  check(slug, String);
  var data = Publications.find({'slug': slug});
  if (data) {
    return data;
  }
  this.ready();
});

// Categories
Meteor.publish('categories', function (/* args */) {
  return Categories.find({}, {fields: {title: 1, definition: 1, slug: 1}});
});


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

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>RF22: rf22_serial_modem.pde</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

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

RF22

Main Page

Classes

Files

Examples

rf22_serial_modem.pde

Example sketch implements a bidirectional serial modem with the RF22ReliableDatagram class. It is designed to work with another instance of rf22_serial_modem. Pairs of arduino+radio running this program translate input Serial port data to radio and send it to the other side where the data is sent out on its serial port. So it acts like a transparent serial cable over radio. Pairs of radios share the same ADDRESS, and therefore you can have up to 256 such pairs sharing the same airspace. In the event of radio communications failure, it fails silently.

<address class="footer">
Generated by

 1.8.5
</address>


text:
using System;
using System.Collections.Generic;
using System.Linq;

using LL.MDE.Components.Common.EnArLoader;
using LL.MDE.Components.Qvt.Metamodel.CustomExtensions.EMOFExtensions;
using LL.MDE.Components.Qvt.Metamodel.EMOFExtensions;

using NMF.Utilities;

using EMOF = LL.MDE.Components.Qvt.Metamodel.EMOF;
using EnAr = LL.MDE.DataModels.EnAr;

namespace LL.MDE.Components.Qvt.EnArImport
{
	public class EnArImporterEMOF
	{
		private readonly Dictionary<EnAr.Package, EMOF.IPackage> elementToPackage = new Dictionary<EnAr.Package, EMOF.IPackage>();
		private readonly Dictionary<EnAr.Element, EMOF.IType> elementToType = new Dictionary<EnAr.Element, EMOF.IType>();
		private readonly EnArExplorer explorer;

		public EnArImporterEMOF(EnArExplorer explorer)
		{
			this.explorer = explorer;
		}

		private EMOF.IPrimitiveType ConstructPrimitiveType(EnAr.Element classElement)
		{
			EMOF.IPrimitiveType result = new EMOF.PrimitiveType()
			{
				Name = classElement.Name,
			};

			string mofPrimitiveType = explorer.GetTaggedValue(classElement, "MOFPrimitiveType");
			if (!mofPrimitiveType.IsNullOrEmpty())
			{
				result.SetCsharpType(mofPrimitiveType.ToLower());
			}
			else
			{
				result.SetCsharpType(classElement.Name.ToLower());
			}

			return result;
		}

		private bool TranslateContainment(string containment)
		{
			return containment != "Not Specified";
		}

		private int TranslateLowerBound(string bound)
		{
			return TranslateBound(bound, 0);
		}

		private int TranslateUpperBound(string bound)
		{
			return TranslateBound(bound, 1);
		}

		private int TranslateBound(string bound, int def)
		{
			if (bound == "")
				return def;
			else if (bound == "*")
				return -1;
			else
			{
				try
				{
					return Int32.Parse(bound);
				}
				catch (Exception)
				{
					return def;
				}
			}
		}

		private EMOF.IPrimitiveType ConstructPrimitiveType(string typeName)
		{
			switch (typeName.ToLower())
			{
				case "bool":
				case "boolean":
					return PrimitiveTypes.BOOLEAN;
				case "long":
				case "double":
					return PrimitiveTypes.REAL;
				case "int":
				case "short":
					return PrimitiveTypes.INTEGER;
				default:
					return PrimitiveTypes.STRING;
			}
		}

		public EMOF.IType ConstructTypeOfTyped(EnAr.Element typedElement)
		{
			EnAr.Element typeElement = explorer.GetClassElement(typedElement);
			if (typeElement != null)
				return ConstructType(typeElement);
			else
				return ConstructPrimitiveType(typedElement.Type);
		}

		public EMOF.IType ConstructTypeOfTyped(EnAr.Attribute typedAttribute)
		{
			EnAr.Element typeElement = explorer.GetClassElement(typedAttribute);
			if (typeElement != null)
				return ConstructType(typeElement);
			else
				return ConstructPrimitiveType(typedAttribute.Type);
		}

        public EMOF.IType ConstructTypeOfMethod(EnAr.Method method)
        {
            if (method.ReturnType == null)
                return null;
            EnAr.Element returnType = explorer.repository.GetElementByGuid(method.ReturnType);
            if (returnType != null)
                return ConstructType(returnType);
            else
                return ConstructPrimitiveType(method.ReturnType);
        }

        public EMOF.IType ConstructTypeOfParameter(EnAr.Parameter parameter)
        {
            if (parameter.Type == null)
                return null;
            EnAr.Element returnType = explorer.repository.GetElementByGuid(parameter.Type);
            if (returnType != null)
                return ConstructType(returnType);
            else
                return ConstructPrimitiveType(parameter.Type);
        }

        private EMOF.IType ConstructType(EnAr.Element classElement)
		{
			if (elementToType.ContainsKey(classElement))
			{
				return elementToType[classElement];
			}
			else
			{
				EMOF.IType result;
				// The type can be primitive
				if (classElement.Stereotype.ToLower() == "primitive")
				{
					// We create a PrimitiveType
					result = ConstructPrimitiveType(classElement);
					elementToType.Add(classElement, result);
				}
				// Or a class
				else
				{
					result = ConstructClass(classElement);
				}
				return result;
			}
		}

		private EMOF.IProperty ConstructProperty(EnAr.Attribute attribute)
		{
			EMOF.IProperty property = new EMOF.Property()
			{
				Name = attribute.Name,
				Type = ConstructTypeOfTyped(attribute),
				Default = attribute.Default,
				IsComposite = TranslateContainment(attribute.Containment),
				IsDerived = attribute.IsDerived,
				Lower = TranslateLowerBound(attribute.LowerBound),
				Upper = TranslateUpperBound(attribute.UpperBound),
				IsOrdered = attribute.IsOrdered,
				IsReadOnly = attribute.IsConst,
				IsUnique = !attribute.AllowDuplicates,
			};
			return property;
		}

		private EMOF.IProperty ConstructProperty(EMOF.IClass source, EMOF.IClass target, EnAr.ConnectorEnd sourceC, EnAr.ConnectorEnd targetC)
		{
			if (!string.IsNullOrWhiteSpace(targetC.Role))
			{
				EMOF.IProperty property = new EMOF.Property()
				{
					Name = targetC.Role,
					Type = target,
					IsComposite = sourceC.Aggregation > 0,
					Class = source,
					IsDerived = targetC.Derived,
					IsUnique = !targetC.AllowDuplicates,
					Lower = TranslateMultiplicityLower(targetC.Cardinality),
					Upper = TranslateMultiplicityUpper(targetC.Cardinality),
				};
				source.OwnedAttribute.Add(property);
				return property;
			}

			return null;
		}

		private int TranslateMultiplicityUpper(string cardinality)
		{
			if (string.IsNullOrWhiteSpace(cardinality))
				return -1;
			if (cardinality.Length == 1)
				return TranslateBound(cardinality, 1);
			else if (cardinality.Last() == '.')
				return -1;
			else
				return TranslateBound(cardinality.Last().ToString(), 1);
		}

		private int TranslateMultiplicityLower(string cardinality)
		{
			if (string.IsNullOrWhiteSpace(cardinality))
				return 0;
			if (cardinality == "*")
				return 0;
			else
				return TranslateBound(cardinality[0].ToString(), 0);
		}

		private EMOF.IClass ConstructClass(EnAr.Element classElement)
		{
			// We create a EMOF.Class
			EMOF.IClass clazz = new EMOF.Class() { IsAbstract = classElement.Abstract.ToLower() == "true", Name = classElement.Name };
			elementToType.Add(classElement, clazz);

			// We browse the attributes of the EMOF.Class element (~= ecore attributes)
			foreach (EnAr.Attribute attribute in explorer.GetAttributes(classElement))
			{
				EMOF.IProperty property = ConstructProperty(attribute);
				property.Class = clazz;
				clazz.OwnedAttribute.Add(property);
			}

			// We browse the connectors (~= ecore references + inheritance links)
			foreach (EnAr.Connector connector in explorer.GetConnectorsWithSource(classElement))
			{
				EnAr.Element targetElement = explorer.GetTargetElement(connector);
				if (targetElement.Type.ToLower() == "class")
				{
					EMOF.IClass targetType = ConstructType(targetElement) as EMOF.Class;

					if (targetType != null)
					{
						// Case super type
						if (connector.Type.ToLower() == "generalization")
						{
							clazz.SuperClass.Add(targetType);
						}
						// Case reference(s)
						else
						{
							EMOF.IProperty prop1 = ConstructProperty(clazz, targetType, connector.ClientEnd, connector.SupplierEnd);
							EMOF.IProperty prop2 = ConstructProperty(targetType, clazz, connector.SupplierEnd, connector.ClientEnd);
							if (prop1 != null && prop2 != null)
							{
								prop1.Opposite = prop2;
								prop2.Opposite = prop1;
							}
						}
					}
				}
			}

			// And finally the methods
			foreach (EnAr.Method method in explorer.GetMethods(classElement))
			{
				EMOF.IOperation operation = ConstructOperation(method);
				clazz.OwnedOperation.Add(operation);
				operation.Class = clazz;
			}

			return clazz;
		}

		private EMOF.IOperation ConstructOperation(EnAr.Method method)
		{
			//TODO type: is the classifierID the return type?
			EMOF.IOperation operation = new EMOF.Operation()
			{
				Name = method.Name,
				Lower = 0,
				Upper = method.ReturnIsArray ? 1 : -1,
				// type = type
			};

			foreach (EnAr.Parameter enArParameter in method.Parameters)
			{
				EMOF.IParameter parameter = ConstructParameter(enArParameter);
				parameter.Operation = operation;
				operation.OwnedParameter.Add(parameter);
			}

			return operation;
		}

		private EMOF.IParameter ConstructParameter(EnAr.Parameter enArParameter)
		{
			//TODO type
			EMOF.IParameter parameter = new EMOF.Parameter()
			{
				Name = enArParameter.Name,
			};
			return parameter;
		}

		private EMOF.IPackage ConstructPackage(EnAr.Package metamodelPackage)
		{
			if (elementToPackage.ContainsKey(metamodelPackage))
			{
				return elementToPackage[metamodelPackage];
			}
			else
			{
				// We create the Package
				EMOF.IPackage package = new EMOF.Package() { Name = metamodelPackage.Name };
				elementToPackage.Add(metamodelPackage, package);

				// We create its owned Types
				foreach (EnAr.Element classChild in explorer.GetChildrenElementsWithType(metamodelPackage, "class"))
				{
					EMOF.IType type = ConstructType(classChild);
					package.OwnedType.Add(type);
					type.Package = package;
				}

				// We create its nested Packages
				foreach (EnAr.Package metamodelChild in explorer.GetChildrenPackages(metamodelPackage))
				{
					EMOF.IPackage nestedPackage = ConstructPackage(metamodelChild);
					package.NestedPackage.Add(nestedPackage);
					nestedPackage.NestingPackage = package;
				}

				return package;
			}
		}

		public Tuple<EMOF.IPackage, string> ConstructMetamodel(string metamodelName)
		{
			List<EnAr.Package> metamodelPackages = explorer.FindPackagesWithStereotype("metamodel");
			EnAr.Package metamodelPackage = metamodelPackages.Single(p => p.Name == metamodelName);
			EMOF.IPackage emofMetamodel = ConstructPackage(metamodelPackage);
			string alias = null;
			// We store the alias, if any
			if (!string.IsNullOrWhiteSpace(metamodelPackage.Alias))
				alias = metamodelPackage.Alias;
			return new Tuple<EMOF.IPackage, string>(emofMetamodel, alias);
		}

		/// <summary>
		/// Find all metamodels of the EA file and import them.
		/// </summary>
		/// <returns> A Tuple with the metamodels, and the aliases of the metamodel.</returns>
		public Tuple<List<EMOF.IPackage>, Dictionary<string, EMOF.IPackage>> ConstructMetamodels()
		{
			List<EMOF.IPackage> metamodels = new List<EMOF.IPackage>();
			Dictionary<string, EMOF.IPackage> aliases = new Dictionary<string, EMOF.IPackage>();

			// We browse all package elements with stereotype "metamodel"
			List<EnAr.Package> metamodelPackages = explorer.FindPackagesWithStereotype("metamodel");
			foreach (EnAr.Package metamodelPackage in metamodelPackages)
			{
				EMOF.IPackage emofMetamodel = ConstructPackage(metamodelPackage);

				// We import into an EMOF Package

				metamodels.Add(emofMetamodel);

				// We store the alias, if any
				if (!string.IsNullOrWhiteSpace(metamodelPackage.Alias))
					aliases.Add(metamodelPackage.Alias, emofMetamodel);
			}
			return new Tuple<List<EMOF.IPackage>, Dictionary<string, EMOF.IPackage>>(metamodels, aliases);
		}

		/*   public Tuple<EMOF.IPackage,IEnumerable<string>> ConstructMetamodel(string metamodelName)
		  {
				List<EnAr.Package> metamodelPackages = explorer.FindPackagesWithStereotype("metamodel");

				return null;
		  }
*/

		public static string GetFQN(EMOF.IPackage package)
		{
			if (package.NestingPackage == null)
			{
				return package.Name;
			}
			else
			{
				return GetFQN(package.NestingPackage) + "." + package.Name;
			}
		}

	    public EMOF.IPackage GetEMOFPackage(EnAr.Package p)
	    {
	        return elementToPackage[p];
	    }

	}
}