text:
REST in Place
===========
                                  _______
                                 /       \
                                 | R.I.P.|
                                 |       |
                                 |       |
                               -------------

REST in Place is an AJAX Inplace-Editor that talks to RESTful controllers.
It requires absolutely no additional server-side code if your controller
fulfills the following REST preconditions:

-   It uses the HTTP PUT method to update a record
-   It delivers an object in JSON form for requests with
    "Accept: application/json" headers

The editor works by PUTting the updated value to the server and GETting the
updated record afterwards to display the updated value.
That way any authentication methods or otherwise funky workflows in your
controllers are used for the inplace-editors requests.

To save the additional GET request, you can take the shortcut of returning the
updated record in the response to the PUT request. See the testapp for an
example.

URL:         <http://github.com/janv/rest_in_place/>
REPOSITORY:  git://github.com/janv/rest_in_place.git
BLOG:        <http://jan.varwig.org/projects/rest-in-place>

If you like REST in Place, you can flattr me:

Requirements
============

Rails
-----

Since I guess most people use REST in Place in Rails apps, I turned this
entire thing into a gem that you can require in your Gemfile. It requires
jQuery, but it will NOT install a `jquery-rails` dependency. This is done so
you aren't forced to use `jquery-rails` if you want to run a more up-to-date
version of jQuery. Just make sure that jQuery is there.

REST in Place requires Rails >= 3.1 as a dependency since it loads through the
asset pipeline.

CoffeeScript
------------

The CoffeeScript code (`lib/assets/javascripts/rest_in_place/rest_in_place.coffee.erb`)
only relies on the presence of jQuery. You can extract just that file and use
it with whatever framework in whatever server-side language you want, given
that you follow the coventions described later in this document.

Even though this is processed by ERB to sniff out some relevant Rails settings,
you can use it as a CoffeeScript file without modification. (This feature
might vanish at any time in the future, tying RIP closer to Rails).

JavaScript only
---------------

If you're still using JavaScript, give [CoffeeScript](http://jashkenas.github.com/coffee-script/)
a try. It's a preprocessor/different syntax, that makes writing JavaScript
bearable. If you absolutely don't want to learn anything new, just convert
REST in Place to JavaScript using http://js2coffee.org/ before including it in
your project.

Installation
============

Just add

```ruby
gem 'rest_in_place'
```

to your Gemfile.

Then load the JavaScript by adding <%= javascript_include_tag "rest_in_place" %>
into your layout. Alternatively you can require 'rest_in_place' in your
JavaScript files in `app/assets`, for example in your application.js:

```javascript
//= require 'rest_in_place'
```

In both cases, make sure you load REST in Place __after__ jQuery.

Rails Request Forgery Protection
================================

For REST in Place to work with Rails request forgery protection, you need to
have the Rails CSRF meta tags in your HTML head:

```erb
<%= csrf_meta_tags %>
```

Usage Instructions
==================

To make a piece of Text inplace-editable, wrap it into an element (a span
usually) with class "rest-in-place". The editor needs 3 pieces of information
to work: a URL, an object name and the attribute name. These are provided as
follows:

-   put attributes into the element, like this:

    ```erb
    <span class="rest-in-place" data-url="/users/1" data-object="user" data-attribute="name" data-placeholder="Enter a name">
      <%= @user.name %>
    </span>
    ```

-   if any of these attributes is missing, DOM parents of the element are searched
    for them. That means you can write something like:

    ```erb
    <div data-object="user" data-url="/users/1">
      Name:  <span class="rest-in-place" data-attribute="name" ><%= @user.name %></span><br/>
      eMail: <span class="rest-in-place" data-attribute="email"><%= @user.email %></span>
    </div>
    ```

-   You can completely omit the URL to use the current document's URL.
    With proper RESTful controllers this should always work, the explicit
    URL-attribute is for cases when you want to edit a resource that is
    displayed as part of a non-RESTful webpage.

-   Rails provides the DOM helper that constructs a DOM id out of an
    ActiveRecord for you. So, your HTML page may look like this:

    ```erb
    <div id="<%= dom_id @user # == "user_1" %>">
      Name:  <span class="rest-in-place" data-attribute="name" ><%= @user.name %></span><br/>
      eMail: <span class="rest-in-place" data-attribute="email"><%= @user.email %></span>
    </div>
    ```

    REST in Place recognizes `dom_id`s of this form and derives the object parameter
    from them, so that (with the current documents URL used) you really only need
    to provide the attributes name in most cases.

    **Note that a manually defined (in the element or in one of the parents)
    object always overrides dom_id recognition.**

-   REST in Place supports multiple form types. The default type is a input
    field, a textarea is also supported. To select a form type use the
    `data-formtype` attribute in the element and set it to the name of your
    formtype ( `input`, or `textarea` ).

    To write your own form types, just extend the `RestInPlace.forms` object
    and select your new form type throught the `data-formtype` attribute.

Elements with the class `rest-in-place` are picked up automatically upon
`document.ready`. For other elements, grab them via jQuery and call
`.restInPlace()` on the jQuery object.

```javascript
$('.my-custom-class').restInPlace()
```

Events
------

A REST in Place instance triggers four different events on the element that
it's associated with:

- `activate.rest-in-place` when starting the editing of the element.
  Triggering the event is the first thing that happens, before any processing
  and form building takes place. That means you can use this event to modify
  the content of the element (for example to remove number/date formatting).
- `ready.rest-in-place` when the form has been built. This event can be used
  e.g. to change the size of the field or textarea.
- `success.rest-in-place` with the data retrieved from the server as an
  extra parameter after a successful save on the server.
  This event is triggered at the very latest moment, after the element has
  been restored with the data from the server. This means you can use the
  event handler to further modify the data and overwrite the displayed value
  (useful for number/date formatting for example).
- `failure.rest-in-place` after an error occurred. The second argument will be
  jQuery's responseJSON, so it is possible to handle (for instance) server-side
  validation errors.

  ```javascript
  $('#my-editable-element').bind('failure.rest-in-place', function(event, json) {
      $el = $(this);
      attr = $el.data("attribute");
      error_message = json[attr].join(", ");
      $el.after("<span class='error'>#{error_message}</span>");
  });
  ```

- `update.rest-in-place` immediately before sending the update to the server
- `abort.rest-in-place` when the user aborts the editing process.

Bind to these events through the jQuery event mechanisms:

```javascript
$('#my-editable-element').bind('success.rest-in-place', function(event, data){
  console.log("Yay it worked! The new value is", data.whatever);
});
```

Example
=======

Your routes.rb:

```erb
resources :users
```

Your app/controllers/users_controller.rb:

```ruby
class UsersController < ApplicationController
  def show
    @user = User.find params[:id]
    respond_to do |format|
      format.html
      format.json {render :json => @user}
    end
  end

  def update
    @user = User.find params[:id]
    if @user.update_attributes!(params[:user])
      respond_to do |format|
        format.html { redirect_to( @person )}
        format.json { render :json => @user }
      end
    else
      respond_to do |format|
        format.html { render :action  => :edit } # edit.html.erb
        format.json { render :nothing =>  true }
      end
    end
  end
end
```

Your app/views/users/show.html.erb:

```erb
<div id="<%= dom_id @user %>">
  ID: <%= @user.id %><br />
  Name: <span class="rest-in-place" data-formtype="input" data-attribute="name"><%= @user.name %></span><br/><br/>
  Hobbies: <span class="rest-in-place" data-formtype="textarea" data-attribute="hobbies"><%= @user.hobbies %></span>
</div>
```

You can run this example by running to the testapp included in this
plugin with script/server (SQLite3 required) and visiting
localhost:3000/users/

Hint:
you might need to set up the database first.
Copy and edit `testapp/config/database.yml.sample` accordingly.
If you don't want to use the included SQLite3 database, run `rake db:create`
and `rake db:schema:load`.

Troubleshooting
===============

REST in Place is very picky about correct headers and formatting.
If you experience errors, please make sure your controller sends responses as
properly formatted JSON with the correct MIME-Type "application/json".

Testing
=======

The repository contains a `testapp` directory with a rails app that can be
used to test REST in Place. Run `bundle exec rake db:seed` and head to `http://localhost:3000` to see it in
action.

There's also an automated Jasmine spec suite running at
`http://localhost:3000/jasmine`. You can find the sources for the specs at
`testapp/app/assets/javascripts/spec.coffee`

Participation
=============

I'd love to get comments, bug reports (or better, pull-requests) about REST in
Place. For this, you can either fork the project to send a pull request, or
submit a bug in the tracker at GitHub:
<http://github.com/janv/rest_in_place/issues>

For general comments and questions, please use the comment function on my blog:
<http://jan.varwig.org/projects/rest-in-place>

If you send pull requests be sure to also add tests and make sure the existing
tests pass.

Copyright (c) 2013 [Jan Varwig], released under the MIT license


text:
#include "vector_vpainter.h"
#include <algorithm>

V_BEGIN_NAMESPACE

void VPainter::drawRle(const VPoint &, const VRle &rle)
{
    if (rle.empty()) return;
    // mSpanData.updateSpanFunc();

    if (!mSpanData.mUnclippedBlendFunc) return;

    // do draw after applying clip.
    rle.intersect(mSpanData.clipRect(), mSpanData.mUnclippedBlendFunc,
                  &mSpanData);
}

void VPainter::drawRle(const VRle &rle, const VRle &clip)
{
    if (rle.empty() || clip.empty()) return;

    if (!mSpanData.mUnclippedBlendFunc) return;

    rle.intersect(clip, mSpanData.mUnclippedBlendFunc, &mSpanData);
}

static void fillRect(const VRect &r, VSpanData *data)
{
    auto x1 = std::max(r.x(), 0);
    auto x2 = std::min(r.x() + r.width(), data->mDrawableSize.width());
    auto y1 = std::max(r.y(), 0);
    auto y2 = std::min(r.y() + r.height(), data->mDrawableSize.height());

    if (x2 <= x1 || y2 <= y1) return;

    const int  nspans = 256;
    VRle::Span spans[nspans];

    int y = y1;
    while (y < y2) {
        int n = std::min(nspans, y2 - y);
        int i = 0;
        while (i < n) {
            spans[i].x = short(x1);
            spans[i].len = ushort(x2 - x1);
            spans[i].y = short(y + i);
            spans[i].coverage = 255;
            ++i;
        }

        data->mUnclippedBlendFunc(n, spans, data);
        y += n;
    }
}

void VPainter::drawBitmapUntransform(const VRect &  target,
                                         const VBitmap &bitmap,
                                         const VRect &  source,
                                         uint8_t        const_alpha)
{
    mSpanData.initTexture(&bitmap, const_alpha, source);
    if (!mSpanData.mUnclippedBlendFunc) return;

    // update translation matrix for source texture.
    mSpanData.dx = float(target.x() - source.x());
    mSpanData.dy = float(target.y() - source.y());

    fillRect(target, &mSpanData);
}

VPainter::VPainter(VBitmap *buffer)
{
    begin(buffer);
}
bool VPainter::begin(VBitmap *buffer)
{
    mBuffer.prepare(buffer);
    mSpanData.init(&mBuffer);
    // TODO find a better api to clear the surface
    mBuffer.clear();
    return true;
}
void VPainter::end() {}

void VPainter::setDrawRegion(const VRect &region)
{
    mSpanData.setDrawRegion(region);
}

void VPainter::setBrush(const VBrush &brush)
{
    mSpanData.setup(brush);
}

void VPainter::setBlendMode(BlendMode mode)
{
    mSpanData.mBlendMode = mode;
}

VRect VPainter::clipBoundingRect() const
{
    return mSpanData.clipRect();
}

void VPainter::drawBitmap(const VPoint &point, const VBitmap &bitmap,
                          const VRect &source, uint8_t const_alpha)
{
    if (!bitmap.valid()) return;

    drawBitmap(VRect(point, bitmap.size()),
               bitmap, source, const_alpha);
}

void VPainter::drawBitmap(const VRect &target, const VBitmap &bitmap,
                          const VRect &source, uint8_t const_alpha)
{
    if (!bitmap.valid()) return;

    // clear any existing brush data.
    setBrush(VBrush());

    if (target.size() == source.size()) {
        drawBitmapUntransform(target, bitmap, source, const_alpha);
    } else {
        // @TODO scaling
    }
}

void VPainter::drawBitmap(const VPoint &point, const VBitmap &bitmap,
                          uint8_t const_alpha)
{
    if (!bitmap.valid()) return;

    drawBitmap(VRect(point, bitmap.size()),
               bitmap, bitmap.rect(),
               const_alpha);
}

void VPainter::drawBitmap(const VRect &rect, const VBitmap &bitmap,
                          uint8_t const_alpha)
{
    if (!bitmap.valid()) return;

    drawBitmap(rect, bitmap, bitmap.rect(),
               const_alpha);
}

V_END_NAMESPACE

redpajama_set_name: RedPajamaGithub


text:
package org.gradle;

import org.junit.Test;
import org.junit.experimental.categories.Category;

@Category(CategoryA.class)
public class SomeTest {

    @Test
    public void testOk1() {
    }

    @Test
    @Category(CategoryC.class)
    public void testOk2() {
    }

    @Test
    @Category(CategoryB.class)
    public void testOk3() {
    }

    @Test
    @Category({CategoryB.class, CategoryC.class})
    public void testOk4() {
    }
}


text:
import type { Vector } from './Vector';

/**
 * Clone a Vector object
 */

export function clone(vector: Vector): Vector {
  return {
    x: vector.x,
    y: vector.y,
  };
}


text:
/

//  DESCRIPTION
//
//  It is very important to understand the memory management policy
//  of the hash.  This hash is completely responsible for allocating
//  and deallocating ALL of the memory used in the hash entries and the
//  the hash array itself.  So the pointers passed to the hash
//  via the Initialize(), Add() and Find() methods must all represent
//  pre-allocated structs, which the hash will use to copy data into
//  or from.  In other words, the pointers do not imply either the transfer
//  of ownership of allocated memory OR the exposure of actual hash
//  entries to the user of the interface.  Thus, for example, the
//  IFXBTTHashEntry pointer passed as an argument in Add() must be an
//  IFXBTTHashEntry struct that's been created prior to the call to Add()
//  and should subsequently be destroyed at some point after the call to
//  Add().  It will merely be used by the hash within the Add() method
//  to create a new IFXBTTHashEntry that is identical.  Similarly for
//  the IFXBTTHashEntry array provided in the Initialize() method -- this
//  array will not be retained by the hash, it will be used to create
//  a new array with identical entries.  The calling function is responsible
//  for the memory of the array argument, while the hash will be responsible
//  for the memory of the array that it creates and manages.
//
//  The short version of this is: "If you alloc it, you dealloc it."  The
//  BTT hash doesn't hold onto anything.
//
//***************************************************************************

#ifndef IFXBTTHASH_H
#define IFXBTTHASH_H

#include "IFXSceneGraph.h"

// {0E238F14-2CEC-453a-8F60-0F63A3880953}
IFXDEFINE_GUID(IID_IFXBTTHash,
			   0xe238f14, 0x2cec, 0x453a, 0x8f, 0x60, 0xf, 0x63, 0xa3, 0x88, 0x9, 0x53);

#define IFX_E_HASHMAPU32_ID_NOT_FOUND \
	MAKE_IFXRESULT_FAIL( IFXRESULT_COMPONENT_CORE_SERVICES, 0x00100 )

class IFXBTTHash : public IFXUnknown
{
public:

	class IFXBTTHashEntry
	{
	public:

		// default constructor
		IFXBTTHashEntry()
		{
			blockType = 0;
			paletteType = IFXSceneGraph::NUMBER_OF_PALETTES;
			flags = 0;
		}

		// paramaterized constructor
		IFXBTTHashEntry( U32      in_blockType,
			IFXSceneGraph::EIFXPalette in_paletteType,
			U32      in_flags,
			const IFXCID*  in_decoderCID )

		{
			blockType = in_blockType;
			paletteType = in_paletteType;
			flags = in_flags;
			decoderCID = *in_decoderCID;
		}

		~IFXBTTHashEntry()
		{
			if ( flags & NEWBLOCKTYPE )
			{
			}
		}

		IFXRESULT IFXAPI Initialize()
		{
			return IFX_OK;
		}

		U32 blockType;  // NOTE: this is the hash 'key'
		IFXSceneGraph::EIFXPalette paletteType;
		U32 flags;
		IFXCID decoderCID;
	};

	enum EIFXBTTFlags
	{
		CONTINUATION  = 1<<0,
		CHAIN     = 1<<1,
		NEWBLOCKTYPE  = 1<<2,
		ALL       = 0xFFFFFFFF
	};

	virtual IFXRESULT IFXAPI  Initialize () = 0 ;
	virtual IFXRESULT IFXAPI  Initialize (
									U32	uHashSize,
									U32 numEntries,
				 const IFXBTTHashEntry* pEntryList ) = 0 ;

	virtual IFXRESULT IFXAPI  Add  ( const IFXBTTHashEntry* pEntry ) = 0 ;
	virtual IFXRESULT IFXAPI  Delete ( U32 ukey ) = 0 ;
	virtual IFXRESULT IFXAPI  Find   ( U32 ukey, IFXBTTHashEntry* pEntry ) = 0 ;
};

#endif


text:
from yahdlc import *
from threading import Thread, Event, Lock
from queue import Queue, Full
from time import sleep, time

class HDLController:
    """
    An HDLC controller based on python4yahdlc.
    """

    MAX_SEQ_NO = 8
    MIN_SENDING_TIMEOUT = 0.5

    def __init__(self, read_func, write_func, sending_timeout=2, window=3, frames_queue_size=0, fcs_nack=True):
        if not hasattr(read_func, '__call__'):
            raise TypeError('The read function parameter is not a callable object')
        if not hasattr(write_func, '__call__'):
            raise TypeError('The write function parameter is not a callable object')

        self.read = read_func
        self.write = write_func

        self.window = window
        self.fcs_nack = fcs_nack
        self.senders = dict()
        self.send_lock = Lock()
        self.new_seq_no = 0

        self.send_callback = None
        self.receive_callback = None

        self.set_sending_timeout(sending_timeout)

        self.receiver = None
        self.frames_received = Queue(maxsize=frames_queue_size)

    def start(self):
        """
        Starts HDLC controller's threads.
        """

        self.receiver = self.Receiver(
            self.read,
            self.write,
            self.send_lock,
            self.senders,
            self.frames_received,
            callback=self.receive_callback,
            fcs_nack=self.fcs_nack,
        )

        self.receiver.start()

    def stop(self):
        """
        Stops HDLC controller's threads.
        """

        if self.receiver != None:
            self.receiver.join()

        for s in self.senders.values():
            s.join()

    def set_send_callback(self, callback):
        """
        Sets the send callback function.

        If the HDLC controller has already been started, the new
        callback function will be taken into account for the next
        data frames to be sent.
        """

        if not hasattr(callback, '__call__'):
            raise TypeError('The callback function parameter is not a callable object')

        self.send_callback = callback

    def set_receive_callback(self, callback):
        """
        Sets the receive callback function.

        This method has to be called before starting the
        HDLC controller.
        """

        if not hasattr(callback, '__call__'):
            raise TypeError('The callback function parameter is not a callable object')

        self.receive_callback = callback

    def set_sending_timeout(self, sending_timeout):
        """
        Sets the sending timeout.
        """

        if sending_timeout >= HDLController.MIN_SENDING_TIMEOUT:
            self.sending_timeout = sending_timeout

    def get_senders_number(self):
        """
        Returns the number of active senders.
        """

        return len(self.senders)

    def send(self, data):
        """
        Sends a new data frame.

        This method will block until a new room is available for
        a new sender. This limit is determined by the size of the window.
        """

        while len(self.senders) >= self.window:
            pass

        self.senders[self.new_seq_no] = self.Sender(
            self.write,
            self.send_lock,
            data,
            self.new_seq_no,
            timeout=self.sending_timeout,
            callback=self.send_callback,
        )

        self.senders[self.new_seq_no].start()
        self.new_seq_no = (self.new_seq_no + 1) % HDLController.MAX_SEQ_NO

    def get_data(self):
        """
        Gets the next frame received.

        This method will block until a new data frame is available.
        """

        return self.frames_received.get()

    class Sender(Thread):
        """
        Thread used to send HDLC frames.
        """

        def __init__(self, write_func, send_lock, data, seq_no, timeout=2, callback=None):
            super().__init__()
            self.write = write_func
            self.send_lock = send_lock
            self.data = data
            self.seq_no = seq_no
            self.timeout = timeout
            self.callback = callback

            self.stop_sender = Event()
            self.stop_timeout = Event()
            self.next_timeout = 0

        def run(self):
            while not self.stop_sender.isSet():
                self.stop_timeout.wait(max(0, self.next_timeout - time()))
                self.stop_timeout.clear()

                if not self.stop_sender.isSet():
                    self.next_timeout = time() + self.timeout

                    with self.send_lock:
                        self.__send_data()

        def join(self, timeout=None):
            """
            Stops the current thread.
            """

            self.stop_sender.set()
            self.stop_timeout.set()
            super().join(timeout)

        def ack_received(self):
            """
            Informs the sender that the related ACK frame has been received.
            As a consequence, the current thread is being stopped.
            """

            self.join()

        def nack_received(self):
            """
            Informs the sender that an NACK frame has been received.
            As a consequence, the data frame is being resent.
            """

            self.stop_timeout.set()

        def __send_data(self):
            """
            Sends a new data frame.
            """

            if self.callback != None:
                self.callback(self.data)

            self.write(frame_data(self.data, FRAME_DATA, self.seq_no))

    class Receiver(Thread):
        """
        Thread used to receive HDLC frames.
        """

        def __init__(self, read_func, write_func, send_lock, senders_list, frames_received, callback=None, fcs_nack=True):
            super().__init__()
            self.read = read_func
            self.write = write_func
            self.send_lock = send_lock
            self.senders = senders_list
            self.frames_received = frames_received
            self.callback = callback
            self.fcs_nack = fcs_nack

            self.stop_receiver = Event()

        def run(self):
            while not self.stop_receiver.isSet():
                try:
                    data, ftype, seq_no = get_data(self.read())

                    if ftype == FRAME_DATA:
                        with self.send_lock:
                            if self.callback != None:
                                self.callback(data)

                            self.frames_received.put_nowait(data)
                            self.__send_ack((seq_no + 1) % HDLController.MAX_SEQ_NO)
                    elif ftype == FRAME_ACK:
                        seq_no_sent = (seq_no - 1) % HDLController.MAX_SEQ_NO
                        self.senders[seq_no_sent].ack_received()
                        del self.senders[seq_no_sent]
                    elif ftype == FRAME_NACK:
                        self.senders[seq_no].nack_received()
                    else:
                        raise TypeError('Bad frame type received')
                except MessageError:
                    # No HDLC frame detected.
                    pass
                except KeyError:
                    # Drops bad (N)ACKs.
                    pass
                except Full:
                    # Drops new data frames when the receive queue
                    # is full.
                    pass
                except FCSError as e:
                    # Sends back an NACK if a corrupted frame is received
                    # and if the FCS NACK option is enabled.
                    if self.fcs_nack:
                        with self.send_lock:
                            self.__send_nack(e.args[0])
                except TypeError:
                    # Generally, raised when an HDLC frame with a bad frame
                    # type is received.
                    pass
                finally:
                    # 200 µs.
                    sleep(200 / 1000000.0)

        def join(self, timeout=None):
            """
            Stops the current thread.
            """

            self.stop_receiver.set()
            super().join(timeout)

        def __send_ack(self, seq_no):
            """
            Sends a new ACK frame.
            """

            self.write(frame_data('', FRAME_ACK, seq_no))

        def __send_nack(self, seq_no):
            """
            Sends a new NACK frame.
            """

            self.write(frame_data('', FRAME_NACK, seq_no))


text:
<?php

namespace Formativ\Cms\Compiler;

use Formativ\Cms\CompilerInterface;
use Illuminate\View\Compilers\BladeCompiler;

class Blade
extends BladeCompiler
implements CompilerInterface
{

}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class net.cabezudo.json.exceptions.PropertyNotExistException (JSONLib documentation.)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
net.cabezudo.json.exceptions.PropertyNotExistException

Packages that use PropertyNotExistException

Package
Description

net.cabezudo.json

net.cabezudo.json.values

Uses of PropertyNotExistException in net.cabezudo.json

Methods in net.cabezudo.json that throw PropertyNotExistException

Modifier and Type
Method and Description

static void
JSON.main(java.lang.String... args)

Uses of PropertyNotExistException in net.cabezudo.json.values

Methods in net.cabezudo.json.values that throw PropertyNotExistException

Modifier and Type
Method and Description

java.math.BigDecimal
JSONArray.digBigDecimal(java.lang.String fullPropertyName)

Dig into this JSONArray object to find a element or
 property to convert to BigDecimal.

java.math.BigInteger
JSONArray.digBigInteger(java.lang.String fullPropertyName)

Dig into this JSONArray object to find a element or
 property to convert to BigInteger.

java.lang.Boolean
JSONArray.digBoolean(java.lang.String fullPropertyName)

Dig into this JSONArray object to find a element or
 property to convert to Boolean.

java.lang.Boolean
JSONObject.digBoolean(java.lang.String fullPropertyName)

Dig into this net.cabezudo.json.values.JSONObject object to find a property to
 convert to Boolean.

java.lang.Byte
JSONArray.digByte(java.lang.String fullPropertyName)

Dig into this JSONArray object to find an element or
 property to convert to Byte.

java.lang.Byte
JSONObject.digByte(java.lang.String fullPropertyName)

Dig into this net.cabezudo.json.values.JSONObject object to find a property to
 convert to Byte.

java.util.Calendar
JSONArray.digCalendar(java.lang.String fullPropertyName)

Dig into this JSONArray object to find an element or
 property to convert to Calendar.

java.lang.Character
JSONArray.digCharacter(java.lang.String fullPropertyName)

Dig into this JSONArray object to find an element or
 property to convert to Character.

java.lang.Character
JSONObject.digCharacter(java.lang.String fullPropertyName)

Dig into this net.cabezudo.json.values.JSONObject object to find a property to
 convert to Character.

java.lang.Double
JSONArray.digDouble(java.lang.String fullPropertyName)

Dig into this JSONArray object to find an element or
 property to convert to Double.

java.lang.Double
JSONObject.digDouble(java.lang.String fullPropertyName)

Dig into this net.cabezudo.json.values.JSONObject object to find a property to
 convert to Double.

java.lang.Float
JSONArray.digFloat(java.lang.String fullPropertyName)

Dig into this JSONArray object to find an element or
 property to convert to Float.

java.lang.Float
JSONObject.digFloat(java.lang.String fullPropertyName)

Dig into this JSONObject object to find a property to
 convert to Float.

java.lang.Integer
JSONArray.digInteger(java.lang.String fullPropertyName)

Dig into this JSONArray object to find an element or
 property to convert to Integer.

java.lang.Integer
JSONObject.digInteger(java.lang.String fullPropertyName)

Dig into this JSONObject object to find a property to
 convert to Integer.

java.lang.Long
JSONArray.digLong(java.lang.String fullPropertyName)

Dig into this JSONArray object to find an element or
 property to convert to Long.

java.lang.Long
JSONObject.digLong(java.lang.String fullPropertyName)

Dig into this JSONObject object to find a property to
 convert to Long.

JSONObject
JSONArray.digObject(java.lang.String fullPropertyName)

Dig into this JSONArray object to find an element or
 property to convert to JSONObject.

JSONObject
JSONObject.digObject(java.lang.String fullPropertyName)

Dig into this JSONObject object to find a property to
 convert to JSONObject.

java.lang.Short
JSONArray.digShort(java.lang.String fullPropertyName)

Dig into this JSONArray object to find an element or
 property to convert to Short.

java.lang.Short
JSONObject.digShort(java.lang.String fullPropertyName)

Dig into this JSONObject object to find a property to
 convert to Short.

java.lang.String
JSONArray.digString(java.lang.String fullPropertyName)

Dig into this JSONArray object to find an element or
 property to convert to String.

java.lang.String
JSONObject.digString(java.lang.String fullPropertyName)

Dig into this JSONObject object to find a property to
 convert to String.

JSONValue
JSONArray.digValue(java.lang.String fullPropertyName)

Dig into this JSONArray object to find an element or
 property to convert to BigDecimal.

JSONValue
JSONObject.digValue(java.lang.String fullPropertyName)

Dig into this JSONObject object to find a property and
 return a JSONValue object.

JSONValue[]
JSONObject.getArray(java.lang.String propertyName)

Return the value of the property with the name passed converted to
 net.cabezudo.json.values.JSONValue[].

java.math.BigDecimal
JSONObject.getBigDecimal(int index)

Return the value of the property with the index passed converted to BigDecimal.

java.math.BigDecimal
JSONObject.getBigDecimal(java.lang.String propertyName)

Return the value of the property with the name passed converted to BigDecimal.

java.math.BigInteger
JSONObject.getBigInteger(int index)

Return the value of the property with the index passed converted to BigInteger.

java.math.BigInteger
JSONObject.getBigInteger(java.lang.String propertyName)

Return the value of the property with the name passed converted to BigInteger.

java.lang.Boolean
JSONObject.getBoolean(int index)

Return the value of the property with the index passed converted to Boolean.

java.lang.Boolean
JSONObject.getBoolean(java.lang.String propertyName)

Return the value of the property with the name passed converted to Boolean.

java.lang.Byte
JSONObject.getByte(int index)

Return the value of the property with the index passed converted to Byte.

java.lang.Byte
JSONObject.getByte(java.lang.String propertyName)

Return the value of the property with the name passed converted to Byte.

byte[]
JSONObject.getByteArray(int index)

Return the value of the property with the index passed converted to byte[].

byte[]
JSONObject.getByteArray(java.lang.String propertyName)

Return the value of the property with the name passed converted to byte[].

java.util.Calendar
JSONObject.getCalendar(int index)

Return the value of the property with the index passed converted to Calendar.

java.util.Calendar
JSONObject.getCalendar(java.lang.String propertyName)

Return the value of the property with the name passed converted to Calendar.

java.lang.Character
JSONObject.getCharacter(int index)

Return the value of the property with the index passed converted to Character.

java.lang.Character
JSONObject.getCharacter(java.lang.String propertyName)

Return the value of the property with the name passed converted to Character.

java.lang.Double
JSONObject.getDouble(int index)

Return the value of the property with the index passed converted to Double.

java.lang.Double
JSONObject.getDouble(java.lang.String propertyName)

Return the value of the property with the name passed converted to Double.

JSONPair
JSONObject.getElement(int index)

Return the element in the position specified.

JSONPair
JSONObject.getElement(java.lang.String propertyName)

Return the element associated with the property name.

java.lang.Float
JSONObject.getFloat(int index)

Return the value of the property with the index passed converted to Float.

java.lang.Float
JSONObject.getFloat(java.lang.String propertyName)

Return the value of the property with the name passed converted to Float.

java.lang.Integer
JSONObject.getInteger(int index)

Return the value of the property with the index passed converted to Integer.

java.lang.Integer
JSONObject.getInteger(java.lang.String propertyName)

Return the value of the property with the name passed converted to Integer.

JSONArray
JSONObject.getJSONArray(int index)

Return the value of the property with the index passed converted to
 JSONArray.

JSONArray
JSONObject.getJSONArray(java.lang.String propertyName)

Return the value of the property with the name passed converted to
 JSONArray.

java.lang.Long
JSONObject.getLong(int index)

Return the value of the property with the index passed converted to Long.

java.lang.Long
JSONObject.getLong(java.lang.String propertyName)

Return the value of the property with the name passed converted to Long.

JSONObject
JSONObject.getObject(int index)

Return the value of the property with the index passed converted to
 JSONObject.

JSONObject
JSONObject.getObject(java.lang.String propertyName)

Return the value of the property with the name passed converted to
 JSONObject.

java.lang.Short
JSONObject.getShort(int index)

Return the value of the property with the index passed converted to Short.

java.lang.Short
JSONObject.getShort(java.lang.String propertyName)

Return the value of the property with the name passed converted to Short.

java.lang.String
JSONObject.getString(int index)

Return the value of the property with the index passed converted to String.

java.lang.String
JSONObject.getString(java.lang.String propertyName)

Return the value of the property with the name passed converted to String.

JSONValue
JSONObject.getValue(int index)

Return the value of the property with the index passed converted to
 JSONValue.

JSONValue
JSONObject.getValue(java.lang.String propertyName)

Return the value of the property with the name passed converted to
 JSONValue.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
using System;

using BeanIO.Config;

namespace BeanIO.Internal.Config
{
    ///
    /// Stores bean information.
    ///
    /// <remarks>
    /// A Bean object is used to instantiate configurable components
    /// such as a type handler, record reader factory or record writer factory.
    /// </remarks>
    public interface IBeanConfig
    {
        ///
        /// Gets or sets the fully qualified class name of the bean.
        ///
        string ClassName { get; set; }

        ///
        /// Gets or sets the bean properties.
        ///
        Properties Properties { get; set; }
    }
}


text:
<?php

namespace Google\AdsApi\Dfp\v201705;

/**
 * This file was generated from WSDL. DO NOT EDIT.
 */
class VideoRedirectCreative extends \Google\AdsApi\Dfp\v201705\BaseVideoCreative
{

    /**
     * @var \Google\AdsApi\Dfp\v201705\VideoRedirectAsset[] $videoAssets
     */
    protected $videoAssets = null;

    /**
     * @param int $advertiserId
     * @param int $id
     * @param string $name
     * @param \Google\AdsApi\Dfp\v201705\Size $size
     * @param string $previewUrl
     * @param string $policyViolations
     * @param \Google\AdsApi\Dfp\v201705\AppliedLabel[] $appliedLabels
     * @param \Google\AdsApi\Dfp\v201705\DateTime $lastModifiedDateTime
     * @param \Google\AdsApi\Dfp\v201705\BaseCustomFieldValue[] $customFieldValues
     * @param string $destinationUrl
     * @param string $destinationUrlType
     * @param int $duration
     * @param boolean $allowDurationOverride
     * @param \Google\AdsApi\Dfp\v201705\ConversionEvent_TrackingUrlsMapEntry[] $trackingUrls
     * @param long[] $companionCreativeIds
     * @param string $customParameters
     * @param string $vastPreviewUrl
     * @param string $sslScanResult
     * @param string $sslManualOverride
     * @param \Google\AdsApi\Dfp\v201705\VideoRedirectAsset[] $videoAssets
     */
    public function __construct($advertiserId = null, $id = null, $name = null, $size = null, $previewUrl = null, $policyViolations = null, array $appliedLabels = null, $lastModifiedDateTime = null, array $customFieldValues = null, $destinationUrl = null, $destinationUrlType = null, $duration = null, $allowDurationOverride = null, array $trackingUrls = null, array $companionCreativeIds = null, $customParameters = null, $vastPreviewUrl = null, $sslScanResult = null, $sslManualOverride = null, array $videoAssets = null)
    {
      parent::__construct($advertiserId, $id, $name, $size, $previewUrl, $policyViolations, $appliedLabels, $lastModifiedDateTime, $customFieldValues, $destinationUrl, $destinationUrlType, $duration, $allowDurationOverride, $trackingUrls, $companionCreativeIds, $customParameters, $vastPreviewUrl, $sslScanResult, $sslManualOverride);
      $this->videoAssets = $videoAssets;
    }

    /**
     * @return \Google\AdsApi\Dfp\v201705\VideoRedirectAsset[]
     */
    public function getVideoAssets()
    {
      return $this->videoAssets;
    }

    /**
     * @param \Google\AdsApi\Dfp\v201705\VideoRedirectAsset[] $videoAssets
     * @return \Google\AdsApi\Dfp\v201705\VideoRedirectCreative
     */
    public function setVideoAssets(array $videoAssets)
    {
      $this->videoAssets = $videoAssets;
      return $this;
    }

}


text:
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}
#loader {
    display: block;
    position: relative;
    left: 50%;
    top: 50%;
    width: 150px;
    height: 150px;
    margin: -75px 0 0 -75px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #05cdfa;
    -webkit-animation: spin 2s linear infinite;
    animation: spin 2s linear infinite;
}
#loader:before {
    content: "";
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #04acd2;
    -webkit-animation: spin 3s linear infinite;
    animation: spin 3s linear infinite;
}
#loader:after {
    content: "";
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #a1e9fa;
    -webkit-animation: spin 1.5s linear infinite;
    animation: spin 1.5s linear infinite;
}
@-webkit-keyframes spin {
    0%   {
        -webkit-transform: rotate(0deg);
        -ms-transform: rotate(0deg);
        transform: rotate(0deg);
    }
    100% {
        -webkit-transform: rotate(360deg);
        -ms-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}
@keyframes spin {
    0%   {
        -webkit-transform: rotate(0deg);
        -ms-transform: rotate(0deg);
        transform: rotate(0deg);
    }
    100% {
        -webkit-transform: rotate(360deg);
        -ms-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}


text:
This document describes the layout of the project as viewed in the solution file.

- `GRA` - utilities for use throughout the solution
- `GRA.Controllers` - controllers for the MVC application - they are kept out of the `GRA.Web` project to keep all program logic removed from the UI and to make them easily testable
- Domain
  - `GRA.Domain.Model` - domain models which are passed between the UI and data repositories
  - `GRA.Domain.Repository` - interfaces describing the data repositories
  - `GRA.Domain.Service` - services for performing logic and calling data repositories
- Infrastructure
  - `GRA.Data` - main Entity Framework data project
    - `Model` - model files that match the database schema, used by EF for [database CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete)
    - `Profiles` - [AutoMapper profiles](https://github.com/AutoMapper/AutoMapper/wiki/Configuration#profile-instances)
    - `Repository` - repositories for communicating with the database and returning domain model objects
  - `GRA.Data.SQLite` - database provider for using SQLite
  - `GRA.Data.SqlServer` - database provider for using Microsoft SQL Server
- `GRA.Web` - MVC Web front-end and dependency injection composition root
  - `wwwroot` - static files for serving via the Web
  - `Areas/MissionControl` - Razor files for Mission Control (site administration)
  - `Views` - Razor files
  - `Startup.cs` - the main configuration location for the project


text:
This plugin is designed to work with simple VIM snippets like the once from
[here](https://github.com/honza/vim-snippets/tree/master/snippets)
The plugin itself doesn't provide any snippets. To add snippets for a language
place a file containing the snippets at `~/.config/micro/plugins/snippets/[filetype].snippets`

# Commands

The plugin providies the following commands:

* `snippetinsert`: with an optional parameter to specify which snippet should be inserted. If the parameter is absent, the word right before the cursor will be used for this. (`Alt+S`)
* `snippetnext`: proceeds to the next placeholder (`Alt+W`)
* `snippetcancel`: removes all the current snippet (`Alt+D`)
* `snippetaccept`: finishes the snippet editing for the current snippet. (`Alt+A`)

# Snippet Files

The snippet files have a very simple syntax:
* lines starting with `#` are ignored
* a line starts with `snippet` starts a new snippet.
* after `snippet` you can add one or more shortcuts for the snippets, like `snippet aFunc bFunc` (at least one shortcut is required)
* every line of code within the snippet must start with a tab (`\t`)
* a snippet can have multiple placeholders which are indicated by `${num[:name]}` where num is a numeric value. Placeholders with the same number share the same value. You also have the option to give a placeholder a name / description / default value.

Plugins can provide snippet files they just need to publish them as a runtime file with type `snippets`.
See the plugins help for additional details.

Sample for go:

```
# creates a function that prints a value
snippet fmtfunc
	func ${0:name}() {
		fmt.Println("${0} prints:", ${1:value})
	}
```


text:
body {
  margin: 15px;
}

#gallery img {
  height: 18vw;
  /* height: 50px; */
  object-fit: cover;
  margin-bottom: 30px;
}
@media (min-width: 576px) {
  #gallery img {
    height: 18vw;
  }
}
@media (min-width: 992px) {
  #gallery img {
    height: 18vw;
  }
}
.carousel-item img {
  /* height: 60vw; */
  object-fit: cover;
}
/* @media (min-width: 576px) {
  .carousel-item img {
    height: 350px;
  }
} */
* {
  transition: 0.3s;
}
#gallery.custom {
  padding: 0 15px;
}
#gallery.custom img {
  display: block;
  margin: 15px 0;
  border-radius: 300px 30px 300px 300px;
}
#gallery.custom img:hover {
  border-radius: 30px 90px 30px 30px;
}
#exampleModal.custom .modal-content {
  background: none;
  border: none;
}
#exampleModal.custom .modal-header {
  border: none;
}
#exampleModal.custom .modal-header button {
  background: none;
  border-radius: 100px 100px 0 0;
  padding: 5px 10px;
  opacity: 1;
  position: relative;
  top: 3px;
  border: solid 2px white;
}
@media (min-width: 992px) {
  #exampleModal.custom .modal-header button {
    top: 15px;
  }
}
#exampleModal.custom .modal-header button:hover {
  top: 3px;
}
#exampleModal.custom .modal-header span {
  color: white;
}
#exampleModal.custom .modal-body {
  padding: 0;
  border: none;
  position: relative;
}
#exampleModal.custom .modal-body::before, #exampleModal.custom .modal-body::after {
  content: '';
  height: 50px;
  width: 50px;
  display: block;
  position: absolute;
  background: white;
  border-radius: 3px 10px;
}
@media (min-width: 768px) {
  #exampleModal.custom .modal-body::before, #exampleModal.custom .modal-body::after {
    border-radius: 3px 30px;
    height: 100px;
    width: 100px;
  }
}
#exampleModal.custom .modal-body::before {
  top: -5px;
  left: -5px;
}
@media (min-width: 768px) {
  #exampleModal.custom .modal-body::before {
    top: -15px;
    left: -15px;
  }
}
#exampleModal.custom .modal-body::after {
  bottom: -5px;
  right: -5px;
  z-index: -1;
}
@media (min-width: 768px) {
  #exampleModal.custom .modal-body::after {
    bottom: -15px;
    right: -15px;
  }
}
#exampleModal.custom .modal-footer {
  border: none;
  margin-top: 60px;
}
@media (min-width: 992px) {
  #exampleModal.custom .modal-footer {
    margin-top: 40px;
  }
}
#exampleModal.custom .modal-footer .btn {
  margin: auto;
  border: solid 2px white;
  background: none;
  text-transform: uppercase;
  font-size: 0.8em;
  letter-spacing: 0.1em;
  font-weight: bold;
  padding: 0.2em 0.7em;
}
#exampleModal.custom .modal-footer .btn:hover {
  background: white;
  color: black;
}
#exampleModal.custom .carousel-control-prev, #exampleModal.custom .carousel-control-next {
  font-size: 2em;
  top: auto;
  opacity: 1;
  bottom: -52px;
}
@media (min-width: 768px) {
  #exampleModal.custom .carousel-control-prev, #exampleModal.custom .carousel-control-next {
    top: 0;
    opacity: 0.5;
    bottom: 0;
  }
}
#exampleModal.custom .carousel-control-next-icon, #exampleModal.custom .carousel-control-prev-icon {
  height: 30px;
  width: 30px;
}
@media (min-width: 768px) {
  #exampleModal.custom .carousel-control-prev {
    left: -90px;
  }
}
@media (min-width: 768px) {
  #exampleModal.custom .carousel-control-next {
    right: -90px;
  }
}
#exampleModal.custom .carousel-indicators {
  bottom: -60px;
}
@media (min-width: 992px) {
  #exampleModal.custom .carousel-indicators {
    bottom: -30px;
  }
}
#exampleModal.custom .carousel-indicators li {
  height: 30px;
  border-radius: 100px;
  background: none;
  border: solid 2px white;
}
@media (min-width: 992px) {
  #exampleModal.custom .carousel-indicators li {
    height: 10px;
  }
}
#exampleModal.custom .carousel-indicators li:hover {
  background: white;
}
#exampleModal.custom .carousel-indicators li.active {
  background: white;
}
/* The switch - the box around the slider */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}
@media (min-width: 576px) {
  .switch {
    margin: 0;
  }
}
/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
/* The slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}
input:checked + .slider {
  background-color: #2196F3;
}
input:focus + .slider {
  box-shadow: 0 0 1px #2196F3;
}
input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}
/* Rounded sliders */
.slider.round {
  border-radius: 34px;
}
.slider.round:before {
  border-radius: 50%;
}
.switch-wrap {
  text-align: center;
  background-color: #b1fbc1;
  padding: 30px;
  border-radius: 3px;
  margin: 30px 0 0;
}
@media (min-width: 576px) {
  .switch-wrap {
    position: fixed;
    bottom: 0;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    width: 100%;
    justify-content: center;
    padding: 10px;
  }
}
.switch-text {
  display: block;
  margin: 0.5em;
}
@media (min-width: 576px) {
  .switch-text {
    margin: 0 1em 0 0;
  }
}


text:
//
//  LELoadingAnimationView.m
//  ticket
//
//  Created by Larry Emerson on 14-2-22.
//  Copyright (c) 2014年 360CBS. All rights reserved.
//

#import "LELoadingAnimationView.h"

@implementation LELoadingAnimationView{
    UIImageView *curView;
}
#define LoadingAnimationTime    0.2

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self leAdditionalInits];
    }
    return self;
}
-(void) leAdditionalInits{
    NSBundle *bundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"LEFrameworks" ofType:@"bundle"]];
    UIImage *img=[[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@.png",bundle.bundlePath,@"sr_refresh"]];
    [self setFrame:CGRectMake(0,0, img.size.width, img.size.height)];
    self.leViewWidth=img.size.width;
    self.leViewHeight=img.size.height;
    curView=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, img.size.width,img.size.height)];
    [curView setImage:img];
    [self addSubview:curView];
    [self setHidden:YES];
}
+ (UIImageView *)rotate360DegreeWithImageView:(UIImageView *)imageView{
    CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath: @"transform" ];
    animation.fromValue = [NSValue valueWithCATransform3D:CATransform3DIdentity];
    //围绕Z轴旋转,垂直与屏幕
    animation.toValue = [NSValue valueWithCATransform3D: CATransform3DMakeRotation(M_PI/2, 0.0, 0.0, 1.0) ];
    animation.duration = 0.2f;
    //旋转效果累计,先转180度,接着再旋转180度,从而实现360旋转
    animation.cumulative = YES;
    animation.repeatCount = 1000;
    animation.removedOnCompletion = YES;
    CGRect imageRrect = CGRectMake(0, 0,imageView.frame.size.width, imageView.frame.size.height);
    UIGraphicsBeginImageContextWithOptions(imageRrect.size, NO, [UIScreen mainScreen].scale);
    [imageView.image drawInRect:imageRrect];
    imageView.image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    [imageView.layer addAnimation:animation forKey:nil ];
    return imageView;
}
-(void) leStartAnimation{
    [self setHidden:NO];
    curView=[LELoadingAnimationView rotate360DegreeWithImageView:curView];
}

-(void) leStopAnimation{
    [curView.layer removeAllAnimations];
    [self setHidden:YES];
}

/** // Only override drawRect: if you perform custom drawing.
 // An empty implementation adversely affects performance during animation.
 - (void)drawRect:(CGRect)rect
 {
 // Drawing code
 }
 */

@end


text:
require 'rails_helper'

RSpec.describe 'developers request:' do
  describe 'GET /settings/developer' do
    let(:user) { create(:user) }

    before do
      log_in_as user
    end

    it 'responds 200' do
      get developer_path

      expect(response).to have_http_status(:ok)
    end

    context 'with developer' do
      before do
        developer = create(:developer, user:)
        create_list(:client, Faker::Number.within(range: 0..2), developer:)

        allow(Octokit::Client).to receive(:new).with(access_token: developer.github_access_token).and_return(
          instance_double(Octokit::Client, user: {}),
        )
      end

      it 'responds 200' do
        get developer_path

        expect(response).to have_http_status(:ok)
      end
    end

    context 'with developer but their github_access_token has been revoked' do
      before do
        developer = create(:developer, user:)
        create_list(:client, Faker::Number.within(range: 0..2), developer:)

        allow(Octokit::Client).to receive(:new).with(access_token: developer.github_access_token).and_return(
          instance_double(Octokit::Client).tap { |client| allow(client).to receive(:user).and_raise(Octokit::Unauthorized) },
        )
      end

      it 'responds 200' do
        get developer_path

        expect(response).to have_http_status(:ok)
      end
    end
  end
end


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

/**
 * @fileoverview Factory model for frontend learner answer info
 */

import { LearnerAnswerInfo } from
  'domain/statistics/learner-answer-info.model';
import { InteractionCustomizationArgs } from
  'interactions/customization-args-defs';

export class LearnerAnswerDetails {
  expId: string;
  stateName: string;
  interactionId: string;
  customizationArgs: InteractionCustomizationArgs;
  learnerAnswerInfoData: LearnerAnswerInfo[];

  constructor(
      expId: string, stateName: string, interactionId: string,
      customizationArgs: InteractionCustomizationArgs,
      learnerAnswerInfoData: LearnerAnswerInfo[]) {
    this.expId = expId;
    this.stateName = stateName;
    this.interactionId = interactionId;
    this.customizationArgs = customizationArgs;
    this.learnerAnswerInfoData = learnerAnswerInfoData;
  }

  static createDefaultLearnerAnswerDetails(
      expId: string, stateName: string, interactionId: string,
      customizationArgs: InteractionCustomizationArgs,
      learnerAnswerInfoData: LearnerAnswerInfo[]): LearnerAnswerDetails {
    return new LearnerAnswerDetails(
      expId, stateName, interactionId, customizationArgs,
      learnerAnswerInfoData);
  }

  getExpId(): string {
    return this.expId;
  }

  getStateName(): string {
    return this.stateName;
  }

  getLearnerAnswerInfoData(): LearnerAnswerInfo[] {
    return this.learnerAnswerInfoData;
  }

  getLastUpdatedTime(): number {
    var createdOnValues =
      this.learnerAnswerInfoData.map(info => info.getCreatedOn());
    return Math.max(...createdOnValues);
  }
}


text:
using System;
using System.Globalization;
using PcapDotNet.Base;

namespace PcapDotNet.Packets.Dns
{
    /// <summary>
    /// RFC 2930.
    /// <pre>
    /// +------+------------+------------+
    /// | bit  | 0-15       | 16-31      |
    /// +------+------------+------------+
    /// | 0    | Algorithm               |
    /// | ...  |                         |
    /// +------+-------------------------+
    /// | X    | Inception               |
    /// +------+-------------------------+
    /// | X+32 | Expiration              |
    /// +------+------------+------------+
    /// | X+64 | Mode       | Error      |
    /// +------+------------+------------+
    /// | X+96 | Key Size   |            |
    /// +------+------------+ Key Data   |
    /// | ...  |                         |
    /// +------+------------+------------+
    /// |      | Other Size |            |
    /// +------+------------+ Other Data |
    /// | ...  |                         |
    /// +------+-------------------------+
    /// </pre>
    /// </summary>
    [DnsTypeRegistration(Type = DnsType.TKey)]
    public sealed class DnsResourceDataTransactionKey : DnsResourceData, IEquatable<DnsResourceDataTransactionKey>
    {
        private static class OffsetAfterAlgorithm
        {
            public const int Inception = 0;
            public const int Expiration = Inception + SerialNumber32.SizeOf;
            public const int Mode = Expiration + SerialNumber32.SizeOf;
            public const int Error = Mode + sizeof(ushort);
            public const int KeySize = Error + sizeof(ushort);
            public const int KeyData = KeySize + sizeof(ushort);
        }

        private const int ConstantPartLength = OffsetAfterAlgorithm.KeyData + sizeof(ushort);

        /// <summary>
        /// Constructs an instance out of the algorithm, inception, expiration, mode, error, key and other fields.
        /// </summary>
        /// <param name="algorithm">
        /// Name of the algorithm in domain name syntax.
        /// The algorithm determines how the secret keying material agreed to using the TKEY RR is actually used to derive the algorithm specific key.
        /// </param>
        /// <param name="inception">
        /// Number of seconds since the beginning of 1 January 1970 GMT ignoring leap seconds treated as modulo 2**32 using ring arithmetic.
        /// In messages between a DNS resolver and a DNS server where this field is meaningful,
        /// it is either the requested validity interval start for the keying material asked for or
        /// specify the validity interval start of keying material provided.
        ///
        /// To avoid different interpretations of the inception time in TKEY RRs,
        /// resolvers and servers exchanging them must have the same idea of what time it is.
        /// One way of doing this is with the NTP protocol [RFC 2030] but that or any other time synchronization used for this purpose must be done securely.
        /// </param>
        /// <param name="expiration">
        /// Number of seconds since the beginning of 1 January 1970 GMT ignoring leap seconds treated as modulo 2**32 using ring arithmetic.
        /// In messages between a DNS resolver and a DNS server where this field is meaningful,
        /// it is either the requested validity interval end for the keying material asked for or
        /// specify the validity interval end of keying material provided.
        ///
        /// To avoid different interpretations of the expiration time in TKEY RRs,
        /// resolvers and servers exchanging them must have the same idea of what time it is.
        /// One way of doing this is with the NTP protocol [RFC 2030] but that or any other time synchronization used for this purpose must be done securely.
        /// </param>
        /// <param name="mode">
        /// Specifies the general scheme for key agreement or the purpose of the TKEY DNS message.
        /// Servers and resolvers supporting this specification must implement the Diffie-Hellman key agreement mode and the key deletion mode for queries.
        /// All other modes are optional.
        /// A server supporting TKEY that receives a TKEY request with a mode it does not support returns the BADMODE error.
        /// </param>
        /// <param name="error">
        /// When the TKEY Error Field is non-zero in a response to a TKEY query, the DNS header RCODE field indicates no error.
        /// However, it is possible if a TKEY is spontaneously included in a response the TKEY RR and DNS header error field
        /// could have unrelated non-zero error codes.
        /// </param>
        /// <param name="key">The key exchange data. The meaning of this data depends on the mode.</param>
        /// <param name="other">May be used in future extensions.</param>
        public DnsResourceDataTransactionKey(DnsDomainName algorithm, SerialNumber32 inception, SerialNumber32 expiration, DnsTransactionKeyMode mode,
                                             DnsResponseCode error, DataSegment key, DataSegment other)
        {
            if (key == null)
                throw new ArgumentNullException("key");
            if (other == null)
                throw new ArgumentNullException("other");

            if (key.Length > ushort.MaxValue)
                throw new ArgumentOutOfRangeException("key", key.Length,
                                                      string.Format(CultureInfo.InvariantCulture, "Cannot be longer than {0}", ushort.MaxValue));
            if (other.Length > ushort.MaxValue)
                throw new ArgumentOutOfRangeException("other", other.Length,
                                                      string.Format(CultureInfo.InvariantCulture, "Cannot be longer than {0}", ushort.MaxValue));

            Algorithm = algorithm;
            Inception = inception;
            Expiration = expiration;
            Mode = mode;
            Error = error;
            Key = key;
            Other = other;
        }

        /// <summary>
        /// Name of the algorithm in domain name syntax.
        /// The algorithm determines how the secret keying material agreed to using the TKEY RR is actually used to derive the algorithm specific key.
        /// </summary>
        public DnsDomainName Algorithm { get; private set; }

        /// <summary>
        /// Number of seconds since the beginning of 1 January 1970 GMT ignoring leap seconds treated as modulo 2**32 using ring arithmetic.
        /// In messages between a DNS resolver and a DNS server where this field is meaningful,
        /// it is either the requested validity interval start for the keying material asked for or
        /// specify the validity interval start of keying material provided.
        ///
        /// To avoid different interpretations of the inception time in TKEY RRs,
        /// resolvers and servers exchanging them must have the same idea of what time it is.
        /// One way of doing this is with the NTP protocol [RFC 2030] but that or any other time synchronization used for this purpose must be done securely.
        /// </summary>
        public SerialNumber32 Inception { get; private set; }

        /// <summary>
        /// Number of seconds since the beginning of 1 January 1970 GMT ignoring leap seconds treated as modulo 2**32 using ring arithmetic.
        /// In messages between a DNS resolver and a DNS server where this field is meaningful,
        /// it is either the requested validity interval end for the keying material asked for or
        /// specify the validity interval end of keying material provided.
        ///
        /// To avoid different interpretations of the expiration time in TKEY RRs,
        /// resolvers and servers exchanging them must have the same idea of what time it is.
        /// One way of doing this is with the NTP protocol [RFC 2030] but that or any other time synchronization used for this purpose must be done securely.
        /// </summary>
        public SerialNumber32 Expiration { get; private set; }

        /// <summary>
        /// Specifies the general scheme for key agreement or the purpose of the TKEY DNS message.
        /// Servers and resolvers supporting this specification must implement the Diffie-Hellman key agreement mode and the key deletion mode for queries.
        /// All other modes are optional.
        /// A server supporting TKEY that receives a TKEY request with a mode it does not support returns the BADMODE error.
        /// </summary>
        public DnsTransactionKeyMode Mode { get; private set; }

        /// <summary>
        /// When the TKEY Error Field is non-zero in a response to a TKEY query, the DNS header RCODE field indicates no error.
        /// However, it is possible if a TKEY is spontaneously included in a response the TKEY RR and DNS header error field
        /// could have unrelated non-zero error codes.
        /// </summary>
        public DnsResponseCode Error { get; private set; }

        /// <summary>
        /// The key exchange data.
        /// The meaning of this data depends on the mode.
        /// </summary>
        public DataSegment Key { get; private set; }

        /// <summary>
        /// May be used in future extensions.
        /// </summary>
        public DataSegment Other { get; private set; }

        /// <summary>
        /// Two DnsResourceDataTransactionKey are equal iff their algorithm, inception, expiration, mode, error, key and other fields are equal.
        /// </summary>
        public bool Equals(DnsResourceDataTransactionKey other)
        {
            return other != null &&
                   Algorithm.Equals(other.Algorithm) &&
                   Inception.Equals(other.Inception) &&
                   Expiration.Equals(other.Expiration) &&
                   Mode.Equals(other.Mode) &&
                   Error.Equals(other.Error) &&
                   Key.Equals(other.Key) &&
                   Other.Equals(other.Other);
        }

        /// <summary>
        /// Two DnsResourceDataTransactionKey are equal iff their algorithm, inception, expiration, mode, error, key and other fields are equal.
        /// </summary>
        public override bool Equals(object obj)
        {
            return Equals(obj as DnsResourceDataTransactionKey);
        }

        /// <summary>
        /// A hash code of the combination of the algorithm, inception, expiration, mode, error, key and other fields.
        /// </summary>
        public override int GetHashCode()
        {
            return Sequence.GetHashCode(Algorithm, Inception, Expiration, BitSequence.Merge((ushort)Mode, (ushort)Error), Key, Other);
        }

        internal DnsResourceDataTransactionKey()
            : this(DnsDomainName.Root, 0, 0, DnsTransactionKeyMode.DiffieHellmanExchange, DnsResponseCode.NoError, DataSegment.Empty, DataSegment.Empty)
        {
        }

        internal override int GetLength(DnsDomainNameCompressionData compressionData, int offsetInDns)
        {
            return Algorithm.GetLength(compressionData, offsetInDns) + ConstantPartLength + Key.Length + Other.Length;
        }

        internal override int WriteData(byte[] buffer, int dnsOffset, int offsetInDns, DnsDomainNameCompressionData compressionData)
        {
            int algorithmLength = Algorithm.Write(buffer, dnsOffset, compressionData, offsetInDns);
            int offset = dnsOffset + offsetInDns + algorithmLength;
            buffer.Write(offset + OffsetAfterAlgorithm.Inception, Inception.Value, Endianity.Big);
            buffer.Write(offset + OffsetAfterAlgorithm.Expiration, Expiration.Value, Endianity.Big);
            buffer.Write(offset + OffsetAfterAlgorithm.Mode, (ushort)Mode, Endianity.Big);
            buffer.Write(offset + OffsetAfterAlgorithm.Error, (ushort)Error, Endianity.Big);
            buffer.Write(offset + OffsetAfterAlgorithm.KeySize, (ushort)Key.Length, Endianity.Big);
            Key.Write(buffer, offset + OffsetAfterAlgorithm.KeyData);

            int otherSizeOffset = offset + OffsetAfterAlgorithm.KeyData + Key.Length;
            buffer.Write(otherSizeOffset, (ushort)Other.Length, Endianity.Big);
            Other.Write(buffer, otherSizeOffset + sizeof(ushort));

            return algorithmLength + ConstantPartLength + Key.Length + Other.Length;
        }

        internal override DnsResourceData CreateInstance(DnsDatagram dns, int offsetInDns, int length)
        {
            if (length < ConstantPartLength + DnsDomainName.RootLength)
                return null;

            DnsDomainName algorithm;
            int algorithmLength;
            if (!DnsDomainName.TryParse(dns, offsetInDns, length - ConstantPartLength, out algorithm, out algorithmLength))
                return null;
            offsetInDns += algorithmLength;
            length -= algorithmLength;

            if (length < ConstantPartLength)
                return null;

            uint inception = dns.ReadUInt(offsetInDns + OffsetAfterAlgorithm.Inception, Endianity.Big);
            uint expiration = dns.ReadUInt(offsetInDns + OffsetAfterAlgorithm.Expiration, Endianity.Big);
            DnsTransactionKeyMode mode = (DnsTransactionKeyMode)dns.ReadUShort(offsetInDns + OffsetAfterAlgorithm.Mode, Endianity.Big);
            DnsResponseCode error = (DnsResponseCode)dns.ReadUShort(offsetInDns + OffsetAfterAlgorithm.Error, Endianity.Big);

            int keySize = dns.ReadUShort(offsetInDns + OffsetAfterAlgorithm.KeySize, Endianity.Big);
            if (length < ConstantPartLength + keySize)
                return null;
            DataSegment key = dns.Subsegment(offsetInDns + OffsetAfterAlgorithm.KeyData, keySize);

            int totalReadAfterAlgorithm = OffsetAfterAlgorithm.KeyData + keySize;
            offsetInDns += totalReadAfterAlgorithm;
            length -= totalReadAfterAlgorithm;
            int otherSize = dns.ReadUShort(offsetInDns, Endianity.Big);
            if (length != sizeof(ushort) + otherSize)
                return null;
            DataSegment other = dns.Subsegment(offsetInDns + sizeof(ushort), otherSize);

            return new DnsResourceDataTransactionKey(algorithm, inception, expiration, mode, error, key, other);
        }
    }
}


text:
package org.opentosca.toscana.core.plugin.lifecycle;

import java.io.IOException;
import java.util.HashSet;

import org.opentosca.toscana.core.BaseUnitTest;
import org.opentosca.toscana.core.csar.Csar;
import org.opentosca.toscana.core.csar.CsarImpl;
import org.opentosca.toscana.core.testdata.TestPlugins;
import org.opentosca.toscana.core.transformation.Transformation;
import org.opentosca.toscana.core.transformation.TransformationContext;
import org.opentosca.toscana.core.transformation.TransformationImpl;
import org.opentosca.toscana.core.transformation.platform.Platform;
import org.opentosca.toscana.core.transformation.properties.NoSuchPropertyException;
import org.opentosca.toscana.model.EffectiveModel;

import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.junit.Assert.fail;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

public class LifecycleAwarePluginTest extends BaseUnitTest {

    private static final Logger logger = LoggerFactory.getLogger(LifecycleAwarePluginTest.class);

    private TransformationContext context;

    private TestTransformationLifecycle lifecycle;

    private boolean checkEnvironment = true;
    private boolean checkModel = true;

    private LifecycleTestPlugin plugin;
    private Platform platform;

    @Before
    public void setUp() throws Exception {
        Csar csar = new CsarImpl(tmpdir, "csarId", logMock());
        Transformation t = new TransformationImpl(csar, TestPlugins.PLATFORM1, logMock(), mock(EffectiveModel.class));
        context = spy(new TransformationContext(t, tmpdir));
        doReturn(false).when(context).performDeployment();
        lifecycle = spy(new TestTransformationLifecycle(context));
        checkModel = true;
        plugin = new LifecycleTestPlugin(TestPlugins.PLATFORM1);
    }

    @Test
    public void testDeploymentEnabled() throws Exception {
        when(context.performDeployment()).thenReturn(true);
        plugin = new LifecycleTestPlugin(new Platform("test", "test", true, new HashSet<>()));
        lifecycle = spy(new TestTransformationLifecycle(context));
        checkModel = true;
        plugin.transform(lifecycle);
        verify(lifecycle, times(1)).deploy();
    }

    @Test
    public void testDeploymentDisabled() throws Exception {
        when(context.performDeployment()).thenReturn(false);
        plugin = new LifecycleTestPlugin(TestPlugins.PLATFORM4);
        plugin.transform(lifecycle);
        verify(lifecycle, times(0)).deploy();
    }

    @Test
    public void checkEnvFailure() throws Exception {
        checkEnvironment = false;
        plugin = new LifecycleTestPlugin(TestPlugins.PLATFORM4);
        try {
            plugin.transform(lifecycle);
        } catch (ValidationFailureException e) {
            logger.info("Thrown exception: ", e);
            verify(lifecycle, never()).checkModel();
            return;
        }
        fail();
    }

    @Test
    public void checkModelFailure() throws Exception {
        checkModel = false;
        try {
            plugin.transform(lifecycle);
        } catch (ValidationFailureException e) {
            logger.info("Thrown exception: ", e);
            verify(lifecycle, never()).prepare();
            return;
        }
        fail();
    }

    @Test
    public void successfulExec() throws Exception {
        when(lifecycle.checkModel()).thenReturn(true);
        plugin.transform(lifecycle);
        verify(lifecycle).cleanup();
    }

    private class LifecycleTestPlugin extends ToscanaPlugin {

        //Not using mockito because it somehow did not work as expected using spy()
        public LifecycleTestPlugin(Platform platform) {
            super(platform);
        }

        @Override
        public AbstractLifecycle getInstance(TransformationContext context) {
            return lifecycle;
        }
    }

    private class TestTransformationLifecycle extends AbstractLifecycle {

        public TestTransformationLifecycle(TransformationContext context) throws IOException {
            super(context);
        }

        @Override
        public boolean checkEnvironment() {
            System.out.println("Check Env");
            return checkEnvironment;
        }

        @Override
        public boolean checkModel() {
            System.out.println("Check Model");
            return checkModel;
        }

        @Override
        public void prepare() throws NoSuchPropertyException {
            System.out.println("Prepare");
        }

        @Override
        public void transform() {
            System.out.println("Transform");
        }

        @Override
        public void cleanup() {
            System.out.println("Cleanup");
        }

        @Override
        public void deploy() {
            System.out.println("Deploy");
        }
    }
}


text:
set -e

ENV_MGMT_NETWORK="10.0.0.0/24"
ENV_MGMT_OS_CONTROLLER_IP="10.0.0.11"
ENV_MGMT_OS_NETWORK_IP="10.0.0.21"
ENV_MGMT_OS_COMPUTE_IP="10.0.0.31"
ENV_MGMT_OS_OBJECT_IP="10.0.0.61"

ENV_TUNNEL_NETWORK="10.0.1.0/24"
ENV_TUNNEL_OS_CONTROLLER_IP="10.0.1.11"
ENV_TUNNEL_OS_NETWORK_IP="10.0.1.21"
ENV_TUNNEL_OS_COMPUTE_IP="10.0.1.31"

LOG=/tmp/provision.log
date | tee $LOG            # when:  Thu Aug 10 07:48:13 UTC 2017
whoami | tee -a $LOG       # who:   root
pwd | tee -a $LOG          # where: /home/vagrant

CACHE=/vagrant/cache
[ -d $CACHE ] || mkdir -p $CACHE

ARCHIVE=/vagrant/archive
[ -d $ARCHIVE ] || mkdir -p $ARCHIVE

function use_public_apt_server() {
    apt install -y software-properties-common
    add-apt-repository cloud-archive:pike
    apt-get update && APT_UPDATED=true

    # Reference https://docs.openstack.org/newton/install-guide-ubuntu/environment-packages.html
}

function use_local_apt_server() {
    cat > /etc/apt/sources.list <<DATA
deb http://192.168.240.3/ubuntu xenial main restricted
deb http://192.168.240.3/ubuntu xenial universe
deb http://192.168.240.3/ubuntu xenial multiverse
deb http://192.168.240.3/ubuntu xenial-updates main restricted
deb http://192.168.240.3/ubuntu xenial-updates universe
deb http://192.168.240.3/ubuntu xenial-updates multiverse
deb http://192.168.240.3/ubuntu xenial-security main restricted
deb http://192.168.240.3/ubuntu xenial-security universe
deb http://192.168.240.3/ubuntu xenial-security multiverse
deb http://192.168.240.3/ubuntu-cloud-archive xenial-updates/pike main
DATA

    rm -rf /var/lib/apt/lists/*
    echo 'APT::Get::AllowUnauthenticated "true";' > /etc/apt/apt.conf.d/99-use-local-apt-server
    apt-get update && APT_UPDATED=true
}

function each_node_must_resolve_the_other_nodes_by_name_in_addition_to_IP_address() {
    cat >> /etc/hosts <<DATA
$ENV_MGMT_OS_CONTROLLER_IP os-controller
$ENV_MGMT_OS_NETWORK_IP os-network
$ENV_MGMT_OS_COMPUTE_IP os-compute
DATA

    # Reference https://docs.openstack.org/newton/install-guide-ubuntu/environment-networking.html
}

function install_utilities() {
    [ "$APT_UPDATED" == "true" ] || apt-get update && APT_UPDATED=true
    apt-get install -y crudini
}

function install_python() {
    PYTHON_VERSION=2.7.11-1
    PYTHON_PIP_VERSION=8.1.1-2ubuntu0.4
    [ "$APT_UPDATED" == "true" ] || apt-get update && APT_UPDATED=true
    #apt-get install -y python=$PYTHON_VERSION python-pip=$PYTHON_PIP_VERSION
    apt-get install -y python python-pip
}

function install_ntp() {
    CHRONY_VERSION=2.1.1-1
    [ "$APT_UPDATED" == "true" ] || apt-get update && APT_UPDATED=true
    #apt-get install -y chrony=$CHRONY_VERSION
    apt-get install -y chrony

    # # # # # # # # # # # # # # # # ## # # # # # # # # # # # # # # # # # # # # # # # # ## # # # # # # # #

    # To connect to the os-controller node
    sed -i "s/^pool /#pool /g" /etc/chrony/chrony.conf
    sed -i "s/^server /#server /g" /etc/chrony/chrony.conf
    echo "server os-controller iburst" >> /etc/chrony/chrony.conf

    # Restart the NTP service
    service chrony restart

    # Verify operation
    chronyc sources

    # Log files
    # /var/log/chrony/measurements.log
    # /var/log/chrony/statistics.log
    # /var/log/chrony/tracking.log

    # Reference https://docs.openstack.org/newton/install-guide-ubuntu/environment-ntp-other.html
}

function install_xfs() {
    [ "$APT_UPDATED" == "true" ] || apt-get update && APT_UPDATED=true
    apt-get install -y xfsprogs
}

function install_rsync() {
    [ "$APT_UPDATED" == "true" ] || apt-get update && APT_UPDATED=true
    apt-get install -y rsync
}

function download_swift() {
    [ "$APT_UPDATED" == "true" ] || apt-get update && APT_UPDATED=true
    apt-get install -y swift swift-account swift-container swift-object
}

function configure_swift_part1() {
    # [ PART I ]

    # Format the /dev/sdb and /dev/sdc devices as XFS
    mkfs.xfs /dev/sdb
    mkfs.xfs /dev/sdc

    # Create the mount point directory structure
    mkdir -p /srv/node/sdb
    mkdir -p /srv/node/sdc

    # Edit the /etc/fstab file
    echo "/dev/sdb /srv/node/sdb xfs noatime,nodiratime,nobarrier,logbufs=8 0 2" >> /etc/fstab
    echo "/dev/sdc /srv/node/sdc xfs noatime,nodiratime,nobarrier,logbufs=8 0 2" >> /etc/fstab

    # Mount the devices
    mount /srv/node/sdb
    mount /srv/node/sdc

    # Create or edit the /etc/rsyncd.conf file
    cat > /etc/rsyncd.conf <<DATA
uid = swift
gid = swift
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
address = $ENV_MGMT_OS_OBJECT_IP

[account]
max connections = 2
path = /srv/node/
read only = False
lock file = /var/lock/account.lock

[container]
max connections = 2
path = /srv/node/
read only = False
lock file = /var/lock/container.lock

[object]
max connections = 2
path = /srv/node/
read only = False
lock file = /var/lock/object.lock
DATA

    # Edit the /etc/default/rsync file and enable the rsync service
    sed -i 's/RSYNC_ENABLE=false/RSYNC_ENABLE=true/' /etc/default/rsync

    # Start the rsync service
    service rsync start

    # Download /etc/swift/account-server.conf
    cp /vagrant/sample.conf/account-server.conf /etc/swift/account-server.conf

    # Download /etc/swift/container-server.conf
    cp /vagrant/sample.conf/container-server.conf /etc/swift/container-server.conf

    # Download /etc/swift/object-server.conf
    cp /vagrant/sample.conf/object-server.conf /etc/swift/object-server.conf

    # Edit the /etc/swift/account-server.conf file, [DEFAULT] section
    crudini --set  /etc/swift/account-server.conf DEFAULT bind_ip "$ENV_MGMT_OS_OBJECT_IP"
    crudini --set  /etc/swift/account-server.conf DEFAULT bind_port "6202"
    crudini --set  /etc/swift/account-server.conf DEFAULT user "swift"
    crudini --set  /etc/swift/account-server.conf DEFAULT swift_dir "/etc/swift"
    crudini --set  /etc/swift/account-server.conf DEFAULT devices "/srv/node"
    crudini --set  /etc/swift/account-server.conf DEFAULT mount_check "True"

    # Edit the /etc/swift/account-server.conf file, [pipeline:main] section
    crudini --set  /etc/swift/account-server.conf pipeline:main pipeline "healthcheck recon account-server"

    # Edit the /etc/swift/account-server.conf file, [filter:recon] section
    crudini --set  /etc/swift/account-server.conf filter:recon use "egg:swift#recon"
    crudini --set  /etc/swift/account-server.conf filter:recon recon_cache_path "/var/cache/swift"

    # Edit the /etc/swift/container-server.conf file, [DEFAULT] section
    crudini --set  /etc/swift/container-server.conf DEFAULT bind_ip "$ENV_MGMT_OS_OBJECT_IP"
    crudini --set  /etc/swift/container-server.conf DEFAULT bind_port "6201"
    crudini --set  /etc/swift/container-server.conf DEFAULT user "swift"
    crudini --set  /etc/swift/container-server.conf DEFAULT swift_dir "/etc/swift"
    crudini --set  /etc/swift/container-server.conf DEFAULT devices "/srv/node"
    crudini --set  /etc/swift/container-server.conf DEFAULT mount_check "True"

    # Edit the /etc/swift/container-server.conf file, [pipeline:main] section
    crudini --set  /etc/swift/container-server.conf pipeline:main pipeline "healthcheck recon container-server"

    # Edit the /etc/swift/container-server.conf file, [filter:recon] section
    crudini --set  /etc/swift/container-server.conf filter:recon use "egg:swift#recon"
    crudini --set  /etc/swift/container-server.conf filter:recon recon_cache_path "/var/cache/swift"

    # Edit the /etc/swift/object-server.conf file, [DEFAULT] section
    crudini --set  /etc/swift/object-server.conf DEFAULT bind_ip "$ENV_MGMT_OS_OBJECT_IP"
    crudini --set  /etc/swift/object-server.conf DEFAULT bind_port "6200"
    crudini --set  /etc/swift/object-server.conf DEFAULT user "swift"
    crudini --set  /etc/swift/object-server.conf DEFAULT swift_dir "/etc/swift"
    crudini --set  /etc/swift/object-server.conf DEFAULT devices "/srv/node"
    crudini --set  /etc/swift/object-server.conf DEFAULT mount_check "True"

    # Edit the /etc/swift/object-server.conf file, [pipeline:main] section
    crudini --set  /etc/swift/object-server.conf pipeline:main pipeline "healthcheck recon object-server"

    # Edit the /etc/swift/object-server.conf file, [filter:recon] section
    crudini --set  /etc/swift/object-server.conf filter:recon use "egg:swift#recon"
    crudini --set  /etc/swift/object-server.conf filter:recon recon_cache_path "/var/cache/swift"
    crudini --set  /etc/swift/object-server.conf filter:recon recon_lock_path "/var/lock"

    # Ensure proper ownership of the mount point directory structure
    chown -R swift:swift /srv/node

    # Create the recon directory and ensure proper ownership of it
    mkdir -p /var/cache/swift
    chown -R root:swift /var/cache/swift
    chmod -R 775 /var/cache/swift
}

function configure_swift_part2() {
    # [ PART II ] - Copy the account.ring.gz, container.ring.gz, and object.ring.gz files to the /etc/swift directory on each storage node
    cp $CACHE/account.ring.gz /etc/swift/
    cp $CACHE/container.ring.gz /etc/swift/
    cp $CACHE/object.ring.gz /etc/swift/
}

function configure_swift_part3() {
    # [ PART III ] - Finalize installation

    # Copy the swift.conf file to the /etc/swift directory on each storage node
    cp $CACHE/swift.conf /etc/swift/

    # On all nodes, ensure proper ownership of the configuration directory
    chown -R root:swift /etc/swift

    # On the storage nodes, start the Object Storage services
    swift-init all start
}

function main() {
    while [ $# -gt 0 ];
    do
        case $1 in
            download)
                #use_local_apt_server
                use_public_apt_server
                each_node_must_resolve_the_other_nodes_by_name_in_addition_to_IP_address
                install_utilities
                install_python
                install_ntp
                install_xfs
                install_rsync
                download_swift
                ;;
            configure-part2)
                configure_swift_part1
                ;;
            configure-part4)
                configure_swift_part2
                ;;
            configure-part6)
                configure_swift_part3
                ;;
            *)
                echo "unknown mode"
                ;;
        esac
        shift
    done
    echo done
}
main $@


text:
package org.mapfish.print.processor.jasper;

import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.Timer;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.google.common.io.Files;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperCompileManager;
import org.mapfish.print.config.Configuration;
import org.mapfish.print.config.HasConfiguration;
import org.mapfish.print.config.WorkingDirectories;
import org.mapfish.print.processor.AbstractProcessor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import java.io.File;
import java.io.IOException;
import java.nio.file.StandardCopyOption;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nullable;

/**
 *
A processor that actually compiles a JasperReport template file.

 *
Example

 *

 *     processors:
 *         - !reportBuilder # compile all reports in current directory
 *               directory: '.'

 * [[examples=verboseExample]]
 *
 * @author Jesse
 * @author sbrunner
 */
public final class JasperReportBuilder extends AbstractProcessor<JasperReportBuilder.Input, Void> implements HasConfiguration {
    private static final Logger LOGGER = LoggerFactory.getLogger(JasperReportBuilder.class);
    /**
     * Extension for Jasper XML Report Template files.
     */
    public static final String JASPER_REPORT_XML_FILE_EXT = ".jrxml";
    /**
     * Extension for Compiled Jasper Report Template files.
     */
    public static final String JASPER_REPORT_COMPILED_FILE_EXT = ".jasper";

    private File directory = null;
    private Configuration configuration;
    @Autowired
    private MetricRegistry metricRegistry;
    @Autowired
    private WorkingDirectories workingDirectories;

    /**
     * Constructor.
     */
    protected JasperReportBuilder() {
        super(Void.class);
    }

    @Override
    public Void execute(final JasperReportBuilder.Input param, final ExecutionContext context) throws JRException {
        Timer.Context buildReports = this.metricRegistry.timer(getClass() + "_execute()").time();
        try {
            for (final File jasperFile : jasperXmlFiles()) {
                checkCancelState(context);
                compileJasperReport(this.configuration, jasperFile);
            }
            return null;
        } finally {
            buildReports.stop();
        }
    }

    File compileJasperReport(final Configuration config, final File jasperFile) throws JRException {
        final File buildFile = this.workingDirectories.getBuildFileFor(config, jasperFile, JASPER_REPORT_COMPILED_FILE_EXT, LOGGER);
        return compileJasperReport(buildFile, jasperFile);
    }

    File compileJasperReport(final File buildFile, final File jasperFile) throws JRException {
        if (!buildFile.exists() || jasperFile.lastModified() > buildFile.lastModified()) {
            try {
                // May be called from multiple threads at the same time for the same report.
                // Instead of trying to protect the compiled file against modification while
                // another thread is reading it, use a temporary file as a target instead and
                // move it (atomic operation) when done. Worst case: we compile a file twice instead
                // of once.
                File tmpBuildFile = File.createTempFile("temp_", JASPER_REPORT_COMPILED_FILE_EXT, buildFile.getParentFile());

                LOGGER.info("Building Jasper report: " + jasperFile.getAbsolutePath());
                LOGGER.debug("To: " + buildFile.getAbsolutePath());
                final Timer.Context compileJasperReport = this.metricRegistry.timer("compile_" + jasperFile).time();
                try {
                    JasperCompileManager.compileReportToFile(jasperFile.getAbsolutePath(), tmpBuildFile.getAbsolutePath());
                } finally {
                    final long compileTime = TimeUnit.MILLISECONDS.convert(compileJasperReport.stop(), TimeUnit.NANOSECONDS);
                    LOGGER.info("Report built in " + compileTime + "ms.");
                }

                java.nio.file.Files.move(tmpBuildFile.toPath(), buildFile.toPath(), StandardCopyOption.ATOMIC_MOVE);
            } catch (IOException e) {
                throw new JRException(e);
            }
        } else {
            LOGGER.debug("Destination file is already up to date: " + buildFile.getAbsolutePath());
        }
        return buildFile;
    }

    private Iterable<File> jasperXmlFiles() {
        File directoryToSearch = this.directory;
        if (directoryToSearch == null) {
            directoryToSearch = this.configuration.getDirectory();
        }
        final String configurationAbsolutePath = this.configuration.getDirectory().getAbsolutePath();
        if (!directoryToSearch.getAbsolutePath().startsWith(configurationAbsolutePath)) {
            throw new IllegalArgumentException("All directories and files referenced in the configuration must be in the configuration " +
                                               "directory: " + directoryToSearch + " is not in " + this.configuration.getDirectory());
        }
        final Iterable<File> children = Files.fileTreeTraverser().children(directoryToSearch);
        return Iterables.filter(children, new Predicate<File>() {
            @Override
            public boolean apply(@Nullable final File input) {
                return input != null && input.getName().endsWith(JASPER_REPORT_XML_FILE_EXT);
            }
        });
    }

    @Override
    public JasperReportBuilder.Input createInputParameter() {
        return new JasperReportBuilder.Input();
    }

    /**
     * Set the directory and test that the directory exists and is contained within the Configuration directory.
     *
     * @param directory the new directory
     */
    public void setDirectory(final String directory) {
        this.directory = new File(this.configuration.getDirectory(), directory);
        if (!this.directory.exists()) {
            throw new IllegalArgumentException("Directory does not exist: "
                                               + this.directory + ".\nConfiguration contained value "
                                               + directory + " which is supposed to be relative to configuration directory");
        }

        if (!this.directory.getAbsolutePath().startsWith(this.configuration.getDirectory().getAbsolutePath())) {
            throw new IllegalArgumentException("All files and directories must be contained in the configuration directory" +
                                               " the directory provided in the configuration breaks that contract: " + directory
                                               + " in config file resolved to " + this.directory);
        }
    }

    @Override
    public void setConfiguration(final Configuration configuration) {
        this.configuration = configuration;
    }

    @Override
    public String toString() {
        return getClass().getSimpleName() + "(" + this.directory + ")";
    }

    /**
     * The input parameter object for {@link JasperReportBuilder}.
     */
    public static final class Input {
    }

    @Override
    protected void extraValidation(final List<Throwable> validationErrors, final Configuration config) {
        // nothing to do
    }
}


text:
class sapi_spphoneconverter_1 {
    constructor() {
        // int LanguageId () {get} {set}
        this.LanguageId = undefined;

    }

    // string IdToPhone (Variant)
    IdToPhone(Variant) {

    }

    // Variant PhoneToId (string)
    PhoneToId(string) {

    }

}

module.exports = sapi_spphoneconverter_1;


text:
'use strict';
var http = require('http');

http.createServer(function (request, response) {
	// request.url contiene el path de la petición
	if (request.url != '/') {
		// no es la home /, devuelve error
		response.writeHead(500, {'Content-Type': 'text/plain'});
		// una respuesta 500 puede devolver una página
		response.end('Error');
		return;
	}
	response.writeHead(200, {'Content-Type': 'text/plain'});
	response.end('Hello World\n');
}).listen(1337, '127.0.0.1');

console.log('Server running at http://127.0.0.1:1337/');


text:
/* Generated by Font Squirrel (http://www.fontsquirrel.com) */

/*
 * Roboto
================================================================================ */
@font-face {
    font-family: 'roboto-black';
    src: url('../fonts/roboto/roboto-black-webfont.woff2') format('woff2'),
         url('../fonts/roboto/roboto-black-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'roboto-black-italic';
    src: url('../fonts/roboto/roboto-blackitalic-webfont.woff2') format('woff2'),
         url('../fonts/roboto/roboto-blackitalic-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'roboto-bold';
    src: url('../fonts/roboto/roboto-bold-webfont.woff2') format('woff2'),
         url('../fonts/roboto/roboto-bold-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'roboto-bold-italic';
    src: url('../fonts/roboto/roboto-bolditalic-webfont.woff2') format('woff2'),
         url('../fonts/roboto/roboto-bolditalic-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'roboto-italic';
    src: url('../fonts/roboto/roboto-italic-webfont.woff2') format('woff2'),
         url('../fonts/roboto/roboto-italic-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'roboto-light';
    src: url('../fonts/roboto/roboto-light-webfont.woff2') format('woff2'),
         url('../fonts/roboto/roboto-light-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'roboto-light-italic';
    src: url('../fonts/roboto/roboto-lightitalic-webfont.woff2') format('woff2'),
         url('../fonts/roboto/roboto-lightitalic-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'roboto-medium';
    src: url('../fonts/roboto/roboto-medium-webfont.woff2') format('woff2'),
         url('../fonts/roboto/roboto-medium-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'roboto-medium-italic';
    src: url('../fonts/roboto/roboto-mediumitalic-webfont.woff2') format('woff2'),
         url('../fonts/roboto/roboto-mediumitalic-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'roboto-regular';
    src: url('../fonts/roboto/roboto-regular-webfont.woff2') format('woff2'),
         url('../fonts/roboto/roboto-regular-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'roboto-thin';
    src: url('../fonts/roboto/roboto-thin-webfont.woff2') format('woff2'),
         url('../fonts/roboto/roboto-thin-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'roboto-thin-italic';
    src: url('../fonts/roboto/roboto-thinitalic-webfont.woff2') format('woff2'),
         url('../fonts/roboto/roboto-thinitalic-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

/*
 * Domine
================================================================================ */
@font-face {
    font-family: 'domine-bold';
    src: url('../fonts/domine/domine-bold-webfont.woff2') format('woff2'),
         url('../fonts/domine/domine-bold-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'domine-regular';
    src: url('../fonts/domine/domine-regular-webfont.woff2') format('woff2'),
         url('../fonts/domine/domine-regular-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}