text:
package application.view;

import application.dialog.LayoutInflater;
import javafx.scene.Parent;
import javafx.scene.layout.AnchorPane;

public class LoginView implements View {

	@Override
	public Parent getView() {
		AnchorPane anchorPane = LayoutInflater.inflate("activity_login", AnchorPane.class);
		return anchorPane;
	}
}

redpajama_set_name: RedPajamaGithub


text:
package com.github.dreamhead.moco.util;

import io.netty.handler.codec.http.Cookie;
import io.netty.handler.codec.http.DefaultCookie;
import io.netty.handler.codec.http.ServerCookieEncoder;

public class Cookies {
    public String encodeCookie(String key, String value) {
        Cookie cookie = new DefaultCookie(key, value);
        cookie.setPath("/");
        return ServerCookieEncoder.encode(cookie);
    }
}


text:
namespace NPOI.XSSF.UserModel
{

    using NPOI.SS.UserModel;
    using System;
    using NPOI.OpenXmlFormats.Spreadsheet;
    using System.Collections.Generic;
    using NPOI.SS.Util;

    /**
     * @author Radhakrishnan J
     *
     */
    public class XSSFDataValidationHelper : IDataValidationHelper
    {
        private XSSFSheet xssfSheet;

        public XSSFDataValidationHelper(XSSFSheet xssfSheet)
            : base()
        {

            this.xssfSheet = xssfSheet;
        }

        /* (non-Javadoc)
         * @see NPOI.ss.usermodel.DataValidationHelper#CreateDateConstraint(int, java.lang.String, java.lang.String, java.lang.String)
         */
        public IDataValidationConstraint CreateDateConstraint(int operatorType, String formula1, String formula2, String dateFormat)
        {
            return new XSSFDataValidationConstraint(ValidationType.DATE, operatorType, formula1, formula2);
        }

        /* (non-Javadoc)
         * @see NPOI.ss.usermodel.DataValidationHelper#CreateDecimalConstraint(int, java.lang.String, java.lang.String)
         */
        public IDataValidationConstraint CreateDecimalConstraint(int operatorType, String formula1, String formula2)
        {
            return new XSSFDataValidationConstraint(ValidationType.DECIMAL, operatorType, formula1, formula2);
        }

        /* (non-Javadoc)
         * @see NPOI.ss.usermodel.DataValidationHelper#CreateExplicitListConstraint(java.lang.String[])
         */
        public IDataValidationConstraint CreateExplicitListConstraint(String[] listOfValues)
        {
            return new XSSFDataValidationConstraint(listOfValues);
        }

        /* (non-Javadoc)
         * @see NPOI.ss.usermodel.DataValidationHelper#CreateFormulaListConstraint(java.lang.String)
         */
        public IDataValidationConstraint CreateFormulaListConstraint(String listFormula)
        {
            return new XSSFDataValidationConstraint(ValidationType.LIST, listFormula);
        }

        public IDataValidationConstraint CreateNumericConstraint(int validationType, int operatorType, String formula1, String formula2)
        {
            if (validationType == ValidationType.INTEGER)
            {
                return CreateintConstraint(operatorType, formula1, formula2);
            }
            else if (validationType == ValidationType.DECIMAL)
            {
                return CreateDecimalConstraint(operatorType, formula1, formula2);
            }
            else if (validationType == ValidationType.TEXT_LENGTH)
            {
                return CreateTextLengthConstraint(operatorType, formula1, formula2);
            }
            return null;
        }

        /* (non-Javadoc)
         * @see NPOI.ss.usermodel.DataValidationHelper#CreateintConstraint(int, java.lang.String, java.lang.String)
         */
        public IDataValidationConstraint CreateintConstraint(int operatorType, String formula1, String formula2)
        {
            return new XSSFDataValidationConstraint(ValidationType.INTEGER, operatorType, formula1, formula2);
        }

        /* (non-Javadoc)
         * @see NPOI.ss.usermodel.DataValidationHelper#CreateTextLengthConstraint(int, java.lang.String, java.lang.String)
         */
        public IDataValidationConstraint CreateTextLengthConstraint(int operatorType, String formula1, String formula2)
        {
            return new XSSFDataValidationConstraint(ValidationType.TEXT_LENGTH, operatorType, formula1, formula2);
        }

        /* (non-Javadoc)
         * @see NPOI.ss.usermodel.DataValidationHelper#CreateTimeConstraint(int, java.lang.String, java.lang.String, java.lang.String)
         */
        public IDataValidationConstraint CreateTimeConstraint(int operatorType, String formula1, String formula2)
        {
            return new XSSFDataValidationConstraint(ValidationType.TIME, operatorType, formula1, formula2);
        }

        public IDataValidationConstraint CreateCustomConstraint(String formula)
        {
            return new XSSFDataValidationConstraint(ValidationType.FORMULA, formula);
        }

        /* (non-Javadoc)
         * @see NPOI.ss.usermodel.DataValidationHelper#CreateValidation(NPOI.ss.usermodel.DataValidationConstraint, NPOI.ss.util.CellRangeAddressList)
         */
        public IDataValidation CreateValidation(IDataValidationConstraint constraint, CellRangeAddressList cellRangeAddressList)
        {
            XSSFDataValidationConstraint dataValidationConstraint = (XSSFDataValidationConstraint)constraint;
            CT_DataValidation newDataValidation = new CT_DataValidation();

            int validationType = constraint.GetValidationType();
            switch (validationType)
            {
                case ValidationType.LIST:
                    newDataValidation.type = (ST_DataValidationType.list);
                    newDataValidation.formula1 = (constraint.Formula1);
                    break;
                case ValidationType.ANY:
                    newDataValidation.type = ST_DataValidationType.none;
                    break;
                case ValidationType.TEXT_LENGTH:
                    newDataValidation.type = ST_DataValidationType.textLength;
                    break;
                case ValidationType.DATE:
                    newDataValidation.type = ST_DataValidationType.date;
                    break;
                case ValidationType.INTEGER:
                    newDataValidation.type = ST_DataValidationType.whole;
                    break;
                case ValidationType.DECIMAL:
                    newDataValidation.type = ST_DataValidationType.@decimal;
                    break;
                case ValidationType.TIME:
                    newDataValidation.type = ST_DataValidationType.time;
                    break;
                case ValidationType.FORMULA:
                    newDataValidation.type = ST_DataValidationType.custom;
                    break;
                default:
                    newDataValidation.type = ST_DataValidationType.none;
                    break;
            }

            if (validationType != ValidationType.ANY && validationType != ValidationType.LIST)
            {
                newDataValidation.@operator = ST_DataValidationOperator.between;
                if (XSSFDataValidation.operatorTypeMappings.ContainsKey(constraint.Operator))
                    newDataValidation.@operator = XSSFDataValidation.operatorTypeMappings[constraint.Operator];

                if (constraint.Formula1 != null)
                {
                    newDataValidation.formula1 = (constraint.Formula1);
                }
                if (constraint.Formula2 != null)
                {
                    newDataValidation.formula2 = (constraint.Formula2);
                }
            }

            CellRangeAddress[] cellRangeAddresses = cellRangeAddressList.CellRangeAddresses;
            string sqref = string.Empty;
            for (int i = 0; i < cellRangeAddresses.Length; i++)
            {
                CellRangeAddress cellRangeAddress = cellRangeAddresses[i];
                if(sqref.Length==0)
                    sqref = cellRangeAddress.FormatAsString();
                else
                    sqref = " " + cellRangeAddress.FormatAsString();
            }
            newDataValidation.sqref = sqref;

            return new XSSFDataValidation(dataValidationConstraint, cellRangeAddressList, newDataValidation);
        }
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="css/contactform.css" rel="stylesheet" type="text/css" />

<title>Standard Scripts</title>

JAVA FUNCTIONS

  Text Alert

    <button type="button" value="Submit" onclick="popUpwindow('credits.html' , 'credits' , 'width=500 , height=170'); ">Call popup window</button>
    <button type="button" value="Show_or_Hide" onClick=" toggleHidden('hiddenImage');">Show/Hide Content</button>

TEST CAPTION FOR IMAGE

    <button type="button" value="submit" onclick="JavaMessage('Javascript alert from Button');">Alert</button>

  <form method="post" action="php/contact.php" id="mainform" onsubmit="return verifyForm('mainform');">

  *Gender
  <input type="radio" name="Gender" value="Male">Male <input type="radio" name="Gender" value="Female">Female

  *Check box example
  <input type="checkbox" name="checkbox" value="check1">Check box 1
  <input type="checkbox" name="checkbox" value="check2">Check box 2

Fields marked with * are mandatory.

      *First Name:
      <input class="formField" required="required" name="First_Name" id="First_Name" type="text"/>

      *Email Address:
      <input class="formField" required="requiredemail"name="Email"/>

      *Nature of Inquiry:
      <select class="formField" required="required"name="Nature_of_Inquiry"/>

      <option value=" "> </option>
      <option value="Option_1">Option 1</option>
      <option value="Option_2">Option 2</option>
      <option value="Option_3">Option 3</option>
      </select>

      *Questions/Comments:
      <textarea name="Comments" required="required"></textarea>

      <input type="submit" value="Submit Request" style="font-size:11px;" />
      <input type="reset" value="Reset Form" style="font-size:11px;" />

  </form>


text:
<?php

class Mage_Core_Model_Message_Success extends Mage_Core_Model_Message_Abstract
{
    public function __construct($code)
    {
        parent::__construct(Mage_Core_Model_Message::SUCCESS, $code);
    }
}


text:
module Nucleus
  module Errors
    class EndpointAuthenticationError < AdapterError
      # initialize with default error to be 401, authentication failed
      def initialize(message, ui_error = ErrorMessages::AUTH_UNAUTHORIZED)
        super(message, ui_error)
      end
    end
  end
end


text:
/* IBM_PROLOG_BEGIN_TAG */
/*
 * Copyright 2003,2016 IBM International Business Machines Corp.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * 		 http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 * implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/* IBM_PROLOG_END_TAG */

#ifndef _LIB_MM_H
#define _LIB_MM_H

#define  B     1
#define  K     1024*B
#define  M     1024*K
#define PG_SZ_16M (16*M)
#define PG_SZ_64K (64*K)
#define PG_SZ_4K  (4 *K)

#include <stdio.h>
#include <ctype.h>
#include <sys/errno.h>
#include <string.h>
#include <stdlib.h>
#include <sys/shm.h>
#include <stddef.h>

#ifdef DEBUG
   #define  PRINT(x)   {printf x;}
#else
   #define  PRINT(x)
#endif

/*
 * memory pool management
 */

#define NUM_BUF_SIZES  1024

struct buf_node {
	struct           buf_node *next;
    char * 	         unaligned_addr;    /* Unaligned Address                                      */
	char *	         aligned_addr;      /* Aligned   Address                                      */
	char *	         bus_addr;          /* Bus       Address                                      */
	char * 	         real_addr;         /* Real      Address                                      */

	int              shm_id;            /* Shared memory id, while creating segment for 16M pages */

	unsigned long    size;              /* Size of the node buffer                                */
    unsigned long    page_size;         /* Base page size of the pool                             */
};

struct buf_pool {
    unsigned long     size;             /* Size of the node buffer in bytes       	      		  */
    unsigned long     page_size;        /* Base page size of the pool                             */
    struct buf_node   *free;            /* Pointer to the head of the free buf_node linked list   */
    struct buf_node   *inuse;           /* Pointer to the head of the inuse buf_node linked list  */
    int               num_free;	        /* Number of buffers of size "size" that are free         */
    int               num_elements;     /* Total number of allocated buffers for size "size"
				                         * num_elements = num_free + number of buffers in use     */
    int	              alignment_size;   /* Alignment size                                         */
    char *            shm_start_addr;   /* Address where the segment is attached                  */
	int               shm_id;           /* Shared memory id, while creating segment for 16M pages */
    unsigned 	      PCI_addr:1,       /* Bit field to indicate if PCI addr has to be generated  */
 				      real_addr:1,      /* Bit field to indicate if real addr has to be generated */
				      align:1;          /* Bit field to indicate if the addr has to be aligned    */
    unsigned          shm_pool:1;       /* Bit field to indicate if the memory was allocated
                                         * using shmget or malloc                                 */
};

/*
 * HTX descriptor pool management routines
 * creates, manages and destroy descriptor pool memory
 * for Tx and Rx operations
 */
int iomm_init_pool(long *pool_handle, long buf_size, long align_size, int num_elements);

int iomm_free_pool_list(long index);

int iomm_resize_pool(long pool_handle, long size, int num_nodes);

int iomm_get_buf_node(long pool_handle, long size, int num_nodes, struct buf_node **node);

int iomm_get_buf_page_node(long pool_handle, long page_size, long size, int num_nodes, struct buf_node **node);

int iomm_put_buf_node(long pool_handle, long size, struct buf_node *buf);

long iomm_check_buf_size(long pool_handle);

int iomm_init_page_pool(long *pool_handle, void *shmat_addr, long page_size, long buf_size, int num_elements, int *num_pages_allocated);

int iomm_cleanup_page_pool(int index, long psize);

void *iomm_get_shmat_addr(long index);

#endif


text:
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/chromeos/accessibility/magnification_manager.h"

#include <limits>
#include <memory>

#include "ash/magnifier/magnification_controller.h"
#include "ash/public/cpp/ash_pref_names.h"
#include "ash/public/cpp/docked_magnifier_controller.h"
#include "ash/shell.h"
#include "base/bind.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "components/prefs/pref_change_registrar.h"
#include "components/prefs/pref_service.h"
#include "components/user_manager/user_manager.h"
#include "content/public/browser/focused_node_details.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
#include "ui/accessibility/ax_role_properties.h"
#include "ui/views/accessibility/ax_event_manager.h"
#include "ui/views/accessibility/view_accessibility.h"

namespace chromeos {

namespace {
MagnificationManager* g_magnification_manager = nullptr;
}  // namespace

// static
void MagnificationManager::Initialize() {
  CHECK(g_magnification_manager == nullptr);
  g_magnification_manager = new MagnificationManager();
}

// static
void MagnificationManager::Shutdown() {
  CHECK(g_magnification_manager);
  delete g_magnification_manager;
  g_magnification_manager = nullptr;
}

// static
MagnificationManager* MagnificationManager::Get() {
  return g_magnification_manager;
}

bool MagnificationManager::IsMagnifierEnabled() const {
  return fullscreen_magnifier_enabled_;
}

void MagnificationManager::SetMagnifierEnabled(bool enabled) {
  if (!profile_)
    return;

  PrefService* prefs = profile_->GetPrefs();
  prefs->SetBoolean(ash::prefs::kAccessibilityScreenMagnifierEnabled, enabled);
  prefs->CommitPendingWrite();
}

bool MagnificationManager::IsDockedMagnifierEnabled() const {
  return profile_ &&
         profile_->GetPrefs()->GetBoolean(ash::prefs::kDockedMagnifierEnabled);
}

void MagnificationManager::SetDockedMagnifierEnabled(bool enabled) {
  if (!profile_)
    return;

  PrefService* prefs = profile_->GetPrefs();
  prefs->SetBoolean(ash::prefs::kDockedMagnifierEnabled, enabled);
  prefs->CommitPendingWrite();
}

void MagnificationManager::SaveScreenMagnifierScale(double scale) {
  if (!profile_)
    return;

  profile_->GetPrefs()->SetDouble(
      ash::prefs::kAccessibilityScreenMagnifierScale, scale);
}

double MagnificationManager::GetSavedScreenMagnifierScale() const {
  if (!profile_)
    return std::numeric_limits<double>::min();

  return profile_->GetPrefs()->GetDouble(
      ash::prefs::kAccessibilityScreenMagnifierScale);
}

void MagnificationManager::OnProfileWillBeDestroyed(Profile* profile) {
  DCHECK_EQ(profile_, profile);
  SetProfile(nullptr);
}

void MagnificationManager::OnViewEvent(views::View* view,
                                       ax::mojom::Event event_type) {
  if (!fullscreen_magnifier_enabled_ && !IsDockedMagnifierEnabled())
    return;

  if (event_type != ax::mojom::Event::kFocus &&
      event_type != ax::mojom::Event::kSelection) {
    return;
  }

  ui::AXNodeData data;
  view->GetViewAccessibility().GetAccessibleNodeData(&data);

  // Disallow focus on large containers, which probably should not move the
  // magnified viewport to the center of the view.
  if (ui::IsControl(data.role))
    HandleFocusChanged(view->GetBoundsInScreen(), false);
}

void MagnificationManager::SetProfileForTest(Profile* profile) {
  SetProfile(profile);
}

MagnificationManager::MagnificationManager() {
  registrar_.Add(this, chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE,
                 content::NotificationService::AllSources());
  // TODO(warx): observe focus changed in page notification when either
  // fullscreen magnifier or docked magnifier is enabled.
  registrar_.Add(this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE,
                 content::NotificationService::AllSources());
  user_manager::UserManager::Get()->AddSessionStateObserver(this);
  views::AXEventManager::Get()->AddObserver(this);
}

MagnificationManager::~MagnificationManager() {
  CHECK(this == g_magnification_manager);
  views::AXEventManager::Get()->RemoveObserver(this);
  user_manager::UserManager::Get()->RemoveSessionStateObserver(this);
}

void MagnificationManager::Observe(
    int type,
    const content::NotificationSource& source,
    const content::NotificationDetails& details) {
  switch (type) {
    case chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE: {
      // Update |profile_| when entering the login screen.
      Profile* profile = ProfileManager::GetActiveUserProfile();
      if (ProfileHelper::IsSigninProfile(profile))
        SetProfile(profile);
      break;
    }
    case content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE: {
      HandleFocusChangedInPage(details);
      break;
    }
  }
}

void MagnificationManager::ActiveUserChanged(user_manager::User* active_user) {
  if (!active_user)
    return;

  active_user->AddProfileCreatedObserver(
      base::BindOnce(&MagnificationManager::SetProfileByUser,
                     weak_ptr_factory_.GetWeakPtr(), active_user));
}

void MagnificationManager::SetProfileByUser(const user_manager::User* user) {
  SetProfile(ProfileHelper::Get()->GetProfileByUser(user));
}

void MagnificationManager::SetProfile(Profile* profile) {
  if (profile_)
    profile_observer_.Remove(profile_);
  DCHECK(!profile_observer_.IsObservingSources());

  pref_change_registrar_.reset();

  if (profile) {
    // TODO(yoshiki): Move following code to PrefHandler.
    pref_change_registrar_.reset(new PrefChangeRegistrar);
    pref_change_registrar_->Init(profile->GetPrefs());
    pref_change_registrar_->Add(
        ash::prefs::kAccessibilityScreenMagnifierEnabled,
        base::BindRepeating(&MagnificationManager::UpdateMagnifierFromPrefs,
                            base::Unretained(this)));
    pref_change_registrar_->Add(
        ash::prefs::kAccessibilityScreenMagnifierCenterFocus,
        base::BindRepeating(&MagnificationManager::UpdateMagnifierFromPrefs,
                            base::Unretained(this)));
    pref_change_registrar_->Add(
        ash::prefs::kAccessibilityScreenMagnifierScale,
        base::BindRepeating(&MagnificationManager::UpdateMagnifierFromPrefs,
                            base::Unretained(this)));
    pref_change_registrar_->Add(
        ash::prefs::kDockedMagnifierEnabled,
        base::BindRepeating(
            &MagnificationManager::UpdateDockedMagnifierFromPrefs,
            base::Unretained(this)));

    profile_observer_.Add(profile);
  }

  profile_ = profile;
  UpdateMagnifierFromPrefs();
  UpdateDockedMagnifierFromPrefs();
}

void MagnificationManager::SetMagnifierEnabledInternal(bool enabled) {
  // This method may be invoked even when the other magnifier settings (e.g.
  // type or scale) are changed, so we need to call magnification controller
  // even if |enabled| is unchanged. Only if |enabled| is false and the
  // magnifier is already disabled, we are sure that we don't need to reflect
  // the new settings right now because the magnifier keeps disabled.
  if (!enabled && !fullscreen_magnifier_enabled_)
    return;

  fullscreen_magnifier_enabled_ = enabled;

  ash::Shell::Get()->magnification_controller()->SetEnabled(enabled);
}

void MagnificationManager::SetMagnifierKeepFocusCenteredInternal(
    bool keep_focus_centered) {
  if (keep_focus_centered_ == keep_focus_centered)
    return;

  keep_focus_centered_ = keep_focus_centered;

  ash::Shell::Get()->magnification_controller()->SetKeepFocusCentered(
      keep_focus_centered_);
}

void MagnificationManager::SetMagnifierScaleInternal(double scale) {
  if (scale_ == scale)
    return;

  scale_ = scale;

  ash::Shell::Get()->magnification_controller()->SetScale(scale_,
                                                          false /* animate */);
}

void MagnificationManager::UpdateMagnifierFromPrefs() {
  if (!profile_)
    return;

  PrefService* prefs = profile_->GetPrefs();
  const bool enabled =
      prefs->GetBoolean(ash::prefs::kAccessibilityScreenMagnifierEnabled);
  const bool keep_focus_centered =
      prefs->GetBoolean(ash::prefs::kAccessibilityScreenMagnifierCenterFocus);
  const double scale =
      prefs->GetDouble(ash::prefs::kAccessibilityScreenMagnifierScale);

  if (!enabled) {
    SetMagnifierEnabledInternal(enabled);
    SetMagnifierKeepFocusCenteredInternal(keep_focus_centered);
    SetMagnifierScaleInternal(scale);
  } else {
    SetMagnifierScaleInternal(scale);
    SetMagnifierKeepFocusCenteredInternal(keep_focus_centered);
    SetMagnifierEnabledInternal(enabled);
  }

  AccessibilityStatusEventDetails details(ACCESSIBILITY_TOGGLE_SCREEN_MAGNIFIER,
                                          fullscreen_magnifier_enabled_);

  if (!AccessibilityManager::Get())
    return;
  AccessibilityManager::Get()->NotifyAccessibilityStatusChanged(details);
  if (ash::Shell::Get())
    ash::Shell::Get()->UpdateCursorCompositingEnabled();
}

void MagnificationManager::UpdateDockedMagnifierFromPrefs() {
  if (!profile_)
    return;

  PrefService* prefs = profile_->GetPrefs();
  const bool enabled = prefs->GetBoolean(ash::prefs::kDockedMagnifierEnabled);
  AccessibilityStatusEventDetails details(ACCESSIBILITY_TOGGLE_DOCKED_MAGNIFIER,
                                          enabled);

  if (!AccessibilityManager::Get())
    return;
  AccessibilityManager::Get()->NotifyAccessibilityStatusChanged(details);
}

void MagnificationManager::HandleFocusChangedInPage(
    const content::NotificationDetails& details) {
  const bool docked_magnifier_enabled = IsDockedMagnifierEnabled();
  if (!fullscreen_magnifier_enabled_ && !docked_magnifier_enabled)
    return;

  content::FocusedNodeDetails* node_details =
      content::Details<content::FocusedNodeDetails>(details).ptr();
  // Ash uses the InputMethod of the window tree host to observe text input
  // caret bounds changes, which works for both the native UI as well as
  // webpages. We don't need to notify it of editable nodes in this case.
  if (node_details->is_editable_node)
    return;

  HandleFocusChanged(node_details->node_bounds_in_screen,
                     node_details->is_editable_node);
}

void MagnificationManager::HandleFocusChanged(const gfx::Rect& bounds_in_screen,
                                              bool is_editable) {
  if (bounds_in_screen.IsEmpty())
    return;

  // Fullscreen magnifier and docked magnifier are mutually exclusive.
  if (fullscreen_magnifier_enabled_) {
    ash::Shell::Get()->magnification_controller()->HandleFocusedNodeChanged(
        is_editable, bounds_in_screen);
    return;
  }
  DCHECK(IsDockedMagnifierEnabled());
  ash::DockedMagnifierController::Get()->CenterOnPoint(
      bounds_in_screen.CenterPoint());
}

}  // namespace chromeos


text:
<?xml version='1.0' encoding='utf-8'?>
<plugin id="com.andrewtremblay.plugintest" version="0.0.0" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
	<name>Plugin-Example</name>
	<AUTHOR>Andrew Tremblay</AUTHOR>
	<license>Apache 2.0</license>
	<description>A Test</description>
	<js-module name="Plugin-Example" src="www/Plugin-Example.js">
		<clobbers target="cordova.plugins.Plugin-Example" />
	</js-module>
	<platform name="ios">
		<config-file parent="/*" target="config.xml">
			<feature name="Plugin-Example">
				<param name="ios-package" value="Plugin-Example" />
			</feature>
		</config-file>
		<source-file src="src/ios/CDVPlugin-Example.m" />
	</platform>
	<platform name="android">
		<config-file parent="/*" target="res/xml/config.xml">
			<feature name="Plugin-Example">
				<param name="android-package" value="com.andrewtremblay.plugintest.Plugin-Example" />
			</feature>
		</config-file>
		<config-file parent="/*" target="AndroidManifest.xml">
		</config-file>
		<source-file src="src/android/Plugin-Example.java" target-dir="src/com/andrewtremblay/plugintest/Plugin-Example" />
	</platform>
</plugin>


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingTop="@dimen/xsolla_base_4"
    android:paddingBottom="@dimen/xsolla_base_4"
    android:baselineAligned="false">

    <FrameLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="@dimen/xsolla_base_8"
        android:layout_marginStart="@dimen/xsolla_base_8"
        android:layout_gravity="center"
        android:background="@color/material_grey_600"
        android:padding="1dp">

            <ImageView
                android:layout_width="@dimen/xsolla_base_32"
                android:layout_height="@dimen/xsolla_base_32"
                android:contentDescription="summary_item_image"
                android:background="@color/xsolla_white"
                android:padding="1dp"
                android:id="@+id/xsolla_iv"/>
    </FrameLayout>

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginLeft="@dimen/xsolla_base_8"
        android:layout_marginStart="@dimen/xsolla_base_8"
        android:layout_weight="3"
        android:layout_gravity="center_vertical">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity=""
            android:textColor="@color/xsolla_black"
            android:textSize="@dimen/xsolla_textMedium"
            android:text="Сhicken Leg"
            android:id="@+id/xsolla_tv_title" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="It is the cooked version of Raw Chicken Leg which is gutted from chicken."
            android:ellipsize="marquee"
            android:id="@+id/xsolla_tv_description" />
        <TextView
            android:visibility="gone"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="@color/xsolla_green"
            android:textSize="@dimen/xsolla_textSmall"
            android:text=" Bonus"
            android:id="@+id/xsolla_tv_bonus"/>
    </LinearLayout>

    <FrameLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:padding="@dimen/xsolla_base_8">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="@color/xsolla_black"
            android:textSize="@dimen/xsolla_textMedium"
            android:text="$19.99"
            android:id="@+id/xsolla_tv_price"
            android:layout_gravity="center" />
    </FrameLayout>

</LinearLayout>


text:
/*
 * decaffeinate suggestions:
 * DS101: Remove unnecessary use of Array.from
 * DS102: Remove unnecessary code created because of implicit returns
 * DS205: Consider reworking code to avoid use of IIFEs
 * DS207: Consider shorter variations of null checks
 * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
 */
const fs = require('fs'); // eslint-disable-line id-length
const path = require('path');

module.exports = function (robot, scripts) {
  const scriptsPath = path.resolve(__dirname, 'src');

  return fs.exists(scriptsPath, (exists) => { // eslint-disable-line consistent-return
    if (exists) {
      return (() => {
        const result = [];

        for (const script of Array.from(fs.readdirSync(scriptsPath))) { // eslint-disable-line no-sync
          if (scripts && !Array.from(scripts).includes('*')) {
            if (Array.from(scripts).includes(script)) {
              result.push(robot.loadFile(scriptsPath, script));
            }
          } else {
            result.push(robot.loadFile(scriptsPath, script));
          }
        }
        return result;
      })();
    }
  });
};


text:
<?php

namespace Sonata\BlockBundle\Form\Type;

use Sonata\BlockBundle\Block\BlockServiceManagerInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class ServiceListType extends AbstractType
{
    protected $manager;

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

    /**
     * {@inheritdoc}
     */
    public function getBlockPrefix()
    {
        return 'sonata_block_service_choice';
    }

    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return $this->getBlockPrefix();
    }

    /**
     * {@inheritdoc}
     */
    public function getParent()
    {
        return 'choice';
    }

    /**
     * {@inheritdoc}
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $this->configureOptions($resolver);
    }

    /**
     * {@inheritdoc}
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $manager = $this->manager;

        $resolver->setRequired(array(
            'context',
        ));

        $resolver->setDefaults(array(
            'multiple'           => false,
            'expanded'           => false,
            'choices'            => function (Options $options, $previousValue) use ($manager) {
                $types = array();
                foreach ($manager->getServicesByContext($options['context'], $options['include_containers']) as $code => $service) {
                    $types[$code] = sprintf('%s - %s', $service->getName(), $code);
                }

                return $types;
            },
            'preferred_choices'  => array(),
            'empty_data'         => function (Options $options) {
                $multiple = isset($options['multiple']) && $options['multiple'];
                $expanded = isset($options['expanded']) && $options['expanded'];

                return $multiple || $expanded ? array() : '';
            },
            'empty_value'        => function (Options $options, $previousValue) {
                $multiple = isset($options['multiple']) && $options['multiple'];
                $expanded = isset($options['expanded']) && $options['expanded'];

                return $multiple || $expanded || !isset($previousValue) ? null : '';
            },
            'error_bubbling'     => false,
            'include_containers' => false,
        ));
    }
}


text:
package rillit

import scala.language.experimental.macros
import scala.reflect.macros.Context
import shapeless.Lens

object Lenser {
  trait StackedLens[A, B, C] extends Lens[A, C] {
    protected def parent: Lens[A, B]
    protected def local: Lens[B, C]
    protected def lens = local compose parent
    def get(x: A) = lens.get(x)
    def set(x: A)(v: C) = lens.set(x)(v)
  }

  trait TopLens[A, B] extends StackedLens[A, A, B] {
    protected def parent = ???
    override protected def lens = local
  }

  /** Our point of contact with the outside world. */
  def apply[A]: Any = macro apply_impl[A]

  def apply_impl[A: c.WeakTypeTag](c: Context) = {
    import c.universe._

    // Each node in the tree has a class and a set of definitions it expects.
    trait Node {
      def classDef: ClassDef
      def defs: List[Tree]
    }

    case class RootNode(classDef: ClassDef) extends Node {
      def defs = classDef :: Nil
    }

    case class NonRootNode(
      classDef: ClassDef,
      lensDef: ClassDef,
      acc: MethodSymbol
    ) extends Node {
      def defs = classDef :: lensDef :: Nil
    }

    def instance(node: Node) = Apply(
      Select(New(Ident(node.classDef.name)), nme.CONSTRUCTOR),
      Nil
    )

    // A convenience method for creating a list of a type's accessor methods.
    def accessors(t: Type) = t.declarations.collect {
      case acc: MethodSymbol if acc.isCaseAccessor => acc
    }.toList

    def childMethods(children: List[Node]) = children.collect {
      case node @ NonRootNode(classDef, _, acc) => DefDef(
        Modifiers(),
        newTermName(acc.name.decoded),
        Nil,
        Nil,
        TypeTree(),
        instance(node)
      )
    }

    val lenser = Select(Ident("rillit"), "Lenser")
    val source = c.weakTypeOf[A]

    val tree = util.Tree.unfold(accessors(source))(
      acc => accessors(acc.returnType)
    ).histo[Node] {
      case (Some(acc), depth, children) =>
        val parent = acc.owner.asClass.toType
        val target = acc.returnType
        val anon = newTypeName(c.fresh)
        val self = newTermName(c.fresh)
        val lens = createLens(c)(acc, parent, target)

        val classDef = ClassDef(
          Modifiers(),
          anon,
          Nil,
          Template(
            TypeTree(
              if (depth == 1) appliedType(
                typeOf[TopLens[_, _]].typeConstructor,
                List(source, target)
              ) else appliedType(
                typeOf[StackedLens[_, _, _]].typeConstructor,
                List(source, parent, target)
              )
            ) :: Nil,
            emptyValDef,
            constructor(c) ::
            ValDef(
              Modifiers(Flag.PROTECTED),
              newTermName("local"),
              TypeTree(),
              Apply(Select(New(Ident(lens.name)), nme.CONSTRUCTOR), Nil)
            ) :: childMethods(children.map(_.value))
          )
        )

        NonRootNode(classDef, lens, acc)

     case (None, _, children) =>
        RootNode(ClassDef(
          Modifiers(),
          newTypeName(c.fresh),
          Nil,
          Template(
            Ident(newTypeName("AnyRef")) :: Nil,
            emptyValDef,
            constructor(c) :: childMethods(children.map(_.value))
          )
        ))
    }

    def assignParents(parentIf: Option[ClassDef])(
      tree: util.Tree[Node]
    ): util.Tree[Node] = {
      val node = parentIf.fold(tree.value) { parent =>
        val NonRootNode(
          ClassDef(mods, className, tps, Template(parents, _, body)),
          other,
          acc
        ) = tree.value

        NonRootNode(
          ClassDef(
            mods,
            className,
            tps,
            Template(
              parents,
              emptyValDef,
              ValDef(
                Modifiers(),
                newTermName("parent"),
                TypeTree(),
                Apply(Select(New(Ident(parent.name)), nme.CONSTRUCTOR), Nil)
              ) :: body
            )
          ),
          other,
          acc
        )
      }

      util.Tree(
        node,
        tree.depth,
        tree.children.map(assignParents(Some(node.classDef)))
      )
    }

    val withParents = util.Tree(
      tree.value,
      tree.depth,
      tree.children.map(assignParents(None))
    )

    c.Expr(
      Block(
        withParents.flatten.flatMap(_.defs),
        instance(withParents.value)
      )
    )
  }

  def createLens(c: Context)(
    acc: c.universe.MethodSymbol,
    source: c.universe.Type,
    target: c.universe.Type
  ) = {
    import c.universe._

      val target = acc.returnType
      val anon = newTypeName(c.fresh)
      val lens = newTermName(c.fresh)
      val gx = newTermName(c.fresh)
      val sx = newTermName(c.fresh)
      val sv = newTermName(c.fresh)

      val getter = DefDef(
        Modifiers(),
        newTermName("get"),
        Nil,
        List(
          ValDef(Modifiers(Flag.PARAM), gx, TypeTree(source), EmptyTree) :: Nil
        ),
        TypeTree(),
        Select(Ident(gx), acc.name)
      )

      val setter = DefDef(
        Modifiers(),
        newTermName("set"),
        Nil,
        List(
          List( ValDef(Modifiers(Flag.PARAM), sx, TypeTree(source), EmptyTree) ),
          List( ValDef(Modifiers(Flag.PARAM), sv, TypeTree(target), EmptyTree) )
        ),
        TypeTree(),
        Apply(
          Select(Ident(sx), "copy"),
          AssignOrNamedArg(Ident(acc.name), Ident(sv)) :: Nil
        )
      )

      ClassDef(
        Modifiers(Flag.FINAL),
        anon,
        Nil,
        Template(
          TypeTree(
            appliedType(
              typeOf[Lens[_, _]].typeConstructor,
              List(source, target)
            )
          ) :: Nil,
          emptyValDef,
          List(constructor(c), getter, setter)
        )
      )
    }

  /** Convenience method for creating an empty constructor tree. */
  def constructor(c: Context) = {
    import c.universe._

    DefDef(
      Modifiers(),
      nme.CONSTRUCTOR,
      Nil,
      Nil :: Nil,
      TypeTree(),
      Block(
        Apply(
          Select(Super(This(tpnme.EMPTY), tpnme.EMPTY), nme.CONSTRUCTOR),
          Nil
        ) :: Nil,
        c.literalUnit.tree
      )
    )
  }
}


text:
=pod

=head1 NAME

X509_check_purpose - Check the purpose of a certificate

=head1 SYNOPSIS

 #include <openssl/x509v3.h>

 int X509_check_purpose(X509 *x, int id, int ca);

=head1 DESCRIPTION

This function checks if certificate I<x> was created with the purpose
represented by I<id>. If I<ca> is nonzero, then certificate I<x> is
checked to determine if it's a possible CA with various levels of certainty
possibly returned.

Below are the potential ID's that can be checked:

 # define X509_PURPOSE_SSL_CLIENT        1
 # define X509_PURPOSE_SSL_SERVER        2
 # define X509_PURPOSE_NS_SSL_SERVER     3
 # define X509_PURPOSE_SMIME_SIGN        4
 # define X509_PURPOSE_SMIME_ENCRYPT     5
 # define X509_PURPOSE_CRL_SIGN          6
 # define X509_PURPOSE_ANY               7
 # define X509_PURPOSE_OCSP_HELPER       8
 # define X509_PURPOSE_TIMESTAMP_SIGN    9

The checks performed take into account the X.509 extensions
keyUsage, extendedKeyUsage, and basicConstraints.

=head1 RETURN VALUES

For non-CA checks

=over 4

=item -1 an error condition has occurred

=item E<32>1 if the certificate was created to perform the purpose represented by I<id>

=item E<32>0 if the certificate was not created to perform the purpose represented by I<id>

=back

For CA checks the below integers could be returned with the following meanings:

=over 4

=item -1 an error condition has occurred

=item E<32>0 not a CA or does not have the purpose represented by I<id>

=item E<32>1 is a CA.

=item E<32>2 Only possible in old versions of openSSL when basicConstraints are absent.
         New versions will not return this value. May be a CA

=item E<32>3 basicConstraints absent but self signed V1.

=item E<32>4 basicConstraints absent but keyUsage present and keyCertSign asserted.

=item E<32>5 legacy Netscape specific CA Flags present

=back

=head1 COPYRIGHT

Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this
file except in compliance with the License. You can obtain a copy in the file
LICENSE in the source distribution or at L<https://www.openssl.org/source/license.html>.

=cut


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/baseLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <View
        android:id="@+id/background"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:background="#a1000000"
        android:visibility="invisible"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <com.benny.openlauncher.widget.Desktop
        android:id="@+id/desktop"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginBottom="4dp"
        app:layout_constraintBottom_toTopOf="@+id/desktopIndicator"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/clockFrame" />

    <include
        android:id="@+id/clockFrame"
        layout="@layout/view_search_bar"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginEnd="16dp"
        android:layout_marginLeft="16dp"
        android:layout_marginRight="16dp"
        android:layout_marginStart="16dp"
        android:layout_marginTop="16dp"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <View
        android:id="@+id/left"
        android:layout_width="20dp"
        android:layout_height="0dp"
        android:alpha="0"
        android:background="@drawable/outlinebg"
        android:translationX="-6dp"
        app:layout_constraintBottom_toBottomOf="@+id/desktop"
        app:layout_constraintLeft_toLeftOf="@+id/desktop"
        app:layout_constraintTop_toTopOf="@+id/desktop" />

    <View
        android:id="@+id/right"
        android:layout_width="20dp"
        android:layout_height="0dp"
        android:alpha="0"
        android:background="@drawable/outlinebg"
        android:translationX="6dp"
        app:layout_constraintBottom_toBottomOf="@+id/desktop"
        app:layout_constraintRight_toRightOf="@+id/desktop"
        app:layout_constraintTop_toTopOf="@+id/desktop" />

    <com.benny.openlauncher.widget.PagerIndicator
        android:id="@+id/desktopIndicator"
        android:layout_width="0dp"
        android:layout_height="10dp"
        android:layout_marginBottom="4dp"
        app:layout_constraintBottom_toTopOf="@+id/dock"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent" />

    <com.benny.openlauncher.widget.Dock
        android:id="@+id/dock"
        android:layout_width="0dp"
        android:layout_height="70dp"
        android:fitsSystemWindows="true"
        android:paddingEnd="8dp"
        android:paddingLeft="8dp"
        android:paddingRight="8dp"
        android:paddingStart="8dp"
        android:paddingTop="0dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent" />

    <com.benny.openlauncher.widget.SearchBar
        android:id="@+id/searchBar"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginLeft="16dp"
        android:layout_marginRight="16dp"
        android:layout_marginTop="0dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="@+id/clockFrame" />

    <com.benny.openlauncher.widget.DesktopOptionView
        android:id="@+id/desktopEditOptionPanel"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginBottom="20dp"
        android:fitsSystemWindows="true"
        android:visibility="invisible"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent" />

    <com.benny.openlauncher.widget.AppDrawerController
        android:id="@+id/appDrawerController"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:fitsSystemWindows="true"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <com.benny.openlauncher.widget.DragOptionView
        android:id="@+id/dragOptionPanel"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="8dp"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:layout_marginStart="8dp"
        android:fitsSystemWindows="true"
        app:cardBackgroundColor="@color/Light.Background"
        app:cardCornerRadius="2dp"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <com.benny.openlauncher.widget.GroupPopupView
        android:id="@+id/groupPopup"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintHorizontal_bias="1.0"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="1.0" />

</android.support.constraint.ConstraintLayout>


text:
<?php
namespace TYPO3\CMS\Recordlist\LinkHandler;

use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Resource\FileInterface;
use TYPO3\CMS\Core\Resource\Folder;
use TYPO3\CMS\Core\Resource\InaccessibleFolder;
use TYPO3\CMS\Core\Resource\ResourceInterface;

/**
 * Link handler for folder links
 */
class FolderLinkHandler extends FileLinkHandler
{
    /**
     * @var string
     */
    protected $mode = 'folder';

    /**
     * @var string
     */
    protected $additionalFolderClass = 'bg-success';

    /**
     * @var string
     */
    protected $expectedClass = Folder::class;

    /**
     * @return string
     */
    protected function getTitle()
    {
        return $this->getLanguageService()->getLL('folders');
    }

    /**
     * @param Folder $folder
     * @param string $extensionList
     * @return FileInterface[]
     */
    protected function getFolderContent(Folder $folder, $extensionList)
    {
        return $folder->getSubfolders();
    }

    /**
     * Renders a single item displayed in the current folder
     *
     * @param ResourceInterface $fileOrFolderObject
     *
     * @return array
     * @throws \InvalidArgumentException
     */
    protected function renderItem(ResourceInterface $fileOrFolderObject)
    {
        if (!$fileOrFolderObject instanceof Folder) {
            throw new \InvalidArgumentException('Expected Folder object, got "' . get_class($fileOrFolderObject) . '" object.', 1443651369);
        }
        $fileIdentifier = $fileOrFolderObject->getCombinedIdentifier();
        $overlay = null;
        if ($fileOrFolderObject instanceof InaccessibleFolder) {
            $overlay = ['status-overlay-locked' => []];
        }
        $icon = 'getName()) . '">'
            . $this->iconFactory->getIcon('apps-filetree-folder-default', Icon::SIZE_SMALL, $overlay)->render()
            . '';
        return [$fileIdentifier, $icon];
    }
}


text:
var React = {
  createElement(elName, props) {
    return { elName, props };
  }
}

Tinytest.add('typescript - runtime - react', (test) => {
  {
    let props = {
      style: { display: 'block' }
    };
    class Component {
      render() {
        return <div {...props} />;
      }
    }

    let element = { elName: 'div', props };
    test.equal((new Component()).render(), element);
  }
});


text:
/* ============================================================================
  Surface Decal Demo
  By Damian Trebilco

  Origional base lighting demo by "Humus"
============================================================================ */

/***********      .---.         .-"-.      *******************\
* -------- *     /   ._.       / ´ ` \     * ---------------- *
* Author's *     \_  (__\      \_°v°_/     * humus@rogers.com *
*   note   *     //   \\       //   \\     * ICQ #47010716    *
* -------- *    ((     ))     ((     ))    * ---------------- *
*          ****--""---""-------""---""--****                  ********\
* This file is a part of the work done by Humus. You are free to use  *
* the code in any way you like, modified, unmodified or copy'n'pasted *
* into your own work. However, I expect you to respect these points:  *
*  @ If you use this file and its contents unmodified, or use a major *
*    part of this file, please credit the author and leave this note. *
*  @ For use in anything commercial, please request my approval.      *
*  @ Share your work and ideas too as much as you can.                *
\*********************************************************************/

#include "App.h"

GLint
gluUnProject(GLdouble winx, GLdouble winy, GLdouble winz,
	     const GLdouble model[16], const GLdouble proj[16],
	     const GLint viewport[4],
	     GLdouble * objx, GLdouble * objy, GLdouble * objz);

// Structure containing all the editor only data
struct EditorData
{
  EditorData();

  bool m_isEditorMode;    //!< If currently in editor mode
  bool m_isLeftMouseDown; //!< State of the left mouse button
  bool m_isRightMouseDown; //!< State of the right mouse button

  bool m_debugRenderMode;  //!< Debug render mode
  bool m_wireframeOverlay; //!< If rendering a wireframe overlay

  float m_editSphereSize; //!< Size of the editor sphere
  vec3 m_editSpherePos;   //!< The editor sphere position

  bool m_editWeights;     //!< If editing vertex weights (otherwise editing material type)

  float m_weightInc;      //!< Weight edit increment (decrement if negative)

  int m_materialID;       //!< The current editing material ID
  int m_layerIndex;       //!< The current editing layer
};
EditorData s_editorData;

EditorData::EditorData()
: m_isEditorMode(false)
, m_isLeftMouseDown(false)
, m_isRightMouseDown(false)
, m_debugRenderMode(false)
, m_wireframeOverlay(true)
, m_editSphereSize(50.0f)
, m_editSpherePos(0.0f, 0.0f, 0.0f)
, m_editWeights(true)
, m_weightInc(1.0f)
, m_materialID(0)
, m_layerIndex(0)
{
}

void ConvertMatrix(const mat4 &srcMat, GLdouble outMat[16])
{
  // Loop and convert to double format
  const float * srcData = (const float*)value_ptr(srcMat);
  for(int i=0; i< 16; i++){
    outMat[i] = srcData[i];
  }
}

bool App::GetCollisionTriangle(const int a_x, const int a_y, vec3 & a_colPoint, const BTri *& a_colTriangle)
{
  vec3 newPos;
  vec3 targetPos;

  // Calculate the screen target position
  {
    GLdouble modelview[16];
    GLdouble projection[16];
    GLint viewport[4] ={0, 0, width, height};

    GLdouble posX, posY, posZ;

    ConvertMatrix(m_projectionMatrix, projection);
    ConvertMatrix(m_modelviewMatrix, modelview);

    gluUnProject((GLdouble)a_x, (GLdouble)height - (GLdouble)a_y, 1.0,
         modelview, projection,
	       viewport,
	       &posX, &posY, &posZ);

    targetPos = vec3((float)posX, (float)posY, (float)posZ);
  }

  // Check for a collision between the last and new position
  return m_bsp.intersects(camPos, targetPos, &a_colPoint, &a_colTriangle);
}

void App::PaintWeights(const vec3 & a_spherePos, float a_sphereSize, bool a_add)
{
  // Get all the vertices in the sphere area
  Array<uint> indices;
  m_map->GetSphereVertices(a_spherePos, a_sphereSize, indices);
  for(uint i = 0; i < indices.getCount(); i++)
  {
    // Loop and update each vertex
    SurfaceDecalModel::MatVertexData updateData;
    uint vertIndex = indices[i];
    if(m_map->GetVertexMatData(vertIndex, updateData))
    {
      // Add or subtract the weight value
      if(a_add)
      {
        updateData.m_matWeight += (s_editorData.m_weightInc * frameTime);
      }
      else
      {
        updateData.m_matWeight -= (s_editorData.m_weightInc * frameTime);
      }
      updateData.m_matWeight = clamp(updateData.m_matWeight, 0.0f, 1.0f);

      m_map->UpdateVertex(renderer, vertIndex, updateData);
    }
  }
}

void App::PaintSurface(const int x, const int y)
{
  // Calculate the collision point into the BSP
  vec3 colPoint;
  const BTri * colTri;
  if(GetCollisionTriangle(x, y, colPoint, colTri))
  {
    // The triangle index is the collision data
    uint triIndex = (uint)(colTri->data);

    // Get the existing data
    SurfaceDecalModel::MatVertexData updateData;
    if(m_map->GetTriangleMatData(triIndex, updateData))
    {
      ASSERT(s_editorData.m_layerIndex >= 0 && s_editorData.m_layerIndex < 4);
      updateData.m_matSelect[s_editorData.m_layerIndex] = s_editorData.m_materialID;

      // Update the triangle data
      m_map->UpdateTriangle(renderer, triIndex, updateData);
    }
  }
}

bool App::GetSpherePosition(const int x, const int y)
{
  vec3 newPos;
  vec3 targetPos;

  // Calculate the screen target position
  {
    GLdouble modelview[16];
    GLdouble projection[16];
    GLint viewport[4] ={0 , 0, width, height};

    GLdouble posX, posY, posZ;

    ConvertMatrix(m_projectionMatrix, projection);
    ConvertMatrix(m_modelviewMatrix, modelview);

    float srcZ = 1.0f;
	  glReadPixels( x, height - y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &srcZ );

    gluUnProject((GLdouble)x, (GLdouble)height - (GLdouble)y, srcZ, //1.0,
         modelview, projection,
	       viewport,
	       &posX, &posY, &posZ);

    targetPos = vec3((float)posX, (float)posY, (float)posZ);
  }

  // Get the new position as slightly offset from the surface intersection
  newPos = targetPos - (normalize(targetPos - camPos) * s_editorData.m_editSphereSize * 0.3f);

  /*
  // Check for a collision between the last and new position
  vec3 colPoint;
  const BTri *colTriangle;
  if(bsp.intersects(camPos, targetPos, &colPoint, &colTriangle)){

    // Don't land exactly on the plane,
    newPos = colPoint + 10.0f * colTriangle->plane.xyz();
  }
  else{
    return false;
  }
*/

  // Assign the editor data new position
  s_editorData.m_editSpherePos = newPos;

  return true;
}

bool App::onKeyEditor(const uint key, const bool pressed)
{
  // Toggle in/out of editor mode
  if(key == KEY_E && pressed)
  {
    s_editorData.m_isEditorMode = !s_editorData.m_isEditorMode;
  }

  // If not in editor mode, return now
  if(!s_editorData.m_isEditorMode)
  {
    s_editorData.m_isLeftMouseDown = false;
    s_editorData.m_isRightMouseDown = false;
    return false;
  }

  if(pressed)
  {
    // Toggle the editor mode
    if(key == KEY_M)
    {
      s_editorData.m_editWeights = !s_editorData.m_editWeights;
    }

    // Save the editor changes
    if(key == KEY_S)
    {
      m_map->SaveVertexData("../Models/Room6/Map0.vd");
    }
    if(key == KEY_L)
    {
      m_map->LoadVertexData("../Models/Room6/Map0.vd", renderer);
    }

    if(key == KEY_1)
    {
      s_editorData.m_debugRenderMode = true;
    }

    if(key == KEY_2)
    {
      s_editorData.m_debugRenderMode = false;
    }

    if(key == KEY_3)
    {
      s_editorData.m_wireframeOverlay = !s_editorData.m_wireframeOverlay;
    }

    if(s_editorData.m_editWeights)
    {
      // Change weight intensity
      if(key == KEY_NUMPAD8)
      {
        s_editorData.m_weightInc += 0.1f;
      }
      if(key == KEY_NUMPAD2)
      {
        s_editorData.m_weightInc -= 0.1f;
      }

      s_editorData.m_weightInc = clamp(s_editorData.m_weightInc, 0.0f, 3.0f);
    }
    else
    {
      // Change material edit params
      if(key == KEY_NUMPAD8)
      {
        s_editorData.m_layerIndex += 1;
      }
      if(key == KEY_NUMPAD2)
      {
        s_editorData.m_layerIndex -= 1;
      }

      if(key == KEY_NUMPAD4)
      {
        s_editorData.m_materialID -= 1;
      }
      if(key == KEY_NUMPAD6)
      {
        s_editorData.m_materialID += 1;
      }

      // Wrap clamp
      if(s_editorData.m_layerIndex < 0)
      {
        s_editorData.m_layerIndex += 4;
      }
      if(s_editorData.m_layerIndex >= 4)
      {
        s_editorData.m_layerIndex -= 4;
      }

      if(s_editorData.m_materialID < 0)
      {
        s_editorData.m_materialID += 256;
      }
      if(s_editorData.m_materialID >= 256)
      {
        s_editorData.m_materialID -= 256;
      }
    }
  }

  return true;
}

bool App::onMouseWheelEditor(const int x, const int y, const int scroll)
{
  // If not in editor mode, return now
  if(!s_editorData.m_isEditorMode){
    return false;
  }

  // Adjust the sphere placement size
  s_editorData.m_editSphereSize = clamp(s_editorData.m_editSphereSize + (float)scroll, 0.0f, 700.0f);

  return true;
}

bool App::onMouseButtonEditor(const int x, const int y, const MouseButton button, const bool pressed)
{
  // If not in editor mode, return now
  if(!s_editorData.m_isEditorMode)
  {
    return false;
  }

  // Set if the mouse is down
  if(button == MOUSE_LEFT)
  {
    s_editorData.m_isLeftMouseDown = pressed;
  }
  if(button == MOUSE_RIGHT)
  {
    s_editorData.m_isRightMouseDown = pressed;
  }

  // Paint the surface if necessary
  if(!s_editorData.m_editWeights &&
     s_editorData.m_isLeftMouseDown)
  {
    PaintSurface(x, y);
  }

  return true;
}

bool App::onMouseMoveEditor(const int x, const int y, const int deltaX, const int deltaY)
{
  // If not in editor mode, return now
  if(!s_editorData.m_isEditorMode){
    return false;
  }

  // Get the new sphere position
  GetSpherePosition(x,y);

  // Paint the surface if necessary
  if(!s_editorData.m_editWeights &&
     s_editorData.m_isLeftMouseDown)
  {
    PaintSurface(x, y);
  }

  return true;
}

ShaderID App::GetRenderShader()
{
  // If it is the standard shader
  if(!s_editorData.m_isEditorMode ||
     !s_editorData.m_debugRenderMode)
  {
    return m_lightingMP_ambient;
  }

  // Return a debug renderer
  if(s_editorData.m_editWeights)
  {
    return m_debugVertexWeights;
  }
  else
  {
    return m_debugMatData;
  }
}

void App::SetDebugShaderConstants()
{
  // Set the debug shader constants if necessary
  if(s_editorData.m_isEditorMode &&
     s_editorData.m_debugRenderMode &&
     !s_editorData.m_editWeights)
  {
    renderer->setShaderConstant1f("debugMatIndex", (float)s_editorData.m_layerIndex);
  }
}

void App::drawFrameEditor()
{
  // If not in editor mode, return now
  if(!s_editorData.m_isEditorMode){
    return;
  }

  // Update the weights if necessary
  if(s_editorData.m_editWeights &&
     (s_editorData.m_isLeftMouseDown ||
      s_editorData.m_isRightMouseDown))
  {
    PaintWeights(s_editorData.m_editSpherePos, s_editorData.m_editSphereSize, s_editorData.m_isLeftMouseDown);
  }

  // Draw the wireframe if necessary
  if(s_editorData.m_wireframeOverlay)
  {
    glLineWidth(5.0f);

    renderer->reset();
    renderer->setShader(m_colorOnly);
    renderer->setRasterizerState(m_wireFrameRS);
    renderer->setDepthState(noDepthWrite);
    renderer->apply();

    renderer->setShaderConstant4f("outColor", vec4(1.0f, 1.0f, 1.0f, 1.0f));
    renderer->applyConstants();

    m_map->draw(renderer);
  }

  // Draw the light sphere volumes into the scene
  renderer->reset();
  renderer->setShader(m_lightingColorOnly);
  renderer->setBlendState(m_blendAdd);
  renderer->setRasterizerState(cullNone);
  renderer->setDepthState(noDepthWrite);
  renderer->apply();

  renderer->setShaderConstant3f("lightPos", s_editorData.m_editSpherePos);
  renderer->setShaderConstant1f("lightRadius", s_editorData.m_editSphereSize);
  renderer->setShaderConstant4f("outColor", vec4(0.5f, 0.5f, 0.0f, 0.5f));
  renderer->applyConstants();

  // Draw a sphere the radius of the light
  m_sphereModel->draw(renderer);

  // Draw text data to the screen
	renderer->setup2DMode(0, (float) width, 0, (float) height);

  // Draw the current light index to the screen
	char str[512];
  int offset = 0;

  // Display the edit mode strings
  if(s_editorData.m_editWeights)
  {
	  renderer->drawText("Blend Weights Edit Mode", (float)width - (14 * 30) - 8, 8.0f + offset, 30, 38, defaultFont, linearClamp, blendSrcAlpha, noDepthTest);

    offset += 38;
    sprintf(str, "Weight Adjustment %.2f", s_editorData.m_weightInc);
	  renderer->drawText(str, (float)width - (14 * 30) - 8, 8.0f + offset, 30, 38, defaultFont, linearClamp, blendSrcAlpha, noDepthTest);
  }
  else
  {
    renderer->drawText("Material Edit Mode", (float)width - (14 * 30) - 8, 8.0f + offset, 30, 38, defaultFont, linearClamp, blendSrcAlpha, noDepthTest);

    offset += 38;
    sprintf(str, "Material %d", s_editorData.m_materialID + 1); // Add 1 to be artist friendly
	  renderer->drawText(str, (float)width - (14 * 30) - 8, 8.0f + offset, 30, 38, defaultFont, linearClamp, blendSrcAlpha, noDepthTest);

    offset += 38;
    sprintf(str, "Layer %d", s_editorData.m_layerIndex + 1); // Add 1 to be artist friendly
	  renderer->drawText(str, (float)width - (14 * 30) - 8, 8.0f + offset, 30, 38, defaultFont, linearClamp, blendSrcAlpha, noDepthTest);
  }
}


text:
<?php
class PageController extends BaseController {

	protected $layout = 'layout.main';
    protected $user;

    // For Future Use
    public function __construct(Illuminate\Support\Facades\Auth $auth)
    {
        $this->user = $auth::User();
    }

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

	public function missingMethod($parameters = array())
	{
		$layout->title = 'Not Found';
		$layout->content = View::make("errors.missing")->with('exception', 'Page Not Found!');
		return Response::make($layout, 404);
	}
}


text:
module SimpleGame {
    export class Game extends Phaser.Game {

        private self = this;

        static global = {
            playerX: 140,
            playerY: 2500,
            screenWidth: 640,
            screenHeight: 800,
            levelsMusic: null,
            volume: 0.3
        };

        constructor() {
            super(Game.global.screenWidth, Game.global.screenHeight, Phaser.AUTO, 'content', null);
            this.state.add('Boot', Boot, false);
            this.state.add('Preloader', Preloader, false);
            this.state.add('MainMenu', MainMenu, false);
            this.state.add('SelectMap', SelectMap, false);
            this.state.add('Level1', Level1, false);
            this.state.start('Boot');
        }
        preload() {
        }
        render() {
            // This renders debug information about physics bodies
            // this.debug.game;
        }
    }
}


text:
{% set page = {
	hide: {
		globalnav: true
	}
} %}

{% extends currentApp.filePaths.layoutsDir + "default.html" %}

{% block main_content %}

Sign in

Enter your email address and password to access your allocated cases.

	  <form action="login" method="post">

	  	  Email address
	  	  <input class="form-control form-control-1-1" id="username" name="username" type="text" autocomplete="off">

	  	  Password
	  	  <input class="form-control form-control-1-1" id="password" name="password" type="password" autocomplete="off">

	    <fieldset class="primary-nav form-group">
	      <legend class="visuallyhidden">Form Navigation</legend>
	      <input type="submit" value="Continue" class="button" id="submitButton" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">
	    </fieldset>

Forgotten your password?

	  </form>

{% endblock %}


text:
module RecombeeApiClient
  require_relative 'request'
  require_relative '../errors'

  ##
  #Deletes an existing view portion specified by (`userId`, `itemId`, `sessionId`) from the database.
  #
  class DeleteViewPortion < ApiRequest
    attr_reader :user_id, :item_id, :session_id
    attr_accessor :timeout
    attr_accessor :ensure_https

  ##
  # * *Required arguments*
  #   - +user_id+ -> ID of the user who rated the item.
  #   - +item_id+ -> ID of the item which was rated.
  #
  # * *Optional arguments (given as hash optional)*
  #   - +sessionId+ -> Identifier of a session.
  #
    def initialize(user_id, item_id, optional = {})
      @user_id = user_id
      @item_id = item_id
      optional = normalize_optional(optional)
      @session_id = optional['sessionId']
      @optional = optional
      @timeout = 1000
      @ensure_https = false
      @optional.each do |par, _|
        fail UnknownOptionalParameter.new(par) unless ["sessionId"].include? par
      end
    end

    # HTTP method
    def method
      :delete
    end

    # Values of body parameters as a Hash
    def body_parameters
      p = Hash.new
      p
    end

    # Values of query parameters as a Hash.
    # name of parameter => value of the parameter
    def query_parameters
      params = {}
      params['userId'] = @user_id
      params['itemId'] = @item_id
      params['sessionId'] = @optional['sessionId'] if @optional['sessionId']
      params
    end

    # Relative path to the endpoint
    def path
      "/{databaseId}/viewportions/"
    end
  end
end


text: var ENV = "development";


text:
<?php

namespace Magento\Customer\Model\Config;

/**
 * Customer sharing config model
 *
 * @author      Magento Core Team <core@magentocommerce.com>
 */
class Share extends \Magento\Framework\App\Config\Value implements \Magento\Framework\Option\ArrayInterface
{
    /**
     * Xml config path to customers sharing scope value
     *
     */
    const XML_PATH_CUSTOMER_ACCOUNT_SHARE = 'customer/account_share/scope';

    /**
     * Possible customer sharing scopes
     *
     */
    const SHARE_GLOBAL = 0;

    const SHARE_WEBSITE = 1;

    /**
     * @var \Magento\Customer\Model\ResourceModel\Customer
     */
    protected $_customerResource;

    /** @var  \Magento\Store\Model\StoreManagerInterface */
    protected $_storeManager;

    /**
     * Constructor
     *
     * @param \Magento\Framework\Model\Context $context
     * @param \Magento\Framework\Registry $registry
     * @param \Magento\Framework\App\Config\ScopeConfigInterface $config
     * @param \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList
     * @param \Magento\Store\Model\StoreManagerInterface $storeManager
     * @param \Magento\Customer\Model\ResourceModel\Customer $customerResource
     * @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
     * @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
     * @param array $data
     */
    public function __construct(
        \Magento\Framework\Model\Context $context,
        \Magento\Framework\Registry $registry,
        \Magento\Framework\App\Config\ScopeConfigInterface $config,
        \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Customer\Model\ResourceModel\Customer $customerResource,
        \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
        \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
        array $data = []
    ) {
        $this->_storeManager = $storeManager;
        $this->_customerResource = $customerResource;
        parent::__construct($context, $registry, $config, $cacheTypeList, $resource, $resourceCollection, $data);
    }

    /**
     * Check whether current customers sharing scope is global
     *
     * @return bool
     */
    public function isGlobalScope()
    {
        return !$this->isWebsiteScope();
    }

    /**
     * Check whether current customers sharing scope is website
     *
     * @return bool
     */
    public function isWebsiteScope()
    {
        return $this->_config->getValue(
            self::XML_PATH_CUSTOMER_ACCOUNT_SHARE,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE
        ) == self::SHARE_WEBSITE;
    }

    /**
     * Get possible sharing configuration options
     *
     * @return array
     */
    public function toOptionArray()
    {
        return [self::SHARE_GLOBAL => __('Global'), self::SHARE_WEBSITE => __('Per Website')];
    }

    /**
     * Check for email duplicates before saving customers sharing options
     *
     * @return $this
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function beforeSave()
    {
        $value = $this->getValue();
        if ($value == self::SHARE_GLOBAL) {
            if ($this->_customerResource->findEmailDuplicates()) {
                //@codingStandardsIgnoreStart
                throw new \Magento\Framework\Exception\LocalizedException(
                    __(
                        'We can\'t share customer accounts globally when the accounts share identical email addresses on more than one website.'
                    )
                );
                //@codingStandardsIgnoreEnd
            }
        }
        return $this;
    }

    /**
     * Returns shared website Ids.
     *
     * @param int $websiteId the ID to use if website scope is on
     * @return int[]
     */
    public function getSharedWebsiteIds($websiteId)
    {
        $ids = [];
        if ($this->isWebsiteScope()) {
            $ids[] = $websiteId;
        } else {
            foreach ($this->_storeManager->getWebsites() as $website) {
                $ids[] = $website->getId();
            }
        }
        return $ids;
    }
}


text:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">

  <title>Qt 4.3: Qt 3 Support Members for QUrl</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />

  	Home · All Classes · Main Classes · Grouped Classes · Modules · Functions

Qt 3 Support Members for QUrl

The following class members are part of the Qt 3 support layer. They are provided to help you port old code to Qt 4. We advise against using them in new code.

QUrl class reference

Public Functions

void addPath ( const QString & p )

bool cdUp ()

QString dirPath () const

QString fileName () const

bool hasHost () const

bool hasPassword () const

bool hasPath () const

bool hasPort () const

bool hasRef () const

bool hasUser () const

QString protocol () const

QString query () const

QString ref () const

void setFileName ( const QString & txt )

void setProtocol ( const QString & s )

void setQuery ( const QString & txt )

void setRef ( const QString & txt )

void setUser ( const QString & s )

QString user () const

operator QString () const

Static Public Members

void decode ( QString & url )

void encode ( QString & url )

bool isRelativeUrl ( const QString & url )

Protected Functions

void reset ()

Member Function Documentation

void QUrl::addPath ( const QString & p )

Use setPath() instead.

bool QUrl::cdUp ()

Use resolved("..") instead.

For example, if you have code like

 QUrl url("http://www.trolltech.com/Developer/");
 url.cdUp();

you can rewrite it as

 QUrl url("http://www.trolltech.com/Developer/");
 url = url.resolved("..");

void QUrl::decode ( QString & url )  <tt> [static]</tt>

Use fromPercentEncoding() instead.

QString QUrl::dirPath () const

Use QFileInfo(path()).absolutePath() or QFileInfo(path()) instead.

void QUrl::encode ( QString & url )  <tt> [static]</tt>

Use toPercentEncoding() instead.

QString QUrl::fileName () const

Use QFileInfo(path()).fileName() instead.

See also setFileName().

bool QUrl::hasHost () const

Use !host().isEmpty() instead.

bool QUrl::hasPassword () const

Use !password().isEmpty() instead.

bool QUrl::hasPath () const

Use !path().isEmpty() instead.

bool QUrl::hasPort () const

Use port() != -1 instead.

bool QUrl::hasRef () const

Use !fragment().isEmpty() instead.

bool QUrl::hasUser () const

Use !userName().isEmpty() instead.

bool QUrl::isRelativeUrl ( const QString & url )  <tt> [static]</tt>

Use isRelative() instead.

QString QUrl::protocol () const

Use scheme() instead.

See also setProtocol().

QString QUrl::query () const

Use encodedQuery() instead.

See also setQuery().

QString QUrl::ref () const

Use fragment() instead.

See also setRef().

void QUrl::reset ()  <tt> [protected]</tt>

Use clear() instead.

void QUrl::setFileName ( const QString & txt )

Use setPath() instead.

See also fileName().

void QUrl::setProtocol ( const QString & s )

Use setScheme() instead.

See also protocol().

void QUrl::setQuery ( const QString & txt )

Use setEncodedQuery() instead.

See also query().

void QUrl::setRef ( const QString & txt )

Use setFragment() instead.

See also ref().

void QUrl::setUser ( const QString & s )

Use setUserName() instead.

See also user().

QString QUrl::user () const

Use userName() instead.

See also setUser().

QUrl::operator QString () const

Use toString() instead.

<address>

Copyright © 2008 Trolltech
Trademarks

Qt 4.3.5

</address>


text:
<!doctype html>
<meta charset="utf-8">
<title>Test Payment App</title>

Account balance: $10.00

<button>Authorize</button>


text:
    - intial version
#### 1.1.0
    - Added PageAction and RecordAction options to query options
#### 1.2.0
	- all functions that take entityID remove {} that is added by Xrm.Page getEntityID so you don't have to pre-process it before passing to API
#### 1.2.1
	- allow entity ID to be null when passed to .Get and just use collection name as passed
#### 1.3.0
	- Added support for Expand query option

# CRMWebAPIMetadata.js Releases
#### 1.0.0
	- initial version
#### 1.1.3
    - added support for GetEntityDisplayNameList
#### 1.2.0
	- added support for GetAttributeDisplayNameList
#### 1.2.1
 	- added filter to GetAttributeDisplayNamelist for attributeof and no read, added ODataLogicalName to handle Owner,Customer and Lookup
#### 1.3.0
 	- Added CopyEntityAttribute function (note Boolean and Picklist types have a CRM bug)
#### 1.3.1
 	- Got CopyEntityAttribute to create Boolean and Picklists - as long as picklist isn't global - that is still outstanding
#### 1.3.2
 	- Got CopyEntityAttribute to create OptionSets pointing to global optionset values


text:
@implementation NSString (flxExtensions)
+ (BOOL) string:(NSString *)string1 isEqualToString:(NSString *)string2{
    if (!string1.length && !string2.length) return YES;
    else if (!string1.length && string2.length) return NO;
    else if (string1.length && !string2.length) return NO;
    else if ([string1 isEqual:string2]) return YES;
    else return NO;
}
+ (NSString *) newGUID{
    CFUUIDRef theUUID = CFUUIDCreate(NULL);
    CFStringRef string = CFUUIDCreateString(NULL, theUUID);
    CFRelease(theUUID);
    return (__bridge_transfer NSString *)string;
}
+ (NSString *) randomStringLength:(int)len{

    NSMutableString *randomString = [NSMutableString stringWithCapacity: len];
    for (int i=0; i<len; i++) {
        [randomString appendFormat: @"%C", [LettersForGeneration characterAtIndex: arc4random() % [LettersForGeneration length]]];
    }

    return randomString;
}
- (NSString *) stringBySeparatingWords{
    BOOL lastUpper = YES;
    NSCharacterSet *uppers = [NSCharacterSet uppercaseLetterCharacterSet];
    NSMutableString *new = [NSMutableString stringWithCapacity:self.length * 2];
    for (int i = 0; i < self.length; i++){
        unichar c = [self characterAtIndex:i];
        if ([uppers characterIsMember:c]){
            if (!lastUpper){
                [new appendString:@" "];
            }
            lastUpper = YES;
        } else {
            lastUpper = NO;
        }
        [new appendFormat:@"%c", c];
    }
    return new;
}
- (NSString *) repeat:(NSUInteger)repeat{
    return [@"" stringByPaddingToLength:repeat * [self length] withString:self startingAtIndex:0];
}
- (NSString *) urlSafeString{
    //We first encode the string in case it already had escaped characters
    NSString *encoded = self.encodedURLString;
    //Add escapes
    return (__bridge_transfer NSString *) CFURLCreateStringByAddingPercentEscapes(NULL,
                                                                     (CFStringRef)encoded,
                                                                     NULL,
                                                                     NULL,
                                                                     kCFStringEncodingUTF8);
}
- (NSString *) encodedURLString{
    return (__bridge_transfer NSString *) CFURLCreateStringByReplacingPercentEscapesUsingEncoding(NULL,
                                                                                (CFStringRef)self,
                                                                                CFSTR(""),
                                                                                kCFStringEncodingUTF8);
}
- (BOOL) has:(NSString *)string{
    return ([self rangeOfString:string].location != NSNotFound);
}
- (CGSize) sizeWithUIFont:(UIFont *)font{
  if (font){
    return [self sizeWithAttributes:@{NSFontAttributeName : font}];
  }
  return CGSizeZero;
}
- (CGSize) sizeWithUIFont:(UIFont *)font constrainedToSize:(CGSize)size{
  if (font){
    return [self boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : font} context:nil].size;
  }
  return size;
}
@end