text:
import graphene

from .....attribute.models import AttributeValue
from .....attribute.utils import associate_attribute_values_to_instance
from .....tests.utils import dummy_editorjs
from ....tests.utils import get_graphql_content, get_graphql_content_from_response

PAGE_QUERY = """
    query PageQuery($id: ID, $slug: String) {
        page(id: $id, slug: $slug) {
            id
            title
            slug
            pageType {
                id
            }
            content
            contentJson
            attributes {
                attribute {
                    slug
                }
                values {
                    id
                    slug
                }
            }
        }
    }
"""

def test_query_published_page(user_api_client, page):
    page.is_published = True
    page.save()

    page_type = page.page_type

    assert page.attributes.count() == 1
    page_attr_assigned = page.attributes.first()
    page_attr = page_attr_assigned.attribute

    assert page_attr_assigned.values.count() == 1
    page_attr_value = page_attr_assigned.values.first()

    # query by ID
    variables = {"id": graphene.Node.to_global_id("Page", page.id)}
    response = user_api_client.post_graphql(PAGE_QUERY, variables)
    content = get_graphql_content(response)
    page_data = content["data"]["page"]
    assert (
        page_data["content"]
        == page_data["contentJson"]
        == dummy_editorjs("Test content.", True)
    )
    assert page_data["title"] == page.title
    assert page_data["slug"] == page.slug
    assert page_data["pageType"]["id"] == graphene.Node.to_global_id(
        "PageType", page.page_type.pk
    )

    expected_attributes = []
    for attr in page_type.page_attributes.all():
        values = (
            [
                {
                    "slug": page_attr_value.slug,
                    "id": graphene.Node.to_global_id(
                        "AttributeValue", page_attr_value.pk
                    ),
                }
            ]
            if attr.slug == page_attr.slug
            else []
        )
        expected_attributes.append({"attribute": {"slug": attr.slug}, "values": values})

    for attr_data in page_data["attributes"]:
        assert attr_data in expected_attributes

    # query by slug
    variables = {"slug": page.slug}
    response = user_api_client.post_graphql(PAGE_QUERY, variables)
    content = get_graphql_content(response)
    assert content["data"]["page"]["id"] == graphene.Node.to_global_id("Page", page.id)

def test_customer_query_unpublished_page(user_api_client, page):
    page.is_published = False
    page.save()

    # query by ID
    variables = {"id": graphene.Node.to_global_id("Page", page.id)}
    response = user_api_client.post_graphql(PAGE_QUERY, variables)
    content = get_graphql_content(response)
    assert content["data"]["page"] is None

    # query by slug
    variables = {"slug": page.slug}
    response = user_api_client.post_graphql(PAGE_QUERY, variables)
    content = get_graphql_content(response)
    assert content["data"]["page"] is None

def test_staff_query_unpublished_page_by_id(
    staff_api_client, page, permission_manage_pages
):
    page.is_published = False
    page.save()

    # query by ID
    variables = {"id": graphene.Node.to_global_id("Page", page.id)}
    response = staff_api_client.post_graphql(
        PAGE_QUERY,
        variables,
        permissions=[permission_manage_pages],
        check_no_permissions=False,
    )
    content = get_graphql_content(response)
    assert content["data"]["page"]["id"] == variables["id"]

def test_staff_query_unpublished_page_by_id_without_required_permission(
    staff_api_client,
    page,
):
    page.is_published = False
    page.save()

    # query by ID
    variables = {"id": graphene.Node.to_global_id("Page", page.id)}
    response = staff_api_client.post_graphql(PAGE_QUERY, variables)
    content = get_graphql_content(response)
    assert content["data"]["page"] is None

def test_app_query_unpublished_page_by_id(
    app_api_client, page, permission_manage_pages
):
    # given
    page.is_published = False
    page.save()

    app_api_client.app.permissions.add(permission_manage_pages)

    variables = {"id": graphene.Node.to_global_id("Page", page.id)}

    # when
    response = app_api_client.post_graphql(
        PAGE_QUERY,
        variables,
    )

    # then
    content = get_graphql_content(response)
    assert content["data"]["page"]["id"] == variables["id"]

def test_app_query_unpublished_page_by_id_without_required_permission(
    app_api_client,
    page,
):
    # given
    page.is_published = False
    page.save()

    variables = {"id": graphene.Node.to_global_id("Page", page.id)}

    # when
    response = app_api_client.post_graphql(PAGE_QUERY, variables)

    # then
    content = get_graphql_content(response)
    assert content["data"]["page"] is None

def test_app_query_unpublished_page_by_slug(
    app_api_client, page, permission_manage_pages
):
    # given
    page.is_published = False
    page.save()

    app_api_client.app.permissions.add(permission_manage_pages)

    variables = {"slug": page.slug}

    # when
    response = app_api_client.post_graphql(
        PAGE_QUERY,
        variables,
    )

    # then
    content = get_graphql_content(response)
    assert content["data"]["page"]["id"] == graphene.Node.to_global_id("Page", page.id)

def test_app_query_unpublished_page_by_slug_without_required_permission(
    app_api_client,
    page,
):
    # given
    page.is_published = False
    page.save()

    # when
    variables = {"slug": page.slug}

    # then
    response = app_api_client.post_graphql(PAGE_QUERY, variables)
    content = get_graphql_content(response)
    assert content["data"]["page"] is None

def test_staff_query_unpublished_page_by_slug(
    staff_api_client, page, permission_manage_pages
):
    page.is_published = False
    page.save()

    # query by slug
    variables = {"slug": page.slug}
    response = staff_api_client.post_graphql(
        PAGE_QUERY,
        variables,
        permissions=[permission_manage_pages],
        check_no_permissions=False,
    )
    content = get_graphql_content(response)
    assert content["data"]["page"]["id"] == graphene.Node.to_global_id("Page", page.id)

def test_staff_query_unpublished_page_by_slug_without_required_permission(
    staff_api_client,
    page,
):
    page.is_published = False
    page.save()

    # query by slug
    variables = {"slug": page.slug}
    response = staff_api_client.post_graphql(PAGE_QUERY, variables)
    content = get_graphql_content(response)
    assert content["data"]["page"] is None

def test_staff_query_page_by_invalid_id(staff_api_client, page):
    id = "bh/"
    variables = {"id": id}
    response = staff_api_client.post_graphql(PAGE_QUERY, variables)
    content = get_graphql_content_from_response(response)
    assert len(content["errors"]) == 1
    assert content["errors"][0]["message"] == f"Couldn't resolve id: {id}."
    assert content["data"]["page"] is None

def test_staff_query_page_with_invalid_object_type(staff_api_client, page):
    variables = {"id": graphene.Node.to_global_id("Order", page.id)}
    response = staff_api_client.post_graphql(PAGE_QUERY, variables)
    content = get_graphql_content(response)
    assert content["data"]["page"] is None

def test_get_page_with_sorted_attribute_values(
    staff_api_client,
    page,
    product_list,
    page_type_product_reference_attribute,
    permission_manage_pages,
):
    # given
    page_type = page.page_type
    page_type.page_attributes.set([page_type_product_reference_attribute])

    attr_value_1 = AttributeValue.objects.create(
        attribute=page_type_product_reference_attribute,
        name=product_list[0].name,
        slug=f"{page.pk}_{product_list[0].pk}",
    )
    attr_value_2 = AttributeValue.objects.create(
        attribute=page_type_product_reference_attribute,
        name=product_list[1].name,
        slug=f"{page.pk}_{product_list[1].pk}",
    )
    attr_value_3 = AttributeValue.objects.create(
        attribute=page_type_product_reference_attribute,
        name=product_list[2].name,
        slug=f"{page.pk}_{product_list[2].pk}",
    )

    attr_values = [attr_value_2, attr_value_1, attr_value_3]
    associate_attribute_values_to_instance(
        page, page_type_product_reference_attribute, *attr_values
    )

    page_id = graphene.Node.to_global_id("Page", page.id)
    variables = {"id": page_id}
    staff_api_client.user.user_permissions.add(permission_manage_pages)

    # when
    response = staff_api_client.post_graphql(PAGE_QUERY, variables)

    # then
    content = get_graphql_content(response)
    data = content["data"]["page"]
    assert len(data["attributes"]) == 1
    values = data["attributes"][0]["values"]
    assert len(values) == 3
    assert [value["id"] for value in values] == [
        graphene.Node.to_global_id("AttributeValue", val.pk) for val in attr_values
    ]


text:
<?php

namespace CR\GSBRBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 * praticienRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class praticienRepository extends EntityRepository {

    public function findAll() {

        return $this->findBy(array(), array('nomMedecin' => 'ASC'));

    }

}

redpajama_set_name: RedPajamaGithub


text:
using System.Web;

namespace ProstoA.Spower {
    public interface ISpowerHandlerFactory : IHttpHandlerFactory {
        string[] AllowExts { get; }
    }
}


text:
/*-------------------------------------------------------
 * This file was generated by XpeCodeGen
 * Version 1.0.0
 *
 * Do not make changes to this file
 *-------------------------------------------------------*/
package com.badlogic.gdx.physics.bullet.collision;

/** @author xpenatan */
public class btConvexInternalShape extends btConvexShape {

	protected void cacheObj() {
		com.dragome.commons.javascript.ScriptHelper.put("addr",this.cPointer,this);
		this.jsObj = com.dragome.commons.javascript.ScriptHelper.eval("Bullet.wrapPointer(addr,Bullet.btConvexInternalShape);",this);
	}
}


text:
The project is based on Actix - actor framework for Rust. More info about general idea of actors
[here as video](https://www.youtube.com/watch?v=lPTqcecwkJg)
or [here as a text](https://doc.akka.io/docs/akka/2.5.3/scala/general/index.html). Lot of information about actors
is available in regard to Akka, actor framework for JVM, but the general concepts are valid for Rust's Actix as well.

When you start looking into the code, you'll be mostly interested in code located at `src/actors`. These files define
several different actors within the agency.

## Messages everywhere!
There's few kinds:
- the way to interact with agency from outside is by sending "messages" via a transport protocol, in case of this agency
it is mostly HTTP POST Requests with binary encoding.
- That binary data is considered a message which will be somehow processed. Note though that a message can contain
another nested message (like an envelope in an envelope, but in this case each envelope represents some encrypted data).
- Actix framework itself is communicating via "messages". Actor framework is a lot like OOP, but the entities are not
calling each other's methods, but sending messages. So instead of `router.router(foo=1, bar=2)` you would basically do
something more like `dispatchMessage(router, Message {foo:1, bar:2})`.

## Protocols
The point of cloud agency is enabling asynchronous communication between agency which might not be always online and/or
have public IP address.
- These agents talk to each other using certain protocol - for example protocol to send/receive verifiable credentials
 and proofs based on them.
- But these agents need also a protocol for communication with the agency itself. Dummy Cloud Agency implements agency
protocol implemented by LibVCX library. Such protocol specified how to download messages or manage connections between
your cloud agent and other entities of outside word.

# The actors
Let's go trough the agents within the agency and their roles.

## Forward agent
This is sort of core agent of the agency and has it's own wallet. Let's call this `Forward Agent`'s wallet.
Every message coming into the agency have to first pass through  (and be processed by) forward
agent `forward_agent.rs`. Forward agent is basically represents identity of the agency
itself. Agency has it's own keypair (you can specify that in `"forward_agent":` section of configuration file) and
every message coming through the agency (regardless of who the recipient is) must be anoncrypted by agency's keypair.
So when a message arrives to agency, it first flows to forward agent`which anondecrypts the message.

Next, the message is passed to Router actor `router.rs`.

## Router
Router is Actor, which as name suggests, routes messages. It can process few types of messages, which basically gives
Router interaction interface for following operations.
- Register Agent did route
- Register Agent Connection route
- Route a message

In order for router to be able route messages anywhere, other actors (such as `Forward Agent`, `Agent Connection`,
`Forward agent Connection`) must first register their DIDs which is like them saying "Hey Router, when you get
a message for DID=123456, that's me! Forward it to me please."  And soo when Router later gets message to route,
the message must contain `fwd` field with value if recipient's DID.

## Forward agent connection
Let's get back to Forward Agent for a second. Apart from the mundane anondecryption Forward Agent performs,
it can also handle 1 type of Agency protocol message - `Connect`. Anytime an agent from outer world wants to
start interacting with agency, it first needs to establish connection with agency. That means the agency and
the outer agent have to exchange public keys used uniquely for encryption and identification of the relationship
between them. That is accommodated via the `Connect` agency protocol message.

Each forward agent connection represents connection with someone and it's Forward Agent Connection has its own DID.
This DID is registered in `Router`. Each forward agent connection is stored in `Forward Agent`'s wallet as pair of DIDs
with metadata.

Forward Agent Connection actor itself can handle just 2 types of agency protocol messages `CreateAgent` and `SingUp`.
These are usually called subsequently to upgrade your "a connection with the agency" to a full blown cloud agent inside
cloud agency. `CreateAgent` creates you `Agent` in the cloud agency.

## Agent
Agent is actor representing your cloud agent. It has its own DID and keypair stored in its own wallet. The wallet will
is later also used to manage pairwise connection between your agent and other agents.
Agent has many capabilities - following LibVCX agency protocol, you can create new connections with other agents,
requests messages from established connections, configure your agent and more. Particularly important agency protocol
message type is `CreateKey` which as result create new actor `Agent Connection`.

## Agent connection
Agent connection is representation of single pairwise relationship of particular `Agent`. The state of this actor
includes data such a connection status and list of messages exchanged within this relationship.

## Requester
This is "singleton", almost stateless actor which does not need to persist any state. Requester is solely used to
forward messages to different cloud agencies.


text:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Cory V Gerlach on My BioBits</title>
    <link>http://lpantano.github.io/authors/cory-v-gerlach/</link>
    <description>Recent content in Cory V Gerlach on My BioBits</description>
    <generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator>
    <language>en-us</language>
    <lastBuildDate>Sat, 01 Jun 2019 00:00:00 +0000</lastBuildDate>

	    <atom:link href="http://lpantano.github.io/authors/cory-v-gerlach/index.xml" rel="self" type="application/rss+xml" />

    <item>
      <title>Multi omics analysis of fibrotic kidneys in two mouse models.</title>
      <link>http://lpantano.github.io/publication/pavkovic-2019/</link>
      <pubDate>Sat, 01 Jun 2019 00:00:00 +0000</pubDate>

      <guid>http://lpantano.github.io/publication/pavkovic-2019/</guid>
      <description></description>
    </item>

  </channel>
</rss>


text:
<?php

defined('BASEPATH') OR exit('No direct script access allowed');
?>
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">

	<meta name="description" content="">
	<meta name="author" content="">
	<link rel="icon" href="./public/image/favicon.ico">

	<link href="/public/vendor/bootstrap-3.3.7/css/bootstrap.min.css" rel="stylesheet">

	<link href="/public/vendor/bootstrap-3.3.7/ie10-viewport-bug-workaround.css" rel="stylesheet">

	<link href="/public/vendor/bootstrap-3.3.7/starter-template.css" rel="stylesheet">

  <link href="/public/vendor/bootstrap-3.3.7/signin.css" rel="stylesheet">

	<link href="/public/vendor/jquery-ui-1.12.1/jquery-ui.css" rel="stylesheet">
	<link href="/public/css/own_css.css" rel="stylesheet">

	<title><?php echo $title; ?></title>

		<?php echo $content; ?>

Code licensed under MIT,
documentation under CC BY 3.0.
 © numbrCode,  2017  www.yoursite.com.


text:
angular
    .module('app.controllers')
    .controller('userDetailsController', userDetailsController);

userDetailsController.$inject = ['$state', '$stateParams', 'userDetailsDAL', 'customStorage', 'userDetails'];

function userDetailsController($state, $stateParams, userDetailsDAL, customStorage, userDetails) {
    var userDetailsCtrl = this;

    userDetailsCtrl.userDetails = [];
    userDetailsCtrl.deleteUser = deleteUser;
    userDetailsCtrl.goBack = goBack;

    if (Object.keys(userDetails).length === 0) $state.go('userList', {fetchFromServer:true});

    userDetailsCtrl.userDetails = userDetails;

    function deleteUser() {
        //http call to backend for delete
        userDetailsDAL.deleteUser(userDetailsCtrl.userDetails.id)
            .then(function (data) {
                $state.go('userList');
            }, function (error) {
                console.log(error);
            })
    }

    function goBack(){
        $state.go('userList', {fetchFromServer:false})
    }
}


text:
#ifndef QQMLWEBCHANNELATTACHED_H
#define QQMLWEBCHANNELATTACHED_H

//
//  W A R N I N G
//  -------------
//
// This file is not part of the Qt API.  It exists purely as an
// implementation detail.  This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//

#include <QObject>

#include "qwebchannelglobal.h"

QT_BEGIN_NAMESPACE

class Q_WEBCHANNEL_EXPORT QQmlWebChannelAttached : public QObject
{
    Q_OBJECT

    Q_PROPERTY( QString id READ id WRITE setId NOTIFY idChanged FINAL )
public:
    explicit QQmlWebChannelAttached(QObject *parent = 0);
    virtual ~QQmlWebChannelAttached();

    QString id() const;
    void setId(const QString &id);

Q_SIGNALS:
    void idChanged(const QString &id);

private:
    QString m_id;
};

QT_END_NAMESPACE

#endif // QQMLWEBCHANNELATTACHED_H


text:
package pl.srw.billcalculator.db;

import org.greenrobot.greendao.database.StandardDatabase;
import org.greenrobot.greendao.query.QueryBuilder;
import org.greenrobot.greendao.test.AbstractDaoSessionTest;

import java.util.Date;
import java.util.List;

import pl.srw.billcalculator.db.dao.DaoMaster;
import pl.srw.billcalculator.db.dao.DaoSession;
import pl.srw.billcalculator.persistence.Triggers;
import pl.srw.billcalculator.persistence.type.BillType;

public class TriggersTest extends AbstractDaoSessionTest<DaoMaster, DaoSession> {

    public TriggersTest() {
        super(DaoMaster.class);
    }

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        QueryBuilder.LOG_SQL = true;
        QueryBuilder.LOG_VALUES = true;
        Triggers.create(((StandardDatabase) db).getSQLiteDatabase());
    }

    public void testTriggerInsertHistoryEntryOnInsertPgeBill() {
        testTriggerInsertHistoryEntryOnInsert(new PgeG12Bill(), BillType.PGE_G12);
    }

    public void testTriggerInsertHistoryEntryOnInsertPgeG12Bill() {
        testTriggerInsertHistoryEntryOnInsert(new PgeG11Bill(), BillType.PGE_G11);
    }

    public void testTriggerInsertHistoryEntryOnInsertPgnigBill() {
        testTriggerInsertHistoryEntryOnInsert(new PgnigBill(), BillType.PGNIG);
    }

    public void testTriggerInsertHistoryEntryOnInsertTauronG11Bill() {
        testTriggerInsertHistoryEntryOnInsert(new TauronG11Bill(), BillType.TAURON_G11);
    }

    public void testTriggerInsertHistoryEntryOnInsertTauronG12Bill() {
        testTriggerInsertHistoryEntryOnInsert(new TauronG12Bill(), BillType.TAURON_G12);
    }

    public void testTriggerDeleteHistoryEntryOnDeletePgeBill() {
        testTriggerDeleteHistoryEntryOnDelete(new PgeG11Bill());
    }

    public void testTriggerDeleteHistoryEntryOnDeletePgeG12Bill() {
        testTriggerDeleteHistoryEntryOnDelete(new PgeG12Bill());
    }

    public void testTriggerDeleteHistoryEntryOnDeleteTauronG11Bill() {
        testTriggerDeleteHistoryEntryOnDelete(new TauronG11Bill());
    }

    public void testTriggerDeleteHistoryEntryOnDeleteTauronG12Bill() {
        testTriggerDeleteHistoryEntryOnDelete(new TauronG12Bill());
    }

    public void testTriggerDeleteHistoryEntryOnDeletePgnigBill() {
        testTriggerDeleteHistoryEntryOnDelete(new PgnigBill());
    }

    public void testTriggerDeleteSingleHistoryEntryOnDeletePgeG12Bill() {
        final PgeG11Bill bill = new PgeG11Bill(1L);
        // given: 3 bills inserted
        daoSession.insert(bill);
        daoSession.insert(new PgeG12Bill(1L));
        daoSession.insert(new PgnigBill(1L));

        // when: 1 bill is deleted
        daoSession.delete(bill);

        // then: 2 history entries present
        assertEquals(2, daoSession.getHistoryDao().loadAll().size());
    }

    private void testTriggerDeleteHistoryEntryOnDelete(Bill bill) {
        // save
        daoSession.insert(bill);

        // delete
        daoSession.delete(bill);

        // test
        assertTrue(daoSession.getHistoryDao().loadAll().isEmpty());
    }

    private void testTriggerInsertHistoryEntryOnInsert(Bill bill, BillType billType) {
        Date date = new Date();
        // save
        bill.setDateFrom(date);
        final long billId = daoSession.insert(bill);

        // load
        final List<History> history = daoSession.getHistoryDao().loadAll();

        // test
        assertEquals(1, history.size());
        final History historyBill = history.get(0);
        assertEquals(billId, historyBill.getBillId().longValue());
        assertEquals(date, historyBill.getDateFrom());
        assertEquals(billType.toString(), historyBill.getBillType());
    }
}


text:
{% extends "base.html" %}

{% block content %}

            My Groups

			<input type="submit" class="button" value="Create New Group">

{% endblock %}


text:
package com.hazelcast.wan;

import com.hazelcast.config.WanAcknowledgeType;
import com.hazelcast.test.HazelcastParallelClassRunner;
import com.hazelcast.test.annotation.ParallelTest;
import com.hazelcast.test.annotation.QuickTest;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;

import static com.hazelcast.wan.WanSyncStatus.FAILED;
import static com.hazelcast.wan.WanSyncStatus.IN_PROGRESS;
import static com.hazelcast.wan.WanSyncStatus.READY;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;

@RunWith(HazelcastParallelClassRunner.class)
@Category({QuickTest.class, ParallelTest.class})
public class WanSyncStatusTest {

    @Test
    public void test() {
        assertSame(READY, WanSyncStatus.getByStatus(READY.getStatus()));
        assertSame(IN_PROGRESS, WanSyncStatus.getByStatus(IN_PROGRESS.getStatus()));
        assertSame(FAILED, WanSyncStatus.getByStatus(FAILED.getStatus()));
        assertNull(WanAcknowledgeType.getById(-1));
    }
}


text:
"""
Documents
"""

from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals

import os
import glob
import codecs

class AbstractFile(object):
    def __init__(self, path):
        path = os.path.abspath(path)
        self.set_path(path)

    def set_path(self, path):
        self.path = path
        self.dir = os.path.dirname(self.path)
        self.name = os.path.basename(self.path)
        self.caption = self.name

    def __str__(self):
        return '%s (%s)' % (self.name, self.path)

    def get_path(self):
        return self.path

    def get_dir(self):
        return self.dir

    def get_name(self):
        return self.name

    def get_ctime(self):
        ctime = 0
        if os.path.exists(self.path):
            ctime = os.path.getctime(self.path)
        return ctime

    def get_mtime(self):
        mtime = 0
        if os.path.exists(self.path):
            mtime = os.path.getmtime(self.path)
        return mtime

    def is_file(self):
        return os.path.isfile(self.path)

    def is_dir(self):
        return os.path.isdir(self.path)

    def is_temp_file(self):
        state = False
        lower_name = self.name.lower()
        if lower_name == 'cvs':
            state = True
        elif lower_name.startswith('$') or lower_name.startswith('.'):
            state = True
        elif lower_name.endswith('.tmp') or lower_name.endswith('.bak'):
            state = True
        return state

    def change_name(self, new_name):
        os.chdir(self.dir)
        os.rename(self.name, new_name)
        new_path = os.path.join(self.dir, new_name)
        self.set_path(new_path)

class Dir(AbstractFile):
    def __init__(self, path):
        super(Dir, self).__init__(path)

    def ensure_existence(self):
        if self.is_file():
            cur_file = File(self.path)
            new_name = 'old_file_' + cur_file.name
            cur_file.change_name(new_name)
        if not self.is_dir():
            os.makedirs(self.path)

    def list_all(self, pattern='*'):
        all_files = []
        paths = glob.glob(os.path.join(self.path, pattern))
        all_files = (AbstractFile(path) for path in paths)
        all_files = [f for f in all_files if not f.is_temp_file()]
        all_files.sort(key=lambda f: f.get_name().lower())
        return all_files

    def list_dirs(self, pattern='*'):
        all_files = self.list_all(pattern)
        dirs = [Dir(f.path) for f in all_files if f.is_dir()]
        return dirs

    def list_files(self, pattern='*'):
        all_files = self.list_all(pattern)
        files = [File(f.path) for f in all_files if f.is_file()]
        return files

    def list_files_of_extension(self, ext=''):
        return self.list_files('*' + ext)

    def list_files_of_extensions(self, exts=['']):
        all_files = []
        for ext in exts:
            all_files += self.list_files_of_extension(ext)
        return all_files

    def recursive_list_files(self, exts=[''], exclude_dirs=[]):
        all_files = self.list_files_of_extensions(exts)
        dirs = self.list_dirs()
        for cur_dir in dirs:
            if cur_dir.get_name() not in exclude_dirs:
                all_files += cur_dir.recursive_list_files(exts)
        return all_files

    def has_file(self, file_name):
        file_path = os.path.join(self.path, file_name)
        return os.path.isfile(file_path)

class File(AbstractFile):
    """
    Doc of this class
    """
    def __init__(self, path, encoding='utf-8'):
        super(File, self).__init__(path)
        self.set_encoding(encoding)

    def has_ext(self, extension):
        return self.get_ext() == extension

    def get_ext(self):
        return os.path.splitext(self.name)[1]

    def get_basename(self):
        return os.path.splitext(self.name)[0]

    def get_encoding(self):
        return self.encoding

    def set_encoding(self, encoding='utf-8'):
        self.encoding = encoding

    def read(self):
        text = ''
        try:
            with codecs.open(self.path, 'r', self.encoding) as f:
                text = f.read()
        except (IOError, UnicodeError):
            pass
        return text

    def write(self, text, append=False):
        mode = 'w'
        if append:
            mode = 'a'
        try:
            with codecs.open(self.path, mode, self.encoding) as f:
                f.write(text)
        except (IOError, UnicodeError):
            pass


text:
package com.alibaba.fastjson.serializer;

import java.io.IOException;
import java.lang.reflect.Type;

import com.alibaba.fastjson.JSONAware;

/**
 * @author wenshao[szujobs@hotmail.com]
 */
public class JSONAwareSerializer implements ObjectSerializer {

    public static JSONAwareSerializer instance = new JSONAwareSerializer();

    public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType, int features) throws IOException {
        SerializeWriter out = serializer.out;

        JSONAware aware = (JSONAware) object;
        out.write(aware.toJSONString());
    }
}


text:
import Graphics.Gloss.Game

-- A sprite representing our character
slimeSprite = bmp "Slime.bmp"

slimeWidth  = 104 * 0.5     -- we draw it with scale 0.5
slimeHeight = 104 * 0.5

-- Our game world consists of both the location and the vertical velocity of our character.
data World = World Point Float

-- This starts our gamein a window with a give size, running at 30 frames per second.
--
-- The argument 'World (0, 0) 0' is the initial state of our game world, where our character is at the centre of the
-- window and has no velocity.
--
main = play (InWindow "Slime is here!" (600, 400) (50, 50)) white 30 (World (0, 0) 0) draw handle [applyGravity]

-- To draw a frame, we position the character sprite at the location as determined by the current state of the world.
-- We shrink the sprite by 50%.
draw (World (x, y) _v) = translate x y (scale 0.5 0.5 slimeSprite)

-- Whenever any of the keys 'a', 'd', 'w', or 's' have been pushed down, move our character in the corresponding
-- direction.
handle (EventKey (Char 'a') Down _ _) (World (x, y) v) = World (moveX (x, y) (-10)) v
handle (EventKey (Char 'd') Down _ _) (World (x, y) v) = World (moveX (x, y) 10) v
handle (EventKey (Char 'w') Down _ _) (World (x, y) v) = World (moveY (x, y) 10) v
handle (EventKey (Char 's') Down _ _) (World (x, y) v) = World (moveY (x, y) (-10)) v
handle event world = world        -- don't change the world in case of any other events

-- Move horizontally, but box the character in at the window boundaries.
moveX (x, y) offset = if x + offset < (-300) + slimeWidth / 2
                      then ((-300) + slimeWidth /  2, y)
                      else if x + offset > 300 - slimeWidth /  2
                      then (300 - slimeWidth /  2, y)
                      else (x + offset, y)

-- Move vertically, but box the character in at the window boundaries.
moveY (x, y) offset = if y + offset < (-200) + slimeHeight / 2
                      then (x, (-200) + slimeHeight /  2)
                      else if y + offset > 200 - slimeHeight /  2
                      then (x, 200 - slimeHeight /  2)
                      else (x, y + offset)

-- Each frame, add the veclocity to the verticial position (y-axis) and decrease the velocity slightly.
--
-- A negative velocity corresponds to a downward movement and by decreasing it continually, we accelerate downwards,
-- which corresponds to a gravitational pull.
--
applyGravity _time (World (x, y) v) = World (moveY (x, y) v) (v - 0.1)


text:
@interface FBApplicationProcess : NSObject

@property (nonatomic, retain) NSString *bundleIdentifier;

@end


text:
## Latest Release: 1210.14.1.2 (2022/06/24)
* [azure-chef-extension #371] https://github.com/chef-partners/azure-chef-extension/pull/371 Documented the use of chef_server_crt option in azure-chef-extension
* [azure-chef-extension #373] https://github.com/chef-partners/azure-chef-extension/pull/373 Add files to help with release process
* [azure-chef-extension #376] https://github.com/chef-partners/azure-chef-extension/pull/376 Changes for Rakefile for new process of publishing
* [azure-chef-extension #377] https://github.com/chef-partners/azure-chef-extension/pull/377 Update in makefile for automating the process
* [azure-chef-extension #378] https://github.com/chef-partners/azure-chef-extension/pull/378 Upgrade rack version to 2.14 for azure-chef-extension

## Release: 1210.14.1.1 (2021/10/14)
* [azure-chef-extension #363] https://github.com/chef-partners/azure-chef-extension/pull/363 Fix for python not found error in latest Linux versions
* [azure-chef-extension #366] https://github.com/chef-partners/azure-chef-extension/pull/366 Masking the credentials from chef-package-url
* [azure-chef-extension #368] https://github.com/chef-partners/azure-chef-extension/pull/368 Fix for shared.sh script file according to ruby code conventions.

## Release: 1210.14.1.0 (2021/09/01)
* [azure-chef-extension #353](https://github.com/chef-partners/azure-chef-extension/pull/353) Changing the default daemon setting to task for windows.
* [azure-chef-extension #357](https://github.com/chef-partners/azure-chef-extension/pull/357) Fix TLS for installs from Azure Blob Stores.
* [azure-chef-extension #358](https://github.com/chef-partners/azure-chef-extension/pull/358) Removing knife dependency from azure chef extension
* [azure-chef-extension #359](https://github.com/chef-partners/azure-chef-extension/pull/359) Unpinning Chef-Infra-Client-16 from azure-chef-extension.
* [azure-chef-extension #360](https://github.com/chef-partners/azure-chef-extension/pull/360) Unpinning chef-16 gem from gemspec file.

## Release: 1210.13.5.2 (2021/05/17)
* [azure-chef-extension #345](https://github.com/chef-partners/azure-chef-extension/pull/345) Pin to chef 16 until chef 17 is tested and verified in Azure.
* [azure-chef-extension #347](https://github.com/chef-partners/azure-chef-extension/pull/347) Pinned to chef-16 gem to fix rspec.
* [azure-chef-extension #344](https://github.com/chef-partners/azure-chef-extension/pull/344) Add MSI installer logging.

## Release: 1210.13.5.1 (2021/04/01)
* [azure-chef-extension #337](https://github.com/chef-partners/azure-chef-extension/pull/337) Fix for failing deployment of Azure Chef extension in Ubuntu 20.04.

## Release: 1210.13.4.3 (2021/03/16)
* [azure-chef-extension #339](https://github.com/chef-partners/azure-chef-extension/pull/339) Remove query params from chef_package_url.

## Release: 1210.13.4.2 (2021/02/02)
* [azure-chef-extension #333](https://github.com/chef-partners/azure-chef-extension/pull/333) Remove use of Get Win32_Product API Call.
* [azure-chef-extension #332](https://github.com/chef-partners/azure-chef-extension/pull/332) Fix for inconsistent behavior with System Path and error while running dameon as service.
* [azure-chef-extension #330](https://github.com/chef-partners/azure-chef-extension/pull/330) Improvement in code of chef-install.sh.

## Release: 1210.13.4.1 (2020/08/19)
* [azure-chef-extension #320](https://github.com/chef-partners/azure-chef-extension/pull/320) Fix python syntax error found while testing Redhat 8 for environment variable and Updated example of custom_json_attr.
* [azure-chef-extension #309](https://github.com/chef-partners/azure-chef-extension/pull/309) Unpin Chef 15 and pin to latest chef version.
* [azure-chef-extension #308](https://github.com/chef-partners/azure-chef-extension/pull/308) Add support for Chef Client 16.

## Release: 1210.13.3.3 (2020/07/30)
* [azure-chef-extension #304](https://github.com/chef-partners/azure-chef-extension/pull/304) Fix for #303: enable times out with chef_package_url param
* [azure-chef-extension #306](https://github.com/chef-partners/azure-chef-extension/pull/306) Fix for #305: Install fails on Linux when proxy does SSL int.

## Release: 1210.13.3.2 (2020/07/03)
* [azure-chef-extension #300](https://github.com/chef-partners/azure-chef-extension/pull/300) Added a new parameter called `chef_package_url` which specifies a url to download Chef Infra Client package (.msi .rpm .deb) and subsequently install.

## Release: 1210.13.3.1 (2020/06/04)
* [azure-chef-extension #293](https://github.com/chef-partners/azure-chef-extension/pull/293) Support azure chef extension to chef-15. For this added `CHEF_LICENSE` option
which can be pass as [license acceptance](https://github.com/chef-partners/azure-chef-extension#arm-commands-for-azure-chef-extension)

## Release: 1210.13.2.3 (2020/02/13)
* [azure-chef-extension #287](https://github.com/chef-partners/azure-chef-extension/pull/287) Fix empty runlist issue while passing policy_name and policy_group.

## Release: 1210.13.2.2 (2019/11/26)
* [azure-chef-extension #284](https://github.com/chef-partners/azure-chef-extension/pull/284) Remove --no-ri and --no-rdoc options from chef-install.sh.
* [azure-chef-extension #281](https://github.com/chef-partners/azure-chef-extension/pull/281) Add compatible python path for Rhel8.
* [azure-chef-extension #279](https://github.com/chef-partners/azure-chef-extension/pull/279) Fix null-valued expression error.
* [azure-chef-extension #278](https://github.com/chef-partners/azure-chef-extension/pull/278) Set path in cron for chef client environment.

## Release: 1210.13.2.1 (2019/08/23)
* [azure-chef-extension #274](https://github.com/chef-partners/azure-chef-extension/pull/274) Added `chef_package_path` option to allow custom path of downloaded chef client.
* [azure-chef-extension #266](https://github.com/chef-partners/azure-chef-extension/pull/266) Fixes failing specs in recent merge which has wrong check of error code.

## Release: 1210.13.1.1 (2019/08/23)
* [azure-chef-extension #269](https://github.com/chef-partners/azure-chef-extension/pull/269) Pin to Chef 14 until Chef 15 is tested and verified on Azure later this year

## Release: 1210.13.1.0 (2019/02/05)
* [azure-chef-extension #261](https://github.com/chef-partners/azure-chef-extension/pull/261) Fixes the duplicate node_name in client.rb
* [azure-chef-extension #255](https://github.com/chef-partners/azure-chef-extension/pull/255) Fixes environment and run_list params not recognised.

## Release: 1210.12.110.1002 (2018/08/23)
* [azure-chef-extension #271](https://github.com/chef-partners/azure-chef-extension/pull/271) Pin to Chef 14 until Chef 15 is tested and verified on Azure later this year.

## Release: 1210.12.110.1001 (2018/04/30)
* [azure-chef-extension #245](https://github.com/chef-partners/azure-chef-extension/pull/245) Added `bootstrap_channel` option to install chef client version from `stable`, `current` or `unstable` channel.

## Release: 1210.12.110.1000 (2017/11/15)
* [azure-chef-extension #237](https://github.com/chef-partners/azure-chef-extension/pull/237) Updated document for extension sequencing in ARM template.
* [azure-chef-extension #236](https://github.com/chef-partners/azure-chef-extension/pull/236) Added support for Oracle Linux.
* [azure-chef-extension #234](https://github.com/chef-partners/azure-chef-extension/pull/234) Updated rake task to use azure-extension-cli to publish/unpublish extension in Public cloud
* [azure-chef-extension #229](https://github.com/chef-partners/azure-chef-extension/pull/229) Updated rake task to support publishing extension on Gov Cloud
* [azure-chef-extension #228](https://github.com/chef-partners/azure-chef-extension/pull/228) Removed backup logic and using n.settings file from C:/Chef during update to fix error coming while upgrading Chef extension version on Windows.

## Release: 1210.12.109.1005 (2017/07/03)
* [azure-chef-extension #217](https://github.com/chef-partners/azure-chef-extension/pull/217) Chef-service enable failed, make sure that Azure Chef extension start the chef-client service, If service StartMode is disabled.

## Release: 1210.12.109.1004 (2017/05/18)
* [azure-chef-extension #213](https://github.com/chef-partners/azure-chef-extension/pull/213) Fixed runlist conflicts with policy_name and policy_group settings in first-boot.json
* [azure-chef-extension #210](https://github.com/chef-partners/azure-chef-extension/pull/210) Update readme with microsoft image
* [azure-chef-extension #209](https://github.com/chef-partners/azure-chef-extension/pull/209) Added changes for spliting multiple certificates
* [azure-chef-extension #208](https://github.com/chef-partners/azure-chef-extension/pull/208) Fixing OpenSSL `header too long` issue.

## Release: 1210.12.109.1003 (2017/03/31)
* [azure-chef-extension #205](https://github.com/chef-partners/azure-chef-extension/pull/205) Fixed extension failure issue for Windows 8.

## Release: 1210.12.109.1002 (2017/03/28)
* [azure-chef-extension #203](https://github.com/chef-partners/azure-chef-extension/pull/203) Fixed nested backup issue.
* [azure-chef-extension #200](https://github.com/chef-partners/azure-chef-extension/pull/200) Fixed extension bad format issue.
* [azure-chef-extension #197](https://github.com/chef-partners/azure-chef-extension/pull/197) Optimized extension install and enable for windows.
* [azure-chef-extension #196](https://github.com/chef-partners/azure-chef-extension/pull/196) Renamed chef-service-interval option name to chef-daemon-interval.

## Release: 1210.12.109.1000 (2017/03/17)
* [azure-chef-extension #193](https://github.com/chef-partners/azure-chef-extension/pull/193) Added support for environment_variables in windows extension.

## Release: 1210.12.108.1000 (2017/02/17)
* [azure-chef-extension #188](https://github.com/chef-partners/azure-chef-extension/pull/188) Add support for chef-client scheduled task

## Release: 1210.12.106.1001 (2017/01/30)
* [azure-chef-extension #187](https://github.com/chef-partners/azure-chef-extension/pull/187) add python script to parse env variables

## Release: 1210.12.107.1001 (2017/01/03)
* [azure-chef-extension #185](https://github.com/chef-partners/azure-chef-extension/pull/185) Parsing json on Windows 2008

## Release: 1210.12.107.1000 (2016/12/26)
* [azure-chef-extension #178](https://github.com/chef-partners/azure-chef-extension/pull/178) Added -daemon option in chef-client service install
* [azure-chef-extension #181](https://github.com/chef-partners/azure-chef-extension/pull/181) Moving install steps to enable
* [azure-chef-extension #183](https://github.com/chef-partners/azure-chef-extension/pull/183) Skipping reading azure config json file for powershell V2.0
* [azure-chef-extension #184](https://github.com/chef-partners/azure-chef-extension/pull/184) Accepting daemon=none instead of auto

## Release: 1210.12.106.1000 (2016/10/19)
* [azure-chef-extension #161](https://github.com/chef-partners/azure-chef-extension/pull/161) Added code to read chef_service_interval from extension config file and process it.
* [azure-chef-extension #167](https://github.com/chef-partners/azure-chef-extension/pull/167) Adding support for setting custom json attributes in first_boot.json
* [azure-chef-extension #169](https://github.com/chef-partners/azure-chef-extension/pull/169) Fetching secret from protectedSettings instead of publicSettings
* [azure-chef-extension #172](https://github.com/chef-partners/azure-chef-extension/pull/172) Fixed bug to not generate empty encrypted_data_bag_secret file.

## Release: 1210.12.105.1001 (2016/08/10)
* [azure-chef-extension #157](https://github.com/chef-partners/azure-chef-extension/pull/157) Fix for validation.pem file not generating
* [azure-chef-extension #158](https://github.com/chef-partners/azure-chef-extension/pull/158) Pinned rack to fix travis failure

## Release: 1210.12.105.1000 (2016/06/27)
* [azure-chef-extension #149](https://github.com/chef-partners/azure-chef-extension/pull/149) Removed unrequired flags for Linux Platforms
* [azure-chef-extension #150](https://github.com/chef-partners/azure-chef-extension/pull/150) Removed unwanted flags for windows

## Release: 1210.12.104.1000 (2016/06/20)
* [azure-chef-extension #141](https://github.com/chef-partners/azure-chef-extension/pull/141) Added support to read environment variables from handler settings file
* [azure-chef-extension #143](https://github.com/chef-partners/azure-chef-extension/pull/143) Added retry logic for chef-client download issue on Windows platform.
* [azure-chef-extension #144](https://github.com/chef-partners/azure-chef-extension/pull/144) Added check for chef-client installation and to skip installation if exists

## Release: 1210.12.103.1000 (2016/05/24)
* [azure-chef-extension #127](https://github.com/chef-partners/azure-chef-extension/pull/127) Updated README for adding uninstallChefClient option
* [azure-chef-extension #133](https://github.com/chef-partners/azure-chef-extension/pull/133) Appending Environment path for ruby at the end
* [azure-chef-extension #128](https://github.com/chef-partners/azure-chef-extension/pull/128) Use opscode chef's install for chef installation
* [azure-chef-extension #122](https://github.com/chef-partners/azure-chef-extension/pull/122) Added code to write chef_client run logs in sub_status field of 0.status file
* [azure-chef-extension #135](https://github.com/chef-partners/azure-chef-extension/pull/135) Added support to read ohai_hints in extension
* [azure-chef-extension #136](https://github.com/chef-partners/azure-chef-extension/pull/136) Fixed bug when ohai_hints are not passed and modified RSpecs
* [azure-chef-extension #139](https://github.com/chef-partners/azure-chef-extension/pull/139) Used different way for downloading opscode install.ps1 file for windows

## Release: 1210.12.102.1000 (2016/03/28)
* [azure-chef-extension #115](https://github.com/chef-partners/azure-chef-extension/pull/115) Decrypting validation key if it's provided in Base64encoded format
* [azure-chef-extension #116](https://github.com/chef-partners/azure-chef-extension/pull/116) Added AzureChefExtension support for RHEL platform

## Release: 1210.12.101.1000 for Windows (2016/02/04) and 1210.12.101.1000 for Ubuntu (2016/02/12)
* [azure-chef-extension #104](https://github.com/chef-partners/azure-chef-extension/pull/104) Fixed pester specs
* [azure-chef-extension #103](https://github.com/chef-partners/azure-chef-extension/pull/103) Added uninstall_chef_client flag which determines whether to uninstall chef-client or not.
* [azure-chef-extension #107](https://github.com/chef-partners/azure-chef-extension/pull/107) Added code to delete node-registered file during update process as it was not allowing chef-client run during enable process after update.
* [azure-chef-extension #108](https://github.com/chef-partners/azure-chef-extension/pull/108) Installing chef from Omnitruck for ubuntu and centos
* [azure-chef-extension #109](https://github.com/chef-partners/azure-chef-extension/pull/109) Debian support in azure-chef-extension
* [azure-chef-extension #111](https://github.com/chef-partners/azure-chef-extension/pull/110) Modified parsing code which reads bootstrap_version and handled various cases like parsing the contents having new lines
* [azure-chef-extension #112](https://github.com/chef-partners/azure-chef-extension/pull/111) Modified sed command to read major version for centos plaform

## Release: 1210.12.100.1000 (2015/12/07)
* [azure-chef-extension #95](https://github.com/chef-partners/azure-chef-extension/pull/95) Tagging policy
* [azure-chef-extension #94](https://github.com/chef-partners/azure-chef-extension/pull/94) Functional RSpecs for ssl cert support under bootstrap protocol cloud-api
* [azure-chef-extension #99](https://github.com/chef-partners/azure-chef-extension/pull/99) Not removing chef-client on extension uninstall

## Release: 1210.12.100 (2015/11/19)
* [azure-chef-extension #80](https://github.com/chef-partners/azure-chef-extension/pull/80) Fix uninstall for deleteChefConfig flag
* [azure-chef-extension #86](https://github.com/chef-partners/azure-chef-extension/pull/86) Added code for Ubuntu and CentOS to accept version of Chef to download and install
* [azure-chef-extension #87](https://github.com/chef-partners/azure-chef-extension/pull/87) Passing bootstrap options to client.rb
* [azure-chef-extension #89](https://github.com/chef-partners/azure-chef-extension/pull/89) Moved call to function copy_settings_file after the bootstrap_directory is created
* [azure-chef-extension #90](https://github.com/chef-partners/azure-chef-extension/pull/90) Reduce time to install extension for ubuntu
* [azure-chef-extension #92](https://github.com/chef-partners/azure-chef-extension/pull/92) Implemented changes for Chef Extension usage examples
* [azure-chef-extension #91](https://github.com/chef-partners/azure-chef-extension/pull/91) Added SSL certificate bootstrap support in chef extension for cloud-api protocol

## Release: 1210.12.5.1000 (2015/10/27)
* [azure-chef-extension #71](https://github.com/chef-partners/azure-chef-extension/pull/71) Added chef.io url
* [azure-chef-extension #78](https://github.com/chef-partners/azure-chef-extension/pull/78) Readme update for centos support
* [azure-chef-extension #76](https://github.com/chef-partners/azure-chef-extension/pull/76) Decouple chef-client installation for windows - using omnitruck API
* [azure-chef-extension #79](https://github.com/chef-partners/azure-chef-extension/pull/79) Install chef via apt repo on ubuntu

## Release: 1210.12.4.1000 (2015/08/21)
* [azure-chef-extension #53](https://github.com/chef-partners/azure-chef-extension/pull/53) Fix for bootstrap_options Chef environment name setting
* [azure-chef-extension #52](https://github.com/chef-partners/azure-chef-extension/pull/52) Extension update happens for Linux even if AutoUpdateClient=false
* [azure-chef-extension #55](https://github.com/chef-partners/azure-chef-extension/pull/55) Updated version scheme for 1210.12.4.1000
* [azure-chef-extension #59](https://github.com/chef-partners/azure-chef-extension/pull/59) Update readme for unavailability of old extensions

## Release: 1210.12.4.1 (2015/07/22)
* [azure-chef-extension #25](https://github.com/chef-partners/azure-chef-extension/pull/25) Functional testcases for basic commands of azure chef extension
* [azure-chef-extension #39](https://github.com/chef-partners/azure-chef-extension/pull/39) Azure extension handler issue
* [azure-chef-extension #40](https://github.com/chef-partners/azure-chef-extension/pull/40) Fixed issue related to preserve runlist if first chef client run fails
* [azure-chef-extension #41](https://github.com/chef-partners/azure-chef-extension/pull/41) Functional testcase for disable command
* [azure-chef-extension #42](https://github.com/chef-partners/azure-chef-extension/pull/42) Implemented node verify cert bootstrap option
* [azure-chef-extension #46](https://github.com/chef-partners/azure-chef-extension/pull/46) Azure extension failing with timeout error
* [azure-chef-extension #43](https://github.com/chef-partners/azure-chef-extension/pull/43) Added support for validator less bootstrap
* [azure-chef-extension #48](https://github.com/chef-partners/azure-chef-extension/pull/48) Enable cmd fails when chef-client service is not already installed
* [azure-chef-extension #49](https://github.com/chef-partners/azure-chef-extension/pull/49) Fixed empty client_key/validation_key issue

## Release: 1207.12.3.0 (2015/05/15)
* [azure-chef-extension #36](https://github.com/chef-partners/azure-chef-extension/pull/36) Fixed escape runlist related issue
* [azure-chef-extension #31](https://github.com/chef-partners/azure-chef-extension/pull/31) Load azure attributes in hints file for ohai azure plugin

## Release: 1206.12.3.0 (2015/05/12)
* [azure-chef-extension #34](https://github.com/chef-partners/azure-chef-extension/pull/34) Fixed update extension process related issues
* [azure-chef-extension #33](https://github.com/chef-partners/azure-chef-extension/pull/33) Removed chef-client run with run_list part
* [azure-chef-extension #29](https://github.com/chef-partners/azure-chef-extension/pull/29) Updated README doc
* [azure-chef-extension #28](https://github.com/chef-partners/azure-chef-extension/pull/28) Implemented changes to append extension generated config to client_rb
* [azure-chef-extension #24](https://github.com/chef-partners/azure-chef-extension/pull/24) Fixed Azure chef extension uninstall should not delete c:\chef or /etc/chef by default
* [azure-chef-extension #22](https://github.com/chef-partners/azure-chef-extension/pull/22) Implemented changes to preserve runlist if first converge fails
* [azure-chef-extension #16](https://github.com/chef-partners/azure-chef-extension/pull/16) Testcases for azure-chef-extension
* [azure-chef-extension #23](https://github.com/chef-partners/azure-chef-extension/pull/23) Added log_level attribute and set it to info for detailed log
* [azure-chef-extension #21](https://github.com/chef-partners/azure-chef-extension/pull/21) Fix for providing multiple runlist item
* [azure-chef-extension #19](https://github.com/chef-partners/azure-chef-extension/pull/19) Updated Readme for using JSON object to pass options

## Previous  Release: 1205.12.2.1 (2014/04/01)

**See source control commit history for earlier changes.**


text:
/**
 * Generic field check function. Use checkFunction to validate
 * field whose id is id content.
 *
 * If checkFunction returns true, field parentNode class is set
 * to 'validField' else it's set to 'invalidField'.
 *
 * Beware that it is *parentNode* class which is set. It allow
 * style to use a ':after' pseudo-class even if it's an input
 * field. Enclose field in a span to hava something easy to manage.
 *
 * @param id string Id of the field to check.
 * @param checkFunction function(value). Function which returns
 *        true if value is considered as correct, false else.
 * @param extra any An optional extra parameter to pass to checkFunction.
 */

function check(id, checkFunction, extra) {
    if(! checkFunction($F(id), extra)) {
        $(id).parentNode.setAttribute('class', 'invalidField');
    } else {
        $(id).parentNode.setAttribute('class', 'validField');
    }
    // Avoid strange bug in firefox
    $(id).focus();
}

/*
 * Function to pass to 'check' to ensure that the field contains
 * a valid identifier (lower case letters and numbers, minimum
 * 3 letters, max can be defined through the extra argument of
 * check).
 * @param value string Value to check.
 * @param max integer Optional max length for the value.
 * @return true if the value is correct, false else.
 */
function validIdentifier(value, max) {
    var r = new RegExp('^[a-z0-9]{3,' + max + '}$');
    return r.test(value);
}

/**
 * Function to pass to 'check' to ensure that the field contains
 * a valid email address (the regex could be improved).
 * @param value string Value to check.
 */
function validEmail(value) {
    return /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,10})$/.test(value);
}

/**
 * Function to check that a string is harmless (no tag
 * injection).
 * @param value string Value to check.
 */
function validString(value) {
    return /^[^<>"]+$/.test(value);
}

/**
 * Function to pass to 'check' to validate Zip code
 */
function validZip(value) {
    return /^[\w\d\s\-]+$/.test(value);
}

function decode_mail(crypted) {
    var clear = '';
    for(var i = 0 ; i < crypted.length ; ++i) {
        clear += String.fromCharCode(crypted.charCodeAt(i) - 1);
    }
    return clear;
}

/**
 * Toggles visibility of element whose id is id.
 * @param id string Id of element to toggle.
 */
function toggle(id) {
    var el = $(id);
    if(!el) return;
    if(el.style.display == 'none') {
        el.style.display = '';
    } else {
        el.style.display = 'none';
    }
}


text:
using UnityEngine;
using System.Collections;

public class TriggerZone : MonoBehaviour {
	public AudioClip lockedSound;
	public Light doorLight;
	public GUIText textHints;
	// Use this for initialization
	void Start () {

	}

	// Update is called once per frame
	void Update () {

	}
	void OnTriggerEnter(Collider col){
		if(col.gameObject.tag == "First Person Controller"){
			if(Inventory.charge == 4){
				transform.FindChild("door").SendMessage("DoorCheck");
				if(GameObject.Find("PowerGUI")){
					Destroy(GameObject.Find("PowerGUI"));
					doorLight.color = Color.green;
				}
			}else if(Inventory.charge > 0 && Inventory.charge < 4){
				textHints.SendMessage("ShowHint",
			"This door won't budge..guess it needs fully charging- maybe more power cells will help...");
				transform.FindChild("door").audio.PlayOneShot(lockedSound);
			}else{
				transform.FindChild("door").audio.PlayOneShot(lockedSound);
				col.gameObject.SendMessage("HUDon");
				textHints.SendMessage("ShowHint", "This door seems locked.. maybe that generator needs power...\nDesign by Liuzixing");
			}
		}
	}
}


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

namespace Thunder.Web.Mvc.Extensions
{
    /// <summary>
    ///     ModelState Dictionary Extensions
    /// </summary>
    public static class ModelStateDictionaryExtensions
    {
        /// <summary>
        ///     Convert <see cref="ModelStateDictionary" /> to list of key and value
        /// </summary>
        /// <param name="source"></param>
        /// <returns></returns>
        public static IEnumerable<KeyValuePair<string, IList<string>>> ToKeyAndValues(this ModelStateDictionary source)
        {
            return (from key in source.Keys
                where source[key].Errors.Any()
                select
                    new KeyValuePair<string, IList<string>>(key, source[key].Errors.Select(error => error.ErrorMessage)
                        .ToList()));
        }

        /// <summary>
        ///     Convert dictionary <see cref="ModelState" /> to list of key and value
        /// </summary>
        /// <param name="source"></param>
        /// <returns></returns>
        public static IEnumerable<KeyValuePair<string, IList<string>>> ToKeyAndValues(this IDictionary<string, ModelState> source)
        {
            return (from key in source.Keys
                    where source[key].Errors.Any()
                    select
                        new KeyValuePair<string, IList<string>>(key, source[key].Errors.Select(error => error.ErrorMessage)
                            .ToList()));
        }

        /// <summary>
        /// Exclude properties with key part in validation of model state
        /// </summary>
        /// <param name="source"><see cref="ModelStateDictionary"/></param>
        /// <param name="keyPart">Key part in validation of model state</param>
        /// <param name="ignoreKeys">Ignore keys</param>
        public static void ExcludePropertiesWithKeyPart(this ModelStateDictionary source, string keyPart, string[] ignoreKeys)
        {
            if (source.IsValid) return;

            foreach (var item in source.ToList().Where(item =>
                item.Key.ToLower().IndexOf(keyPart.ToLower(), StringComparison.InvariantCulture) != -1
                && (ignoreKeys != null && !ignoreKeys.Contains(item.Key))))
            {
                source.Remove(item);
            }
        }

        /// <summary>
        /// Add model error with format
        /// </summary>
        /// <param name="source"><see cref="ModelStateDictionary"/></param>
        /// <param name="key">Key</param>
        /// <param name="errorMessage">Error message</param>
        /// <param name="args">Replace de format parameters</param>
        public static void AddModelErrorFormat(this ModelStateDictionary source, string key, string errorMessage, params object[] args)
        {
            source.AddModelError(key, string.Format(errorMessage, args));
        }

        /// <summary>
        /// Cast for list of string
        /// </summary>
        /// <param name="source"><see cref="ModelStateDictionary"/></param>
        /// <returns>List of string</returns>
        public static IList<string> ToListOfString(this ModelStateDictionary source)
        {
            return (from key in source.Keys where source[key].Errors.Any() from error in source[key].Errors select error.ErrorMessage).ToList();
        }
    }
}


text:
<?php

/** Zend_Server_Cache */
#require_once 'Zend/Server/Cache.php';

/**
 * Zend_XmlRpc_Server_Cache: cache Zend_XmlRpc_Server server definition
 *
 * @category   Zend
 * @package    Zend_XmlRpc
 * @subpackage Server
 * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Zend_XmlRpc_Server_Cache extends Zend_Server_Cache
{
    /**
     * @var array Skip system methods when caching XML-RPC server
     */
    protected static $_skipMethods = array(
        'system.listMethods',
        'system.methodHelp',
        'system.methodSignature',
        'system.multicall',
    );
}


text:
package com.github.jcustenborder.vertica.binary;

import java.util.Date;

class TimestampUtilDateEncoder extends UTCTimestampEncoder<Date> {
  @Override
  public Class<Date> inputType() {
    return Date.class;
  }

  @Override
  protected long utcTime(Date input) {
    return input.getTime();
  }
}


text:
package com.example.mindrate.gson;

/**
 *

 *
Project: MindRate

 *
Package: com.example.mindrate.gson

 *
Author: Ecko Tan

 *
E-mail: eckotan@icloud.com

 *
Created at 2017/3/21:23:15

 *

 */

public class Time {
//==============getter and setter=====================
    public String getYear() {
        return year;
    }

    public void setYear(String year) {
        this.year = year;
    }

    public String getMonth() {
        return month;
    }

    public void setMonth(String month) {
        this.month = month;
    }

    public String getDay() {
        return day;
    }

    public void setDay(String day) {
        this.day = day;
    }

    public String getHour() {
        return hour;
    }

    public void setHour(String hour) {
        this.hour = hour;
    }

    public String getMinute() {
        return minute;
    }

    public void setMinute(String minute) {
        this.minute = minute;
    }

    public String getSecond() {
        return second;
    }

    public void setSecond(String second) {
        this.second = second;
    }

    private String year;
    private String month;
    private String day;
    private String hour;
    private String minute;
    private String second;

    public Time(String year, String month, String day, String hour, String minute, String second) {
        this.year = year;
        this.month = month;
        this.day = day;
        this.hour = hour;
        this.minute = minute;
        this.second = second;
    }

}


text:
<?php
/*
 * This file is part of Sulu.
 *
 * (c) MASSIVE ART WebServices GmbH
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace Sulu\Component\Content\Repository;

use Hateoas\Configuration\Annotation\Embedded;
use Hateoas\Configuration\Annotation\Relation;
use Hateoas\Configuration\Annotation\Route;
use Jackalope\Query\Row;
use JMS\Serializer\Annotation\ExclusionPolicy;
use JMS\Serializer\Annotation\Expose;
use Sulu\Component\Content\Compat\StructureType;
use Sulu\Exception\FeatureNotImplementedException;

/**
 * Container class for content data.
 *
 * @ExclusionPolicy("all")
 * @Relation(
 *      "children",
 *      href = @Route(
 *          "get_nodes",
 *          parameters = {"parent" = "expr(object.getId())", "language" = "expr(object.getLocale())", "webspace" = "expr(object.getWebspaceKey())", "fields" = "expr(object.getMapping())"}
 *      )
 * )
 * @Relation(
 *      "nodes",
 *      embedded = @Embedded("expr(object.getChildren())")
 * )
 */
class Content implements \ArrayAccess
{
    /**
     * @var string
     */
    private $locale;

    /**
     * @var string
     */
    private $webspaceKey;

    /**
     * @var string
     *
     * @Expose
     */
    private $id;

    /**
     * @var string
     *
     * @Expose
     */
    private $path;

    /**
     * @var int
     */
    private $workflowStage;

    /**
     * @var int
     */
    private $nodeType;

    /**
     * @var bool
     *
     * @Expose
     */
    private $hasChildren;

    /**
     * @var Content[]
     */
    private $children = [];

    /**
     * @var array
     */
    private $data;

    /**
     * @var array
     */
    private $permissions;

    /**
     * @var StructureType
     */
    private $localizationType;

    /**
     * @var string
     */
    private $url;

    /**
     * @var string[]
     */
    private $urls;

    /**
     * @var string[]
     *
     * @Expose
     */
    private $concreteLanguages;

    /**
     * @var Row
     */
    private $row;

    public function __construct(
        $locale,
        $webspaceKey,
        $id,
        $path,
        $workflowStage,
        $nodeType,
        $hasChildren,
        array $data,
        array $permissions,
        StructureType $localizationType = null
    ) {
        $this->id = $id;
        $this->path = $path;
        $this->workflowStage = $workflowStage;
        $this->nodeType = $nodeType;
        $this->hasChildren = $hasChildren;
        $this->data = $data;
        $this->permissions = $permissions;
        $this->localizationType = $localizationType;
        $this->locale = $locale;
        $this->webspaceKey = $webspaceKey;
    }

    /**
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @return string
     */
    public function getPath()
    {
        return $this->path;
    }

    /**
     * @return array
     */
    public function getData()
    {
        return $this->data;
    }

    /**
     * @param string $propertyName
     * @param mixed $value
     */
    public function setDataProperty($propertyName, $value)
    {
        $this->data[$propertyName] = $value;
    }

    /**
     * @return int
     */
    public function getWorkflowStage()
    {
        return $this->workflowStage;
    }

    /**
     * @return int
     */
    public function getNodeType()
    {
        return $this->nodeType;
    }

    /**
     * @return array
     */
    public function getPermissions()
    {
        return $this->permissions;
    }

    /**
     * @return bool
     */
    public function hasChildren()
    {
        return $this->hasChildren;
    }

    /**
     * @return StructureType
     */
    public function getLocalizationType()
    {
        return $this->localizationType;
    }

    /**
     * @return string
     */
    public function getLocale()
    {
        return $this->locale;
    }

    /**
     * @return string
     */
    public function getWebspaceKey()
    {
        return $this->webspaceKey;
    }

    /**
     * @param Content[] $children
     */
    public function setChildren($children)
    {
        $this->children = $children;
    }

    /**
     * @return Content[]
     */
    public function getChildren()
    {
        return $this->children;
    }

    /**
     * @return Row
     */
    public function getRow()
    {
        return $this->row;
    }

    /**
     * @param Row $row
     */
    public function setRow(Row $row)
    {
        $this->row = $row;
    }

    /**
     * @return string[]
     */
    public function getMapping()
    {
        return implode(',', array_keys($this->data));
    }

    /**
     * @return \string[]
     */
    public function getUrls()
    {
        return $this->urls;
    }

    /**
     * @param \string[] $urls
     */
    public function setUrls(array $urls)
    {
        $this->urls = $urls;
    }

    /**
     * @return string
     */
    public function getUrl()
    {
        return $this->url;
    }

    /**
     * @param string $url
     */
    public function setUrl($url)
    {
        $this->url = $url;
    }

    /**
     * @return \string[]
     */
    public function getConcreteLanguages()
    {
        return $this->concreteLanguages;
    }

    /**
     * @param \string[] $concreteLanguages
     */
    public function setConcreteLanguages($concreteLanguages)
    {
        $this->concreteLanguages = $concreteLanguages;
    }

    /**
     * {@inheritdoc}
     */
    public function offsetExists($offset)
    {
        return array_key_exists($offset, $this->data);
    }

    /**
     * {@inheritdoc}
     */
    public function offsetGet($offset)
    {
        return $this->data[$offset];
    }

    /**
     * {@inheritdoc}
     */
    public function offsetSet($offset, $value)
    {
        throw new FeatureNotImplementedException();
    }

    /**
     * {@inheritdoc}
     */
    public function offsetUnset($offset)
    {
        throw new FeatureNotImplementedException();
    }
}


text:
    {{applicationService.getUser().name}}

{{'menu.account-settings'|translate}}

{{'menu.logout'|translate}}

     {{'menu.register'|translate}}

     {{'menu.login'|translate}}


text:
    This example shows the client-side events supported by Telerik Chart for ASP.NET MVC.

    You can attach an event handler using either of these options:

        Specifiy the JavaScript event handler name:

Html.Telerik().Chart(Model)
    .Name("chart")
    .Series(series => {
        series.Bar(s => s.RepSales).Name("Representative Sales");
        series.Bar(s => s.TotalSales).Name("Total Sales");
    })
    .ClientEvents(events => events
        .OnLoad("onLoad")
    )

        Declare the event handler inline (WebForms syntax):

<%= Html.Telerik().Chart(Model)
    .Name("chart")
    .Series(series => {
        series.Bar(s => s.RepSales).Name("Representative Sales");
        series.Bar(s => s.TotalSales).Name("Total Sales");
    })
    .ClientEvents(events => events
       .OnLoad(() =>
       {
        %>
         function(e) {
             // Perform required actions here.
         }
        <%
       }
    )
%>

        Declare the event handler inline (Razor syntax):

@(Html.Telerik().Chart(Model)
    .Name("chart")
    .Series(series => {
        series.Bar(s => s.RepSales).Name("Representative Sales");
        series.Bar(s => s.TotalSales).Name("Total Sales");
    })
    .ClientEvents(events => events
        .OnLoad(
        @<text>
            function(e) {
                // Perform required actions here.
            }
        </text>)
    )
)

    The chart has the following events:

        OnLoad - raised when the component is initialized.

        OnDataBinding (cancellable) - raised when the chart is requesting data via Ajax binding.

        OnDataBound - raised when the component has received data via Ajax binding
                               and is about to render it.

        OnSeriesClick - raised when the user clicks a data series point.


text:
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>Profile</title>

    <!-- Bootstrap -->
    <link href="<?php echo public_url('user')?>/css/bootstrap.min.css" rel="stylesheet">
    <link href="<?php echo public_url('user')?>/css/profile.css" rel="stylesheet">


text:
using System.Text.Json;
using Azure.Core;

namespace Azure.ResourceManager.Resources.Models
{
    public partial class DeploymentOperation
    {
        internal static DeploymentOperation DeserializeDeploymentOperation(JsonElement element)
        {
            string id = default;
            string operationId = default;
            DeploymentOperationProperties properties = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("operationId"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    operationId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    properties = DeploymentOperationProperties.DeserializeDeploymentOperationProperties(property.Value);
                    continue;
                }
            }
            return new DeploymentOperation(id, operationId, properties);
        }
    }
}


text:
<?php

namespace Area4\CampeonatoBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Area4\UsuarioBundle\Entity\Usuario as Usuario;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * Area4\CampeonatoBundle\Entity\Jugador
 *
 * @ORM\Table(name="Jugador")
 * @ORM\Entity(repositoryClass="Area4\CampeonatoBundle\Entity\JugadorRepository")
 * @ORM\HasLifecycleCallbacks()
 */
class Jugador
{

    /**
     * @var integer $dni
     *
     * @ORM\Column(name="dni", type="integer", nullable=false)
     * @ORM\Id
     * @ ORM\GeneratedValue(strategy="IDENTITY")
     * @Assert\NotBlank()
     */
    private $dni;

    /**
     * @var string $nombre
     *
     * @ORM\Column(name="nombre", type="string", length=45, nullable=false)
     * @Assert\NotBlank()
     */
    private $nombre;

    /**
     * @var string $apellido
     *
     * @ORM\Column(name="apellido", type="string", length=45, nullable=false)
     * @Assert\NotBlank()
     */
    private $apellido;

    /**
     * @var Equipo
     *
     * @ORM\ManyToOne(targetEntity="Equipo", inversedBy="Jugador")
     * @ORM\JoinColumn(name="Equipo_id", referencedColumnName="id")
     * @Assert\NotBlank()
     * @Assert\Type(type="Area4\CampeonatoBundle\Entity\Equipo")
     */
    private $equipo;

    /**
     *
     * @ORM\OneToOne(targetEntity="Area4\UsuarioBundle\Entity\Usuario")
     * @ORM\JoinColumn(name="usuario_id", referencedColumnName="id")
     * @Assert\NotBlank()
     * @Assert\Type(type="Area4\UsuarioBundle\Entity\Usuario")
     * @var Usuario
     **/
    private $usuario;
    /**
     * @ORM\Column(name="fecha_nacimiento", type="date", nullable=false)
     * @Assert\NotBlank()
     * @var date
     **/
    private $fechadeNacimiento;
    /**
     * Slug : concatena - nombre + apellido + dni
     * @ORM\Column(name="slug", type="string", length="255", nullable=false)
     * @var string
     **/
    private $slug;
    /**
     * @ ORM\Column(name="foto", type="string", length="255", nullable=true)
     **/
    private $foto;
    /**
     * Set dni
     *
     * @param integer $dni
     */
    public function setDni($dni)
    {
        $this->dni = str_replace(".", "", $dni);
    }

    /**
     * Get dni
     *
     * @return integer
     */
    public function getDni()
    {
        return $this->dni;
    }

    /**
     * Set nombre
     *
     * @param string $nombre
     */
    public function setNombre($nombre)
    {
        $this->nombre = strtoupper($nombre);
    }

    /**
     * Get nombre
     *
     * @return string
     */
    public function getNombre()
    {
        return $this->nombre;
    }

    /**
     * Set apellido
     *
     * @param string $apellido
     */
    public function setApellido($apellido)
    {
        $this->apellido = strtoupper($apellido);
    }

    /**
     * Get apellido
     *
     * @return string
     */
    public function getApellido()
    {
        return $this->apellido;
    }

    /**
     * Set equipo
     *
     * @param Area4\CampeonatoBundle\Entity\Equipo $equipo
     */
    public function setEquipo(\Area4\CampeonatoBundle\Entity\Equipo $equipo)
    {
        $this->equipo = $equipo;
    }

    /**
     * Get equipo
     *
     * @return Area4\CampeonatoBundle\Entity\Equipo
     */
    public function getEquipo()
    {
        return $this->equipo;
    }

    /**
     * Set usuario
     *
     * @param Area4\UsuarioBundle\Entity\Usuario $usuario
     */
    public function setUsuario(\Area4\UsuarioBundle\Entity\Usuario $usuario)
    {
        $this->usuario = $usuario;
    }

    /**
     * Get usuario
     *
     * @return Area4\UsuarioBundle\Entity\Usuario
     */
    public function getUsuario()
    {
        return $this->usuario;
    }

    /**
     * toString
     *
     * @return string
     *
     **/
    public function __toString()
    {
        return sprintf("%d - %s, %s", $this->dni, $this->apellido, $this->nombre);
    }

    /**
     * Set fechadeNacimiento
     *
     * @param date $fechadeNacimiento
     */
    public function setFechadeNacimiento($fechadeNacimiento)
    {
        $this->fechadeNacimiento = $fechadeNacimiento;
    }

    /**
     * Get fechadeNacimiento
     *
     * @return date
     */
    public function getFechadeNacimiento()
    {
        return $this->fechadeNacimiento;
    }

    /**
     * Concatena el nombre con el apellido
     *
     * @return string
     **/
    public function getNombreCompleto()
    {
        return (string) sprintf('%s, %s',$this->apellido,$this->nombre);
    }

    /**
     * Revisa si el jugador ya pertenece a un equipo
     *
     * @return true : si pertenece ya a un equipo.
     * @return false: si no pertenece a ningun equipo.
     * @author ezekielriva
     **/
    public function hasEquipo()
    {
        if (is_null($this->equipo))
            return false;
        else
            return true;
    }

    /**
     * Determina si este jugador es capitán
     *
     * @return true : si es capitán
     *         false: si no es capitán
     * @author ezekielriva
     **/
    public function isCapitan()
    {
        return $this->usuario->hasRole('ROLE_CAP');
    }

    /**
     * Uso para template
     *
     * @return string
     * @author ezekiel
     **/
    public function getCapitanString()
    {
        if ($this->isCapitan())
            return "[CAPITAN]";
    }

    /**
     * Realiza antes de crear
     * @ORM\PrePersist()
     */
    public function prePersist(){
        $this->slug = $this->generateSlug();
    }

    /**
     * @ORM\PreUpdate()
     */
    public function preUpdate(){
        $this->slug = $this->generateSlug();
    }

    /**
     * Genera el slug
     *
     * @return string
     * @author ezekiel
     **/
    private function generateSlug()
    {
        return (string) sprintf("%d - %s, %s", $this->dni, $this->apellido, $this->nombre);
    }

    /**
     * Retorna una versíon mas amigable del nombre
     *
     * @return string
     * @author ezekiel
     **/
    public function friendlyName()
    {
        return (string) sprintf("%s %s", $this->nombre, $this->apellido);
    }
}


text:
<record id="movement" in-findedit="yes" type="record,procedure">
                <services-url>movements</services-url>
                <web-url>movement</web-url>
                <tab-url>movement-tab</tab-url>
                <services-tenant-singular>Movement</services-tenant-singular>
                <services-list-path>abstract-common-list/list-item</services-list-path>
                <services-record-path>movements_common:http://collectionspace.org/services/movement,movements_common</services-record-path>
                <services-record-path id="collectionspace_core">collectionspace_core:http://collectionspace.org/collectionspace_core/,collectionspace_core</services-record-path>
                <hassoftdelete>true</hassoftdelete>
                <structures>
                    <structure id="search">
                        <view>

                        </view>
                    </structure>
                    <structure id="screen">
                        <view>

                        </view>
                    </structure>
                    <structure id="tab">
                        <view>
                            <titlebar show="false"></titlebar>
                            <sidebar show="false"></sidebar>
                            <edit-section id="details" show="true"></edit-section>
                            <list-section id="list" show="false"></list-section>

                        </view>
                        <repeat id="list" asSibling="true">
                            <selector>recordList-row:</selector>
                            <field id="summary" ui-type="list">
                                <selector>related-summary</selector>
                            </field>
                            <field id="number" ui-type="list">
                                <selector>related-number</selector>
                            </field>
                        </repeat>
                    </structure>
                </structures>

				<include src="domain-procedure-movement.xml" strip-root="yes"/>

                <row-selector>.csc-recordList-row:</row-selector>

                    <field id="tenantID" section="collectionspace_core" attributes="GET"></field>
                    <field id="createdAt" section="collectionspace_core" attributes="GET"></field>
                    <field id="createdBy" section="collectionspace_core" attributes="GET"></field>
                    <field id="updatedBy" ui-search="repeatable" section="collectionspace_core" attributes="GET"></field>
                    <field id="updatedAt" ui-search="range" ui-type="date" section="collectionspace_core" attributes="GET" mini="search,list,relate"></field>

                    <field id="currentLocation" ui-search="repeatable" in-title="yes" mini="summary,search,list,relate,terms" autocomplete="location-location">
                        <title-selector>titleBar-currentLocation</title-selector>
                    </field>
                    <field id="currentLocationFitness">
                        <options>
                            <option id="" default="yes">Please select a value</option>
                            <option id="dangerous">Dangerous</option>
                            <option id="suitable">Suitable</option>
                            <option id="temporary">Temporary</option>
                            <option id="unsuitable">Unsuitable</option>
                        </options>
                    </field>
                    <field id="currentLocationNote"></field>
                    <field id="locationDate" ui-search="range" in-title="yes" ui-type="date">
                        <selector>movement-locationDate</selector>
                    </field>
                    <field id="normalLocation" ui-search="repeatable" autocomplete="location-location"></field>

                    <field id="movementReferenceNumber" ui-search="repeatable" chooser="yes" in-title="no" mini="number,search,list,relate,terms" seperate_ui_container="true">
                        <options>
                            <option id="inventory" sample="INV2010.1">Inventory</option>
                            <option id="location" sample="LOC2010.1">Location</option>
                            <option id="movement" sample="MV2010.1">Movement</option>
                        </options>
                    </field>
                    <field id="plannedRemovalDate" ui-search="range" ui-type="date"></field>
                    <field id="removalDate" ui-search="range" ui-type="date">
                        <selector>movement-removalDate</selector>
                    </field>
                    <field id="reasonForMove" ui-search="repeatable">
                        <options>
                            <option id="" default="yes">Please select a value</option>
                            <option id="conservation">Conservation</option>
                            <option id="exhibition">Exhibition</option>
                            <option id="inventory">Inventory</option>
                            <option id="loan">Loan</option>
                            <option id="newstoragelocation">New Storage Location</option>
                            <option id="photography">Photography</option>
                            <option id="research">Research</option>
                        </options>
                    </field>
                    <field id="movementContact" ui-search="repeatable" autocomplete="person-person"></field>
                    <repeat id="movementMethods">
                        <field id="movementMethod" ui-search="repeatable">
                            <selector>movement-movementMethods</selector>
                            <options>
                                <option id="" default="yes">Please select a value</option>
                                <option id="forklift">Forklift</option>
                                <option id="handcarried">Handcarried</option>
                                <option id="trolley">Trolley</option>
                            </options>
                        </field>
                    </repeat>
                    <field id="movementNote"></field>

            </record>


text:
#ifndef IDBTransactionBackendInterface_h
#define IDBTransactionBackendInterface_h

#include "IDBCallbacks.h"
#include <wtf/Threading.h>
#include <wtf/text/WTFString.h>

#if ENABLE(INDEXED_DATABASE)

namespace WebCore {

class IDBCursorBackendImpl;
class IDBObjectStoreBackendInterface;
class IDBTransactionCallbacks;

typedef int ExceptionCode;

// This class is shared by IDBTransaction (async) and IDBTransactionSync (sync).
// This is implemented by IDBTransactionBackendImpl and optionally others (in order to proxy
// calls across process barriers). All calls to these classes should be non-blocking and
// trigger work on a background thread if necessary.
class IDBTransactionBackendInterface : public ThreadSafeRefCounted<IDBTransactionBackendInterface> {
public:
    virtual ~IDBTransactionBackendInterface() { }

    enum TaskType {
        NormalTask = 0,
        PreemptiveTask
    };

    virtual PassRefPtr<IDBObjectStoreBackendInterface> objectStore(int64_t, ExceptionCode&) = 0;
    virtual void didCompleteTaskEvents() = 0;
    virtual void commit() = 0;
    virtual void abort() = 0;
    virtual void setCallbacks(IDBTransactionCallbacks*) = 0;
};

} // namespace WebCore

#endif

#endif // IDBTransactionBackendInterface_h


text:
//-----------------------------------NOTICE----------------------------------//
// Some of this file is automatically filled in by a Python script.  Only    //
// add custom code in the designated areas or it will be overwritten during  //
// the next update.                                                          //
//-----------------------------------NOTICE----------------------------------//

#ifndef _NIBSPLINEDATA_H_
#define _NIBSPLINEDATA_H_

//--BEGIN FILE HEAD CUSTOM CODE--//
//--END CUSTOM CODE--//

#include "NiObject.h"
namespace Niflib
{
	class NiBSplineData;
	typedef Ref<NiBSplineData> NiBSplineDataRef;

	/*! B-spline data points as floats, or as shorts for compressed B-splines. */
	class NiBSplineData : public NiObject
	{
	public:
		/*! Constructor */
		NIFLIB_API NiBSplineData();

		/*! Destructor */
		NIFLIB_API virtual ~NiBSplineData();

		/*!
		 * A constant value which uniquly identifies objects of this type.
		 */
		NIFLIB_API static const Type TYPE;

		/*!
		 * A factory function used during file reading to create an instance of this type of object.
		 * \return A pointer to a newly allocated instance of this type of object.
		 */
		NIFLIB_API static NiObject * Create();

		/*!
		 * Summarizes the information contained in this object in English.
		 * \param[in] verbose Determines whether or not detailed information about large areas of data will be printed out.
		 * \return A string containing a summary of the information within the object in English.  This is the function that Niflyze calls to generate its analysis, so the output is the same.
		 */
		NIFLIB_API virtual string asString(bool verbose = false) const;

		/*!
		 * Used to determine the type of a particular instance of this object.
		 * \return The type constant for the actual type of the object.
		 */
		NIFLIB_API virtual const Type & GetType() const;

		/***Begin Example Naive Implementation****

		// Float values representing the control data.
		// \return The current value.
		vector<float > GetFloatControlPoints() const;

		// Float values representing the control data.
		// \param[in] value The new value.
		void SetFloatControlPoints( const vector<float >& value );

		// Signed shorts representing the data from 0 to 1 (scaled by SHRT_MAX).
		// \return The current value.
		vector<short > GetShortControlPoints() const;

		// Signed shorts representing the data from 0 to 1 (scaled by SHRT_MAX).
		// \param[in] value The new value.
		void SetShortControlPoints( const vector<short >& value );

		****End Example Naive Implementation***/

		//--BEGIN MISC CUSTOM CODE--//

		/*!
		 * Get floats representing the spline data.
		 * \return The spline data.
		 */
		NIFLIB_API vector<float> GetFloatControlPoints() const;

		/*!
		 * Get Range of signed shorts representing the data scaled by SHRT_MAX.
		 * \param[in] offset The start of the range.
		 * \param[in] count The number of control points to get.
		 * \return The control points that fall within the specified range.
		 */
		NIFLIB_API vector<float> GetFloatControlPointRange(int offset, int count) const;

		/*!
		 * Get Signed shorts representing the spline data scaled by SHRT_MAX.
		 * \return The spline data.
		 */
		NIFLIB_API vector<short> GetShortControlPoints() const;

		/*!
		 * Get Range of signed shorts representing the data scaled by SHRT_MAX.
		 * \param[in] offset The start of the range.
		 * \param[in] count The number of control points to get.
		 * \return The control points that fall within the specified range.
		 */
		NIFLIB_API vector<short> GetShortControlPointRange(int offset, int count) const;

		//--END CUSTOM CODE--//
	protected:
		/*! Number of Float Data Points */
		mutable unsigned int numFloatControlPoints;
		/*! Float values representing the control data. */
		vector<float > floatControlPoints;
		/*! Number of Short Data Points */
		mutable unsigned int numShortControlPoints;
		/*! Signed shorts representing the data from 0 to 1 (scaled by SHRT_MAX). */
		vector<short > shortControlPoints;
	public:
		/*! NIFLIB_HIDDEN function.  For internal use only. */
		NIFLIB_HIDDEN virtual void Read(istream& in, list<unsigned int> & link_stack, const NifInfo & info);
		/*! NIFLIB_HIDDEN function.  For internal use only. */
		NIFLIB_HIDDEN virtual void Write(ostream& out, const map<NiObjectRef, unsigned int> & link_map, list<NiObject *> & missing_link_stack, const NifInfo & info) const;
		/*! NIFLIB_HIDDEN function.  For internal use only. */
		NIFLIB_HIDDEN virtual void FixLinks(const map<unsigned int, NiObjectRef> & objects, list<unsigned int> & link_stack, list<NiObjectRef> & missing_link_stack, const NifInfo & info);
		/*! NIFLIB_HIDDEN function.  For internal use only. */
		NIFLIB_HIDDEN virtual list<NiObjectRef> GetRefs() const;
		/*! NIFLIB_HIDDEN function.  For internal use only. */
		NIFLIB_HIDDEN virtual list<NiObject *> GetPtrs() const;
	};

	//--BEGIN FILE FOOT CUSTOM CODE--//
	//--END CUSTOM CODE--//
} //End Niflib namespace
#endif


text:
// Include React as a dependency
import React, { PropTypes as T } from 'react'

// Include our helpers for API calls
// var helpers = require("../../../../utils/helpers");

// Results Component Declaration
class Results extends React.Component {

  // Here we will save states for the contents we save
  constructor(props) {
    super(props)
    this.state =  {

    };
  }

  // This code handles the sending of the search terms to the parent Search component
  // handleClick() {
  //   console.log("CLICKED");
  //   console.log(item);

  //   // helpers.postSaved(item.headline.main, item.pub_date, item.web_url).then(function() {
  //   //   console.log(item.web_url);
  //   // });
  // }

  // A helper method for mapping through our articles and outputting some HTML
  /*renderArticles() {

    return this.props.results.map(function(job, index) {

      // Each article thus reperesents a list group item with a known index
      return (

                {article.headline.main}

                  <button className="btn btn-default ">View Article</button>

                {/*
                  By using an arrow function callback to wrap this.handleClick,
                  we can pass in an article as an argument
                }
  //               <button className="btn btn-primary" onClick={() => this.handleClick(article)}>Save</button>
  //
  //

  //
Date Published: {article.pub_date}

  //

  //

  //     );

  //   }.bind(this));

  // }*/

  // // A helper method for rendering a container to hold all of our articles
  renderContainer() {
    let jobResults = this.props.results;
    return Object.keys(jobResults).map(function(keyName, index){
      console.log(jobResults[keyName])
      let job = jobResults[keyName];

     var snippet = job.snippet;
    snippet=snippet.replace(/<[a-zA-Z\/][^>]*>/g, '');
    console.log(snippet);

    return (

                       {job.jobtitle} - {job.company} - {job.formattedLocation}  - {job.formattedRelativeTime}

{snippet}

                          Applied

                          Apply Later

                          Apply Now

               )
              }.bind(this));

  }

  render() {
    // If we have no articles, render this HTML
    if (!this.props.results) {
      return (

Job Results

              Enter search terms to begin...

      );
    }
    // If we have articles, return this.renderContainer() which in turn, returns all the articles
    return (

Job Results

                {this.renderContainer()}

    )
}
};

// Export the module back to the route
module.exports = Results;


text:
LastGenre Plugin
================

The MusicBrainz database `does not contain genre information`_. Therefore, when
importing and autotagging music, beets does not assign a genre.  The
``lastgenre`` plugin fetches *tags* from `Last.fm`_ and assigns them as genres
to your albums and items. The plugin is included with beets as of version
1.0b11.

.. _does not contain genre information:
    http://musicbrainz.org/doc/General_FAQ#Why_does_MusicBrainz_not_support_genre_information.3F
.. _Last.fm: http://last.fm/

The plugin requires `pylast`_, which you can install using `pip`_ by typing::

    pip install pylast

After you have pylast installed, enable the plugin by putting ``lastgenre`` on
your ``plugins`` line in :doc:`config file </reference/config>`.

The plugin chooses genres based on a *whitelist*, meaning that only certain
tags can be considered genres. This way, tags like "my favorite music" or "seen
live" won't be considered genres. The plugin ships with a fairly extensive
internal whitelist, but you can set your own in the config file using the
``whitelist`` configuration value::

    lastgenre:
        whitelist: /path/to/genres.txt

The genre list file should contain one genre per line. Blank lines are ignored.
For the curious, the default genre list is generated by a `script that scrapes
Wikipedia`_.

.. _pip: http://www.pip-installer.org/
.. _pylast: http://code.google.com/p/pylast/
.. _script that scrapes Wikipedia: https://gist.github.com/1241307

If no genre is found, the file will be left unchanged. To instead specify a
fallback genre, use the ``fallback`` configuration option. You can, of
course, use the empty string as a fallback, like so::

    lastgenre:
        fallback: ''

Canonicalization
----------------

The plugin can also *canonicalize* genres, meaning that more obscure genres can
be turned into coarser-grained ones that are present in the whitelist. This
works using a tree of nested genre names, represented using `YAML`_, where the
leaves of the tree represent the most specific genres.

To enable canonicalization, set the ``canonical`` configuration value::

    lastgenre:
        canonical: ''

Setting this value to the empty string will use a built-in canonicalization
tree. You can also set it to a path, just like the ``whitelist`` config value,
to use your own tree.

.. _YAML: http://www.yaml.org/

Genre Source
------------

When looking up genres for albums or individual tracks, you can choose whether
to use Last.fm tags on the album, the artist, or the track. For example, you
might want all the albums for a certain artist to carry the same genre. Set the
``source`` configuration value to "album", "track", or "artist", like so::

    lastgenre:
        source: artist

The default is "album". When set to "track", the plugin will fetch *both*
album-level and track-level genres for your music when importing albums.

Running Manually
----------------

In addition to running automatically on import, the plugin can also run manually
from the command line. Use the command ``beet lastgenre [QUERY]`` to fetch
genres for albums matching a certain query.

To disable automatic genre fetching on import, set the ``auto`` config option
to false.


text:
'use strict';

module.exports = function(grunt) {

	// Project configuration.
	grunt.initConfig({
		jshint: {
			all: [
				'Gruntfile.js',
				'tasks/**/*.js',
				'<%= nodeunit.tests %>'
			],
			options: {
				jshintrc: 'config/.jshintrc'
			}
		},

		jscs: {
			options: {
				config: 'config/.jscsrc'
			},
			src: [
				'Gruntfile.js',
				'tasks/**/*.js'
			]
		},

		// Before generating any new files, remove any previously-created files.
		clean: {
			tests: ['tmp']
		},

		// Configuration to be run (and then tested).
		go: {
			compile: {
				options: {},
				files: {
					'tmp/HelloWorld.go': 'test/fixtures/HelloWorld.go'
				}
			}
		},

		// Unit tests.
		nodeunit: {
			tests: ['test/*_test.js']
		}

	});

	// Actually load this plugin's task(s).
	grunt.loadTasks('tasks');

	// These plugins provide necessary tasks.
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-jscs');
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-nodeunit');

	// Whenever the "test" task is run, first clean the "tmp" dir, then run this
	// plugin's task(s), then test the result.
	grunt.registerTask('test', ['clean', 'go', 'nodeunit']);

	// By default, lint and run all tests.
	grunt.registerTask('default', ['jshint', 'jscs', 'test']);

};


text:
<component name="libraryTable">
  <library name="support-vector-drawable-25.3.1">
    <CLASSES>
      <root url="file://$USER_HOME$/.android/build-cache/2dff98c08d7cc7ac6b9e279563a117f77dad29c8/output/res" />
      <root url="jar://$USER_HOME$/.android/build-cache/2dff98c08d7cc7ac6b9e279563a117f77dad29c8/output/jars/classes.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-vector-drawable/25.3.1/support-vector-drawable-25.3.1-sources.jar!/" />
    </SOURCES>
  </library>
</component>