text:
"""add_committee_meeting_attendance_table

Revision ID: 3daa1030c816
Revises: 5647a4255cdc
Create Date: 2015-07-20 13:41:37.293770

"""

# revision identifiers, used by Alembic.
revision = '3daa1030c816'
down_revision = '5647a4255cdc'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('committee_meeting_attendance',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('alternate_member', sa.Boolean(), nullable=True),
    sa.Column('chairperson', sa.Boolean(), nullable=False),
    sa.Column('meeting_id', sa.Integer(), nullable=False),
    sa.Column('member_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['meeting_id'], ['event.id'], ondelete='CASCADE'),
    sa.ForeignKeyConstraint(['member_id'], ['member.id'], ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id')
    )
    op.add_column('event', sa.Column('actual_end_time', sa.Time(timezone=True), nullable=True))
    op.add_column('event', sa.Column('actual_start_time', sa.Time(timezone=True), nullable=True))
    op.add_column('event', sa.Column('pmg_monitor', sa.String(length=255), nullable=True))
    ### end Alembic commands ###

def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('event', 'pmg_monitor')
    op.drop_column('event', 'actual_start_time')
    op.drop_column('event', 'actual_end_time')

    op.drop_table('committee_meeting_attendance')
    ### end Alembic commands ###


text:
if (typeof window !== 'undefined') {
  window.completedTests = 0;
  window.sawFail = false;
  window.onload = function () {
    window.testsPassed = null;
    var handleResults = function (runner) {
      var failedTests = [];
      if (runner.stats.end) {
        window.testsPassed = runner.stats.failures === 0;
      }
      runner.on('pass', function () {
        window.completedTests += 1;
      });
      runner.on('fail', function (test, err) {
        window.sawFail = true;
        var flattenTitles = function (testToFlatten) {
          var titles = [];
          var currentTest = testToFlatten;
          while (currentTest.parent.title) {
            titles.push(currentTest.parent.title);
            currentTest = currentTest.parent;
          }
          return titles.reverse();
        };
        failedTests.push({
          name: test.title,
          result: false,
          message: err.message,
          stack: err.stack,
          titles: flattenTitles(test)
        });
      });
      runner.on('end', function () {
        window.testsPassed = !window.sawFail;
        // for sauce
        window.mochaResults = runner.stats;
        window.mochaResults.reports = failedTests;
      });
      return runner;
    };
    handleResults(mocha.run());
  };
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<bookmap class="- map/map bookmap/bookmap " collection-type="sequence" xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" xmlns:opentopic-index="http://www.idiominc.com/opentopic/index">
  <oxy:front-page xmlns:oxy="http://www.oxygenxml.com/extensions/author">
    <oxy:front-page-title/>
  </oxy:front-page>
  <topic>
    <colspec class="- topic/colspec " colname="col1" colnum="1" colwidth="1*" rowheader="headers" style="width:20%;"/>
    <colspec class="- topic/colspec " colname="col2" colnum="3" colwidth="1*" rowheader="headers" style="width:20%;"/>
    <colspec class="- topic/colspec " colname="col3" colnum="2" colwidth="2*" rowheader="headers" style="width:40%;"/>
    <colspec class="- topic/colspec " colname="col4" colnum="4" colwidth=" *" rowheader="headers" style="width:20%;"/>
  </topic>
</bookmap>


text:
using System;
using System.Threading.Tasks;
using Azure.Core.TestFramework;
using Azure.ResourceManager.AppService;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.ServiceLinker.Models;
using Azure.ResourceManager.Sql;
using NUnit.Framework;

namespace Azure.ResourceManager.ServiceLinker.Tests.Tests
{
    [TestFixture]
    public class WebAppSqlConnectionTests : ServiceLinkerTestBase
    {
        public WebAppSqlConnectionTests() : base(true)
        {
        }

        [SetUp]
        public async Task Init()
        {
            await InitializeClients();
        }

        [TestCase]
        [Ignore("Sql Database Creation Failed")]
        public async Task WebAppSqlConnectionCRUD()
        {
            string resourceGroupName = Recording.GenerateAssetName("SdkRg");
            string webAppName = Recording.GenerateAssetName("SdkWeb");
            string sqlServerName = Recording.GenerateAssetName("SdkSql");
            string sqlDatabaseName = Recording.GenerateAssetName("SdkSql");
            string sqlUserName = Recording.GenerateAssetName("SdkSql");
            string sqlPassword = Recording.GenerateAssetName("SdkPa5$");
            string linkerName = Recording.GenerateAssetName("SdkLinker");

            // create resource group
            await ResourceGroups.CreateOrUpdateAsync(WaitUntil.Completed, resourceGroupName, new Resources.ResourceGroupData(DefaultLocation));
            ResourceGroupResource resourceGroup = await ResourceGroups.GetAsync(resourceGroupName);

            // // create web app
            WebSiteCollection webSites = resourceGroup.GetWebSites();
            await webSites.CreateOrUpdateAsync(WaitUntil.Completed, webAppName, new WebSiteData(DefaultLocation));
            WebSiteResource webapp = await webSites.GetAsync(webAppName);

            // create sql database
            SqlServerCollection sqlServers = resourceGroup.GetSqlServers();
            SqlServerData sqlServerData = new SqlServerData(DefaultLocation)
            {
                AdministratorLogin = sqlUserName,
                AdministratorLoginPassword = sqlPassword,
            };
            await sqlServers.CreateOrUpdateAsync(WaitUntil.Completed, sqlServerName, sqlServerData);
            SqlServerResource sqlServer = await sqlServers.GetAsync(sqlServerName);

            SqlDatabaseCollection sqlDatabases = sqlServer.GetSqlDatabases();
            await sqlDatabases.CreateOrUpdateAsync(WaitUntil.Completed, sqlDatabaseName, new SqlDatabaseData(DefaultLocation));
            SqlDatabaseResource sqlDatabase = await sqlDatabases.GetAsync(sqlDatabaseName);

            // create service linker
            LinkerResourceCollection linkers = webapp.GetLinkerResources();
            var linkerData = new LinkerResourceData
            {
                TargetService = new Models.AzureResourceInfo
                {
                    Id = sqlDatabase.Id,
                },
                AuthInfo = new SecretAuthInfo
                {
                    Name = sqlUserName,
                    SecretInfo = new RawValueSecretInfo
                    {
                        Value = sqlPassword,
                    },
                },
                ClientType = LinkerClientType.Dotnet,
            };
            await linkers.CreateOrUpdateAsync(WaitUntil.Completed, linkerName, linkerData);

            // list service linker
            var linkerResources = await linkers.GetAllAsync().ToEnumerableAsync();
            Assert.AreEqual(1, linkerResources.Count);
            Assert.AreEqual(linkerName, linkerResources[0].Data.Name);

            // get service linker
            LinkerResource linker = await linkers.GetAsync(linkerName);
            Assert.IsTrue(linker.Id.ToString().StartsWith(webapp.Id.ToString(), StringComparison.InvariantCultureIgnoreCase));
            Assert.AreEqual(sqlDatabase.Id, (linker.Data.TargetService as AzureResourceInfo).Id);
            Assert.AreEqual(LinkerAuthType.Secret, linker.Data.AuthInfo.AuthType);

            // get service linker configurations
            SourceConfigurationResult configurations = await linker.GetConfigurationsAsync();
            foreach (var configuration in configurations.Configurations)
            {
                Assert.IsNotNull(configuration.Name);
                Assert.IsNotNull(configuration.Value);
            }

            // delete service linker
            var operation = await linker.DeleteAsync(WaitUntil.Completed);
            Assert.IsTrue(operation.HasCompleted);
        }
    }
}


text:
//
//  XYImagePreview.h
//  Pods
//
//  Created by xuyangjiang on 2017/9/22.
//

#ifndef XYImagePreview_h
#define XYImagePreview_h

#import "STImageVIew.h"
#import "XYImageModel.h"
#import "XYPhotoPreview.h"

#endif /* XYImagePreview_h */


text:
import React from "react";
import {
  ListGroup,
  ListGroupItem,
  Row,
  Col,
  Input,
  InputGroup,
  InputGroupAddon,
  Button,
  Badge
} from "reactstrap";

export default props => (

    <ListGroup>
      {props.checkpoints.map((item, i) => (
        <ListGroupItem className="justify-content-between" key={i}>

{item.title}

{item.code}

          <Badge pill>{item.score}</Badge>

 props.onDelete(item.id)}
          >
            delete

        </ListGroupItem>
      ))}
    </ListGroup>

    <Row>
      <Col md={{ size: 7, offset: 1 }} xs={{ size: 11, offset: 1 }}>
        <InputGroup>
          <InputGroupAddon>
            Title
          </InputGroupAddon>
          <Input
            type="text"
            name="checkpoint_title"
            value={props.checkpoint.title}
            onChange={props.onTitleChange}
          />
        </InputGroup>

        <InputGroup>
          <InputGroupAddon>
            Score
          </InputGroupAddon>
          <Input
            name="checkpoint_score"
            type="number"
            value={props.checkpoint.score}
            onChange={props.onScoreChange}
          />
        </InputGroup>
      </Col>
      <Col
        md={{ size: 4, pull: 1 }}
        xs={12}
        className="d-flex justify-content-end align-items-center"
      >
        <Button color="info" onClick={props.addCheckPoint}>
          Add
        </Button>
      </Col>
    </Row>

);


text:
package com.stulsoft.ysps.pimplicit

import com.stulsoft.ysps.pimplicit.StringUtils._
import com.typesafe.scalalogging.LazyLogging

/**
  * Created by Yuriy Stul on 11/8/2016.
  */
object ImplicitClassTest extends App with LazyLogging {
  logger.info("Start")
  logger.info(""""Hey".increment: {}""", "Hey".increment)
  logger.info(""""Hey".decrement: {}""", "Hey".decrement)
  logger.info(""""Hey".replacement: {}""", "Hey".replacement('X'))
  logger.info("End")
}


text:
<?php

/**
 * HTTP Connection Class - used in API calls (cURL library is required)
 */
class PagSeguroHttpConnection
{

    private $status;
    private $response;

    public function __construct()
    {
        if (!function_exists('curl_init')) {
            throw new Exception('PagSeguroLibrary: cURL library is required.');
        }
    }

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

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

    public function getResponse()
    {
        return $this->response;
    }

    public function setResponse($response)
    {
        $this->response = $response;
    }

    public function post($url, array $data, $timeout = 20, $charset = 'ISO-8859-1')
    {
        return $this->curlConnection('POST', $url, $timeout, $charset, $data);
    }

    public function get($url, $timeout = 20, $charset = 'ISO-8859-1')
    {
        return $this->curlConnection('GET', $url, $timeout, $charset, null);
    }

    private function curlConnection($method, $url, $timeout, $charset, array $data = null)
    {

        if (strtoupper($method) === 'POST') {
            $postFields = ($data ? http_build_query($data, '', '&') : "");
            $contentLength = "Content-length: " . strlen($postFields);
            $methodOptions = array(
                CURLOPT_POST => true,
                CURLOPT_POSTFIELDS => $postFields,
            );
        } else {
            $contentLength = null;
            $methodOptions = array(
                CURLOPT_HTTPGET => true
            );
        }

        $options = array(
            CURLOPT_HTTPHEADER => array(
                "Content-Type: application/x-www-form-urlencoded; charset=" . $charset,
                $contentLength,
                'lib-description: php:' . PagSeguroLibrary::getVersion(),
                'language-engine-description: php:' . PagSeguroLibrary::getPHPVersion()
            ),
            CURLOPT_URL => $url,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_HEADER => false,
            CURLOPT_SSL_VERIFYPEER => false,
		CURLOPT_FOLLOWLOCATION => true,         //ACRESCENTAR ESSA LINHA
		CURLOPT_SSL_VERIFYHOST => false,         //ACRESCENTAR ESSA LINHA
            CURLOPT_CONNECTTIMEOUT => $timeout,
            //CURLOPT_TIMEOUT => $timeout
            );

        if (!is_null(PagSeguroLibrary::getModuleVersion())) {
            array_push($options[CURLOPT_HTTPHEADER], 'module-description: ' . PagSeguroLibrary::getModuleVersion());
        }

        if (!is_null(PagSeguroLibrary::getCMSVersion())) {
            array_push($options[CURLOPT_HTTPHEADER], 'cms-description: ' . PagSeguroLibrary::getCMSVersion());
        }

        $options = ($options + $methodOptions);

        $curl = curl_init();
        curl_setopt_array($curl, $options);
        $resp = curl_exec($curl);
        $info = curl_getinfo($curl);
        $error = curl_errno($curl);
        $errorMessage = curl_error($curl);
        curl_close($curl);
        $this->setStatus((int) $info['http_code']);
        $this->setResponse((String) $resp);
        if ($error) {
            throw new Exception("CURL can't connect: $errorMessage");
        } else {
            return true;
        }
    }
}


text:
SYNONYM

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

#### Published in
Fruct. sem. pl. 2:379, t. 162, fig. 3. 1791

#### Original name
null

### Remarks
null


text:
package quad;
import java.util.*;
public class quadBasic {
	public static void main(String[] args) {

		Scanner input = new Scanner(System.in);
		System.out.println("(pressing enter after each varible)");
		System.out.println(("(Ax^2 + Bx + C = 0 form)")); System.out.println();
		System.out.println("Enter A, B, and C: ");

		double a = input.nextDouble(); //System.out.println(a + " " + b + " " + c);
		double b = input.nextDouble();
		double c = input.nextDouble();
		double discriminate = (b * b) - 4*(a)*(c); //System.out.println(discriminate);

		if(discriminate > 0){
			//two roots
			double positiveRoot = ((b * -1) + Math.sqrt(discriminate))/(2 * a);
			double negativeRoot = ((b * -1) - Math.sqrt(discriminate))/(2 * a);
			System.out.println("Roots: " + positiveRoot + " , " + negativeRoot);
		}
		else if(discriminate == 0){
			//one root
			double root = (Math.sqrt(c)) * -1;
			System.out.println(root + " (double root)");
		}
		else if(discriminate < 0){
			//imaginary roots
			System.out.println("Your roots are imaginary and are yet to be implemented");
		}
		else{
			System.out.println("Root: 23(infinite root)");
		}
	}
}


text:
require 'socket'
require 'timeout'

def port_open?(ip, port)
  begin
    Timeout::timeout(1) do
      begin
        s = TCPSocket.new(ip, port)
        s.close
        return true
      rescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH
        return false
      end
    end
  rescue Timeout::Error
  end

  return false
end

Puppet::Type.type(:xlrelease_check_connection).provide(:port_check) do

  def exists?
      start_time = Time.now
      timeout = resource[:timeout]

      success = port_open?(resource[:host], resource[:port])

      unless success
        while (Time.now - start_time) < timeout
          Puppet.notice("unable to reach #{resource[:host]}:#{resource[:port]} ")
          sleep 2
          success = port_open?(resource[:host], resource[:port])
          break if success
        end
      end

      unless success
        Puppet.notice("unable to reach #{resource[:host]}:#{resource[:port]} withing a timeout period of #{resource[:timeout]} ; giving up.")
      end

      success
    end

    def create
      # If `#create` is called, that means that `#exists?` returned false, which
      # means that the connection could not be established... so we need to
      # cause a failure here.
      raise Puppet::Error, "Unable to connect! (#{resource[:host]}:#{resource[:port]})"
    end

end


text:
export default normalizeTeam;

import fixturizeEntityId from "../fixturize-entity-id.js";
import fixturizePath from "../fixturize-path.js";
import setIfExists from "../set-if-exists.js";

function normalizeTeam(scenarioState, response) {
  // set all IDs to 1
  setIfExists(
    response,
    "id",
    fixturizeEntityId.bind(null, scenarioState.ids, "team")
  );

  // normalize URLs
  setIfExists(response, "url", fixturizePath.bind(null, scenarioState));
  setIfExists(response, "members_url", fixturizePath.bind(null, scenarioState));
  setIfExists(
    response,
    "repositories_url",
    fixturizePath.bind(null, scenarioState)
  );
}


text:
package com.github.mikephil.charting.renderer;

import android.graphics.Canvas;
import android.graphics.Paint.Align;

import com.github.mikephil.charting.animation.ChartAnimator;
import com.github.mikephil.charting.buffer.BarBuffer;
import com.github.mikephil.charting.buffer.HorizontalBarBuffer;
import com.github.mikephil.charting.data.BarData;
import com.github.mikephil.charting.data.BarDataSet;
import com.github.mikephil.charting.data.BarEntry;
import com.github.mikephil.charting.interfaces.BarDataProvider;
import com.github.mikephil.charting.utils.Transformer;
import com.github.mikephil.charting.utils.Utils;
import com.github.mikephil.charting.utils.ValueFormatter;
import com.github.mikephil.charting.utils.ViewPortHandler;

import java.util.List;

/**
 * Renderer for the HorizontalBarChart.
 *
 * @author Philipp Jahoda
 */
public class HorizontalBarChartRenderer extends BarChartRenderer {

    private float mYOffset = 0f;

    public HorizontalBarChartRenderer(BarDataProvider chart, ChartAnimator animator,
            ViewPortHandler viewPortHandler) {
        super(chart, animator, viewPortHandler);

        mValuePaint.setTextAlign(Align.LEFT);
    }

    @Override
    public void initBuffers() {

        BarData barData = mChart.getBarData();
        mBarBuffers = new HorizontalBarBuffer[barData.getDataSetCount()];

        for (int i = 0; i < mBarBuffers.length; i++) {
            BarDataSet set = barData.getDataSetByIndex(i);
            mBarBuffers[i] = new HorizontalBarBuffer(set.getValueCount() * 4 * set.getStackSize(),
                    barData.getGroupSpace(),
                    barData.getDataSetCount(), set.isStacked());
        }
    }

    protected void drawDataSet(Canvas c, BarDataSet dataSet, int index) {

        Transformer trans = mChart.getTransformer(dataSet.getAxisDependency());
        calcXBounds(trans);

        mShadowPaint.setColor(dataSet.getBarShadowColor());

        float phaseX = mAnimator.getPhaseX();
        float phaseY = mAnimator.getPhaseY();

        List<BarEntry> entries = dataSet.getYVals();

        // initialize the buffer
        BarBuffer buffer = mBarBuffers[index];
        buffer.setPhases(phaseX, phaseY);
        buffer.setBarSpace(dataSet.getBarSpace());
        buffer.setDataSet(index);
        buffer.setInverted(mChart.isInverted(dataSet.getAxisDependency()));

        buffer.feed(entries);

        trans.pointValuesToPixel(buffer.buffer);

        for (int j = 0; j < buffer.size(); j += 4) {

            if (!mViewPortHandler.isInBoundsTop(buffer.buffer[j + 3]))
                break;

            if (!mViewPortHandler.isInBoundsBottom(buffer.buffer[j + 1]))
                continue;

            if (mChart.isDrawBarShadowEnabled()) {
                c.drawRect(mViewPortHandler.contentLeft(), buffer.buffer[j + 1],
                        mViewPortHandler.contentRight(),
                        buffer.buffer[j + 3], mShadowPaint);
            }

            // Set the color for the currently drawn value. If the index
            // is
            // out of bounds, reuse colors.
            mRenderPaint.setColor(dataSet.getColor(j / 4));
            c.drawRect(buffer.buffer[j], buffer.buffer[j + 1], buffer.buffer[j + 2],
                    buffer.buffer[j + 3], mRenderPaint);
        }
    }

    @Override
    public void drawValues(Canvas c) {
        // if values are drawn
        if (passesCheck()) {

            List<BarDataSet> dataSets = mChart.getBarData().getDataSets();

            final float valueOffsetPlus = Utils.convertDpToPixel(5f);
            float posOffset = 0f;
            float negOffset = 0f;
            boolean drawValueAboveBar = mChart.isDrawValueAboveBarEnabled();

            if (drawValueAboveBar)
                mValuePaint.setTextAlign(Align.LEFT);
            else
                mValuePaint.setTextAlign(Align.RIGHT);

            for (int i = 0; i < mChart.getBarData().getDataSetCount(); i++) {

                BarDataSet dataSet = dataSets.get(i);

                if (!dataSet.isDrawValuesEnabled())
                    continue;

                boolean isInverted = mChart.isInverted(dataSet.getAxisDependency());

                // apply the text-styling defined by the DataSet
                applyValueTextStyle(dataSet);

                mYOffset = Utils.calcTextHeight(mValuePaint, "10") / 2f;

                ValueFormatter formatter = dataSet.getValueFormatter();

                Transformer trans = mChart.getTransformer(dataSet.getAxisDependency());

                List<BarEntry> entries = dataSet.getYVals();

                float[] valuePoints = getTransformedValues(trans, entries, i);

                // if only single values are drawn (sum)
                if (!mChart.isDrawValuesForWholeStackEnabled()) {

                    for (int j = 0; j < valuePoints.length * mAnimator.getPhaseX(); j += 2) {

                        if (!mViewPortHandler.isInBoundsX(valuePoints[j]))
                            continue;

                        if (!mViewPortHandler.isInBoundsTop(valuePoints[j + 1]))
                            break;

                        if (!mViewPortHandler.isInBoundsBottom(valuePoints[j + 1]))
                            continue;

                        float val = entries.get(j / 2).getVal();
                        String valueText = formatter.getFormattedValue(val);

                        // calculate the correct offset depending on the draw position of the value
                        float valueTextWidth = Utils.calcTextWidth(mValuePaint, valueText);
                        posOffset = (drawValueAboveBar ? valueOffsetPlus : -(valueTextWidth + valueOffsetPlus));
                        negOffset = (drawValueAboveBar ? -(valueTextWidth + valueOffsetPlus) : valueOffsetPlus);

                        if (isInverted)
                        {
                            posOffset = -posOffset - valueTextWidth;
                            negOffset = -negOffset - valueTextWidth;
                        }

                        drawValue(c, valueText, valuePoints[j] + (val >= 0 ? posOffset : negOffset),
                                valuePoints[j + 1]);
                    }

                    // if each value of a potential stack should be drawn
                } else {

                    for (int j = 0; j < (valuePoints.length - 1) * mAnimator.getPhaseX(); j += 2) {

                        BarEntry e = entries.get(j / 2);

                        float[] vals = e.getVals();

                        // we still draw stacked bars, but there is one
                        // non-stacked
                        // in between
                        if (vals == null) {

                            if (!mViewPortHandler.isInBoundsX(valuePoints[j]))
                                continue;

                            if (!mViewPortHandler.isInBoundsTop(valuePoints[j + 1]))
                                break;

                            if (!mViewPortHandler.isInBoundsBottom(valuePoints[j + 1]))
                                continue;

                            float val = e.getVal();
                            String valueText = formatter.getFormattedValue(val);

                            // calculate the correct offset depending on the draw position of the value
                            float valueTextWidth = Utils.calcTextWidth(mValuePaint, valueText);
                            posOffset = (drawValueAboveBar ? valueOffsetPlus : -(valueTextWidth + valueOffsetPlus));
                            negOffset = (drawValueAboveBar ? -(valueTextWidth + valueOffsetPlus) : valueOffsetPlus);

                            if (isInverted)
                            {
                                posOffset = -posOffset - valueTextWidth;
                                negOffset = -negOffset - valueTextWidth;
                            }

                            drawValue(c, valueText, valuePoints[j]
                                    + (e.getVal() >= 0 ? posOffset : negOffset),
                                    valuePoints[j + 1]);

                        } else {

                            float[] transformed = new float[vals.length * 2];
                            int cnt = 0;
                            float add = e.getVal();

                            for (int k = 0; k < transformed.length; k += 2) {

                                add -= vals[cnt];
                                transformed[k] = (vals[cnt] + add) * mAnimator.getPhaseY();
                                cnt++;
                            }

                            trans.pointValuesToPixel(transformed);

                            for (int k = 0; k < transformed.length; k += 2) {

                                float val = vals[k / 2];
                                String valueText = formatter.getFormattedValue(val);

                                // calculate the correct offset depending on the draw position of the value
                                float valueTextWidth = Utils.calcTextWidth(mValuePaint, valueText);
                                posOffset = (drawValueAboveBar ? valueOffsetPlus : -(valueTextWidth + valueOffsetPlus));
                                negOffset = (drawValueAboveBar ? -(valueTextWidth + valueOffsetPlus) : valueOffsetPlus);

                                if (isInverted)
                                {
                                    posOffset = -posOffset - valueTextWidth;
                                    negOffset = -negOffset - valueTextWidth;
                                }

                                float x = transformed[k]
                                        + (val >= 0 ? posOffset : negOffset);
                                float y = valuePoints[j + 1];

                                if (!mViewPortHandler.isInBoundsX(x))
                                    continue;

                                if (!mViewPortHandler.isInBoundsTop(y))
                                    break;

                                if (!mViewPortHandler.isInBoundsBottom(y))
                                    continue;

                                drawValue(c, valueText, x, y);
                            }
                        }
                    }
                }
            }
        }
    }

    @Override
    protected void prepareBarHighlight(float x, float y, float barspaceHalf, float from,
            Transformer trans) {

        float top = x - 0.5f + barspaceHalf;
        float bottom = x + 0.5f - barspaceHalf;
        float left = y >= from ? y : from;
        float right = y <= from ? y : from;

        mBarRect.set(left, top, right, bottom);

        trans.rectValueToPixelHorizontal(mBarRect, mAnimator.getPhaseY());
    }

    @Override
    public float[] getTransformedValues(Transformer trans, List<BarEntry> entries,
            int dataSetIndex) {
        return trans.generateTransformedValuesHorizontalBarChart(entries, dataSetIndex,
                mChart.getBarData(), mAnimator.getPhaseY());
    }

    @Override
    protected void drawValue(Canvas c, String value, float xPos, float yPos) {
        super.drawValue(c, value, xPos, yPos + mYOffset);
    }

    @Override
    protected boolean passesCheck() {
        return mChart.getBarData().getYValCount() < mChart.getMaxVisibleCount()
                * mViewPortHandler.getScaleY();
    }
}


text:
import argparse
import sys
import os
import re
import itertools
import numpy as np

# argparse for information
parser = argparse.ArgumentParser()
parser.add_argument("-pf", "--pdb_file", help="pdb file for a single energy file "
                                              "if you dont use -p or -pf the default path will be searched")
parser.add_argument("-f", "--energy_file", help="input energy profile file (run just for this file)")
args = parser.parse_args()

# sanity check
if not len(sys.argv) > 1:
    print "this script takes a folder of energy files and adds aa contact profiles to them"
    parser.print_help()
    sys.exit(0)

# inserts a key value pair into the dict, or adds the value if the key exists
def insert_into_data_structure(key, value, dictionary):
    if not value == 0:
        if not key in dictionary:
            dictionary[key] = value
        else:
            # there should never be the else case
            # dictionary[key].append((value))
            print "ERROR!!!! else: ", key

def check_if_pdb_file_exists(pdb_file):
    if not (os.path.isfile(pdb_file)):
        print "there is no file: ", pdb_file
        missing_list.append(pdb_file)
        return False
    else:
        return True

def get_pdb_file(energy_file):
    pdb = energy_file.split(".ep2")[0] + ".pdb"
    return pdb

def calc_energy_file(pdb_file, energy_file):
    line_count = 0
    xlist = []
    ylist = []
    zlist = []
    poslist = []
    pre_aa_count = ""
    pre_pdb_id = "pdb" + energy_file.split(".")[0]
    if len(pre_pdb_id.split("-")) == 2:
        specific_chain = pre_pdb_id.split("-")[1]
    else:
        specific_chain = "all"
    if specific_chain != "all":
        # just the specific Chain
        with open(pdb_file, 'r') as pdb_file_handle:
            for line in pdb_file_handle:
                if line.startswith('ATOM'):
                    # see for more info: http://deposit.rcsb.org/adit/docs/pdb_atom_format.html
                    chain = line[21].replace(" ", "")
                    if chain != specific_chain:
                        # skip this chain
                        continue
                    atom = line[0:5]
                    pos = line[6:10].replace(" ", "")
                    a_type = line[12:15].replace(" ", "")
                    aa = line[17:20].replace(" ", "")
                    aa_count = line[22:26].replace(" ", "")
                    alternate_ca = line[26:27].replace(" ", "")
                    oc_x = line[30:37].replace(" ", "")
                    oc_y = line[38:45].replace(" ", "")
                    oc_z = line[46:53].replace(" ", "")
                    if a_type == "CA" and pre_aa_count != aa_count:
                        # print pre_aa_count, aa_count
                        if pre_aa_count != aa_count:
                            xlist.append(float(oc_x))
                            ylist.append(float(oc_y))
                            zlist.append(float(oc_z))
                            poslist.append(aa_count + chain)
                        pre_aa_count = aa_count
                elif line.startswith('ENDMDL'):
                    break
    else:
        # all chains
        with open(pdb_file, 'r') as pdb_file_handle:
            for line in pdb_file_handle:
                if line.startswith('ATOM'):
                    chain = line[21].replace(" ", "")
                    # atom = line[0:5]
                    # absolut_pos = line[6:10].replace(" ", "")
                    a_type = line[12:15].replace(" ", "")
                    # aa = line[17:20].replace(" ", "")
                    aa_count = line[22:26].replace(" ", "")
                    # alternate_ca = line[26:27].replace(" ", "")
                    oc_x = line[30:37].replace(" ", "")
                    oc_y = line[38:45].replace(" ", "")
                    oc_z = line[46:53].replace(" ", "")

                    if a_type == "CA" and pre_aa_count != aa_count:
                        if pre_aa_count != aa_count:
                            xlist.append(float(oc_x))
                            ylist.append(float(oc_y))
                            zlist.append(float(oc_z))
                            poslist.append(aa_count + chain)
                        pre_aa_count = aa_count
                elif line.startswith('ENDMDL'):
                    break

    contact_dict = {}
    # check distances to other atoms in the specific chain
    for x1, y1, z1, pos1 in itertools.izip(xlist, ylist, zlist, poslist):
        contact_list = []
        chain1 = re.split(r'(\d+)', pos1)[2]
        # print pos1
        for x2, y2, z2, pos2 in itertools.izip(xlist, ylist, zlist, poslist):
            chain2 = re.split(r'(\d+)', pos2)[2]
            if chain1 != chain2:
                continue
            dist = np.sqrt(np.square(x1 - x2) + np.square(y1 - y2) + np.square(y1 - y2))
            if dist < 8:
                # if x1-4 < x2 < x1+4 and y1-4 < y2 < y1+4 and z1-4 < z2 < z1+4:
                # print x1, x2, y1, y2, z1, z2, dist
                contact_list.append("1")
            else:
                contact_list.append("0")
        insert_into_data_structure(pos1, contact_list, contact_dict)

    file_name = energy_file.split("/")[-1]
    if energy_file.endswith(".ep2"):
        target = open(file_name + ".cnn", 'w')
        print "writing to: " + file_name

        with open(energy_file, 'r') as energy_file_handle:
            for line in energy_file_handle:
                # print line
                line_array = line.split("\t")
                target.write(line.rstrip())
                if not "REMK" in line_array:
                    if line_count == 0:
                        name = line_array[1]
                        target.write("\n")
                    elif line_count == 1:
                        aa_type = line_array[1]
                        target.write("\n")
                    elif line_count == 2:
                        header = line_array
                        target.write("\n")
                    else:
                        aa_number = line_array[2]
                        energy_chain = line_array[1]
                        try:
                            export_string = " ".join(contact_dict[aa_number + energy_chain])
                        except (ValueError, IndexError, KeyError):
                            export_string = "-"
                        target.write("\t" + export_string + "\n")
                line_count += 1
        target.close()

# -------------------------------------------- main script ---------------------------------------------- #

counter = 0
missing_list = []
print "started!"

if args.energy_file:
    print "Adding contacts for just one file"
    energy_file = args.energy_file
    pdb_file = get_pdb_file(energy_file)
    print pdb_file
    if not check_if_pdb_file_exists(pdb_file):
        print "file not found: ", pdb_file
        file_name = energy_file.split("/")[-1]
        target = open(file_name + ".cnn", 'w')
        target.write("MISSING PDB FILE")
        target.close()
    else:
        calc_energy_file(pdb_file, args.energy_file)

else:
    print "Error, missing arguments"
    sys.exit(0)

print "FINISH!"
if len(missing_list) > 1:
    print "Found ", len(missing_list), " missing pdb files"
    print missing_list


text:
package example.response;

/**
 * Created by nitina on 2/19/17.
 */
public class Response {

    private String test;

    public String getTest() {
        return test;
    }

    public void setTest(String test) {
        this.test = test;
    }
}


text:
layout: page
title: Informativa estesa sui cookie
i18n:
  - lang: en
    url: /cookie-policy/
permalink: /it/cookie-policy/
---

**Informativa estesa ai sensi del provv. n.229/2014 Garante Privacy ei
ss. mm. ii, in G.U. 3 giugno 2014. ([provvedimento 229 dell'8 maggio 2014](http://www.garanteprivacy.it/web/guest/home/docweb/-/docweb-display/docweb/3118884))**

English version available [here](/cookie-policy).

# Introduzione

Il Garante della Privacy ha recepito una direttiva europea che impone agli
amministratori delle pagine web di mostrare ai visitatori un banner che li
informa di quale sia lo politica dei cookie del sito che stanno consultando
e di subordinare la sua accettazione al proseguimento della navigazione.

Il sito tiene traccia del consenso dato sul banner mediante un cookie tecnico,
considerato dal Garante della Privacy uno strumento "non particolarmente invasivo".

Utilizziamo i cookie per rendere il sito più facile ed intuitivo.
I dati raccolti grazie ai cookie servono a rendere l'esperienza di navigazione
più piacevole e più efficiente in futuro.

# Cosa sono i cookie?

I cookie sono piccoli file di testo inviati dal sito al terminale
dell'interessato (solitamente al browser), dove vengono memorizzati per essere
poi ritrasmessi al sito alla successiva visita del medesimo utente.

Un cookie non può richiamare nessun altro dato dal disco fisso dell'utente
né trasmettere virus informatici o acquisire indirizzi email.

Ogni cookie è unico per il web browser dell'utente. Alcune delle funzioni dei
cookie possono essere demandate ad altre tecnologie. Nel presente documento
con il termine *cookie* si vuol far riferimento sia ai cookie, propriamente
detti, sia a tutte le tecnologie similari.

# Tipologia dei cookie

I cookie possono essere di prima o di terza parte, dove per "prima parte" si
intendono i cookie che riportano come dominio il sito, mentre per "terza parte"
si intendono i cookie che sono relativi a domini esterni.

I cookie di terza parte sono necessariamente installati da un soggetto esterno,
sempre definito come "terza parte", non gestito dal sito. Tali soggetti possono
eventualmente installare anche cookie di prima parte, salvando sul dominio del
sito i propri cookie.

Un altro tipo di cookie sono i cosiddetti "Flash Cookie" (Local Shared Objects),
utilizzati all'interno di Adobe Flash Player per erogare alcuni contenuti,
come video clip o animazioni, in modo da ricordare le impostazioni e preferenze.

I Flash cookie sono archiviati sul dispositivo, ma sono gestiti attraverso
un'interfaccia differente rispetto a quella fornita dal browser utilizzato.

# Natura dei cookie

Relativamente alla natura dei cookie, ne esistono di diversi tipi:

## Cookie tecnici

I cookie tecnici sono quelli utilizzati al solo fine di "effettuare la trasmissione
di una comunicazione su una rete di comunicazione elettronica o nella misura
strettamente necessaria al fornitore di un servizio della società dell'informazione
esplicitamente richiesto dall'abbonato o dall'utente a erogare tale servizio"
(cfr. art. 122, comma 1, del D. Lgs. 196/2003, Codice della Privacy).

Questi cookie sono necessari al corretto funzionamento del sito e sono normalmente
installati direttamente dal titolare o gestore del sito web.

Si suddividono in:

* **cookie di navigazione o di sessione:** garantiscono la normale navigazione e
  fruizione del sito web permettendo, ad esempio, di realizzare un acquisto o
  autenticarsi per accedere ad aree riservate; sono quindi necessari per il corretto
  funzionamento del sito;
* **cookie analytics:** assimilati ai cookie tecnici laddove utilizzati direttamente
  dal gestore del sito per raccogliere informazioni, in forma aggregata, sul numero
  degli utenti e su come questi visitano il sito stesso, al fine di migliorare le
  performance del sito;
* **cookie di funzionalità:** permettono all'utente la navigazione in funzione di
  una serie di criteri selezionati (come la lingua o i prodotti selezionati durante
  l'acquisto) al fine di migliorare il servizio reso allo stesso. Per l'installazione
  di tali cookie non è richiesto il preventivo consento degli utenti (maggiori informazioni
  nel paragrafo "Gestione dei cookie" in basso).

## Cookie di profilazione

I cookie di profilazione sono volti a creare profili relativi all'utente e
vengono utilizzati al fine di inviare messaggi pubblicitari in linea con le
preferenze manifestate dallo stesso nell'ambito della navigazione in rete.

Per l'utilizzo dei cookie di profilazione è richiesto il consenso dell'interessato.

Secondo il provvedimento (maggiori informazioni nel paragrafo "Gestione dei cookie" in basso)
l'utente può autorizzare o negare il consenso all'installazione dei cookie
attraverso le opzioni fornite nella sezione "Gestione dei cookie".

In caso di cookie di terze parti, il sito non ha un controllo diretto dei
singoli cookie e non può controllarli (non può né installarli direttamente
né cancellarli).

Puoi comunque gestire questi cookie attraverso le impostazioni del browser
(segui le istruzioni riportate più avanti), o i siti indicati nella
sezione "Gestione dei cookie".

L'Utente è pertanto invitato a verificare sul sito della terza parte indicato
nella tabella riportata di seguito.

# Elenco dei cookie su questo sito

Questo sito utilizza solamente cookie tecnici di terze parti.

## Analisi del traffico

Monitoriamo il traffico mediante Google Analytics.

Il servizio Google Analytics utilizza i cookie per raccogliere e analizzare
in forma anonima le informazioni sui comportamenti di utilizzi del sito:
quali pagine vengono visualizzate, come l'Utente è arrivato a tali pagine
e alcune informazioni basilari sul computer (ad esempio browser,
risoluzione dello schermo, sistema operativo).

Tutte queste informazioni sono anonime - non siamo a conoscenza di chi sia
l'Utente, sappiamo solo che qualcuno ha visitato il sito.

Si tratta di informazioni statistiche che consentono di capire quali parti
del sito vanno meglio, come tanti altri siti utilizziamo queste informazioni
per migliorare il sito.

Gli indirizzi IP sono anonimizzati come spiegato [qui](https://support.google.com/analytics/answer/2763052?hl=it)
e [qui](http://www.iubenda.com/blog/2013/11/13/ip-anonymization-google-analytics-privacy/).

Sono assimilati a cookie tecnici in accordo al provvedimento [229 del 8 maggio 2014](http://www.garanteprivacy.it/web/guest/home/docweb/-/docweb-display/docweb/3118884).

Maggiori informazioni nella [informativa sulla privacy](http://www.google.com/analytics/learn/privacy.html)
di Google Analytics, inoltre il servizio può essere [disattivato](https://tools.google.com/dlpage/gaoptout)
se lo si desidera.

## Social network

Le news di questo sito possono essere condivise sui social network usando
i link agli appositi strumenti di condivisione in calce alla pagina.

Tale funzionalità è implementata usando normali link a risorse esterne
per evitare il tracciamento di quante volte è stata condivisa la pagina.

Non è necessario utilizzare questa funzionalità per fruire il sito.

Ad ogni modo qualora l'Utente decidesse di condividere contenuti di questo sito
sui social network, questi ultimi potrebbero essere a conoscenza del fatto
che stai visitando questo sito.

Di seguito sono riportati i link alle informative sulla privacy dei social network:

* [Twitter](https://twitter.com/privacy?lang=en)
* [Facebook](https://www.facebook.com/policy.php)
* [Google+](http://www.google.com/policies/privacy/)
* [Reddit](https://www.reddit.com/wiki/privacypolicy)

## Commenti e discussioni

Al fine di consentire ai visitatori di commentare le nostre pagine, utilizziamo
un sistema di discussione chiamato Disqus.

Per fare ciò incorporiamo del codice fornitoci da Disqus che pertanto non
possiamo controllare direttamente.

Disqus traccia le visite in maniera anonima, ricorda anche chi sei se effettui
il login ad uno qualsiasi dei servizi Disqus affinchè tu possa commentare
su qualsiasi sito web che utilizza il suddetto servizio utilizzando lo
stesso account.

Il login su Disqus può essere effettuato in molti modi, anche mediante Facebook.
Se effettui il login usando i social network, Disqus sarà in grado di collegare
la tua attività a quel social network. In questo modo la tua attività su Disqus
diventa identificabile personalmente.

Maggiori informazioni nella [informativa sulla privacy](http://docs.disqus.com/help/30/) di Disqus,
e anche su [questa](https://help.disqus.com/customer/portal/articles/1657951) pagina.

# Durata dei cookie

I cookie hanno una durata pari alla data di scadenza (o dettata da un'azione
specifica come la chiusura del browser) impostata al momento dell'installazione.

I cookie possono essere:

* **temporanei o di sessione (session cookie):** sono utilizzati per archiviare
  informazioni temporanee, consentono di collegare le azioni eseguite durante
  una sessione specifica e vengono rimossi dal computer alla chiusura del browser;
* **permanenti (persistent cookie):** sono utilizzati per archiviare informazioni,
  ad esempio il nome e la password di accesso, in modo da evitare che l'utente
  debba digitarli nuovamente ogni volta che visita un sito specifico. Questi
  rimangono memorizzati nel computer anche dopo aver chiuso il browser.

# Gestione dei cookie

Se è stato già dato il consenso ma si vogliono cambiare le autorizzazioni dei cookie,
bisogna cancellarli attraverso il browser come indicato sotto, in quanto quelli
già installati non saranno rimossi.

In particolare, si tenga presente che non è possibile in alcun modo controllare
i cookie di terze parti, quindi se è già stato dato precedentemente il consenso,
è necessario procedere alla cancellazione dei cookie mediante il browser oppure
chiedendo l'opt-out direttamente alle terze parti o tramite il sito
[http://www.youronlinechoices.com/it/le-tue-scelte](http://www.youronlinechoices.com/it/le-tue-scelte).

Se vuoi saperne di più, puoi consultare i seguenti siti:

* [http://www.youronlinechoices.com/](http://www.youronlinechoices.com/)
* [http://www.allaboutcookies.org/](http://www.allaboutcookies.org/)
* [https://www.cookiechoices.org/](https://www.cookiechoices.org/)
* [http://www.garanteprivacy.it/web/guest/home/docweb/-/docweb-display/docweb/3118884](http://www.garanteprivacy.it/web/guest/home/docweb/-/docweb-display/docweb/3118884)

# Come gestire i cookie nei vari browser

Di seguito riportiamo le procedure di gestione dei cookie nei
maggiori browser, direttamente dalla loro manualistica.

{% include cookies-settings.html %}

# Aggiornamenti a questo documento

Possiamo aggiornare questo documento di tanto in tanti, in particolare
al cambiare della tecnologia.

Puoi consultare questa pagina in ogni momento per leggere l'ultima versione.

Eventuali domande circa le politiche sulla privacy e i dati personali
possono essere indirizzate a [info@hawaiios.org](mailto:info@hawaiios.org).

<!-- vim: set noai ts=4 sw=4 expandtab: -->


text:
using System;
using System.Collections.Generic;
using System.Reactive.Linq;
using System.Reactive.Threading.Tasks;
using MS.Core;

namespace System
{
    public static class __ArraySegment1
    {
        public static IObservable<System.Int32> GetHashCode<T>(
            this IObservable<System.ArraySegment<T>> ArraySegmentValue)
        {
            return Observable.Select(ArraySegmentValue,
                (ArraySegmentValueLambda) => ArraySegmentValueLambda.GetHashCode());
        }

        public static IObservable<System.Boolean> Equals<T>(this IObservable<System.ArraySegment<T>> ArraySegmentValue,
            IObservable<System.Object> obj)
        {
            return Observable.Zip(ArraySegmentValue, obj,
                (ArraySegmentValueLambda, objLambda) => ArraySegmentValueLambda.Equals(objLambda));
        }

        public static IObservable<System.Boolean> Equals<T>(this IObservable<System.ArraySegment<T>> ArraySegmentValue,
            IObservable<System.ArraySegment<T>> obj)
        {
            return Observable.Zip(ArraySegmentValue, obj,
                (ArraySegmentValueLambda, objLambda) => ArraySegmentValueLambda.Equals(objLambda));
        }

        public static IObservable<T[]> get_Array<T>(this IObservable<System.ArraySegment<T>> ArraySegmentValue)
        {
            return Observable.Select(ArraySegmentValue, (ArraySegmentValueLambda) => ArraySegmentValueLambda.Array);
        }

        public static IObservable<System.Int32> get_Offset<T>(this IObservable<System.ArraySegment<T>> ArraySegmentValue)
        {
            return Observable.Select(ArraySegmentValue, (ArraySegmentValueLambda) => ArraySegmentValueLambda.Offset);
        }

        public static IObservable<System.Int32> get_Count<T>(this IObservable<System.ArraySegment<T>> ArraySegmentValue)
        {
            return Observable.Select(ArraySegmentValue, (ArraySegmentValueLambda) => ArraySegmentValueLambda.Count);
        }
    }
}


text:
import _ from 'lodash';

// Takes a hit, merges it with any stored/scripted fields, and with the metaFields
// returns a flattened version
export default function FlattenHitProvider(config) {
  let metaFields = config.get('metaFields');

  config.watch('metaFields', value => {
    metaFields = value;
  });

  function flattenHit(indexPattern, hit, deep) {
    const flat = {};

    // recursively merge _source
    const fields = indexPattern.fields.byName;
    (function flatten(obj, keyPrefix) {
      keyPrefix = keyPrefix ? keyPrefix + '.' : '';
      _.forOwn(obj, function (val, key) {
        key = keyPrefix + key;

        if (deep) {
          const isNestedField = fields[key] && fields[key].type === 'nested';
          const isArrayOfObjects = _.isArray(val) && _.isPlainObject(_.first(val));
          if (isArrayOfObjects && !isNestedField) {
            _.each(val, v => flatten(v, key));
            return;
          }
        } else if (flat[key] !== void 0) {
          return;
        }

        const hasValidMapping = fields[key] && fields[key].type !== 'conflict';
        const isValue = !_.isPlainObject(val);

        if (hasValidMapping || isValue) {
          if (!flat[key]) {
            flat[key] = val;
          } else if (_.isArray(flat[key])) {
            flat[key].push(val);
          } else {
            flat[key] = [ flat[key], val ];
          }
          return;
        }

        flatten(val, key);
      });
    }(hit._source));

    // assign the meta fields
    _.each(metaFields, function (meta) {
      if (meta === '_source') return;
      flat[meta] = hit[meta];
    });

    // unwrap computed fields
    _.forOwn(hit.fields, function (val, key) {
      if (key[0] === '_' && !_.contains(metaFields, key)) return;
      flat[key] = _.isArray(val) && val.length === 1 ? val[0] : val;
    });

    return flat;
  }

  return function flattenHitWrapper(indexPattern) {
    return function cachedFlatten(hit, deep = false) {
      return hit.$$_flattened || (hit.$$_flattened = flattenHit(indexPattern, hit, deep));
    };
  };
}


text:
<?php /*fich13.php?*/?>

<form action="upload2.php" method=post enctype="multipart/form-data">
<input type=hidden name=MAX_FILE_SIZE value=102400>
Seleccione o ficheiro: <input type=File name="origem">

<input type=submit value=ENVIAR>


text:
'use strict';

exports.keys = '123456';

exports.logger = {
  consoleLevel: 'info',
};


text:
<?php

namespace DevGroup\Users\widgets;

use DevGroup\Users\models\User;
use Yii;
use yii\base\Widget;
use yii\web\ServerErrorHttpException;

/**
 * Class UserProfileFormWidget
 *
 * @package DevGroup\Users\widgets
 */
class UserProfileFormWidget extends Widget
{
    public $viewFile = 'user-profile-form';
    public $formOptions = [
        'options' => [
            'class' => 'user-profile-form m-form',
        ],
    ];

    /** @var User */
    public $user = null;

    /** @inheritdoc */
    public function run()
    {
        if ($this->user === null) {
            $this->user = Yii::$app->user->identity;
            if ($this->user === null) {
                throw new ServerErrorHttpException("No user identity found");
            }
            $this->user->setScenario(User::SCENARIO_PROFILE_UPDATE);
        }

        $this->formOptions['action'] = ['@profile-update'];

        return $this->render(
            $this->viewFile,
            [
                'user' => $this->user,
                'formOptions' => $this->formOptions,
            ]
        );
    }
}


text:
<?php
/**
 * Created by PhpStorm.
 * User: spajx
 * Date: 30.4.17
 * Time: 16:39
 */

namespace AppBundle\Entity;

use DateTimeInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Criteria;

/**
 * Class TimeCard
 */
class TimeCard
{

    /**
     * @var \DateTime
     */
    protected $month;

    /**
     * @var TimeEntry[]|ArrayCollection
     */
    protected $entries;

    /**
     * @var int
     */
    protected $workedMinutes = 0;

    /**
     * TimeCard constructor.
     * @param \DateTime $month
     * @param array     $entries
     */
    public function __construct(\DateTime $month, array $entries)
    {
        $this->entries = new ArrayCollection($entries);

        foreach ($this->entries as $entry) {
            $this->workedMinutes += $entry->getWorkedMinutes();
        }
    }

    /**
     * @return TimeEntry[]|ArrayCollection
     */
    public function getEntries(): ArrayCollection
    {
        return $this->entries;
    }

    /**
     * @param DateTimeInterface $date
     * @return TimeEntry
     */
    public function getEntryByDate(DateTimeInterface $date): TimeEntry
    {
        $criteria = Criteria::create()->where(Criteria::expr()->eq('date', $date))->setFirstResult(1);

        return $this->entries->matching($criteria)->first();
    }

    /**
     * @return int
     */
    public function getWorkedMinutes(): int
    {
        return $this->workedMinutes;
    }

    /**
     * @return float
     */
    public function getWorkedHours(): float
    {
        return $this->workedMinutes / 60;
    }

}


text:
import errno
import time

from flask import Response, current_app, render_template, stream_with_context
from flask.views import MethodView
from werkzeug.exceptions import NotFound, Forbidden

from ..utils.permissions import *
from ..utils.date_funcs import delete_if_lifetime_over
from . import blueprint

class DownloadView(MethodView):
    content_disposition = 'attachment'  # to trigger download

    def get(self, name):
        if not may(READ):
            raise Forbidden()
        try:
            item = current_app.storage.openwrite(name)
        except (OSError, IOError) as e:
            if e.errno == errno.ENOENT:
                raise NotFound()
            raise

        if not item.meta['complete']:
            error = 'Upload incomplete. Try again later.'
        else:
            error = None
        if error:
            try:
                return render_template('error.html', heading=item.meta['filename'], body=error), 409
            finally:
                item.close()

        if item.meta['locked'] and not may(ADMIN):
            raise Forbidden()

        if delete_if_lifetime_over(item, name):
            raise NotFound()

        def stream():
            with item as _item:
                # Stream content from storage
                offset = 0
                size = _item.data.size
                while offset < size:
                    buf = _item.data.read(16 * 1024, offset)
                    offset += len(buf)
                    yield buf
                item.meta['timestamp-download'] = int(time.time())

        ct = item.meta['type']
        dispo = self.content_disposition
        if dispo != 'attachment':
            # no simple download, so we must be careful about XSS
            if ct.startswith("text/"):
                ct = 'text/plain'  # only send simple plain text

        ret = Response(stream_with_context(stream()))
        ret.headers['Content-Disposition'] = '{0}; filename="{1}"'.format(
            dispo, item.meta['filename'])
        ret.headers['Content-Length'] = item.meta['size']
        ret.headers['Content-Type'] = ct
        ret.headers['X-Content-Type-Options'] = 'nosniff'  # yes, we really mean it
        return ret

class InlineView(DownloadView):
    content_disposition = 'inline'  # to trigger viewing in browser, for some types

blueprint.add_url_rule('/<itemname:name>/+download', view_func=DownloadView.as_view('download'))
blueprint.add_url_rule('/<itemname:name>/+inline', view_func=InlineView.as_view('inline'))


text:
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) > [sip.js](./sip.js.md) > [UserAgentOptions](./sip.js.useragentoptions.md) > [transportConstructor](./sip.js.useragentoptions.transportconstructor.md)

## UserAgentOptions.transportConstructor property

A constructor function for the user agent's `Transport`<!-- -->.

<b>Signature:</b>

```typescript
transportConstructor?: new (logger: Logger, options: any) => Transport;
```

## Remarks

For more information about creating your own transport see `Transport`<!-- -->.


text:
import { HeatmapSeriesData, Series, StoreModule } from '@t/store/store';
import { HeatmapCategoriesType, RangeDataType } from '@t/options';
import { getDataInRange } from '@src/helpers/range';

function makeHeatmapSeries(
  series: Series,
  categories: HeatmapCategoriesType,
  viewRange?: RangeDataType<number>
): HeatmapSeriesData[] {
  if (!series.heatmap) {
    return [];
  }

  return series.heatmap.data.map((rowSeries, y) => {
    const { yCategory, data } = rowSeries;

    return getDataInRange(data, viewRange).map((colorValue, x) => ({
      colorValue,
      category: {
        x: categories.x[x],
        y: yCategory,
      },
      indexes: [x, y],
    }));
  });
}

const heatmapSeriesData: StoreModule = {
  name: 'heatmapSeriesData',
  state: () => ({
    heatmapSeries: [],
  }),
  action: {
    setHeatmapSeriesData({ state, computed }) {
      state.heatmapSeries = makeHeatmapSeries(
        state.series,
        state.categories as HeatmapCategoriesType,
        computed.viewRange
      );
    },
  },
  observe: {
    updateTreemapSeriesData() {
      this.dispatch('setHeatmapSeriesData');
    },
  },
};

export default heatmapSeriesData;


text:
			Posted on

			by

{{ task.name }}

                        #
                        Name
                        Description
                        Start Date
                        Due Date

                        <form name="newTaskForm" id="newTaskForm" ng-submit="createTask($index)" novalidate>
                            <fieldset>

                                        <input type="text" data-ng-model="name" id="name" class="form-control" placeholder="Name" required>

                                        <input type="text" data-ng-model="description" id="description" class="form-control" placeholder="Description">

                                        <input type="date" data-ng-model="startDate" id="startDate" class="form-control" placeholder="Start Date">

                                        <input type="date" data-ng-model="dueDate" id="dueDate" class="form-control" placeholder="End Date">

                                    <input type="submit" class="btn btn-default" ng-click="createTask($index)">

                            </fieldset>
                        </form>


text:
using System.Net.Http;
using System.Web.Http;
using System.Web.Http.Routing;

namespace TestHelper
{
    public class DummyController
    {
        public DummyController(HttpConfiguration configuration, HttpRequestMessage requestMessage, HttpRouteData routeData)
        {
            Configuration = configuration;
            RequestMessage = requestMessage;
            RouteData = routeData;
        }

        public HttpConfiguration Configuration { get; }
        public HttpRequestMessage RequestMessage { get; }
        public HttpRouteData RouteData { get; }

    }
}


text:
/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/**
 * @license
 * Copyright Google Inc. All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
/**
 * @module
 * @description
 * Entry point for all public APIs of this package.
 */
export { platformServerTesting, ServerTestingModule } from './src/testing';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3BsYXRmb3JtLXNlcnZlci90ZXN0aW5nL3B1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQWFBLDJEQUFjLGVBQWUsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGxpY2Vuc2VcbiAqIENvcHlyaWdodCBHb29nbGUgSW5jLiBBbGwgUmlnaHRzIFJlc2VydmVkLlxuICpcbiAqIFVzZSBvZiB0aGlzIHNvdXJjZSBjb2RlIGlzIGdvdmVybmVkIGJ5IGFuIE1JVC1zdHlsZSBsaWNlbnNlIHRoYXQgY2FuIGJlXG4gKiBmb3VuZCBpbiB0aGUgTElDRU5TRSBmaWxlIGF0IGh0dHBzOi8vYW5ndWxhci5pby9saWNlbnNlXG4gKi9cblxuLyoqXG4gKiBAbW9kdWxlXG4gKiBAZGVzY3JpcHRpb25cbiAqIEVudHJ5IHBvaW50IGZvciBhbGwgcHVibGljIEFQSXMgb2YgdGhpcyBwYWNrYWdlLlxuICovXG5leHBvcnQgKiBmcm9tICcuL3NyYy90ZXN0aW5nJztcblxuLy8gVGhpcyBmaWxlIG9ubHkgcmVleHBvcnRzIGNvbnRlbnQgb2YgdGhlIGBzcmNgIGZvbGRlci4gS2VlcCBpdCB0aGF0IHdheS5cbiJdfQ==


text:
layout:     post
title:      Apereo CAS - SAML2 Metadata with MongoDb
summary:    CAS distributed SAML2 metadata management using MongoDB, where you learn how to store metadata documents inside MongoDB for CAS as a SAML2 identity provider and all other registered SAML2 service providers.
tags:       [CAS,SAML]
---

  Collaborate
The blog is managed and hosted on GitHub. If you wish to update the contents of this post or if you have found an inaccuracy and wish to make corrections, we recommend that you please submit a pull request to this repository.

This post is relocated to [here](https://fawnoos.com/2018/11/03/cas6-saml2-metadata-mongodb/).

[Misagh Moayyed](https://fawnoos.com)


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Septoria blumenbachiae Speg.

### Remarks
null


text:
// Copyright (c) 2012 Sergiu Dotenco
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

/**
 * @brief Boost.Spirit based BibTeX parser.
 * @file bibtexreader.hpp
 * @author Sergiu Dotenco
 * @version 0.1
 */

#ifndef BIBTEXREADER_HPP
#define BIBTEXREADER_HPP

#pragma once

#include <istream>
#include <string>

#include <boost/fusion/include/vector.hpp>
#include <boost/io/ios_state.hpp>
#include <boost/mpl/and.hpp>
#include <boost/range.hpp>
#include <boost/spirit/include/phoenix.hpp>
#include <boost/spirit/include/support_istream_iterator.hpp>
#include <boost/utility/enable_if.hpp>

#include "bibtexentry.hpp"

namespace bibtex {

/**
 * @brief Single BibTeX entry reader.
 *
 * @tparam ForwardIterator Input sequence iterator type.
 * @tparam Skipper Skipper type.
 */
template <class ForwardIterator, class Skipper>
class BibTeXReader
    : public boost::spirit::qi::grammar<ForwardIterator, BibTeXEntry(), Skipper>
{
public:
    BibTeXReader()
        : BibTeXReader::base_type(start_, "single BibTeX entry")
    {
        using namespace boost::spirit;
        namespace ph = boost::phoenix;
        namespace sn = detail::encoding;

        escapedBrace.add
            ("\\{", '{')
            ("\\}", '}')
            ;
        escapedQuote.add
            ("\\\"", '"')
            ;

        tag_ = +detail::encoding::alnum;
        entryKey_ = qi::lexeme[+(~qi::char_(',') - sn::space)];
        key_ = qi::lexeme[+(~qi::char_("=,})") - sn::space)];

        escapedText_
            = !qi::lit('{') >> +(escapedBrace | ~qi::char_("{}"))
            ;

        quoteText_
            = +(escapedQuote | ~qi::char_("\"{}"))
            ;

        innerBraceText_
            %=
            qi::as_string
            [
                qi::char_('{')
                >>
                    *(innerBraceText_ | escapedText_)
                >>
                qi::char_('}')
            ]
            |
            escapedText_
            ;

        innerQuoteText_
            %=
            qi::as_string
            [
                qi::char_('{')
                >>
                    *(innerQuoteText_ | escapedText_)
                >>
                qi::char_('}')
            ]
            |
            quoteText_
            ;

        quoted_
            = qi::lexeme
            [
                ( '"' >> *innerQuoteText_ >> '"' )
                |
                ( '{' >> *innerBraceText_ >> '}' )
            ]
            [
                _val = ph::accumulate(_1, ph::construct<std::string>())
            ]
            ;

        value_
            = quoted_
            | +~qi::char_(",})#")
            ;

        values_
            = value_ % '#'
            ;

        field_
            = key_ >> '=' >> values_
            ;

        fields_ = -(field_ % ',');

        body_
            = -entryKey_ >> ',' // tolerate an empty key
            >> fields_
            >> -qi::lit(',') // accept a trailing comma
            ;

        generic_
            =
            '@' >> tag_
            [
                ph::at_c<0>(_val) = _1
            ]
            >>
            (
                ('{' >> body_ >> '}')
                |
                ('(' >> body_ >> ')')
            )
            [
                ph::at_c<1>(_val) = ph::at_c<0>(_1),
                ph::at_c<2>(_val) = ph::at_c<1>(_1)
            ]
            ;

        string_
            =
            '@' >> sn::no_case
            [
                qi::string("string")
                [
                    ph::at_c<0>(_val) = _1
                ]
            ]
            >>
            (
                ('{' >> field_ >> '}')
                |
                ('(' >> field_ >> ')')
            )
            [
                ph::assign(ph::bind(&BibTeXEntry::fields, _val), 1, _1)
            ]
            ;

        simple_
            =
            '@' >> sn::no_case
            [
                (
                    sn::string("comment")
                    |
                    sn::string("include")
                    |
                    sn::string("preamble")
                )
                [
                    ph::at_c<0>(_val) = _1
                ]
            ]
            >>
            (
                ('{' >> values_ >> '}')
                |
                ('(' >> values_ >> ')')
            )
            [
                ph::assign(ph::bind(&BibTeXEntry::fields, _val), 1,
                    ph::construct<KeyValue>
                        (ph::construct<KeyValue::first_type>(), _1))
            ]
            ;

        entry_
            = string_
            | simple_
            | generic_
            ;

        junk_
            = *~qi::lit('@')
            ;

        start_
            = junk_ >> entry_
            ;
    }

private:
    typedef boost::spirit::qi::rule<ForwardIterator, std::string(), Skipper>
        StringRule;
    typedef boost::spirit::qi::rule<ForwardIterator, std::string()>
        SimpleStringRule;

    boost::spirit::qi::rule<ForwardIterator, BibTeXEntry(), Skipper> generic_;
    boost::spirit::qi::rule<ForwardIterator, BibTeXEntry(), Skipper> include_;
    boost::spirit::qi::rule<ForwardIterator, BibTeXEntry(), Skipper> simple_;
    boost::spirit::qi::rule<ForwardIterator, BibTeXEntry(), Skipper> start_;
    boost::spirit::qi::rule<ForwardIterator, BibTeXEntry(), Skipper> string_;
    boost::spirit::qi::rule<ForwardIterator, BibTeXEntry(), Skipper> entry_;
    boost::spirit::qi::rule<ForwardIterator, ValueVector(), Skipper> values_;
    boost::spirit::qi::rule<ForwardIterator, Skipper> junk_;
    boost::spirit::qi::rule<ForwardIterator,
        boost::fusion::vector<boost::optional<std::string>,
        KeyValueVector>(), Skipper> body_;
    boost::spirit::qi::rule<ForwardIterator, KeyValue(), Skipper> field_;
    boost::spirit::qi::rule<ForwardIterator, KeyValueVector(), Skipper>
        fields_;
    boost::spirit::qi::symbols<char, char> escapedBrace;
    boost::spirit::qi::symbols<char, char> escapedQuote;
    StringRule quoted_;
    StringRule entryKey_;
    StringRule key_;
    StringRule tag_;
    StringRule value_;
    SimpleStringRule innerBraceText_;
    SimpleStringRule escapedText_;
    SimpleStringRule innerQuoteText_;
    SimpleStringRule quoteText_;
};

template<class ForwardIterator, class Skipper>
inline bool read(ForwardIterator first, ForwardIterator last, Skipper& skipper,
                  BibTeXEntry& entry)
{
    BibTeXReader<ForwardIterator, Skipper> parser;
    return boost::spirit::qi::phrase_parse(first, last, parser, skipper, entry);
}

template<class ForwardIterator, class Skipper, class Container>
inline bool read(ForwardIterator first, ForwardIterator last, Skipper& skipper,
    Container& entries, boost::enable_if<boost::is_same<
        typename Container::value_type, BibTeXEntry> >* /*dummy*/ = NULL)
{
    BibTeXReader<ForwardIterator, Skipper> parser;
    return boost::spirit::qi::phrase_parse(first, last, *parser, skipper,
        entries);
}

template<class ForwardRange, class Skipper>
inline bool read(const ForwardRange& range, Skipper& skipper,
                 BibTeXEntry& entry)
{
    return read(boost::const_begin(range), boost::const_end(range), entry);
}

template<class ForwardRange, class Skipper, class Container>
inline bool read(const ForwardRange& range, Skipper& skipper,
    Container& entries, boost::enable_if<boost::is_same<
        typename Container::value_type, BibTeXEntry> >* /*dummy*/ = NULL)
{
    return read(boost::const_begin(range), boost::const_end(range), entries);
}

template<class ForwardIterator>
inline bool read(ForwardIterator first, ForwardIterator last,
                 BibTeXEntry& entry)
{
    return read(first, last, bibtex::space, entry);
}

template<class ForwardIterator, class Container>
inline bool read(ForwardIterator first, ForwardIterator last,
    Container& entries, boost::enable_if<boost::is_same<
        typename Container::value_type, BibTeXEntry> >* /*dummy*/ = NULL)
{
    return read(first, last, bibtex::space, entries);
}

template<class ForwardRange>
inline bool read(const ForwardRange& range, BibTeXEntry& entry,
    typename boost::enable_if<
        boost::has_range_iterator<ForwardRange> >::type* /*dummy*/ = NULL)
{
    return read(range, bibtex::space, entry);
}

template<class ForwardRange, class Container>
inline bool read(const ForwardRange& range, Container& entries,
    typename boost::enable_if<
        boost::has_range_iterator<ForwardRange> >::type* /*dummy*/ = NULL)
{
    return read(range, bibtex::space, entries);
}

template<class E, class T>
inline bool read(std::basic_istream<E, T>& in, BibTeXEntry& e)
{
    boost::io::ios_flags_saver saver(in);
    in.unsetf(std::ios_base::skipws);

    typedef boost::spirit::basic_istream_iterator<E> istream_iterator;
    return read(istream_iterator(in), istream_iterator(), e);
}

template<class E, class T, class Container>
inline bool read(std::basic_istream<E, T>& in, Container& entries)
{
    boost::io::ios_flags_saver saver(in);
    in.unsetf(std::ios_base::skipws);

    typedef boost::spirit::basic_istream_iterator<E> istream_iterator;
    return read(istream_iterator(in), istream_iterator(), entries);
}

template<class E, class T>
inline std::basic_istream<E, T>& operator>>(std::basic_istream<E, T>& in,
    BibTeXEntry& entry)
{
    read(in, entry);
    return in;
}

template<class E, class T, class Range>
inline typename boost::enable_if<
    boost::mpl::and_<
        boost::has_range_iterator<Range>,
        boost::is_same<typename Range::value_type, BibTeXEntry>
    >, std::basic_istream<E, T>
>::type& operator>>(std::basic_istream<E, T>& in, Range& entries)
{
    read(in, entries);
    return in;
}

} // namespace bibtex

#endif // BIBTEXREADER_HPP


text:
package com.dmdirc.addons.ui_swing.components;

import java.awt.Dimension;
import java.awt.LayoutManager;
import java.awt.Rectangle;

import javax.swing.JPanel;
import javax.swing.Scrollable;

/**
 * Scrollable JPanel, only scrolls vertically.
 */
public class XScrollablePanel extends JPanel implements Scrollable {

    private static final long serialVersionUID = 1L;

    /** Creates a new scrollable panel. */
    public XScrollablePanel() {
    }

    /**
     * Creates a new scrollable panel.
     *
     * @param layout Layout manager
     */
    public XScrollablePanel(final LayoutManager layout) {
        super(layout);
    }

    @Override
    public Dimension getPreferredScrollableViewportSize() {
        return getPreferredSize();
    }

    @Override
    public int getScrollableUnitIncrement(final Rectangle visibleRect,
            final int orientation, final int direction) {
        return getFont().getSize();
    }

    @Override
    public int getScrollableBlockIncrement(final Rectangle visibleRect,
            final int orientation, final int direction) {
        return getFont().getSize() * 3;
    }

    @Override
    public boolean getScrollableTracksViewportWidth() {
        return true;
    }

    @Override
    public boolean getScrollableTracksViewportHeight() {
        return false;
    }

}


text:
sidebar_label: Page.emulateTimezone
---

# Page.emulateTimezone() method

#### Signature:

```typescript
class Page {
  emulateTimezone(timezoneId?: string): Promise<void>;
}
```

## Parameters

| Parameter  | Type   | Description                                                                                |
| ---------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| timezoneId | string | (Optional) Changes the timezone of the page. See [ICU's metaZones.txt](https://source.chromium.org/chromium/chromium/deps/icu.git/+/faee8bc70570192d82d2978a71e2a615788597d1:source/data/misc/metaZones.txt) for a list of supported timezone IDs. Passing null disables timezone emulation. |

**Returns:**

Promise<void>


text:
@interface Agency : NSObject<BaseProtocol>

@property Student * student;
-(void)agencyWork;

@end


text:
@interface JiveSearchPeopleRequestOptions : JiveSearchRequestOptions

//! Optional boolean value indicating whether or not to limit search results to only people that match by name.
@property (nonatomic) BOOL nameonly;

@end


text:
<?php
   Class FavModel
   {
      protected $_table = "shop_fav";

      public function __construct()
      {
         $this->_db = Yaf_Registry::get('_db');
      }

      public function select($username)
      {
         $params = array(
            "fav_id",
            "user_uuid",
            "product_uuid",
            "fav_time",
            "comment"
         );
         $whereis = array( "fav_id"=>$username );
         $result = $this->_db->select($this->_table, $params ,$whereis );

         return $result==null?false:$result;
      }
      public function selectAll($where)
      {
        //实现左连接表查询
        $join = array(
            "[>]shop_product"=>"product_uuid"
        );

        $params = array(
            "fav_id",
            "product_name",
            "money",
            "product_uuid",
            "fav_time",
            "comment"
         );
         $whereis = array("user_uuid"=>$where);
         $result = $this->_db->select( "shop_fav" , $join, $params, $whereis );
         // print_r($this->_db->error());
         // print_r($result);

         return $result==null?false:$result;
      }

      public function insert($info)
      {
         $result = $this->_db->insert($this->_table, $info);
         // print_r($this->_db->error());

         return $result<1?false:true;
      }
      public function update($username, $info)
      {
         $result = $this->_db->update($this->_table, $info, array( 'fav_id'=>$username ));

         return $result<1?false:true;
      }
      public function del($username)
      {
         $whereis = array( 'fav_id'=>$username );
         $result = $this->_db->delete($this->_table, $whereis );
         return $result==null?false:true;
      }
   }


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

class Read_details extends CI_Controller {

	public function __construct()
	{
		parent::__construct();
		$this->load->model('janao_janao_model');
		$this->load->model('post_comment_model');
	}

	public function index($id='')
	{

	}

	public function post($id='')
	{

		$data['post_id']=$id;
		$data['old_post']=$this->janao_janao_model->get_janao_natun_by_id($id);
		$data['old_comment']=$this->post_comment_model->get_comment_by_id($id);
		$this->load->view('header');
		$this->load->view('menu');
		$this->load->view('view_read_details',$data);
		$this->load->view('footer');
	}

	public function comment_on_post()
	{
		$insert=array(
			'jano_janao_id' =>$this->input->post('post_id'),
			'comment_by' =>$this->input->post('comment_by'),
			'jano_janao_comment' =>$this->input->post('comment_details')
		);

		$this->post_comment_model->insert_post_comment($insert);

		redirect(base_url()."read_details/post/".$this->input->post('post_id'));
	}

	public function rate_post()
	{
		$rate=$this->input->post('post_rate');
		$post_id=$this->input->post('post_id');

		$session_key="post_rated_".$post_id;

		$array = array(
			$session_key => 'You Rated :'.$rate,
		);

		$this->session->set_userdata( $array );

		$this->post_comment_model->update_rating($rate,$post_id);

		redirect(base_url()."read_details/post/".$this->input->post('post_id'));
	}

}

/* End of file Read_details.php */
/* Location: ./application/controllers/Read_details.php */


text:
package com.suwonsmartapp.abl.sample;

import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.provider.BaseColumns;
import android.provider.MediaStore;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CursorAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.Toast;

import com.suwonsmartapp.abl.AsyncBitmapLoader;

public class SampleActivity extends AppCompatActivity {

    private static final int MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE = 1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        permissionCheck();
    }

    private void init() {
        ListView listView = (ListView) findViewById(R.id.listView);

        Cursor cursor = getContentResolver().query(MediaStore.Video.Media.EXTERNAL_CONTENT_URI
                , null, null, null, null);

        MyAdapter adapter = new MyAdapter(getApplicationContext(), cursor, true);

        listView.setAdapter(adapter);
    }

    private void permissionCheck() {
        if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE)
                != PackageManager.PERMISSION_GRANTED) {

            // 권한 체크 화면 보여주기
            if (ActivityCompat.shouldShowRequestPermissionRationale(this,
                    Manifest.permission.READ_EXTERNAL_STORAGE)) {
                // 사용자가 이전에 거부를 했을 경우
                ActivityCompat.requestPermissions(this,
                        new String[] { Manifest.permission.READ_EXTERNAL_STORAGE },
                        MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE);
            } else {
                // 권한이 없을 때 권한 요청
                ActivityCompat.requestPermissions(this,
                        new String[] { Manifest.permission.READ_EXTERNAL_STORAGE },
                        MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE);
            }
        } else {
            init();
        }
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);

        // 권한 승인 또는 거부 시 처리
        switch (requestCode) {
            case MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE:
                // If request is cancelled, the result arrays are empty.
                if (grantResults.length > 0
                        && grantResults[0] == PackageManager.PERMISSION_GRANTED) {

                    // permission was granted, yay! Do the
                    // contacts-related task you need to do.
                    Toast.makeText(SampleActivity.this, "권한 승인 됨", Toast.LENGTH_SHORT).show();
                    init();
                } else {

                    // permission denied, boo! Disable the
                    // functionality that depends on this permission.
                    Toast.makeText(SampleActivity.this, "권한 거부 됨", Toast.LENGTH_SHORT).show();
                    finish();
                }
        }
    }

    private static class MyAdapter extends CursorAdapter implements
            AsyncBitmapLoader.BitmapLoadListener {

        private AsyncBitmapLoader mAsyncBitmapLoader;
        private Context mContext;

        @Override
        public Bitmap getBitmap(String key) {
            long id = Long.valueOf(key);

            BitmapFactory.Options options = new BitmapFactory.Options();
            options.inSampleSize = 1;

            return MediaStore.Video.Thumbnails.getThumbnail(
                    mContext.getContentResolver(), id, MediaStore.Video.Thumbnails.MINI_KIND,
                    options);
        }

        private static class ViewHolder {
            ImageView imageView;
        }

        public MyAdapter(Context context, Cursor c, boolean autoRequery) {
            super(context, c, autoRequery);

            mContext = context;

            mAsyncBitmapLoader = new AsyncBitmapLoader(context);
            mAsyncBitmapLoader.setBitmapLoadListener(this);
        }

        @Override
        public View newView(Context context, Cursor cursor, ViewGroup parent) {
            View rootView = LayoutInflater.from(context)
                    .inflate(R.layout.listview_item_movie, parent, false);
            ViewHolder holder = new ViewHolder();
            holder.imageView = (ImageView) rootView.findViewById(R.id.image);
            rootView.setTag(holder);
            return rootView;
        }

        @Override
        public void bindView(View view, Context context, Cursor cursor) {
            ViewHolder holder = (ViewHolder) view.getTag();
            mAsyncBitmapLoader.loadBitmap(String.valueOf(cursor.getLong(cursor.getColumnIndexOrThrow(BaseColumns._ID))), holder.imageView);
        }
    }

}


text:
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
             xmlns:b="urn:import:com.github.gwtbootstrap.client.ui" >

  <b:TextBox ui:field="textBox"/>
</ui:UiBinder>