text:
"""
    lantz.drivers.legacy.coherent.innova
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Implements the drivers for Innova 300 Series gas lasers.

    Implementation Notes
    --------------------

    There are currently 3 drivers implemented Innova300C, ArgonInnova300C
    and KryptonInnova300C. The last two only add to the first the
    corresponding wavelength selection.

    Sources::

        - Innova 300C Manual

    :copyright: 2015 by Lantz Authors, see AUTHORS for more details.
    :license: BSD, see LICENSE for more details.

"""

from lantz import Q_, Action, Feat, DictFeat
from lantz.errors import InvalidCommand
from lantz.drivers.legacy.serial import SerialDriver

def make_feat(command, **kwargs):

    def get(self):
        return self.query('PRINT {}'.format(command))

    def set(self, value):
        return self.query('{}={}'.format(command, value))

    if kwargs.pop('readonly', None):
        return Feat(fget=get, **kwargs)
    elif kwargs.pop('writeonly', None):
        return Feat(fset=set, **kwargs)

    return Feat(get, set, **kwargs)

class Innova300C(SerialDriver):
    """Innova300 C Series.
    """

    ENCODING = 'ascii'

    SEND_TERMINATION = '\r\n'
    RECV_TERMINATION = '\r\n'

    def __init__(self, port=1, baudrate=1200, **kwargs):
        super().__init__(port, baudrate, bytesize=8, parity='None',
                         stopbits=1, **kwargs)

    def initialize(self):
        super().initialize()
        self.echo_enabled = False

    def query(self, command, *, send_args=(None, None), recv_args=(None, None)):
        """Send query to the laser and return the answer, after handling
        possible errors.

        :param command: command to be sent to the instrument
        :type command: string

        :param send_args: (termination, encoding) to override class defaults
        :param recv_args: (termination, encoding) to override class defaults
        """
        ans = super().query(command, send_args=send_args, recv_args=recv_args)
        # TODO: Echo handling
        if ans == 'Out of Range':
            raise ValueError()
        elif ans.startswith('Syntax Error'):
            raise InvalidCommand()
        elif ans == 'Laser must be off':
            raise Exception('Laser must be off')

        return ans

    # General information and communication

    idn = make_feat('ID',
                    readonly=True,
                    doc='Laser identification, should be I300.',
                    read_once=True)

    software_rev = make_feat('SOFTWARE',
                             readonly=True,
                             doc='Software revision level in the power supply.',
                             read_once=True)

    head_software_rev = make_feat('HEAD SOFTWARE',
                                  readonly=True,
                                  doc='Software revision level in the laser head board.',
                                  read_once=True)

    echo_enabled = make_feat('ECHO',
                             writeonly=True,
                             doc='Echo mode of the serial interface.',
                             values={True: 1, False: 0})

    baudrate = Feat(values={110, 300, 1200, 2400, 4800, 9600, 19200})

    @baudrate.setter
    def baudrate(self, value):
        """RS-232/422 baud rate, the serial connection will be reset after.
        """
        self.query('BAUDRATE={}'.format(value))
        #TODO: RESET Connection

    # Interface

    analog_relative = make_feat('ANALOG MODE',
                                doc='Analog Interface input mode.',
                                values={True: 1, False: 0})

    analog_enabled = make_feat('ANALOGINT',
                               doc='Analog Interface input state.',
                               values={True: 1, False: 0})

    current_range = make_feat('CURRENT RANGE',
                              doc='Current corresponding to 5 Volts at the input'\
                                  ' or output lines of the Analog Interface.',
                              units='A',
                              limits=(10, 100, 1))

    control_pin_high = make_feat('CONTROL',
                                 readonly=True,
                                 doc='State of the input pin 10 of the Analog Interface.',
                                 values={True: 1, False: 0})

    output_pin_high = make_feat('STATUS',
                                doc='State of the output pin 24 and 25 of the Analog Interface.',
                                values={(False, False): 0, (True, False): 1,
                                     (False, True): 2, (True, True): 3})

    # Diagnostics

    @Feat()
    def faults(self):
        """List of all active faults.
        """
        return self.query('PRINT FAULT').split('&')

    autofill_delta = make_feat('AUTOFILL DELTA',
                               readonly=True,
                               doc='Tube voltage minus the autofill setting.',
                               units='V')

    autofill_needed = make_feat('AUTOFILL STATUS',
                                readonly=True,
                                doc='Is the autofill needed (wheter fill is enabled or not)',
                                values={True: 1, False: 0})

    remaining_time = make_feat('HRSTILSHUTDOWN',
                               readonly=True,
                               doc='Number of hours remaining before the laser '\
                                   'will shut down automatically.',
                               units='hour')

    cathode_current = make_feat('CATHODE CURRENT',
                                readonly=True,
                                doc='Laser cathode current (AC).',
                                units='A')

    cathode_voltage = make_feat('CATHODE VOLTAGE',
                                readonly=True,
                                doc='Laser cathode voltage (AC).',
                                units='V')

    time_to_start = make_feat('START',
                              readonly=True,
                              doc='Timer countdown during the start delay cycle.',
                              units='second')

    @Feat()
    def is_in_start_delay(self):
        """Laser is in start delay (tube not ionized)
        """
        return self.query('LASER') == '1'

    tube_time = make_feat('HOURS',
                          readonly=True,
                          doc='Number of operating hours on the plasma tube.',
                          units='hour')

    tube_voltage = make_feat('TUBE VOLTAGE',
                             readonly=True,
                             doc='Laser tube voltage.',
                             units='V')

    water_flow = make_feat('FLOW',
                           readonly=True,
                           doc='Water flow.',
                           units='gallons/minute')

    water_resistivity = make_feat('WATER RESISTIVITY',
                                  readonly=True,
                                  doc='Resistivity of the incoming water to the power supply.',
                                  units='kohm*cm')

    water_temperature = make_feat('WATER TEMPERATURE',
                                  doc='Temperature of the incoming water to the power supply.')

    # Other

    autofill_mode = make_feat('AUTOFILL',
                              doc='Autofill mode.',
                              values={'disabled': 0, 'enabled': 1,
                                   'enabled until next autofill': 2})

    laser_enabled = make_feat('LASER',
                              doc='Energize the power supply.',
                              values={True: 2, False: 0})

    magnet_current = make_feat('MAGNET CURRENT',
                               readonly=True,
                               doc='Laser magnet current.',
                               units='A')

    operating_mode = make_feat('MODE',
                               readonly=True,
                               doc='Laser operating mode.',
                               values={'current regulation': 0,
                                    'reduced bandwidth light regulation': 1,
                                    'standard light regulation': 2,
                                    'current regulation, light regulation out of range': 3})

    # Etalon

    etalon_mode = make_feat('EMODE',
                            doc='Etalon mode.',
                            values={'manual': 0, 'modetrack': 1, 'modetune': 2})

    etalon_temperature = make_feat('ETALON',
                                   readonly=True,
                                   doc='Etalon temperature.',
                                   units='degC')

    @Feat(units='degC', limits=(51.5, 54, 0.001))
    def etalon_temperature_setpoint(self):
        """Setpoint for the etalon temperature.
        """
        return self.query('PRINT SET ETALON')

    @etalon_temperature_setpoint.setter
    def etalon_temperature_setpoint(self, value):
        self.query('ETALON={}'.format(value))

    # Magnetic field

    magnetic_field_high = make_feat('FIELD',
                                    doc='Magnetic field.',
                                    values={True: 1, False: 0})

    @Feat(values={True: 1, False: 0})
    def magnetic_field_setpoint_high(self):
        """Setpoint for magnetic field setting.
        """
        return self.query('PRINT SET FIELD')

    @magnetic_field_setpoint_high.setter
    def magnetic_field_setpoint_high(self, value):
        self.query('FIELD={}'.format(value))

    # Light and current regulation

    powertrack_mode_enabled = make_feat('PT',
                                        doc='PowerTrack.',
                                        values={True: 1, False: 0})

    @DictFeat(keys=('A', 'B'), limits=(0, 255))
    def powertrack_position(self, key):
        """Relative position of the PowerTrack solenoids.
        """
        return self.query('PRINT PTDAC{}'.format(key))

    @powertrack_position.setter
    def powertrack_position(self, key, value):
        self.query('PTDAC{}={}'.format(key, value))

    @Action()
    def recalibrate_powertrack(self):
        """Recalibrate PowerTrack. This will only execute if PowerTrack is on
        and light regulation is off
        """
        self.query('PT=2')

    @Action()
    def center_powertrack(self):
        """Center PowerTrack and turn it off.
        """
        self.query('PT=3')

    current = make_feat('CURRENT',
                        readonly=True,
                        doc='Current regulation mode.',
                        units='A')

    @Feat(units='A', limits=(0, 50, 0.01))
    def current_setpoint(self):
        """Current setpoint when using the current regulation mode.
        """
        return self.query('PRINT SET CURRENT')

    @current_setpoint.setter
    def current_setpoint(self, value):
        self.query('CURRENT={}'.format(value))

    power = make_feat('LIGHT 3',
                      readonly=True,
                      doc='Current power output.',
                      units='A')

    @Feat(units='W', limits=(0, 50, 0.0001))
    def power_setpoint(self):
        """Setpoint for the light regulation.
        """
        return self.query('PRINT SET LIGHT')

    @power_setpoint.setter
    def power_setpoint(self, value):
        self.query('LIGHT={}'.format(value))

    auto_light_cal_enabled = make_feat('AUTOLTCAL',
                                       doc='Automatic light regulation calibration flag.',
                                       values={True: 1, False: 0})

    current_change_limit = make_feat('PCTCHGTILRECAL',
                                     doc='Percent tube change before an automatic '\
                                         'light regulation recalibration becomes '\
                                         'necessary.',
                                     units='', #TODO: %
                                     limits=(5, 100, 1))

class ArgonInnova300C(Innova300C):
    """Argon Innova 300C.
    """

    wavelength = make_feat('WAVELENGTH',
                           doc='Wavelength for the internal power meter calibration',
                           values={351, 364, 454, 457, 465, 472, 476, 488, 496, 501,
                                 514, 528, 1090, 'MLVS', 'MLUV', 'MLDUV'})

class KryptonInnova300C(Innova300C):
    """Krypton Innova 300C.
    """
    wavelength = make_feat('WAVELENGTH',
                           doc='Wavelength for the internal power meter calibration',
                           values={476, 482, 520, 530, 568, 647, 676, 752, 'MLVS',
                                 'MLUV', 'MLVI', 'MLBG', 'MLRD', 'MLIR'})

if __name__ == '__main__':
    import argparse
    import lantz.log

    parser = argparse.ArgumentParser(description='Test Kentech HRI')
    parser.add_argument('-i', '--interactive', action='store_true',
                        default=False, help='Show interactive GUI')
    parser.add_argument('-p', '--port', type=str, default='17',
                        help='Serial port to connect to')

    args = parser.parse_args()
    lantz.log.log_to_socket(lantz.log.DEBUG)
    with Innova300C(args.port) as inst:
        if args.interactive:
            from lantz.ui.app import start_test_app
            start_test_app(inst)
        else:
            print(inst.idn)
            print(inst.software_rev)
            print(inst.head_software_rev)


text:
module FilterableTable
end

redpajama_set_name: RedPajamaGithub


text:
#ifndef H_CYearView
#define H_CYearView

#include "CCalendarViewBase.h"

#include "CYearTable.h"

#include "HPopupMenu.h"

class JXMultiImageButton;
class CStaticText;

// ===========================================================================
//	CYearView

class	CYearView : public CCalendarViewBase
{
public:
			CYearView(JXContainer* enclosure,
					const HSizingOption hSizing, const VSizingOption vSizing,
					const JCoordinate x, const JCoordinate y,
					const JCoordinate w, const JCoordinate h);
	virtual	~CYearView();

	virtual void ListenTo_Message(long msg, void* param);
	virtual void Receive(JBroadcaster* sender, const Message& message);

	virtual bool ObeyCommand(unsigned long cmd, SMenuCommandChoice* menu = NULL);
	virtual void UpdateCommand(unsigned long cmd, CCmdUI* cmdui);

	virtual iCal::CICalendarDateTime GetSelectedDate() const;

	virtual cdstring GetTitle() const;

	virtual void ResetFont(const SFontInfo& finfo);			// Reset text traits

	virtual void DoPrint();

	NCalendarView::EYearLayout GetLayout() const
	{
		return mLayoutValue;
	}
	void SetLayout(NCalendarView::EYearLayout layout);

	virtual CCalendarTableBase* GetTable() const;

protected:
	NCalendarView::EYearLayout	mLayoutValue;

	// UI Objects
// begin JXLayout1

    JXMultiImageButton* mYearMinus;
    CStaticText*        mYear;
    JXMultiImageButton* mYearPlus;
    HPopupMenu*         mLayout;

// end JXLayout1
	CYearTable*			mTable;

	virtual void		OnCreate();

	virtual void		ResetDate();
			void		SetCaptions();

			void		OnUpdateNewEvent(CCmdUI* pCmdUI);

			void		OnPreviousYear();
			void		OnNextYear();
			void		OnThisYear();
			void		OnNewEvent();
			void		OnLayout();
};

#endif


text:
scripts=$(pwd)

cd ../Libraries/Drivers
git submodule update --recursive

# compile drivers (warning: make sure libi2c-dev is installed first)
cd Build
./compile.sh

cd ../../../BoneCentral/Peripherals
V8=$(node -e "var V8A=process.versions.v8.split('.');console.log('0x0'+V8A[0]+V8A[1]+V8A[2]);")
swig -c++ -javascript -node -DV8_VERSION=$V8 swig_VixenAUV.i
node-gyp configure
node-gyp build

#cd ../JavaScript
#npm install httpdispatcher

echo "- FINISHED -"
cd $scripts


text:
These settings apply only when `--csharp` is specified on the command line.
Please also specify `--csharp-sdks-folder=<path to "SDKs" directory of your azure-sdk-for-net clone>`.

```yaml $(csharp)
csharp:
  azure-arm: true
  license-header: MICROSOFT_MIT_NO_VERSION
  payload-flattening-threshold: 1
  clear-output-folder: true
  client-side-validation: false
  namespace: Microsoft.Azure.Management.ContainerApps
  output-folder: $(csharp-sdks-folder)/app/Microsoft.Azure.Management.ContainerApps/src/Generated
```


text:
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Erstellungszeit: 10. Apr 2017 um 17:10
-- Server-Version: 10.1.16-MariaDB
-- PHP-Version: 7.0.9

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Datenbank: `playbook`
--

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `answer`
--

CREATE TABLE `answer` (
  `answerId` int(11) NOT NULL,
  `fk_question` int(11) NOT NULL,
  `answerText` varchar(400) NOT NULL,
  `isCorrect` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `game`
--

CREATE TABLE `game` (
  `gameId` int(11) NOT NULL,
  `name` varchar(30) NOT NULL,
  `description` varchar(400) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `log_login`
--

CREATE TABLE `log_login` (
  `logId` int(11) NOT NULL,
  `fk_user` int(11) NOT NULL,
  `ip` int(35) NOT NULL,
  `loginDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `question`
--

CREATE TABLE `question` (
  `questionId` int(11) NOT NULL,
  `fk_topic` int(11) NOT NULL,
  `questionText` varchar(400) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `rankinglist`
--

CREATE TABLE `rankinglist` (
  `rankingListId` int(11) NOT NULL,
  `fk_game` int(11) NOT NULL,
  `fk_user` int(11) NOT NULL,
  `points` double NOT NULL,
  `gameDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `session`
--

CREATE TABLE `session` (
  `sessionId` int(11) NOT NULL,
  `fk_user` int(11) NOT NULL,
  `sessionKey` varchar(400) NOT NULL,
  `loginDate` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `topic`
--

CREATE TABLE `topic` (
  `topicId` int(11) NOT NULL,
  `name` varchar(30) NOT NULL,
  `description` varchar(400) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `user`
--

CREATE TABLE `user` (
  `userId` int(11) NOT NULL,
  `email` varchar(140) NOT NULL,
  `password` varchar(60) NOT NULL,
  `username` varchar(18) NOT NULL,
  `joinDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `active` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Not used',
  `admin` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Not used'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Indizes der exportierten Tabellen
--

--
-- Indizes für die Tabelle `answer`
--
ALTER TABLE `answer`
  ADD PRIMARY KEY (`answerId`);

--
-- Indizes für die Tabelle `game`
--
ALTER TABLE `game`
  ADD PRIMARY KEY (`gameId`);

--
-- Indizes für die Tabelle `log_login`
--
ALTER TABLE `log_login`
  ADD PRIMARY KEY (`logId`);

--
-- Indizes für die Tabelle `question`
--
ALTER TABLE `question`
  ADD PRIMARY KEY (`questionId`);

--
-- Indizes für die Tabelle `rankinglist`
--
ALTER TABLE `rankinglist`
  ADD PRIMARY KEY (`rankingListId`);

--
-- Indizes für die Tabelle `session`
--
ALTER TABLE `session`
  ADD PRIMARY KEY (`sessionId`);

--
-- Indizes für die Tabelle `topic`
--
ALTER TABLE `topic`
  ADD PRIMARY KEY (`topicId`);

--
-- Indizes für die Tabelle `user`
--
ALTER TABLE `user`
  ADD PRIMARY KEY (`userId`),
  ADD UNIQUE KEY `email` (`email`),
  ADD UNIQUE KEY `username` (`username`);

--
-- AUTO_INCREMENT für exportierte Tabellen
--

--
-- AUTO_INCREMENT für Tabelle `answer`
--
ALTER TABLE `answer`
  MODIFY `answerId` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT für Tabelle `game`
--
ALTER TABLE `game`
  MODIFY `gameId` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT für Tabelle `log_login`
--
ALTER TABLE `log_login`
  MODIFY `logId` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT für Tabelle `question`
--
ALTER TABLE `question`
  MODIFY `questionId` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT für Tabelle `rankinglist`
--
ALTER TABLE `rankinglist`
  MODIFY `rankingListId` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT für Tabelle `session`
--
ALTER TABLE `session`
  MODIFY `sessionId` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT für Tabelle `topic`
--
ALTER TABLE `topic`
  MODIFY `topicId` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT für Tabelle `user`
--
ALTER TABLE `user`
  MODIFY `userId` int(11) NOT NULL AUTO_INCREMENT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;


text:
using base::ASCIIToUTF16;

namespace autofill {

class AddressFieldTest : public testing::Test {
 public:
  AddressFieldTest() {}

 protected:
  std::vector<std::unique_ptr<AutofillField>> list_;
  std::unique_ptr<AddressField> field_;
  FieldCandidatesMap field_candidates_map_;

  // Downcast for tests.
  static std::unique_ptr<AddressField> Parse(AutofillScanner* scanner) {
    std::unique_ptr<FormField> field = AddressField::Parse(scanner);
    return base::WrapUnique(static_cast<AddressField*>(field.release()));
  }

 private:
  DISALLOW_COPY_AND_ASSIGN(AddressFieldTest);
};

TEST_F(AddressFieldTest, Empty) {
  AutofillScanner scanner(list_);
  field_ = Parse(&scanner);
  ASSERT_EQ(nullptr, field_.get());
}

TEST_F(AddressFieldTest, NonParse) {
  list_.push_back(base::MakeUnique<AutofillField>());
  AutofillScanner scanner(list_);
  field_ = Parse(&scanner);
  ASSERT_EQ(nullptr, field_.get());
}

TEST_F(AddressFieldTest, ParseOneLineAddress) {
  FormFieldData field;
  field.form_control_type = "text";

  field.label = ASCIIToUTF16("Address");
  field.name = ASCIIToUTF16("address");
  list_.push_back(
      base::MakeUnique<AutofillField>(field, ASCIIToUTF16("addr1")));

  AutofillScanner scanner(list_);
  field_ = Parse(&scanner);
  ASSERT_NE(nullptr, field_.get());
  field_->AddClassifications(&field_candidates_map_);
  ASSERT_TRUE(field_candidates_map_.find(ASCIIToUTF16("addr1")) !=
              field_candidates_map_.end());
  EXPECT_EQ(ADDRESS_HOME_LINE1,
            field_candidates_map_[ASCIIToUTF16("addr1")].BestHeuristicType());
}

TEST_F(AddressFieldTest, ParseTwoLineAddress) {
  FormFieldData field;
  field.form_control_type = "text";

  field.label = ASCIIToUTF16("Address");
  field.name = ASCIIToUTF16("address");
  list_.push_back(
      base::MakeUnique<AutofillField>(field, ASCIIToUTF16("addr1")));

  field.label = base::string16();
  field.name = ASCIIToUTF16("address2");
  list_.push_back(
      base::MakeUnique<AutofillField>(field, ASCIIToUTF16("addr2")));

  AutofillScanner scanner(list_);
  field_ = Parse(&scanner);
  ASSERT_NE(nullptr, field_.get());
  field_->AddClassifications(&field_candidates_map_);
  ASSERT_TRUE(field_candidates_map_.find(ASCIIToUTF16("addr1")) !=
              field_candidates_map_.end());
  EXPECT_EQ(ADDRESS_HOME_LINE1,
            field_candidates_map_[ASCIIToUTF16("addr1")].BestHeuristicType());
  ASSERT_TRUE(field_candidates_map_.find(ASCIIToUTF16("addr2")) !=
              field_candidates_map_.end());
  EXPECT_EQ(ADDRESS_HOME_LINE2,
            field_candidates_map_[ASCIIToUTF16("addr2")].BestHeuristicType());
}

TEST_F(AddressFieldTest, ParseThreeLineAddress) {
  FormFieldData field;
  field.form_control_type = "text";

  field.label = ASCIIToUTF16("Address Line1");
  field.name = ASCIIToUTF16("Address1");
  list_.push_back(
      base::MakeUnique<AutofillField>(field, ASCIIToUTF16("addr1")));

  field.label = ASCIIToUTF16("Address Line2");
  field.name = ASCIIToUTF16("Address2");
  list_.push_back(
      base::MakeUnique<AutofillField>(field, ASCIIToUTF16("addr2")));

  field.label = ASCIIToUTF16("Address Line3");
  field.name = ASCIIToUTF16("Address3");
  list_.push_back(
      base::MakeUnique<AutofillField>(field, ASCIIToUTF16("addr3")));

  AutofillScanner scanner(list_);
  field_ = Parse(&scanner);
  ASSERT_NE(nullptr, field_.get());
  field_->AddClassifications(&field_candidates_map_);
  ASSERT_TRUE(field_candidates_map_.find(ASCIIToUTF16("addr1")) !=
              field_candidates_map_.end());
  EXPECT_EQ(ADDRESS_HOME_LINE1,
            field_candidates_map_[ASCIIToUTF16("addr1")].BestHeuristicType());
  ASSERT_TRUE(field_candidates_map_.find(ASCIIToUTF16("addr2")) !=
              field_candidates_map_.end());
  EXPECT_EQ(ADDRESS_HOME_LINE2,
            field_candidates_map_[ASCIIToUTF16("addr2")].BestHeuristicType());
  ASSERT_TRUE(field_candidates_map_.find(ASCIIToUTF16("addr3")) !=
              field_candidates_map_.end());
  EXPECT_EQ(ADDRESS_HOME_LINE3,
            field_candidates_map_[ASCIIToUTF16("addr3")].BestHeuristicType());
}

TEST_F(AddressFieldTest, ParseStreetAddressFromTextArea) {
  FormFieldData field;
  field.form_control_type = "textarea";

  field.label = ASCIIToUTF16("Address");
  field.name = ASCIIToUTF16("address");
  list_.push_back(base::MakeUnique<AutofillField>(field, ASCIIToUTF16("addr")));

  AutofillScanner scanner(list_);
  field_ = Parse(&scanner);
  ASSERT_NE(nullptr, field_.get());
  field_->AddClassifications(&field_candidates_map_);
  ASSERT_TRUE(field_candidates_map_.find(ASCIIToUTF16("addr")) !=
              field_candidates_map_.end());
  EXPECT_EQ(ADDRESS_HOME_STREET_ADDRESS,
            field_candidates_map_[ASCIIToUTF16("addr")].BestHeuristicType());
}

TEST_F(AddressFieldTest, ParseCity) {
  FormFieldData field;
  field.form_control_type = "text";

  field.label = ASCIIToUTF16("City");
  field.name = ASCIIToUTF16("city");
  list_.push_back(
      base::MakeUnique<AutofillField>(field, ASCIIToUTF16("city1")));

  AutofillScanner scanner(list_);
  field_ = Parse(&scanner);
  ASSERT_NE(nullptr, field_.get());
  field_->AddClassifications(&field_candidates_map_);
  ASSERT_TRUE(field_candidates_map_.find(ASCIIToUTF16("city1")) !=
              field_candidates_map_.end());
  EXPECT_EQ(ADDRESS_HOME_CITY,
            field_candidates_map_[ASCIIToUTF16("city1")].BestHeuristicType());
}

TEST_F(AddressFieldTest, ParseState) {
  FormFieldData field;
  field.form_control_type = "text";

  field.label = ASCIIToUTF16("State");
  field.name = ASCIIToUTF16("state");
  list_.push_back(
      base::MakeUnique<AutofillField>(field, ASCIIToUTF16("state1")));

  AutofillScanner scanner(list_);
  field_ = Parse(&scanner);
  ASSERT_NE(nullptr, field_.get());
  field_->AddClassifications(&field_candidates_map_);
  ASSERT_TRUE(field_candidates_map_.find(ASCIIToUTF16("state1")) !=
              field_candidates_map_.end());
  EXPECT_EQ(ADDRESS_HOME_STATE,
            field_candidates_map_[ASCIIToUTF16("state1")].BestHeuristicType());
}

TEST_F(AddressFieldTest, ParseZip) {
  FormFieldData field;
  field.form_control_type = "text";

  field.label = ASCIIToUTF16("Zip");
  field.name = ASCIIToUTF16("zip");
  list_.push_back(base::MakeUnique<AutofillField>(field, ASCIIToUTF16("zip1")));

  AutofillScanner scanner(list_);
  field_ = Parse(&scanner);
  ASSERT_NE(nullptr, field_.get());
  field_->AddClassifications(&field_candidates_map_);
  ASSERT_TRUE(field_candidates_map_.find(ASCIIToUTF16("zip1")) !=
              field_candidates_map_.end());
  EXPECT_EQ(ADDRESS_HOME_ZIP,
            field_candidates_map_[ASCIIToUTF16("zip1")].BestHeuristicType());
}

TEST_F(AddressFieldTest, ParseStateAndZipOneLabel) {
  FormFieldData field;
  field.form_control_type = "text";

  field.label = ASCIIToUTF16("State/Province, Zip/Postal Code");
  field.name = ASCIIToUTF16("state");
  list_.push_back(
      base::MakeUnique<AutofillField>(field, ASCIIToUTF16("state")));

  field.label = ASCIIToUTF16("State/Province, Zip/Postal Code");
  field.name = ASCIIToUTF16("zip");
  list_.push_back(base::MakeUnique<AutofillField>(field, ASCIIToUTF16("zip")));

  AutofillScanner scanner(list_);
  field_ = Parse(&scanner);
  ASSERT_NE(nullptr, field_.get());
  field_->AddClassifications(&field_candidates_map_);
  ASSERT_TRUE(field_candidates_map_.find(ASCIIToUTF16("state")) !=
              field_candidates_map_.end());
  EXPECT_EQ(ADDRESS_HOME_STATE,
            field_candidates_map_[ASCIIToUTF16("state")].BestHeuristicType());
  ASSERT_TRUE(field_candidates_map_.find(ASCIIToUTF16("zip")) !=
              field_candidates_map_.end());
  EXPECT_EQ(ADDRESS_HOME_ZIP,
            field_candidates_map_[ASCIIToUTF16("zip")].BestHeuristicType());
}

TEST_F(AddressFieldTest, ParseCountry) {
  FormFieldData field;
  field.form_control_type = "text";

  field.label = ASCIIToUTF16("Country");
  field.name = ASCIIToUTF16("country");
  list_.push_back(
      base::MakeUnique<AutofillField>(field, ASCIIToUTF16("country1")));

  AutofillScanner scanner(list_);
  field_ = Parse(&scanner);
  ASSERT_NE(nullptr, field_.get());
  field_->AddClassifications(&field_candidates_map_);
  ASSERT_TRUE(field_candidates_map_.find(ASCIIToUTF16("country1")) !=
              field_candidates_map_.end());
  EXPECT_EQ(
      ADDRESS_HOME_COUNTRY,
      field_candidates_map_[ASCIIToUTF16("country1")].BestHeuristicType());
}

TEST_F(AddressFieldTest, ParseCompany) {
  FormFieldData field;
  field.form_control_type = "text";

  field.label = ASCIIToUTF16("Company");
  field.name = ASCIIToUTF16("company");
  list_.push_back(
      base::MakeUnique<AutofillField>(field, ASCIIToUTF16("company1")));

  AutofillScanner scanner(list_);
  field_ = Parse(&scanner);
  ASSERT_NE(nullptr, field_.get());
  field_->AddClassifications(&field_candidates_map_);
  ASSERT_TRUE(field_candidates_map_.find(ASCIIToUTF16("company1")) !=
              field_candidates_map_.end());
  EXPECT_EQ(
      COMPANY_NAME,
      field_candidates_map_[ASCIIToUTF16("company1")].BestHeuristicType());
}

}  // namespace autofill


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

<TITLE>
org.apache.hadoop.mapred.join (Hadoop 0.20.2-cdh3u0 API)
</TITLE>

<META NAME="date" CONTENT="2011-03-25">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

Package org.apache.hadoop.mapred.join

Given a set of sorted datasets keyed with the same class and yielding equal
partitions, it is possible to effect a join of those datasets prior to the map.

See:

          Description

Interface Summary

ComposableInputFormat<K extends WritableComparable,V extends Writable>
Refinement of InputFormat requiring implementors to provide
 ComposableRecordReader instead of RecordReader.

ComposableRecordReader<K extends WritableComparable,V extends Writable>
Additional operations required of a RecordReader to participate in a join.

ResetableIterator<T extends Writable>
This defines an interface to a stateful Iterator that can replay elements
 added to it directly.

Class Summary

ArrayListBackedIterator<X extends Writable>
This class provides an implementation of ResetableIterator.

CompositeInputFormat<K extends WritableComparable>
An InputFormat capable of performing joins over a set of data sources sorted
 and partitioned the same way.

CompositeInputSplit
This InputSplit contains a set of child InputSplits.

CompositeRecordReader<K extends WritableComparable,V extends Writable,X extends Writable>
A RecordReader that can effect joins of RecordReaders sharing a common key
 type and partitioning.

InnerJoinRecordReader<K extends WritableComparable>
Full inner join.

JoinRecordReader<K extends WritableComparable>
Base class for Composite joins returning Tuples of arbitrary Writables.

MultiFilterRecordReader<K extends WritableComparable,V extends Writable>
Base class for Composite join returning values derived from multiple
 sources, but generally not tuples.

OuterJoinRecordReader<K extends WritableComparable>
Full outer join.

OverrideRecordReader<K extends WritableComparable,V extends Writable>
Prefer the "rightmost" data source for this key.

Parser
Very simple shift-reduce parser for join expressions.

Parser.Node

Parser.NodeToken

Parser.NumToken

Parser.StrToken

Parser.Token
Tagged-union type for tokens from the join expression.

ResetableIterator.EMPTY<U extends Writable>

StreamBackedIterator<X extends Writable>
This class provides an implementation of ResetableIterator.

TupleWritable
Writable type storing multiple Writables.

WrappedRecordReader<K extends WritableComparable,U extends Writable>
Proxy class for a RecordReader participating in the join framework.

Enum Summary

Parser.TType

Package org.apache.hadoop.mapred.join Description

Given a set of sorted datasets keyed with the same class and yielding equal
partitions, it is possible to effect a join of those datasets prior to the map.
This could save costs in re-partitioning, sorting, shuffling, and writing out
data required in the general case.

Interface

The attached code offers the following interface to users of these
classes.

property	required	value

mapred.join.expr	yes
    Join expression to effect over input data

mapred.join.keycomparator	no
    <tt>WritableComparator</tt> class to use for comparing keys

mapred.join.define.<ident>	no
    Class mapped to identifier in join expression

The join expression understands the following grammar:

func ::= <ident>([<func>,]*<func>)
func ::= tbl(<class>,"<path>");

Operations included in this patch are partitioned into one of two types:
join operations emitting tuples and "multi-filter" operations emitting a
single value from (but not necessarily included in) a set of input values.
For a given key, each operation will consider the cross product of all
values for all sources at that node.

Identifiers supported by default:

identifier	type	description

inner	Join	Full inner join

outer	Join	Full outer join

override	MultiFilter
    For a given key, prefer values from the rightmost source

A user of this class must set the <tt>InputFormat</tt> for the job to
<tt>CompositeInputFormat</tt> and define a join expression accepted by the
preceding grammar. For example, both of the following are acceptable:

inner(tbl(org.apache.hadoop.mapred.SequenceFileInputFormat.class,
          "hdfs://host:8020/foo/bar"),
      tbl(org.apache.hadoop.mapred.SequenceFileInputFormat.class,
          "hdfs://host:8020/foo/baz"))

outer(override(tbl(org.apache.hadoop.mapred.SequenceFileInputFormat.class,
                   "hdfs://host:8020/foo/bar"),
               tbl(org.apache.hadoop.mapred.SequenceFileInputFormat.class,
                   "hdfs://host:8020/foo/baz")),
      tbl(org.apache.hadoop.mapred/SequenceFileInputFormat.class,
          "hdfs://host:8020/foo/rab"))

<tt>CompositeInputFormat</tt> includes a handful of convenience methods to
aid construction of these verbose statements.

As in the second example, joins may be nested. Users may provide a
comparator class in the <tt>mapred.join.keycomparator</tt> property to specify
the ordering of their keys, or accept the default comparator as returned by
<tt>WritableComparator.get(keyclass)</tt>.

Users can specify their own join operations, typically by overriding
<tt>JoinRecordReader</tt> or <tt>MultiFilterRecordReader</tt> and mapping that
class to an identifier in the join expression using the
<tt>mapred.join.define.ident</tt> property, where ident is
the identifier appearing in the join expression. Users may elect to emit- or
modify- values passing through their join operation. Consulting the existing
operations for guidance is recommended. Adding arguments is considerably more
complex (and only partially supported), as one must also add a <tt>Node</tt>
type to the parse tree. One is probably better off extending
<tt>RecordReader</tt> in most cases.

JIRA

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

Copyright © 2009 The Apache Software Foundation


text:
from datetime import datetime, timedelta

from croniter import croniter
from croniter.tests import base

class CroniterRandomTest(base.TestCase):
    epoch = datetime(2020, 1, 1, 0, 0)

    def test_random(self):
        """Test random definition"""
        obj = croniter('R R * * *', self.epoch)
        result_1 = obj.get_next(datetime)
        self.assertGreaterEqual(result_1, datetime(2020, 1, 1, 0, 0))
        self.assertLessEqual(result_1, datetime(2020, 1, 1, 0, 0) + timedelta(days=1))
        result_2 = obj.get_next(datetime)
        self.assertGreaterEqual(result_2, datetime(2020, 1, 2, 0, 0))
        self.assertLessEqual(result_2, datetime(2020, 1, 2, 0, 0) + timedelta(days=1))

    def test_random_range(self):
        """Test random definition within a range"""
        obj = croniter('R R R(10-20) * *', self.epoch)
        result_1 = obj.get_next(datetime)
        self.assertGreaterEqual(result_1, datetime(2020, 1, 10, 0, 0))
        self.assertLessEqual(result_1, datetime(2020, 1, 10, 0, 0) + timedelta(days=11))
        result_2 = obj.get_next(datetime)
        self.assertGreaterEqual(result_2, datetime(2020, 2, 10, 0, 0))
        self.assertLessEqual(result_2, datetime(2020, 2, 10, 0, 0) + timedelta(days=11))

    def test_random_float(self):
        """Test random definition, float result"""
        obj = croniter('R R * * *', self.epoch)
        result_1 = obj.get_next(float)
        self.assertGreaterEqual(result_1, 1577836800.0)
        self.assertLessEqual(result_1, 1577836800.0 + (60 * 60 * 24))
        result_2 = obj.get_next(float)
        self.assertGreaterEqual(result_2, 1577923200.0)
        self.assertLessEqual(result_2, 1577923200.0 + (60 * 60 * 24))


text:
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var preact_1 = require("preact");
var nodeDetail_1 = require("./nodeDetail");
var flowArrow_1 = require("./flowArrow");
var NodePaths = (function (_super) {
    __extends(NodePaths, _super);
    function NodePaths() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.state = {
            retained: [],
            enterExit: []
        };
        return _this;
    }
    NodePaths.prototype.componentDidMount = function () {
        var trans = this.props.transition;
        var tcPaths = Object.assign({}, trans.treeChanges());
        // Ignore the root state when drawing paths.
        ["entering", "exiting", "retained"]
            .forEach(function (key) { return tcPaths[key] = tcPaths[key].filter(function (node) { return !!node.state.name; }); });
        var partialKey = function (pathname, idx) {
            var node = tcPaths[pathname][idx];
            return node ? node.state.name : "";
        };
        var key = function (pathname1, pathname2, idx) {
            return trans.$id + "." + partialKey(pathname1, idx) + "-" + partialKey(pathname2, idx);
        };
        var retained = tcPaths.retained
            .map(function (node, idx) { return ({ key: key('retained', 'retained', idx), to: node, toType: 'retain', from: node, fromType: 'retain' }); });
        var enterExit = [];
        var maxPathLength = Math.max(tcPaths.exiting.length, tcPaths.entering.length);
        for (var i = 0; i < maxPathLength; i++) {
            enterExit.push({
                key: key('exiting', 'entering', i),
                to: tcPaths.entering[i],
                toType: tcPaths.entering[i] && 'enter',
                from: tcPaths.exiting[i],
                fromType: tcPaths.exiting[i] && 'exit'
            });
        }
        this.setState({ retained: retained, enterExit: enterExit });
    };
    NodePaths.prototype.render = function () {
        var height = 2000;
        var retained = this.state.retained || [];
        var enterExit = this.state.enterExit || [];
        var lastEnterIdx = enterExit.filter(function (x) { return !!x.toType; }).length - 1;
        return (preact_1.h("table", { className: "paths" },
            preact_1.h("thead", null,
                preact_1.h("tr", null,
                    preact_1.h("th", null, "From Path"),
                    preact_1.h("th", null, "To Path"))),
            preact_1.h("tbody", null,
                retained.map(function (elem) {
                    return preact_1.h("tr", { key: elem.key },
                        preact_1.h("td", { className: elem.fromType, colSpan: 2 },
                            preact_1.h(nodeDetail_1.NodeDetail, { node: elem.from, type: elem.fromType })));
                }),
                enterExit.map(function (elem, idx) {
                    return preact_1.h("tr", { key: elem.key },
                        preact_1.h("td", { colSpan: 2 },
                            preact_1.h("div", { className: "uirTransVisRow" },
                                preact_1.h("div", { className: "" + elem.fromType }, !elem.fromType ? null :
                                    preact_1.h("div", null,
                                        preact_1.h("div", { className: "uirNodeContent" },
                                            preact_1.h(nodeDetail_1.NodeDetail, { node: elem.from, type: elem.fromType }),
                                            preact_1.h(flowArrow_1.FlowArrow, { bottom: 'V', top: idx ? 'V' : elem.toType ? 'RU' : 'AU' })))),
                                preact_1.h("div", { className: "" + elem.toType }, !elem.toType ? null :
                                    preact_1.h("div", null,
                                        preact_1.h("div", { className: "uirNodeContent" },
                                            preact_1.h(flowArrow_1.FlowArrow, { top: idx ? 'V' : elem.fromType ? 'RD' : 'V', bottom: idx == lastEnterIdx ? 'AD' : 'V' }),
                                            preact_1.h(nodeDetail_1.NodeDetail, { node: elem.to, type: elem.toType })))))));
                }))));
    };
    return NodePaths;
}(preact_1.Component));
exports.NodePaths = NodePaths;
//# sourceMappingURL=nodePaths.js.map


text:
using System.Collections.Generic;
using System.Linq.Expressions;
using MvcContrib.FluentHtml.Behaviors;

namespace MvcContrib.FluentHtml.Elements
{
	/// <summary>
	/// Generate a literal (text inside a span element).
	/// </summary>
	public class Literal : LiteralBase<Literal>
	{
		/// <summary>
		/// Generates a literal element (span).
		/// </summary>
		/// <param name="name">The name of the element.</param>
		/// <param name="forMember">Expression indicating the view model member assocaited with the element</param>
		/// <param name="behaviors">Behaviors to apply to the element</param>
		public Literal(string name, MemberExpression forMember, IEnumerable<IBehaviorMarker> behaviors) :
			base(name, forMember, behaviors) { }

		/// <summary>
		/// Generates a literal element (span).
		/// </summary>
		/// <param name="name">The name of the element.</param>
		public Literal(string name) : base(name) { }
	}
}


text:
layout: es_post
title: Google sincroniza contactos y calendario con su iPhone/iPod Touch
created: 1235657180
categories: Personal
tags: ['ipod touch', 'contactos', 'google', 'gmail', 'iphone', 'sync', 'calendario', 'synchronizar']
language: es
permalink: es/2009/02/26/google-sincroniza-contactos-y-calendario-su-iphoneipod-touch-11/
thumbnail: http://www.profesional.co.cr/sites/files/sync-48x48.gif
translation: 2009/02/26/google-synchronize-calendar-and-contacts-your-iphoneipod-touch-10/
---
Google ha creado una interfaz de exchange para habilitar la sincronización entre sus contactos de Gmail y calendarios con su iPhone/iPod Touch. Enterese aquí: [Google Sync](http://www.google.com/mobile/apple/sync.html)

{{ '/sites/files/sync-48x48.gif' | img_tag: 'main-article-image', '', 'Google Sync Calendar Contacts with iPhone/iPod Touch', 48, 48 }}

{{ '/sites/files/mobile_138740f_en.gif' | img_tag: 'article-image', '', 'Google Sync Calendar Contacts with iPhone/iPod Touch Warning erase data', 192, 282 }}

__Advertencia:__ En su primera sincronización con su iPhone/iPod Touch la información va a ser borrada, así que asegurese de respaldar la información en el Outlook o alguna aplicación similar.

Esto brinda la posibilidad de sincronizar sus contactos y calendario sin tener que conectar su iPhone/iPod Touch a la computadora y si la necesidad de aplicaciones adicionales.
En mi caso, he estado usando el NemusSync (una applicación del jailbreak para sincronizar el calendario con el iPhone/iPod Touch) y el iTunes para sincronizar los contactos con Gmail, pero ahora esto abre una nueva, más confiable y sencilla forma de sincronizar.
También hay que tomar en cuenta que la configuración de esta interfaz no sincroniza el correo (para esto siga utilizando como lo ha hecho antes, por medio de la configuración normal de Gmail).

_Recuerde respaldar su información._

{{ '/sites/files/mobile_138740d_en.gif' | img_tag: 'article-image', '', 'Google Sync Calendar Contacts with iPhone/iPod Touch', 192, 282 }}
{{ '/sites/files/mobile_138740d_en.gif' | img_tag: 'article-image', '', 'Google Sync Calendar Contacts with iPhone/iPod Touch', 192, 282 }}


text:
Apache Ignite

__________________
- [https://ignite.apache.org/index.html](https://ignite.apache.org/index.html)

- [http://ignite.incubator.apache.org/](http://ignite.incubator.apache.org/)
- [https://dzone.com/articles/apache-ignite-word-count](https://dzone.com/articles/apache-ignite-word-count)

## 讨论

- [https://issues.apache.org/jira/browse/IGNITE-1255](https://issues.apache.org/jira/browse/IGNITE-1255) 我提的问题。问题答复仔细看看。
- [http://apache-ignite-users.70518.x6.nabble.com/](http://apache-ignite-users.70518.x6.nabble.com/) 上面回复者给出:提问题的最新处
- [http://apacheignite.gridgain.org/v1.0/discuss](http://apacheignite.gridgain.org/v1.0/discuss)


text:
#ifndef _STLP_BOOST_TYPE_TRAITS_H
#define _STLP_BOOST_TYPE_TRAITS_H

#ifndef BOOST_CONFIG_SUFFIX_HPP
#  ifdef BOOST_CONFIG_HPP
#    undef BOOST_CONFIG_HPP
#  endif
#  include <boost/config.hpp>
#endif

#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_float.hpp>
#include <boost/type_traits/has_trivial_constructor.hpp>
#include <boost/type_traits/has_trivial_copy.hpp>
#include <boost/type_traits/has_trivial_assign.hpp>
#include <boost/type_traits/has_trivial_destructor.hpp>
#include <boost/type_traits/is_pod.hpp>
#include <boost/type_traits/is_pointer.hpp>
#include <boost/type_traits/is_reference.hpp>
#include <boost/type_traits/remove_cv.hpp>
#include <boost/type_traits/is_same.hpp>

/*
 * This file mostly wraps boost type_traits in the STLport type_traits.
 * When checking a type traits like trivial assign operator for instance
 * both the boost value and STLport values has to be taken into account
 * as we don't know what the user might have prefer, specializing the boost
 * type traits or the STLport one.
 */
_STLP_BEGIN_NAMESPACE

template <class _Tp> struct _IsRef {
  enum { _Is = ::boost::is_reference<_Tp>::value };
  typedef typename __bool2type<_Is>::_Ret _Ret;
};

template <class _Tp> struct _IsPtr {
  enum { is_pointer = ::boost::is_pointer<_Tp>::value };
  typedef typename __bool2type<is_pointer>::_Ret _Ret;
};

template <class _Tp> struct _IsIntegral {
  enum { is_integral = ::boost::is_integral<_Tp>::value };
  typedef typename __bool2type<is_integral>::_Ret _Ret;
};

template <class _Tp> struct _IsRational {
  enum { is_float = ::boost::is_float<_Tp>::value };
  typedef typename __bool2type<is_float>::_Ret _Ret;
};

template <class _Tp>
struct __type_traits {
  enum { trivial_constructor = ::boost::has_trivial_constructor<_Tp>::value };
  typedef typename __bool2type<trivial_constructor>::_Ret has_trivial_default_constructor;

  enum { trivial_copy = ::boost::has_trivial_copy<_Tp>::value };
  typedef typename __bool2type<trivial_copy>::_Ret has_trivial_copy_constructor;

  enum { trivial_assign = ::boost::has_trivial_assign<_Tp>::value };
  typedef typename __bool2type<trivial_assign>::_Ret has_trivial_assignment_operator;

  enum { trivial_destructor = ::boost::has_trivial_destructor<_Tp>::value };
  typedef typename __bool2type<trivial_destructor>::_Ret has_trivial_destructor;

  enum { pod = ::boost::is_pod<_Tp>::value };
  typedef typename __bool2type<pod>::_Ret is_POD_type;
};

template <class _Tp1, class _Tp2>
struct _TrivialCopy {
  typedef typename ::boost::remove_cv<_Tp1>::type uncv1;
  typedef typename ::boost::remove_cv<_Tp2>::type uncv2;

  enum { same = ::boost::is_same<uncv1, uncv2>::value };
  typedef typename __bool2type<same>::_Ret _Same;

  enum { boost_trivial_assign = ::boost::has_trivial_assign<uncv1>::value };
  typedef typename __bool2type<boost_trivial_assign>::_Ret _BoostTrivialAssign;
  typedef typename __type_traits<uncv1>::has_trivial_assignment_operator _STLPTrivialAssign;
  typedef typename _Lor2<_BoostTrivialAssign, _STLPTrivialAssign>::_Ret _TrivialAssign;

  typedef typename _Land2<_Same, _TrivialAssign>::_Ret _Type;
  static _Type _Answer() { return _Type(); }
};

template <class _Tp1, class _Tp2>
struct _TrivialUCopy {
  typedef typename ::boost::remove_cv<_Tp1>::type uncv1;
  typedef typename ::boost::remove_cv<_Tp2>::type uncv2;

  enum { same = ::boost::is_same<uncv1, uncv2>::value };
  typedef typename __bool2type<same>::_Ret _Same;

  enum { boost_trivial_copy = ::boost::has_trivial_copy<uncv1>::value };
  typedef typename __bool2type<boost_trivial_copy>::_Ret _BoostTrivialCopy;
  typedef typename __type_traits<uncv1>::has_trivial_copy_constructor _STLPTrivialCopy;
  typedef typename _Lor2<_BoostTrivialCopy, _STLPTrivialCopy>::_Ret _TrivialCopy;

  typedef typename _Land2<_Same, _TrivialCopy>::_Ret _Type;
  static _Type _Answer() { return _Type(); }
};

template <class _Tp>
struct _DefaultZeroValue {
  enum { is_integral = ::boost::is_integral<_Tp>::value };
  typedef typename __bool2type<is_integral>::_Ret _IsIntegral;
  enum { is_float = ::boost::is_float<_Tp>::value };
  typedef typename __bool2type<is_float>::_Ret _IsFloat;
  enum { is_pointer = ::boost::is_pointer<_Tp>::value };
  typedef typename __bool2type<is_pointer>::_Ret _IsPointer;

  typedef typename _Lor3<_IsIntegral, _IsFloat, _IsPointer>::_Ret _Ret;
};

template <class _Tp>
struct _TrivialInit {
  typedef typename ::boost::remove_cv<_Tp>::type uncv;

  enum { boost_trivial_constructor = ::boost::has_trivial_constructor<uncv>::value };
  typedef typename __bool2type<boost_trivial_constructor>::_Ret _BoostTrivialInit;
  typedef typename __type_traits<uncv>::has_trivial_default_constructor _STLPTrivialInit;
  typedef typename _Lor2<_BoostTrivialInit, _STLPTrivialInit>::_Ret _Tr1;

  typedef typename _DefaultZeroValue<_Tp>::_Ret _Tr2;
  typedef typename _Not<_Tr2>::_Ret _Tr3;

  typedef typename _Land2<_Tr1, _Tr3>::_Ret _Ret;
  static _Ret _Answer() { return _Ret(); }
};

_STLP_END_NAMESPACE

#endif /* _STLP_BOOST_TYPE_TRAITS_H */


text:
This is for ic announcements.
Usage /announce
Output: Name announces text


text:
package secret_stash.controller;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;
import java.util.Set;

import secret_stash.model.StashData;
import secret_stash.view.EditView;
import secret_stash.view.LockedView;
import secret_stash.view.UnlockedView;
import secret_stash.view.ViewFrame;

public class Controller {

    private static final String STASH_PATH_PROP = "stash_at";
    private ViewFrame frame;
    private StashData stashData;
    private String stashFilePath;
    private String unlockPassword;
    private FileHandler fileHandler;
    private Properties props;

    public Controller(ViewFrame frame) {
        this.frame = frame;
        this.fileHandler = new FileHandler();
        try {
            this.props = fileHandler.parseConfig();
        } catch (FileNotFoundException e) {
            // no big deal; file just hasn't been created for the first time
            this.props = new Properties();
        } catch (IOException e) {
            e.printStackTrace(); // TODO maybe show warning?
            this.props = new Properties();
        }
    }

    // may return null if not found
    public String getStashPath() {
        return props.getProperty(STASH_PATH_PROP);
    }

    public boolean createStash(String path) throws Exception {
        return fileHandler.createStash(path);
    }

    public void lock() throws Exception {
        fileHandler.storeStash(stashFilePath, unlockPassword, stashData);
        frame.setView(new LockedView(this));
    }

    public void unlock(String filePath, String password) throws Exception {
        if (filePath.isEmpty())
            throw new Exception("Provide a path to a stash file");
        if (password.isEmpty())
            throw new Exception("No password given");

        try {
            props.setProperty(STASH_PATH_PROP, filePath);
            fileHandler.storeConfig(props);
        } catch (FileNotFoundException e) {
            props.remove(STASH_PATH_PROP);
            throw new Exception("Invalid stash file");
        } catch (IOException e) {
            props.remove(STASH_PATH_PROP);
            e.printStackTrace(); // TODO maybe show warning?
        }

//        try {
//            stashData = fileHandler.parseStash(filePath, password);
//        } catch (Exception e) {
//            throw new Exception("Unable to read stash file");
//        }
        stashData = fileHandler.parseStash(filePath, password);

        this.stashFilePath = filePath;
        this.unlockPassword = password;
        this.frame.setView(new UnlockedView(this));
    }

    public void add() {
        frame.setView(new EditView(this));
    }

    public void edit(String name) {
        String[] data = stashData.getValues(name);
        frame.setView(new EditView(this, name, data[0], data[1]));
    }

    public void update(String name,
                       String username,
                       String password) throws Exception {
        if (name.isEmpty())
            throw new Exception("Provide a name.");
        if (username.isEmpty())
            throw new Exception("Provide a username");
        if (password.isEmpty())
            throw new Exception("Provide a password");

        stashData.update(name, username, password);
        frame.setView(new UnlockedView(this));
    }

    // caller should update view immediately after this call
    public void remove(String name) {
        stashData.remove(name);
    }

    // called by view when it's time to return to menu
    public void cancel() {
        frame.setView(new UnlockedView(this));
    }

    // TODO finish implementing me
    public void help() {
        frame.dialog("No help yet.");
    }

    public Set<String> getNames() {
        return stashData.getNames();
    }
}


text:
@interface TGCameraViewController () <UIImagePickerControllerDelegate, UINavigationControllerDelegate>

@property (strong, nonatomic) IBOutlet UIView *captureView;
@property (strong, nonatomic) IBOutlet UIImageView *topLeftView;
@property (strong, nonatomic) IBOutlet UIImageView *topRightView;
@property (strong, nonatomic) IBOutlet UIImageView *bottomLeftView;
@property (strong, nonatomic) IBOutlet UIImageView *bottomRightView;
@property (strong, nonatomic) IBOutlet UIView *separatorView;
@property (strong, nonatomic) IBOutlet UIView *actionsView;
@property (strong, nonatomic) IBOutlet UIButton *gridButton;
@property (strong, nonatomic) IBOutlet UIButton *toggleButton;
@property (strong, nonatomic) IBOutlet UIButton *shotButton;
@property (strong, nonatomic) IBOutlet TGTintedButton *albumButton;
@property (strong, nonatomic) IBOutlet UIButton *flashButton;
@property (strong, nonatomic) IBOutlet TGCameraSlideView *slideUpView;
@property (strong, nonatomic) IBOutlet TGCameraSlideView *slideDownView;
@property (strong, nonatomic) IBOutlet UIImageView *shotOutline;
@property (weak, nonatomic) IBOutlet UIView *squareCaptureView;
@property (weak, nonatomic) IBOutlet UIView *topView;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *topViewHeight;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *toggleButtonWidth;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *topLeftViewTopConstraint;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *topRightViewTopConstraint;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottomRightBottomConstraint;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottomLeftBottomConstraint;

@property (strong, nonatomic) TGCamera *camera;
@property (nonatomic) BOOL wasLoaded;
@property (nonatomic) UIDeviceOrientation deviceOrientation;
@property (nonatomic) BOOL landscapeViewMode;

- (IBAction)closeTapped;
- (IBAction)gridTapped;
- (IBAction)flashTapped;
- (IBAction)shotTapped;
- (IBAction)albumTapped;
- (IBAction)toggleTapped;

- (IBAction)handleTapGesture:(UITapGestureRecognizer *)recognizer;

- (void)deviceOrientationDidChangeNotification;
- (void)latestPhoto;
- (AVCaptureVideoOrientation)videoOrientationForDeviceOrientation:(UIDeviceOrientation)deviceOrientation;
- (void)viewWillDisappearWithCompletion:(void (^)(void))completion;

@end

@implementation TGCameraViewController

- (void)viewDidLoad {
    NSLog(@"%s",__FUNCTION__);

    [super viewDidLoad];

    if (CGRectGetHeight([[UIScreen mainScreen] bounds]) <= 480) {
        _topViewHeight.constant = 0;
    }

    if ([[TGCamera getOption:kTGCameraOptionHiddenToggleButton] boolValue] == YES) {
        _toggleButton.hidden = YES;
        _toggleButtonWidth.constant = 0;
    }

    [self setupAlbumButton];

    _camera = [TGCamera cameraWithFlashButton:_flashButton];

    _captureView.backgroundColor = [UIColor clearColor];

    _topLeftView.transform = CGAffineTransformMakeRotation(0);
    _topRightView.transform = CGAffineTransformMakeRotation(M_PI_2);
    _bottomLeftView.transform = CGAffineTransformMakeRotation(-M_PI_2);
    _bottomRightView.transform = CGAffineTransformMakeRotation(M_PI_2*2);

    // get the latest image from the album
    [self latestPhoto];
}

- (void)viewWillAppear:(BOOL)animated {
    NSLog(@"%s",__FUNCTION__);

    [super viewWillAppear:animated];

    dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void){
        [_camera startRunning];

        dispatch_async(dispatch_get_main_queue(), ^(void){
            _separatorView.hidden = YES;

            if (_wasLoaded == NO) {
                _wasLoaded = YES;
                [_camera insertSublayerWithCaptureView:_captureView atRootView:self.view];
            }else{
                [TGCameraSlideView hideSlideUpView:_slideUpView slideDownView:_slideDownView atView:_captureView completion:^{
                }];
            }
        });
    });

    _shotButton.enabled = YES;
    _shotOutline.hidden = NO;
    _albumButton.enabled = YES;
    _actionsView.hidden = NO;
}

- (void)viewDidAppear:(BOOL)animated {
    NSLog(@"%s",__FUNCTION__);

    [super viewDidAppear:animated];

    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(deviceOrientationDidChangeNotification)
                                                 name:UIDeviceOrientationDidChangeNotification
                                               object:nil];

    [self deviceOrientationDidChangeNotification];
}

- (void)viewDidDisappear:(BOOL)animated {
    [super viewDidDisappear:animated];

    [[NSNotificationCenter defaultCenter] removeObserver:self];

    [_camera stopRunning];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

- (BOOL)prefersStatusBarHidden {
    return YES;
}

- (void)dealloc {
    _captureView = nil;
    _topLeftView = nil;
    _topRightView = nil;
    _bottomLeftView = nil;
    _bottomRightView = nil;
    _separatorView = nil;
    _actionsView = nil;
    _gridButton = nil;
    _toggleButton = nil;
    _shotButton = nil;
    _albumButton = nil;
    _flashButton = nil;
    _slideUpView = nil;
    _slideDownView = nil;
    _camera = nil;
}

#pragma mark -
#pragma mark - UIImagePickerControllerDelegate

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
    UIImage *photo = [TGAlbum imageWithMediaInfo:info];
    //NSMutableDictionary* exifDict;

    if ([[info allKeys] containsObject:UIImagePickerControllerReferenceURL]){

        NSURL *assetURL = [info objectForKey:UIImagePickerControllerReferenceURL];
        ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
        [library assetForURL:assetURL resultBlock:^(ALAsset *asset) {
            if (asset)
            {
                NSDictionary *metadata = asset.defaultRepresentation.metadata;
                NSMutableDictionary *exifDict = [[NSMutableDictionary alloc] initWithDictionary:metadata];

                //IOS8対応
                //ALAssetRepresentation *assetRepresentation = [asset defaultRepresentation];
                //UIImage *fullscreenImage = [UIImage imageWithCGImage:[assetRepresentation fullScreenImage]];
                //UIImage *photo = scaleAndRotateImage(fullscreenImage); //イメージをセット
                Byte *buffer = (Byte*)malloc(asset.defaultRepresentation.size);
                NSUInteger buffered = [asset.defaultRepresentation getBytes:buffer fromOffset:0.0 length:asset.defaultRepresentation.size error:nil];
                NSData *imageData = [NSData dataWithBytesNoCopy:buffer length:buffered freeWhenDone:YES];

                if ([_delegate respondsToSelector:@selector(cameraShouldShowPreviewScreenForGalleryPicker)]) {
                    if ([_delegate cameraShouldShowPreviewScreenForGalleryPicker]) {
                        TGPhotoViewController *viewController = [TGPhotoViewController newWithDelegate:_delegate photo:photo];
                        [viewController setAlbumPhoto:YES];
                        [self.navigationController pushViewController:viewController animated:NO];
                    }else{
                        [_delegate cameraDidSelectAlbumPhoto:photo exifDict:exifDict imageData:imageData withDisappearingTime:0];
                    }
                }else{
                    TGPhotoViewController *viewController = [TGPhotoViewController newWithDelegate:_delegate photo:photo];
                    [viewController setAlbumPhoto:YES];
                    [self.navigationController pushViewController:viewController animated:NO];
                }

                [self dismissViewControllerAnimated:YES completion:nil];
            }
            else
            {
                [library enumerateGroupsWithTypes:ALAssetsGroupPhotoStream usingBlock:^(ALAssetsGroup *group, BOOL *stop) {
                    [group enumerateAssetsWithOptions:NSEnumerationReverse usingBlock:^(ALAsset *asset, NSUInteger index, BOOL *stop) {
                        if ([asset.defaultRepresentation.url isEqual:assetURL]){
                            // フォトストリームのALAsset取得成功
                            *stop = YES;
                            NSDictionary *metadata = asset.defaultRepresentation.metadata;
                            NSMutableDictionary *exifDict = [[NSMutableDictionary alloc] initWithDictionary:metadata];

                            //IOS8対応
                            //ALAssetRepresentation *assetRepresentation = [asset defaultRepresentation];
                            //UIImage *fullscreenImage = [UIImage imageWithCGImage:[assetRepresentation fullScreenImage]];
                            //UIImage *photo = scaleAndRotateImage(fullscreenImage); //イメージをセット

                            Byte *buffer = (Byte*)malloc(asset.defaultRepresentation.size);
                            NSUInteger buffered = [asset.defaultRepresentation getBytes:buffer fromOffset:0.0 length:asset.defaultRepresentation.size error:nil];
                            NSData *imageData = UIImageJPEGRepresentation(photo, 1.0); //[NSData dataWithBytesNoCopy:buffer length:buffered freeWhenDone:YES];

                            if ([_delegate respondsToSelector:@selector(cameraShouldShowPreviewScreenForGalleryPicker)]) {
                                if ([_delegate cameraShouldShowPreviewScreenForGalleryPicker]) {
                                    TGPhotoViewController *viewController = [TGPhotoViewController newWithDelegate:_delegate photo:photo];
                                    [viewController setAlbumPhoto:YES];
                                    [self.navigationController pushViewController:viewController animated:NO];
                                }else{
                                    [_delegate cameraDidSelectAlbumPhoto:photo  exifDict:exifDict imageData:imageData withDisappearingTime:0];
                                }
                            }else{
                                TGPhotoViewController *viewController = [TGPhotoViewController newWithDelegate:_delegate photo:photo];
                                [viewController setAlbumPhoto:YES];
                                [self.navigationController pushViewController:viewController animated:NO];
                            }

                            [self dismissViewControllerAnimated:YES completion:nil];

                        }
                    }];
                } failureBlock:^(NSError *error) {
                    // フォトストリームのALAsset取得失敗
                }];
            }
        } failureBlock:^(NSError *error) {
            // フォトストリーム以外のALAsset取得失敗
        }];

    }

}

- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    [[UIApplication sharedApplication] setStatusBarHidden:YES];
    [viewController prefersStatusBarHidden];
    viewController.navigationController.navigationBar.barTintColor = [TGCameraColor barColor];
    viewController.navigationController.navigationBar.tintColor = [TGCameraColor barTintColor];
    viewController.navigationController.navigationBar.translucent = false;
}

#pragma mark -
#pragma mark - Actions

- (IBAction)closeTapped {
    if ([_delegate respondsToSelector:@selector(cameraDidCancel)]) {
        [_delegate cameraDidCancel];
    }
}

- (IBAction)gridTapped {
    [_camera disPlayGridView];
}

- (IBAction)flashTapped {
    [_camera changeFlashModeWithButton:_flashButton];
}

- (IBAction)shotTapped {
    _shotButton.enabled =
    _albumButton.enabled = NO;

    UIDeviceOrientation deviceOrientation;
    if (self.deviceOrientation) {
        deviceOrientation = self.deviceOrientation;
    }else{
        deviceOrientation = [[UIDevice currentDevice] orientation];
    }
    AVCaptureVideoOrientation videoOrientation = [self videoOrientationForDeviceOrientation:deviceOrientation];

    [self viewWillDisappearWithCompletion:^{
        [_camera takePhotoWithCaptureView:_captureView videoOrientation:videoOrientation cropSize:_captureView.frame.size
                               completion:^(UIImage *photo,NSDictionary *meta) {
                                   if ([_delegate respondsToSelector:@selector(cameraShouldShowPreviewScreen)]) {
                                       if ([_delegate cameraShouldShowPreviewScreen]) {
                                           [self navigateToPhotoViewController:photo];
                                       } else {
                                           [_delegate cameraDidTakePhoto:photo exifDict:[meta mutableCopy] withDisappearingTime:0];
                                       }
                                   } else {
                                       [self navigateToPhotoViewController:photo];
                                   }
                               }];
    }];
}

- (void)navigateToPhotoViewController:(UIImage *)photo {
    TGPhotoViewController *viewController = [TGPhotoViewController newWithDelegate:_delegate photo:photo];
    [self.navigationController pushViewController:viewController animated:YES];
}

- (IBAction)albumTapped {
    _shotButton.enabled = NO;
    _shotOutline.hidden = YES;
    _albumButton.enabled = NO;

    [self viewWillDisappearWithCompletion:^{
        UIImagePickerController *pickerController = [TGAlbum imagePickerControllerWithDelegate:self];
        [self presentViewController:pickerController animated:YES completion:nil];
    }];

}

- (IBAction)toggleTapped {
    [_camera toogleWithFlashButton:_flashButton];
}

- (IBAction)handleTapGesture:(UITapGestureRecognizer *)recognizer {
    CGPoint touchPoint = [recognizer locationInView:_captureView];
    [_camera focusView:_captureView inTouchPoint:touchPoint];
}

#pragma mark -
#pragma mark - Private methods

- (void)setupAlbumButton {
    if ([_delegate respondsToSelector:@selector(cameraShouldShowGalleryPicker)]) {
        _albumButton.hidden = ![_delegate cameraShouldShowGalleryPicker];
    }

    [_albumButton.layer setCornerRadius:10.f];
    [_albumButton.layer setMasksToBounds:YES];
}

- (void)deviceOrientationDidChangeNotification {
    [self orientationDevice:[UIDevice.currentDevice orientation]];
}

-(void)deviceOrientationChange:(UIDeviceOrientation)orientation{
    self.deviceOrientation = orientation;
    [self orientationDevice:orientation];
}

-(void)orientationDevice:(UIDeviceOrientation)orientation{
    NSInteger degress;

    switch (orientation) {
        case UIDeviceOrientationFaceUp:
        case UIDeviceOrientationPortrait:
        case UIDeviceOrientationUnknown:
            degress = 0;
            //[self portraitView];
            break;

        case UIDeviceOrientationLandscapeLeft:
            degress = 90;
            //[self landscapeView];
            break;

        case UIDeviceOrientationFaceDown:
        case UIDeviceOrientationPortraitUpsideDown:
            degress = 180;
            //[self portraitView];
            break;

        case UIDeviceOrientationLandscapeRight:
            degress = 270;
            //[self landscapeView];
            break;
    }

    CGFloat radians = degress * M_PI / 180;
    CGAffineTransform transform = CGAffineTransformMakeRotation(radians);

    [UIView animateWithDuration:.5f animations:^{
        _gridButton.transform =
        _toggleButton.transform =
        _albumButton.transform =
        _flashButton.transform = transform;
    }];
}

-(void)landscapeView
{
    if (!_landscapeViewMode) {
        _landscapeViewMode = YES;

        [UIView animateWithDuration:0.3 animations:^{
            _actionsView.alpha = 0;
            _topView.alpha = 0;

        } completion: ^(BOOL finished) {
            _actionsView.hidden = finished - 0.2;
            _topView.hidden = finished - 0.2;

            _topLeftViewTopConstraint.constant = 0;
            _topRightViewTopConstraint.constant = 0;
            _bottomRightBottomConstraint.constant = 0;
            _bottomLeftBottomConstraint.constant = 0;

        }];
    }
}

-(void)portraitView
{
    if (_landscapeViewMode) {
        _landscapeViewMode = NO;

        _actionsView.alpha = 0;
        _actionsView.hidden = NO;

        _topView.alpha = 0;
        _topView.hidden = NO;

        [UIView animateWithDuration:0.3 animations:^{
            _actionsView.alpha = 0.8;
            _topView.alpha = 0.8;

            _topLeftViewTopConstraint.constant = 50;
            _topRightViewTopConstraint.constant = 50;
            _bottomRightBottomConstraint.constant = 60;
            _bottomLeftBottomConstraint.constant = 60;
        }];
    }
}

-(void)latestPhoto
{
    dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void){

        // get the latest image from the album
        ALAuthorizationStatus status = [ALAssetsLibrary authorizationStatus];
        if (status != ALAuthorizationStatusDenied) {
            TGAssetsLibrary *library = [TGAssetsLibrary defaultAssetsLibrary];

            __weak __typeof(self)wSelf = self;
            [library latestPhotoWithCompletion:^(UIImage *photo) {
                dispatch_async(dispatch_get_main_queue(), ^(void){

                    wSelf.albumButton.disableTint = YES;
                    [[wSelf.albumButton imageView] setContentMode: UIViewContentModeScaleAspectFill];
                    [wSelf.albumButton setImage:photo forState:UIControlStateNormal];

                });
            }];
        }
    });
}

- (AVCaptureVideoOrientation)videoOrientationForDeviceOrientation:(UIDeviceOrientation)deviceOrientation {
    AVCaptureVideoOrientation result = (AVCaptureVideoOrientation) deviceOrientation;

    switch (deviceOrientation) {
        case UIDeviceOrientationLandscapeLeft:
            result = AVCaptureVideoOrientationLandscapeRight;
            break;

        case UIDeviceOrientationLandscapeRight:
            result = AVCaptureVideoOrientationLandscapeLeft;
            break;

        default:
            break;
    }

    return result;
}

- (void)viewWillDisappearWithCompletion:(void (^)(void))completion {
    _actionsView.hidden = YES;

    [TGCameraSlideView showSlideUpView:_slideUpView slideDownView:_slideDownView atView:_captureView completion:^{
        completion();
    }];
}

@end


text:
package org.eclipse.ceylon.compiler.java.test;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;

import org.junit.ComparisonFailure;
import org.junit.runner.Description;
import org.junit.runner.notification.Failure;
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.ParentRunner;
import org.junit.runners.model.InitializationError;

public class CeylonTestRunner extends ParentRunner<Method> {

    private Class<?> testClass;

    private LinkedHashMap<Method, Description> children = new LinkedHashMap<Method, Description>();

    private Method failureCountGetter;

    public CeylonTestRunner(Class<?> testClass, Method failureCountGetter, List<String> list) throws InitializationError {
        super(testClass);
        this.testClass = testClass;
        this.failureCountGetter = failureCountGetter;
        for (String method : list) {
            Method m;
            try {
                m = testClass.getMethod(method);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            Description description = Description.createTestDescription(testClass, method);
            children.put(m, description);
        }
    }

    @Override
    protected Description describeChild(Method child) {
        return children.get(child);
    }

    @Override
    protected List<Method> getChildren() {
        return new ArrayList<Method>(this.children.keySet());
    }

    @Override
    protected void runChild(Method method, RunNotifier notifier) {
        Description description = describeChild(method);
        notifier.fireTestStarted(description);
        Failure failure = null;
        try {
            failure = executeTest(method, description);
        } finally {
            if (failure != null) {
                notifier.fireTestFailure(failure);
            }
        }
        notifier.fireTestFinished(description);
    }

    private Failure executeTest(Method child, Description description) {
        Failure failure = null;
        try {

            Object instance;
            if (Modifier.isStatic(child.getModifiers())) {
                instance = null;
            } else {
                instance = testClass.newInstance();
            }
            Long previousCount = null;
            if(failureCountGetter != null)
                previousCount = (Long) failureCountGetter.invoke(null);

            child.invoke(instance);

            if(failureCountGetter != null){
                Long newCount = (Long) failureCountGetter.invoke(null);
                if(!newCount.equals(previousCount))
                    failure = new Failure(description, new AssertionError("check() failed: "+(newCount - previousCount)+" errors"));
            }
        } catch (InvocationTargetException e) {
            Throwable cause = e.getCause();
            StackTraceElement[] st = cause.getStackTrace();
            if ("ceylon.language.AssertionError".equals(cause.getClass().getName())) {
                AssertionError error = new AssertionError(cause.getMessage());
                error.setStackTrace(cause.getStackTrace());
                failure = new Failure(description, error);
            } else if ("org.eclipse.ceylon.compiler.java.test.runtime.AssertionFailed".equals(cause.getClass().getName())) {
                AssertionError error = new AssertionError(cause.getMessage());
                error.setStackTrace(cause.getStackTrace());
                failure = new Failure(description, error);
            } else if ("org.eclipse.ceylon.compiler.java.test.runtime.ComparisonFailed".equals(cause.getClass().getName())) {
                Object expected = get(cause, "getExpected");
                Object got = get(cause, "getGot");
                ComparisonFailure error = new ComparisonFailure(cause.getMessage(), String.valueOf(expected), String.valueOf(got));
                error.setStackTrace(cause.getStackTrace());
                failure = new Failure(description, error);
            } else {
                failure = new Failure(description, e);
            }
        } catch (Exception e) {
            failure = new Failure(description, e);
        } catch (AssertionError e) {
            failure = new Failure(description, e);
        }
        return failure;
    }

    private Object get(Throwable cause, String getter) {
        try {
            Method method = cause.getClass().getMethod(getter);
            Object expected = method.invoke(cause);
            return expected;
        } catch (Exception e) {
            throw new RuntimeException();
        }
    }

    public int testCount() {
        return this.children.size();
    }

}


text:
void foo() {
}

bool foobool(int argc) {
  return argc;
}

struct S1; // expected-note {{declared here}}

template <class T, typename S, int N, int ST> // expected-note {{declared here}}
T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
  #pragma omp simd collapse // expected-error {{expected '(' after 'collapse'}}
  for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
  #pragma omp simd collapse ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
  #pragma omp simd collapse () // expected-error {{expected expression}}
  for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
  // expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
  // expected-error@+2 2 {{expression is not an integral constant expression}}
  // expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
  #pragma omp simd collapse (argc
  for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
  // expected-error@+1 2 {{argument to 'collapse' clause must be a positive integer value}}
  #pragma omp simd collapse (ST // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
  #pragma omp simd collapse (1)) // expected-warning {{extra tokens at the end of '#pragma omp simd' are ignored}}
  for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
  #pragma omp simd collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}}
  for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp simd', but found only 1}}
  // expected-error@+3 2 {{directive '#pragma omp simd' cannot contain more than one 'collapse' clause}}
  // expected-error@+2 2 {{argument to 'collapse' clause must be a positive integer value}}
  // expected-error@+1 2 {{expression is not an integral constant expression}}
  #pragma omp simd collapse (foobool(argc)), collapse (true), collapse (-5)
  for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
  #pragma omp simd collapse (S) // expected-error {{'S' does not refer to a value}}
  for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
  // expected-error@+1 2 {{expression is not an integral constant expression}}
  #pragma omp simd collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
  #pragma omp simd collapse (1)
  for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
  #pragma omp simd collapse (N) // expected-error {{argument to 'collapse' clause must be a positive integer value}}
  for (T i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
  #pragma omp simd collapse (2) // expected-note {{as specified in 'collapse' clause}}
  foo(); // expected-error {{expected 2 for loops after '#pragma omp simd'}}
  return argc;
}

int main(int argc, char **argv) {
  #pragma omp simd collapse // expected-error {{expected '(' after 'collapse'}}
  for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
  #pragma omp simd collapse ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
  #pragma omp simd collapse () // expected-error {{expected expression}}
  for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
  #pragma omp simd collapse (4 // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{as specified in 'collapse' clause}}
  for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp simd', but found only 1}}
  #pragma omp simd collapse (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp simd' are ignored}} expected-note {{as specified in 'collapse' clause}}
  for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp simd', but found only 1}}
  #pragma omp simd collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
  for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
  // expected-error@+3 {{expression is not an integral constant expression}}
  // expected-error@+2 2 {{directive '#pragma omp simd' cannot contain more than one 'collapse' clause}}
  // expected-error@+1 2 {{argument to 'collapse' clause must be a positive integer value}}
  #pragma omp simd collapse (foobool(argc)), collapse (true), collapse (-5)
  for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
  #pragma omp simd collapse (S1) // expected-error {{'S1' does not refer to a value}}
  for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
  // expected-error@+1 {{expression is not an integral constant expression}}
  #pragma omp simd collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
  #pragma omp simd collapse (2) // expected-note {{as specified in 'collapse' clause}}
  foo(); // expected-error {{expected 2 for loops after '#pragma omp simd'}}
  // expected-error@+3 {{statement after '#pragma omp simd' must be a for loop}}
  // expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, -1, -2>' requested here}}
  #pragma omp simd collapse(collapse(tmain<int, char, -1, -2>(argc, argv) // expected-error 2 {{expected ')'}} expected-note 2 {{to match this '('}}
  foo();
  // expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, 1, 0>' requested here}}
  return tmain<int, char, 1, 0>(argc, argv);
}


text:
package com.google.errorprone.bugpatterns.testdata;

import com.google.common.base.Objects;

/** @author bhagwani@google.com (Sumit Bhagwani) */
public class SelfEqualsGuavaNegativeCases {
  private String field;

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }

    SelfEqualsGuavaNegativeCases other = (SelfEqualsGuavaNegativeCases) o;
    return Objects.equal(field, other.field);
  }

  @Override
  public int hashCode() {
    return field != null ? field.hashCode() : 0;
  }
}


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/background"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".SleepActivity" >

    <Button
        android:id="@+id/stopsleeping"
        android:layout_width="110dp"
        android:layout_height="50dp"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:layout_marginBottom="31dp"
        android:layout_marginRight="18dp"
        android:background="@drawable/buttonshape"
        android:text="@string/stop_sleeping" />

    <Button
        android:id="@+id/startsleeping"
        android:layout_width="110dp"
        android:layout_height="50dp"
        android:layout_alignBaseline="@+id/stopsleeping"
        android:layout_alignBottom="@+id/stopsleeping"
        android:layout_alignParentLeft="true"
        android:layout_marginLeft="18dp"
        android:background="@drawable/buttonshape"
        android:text="@string/start_sleeping" />

    <ImageView
        android:id="@+id/sleepingdog"
        android:layout_width="250dp"
        android:layout_height="250dp"
        android:layout_above="@+id/stopsleeping"
        android:layout_alignRight="@+id/stopsleeping"
        android:layout_marginBottom="27dp"
        android:src="@drawable/sleepingdogv1" />

</RelativeLayout>


text:
extern "Java"
{
  namespace gnu
  {
    namespace xml
    {
      namespace transform
      {
          class Stylesheet;
          class TransformerFactoryImpl;
          class XSLURIResolver;
      }
    }
  }
  namespace javax
  {
    namespace xml
    {
      namespace transform
      {
          class ErrorListener;
          class Source;
          class Templates;
          class Transformer;
          class URIResolver;
        namespace sax
        {
            class TemplatesHandler;
            class TransformerHandler;
        }
      }
      namespace xpath
      {
          class XPathFactory;
      }
    }
  }
  namespace org
  {
    namespace xml
    {
      namespace sax
      {
          class XMLFilter;
      }
    }
  }
}

class gnu::xml::transform::TransformerFactoryImpl : public ::javax::xml::transform::sax::SAXTransformerFactory
{

public:
  TransformerFactoryImpl();
  virtual ::javax::xml::transform::Transformer * newTransformer(::javax::xml::transform::Source *);
  virtual ::javax::xml::transform::Transformer * newTransformer();
  virtual ::javax::xml::transform::Templates * newTemplates(::javax::xml::transform::Source *);
public: // actually package-private
  virtual ::gnu::xml::transform::Stylesheet * newStylesheet(::javax::xml::transform::Source *, jint, ::gnu::xml::transform::Stylesheet *);
public:
  virtual ::javax::xml::transform::Source * getAssociatedStylesheet(::javax::xml::transform::Source *, ::java::lang::String *, ::java::lang::String *, ::java::lang::String *);
public: // actually package-private
  virtual ::java::util::Map * parseParameters(::java::lang::String *);
  virtual ::java::lang::String * unquote(::java::lang::String *);
public:
  virtual void setURIResolver(::javax::xml::transform::URIResolver *);
  virtual ::javax::xml::transform::URIResolver * getURIResolver();
  virtual void setFeature(::java::lang::String *, jboolean);
  virtual jboolean getFeature(::java::lang::String *);
  virtual void setAttribute(::java::lang::String *, ::java::lang::Object *);
  virtual ::java::lang::Object * getAttribute(::java::lang::String *);
  virtual void setErrorListener(::javax::xml::transform::ErrorListener *);
  virtual ::javax::xml::transform::ErrorListener * getErrorListener();
  virtual ::javax::xml::transform::sax::TemplatesHandler * newTemplatesHandler();
  virtual ::javax::xml::transform::sax::TransformerHandler * newTransformerHandler();
  virtual ::javax::xml::transform::sax::TransformerHandler * newTransformerHandler(::javax::xml::transform::Source *);
  virtual ::javax::xml::transform::sax::TransformerHandler * newTransformerHandler(::javax::xml::transform::Templates *);
  virtual ::org::xml::sax::XMLFilter * newXMLFilter(::javax::xml::transform::Source *);
  virtual ::org::xml::sax::XMLFilter * newXMLFilter(::javax::xml::transform::Templates *);
  static void main(JArray< ::java::lang::String * > *);
public: // actually package-private
  ::javax::xml::xpath::XPathFactory * __attribute__((aligned(__alignof__( ::javax::xml::transform::sax::SAXTransformerFactory)))) xpathFactory;
  ::gnu::xml::transform::XSLURIResolver * resolver;
  ::javax::xml::transform::ErrorListener * userListener;
  ::javax::xml::transform::URIResolver * userResolver;
public:
  static ::java::lang::Class class$;
};

#endif // __gnu_xml_transform_TransformerFactoryImpl__


text:
<?xml version="1.0" encoding="UTF-8"?>

<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
	id="org.limitstate.honeywell_scanner_plugin"
	version="0.0.5">

	<name>Honeywell Barcode Scanner Plugin</name>
	<description>Honeywell Barcode Scanner Plugin</description>
	<license>Apache 2.0</license>
	<keywords>cordova, honeywell, dolphin, scanner, plugin</keywords>

	<js-module src="www/honeywell_scanner_plugin.js" name="HoneywellScannerPlugin">
		<clobbers target="navigator.honeywell_scanner_plugin" />
	</js-module>

	<!-- android -->
	<platform name="android">
		<config-file target="AndroidManifest.xml" parent="/*">
			<uses-permission android:name="android.permission.CAMERA" />
			<uses-permission android:name="android.permission.FLASHLIGHT" />
			<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
			<uses-permission android:name="android.permission.INTERNET" />
			<uses-permission android:name="android.permission.READ_LOGS" />
			<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
			<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
			<uses-permission android:name="android.permission.VIBRATE" />
			<uses-permission android:name="android.permission.NFC" />

			<uses-feature android:name="android.hardware.camera" />
			<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
			<uses-feature android:name="android.hardware.camera.flash" android:required="false" />
		</config-file>

		<config-file target="res/xml/config.xml" parent="/*">
			<feature name="BarcodeScannerPlugin">
				<param name="android-package" value="org.limitstate.honeywell.BarcodeScannerPlugin" />
			</feature>
		</config-file>

		<source-file src="src/android/libs/gson-2.2.4.jar" target-dir="libs" />
		<source-file src="src/android/libs/honeywell.jar" target-dir="libs" />

		<source-file src="src/android/BarcodeScannerPlugin.java" target-dir="src/org/limitstate/honeywell" />
	</platform>

</plugin>


text:
Input a URL which failed to load, and then click the button to run some
     tests for why it failed.

  <form id=test-view-connection-tests-form>
    URL: <input type=text id=test-view-url-input />
    <input id=test-view-connection-tests-submit type=submit value="Start tests" />
  </form>