text:
<!DOCTYPE html>

    <title>Onslyde Remote</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0"/>

    <meta name="apple-mobile-web-app-capable" content="yes"/>

    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <meta http-equiv="cache-control" content="no-cache" />
    <link href="//fonts.googleapis.com/css?family=Lato:300,400,700,900" rel="stylesheet" type="text/css">
    <link href="css/panel/edge-panel-remote.css?v=100" media="screen" rel="stylesheet" type="text/css" />

                <input id="agree" class="button" type="submit" value="Agree" />
                <input id="disagree" class="button" type="submit" value="Disagree"/>
                <input id="speak" class="button" type="submit" value="I want to speak!" />

        &#62223 Authorize

                    Follow @edgeconf


text:
<?php
/**
 * @author Maxim Sokolovsky <sokolovsky@worksolutions.ru>
 */

namespace WS\Migrations\Entities;

use Bitrix\Main\Type\DateTime;
use Bitrix\Main\UserTable;
use WS\Migrations\factories\DateTimeFactory;

class SetupLogModel extends BaseEntity {
    public
        $id, $userId;
    /**
     * @var \DateTime
     */
    public $date;

    private $_userData = false;

    public function __construct() {
        $this->date = DateTimeFactory::createBase();
    }

    static protected function map() {
        return array(
            'id' => 'ID',
            'date' => 'DATE',
            'userId' => 'USER_ID'
        );
    }

    static protected function gatewayClass() {
        return SetupLogTable::className();
    }

    static protected function modifyFromDb($data) {
        if ($data['date'] instanceof DateTime) {
            $timestamp = $data['date']->getTimestamp();
            $data['date'] = DateTimeFactory::createBase();
            $data['date']->setTimestamp($timestamp);
        } else {
            $data['date']= DateTimeFactory::createBase($data['date']);
        }
        return $data;
    }

    static protected function modifyToDb($data) {
        $data['date'] && $data['date'] instanceof \DateTime && $data['date'] = DateTimeFactory::createBitrix($data['date']);
        return $data;
    }

    /**
     * @return AppliedChangesLogModel[]
     */
    public function getAppliedLogs() {
        return AppliedChangesLogModel::find(array(
            'filter' => array(
                '=setupLogId' => $this->id
            )
        ));
    }

    /**
     * @return array
     */
    private function getUserData() {
        if ($this->_userData === false) {
            $this->_userData = UserTable::getById($this->userId)->fetch();
        }
        return $this->_userData;
    }

    public function shortUserInfo() {
        $res  = 'cli';
        if ($this->userId) {
            $data = $this->getUserData();
            $res = $data['NAME'].' '.$data['LAST_NAME'];
        }
        return $res;
    }
}

redpajama_set_name: RedPajamaGithub


text:
<TITLE>Review for Innocence (2000)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Innocence (2000)

reviewed by
Robin Clifford

"Innocence"

Five decades ago, Andreas (Charles Tingwell) and Claire (Julia Blake)
shared a passionate romance in Belgium, following World War II, then went
their separate ways. Now, a half-century later, they discover that they
live in the same Australian city and it soon becomes evident that their
love of so long ago has not faded. Although Andreas is a widower, Claire is
married and is torn between her loyalty to husband John (Terry Norris) and
the passion she still feels for her former lover in "Innocence."

Director Paul Cox is known for his artistic portrayals of life, such as
that of a lonely, aging voyeur in "A Man of Flowers" and a woman dying with
dignity in "A Woman's Tale." With "Innocence" the helmer/writer takes a
radically different filmic path with a subject matter - a long parted
couple, now aged, and their rekindled passion - that is not the kind of
thing one gets from Hollywood. With its theme of senior love, it is the
kind of thing that the internationally acclaimed filmmaker would explore,
though, and he is moderately successful in his effort. High marks go to Cox
for having the gonads to depict life during the twilight years where love
and passion are still real.

Using ample, even overused, flashbacks shot with a handheld camera and
exhibiting a grainy garishness, we see Claire (Kristine Van Pellicom) and
Andreas (Kenny Aernouts), 50-years younger, walking hand in hand,
frolicking around Belgium and making mad, passionate love. (Truth be told,
the flashbacks are the biggest problem with the film, taking up too much
time showing a young couple almost void of any real personality.) This sets
the stage for what will happen many years later to the young lovers after
they are, seemingly, parted forever.

We come to the present and meet septuagenarian Andreas, whose wife died
some 30 years ago and, since that time, he has reminisced about his first
love, Claire. When he learns that she lives nearby, he writes to her,
almost begging to see her again. Although Claire is married now, old
feelings flood back and she agrees to meet with her old flame. Their
passions are rekindled and Claire must make a choice between her
long-standing marriage and her newly re-sparked relationship with Andreas.

This study in elderly romance is handled with dignity as Cox shifts between
the modern-day love affair of Claire and Andreas and the long ago, though
not forgotten, involvement when the two were so much younger (but,
definitely, not more impassioned). The story segues between the quiet,
loving romance of the elder couple and the more energetic ardor when they
were young. The present-day interlude, as the couple beds down together
after half a century apart, is handled with sensitivity as the camera
lingers over their quiet loving that still has the fire (though a bit more
slowly generated) of their younger years..

Cox kicks it up a notch as he throws Claire's marriage into the mixture
with she and husband John coping with their side of this aging love
triangle. Married for over 40 years ("44 years, 3 months and 6 days,"
Claire informs John), there has not been a physical relationship between
them for two decades. When she drops the news of her newly awakened desires
for Andreas, John, at first, simply doesn't believe it, then, as the
reality sinks in, is angered, hurt and confused. Claire decides to accept
the consequences of her action and a tense truce is arrived at, but not
before John sends his physician son David (Robert Menzies ) to find out
what's wrong. Meanwhile, the widowed Andreas confides his feelings to his
incredulous daughter, Monique (Marta Dusseldorp), and garners her support.

Julia Blake takes charismatic hold of the screen as the still beautiful
Claire. The actress is the one in charge here as Claire is the one who
makes the decisions concerning her life and those of Andreas and John.
Blake has regal good looks and comes across as attractive and a convincing
object of desire for both of her men. Blake's real-life husband Norris
gives a solid tragic/comic performance as movie husband, John, who is torn
between maintaining the failing status quo of his marriage and the desire
to keep his wife, no matter what the cost. Charles Tingwell (one of the
heroes in the wonderful Aussie comedy, "The Castle") is two dimensional, at
best, and acts mainly as the catalyst for the changes that are to be
visited on the three senior citizens. The limited supporting cast helps to
give some depth to the background, but the focus is on the three principles
throughout the film.

There is a staginess to the proceedings that gives the film a static,
TV-like look that is more suited to the small screen. If an actress of a
lesser caliber than Blake were the focus of the film, I'd say that it
should go directly to television. Her performance, though, is worth the
price of theater admission. The subject matter is so fresh and untrammeled
it begs to draw in more mature audiences to this sweet, melancholy story of
love at the end of life, though I doubt that you'll see it at the local
multiplex. "Innocence" travels ground that is rarely seen on the screen and
is handle with sensitive care. I give it a B.

For more Reeeling reviews visit www.reelingreviews.com

robin@reelingreviews.com
laura@reelingreviews.com

==========
X-RAMR-ID: 29683
X-Language: en
X-RT-ReviewID: 252506
X-RT-TitleID: 1109599
X-RT-SourceID: 386
X-RT-AuthorID: 1488

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
<?php

/**
 * @param int $questionnaireID The questionnaire ID
 *
 * @returns The questionnaire database record.
 */
function getQuestionaire($questionnaireID) {
	global $db;

	$stmt = new tidy_sql($db, "
		SELECT * FROM Questionaires WHERE QuestionaireID=?", "i");

	$rows = $stmt->query($questionnaireID);

	return $rows[0];
}


text:
;(function( w, $ ) {

	var primaryMatch = {
		ajskldfjklasjdfkljaklsdf: $( "#ajskldfjklasjdfkljaklsdf" ),
		cursive: $( "#cursive" ),
		monospace: $( "#monospace" ),
		'sans-serif': $( "#sans-serif" ),
		serif: $( "#serif" ),
		fantasy: $( "#fantasy" )
	};

	var FFR = w.FontFamilyReunion = {
		success: [],
		error: [],
		getFontFamily: function( family ) {
			return 'font-family: ' + family;
		},
		getQuotedFontFamily: function( family ) {
			if( family in primaryMatch ) {
				return FFR.getFontFamily( family );
			}

			return 'font-family: \'' + family + '\'';
		},
		testDefaultMatch: function( family ) {
			// TODO use internal option from FontFaceOnload
			var testString = 'AxmTYklsjo190QW@#% This is a test string',
				fallbacks = {
					ajskldfjklasjdfkljaklsdf: "monospace",
					"sans-serif": "serif",
					serif: "sans-serif",
					cursive: "serif",
					fantasy: "serif",
					monospace: "sans-serif"
				},
				primary,
				secondary;

			for( primary in fallbacks ) {
				secondary = fallbacks[ primary ];
				FontFaceOnload( family, {
					timeout: 0, // local fonts only
					tolerance: 0,
					fallbacks: [ primary, secondary ],
					primaryMatch: function() {
						primaryMatch[ primary ].append( '

' + testString + ' ' + family + '

' + testString + '

' );
					}
				});
			}
		}
	};

	$( "#ua" ).html( navigator.userAgent );

	var $error = $( "#error" ),
		$success = $( "#success" ),
		deferreds = [];

	$.getJSON( "src/font-families.json" ).done(function( data ) {
		for( var j = 0, k = data.families.length; j < k; j++ ) {
			(function( family ) {
				var deferred = $.Deferred(),
					fallbacks = {
						"sans-serif": [ "serif", "monospace" ],
						serif: [ "sans-serif", "monospace" ]
					};

				FontFaceOnload( family, {
					timeout: 0, // local fonts only
					fallbacks: fallbacks[ family ] ? fallbacks[ family ] : undefined,
					success: function() {
						// $success.append( '
' + family + '

' + family + '
' );
						FFR.success.push( family );
						deferred.resolve();
					},
					error: function() {
						// $error.append( '
' + family + ' 

' + family + '
' );
						FFR.error.push( family );
						deferred.resolve();
					}
				});

				deferreds.push( deferred.promise() );
			})( data.families[ j ] );
		}

		$.when.apply( deferreds ).then(function() {
			$success.find( "textarea" ).val( JSON.stringify( FFR.success ) );

			if( confirm( "Save?" ) ) {
				$.ajax({
					type: 'POST',
					url: 'http://192.168.2.27:3000/save',
					data: {
						ua: navigator.userAgent,
						families: FFR.success.join( ',' )
					},
					dataType: 'json',
					success: function() {
						alert( 'Saved' );
					}
				});
			}

			var success = FFR.success;
			for( var j = 0, k = success.length; j < k; j++ ) {
				FFR.testDefaultMatch( success[ j ] );
			}
		});
	});

}( this, jQuery ));


text:
status: publish
tags:
- employees
- fredericiana
- international
- mozilla
- osl
published: true
title: Mozilla Across the Globe
type: post
meta:
  aktt_tweeted: "1"
  _edit_last: "2"
  aktt_notify_twitter: "yes"
layout: post
---
My colleague Dave made a little Google Maps mashup, illustrating where in the world Mozilla employees are. The result is quite an impressive map:

Over at Dave's blog, you can actually zoom in to see more closely where people are. The one in Munich, Germany, is yours truly, by the way.


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using DecoratorLib;

namespace WinFormsApp
{
    public partial class MainForm : Form
    {
        private BindingList<Jedi> _jediList;

        public MainForm()
        {
            InitializeComponent();

            // Create the binding list
            var jediList = new List<Jedi>();

            // Add json logging
            var jsonDecorator = new JsonLoggingDecorator<Jedi>
                (jediList);

            var xmlDecorator = new XmlLoggingDecorator<Jedi>
                (jsonDecorator);

            // Bind list to the data grid
            _jediList = new BindingList<Jedi>(xmlDecorator);
            jediBindingSource.DataSource = _jediList;
        }

        private void addButton_Click(object sender, EventArgs e)
        {
            var jedi = new Jedi
            {
                Name = nameTextBox.Text,
                Rank = (Rank) Enum.Parse(typeof(Rank),
                    rankTextBox.Text),
                Years = int.Parse(yearsTextBox.Text)
            };
            _jediList.Add(jedi);
        }

        private void removeButton_Click(object sender, EventArgs e)
        {
            var jedi = (Jedi)jediBindingSource.Current;
            _jediList.Remove(jedi);
        }
    }
}


text:
void searchByClub(LinkedList<Item> mData, string searchKey)
{
	Node<Item> *tmp;
	Node<Item> *before;

	tmp = mData.mHead;
	before = mData.mHead;

	while (tmp != NULL) // While list not empty or not end of list
	{
		if (tmp->mData.getNameOwner() == searchKey) //if club is same as searchkey, return every items
		{
			cout << endl << tmp->mData << endl;
		}
		before = tmp;
		tmp = tmp->mNext;
	}

	if (tmp == NULL) // Club doesn't have item
	{
		cout <<"Club " << searchKey << " does not have items or does not exist." << endl;
	}
}

void searchByLocationBuilding(LinkedList<Item> mData, string searchKey)
{
	Node<Item> *tmp;
	Node<Item> *before;

	tmp = mData.mHead;
	before = mData.mHead;

	while (tmp != NULL) // While list not empty or not end of list
	{
		if (tmp->mData.getLocation().getBuilding() == searchKey) //if location is same as searchkey, return every items
		{
			cout << endl << tmp->mData << endl;
		}
		before = tmp;
		tmp = tmp->mNext;
	}

	if (tmp == NULL) // Location doesnt have item
	{
		cout << "No item in this building: " << searchKey << endl;
	}
}

void searchByLocationRoom(LinkedList<Item> mData, string searchKey)
{
	Node<Item> *tmp;
	Node<Item> *before;

	tmp = mData.mHead;
	before = mData.mHead;

	while (tmp != NULL) // While list not empty or not end of list
	{
		if (tmp->mData.getLocation().getRoom() == searchKey) //if location is same as searchkey, return every items
		{
			cout << endl << tmp->mData << endl;
		}
		before = tmp;
		tmp = tmp->mNext;
	}

	if (tmp == NULL) // Room doesn't have item
	{
		cout << "No item in this room: " << searchKey << endl;
	}
}

void searchBySerial(LinkedList<Item> mData, int searchKey)
{
	Node<Item> *tmp;
	Node<Item> *before;

	tmp = mData.mHead;
	before = mData.mHead;

	while (tmp != NULL) // While list not empty or not end of list
	{
		if (tmp->mData.getSerial() == searchKey) //if serial is same as searchkey, return item
		{
			cout << endl << tmp->mData << endl;
		}
		before = tmp;
		tmp = tmp->mNext;
	}

	if (tmp == NULL) // Serial doesn't exist
	{
		cout << "Item with serial " << searchKey << " does not exist." << endl;
	}
}

void searchBySeller(LinkedList<Item> mData, string searchKey)
{
	Node<Item> *tmp;
	Node<Item> *before;

	tmp = mData.mHead;
	before = mData.mHead;

	while (tmp != NULL) // While list not empty or not end of list
	{
		if (tmp->mData.getSource().getSeller() == searchKey) //if seller is same as searchkey, return every items
		{
			cout << endl << tmp->mData << endl;
		}
		before = tmp;
		tmp = tmp->mNext;
	}

	if (tmp == NULL) // Seller doesn't have item
	{
		cout << "Seller " << searchKey << " does not exist." << endl;
	}
}

void searchByType(LinkedList<Item> mData, string searchKey)
{
	Node<Item> *tmp;
	Node<Item> *before;

	tmp = mData.mHead;
	before = mData.mHead;

	while (tmp != NULL) // While list not empty or not end of list
	{
		if (tmp->mData.getNameType() == searchKey) //if type is same as searchkey, return every items
		{
			cout << endl << tmp->mData << endl;
		}
		before = tmp;
		tmp = tmp->mNext;
	}

	if (tmp == NULL) // Type doesn't have item
	{
		cout << "Type " << searchKey << " does not exist." << endl;
	}
}


text:
package com.example.cmput301f17t27.nume.account;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.example.cmput301f17t27.nume.R;
import com.example.cmput301f17t27.nume.various.SaveLoadController;

/**
 * Activity where the user can edit their NuMe account
 * @author CMPUT301F17T27
 * @version 1.0
 * @see
 * @since 1.0
 */
public class EditProfileActivity extends AppCompatActivity {
    //Request codes for startingActivityForResult
    protected static final int NO_ACTION_RESULT_CODE = 0;
    protected static final int UPDATE_PROFILE_RESULT_CODE = 2;

    //Profile var declaration
    private Profile profile;

    //UI declarations
    private EditText fullName;
    private Button saveButton;
    private Button cancelButton;

    /**
     *
     * @param savedInstanceState
     */
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_edit_profile);

        //Un-bundle the profile sent from the activity where the drawer button was clicked
        Bundle bundle = getIntent().getExtras();
        profile = (Profile) bundle.getSerializable("PROFILE");

        //UI definitions
        fullName = (EditText) findViewById(R.id.fullname_edit);
        saveButton = (Button) findViewById(R.id.savebutton);
        cancelButton = (Button) findViewById(R.id.cancelbutton);

        //Fill in the name UI field
        fullName.setText(profile.getName());

        //Setup the listener for the save button
        saveButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //Get the name string from the UI field
                String newName = fullName.getText().toString();

                //If the UI field is not empty
                if(newName.length() != 0) {
                    //Update the name in the profile
                    profile.setName(newName);

                    //Save the profile
                    SaveLoadController.saveProfile(EditProfileActivity.this, profile);

                    //Bundle up the profile and return to the habit list activity
                    Intent intent = new Intent();
                    Bundle bundle = new Bundle();
                    bundle.putSerializable("PROFILE", profile);
                    intent.putExtras(bundle);
                    setResult(UPDATE_PROFILE_RESULT_CODE, intent);
                    finish();
                }

                //If the UI field is empty
                else {
                    Toast.makeText(EditProfileActivity.this, "Please enter a name", Toast.LENGTH_SHORT).show();
                }
            }
        });

        //Setup the listener for the cancel button
        cancelButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent();
                setResult(NO_ACTION_RESULT_CODE, intent);
                finish();
            }
        });
    }
}


text:
// ------------------------------------------------------------
//  Copyright (c) Microsoft Corporation.  All rights reserved.
//  Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
// ------------------------------------------------------------

using System;

namespace QuickService.Common.Diagnostics
{
    /// <summary>
    /// Count per second structure used to track the service RPS.
    /// </summary>
    public struct CountPerSecond
    {
        internal readonly Int64 _tick;
        internal readonly Int64 _count;

        /// <summary>
        /// CountPerSecond Constructor.
        /// </summary>
        /// <param name="tick">Tick count when the structure was initialized.</param>
        /// <param name="count">Count.</param>
        internal CountPerSecond(Int64 tick, Int64 count)
        {
            _tick = tick == 0 ? DateTime.Now.Ticks : tick;
            _count = count;
        }

        /// <summary>
        /// Default counts per second.
        /// </summary>
        public static readonly CountPerSecond Zero = new CountPerSecond(0, 0);

        /// <summary>
        /// Increments the request count by N.
        /// </summary>
        /// <param name="cps">Current CountPerSecond instance.</param>
        /// <param name="addend">Number of counts to increment.</param>
        /// <returns>A new CountPerSecond instance with the count incremented by the value of the addend.</returns>
        public static CountPerSecond operator +(CountPerSecond cps, Int32 addend) => new CountPerSecond(cps._tick, cps._count + addend);

        /// <summary>
        /// Get the latest request per second value.
        /// </summary>
        /// <returns>Long integer containing the number of count per second.</returns>
        public Int64 GetLatest() => _count / Math.Max(1, (DateTime.Now.Ticks - _tick) / TimeSpan.TicksPerSecond);

        /// <summary>
        /// Allows casting of a CountPerSecond instance to a long value.
        /// </summary>
        /// <param name="cps"></param>
        public static implicit operator Int64(CountPerSecond cps) => cps.GetLatest();

        /// <summary>
        /// Get the string value of the count per second.
        /// </summary>
        /// <returns>String instance containing the current number of count per second.</returns>
        public override string ToString() => GetLatest().ToString();
    }
}


text:
package com.microsoft.azure.management.storage.v2019_04_01;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Lease Container request schema.
 */
public class LeaseContainerRequest {
    /**
     * Specifies the lease action. Can be one of the available actions.
     * Possible values include: 'Acquire', 'Renew', 'Change', 'Release',
     * 'Break'.
     */
    @JsonProperty(value = "action", required = true)
    private String action;

    /**
     * Identifies the lease. Can be specified in any valid GUID string format.
     */
    @JsonProperty(value = "leaseId")
    private String leaseId;

    /**
     * Optional. For a break action, proposed duration the lease should
     * continue before it is broken, in seconds, between 0 and 60.
     */
    @JsonProperty(value = "breakPeriod")
    private Integer breakPeriod;

    /**
     * Required for acquire. Specifies the duration of the lease, in seconds,
     * or negative one (-1) for a lease that never expires.
     */
    @JsonProperty(value = "leaseDuration")
    private Integer leaseDuration;

    /**
     * Optional for acquire, required for change. Proposed lease ID, in a GUID
     * string format.
     */
    @JsonProperty(value = "proposedLeaseId")
    private String proposedLeaseId;

    /**
     * Get specifies the lease action. Can be one of the available actions. Possible values include: 'Acquire', 'Renew', 'Change', 'Release', 'Break'.
     *
     * @return the action value
     */
    public String action() {
        return this.action;
    }

    /**
     * Set specifies the lease action. Can be one of the available actions. Possible values include: 'Acquire', 'Renew', 'Change', 'Release', 'Break'.
     *
     * @param action the action value to set
     * @return the LeaseContainerRequest object itself.
     */
    public LeaseContainerRequest withAction(String action) {
        this.action = action;
        return this;
    }

    /**
     * Get identifies the lease. Can be specified in any valid GUID string format.
     *
     * @return the leaseId value
     */
    public String leaseId() {
        return this.leaseId;
    }

    /**
     * Set identifies the lease. Can be specified in any valid GUID string format.
     *
     * @param leaseId the leaseId value to set
     * @return the LeaseContainerRequest object itself.
     */
    public LeaseContainerRequest withLeaseId(String leaseId) {
        this.leaseId = leaseId;
        return this;
    }

    /**
     * Get optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60.
     *
     * @return the breakPeriod value
     */
    public Integer breakPeriod() {
        return this.breakPeriod;
    }

    /**
     * Set optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60.
     *
     * @param breakPeriod the breakPeriod value to set
     * @return the LeaseContainerRequest object itself.
     */
    public LeaseContainerRequest withBreakPeriod(Integer breakPeriod) {
        this.breakPeriod = breakPeriod;
        return this;
    }

    /**
     * Get required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires.
     *
     * @return the leaseDuration value
     */
    public Integer leaseDuration() {
        return this.leaseDuration;
    }

    /**
     * Set required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires.
     *
     * @param leaseDuration the leaseDuration value to set
     * @return the LeaseContainerRequest object itself.
     */
    public LeaseContainerRequest withLeaseDuration(Integer leaseDuration) {
        this.leaseDuration = leaseDuration;
        return this;
    }

    /**
     * Get optional for acquire, required for change. Proposed lease ID, in a GUID string format.
     *
     * @return the proposedLeaseId value
     */
    public String proposedLeaseId() {
        return this.proposedLeaseId;
    }

    /**
     * Set optional for acquire, required for change. Proposed lease ID, in a GUID string format.
     *
     * @param proposedLeaseId the proposedLeaseId value to set
     * @return the LeaseContainerRequest object itself.
     */
    public LeaseContainerRequest withProposedLeaseId(String proposedLeaseId) {
        this.proposedLeaseId = proposedLeaseId;
        return this;
    }

}


text:
package com.github.javarch.support.data;

/**
 * Data needed to put a file into {@link FileStorage}.
 * @author Keith Donald
 */
public final class FileData {

	private final String name;

	private final byte[] bytes;

	private final String contentType;

	public FileData(String name, byte[] bytes, String contentType) {
		this.name = name;
		this.bytes = bytes;
		this.contentType = contentType;
	}

	/**
	 * The name of the file.
	 */
	public String getName() {
		return name;
	}

	/**
	 * The file data as a byte array.
	 */
	public byte[] getBytes() {
		return bytes;
	}

	/**
	 * The file content type.
	 */
	public String getContentType() {
		return contentType;
	}

}


text:
require "rails/test_unit/runner"

if defined?(ENGINE_ROOT)
  $LOAD_PATH << File.expand_path("test", ENGINE_ROOT)
else
  $LOAD_PATH << File.expand_path("../../test", APP_PATH)
end

Rails::TestUnit::Runner.parse_options(ARGV)
Rails::TestUnit::Runner.run(ARGV)


text:
//
//  NSDateFormatter+PPDBLHelper.h
//  Pods
//
//  Created by wanyakun on 2017/3/27.
//
//

#import <Foundation/Foundation.h>

@interface NSDateFormatter (PPDBLHelper)

/**
 获取dateFormater实例

 @return dateFormatter实例
 */
+ (id)dateFormatter;

/**
 根据format获取formatter

 @param dateFormat format
 @return dateFormatter实例
 */
+ (id)dateFormatterWithFormat:(NSString *)dateFormat;

/**
 默认dateFormatter实例,格式为:yyyy-MM-dd HH:mm:ss

 @return dateFormatter实例
 */
+ (id)defaultDateFormatter;

@end


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Admin_model extends CI_Model {

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

	}

	public function get_post()
	{
		$data['title'] = 'Admin | Beheard';
		$this->db->where('adminusername', $this->session->userdata('adminusername'));
		$data['admin'] = $this->db->get('admin');
		$this->db->where_not_in('adminusername', 'super admin');
		$data['alladmins'] = $this->db->get('admin');
		$this->db->where('admin_id', $this->uri->segment(3));
		$data['adminselect'] = $this->db->get('admin');
		$data['articletype'] = $this->db->get('articletype');
		$articlet = str_replace('-',' ', $this->uri->segment(3));
		$this->db->select('*');
		$this->db->from('articletype');
		$this->db->where('articletypename',$articlet);
		$this->db->join('article', 'article.articletype = articletype.articletype_id');
		$data['article']= $this->db->get();
		$this->db->where('articletype_id', $this->uri->segment(3));
		$data['articletypeselect'] = $this->db->get('articletype');;
		$this->db->where('article_id', $this->uri->segment(3));
		$data['articleselect'] = $this->db->get('article');
		$this->db->select('*');
		$this->db->from('article');
		$this->db->where('article_id', $this->uri->segment(3));
		$this->db->join('comments', 'comments.commentarticleid = article.article_id');
		$data['commentsquery']= $this->db->get();
		$this->db->where('name', 'facebook');
		$data['fbsocial'] = $this->db->get('social');
		$this->db->where('name', 'twitter');
		$data['twsocial'] = $this->db->get('social');
		$this->db->where('name', 'google plus');
		$data['gpsocial'] = $this->db->get('social');
		$this->db->where('social_id', $this->uri->segment(3));
		$data['fbsocialedit'] = $this->db->get('social');
		$this->db->where('social_id', $this->uri->segment(3));
		$data['twsocialedit'] = $this->db->get('social');
		$this->db->where('social_id', $this->uri->segment(3));
		$data['gpsocialedit'] = $this->db->get('social');
		return $data;
	}

	public function get_editprofile()
	{
		$data['title'] = 'Edit Admin | Beheard';
		$this->db->where('adminusername', $this->session->userdata('adminusername'));
		$data['admin'] = $this->db->get('admin');
		return $data;
	}

	public function get_editpicture()
	{
		$data['title'] = 'Edit Admin Picture | Beheard';
		$this->db->where('adminusername', $this->session->userdata('adminusername'));
		$data['admin'] = $this->db->get('admin');
		return $data;
	}

	public function get_editedpicture()
	{
		$file_data = $this->upload->data();

		$edit_the_picture = array(
			'adminphoto' =>  $file_data['file_name']
			);

		$this->db->where('adminusername', $this->session->userdata('adminusername'));
		$update = $this->db->update('admin', $edit_the_picture);
		return $update;
	}

	public function get_editedprofile()
	{
		$edit_the_profile = array(
			'screenname' => $this->input->post('screenname'),
			'adminfirstname' => $this->input->post('adminfirstname'),
			'adminsurname' => $this->input->post('adminsurname'),
			'adminemail' => $this->input->post('adminemail'),
			'adminnumber' => $this->input->post('adminnumber'),
			'admindescription' => $this->input->post('admindescription'),
			);

		$this->db->where('adminusername', $this->session->userdata('adminusername'));
		$update = $this->db->update('admin', $edit_the_profile);
		return $update;
	}

	public function get_addedadmin()
	{
		$add_the_admin = array(
			'adminusername' => $this->input->post('adminusername'),
			'adminpassword' => md5($this->input->post('adminpassword')),
			'screenname' => $this->input->post('screenname'),
			'adminfirstname' => $this->input->post('adminfirstname'),
			'adminsurname' => $this->input->post('adminsurname'),
			'adminemail' => $this->input->post('adminemail'),
			'adminnumber' => $this->input->post('adminnumber'),
			'admindescription' => $this->input->post('admindescription'),
			);

		$insert = $this->db->insert('admin', $add_the_admin);
		return $insert;
	}

	public function get_editedadmin()
	{
		$edit_the_admin = array(
			'screenname' => $this->input->post('screenname'),
			'adminfirstname' => $this->input->post('adminfirstname'),
			'adminsurname' => $this->input->post('adminsurname'),
			'adminemail' => $this->input->post('adminemail'),
			'adminnumber' => $this->input->post('adminnumber'),
			'admindescription' => $this->input->post('admindescription'),
			);

		$this->db->where('admin_id', $this->input->post('admin_id'));
		$update = $this->db->update('admin', $edit_the_admin);
		return $update;
	}

	public function get_deleteadmin()
	{
		$this->db->where('admin_id', $this->uri->segment(3));
		$delete = $this->db->delete('admin');
		return $delete;
	}

	public function get_addedarticletype()
	{
		$add_the_articletype = array(
			'articletypename' => $this->input->post('articletypename'),
			);

		$insert = $this->db->insert('articletype', $add_the_articletype);
		return $insert;
	}

	public function get_editedarticletype()
	{
		$edit_the_articletype = array(
			'articletypename' => $this->input->post('articletypename')
			);

		$this->db->where('articletype_id', $this->input->post('articletype_id'));
		$update = $this->db->update('articletype', $edit_the_articletype);
		return $update;
	}

	public function get_deletearticletype()
	{
		$this->db->where('articletype_id', $this->uri->segment(3));
		$delete = $this->db->delete('articletype');
		return $delete;
	}

	public function get_addedarticle()
	{

		$file_data = $this->upload->data();
		$thearttype = $this->input->post('articletype');
		$this->db->where('articletypename',$thearttype);
		$gettheart = $this->db->get('articletype');
		foreach($gettheart->result() as $gettheartrow)
		{
			$getarttype = $gettheartrow->articletype_id;
		}

		$add_the_article = array(
			'picture' =>  $file_data['file_name'],
			// 'articletype' => $this->input->post('articletype'),
			'articletype' => $getarttype,
			'typeofnews' => $this->input->post('typeofnews'),
			'headline' => $this->input->post('headline'),
			'author' => $this->input->post('author'),
			'leadstory' => $this->input->post('leadstory'),
			'body' => $this->input->post('body'),
			'picturesource' => $this->input->post('picturesource'),
			'dateposted' => date('Y-m-d')
			);

		$insert = $this->db->insert('article', $add_the_article);
		return $insert;
	}

	public function get_editedarticle()
	{
		$edit_the_article = array(
			'typeofnews' => $this->input->post('typeofnews'),
			'headline' => $this->input->post('headline'),
			'author' => $this->input->post('author'),
			'leadstory' => $this->input->post('leadstory'),
			'body' => $this->input->post('body')
			);

		$this->db->where('article_id', $this->input->post('article_id'));
		$update = $this->db->update('article', $edit_the_article);
		return $update;
	}

	public function get_editedarticlepicture()
	{
		$file_data = $this->upload->data();

		$edit_the_picture = array(
			'picture' =>  $file_data['file_name'],
			'picturesource' => $this->input->post('picturesource')
			);

		$this->db->where('article_id', $this->input->post('article_id'));
		$update = $this->db->update('article', $edit_the_picture);
		return $update;
	}

	public function get_deletearticle()
	{
		$this->db->where('article_id', $this->uri->segment(3));
		$delete = $this->db->delete('article');
		return $delete;
	}

	public function get_deletecomment()
	{
		$this->db->where('comment_id', $this->uri->segment(3));
		$delete = $this->db->delete('comments');
		return $delete;
	}

	public function get_editedsocial()
	{
		$edit_the_social = array(
			'link' => $this->input->post('link')
			);

		$this->db->where('social_id', $this->input->post('social_id'));
		$update = $this->db->update('social', $edit_the_social);
		return $update;
	}

	public function get_changedpassword()
	{
		$chng_the_adminpass = array(
			'adminpassword' => md5($this->input->post('newpassword'))
			);

		$this->db->where('adminusername', $this->session->userdata('adminusername'));
		$update = $this->db->update('admin', $chng_the_adminpass);
		return $update;
	}
}

/* End of file admin_model.php */
/* Location: ./application/models/admin_model.php */


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <title>ally.fix.pointerFocusChildren Example</title>
  <link rel="jsbin" href="https://jsbin.com/gomofa/">

ally.fix.pointerFocusChildren Example

There are two focusable div elements in this document, each containing two span element children layed out using FlexBox. The first div element exhibits the undesired behavior upon click, the second div element is covered by ally.fix.pointerFocusChildren.

Natural Browser Behavior

      one
      two

Fixed Behavior

      one
      two


text:
<!DOCTYPE html>
<html lang="en">

<head>
    <title>Best books of 2015 : NPR</title>

    <meta name="twitter:card" content="summary">
    <meta name="twitter:site" content="nprbooks">
    <meta name="twitter:image" content="http://apps.npr.org/best-books-2015/assets/cover/takeaction-minnesota.jpg" />

    <meta property="og:title" content="NPR's Best Books of 2015 - TakeAction Minnesota" />
    <meta property="og:url" content="http://127.0.0.1:8000/share/takeaction-minnesota.html" />
    <meta property="og:type" content="article" />
    <meta property="og:description" content="&#8220;TakeAction Minnesota is a strong individual membership (15,000+ dues paying individuals &amp; 23 organizations ranging from unions to ...&#8221;" />
    <meta property="og:image" content="http://apps.npr.org/best-books-2015/assets/cover/takeaction-minnesota.jpg" />
    <meta property="og:site_name" content="NPR.org" />
    <meta property="fb:app_id" content="1.38837436155e+14" />

    <meta name="thumbnail" content="http://apps.npr.org/best-books-2015/assets/cover/takeaction-minnesota.jpg" />
</head>

<body>
</body>

</html>


text:
package GenericLayer;

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

public class TempSearchPatientTest {

    public searchRepository searchRepository;

    @BeforeClass
    public void setUp(){
     searchRepository = Factory.getDriver();
    }

    @Test
    public void searchPatient() {
        Assert.assertTrue(searchRepository.doesPatientExist("1234599"));
    }
}


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Welcome extends CI_Controller {
	public function __construct() {
		parent::__construct();
		$this->load->model('post_model');
		$this->load->model('statistik_model');
		if(!isset($_SESSION['statistic']) or empty($_SESSION['statistic'])) {
			$_SESSION['statistic'] = dechex(rand(0x000000, 0xFFFFFF));
		}
	}

	public function index()
	{
		$this->statistik_model->insert_stat($_SESSION['statistic'],'home');
		$data['all_posts'] = $this->post_model->all_post(0)->result();
		$data['title'] = "Home";
		$data['desc'] = "Selamat datang di web-nya Ahmad 'AYA' Sanusi. Sebuah web log yang berisi apa saja hal yang penulis sukai, mulai dari linux, web development, Anime, dan Manga";
		$data['ogimage'] = "https://sanusi.me/ss.png";
		$data['sharer_links'] = $this->sharer_link();
		$this->load->view('templates/header',$data);
		$this->load->view('home',$data);
	}

	private function sharer_link() {
		$socmed = array(
			'facebook' => 'https://www.facebook.com/sharer.php?u=',
			'google-plus' => 'https://plus.google.com/share?url=',
			'twitter' => 'https://twitter.com/intent/tweet?url=',
			'pinterest' => 'https://pinterest.com/pin/create/bookmarklet/?url=',
			'linkedin' => 'https://www.linkedin.com/shareArticle?url=',
			'reddit' => 'https://reddit.com/submit?url='
		);
		return $socmed;
	}

	public function view($slug) {
		$getposts = $this->post_model->single_post('post',$slug);
		if(!empty($getposts->row('title')) OR $getposts->row('title') != NULL) {
			$data['all_posts'] = $getposts->result();
			$data['title'] = $getposts->row('title');
			$data['desc'] = $getposts->row('excerpt');
			$data['ogimage'] = $getposts->row('ogimage');
			$this->statistik_model->insert_stat($_SESSION['statistic'],$data['title']);
			$data['sharer_links'] = $this->sharer_link();
			$this->load->view('templates/header',$data);
			$this->load->view('home',$data);
		} else {
			$this->notfound();
		}
	}

	public function category($slug) {
		$getcategories = $this->post_model->search_by_meta('category',$slug);
		if(!empty($getcategories->row('title')) OR $getcategories->row('title') != NULL) {
			$this->statistik_model->insert_stat($_SESSION['statistic'],$slug);
			$data['all_posts'] = $getcategories->result();
			$data['title'] = $slug;
			$data['desc'] = "All post under ".$slug." category";
			$data['ogimage'] = "https://sanusi.me/ss.png";
			$this->load->view('templates/header',$data);
			$this->load->view('search',$data);
		} else {
			$this->notfound();
		}
	}

	public function tag($slug) {
		$getcategories = $this->post_model->search_by_meta('tags',$slug);
		if(!empty($getcategories->row('title')) OR $getcategories->row('title') != NULL) {
			$this->statistik_model->insert_stat($_SESSION['statistic'],$slug);
			$data['all_posts'] = $getcategories->result();
			$data['title'] = $slug;
			$data['desc'] = "All post under ".$slug." category";
			$data['ogimage'] = "https://sanusi.me/ss.png";
			$this->load->view('templates/header',$data);
			$this->load->view('search',$data);
		} else {
			$this->notfound();
		}
	}

	public function search() {
		if($this->input->post('search') == NULL ) {
			header('Location: '.base_url());
		} else {
			$this->statistik_model->insert_stat($_SESSION['statistic'],$this->input->post('search'));
			$search_result = $this->post_model->search_engine($this->input->post('search'));
			if(empty($search_result) OR $search_result == NULL) {
				$this->notfound();
			} else {
				$data['all_posts'] = $search_result->result();
				$data['title'] = "Search result for: ".$this->input->post('search');
				$data['desc'] = "Search result for: ".$this->input->post('search');
				$data['ogimage'] = "https://sanusi.me/ss.png";
				$this->load->view('templates/header',$data);
				$this->load->view('search',$data);
			}
		}
	}

	private function notfound() {
		$data['title'] = "Error!! 410 Gone! 404 Not Found";
		$data['desc'] = "Error!! 410 Gone! 404 Not Found!";
		$data['ogimage'] = "https://sanusi.me/ss.png";
		$this->load->view('templates/header',$data);
		$this->load->view('notfound');
	}

}


text:
@extends('canvas::backend.layout')

@section('title')
    <title>{{ \Canvas\Models\Settings::blogTitle() }} | Edit Tag</title>
@stop

@section('content')

        @include('canvas::backend.shared.partials.sidebar-navigation')

Home

Tags

Edit Tag

                        @include('canvas::backend.shared.partials.errors')
                        @include('canvas::backend.shared.partials.success')

                            Edit {{ $data['title'] }}

                                @if(isset($data['updated_at']))
                                    Last edited on {{$data['updated_at']->format('M d, Y') }} at {{ $data['updated_at']->format('g:i A') }}
                                @else
                                    Last edited on {{ $data['created_at']->format('M d, Y') }} at {{ $data['created_at']->format('g:i A') }}
                                @endif

                        <form class="keyboard-save" role="form" method="POST" id="tagUpdate" action="{!! route('canvas.admin.tag.update', $data['id']) !!}">
                            <input type="hidden" name="_token" value="{{ csrf_token() }}">
                            <input type="hidden" name="_method" value="PUT">
                            <input type="hidden" name="id" value="{{ $data['id'] }}">

                            @include('canvas::backend.tag.partials.form')

                                <button type="submit" class="btn btn-primary btn-icon-text">
                                     Save
                                </button>
                                <button type="button" class="btn btn-danger btn-icon-text" data-toggle="modal" data-target="#modal-delete">
                                     Delete
                                </button>

                        </form>

    @include('canvas::backend.tag.partials.modals.delete')
@stop

@section('unique-js')
    {!! JsValidator::formRequest('Canvas\Http\Requests\TagUpdateRequest', '#tagUpdate') !!}
    @if(Session::get('_update-tag'))
        @include('canvas::backend.shared.notifications.notify', ['section' => '_update-tag'])
        {{ \Session::forget('_update-tag') }}
    @endif
@stop


text:
package org.apache.camel.component.elasticsearch.converter;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.camel.Converter;
import org.apache.camel.Exchange;
import org.apache.camel.component.elasticsearch.ElasticsearchConstants;
import org.apache.camel.util.ObjectHelper;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
import org.elasticsearch.action.bulk.BulkRequest;
import org.elasticsearch.action.delete.DeleteRequest;
import org.elasticsearch.action.get.GetRequest;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.update.UpdateRequest;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Converter(generateLoader = true)
public final class ElasticsearchActionRequestConverter {
    private static final Logger LOG = LoggerFactory.getLogger(ElasticsearchActionRequestConverter.class);

    private static final String ES_QUERY_DSL_PREFIX = "query";

    private ElasticsearchActionRequestConverter() {
    }

    // Update requests
    private static UpdateRequest createUpdateRequest(Object document, Exchange exchange) {
        if (document instanceof UpdateRequest) {
            return (UpdateRequest) document;
        }
        UpdateRequest updateRequest = new UpdateRequest();
        if (document instanceof byte[]) {
            updateRequest.doc((byte[]) document);
        } else if (document instanceof Map) {
            updateRequest.doc((Map<String, Object>) document);
        } else if (document instanceof String) {
            updateRequest.doc((String) document, XContentFactory.xContentType((String) document));
        } else if (document instanceof XContentBuilder) {
            updateRequest.doc((XContentBuilder) document);
        } else {
            return null;
        }

        return updateRequest
                .waitForActiveShards(
                        exchange.getIn().getHeader(ElasticsearchConstants.PARAM_WAIT_FOR_ACTIVE_SHARDS, Integer.class))
                .index(exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_NAME, String.class))
                .id(exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_ID, String.class));
    }

    // Index requests
    private static IndexRequest createIndexRequest(Object document, Exchange exchange) {
        if (document instanceof IndexRequest) {
            return (IndexRequest) document;
        }
        IndexRequest indexRequest = new IndexRequest();
        if (document instanceof byte[]) {
            indexRequest.source((byte[]) document, XContentFactory.xContentType((byte[]) document));
        } else if (document instanceof Map) {
            indexRequest.source((Map<String, Object>) document);
        } else if (document instanceof String) {
            indexRequest.source((String) document, XContentFactory.xContentType((String) document));
        } else if (document instanceof XContentBuilder) {
            indexRequest.source((XContentBuilder) document);
        } else {
            return null;
        }

        return indexRequest
                .waitForActiveShards(
                        exchange.getIn().getHeader(ElasticsearchConstants.PARAM_WAIT_FOR_ACTIVE_SHARDS, Integer.class))
                .index(exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_NAME, String.class));
    }

    @Converter
    public static IndexRequest toIndexRequest(Object document, Exchange exchange) {
        IndexRequest indexRequest = createIndexRequest(document, exchange);

        // NOTE: although we dodge the NPE here, it may still throw it somewhere else
        if (indexRequest != null) {
            indexRequest.id(exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_ID, String.class));
        }

        return indexRequest;
    }

    @Converter
    public static UpdateRequest toUpdateRequest(Object document, Exchange exchange) {
        UpdateRequest updateRequest = createUpdateRequest(document, exchange);

        // NOTE: although we dodge the NPE here, it may still throw it somewhere else
        if (updateRequest != null) {
            updateRequest.id(exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_ID, String.class));
        }

        return updateRequest;
    }

    @Converter
    public static GetRequest toGetRequest(Object document, Exchange exchange) {
        if (document instanceof GetRequest) {
            return (GetRequest) document;
        }
        if (document instanceof String) {
            return new GetRequest(exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_NAME, String.class))
                    .id((String) document);
        }
        return null;
    }

    @Converter
    public static DeleteRequest toDeleteRequest(Object document, Exchange exchange) {
        if (document instanceof DeleteRequest) {
            return (DeleteRequest) document;
        }
        if (document instanceof String) {
            return new DeleteRequest().index(exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_NAME, String.class))
                    .id((String) document);
        }
        return null;
    }

    @Converter
    public static DeleteIndexRequest toDeleteIndexRequest(Object document, Exchange exchange) {
        if (document instanceof DeleteIndexRequest) {
            return (DeleteIndexRequest) document;
        }
        if (document instanceof String) {
            String index = exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_NAME, String.class);
            return new DeleteIndexRequest(index);
        }
        return null;
    }

    @Converter
    public static SearchRequest toSearchRequest(Object queryObject, Exchange exchange) throws IOException {
        String indexName = exchange.getIn().getHeader(ElasticsearchConstants.PARAM_INDEX_NAME, String.class);

        if (queryObject instanceof SearchRequest) {
            SearchRequest searchRequest = (SearchRequest) queryObject;
            String[] indices = searchRequest.indices();
            if (indices == null || indices.length == 0) {
                searchRequest.indices(indexName);
            }
            return searchRequest;
        }
        SearchRequest searchRequest = new SearchRequest();

        // Only setup the indexName if the message header has the
        // setting

        Integer size = exchange.getIn().getHeader(ElasticsearchConstants.PARAM_SIZE, Integer.class);
        Integer from = exchange.getIn().getHeader(ElasticsearchConstants.PARAM_FROM, Integer.class);
        if (ObjectHelper.isNotEmpty(indexName)) {
            searchRequest.indices(indexName);
        }

        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
        String queryText = null;

        if (queryObject instanceof Map<?, ?>) {
            Map<String, Object> mapQuery = (Map<String, Object>) queryObject;
            // Remove 'query' prefix from the query object for backward
            // compatibility
            if (mapQuery.containsKey(ES_QUERY_DSL_PREFIX)) {
                mapQuery = (Map<String, Object>) mapQuery.get(ES_QUERY_DSL_PREFIX);
            }
            try {
                XContentBuilder contentBuilder = XContentFactory.contentBuilder(XContentType.JSON);
                queryText = Strings.toString(contentBuilder.map(mapQuery));
            } catch (IOException e) {
                LOG.error("Cannot build the QueryText from the map.", e);
            }
        } else if (queryObject instanceof String) {
            queryText = (String) queryObject;
            ObjectMapper mapper = new ObjectMapper();
            JsonNode jsonTextObject = mapper.readValue(queryText, JsonNode.class);
            JsonNode parentJsonNode = jsonTextObject.get(ES_QUERY_DSL_PREFIX);
            if (parentJsonNode != null) {
                queryText = parentJsonNode.toString();
            }
        } else {
            // Cannot convert the queryObject into SearchRequest
            LOG.info("Cannot convert queryObject into SearchRequest object");
            return null;
        }
        if (size != null) {
            searchSourceBuilder.size(size);
        }
        if (from != null) {
            searchSourceBuilder.from(from);
        }
        searchSourceBuilder.query(QueryBuilders.wrapperQuery(queryText));
        searchRequest.source(searchSourceBuilder);

        return searchRequest;
    }

    @Converter
    public static BulkRequest toBulkRequest(Object documents, Exchange exchange) {
        if (documents instanceof BulkRequest) {
            return (BulkRequest) documents;
        }
        if (documents instanceof List) {
            BulkRequest request = new BulkRequest();
            for (Object document : (List<Object>) documents) {
                request.add(createIndexRequest(document, exchange));
            }
            return request;
        }
        return null;
    }

}


text:
package org.sakaiproject.pasystem.impl.acknowledgements;

import java.sql.SQLException;
import java.util.UUID;
import org.sakaiproject.pasystem.api.Acknowledger;
import org.sakaiproject.pasystem.impl.common.DB;
import org.sakaiproject.pasystem.impl.common.DBAction;
import org.sakaiproject.pasystem.impl.common.DBConnection;
import org.sakaiproject.pasystem.api.AcknowledgementType;

/**
 * Mark a popup or banner as acknowledged by a user.
 */
public class AcknowledgementStorage {

    public enum NotificationType {
        BANNER,
        POPUP
    }

    private final String tableName;

    public AcknowledgementStorage(NotificationType type) {
        tableName = ("PASYSTEM_" + type + "_dismissed").toLowerCase();
    }

    /**
     * Record the fact that a user has acknowledged a particular popup/banner.
     */
    public void acknowledge(final String uuid, final String userEid, final AcknowledgementType acknowledgementType) {
        DB.transaction
                ("Acknowledge a notification on behalf of a user",
                        new DBAction<Void>() {
                            @Override
                            public Void call(DBConnection db) throws SQLException {
                                db.run("DELETE FROM " + tableName + " where uuid = ? AND user_eid = ?")
                                        .param(uuid)
                                        .param(userEid.toLowerCase())
                                        .executeUpdate();

                                db.run("INSERT INTO " + tableName + " (uuid, user_eid, state, dismiss_time) values (?, ?, ?, ?)")
                                        .param(uuid)
                                        .param(userEid.toLowerCase())
                                        .param(acknowledgementType.dbValue())
                                        .param(System.currentTimeMillis())
                                        .executeUpdate();

                                db.commit();
                                return null;
                            }
                        }
                );
    }

    /**
     * Forget all temporary acknowledgements created by a user.
     */
    public void clearTemporaryDismissedForUser(String userEid) {
        DB.transaction
                ("Delete all temporarily dismissed banners for a user",
                        new DBAction<Void>() {
                            @Override
                            public Void call(DBConnection db) throws SQLException {
                                db.run("DELETE FROM " + tableName + " WHERE state = ? AND user_eid = ?")
                                        .param(AcknowledgementType.TEMPORARY.dbValue())
                                        .param(userEid)
                                        .executeUpdate();

                                db.commit();
                                return null;
                            }
                        }
                );
    }

}


text:
package scalacookbook.chapter11

/**
  * Created by liguodong on 2016/7/31.
  */
object AddElementToSet extends App{

  //Mutable set

  // use var with mutable 创建空的set
  var set = scala.collection.mutable.Set[Int]()

  // add one element
  set += 1   //scala.collection.mutable.Set[Int] = Set(1)

  // add multiple elements
  set += (2, 3)
  println(set)  //Set(1, 2, 3)

  // notice that there is no error when you add a duplicate element
  set += 2
  println(set) //Set(1, 2, 3)

  // add elements from any sequence (any TraversableOnce)
  set ++= Vector(4, 5) //scala.collection.mutable.Set[Int] = Set(2, 1, 4, 3, 5)
  println(set)

  set.add(6) //Boolean = true
  set.add(5) //Boolean = false
  println(set)

  //测试set集合中是否包含该元素
  println(set.contains(5))

  println("-----------------")

  //创建包含元素的set
  var set2 = scala.collection.mutable.Set(1, 2, 3)

  println(set2)

  println("--------------------")

  //Immutable set

  //create an immutable set
  val s1 = Set(1, 2)

  // add one element
  val s2 = s1 + 3

  // add multiple elements (+ method has a varargs field)
  val s3 = s2 + (4, 5)

  // add elements from another sequence
  val s4 = s3 ++ List(6, 7)

  println(s4)

  // declare your variable as a var,
  // and reassign the resulting set back to the same variable
  var set3 = Set(1, 2, 3)  //scala.collection.immutable.Set[Int] = Set(1, 2, 3)
  set3 += 4
  println(set3)

}


text:
package abi42_0_0.host.exp.exponent.modules.api.screens;

import android.content.Context;
import android.content.ContextWrapper;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.inputmethod.InputMethodManager;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;

import abi42_0_0.com.facebook.react.ReactRootView;
import abi42_0_0.com.facebook.react.modules.core.ChoreographerCompat;
import abi42_0_0.com.facebook.react.modules.core.ReactChoreographer;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;

public class ScreenContainer<T extends ScreenFragment> extends ViewGroup {

  protected final ArrayList<T> mScreenFragments = new ArrayList<>();

  protected @Nullable FragmentManager mFragmentManager;
  private @Nullable FragmentTransaction mCurrentTransaction;
  private @Nullable FragmentTransaction mProcessingTransaction;
  private boolean mNeedUpdate;
  private boolean mIsAttached;
  private boolean mLayoutEnqueued = false;
  private @Nullable ScreenFragment mParentScreenFragment = null;

  private final ChoreographerCompat.FrameCallback mFrameCallback = new ChoreographerCompat.FrameCallback() {
    @Override
    public void doFrame(long frameTimeNanos) {
      updateIfNeeded();
    }
  };

  private final ChoreographerCompat.FrameCallback mLayoutCallback = new ChoreographerCompat.FrameCallback() {
    @Override
    public void doFrame(long frameTimeNanos) {
      mLayoutEnqueued = false;
      measure(
              MeasureSpec.makeMeasureSpec(getWidth(), MeasureSpec.EXACTLY),
              MeasureSpec.makeMeasureSpec(getHeight(), MeasureSpec.EXACTLY));
      layout(getLeft(), getTop(), getRight(), getBottom());
    }
  };

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

  @Override
  protected void onLayout(boolean changed, int l, int t, int r, int b) {
    for (int i = 0, size = getChildCount(); i < size; i++) {
      getChildAt(i).layout(0, 0, getWidth(), getHeight());
    }
  }

  @Override
  public void removeView(View view) {
    // The below block is a workaround for an issue with keyboard handling within fragments. Despite
    // Android handles input focus on the fragments that leave the screen, the keyboard stays open
    // in a number of cases. The issue can be best reproduced on Android 5 devices, before some changes
    // in Android's InputMethodManager have been introduced (specifically around dismissing the
    // keyboard in onDetachedFromWindow). However, we also noticed the keyboard issue happen
    // intermittently on recent versions of Android as well. The issue hasn't been previously noticed
    // as in React Native <= 0.61 there was a logic that'd trigger keyboard dismiss upon a blur event
    // (the blur even gets dispatched properly, the keyboard just stays open despite that) – note
    // the change in RN core here: https://github.com/facebook/react-native/commit/e9b4928311513d3cbbd9d875827694eab6cfa932
    // The workaround is to force-hide keyboard when the screen that has focus is dismissed (we detect
    // that in removeView as super.removeView causes the input view to un focus while keeping the
    // keyboard open).
    if (view == getFocusedChild()) {
      ((InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE))
              .hideSoftInputFromWindow(getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
    }
    super.removeView(view);
  }

  @Override
  public void requestLayout() {
    super.requestLayout();

    if (!mLayoutEnqueued && mLayoutCallback != null) {
      mLayoutEnqueued = true;
      // we use NATIVE_ANIMATED_MODULE choreographer queue because it allows us to catch the current
      // looper loop instead of enqueueing the update in the next loop causing a one frame delay.
      ReactChoreographer.getInstance().postFrameCallback(
              ReactChoreographer.CallbackType.NATIVE_ANIMATED_MODULE,
              mLayoutCallback);
    }
  }

  public boolean isNested() {
    return mParentScreenFragment != null;
  }

  protected void markUpdated() {
    if (!mNeedUpdate) {
      mNeedUpdate = true;
      // enqueue callback of NATIVE_ANIMATED_MODULE type as all view operations are executed in
      // DISPATCH_UI type and we want the callback to be called right after in the same frame.
      ReactChoreographer.getInstance().postFrameCallback(
              ReactChoreographer.CallbackType.NATIVE_ANIMATED_MODULE,
              mFrameCallback);
    }
  }

  protected void notifyChildUpdate() {
    markUpdated();
  }

  protected T adapt(Screen screen) {
    return (T) new ScreenFragment(screen);
  }

  protected void addScreen(Screen screen, int index) {
    T fragment = adapt(screen);
    screen.setFragment(fragment);
    mScreenFragments.add(index, fragment);
    screen.setContainer(this);
    markUpdated();
  }

  protected void removeScreenAt(int index) {
    mScreenFragments.get(index).getScreen().setContainer(null);
    mScreenFragments.remove(index);
    markUpdated();
  }

  protected void removeAllScreens() {
    for (ScreenFragment screenFragment: mScreenFragments) {
      screenFragment.getScreen().setContainer(null);
    }
    mScreenFragments.clear();
    markUpdated();
  }

  protected int getScreenCount() {
    return mScreenFragments.size();
  }

  protected Screen getScreenAt(int index) {
    return mScreenFragments.get(index).getScreen();
  }

  public @Nullable Screen getTopScreen() {
    for (ScreenFragment screenFragment: mScreenFragments) {
      if (getActivityState(screenFragment) == Screen.ActivityState.ON_TOP) {
        return screenFragment.getScreen();
      }
    }
    return null;
  }

  private void setFragmentManager(FragmentManager fm) {
    mFragmentManager = fm;
    updateIfNeeded();
  }

  private void setupFragmentManager() {
    ViewParent parent = this;
    // We traverse view hierarchy up until we find screen parent or a root view
    while (!(parent instanceof ReactRootView || parent instanceof Screen) && parent.getParent() != null) {
      parent = parent.getParent();
    }
    // If parent is of type Screen it means we are inside a nested fragment structure.
    // Otherwise we expect to connect directly with root view and get root fragment manager
    if (parent instanceof Screen) {
      ScreenFragment screenFragment = ((Screen) parent).getFragment();
      mParentScreenFragment = screenFragment;
      mParentScreenFragment.registerChildScreenContainer(this);
      setFragmentManager(screenFragment.getChildFragmentManager());
      return;
    }

    // we expect top level view to be of type ReactRootView, this isn't really necessary but in order
    // to find root view we test if parent is null. This could potentially happen also when the view
    // is detached from the hierarchy and that test would not correctly indicate the root view. So
    // in order to make sure we indeed reached the root we test if it is of a correct type. This
    // allows us to provide a more descriptive error message for the aforementioned case.
    if (!(parent instanceof ReactRootView)) {
      throw new IllegalStateException("ScreenContainer is not attached under ReactRootView");
    }
    // ReactRootView is expected to be initialized with the main React Activity as a context but
    // in case of Expo the activity is wrapped in ContextWrapper and we need to unwrap it
    Context context = ((ReactRootView) parent).getContext();
    while (!(context instanceof FragmentActivity) && context instanceof ContextWrapper) {
      context = ((ContextWrapper) context).getBaseContext();
    }
    if (!(context instanceof FragmentActivity)) {
      throw new IllegalStateException(
              "In order to use RNScreens components your app's activity need to extend ReactFragmentActivity or ReactCompatActivity");
    }
    setFragmentManager(((FragmentActivity) context).getSupportFragmentManager());
  }

  protected FragmentTransaction getOrCreateTransaction() {
    if (mCurrentTransaction == null) {
      mCurrentTransaction = mFragmentManager.beginTransaction();
      mCurrentTransaction.setReorderingAllowed(true);
    }
    return mCurrentTransaction;
  }

  protected void tryCommitTransaction() {
    if (mCurrentTransaction != null) {
      final FragmentTransaction transaction = mCurrentTransaction;
      mProcessingTransaction = transaction;
      mProcessingTransaction.runOnCommit(new Runnable() {
        @Override
        public void run() {
          if (mProcessingTransaction == transaction) {
            // we need to take into account that commit is initiated with some other transaction while
            // the previous one is still processing. In this case mProcessingTransaction gets overwritten
            // and we don't want to set it to null until the second transaction is finished.
            mProcessingTransaction = null;
          }
        }
      });
      mCurrentTransaction.commitAllowingStateLoss();
      mCurrentTransaction = null;
    }
  }

  private void attachScreen(ScreenFragment screenFragment) {
    getOrCreateTransaction().add(getId(), screenFragment);
  }

  private void moveToFront(ScreenFragment screenFragment) {
    FragmentTransaction transaction = getOrCreateTransaction();
    transaction.remove(screenFragment);
    transaction.add(getId(), screenFragment);
  }

  private void detachScreen(ScreenFragment screenFragment) {
    getOrCreateTransaction().remove(screenFragment);
  }

  protected Screen.ActivityState getActivityState(ScreenFragment screenFragment) {
    return screenFragment.getScreen().getActivityState();
  }

  protected boolean hasScreen(ScreenFragment screenFragment) {
    return mScreenFragments.contains(screenFragment);
  }

  @Override
  protected void onAttachedToWindow() {
    super.onAttachedToWindow();
    mIsAttached = true;
    mNeedUpdate = true;
    setupFragmentManager();
  }

  /**
   * Removes fragments from fragment manager that are attached to this container
   */
  private void removeMyFragments() {
    FragmentTransaction transaction = mFragmentManager.beginTransaction();
    boolean hasFragments = false;

    for (Fragment fragment : mFragmentManager.getFragments()) {
      if (fragment instanceof ScreenFragment && ((ScreenFragment) fragment).mScreenView.getContainer() == this) {
        transaction.remove(fragment);
        hasFragments = true;
      }
    }
    if (hasFragments) {
      transaction.commitNowAllowingStateLoss();
    }
  }

  @Override
  protected void onDetachedFromWindow() {
    // if there are pending transactions and this view is about to get detached we need to perform
    // them here as otherwise fragment manager will crash because it won't be able to find container
    // view. We also need to make sure all the fragments attached to the given container are removed
    // from fragment manager as in some cases fragment manager may be reused and in such case it'd
    // attempt to reattach previously registered fragments that are not removed
    if (mFragmentManager != null && !mFragmentManager.isDestroyed()) {
      removeMyFragments();
      mFragmentManager.executePendingTransactions();
    }

    if (mParentScreenFragment != null) {
      mParentScreenFragment.unregisterChildScreenContainer(this);
      mParentScreenFragment = null;
    }

    super.onDetachedFromWindow();
    mIsAttached = false;
    // When fragment container view is detached we force all its children to be removed.
    // It is because children screens are controlled by their fragments, which can often have a
    // delayed lifecycle (due to transitions). As a result due to ongoing transitions the fragment
    // may choose not to remove the view despite the parent container being completely detached
    // from the view hierarchy until the transition is over. In such a case when the container gets
    // re-attached while tre transition is ongoing, the child view would still be there and we'd
    // attempt to re-attach it to with a misconfigured fragment. This would result in a crash. To
    // avoid it we clear all the children here as we attach all the child fragments when the container
    // is reattached anyways. We don't use `removeAllViews` since it does not check if the children are
    // not already detached, which may lead to calling `onDetachedFromWindow` on them twice. We also
    // get the size earlier, because we will be removing child views in `for` loop.
    int size = getChildCount();
    for (int i = size - 1; i >= 0; i--) {
      removeViewAt(i);
    }
  }

  @Override
  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    for (int i = 0, size = getChildCount(); i < size; i++) {
      getChildAt(i).measure(widthMeasureSpec, heightMeasureSpec);
    }
  }

  private void updateIfNeeded() {
    if (!mNeedUpdate || !mIsAttached || mFragmentManager == null) {
      return;
    }
    mNeedUpdate = false;
    onUpdate();
  }

  private final void onUpdate() {
    // We double check if fragment manager have any pending transactions to run.
    // In performUpdate we often check whether some fragments are added to
    // manager to avoid adding them for the second time (which result in crash).
    // By design performUpdate should be called at most once per frame, so this
    // should never happen, but in case there are some pending transaction we
    // need to flush them here such that Fragment#isAdded checks reflect the
    // reality and that we don't have enqueued fragment add commands that will
    // execute shortly and cause "Fragment already added" crash.
    mFragmentManager.executePendingTransactions();

    performUpdate();
    notifyContainerUpdate();
  }

  protected void performUpdate() {
    // detach screens that are no longer active
    Set<Fragment> orphaned = new HashSet<>(mFragmentManager.getFragments());
    for (ScreenFragment screenFragment: mScreenFragments) {
      if (getActivityState(screenFragment) == Screen.ActivityState.INACTIVE && screenFragment.isAdded()) {
        detachScreen(screenFragment);
      }
      orphaned.remove(screenFragment);
    }
    if (!orphaned.isEmpty()) {
      Object[] orphanedAry = orphaned.toArray();
      for (int i = 0; i < orphanedAry.length; i++) {
        if (orphanedAry[i] instanceof ScreenFragment) {
          if (((ScreenFragment) orphanedAry[i]).getScreen().getContainer() == null) {
            detachScreen((ScreenFragment) orphanedAry[i]);
          }
        }
      }
    }

    boolean transitioning = true;

    Screen topScreen = getTopScreen();
    if (topScreen != null) {
      // if there is an "onTop" screen it means the transition has ended
      transitioning = false;
    }

    // attach newly activated screens
    boolean addedBefore = false;
    for (ScreenFragment screenFragment: mScreenFragments) {
      Screen.ActivityState activityState = getActivityState(screenFragment);
      if (activityState != Screen.ActivityState.INACTIVE && !screenFragment.isAdded()) {
        addedBefore = true;
        attachScreen(screenFragment);
      } else if (activityState != Screen.ActivityState.INACTIVE && addedBefore) {
        moveToFront(screenFragment);
      }
      screenFragment.getScreen().setTransitioning(transitioning);
    }

    tryCommitTransaction();
  }

  protected void notifyContainerUpdate() {
    Screen topScreen = getTopScreen();
    if (topScreen != null) {
      topScreen.getFragment().onContainerUpdate();
    }
  }
}


text: Experimenting with the Rust language


text:
package org.gearvrf.scene_objects;

import org.gearvrf.GVRActivity;
import org.gearvrf.GVRContext;
import org.gearvrf.GVRDrawFrameListener;
import org.gearvrf.GVRExternalTexture;
import org.gearvrf.GVRMaterial;
import org.gearvrf.GVRMaterial.GVRShaderType;
import org.gearvrf.GVRMesh;
import org.gearvrf.GVRSceneObject;
import org.gearvrf.GVRTexture;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.PorterDuff.Mode;
import android.graphics.SurfaceTexture;
import android.graphics.drawable.Drawable;
import android.util.Log;
import android.view.Surface;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.webkit.WebView;
import android.widget.LinearLayout;
import android.widget.TextView;

public class GVRTextViewSceneObject extends GVRSceneObject {
    private static final int REFRESH_INTERVAL = 30; // frames

    private static final int DEFAULT_WIDTH = 2000;
    private static final int DEFAULT_HEIGHT = 1000;
    private static final float DEFAULT_QUAD_WIDTH = 2.0f;
    private static final float DEFAULT_QUAD_HEIGHT = 2.0f;
    private static final String DEFAULT_TEXT = "";

    private final Surface mSurface;
    private final SurfaceTexture mSurfaceTexture;
    private final LinearLayout mTextViewContainer;
    private final TextView mTextView;

    private int mCount = 0;

    /**
     * Shows a {@link TextView} on a {@linkplain GVRSceneObject scene object}.
     *
     * @param gvrContext
     *            current {@link GVRContext}
     * @param mesh
     *            A {@link GVRMesh} - see
     *            {@link GVRContext#loadMesh(org.gearvrf.GVRAndroidResource)}
     *            and {@link GVRContext#createQuad(float, float)}.
     *
     *            Please note that this mesh controls the size of your scene
     *            object, and it is independent of the size of the internal
     *            {@code TextView}: a large mismatch between the scene object's
     *            size and the view's size will result in 'spidery' or 'blocky'
     *            text.
     * @param gvrActivity
     *            a {@link GVRActivity}
     * @param viewWidth
     *            Width of the {@link TextView}
     * @param viewHeight
     *            Height of the {@link TextView}
     * @param text
     *            {@link CharSequence} to show on the textView
     */
    public GVRTextViewSceneObject(GVRContext gvrContext, GVRMesh mesh,
            GVRActivity gvrActivity, int viewWidth, int viewHeight,
            CharSequence text) {
        super(gvrContext, mesh);
        mTextView = new TextView(gvrActivity);
        mTextView.setLayoutParams(new LayoutParams(viewWidth, viewHeight));
        mTextView.measure(viewWidth, viewHeight);
        mTextView.setBackgroundColor(Color.TRANSPARENT);
        mTextView.setText(text);
        mTextView.setVisibility(View.VISIBLE);
        mTextViewContainer = new LinearLayout(gvrActivity);
        mTextViewContainer.addView(mTextView);
        mTextViewContainer.measure(viewWidth, viewHeight);
        mTextViewContainer.layout(0, 0, viewWidth, viewHeight);
        mTextViewContainer.setVisibility(View.VISIBLE);
        gvrContext.registerDrawFrameListener(mFrameListener);
        GVRTexture texture = new GVRExternalTexture(gvrContext);
        GVRMaterial material = new GVRMaterial(gvrContext, GVRShaderType.OES.ID);
        material.setMainTexture(texture);
        getRenderData().setMaterial(material);

        mSurfaceTexture = new SurfaceTexture(texture.getId());
        mSurface = new Surface(mSurfaceTexture);
        mSurfaceTexture.setDefaultBufferSize(mTextViewContainer.getWidth(),
                mTextViewContainer.getHeight());
    }

    /**
     * Shows a {@link TextView} on a {@linkplain GVRSceneObject scene object}.
     *
     * @param gvrContext
     *            current {@link GVRContext}
     * @param gvrActivity
     *            a {@link GVRActivity}
     * @param width
     *            Scene object height, in GVRF scene graph units.
     *
     *            Please note that your scene object's size, is independent of
     *            the size of the internal {@code TextView}: a large mismatch
     *            between the scene object's size and the view's size will
     *            result in 'spidery' or 'blocky' text.
     *
     * @param height
     *            Scene object's width, in GVRF scene graph units.
     * @param viewWidth
     *            Width of the {@link TextView}
     * @param viewHeight
     *            Height of the {@link TextView}
     * @param text
     *            {@link CharSequence} to show on the textView
     */
    public GVRTextViewSceneObject(GVRContext gvrContext,
            GVRActivity gvrActivity, float width, float height, int viewWidth,
            int viewHeight, CharSequence text) {
        this(gvrContext, gvrContext.createQuad(width, height), gvrActivity,
                viewWidth, viewHeight, text);
    }

    /**
     * Shows a {@link TextView} on a {@linkplain GVRSceneObject scene object}
     * with view default height and width.
     *
     * @param gvrContext
     *            current {@link GVRContext}
     * @param mesh
     *            a {@link GVRMesh} - see
     *            {@link GVRContext#loadMesh(org.gearvrf.GVRAndroidResource)}
     *            and {@link GVRContext#createQuad(float, float)}
     *
     *            Please note that this mesh controls the size of your scene
     *            object, and it is independent of the size of the internal
     *            {@code TextView}: a large mismatch between the scene object's
     *            size and the view's size will result in 'spidery' or 'blocky'
     *            text.
     * @param gvrActivity
     *            a {@link GVRActivity}
     * @param text
     *            {@link CharSequence} to show on the textView
     */
    public GVRTextViewSceneObject(GVRContext gvrContext, GVRMesh mesh,
            GVRActivity gvrActivity, CharSequence text) {
        this(gvrContext, mesh, gvrActivity, DEFAULT_WIDTH, DEFAULT_HEIGHT, text);
    }

    /**
     * Shows a {@link TextView} on a {@linkplain GVRSceneObject scene object}
     * with view's default height and width.
     *
     * @param gvrContext
     *            current {@link GVRContext}
     * @param gvrActivity
     *            a {@link GVRActivity}
     * @param width
     *            Scene object height, in GVRF scene graph units.
     *
     *            Please note that your scene object's size, is independent of
     *            the size of the internal {@code TextView}: a large mismatch
     *            between the scene object's size and the view's size will
     *            result in 'spidery' or 'blocky' text.
     *
     * @param height
     *            Scene object's width, in GVRF scene graph units.
     * @param text
     *            {@link CharSequence} to show on the textView
     */
    public GVRTextViewSceneObject(GVRContext gvrContext,
            GVRActivity gvrActivity, float width, float height,
            CharSequence text) {
        this(gvrContext, gvrContext.createQuad(width, height), gvrActivity,
                text);
    }

    /**
     * Shows a {@link TextView} on a {@linkplain GVRSceneObject scene object}
     * with both view's default height and width and quad's default height and
     * width.
     *
     * @param gvrContext
     *            current {@link GVRContext}
     * @param gvrActivity
     *            a {@link GVRActivity}
     * @param text
     *            {@link CharSequence} to show on the textView
     */
    public GVRTextViewSceneObject(GVRContext gvrContext,
            GVRActivity gvrActivity, CharSequence text) {
        this(gvrContext, gvrActivity, DEFAULT_QUAD_WIDTH, DEFAULT_QUAD_HEIGHT,
                text);
    }

    /**
     * Shows a {@link TextView} on a {@linkplain GVRSceneObject scene object}
     * with both view's default height and width and quad's default height and
     * width. The initial text will be the private {@code DEFAULT_TEXT}
     * constant, or {@code ""}.
     *
     * @param gvrContext
     *            current {@link GVRContext}
     * @param gvrActivity
     *            a {@link GVRActivity}
     */
    public GVRTextViewSceneObject(GVRContext gvrContext, GVRActivity gvrActivity) {
        this(gvrContext, gvrActivity, DEFAULT_TEXT);
    }

    /**
     * Set the text size.
     *
     * @param newSize
     *            The new text size.
     */
    public void setTextSize(float size) {
        mTextView.setTextSize(size);
    }

    /**
     * Get the current text size.
     *
     * @return The current text size.
     */
    public float getTextSize() {
        return mTextView.getTextSize();
    }

    /**
     * Set the text color.
     *
     * @param color
     *            The text color, in Android {@link Color} format. The
     *            {@linkplain Color#alpha(int) alpha component} is ignored.
     */
    public void setTextColor(int color) {
        mTextView.setTextColor(color);
    }

    /**
     * Set the text to be displayed.
     *
     * @param text
     *            The new text to be displayed.
     */
    public void setText(CharSequence text) {
        mTextView.setText(text);
    }

    /**
     * Get the current text.
     *
     * @return The text that is currently displayed.
     */
    public CharSequence getText() {
        return mTextView.getText();
    }

    /**
     * Get the current text, as a {@code String}.
     *
     * This is a convenience function, 100% equivalent to {@link #getText()}
     * {@code .toString()}
     *
     * @return The text that is currently displayed.
     */
    public String getTextString() {
        return getText().toString();
    }

    /**
     * Set the view's background color.
     *
     * @param color
     *            The view's background color, in Android {@link Color} format.
     *            The {@linkplain Color#alpha(int) alpha component} is ignored.
     */
    public void setBackgroundColor(int color) {
        mTextViewContainer.setBackgroundColor(color);
    }

    /**
     * Set the view's background {@code Drawable}.
     *
     * @param drawable
     *            The view's background. {@code null} will clear any current
     *            background {@code Drawable}.
     */
    public void setBackGround(Drawable drawable) {
        mTextViewContainer.setBackground(drawable);
    }

    /**
     * Get the view's background {@code Drawable}, if any.
     *
     * @param drawable
     *            The view's background; may be {@code null}.
     */
    public Drawable getBackGround() {
        return mTextViewContainer.getBackground();
    }

    /**
     * Set the view's gravity.
     *
     * @param gravity
     *            The gravity of the internal TextView
     */
    public void setGravity(int gravity) {
        mTextView.setGravity(gravity);
    }

    /**
     * Get the view's gravity.
     *
     * @return The gravity of the internal TextView
     */
    public int getGravity() {
        return mTextView.getGravity();
    }

    private final GVRDrawFrameListener mFrameListener = new GVRDrawFrameListener() {
        @Override
        public void onDrawFrame(float frameTime) {
            if (++mCount > REFRESH_INTERVAL) {
                refresh();
                mCount = 0;
            }
        }
    };

    /** Draws the {@link WebView} onto {@link #mSurfaceTexture} */
    private void refresh() {
        try {
            Canvas canvas = mSurface.lockCanvas(null);
            canvas.drawColor(Color.TRANSPARENT, Mode.CLEAR);
            mTextViewContainer.draw(canvas);
            mSurface.unlockCanvasAndPost(canvas);
        } catch (Surface.OutOfResourcesException t) {
            Log.e("GVRTextViewObject", "lockCanvas failed");
        }
        mSurfaceTexture.updateTexImage();
    }

}


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

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
  Class: Generator::Generator

    — Documentation by YARD 0.8.7.6

</title>

  <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />

  <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />

    Index (G) »
    Generator
     »
    Generator

(no frames)

      Class List

      Method List

      File List

Class: Generator::Generator

Inherits:

      Object

Object

Generator::Generator

        show all

Defined in:

lib/generator/generator.rb

      Instance Method Summary
      (collapse)

      - (Object) dev_root

      - (Object) generate

      - (Generator) initialize

    constructor

A new instance of Generator.

      - (Object) project_name(project_folder)

      - (Object) project_web_folder(project)

      - (Object) projects_folder

      - (Object) web_root

Constructor Details

    - (<tt>Generator</tt>) initialize

Returns a new instance of Generator

8
9
10
11
12
13

# File 'lib/generator/generator.rb', line 8

def initialize
  @haml      = HamlGenerator.new
  @sass      = SassGenerator.new
  @coffee    = CoffeeGenerator.new
  @structure = StructureGenerator.new
end

Instance Method Details

    - (<tt>Object</tt>) dev_root

19
20
21

# File 'lib/generator/generator.rb', line 19

def dev_root
  return 'dev_root'
end

    - (<tt>Object</tt>) generate

35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

# File 'lib/generator/generator.rb', line 35

def generate
  FileUtils.rm_rf(Dir.glob("web_root/*"))

  projects_folder.each do |project_folder|
    next unless File.directory? project_folder
    next if project_folder.include? 'shared'

    project_name = project_folder.split('/')[-1]
    project_output_folder = project_web_folder(project_name)

    @structure.generate project_folder, project_output_folder
    @haml.generate      project_folder, project_output_folder
    @coffee.generate    "#{project_folder}/coffee", "#{project_output_folder}/js"
    @sass.generate      "#{project_folder}/sass"  , "#{project_output_folder}/css"
  end
end

    - (<tt>Object</tt>) project_name(project_folder)

27
28
29

# File 'lib/generator/generator.rb', line 27

def project_name project_folder
  project_folder.split('/')[-1]
end

    - (<tt>Object</tt>) project_web_folder(project)

31
32
33

# File 'lib/generator/generator.rb', line 31

def project_web_folder project
  "#{web_root}/#{project}"
end

    - (<tt>Object</tt>) projects_folder

23
24
25

# File 'lib/generator/generator.rb', line 23

def projects_folder
  Dir.glob("#{dev_root}/*")
end

    - (<tt>Object</tt>) web_root

15
16
17

# File 'lib/generator/generator.rb', line 15

def web_root
  return 'web_root'
end

  Generated on Sun Dec 21 19:55:50 2014 by
  yard
  0.8.7.6 (ruby-2.1.3).


text:
/**
 * Created by Le on 10/21/2015.
 */
var cartApp = angular.module("cartApp", []);

cartApp.controller('cartCtrl', function ($scope, $http) {
    $scope.refreshCart = function () {
        $http.get('/rest/cart/' + $scope.cartId).success(function _successGet(data) {
            $scope.cart = data;
        });
    };

    $scope.clearCart = function () {
        $http.delete('/rest/cart/' + $scope.cartId)
            .success(function _successDelete() {
                $scope.refreshCart();
            });

    };

    $scope.initCartId = function (cartId) {
        $scope.cartId = cartId;
        $http.get('/rest/cart/' + $scope.cartId).success(function _successInit(data) {
            $scope.cart = data;
        });
    };

    $scope.addToCart = function (productId) {
        $http.put('/rest/cart/add/' + productId)
            .success(function _successPut() {
                alert("Product Successfully added to the Cart!");
            }).error(function _errorPut() {
        });
    };

    $scope.removeFromCart = function (productId) {
        $http.put('/rest/cart/remove/' + productId)
            .success(function _successPut() {
                $scope.refreshCart();
            }).error(function _errorPut() {
        });
    };

    $scope.calGrandTotal = function() {
        var grandTotal=0;

        for (var i=0; i<$scope.cart.cartItems.length; i++) {
            grandTotal+=$scope.cart.cartItems[i].totalPrice;
        }

        return grandTotal;
    };

});


text:
"""
    conf
    ~~~~

    Sphinx documentation configuration

    :copyright: 2015 by Jonathan Zempel.
    :license: BSD, see LICENSE for more details.
"""

from continuity.cli.commons import (FinishCommand, InitCommand, ReviewCommand,
        StartCommand, TasksCommand)
from continuity.cli.github import IssueCommand, IssuesCommand
from continuity.cli.pt import BacklogCommand, StoryCommand
from datetime import datetime
import continuity

_commands = [
    BacklogCommand,
    FinishCommand,
    InitCommand,
    IssueCommand,
    IssuesCommand,
    ReviewCommand,
    StartCommand,
    StoryCommand,
    TasksCommand
]
_description = "continuous dev inspired by GitHub Flow"
master_doc = "index"

copyright = "{0}, {1}".format(datetime.now().year, continuity.__author__)
exclude_patterns = ["_build"]
html_static_path = ["_static"]
html_theme = "default"
htmlhelp_basename = "{0}doc".format(continuity.__name__)
latex_documents = [(
    master_doc,
    "{0}.tex".format(continuity.__name__),
    _description,
    continuity.__author__,
    "manual"
)]
latex_elements = {}
man_pages = [(
    master_doc,
    continuity.__name__,
    _description,
    [continuity.__author__],
    1
)]

for _command in _commands:
    _name = "git-{0}".format(continuity.__name__ if _command == InitCommand
            else _command.name)
    man_page = (
        _name,
        _name,
        _command._help(),
        [continuity.__author__],
        1
    )
    man_pages.append(man_page)

project = continuity.__name__
pygments_style = "sphinx"
release = continuity.__version__
source_suffix = ".rst"
templates_path = ["_templates"]
texinfo_documents = [(
    master_doc,
    continuity.__name__,
    '',
    continuity.__author__,
    continuity.__name__,
    _description,
    "Miscellaneous"
)]
version = continuity.__version__


text:
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Date** | Pointer to **string** | date |
**Sid** | Pointer to **string** | sid |
**Url** | Pointer to **string** | The absolute URL of the resource |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


text:
FOUNDATION_EXPORT double GAuthVersionNumber;

//! Project version string for GoogleAuthenticator-iOS.
FOUNDATION_EXPORT const unsigned char GAuthVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <GoogleAuthenticator_iOS/PublicHeader.h>


text:
Some test app
=========

Test application that uses Fiber API.

# Usage

Just start this rails app:

    rails s

# Testing

I wrote some basic specs using RSpec gem:

    bundle exec rspec


text:
#if DEVICE_FLASH
#include "flash_api.h"
#include "flash_data.h"
#include "platform/mbed_critical.h"

// This file is automatically generated

static uint32_t GetSector(uint32_t Address);
static uint32_t GetSectorSize(uint32_t Sector);

int32_t flash_init(flash_t *obj)
{
    return 0;
}

int32_t flash_free(flash_t *obj)
{
    return 0;
}

static int32_t flash_unlock(void)
{
    /* Allow Access to Flash control registers and user Falsh */
    if (HAL_FLASH_Unlock()) {
        return -1;
    } else {
        return 0;
    }
}

static int32_t flash_lock(void)
{
    /* Disable the Flash option control register access (recommended to protect
    the option Bytes against possible unwanted operations) */
    if (HAL_FLASH_Lock()) {
        return -1;
    } else {
        return 0;
    }
}

int32_t flash_erase_sector(flash_t *obj, uint32_t address)
{
    /*Variable used for Erase procedure*/
    static FLASH_EraseInitTypeDef EraseInitStruct;
    uint32_t FirstSector;
    uint32_t SectorError = 0;
    int32_t status = 0;

    if ((address >= (FLASH_BASE + FLASH_SIZE)) || (address < FLASH_BASE)) {
        return -1;
    }

    if (flash_unlock() != HAL_OK) {
        return -1;
    }

    /* Get the 1st sector to erase */
    FirstSector = GetSector(address);

    /* Fill EraseInit structure*/
    EraseInitStruct.TypeErase = FLASH_TYPEERASE_SECTORS;
    EraseInitStruct.VoltageRange = FLASH_VOLTAGE_RANGE_3;
    EraseInitStruct.Sector = FirstSector;
    EraseInitStruct.NbSectors = 1;
    if(HAL_FLASHEx_Erase(&EraseInitStruct, &SectorError) != HAL_OK){
        status = -1;
    }

    flash_lock();

    return status;
}

int32_t flash_program_page(flash_t *obj, uint32_t address, const uint8_t *data, uint32_t size)
{
    int32_t status = 0;

    if ((address >= (FLASH_BASE + FLASH_SIZE)) || (address < FLASH_BASE)) {
        return -1;
    }

    if (flash_unlock() != HAL_OK) {
        return -1;
    }

  /* Note: If an erase operation in Flash memory also concerns data in the data or instruction cache,
     you have to make sure that these data are rewritten before they are accessed during code
     execution. If this cannot be done safely, it is recommended to flush the caches by setting the
     DCRST and ICRST bits in the FLASH_CR register. */
    __HAL_FLASH_DATA_CACHE_DISABLE();
    __HAL_FLASH_INSTRUCTION_CACHE_DISABLE();

    __HAL_FLASH_DATA_CACHE_RESET();
    __HAL_FLASH_INSTRUCTION_CACHE_RESET();

    __HAL_FLASH_INSTRUCTION_CACHE_ENABLE();
    __HAL_FLASH_DATA_CACHE_ENABLE();

    while ((size > 0) && (status == 0)) {
        if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_BYTE, address, (uint64_t)*data) != HAL_OK) {
            status = -1;
        } else {
            size--;
            address++;
            data++;
        }
    }

    flash_lock();

    return status;
}

uint32_t flash_get_sector_size(const flash_t *obj, uint32_t address)
{
    if ((address >= (FLASH_BASE + FLASH_SIZE)) || (address < FLASH_BASE)) {
        return MBED_FLASH_INVALID_SIZE;
    }

    return (GetSectorSize(GetSector(address)));
}

uint32_t flash_get_page_size(const flash_t *obj)
{
    // Flash of STM32F4 devices can be programed 1 byte at a time
    return (1);
}

uint32_t flash_get_start_address(const flash_t *obj)
{
    return FLASH_BASE;
}
uint32_t flash_get_size(const flash_t *obj)
{
    return FLASH_SIZE;
}

/**
  * @brief  Gets the sector of a given address
  * @param  None
  * @retval The sector of a given address
  */
static uint32_t GetSector(uint32_t address)
{
    uint32_t sector = 0;
    uint32_t tmp = address - ADDR_FLASH_SECTOR_0;
    /* This function supports 1Mb and 2Mb flash sizes */
#if defined(ADDR_FLASH_SECTOR_16)
    if (address & 0x100000) { // handle 2nd bank
        /*  Sector will be at least 12 */
        sector = FLASH_SECTOR_12;
        tmp -= 0x100000;
        address -= 0x100000;
    }
#endif
    if (address < ADDR_FLASH_SECTOR_4) { // 16k sectorsize
        sector += tmp >>14;
    }
#if defined(ADDR_FLASH_SECTOR_5)
    else if (address < ADDR_FLASH_SECTOR_5) { //64k sector size
        sector += FLASH_SECTOR_4;
    } else {
        sector += 4 + (tmp >>17);
    }
#else
    // In case ADDR_FLASH_SECTOR_5 is not defined, sector 4 is the last one.
    else { //64k sector size
        sector += FLASH_SECTOR_4;
    }
#endif
    return sector;
}

/**
  * @brief  Gets sector Size
  * @param  None
  * @retval The size of a given sector
  */
static uint32_t GetSectorSize(uint32_t Sector)
{
    uint32_t sectorsize = 0x00;
#if defined(FLASH_SECTOR_16)
    if((Sector == FLASH_SECTOR_0) || (Sector == FLASH_SECTOR_1) || (Sector == FLASH_SECTOR_2) ||\
       (Sector == FLASH_SECTOR_3) || (Sector == FLASH_SECTOR_12) || (Sector == FLASH_SECTOR_13) ||\
       (Sector == FLASH_SECTOR_14) || (Sector == FLASH_SECTOR_15)) {
           sectorsize = 16 * 1024;
       } else if((Sector == FLASH_SECTOR_4) || (Sector == FLASH_SECTOR_16)) {
#else
if((Sector == FLASH_SECTOR_0) || (Sector == FLASH_SECTOR_1) || (Sector == FLASH_SECTOR_2) ||\
   (Sector == FLASH_SECTOR_3)) {
       sectorsize = 16 * 1024;
   } else if(Sector == FLASH_SECTOR_4) {
#endif
        sectorsize = 64 * 1024;
    } else {
        sectorsize = 128 * 1024;
    }
    return sectorsize;
}

#endif