text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Practices.Unity;
using WinFormsMvvm;
using WinFormsMvvm.DialogService;
using WinFormsMvvm.Controls;
using LogService;
using eZustellSendPOC.Views;
using WinFormsMvvm.DialogService.FrameworkDialogs.OpenFile;
using System.Windows.Forms;
using eZustellSendPOC.Services;
using WinFormsMvvm.ExtensionMethods;
using SimpleEventBroker;
using WinFormsMvvm.DialogService.FrameworkDialogs.SaveFile;
using eZustellSendPOC.RCService;
using System.IO;
using eZustellSendPOC.About.Views;

namespace eZustellSendPOC.ViewModels
{
    /// <summary>
    /// Controller for FrmSendPOCView
    /// </summary>
    public class SendPOCController : ViewModelBase
    {
        private IUnityContainer _uc;
        private IeZustellService _eZServ;
        private ICertificateService _cerServ;

        private SendPOCViewmodel _sendPocVM;
        /// <summary>
        /// Gets or sets the send poc vm.
        /// </summary>
        /// <value>
        /// The Datamodel for the View
        /// </value>
        public SendPOCViewmodel SendPocVM
        {
            get { return _sendPocVM; }
            set
            {
                if (_sendPocVM == value)
                    return;
                _sendPocVM = value;
                OnPropertyChanged();
            }
        }

        /// <summary>
        /// The member list to select the Member to display
        /// </summary>
        public List<string> MemberList = new List<string>() { "FullName", "CompanyName", "PersTypeString" };

        /// <summary>
        /// Initializes a new instance of the <see cref="SendPOCController"/> class.
        /// </summary>
        /// <param name="uc">The uc.</param>
        /// <param name="dlgService">The dialog service.</param>
        /// <param name="vm">The vm.</param>
        public SendPOCController(IUnityContainer uc, IDialogService dlgService, SendPOCViewmodel vm, ICertificateService certServ, IeZustellService eZServ)
            : base(dlgService)
        {
            _uc = uc;
            _sendPocVM = vm;
            SendPocVM.ReceiverList = ReceiverViewModel.GetReceiverFromAddressBook(null, true);
            SendPocVM.SelectedReceiver = SendPocVM.ReceiverList[0];
            _eZServ = eZServ;
            _cerServ = certServ;
            SendPocVM.IsZustellungEnabled = true;
            if (_cerServ.Certificate == null)
            {
                SendPocVM.IsZustellungEnabled = false;
            }
        }

        #region OpenAddresBook
        private RelayCommand _OpenAddresBookCommand;
        /// <summary>
        /// Gets the open addres book command.
        /// </summary>
        /// <value>
        /// The open addres book command.
        /// </value>
        public RelayCommand OpenAddresBookCommand
        {
            get
            {
                _OpenAddresBookCommand = _OpenAddresBookCommand ?? new RelayCommand(OpenAddresBookClick);
                return _OpenAddresBookCommand;
            }
        }
        /// <summary>
        /// Opens the addres book click.
        /// </summary>
        /// <param name="obj">The object.</param>
        private void OpenAddresBookClick(object obj)
        {
            var addrBook = _eZServ.GetAddressBook();
            if (_eZServ.LastRC != eZustellServiceBase.ZustellServiceRC.OK)
            {
                _dlg.ShowMessageBox(_eZServ.GetMessage());
                return;
            }
            var recList = ReceiverViewModel.GetReceiverFromAddressBook(addrBook, true);
            SendPocVM.ReceiverList.Clear();
            foreach (var item in recList)
            {
                SendPocVM.ReceiverList.Add(item);
            }
            SendPocVM.SelectedReceiver = SendPocVM.ReceiverList[0];
        }
        #endregion

        #region MakeCertificate
        private RelayCommand _MakeCertificateCommand;
        /// <summary>
        /// Gets the make certificate command.
        /// </summary>
        /// <value>
        /// The make certificate command.
        /// </value>
        public RelayCommand MakeCertificateCommand
        {
            get
            {
                _MakeCertificateCommand = _MakeCertificateCommand ?? new RelayCommand(param => MakeCertificateClick());
                return _MakeCertificateCommand;
            }
        }

        /// <summary>
        /// Makes the certificate click.
        /// </summary>
        private void MakeCertificateClick()
        {
            Log.Information("{0}", CallerInfo.Create(), "MakeCertificate clicked");
            var rc = _dlg.ShowDialog<FrmCertificate, CertificateController>();
        }
        #endregion

        #region AddAttachment
        private RelayCommand _AddAttachmentCommand;
        public RelayCommand AddAttachmentCommand
        {
            get
            {
                _AddAttachmentCommand = _AddAttachmentCommand ?? new RelayCommand(AddAttachmentClick);
                return _AddAttachmentCommand;
            }
        }
        private void AddAttachmentClick(object obj)
        {
            var ofd = _uc.Resolve<IOpenFileDialog>();
            ofd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            ofd.Filter = "PDF Datei (*.pdf)|*.pdf|XML Datei (*.xml)|*.xml|Alle Dateien (*.*)|*.*";
            ofd.Multiselect = false;
            var rc = _dlg.ShowOpenFileDialog(ofd);
            if (rc == DialogResult.OK)
            {
                SendPocVM.AttachmentFileName = ofd.FileName;
            }
        }
        #endregion

        #region Deliver
        private RelayCommand _DeliverCommand;
        public RelayCommand DeliverCommand
        {
            get
            {
                _DeliverCommand = _DeliverCommand ?? new RelayCommand(DeliverClick);
                return _DeliverCommand;
            }
        }
        private void DeliverClick(object obj)
        {
            //GetTextBoxContentFire();
            if (!SendPocVM.IsZustellungEnabled)
            {
                _dlg.ShowMessageBox("Es sind noch nicht alle benötigen Felder ausgefüllt");
                return;
            }
            SendDeliveryRequestType sendRequ = SendPocVM;
            var resp = _eZServ.SendDelivery(sendRequ);
            if (_eZServ.LastRC != eZustellServiceBase.ZustellServiceRC.OK)
            {
                _dlg.ShowMessageBox(_eZServ.GetMessage());
                return;
            }

            _dlg.ShowMessageBox("Ihre Zustellung wurde abgeschickt."+Environment.NewLine+"Ihre Referenz: "+resp.SentDelivery.SendingApplicationId+Environment.NewLine+
                "Geschäftszahl: "+resp.SentDelivery.DeliveryId);
        }
        #endregion

        #region LoadCertificate
        private RelayCommand _LoadCertificateCommand;
        public RelayCommand LoadCertificateCommand
        {
            get
            {
                _LoadCertificateCommand = _LoadCertificateCommand ?? new RelayCommand(LoadCertificateClick);
                return _LoadCertificateCommand;
            }
        }
        private void LoadCertificateClick(object obj)
        {
            var rc = _dlg.ShowDialog<FrmLoadSaveCertificate, LoadCertificateController>();
            if ((rc != DialogResult.OK) || (_cerServ.Certificate == null))
            {
                SendPocVM.IsZustellungEnabled = false;
            }
            else
            {
                SendPocVM.IsZustellungEnabled = true;
            }

        }
        #endregion

        #region InitCertificate
        private RelayCommand _InitCertificateCommand;
        public RelayCommand InitCertificateCommand
        {
            get
            {
                _InitCertificateCommand = _InitCertificateCommand ?? new RelayCommand(InitCertificateClick);
                return _InitCertificateCommand;
            }
        }
        private void InitCertificateClick(object obj)
        {
            LoadCertificateController ctrl = _uc.Resolve<LoadCertificateController>();
            ctrl.VM.ShowNewButton = true;
            var rc = _dlg.ShowDialog<FrmLoadSaveCertificate>(ctrl);
            if (rc != DialogResult.OK)
            {
                CloseView(DialogResult.Cancel);
            }
            SetInitialPdfFilename();
        }
        #endregion

        #region SaveCertificate
        private RelayCommand _SaveCertificateCommand;
        public RelayCommand SaveCertificateCommand
        {
            get
            {
                _SaveCertificateCommand = _SaveCertificateCommand ?? new RelayCommand(SaveCertificateClick);
                return _SaveCertificateCommand;
            }
        }
        private void SaveCertificateClick(object obj)
        {
            string fn;
            var sfd = _uc.Resolve<ISaveFileDialog>();
            sfd.Filter = "Zertifikate (*.cer)|*.cer";
            if (string.IsNullOrWhiteSpace(Properties.Settings.Default.LastCertificatePath))
            {
                sfd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

            }
            else
            {
                sfd.InitialDirectory = Properties.Settings.Default.LastCertificatePath;
            }
            var rc = _dlg.ShowSaveFileDialog(sfd);
            if (rc == DialogResult.OK)
            {
                fn = sfd.FileName;
                var rcCert = _cerServ.SaveAsCertificate(fn);
            }
        }
        #endregion

                #region ShowAbout
        private RelayCommand _ShowAboutCommand;
        public RelayCommand ShowAboutCommand
        {
            get
            {
                _ShowAboutCommand = _ShowAboutCommand ?? new RelayCommand(ShowAboutClick);
                return _ShowAboutCommand;
            }
        }
        private void ShowAboutClick(object obj)
        {
            _dlg.ShowDialog<FrmAboutView, About.ViewModels.AboutViewController>();
        }
        #endregion

        #region GetOwnAddressbookEntry
        private RelayCommand _GetOwnAddressbookEntryCommand;
        public RelayCommand GetOwnAddressbookEntryCommand
        {
            get
            {
                _GetOwnAddressbookEntryCommand = _GetOwnAddressbookEntryCommand ?? new RelayCommand(GetOwnAddressbookEntryClick);
                return _GetOwnAddressbookEntryCommand;
            }
        }
        private void GetOwnAddressbookEntryClick(object obj)
        {
            var myPersonData = _eZServ.SearchOwnAddress();
            var myEntry = ReceiverViewModel.GetReceiverFromAddressBook(myPersonData, false);
            SendPocVM.ConfirmationEMailList.Clear();
            SendPocVM.ConfirmationEMailList.AddRange(myEntry.FirstOrDefault().eMailAddressList);
            SendPocVM.SelectedEmailToConfirm = SendPocVM.ConfirmationEMailList[0];
        }
        #endregion

        [SubscribesTo(EventService.CertificateLoadedEvent)]
        public void OnCertificateLoadedEvent(object sender, EventArgs args)
        {
            //  EventService.CertificateLoadedEventEventArgs arg = args as  EventService.CertificateLoadedEventEventArgs;

            // Get own PersonalData
            GetOwnAddressbookEntryClick(null);
            //SendPocVM.ConfirmationEMailList.Clear();
            //SendPocVM.ConfirmationEMailList.Add("josef@bogad.at");
            //SendPocVM.ConfirmationEMailList.Add("jbogad@hotmail.com");
        }

        private void SetInitialPdfFilename()
        {
            string[] args = Environment.GetCommandLineArgs();

            if (args.Length < 2)
            {
                //label5.Text = "Zuwenig Parameter.";
                return;
            }
            string fn = args[1];
            if (!File.Exists(fn))
            {
                _dlg.ShowMessageBox("Datei " + fn + " nicht gefunden.");
                return;
            }
            SendPocVM.AttachmentFileName = fn;
        }

        [Publishes(EventService.GetTextBoxContent)]
        public event EventHandler GetTextBoxContentEvent;
        private void GetTextBoxContentFire()
        {
            EventHandler handler = GetTextBoxContentEvent;
            EventService.GetTextBoxContentEventArgs args = new EventService.GetTextBoxContentEventArgs();
            if (handler != null)
            {
                handler(this, args);
                SendPocVM.MessageText = args.MessageText;
            }
            return;
        }

    }
}


text:
from sqlalchemy import Column, Integer, ForeignKey, Boolean
from sqlalchemy.orm import relationship, backref

from ..api.database import Base

class ColorGame(Base):
    '''Represents a color game that is stored in the database.
    A game is linked to a pattern that is the correct solution to the game.
    '''

    # Name of table used by ColorGame
    __tablename__ = 'game'

    # Each game is uniquely keyed
    id = Column(Integer, primary_key=True)

    # Has this game been completed yet
    done = Column(Boolean, default=False)

    # The pattern that represents the solution to this game
    pattern_id = Column(Integer, ForeignKey('pattern.id'))
    pattern = relationship('ColorPattern', backref=backref('game', order_by=id))

redpajama_set_name: RedPajamaGithub


text:
.cm-s-choicescript span.cm-comment { color: rgb(0, 160, 0); }
.cm-s-choicescript span.cm-error { color: red; }
.cm-s-choicescript span.cm-keyword { line-height: 1em; font-weight: bold; color: rgb(255, 130, 0); }
.cm-s-choicescript span.cm-operator { color: red; }
.cm-s-choicescript span.cm-string { color: #a22; }
.cm-s-choicescript span.cm-builtin { line-height: 1em; font-weight: bold; color: rgb(0, 0, 255); }
.cm-s-choicescript span.cm-special { line-height: 1em; font-weight: bold; }
.cm-s-choicescript span.cm-variable { color: black; }
.cm-s-choicescript span.cm-number, .cm-s-choicescript span.cm-atom { color: #3a3; }
.cm-s-choicescript span.cm-meta {color: #555;}
.cm-s-choicescript span.cm-link { color: #3a3; }

.cm-s-choicescript .CodeMirror-activeline-background {background: #e8f2ff !important;}
.cm-s-choicescript .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;}


text:
const float kDZAnimationDefaultDuration = 0.25;

@implementation DZCameraDecoratorBaseViewController
@synthesize getImageBlock = _getImageBlock;
@synthesize needRealTimeDetectFace = _needRealTimeDetectFace;
@synthesize currentViewController = _currentViewController;
@synthesize placeHolderImage = _placeHolderImage;

- (void) setPlaceHolderImage:(UIImage *)placeHolderImage
{
    _placeHolderImage = placeHolderImage;
    _cameraViewController.placeHolderImage = placeHolderImage;
}

- (void) didRemoveCameraViewController
{

}

- (void) removeCameraViewController
{
    [_cameraViewController willMoveToParentViewController:nil];
    [_cameraViewController removeFromParentViewController];
    [self configureRemoveCameraViewControllerAnimation:^{
        [_cameraViewController.view removeFromSuperview];

    }];
    [_cameraViewController didMoveToParentViewController:Nil];
    [self didRemoveCameraViewController];
    _cameraViewController = nil;
}

- (void) configureAddCameraViewControllerAnimation:(DZAnimationCompletionBlock)block
{
    block();
}

- (void) configureRemoveCameraViewControllerAnimation:(DZAnimationCompletionBlock)block
{
    block();
}

- (void) didAddCameraViewController
{

}
- (void) addCameraViewController
{
    _cameraViewController = [[DZCameraViewController alloc] init];
    _cameraViewController.placeHolderImage = _placeHolderImage;
    _cameraViewController.delegate = self;
    [_cameraViewController willMoveToParentViewController:self];
    [self addChildViewController:_cameraViewController];
    [self.view addSubview:_cameraViewController.view];
    [self configureAddCameraViewControllerAnimation:^{

        _cameraViewController.view.frame = self.view.bounds;

    }];
    [_cameraViewController didMoveToParentViewController:self];
    _currentViewController = _cameraViewController;
    [self didAddCameraViewController];
}

- (void) initCameraViewController
{
    [self addCameraViewController];
}

- (void) setNeedRealTimeDetectFace:(BOOL)needRealTimeDetectFace
{
    _needRealTimeDetectFace = needRealTimeDetectFace;
    if (_needRealTimeDetectFace) {
        double delayInSeconds = 0.5;
        dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
        dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
            _cameraViewController.cameraManager.detectFaceRealTime = YES;
        });
    }
    else
    {
        _cameraViewController.cameraManager.detectFaceRealTime = NO;
    }
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self initCameraViewController];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma mark CameraViewController delegate
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- (void) cameraViewControllerDidUserCancel:(DZCameraViewController *)cameraViewController
{
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void) cameraViewController:(DZCameraViewController *)cameraViewController didGetImageFromCamera:(UIImage*)image
{
    if (_getImageBlock) {
        _getImageBlock(self, image);
    }
}

- (void) cameraViewController:(DZCameraViewController *)cameraViewController didGetImageFromAlbum:(UIImage*)image
{
    if (_getImageBlock) {
        _getImageBlock(self, image);
    }
}

#pragma -
#pragma 界面逻辑控制

- (void) pushNextViewController:(UIViewController *)viewController withAnimation:(BOOL)animation completion:(DZAnimationCompletionBlock)completionBlock
{
    if (_currentViewController != _cameraViewController) {
        return;
    }
    [self removeCameraViewController];
    [viewController willMoveToParentViewController:self];
    [self addChildViewController:viewController];
    [self.view addSubview:viewController.view];
    viewController.view.frame = self.view.frame;

    void(^animationBlock)(void) = ^(void) {

    };

    void(^finishAnimationBlock)(void) = ^(void) {
        [viewController didMoveToParentViewController:self];
        _currentViewController = viewController;
        if (completionBlock) {
            completionBlock();
        }
    };
    if (animation) {
        [UIView animateWithDuration:kDZAnimationDefaultDuration animations:animationBlock completion:^(BOOL finished) {
            finishAnimationBlock();
        }];
    }
    else
    {
        animationBlock();
        finishAnimationBlock();
    }
}

- (void) popToCameraViewControllerWithAnimation:(BOOL)animation completion:(DZAnimationCompletionBlock)completionBlock
{

    if (_currentViewController == _cameraViewController) {
        return;
    }
    [_currentViewController willMoveToParentViewController:Nil];
    void(^animationBlock)(void) = ^(void) {

    };

    void(^finishAnimationBlock)(void) = ^(void) {
        [_currentViewController.view removeFromSuperview];
        [_currentViewController removeFromParentViewController];
        [_currentViewController didMoveToParentViewController:nil];
        [self addCameraViewController];
        if (completionBlock) {
            completionBlock();
        }
    };
    if (animation) {
        [UIView animateWithDuration:kDZAnimationDefaultDuration animations:animationBlock completion:^(BOOL finished) {
            finishAnimationBlock();
        }];
    }
    else
    {
        animationBlock();
        finishAnimationBlock();
    }
}

- (void) cameraViewControllerWillSetuDZession:(DZCameraViewController *)cameraViewController
{

}

- (void) cameraViewControllerWillCaptureImage:(DZCameraViewController *)cameraViewController
{

}

- (void) cameraViewControllerDidSetuDZession:(DZCameraViewController *)cameraViewController error:(NSError *)error
{

}

@end


text:
..
    Warning: Do not edit this file. It is automatically generated from the
    software project's code and your changes will be overwritten.

    The tool to generate this file lives in openstack-doc-tools repository.

    Please make any changes needed in the code, then run the
    autogenerate-config-doc tool from the openstack-doc-tools repository, or
    ask for help on the documentation mailing list, IRC channel or meeting.

.. _ceilometer-api:

.. list-table:: Description of API configuration options
   :header-rows: 1
   :class: config-ref-table

   * - Configuration option = Default value
     - Description
   * - **[DEFAULT]**
     -
   * - ``api_paste_config`` = ``api_paste.ini``
     - (String) Configuration file for WSGI definition of API.
   * - ``event_pipeline_cfg_file`` = ``event_pipeline.yaml``
     - (String) Configuration file for event pipeline definition.
   * - ``pipeline_cfg_file`` = ``pipeline.yaml``
     - (String) Configuration file for pipeline definition.
   * - ``pipeline_polling_interval`` = ``20``
     - (Integer) Polling interval for pipeline file configuration in seconds.
   * - ``refresh_event_pipeline_cfg`` = ``False``
     - (Boolean) Refresh Event Pipeline configuration on-the-fly.
   * - ``refresh_pipeline_cfg`` = ``False``
     - (Boolean) Refresh Pipeline configuration on-the-fly.
   * - ``reserved_metadata_keys`` =
     - (List) List of metadata keys reserved for metering use. And these keys are additional to the ones included in the namespace.
   * - ``reserved_metadata_length`` = ``256``
     - (Integer) Limit on length of reserved metadata values.
   * - ``reserved_metadata_namespace`` = ``metering.``
     - (List) List of metadata prefixes reserved for metering use.
   * - **[api]**
     -
   * - ``aodh_is_enabled`` = ``None``
     - (Boolean) Set True to redirect alarms URLs to aodh. Default autodetection by querying keystone.
   * - ``aodh_url`` = ``None``
     - (String) The endpoint of Aodh to redirect alarms URLs to Aodh API. Default autodetection by querying keystone.
   * - ``default_api_return_limit`` = ``100``
     - (Integer) Default maximum number of items returned by API request.
   * - ``gnocchi_is_enabled`` = ``None``
     - (Boolean) Set True to disable resource/meter/sample URLs. Default autodetection by querying keystone.
   * - ``host`` = ``0.0.0.0``
     - (String) The listen IP for the ceilometer API server.
   * - ``pecan_debug`` = ``False``
     - (Boolean) Toggle Pecan Debug Middleware.
   * - ``port`` = ``8777``
     - (Port number) The port for the ceilometer API server.
   * - ``workers`` = ``1``
     - (Integer) Number of workers for api, default value is 1.
   * - **[oslo_middleware]**
     -
   * - ``max_request_body_size`` = ``114688``
     - (Integer) The maximum body size for each request, in bytes.
   * - ``secure_proxy_ssl_header`` = ``X-Forwarded-Proto``
     - (String) DEPRECATED: The HTTP Header that will be used to determine what the original request protocol scheme was, even if it was hidden by an SSL termination proxy.


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>W28650_text</title>
        <link rel="stylesheet" type="text/css" href="style.css" />

                «

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans763.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">XTO ENERGY PRODUCTION COMMINGLING DIAGRAM
Well Name Location
HM Hove 34X-33 SWSE of Sec. 33-T155N—R96W
HM Hove 34X-33C SWSE of Sec. 33-T155N-R96W
HM Hove 34X-33D SWSE of Sec. 33-T155N-R96W
HM Hove 34X-33G SWSE of Sec. 33-T155N-R96W
HM Hove 34X-33H SWSE of Sec. 33-T155N-R96W Williams, North Dakota
[El = Allocation Meter (e.g. Coriolis for oil; Mag Meter for produced water)
Additional tanks, as
Additional/Future Wells with Separators/
Treaters and Oil & Water Measurement CUStOdY - Custody Transfer 7 Transfer
Meter ~ Meter
Custody Transfer Meters
Additional flares, as needed
Original Date: 2012 Oct 17 Rev On: __10I30I12__ Rev On: _1/16113_ Rev On: _9I18l13_ Rev On: _3/13/14__ Rev On: __B/12/14
Rev 0n: _9[3]14_ Rev On: _10I1I14_ Rev On: Rev 0n: Rev On: Rev 0n:


text:
/**
 * Indicates that this module contains classes that need to be generated / processed.
 */
@ModuleGen(name = "vertx-blueprint-product", groupPackage = "io.vertx.blueprint.microservice.product")

package io.vertx.blueprint.microservice.product;

import io.vertx.codegen.annotations.ModuleGen;


text:
package com.github.i49.hibiscus.facets;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.json.JsonArray;
import javax.json.JsonValue;

import com.github.i49.hibiscus.problems.ArrayDuplicateItemProblem;
import com.github.i49.hibiscus.problems.Problem;

/**
 * unique facet to enforce each element in array to be unique.
 *

 * This facet is applicable to {@code array()} type only.
 * If any duplication of values is found in the array,
 * {@link ArrayDuplicateItemProblem} will be reported for each duplicated element excluding the first one.
 * This facet may report more than one problems.
 *

 */
public class UniqueItemFacet implements Facet<JsonArray> {

	/**
	 * The Singleton instance of this facet.
	 */
	public static final UniqueItemFacet INSTANCE = new UniqueItemFacet();

	@Override
	public void apply(JsonArray value, List<Problem> problems) {
		Set<JsonValue> items = new HashSet<>();
		int index = 0;
		for (JsonValue item: value) {
			if (items.contains(item)) {
				problems.add(new ArrayDuplicateItemProblem(index));
			} else {
				items.add(item);
			}
			index++;
		}
	}
}


text:
// Fetch last known query

var lastRoute = localStorage.getItem("lastBus");
var lastStation = localStorage.getItem("lastStop");
var lastDirection = localStorage.getItem("lastDirection");
if (!lastRoute) {
    lastRoute = 99;
}

if (!lastStation) {
    lastStation = 3038;
}

if (!lastDirection) {
    lastDirection = 0;
}

if (lastDirection === -1) {
    lastDirection = 0;
}

function fetchWeather(route, station, direction) {
    var response;
    var req = new XMLHttpRequest();
    console.log("Fetching transit data for " + route, station);
    console.log("http://ottawa.travvik.com/v3/json.php?" +
            "routeno=" + route + "&stopno=" + station + "&src=pebble");
    req.open('GET', "http://ottawa.travvik.com/json.php?" +
            "routeno=" + route + "&stopno=" + station + "&src=pebble", true);
    req.onload = function(e) {
        if (req.readyState === 4) {
            if (req.status === 200) {
                console.log(req.responseText);
                response = JSON.parse(req.responseText);
                var temperature, icon, city;
                var number, stopLabel, destination, arrival;
                //console.log("RSPOSNE" + response);
                //if (response > 0)
                {

                    console.log("***SUCCESS in getting data!");
                    var arrival0 = null, dst0 = null, stoplabel = null;

                    console.log("Executing direction: " + direction);

                    try {
                        arrival0 = response.GetNextTripsForStopResponse.GetNextTripsForStopResult.Route.RouteDirection[direction].Trips.Trip.AdjustedScheduleTime;
                        dst0 = response.GetNextTripsForStopResponse.GetNextTripsForStopResult.Route.RouteDirection[direction].Trips.Trip.TripDestination;
                    }
                    catch (e) {
                        console.log(e);
                    }

                    try {
                        arrival0 = response.GetNextTripsForStopResponse.GetNextTripsForStopResult.Route.RouteDirection.Trips.Trip.AdjustedScheduleTime;
                        dst0 = response.GetNextTripsForStopResponse.GetNextTripsForStopResult.Route.RouteDirection.Trips.Trip.TripDestination;
                    }
                    catch (e) {
                        console.log(e);
                    }

                    try {
                        arrival0 = response.GetNextTripsForStopResponse.GetNextTripsForStopResult.Route.RouteDirection[direction].Trips.Trip[0].AdjustedScheduleTime;
                        dst0 = response.GetNextTripsForStopResponse.GetNextTripsForStopResult.Route.RouteDirection[direction].Trips.Trip[0].TripDestination;
                    }
                    catch (e) {
                        console.log(e);
                    }

                    try {
                        arrival0 = response.GetNextTripsForStopResponse.GetNextTripsForStopResult.Route.RouteDirection.Trips.Trip[0].AdjustedScheduleTime;
                        dst0 = response.GetNextTripsForStopResponse.GetNextTripsForStopResult.Route.RouteDirection.Trips.Trip[0].TripDestination;
                    }
                    catch (e) {
                        console.log(e);
                    }

                    if (arrival0 === null) {
                        Pebble.sendAppMessage({
                            "arrival": 0,
                            "origin": "No data",
                            "destination": "be found",
                            "direction": direction,
                            "busnb": parseInt(route, 10),
                            "stopnb": parseInt(station, 10)
                        });
                    }

                    console.log("Arrival in " + arrival0);
                    console.log("Arrival in " + parseInt(arrival0, 10));

                    stoplabel = response.GetNextTripsForStopResponse.GetNextTripsForStopResult.StopLabel;
                    //arrival0 = arrival0.concat(" mins");

                    Pebble.sendAppMessage({
                        "arrival": parseInt(arrival0, 10),
                        "origin": stoplabel,
                        "destination": dst0,
                        "direction": direction,
                        "busnb": parseInt(route, 10),
                        "stopnb": parseInt(station, 10)
                    });
                    // No error detector, save the values.
                    localStorage.setItem("lastStop", station);
                    localStorage.setItem("lastBus", route);
                    console.log("Sent data to pebble");
                }

            } else {
                console.log("Error");
            }
        }
    };
    req.send(null);
}

function locationSuccess(pos) {
    var coordinates = pos.coords;
    console.log("Running locationSuccess");
    //fetchWeather(coordinates.latitude, coordinates.longitude);
}

function locationError(err) {
    console.warn('location error (' + err.code + '): ' + err.message);
}

function sendErrorMessage() {
    console.log("SendError");
    Pebble.sendAppMessage({
        "arrival": "Error",
        "origin": "Fail",
        "destination": "connect",
        "direction": lastDirection,
        "busnb": parseInt(lastRoute, 10),
        "stopnb": parseInt(lastStation, 10)
    });
}

var locationOptions = {"timeout": 15000, "maximumAge": 60000};
Pebble.addEventListener("ready",
        function(e) {
            console.log("connect!" + e.ready);
            console.log("last known values: " + lastRoute + " " + lastStation);
            fetchWeather(lastRoute, lastStation, 0);
            //locationWatcher = window.navigator.geolocation.watchPosition(locationSuccess, locationError, locationOptions);
            console.log(e.type);
        });
Pebble.addEventListener("appmessage",
        function(e) {
            var bus = null;
            var stop = null;
            var varx = null;
            var direction = null;
            /**enum REQUEST_KEYS {
             REQ_BUS_NB,
             REQ_STOP_NB,
             REQ_NONE,
             REQ_DIRECTION,
             };**/
            console.log("appmessage!");
            if (e.payload.arrival) {
                varx = e.payload.arrival;
                console.log("Payload lastBus: " + varx);
            }
            if (e.payload.origin) {
                varx = e.payload.origin;
                console.log("Payload lastStop: " + varx);
            }

            if (e.payload.direction) {
                varx = e.payload.direction;
                direction = parseInt(varx,10);
                console.log("Payload direction: " + direction);
            }

            if (e.payload.busnb) {
                bus = e.payload.busnb;
                console.log("Payload busnb: " + bus);
            }
            if (e.payload.stopnb) {
                stop = e.payload.stopnb;
                console.log("Payload stopnb: " + stop);
            }

            if (bus === -1 && stop === -1) {
                bus = lastRoute;
                stop = lastStation;
                console.log("Initial conditions");
            }

            if (direction === null){
                direction = 0;
            } else if (direction === -1){
                direction = lastDirection;
            }

            if (bus !== null && stop !== null) {

                console.log("Direction is " + direction);

                fetchWeather(bus, stop, direction);
//                switch (direction) {
//                    case 0:
//                        direction = 1;
//                        break;
//                    case 1:
//                        direction = 0;
//                        break;
//                    default:
//                        direction = 0;
//                        break;
//                }
                localStorage.setItem("lastDirection", direction);
            }
            else
            {
                console.log("Could not parse incoming data.");
                sendErrorMessage();
            }

            console.log("message!");
        });
Pebble.addEventListener("webviewclosed",
        function(e) {
            console.log("webview closed");
            console.log(e.type);
            console.log(e.response);
        });


text:
package com.david.algorithm_study;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

import org.apache.commons.lang3.RandomUtils;

public class Worker implements Runnable {
	private int workId;
	private CountDownLatch latch;
	private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

	public Worker(int workId, CountDownLatch latch) {
		super();
		this.workId = workId;
		this.latch = latch;
	}

	public void doWork() throws InterruptedException {
		String workerName = "worker_" + workId;
		System.out.println(workerName + " work at =" + sdf.format(new Date()));
		TimeUnit.SECONDS.sleep(RandomUtils.nextInt(1, 3));
		latch.countDown();
	}

	@Override
	public void run() {
		try {
			doWork();
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}


text:
package com.slothwerks.hearthstone.compendiumforhearthstone.models;

/**
 * Created by Eric on 9/3/2014.
 */
public enum Mechanic {
    Battlecry, Deathrattle, Freeze, Secret
}


text:
XWikiDoc(function (doc) {
    doc.setParent("RISCOSSPlatformRiskAnalysisManagerCode.WebHome");
    doc.setCreationDate("0");
    doc.setDate("0");
    doc.setContentUpdateDate("0");
    doc.setTitle("SaveSessionPopupForm");
});


text:
layout: post
title: Local data 2016 School District of the Chathams Salary info
tags: school salary pandas python
---

Recently I was looking for a source of data on the web which would be amenable to learning how to use the [Python](http://www.python.org) [Beautiful Soup library](https://www.crummy.com/software/BeautifulSoup/) for web scraping.  Ironically I found many web sites which provided csv or other raw data, but that wouldn't make use of web scraping.  On the other end of the spectrum I found web sites with intriguing data all hidden behind JavaScript layers, which would call for a tool more like selenium and I wanted to use Beautiful Soup.  Anyway, after much searching I found
[Data Universe of Asbury Park Press](http://php.app.com/agent/educationstaff) which not only some data in HTML, but had a nice sampling.  That is some data in tables, some data in just text and all spread around multiple pages.

The data covered educational staff salaries for all NJ public schools in 2016.  I chose to use a [subset](http://php.app.com/agent/educationstaff/search?last_name=&first_name=&county=MORRIS&district=SCH+DIST+OF+THE+CHATHAMS&school=).  of the data which had more meaning to me - just that from Morris County's School District of the Chathams where my kids go.  First, I browsed through the data and inspected it for regularness and pattern which would allow a simple program to digest it.  Luckily, it looked like the site followed a regular, predictable pattern.

The tools used include
1. Python 3.5.3  [Python](http://www.python.org)
2. Python3-requests-2.10.0-4.fc25.noarch [Requests: HTTP for humans](http://docs.python-requests.org/en/master/)
3. Python3-beautifulsoup4-4.6.0-1.fc25.noarch  [Beautiful Soup library](https://www.crummy.com/software/BeautifulSoup/)
4. python3-pandas-0.19.0-1.fc25.x86_64 [Pandas](http://pandas.pydata.org/)

The overview listing pages with maybe ten staff per page had the page numbers were nicely appended to the URLs.

```Python
base_url = 'http://php.app.com/agent/educationstaff/search/page:'
minpage = 1
maxpage = 13873
...
    for i in range(minpage, maxpage + 1):
        url = base_url + str(i)
        page = get_response(url)
        data = get_header_and_salary_data(page)
...
```

I started down that route, but after a few pages hit ctrl-C and interrupted it because, it turned out, as it often does, that I wanted just a little more information than was available on the overview listing pages.  We were to use this data for a linear regression model and I was curious how experience would relate to salary.  Fortunately, there were detail pages for each staff member and those had an id for each.  Also, from what I could tell the ids were ranges where all those in a county would be nearby - quite possibly this wouldn't work out for all districts or counties, but it seemed to for Morris County and School District of the Chathams.  Doing a quick sanity check, thinking about the number of schools, grades and students it seemed like a little less than 400 would be correct.  We got 383 or so by picking a range to fetch and store to files and then storing those to files with pickling and then later filtering upon read.

There were 13,873 pages in the big overview list for all of NJ - doable, but I was only interested in a subset.  By narrowing down to the page id range of 91953-92545 got it down to 592, then filtering down to 396.  Found a duplicate and dropped one row that wasn't complete (df.dropna(subset=[...]) and got down to 393.

```Python
base_url = 'http://php.app.com/agent/educationstaff/details/'
minpage=int(91953)
maxpage=int(92545)
...
data = {}
salaries = []
for i in range(minpage, maxpage + 1):
	url = base_url + str(i)
	page = get_response(url)
	headers, next_salaries = get_employee_details(page)
	salaries.extend(next_salaries)

# Combine the data into a dictionary with
# headers and salaries.
data = {
        'headers': headers,
        'salaries': salaries
       }

fn = base_fn + str(minpage) + '_' + str(maxpage) + '.pkl'
pickle_data(data, fn=fn)
```

We then had these columns to use:
```Python
for idx, val in enumerate(df4.columns):
    print('{} column: {}'.format(idx + 1, val))
dprint('row * column: {}'.format(df4.shape))

1 column: first
2 column: last
3 column: salary
4 column: county
5 column: district
6 column: experience_district
7 column: school
8 column: experience_nj
9 column: primary_job
10 column: experience_total
11 column: fte
12 column: subcategory
13 column: certificate
14 column: highly_qualified
15 column: teaching_route
debug: row * column: (393, 15)
```

**2016 Teacher Salary Data Exploration**
**School District of the Chathams**
**Chatham, NJ**

Looking at only the salary we found a wide range from 21 to 164k
and that the middle was around 65k with the average slightly higher
at 71k, Interesting.

```Python
print('average: {:,.0f}'.format(sal.mean()))
print('middle: {:,.0f}'.format(sal.median()))
print('min,max range: {:,.0f} through {:,.0f}'.format(sal.min(), sal.max()))
print('iqr range for dispersion: {:,.0f}'.format(ss.iqr(sal)))

average: 71,931
middle: 65,035
min,max range: 21,236 through 164,303
iqr range for dispersion: 22,884

ss.describe(sal)
Out[16]:
DescribeResult(nobs=393, minmax=(21236.0, 164303.0), mean=71931.325699745546, variance=475049866.43446535, skewness=1.1999130808179492, kurtosis=2.1010797452043084)
```

Dividing the data up into small ranges or bins and then putting them on a bar chart gives a visual of the distribution.

![Histogram](/images/data_universe_edu_sal_ch_hist.png "Histogram")


text:
//-----------------------------------------------------------------
// July 27, 2012
// Jason Bunk
// Rectangles.h
//
// Rectangular prisms, grids of points held in place by linear springs
// to keep them at proper distance, and diagonally-connecting springs
// to prevent twisting (to a point; then permanent deformation).
//-----------------------------------------------------------------

#ifndef ___RECTANGLE_NEW_H__
#define ___RECTANGLE_NEW_H__

#include "exports.h"
#include "Templates.h"
#include "Entities.h"
#include "EntitySystem.h"
#include <vector>

namespace phys
{

class ent_rectangle_new : public IEntity	//don't export the entire class (stl vectors won't work), just its functions
{
private:
		int N,M; //N horizontal, M vertical

		char checkBounds;

		std::vector<point> temp_positions;
		std::vector<point> temp_velocities;

		INLINE void UpdateCenterPos();
public:

		JPHYS_FLOAT_UNIT mass;
		JPHYS_FLOAT_UNIT kpos, eqdist;

		char drawHollow;

	//N horizontal
	JPHYSICS_API inline int GetN() {return N;}
	//M vertical
	JPHYSICS_API inline int GetM() {return M;}

	JPHYSICS_API ent_rectangle_new();

	JPHYSICS_API ent_rectangle_new(JPHYS_FLOAT_UNIT NN, JPHYS_FLOAT_UNIT MM, EntitySystem* entSys, SpawnParams_Soft params);

//-- IEntity required overrides:

	//updates positions and velocities
	JPHYSICS_API virtual void update(JPHYS_FLOAT_UNIT frametime);

	//draws object using OpenGl
	JPHYSICS_API virtual void draw();

	//draws positions with an offset and stretch. since it has to calculate the offset each time, this is less efficient.
	JPHYSICS_API virtual void drawWithOffset(const point& offset, const point& aspectStretch);

	//applies an impulse to any nearby objects (e.g. for mouse/finger touches)
	JPHYSICS_API virtual void applyImpulse(const point& Location, const point& Impulse);

	//Check collisions, esp. against another moving object nearby
	JPHYSICS_API virtual void checkCollisions(const line &hitSurface, const point& offset);

	void integRK4(std::vector<point> & POSITIONS, std::vector<point> & VELOCITIES, JPHYS_FLOAT_UNIT hhh);

	inline void motionFunc(std::vector<point> & POSITIONS, std::vector<point> & VELOCITIES);

	/*inline*/ void checkVertexCollisions(int vertex1, int vertex2);

};

}

#endif


text:
static int RunHelper(base::TestSuite* test_suite) {
  base::FeatureList::InitializeInstance(std::string(), std::string());
  std::unique_ptr<base::SingleThreadTaskExecutor> executor;
#if defined(USE_OZONE)
  executor = std::make_unique<base::SingleThreadTaskExecutor>(
      base::MessagePumpType::UI);
  ui::OzonePlatform::InitParams params;
  params.single_process = true;
  ui::OzonePlatform::InitializeForGPU(params);
#else
  executor = std::make_unique<base::SingleThreadTaskExecutor>(
      base::MessagePumpType::IO);
#endif

  CHECK(gl::init::InitializeGLOneOff());
  return test_suite->Run();
}

int main(int argc, char** argv) {
  base::TestSuite test_suite(argc, argv);
  base::CommandLine::Init(argc, argv);

  // Always run the perf tests serially, to avoid distorting
  // perf measurements with randomness resulting from running
  // in parallel.
  return base::LaunchUnitTestsSerially(
      argc, argv, base::BindOnce(&RunHelper, base::Unretained(&test_suite)));
}


text:
<?xml version = "1.0"?>
<?xml-stylesheet type="text/xsl" href="pb_help.xsl"?>
<API>
    <MODULE name="NewORMModel" parent="Rho" productException="eb">
        <HELP_OVERVIEW>NewORMModel CoreAPI module</HELP_OVERVIEW>
        <MORE_HELP>New implementation of the RHOM Model.
NOTE: BETA VERSION - This API has not been officially released. It should not be used in a production environment.
</MORE_HELP>

        <TEMPLATES>
            <PROPERTY_BAG/>
        </TEMPLATES>

         <PROPERTIES >
            <DESC>List of properties supported by instance of object.</DESC>
            <PROPERTY name="loaded" type="BOOLEAN" usePropertyBag="accessorsViaPropertyBag" >
                <DESC>Returns true if model is loaded.</DESC>
            </PROPERTY>
            <PROPERTY name="model_name" type="STRING" usePropertyBag="accessorsViaPropertyBag" >
                <DESC>Returns model's name.</DESC>
            </PROPERTY>
            <PROPERTY name="sync_type" type="STRING" usePropertyBag="accessorsViaPropertyBag" default="none" >
                <DESC>Returns model's Sync type.</DESC>
				<VALUES>
                    <VALUE value ="none">
                        <DESC>If data model is not a sync model.</DESC>
                    </VALUE>
                    <VALUE value ="incremental">
                        <DESC>Used when the data model is a sync model. Just syncs changes.</DESC>
                    </VALUE>
					<VALUE value ="bulk_only">
                        <DESC>If the model is used only for bulk sync.</DESC>
                    </VALUE>
                </VALUES>
            </PROPERTY>
            <PROPERTY name="sync_priority" type="INTEGER" usePropertyBag="accessorsViaPropertyBag">
                <DESC>This number determines the order in which the models are processed and synchronised. Priority starts from lower value 1. Lower the number, higher is the priority. Default value is 1000.</DESC>
            </PROPERTY>
            <PROPERTY name="partition" type="STRING" usePropertyBag="accessorsViaPropertyBag" >
                <DESC>Returns model's Db partition.</DESC>
				<VALUES>
					<VALUE value ="local">
						<DESC>This partition is used automatically if the model is not a sync model.</DESC>
					</VALUE>
                    <VALUE value ="user">
                        <DESC>This partition is used automatically if the model is a sync model.</DESC>
                    </VALUE>
					<VALUE value ="app">
                        <DESC>This partition is used to store the application related information.</DESC>
                    </VALUE>
                </VALUES>
            </PROPERTY>
            <PROPERTY name="source_id" type="INTEGER" usePropertyBag="accessorsViaPropertyBag" >
                <DESC>Returns model's source_id.</DESC>
            </PROPERTY>
            <PROPERTY name="fixed_schema" type="BOOLEAN" usePropertyBag="accessorsViaPropertyBag">
                <DESC>Returns true if the model's type is of fixed schema.</DESC>
            </PROPERTY>
            <PROPERTY name="freezed" type="BOOLEAN" usePropertyBag="accessorsViaPropertyBag">
                <DESC>Returns true if the model is frozen.</DESC>
            </PROPERTY>
            <PROPERTY name="associations" type="STRING" usePropertyBag="accessorsViaPropertyBag">
                <DESC>Returns model's associations.</DESC>
            </PROPERTY>
        </PROPERTIES>

        <METHODS>
            <METHOD name="enumerate" access="STATIC">
                <DESC>enumerate method returns array of ORMModel objects.</DESC>
                <RETURN type="ARRAY">
                    <DESC>Array of NewORMModel objects.</DESC>
                    <PARAM type="SELF_INSTANCE"/>
                </RETURN>
            </METHOD>
            <METHOD name="getModel" access="STATIC">
                <DESC>getModel method returns instance of the ORMModel.</DESC>
                <PARAMS>
                    <PARAM name="modelName" type="STRING">
                        <DESC>Name of the model you want returned.</DESC>
                    </PARAM>
                </PARAMS>
                <RETURN type="STRING">
                    <DESC>NewORMModel object.</DESC>
                    <PARAM type="SELF_INSTANCE"/>
                </RETURN>
            </METHOD>

            <METHOD name="init" constructor="true" generateDoc="false">
                <DESC>Initializes new model's instance.</DESC>
                <PARAMS>
                    <PARAM name="modelName" type="STRING"/>
                </PARAMS>
            </METHOD>

            <METHOD name="initModel" generateDoc="false">
                <DESC>Initializes model's internal DB.</DESC>
            </METHOD>

            <METHOD name="setBelongsTo">
                <DESC>Using this method, you can set sync association between models. For details [Associations](guide/rhom_ruby#associations)</DESC>
                <PARAMS>
                    <PARAM name="propertyName" type="STRING"/>
                    <PARAM name="sourceName" type="STRING"/>
                </PARAMS>
            </METHOD>

            <METHOD name="getBelongsTo">
                <DESC>Returns info about model's relationships with other models.</DESC>
                <PARAMS>
                    <PARAM name="propertyName" type="STRING"/>
                </PARAMS>
                <RETURN type="ARRAY"/>
            </METHOD>

            <METHOD name="set">
                <DESC>Sets model's property to value with additional processing for :sync property.</DESC>
                <PARAMS>
                    <PARAM name="propertyName" type="STRING">
						<PARAMS>
							<PARAM name="partition" type="STRING">
                                <DESC>The partition to use for this model. Partitions can be used to segment the data and keep non-synched data separate from synched models.</DESC>
								<VALUES>
                                    <VALUE value ="local">
                                        <DESC>This partition is used automatically if the model is not a sync model.</DESC>
                                    </VALUE>
                                    <VALUE value ="user">
                                        <DESC>This partition is used automatically if the model is a sync model.</DESC>
                                    </VALUE>
									<VALUE value ="app">
                                        <DESC>This partition is used to store the application related information.</DESC>
                                    </VALUE>
                                </VALUES>
                            </PARAM>
							<PARAM name="sync_type" type="STRING">
                                <DESC>Sets the type of sync it will be. </DESC>
                                <VALUES>
                                    <VALUE value ="none">
										<DESC>If data model is not a sync model.</DESC>
                                    </VALUE>
                                    <VALUE value ="incremental">
                                        <DESC>Used when the data model is a sync model. Just syncs changes.</DESC>
									</VALUE>
									<VALUE value ="bulk_only">
                                        <DESC>If the model is used only for bulk sync.</DESC>
                                    </VALUE>
                                </VALUES>
                            </PARAM>
							<PARAM name="sync_priority" type="INTEGER">
                                <DESC>This number determines the order in which the models are processed and synchronised. Priority starts from lower value 1. Lower the number, higher is the priority. Default value is 1000. </DESC>
                            </PARAM>
							<PARAM name="freezed" type="BOOLEAN">
                                <DESC>To make the model Freezed.</DESC>
                            </PARAM>
							<PARAM name="schema_version" type="FLOAT">
                                <DESC>This is used for data migration of the application.</DESC>
                            </PARAM>
						</PARAMS>
					</PARAM>
					<PARAM name="propertyValue" type="STRING">
						<DESC>The property names takes the corresponding property values, as mentioned above .</DESC>
					</PARAM>
                </PARAMS>
            </METHOD>

            <METHOD name="enable">
                <DESC>Sets model's Boolean property to true (enables model's property)</DESC>
                <PARAMS>
                    <PARAM name="propertyName" type="STRING">
					<VALUES>
						<VALUE value = "fixed_schema">
							<DESC>To set the type of model as Fixed_schema.</DESC>
						</VALUE>
						<VALUE value = "sync">
							<DESC>To make the model as user model.</DESC>
						</VALUE>
						<VALUE value = "full_update">
							<DESC>To send all the attributes(changed/unchanged) to Rhoconnect when an object is updated.</DESC>
						</VALUE>
						<VALUE value = "pass_through">
							<DESC>To keep the sensitive data out of redis server.</DESC>
						</VALUE>
					</VALUES>
					</PARAM>
                </PARAMS>
            </METHOD>

            <METHOD name="setModelProperty">
                <DESC>Initializes new model's field property.</DESC>
                <PARAMS>
                    <PARAM name="propertyName" type="STRING">
						<DESC>The name of the property.</DESC>
                    </PARAM>
                    <PARAM name="propertyType" type="STRING">
						<DESC>The type of property. Possible values are: String, Float, integer, Boolean, Varchar, Blob. String is default.</DESC>
                    </PARAM>
                    <PARAM name="propOption" type="STRING" default="Null">
                        <CAN_BE_NIL/>
                        	<VALUES>
						<VALUE value ="overwrite">
							<DESC>Overwrite client copy of blob with the new copy from server. This is useful when RhoConnect modifies images sent from Rhodes, for example zooming or cropping.</DESC>
						</VALUE>
				</VALUES>
                    </PARAM>
                </PARAMS>
            </METHOD>

            <METHOD name="getModelProperty">
                <DESC>Returns info about model's field property.</DESC>
                <PARAMS>
                    <PARAM name="propertyName" type="STRING">
						<DESC>The name of the property.</DESC>
					</PARAM>
                </PARAMS>
                <RETURN type="HASH">
					<DESC>Returns property name,type and option in the form of an HASH.</DESC>
				</RETURN>
            </METHOD>

            <METHOD name="setSchemaIndex">
                <DESC>Initializes new model's schema index.</DESC>
                <PARAMS>
                    <PARAM name="indexName" type="STRING">
						<DESC>To define a named index on a set of attributes.</DESC>
					</PARAM>
                    <PARAM name="indexCols" type="ARRAY">
						<DESC>A set of attributes which need a indexName are passed through this array.</DESC>
					</PARAM>
                    <PARAM name="is_unique" type="BOOLEAN">
						<DESC>To make the indexCols as unique column is_unique is set to true. This will prevent inserting duplicate records.</DESC>
					</PARAM>
                </PARAMS>
            </METHOD>

            <METHOD name="destroy" destructor="true" generateDoc="false">
                <DESC>Destroys model's instance.</DESC>
            </METHOD>

            <METHOD name="createObject" generateDoc="false">
                <DESC>Initializes model's object and stores it in the DB.</DESC>
                <PARAMS>
                    <PARAM name="attrs" type="HASH">
						<DESC>The attribute names and its respective values are passed as a key-value pair through this HASH.</DESC>
					</PARAM>
                </PARAMS>
                <RETURN type="HASH"/>
            </METHOD>

            <METHOD name="createInstance" generateDoc="false">
                <DESC>Creates model's instance and initializes model's object but doesn't store it in DB.</DESC>
                <PARAMS>
                    <PARAM name="attrs" type="HASH">
						<DESC>The attribute names and its respective values are passed as a key-value pair through this HASH.</DESC>
					</PARAM>
                </PARAMS>
                <RETURN type="HASH"/>
            </METHOD>

            <METHOD name="anyChangedObjects">
					<DESC>Checks whether the model has any changed objects.</DESC>
                <RETURN type="BOOLEAN"/>
            </METHOD>

            <METHOD name="hasChanges">
                <DESC>Checks whether the object has any changes. Returns true when an object is created or updated.</DESC>
                <PARAMS>
                    <PARAM name="objId" type="STRING"/>
                </PARAMS>
                <RETURN type="BOOLEAN"/>
            </METHOD>

            <METHOD name="canModify">
                <DESC>Checks whether the object can be modified.</DESC>
                <PARAMS>
                    <PARAM name="objId" type="STRING"/>
                </PARAMS>
                <RETURN type="BOOLEAN"/>
            </METHOD>

            <METHOD name="updateObject" generateDoc="false">
                <DESC>Updates object's attributes in the DB.</DESC>
                <PARAMS>
                    <PARAM name="objId" type="STRING"/>
                    <PARAM name="oldAttrs" type="HASH"/>
                    <PARAM name="newAttrs" type="HASH"/>
                </PARAMS>
                <RETURN type="HASH"/>
            </METHOD>

            <METHOD name="saveObject" generateDoc="false">
                <DESC>Saves (creates if necessary or updates if already exists) object's attributes in the DB.</DESC>
                <PARAMS>
                    <PARAM name="objId" type="STRING"/>
                    <PARAM name="attrs" type="HASH"/>
                </PARAMS>
                <RETURN type="HASH"/>
            </METHOD>

            <METHOD name="deleteObject" generateDoc="false">
                <DESC>Deletes object's attributes from the DB.</DESC>
                <PARAMS>
                    <PARAM name="objId" type="STRING"/>
                </PARAMS>
            </METHOD>

            <METHOD name="deleteObjects" generateDoc="false">
                <DESC>Deletes all object's according to the specified conditions.It is applicable only for Fixed_schema Model.</DESC>
                <PARAMS>
                    <PARAM name="strOptions" type="HASH">
						<DESC>This HASH takes only one key-value pair for which the key is `conditions` and the value is the attribute name. For multiple attribute names, OR/AND/IN operator is used.</DESC>
                    </PARAM>
					<PARAM name="quests" type="ARRAY">
						<DESC>This Array takes the values as String for the attribute names passed in the "strOptions" parameter.</DESC>
					</PARAM>
                </PARAMS>
            </METHOD>

            <METHOD name="deleteObjectsPropertyBagByCondHash" generateDoc="false">
                <DESC>Deletes all objects for the given Property Bag model according to the specified conditions. It is applicable only for Property bag Model.</DESC>
                <PARAMS>
                    <PARAM name="conditions" type="HASH">
						<DESC>The attribute names and its respective values are passed as a key-value pair in this HASH.</DESC>
           			</PARAM>
					<PARAM name="strOptions" type="HASH">
						<DESC>This HASH is passed as an empty HASH.</DESC>
					</PARAM>
                </PARAMS>
                <RETURN type="ARRAY"/>
            </METHOD>

            <METHOD name="deleteObjectsPropertyBagByCondArray" generateDoc="false">
                <DESC>Deletes all objects for the given Property Bag model according to the specified conditions. It is applicable only for Property bag Model.</DESC>
                <PARAMS>
                    <PARAM name="conditions" type="STRING">
						<DESC>The attribute names are passed as a string.</DESC>
					</PARAM>
                    <PARAM name="quests" type="ARRAY">
						<DESC>This Array takes the values as String for the attribute names passed in the "conditions" parameter.</DESC>
					</PARAM>
                    <PARAM name="strOptions" type="HASH">
						<DESC>This HASH is passed as an empty HASH.</DESC>
					</PARAM>
				</PARAMS>
                <RETURN type="ARRAY"/>
            </METHOD>

            <METHOD name="getCount">
                <DESC>Returns total number of objects for the model.</DESC>
                <RETURN type="INTEGER"/>
            </METHOD>

            <METHOD name="getBackendRefreshTime">
                <DESC>Returns time string when the source has been synced.</DESC>
                <RETURN type="STRING"/>
            </METHOD>

            <METHOD name="findObjects" generateDoc="false">
                <DESC>Returns array of objects for the given model queried according to the specified conditions. It is applicable only for Fixed_schema Model.</DESC>
                <PARAMS>
                    <PARAM name="whatParam" type="STRING">
						<DESC>It defines the type of find operation to be performed.</DESC>
						<VALUES>
							<VALUE value = "all">
								<DESC>Finds all Objects matching the 'conditions' for a specific Model.</DESC>
							</VALUE>
							<VALUE value = "count">
								<DESC>Returns the number of Objects matching the 'conditions' in a specific Model.</DESC>
							</VALUE>
							<VALUE value = "first">
								<DESC>Returns the first Object matching the 'conditions' in a specific Model.</DESC>
							</VALUE>
						</VALUES>
					</PARAM>
                    <PARAM name="strOptions" type="HASH">
						<DESC>This HASH takes only three key-value pairs for which the first key is `conditions` and the value is the attribute name. For multiple attribute names, OR/AND/IN operator is used. The second key is `offset` and the value is an integer which indicates the number of records to skip before returning. The third key is `per_page` and the value is an integer which specifies number of records to be returned.</DESC>
                    </PARAM>
					<PARAM name="quests" type="ARRAY">
						<DESC>This Array takes the values as String for the attribute names passed in the "strOptions" parameter.</DESC>
					</PARAM>
					<PARAM name="selectAttrs" type="ARRAY">
						<DESC>This Array takes the attribute names as string.Useful if the model has many attributes and your query only needs a few of them.</DESC>
                    </PARAM>
					<PARAM name="orderAttrs" type="ARRAY">
						<DESC>This Array is formed using attribute name followed by Order direction for that attribute. Order direction: 'ASC' ascending, 'DESC' descending. Default = 'ASC'.</DESC>
					</PARAM>
				</PARAMS>
                <RETURN type="ARRAY"/>
            </METHOD>

            <METHOD name="findObjectsPropertyBagByCondHash" generateDoc="false">
                <DESC>Returns array of objects for the given Property Bag model queried according to the specified conditions. It is applicable only for Property bag Model.</DESC>
                <PARAMS>
                    <PARAM name="whatParam" type="STRING">
						<DESC>It defines the type of find operation to be performed.</DESC>
						<VALUES>
							<VALUE value = "all">
								<DESC>Finds all Objects matching the 'conditions' for a specific Model.</DESC>
							</VALUE>
							<VALUE value = "count">
								<DESC>Returns the number of Objects matching the 'conditions' in a specific Model.</DESC>
							</VALUE>
							<VALUE value = "first">
								<DESC>Returns the first Object matching the 'conditions' in a specific Model.</DESC>
							</VALUE>
						</VALUES>
					</PARAM>
                    <PARAM name="conditions" type="HASH">
						<DESC>The attribute names and its respective values are passed as a key-value pair in this HASH.</DESC>
					</PARAM>
                    <PARAM name="strOptions" type="HASH">
						<DESC>This HASH is passed as an empty HASH.</DESC>
					</PARAM>
                    <PARAM name="selectAttrs" type="ARRAY">
						<DESC>This Array takes the attribute names as string. Note: You must include the column name which is there in condition string and others.</DESC>
                    </PARAM>
                </PARAMS>
                <RETURN type="ARRAY"/>
            </METHOD>

            <METHOD name="findObjectsPropertyBagByCondArray" generateDoc="false">
                <DESC>Returns array of objects for the given Property Bag model queried according to the specified conditions. It is applicable only for Property bag Model.</DESC>
                <PARAMS>
                    <PARAM name="whatParam" type="STRING">
						<DESC>It defines the type of find operation to be performed.</DESC>
						<VALUES>
							<VALUE value = "all">
								<DESC>Finds all Objects matching the 'conditions' for a specific Model.</DESC>
							</VALUE>
							<VALUE value = "count">
								<DESC>Returns the number of Objects matching the 'conditions' in a specific Model.</DESC>
							</VALUE>
							<VALUE value = "first">
								<DESC>Returns the first Object matching the 'conditions' in a specific Model.</DESC>
							</VALUE>
						</VALUES>
					</PARAM>
                    <PARAM name="conditions" type="STRING">
						<DESC>The attribute names are passed as a string.</DESC>
					</PARAM>
                    <PARAM name="quests" type="ARRAY">
						<DESC>This Array takes the values as String for the attribute names passed in the "conditions" parameter.</DESC>
					</PARAM>
                    <PARAM name="strOptions" type="HASH">
						<DESC>This HASH is passed as an empty HASH.</DESC>
					</PARAM>
                    <PARAM name="selectAttrs" type="ARRAY">
						<DESC>This Array takes the attribute names as string. Note: You must include the column name which is there in condition string and others.</DESC>
                    </PARAM>
                </PARAMS>
                <RETURN type="ARRAY"/>
            </METHOD>

            <METHOD name="find_by_sql">
                <DESC>Returns array of objects for the given model queried according to the specified SQL.</DESC>
                <PARAMS>
                    <PARAM name="sqlQuery" type="STRING"/>
                </PARAMS>
                <RETURN type="ARRAY"/>
            </METHOD>

            <METHOD name="validateFreezedAttribute" generateDoc="false">
                <DESC>Validates object's frozen attribute.</DESC>
                <PARAMS>
                    <PARAM name="attrName" type="STRING"/>
                </PARAMS>
                <RETURN type="BOOLEAN"/>
            </METHOD>

            <METHOD name="validateFreezedAttributes" generateDoc="false">
                <DESC>Validates all object's frozen attributes.</DESC>
                <PARAMS>
                    <PARAM name="attrHash" type="HASH"/>
                </PARAMS>
                <RETURN type="BOOLEAN"/>
            </METHOD>

            <METHOD name="buildComplexWhereCond" generateDoc="false">
                <DESC>Aux function.</DESC>
                <PARAMS>
                    <PARAM name="attrKey" type="STRING"/>
                    <PARAM name="attrValues" type="ARRAY"/>
                    <PARAM name="valOp" type="STRING"/>
                    <PARAM name="valFunc" type="STRING"/>
                </PARAMS>
                <RETURN type="ARRAY"/>
            </METHOD>

            <METHOD name="buildFindLimits" generateDoc="false">
                <DESC>Aux function.</DESC>
                <PARAMS>
                    <PARAM name="whatArg" type="STRING"/>
                    <PARAM name="hashArgs" type="HASH"/>
                </PARAMS>
                <RETURN type="HASH"/>
            </METHOD>

            <METHOD name="buildFindOrder" generateDoc="false">
                <DESC>Aux function.</DESC>
                <PARAMS>
                    <PARAM name="order_attrs" type="ARRAY"/>
                    <PARAM name="order_ops" type="ARRAY"/>
                </PARAMS>
                <RETURN type="HASH"/>
            </METHOD>

            <METHOD name="buildFindOrderString" generateDoc="false">
                <DESC>Aux function. Internally used to make order string.</DESC>
                <PARAMS>
                    <PARAM name="order_attrs" type="ARRAY"/>
                    <PARAM name="order_ops" type="ARRAY"/>
                </PARAMS>
                <RETURN type="HASH"/>
            </METHOD>

            <METHOD name="buildSimpleWhereCond" generateDoc="false">
                <DESC>Aux function.</DESC>
                <PARAMS>
                    <PARAM name="what" type="STRING"/>
                    <PARAM name="conditions" type="ARRAY"/>
                </PARAMS>
                <RETURN type="ARRAY"/>
            </METHOD>

            <METHOD name="clear" access="STATIC" generateDoc="false">
                <DESC>This method clears all the models and the associated tables with the models. It is used only for testing purpose and not for the developing.</DESC>
            </METHOD>

            <METHOD name="onSyncDeleteError">
                <DESC>Handles sync delete errors for the object.</DESC>
                <PARAMS>
                    <PARAM name="objId" type="STRING"/>
                    <PARAM name="attrHash" type="HASH"/>
                    <PARAM name="action" type="STRING"/>
                </PARAMS>
            </METHOD>

            <METHOD name="onSyncUpdateError">
                <DESC>Handles sync update errors for the object.</DESC>
                <PARAMS>
                    <PARAM name="objId" type="STRING"/>
                    <PARAM name="attrHash" type="HASH"/>
                    <PARAM name="rollbackHash" type="HASH"/>
                    <PARAM name="action" type="STRING"/>
                </PARAMS>
            </METHOD>

            <METHOD name="onSyncCreateError">
                <DESC>Handles sync create errors.</DESC>
                <PARAMS>
                    <PARAM name="objects" type="ARRAY"/>
                    <PARAM name="action" type="STRING"/>
                </PARAMS>
            </METHOD>

            <METHOD name="pushChanges">
                <DESC>Pushes all changes for the source. For details [push_changes](api/rhom-api#pushchanges)</DESC>
            </METHOD>

            <METHOD name="make" generateAPI="false">
                <DESC>Create a new ORM model object JavaScript reference but does not save it to the database. To save this reference to the database, you will need to execute the .save() method.</DESC>
                <APPLIES jsOnly="true"/>
            </METHOD>

            <METHOD name="new" generateAPI="false">
                <DESC>Initializes new model's instance.</DESC>
                <PARAMS>
                    <PARAM name="modelName" type="STRING"/>
                </PARAMS>
            </METHOD>
            <METHOD name="create" generateAPI="false">
                <DESC>Create a new Rhodes model object and save it to the database. This is the fastest way to insert a single item into the database.</DESC>
                <PARAMS>
                    <PARAM name="attrs" type="HASH">
                        <DESC>List of attributes assigned to the new model object, such as {name : "ABC Inc.",address: "555 5th St."}.</DESC>
                    </PARAM>
                </PARAMS>
                <RETURN type="OBJECT"/>
            </METHOD>
            <METHOD name="changed?" generateAPI="false" deprecated="true" >
                    <DESC>Returns true if a Rhodes model object has local database changes that need to be synchronized, false otherwise.</DESC>
                    <APPLIES rubyOnly="true"/>
                <RETURN type="BOOLEAN"/>
            </METHOD>

            <METHOD name="client_id" generateAPI="false" deprecated="true" >
                    <DESC>Returns the current sync client id.</DESC>
                    <APPLIES rubyOnly="true"/>
                <RETURN type="STRING"/>
            </METHOD>

            <METHOD name="count" generateAPI="false" deprecated="true" >
                    <DESC>Returns the number of objects in the named model.</DESC>
                    <APPLIES rubyOnly="true"/>
                <RETURN type="INTEGER"/>
            </METHOD>
            <METHOD name="can_modify" deprecated="true" generateAPI="false">
                <DESC>Checks whether the object can be modified.</DESC>
                <APPLIES rubyOnly="true"/>
                <PARAMS>
                    <PARAM name="objId" type="STRING"/>
                </PARAMS>
                <RETURN type="BOOLEAN"/>
            </METHOD>
            <METHOD name="updateAttributes" generateAPI="false" deprecated="true">
                <DESC>Updates the current Rho model object attributes and saves it to the database. This is the fastest way to add or update model attributes.</DESC>
                <APPLIES jsOnly="true"/>
                <PARAMS>
                    <PARAM name="attributes" type="HASH">
                        <DESC>List of attributes and their updated values are passed as a key-value pair in this HASH.</DESC>
                    </PARAM>
                </PARAMS>
            </METHOD>

            <METHOD name="update_attributes" generateAPI="false">
                <DESC>Updates the current Rho model object attributes and saves it to the database. This is the fastest way to add or update model attributes.</DESC>
                <PARAMS>
                    <PARAM name="attributes" type="HASH">
                        <DESC>List of attributes and their updated values are passed as a key-value pair in this HASH.</DESC>
                    </PARAM>
                </PARAMS>
            </METHOD>

            <METHOD name="paginate" generateAPI="false">
                <DESC> The paginate method takes care of setting the proper page limit and offset when a large number of records are fetched. This method accepts parameters as key-value pairs.
                </DESC>
                <PARAMS>
                    <PARAM name="params" type="HASH">
                        <DESC>A hash-map with paginate arguments.</DESC>
                        <PARAMS>
                            <PARAM name="page" type="INTEGER">
                                <DESC>This value is an offset which indicates the prevailing page number.</DESC>
                            <CAN_BE_NIL/>
                            </PARAM>
                            <PARAM name="per_page" type="INTEGER">
                                <DESC>This value specifies number of records to be returned. The default value of per_page is 10.</DESC>
                            <CAN_BE_NIL/>
                            </PARAM>
                            <PARAM name="conditions" type="ARRAY or HASH">
                                <DESC>hash of attribute/values. Also supports sql fragment with binding(i.e. ["name=?", "company_name"]).</DESC>
                            <CAN_BE_NIL/>
                            </PARAM>
                            <PARAM name="order" type="STRING or ARRAY">
                                <DESC>The attribute names to order the list.</DESC>
                            <CAN_BE_NIL/>
                            </PARAM>
                            <PARAM name="orderdir" type="STRING or ARRAY">
                                <DESC>Order direction: 'ASC' ascending, 'DESC' descending. Default = 'ASC'.</DESC>
                            <CAN_BE_NIL/>
                            </PARAM>
                            <PARAM name="select" type="STRING">
                                <DESC>The array of string attributes to return with the object.</DESC>
                            <CAN_BE_NIL/>
                            </PARAM>
                        </PARAMS>
                    </PARAM>
                </PARAMS>
                <RETURN type="ARRAY"/>
            </METHOD>

            <METHOD name="find_all" deprecated="true" generateAPI="false">
                <DESC>find('all') replaces the legacy ruby method find_all.</DESC>
                <APPLIES rubyOnly="true"/>
                <RETURN type="HASH"/>
            </METHOD>
            <METHOD name="save" generateAPI="false">
                <DESC>Saves the object's attributes in the DB.</DESC>
            </METHOD>
            <METHOD name="deleteAll" generateAPI="false" deprecated="true" >
                <DESC>Delete all Rhodes model objects for a source filtering by conditions. This method accepts parameters as key-value pairs. It accept conditions as a parameter.</DESC>
                <APPLIES jsOnly="true"/>
                <PARAMS>
                    <PARAM name="params" type="HASH">
                        <DESC>A hash-map with deleteAll arguments.</DESC>
                        <PARAMS>
                            <PARAM name="conditions" type="HASH">
                                <DESC>The attribute names and its respective values are passed as a key-value pair in this HASH. This will delete only the objects matching the criteria passed in the HASH.</DESC>
                            <CAN_BE_NIL/>
                            </PARAM>
                        </PARAMS>
                    </PARAM>
                </PARAMS>
            </METHOD>
            <METHOD name="has" generateAPI="false">
                <DESC>Returns true if the model has the propertyName given.</DESC>
                <APPLIES jsOnly="true"/>
                <PARAMS>
                    <PARAM name="propertyName" type="STRING">
                        <DESC>The name of the property you are checking for its existence.</DESC>
                    </PARAM>
                </PARAMS>
                <RETURN type="BOOLEAN"/>
            </METHOD>

            <METHOD name="vars" generateAPI="false">
                <DESC>Returns an object containing all propertyName and values for the model. You can use myModel.vars().name instead of myModel.get('name').</DESC>
                <APPLIES jsOnly="true"/>
                <RETURN type="HASH"/>
            </METHOD>

            <METHOD name="get_source_id" deprecated="true" generateAPI="false">
                <DESC>Returns the source id number for this Rhodes model object.
                    Please use the model property source_id.</DESC>
                <APPLIES rubyOnly="true"/>
                <RETURN type="HASH"/>
            </METHOD>

            <METHOD name="get_source_name" deprecated="true" generateAPI="false">
                <DESC>Returns the source name for this Rhodes model object.
                    Please use the model property model_name.</DESC>
                <APPLIES rubyOnly="true"/>
                <RETURN type="HASH"/>
            </METHOD>

            <METHOD name="get" generateAPI="false">
                <DESC>Get the value of a property of the current model.Ex: myModel.get('name'); See also the vars() method.</DESC>
                <APPLIES jsOnly="true"/>
                <PARAMS>
                    <PARAM name="propertyName" type="STRING">
                        <DESC>The name of the property you are trying to retrieve.</DESC>
                    </PARAM>
                </PARAMS>
                <RETURN type="STRING">
                    <DESC>Value of the specified property from the database.</DESC>
                </RETURN>
            </METHOD>
            <METHOD name="push_changes" generateAPI="false" deprecated="true">
                <DESC>Pushes all changes for the source.</DESC>
                <APPLIES rubyOnly="true"/>
            </METHOD>
            <METHOD name="delete_all" generateAPI="false">
                <DESC>Delete all Rhodes model objects for a source filtering by conditions. This method accepts parameters as key-value pairs. It accepts 2 keys- conditions and op.</DESC>
                <PARAMS>
                    <PARAM name="params" type="HASH">
                        <DESC>A hash-map with deleteAll arguments.</DESC>
                        <PARAMS>
                            <PARAM name="conditions" type="HASH or ARRAY">
                                <DESC>The attribute names and its respective values are passed as a key-value pair in this HASH. This will delete only the objects matching the criteria passed in the HASH.Also supports sql fragment with binding(i.e. ["name=?", "company_name"]</DESC>
                            <CAN_BE_NIL/>
                            </PARAM>
                        </PARAMS>
                    </PARAM>
                </PARAMS>
            </METHOD>

            <METHOD name="find" generateAPI="false">
                <DESC>Find model objects.</DESC>
                <PARAMS>
                    <PARAM name="queryType" type="STRING">
                        <VALUES>
                            <VALUE value="all" type="STRING">
                                <DESC>returns all objects; can use optional :conditions.</DESC>
                            </VALUE>
                            <VALUE value="first" type="STRING">
                                <DESC>returns first object matching :conditions.</DESC>
                            </VALUE>
                            <VALUE value="count" type="STRING">
                                <DESC>returns the number of objects matching these :conditions.</DESC>
                            </VALUE>
                        </VALUES>
                    </PARAM>
                    <PARAM name="queryOptions" type="HASH">
                        <DESC>An object of selection options</DESC>
                        <PARAMS>
                            <PARAM name="conditions" type="HASH or ARRAY">
                                <DESC>The attribute names and its respective values are passed as a key-value pair in this HASH that is required to find. Ex: conditions { name:'Symbol'}. Also supports sql fragment with binding(i.e. ["name=?", "company_name"]).</DESC>
                                <PARAMS>
                                    <PARAM name="propertyName" type=""></PARAM>
                                    <PARAM name="propertyValue" type=""></PARAM>
                                </PARAMS>
                                <CAN_BE_NIL/>
                            </PARAM>
                            <PARAM name="order" type="STRING or ARRAY">
                                <DESC>Attribute(s) to order the list.</DESC>
                                <CAN_BE_NIL/>
                            </PARAM>
                            <PARAM name="orderdir" type="STRING or ARRAY">
                                <DESC>Order direction.</DESC>
                                <VALUES>
                                    <VALUE value="ASC" type="STRING">
                                        <DESC>Ascending order. (Default)</DESC>
                                    </VALUE>
                                    <VALUE value="DESC" type="STRING">
                                        <DESC>Descending Order</DESC>
                                    </VALUE>
                                </VALUES>
                                <CAN_BE_NIL/>
                            </PARAM>
                            <PARAM name="select" type="ARRAY">
                                <DESC>Array of string attributes to return with the object. Useful if your model has many attributes and your query only needs a few of them.</DESC>
                                <CAN_BE_NIL/>
                            </PARAM>
                        </PARAMS>
                    </PARAM>
                </PARAMS>
                <RETURN type="ARRAY"/>
            </METHOD>

            <ALIASES>
                <ALIAS new="count" existing="getCount"/>
                <ALIAS new="backend_refresh_time" existing="getBackendRefreshTime"/>
            </ALIASES>
        </METHODS>

        <USER_OVERVIEW>
			<!--  More conversational style with INLINE SAMPLES, written in MarkDown -->
			<![CDATA[]]>
        </USER_OVERVIEW>

        <VER_INTRODUCED>1.0.0</VER_INTRODUCED>
        <PLATFORM>WM, CE, Win32, Android, iOS, WP8</PLATFORM>
        <PLATFORM_EB>WM, CE, Win32, Android</PLATFORM_EB>

		 <EXAMPLES>
            <EXAMPLE title="find_by_sql">
                <SECTIONS>
                    <SECTION>
                        <DESC>Finds the objects of a specific model using the SQL query statements.</DESC>
                        <CODE>
                            <JAVASCRIPT>
                <![CDATA[
var stdobjData = stdObj.find_by_sql("SELECT * FROM Student WHERE department = 'Mechanical'");  ]]>
                            </JAVASCRIPT>
                            <RUBY>
                <![CDATA[
result = stdObj.find_by_sql("SELECT * FROM Student WHERE department = 'Electronics'")  ]]>
                            </RUBY>
                        </CODE>
                    </SECTION>
                </SECTIONS>
            </EXAMPLE>
            <EXAMPLE title="create">
                <SECTIONS>
                    <SECTION>
                        <DESC>To create a model's object including initialization.</DESC>
                        <CODE>
                            <JAVASCRIPT>
                <![CDATA[
var accounts = Account.create({"name":"Craig", "age":"20"}); ]]>
                            </JAVASCRIPT>
                            <RUBY>
                <![CDATA[
accounts = Account.create({"name"=>"Craig","age"=>"20"}) ]]>
                            </RUBY>
                        </CODE>
                    </SECTION>
                </SECTIONS>
            </EXAMPLE>
            <EXAMPLE title="setSchemaIndex">
                <SECTIONS>
                    <SECTION>
                        <DESC>To set an index name to a set of attributes and indicating whether it is unique or not.</DESC>
                        <CODE>
                            <JAVASCRIPT>
                <![CDATA[
model.setSchemaIndex("p1", ["name","price"], false); ]]>
                            </JAVASCRIPT>
                            <RUBY>
                 <![CDATA[
model.setSchemaIndex("p1", ["name","price"], false) ]]>
                            </RUBY>
                        </CODE>
                    </SECTION>
                </SECTIONS>
            </EXAMPLE>
            <EXAMPLE title="setBelongsTo">
                <SECTIONS>
                    <SECTION>
                        <DESC>Using this method, you can set sync association between models.</DESC>
                        <CODE>
                            <JAVASCRIPT>
                <![CDATA[
var prdobjData = model.setBelongsTo("itemName", "Product");]]>
                            </JAVASCRIPT>
                            <RUBY>
                <![CDATA[
prdobjData = model.setBelongsTo("itemName", "Product") ]]>
                            </RUBY>
                        </CODE>
                    </SECTION>
                </SECTIONS>
            </EXAMPLE>
            <EXAMPLE title="paginate Method Examples">
                <SECTIONS>
                    <SECTION>
                        <DESC>To fetch the first 10 records.</DESC>
                        <CODE>
                            <JAVASCRIPT>
                <![CDATA[
var accounts = Account.paginate({page:0});  ]]>
                            </JAVASCRIPT>
                            <RUBY>
                <![CDATA[
accounts = Account.paginate({:page=>0})  ]]>
                            </RUBY>
                        </CODE>
                    </SECTION>
                    <SECTION>
                        <DESC>To fetch the records numbered 21-40.</DESC>
                        <CODE>
                            <JAVASCRIPT>
                <![CDATA[
var accounts = Account.paginate({page:1,per_page:20});  ]]>
                            </JAVASCRIPT>
                            <RUBY>
                <![CDATA[
accounts = Account.paginate({:page=>1,:per_page=>20})  ]]>
                            </RUBY>
                        </CODE>
                    </SECTION>
                    <SECTION>
                        <DESC>To fetch the records based on some conditions and ordering them as well.</DESC>
                        <CODE>
                            <JAVASCRIPT>
                <![CDATA[
var accounts = Account.paginate({ page:5,
                    conditions:{'name':'Fred','salary':4000},
                    order: 'salary'
                    });  ]]>
                            </JAVASCRIPT>
                            <RUBY>
                <![CDATA[
accounts = Account.paginate({ :page=>5,
                    :conditions=>{'name'=>'Fred','salary'=>4000},
                    :order=> 'salary'
                    })  ]]>
                            </RUBY>
                        </CODE>
                    </SECTION>
                </SECTIONS>
                </EXAMPLE>
                <EXAMPLE title="save">
                    <SECTIONS>
                        <SECTION>
                            <DESC>Saves the current model object to the database.</DESC>
                                <CODE>
                                    <JAVASCRIPT>
                <![CDATA[
var account = Account.make({"name": "Motorola", "industry": "electronics"});
                account.save(); ]]>
                                    </JAVASCRIPT>
                                    <RUBY>
                <![CDATA[
account = Account.make({"name"=>"Motorola", "industry"=>"electronics"});
                account.save() ]]>
                                    </RUBY>
                                </CODE>
                        </SECTION>
                    </SECTIONS>
                </EXAMPLE>

                <EXAMPLE title="update_attributes">
                    <SECTIONS>
                        <SECTION>
                            <DESC>Updates the current model object's attributes and saves it to the database.</DESC>
                                <CODE>
                                    <JAVASCRIPT>
                <![CDATA[
var account = Account.create({'name': 'Motorola', 'industry': 'electronics'});
            account.update_attributes({'name':'ABB','industry':'robotics'});
            account.get("industry"); //"robotics"   ]]>
                                    </JAVASCRIPT>
                                    <RUBY>
                <![CDATA[
account = Account.create({'name'=> 'Motorola', 'industry'=> 'electronics'})
            account.update_attributes({'name'=>'ABB','industry'=>'robotics'})
            account.get("industry") //"robotics"    ]]>
                                    </RUBY>
                                </CODE>
                        </SECTION>
                    </SECTIONS>
                </EXAMPLE>
                <EXAMPLE title="destroy">
                <SECTIONS>
                    <SECTION>
                        <DESC>Destroy a model object from database.</DESC>
                        <CODE>
                            <JAVASCRIPT>
                <![CDATA[
var account = Account.find('first');
            account.destroy(); ]]>
                            </JAVASCRIPT>
                             <RUBY>
                <![CDATA[
account = Account.find(:first)
            account.destroy() ]]>
                            </RUBY>
                        </CODE>
                    </SECTION>
                </SECTIONS>
                </EXAMPLE>
                <EXAMPLE title="has">
                <SECTIONS>
                    <SECTION>
                        <DESC>Checks whether the propertyName exists in the model.</DESC>
                        <CODE>
                            <JAVASCRIPT>
                <![CDATA[
var account = Account.find('first');
            account.has('salary'); ]]>
                            </JAVASCRIPT>
                            <RUBY>
                <![CDATA[
account = Account.find(:first)
            account.has('salary') ]]>
                            </RUBY>
                        </CODE>
                    </SECTION>
                </SECTIONS>
                </EXAMPLE>
                <EXAMPLE title="vars">
                <SECTIONS>
                    <SECTION>
                        <DESC>Returns all the propertyNames and it's values for the model.</DESC>
                        <CODE>
                            <JAVASCRIPT>
                <![CDATA[
var accounts = Account.create({"name":"Craig", "age":20});
            account.vars(); ]]>
                            </JAVASCRIPT>
                            <RUBY>
                <![CDATA[
accounts = Account.create({"name"=>"Craig", "age"=>20})
            account.vars() ]]>
                            </RUBY>
                        </CODE>
                    </SECTION>
                </SECTIONS>
                </EXAMPLE>
		</EXAMPLES>
    </MODULE>
</API>


text:
VAULT_BASE_URL=${VAULT_ADDR-http://localhost:8200}
if [ -z $1 ]
then
  echo provide key as a param in form  secret/project/keyname
  exit 1
fi

if [ -z $2 ]
then
  echo provide value for $1
  exit 1
fi

if [ -z "$VAULT_API_FAMILY" ]; then
echo vault kv put -address=$VAULT_BASE_URL $1 value=$2
vault kv put -address=$VAULT_BASE_URL $1 value=$2
else
echo vault write -address=$VAULT_BASE_URL $1 value=$2
vault write -address=$VAULT_BASE_URL $1 value=$2
fi


text:
// Copyright (C) 2015-2016 Eric Hebert (ayebear)
// This code is licensed under MIT, see LICENSE.txt for details.

#ifndef ES_COMPONENTPOOL_H
#define ES_COMPONENTPOOL_H

#include <typeindex>
#include <unordered_set>
#include <unordered_map>
#include <memory>
#include <cassert>
#include <es/internal/componentarray.h>

namespace es
{

// A default-constructible type_index
struct TypeIndex
{
    TypeIndex(): id{typeid(void)} {}
    TypeIndex(const std::type_index& id): id{id} {}

    std::type_index id;
};

/*
Each instance of ComponentPool stores its own components.
    Each component type is stored in a separate PackedArray.
    Base component arrays can be accessed by component name or type index.
*/
class ComponentPool
{
    public:

        ComponentPool();
        ~ComponentPool();

        // Registers a new component type and it's name
        template <typename T>
        static void registerComponent(const std::string& compName = "");

        // Returns true if the component name is valid
        static bool validName(const std::string& compName);

        // Returns the type index of a component by name
        static const std::type_index& getTypeIndex(const std::string& compName);

        // Returns the name of a component by type index
        static const std::string& getName(const std::type_index& typeIdx);

        // Returns the component array from the component's type
        template <typename T>
        ComponentArray<T>& get();

        // Returns the component array from the component's type
        template <typename T>
        const ComponentArray<T>& get() const;

        // Returns the base componeny array from the component's type index
        BaseComponentArray* operator[](const std::type_index& typeIdx) const;

        // Returns the base component array from the component's name
        BaseComponentArray* operator[](const std::string& compName);

        // Returns the base component array from the component's name
        const BaseComponentArray* operator[](const std::string& compName) const;

        // Clears all components, and sets up new arrays cloned from registered types
        void reset();

        // Adds any newly registered component types
        void refresh();

    private:

        // For storing components
        using ComponentArrayPtr = std::unique_ptr<BaseComponentArray>;

        // Contains a clonable empty component array and the component name
        struct ComponentInfo
        {
            ComponentArrayPtr array;
            std::string name;
        };

        using TypeToInfoMap = std::unordered_map<std::type_index, ComponentInfo>;
        using NameToTypeMap = std::unordered_map<std::string, TypeIndex>;

        struct StaticData
        {
            // For keeping track of ComponentPool instances
            std::unordered_set<ComponentPool*> instances;

            TypeToInfoMap compInfo;
            NameToTypeMap compTypes;
            const TypeIndex invalidType;
        };

        // Refreshes a single array by type index and returns its pointer
        BaseComponentArray* setupArray(const std::type_index& typeIdx, BaseComponentArray* array);

        static StaticData& getStaticData();

        // Used in the initializer list to make sure the static variables get
        // initialized before any component pools.
        StaticData& data;

        // All components are stored here, separated by type
        std::unordered_map<std::type_index, ComponentArrayPtr> components;
};

template <typename T>
void ComponentPool::registerComponent(const std::string& compName)
{
    std::type_index typeIdx {typeid(T)};
    auto& info = getStaticData().compInfo[typeIdx];
    if (!info.array)
    {
        // Store the name -> type index
        if (!compName.empty())
            getStaticData().compTypes[compName].id = typeIdx;

        // Create an empty array, and save the component name
        info.array = std::make_unique<ComponentArray<T>>();
        info.name = compName;

        // Update current ComponentPool instances with new type
        for (auto ptr: getStaticData().instances)
            ptr->setupArray(typeIdx, info.array.get());
    }
}

template <typename T>
ComponentArray<T>& ComponentPool::get()
{
    // Only returns the array for registered types
    auto found = components.find(typeid(T));
    assert(found != components.end());
    return *static_cast<ComponentArray<T>*>(found->second.get());
}

template <typename T>
const ComponentArray<T>& ComponentPool::get() const
{
    // Only returns the array for registered types
    auto found = components.find(typeid(T));
    assert(found != components.end());
    return *static_cast<const ComponentArray<T>*>(found->second.get());
}

// Registers a single component type
template<typename T>
void registerComponents()
{
    ComponentPool::registerComponent<T>(T::name);
}

// Registers multiple component types
template<typename A, typename B, typename... Args>
void registerComponents()
{
    registerComponents<A>();
    registerComponents<B, Args...>();
}

}

#endif


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
Fl. indica 226. 1768

#### Original name
null

### Remarks
null