text:
title: "2017-04-04のJS: Safari 10.1、ECMAScript 2017-2018、Reactのパフォーマンス計測/改善"
author: "azu"
layout: post
date : 2017-04-04T00:17:15.589Z
category: JSer
tags:
- Safari
- ECMAScript
- ES2017
- ES2018
- React

---

JSer.info #325 - Safari 10.1が正式にリリースされました。

- [New Web Features in Safari 10.1 | WebKit](https://webkit.org/blog/7477/new-web-features-in-safari-10-1/ "New Web Features in Safari 10.1 | WebKit")

Fetch API、CSS Grid、ES2016+、IndexedDB 2.0、Custom Elements、Gamepad、Pointer Lock、Input Events、`download`属性、HTML Media Captureなどかなり色々な機能が実装されています。

過去に関連する解説記事も書かれているのであわせてみるとよさそうです。

- [CSS Grid Layout: A New Layout Module for the Web | WebKit](https://webkit.org/blog/7434/css-grid-layout-a-new-layout-module-for-the-web/ "CSS Grid Layout: A New Layout Module for the Web | WebKit")
- [Introducing Custom Elements | WebKit](https://webkit.org/blog/7027/introducing-custom-elements/ "Introducing Custom Elements | WebKit")

----

> ES2017 was officially approved by the committee to be sent to the ECMA General Assembly for approval.
> -- [March 2017 meeting notes by leobalter · Pull Request #64 · rwaldron/tc39-notes](https://github.com/rwaldron/tc39-notes/pull/64#issuecomment-291270151 "March 2017 meeting notes by leobalter · Pull Request #64 · rwaldron/tc39-notes")

ECMAScript 2017の仕様が固まり、TC39(ECMAScriptの仕様を決める技術委員会)の中で承認され、ECMA [General Assembly](https://www.ecma-international.org/memento/GA.htm "General Assembly")に提出されました。

後は、2017年6月27日に行われる次の[GA 113th meeting](https://www.ecma-international.org/memento/Ecma_meeting_calendar.htm "GA 113th meeting")において承認されれば、正式にECMAScript 2017がリリースされます。

- [Ecma meeting calendar](https://www.ecma-international.org/memento/Ecma_meeting_calendar.htm "Ecma meeting calendar")

ES2017で入る仕様については次の記事でまとめられています。

- [ECMAScript 2017: the final feature set](http://2ality.com/2016/02/ecmascript-2017.html "ECMAScript 2017: the final feature set")

ES2017の仕様はフリーズされたため、[tc39/ecma262](https://github.com/tc39/ecma262 "tc39/ecma262")のmasterブランチは[ES2018 draft](https://github.com/tc39/ecma262/commit/8340bf9a8427ea81bb0d1459471afbcc91d18add "Editorial: master is now ES2018 draft · tc39/ecma262@8340bf9")となっています。

----

**NOTE**:

ECMAScriptのISO標準版である[ISO/IEC 16262](http://www.iso.org/iso/catalogue_detail.htm?csnumber=55755)は、[ECMA-414 ECMAScript Specification Suite](https://www.ecma-international.org/publications/standards/Ecma-414.htm "ECMAScript Specification Suite")という仕様が代わりに提案されています。

- [ECMA-414 ECMAScript Specification Suiteについて | Web Scratch](http://efcl.info/2017/02/27/ecma-414/ "ECMA-414 ECMAScript Specification Suiteについて | Web Scratch")

----

ES2018以降に入るかもしれないECMAScriptのProposalのステータスについては下記にまとめてあります。

- [ECMAScript proposal updates @ 2017-03 | ECMAScript Daily](https://ecmascript-daily.github.io/ecmascript/2017/04/04/ecmascript-proposals-status "ECMAScript proposal updates @ 2017-03 | ECMAScript Daily")
  - 先月時点のステータス変更のまとめ
- [tc39/proposals: Tracking ECMAScript Proposals](https://github.com/tc39/proposals "tc39/proposals: Tracking ECMAScript Proposals")

先月のミーティングでは、正規表現周りの改善Proposalが4つもStage 3へとなりました。
正規表現のProposalに興味がある人は次の記事を見ると良さそうです。

- [Regular Expressions in a post-ES6 world](https://ponyfoo.com/articles/regular-expressions-post-es6 "Regular Expressions in a post-ES6 world")

----

[React is Slow, React is Fast: Optimizing React Apps in Practice](https://marmelab.com/blog/2017/02/06/react-is-slow-react-is-fast.html "React is Slow, React is Fast: Optimizing React Apps in Practice")という記事ではReactアプリケーションのパフォーマンス計測や改善のアプローチについて書かれています。

`?react_perf`を使ったコンポーネントプロファイルのとり方と行った計測と改善のアプローチについてがそれぞれ書かれています。

----

ヘッドライン

----

## normalize.css/CHANGELOG.md at master · necolas/normalize.css
[github.com/necolas/normalize.css/blob/master/CHANGELOG.md](https://github.com/necolas/normalize.css/blob/master/CHANGELOG.md "normalize.css/CHANGELOG.md at master · necolas/normalize.css")

CSS ReleaseNote library

normalize.css 6.0.0リリース。
HTML要素やform要素への`font-family`、`line-height`などのopinionated rulesを削除

----

## TC39: Ecma-402 updates | Rafael Xavier
[rafael.xavier.blog.br/2017/03/23/tc39-ecma-402-updates/](http://rafael.xavier.blog.br/2017/03/23/tc39-ecma-402-updates/ "TC39: Ecma-402 updates | Rafael Xavier")

ECMAScript i18n proposal

Ecma-402(ECMAScript i18n API)のProposalやステータスについて

----

## Release 2.3.0 · qunitjs/qunit
[github.com/qunitjs/qunit/releases/tag/2.3.0](https://github.com/qunitjs/qunit/releases/tag/2.3.0 "Release 2.3.0 · qunitjs/qunit")

JavaScript testing library ReleaseNote

QUnit 2.3.0リリース。
QUnit CLIの追加、CLIからQUnitを実行でき、reporterなどを指定できる。

- [CLI: Introduce QUnit CLI by trentmwillis · Pull Request #1115 · qunitjs/qunit](https://github.com/qunitjs/qunit/pull/1115 "CLI: Introduce QUnit CLI by trentmwillis · Pull Request #1115 · qunitjs/qunit")
- [Introduce CLI tool · Issue #1024 · qunitjs/qunit](https://github.com/qunitjs/qunit/issues/1024 "Introduce CLI tool · Issue #1024 · qunitjs/qunit")

----

## New Web Features in Safari 10.1 | WebKit
[webkit.org/blog/7477/new-web-features-in-safari-10-1/](https://webkit.org/blog/7477/new-web-features-in-safari-10-1/ "New Web Features in Safari 10.1 | WebKit")

safari ReleaseNote

Safari 10.1リリース。
Fetch API、CSS Grid、ES2016+、IndexedDB 2.0、Custom Elements、Gamepad、Pointer Lock、Input Events、`download`属性、HTML Media Captureなど

----

## Node v7.8.0 (Current) | Node.js
[nodejs.org/en/blog/release/v7.8.0/](https://nodejs.org/en/blog/release/v7.8.0/ "Node v7.8.0 (Current) | Node.js")

node.js ReleaseNote

Node.js 7.8.0リリース。
npm 4.2.0へアップデート、async functionの修正のバックポートなど

----

## TestCafe v0.14.0 Released | TestCafe
[devexpress.github.io/testcafe/blog/testcafe-v0-14-0-released.html](http://devexpress.github.io/testcafe/blog/testcafe-v0-14-0-released.html "TestCafe v0.14.0 Released | TestCafe")

JavaScript testing E2E ReleaseNote

TestCafe v0.14.0リリース。
`Role`でログイン情報を決めることができるように、BrowserStackサポート、`t.debug()`で`debugger;`的なデバッグができるように、`file://`に対してもテストできるように、`Selector`にカスタムメソッドを定義できるようになるなど

----

## Flow: A Static Type Checker for JavaScript
[flow.org/en/](https://flow.org/en/ "Flow: A Static Type Checker for JavaScript")

flowtype

Flowの公式サイトがリニューアル公開された

----

## Release Almin.js 0.11 · almin/almin
[github.com/almin/almin/releases/tag/0.11.0](https://github.com/almin/almin/releases/tag/0.11.0 "Release Almin.js 0.11 · almin/almin")

JavaScript Flux library ReleaseNote

Almin 0.11リリース。
Functional UseCaseのサポート、APIドキュメントの更新、Reactバインディングの追加など

----

## Announcing free Microsoft Edge testing in partnership with BrowserStack - Microsoft Edge Dev BlogMicrosoft Edge Dev Blog
[blogs.windows.com/msedgedev/2017/03/30/free-edge-testing-browserstack/](https://blogs.windows.com/msedgedev/2017/03/30/free-edge-testing-browserstack/ "Announcing free Microsoft Edge testing in partnership with BrowserStack - Microsoft Edge Dev BlogMicrosoft Edge Dev Blog")

MSEdge webservice

BrowserStackでテスト目的のMSEdgeが無料で利用できるように

- [Free Edge Testing on Windows 10](https://www.browserstack.com/test-on-microsoft-edge-browser#live-cloud "Free Edge Testing on Windows 10")

----

アーティクル

----

## ZEIT – Next.js 2.0
[zeit.co/blog/next2](https://zeit.co/blog/next2 "ZEIT – Next.js 2.0")

JavaScript React library サーバー ReleaseNote

Reactを使ったフレームワークであるNext.js 2.0リリース。
動的なルーティングができるように、`next/css`は非推奨となり代わりに`styled-jsx`を導入、`<Link>`の`prefetch`サポート、サンプルの追加、`babel`の設定などを行えるようになるなど

- [zeit/styled-jsx: Full CSS support for JSX without compromises](https://github.com/zeit/styled-jsx "zeit/styled-jsx: Full CSS support for JSX without compromises")
- [Migrating from next css · zeit/next.js Wiki](https://github.com/zeit/next.js/wiki/Migrating-from-next-css "Migrating from next css · zeit/next.js Wiki")

----

## V8 JavaScript Engine: Help us test the future of V8!
[v8project.blogspot.com/2017/02/help-us-test-future-of-v8.html](https://v8project.blogspot.com/2017/02/help-us-test-future-of-v8.html "V8 JavaScript Engine: Help us test the future of V8!")

Chrome V8 article

V8の新しいコンパイラーパイプラインであるIgnition interpreterとTurbofan compilerを有効化する方法について。
またバグを見つけた時の報告先について

----

## Writing Better JavaScript with Flow — SitePoint
[www.sitepoint.com/writing-better-javascript-with-flow/](https://www.sitepoint.com/writing-better-javascript-with-flow/ "Writing Better JavaScript with Flow — SitePoint")

flowtype tutorial article

Flowの基本的な使い方についての解説記事。
型の付け方、ライブラリの型、型アノテーションの取り除き方について

----

## React is Slow, React is Fast: Optimizing React Apps in Practice
[marmelab.com/blog/2017/02/06/react-is-slow-react-is-fast.html](http://marmelab.com/blog/2017/02/06/react-is-slow-react-is-fast.html "React is Slow, React is Fast: Optimizing React Apps in Practice")

React performance

Reactのパフォーマンス計測と改善について。
`?react_perf`を使いコンポーネントプロファイル、`why-did-you-update`でのコンポーネントの更新時間の計測。
shouldComponentUpdateでの無駄な更新を排除することでの改善、RecomposeやReselect、React/JSXの使い方での改善について

- [garbles/why-did-you-update: Puts your console on blast when React is making unnecessary updates.](https://github.com/garbles/why-did-you-update "garbles/why-did-you-update: Puts your console on blast when React is making unnecessary updates.")

----

## Svelte ナメてたけど結構スゴい - Qiita
[qiita.com/jgs/items/2d985894ea07f48b74fb](http://qiita.com/jgs/items/2d985894ea07f48b74fb "Svelte ナメてたけど結構スゴい - Qiita")

JavaScript UI library

HTML/CSS/JSをセットで書いたコンポーネントをJavaScript+小さなランタイムに変換するUIフレームワークであるSvelteについて

----

## Regular Expressions in a post-ES6 world
[ponyfoo.com/articles/regular-expressions-post-es6](https://ponyfoo.com/articles/regular-expressions-post-es6 "Regular Expressions in a post-ES6 world")

ECMAScript JavaScript proposal

ES2015以降の正規表現の追加された仕様とProposalの仕様について

----

## Vue.js Tutorial: A Prerendered, SEO-Friendly Example \[Live Demo\] - Snipcart
[snipcart.com/blog/vuejs-tutorial-seo-example](https://snipcart.com/blog/vuejs-tutorial-seo-example "Vue.js Tutorial: A Prerendered, SEO-Friendly Example \[Live Demo\] - Snipcart")

JavaScript Vue tutorial article

Vue.jsのチュートリアル。 PrerenderSpaPluginを使うことで、静的なHTMLを吐けるようにするところまでを行う話

----

## ECMAScript proposal updates @ 2017-03 | ECMAScript Daily
[ecmascript-daily.github.io/ecmascript/2017/04/04/ecmascript-proposals-status](https://ecmascript-daily.github.io/ecmascript/2017/04/04/ecmascript-proposals-status "ECMAScript proposal updates @ 2017-03 | ECMAScript Daily")

ECMAScript proposal

ECMAScript Proposalの最新の変更まとめ。
正規表現系のProposalがStage 3になった。

----

スライド、動画関係

----

## 君はyarn.lockをコミットしているか?
[www.slideshare.net/teppeis/do-you-commit-yarnlock](https://www.slideshare.net/teppeis/do-you-commit-yarnlock "君はyarn.lockをコミットしているか?")

yarn slide

ライブラリでyarn.lockをコミットすることによるdevDepsの固定のメリットについて。
devDepsの方がBreaking Changeは起きやすいため固定することによるメリットがあるという話

----

サイト、サービス、ドキュメント

----

## Vue.js Tutorial: A Prerendered, SEO-Friendly Example \[Live Demo\] - Snipcart
[snipcart.com/blog/vuejs-tutorial-seo-example](https://snipcart.com/blog/vuejs-tutorial-seo-example "Vue.js Tutorial: A Prerendered, SEO-Friendly Example \[Live Demo\] - Snipcart")

JavaScript Vue tutorial

Vue.jsのチュートリアル。
PrerenderSpaPluginを使うことで、静的なHTMLを吐けるようにするところまでを行う話

----

ソフトウェア、ツール、ライブラリ関係

----

## sdgluck/mewt: Immutability in under one kilobyte
[github.com/sdgluck/mewt](https://github.com/sdgluck/mewt "sdgluck/mewt: Immutability in under one kilobyte")

JavaScript library

Proxyを使ったシンプルなImmutableラッパーライブラリ

----

書籍関係

----

## はじめに | Reset CSSフレンズ
[friends.o2p.jp/](http://friends.o2p.jp/ "はじめに | Reset CSSフレンズ")

CSS ebook

ユーザーエージェントによるCSSの特徴を上書きしていくReset CSSやnormalize.cssなどがどのようなスタイルを当てているかについての解説

----


text:
package io.datarouter.scanner;

import java.util.Arrays;
import java.util.List;
import java.util.function.Predicate;

import org.testng.Assert;
import org.testng.annotations.Test;

public class FilteringScannerTests{

	@Test
	public void testInclude(){
		Scanner<Integer> input = Scanner.of(0, 1, 2, 3, 4, 5);
		Predicate<Integer> predicate = i -> i % 2 == 0;
		List<Integer> actual = input.include(predicate).list();
		List<Integer> expected = List.of(0, 2, 4);
		Assert.assertEquals(actual, expected);
	}

	@Test
	public void testExclude(){
		Scanner<Integer> input = Scanner.of(0, 1, 2, 3, 4, 5);
		Predicate<Integer> predicate = i -> i % 2 == 0;
		List<Integer> actual = input.exclude(predicate).list();
		List<Integer> expected = Arrays.asList(1, 3, 5);
		Assert.assertEquals(actual, expected);
	}

}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Authors on Zhi Lu</title>
    <link>https://lzcn.github.io/author/</link>
    <description>Recent content in Authors on Zhi Lu</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <copyright>&copy; 2018</copyright>

	<atom:link href="https://lzcn.github.io/author/index.xml" rel="self" type="application/rss+xml" />

  </channel>
</rss>


text:
"""Tests for jax_cfd.fast_diagonalization."""
from typing import Sequence

from absl.testing import absltest
from absl.testing import parameterized
import jax.numpy as jnp
from jax_cfd.base import array_utils
from jax_cfd.base import fast_diagonalization
from jax_cfd.base import test_util
import numpy as np
import scipy.linalg

Array = fast_diagonalization.Array

def apply_operators(
    operators: Sequence[np.ndarray],
    rhs: Array,
) -> Array:
  """Apply a sum of linear operators along all array axes."""
  assert len(operators) == rhs.ndim
  out = 0
  for axis, matrix in enumerate(operators):
    axes = [i if i != axis else rhs.ndim for i in range(rhs.ndim)]
    out += jnp.einsum(
        matrix, [axis, rhs.ndim], rhs, list(range(rhs.ndim)), axes)
  return out

class FastDiagonalizationTest(test_util.TestCase):

  def test_random_1d_matmul(self):
    rs = np.random.RandomState(0)
    a = rs.randn(3, 3)
    a = jnp.array(a + a.T, np.float32)
    b = rs.randn(3).astype(np.float32)
    a_inv = fast_diagonalization.psuedoinverse(
        [a], b.dtype, hermitian=True, implementation='matmul')
    actual = a_inv(b)
    expected = jnp.linalg.solve(a, b)
    self.assertAllClose(actual, expected, atol=1e-6)

  @parameterized.parameters('fft', 'rfft')
  def test_random_1d_fft(self, implementation):
    rs = np.random.RandomState(0)
    a = jnp.array(scipy.linalg.circulant(rs.randn(4)), np.float32)
    b = rs.randn(4).astype(np.float32)
    a_inv = fast_diagonalization.psuedoinverse(
        [a], b.dtype, circulant=True, implementation=implementation)
    actual = a_inv(b)
    expected = jnp.linalg.solve(a, b)
    self.assertAllClose(actual, expected, atol=1e-5)

  @parameterized.parameters(
      *[(ndim, 'matmul') for ndim in [1, 2, 3]],
      *[(ndim, 'fft') for ndim in [1, 2, 3]],
      *[(ndim, 'rfft') for ndim in [1, 2, 3]],
  )
  def test_identity_nd(self, ndim, implementation):
    rs = np.random.RandomState(0)
    b = rs.randn(*(2, 4, 6)[:ndim]).astype(np.float32)
    ops = [np.eye(2), 2 * np.eye(4), 3 * np.eye(6)]
    a_inv = fast_diagonalization.psuedoinverse(
        ops[:ndim], b.dtype, hermitian=True, circulant=True,
        implementation=implementation)
    actual = a_inv(b)
    expected = b / sum(range(1, 1 + ndim))
    self.assertAllClose(actual, expected, rtol=1e-5, atol=1e-5)

  @parameterized.parameters('matmul', 'fft', 'rfft')
  def test_poisson_1d(self, implementation):
    rs = np.random.RandomState(0)
    a = jnp.array([[-2, 1, 0, 1], [1, -2, 1, 0], [0, 1, -2, 1], [1, 0, 1, -2]],
                  np.float32)
    b = rs.randn(4).astype(np.float32)
    a_inv = fast_diagonalization.psuedoinverse(
        [a], a.dtype, hermitian=True, circulant=True,
        implementation=implementation)
    x = a_inv(b)
    self.assertAllClose(jnp.dot(a, x), b - b.mean(), atol=1e-5)

  @parameterized.parameters(
      dict(periodic_x=False, periodic_y=False),
      dict(periodic_x=False, periodic_y=True),
      dict(periodic_x=True, periodic_y=True),
  )
  def test_poisson_2d_matmul(self, periodic_x, periodic_y):
    a1 = jnp.array([[-2, 1, 0, periodic_x], [1, -2, 1, 0], [0, 1, -2, 1],
                    [periodic_x, 0, 1, -2]], dtype=np.float32)
    a2 = jnp.array([[-2, 1, periodic_y], [1, -2, 1], [periodic_y, 1, -2]],
                   dtype=np.float32)

    b = np.random.RandomState(0).randn(4, 3).astype(np.float32)
    operators = [a1, a2]
    a_inv = fast_diagonalization.psuedoinverse(
        operators, b.dtype, hermitian=True)
    x = a_inv(b)
    actual = apply_operators(operators, x)
    expected = b.copy()
    if periodic_x and periodic_y:
      expected -= expected.mean()
    self.assertAllClose(actual, expected, atol=1e-5)

  @parameterized.parameters('fft', 'rfft')
  def test_poisson_2d_fft(self, implementation):
    a1 = array_utils.laplacian_matrix(size=4, step=1.0)
    a2 = array_utils.laplacian_matrix(size=6, step=1.0)
    b = np.random.RandomState(0).randn(4, 6).astype(np.float32)
    operators = [a1, a2]
    a_inv = fast_diagonalization.psuedoinverse(
        operators, b.dtype, circulant=True, implementation=implementation)
    x = a_inv(b)
    actual = apply_operators(operators, x)
    expected = b - b.mean()
    self.assertAllClose(actual, expected, atol=1e-5)

if __name__ == '__main__':
  absltest.main()


text:
#ifndef ctrlplane_ifmap_entry_h
#define ctrlplane_ifmap_entry_h

#include <boost/intrusive_ptr.hpp>
#include <boost/intrusive/list.hpp>
#include <boost/dynamic_bitset.hpp>

#include "base/util.h"
#include "ifmap/ifmap_origin.h"

namespace pugi {
class xml_node;
}

struct AutogenProperty;
class IFMapTable;

class IFMapObject {
public:
    IFMapObject();
    virtual ~IFMapObject();
    virtual std::string ToString() const = 0;

    virtual void EncodeUpdate(pugi::xml_node *parent) const = 0;

    void set_origin(IFMapOrigin origin) { origin_ = origin; }

    uint64_t sequence_number() { return sequence_number_; }
    const uint64_t sequence_number() const { return sequence_number_; }
    void set_sequence_number(uint64_t sequence_number) {
        sequence_number_ = sequence_number;
    }
    IFMapOrigin origin() const { return origin_; }
    virtual bool ResolveStaleness() = 0; // return true if something was stale

private:
    friend class IFMapNode;
    friend void intrusive_ptr_add_ref(IFMapObject *object);
    friend void intrusive_ptr_release(IFMapObject *object);
    friend void intrusive_ptr_add_ref(const IFMapObject *object);
    friend void intrusive_ptr_release(const IFMapObject *object);

    static void Release(IFMapObject *object);

    boost::intrusive::list_member_hook<> node_;
    mutable int refcount_;
    uint64_t sequence_number_;
    IFMapOrigin origin_;
    DISALLOW_COPY_AND_ASSIGN(IFMapObject);
};

typedef boost::intrusive_ptr<IFMapObject> IFMapObjectRef;
inline void intrusive_ptr_add_ref(IFMapObject *object) {
    if (object == NULL) {
        return;
    }
    object->refcount_++;
}
inline void intrusive_ptr_release(IFMapObject *object) {
    if (object == NULL) {
        return;
    }
    if (--object->refcount_ == 0) {
        IFMapObject::Release(object);
    }
}
inline void intrusive_ptr_add_ref(const IFMapObject *object) {
    object->refcount_++;
}
inline void intrusive_ptr_release(const IFMapObject *object) {
    if (--object->refcount_ == 0) {
        IFMapObject::Release(const_cast<IFMapObject *>(object));
    }
}

// Base class for entries that correspond to IF-MAP identifiers
class IFMapIdentifier : public IFMapObject {
public:
    IFMapIdentifier();
    explicit IFMapIdentifier(int property_count);

    virtual bool SetProperty(const std::string &attr_key,
                             AutogenProperty *data) = 0;
    virtual void ClearProperty(const std::string &attr_key) = 0;

    // Return true if any properties are set.
    virtual bool empty() const {
        return true;
    }

    void TransferPropertyToOldProperty();
    bool ResolveStalePropertiesAndResetOld();
    bool IsPropertySet(int id) const {return property_set_.test(id);};
    virtual bool ResolveStaleness();

protected:
    boost::dynamic_bitset<> property_set_;
    boost::dynamic_bitset<> old_property_set_;

private:
    DISALLOW_COPY_AND_ASSIGN(IFMapIdentifier);
};

// Base class for entries that correspond to meta-data with attributes
class IFMapLinkAttr : public IFMapObject {
public:
    IFMapLinkAttr();
    virtual bool SetData(const AutogenProperty *data) = 0;
    virtual bool ResolveStaleness();

private:
    DISALLOW_COPY_AND_ASSIGN(IFMapLinkAttr);
};

#endif


text:
import os
import sys
import numpy as np
import ConfigParser
from errno import ENOENT
from numpy import loadtxt
from pandas import read_excel, read_csv
from collections import OrderedDict
from scipy.interpolate import interp1d
from distutils.util import strtobool
from astropy.io import fits as astropyfits

# Function to create folders
def make_folder(folder_path):

    #TODO This one is only valid for 2.7
    #TODO add this one to your collection
    try:
        os.makedirs(folder_path)
    except OSError:
        if not os.path.isdir(folder_path):
            raise

    return

# Function to delete files
def silent_remove(filename_list):
    for filename in filename_list:
        try:
            os.remove(filename)
        except OSError as e:  # this would be "except OSError, e:" before Python 2.6
            if e.errno != ENOENT:  # errno.ENOENT = no such file or directory
                raise  # re-raise exception if a different error occurred

# Sample data for FIT3D compilation
def example_data(data_folder):
    arguments_dict = OrderedDict()
    arguments_dict['script'] = 'auto_ssp_elines_rnd.py'  # 0
    arguments_dict['input_spec'] = 'NGC5947.spec_5.txt'  # 1
    arguments_dict['SSPs_lib'] = 'ssp_lib.fits,' + 'ssp_lib.fits'  # 2
    arguments_dict['output_file'] = 'auto_ssp.NGC5947.cen.only.out'  # 3
    arguments_dict['mask_file'] = 'mask_elines.txt'  # 4
    arguments_dict['conf_file'] = 'auto_ssp_V500_several_Hb.config'  # 5
    arguments_dict['plot_tag'] = 1  # 6
    arguments_dict['min'] = -1  # 7
    arguments_dict['max'] = 40  # 8
    arguments_dict['wmin'] = '3850'  # 9
    arguments_dict['wmax'] = '6800'  # 10
    arguments_dict['z_elines_mask'] = 'emission_lines.txt'  # 11
    arguments_dict['input_z'] = 0.02  # 12
    arguments_dict['delta_z'] = 0.001  # 13
    arguments_dict['min_z'] = 0.015  # 14
    arguments_dict['max_z'] = 0.025  # 15
    arguments_dict['input_sigma'] = 2.0  # 16
    arguments_dict['delta_sigma'] = 0.5  # 17
    arguments_dict['min_sigma'] = 1  # 18
    arguments_dict['max_sigma'] = 9  # 19
    arguments_dict['input_Av'] = 0.5  # 20
    arguments_dict['delta_Av'] = 0.1  # 21
    arguments_dict['min_Av'] = 0.0  # 22
    arguments_dict['max_Av'] = 1.6  # 23

    return arguments_dict

# Function to check for nan entries
def check_missing_flux_values(flux):
    # Evaluate the nan array
    nan_idcs = np.isnan(flux)
    nan_count = np.sum(nan_idcs)

    # Directly save if not nan
    if nan_count > 0:
        print '--WARNING: missing flux entries'

    return

# Function to import configuration data
def parseObjData(file_address, sectionName, objData):

    parser = ConfigParser.SafeConfigParser()
    parser.optionxform = str
    if os.path.isfile(file_address):
        parser.read(file_address)

    if not parser.has_section(sectionName):
        parser.add_section(sectionName)

    for key in objData.keys():
        value = objData[key]
        if value is not None:
            if isinstance(value, list) or isinstance(value, np.ndarray):
                value = ','.join(str(x) for x in value)
            else:
                value = str(value)
        else:
            value = ''

        parser.set(sectionName, key, value)

    with open(file_address, 'w') as f:
        parser.write(f)

    return

# Function to save data to configuration file section
def parseDataFile(file_address, section, data, type_data=None, key_suffix = ''):

    # Check if file exists
    if os.path.isfile(file_address):
        cfg = ConfigParser.ConfigParser()
        cfg.optionxform = str
        cfg.read(file_address)
    else:
        exit('--WARNING: Default configuration could not be found exiting program\n-Missing file: {}'.format(file_address))

    # Check section is in conf.ini else create it
    if not cfg.has_section(section):
        cfg.add_section(section)

    # Change format to safe data in dictionary
    for key in data:

        value = data[key]

        if type_data is not None:

            # TODO add a protocol to infer best format to save data
            if type_data is 'lists':
                value = list(value)
                value = ','.join(str(x) for x in value)
                    # try:
                    #     confDict[option] = np.array(map(float, raw_list.split(',')))
                    # except:
                    #     confDict[option] = np.array(map(str, raw_list.split(',')))

        cfg.set(section, key + key_suffix, value)

    with open(file_address, 'w') as f:
        cfg.write(f)

    return

# Class with tools to import SSPs libraries
class SspSynthesisImporter:

    def __init__(self):

        # ------------Configuration of Fit3D
        self.sspSyn_commands_params = [
            'script',  # 0 python script name
            'input_spec',  # 1 input galactic spectrum name
            'SSPs_lib',  # 2 fits-table to use with python
            'output_file',  # 3 Reference name for output files
            'mask_file',  # 4 File with the spectrum region masks
            'conf_file',  # 5 Configuration file for the masks
            'plot_tag',  # 6 tag to launch the plotting
            'min',  # 7 Min flux for ploting
            'max',  # 8 Max flux for ploting
            'wmin',  # 9 Minimum wavelength for plotting
            'wmax',  # 10 Maximum wavelength for plotting
            'z_elines_mask',  # 11 Emission lines file
            'input_z',  # 12 Input redshift
            'delta_z',  # 13 Increments for redshift
            'min_z',  # 14 Minimum redshift
            'max_z',  # 15 Maximum redshift
            'input_sigma',  # 16 Input velocity dispersion
            'delta_sigma',  # 17 Increments for velocity dispersion
            'min_sigma',  # 18 Minimum velocity dispersion
            'max_sigma',  # 19 Maximum velocity dispersion
            'input_Av',  # 20 Input reddening
            'delta_Av',  # 21 Increments for reddening
            'min_Av',  # 22 Minimum reddening
            'max_Av',  # 23 Maximum reddening
        ]

        # The first 4 lines in the configuration file describe the input
        self.sspSyn_config_params = [['input_z', 'delta_z', 'min_z', 'max_z', 'DV', 'RV', 'DS', 'RS', 'MIN_W', 'MAX_W'],
                                     # 12-16
                                     ['input_sigma', 'delta_sigma', 'min_sigma', 'max_sigma'],
                                     # 17-20
                                     ['input_Av', 'delta_Av', 'min_Av', 'max_Av'],
                                     # 21-24
                                     ['N_Systems'],  # Number of SSP bases
                                     ['START_W', 'END_W', 'MASK_FILE', 'CONFIG_FILE', 'NPOLY', 'MASK_FILE_POLY',
                                      'N_MIN_E', 'N_MAX_E'],  # Bases config
                                     ['MIN_DELTA_CHISQ', 'MAX_NITER', 'CUT_MEDIAN_FLUX'],
                                     ['start_w_peak', 'end_w_peak'],
                                     ['wavelength_to_norm', 'width_AA', 'new_back_templates.fits']]

        # Bases float indeces
        self.idcs_floats = np.array([0, 1, 4, 6, 7])

        # Emision lines mask columns headers
        self.eline_mask_header = ['start_wave', 'end_wave', 'mask_file', 'mask_config_file', 'n_poly', 'mask_file_poly',
                                  'n_min_e', 'n_max_e']

        # Number of montercarlo iterations
        self.n_mc = 30

        # Initial value for the chiSq_min
        self.chiSq_min = 1e12

        return

    def load_FIT3D_data(self, conf_file, data_folder=None):

        # Check if we are executing from the folder file
        data_folder = os.getcwd() + '/' if data_folder is None else data_folder

        # Read parameters from command line
        command_dict = self.load_FIT3D_command_params(data_folder=data_folder)
        config_dict = self.load_FIT3D_config_file(conf_file)

        # Update the fit configuration giving preference to the values from the command line
        config_dict.update(command_dict)

        # Load observational data and masks
        config_dict = self.load_FIT3D_observational_fits(data_folder, config_dict)

        # Prepare output files
        output_root = config_dict['output_file'][:config_dict['output_file'].rfind('.')]
        config_dict['single_output_file'] = '{rootname}_{file_code}.{ext}'.format(rootname=output_root,
                                                                                file_code='single', ext='txt')
        config_dict['coeffs_output_file'] = '{rootname}_{file_code}.{ext}'.format(rootname=output_root,
                                                                                file_code='coeffs', ext='txt')
        config_dict['spectrum_output_file'] = '{rootname}_{file_code}.{ext}'.format(rootname=output_root,
                                                                                file_code='spec', ext='txt')
        config_dict['em_lines_output_file'] = '{rootname}_{file_code}.{ext}'.format(rootname=output_root,
                                                                                file_code='elines', ext='txt')

        # Delete these output files if they had been generated from a previos run #USEFULL_Function
        silent_remove([config_dict['output_file'], config_dict['single_output_file'], config_dict['coeffs_output_file'],
                       config_dict['spectrum_output_file'], config_dict['em_lines_output_file']])

        # Store folder with the data and configuration folder
        config_dict['data_folder'] = data_folder
        config_dict['conf_file'] = conf_file
        config_dict['data_type'] = 'FIT3D'

        return config_dict

    def load_FIT3D_command_params(self, data_folder):

        # Empty dictionary to store the data from the commands from the command line
        command_dict = OrderedDict()

        # Extract line command arguments
        self.args_list = sys.argv

        # Check if the minimum parameters have been introduced (WARNING: Need to convert these to the right units)
        if len(self.args_list) > 7:
            command_dict = OrderedDict(zip(self.sspSyn_commands_params[:len(self.args_list)], self.args_list))
        else:
            print '--Error: The input command must include all these arguments:'
            print ', '.join(self.sspSyn_commands_params[:7])

            # Currently run test example if not enought data is provided
            print '---Using example data'
            command_dict = example_data(data_folder=data_folder)

        return command_dict

    def load_FIT3D_config_file(self, config_file_address):

        # Empty dictionary to store the data from the config file
        fit_conf_dict = {}

        # Read the configuration text file
        with open(config_file_address) as conf_file:

            conf_lines = conf_file.readlines()

            # Read redshift, sigma and Av params rows
            for i in range(3):
                param_values = np.array(conf_lines[i].split(), dtype=float)
                fit_conf_dict.update(zip(self.sspSyn_config_params[i], param_values))

            # Read masks rows: 'START_W_n','END_W_n','MASK_FILE_n' ...
            nLineMasks = int(conf_lines[3])
            fit_conf_dict['nLineMasks'] = int(conf_lines[3])

            for i in range(4, 4 + fit_conf_dict['nLineMasks']):
                bases_key = 'base_{}'.format(i - 4)
                param_values = np.array(conf_lines[i].split())

                # Convert to float numerical entries
                param_values[0] = float(param_values[0])
                param_values[1] = float(param_values[1])
                param_values[4] = float(param_values[4])
                param_values[6] = float(param_values[6])
                param_values[7] = float(param_values[7])

                fit_conf_dict[bases_key] = param_values

            # Add ChiSq row (converting to float)
            param_values = np.array(conf_lines[4 + nLineMasks].split(), dtype=float)
            fit_conf_dict.update(zip(self.sspSyn_config_params[5], param_values))

            # Add peak wavelength row (converting to float)
            param_values = np.array(conf_lines[5 + nLineMasks].split(), dtype=float)
            fit_conf_dict.update(zip(self.sspSyn_config_params[6], param_values))

            # Normalizing row (if available) (converting to float)
            if len(conf_lines) == 7 + nLineMasks:
                param_values = np.array(conf_lines[6 + nLineMasks].split(), dtype=float)
                fit_conf_dict.update(zip(self.sspSyn_config_params[7], param_values))
            else:
                fit_conf_dict['wave_norm'] = None
                fit_conf_dict['w_wave_norm'] = None
                fit_conf_dict['new_back_file'] = None

        return fit_conf_dict

    def load_FIT3D_mask(self, config_dict, obs_flux_resam):

        obs_wave = config_dict['obs_wave']

        # --------------Generating spectrum mask
        # Load spectrum masks
        mask_xmin, mask_xmax = loadtxt(config_dict['data_folder'] + config_dict['mask_file'], unpack=True)

        # Load emission lines reference to generate artificial mask
        emLine_wave = loadtxt(config_dict['data_folder'] + config_dict['z_elines_mask'], usecols=([0]), unpack=True)
        emLine_mask_xmin = emLine_wave * (1 + config_dict['input_z']) - 4.0 * config_dict['input_sigma']
        emLine_mask_xmax = emLine_wave * (1 + config_dict['input_z']) + 4.0 * config_dict['input_sigma']

        # Firt check non zero entries
        idx_mask_zero = (obs_flux_resam != 0)

        # Pixels within the spectrum mask
        idx_spec_mask = np.ones(len(obs_wave), dtype=bool)
        for i in range(len(mask_xmin)):
            idx_cur_spec_mask = (obs_wave > mask_xmin[i]) & (obs_wave < mask_xmax[i])
            idx_spec_mask = idx_spec_mask & ~idx_cur_spec_mask

        # Pixels within the emline mask
        idx_emline_mask = np.ones(len(obs_wave), dtype=bool)
        for i in range(len(emLine_wave)):
            idx_cur_emline_mask = (obs_wave > emLine_mask_xmin[i]) & (obs_wave < emLine_mask_xmax[i])
            idx_emline_mask = idx_emline_mask & ~idx_cur_emline_mask

        # Recover wavelength limits for the masks
        wmin_str, wmax_str = config_dict['wmin'].split(','), config_dict['wmax'].split(',')
        wmin = float(wmin_str[0]) if len(wmin_str) == 2 else float(config_dict['wmin'])
        wmax = float(wmax_str[0]) if len(wmax_str) == 2 else float(config_dict['wmax'])
        idx_mask_wmin, idx_mask_wmax = (obs_wave > wmin), (obs_wave < wmax)

        # Combined individual indeces into a global mask
        print idx_mask_zero.shape
        print idx_spec_mask.shape
        print idx_emline_mask.shape
        print idx_mask_wmax.shape
        total_masks = idx_mask_zero & idx_spec_mask & idx_emline_mask & idx_mask_wmin & idx_mask_wmax

        return total_masks

    def load_FIT3D_observational_fits(self, data_folder, config_dict):

        # --------------Read observational data
        obs_data = loadtxt(data_folder + config_dict['input_spec'])
        obs_wave = obs_data[:, 1]
        obs_flux = obs_data[:, 2]
        obs_fluxVar = obs_data[:, 3]

        # Issues with spectra: nan entries
        check_missing_flux_values(obs_flux)

        # Get the error from the library fits
        if obs_fluxVar is not None:
            obs_flux_err = np.sqrt(abs(obs_fluxVar))
        # Else calculate it from the spectrum
        else:
            obs_flux_err = np.sqrt(abs(obs_flux) / 10)

        # Remove big error entries
        median_err = np.median(obs_flux_err)
        idx_big_err = (obs_flux_err > 1.5 * median_err)
        obs_fluxErrAdj = np.copy(obs_flux_err)
        obs_fluxErrAdj[idx_big_err] = 1.5 * median_err

        # --------------Store data
        config_dict['obs_wave'] = obs_wave
        config_dict['obs_flux'] = obs_flux
        config_dict['obs_flux_err'] = obs_flux_err
        config_dict['obs_fluxErrAdj'] = obs_fluxErrAdj
        config_dict['nObsPix'] = len(obs_flux)

        return config_dict

    def import_Fit3D_ssplibrary(self, ssp_file_address):

        # Dictionary to store the data
        ssp_lib_dict = {}

        fluxBases, hdrBases = astropyfits.getdata(ssp_file_address, 0, header=True)
        fluxBases = np.asfortranarray(fluxBases)
        nBases, nPixelsBases = fluxBases.shape
        crpix, cdelt, crval = hdrBases['CRPIX1'], hdrBases['CDELT1'], hdrBases['CRVAL1']
        pixArray = np.arange(0, nPixelsBases)  # WARNING should this arrange start at one?
        basesWavelength = (crval + cdelt * (pixArray + 1 - crpix))

        # Extract age and metallicity from the bases names
        Z_vector, age_vector = np.empty(nBases), np.empty(nBases)
        for i in range(nBases):
            header_code = 'NAME{}'.format(i)

            # Read metallicity and age from and headers list
            base_keyname = hdrBases[header_code]
            age_str = base_keyname[9:base_keyname.find('_z')]
            metal_str = base_keyname[base_keyname.find('_z') + 2:base_keyname.rfind('.')]

            age_factor = 1000.0 if 'Myr' in age_str else 1
            age_vector[i] = float(age_str[:-3]) / age_factor
            Z_vector[i] = float('0.' + metal_str)

        # Staore library data in a dictionary
        ssp_lib_dict['crpix_bases'] = crpix
        ssp_lib_dict['cdelt_bases'] = cdelt
        ssp_lib_dict['crval_bases'] = crval
        ssp_lib_dict['basesWave'] = basesWavelength
        ssp_lib_dict['nBases'] = nBases
        ssp_lib_dict['nPixBases_max'] = nPixelsBases
        ssp_lib_dict['fluxBases'] = fluxBases
        ssp_lib_dict['hdrBases'] = hdrBases
        ssp_lib_dict['ageBases'] = age_vector
        ssp_lib_dict['zBases'] = Z_vector
        # ssp_lib_dict['bases_one_array'] = ones(nBases)

        return ssp_lib_dict

    def import_STARLIGHT_ssplibrary(self, bases_folder, libraries_file_list):

        print '\n--Importing STARLIGHT library'
        print '---Bases file: {}'.format(libraries_file_list)
        print '---Bases folder: {}'.format(bases_folder)

        # Dictionary to store the data
        ssp_lib_dict = {}

        columns_names = ['file_name', 'age_yr', 'z_star', 'bases_nickname', 'f_star', 'YAV_flag', 'alpha/Fe']
        bases_df = read_csv(libraries_file_list, delim_whitespace=True, names=columns_names, skiprows=1)

        # Initial pass to check the biggest size
        nBases = len(bases_df.index)
        max_nPixelsBases = 0

        # Empty contaiores to store the data
        waveBases_orig = []
        fluxBases_orig = []
        Z_vector, age_vector = np.empty(nBases), np.empty(nBases)

        for i in range(nBases):
            bases_file = bases_folder + bases_df.iloc[i]['file_name']
            wave_base_i, flux_base_i = loadtxt(bases_file, unpack=True)

            # Original wavelength range and fluxes from the bases. They may have different wavelength range
            waveBases_orig.append(
                wave_base_i)  # This is not pretty but not other option if bases do not have same length...
            fluxBases_orig.append(
                flux_base_i)  # This is not pretty but not other option if bases do not have same length...

            # Interpolate the bases to observed wavelength resolution (1 angstrom per pixel is the current rule)
            age_vector[i] = bases_df.iloc[i]['age_yr']
            Z_vector[i] = bases_df.iloc[i]['z_star']

        ssp_lib_dict['basesWave'] = waveBases_orig  # This is not pretty but not other option if bases do not have same length...
        ssp_lib_dict['nBases'] = nBases
        ssp_lib_dict['nPixBases_max'] = max_nPixelsBases
        ssp_lib_dict['fluxBases'] = fluxBases_orig  # This is not pretty but not other option if bases do not have same length...
        ssp_lib_dict['ageBases'] = age_vector
        ssp_lib_dict['zBases'] = Z_vector
        # ssp_lib_dict['bases_one_array']     = ones(nBases)

        print '--Library imported'

        return ssp_lib_dict

# Class with SpecSyzer dataloading tools
class ImportModelData(SspSynthesisImporter):

    def __init__(self, confFolder):

        # Class with tools to import starlight bases
        SspSynthesisImporter.__init__(self)

        # Load default configuration file
        self.config = self.load_confFile(confFolder, 'config.ini')

        # Define default folders
        self.dataFolder = os.path.join(os.path.expanduser('~'), self.config['inference_folder'])
        self.inputsFolder = os.path.join(self.dataFolder, self.config['input_data_folder'])
        self.outputsFolder = os.path.join(self.dataFolder, self.config['output_data_folder'])
        self.externalDataFolder = os.path.join(confFolder, self.config['external_data_folder']) # TODO this declaration is not universal with operative system try pathlib
        self.linesFormatDf = os.path.join(confFolder, self.config['external_data_folder'])
        self.configFolder = os.path.join(confFolder, 'config.ini')
        self.linesDb = read_excel(os.path.join(self.externalDataFolder, self.config['linesData_file']), sheet_name=0, header=0, index_col=0)

    def load_confFile(self, root_folder, confFile):

        # Configuration file address
        file_address = '{}/{}'.format(root_folder, confFile)

        # Check if file exists
        if os.path.isfile(file_address):
            cfg = ConfigParser.ConfigParser()
            cfg.optionxform = str
            cfg.read(file_address)
        else:
            exit('--WARNING: Default configuration could not be found exiting program')

        # Loop through configuration file sections and merge into a dictionary
        confDict = dict(cfg.items('conf_entries'))
        confDict['sections'] = cfg.sections()
        for i in range(1, len(cfg.sections())):

            section = cfg.sections()[i]
            confDict[section] = cfg.options(section)

            for option in cfg.options(section):

                if (option in confDict['string_conf']) or ('_folder' in option) or ('_file' in option):
                    confDict[option] = cfg.get(section, option)

                elif '_check' in option:
                    confDict[option] = cfg.getboolean(section, option)

                elif (option in confDict['list_conf']) or ('_parameters' in option) or ('_prior' in option) or ('_list' in option) or ('_coeffs' in option):
                    raw_list = cfg.get(section, option)

                    # Special entry
                    if option is 'input_lines':
                        if raw_list is 'all':
                            confDict[option] = raw_list
                        else:
                            confDict[option] = np.array(map(str, raw_list.split(',')))

                    # By default try to read as a list of floats else strings
                    else:
                        try:
                            confDict[option] = np.array(map(float, raw_list.split(',')))
                        except:
                            confDict[option] = np.array(map(str, raw_list.split(',')))

                # By default read as a float
                else:
                    confDict[option] = cfg.getfloat(section, option)

        # Include configuration file in the dictionary
        confDict['confAddress'] = file_address

        return confDict

    def load_obsData(self, obsFile=None, objName=None):

        # TODO this should go into the master configuration
        list_parameters     = ['input_lines', 'Av_prefit','sigma_star_prefit', 'coeffsPop_prefit', 'coeffsPopErr_prefit', 'wavelengh_limits', 'norm_interval'] #also all 'param_prior'
        boolean_parameters  = ['Normalized_by_Hbeta']
        string_parameters   = ['address_lines_log', 'address_spectrum', 'address_obs_mask', 'obsFile', 'objName']

        # ----Load the obj data
        if obsFile is not None:
            cfg = ConfigParser.SafeConfigParser()
            cfg.optionxform = str
            cfg.read(obsFile)

            # If not section is provided we assume the file only has one and it gives us the properties of the observation
            if objName is None:
                objName = cfg.options(cfg.sections()[0])

            # Dictionary with the observation data
            obj_data = dict(cfg.items(objName))
            obj_data['obsFile'] = obsFile
            obj_data['objName'] = objName

            #Recover data from previous fits
            results_section = objName + '_results'
            if cfg.has_section(results_section):
                prefit_data = dict(cfg.items(results_section))
                obj_data.update(prefit_data)

        else:
            # Dictionary with the observation data # TODO This does not work so well
            obj_data = locals()

        # Convert to the right format # TODO Add security warnings for wrong data
        for key in obj_data.keys():

            # Empty variable
            if obj_data[key] == '':
                obj_data[key] = None

            # None variable
            elif obj_data[key] is None:
                obj_data[key] = None

            # Arrays (The last boolean overrides the parameters
            elif ',' in obj_data[key]:

                if (key in list_parameters) or ('_prior' in key) or ('_true' in key) or (',' in obj_data[key]):
                    if key in ['input_lines']:
                        if obj_data[key] == 'all':
                            obj_data[key] = 'all'
                        else:
                            obj_data[key] = np.array(map(str, obj_data[key].split(',')))
                    else:
                        newArray = []
                        textArrays = obj_data[key].split(',')
                        for item in textArrays:
                            convertValue = float(item) if item != 'None' else np.nan
                            newArray.append(convertValue)
                        obj_data[key] = np.array(newArray)

            # Boolean
            elif (key in boolean_parameters) or ('_check' in key):
                obj_data[key] = strtobool(obj_data[key]) == 1

            # Remaining are either strings (rest floats)
            elif key not in string_parameters:
                obj_data[key] = float(obj_data[key])

            # #Unrecognize object function
            # else:
            #     print 'WARNING: Parameter {} in {} not recognize. Exiting code'.format(key, obsFile)
            #     exit()

        # ----Load the obj spectrum, #TODO read this one using pandas and that way you can chek if there  is a third column for the error
        obj_data['obs_wavelength'], obj_data['obs_flux'] = loadtxt(obj_data['address_spectrum'], usecols=(0, 1), unpack=True)

        # ----Load obj lines log # TODO update code to use address_lines_log
        obj_data['obj_lines_file'] = obj_data['address_lines_log']

        return obj_data

    def import_optical_depth_coeff_table(self, file_address):

        Data_dict = OrderedDict()

        opticalDepthCoeffs_df = read_csv(file_address, delim_whitespace=True, header=0)

        opticalDepthCoeffs = {}
        for column in opticalDepthCoeffs_df.columns:
            opticalDepthCoeffs[column] = opticalDepthCoeffs_df[column].values

        return opticalDepthCoeffs

    def load_ssp_library(self, ssp_lib_type, data_folder=None, data_file=None, wavelengh_limits=None, resample_inc=None, norm_interval=None):

        # TODO In here we need to add a test sample library

        # Store stellar base type
        sspLib_dict = {'data_type': ssp_lib_type}

        # Import the base type
        if ssp_lib_type == 'FIT3D':

            # Check if more files are being introduced
            if ',' in data_file:
                ssp_lib1, ssp_lib2 = data_file.split(',')  # Corrently we are only using the first one (the big)
            else:
                ssp_lib1 = data_file

            sspLib_dict = self.import_Fit3D_ssplibrary(data_folder + ssp_lib1)

        elif ssp_lib_type == 'starlight':

            sspLib_dict = self.import_STARLIGHT_ssplibrary(data_folder, data_file)

        # Store stellar base type
        sspLib_dict['data_type'] = ssp_lib_type

        # Trim, resample and normalized the ssp library if required
        if wavelengh_limits or resample_inc or norm_interval:
            self.treat_input_spectrum(sspLib_dict, sspLib_dict['basesWave'], sspLib_dict['fluxBases'], wavelengh_limits,
                                      resample_inc, norm_interval)

        return sspLib_dict

    def treat_input_spectrum(self, output_dict, spec_wave, spec_flux, wavelengh_limits=None, resample_inc=None, norm_interval=None):

        # TODO we should remove the nBases requirement by some style which can just read the number of dimensions

        # Store input values
        output_dict['wavelengh_limits'] = wavelengh_limits
        output_dict['resample_inc'] = resample_inc
        output_dict['norm_interval'] = norm_interval

        # Special case using 0, -1 indexing
        if wavelengh_limits is not None:
            if (wavelengh_limits[0] != 0) and (wavelengh_limits[0] != -1):
                inputWaveLimits = wavelengh_limits
            else:
                inputWaveLimits = wavelengh_limits
                if wavelengh_limits[0] == 0:
                    inputWaveLimits[0] = int(np.ceil(spec_wave[0]) + 1)
                if wavelengh_limits[-1] == -1:
                    inputWaveLimits[-1] = int(np.floor(spec_wave[-1]) - 1)

        # Resampling the spectra
        if resample_inc is not None:
            wave_resam = np.arange(inputWaveLimits[0], inputWaveLimits[-1], resample_inc, dtype=float)

            # Loop throught the fluxes (In the case of the bases it is assumed they may have different wavelength ranges)
            if isinstance(spec_flux, list):

                flux_resam = np.empty((output_dict['nBases'], len(wave_resam)))
                for i in range(output_dict['nBases']):
                    flux_resam[i, :] = interp1d(spec_wave[i], spec_flux[i], bounds_error=True)(wave_resam)

            # In case only one dimension
            elif spec_flux.ndim == 1:
                flux_resam = interp1d(spec_wave, spec_flux, bounds_error=True)(wave_resam)

            output_dict['wave_resam'] = wave_resam
            output_dict['flux_resam'] = flux_resam

        else:
            output_dict['wave_resam'] = spec_wave
            output_dict['flux_resam'] = spec_flux

        # Normalizing the spectra
        if norm_interval is not None:

            # Loop throught the fluxes (In the case of the bases it is assumed they may have different wavelength ranges)
            if isinstance(spec_flux, list):

                normFlux_coeff = np.empty(output_dict['nBases'])
                flux_norm = np.empty((output_dict['nBases'], len(wave_resam)))
                for i in range(output_dict['nBases']):
                    idx_Wavenorm_min, idx_Wavenorm_max = np.searchsorted(spec_wave[i], norm_interval)
                    normFlux_coeff[i] = np.mean(spec_flux[i][idx_Wavenorm_min:idx_Wavenorm_max])
                    flux_norm[i] = output_dict['flux_resam'][i] / normFlux_coeff[i]

            elif spec_flux.ndim == 1:
                idx_Wavenorm_min, idx_Wavenorm_max = np.searchsorted(spec_wave, norm_interval)
                normFlux_coeff = np.mean(spec_flux[idx_Wavenorm_min:idx_Wavenorm_max])
                flux_norm = output_dict['flux_resam'] / normFlux_coeff

            output_dict['flux_norm'] = flux_norm
            output_dict['normFlux_coeff'] = normFlux_coeff

        else:

            output_dict['flux_norm'] = output_dict['flux_resam']
            output_dict['normFlux_coeff'] = 1.0

        return

    def generate_object_mask(self, linesDf, wavelength, linelabels):

        # TODO This will not work for a redshifted lines log
        idcs_lineMasks = linesDf.index.isin(linelabels)
        idcs_spectrumMasks = ~linesDf.index.isin(linelabels)

        # Matrix mask for integring the emission lines
        n_lineMasks = idcs_lineMasks.sum()
        self.boolean_matrix = np.zeros((n_lineMasks, wavelength.size), dtype=bool)

        # Array with line wavelength resolution which we fill with default value (This is because there are lines beyong the continuum range)
        self.lineRes = np.ones(n_lineMasks) * (wavelength[1] - wavelength[0])

        # Total mask for valid regions in the spectrum
        n_objMasks = idcs_spectrumMasks.sum()
        self.int_mask = np.ones(wavelength.size, dtype=bool)
        self.object_mask = np.ones(wavelength.size, dtype=bool)

        # Loop through the emission lines
        wmin, wmax = linesDf['w3'].loc[idcs_lineMasks].values, linesDf['w4'].loc[idcs_lineMasks].values
        idxMin, idxMax = np.searchsorted(wavelength, [wmin, wmax])
        for i in range(n_lineMasks):
            if not np.isnan(wmin[i]) and not np.isnan(wmax[i]) and (wmax[i] < wavelength[-1]): # We need this for lines beyong continuum range #TODO propose better
                w2, w3 = wavelength[idxMin[i]], wavelength[idxMax[i]]
                idx_currentMask = (wavelength >= w2) & (wavelength <= w3)
                self.boolean_matrix[i, :] = idx_currentMask
                self.int_mask = self.int_mask & ~idx_currentMask
                self.lineRes[i] = wavelength[idxMax[i]] - wavelength[idxMax[i] - 1]

        # Loop through the object masks
        wmin, wmax = linesDf['w3'].loc[idcs_spectrumMasks].values, linesDf['w4'].loc[idcs_spectrumMasks].values
        idxMin, idxMax = np.searchsorted(wavelength, [wmin, wmax])
        for i in range(n_objMasks):
            if not np.isnan(wmin[i]) and not np.isnan(wmax[i]) and (wmax[i] < wavelength[-1]):
                w2, w3 = wavelength[idxMin[i]], wavelength[idxMax[i]]
                idx_currentMask = (wavelength >= w2) & (wavelength <= w3)
                self.int_mask = self.int_mask & ~idx_currentMask
                self.object_mask = self.object_mask & ~idx_currentMask

        return


text:
package com.michaelflisar.pagermanager;

import android.support.v4.app.Fragment;
import android.support.v4.view.PagerAdapter;
import android.util.SparseArray;

public class MPagerAdapterHelper<Frag extends Fragment & IPagerFragment>
{
    private IPagerAdapterCallback<Frag> mCallback = null;
    private SparseArray<Frag> mPageFragments = new SparseArray<Frag>();

    public MPagerAdapterHelper(IPagerAdapterCallback<Frag> callback)
    {
        mCallback = callback;
    }

    public Frag getItem(int index)
    {
        Frag myFragment = tryGetFragment(index);
        if (myFragment == null)
        {
            myFragment = mCallback.createFragment(index);
            mPageFragments.put(index, myFragment);
        }
        return myFragment;
    }

    public void instantiateItem(int position, Frag frag)
    {
        mPageFragments.append(position, frag);
    }

    public void destroyItem(int position)
    {
        mPageFragments.remove(position);
    }

    @SuppressWarnings("unchecked")
    public int getItemPosition(Object item)
    {
        int pos = ((Frag) item).getPagerIndex();
        if (tryGetFragment(pos) != null)
            return pos;
        // otherwise get a new fragment
        return PagerAdapter.POSITION_NONE;
    }

    public Frag tryGetFragment(int pos)
    {
        return mPageFragments.get(pos);
    }
}


text:
@interface DDCometLongPollingTransport ()

- (NSURLConnection *)sendMessages:(NSArray *)messages;
- (NSArray *)outgoingMessages;
- (NSURLRequest *)requestWithMessages:(NSArray *)messages;
- (id)keyWithConnection:(NSURLConnection *)connection;

@end

@implementation DDCometLongPollingTransport

- (id)initWithClient:(DDCometClient *)client
{
	if ((self = [super init]))
	{
		m_client = [client retain];
		m_responseDatas = [[NSMutableDictionary alloc] initWithCapacity:2];
	}
	return self;
}

- (void)dealloc
{
	[m_responseDatas release];
	[m_client release];
	[super dealloc];
}

- (void)start
{
	[self performSelectorInBackground:@selector(main) withObject:nil];
}

- (void)cancel
{
	m_shouldCancel = YES;
}

#pragma mark -

- (void)main
{
	do
	{
		NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
		NSArray *messages = [self outgoingMessages];

		BOOL isPolling;
		if ([messages count] == 0)
		{
			if (m_client.state == DDCometStateConnected)
			{
				isPolling = YES;
				DDCometMessage *message = [DDCometMessage messageWithChannel:@"/meta/connect"];
				message.clientID = m_client.clientID;
				message.connectionType = @"long-polling";
				NSLog(@"Sending long-poll message: %@", message);
				messages = [NSArray arrayWithObject:message];
			}
			else
			{
				[NSThread sleepForTimeInterval:0.01];
			}
		}

		NSURLConnection *connection = [self sendMessages:messages];
		if (connection)
		{
			NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
			while ([runLoop runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.01]])
			{
				if (isPolling)
				{
					if (m_shouldCancel)
					{
						m_shouldCancel = NO;
						[connection cancel];
					}
					else
					{
						messages = [self outgoingMessages];
						[self sendMessages:messages];
					}
				}
			}
		}
		[pool release];
	} while (m_client.state != DDCometStateDisconnected);
}

- (NSURLConnection *)sendMessages:(NSArray *)messages
{
	NSURLConnection *connection = nil;
	if ([messages count] != 0)
	{
		NSURLRequest *request = [self requestWithMessages:messages];
		connection = [NSURLConnection connectionWithRequest:request delegate:self];
		if (connection)
		{
			NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
			[connection scheduleInRunLoop:runLoop forMode:[runLoop currentMode]];
			[connection start];
		}
	}
	return connection;
}

- (NSArray *)outgoingMessages
{
	NSMutableArray *messages = [NSMutableArray array];
	DDCometMessage *message;
	id<DDQueue> outgoingQueue = [m_client outgoingQueue];
	while ((message = [outgoingQueue removeObject]))
		[messages addObject:message];
	return messages;
}

- (NSURLRequest *)requestWithMessages:(NSArray *)messages
{
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:m_client.endpointURL];

	SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSData *body = [jsonWriter dataWithObject:messages];
    [jsonWriter release];

	[request setHTTPMethod:@"POST"];
	[request setValue:@"application/json;charset=UTF-8" forHTTPHeaderField:@"Content-Type"];
	[request setHTTPBody:body];

	NSNumber *timeout = [m_client.advice objectForKey:@"timeout"];
	if (timeout)
		[request setTimeoutInterval:([timeout floatValue] / 1000)];

	return request;
}

- (id)keyWithConnection:(NSURLConnection *)connection
{
	return [NSNumber numberWithUnsignedInteger:[connection hash]];
}

#pragma mark - NSURLConnectionDelegate

- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{
	[m_responseDatas setObject:[NSMutableData data] forKey:[self keyWithConnection:connection]];
}

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
	NSMutableData *responseData = [m_responseDatas objectForKey:[self keyWithConnection:connection]];
	[responseData appendData:data];
}

- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
	NSData *responseData = [[m_responseDatas objectForKey:[self keyWithConnection:connection]] retain];
	[m_responseDatas removeObjectForKey:[self keyWithConnection:connection]];

	SBJsonParser *parser = [[SBJsonParser alloc] init];
	NSArray *responses = [parser objectWithData:responseData];
	[parser release];
	parser = nil;
	[responseData release];
	responseData = nil;

	id<DDQueue> incomingQueue = [m_client incomingQueue];

	for (NSDictionary *messageData in responses)
	{
		DDCometMessage *message = [DDCometMessage messageWithJson:messageData];
		[incomingQueue addObject:message];
	}
}

- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
{
	[m_responseDatas removeObjectForKey:[self keyWithConnection:connection]];
}

@end


text:
package auth

import (
	"context"
	"crypto/ecdsa"
	"crypto/rsa"
	"errors"
	"time"

	jwt "github.com/golang-jwt/jwt"
	"go.uber.org/zap"
)

type tokenJWT struct {
	lg         *zap.Logger
	signMethod jwt.SigningMethod
	key        interface{}
	ttl        time.Duration
	verifyOnly bool
}

func (t *tokenJWT) enable()                         {}
func (t *tokenJWT) disable()                        {}
func (t *tokenJWT) invalidateUser(string)           {}
func (t *tokenJWT) genTokenPrefix() (string, error) { return "", nil }

func (t *tokenJWT) info(ctx context.Context, token string, rev uint64) (*AuthInfo, bool) {
	// rev isn't used in JWT, it is only used in simple token
	var (
		username string
		revision uint64
	)

	parsed, err := jwt.Parse(token, func(token *jwt.Token) (interface{}, error) {
		if token.Method.Alg() != t.signMethod.Alg() {
			return nil, errors.New("invalid signing method")
		}
		switch k := t.key.(type) {
		case *rsa.PrivateKey:
			return &k.PublicKey, nil
		case *ecdsa.PrivateKey:
			return &k.PublicKey, nil
		default:
			return t.key, nil
		}
	})

	if err != nil {
		t.lg.Warn(
			"failed to parse a JWT token",
			zap.Error(err),
		)
		return nil, false
	}

	claims, ok := parsed.Claims.(jwt.MapClaims)
	if !parsed.Valid || !ok {
		t.lg.Warn("failed to obtain claims from a JWT token")
		return nil, false
	}

	username = claims["username"].(string)
	revision = uint64(claims["revision"].(float64))

	return &AuthInfo{Username: username, Revision: revision}, true
}

func (t *tokenJWT) assign(ctx context.Context, username string, revision uint64) (string, error) {
	if t.verifyOnly {
		return "", ErrVerifyOnly
	}

	// Future work: let a jwt token include permission information would be useful for
	// permission checking in proxy side.
	tk := jwt.NewWithClaims(t.signMethod,
		jwt.MapClaims{
			"username": username,
			"revision": revision,
			"exp":      time.Now().Add(t.ttl).Unix(),
		})

	token, err := tk.SignedString(t.key)
	if err != nil {
		t.lg.Debug(
			"failed to sign a JWT token",
			zap.String("user-name", username),
			zap.Uint64("revision", revision),
			zap.Error(err),
		)
		return "", err
	}

	t.lg.Debug(
		"created/assigned a new JWT token",
		zap.String("user-name", username),
		zap.Uint64("revision", revision),
		zap.String("token", token),
	)
	return token, err
}

func newTokenProviderJWT(lg *zap.Logger, optMap map[string]string) (*tokenJWT, error) {
	if lg == nil {
		lg = zap.NewNop()
	}
	var err error
	var opts jwtOptions
	err = opts.ParseWithDefaults(optMap)
	if err != nil {
		lg.Error("problem loading JWT options", zap.Error(err))
		return nil, ErrInvalidAuthOpts
	}

	var keys = make([]string, 0, len(optMap))
	for k := range optMap {
		if !knownOptions[k] {
			keys = append(keys, k)
		}
	}
	if len(keys) > 0 {
		lg.Warn("unknown JWT options", zap.Strings("keys", keys))
	}

	key, err := opts.Key()
	if err != nil {
		return nil, err
	}

	t := &tokenJWT{
		lg:         lg,
		ttl:        opts.TTL,
		signMethod: opts.SignMethod,
		key:        key,
	}

	switch t.signMethod.(type) {
	case *jwt.SigningMethodECDSA:
		if _, ok := t.key.(*ecdsa.PublicKey); ok {
			t.verifyOnly = true
		}
	case *jwt.SigningMethodRSA, *jwt.SigningMethodRSAPSS:
		if _, ok := t.key.(*rsa.PublicKey); ok {
			t.verifyOnly = true
		}
	}

	return t, nil
}


text:
{{auction.get('name')}}

Descripción: {{ auction.get('description') }}

                Precio Actual: {{ auction.get('currentPrice') | currency:"USD":2 }}

Subastas: {{ auction.get('bids') }}

              <countdown units="Days | Hours | Minutes | Seconds" (ended)="onAuctionFinished($event)" [date]="auction.get('endDate')"></countdown>

<button *ngIf="_userService.isUserLoggedIn() | async" class="btn btn-primary" role="button" (click)="bid()">Subastar</button>

Registrarse o inicie sesión para subastar


text:
<?php

/**
 * Display justone.php and fill in who, mug, what for the last quote.
 */
class Last extends Application {

    function __construct() {
        parent::__construct();
    }

    function index() {
        $this->data['pagebody'] = 'justone';
        $source = $this->quotes->last();

        $this->data['who'] = $source['who'];
        $this->data['mug'] = $source['mug'];
        $this->data['what'] = $source['what'];

        $this->render();
    }

}


text:
package com.accelerator.metro.bean;

import java.util.List;

/**
 * Created by Nicholas on 2016/8/8.
 */
public class PlanTicket {

    private int is_ok;
    private String user_id;
    private String session_id;

    private List<ElseInfoBean> else_info;

    public int getIs_ok() {
        return is_ok;
    }

    public void setIs_ok(int is_ok) {
        this.is_ok = is_ok;
    }

    public String getUser_id() {
        return user_id;
    }

    public void setUser_id(String user_id) {
        this.user_id = user_id;
    }

    public String getSession_id() {
        return session_id;
    }

    public void setSession_id(String session_id) {
        this.session_id = session_id;
    }

    public List<ElseInfoBean> getElse_info() {
        return else_info;
    }

    public void setElse_info(List<ElseInfoBean> else_info) {
        this.else_info = else_info;
    }

    public static class ElseInfoBean {

        private String id;
        private String auto_type;
        private String days;
        private String time;
        private String work_time;
        private String start_point;
        private String end_point;
        private String user_id;
        private String city_name;
        private String start_site;
        private String end_site;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getAuto_type() {
            return auto_type;
        }

        public void setAuto_type(String auto_type) {
            this.auto_type = auto_type;
        }

        public String getDays() {
            return days;
        }

        public void setDays(String days) {
            this.days = days;
        }

        public String getTime() {
            return time;
        }

        public void setTime(String time) {
            this.time = time;
        }

        public String getWork_time() {
            return work_time;
        }

        public void setWork_time(String work_time) {
            this.work_time = work_time;
        }

        public String getStart_point() {
            return start_point;
        }

        public void setStart_point(String start_point) {
            this.start_point = start_point;
        }

        public String getEnd_point() {
            return end_point;
        }

        public void setEnd_point(String end_point) {
            this.end_point = end_point;
        }

        public String getUser_id() {
            return user_id;
        }

        public void setUser_id(String user_id) {
            this.user_id = user_id;
        }

        public String getCity_name() {
            return city_name;
        }

        public void setCity_name(String city_name) {
            this.city_name = city_name;
        }

        public String getStart_site() {
            return start_site;
        }

        public void setStart_site(String start_site) {
            this.start_site = start_site;
        }

        public String getEnd_site() {
            return end_site;
        }

        public void setEnd_site(String end_site) {
            this.end_site = end_site;
        }
    }
}


text:
<?hh // strict
namespace traitorous;

use traitorous\http\HttpRequest;
use traitorous\http\HttpRouter;
use traitorous\http\HttpRequestHandler;
use traitorous\http\HttpResponseConsumer;
use traitorous\http\handlers\Controller;
use traitorous\http\handlers\HttpRouteMiddleware;
use traitorous\http\handlers\InjectableHandler;

final class Traitorous {

    public function __construct(
        private Traversable<HttpRouteMiddleware> $_middleware,
        private HttpRouter $_router,
        private (function(): HttpRequestHandler) $_default
    ) { }

    public function run(): void {
        $request    = new HttpRequest();
        $consumer   = new HttpResponseConsumer();
        $middleware = new Vector($this->_middleware);
        $router     = $this->_router();
        $handler    = Controller::foldMiddleware($router, $middleware);
        $response   = $handler->apply($request);

        echo $consumer->consume($response);
    }

    private function _router(): HttpRequestHandler {
        return new InjectableHandler(
            ($req) ==> $this->_router
                            ->route($req)
                            ->getOrElse($this->_default)
                            ->apply($req)
        );
    }

}


text:
package com.github.andrewoma.dexx.collection.internal.base;

import com.github.andrewoma.dexx.collection.Function;
import com.github.andrewoma.dexx.collection.Iterable;
import org.jetbrains.annotations.NotNull;

import java.util.Iterator;

public class MappedIterable<T, F> extends AbstractIterable<T> {
    private final Function<F, T> mapFunction;
    private final com.github.andrewoma.dexx.collection.Iterable<F> from;

    public MappedIterable(Iterable<F> from, Function<F, T> mapFunction) {
        this.mapFunction = mapFunction;
        this.from = from;
    }

    @NotNull
    @Override
    public Iterator<T> iterator() {
        final Iterator<F> iterator = from.iterator();
        return new Iterator<T>() {
            @Override
            public boolean hasNext() {
                return iterator.hasNext();
            }

            @Override
            public T next() {
                return mapFunction.invoke(iterator.next());
            }

            @Override
            public void remove() {
                iterator.remove();
            }
        };
    }
}


text:
module.exports = (() => {

  'use strict';

  const inflect = require('i')();
  let __id__ = 0;

  class RelationshipPath {

    constructor(path) {
      this.path = path;
    }

    toString() {
      return this.path.join(' <-> ');
    }

    joinName(reverse) {

      let path = [].slice.call(this.path);

      if (reverse) {
        path = path.reverse();
      }

      let names = [];

      while (path.length > 1) {
        let node = path.pop();
        let edge = path.pop();
        names.push(edge.hasChild(node) ? edge.options.name : edge.options.as);
      }

      return names.join('__');

    }

    add(node, edge) {
      return new this.constructor([node, edge].concat(this.path));
    }

    getModel() {
      return this.path[0].Model;
    }

    multiple() {
      for (let i = 1; i < this.path.length; i += 2) {
        let edge = this.path[i];
        let node = this.path[i - 1];
        if (edge.hasChild(node) && edge.options.multiple) {
          return true;
        }
      }
      return false;
    }

    immediateMultiple() {
      let node = this.path[0];
      let edge = this.path[1];
      if (edge.hasChild(node) && edge.options.multiple) {
        return true;
      }
      return false;
    }

    joins(alias, firstTable) {

      let node;
      let i = 0;
      return this.path.slice().reverse().reduce((joins, item) => {

        if (item instanceof RelationshipNode) {
          node = item;
          return joins;
        }

        let edge = item;

        let join = {
          joinTable: edge.opposite(node).Model.table(),
          prevTable: joins[joins.length - 1] ? joins[joins.length - 1].joinAlias : (firstTable || null),
        };

        if (edge.hasChild(node)) {
          join.prevColumn = edge.options.via;
          join.joinColumn = 'id';
          join.joinAlias = edge.options.name;
        } else {
          join.prevColumn = 'id';
          join.joinColumn = edge.options.via;
          join.joinAlias = edge.options.as;
        }

        join.joinAlias = alias ? `${alias}${++i}` : join.joinAlias;

        joins.push(join);

        return joins;

      }, []);

    }

  }

  class RelationshipNode {

    constructor(Graph, Model) {
      this.Graph = Graph;
      this.Model = Model;
      this.edges = [];
    }

    toString() {
      return `[Node: ${this.Model.name}]`;
    }

    joinsTo(Model, options) {

      if (!Model.name) {
        // Sanity check for circular dependency resolution
        return null;
      }

      options = options || {};

      options.multiple = !!options.multiple;
      options.as = options.as || (options.multiple ? `${inflect.pluralize(inflect.camelize(this.Model.name, false))}` : `${inflect.camelize(this.Model.name, false)}`);
      options.name = options.name || `${inflect.camelize(Model.name, false)}`;
      options.via = options.via || `${inflect.underscore(options.name)}_id`;

      let parentNode = this.Graph.of(Model);
      let edge = this.edges.filter(e => e.parent === parentNode && e.options.name === options.name).pop();

      if (!edge) {
        edge = new RelationshipEdge(parentNode, this, options);
      }

      return edge;

    }

    childEdges() {
      return this.edges.filter(edge => edge.parent === this);
    }

    cascade() {

      let queue = this.childEdges();
      let paths = queue.map(e => new RelationshipPath([e.child, e, e.parent]));

      let i = 0;
      while (queue.length) {

        let edge = queue.shift();
        let curPath = paths[i++];

        let nextEdges = edge.child.childEdges();
        queue = queue.concat(nextEdges);

        paths = paths.concat(nextEdges.map(e => curPath.add(e.child, e)));

      }

      return paths;

    }

    findExplicit(pathname) {

      let names = pathname.split('__');
      let node = this;
      let path = new RelationshipPath([node]);

      while (names.length) {

        let name = names.shift();

        let edges = node.edges.filter(edge => {
          return (edge.hasChild(node) && edge.options.name === name) || edge.options.as === name;
        });

        if (edges.length === 0) {
          return null;
        }

        let edge = edges.pop();
        let nextNode = edge.opposite(node);

        path = path.add(nextNode, edge);
        node = nextNode;

      }

      return path;

    }

    find(name) {

      let queue = this.edges
        .slice()
        .map(edge => {
          return {edge: edge, path: new RelationshipPath([this])}
        });

      let traversed = {};

      while (queue.length) {

        let item = queue[0];
        let curEdge = item.edge;
        let path = item.path;
        let node;

        traversed[curEdge.id] = true;

        let curNode = path.path[0];
        node = curEdge.opposite(curNode);

        if ((curEdge.hasChild(curNode) && curEdge.options.name === name) || curEdge.options.as === name) {
          return path.add(node, curEdge);
        }

        queue = queue.slice(1).concat(
          node.edges
            .filter(edge => !traversed[edge.id])
            .map(edge => {
              return {
                edge: edge,
                path: path.add(node, curEdge)
              };
            })
        );

      }

      return null;

    }

  }

  class RelationshipEdge {

    constructor(parent, child, options) {

      this.id = ++__id__;
      this.parent = parent;
      this.child = child;
      this.options = options;

      parent.edges.push(this);
      child.edges.push(this);

    }

    toString() {
      return `[Edge: ${this.parent.Model.name}, ${this.child.Model.name}]`;
    }

    hasChild(child) {
      return this.child === child;
    }

    hasParent(parent) {
      return this.parent === parent;
    }

    opposite(node) {
      let opposite = this.child === node ? this.parent : (this.parent === node ? this.child : null);
      return opposite;
    }

  }

  class RelationshipGraph {

    constructor() {
      this.nodes = [];
      this.edges = [];
    }

    of(Model) {

      let node = this.nodes.filter(n => n.Model === Model).pop();
      if (!node) {
        node = new RelationshipNode(this, Model);
        this.nodes.push(node);
      }

      return node;

    }

  }

  return RelationshipGraph;

})();


text:
Having a great autocomplete experience is at the heart of the design goals for TypeScript. Hopefully you find the autocomplete behaviours in alm better than the rest.

> We have an aggressive autocomplete i.e. it should show up by itself whenever it makes sense. You can always trigger it explicitly with `Ctrl + Space`.

## Snippets
Snippets are at the heart of a great autocomplete experience. We provide snippets for common TypeScript constructs e.g. here is an `if` snippet in action:

![](https://raw.githubusercontent.com/alm-tools/alm-tools.github.io/master/screens/autocomplete/snippetBasic.gif)

You cycle through the snippet options with **`Tab`**, e.g. here is a `forof` snippet

![](https://raw.githubusercontent.com/alm-tools/alm-tools.github.io/master/screens/autocomplete/snippetAdvanced.gif)

Once you are happy with the snippet outcome just press **`Enter`** and we take you to a *desirable final location*, e.g. here we chose to stick with default name `item`:

![](https://raw.githubusercontent.com/alm-tools/alm-tools.github.io/master/screens/autocomplete/snippetAbort.gif)

> TIP : You can also press `Esc` to exit the snippet mode without actually jumping to *desirable final location* cursor location.

## Functions
For functions we provide signature completions. Just select the one you want.

![](https://raw.githubusercontent.com/alm-tools/alm-tools.github.io/master/screens/autocomplete/function.gif)

## Path Completions
We provide file path completions so you can use TypeScript modules without an significant disruption to your workflow.

#### ES6 Modules (snippet: `import`)

![](https://raw.githubusercontent.com/alm-tools/alm-tools.github.io/master/screens/autocomplete/es.gif)

![](https://raw.githubusercontent.com/alm-tools/alm-tools.github.io/master/screens/autocomplete/destructure.gif)

#### CommonJS style (snippet: `importr`)

![](https://raw.githubusercontent.com/alm-tools/alm-tools.github.io/master/screens/autocomplete/commonjs.gif)


text:
namespace gtp
{

/////////////////////////////////////////////////////////////////////
// boost::variant that can contain all types of GTP commands
//
using WhateverCommand = boost::variant<
  CmdProtocolVersion,
  CmdName,
  CmdVersion,
  CmdKnownCommand,
  CmdListCommands,
  CmdQuit,
  CmdBoardSize,
  CmdClearBoard,
  CmdKomi,
  CmdGenmove,
  CmdUndo,
  CmdPlay,
  CmdFixedHandicap,
  CmdPlaceFreeHandicap,
  CmdSetFreeHandicap,
  CmdTimeSettings,
  CmdTimeLeft,
  CmdFinalScore,
  CmdFinalStatusList,
  CmdError>;

///////////////////////////////////////////////////////////////////////////////
// Class to read GTP commands from an input stream and to write
// responses to them in an output stream.
//
class ProtocolCodec
{
  public:

    // Constructor.
    ProtocolCodec (std::istream& input, std::ostream& output);

    // Reads a command from the input provided in the constructor.
    WhateverCommand readCommand ();

    // Writes a response to the output provided in the constructor.
    template<typename T> void writeResponse (const T& t);

  private:

    std::istream& input_;  // input from where the commands are parsed.

    std::ostream& output_;  // output to where responses are written.
};

}

#include "gtplib/detail/gtpcodec_impl.hpp"

#endif


text:
package com.accela.TestCases.authorityCenter;

import com.accela.AuthorityCenter.authorityBase.IAuthorityBaseViewer;
import com.accela.AuthorityCenter.ruleFilter.AuthorityRule;
import com.accela.AuthorityCenter.shared.CommandWithAuthority;

public class RuleForTest extends AuthorityRule
{
	private int invokeCount=0;

	private Runnable target=null;

	private boolean shouldFilter=false;

	public RuleForTest(boolean shouldFilter)
	{
		this(shouldFilter, null);
	}

	public RuleForTest(boolean shouldFilter, Runnable target)
	{
		this.shouldFilter=shouldFilter;
		this.target=target;
	}

	@Override
	protected boolean shouldFilterImpl(CommandWithAuthority command,
			IAuthorityBaseViewer authorityBaseViewer) throws Exception
	{
		invokeCount++;
		if(target!=null)
		{
			target.run();
		}

		return shouldFilter;
	}

	public int getInvokeCount()
	{
		return invokeCount;
	}

	public void clearInvokeCount()
	{
		invokeCount=0;
	}

}


text:
package fromjava.generic.server;

public class Bar {
   private int age;

   public Bar() {}

   public int getAge() {
       return age;
   }

   public void setAge(int age) {
       this.age = age;
   }
}


text:
TOP = ../../../..
include $(TOP)/mak/config.mak

BINARY = test_CIM_ComputerSystem

GENCLASS_SOURCES = \
    CIM_ComputerSystem.cpp \
    CIM_ConcreteJob.cpp \
    CIM_EnabledLogicalElement.cpp \
    CIM_Job.cpp \
    CIM_LogicalElement.cpp \
    CIM_ManagedElement.cpp \
    CIM_ManagedSystemElement.cpp \
    CIM_System.cpp \
    repository.cpp

GENCLASS_HEADERS = $(GENCLASS_SOURCES:.cpp=.h)

CLEAN += $(GENCLASS_SOURCES) $(GENCLASS_HEADERS)

SOURCES = \
    $(GENCLASS_SOURCES) \
    main.cpp

LIBRARIES = cimple

export CIMPLE_MOF_PATH=$(TOP)/schema/cim214

include $(TOP)/mak/rules.mak

tests:
	$(TARGET)

genclass $(GENCLASS_SOURCES):
	$(BINDIR)/genclass -r -e CIM_ComputerSystem


text:
<?php

?>
			If you are having trouble with getting ArrowChat running, this debug mode will help you find the problem.

					<img src="<?php echo $base_url; ?>public/debug/images/reserve_tab_<?php echo $test_userid_img; ?>.png" alt="" />
					User ID
					<?php echo $test_userid; ?>

					<img src="<?php echo $base_url; ?>public/debug/images/reserve_tab_<?php echo $test_buddylist_img; ?>.png" alt="" />
					Buddy List
					<?php echo $test_buddylist; ?>

					<img src="<?php echo $base_url; ?>public/debug/images/reserve_tab_<?php echo $test_banned_img; ?>.png" alt="" />
					Banned
					<?php echo $test_banned; ?>

					<img src="<?php echo $base_url; ?>public/debug/images/reserve_tab_<?php echo $test_browser_img; ?>.png" alt="" />
					Browser
					<?php echo $test_browser; ?>

					<img src="<?php echo $base_url; ?>public/debug/images/reserve_tab_<?php echo $integration_img; ?>.png" alt="" />
					Integration File
					<?php echo $integration_test; ?>


text:
static float lastTemperature;

float fahrenheitFromCelsius(float cel){
    lastTemperature = cel;
    float fahr = cel * 1.8 + 32.0;
    printf("%f Celsius is %f Fahrenheit.\n", cel,fahr);
    return fahr;
}

int main(int argc, const char * argv[]) {
    float freezeInC = 0;
    float freezeInF = fahrenheitFromCelsius(freezeInC);
    printf("Water freezes at %f degrees Fahrenheit", freezeInF);
    printf("The last temperature converted was %f.\n", lastTemperature);
    return 0;
}


text:
from flask.ext.login import UserMixin
from utils.kvs import Kvs
from config import SESSION_EXPIRES

class IDGenerator(object):

    def __init__(self, key):
        self._key = '{}_id'.format(key)
        self._store = Kvs(self._key)

    def new(self):
        return self._store.incr()

    def get(self):
        return self._store.get()

    def reset(self):
        return self._store.delete()

    def get_current(self):
        return self.get()

class UserCreateError(Exception):
    pass

class UserManager(object):

    user_session = Kvs('user_session', SESSION_EXPIRES)
    id_generator = IDGenerator('user')

    def create_user(self, name):
        id = str(self.id_generator.new())
        user_data = {'id': id, 'name': name}
        if not self.user_session.hmset(user_data, nx=True):
            raise UserCreateError('User Created Failure. Arm is in use.')
        return User(id, name)

    def get_user(self, id):
        current_user = self.get_current_user()
        if current_user and current_user.id == id:
            return current_user
        else:
            return None

    def get_current_user(self):
        user_data = self.user_session.hgetall()
        if user_data:
            return User(**user_data)
        else:
            return None

    def get_ttl(self):
        return self.user_session.ttl()

    def clear(self):
        self.user_session.delete()

user_manager = UserManager()

class User(UserMixin):

    def __init__(self, id, name):
        self.id = id
        self.name = name

    def is_authenticated(self):
        user = user_manager.get_user(self.id)
        return bool(user)

    def is_active(self):
        return self.is_authenticated()

    @property
    def ttl(self):
        if self.is_active():
            return user_manager.get_ttl()
        else:
            return 0


text:
<config>
	<file>
		<source>
			<plain operatingsystem="/RedHat|CentOS/">syslog</plain>
		</source>
	</file>
</config>


text:
#ifndef DSO_UTILS_H
#define DSO_UTILS_H

#include <stdbool.h>

/** Generic pointer to function. */
typedef void (*dso_generic_func)(void);

/** Library handle (opaque). */
struct dso_handle;

/** Symbol lookup table. */
struct dso_symbol {
    /** Symbol name */
    const char  *name;
    /** Offset into the supplied vtable where symbol is to be loaded. */
    unsigned int offset;
};

/**
 * Opens the named shared library.
 *
 * @param[in]  path  the library name, or NULL to lookup into loaded libraries
 * @return the newly allocated library handle
 */
struct dso_handle *
dso_open(const char *path);

/** Closes and disposed any allocated data. */
void
dso_close(struct dso_handle *h);

/**
 * Loads symbols into the supplied vtable.
 *
 * @param[in]  handle           the DSO handle
 * @param[in]  vtable           the function table to fill in
 * @param[in]  vtable_length    the size (in bytes) of the function table
 * @param[in]  symbols          the NULL terminated array of symbols to lookup
 * @return true on success, false otherwise
 **/
bool
dso_get_symbols(
    struct dso_handle          *h,
    void                       *vtable,
    unsigned int                vtable_length,
    const struct dso_symbol    *symbols
);

#endif /* DSO_UTILS_H */


text:
<?php

namespace TutorAdmin\ShoutBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class TutorAdminShoutBundle extends Bundle
{
}


text:
#include "wa-inc/sensor.h"

#include "sensor_api.h"

typedef struct _sensor {
    struct _sensor *next;
    char *name;
    uint32 handle;
    void (*sensor_callback)(sensor_t, attr_container_t *, void *);
    void *user_data;
} sensor;

static sensor_t g_sensors = NULL;

sensor_t
sensor_open(const char *name, int index,
            sensor_event_handler_f sensor_event_handler, void *user_data)
{
    uint32 id = wasm_sensor_open(name, index);
    if (id == -1)
        return NULL;

    // create local node for holding the user callback
    sensor_t sensor = (sensor_t)malloc(sizeof(struct _sensor));
    if (sensor == NULL)
        return NULL;

    memset(sensor, 0, sizeof(struct _sensor));
    sensor->handle = id;
    sensor->name = strdup(name);
    sensor->user_data = user_data;
    sensor->sensor_callback = sensor_event_handler;

    if (!sensor->name) {
        free(sensor);
        return NULL;
    }

    if (g_sensors == NULL) {
        g_sensors = sensor;
    }
    else {
        sensor->next = g_sensors;
        g_sensors = sensor;
    }

    return sensor;
}

bool
sensor_config_with_attr_container(sensor_t sensor, attr_container_t *cfg)
{
    char *buffer = (char *)cfg;
    int len = attr_container_get_serialize_length(cfg);

    return wasm_sensor_config_with_attr_container(sensor->handle, buffer, len);
}

bool
sensor_config(sensor_t sensor, int interval, int bit_cfg, int delay)
{
    bool ret = wasm_sensor_config(sensor->handle, interval, bit_cfg, delay);
    return ret;
}

bool
sensor_close(sensor_t sensor)
{
    wasm_sensor_close(sensor->handle);

    // remove local node
    sensor_t s = g_sensors;
    sensor_t prev = NULL;
    while (s) {
        if (s == sensor) {
            if (prev == NULL) {
                g_sensors = s->next;
            }
            else {
                prev->next = s->next;
            }
            free(s->name);
            free(s);
            return true;
        }
        else {
            prev = s;
            s = s->next;
        }
    }

    return false;
}

/*
 *
 *  API for native layer to callback for sensor events
 *
 */

void
on_sensor_event(uint32 sensor_id, char *buffer, int len)
{
    attr_container_t *sensor_data = (attr_container_t *)buffer;

    // lookup the sensor and call the handlers
    sensor_t s = g_sensors;
    sensor_t prev = NULL;
    while (s) {
        if (s->handle == sensor_id) {
            s->sensor_callback(s, sensor_data, s->user_data);
            break;
        }

        s = s->next;
    }
}


text:
package org.mybatis.generator.codegen.mybatis3.xmlmapper.elements;

import org.mybatis.generator.api.dom.xml.Attribute;
import org.mybatis.generator.api.dom.xml.TextElement;
import org.mybatis.generator.api.dom.xml.XmlElement;

/**
 *
 * @author Jeff Butler
 *
 */
public class DeleteByExampleElementGenerator extends AbstractXmlElementGenerator {

	public DeleteByExampleElementGenerator() {
		super();
	}

	@Override
	public void addElements(XmlElement parentElement) {
		XmlElement answer = new XmlElement("delete"); //$NON-NLS-1$

		String fqjt = introspectedTable.getExampleType();

		answer.addAttribute(new Attribute("id", introspectedTable.getDeleteByExampleStatementId())); //$NON-NLS-1$
		answer.addAttribute(new Attribute("parameterType", fqjt)); //$NON-NLS-1$

		context.getCommentGenerator().addComment(answer);

		StringBuilder sb = new StringBuilder();
		sb.append("delete from "); //$NON-NLS-1$
		sb.append(introspectedTable.getAliasedFullyQualifiedTableNameAtRuntime());
		answer.addElement(new TextElement(sb.toString()));
		answer.addElement(getExampleIncludeElement());

		if (context.getPlugins().sqlMapDeleteByExampleElementGenerated(answer, introspectedTable)) {
			parentElement.addElement(answer);
		}
	}
}


text:
/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.camunda.bpm.engine.impl;

import org.camunda.bpm.engine.query.QueryProperty;
import org.camunda.bpm.engine.task.TaskQuery;

/**
 * Contains the possible properties that can be used in a {@link TaskQuery}.
 *
 * @author Joram Barrez
 */
public interface TaskQueryProperty {

  public static final QueryProperty TASK_ID = new QueryPropertyImpl("ID_");
  public static final QueryProperty NAME = new QueryPropertyImpl("NAME_");
  public static final QueryProperty NAME_CASE_INSENSITIVE = new QueryPropertyImpl("NAME_", "LOWER");
  public static final QueryProperty DESCRIPTION = new QueryPropertyImpl("DESCRIPTION_");
  public static final QueryProperty PRIORITY = new QueryPropertyImpl("PRIORITY_");
  public static final QueryProperty ASSIGNEE = new QueryPropertyImpl("ASSIGNEE_");
  public static final QueryProperty CREATE_TIME = new QueryPropertyImpl("CREATE_TIME_");
  public static final QueryProperty PROCESS_INSTANCE_ID = new QueryPropertyImpl("PROC_INST_ID_");
  public static final QueryProperty CASE_INSTANCE_ID = new QueryPropertyImpl("CASE_INST_ID_");
  public static final QueryProperty EXECUTION_ID = new QueryPropertyImpl("EXECUTION_ID_");
  public static final QueryProperty CASE_EXECUTION_ID = new QueryPropertyImpl("CASE_EXECUTION_ID_");
  public static final QueryProperty DUE_DATE = new QueryPropertyImpl("DUE_DATE_");
  public static final QueryProperty FOLLOW_UP_DATE = new QueryPropertyImpl("FOLLOW_UP_DATE_");

}


text:
<!DOCTYPE html>

        <meta charset="UTF-8" />
        <meta name="robots" content="index, follow, all" />
        <title>Thelia\Core\EventListener\ErrorListener | </title>
                    <link rel="stylesheet" type="text/css" href="../../../stylesheet.css">

Classes

Namespaces

Interfaces

Traits

Index

Class

Thelia\Core\EventListener\ErrorListener

    class
    ErrorListener        implements
        EventSubscriberInterface

Class ErrorListener

Methods

                    __construct($env, ParserInterface $parser, SecurityContext $securityContext)

                    defaultErrorFallback(GetResponseForExceptionEvent $event)

                    handleException(GetResponseForExceptionEvent $event)

                    static array

                    getSubscribedEvents()

Returns an array of event names this subscriber wants to listen to.

Details

at line 45

                    public
    __construct($env, ParserInterface $parser, SecurityContext $securityContext)

Parameters

                $env

                ParserInterface
                $parser

                SecurityContext
                $securityContext

at line 54

                    public
    defaultErrorFallback(GetResponseForExceptionEvent $event)

Parameters

                GetResponseForExceptionEvent
                $event

at line 73

                    public
    handleException(GetResponseForExceptionEvent $event)

Parameters

                GetResponseForExceptionEvent
                $event

at line 105

                static    public            array
    getSubscribedEvents()

Returns an array of event names this subscriber wants to listen to.

The array keys are event names and the value can be:

The method name to call (priority defaults to 0)

An array composed of the method name to call and the priority

An array of arrays composed of the method names to call and respective
priorities, or 0 if unset

For instance:

array('eventName' => 'methodName')

array('eventName' => array('methodName', $priority))

array('eventName' => array(array('methodName1', $priority), array('methodName2'))

Return Value

            array
            The event names to listen to

        Generated by Sami, the API Documentation Generator.


text:
<Alloy>
	<View layout="composite" class="container" backgroundColor="white" fullscreen="true">
		<Require src="_header" ></Require>
		<View id="add" backgroundColor="black" zIndex="0" top="50">
			<View layout="vertical" width="90%" height="Ti.UI.SIZE" backgroundColor="white" borderColor="white">
				<View height="50" width="Ti.UI.FILL">
					Add Friends & Family Mobile Number
				</View>
				<View height="70" width="Ti.UI.FILL" backgroundColor="gray">
					<TextField id="mobileNo" width="90%" height="50" backgroundColor="white" color="black" borderColor="black" keyboardType="Titanium.UI.KEYBOARD_NUMBER_PAD" ></TextField>
				</View>
				<View layout="horizontal" height="50" backgroundColor="black">
					<View height="100%" width="49.72%" backgroundColor="black" onClick="submit">
						Submit
					</View>
					<View backgroundColor="white" height="100%" width="0.5%"></View>
					<View height="100%" width="49.72%" backgroundColor="black" onClick="cancel">
						Cancel
					</View>
				</View>
			</View>
		</View>
		<View layout="vertical" top="50" zIndex="1">
			<View layout="composite" height="50" backgroundColor="#E82630">
				Friends & Family
				<ImageView backgroundColor="transparent" width="30" height="30" right="10" onClick="back" image="/images/close_icon.png"></ImageView>
			</View>
			<View layout="composite" height="100" backgroundColor="gray">

					Add your 15 most important people on any mobile network or Telekom Malaysia fixed line into the list to enjoy a special call rate and SMS rate.

			</View>
			<ScrollView id="scrollView" layout="vertical" width="100%" backgroundColor="#E6E7E9">
				Currently no friends & family
				<View layout="horizontal" height="20%">
					<View layout="vertical" height="100%" width="70%">
						Mobile Number
						011XXXXXXX
					</View>
					Remove
				</View>
				<View height="1" width="90%" backgroundColor="gray"></View>
			</ScrollView>
			<View height="50" backgroundColor="black" onClick="ff">
				Add Friends & Family
			</View>
		</View>
	</View>
</Alloy>