text:
import * as React from "react";

// Helper function to render a flex row with left/right spans
export function renderRow(label: string, data: string) {
	function getStyle(): React.CSSProperties {
		return {
			display: "flex",
			justifyContent: "space-between",
			height: "20px",
			padding: "2px 0",
			alignItems: "center"
		};
	}

	return (

			{label}
			{data}

	);
}

export function renderRowSpan(label: string, data: JSX.Element) {
	function getStyle(): React.CSSProperties {
		return {
			display: "flex",
			justifyContent: "space-between",
			height: "20px",
			padding: "2px 0",
			alignItems: "center"
		};
	}

	return (

			{label}
			{data}

	);
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>glm::gtx::color_space Namespace Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>

Main Page

Modules

Namespaces

Classes

Files

Namespace List

Namespace Members

glm

gtx

color_space

Functions

glm::gtx::color_space Namespace Reference

< GLM_GTX_color_space extension: Related to RGB to HSV conversions and operations
More...

Functions

template<typename valType >

detail::tvec3< valType > 	hsvColor (detail::tvec3< valType > const &rgbValue)

template<typename valType >

valType 	luminosity (detail::tvec3< valType > const &color)

template<typename valType >

detail::tvec3< valType > 	rgbColor (detail::tvec3< valType > const &hsvValue)

template<typename valType >

detail::tvec3< valType > 	saturation (valType const s, detail::tvec3< valType > const &color)

template<typename valType >

detail::tmat4x4< valType > 	saturation (valType const s)

template<typename valType >

detail::tvec4< valType > 	saturation (valType const s, detail::tvec4< valType > const &color)

Detailed Description

< GLM_GTX_color_space extension: Related to RGB to HSV conversions and operations

<address class="footer">Generated by

 1.7.3 </address>

redpajama_set_name: RedPajamaGithub


text:
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\captcha\Captcha;
use cii\widgets\Toggler;

$this->title = Yii::p('cii', 'Login');
$this->params['breadcrumbs'][] = $this->title;
?>

<?php echo Yii::p('cii', 'Login'); ?>

<?php echo Yii::p('cii', 'Please enter your credentials'); ?>

	<?php $form = ActiveForm::begin(); ?>

				<?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?>

				<?= $form->field($model, 'password')->passwordInput(['data-controller' => 'strengthcheck']) ?>

			<?php if(Captcha::checkRequirements()): ?>

					<?php
					echo $form->field($model, 'captcha')->widget(Captcha::classname(), [
						'captchaAction' => Yii::$app->seo->relativeAdminRoute('captcha'),
						'template' => '

{image}

{input}

',
					]); ?>

			<?php endif; ?>

				<?php echo Toggler::widget([
					'form' => $form,
					'model' => $model,
					'property' => 'rememberMe'
				]); ?>

			<?php echo Html::submitButton(Yii::p('cii', 'Login'), array('class' => 'btn btn-primary')); ?>

	 <?php ActiveForm::end(); ?>


text:
#pragma once

#ifndef GEODE_BASE_H_
#define GEODE_BASE_H_

#include "apache-geode_export.h"

/**@namespace geode This namespace contains all the Geode
 * C++ API classes, enumerations and globals.
 */

/**@namespace geode_statistics This namespace contains all the Geode
 * C++ statistics API classes.
 */

/**@namespace apache::geode::client::TypeHelper This namespace contains type
 * traits helper
 * structs/classes to determine type information at compile time
 * using typename. Useful for templates in particular.
 */

/**
 * @file
 *
 *  Definitions of types and functions supported in the Geode C++ interface
 */

/** Allocates x and throws OutOfMemoryException if it fails */
#define _GEODE_NEW(v, stmt)                                             \
  {                                                                     \
    try {                                                               \
      v = new stmt;                                                     \
    } catch (const std::bad_alloc &) {                                  \
      throw apache::geode::client::OutOfMemoryException(                \
          "Out of Memory while executing \"" #v " = new " #stmt ";\""); \
    }                                                                   \
  }

/** Deletes x only if it exists */
#define _GEODE_SAFE_DELETE(x) \
  {                           \
    delete x;                 \
    x = nullptr;              \
  }

/** Deletes array x only if it exists */
#define _GEODE_SAFE_DELETE_ARRAY(x) \
  {                                 \
    delete[] x;                     \
    x = nullptr;                    \
  }

// TODO shared_ptr - Consider making con/destructors public.
/*
 * Allows std::shared_ptr to access protected constructors and destructors.
 */
#if defined(__clang__)
#define _GEODE_FRIEND_STD_SHARED_PTR(_T)                               \
  friend std::__libcpp_compressed_pair_imp<std::allocator<_T>, _T, 1>; \
  friend std::__shared_ptr_emplace<_T, std::allocator<_T> >;           \
  friend std::default_delete<_T>;
#elif defined(__GNUC__) || defined(__SUNPRO_CC)
#define _GEODE_FRIEND_STD_SHARED_PTR(_T) friend __gnu_cxx::new_allocator<_T>;
#elif defined(_MSC_VER)
#if defined(_MANAGED)
#define _GEODE_FRIEND_STD_SHARED_PTR(_T) \
  friend std::_Ref_count_obj<_T>;        \
  friend std::_Ref_count<_T>;            \
  friend std::_Ptr_base<_T>;             \
  friend std::default_delete<_T>;        \
  friend std::shared_ptr<_T>;
#else
#define _GEODE_FRIEND_STD_SHARED_PTR(_T) friend std::_Ref_count_obj<_T>;
#endif
#else
#define _GEODE_FRIEND_STD_SHARED_PTR(_T)
#endif

#include <chrono>
#include <string>

namespace apache {
namespace geode {
namespace client {

constexpr static std::chrono::milliseconds DEFAULT_QUERY_RESPONSE_TIMEOUT =
    std::chrono::seconds{15};

static const std::string EMPTY_STRING{};

}  // namespace client
}  // namespace geode
}  // namespace apache

#endif  // GEODE_BASE_H_


text:
class ApplicationController < ActionController::Base
  protect_from_forgery

  before_filter :ref_to_cookie, :setting_launch_time

  def mobile_device?
    if session[:mobile_param]
        session[:mobile_param] == "1"
    else
        request.user_agent =~ /Mobile|webOS/
    end
  end

  protected

  def setting_launch_time
    launch_time = AdminUser.first.created_at + 7.days + 1.hour
    launch_time = launch_time.to_time.to_i
    now_time = Time.now.to_time.to_i
    @remainning_time = launch_time - now_time
  end

  def ref_to_cookie

    if params[:ref] && !Rails.application.config.ended
      if !User.find_by_referral_code(params[:ref]).nil?
        #binding.pry
        cookies[:h_ref] = { :value => params[:ref], :expires => 1.week.from_now }
      end

      if request.env["HTTP_USER_AGENT"] and !request.env["HTTP_USER_AGENT"].include?("facebookexternalhit/1.1")
        redirect_to proc { url_for(params.except(:ref)) }
      end
    end

  end

end


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

using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Reflection;
using EventFlow.Extensions;

namespace EventFlow.ReadStores.MsSql
{
    public class ReadModelSqlGenerator : IReadModelSqlGenerator
    {
        private readonly Dictionary<Type, string> _insertSqls = new Dictionary<Type, string>();
        private readonly Dictionary<Type, string> _selectSqls = new Dictionary<Type, string>();
        private readonly Dictionary<Type, string> _updateSqls = new Dictionary<Type, string>();
        private readonly Dictionary<Type, string> _purgeSqls = new Dictionary<Type, string>();
        private static readonly ConcurrentDictionary<Type, string> TableNames = new ConcurrentDictionary<Type, string>();

        public string CreateInsertSql<TReadModel>()
            where TReadModel : IMssqlReadModel
        {
            var readModelType = typeof(TReadModel);
            string sql;
            if (_insertSqls.TryGetValue(readModelType, out sql))
            {
                return sql;
            }

            sql = string.Format(
                "INSERT INTO {0} ({1}) VALUES ({2})",
                GetTableName<TReadModel>(),
                string.Join(", ", GetInsertColumns<TReadModel>()),
                string.Join(", ", GetInsertColumns<TReadModel>().Select(c => string.Format("@{0}", c))));
            _insertSqls[readModelType] = sql;

            return sql;
        }

        public string CreateSelectSql<TReadModel>()
            where TReadModel : IMssqlReadModel
        {
            var readModelType = typeof (TReadModel);
            string sql;
            if (_selectSqls.TryGetValue(readModelType, out sql))
            {
                return sql;
            }

            sql = string.Format("SELECT * FROM {0} WHERE AggregateId = @AggregateId", GetTableName<TReadModel>());
            _selectSqls[readModelType] = sql;

            return sql;
        }

        public string CreateUpdateSql<TReadModel>()
            where TReadModel : IMssqlReadModel
        {
            var readModelType = typeof (TReadModel);
            string sql;
            if (_updateSqls.TryGetValue(readModelType, out sql))
            {
                return sql;
            }

            sql = string.Format(
                "UPDATE {0} SET {1} WHERE AggregateId = @AggregateId",
                GetTableName<TReadModel>(),
                string.Join(", ", GetUpdateColumns<TReadModel>().Select(c => string.Format("{0} = @{0}", c))));
            _updateSqls[readModelType] = sql;

            return sql;
        }

        public string CreatePurgeSql<TReadModel>()
            where TReadModel : IReadModel
        {
            return _purgeSqls.GetOrCreate(
                typeof (TReadModel),
                t => string.Format("DELETE FROM {0}", GetTableName(t)));
        }

        protected IEnumerable<string> GetInsertColumns<TReadModel>()
            where TReadModel : IMssqlReadModel
        {
            return typeof(TReadModel)
                .GetProperties(BindingFlags.Instance | BindingFlags.Public)
                .Where(p => p.Name != "Id") // TODO: Maybe use the key attribute to mark this
                .OrderBy(p => p.Name)
                .Select(p => p.Name);
        }

        protected IEnumerable<string> GetUpdateColumns<TReadModel>()
            where TReadModel : IMssqlReadModel
        {
            return GetInsertColumns<TReadModel>()
                .Where(c => c != "AggregateId");
        }

        public string GetTableName<TReadModel>()
            where TReadModel : IMssqlReadModel
        {
            return GetTableName(typeof(TReadModel));
        }

        protected virtual string GetTableName(Type readModelType)
        {
            return TableNames.GetOrAdd(
                readModelType,
                t =>
                    {
                        var tableAttribute = t.GetCustomAttribute<TableAttribute>(false);
                        return tableAttribute != null
                            ? string.Format("[{0}]", tableAttribute.Name)
                            : string.Format("[ReadModel-{0}]", t.Name.Replace("ReadModel", string.Empty));
                    });
        }
    }
}