text:
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Drawing2D;

namespace VS2005ToolBox
{
  [ToolboxItem(true)]
  [ToolboxBitmap(@"ToolBoxBmp")]
  public partial class ToolBox : TreeView
  {

        #region Local classes
        public class VSTreeNode : TreeNode
        {

        #region Private fields

      private string mToolTipCaption;
      private bool   mOnEdit;
      private bool   mEnabled;

      #endregion

      #region Public properties

      public string ToolTipCaption
      {
        get
        {
          return this.mToolTipCaption;
        }
        set
        {
          this.mToolTipCaption = value;
        }
      }

      public bool OnEdit
      {
        get
        {
          return this.mOnEdit;
        }
        set
        {
          this.mOnEdit = value;
        }
      }

      public bool Enabled
      {
        get
        {
          return this.mEnabled;
        }
        set
        {
          this.mEnabled = value;
        }
      }

      #endregion

      #region Constructor / Destructor

      public VSTreeNode() : base()
      {
        this.mToolTipCaption = string.Empty;
        this.mOnEdit         = false;
        this.mEnabled        = true;
      }

      #endregion
    }

        #endregion

        #region Private consts

        /// <summary>
    /// This is needed to disable the default tooltips
    /// of a treenode item.
    /// </summary>
        private const int TVS_NOTOOLTIPS = 0x80;

        #endregion

        #region Private fields

                /// <summary>
    /// Font to be used for the group headers in the toolbox.
    /// </summary>
        private Font mGroupHeaderFont;

                /// <summary>
    /// Custom tooltip for the treenodes.
    /// </summary>
        private ToolTip mToolTip;

                /// <summary>
    /// Stores the last mouse position for the custom tooltip.
    /// </summary>
        private TreeNode mPreviousNode;

                /// <summary>
    /// Textbox used for label edit.
    /// </summary>
        private TextBox mLabelEditBox;

        #endregion

        #region Protected properties

    /// <summary>
    /// Gets the create params property.
    ///
    /// Disables the tooltip activity for the treenodes.
    /// </summary>
    protected override CreateParams CreateParams
    {
      get
      {
          CreateParams p = base.CreateParams;
          p.Style = p.Style | TVS_NOTOOLTIPS;
          return p;
      }
    }

    #endregion

        #region Private methods

        /// <summary>
        /// Draws a group header
        /// </summary>
        private void drawRootItem(DrawTreeNodeEventArgs e)
        {
          Rectangle nodeTextRect = e.Bounds;

          nodeTextRect.Y      += 1;
          nodeTextRect.Width  -= 1;
          nodeTextRect.Height -= 3;

          if (   (e.State & TreeNodeStates.Marked)   == TreeNodeStates.Marked|| (e.State & TreeNodeStates.Selected) == TreeNodeStates.Selected)
          {

              using (Brush selBrush = new SolidBrush(Color.FromArgb(225, 230, 232)))
              {
                e.Graphics.FillRectangle(selBrush, nodeTextRect);
              }

              using (Pen outerPen = new Pen(Color.FromArgb(49, 106, 197)))
              {
                  e.Graphics.DrawRectangle(outerPen, nodeTextRect);
              }
          }
          else
          {
              using (LinearGradientBrush lgBrush = new LinearGradientBrush(e.Bounds, Color.FromArgb(221, 220, 203), Color.FromArgb(196, 193, 176), LinearGradientMode.Vertical))
              {
                  e.Graphics.FillRectangle(lgBrush, nodeTextRect);
              }

              using (Pen linePen = new Pen(this.BackColor))
              {
                  e.Graphics.DrawLine(linePen, 0, nodeTextRect.Bottom - 2, nodeTextRect.Width, nodeTextRect.Bottom - 2);
              }
          }

          if (e.Node.IsExpanded == true)
          {
              e.Graphics.DrawImage(ATABBI.TexE.Properties.Resources.expanded, new Point(nodeTextRect.Left + 3, nodeTextRect.Top + 4));
          }
          else
          {
              e.Graphics.DrawImage(ATABBI.TexE.Properties.Resources.collapsed, new Point(nodeTextRect.Left + 3, nodeTextRect.Top + 4));
          }
          nodeTextRect.Offset(16, 2);
          e.Graphics.DrawString(e.Node.Text, this.mGroupHeaderFont, SystemBrushes.ControlText, nodeTextRect.Location);
        }

        /// <summary>
        /// Draws a sub item of a group
        /// </summary>
        /// <param name="e"></param>
        private void drawItem(DrawTreeNodeEventArgs e)
        {
          Rectangle nodeTextRect = e.Bounds;

          nodeTextRect.Width -= 1;
          nodeTextRect.Height -= 1;

          if ((e.Node as VSTreeNode).OnEdit)
          {
              e.Graphics.FillRectangle(SystemBrushes.Window, nodeTextRect);
              using (Pen clearBGPen = new Pen(Color.FromArgb(49, 106, 197)))
              {
                  e.Graphics.DrawRectangle(SystemPens.HotTrack, nodeTextRect);
              }
              if (this.ImageList != null && e.Node.ImageIndex < this.ImageList.Images.Count)
              {
                  e.Graphics.DrawImage(this.ImageList.Images[e.Node.ImageIndex], new Point(e.Bounds.Left + 3, e.Bounds.Top + 2));
              }
          }
          else
          {
            if ((e.Node as VSTreeNode).Enabled)
            {
              if ((e.State & TreeNodeStates.Hot) == TreeNodeStates.Hot)
              {
                using (Brush hoverBrush = new SolidBrush(Color.FromArgb(193, 210, 238)))
                {
                  e.Graphics.FillRectangle(hoverBrush, nodeTextRect);
                }

                using (Pen clearBGPen = new Pen(Color.FromArgb(49, 106, 197)))
                {
                  e.Graphics.DrawRectangle(SystemPens.HotTrack, nodeTextRect);
                }
              }
              else
              {
                if ((e.State & TreeNodeStates.Selected) == TreeNodeStates.Selected)
                {
                  using (Brush hoverBrush = new SolidBrush(Color.FromArgb(225, 230, 232)))
                  {
                    e.Graphics.FillRectangle(hoverBrush, nodeTextRect);
                  }

                  e.Graphics.DrawRectangle(SystemPens.HotTrack, nodeTextRect);
                }
                else
                {
                  using (Brush hoverBrush = new SolidBrush(this.BackColor))
                  {
                    e.Graphics.FillRectangle(hoverBrush, e.Bounds);
                  }
                }
              }

              if (this.ImageList != null && e.Node.ImageIndex < this.ImageList.Images.Count)
              {
                e.Graphics.DrawImage(this.ImageList.Images[e.Node.ImageIndex], new Point(e.Bounds.Left + 3, e.Bounds.Top + 2));
              }
                nodeTextRect.Offset(20, 3);
                e.Graphics.DrawString(e.Node.Text, this.Font, SystemBrushes.ControlText, nodeTextRect.Location);
            }
            else
            {
                using (Brush hoverBrush = new SolidBrush(this.BackColor))
                {
                    e.Graphics.FillRectangle(hoverBrush, e.Bounds);
                }

                if (this.ImageList != null && e.Node.ImageIndex < this.ImageList.Images.Count)
                {
                    ControlPaint.DrawImageDisabled(e.Graphics, this.ImageList.Images[e.Node.ImageIndex],e.Bounds.Left + 3, e.Bounds.Top + 2, this.BackColor);
                }

                nodeTextRect.Offset(20, 3);
                ControlPaint.DrawStringDisabled(e.Graphics, e.Node.Text, this.Font, this.BackColor, nodeTextRect, new StringFormat());
            }
          }
        }

        /// <summary>
        /// Handles the end edit event.
        ///
        /// Hides the edit text box and stores the entered
        /// value if needed.
        /// </summary>
        /// <param name="setNewValues">Bool if the new text should be stored.</param>
        private void endLabelEdit(bool setNewValues)
        {
            if (setNewValues == true && this.mLabelEditBox.Tag != null)
            {
                (this.mLabelEditBox.Tag as VSTreeNode).Text = this.mLabelEditBox.Text;
            }

            this.mLabelEditBox.Visible = false;
            if (this.mLabelEditBox.Tag != null)
            {
                (this.mLabelEditBox.Tag as VSTreeNode).OnEdit = false;
                this.mLabelEditBox.Tag = null;
            }
            Invalidate();
        }

        /// <summary>
        /// Handles the lost focus event of the edit text box.
        ///
        /// Ends the label editing by calling the coresponding method.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void mLabelEditBox_LostFocus(object sender, EventArgs e)
    {
      endLabelEdit(false);
    }

        /// <summary>
    /// Handles the key down event.
    ///
    /// Calls the end label edit method and decides epending on the
    /// pressed key if the nw test should be stored.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
        private void mLabelEditBox_KeyDown(object sender, KeyEventArgs e)
    {
      switch (e.KeyCode)
      {
        case Keys.Escape:
          {
            endLabelEdit(false);
            break;
          }
        case Keys.Enter:
          {
            endLabelEdit(true);
            break;
          }
        default:
          {
            break;
          }
      }
    }

        #endregion

        #region Protected methods

    /// <summary>
    /// Decides wich node type should be drawn and calls the coresponding.
    /// methods.
    /// </summary>
    protected override void OnDrawNode(DrawTreeNodeEventArgs e)
    {
      if (e.Node.Level == 0)
      {
        drawRootItem(e);
      }
      else
      {
        drawItem(e);
      }
    }

    /// <summary>
    /// Handles the mouse down event
    ///
    /// Selects the node under the mouse cursor.
    /// </summary>
    /// <param name="e"></param>
    protected override void OnMouseDown(MouseEventArgs e)
    {
      TreeViewHitTestInfo hitTestInfo = this.HitTest(e.X, e.Y);

      if (hitTestInfo.Node != null
      &&  hitTestInfo.Location != TreeViewHitTestLocations.PlusMinus
      && (hitTestInfo.Node as VSTreeNode).Enabled == true)
      {
        this.SelectedNode = hitTestInfo.Node;

        if (hitTestInfo.Node.Level == 0)
        {
          if (hitTestInfo.Node.IsExpanded == true)
          {
            hitTestInfo.Node.Collapse();
          }
          else
          {
            hitTestInfo.Node.Expand();
          }
        }
      }

      base.OnMouseDown(e);
    }

    /// <summary>
    /// Handles the mouse move event
    ///
    /// Checks if the node under the cursor contains a tooltip
    /// and display it.
    /// </summary>
    /// <param name="e"></param>
    protected override void OnMouseMove(MouseEventArgs e)
    {
      base.OnMouseMove(e);

      VSTreeNode currentNode = GetNodeAt(e.X, e.Y) as VSTreeNode;

      if (currentNode == null || this.mPreviousNode == currentNode)
      {
        // Nothing to show. Let's return.
        return;
      }

      if (currentNode.ToolTipText == String.Empty)
      {
        // This item doesn'n contain a tooltip text.
        // Hide the tooltip.
        if (this.mToolTip != null)
        {
          this.mToolTip.Dispose();
          this.mToolTip = null;
        }

        return;
      }

      // Store the current node.
      this.mPreviousNode = currentNode;

      string toolTipCaption = currentNode.ToolTipCaption;
      string toolTipText    = currentNode.ToolTipText;

      // Turn off the tooltip so we can change the text.
      if (this.mToolTip != null && this.mToolTip.Active)
      {
        this.mToolTip.Dispose();
        this.mToolTip = null;
      }

      // Change the tooltip text.
      this.mToolTip = new ToolTip();
      this.mToolTip.ToolTipTitle = toolTipCaption;
      this.mToolTip.SetToolTip(this, toolTipText);

      // Turn on the tooltip .
      this.mToolTip.Active = true;

    }

    /// <summary>
    /// Handles the OnBeforeLabelEdit event
    ///
    /// Adds a textbox to the current label position to
    /// handle the label editing by itself.
    /// </summary>
    /// <param name="e"></param>
    protected override void OnBeforeLabelEdit(NodeLabelEditEventArgs e)
    {
      e.CancelEdit = true;

      if ((e.Node as VSTreeNode).Enabled)
      {
        (e.Node as VSTreeNode).OnEdit = true;

        mLabelEditBox.Bounds = new Rectangle(
          22, e.Node.Bounds.Top + 3, e.Node.Bounds.Width, e.Node.Bounds.Height + 4);

        mLabelEditBox.Text = e.Node.Text;
        mLabelEditBox.Visible = true;
        mLabelEditBox.Tag = e.Node;

        mLabelEditBox.Focus();
        mLabelEditBox.SelectAll();
      }
    }

    /// <summary>
    /// Handles the OnBeforeSelect event
    /// </summary>
    /// <param name="e"></param>
    protected override void OnBeforeSelect(TreeViewCancelEventArgs e)
    {
      if (!(e.Node as VSTreeNode).Enabled)
      {
        e.Cancel = true;
      }

      base.OnBeforeSelect(e);
    }

    #endregion

        #region Constructor / Destructor

        /// <summary>
        /// Creates a new VS 2005 ToolBox like control.
        /// </summary>
        public ToolBox()
    {
      this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
      this.SetStyle(ControlStyles.EnableNotifyMessage,   true);

      this.mGroupHeaderFont = new Font("Microsoft Sans Serif",
        8.25F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(0)));

      this.ShowLines     = false;
      this.HotTracking   = true;
      this.FullRowSelect = true;
      this.DrawMode      = TreeViewDrawMode.OwnerDrawAll;

      this.mPreviousNode = null;

      this.mToolTip = new ToolTip();

      this.mLabelEditBox             = new TextBox();
      this.mLabelEditBox.BorderStyle = BorderStyle.None;
      this.mLabelEditBox.Visible     = false;
      this.mLabelEditBox.LostFocus  += new EventHandler(mLabelEditBox_LostFocus);
      this.mLabelEditBox.KeyDown    += new KeyEventHandler(mLabelEditBox_KeyDown);

      this.Controls.Add(this.mLabelEditBox);
    }
        #endregion
  }
}


text:
package org.optaplanner.core.impl.heuristic.selector.entity.mimic;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.optaplanner.core.impl.domain.entity.descriptor.EntityDescriptor;
import org.optaplanner.core.impl.heuristic.selector.entity.EntitySelector;

public class ManualEntityMimicRecorder implements EntityMimicRecorder {

    protected final EntitySelector sourceEntitySelector;
    protected final List<MimicReplayingEntitySelector> replayingEntitySelectorList;

    protected Object recordedEntity;

    public ManualEntityMimicRecorder(EntitySelector sourceEntitySelector) {
        this.sourceEntitySelector = sourceEntitySelector;
        replayingEntitySelectorList = new ArrayList<MimicReplayingEntitySelector>();
    }

    @Override
    public void addMimicReplayingEntitySelector(MimicReplayingEntitySelector replayingEntitySelector) {
        replayingEntitySelectorList.add(replayingEntitySelector);
    }

    public Object getRecordedEntity() {
        return recordedEntity;
    }

    public void setRecordedEntity(Object recordedEntity) {
        this.recordedEntity = recordedEntity;
        for (MimicReplayingEntitySelector replayingEntitySelector : replayingEntitySelectorList) {
            replayingEntitySelector.recordedNext(recordedEntity);
        }
    }

    @Override
    public EntityDescriptor getEntityDescriptor() {
        return sourceEntitySelector.getEntityDescriptor();
    }

    @Override
    public boolean isCountable() {
        return sourceEntitySelector.isCountable();
    }

    @Override
    public boolean isNeverEnding() {
        return sourceEntitySelector.isNeverEnding();
    }

    @Override
    public long getSize() {
        return sourceEntitySelector.getSize();
    }

    @Override
    public Iterator<Object> endingIterator() {
        return sourceEntitySelector.endingIterator();
    }

    @Override
    public String toString() {
        return "Manual(" + sourceEntitySelector + ")";
    }

}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Core;
using Windows.UI.Xaml.Controls;
using MvvmCross.Core.ViewModels;
using MvvmCross.WindowsUWP.Views;
using MvvmCrossBackstack.Core.PresentationHints;

namespace MvvmCrossBackstack
{
    /// <summary>
    /// Handles back stack presentation hints
    /// </summary>
    public class BackStackHintHandler
    {
        private readonly Frame _frame;

        public BackStackHintHandler(IMvxWindowsFrame rootFrame)
        {
            _frame = (Frame)rootFrame.UnderlyingControl;
        }

        public bool HandleClearBackstackHint(ClearBackstackHint clearBackstackHint)
        {
            _frame.BackStack.Clear();
            UpdateBackButtonVisibility();
            return true;
        }

        public bool HandlePopBackstackHint(PopBackstackHint clearBackstackHint)
        {
            if (_frame.CanGoBack)
            {
                _frame.BackStack.RemoveAt(_frame.BackStackDepth - 1);
                UpdateBackButtonVisibility();
                return true;
            }
            return false;
        }

        private void UpdateBackButtonVisibility()
        {
            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility =
                _frame.CanGoBack ? AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed;
        }
    }
}


text:
/*
Theme Name: Assely
Theme URI: http://assely.org
Description: Theme for Assely framework website
Version: 1.0.0
Author: Jędrzej Chałubek <jedrzej.chalubek@gmail.com>
Author URI: http://jedrzejchalubek.com
*/


text:
[![CI Status](https://travis-ci.org/mikaoj/SwishControl.svg?branch=master)](https://travis-ci.org/mikaoj/SwishControl)
[![Version](https://img.shields.io/cocoapods/v/SwishControl.svg?style=flat)](http://cocoapods.org/pods/SwishControl)
[![License](https://img.shields.io/cocoapods/l/SwishControl.svg?style=flat)](http://cocoapods.org/pods/SwishControl)
[![Platform](https://img.shields.io/cocoapods/p/SwishControl.svg?style=flat)](http://cocoapods.org/pods/SwishControl)

SwishControl is a category on UIControl for adding sound effects to UIControlEvents.

## Usage

Import the SwishControl header
```objc
#import <SwishControl/SwishControl.h>
```
SwishControl uses AudioToolbox which supports aif, caf and wav.

This is how you add a sound effect for all UIButtons
```objc
NSString *clickPath = [[NSBundle mainBundle] pathForResource:@"click" ofType:@"aif"];
[[UIButton appearance] bs_setAudioWithPath:clickPath forEvent:UIControlEventTouchUpInside];
```
Of course it can be applied to a single UIControl as well, if you don't want to set a sound for all of them.

## Requirements
iOS, bananas and a bunch of sound effects

## Installation

SwishControl is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod "SwishControl"
```

## Author

Joakim Gyllström

## License

SwishControl is available under the MIT license. See the LICENSE file for more info.


text:
package org.apache.phoenix.end2end;

import static org.apache.phoenix.util.TestUtil.ROW1;
import static org.apache.phoenix.util.TestUtil.ROW2;
import static org.apache.phoenix.util.TestUtil.ROW3;
import static org.apache.phoenix.util.TestUtil.ROW4;
import static org.apache.phoenix.util.TestUtil.ROW5;
import static org.apache.phoenix.util.TestUtil.ROW7;
import static org.apache.phoenix.util.TestUtil.ROW8;
import static org.apache.phoenix.util.TestUtil.ROW9;
import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.Date;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Properties;

import org.apache.phoenix.util.PhoenixRuntime;
import org.apache.phoenix.util.PropertiesUtil;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

import com.google.common.collect.Lists;

@RunWith(Parameterized.class)
public class CaseStatementIT extends BaseQueryIT {

    public CaseStatementIT(String indexDDL, boolean mutable, boolean columnEncoded) {
        super(indexDDL, mutable, columnEncoded);
    }

    @Parameters(name="CaseStatementIT_{index}") // name is used by failsafe as file name in reports
    public static Collection<Object> data() {
        return QueryIT.data();
    }

    @Test
    public void testSimpleCaseStatement() throws Exception {
        String query = "SELECT CASE a_integer WHEN 1 THEN 'a' WHEN 2 THEN 'b' WHEN 3 THEN 'c' ELSE 'd' END, entity_id AS a FROM " + tableName + " WHERE organization_id=? AND a_integer < 6";
        String url = getUrl() + ";" + PhoenixRuntime.CURRENT_SCN_ATTRIB + "=" + (ts + 5); // Run query at timestamp 5
        Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
        Connection conn = DriverManager.getConnection(url, props);
        try {
            PreparedStatement statement = conn.prepareStatement(query);
            statement.setString(1, tenantId);
            ResultSet rs = statement.executeQuery();
            @SuppressWarnings("unchecked")
            List<List<Object>> expectedResults = Lists.newArrayList(
                Arrays.<Object>asList("a",ROW1),
                Arrays.<Object>asList( "b",ROW2),
                Arrays.<Object>asList("c",ROW3),
                Arrays.<Object>asList("d",ROW4),
                Arrays.<Object>asList("d",ROW5));
            assertValuesEqualsResultSet(rs, expectedResults);
        } finally {
            conn.close();
        }
    }

    @Test
    public void testMultiCondCaseStatement() throws Exception {
        String query = "SELECT CASE WHEN a_integer <= 2 THEN 1.5 WHEN a_integer = 3 THEN 2 WHEN a_integer <= 6 THEN 4.5 ELSE 5 END AS a FROM " + tableName + " WHERE organization_id=?";
        String url = getUrl() + ";" + PhoenixRuntime.CURRENT_SCN_ATTRIB + "=" + (ts + 5); // Run query at timestamp 5
        Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
        Connection conn = DriverManager.getConnection(url, props);
        try {
            PreparedStatement statement = conn.prepareStatement(query);
            statement.setString(1, tenantId);
            ResultSet rs = statement.executeQuery();
            assertTrue(rs.next());
            assertEquals(BigDecimal.valueOf(1.5), rs.getBigDecimal(1));
            assertTrue(rs.next());
            assertEquals(BigDecimal.valueOf(1.5), rs.getBigDecimal(1));
            assertTrue(rs.next());
            assertEquals(BigDecimal.valueOf(2), rs.getBigDecimal(1));
            assertTrue(rs.next());
            assertEquals(BigDecimal.valueOf(4.5), rs.getBigDecimal(1));
            assertTrue(rs.next());
            assertEquals(BigDecimal.valueOf(4.5), rs.getBigDecimal(1));
            assertTrue(rs.next());
            assertEquals(BigDecimal.valueOf(4.5), rs.getBigDecimal(1));
            assertTrue(rs.next());
            assertEquals(BigDecimal.valueOf(5), rs.getBigDecimal(1));
            assertTrue(rs.next());
            assertEquals(BigDecimal.valueOf(5), rs.getBigDecimal(1));
            assertTrue(rs.next());
            assertEquals(BigDecimal.valueOf(5), rs.getBigDecimal(1));
            assertFalse(rs.next());
        } finally {
            conn.close();
        }
    }

    @Test
    public void testPartialEvalCaseStatement() throws Exception {
        String query = "SELECT entity_id FROM " + tableName + " WHERE organization_id=? and CASE WHEN 1234 = a_integer THEN 1 WHEN x_integer = 5 THEN 2 ELSE 3 END = 2";
        String url = getUrl() + ";" + PhoenixRuntime.CURRENT_SCN_ATTRIB + "=" + (ts + 5); // Run query at timestamp 5
        Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
        Connection conn = DriverManager.getConnection(url, props);
        try {
            PreparedStatement statement = conn.prepareStatement(query);
            statement.setString(1, tenantId);
            ResultSet rs = statement.executeQuery();
            assertTrue(rs.next());
            assertEquals(ROW7, rs.getString(1));
            assertFalse(rs.next());
        } finally {
            conn.close();
        }
    }

    @Test
    public void testFoundIndexOnPartialEvalCaseStatement() throws Exception {
        String query = "SELECT entity_id FROM " + tableName + " WHERE organization_id=? and CASE WHEN a_integer = 1234 THEN 1 WHEN x_integer = 3 THEN y_integer ELSE 3 END = 300";
        String url = getUrl() + ";" + PhoenixRuntime.CURRENT_SCN_ATTRIB + "=" + (ts + 5); // Run query at timestamp 5
        Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
        Connection conn = DriverManager.getConnection(url, props);
        try {
            PreparedStatement statement = conn.prepareStatement(query);
            statement.setString(1, tenantId);
            ResultSet rs = statement.executeQuery();
            assertTrue(rs.next());
            assertEquals(ROW9, rs.getString(1));
            assertFalse(rs.next());
        } finally {
            conn.close();
        }
    }

    // TODO: we need some tests that have multiple versions of key values
    @Test
    public void testUnfoundMultiColumnCaseStatement() throws Exception {
        String query = "SELECT entity_id, b_string FROM " + tableName + " WHERE organization_id=? and CASE WHEN a_integer = 1234 THEN 1 WHEN a_date < ? THEN y_integer WHEN x_integer = 4 THEN 4 ELSE 3 END = 4";
        String url = getUrl() + ";" + PhoenixRuntime.CURRENT_SCN_ATTRIB + "=" + (ts + 5); // Run query at timestamp 5
        Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
        Connection conn = DriverManager.getConnection(url, props);
        try {
            PreparedStatement statement = conn.prepareStatement(query);
            statement.setString(1, tenantId);
            statement.setDate(2, new Date(System.currentTimeMillis()));
            ResultSet rs = statement.executeQuery();
            assertTrue(rs.next());
            assertEquals(ROW8, rs.getString(1));
            assertFalse(rs.next());
        } finally {
            conn.close();
        }
    }

    @Test
    public void testNonNullMultiCondCaseStatement() throws Exception {
        String query = "SELECT CASE WHEN entity_id = '000000000000000' THEN 1 WHEN entity_id = '000000000000001' THEN 2 ELSE 3 END FROM " + tableName + " WHERE organization_id=?";
        String url = getUrl() + ";" + PhoenixRuntime.CURRENT_SCN_ATTRIB + "=" + (ts + 5); // Run query at timestamp 5
        Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
        Connection conn = DriverManager.getConnection(url, props);
        try {
            PreparedStatement statement = conn.prepareStatement(query);
            statement.setString(1, tenantId);
            ResultSet rs = statement.executeQuery();
            ResultSetMetaData rsm = rs.getMetaData();
            assertEquals(ResultSetMetaData.columnNoNulls,rsm.isNullable(1));
        } finally {
            conn.close();
        }
    }

    @Test
    public void testNullMultiCondCaseStatement() throws Exception {
        String query = "SELECT CASE WHEN entity_id = '000000000000000' THEN 1 WHEN entity_id = '000000000000001' THEN 2 END FROM " + tableName + " WHERE organization_id=?";
        String url = getUrl() + ";" + PhoenixRuntime.CURRENT_SCN_ATTRIB + "=" + (ts + 5); // Run query at timestamp 5
        Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
        Connection conn = DriverManager.getConnection(url, props);
        try {
            PreparedStatement statement = conn.prepareStatement(query);
            statement.setString(1, tenantId);
            ResultSet rs = statement.executeQuery();
            ResultSetMetaData rsm = rs.getMetaData();
            assertEquals(ResultSetMetaData.columnNullable,rsm.isNullable(1));
        } finally {
            conn.close();
        }
    }

    @Test
    public void testNullabilityMultiCondCaseStatement() throws Exception {
        String query = "SELECT CASE WHEN a_integer <= 2 THEN ? WHEN a_integer = 3 THEN ? WHEN a_integer <= ? THEN ? ELSE 5 END AS a FROM " + tableName + " WHERE organization_id=?";
        String url = getUrl() + ";" + PhoenixRuntime.CURRENT_SCN_ATTRIB + "=" + (ts + 5); // Run query at timestamp 5
        Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
        Connection conn = DriverManager.getConnection(url, props);
        try {
            PreparedStatement statement = conn.prepareStatement(query);
            statement.setBigDecimal(1,BigDecimal.valueOf(1.5));
            statement.setInt(2,2);
            statement.setInt(3,6);
            statement.setBigDecimal(4,BigDecimal.valueOf(4.5));
            statement.setString(5, tenantId);
            ResultSet rs = statement.executeQuery();
            assertTrue(rs.next());
            assertEquals(BigDecimal.valueOf(1.5), rs.getBigDecimal(1));
            assertTrue(rs.next());
            assertEquals(BigDecimal.valueOf(1.5), rs.getBigDecimal(1));
            assertTrue(rs.next());
            assertEquals(BigDecimal.valueOf(2), rs.getBigDecimal(1));
            assertTrue(rs.next());
            assertEquals(BigDecimal.valueOf(4.5), rs.getBigDecimal(1));
            assertTrue(rs.next());
            assertEquals(BigDecimal.valueOf(4.5), rs.getBigDecimal(1));
            assertTrue(rs.next());
            assertEquals(BigDecimal.valueOf(4.5), rs.getBigDecimal(1));
            assertTrue(rs.next());
            assertEquals(BigDecimal.valueOf(5), rs.getBigDecimal(1));
            assertTrue(rs.next());
            assertEquals(BigDecimal.valueOf(5), rs.getBigDecimal(1));
            assertTrue(rs.next());
            assertEquals(BigDecimal.valueOf(5), rs.getBigDecimal(1));
            assertFalse(rs.next());
        } finally {
            conn.close();
        }
    }

}


text:
package org.apache.accumulo.core.client.lexicoder;

/**
 * A lexicoder for signed integers. The encoding sorts Integer.MIN_VALUE first and Integer.MAX_VALUE
 * last. The encoding sorts -2 before -1. It corresponds to the sort order of Integer.
 *
 * @since 1.6.0
 */
public class IntegerLexicoder extends AbstractLexicoder<Integer> {

  private UIntegerLexicoder uil = new UIntegerLexicoder();

  @Override
  public byte[] encode(Integer i) {
    return uil.encode(i ^ 0x80000000);
  }

  @Override
  public Integer decode(byte[] b) {
    // This concrete implementation is provided for binary compatibility, since the corresponding
    // superclass method has type-erased return type Object. See ACCUMULO-3789 and #1285.
    return super.decode(b);
  }

  @Override
  protected Integer decodeUnchecked(byte[] data, int offset, int len) {
    return uil.decodeUnchecked(data, offset, len) ^ 0x80000000;
  }

}


text:
require 'spec_helper'

describe Mediafile do

  before(:each) do
    @mediafile = Mediafile.create!(Factory.attributes_for(:mediafile))
  end

  it { should belong_to(:account) }
  it { should validate_presence_of(:account).with_message(/must have an account/) }

  describe "authors" do
    it { should have_many(:photocredits).dependent(:destroy) }
    it { should have_many(:authors).through(:photocredits) }

    it "should generate appropriate authors JSON" do
      lilly = Factory(:author, :name => "Lilly Aldrin")
      barney = Factory(:author, :name => "Barney Stinson")
      mediafile = Factory(:mediafile, :authors => [lilly, barney])

      mediafile.authors_json.should eql([{ "id" => lilly.id, "name" => lilly.name },{ "id" => barney.id, "name" => barney.name }].to_json)
    end

    it "should create a human readable list of authors' names" do
      mediafile = Factory(:mediafile)
      mediafile.authors = [Factory(:author, :name => "Lilly")]
      mediafile.authors_list.should == "Lilly"

      mediafile.authors << Factory(:author, :name => "Marshall")
      mediafile.authors_list.should == "Lilly and Marshall"

      mediafile.authors << Factory(:author, :name => "Robin")
      mediafile.authors_list.should == "Lilly, Marshall and Robin"

      mediafile.authors << Factory(:author, :name => "Barney")
      mediafile.authors_list.should == "Lilly, Marshall, Robin and Barney"
    end

    it "should add authors from a mixed list of IDs and new author names" do
      mediafile = Factory(:mediafile, :authors => [Factory(:author, :name => "Soon to be removed")])

      lilly = Factory(:author, :name => "Lilly Aldrin", :account => mediafile.account)
      barney = Factory(:author, :name => "Barney Stinson", :account => mediafile.account)

      mediafile.author_ids = "#{lilly.id}, Marshall Ericson,#{barney.id}"
      marshall = mediafile.account.authors.find_by_name("Marshall Ericson")
      mediafile.authors.should == [lilly, marshall, barney]
    end
  end

  describe "media class identification" do
    before do
      @image = Factory(:image)
      @audiofile = Factory(:audiofile)
    end

    it "should properly identify mediafiles" do
      @mediafile.should be_file
      @image.should_not be_file
    end

    it "should properly identify images" do
      @image.should be_image
      @audiofile.should_not be_image
    end

    it "should properly identify audiofiles" do
      @audiofile.should be_audiofile
      @image.should_not be_audiofile
    end
  end

  it "should break up a comma (with 'and') seperated string of authors' names to create authors array" do
    @mediafile.authors_list = "Lilly, Marshall and Robin"
    @mediafile.authors.length.should == 3
  end

  it "should create account-neutral photocopies of itself" do
    original = Factory(:detailed_mediafile)
    new_account = Factory(:account)
    photocopy = original.photocopy(new_account)

    photocopy.should_not be_new_record
    photocopy.account.should == new_account
    photocopy.authors_list.should == original.authors_list

    photocopy.file.should_not be_nil
    photocopy.file_content_type.should == original.file_content_type
    photocopy.file_file_size.should == original.file_file_size
    File.exists?(photocopy.file.path(:original)).should be_true
  end

  it "should set date when created" do
    @mediafile.date.should_not be_nil
  end

  it "should add tags" do
    @mediafile.tag("testing, one, two, three")
    @mediafile.tag_list.to_s.should == "testing, one, two, three"
    @mediafile.tag("four")
    @mediafile.tag_list.to_s.should == "testing, one, two, three, four"
  end
end


text:
#include <linux/bootmem.h>
#include <linux/blkdev.h>
#include <linux/ctype.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/limits.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/stat.h>
#include <linux/string.h>
#include <linux/types.h>

#include <asm/mmzone.h>

/*
 * Physical location of iSCSI Boot Format Table.
 */
struct ibft_table_header *ibft_addr;
EXPORT_SYMBOL_GPL(ibft_addr);

#define IBFT_SIGN "iBFT"
#define IBFT_SIGN_LEN 4
#define IBFT_START 0x80000 /* 512kB */
#define IBFT_END 0x100000 /* 1MB */
#define VGA_MEM 0xA0000 /* VGA buffer */
#define VGA_SIZE 0x20000 /* 128kB */

/*
 * Routine used to find the iSCSI Boot Format Table. The logical
 * kernel address is set in the ibft_addr global variable.
 */
void __init reserve_ibft_region(void)
{
	unsigned long pos;
	unsigned int len = 0;
	void *virt;

	ibft_addr = NULL;

	for (pos = IBFT_START; pos < IBFT_END; pos += 16) {
		/* The table can't be inside the VGA BIOS reserved space,
		 * so skip that area */
		if (pos == VGA_MEM)
			pos += VGA_SIZE;
		virt = isa_bus_to_virt(pos);
		if (memcmp(virt, IBFT_SIGN, IBFT_SIGN_LEN) == 0) {
			unsigned long *addr =
			    (unsigned long *)isa_bus_to_virt(pos + 4);
			len = *addr;
			/* if the length of the table extends past 1M,
			 * the table cannot be valid. */
			if (pos + len <= (IBFT_END-1)) {
				ibft_addr = (struct ibft_table_header *)virt;
				break;
			}
		}
	}
	if (ibft_addr)
		reserve_bootmem(pos, PAGE_ALIGN(len), BOOTMEM_DEFAULT);
}


text:
. `dirname $0`/../lib_logging.sh

info "Installing PIP Python package manager ..."

yum --assumeyes install python-pip


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mycotaxon 87: 51 (2003)

#### Original name
Stictis panizzei De Not., 1863

### Remarks
null


text:
<!DOCTYPE html>

    <title>Enums  Reference</title>
    <link rel="stylesheet" type="text/css" href="css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="css/highlight.css" />
    <meta charset='utf-8'>

 Docs (25% documented)

         Reference

        Enums  Reference

            Classes

                AlertNotificationService

                AppIDService

                AutoScalingService

                CloudantService

                DB2Service

                MongoDBService

                MySQLService

                ObjectStorageService

                PostgreSQLService

                RedisService

            Enums

                ConfigurationManagerError

            Extensions

                ConfigurationManager

Enums

The following enums are available globally.

                    ConfigurationManagerError

Cloudant, MongoDB, Redis, PostgreSQL

                        See more

Declaration

Swift

public enum ConfigurationManagerError: Error

© 2017 . All rights reserved. (Last updated: 2017-05-12)

Generated by jazzy ♪♫ v0.8.1, a Realm project.


text:
```@docs
BandedMatrix
```

```@docs
bones
```

```@docs
brand
```

```@meta
DocTestSetup = quote
    using BandedMatrices
end
```

To create a banded matrix of all zeros, identity matrix, or with a constant value
use the following constructors:
```jldoctest
julia> BandedMatrix(Zeros(5,5), (1,2))
5×5 BandedMatrix{Float64} with bandwidths (1, 2):
 0.0  0.0  0.0   ⋅    ⋅
 0.0  0.0  0.0  0.0   ⋅
  ⋅   0.0  0.0  0.0  0.0
  ⋅    ⋅   0.0  0.0  0.0
  ⋅    ⋅    ⋅   0.0  0.0

julia> BandedMatrix(Eye(5), (1,2))
5×5 BandedMatrix{Float64} with bandwidths (1, 2):
 1.0  0.0  0.0   ⋅    ⋅
 0.0  1.0  0.0  0.0   ⋅
  ⋅   0.0  1.0  0.0  0.0
  ⋅    ⋅   0.0  1.0  0.0
  ⋅    ⋅    ⋅   0.0  1.0

julia> BandedMatrix(Ones(5,5), (1,2))
5×5 BandedMatrix{Float64} with bandwidths (1, 2):
 1.0  1.0  1.0   ⋅    ⋅
 1.0  1.0  1.0  1.0   ⋅
  ⋅   1.0  1.0  1.0  1.0
  ⋅    ⋅   1.0  1.0  1.0
  ⋅    ⋅    ⋅   1.0  1.0
```
To create a banded matrix of a given size with constant bands (such as the classical finite difference approximation of the one-dimensional Laplacian on the unit interval [0,1]), you can use the following:
```julia
n = 128
h = 1/n
A = BandedMatrix{Float64}(undef, (n,n), (1,1))
A[band(0)] .= -2/h^2
A[band(1)] .= A[band(-1)] .= 1/h^2
```

Creating a large banded matrix from a dense matrix should be avoided because that costs time and memory:
```julia
julia> @time BandedMatrix(ones(10000,10000),(0,0));
0.775120 seconds (10 allocations: 763.016 MiB, 28.04% gc time)
```
Try to use structured matrices to get around this:
```julia
julia> @time BandedMatrix(Ones(10000,10000),(0,0));
0.000074 seconds (9 allocations: 78.469 KiB)
```

Another example:
```julia
julia> @time BandedMatrix([Ones(10000,5000) Zeros(10000,5000)],(1,1));
0.346918 seconds (22 allocations: 763.169 MiB, 8.38% gc time)

julia> using LazyArrays
julia> @time BandedMatrix(Hcat(Ones(10000,5000),Zeros(10000,5000)),(1,1));
0.012627 seconds (30.01 k allocations: 1.374 MiB, 92.24% gc time)
```

See [LazyArrays](https://github.com/JuliaArrays/LazyArrays.jl), [FillArrays](https://github.com/JuliaArrays/FillArrays.jl) for other implemented structured matrices.

## Accessing banded matrices

```@docs
bandwidths
```

```@docs
bandwidth
```

```@docs
bandrange
```

```@docs
band
```

```@docs
BandRange
```

To loop over the nonzero elements of a BandedMatrix, you can use `colrange(A, c)` and `rowrange(A, r)`.

## Creating symmetric banded matrices

Use `Symmetric(::BandedMatrix)` to work with symmetric banded matrices.

## Banded matrix interface

Banded matrices go beyond the type `BandedMatrix`: one can also create
matrix types that conform to the _banded matrix interface_, in which case
many of the utility functions in this package are available. The banded matrix
interface consists of the following:

| Required methods | Brief description |
| :--------------- | :--------------- |
| `bandwidths(A)` | Returns a tuple containing the sub-diagonal and super-diagonal bandwidth |
| `isbanded(A)`    | Override to return `true` |

| Optional methods | Brief description |
| :--------------- | :--------------- |
| `inbands_getindex(A, k, j)` | Unsafe: return `A[k,j]`, without the need to check if we are inside the bands |
| `inbands_setindex!(A, v, k, j)` | Unsafe: set `A[k,j] = v`, without the need to check if we are inside the bands |
| `BandedMatrices.MemoryLayout(A)` | Override to get banded lazy linear algebra, e.g. `y .= Mul(A,x)` |
| `BandedMatrices.bandeddata(A)` | Override to return a matrix of the entries in BLAS format. Required if `MemoryLayout(A)` returns `BandedColumnMajor` |

Note that certain `SubArray`s of `BandedMatrix` are also banded matrices.
The banded matrix interface is implemented for such `SubArray`s to take advantage of this.

## Eigenvalues
To compute efficiently a selection of eigenvalues for a `BandedMatrix`, you may use any Krylov method that relies on a sequence of matrix * vector operations. For instance, using the package [KrylovKit](https://github.com/Jutho/KrylovKit.jl):
```julia
using KrylovKit
A = BandedMatrix(Eye(5), (1, 1))
KrylovKit.eigsolve(A, 1, :LR)
```

## Implementation

Currently, only column-major ordering is supported: a banded matrix `B`
```julia
[ a_11 a_12  ⋅    ⋅
  a_21 a_22 a_23  ⋅
  a_31 a_32 a_33 a_34
   ⋅   a_42 a_43 a_44  ]
```
is represented as a `BandedMatrix` with a field `B.data` representing the matrix as
```julia
[ ⋅     a_12   a_23    a_34
 a_11   a_22   a_33    a_44
 a_21   a_32   a_43    ⋅
 a_31   a_42   ⋅       ⋅       ]
```
`B.l` gives the number of subdiagonals (2) and `B.u` gives the number of super-diagonals (1).  Both `B.l` and `B.u` must be non-negative at the moment.


text:
import io
import os
import sys
import time

from IOST_Prepare import IOST_Prepare
from IOST_Config  import *

import gtk
import gtk.glade

from pprint import pprint

#======================================================================
IOST_WMain_UART_Debug_Enable = 0

#======================================================================s
class IOST_WMain_UART():
    """
    """
    #----------------------------------------------------------------------
    def __init__(self, glade_filename, window_name, builder=None):
        """
        """
        self.IOST_WMain_UART_window_name=window_name
        if not builder:
            self.IOST_UART_Builder = gtk.Builder()
            self.IOST_UART_Builder.add_from_file(glade_filename)
            self.IOST_UART_Builder.connect_signals(self)
        else:
            self.IOST_UART_Builder = builder

    #----------------------------------------------------------------------
    def GetUART_Obj(self, window_name):
        """
        Get all UART objects on WMain window
        """
        self.IOST_Objs[window_name][window_name+"_IP_Enable_UART_CB"]  = \
        self.IOST_UART_Builder.get_object(self.IOST_Objs[window_name]["_IP_Enable_UART_CB"])

        for i in range(0, self.IOST_Data["UART_PortNum"]):
            self.IOST_Objs[window_name][window_name+"_Config_UART"+str(i)+"_CB"] = \
            self.IOST_UART_Builder.get_object(self.IOST_Objs[window_name]["_Config_UART"+str(i)+"_CB"])

            self.IOST_Objs[window_name][window_name+"_Config_UART"+str(i)+"_B"] = \
            self.IOST_UART_Builder.get_object(self.IOST_Objs[window_name]["_Config_UART"+str(i)+"_B"])

    #----------------------------------------------------------------------
    def InitUART_Obj(self, window_name):
        """
        Init all UART objects when start IOST Wmain program
        """
        if self.IOST_Data["UART"] == "Enable":
            self.IOST_Objs[window_name][window_name+"_IP_Enable_UART_CB"].set_active(True)
            for i in range(0, self.IOST_Data["UART_PortNum"]):
                if self.IOST_Data["UART"+str(i)][0] == "Disable":
                    self.IOST_Objs[window_name][window_name+"_Config_UART"+str(i)+"_CB"].set_active(False)
                    self.IOST_Objs[window_name][window_name+"_Config_UART"+str(i)+"_B"].set_sensitive(False)
                else:
                    self.IOST_Objs[window_name][window_name+"_Config_UART"+str(i)+"_CB"].set_active(True)
                    self.IOST_Objs[window_name][window_name+"_Config_UART"+str(i)+"_B"].set_sensitive(True)
        else:
            self.IOST_Objs[window_name][window_name+"_IP_Enable_UART_CB"].set_active(False)
            for i in range(0, self.IOST_Data["UART_PortNum"]):
                self.IOST_Objs[window_name][window_name+"_Config_UART"+str(i)+"_CB"].set_sensitive(False)
                self.IOST_Objs[window_name][window_name+"_Config_UART"+str(i)+"_B"].set_sensitive(False)

    #----------------------------------------------------------------------
    def on_IOST_WMain_Config_UART0_B_clicked(self, object, data=None):
        "Control to ConfigUART-0 button "

    #----------------------------------------------------------------------
    def on_IOST_WMain_Config_UART0_C_toggled(self, object, data=None):
        ""
        Res = self.IOST_Objs[self.IOST_WMain_UART_window_name][self.IOST_WMain_UART_window_name+"_Config_UART0_CB"].get_active()
        self.IOST_Objs[self.IOST_WMain_UART_window_name][self.IOST_WMain_UART_window_name+"_Config_UART0_B"].set_sensitive(Res)

        if (Res):
            self.IOST_Data["UART0"][0] = 'Enable'
        else:
            self.IOST_Data["UART0"][0] = 'Disable'
        if IOST_WMain_UART_Debug_Enable:
            print self.IOST_Data["UART0"][0]

    #----------------------------------------------------------------------
    def on_IOST_WMain_Config_UART1_B_clicked(self, object, data=None):
        "Control to ConfigUART-1 button "

    #----------------------------------------------------------------------
    def on_IOST_WMain_Config_UART1_C_toggled(self, object, data=None):
        ""
        Res = self.IOST_Objs[self.IOST_WMain_UART_window_name][self.IOST_WMain_UART_window_name+"_Config_UART1_CB"].get_active()
        self.IOST_Objs[self.IOST_WMain_UART_window_name][self.IOST_WMain_UART_window_name+"_Config_UART1_B"].set_sensitive(Res)

        if (Res):
            self.IOST_Data["UART1"][0] = 'Enable'
        else:
            self.IOST_Data["UART1"][0] = 'Disable'
        if IOST_WMain_UART_Debug_Enable:
            print self.IOST_Data["UART1"][0]

    #----------------------------------------------------------------------
    def on_IOST_WMain_Config_UART2_B_clicked(self, object, data=None):
        "Control to ConfigUART-2 button "

    #----------------------------------------------------------------------
    def on_IOST_WMain_Config_UART2_C_toggled(self, object, data=None):
        ""
        Res = self.IOST_Objs[self.IOST_WMain_UART_window_name][self.IOST_WMain_UART_window_name+"_Config_UART2_CB"].get_active()
        self.IOST_Objs[self.IOST_WMain_UART_window_name][self.IOST_WMain_UART_window_name+"_Config_UART2_B"].set_sensitive(Res)

        if (Res):
            self.IOST_Data["UART2"][0] = 'Enable'
        else:
            self.IOST_Data["UART2"][0] = 'Disable'
        if IOST_WMain_UART_Debug_Enable:
            print self.IOST_Data["UART2"][0]

    #----------------------------------------------------------------------
    def on_IOST_WMain_Config_UART3_B_clicked(self, object, data=None):
        ""
        "Control to ConfigUART-3 button "

    #----------------------------------------------------------------------
    def on_IOST_WMain_Config_UART3_C_toggled(self, object, data=None):
        ""
        Res = self.IOST_Objs[self.IOST_WMain_UART_window_name][self.IOST_WMain_UART_window_name+"_Config_UART3_CB"].get_active()
        self.IOST_Objs[self.IOST_WMain_UART_window_name][self.IOST_WMain_UART_window_name+"_Config_UART3_B"].set_sensitive(Res)

        if (Res):
            self.IOST_Data["UART3"][0] = 'Enable'
        else:
            self.IOST_Data["UART3"][0] = 'Disable'
        if IOST_WMain_UART_Debug_Enable:
            print self.IOST_Data["UART3"][0]

    #----------------------------------------------------------------------
    def on_IOST_WMain_Config_UART4_B_clicked(self, object, data=None):
        "Control to ConfigUART-4 button "

    #----------------------------------------------------------------------
    def on_IOST_WMain_Config_UART4_C_toggled(self, object, data=None):
        ""
        Res = self.IOST_Objs[self.IOST_WMain_UART_window_name][self.IOST_WMain_UART_window_name+"_Config_UART4_CB"].get_active()
        self.IOST_Objs[self.IOST_WMain_UART_window_name][self.IOST_WMain_UART_window_name+"_Config_UART4_B"].set_sensitive(Res)

        if (Res):
            self.IOST_Data["UART4"][0] = 'Enable'
        else:
            self.IOST_Data["UART4"][0] = 'Disable'
        if IOST_WMain_UART_Debug_Enable:
            print self.IOST_Data["UART4"][0]

    #----------------------------------------------------------------------
    def on_IOST_WMain_IP_Enable_UART_CB_toggled(self, object, data=None):
        Res = self.IOST_Objs[self.IOST_WMain_UART_window_name][self.IOST_WMain_UART_window_name+"_IP_Enable_UART_CB"].get_active()
        self.IOST_WMain_UART_set_sensitive_all(Res)
        if Res:
            self.IOST_Data["UART"] = 'Enable'
        else:
            self.IOST_Data["UART"] = 'Disable'

    #----------------------------------------------------------------------
    def IOST_WMain_UART_set_sensitive_all(self, value):
        for i in range(0, self.IOST_Data["UART_PortNum"]):
            self.IOST_Objs[self.IOST_WMain_UART_window_name][self.IOST_WMain_UART_window_name+"_Config_UART"+str(i)+"_CB"].set_sensitive(value)
            if self.IOST_Data["UART"+str(i)][0] == "Enable" and value:
                self.IOST_Objs[self.IOST_WMain_UART_window_name][self.IOST_WMain_UART_window_name+"_Config_UART"+str(i)+"_B"].set_sensitive(value)
            else:
                self.IOST_Objs[self.IOST_WMain_UART_window_name][self.IOST_WMain_UART_window_name+"_Config_UART"+str(i)+"_B"].set_sensitive(False)

#


text:
<?php

namespace AutoCheck;

/**
 * Class GetLink
 * @package AutoCheck
 */
class GetLink
{

    /**
     * @var Account
     */
    protected $account;
    /**
     * @var string
     */
    protected $postUrl = 'https://www.autocheck.com/DealerWebLink.jsp';

    /**
     * @param Account $account
     */
    public function __construct(Account $account)
    {
        $this->account = $account;
    }

    /**
     * @param $vin
     * @return mixed
     */
    public function requestLinkForVin($vin)
    {
        $data = [
            'VIN' => $vin,
            'CID' => $this->account->getCustomerId(),
            'PWD' => $this->account->getPassword(),
            'SID' => $this->account->getSecondaryCustomerId(),
            'LANG' => $this->account->getLanguage(),
        ];
        return $this->sendPost($data);
    }

    /**
     * @param $data
     * @return mixed
     */
    private function sendPost($data)
    {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($ch, CURLOPT_URL, $this->postUrl);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $this->generateUrlEncodedQueryString($data));
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $response = curl_exec($ch);
        curl_close($ch);
        return $response;
    }

    /**
     * @param $data
     * @return string
     */
    private function generateUrlEncodedQueryString($data)
    {
        $this->guardAgainstInvalidInputForUrl($data);
        return http_build_query($data);
    }

    /**
     * @param $data
     */
    private function guardAgainstInvalidInputForUrl($data)
    {
        if (!is_array($data))
            throw new \InvalidArgumentException;
    }
}


text:
Dropwizard kubernetes sample app using fabric8  openshift v3

     1) checkout fabric8-installer
        https://github.com/fabric8io/fabric8-installer.git

     2) cd fabric8-installer/vagrant/openshift

     3) vagrant up

        export KUBERNETES_DOMAIN=vagrant.f8
        export DOCKER_HOST=tcp://vagrant.f8:2375
        oc login https://172.28.128.4:8443
        username/password :  admin/admin

      4) vagrant landrush  start    on Mac to make sure the DNS is running

      To verify if the install is successful .

      oc get pods

     cd dropwizard-kubernetes

     run  $mvn clean install docker:build fabric8:recreate fabric8:delete-pods

      login to  fabric8.f8
      username/password :  admin/admin

      Go to Kubernetes -> Apps tab

      Run the app template chat

      run  the app template chaos-monkey


text:
package de.dch.cw.rest;

public class CWServer {

    private long id;
    private String content;

    public CWServer(long id, String content) {
        this.id = id;
        this.content = content;
    }

    public long getId() {
        return id;
    }

    public String getContent() {
        return content;
    }
}


text:
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { NewTopicComponent } from './new-topic.component';

describe('NewTopicComponent', () => {
  let component: NewTopicComponent;
  let fixture: ComponentFixture<NewTopicComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ NewTopicComponent ]
    })
    .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(NewTopicComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should be created', () => {
    expect(component).toBeTruthy();
  });
});


text:
import datetime

from spindrift.micro import Micro

PORT = 12345
PATH = '/test/coerce'
ID = 123
DATE = datetime.date(2018, 12, 13)

def to_date(ts):
    return datetime.datetime.strptime(ts, '%Y-%m-%d').date()

def coerce(request, id, when):
    assert id == ID
    return when.isoformat()

def on_coerce(rc, result):
    assert rc == 0
    assert result == DATE.isoformat()

def test_ping():
    s = [
        'SERVER coerce {}'.format(PORT),
        r'  ROUTE {}/(?P<id>\d+)$'.format(PATH),
        '    ARG int',
        '    GET test.test_micro_coerce.coerce',
        '        CONTENT when type=test.test_micro_coerce.to_date',
        'CONNECTION coerce http://localhost:{}'.format(PORT),
        '  RESOURCE get %s/{id} is_json=False' % PATH,
        '    REQUIRED when',
    ]
    micro = Micro().load(s).setup()

    c = micro.connection.coerce.resource.get(
        on_coerce,
        ID,
        DATE.isoformat(),
    )
    while c.is_open:
        micro.network.service()
    assert c.t_http_data > 0
    micro.close()


text:
// Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information.

(function ($) {

  /**
   * @param {object} options DatePicker options
   * @param {array} options.optionMonths An array of month abbreviations for the options grid
   * @param {string} options.label A label for the DatePicker
   * @param {string} options.placeholderText Placeholder text for the DatePicker textfield
   */
  $.fn.DatePicker = function (options) {

    var datePicker;
    var self = this;
    var optionMonths = options && options.optionMonths || ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
    var label = options && options.label || "Start Date";
    var placeholderText = options && options.placeholderText || "Select a date";

    /** check if the PickaDate plugin exists, if not load the plugin */
    if (!$().pickadate) {
      var firstScript = document.getElementsByTagName("script")[0];
      var script = document.createElement("script");
      script.onload = returnDatePicker;
      script.src = "PickaDate.js";
      firstScript.parentNode.insertBefore(script, firstScript);
    } else {
      datePicker = returnDatePicker();
    }

    function returnDatePicker() {
      /** Iterate through each date picker provided. */
      return self.each(function () {

        var $datePicker = $(this);

        /**create the body of the datepicker */
        appendElements($datePicker, optionMonths);

        /** insert label and placeholder text */
        $datePicker.find('.ms-Label').text(label);
        $datePicker.find('.ms-TextField-field').attr("placeholder", placeholderText + "...");

        /** Set up variables and run the Pickadate plugin. */
        var $dateField = $datePicker.find('.ms-TextField-field').pickadate({
          // Strings and translations.
          weekdaysShort: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],

          // Don't render the buttons
          today: '',
          clear: '',
          close: '',

          // Events
          onStart: function() {
            initCustomView($datePicker);
          },

          // Classes
          klass: {

            // The element states
            input: 'ms-DatePicker-input',
            active: 'ms-DatePicker-input--active',

            // The root picker and states
            picker: 'ms-DatePicker-picker',
            opened: 'ms-DatePicker-picker--opened',
            focused: 'ms-DatePicker-picker--focused',

            // The picker holder
            holder: 'ms-DatePicker-holder',

            // The picker frame, wrapper, and box
            frame: 'ms-DatePicker-frame',
            wrap: 'ms-DatePicker-wrap',
            box: 'ms-DatePicker-dayPicker',

            // The picker header
            header: 'ms-DatePicker-header',

            // Month & year labels
            month: 'ms-DatePicker-month',
            year: 'ms-DatePicker-year',

            // Table of dates
            table: 'ms-DatePicker-table',

            // Weekday labels
            weekdays: 'ms-DatePicker-weekday',

            // Day states
            day: 'ms-DatePicker-day',
            disabled: 'ms-DatePicker-day--disabled',
            selected: 'ms-DatePicker-day--selected',
            now: 'ms-DatePicker-day--today',
            infocus: 'ms-DatePicker-day--infocus',
            outfocus: 'ms-DatePicker-day--outfocus'
          }
        });
        var $picker = $dateField.pickadate('picker');

        /** Respond to built-in picker events. */
        $picker.on({
          render: function() {
            updateCustomView($datePicker);
          },
          open: function() {
            scrollUp($datePicker);
          }
        });

      });
    }

    return datePicker;
  };

  /**
   * Create the body of the DatePicker plugin and
   * append it to the date picker element
   * @param {object} $datePicker JQuery object
   * @param {array} optionMonths
   */
  function appendElements($datePicker, optionMonths) {
    var elements = '
';
    elements += '';
    elements += '';
    elements += '<input class="ms-TextField-field" type="text">';
    elements += '
';
    elements += '
';
    elements += '';
    elements += '';
    elements += '

';
    elements += '
';
    elements += 'Go to today';
    elements += '
';
    elements += '
';
    elements += '
';
    elements += '';
    elements += '';
    elements += '
';
    elements += '

';
    elements += '
';
    elements += '
';
    elements += '

';
    elements += '
';
    elements += '
';
    elements += '';
    elements += '';
    elements += '

';
    $datePicker.append(elements);
    $datePicker.find('.ms-DatePicker-optionGrid').append(createMonthOptions(optionMonths));
  }
  /**
   * creates month elements for the month grid
   * @param {array} optionMonths
   * @returns {string}
   */
  function createMonthOptions(optionMonths) {
    var i = 0;
    var content = "";
    for(i; i < 12; i++) {
      content += '' + optionMonths[i] + '';
    }
    return content;
  }
  /**
   * After the Pickadate plugin starts, this function
   * adds additional controls to the picker view.
   */
  function initCustomView($datePicker) {

    /** Get some variables ready. */
    var $monthControls = $datePicker.find('.ms-DatePicker-monthComponents');
    var $goToday = $datePicker.find('.ms-DatePicker-goToday');
    var $dayPicker = $datePicker.find('.ms-DatePicker-dayPicker');
    var $monthPicker = $datePicker.find('.ms-DatePicker-monthPicker');
    var $yearPicker = $datePicker.find('.ms-DatePicker-yearPicker');
    var $pickerWrapper = $datePicker.find('.ms-DatePicker-wrap');
    var $picker = $datePicker.find('.ms-TextField-field').pickadate('picker');

    /** Move the month picker into position. */
    $monthControls.appendTo($pickerWrapper);
    $goToday.appendTo($pickerWrapper);
    $monthPicker.appendTo($pickerWrapper);
    $yearPicker.appendTo($pickerWrapper);

    /** Update the custom view. */
    updateCustomView($datePicker);

    /** Move back one month. */
    $monthControls.on('click', '.js-prevMonth', function(event) {
      event.preventDefault();
      var newMonth = $picker.get('highlight').month - 1;
      changeHighlightedDate($picker, null, newMonth, null);
    });

    /** Move ahead one month. */
    $monthControls.on('click', '.js-nextMonth', function(event) {
      event.preventDefault();
      var newMonth = $picker.get('highlight').month + 1;
      changeHighlightedDate($picker, null, newMonth, null);
    });

    /** Move back one year. */
    $monthPicker.on('click', '.js-prevYear', function(event) {
      event.preventDefault();
      var newYear = $picker.get('highlight').year - 1;
      changeHighlightedDate($picker, newYear, null, null);
    });

    /** Move ahead one year. */
    $monthPicker.on('click', '.js-nextYear', function(event) {
      event.preventDefault();
      var newYear = $picker.get('highlight').year + 1;
      changeHighlightedDate($picker, newYear, null, null);
    });

    /** Move back one decade. */
    $yearPicker.on('click', '.js-prevDecade', function(event) {
      event.preventDefault();
      var newYear = $picker.get('highlight').year - 10;
      changeHighlightedDate($picker, newYear, null, null);
    });

    /** Move ahead one decade. */
    $yearPicker.on('click', '.js-nextDecade', function(event) {
      event.preventDefault();
      var newYear = $picker.get('highlight').year + 10;
      changeHighlightedDate($picker, newYear, null, null);
    });

    /** Go to the current date, shown in the day picking view. */
    $goToday.click(function(event) {
      event.preventDefault();

      /** Select the current date, while keeping the picker open. */
      var now = new Date();
      $picker.set('select', [now.getFullYear(), now.getMonth(), now.getDate()]);

      /** Switch to the default (calendar) view. */
      $datePicker.removeClass('is-pickingMonths').removeClass('is-pickingYears');

    });

    /** Change the highlighted month. */
    $monthPicker.on('click', '.js-changeDate', function(event) {
      event.preventDefault();

      /** Get the requested date from the data attributes. */
      var newYear = $(this).attr('data-year');
      var newMonth = $(this).attr('data-month');
      var newDay = $(this).attr('data-day');

      /** Update the date. */
      changeHighlightedDate($picker, newYear, newMonth, newDay);

      /** If we've been in the "picking months" state on mobile, remove that state so we show the calendar again. */
      if ($datePicker.hasClass('is-pickingMonths')) {
        $datePicker.removeClass('is-pickingMonths');
      }
    });

    /** Change the highlighted year. */
    $yearPicker.on('click', '.js-changeDate', function(event) {
      event.preventDefault();

      /** Get the requested date from the data attributes. */
      var newYear = $(this).attr('data-year');
      var newMonth = $(this).attr('data-month');
      var newDay = $(this).attr('data-day');

      /** Update the date. */
      changeHighlightedDate($picker, newYear, newMonth, newDay);

      /** If we've been in the "picking years" state on mobile, remove that state so we show the calendar again. */
      if ($datePicker.hasClass('is-pickingYears')) {
        $datePicker.removeClass('is-pickingYears');
      }
    });

    /** Switch to the default state. */
    $monthPicker.on('click', '.js-showDayPicker', function(event) {
      $datePicker.removeClass('is-pickingMonths');
      $datePicker.removeClass('is-pickingYears');
    });

    /** Switch to the is-pickingMonths state. */
    $monthControls.on('click', '.js-showMonthPicker', function(event) {
      $datePicker.toggleClass('is-pickingMonths');
    });

    /** Switch to the is-pickingYears state. */
    $monthPicker.on('click', '.js-showYearPicker', function(event) {
      $datePicker.toggleClass('is-pickingYears');
    });

  }

  /** Change the highlighted date. */
  function changeHighlightedDate($picker, newYear, newMonth, newDay) {

    /** All variables are optional. If not provided, default to the current value. */
    if (newYear == null) {
      newYear = $picker.get('highlight').year;
    }
    if (newMonth == null) {
      newMonth = $picker.get('highlight').month;
    }
    if (newDay == null) {
      newDay = $picker.get('highlight').date;
    }

    /** Update it. */
    $picker.set('highlight', [newYear, newMonth, newDay]);

  }

  /** Whenever the picker renders, do our own rendering on the custom controls. */
  function updateCustomView($datePicker) {
    /** Get some variables ready. */
    var $monthPicker = $datePicker.find('.ms-DatePicker-monthPicker');
    var $yearPicker = $datePicker.find('.ms-DatePicker-yearPicker');
    var $pickerWrapper = $datePicker.find('.ms-DatePicker-wrap');
    var $picker = $datePicker.find('.ms-TextField-field').pickadate('picker');

    /** Set the correct year. */
    $monthPicker.find('.ms-DatePicker-currentYear').text($picker.get('view').year);

    /** Highlight the current month. */
    $monthPicker.find('.ms-DatePicker-monthOption').removeClass('is-highlighted')
    $monthPicker.find('.ms-DatePicker-monthOption[data-month="' + $picker.get('highlight').month + '"]').addClass('is-highlighted');

    /** Generate the grid of years for the year picker view. */

      // Start by removing any existing generated output. */
    $yearPicker.find('.ms-DatePicker-currentDecade').remove();
    $yearPicker.find('.ms-DatePicker-optionGrid').remove();

    // Generate the output by going through the years.
    var startingYear = $picker.get('highlight').year - 11;
    var decadeText = startingYear + " - " + (startingYear + 11);
    var output = '
' + decadeText + '
';
    output += '
';
    for (year = startingYear; year < (startingYear + 12); year++) {
      output += '' + year +'';
    }
    output += '
';

    // Output the title and grid of years generated above.
    $yearPicker.append(output);

    /** Highlight the current year. */
    $yearPicker.find('.ms-DatePicker-yearOption').removeClass('is-highlighted')
    $yearPicker.find('.ms-DatePicker-yearOption[data-year="' + $picker.get('highlight').year + '"]').addClass('is-highlighted');
  }

  /** Scroll the page up so that the field the date picker is attached to is at the top. */
  function scrollUp($datePicker) {
    $('html, body').animate({
      scrollTop: $datePicker.offset().top
    }, 367);
  }

})(jQuery);


text:
My component

	This is an example of component 1 ...


text:
@interface PodsDummy_JFTextFieldTableCell : NSObject
@end
@implementation PodsDummy_JFTextFieldTableCell
@end


text:
<?php

namespace Pagekit\Blog\Entity;

use Pagekit\Comment\CommentsTrait;
use Pagekit\Framework\Database\Event\EntityEvent;
use Pagekit\System\Entity\DataTrait;
use Pagekit\User\Entity\AccessTrait;

/**
 * @Entity(repositoryClass="Pagekit\Blog\Entity\PostRepository", tableClass="@blog_post", eventPrefix="blog.post")
 */
class Post
{
    use AccessTrait, DataTrait, CommentsTrait;

    /* Post draft status. */
    const STATUS_DRAFT = 0;

    /* Post pending review status. */
    const STATUS_PENDING_REVIEW = 1;

    /* Post published. */
    const STATUS_PUBLISHED = 2;

    /* Post unpublished. */
    const STATUS_UNPUBLISHED = 3;

    /** @Column(type="integer") @Id */
    protected $id;

    /** @Column(type="string") */
    protected $title;

    /** @Column(type="string") */
    protected $slug;

    /** @Column(type="integer") */
    protected $user_id;

    /** @Column(type="datetime")*/
    protected $date;

    /** @Column(type="text") */
    protected $content;

    /** @Column(type="text") */
    protected $excerpt;

    /** @Column(type="smallint") */
    protected $status;

    /** @Column(type="datetime") */
    protected $modified;

    /** @Column(type="boolean") */
    protected $comment_status;

    /** @Column(type="integer") */
    protected $comment_count = 0;

    /** @Column(type="json_array") */
    protected $data;

    /**
     * @BelongsTo(targetEntity="Pagekit\User\Entity\User", keyFrom="user_id")
     */
    protected $user;

    /**
     * @HasMany(targetEntity="Comment", keyFrom="id", keyTo="post_id")
     * @OrderBy({"created" = "DESC"})
     */
    protected $comments;

    /**
     * @var bool
     */
    protected $commentable;

    public function getId()
    {
        return $this->id;
    }

    public function setId($id)
    {
        $this->id = $id;
    }

    public function getTitle()
    {
        return $this->title;
    }

    public function setTitle($title)
    {
        $this->title = $title;
    }

    public function getSlug()
    {
        return $this->slug;
    }

    public function setSlug($slug)
    {
        $this->slug = $slug;
    }

    public function getUserId()
    {
        return $this->user_id;
    }

    public function setUserId($userId)
    {
        $this->user_id = $userId;
    }

    public function getDate()
    {
        return $this->date;
    }

    public function setDate(\DateTime $date)
    {
        $this->date = $date;
    }

    public function getContent()
    {
        return $this->content;
    }

    public function setContent($content)
    {
        $this->content = $content;
    }

    public function getExcerpt()
    {
        return $this->excerpt;
    }

    public function setExcerpt($excerpt)
    {
        $this->excerpt = $excerpt;
    }

    public function getStatus()
    {
        return $this->status;
    }

    public function setStatus($status)
    {
        $this->status = $status;
    }

    public function getModified()
    {
        return $this->modified;
    }

    public function setModified(\DateTime $modified)
    {
        $this->modified = $modified;
    }

    public static function getStatuses()
    {
        return [
            self::STATUS_PUBLISHED      => __('Published'),
            self::STATUS_UNPUBLISHED    => __('Unpublished'),
            self::STATUS_DRAFT          => __('Draft'),
            self::STATUS_PENDING_REVIEW => __('Pending Review')
        ];
    }

    public function getStatusText()
    {
        $statuses = self::getStatuses();

        return isset($statuses[$this->status]) ? $statuses[$this->status] : __('Unknown');
    }

    public function getUser()
    {
        return $this->user;
    }

    public function setUser($user)
    {
        $this->user = $user;
    }

    public function isCommentable()
    {
        return $this->commentable;
    }

    public function setCommentable($commentable)
    {
        $this->commentable = $commentable;
    }

    /**
     * @PreSave
     */
    public function preSave(EntityEvent $event)
    {
        $this->modified = new \DateTime;

        $repository = $event->getEntityManager()->getRepository(get_class($this));

        $i = 2;
        $id = $this->id;

        while ($repository->query()->where('slug = ?', [$this->slug])->where(function($query) use($id) { if ($id) $query->where('id <> ?', [$id]); })->first()) {
            $this->slug = preg_replace('/-\d+$/', '', $this->slug).'-'.$i++;
        }
    }

    /**
     * @PreDelete
     */
    public function preDelete(EntityEvent $event)
    {
        $event->getConnection()->delete('@blog_comment', ['post_id' => $this->getId()]);
    }
}


text:
class ApprovalCommandConfiguration {
    [string]$Expression
    [System.Collections.ArrayList]$ApprovalGroups
    [bool]$PeerApproval

    ApprovalCommandConfiguration() {
        $this.Expression = [string]::Empty
        $this.ApprovalGroups = New-Object -TypeName System.Collections.ArrayList
        $this.PeerApproval = $true
    }

    [hashtable]ToHash() {
        return @{
            Expression   = $this.Expression
            Groups       = $this.ApprovalGroups
            PeerApproval = $this.PeerApproval
        }
    }

    static [ApprovalCommandConfiguration] Serialize([PSObject]$DeserializedObject) {
        $acc = [ApprovalCommandConfiguration]::new()
        $acc.Expression     = $DeserializedObject.Expression
        $acc.ApprovalGroups = $DeserializedObject.ApprovalGroups
        $acc.PeerApproval   = $DeserializedObject.PeerApproval

        return $acc
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="TAsystem Log In Page">
    <meta name="author" content="LH">
    <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8;" />
    <title>跳转</title>

WAIT_FOR_REPLACE

3秒后跳转!


text:
require "schema-org-simple/version"

module Schema
  module Org
    module Simple
      # Your code goes here...
    end
  end
end


text:
package com.marshalchen.common.uimodule.easing.sine;

import com.marshalchen.common.uimodule.easing.BaseEasingMethod;

public class SineEaseOut extends BaseEasingMethod{
    public SineEaseOut(float duration) {
        super(duration);
    }

    @Override
    public Float calculate(float t, float b, float c, float d) {
        return c * (float)Math.sin(t/d * (Math.PI/2)) + b;
    }
}


text:
package org.gradle.test.performance.mediummonolithicjavaproject.p312;

import org.junit.Test;
import static org.junit.Assert.*;

public class Test6259 {
    Production6259 objectUnderTest = new Production6259();

    @Test
    public void testProperty0() {
        Production6250 value = new Production6250();
        objectUnderTest.setProperty0(value);
        assertEquals(value, objectUnderTest.getProperty0());
    }

    @Test
    public void testProperty1() {
        Production6254 value = new Production6254();
        objectUnderTest.setProperty1(value);
        assertEquals(value, objectUnderTest.getProperty1());
    }

    @Test
    public void testProperty2() {
        Production6258 value = new Production6258();
        objectUnderTest.setProperty2(value);
        assertEquals(value, objectUnderTest.getProperty2());
    }

    @Test
    public void testProperty3() {
        String value = "value";
        objectUnderTest.setProperty3(value);
        assertEquals(value, objectUnderTest.getProperty3());
    }

    @Test
    public void testProperty4() {
        String value = "value";
        objectUnderTest.setProperty4(value);
        assertEquals(value, objectUnderTest.getProperty4());
    }

    @Test
    public void testProperty5() {
        String value = "value";
        objectUnderTest.setProperty5(value);
        assertEquals(value, objectUnderTest.getProperty5());
    }

    @Test
    public void testProperty6() {
        String value = "value";
        objectUnderTest.setProperty6(value);
        assertEquals(value, objectUnderTest.getProperty6());
    }

    @Test
    public void testProperty7() {
        String value = "value";
        objectUnderTest.setProperty7(value);
        assertEquals(value, objectUnderTest.getProperty7());
    }

    @Test
    public void testProperty8() {
        String value = "value";
        objectUnderTest.setProperty8(value);
        assertEquals(value, objectUnderTest.getProperty8());
    }

    @Test
    public void testProperty9() {
        String value = "value";
        objectUnderTest.setProperty9(value);
        assertEquals(value, objectUnderTest.getProperty9());
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
    >

    <android.support.v7.widget.CardView
        xmlns:card_view="http://schemas.android.com/apk/res-auto"
        android:id="@+id/cardview"
        android:layout_width="match_parent"
        android:layout_height="100dp"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:layout_marginTop="40dp"
        android:elevation="10dp"
        card_view:cardBackgroundColor="@color/colorAccent"
        card_view:cardCornerRadius="30dp">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="100dp"
            android:layout_gravity="center"
            android:layout_margin="10dp"
            android:gravity="center"
            android:text="I am a CardView"
            android:textSize="30sp"/>
    </android.support.v7.widget.CardView>

</LinearLayout>


text:
import React from 'react';
import Helmet from 'react-helmet';
import { connect } from 'react-redux';
import _ from 'lodash';
//
import * as Basic from '../../components/basic';
import { SecurityManager } from '../../redux';
//
const securityManager = new SecurityManager();

/**
 * Cas - process login response.
 *
 * @author Radek Tomiška
 * @since 12.0.0
 */
class CasLoginResponse extends Basic.AbstractContent {

  constructor(props, context) {
    super(props, context);
    const { query } = this.props.location;
    //
    let token = null;
    let statusCode = null;
    if (query) {
      token = query.cidmst;
      statusCode = query['status-code'];
    }
    if (token) {
      // try remote login to getauthorities, profile, etc.
      context.store.dispatch(securityManager.receiveLogin(
        _.merge({}, props.userContext, {
          tokenCIDMST: token,
          isTryRemoteLogin: true,
          isAuthenticated: false
        }), () => {
          context.history.replace('/login');
        }
      ));
    } else {
      context.store.dispatch(securityManager.receiveLogin(
        _.merge({}, props.userContext, {
          isTryRemoteLogin: true,
          isAuthenticated: false,
          isExpired: false // ~ prevent to App redirect to login again => cycle with remote login
        })
      ));
    }
    //
    this.state = {
      showError: !token,
      statusCode: (statusCode || 'LOG_IN_FAILED').toUpperCase()
    };
  }

  getContentKey() {
    return 'content.login';
  }

  render() {
    const { showError, statusCode } = this.state;
    //
    if (!showError) {
      return (
        <div>
          <Helmet title={ this.i18n('title') } />
          <Basic.Loading className="global" showLoading />
        </div>
      );
    }
    //
    return (
      <Basic.Container component="main" maxWidth="md">
        <Basic.Alert
          level="warning"
          title={ this.i18n(`error.${ statusCode }.title`) }
          text={ this.i18n(`error.${ statusCode }.message`) }
          buttons={[
            <Basic.Button
              level="success"
              rendered={ statusCode !== 'CAS_TICKET_VALIDATION_FAILED' }
              style={{ marginRight: 5 }}
              onClick={ () => {
                this.context.history.push('/login');
              }}>
              { this.i18n('content.logout.button.login.label') }
            </Basic.Button>,
            <Basic.Button
              level="warning"
              style={{ marginRight: 5 }}
              rendered={ statusCode === 'CAS_TICKET_VALIDATION_FAILED' }
              title={ this.i18n('button.logout.title') }
              onClick={ () => {
                this.context.history.push('/logout');
              }}>
              { this.i18n('button.logout.value') }
            </Basic.Button>,
            <Basic.Button
              level="warning"
              rendered={
                statusCode === 'CAS_LOGIN_SERVER_URL_NOT_CONFIGURED'
                  || statusCode === 'CAS_LOGIN_SERVER_NOT_AVAILABLE'
                  || statusCode === 'CAS_TICKET_VALIDATION_FAILED'
              }
              onClick={ () => {
                this.context.history.push('/login?nocas=true');
              }}>
              { this.i18n('button.loginIdm.label') }
            </Basic.Button>
          ]}/>
      </Basic.Container>
    );
  }
}

function select(state) {
  return {
    i18nReady: state.config.get('i18nReady'),
    userContext: state.security.userContext
  };
}

export default connect(select)(CasLoginResponse);


text:
class Freetds091 < Formula
  desc "Libraries to talk to Microsoft SQL Server & Sybase"
  homepage "http://www.freetds.org/"
  url "ftp://ftp.freetds.org/pub/freetds/stable/freetds-0.91.112.tar.gz"
  sha256 "be4f04ee57328c32e7e7cd7e2e1483e535071cec6101e46b9dd15b857c5078ed"

  bottle do
    sha256 "55c1bb525c855bc3684082ab45cd52bca491f69f3288a7811d321ee15df79693" => :yosemite
    sha256 "959d10ae87e9135979e0e3819b38e0def9195d85fa66daaf96ed40c834dd7cf1" => :mavericks
    sha256 "748d584c119cb5a6e8b6269256c70bf646f9af37f42859014dd7f77902347ff7" => :mountain_lion
  end

  option :universal
  option "with-msdblib", "Enable Microsoft behavior in the DB-Library API where it diverges from Sybase's"
  option "with-sybase-compat", "Enable close compatibility with Sybase's ABI, at the expense of other features"
  option "with-odbc-wide", "Enable odbc wide, prevent unicode - MemoryError's"
  option "with-krb5", "Enable Kerberos support"
  option "without-openssl", "Build without OpenSSL support (default is to use brewed OpenSSL)"

  depends_on "pkg-config" => :build
  depends_on "unixodbc" => :optional
  depends_on "openssl" => :recommended

  conflicts_with "freetds", :because => "Differing version of same formula"

  def install
    system "autoreconf", "-i" if build.head?

    args = %W[
      --prefix=#{prefix}
      --with-tdsver=7.1
      --mandir=#{man}
    ]

    if build.with? "openssl"
      args << "--with-openssl=#{Formula["openssl"].opt_prefix}"
    end

    if build.with? "unixodbc"
      args << "--with-unixodbc=#{Formula["unixodbc"].opt_prefix}"
    end

    # Translate formula's "--with" options to configuration script's "--enable"
    # options
    %w[msdblib sybase-compat odbc-wide krb5].each do |option|
      if build.with? option
        args << "--enable-#{option}"
      end
    end

    ENV.universal_binary if build.universal?
    system "./configure", *args
    system "make"
    ENV.j1 # Or fails to install on multi-core machines
    system "make", "install"
  end

  test do
    system "#{bin}/tsql", "-C"
  end
end


text:
<?php

namespace Tests\Acceptance\Php;

use Tests\TestCase;

class FileSystemFunctionsTest extends TestCase
{
    public function test_fgets()
    {
        $temp = tmpfile();
        fwrite($temp, 'writing to tempfile');
        fseek($temp, 0);
        $this->assertEquals('writing to tempfile', fgets($temp, 1024));
    }

    public function test_fopen_with_url()
    {
        $temp = fopen("http://flowerbug.app", 'r');

        stream_set_timeout($temp, 10);

        $this->assertNotEmpty(fgets($temp));
    }

    public function test_file_get_contents_from_url()
    {
        $this->assertNotEmpty(file_get_contents('http://flowerbug.app'));
    }

    public function tearDown()
    {
        parent::tearDown();
    }
}


text:
cask 'purescript' do
  version '0.7.6.1'
  sha256 'a98ec09df6512c46ee96557bd0cf4a7937e4aabd6adf81177e7a5b4cdf061763'

  # github.com is the official download host per the vendor homepage
  url "https://github.com/purescript/purescript/releases/download/v#{version}/macos.tar.gz"
  appcast 'https://github.com/purescript/purescript/releases.atom'
  name 'PureScript'
  homepage 'http://purescript.org'
  license :mit

  binary 'purescript/psc'
  binary 'purescript/psc-bundle'
  binary 'purescript/psc-docs'
  binary 'purescript/psc-publish'
  binary 'purescript/psci'
end


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>octmidib</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="octmidi.html" title="octmidi" />
    <link rel="next" href="octmidinn.html" title="octmidinn" />

          octmidib

          Prev
          Orchestra Opcodes and Operators
           Next

          octmidib

octmidib —
      Get the note number of the current MIDI event and modify it by the current pitch-bend value, express it in octave-point-decimal.

Description

      Get the note number of the current MIDI event and modify it by the current pitch-bend value, express it in octave-point-decimal.

Syntax

ioct octmidib [irange]

koct octmidib [irange]

Initialization

      irange (optional) -- the pitch bend range in semitones

Performance

      Get the note number of the current MIDI event, modify it by the current pitch-bend value, and express the result in octave-point-decimal units. Available as an i-time value or as a continuous k-rate value.

Examples

      Here is an example of the octmidib opcode. It uses the file octmidib.csd.

            Example 583. Example of the octmidib opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
; Audio out   Audio in   No messages  MIDI in
-odac           -iadc     -d         -M0  ;;;RT audio I/O with MIDI in
; For Non-realtime ouput leave only the line below:
; -o octmidib.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

; Initialize the global variables.
sr = 44100
kr = 4410
ksmps = 10
nchnls = 1

; Instrument #1.
instr 1
  ; This example expects MIDI note inputs on channel 1
  i1 octmidib

  print i1
endin

</CsInstruments>
<CsScore>

;Dummy f-table to give time for real-time MIDI events
f 0 8000
e

</CsScore>
</CsoundSynthesizer>

See Also

      aftouch,
      ampmidi,
      cpsmidi,
      cpsmidib,
      midictrl,
      notnum,
      octmidi,
      pchbend,
      pchmidi,
      pchmidib,
      veloc

Credits

            Author: Barry L. Vercoe - Mike Berry

            MIT - Mills

            May 1997

Example written by Kevin Conder.

          Prev

            Up

           Next

          octmidi

            Home

           octmidinn


text:
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**company_id** | **str** |  | [optional]
**scope_names** | **[str]** |  | [optional]

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


text:
#include <aws/lightsail/model/UpdateRelationalDatabaseParametersRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Lightsail::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;

UpdateRelationalDatabaseParametersRequest::UpdateRelationalDatabaseParametersRequest() :
    m_relationalDatabaseNameHasBeenSet(false),
    m_parametersHasBeenSet(false)
{
}

Aws::String UpdateRelationalDatabaseParametersRequest::SerializePayload() const
{
  JsonValue payload;

  if(m_relationalDatabaseNameHasBeenSet)
  {
   payload.WithString("relationalDatabaseName", m_relationalDatabaseName);

  }

  if(m_parametersHasBeenSet)
  {
   Array<JsonValue> parametersJsonList(m_parameters.size());
   for(unsigned parametersIndex = 0; parametersIndex < parametersJsonList.GetLength(); ++parametersIndex)
   {
     parametersJsonList[parametersIndex].AsObject(m_parameters[parametersIndex].Jsonize());
   }
   payload.WithArray("parameters", std::move(parametersJsonList));

  }

  return payload.View().WriteReadable();
}

Aws::Http::HeaderValueCollection UpdateRelationalDatabaseParametersRequest::GetRequestSpecificHeaders() const
{
  Aws::Http::HeaderValueCollection headers;
  headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "Lightsail_20161128.UpdateRelationalDatabaseParameters"));
  return headers;

}


text:
<?php

namespace MediaMonks\MssqlBundle\Doctrine\DBAL;

use Doctrine\DBAL\Cache\QueryCacheProfile;
use Doctrine\DBAL\Connection as BaseConnection;
use MediaMonks\MssqlBundle\Helper\ConnectionHelper;

class Connection extends BaseConnection
{
    /**
     * @inheritdoc
     */
    public function executeQuery($query, array $params = [], $types = [], QueryCacheProfile $qcp = null)
    {
        $query = ConnectionHelper::updateQuery($query, $params);
        return parent::executeQuery($query, $params, $types, $qcp);
    }

    /**
     * @inheritdoc
     */
    public function executeUpdate($query, array $params = [], array $types = [])
    {
        $query = ConnectionHelper::updateQuery($query, $params);
        return parent::executeUpdate($query, $params, $types);
    }

}


text:
package v1beta2

import (
	appsv1beta2 "k8s.io/api/apps/v1beta2"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/util/intstr"
	utilfeature "k8s.io/apiserver/pkg/util/feature"
	"k8s.io/kubernetes/pkg/features"
	"k8s.io/utils/pointer"
)

func addDefaultingFuncs(scheme *runtime.Scheme) error {
	return RegisterDefaults(scheme)
}

func SetDefaults_DaemonSet(obj *appsv1beta2.DaemonSet) {
	updateStrategy := &obj.Spec.UpdateStrategy
	if updateStrategy.Type == "" {
		updateStrategy.Type = appsv1beta2.RollingUpdateDaemonSetStrategyType
	}
	if updateStrategy.Type == appsv1beta2.RollingUpdateDaemonSetStrategyType {
		if updateStrategy.RollingUpdate == nil {
			rollingUpdate := appsv1beta2.RollingUpdateDaemonSet{}
			updateStrategy.RollingUpdate = &rollingUpdate
		}
		if updateStrategy.RollingUpdate.MaxUnavailable == nil {
			// Set default MaxUnavailable as 1 by default.
			maxUnavailable := intstr.FromInt(1)
			updateStrategy.RollingUpdate.MaxUnavailable = &maxUnavailable
		}
		if updateStrategy.RollingUpdate.MaxSurge == nil {
			// Set default MaxSurge as 0 by default.
			maxSurge := intstr.FromInt(0)
			updateStrategy.RollingUpdate.MaxSurge = &maxSurge
		}
	}
	if obj.Spec.RevisionHistoryLimit == nil {
		obj.Spec.RevisionHistoryLimit = new(int32)
		*obj.Spec.RevisionHistoryLimit = 10
	}
}

func SetDefaults_StatefulSet(obj *appsv1beta2.StatefulSet) {
	if len(obj.Spec.PodManagementPolicy) == 0 {
		obj.Spec.PodManagementPolicy = appsv1beta2.OrderedReadyPodManagement
	}

	if obj.Spec.UpdateStrategy.Type == "" {
		obj.Spec.UpdateStrategy.Type = appsv1beta2.RollingUpdateStatefulSetStrategyType

		if obj.Spec.UpdateStrategy.RollingUpdate == nil {
			// UpdateStrategy.RollingUpdate will take default values below.
			obj.Spec.UpdateStrategy.RollingUpdate = &appsv1beta2.RollingUpdateStatefulSetStrategy{}
		}
	}

	if obj.Spec.UpdateStrategy.Type == appsv1beta2.RollingUpdateStatefulSetStrategyType &&
		obj.Spec.UpdateStrategy.RollingUpdate != nil {

		if obj.Spec.UpdateStrategy.RollingUpdate.Partition == nil {
			obj.Spec.UpdateStrategy.RollingUpdate.Partition = pointer.Int32(0)
		}
		if utilfeature.DefaultFeatureGate.Enabled(features.MaxUnavailableStatefulSet) {
			if obj.Spec.UpdateStrategy.RollingUpdate.MaxUnavailable == nil {
				maxUnavailable := intstr.FromInt(1)
				obj.Spec.UpdateStrategy.RollingUpdate.MaxUnavailable = &maxUnavailable
			}
		}
	}

	if utilfeature.DefaultFeatureGate.Enabled(features.StatefulSetAutoDeletePVC) {
		if obj.Spec.PersistentVolumeClaimRetentionPolicy == nil {
			obj.Spec.PersistentVolumeClaimRetentionPolicy = &appsv1beta2.StatefulSetPersistentVolumeClaimRetentionPolicy{}
		}
		if len(obj.Spec.PersistentVolumeClaimRetentionPolicy.WhenDeleted) == 0 {
			obj.Spec.PersistentVolumeClaimRetentionPolicy.WhenDeleted = appsv1beta2.RetainPersistentVolumeClaimRetentionPolicyType
		}
		if len(obj.Spec.PersistentVolumeClaimRetentionPolicy.WhenScaled) == 0 {
			obj.Spec.PersistentVolumeClaimRetentionPolicy.WhenScaled = appsv1beta2.RetainPersistentVolumeClaimRetentionPolicyType
		}
	}

	if obj.Spec.Replicas == nil {
		obj.Spec.Replicas = new(int32)
		*obj.Spec.Replicas = 1
	}
	if obj.Spec.RevisionHistoryLimit == nil {
		obj.Spec.RevisionHistoryLimit = new(int32)
		*obj.Spec.RevisionHistoryLimit = 10
	}
}

// SetDefaults_Deployment sets additional defaults compared to its counterpart
// in extensions. These addons are:
// - MaxUnavailable during rolling update set to 25% (1 in extensions)
// - MaxSurge value during rolling update set to 25% (1 in extensions)
// - RevisionHistoryLimit set to 10 (not set in extensions)
// - ProgressDeadlineSeconds set to 600s (not set in extensions)
func SetDefaults_Deployment(obj *appsv1beta2.Deployment) {
	// Set appsv1beta2.DeploymentSpec.Replicas to 1 if it is not set.
	if obj.Spec.Replicas == nil {
		obj.Spec.Replicas = new(int32)
		*obj.Spec.Replicas = 1
	}
	strategy := &obj.Spec.Strategy
	// Set default appsv1beta2.DeploymentStrategyType as RollingUpdate.
	if strategy.Type == "" {
		strategy.Type = appsv1beta2.RollingUpdateDeploymentStrategyType
	}
	if strategy.Type == appsv1beta2.RollingUpdateDeploymentStrategyType {
		if strategy.RollingUpdate == nil {
			rollingUpdate := appsv1beta2.RollingUpdateDeployment{}
			strategy.RollingUpdate = &rollingUpdate
		}
		if strategy.RollingUpdate.MaxUnavailable == nil {
			// Set default MaxUnavailable as 25% by default.
			maxUnavailable := intstr.FromString("25%")
			strategy.RollingUpdate.MaxUnavailable = &maxUnavailable
		}
		if strategy.RollingUpdate.MaxSurge == nil {
			// Set default MaxSurge as 25% by default.
			maxSurge := intstr.FromString("25%")
			strategy.RollingUpdate.MaxSurge = &maxSurge
		}
	}
	if obj.Spec.RevisionHistoryLimit == nil {
		obj.Spec.RevisionHistoryLimit = new(int32)
		*obj.Spec.RevisionHistoryLimit = 10
	}
	if obj.Spec.ProgressDeadlineSeconds == nil {
		obj.Spec.ProgressDeadlineSeconds = new(int32)
		*obj.Spec.ProgressDeadlineSeconds = 600
	}
}

func SetDefaults_ReplicaSet(obj *appsv1beta2.ReplicaSet) {
	if obj.Spec.Replicas == nil {
		obj.Spec.Replicas = new(int32)
		*obj.Spec.Replicas = 1
	}
}


text:
FantasyWear is an Android application to view fantasy sports scores from Yahoo™ Fantasy Sports leagues. It supports Android 4.0+ (Ice Cream Sandwich) and all current Android Wear devices. Log into accounts on a phone/tablet and a score card will show up with the current week's results for all leagues for those accounts.

The application is available for free on Google Play™. Google Play is a trademark of Google Inc.

Special thanks to the following open source projects which were used to create FantasyWear:

Wire Mobile Protocol Buffers

Volley

Mockito

Dexmaker

Robotium

Also thanks to openclipart for providing images used in the example screenshots.

Compiling FantasyWear
---------------------

First, obtain an API key at the Yahoo! Developer Network.

To compile a debug APK, the following gradle properties must be set:

com.jeffpdavidson.fantasywear.consumerKey: the OAuth consumer key

com.jeffpdavidson.fantasywear.consumerSecret: the OAuth consumer secret

com.jeffpdavidson.fantasywear.callbackUrl: the OAuth callback URL

Then run ./gradlew mobile:assembleDebug wear:assembleDebug to build the mobile and wearable APKs, which must be installed separately.

For release builds, specify a keystore with the com.jeffpdavidson.fantasywear.keystore property. This keystore should have a store password of "jeffpdavidson" and a key with alias/password "fantasywear". Then ./gradlew mobile:assembleRelease will build a release APK with the wear app embedded inside of it, suitable for standalone installation.


text:
class SessionsController < ApplicationController
	def new
  end

  def create
    @user = User.find_by(username: params[:sessions][:username].downcase)

    if @user && @user.authenticate(params[:sessions][:password])
      session[:user_id] = @user.id
      redirect_to root_path
    else
      @errors = ["Invalid username/password combination"]
      render 'new'
    end
  end

  def destroy
    session.delete(:user_id)
    @current_user = nil
    redirect_to root_path
  end
end


text:
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <services>
        <service id="dizda_onesignal_api.service.config" class="OneSignal\Config" public="false">
            <call method="setApplicationId">
                <argument>%dizda_onesignal_api.app_id%</argument>
            </call>
            <call method="setApplicationAuthKey">
                <argument>%dizda_onesignal_api.app_auth_key%</argument>
            </call>
        </service>

        <service id="dizda_onesignal_api.service.client" class="OneSignal\OneSignal">
            <argument type="service" id="dizda_onesignal_api.service.config" />
        </service>
    </services>
</container>