text:
define(['modules/defaultcontroller','util/datatraversing'], function(Default,Traversing) {

	function controller() {};
	controller.prototype = $.extend(true, {}, Default, {

		lineHover: function(element) {

			var actions;
			if(!(actions = this.module.vars_out()))
				return;
			for(var i = 0; i < actions.length; i++)
				if(actions[i].event == "onHover")
					CI.API.setSharedVarFromJPath(actions[i].name, element, actions[i].jpath);

			CI.RepoHighlight.set(element._highlight, 1);
		},

		lineOut: function(element) {
			CI.RepoHighlight.set(element._highlight, 0);
		},

		lineClick: function(element) {

			var actions;
			if(!(actions = this.module.vars_out()))
				return;

			for(var i = 0; i < actions.length; i++) {
				if(actions[i].event == "onSelect") {
					(function(element, actionName, jpath) {
						CI.API.setSharedVarFromJPath(actionName, element, jpath);
					}) (element, actions[i].name, actions[i].jpath)
				}
			}
		},

		configurationSend: {

			events: {

				onSelect: {
					label: 'Select a line',
					description: 'Click on a line to select it'
				},

				onHover: {
					label: 'Hovers a line',
					description: 'Pass the mouse over a line to select it'
				}
			},

			rels: {
				'element': {
					label: 'Row',
					description: 'Returns the selected row in the list'
				}
			}

		},

		configurationReceive: {
			list: {
				type: ["array", "arrayXY"],
				label: 'List',
				description: 'Any list of displayable element'
			}
		},

		moduleInformations: {
			moduleName: 'Table'
		},

		doConfiguration: function(section) {

			var groupfield = new BI.Forms.GroupFields.List('gencfg');

			section.addFieldGroup(groupfield);

			var field = groupfield.addField({
				type: 'Text',
				name: 'nblines'
			});
			field.setTitle(new BI.Title('Lines per page'));

			var data = this.module.getDataFromRel('list');
			var jpaths = [];

			if(Traversing.getType(data) == 'array')
				Traversing.getJPathsFromElement(data[0], jpaths);
			else if(Traversing.getType(data) == 'arrayXY')
				Traversing.getJPathsFromElement(data, jpaths);

			var field = groupfield.addField({
				type: 'Combo',
				name: 'colorjpath'
			});

			field.setTitle(new BI.Title('Color jPath'));
			field.implementation.setOptions(jpaths);

			var field = groupfield.addField({
				type: 'Checkbox',
				name: 'displaySearch'
			});
			field.implementation.setOptions({ 'allow': 'Allow searching'});
			field.setTitle(new BI.Title('Searching'));

			var groupfield = new BI.Forms.GroupFields.Table('cols');

			section.addFieldGroup(groupfield);

			var field = groupfield.addField({
				type: 'Text',
				name: 'coltitle'
			});
			field.setTitle(new BI.Title('Columns title'));

			var field = groupfield.addField({
				type: 'Combo',
				name: 'coljpath'
			});
			field.implementation.setOptions(jpaths);
			field.setTitle(new BI.Title('Value jPath'));

			return true;
		},

		doFillConfiguration: function() {

			var cols = this.module.getConfiguration().colsjPaths;
			var nblines = this.module.getConfiguration().nbLines || 20;
			var colorjPath = this.module.getConfiguration().colorjPath || '';
			var search = this.module.getConfiguration().displaySearch || false;

			var titles = [];
			var jpaths = [];

			for(var i in cols) {
				titles.push(i);
				jpaths.push(cols[i].jpath);
			}

			return {

				groups: {
					gencfg: [{
						nblines: [nblines],
						colorjpath: [colorjPath],
						displaySearch: [[search ? 'allow' : '']]
					}],

					cols: [{
						coltitle: titles,
						coljpath: jpaths
					}]
				}
			}
		},

		doSaveConfiguration: function(confSection) {
			var group = confSection[0].cols[0];
			var cols = {};
			for(var i = 0; i < group.length; i++)
				cols[group[i].coltitle] = { jpath: group[i].coljpath };
			this.module.getConfiguration().colsjPaths = cols;
			this.module.getConfiguration().nbLines = confSection[0].gencfg[0].nblines[0];
			this.module.getConfiguration().colorjPath = confSection[0].gencfg[0].colorjpath[0];
			this.module.getConfiguration().displaySearch = !!confSection[0].gencfg[0].displaySearch[0][0];
		}
	});

	return controller;
});


text:
#include <config.h>

#include <stdio.h>

#include "debugger/debugger.h"
#include "event.h"
#include "machine.h"
#include "memory_pages.h"
#include "periph.h"
#include "peripherals/disk/beta.h"
#include "peripherals/disk/didaktik.h"
#include "peripherals/disk/disciple.h"
#include "peripherals/disk/opus.h"
#include "peripherals/disk/plusd.h"
#include "peripherals/ide/divide.h"
#include "peripherals/if1.h"
#include "peripherals/spectranet.h"
#include "peripherals/ula.h"
#include "peripherals/usource.h"
#include "profile.h"
#include "rzx.h"
#include "settings.h"
#include "slt.h"
#include "svg.h"
#include "tape.h"
#include "z80.h"

#include "z80_macros.h"

#ifndef HAVE_ENOUGH_MEMORY
static int z80_cbxx( libspectrum_byte opcode2 );
static int z80_ddxx( libspectrum_byte opcode2 );
static int z80_edxx( libspectrum_byte opcode2 );
static int z80_fdxx( libspectrum_byte opcode2 );
static void z80_ddfdcbxx( libspectrum_byte opcode3,
			  libspectrum_word tempaddr );
#endif				/* #ifndef HAVE_ENOUGH_MEMORY */

/* Certain features (eg RZX playback trigged interrupts, the debugger,
   TR-DOS ROM paging) can't be handled within the normal 'events'
   framework as they don't happen at a specified tstate. In order to
   support these, we basically need to check every opcode as to
   whether they have occurred or not.

   There are (fairly common) circumstances under which we know that
   the features will never occur (eg we will never get an interrupt
   from RZX playback unless we're doing RZX playback), and we would
   quite like to skip the check in this state. We can do this if we
   use gcc's computed goto feature[1]. What follows is some
   preprocessor hackery to moderately transparently do this while
   still retaining the "normal" behaviour for non-gcc compilers.

   Ensure that the same arguments are given to respective
   SETUP_CHECK() and CHECK() macros or everything will break.

   [1] see 'C Extensions', 'Labels as Values' in the gcc info page.
*/

#ifdef __GNUC__

#define SETUP_CHECK( label, condition ) \
  pos_##label,
#define SETUP_NEXT( label )

enum {
#include "z80_checks.h"
  numchecks
};

#define CHECK( label, condition ) goto *cgoto[ pos_##label ]; label:
#define END_CHECK

#else				/* #ifdef __GNUC__ */

#define CHECK( label, condition ) if( condition ) {
#define END_CHECK }

#endif				/* #ifdef __GNUC__ */

#ifndef HAVE_ENOUGH_MEMORY
static libspectrum_byte opcode = 0x00;
#endif

/* Execute Z80 opcodes until the next event */
void
z80_do_opcodes( void )
{
#ifdef HAVE_ENOUGH_MEMORY
  libspectrum_byte opcode = 0x00;
#endif

  int even_m1 =
    machine_current->capabilities & LIBSPECTRUM_MACHINE_CAPABILITY_EVEN_M1;

#ifdef __GNUC__

#undef SETUP_CHECK
#define SETUP_CHECK( label, condition ) \
  if( condition ) { cgoto[ next ] = &&label; next = pos_##label + 1; } \
  check++;

#undef SETUP_NEXT
#define SETUP_NEXT( label ) \
  if( next != check ) { cgoto[ next ] = &&label; } \
  next = check;

  void *cgoto[ numchecks ]; size_t next = 0; size_t check = 0;

#include "z80_checks.h"

#endif				/* #ifdef __GNUC__ */

  while( tstates < event_next_event ) {

    /* Profiler */
    CHECK( profile, profile_active )

    profile_map( PC );

    END_CHECK

    /* If we're due an end of frame from RZX playback, generate one */
    CHECK( rzx, rzx_playback )

    if( R + rzx_instructions_offset >= rzx_instruction_count ) {
      event_add( tstates, spectrum_frame_event );
      break;		/* And break out of the execution loop to let
			   the interrupt happen */
    }

    END_CHECK

    /* Check if the debugger should become active at this point */
    CHECK( debugger, debugger_mode != DEBUGGER_MODE_INACTIVE )

    if( debugger_check( DEBUGGER_BREAKPOINT_TYPE_EXECUTE, PC ) )
      debugger_trap();

    END_CHECK

    CHECK( beta, beta_available )

#define NOT_128_TYPE_OR_IS_48_TYPE ( !( machine_current->capabilities & \
            LIBSPECTRUM_MACHINE_CAPABILITY_128_MEMORY ) || \
            machine_current->ram.current_rom )

    if( beta_active ) {
      if( NOT_128_TYPE_OR_IS_48_TYPE && PC >= 16384 ) {
	beta_unpage();
      }
    } else if( ( PC & beta_pc_mask ) == beta_pc_value &&
               NOT_128_TYPE_OR_IS_48_TYPE ) {
      beta_page();
    }

    END_CHECK

    CHECK( plusd, plusd_available )

    if( PC == 0x0008 || PC == 0x003a || PC == 0x0066 || PC == 0x028e ) {
      plusd_page();
    }

    END_CHECK

    CHECK( didaktik80, didaktik80_available )

    if( PC == 0x0000 || PC == 0x0008 ) {
      didaktik80_page();
    } else if( PC == 0x1700 ) {
      didaktik80_unpage();
    }

    END_CHECK

    CHECK( disciple, disciple_available )

    if( PC == 0x0001 || PC == 0x0008 || PC == 0x0066 || PC == 0x028e ) {
      disciple_page();
    }

    END_CHECK

    CHECK( usource, usource_available )

    if( PC == 0x2bae ) {
      usource_toggle();
    }

    END_CHECK

    CHECK( if1p, if1_available )

    if( PC == 0x0008 || PC == 0x1708 ) {
      if1_page();
    }

    END_CHECK

    CHECK( divide_early, settings_current.divide_enabled )

    if( ( PC & 0xff00 ) == 0x3d00 ) {
      divide_set_automap( 1 );
    }

    END_CHECK

    CHECK( spectranet_page, spectranet_available && !settings_current.spectranet_disable )

    if( PC == 0x0008 || ((PC & 0xfff8) == 0x3ff8) )
      spectranet_page( 0 );

    if( PC == spectranet_programmable_trap &&
      spectranet_programmable_trap_active )
      event_add( 0, z80_nmi_event );

    END_CHECK

  opcode_delay:

    contend_read( PC, 4 );

    /* Check to see if M1 cycles happen on even tstates */
    CHECK( evenm1, even_m1 )

    if( tstates & 1 ) {
      if( ++tstates == event_next_event ) {
	break;
      }
    }

    END_CHECK

  run_opcode:
    /* Do the instruction fetch; readbyte_internal used here to avoid
       triggering read breakpoints */
    opcode = readbyte_internal( PC );

    CHECK( if1u, if1_available )

    if( PC == 0x0700 ) {
      if1_unpage();
    }

    END_CHECK

    CHECK( divide_late, settings_current.divide_enabled )

    if( ( PC & 0xfff8 ) == 0x1ff8 ) {
      divide_set_automap( 0 );
    } else if( (PC == 0x0000) || (PC == 0x0008) || (PC == 0x0038)
      || (PC == 0x0066) || (PC == 0x04c6) || (PC == 0x0562) ) {
      divide_set_automap( 1 );
    }

    END_CHECK

    CHECK( opus, opus_available )

    if( opus_active ) {
      if( PC == 0x1748 ) {
        opus_unpage();
      }
    } else if( PC == 0x0008 || PC == 0x0048 || PC == 0x1708 ) {
      opus_page();
    }

    END_CHECK

    CHECK( spectranet_unpage, spectranet_available )

    if( PC == 0x007c )
      spectranet_unpage();

    END_CHECK

    CHECK( z80_iff2_read, z80.iff2_read )

    z80.iff2_read = 0;
    /* Execute *one* instruction before reevaluating the checks */
    event_add( tstates, z80_nmos_iff2_event );

    END_CHECK

    CHECK( didaktik80snap, didaktik80_snap )

    if( PC == 0x0066 && !didaktik80_active ) {
      opcode = 0xc7;	/* RST 00 */
      didaktik80_snap = 0; /* FIXME: this should be a time-based reset */
    }

    END_CHECK

    CHECK( svg_capture, svg_capture_active )

    svg_capture();

    END_CHECK

  end_opcode:
    PC++; R++;
    switch(opcode) {
#include "z80/opcodes_base.c"
    }

  }

}

#ifndef HAVE_ENOUGH_MEMORY

static int
z80_cbxx( libspectrum_byte opcode2 )
{
  switch(opcode2) {
#include "z80/z80_cb.c"
  }
  return 0;
}

static int
z80_ddxx( libspectrum_byte opcode2 )
{
  switch(opcode2) {
#define REGISTER  IX
#define REGISTERL IXL
#define REGISTERH IXH
#include "z80/z80_ddfd.c"
#undef REGISTERH
#undef REGISTERL
#undef REGISTER
  }
  return 0;
}

static int
z80_edxx( libspectrum_byte opcode2 )
{
  switch(opcode2) {
#include "z80/z80_ed.c"
  }
  return 0;
}

static int
z80_fdxx( libspectrum_byte opcode2 )
{
  switch(opcode2) {
#define REGISTER  IY
#define REGISTERL IYL
#define REGISTERH IYH
#include "z80/z80_ddfd.c"
#undef REGISTERH
#undef REGISTERL
#undef REGISTER
  }
  return 0;
}

static void
z80_ddfdcbxx( libspectrum_byte opcode3, libspectrum_word tempaddr )
{
  switch(opcode3) {
#include "z80/z80_ddfdcb.c"
  }
}

#endif			/* #ifndef HAVE_ENOUGH_MEMORY */

redpajama_set_name: RedPajamaGithub


text:
from __future__ import absolute_import

from setuptools import setup

description = ("Thrift SASL Python module that implements SASL transports for "
               "Thrift (`TSaslClientTransport`).")

setup(
    name='thrift_sasl',
    version='0.4.3',
    description=description,
    long_description=description,
    url='https://github.com/cloudera/thrift_sasl',
    setup_requires=['setuptools>=20.5'],
    install_requires=[
        # Python 3 support was added to thrift in version 0.10.0.
        "thrift>=0.10.0;python_version>='3.0'",
        "thrift>=0.9.3;python_version<'3.0'",
        "pure-sasl>=0.6.2",
        "six>=1.13.0"
    ],
    packages=['thrift_sasl'],
    keywords='thrift sasl transport',
    license='Apache License, Version 2.0',
    classifiers=[
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
        'Programming Language :: Python :: 3.9']
)


text:
package org.ehcache.internal.store;

import org.ehcache.spi.cache.Store;
import org.ehcache.spi.test.SPITest;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;

/**
 * Test the {@link org.ehcache.spi.cache.Store.Configuration#getValueType()} contract of the
 * {@link org.ehcache.spi.cache.Store.Configuration Store.Configuration} interface.
 * <p/>
 *
 * @author Aurelien Broszniowski
 */

public class StoreConfigurationGetValueTypeTest<K, V> extends SPIStoreTester<K, V> {

  public StoreConfigurationGetValueTypeTest(final StoreFactory<K, V> factory) {
    super(factory);
  }

  @SPITest
  public void returnsCorrectValueType() throws IllegalAccessException, InstantiationException {
    Store.Configuration<K, V> kvConfiguration = factory.newConfiguration(factory.getKeyType(), factory.getValueType(),
        null, null, null);

    assertThat(kvConfiguration.getValueType(), is(equalTo(factory.getValueType())));
  }
}


text:
package scouter.server.db.obj;

import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.Hashtable;

import scouter.util.IClose;

object ObjectData {
    val table = new Hashtable[String, ObjectData]();
    def open(file: String): ObjectData = {
        table.synchronized {
            var reader = table.get(file);
            if (reader != null) {
                reader.refrence += 1;
            } else {
                reader = new ObjectData(file);
                table.put(file, reader);
            }
            return reader;
        }
    }
}

class ObjectData(file: String) extends  IClose {

    var refrence = 0;
    val dataFile = new RandomAccessFile(file + ".data", "rw");

    def close() {
        ObjectData.table.synchronized {
            if (this.refrence == 0) {
                ObjectData.table.remove(this.file);
                try {
                    dataFile.close();
                } catch {
                    case e: Throwable =>
                        e.printStackTrace()
                }
            } else {
                this.refrence -= 1;
            }
        }

    }

    def read(fpos: Long): Array[Byte] = {
        this.synchronized {
            try {
                dataFile.seek(fpos);
                val length = dataFile.readInt();
                val buffer = new Array[Byte](length);
                dataFile.read(buffer);
                return buffer;
            } catch {
                case e: IOException =>
                    throw new RuntimeException(e);
            }
        }
    }

    def write(data: Array[Byte]): Long = {
        this.synchronized {
            val location = dataFile.length();
            dataFile.seek(location);
            dataFile.writeInt(data.length);
            dataFile.write(data);
            return location;
        }
    }

    def update(pos: Long, data: Array[Byte]) {
        dataFile.seek(pos);
        dataFile.writeInt(data.length);
        dataFile.write(data);
    }
}


text:
<!DOCTYPE html>
<body>
This test should redirect to a landing page with no doubled slashes in the path.

<script>
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}
</script>

<script>
location.pathname="/uri/resources/assign-path-landing.html";
</script>


text:
include symlink.sh

include mac/brew.sh
include npm.sh

include mac/fonts.sh
include mac/apps.sh
include mac/chunkwm.sh
include mac/config.sh
# include mac/dev.sh
# include mac/media.sh


text:
package ghttp

import (
	"reflect"
	"runtime"
)

const (
	gDEFAULT_MIDDLEWARE_PATTERN = "/*"
)

// 注册中间件,绑定到指定的路由规则上,中间件参数支持多个。
func (s *Server) BindMiddleware(pattern string, handlers ...HandlerFunc) {
	for _, handler := range handlers {
		s.setHandler(pattern, &handlerItem{
			itemType: gHANDLER_TYPE_MIDDLEWARE,
			itemName: runtime.FuncForPC(reflect.ValueOf(handler).Pointer()).Name(),
			itemFunc: handler,
		})
	}
}

// 注册中间件,绑定到全局路由规则("/*")上,中间件参数支持多个。
func (s *Server) BindMiddlewareDefault(handlers ...HandlerFunc) {
	for _, handler := range handlers {
		s.setHandler(gDEFAULT_MIDDLEWARE_PATTERN, &handlerItem{
			itemType: gHANDLER_TYPE_MIDDLEWARE,
			itemName: runtime.FuncForPC(reflect.ValueOf(handler).Pointer()).Name(),
			itemFunc: handler,
		})
	}
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace XCLCMS.Lib.Common
{
    /// <summary>
    /// 公共操作
    /// </summary>
    public static class Comm
    {
        #region 缓存相关

        /// <summary>
        /// 站点配置信息缓存
        /// </summary>
        public const string SettingCacheName = "SettingCacheName";

        /// <summary>
        /// 缓存清理
        /// </summary>
        public static void ClearCache()
        {
            XCLNetTools.Cache.CacheClass.Clear(XCLCMS.Lib.Common.Comm.SettingCacheName);
        }

        #endregion 缓存相关

        #region 配置相关

        /// <summary>
        /// 获取当前系统所处环境
        /// </summary>
        public static XCLNetTools.Enum.CommonEnum.SysEnvironmentEnum GetCurrentEnvironment()
        {
            string val = XCLNetTools.XML.ConfigClass.GetConfigString("SysEnvironment");
            if (string.IsNullOrWhiteSpace(val))
            {
                throw new ArgumentNullException("SysEnvironment", "appSettings中缺少环境节点配置信息!");
            }
            return (XCLNetTools.Enum.CommonEnum.SysEnvironmentEnum)Enum.Parse(typeof(XCLNetTools.Enum.CommonEnum.SysEnvironmentEnum), val.Trim().ToUpper());
        }

        /// <summary>
        /// 获取当前应用AppKey
        /// </summary>
        public static string AppKey
        {
            get
            {
                var str = XCLNetTools.XML.ConfigClass.GetConfigString("AppKey");
                if (string.IsNullOrWhiteSpace(str))
                {
                    throw new ArgumentNullException("AppKey", "请在配置文件中配置有效的AppKey!");
                }
                return str;
            }
        }

        /// <summary>
        /// 获取当前应用WebAPIServiceURL
        /// </summary>
        public static string WebAPIServiceURL
        {
            get
            {
                var str = XCLNetTools.XML.ConfigClass.GetConfigString("WebAPIServiceURL");
                if (string.IsNullOrWhiteSpace(str))
                {
                    throw new ArgumentNullException("WebAPIServiceURL", "请在配置文件中配置有效的WebAPIServiceURL!");
                }
                return str;
            }
        }

        #endregion 配置相关

        #region 数据字典相关

        /// <summary>
        /// 将指定code的SysDic的子项转为options
        /// </summary>
        public static string GetSysDicOptionsByCode(string code, XCLNetTools.Entity.SetOptionEntity options = null)
        {
            StringBuilder str = new StringBuilder();
            if (null != options && options.IsNeedPleaseSelect)
            {
                str.Append("<option value=''>--请选择--</option>");
            }

            List<XCLCMS.Data.Model.SysDic> lst = null;
            var request = XCLCMS.Lib.WebAPI.Library.CreateRequest<object>();
            request.Body = code;
            var response = XCLCMS.Lib.WebAPI.SysDicAPI.GetChildListByCode(request);
            if (null != response)
            {
                lst = response.Body;
            }

            if (null != lst && lst.Count > 0)
            {
                lst.ForEach(m =>
                {
                    if (null != options)
                    {
                        str.AppendFormat("<option value='{0}' {2}>{1}</option>", m.SysDicID, m.DicName, string.Equals(options.DefaultValue, m.SysDicID.ToString(), StringComparison.OrdinalIgnoreCase) ? " selected='selected' " : "");
                    }
                    else
                    {
                        str.AppendFormat("<option value='{0}'>{1}</option>", m.SysDicID, m.DicName);
                    }
                });
            }
            return str.ToString();
        }

        #endregion 数据字典相关

        #region 文件管理相关

        /// <summary>
        /// 允许上传的附件扩展名信息(小写)
        /// </summary>
        public static List<string> AllowUploadExtInfo = new Func<List<string>>(() =>
        {
            return XCLNetTools.Enum.EnumHelper.GetEnumFieldModelList(typeof(XCLNetTools.Enum.CommonEnum.FileExtInfoEnum)).Where(k =>
                k.Text == XCLNetTools.Enum.CommonEnum.FileExtInfoEnum.Txt.ToString() ||
                k.Text == XCLNetTools.Enum.CommonEnum.FileExtInfoEnum.Compress.ToString() ||
                k.Text == XCLNetTools.Enum.CommonEnum.FileExtInfoEnum.Image.ToString() ||
                k.Text == XCLNetTools.Enum.CommonEnum.FileExtInfoEnum.Music.ToString() ||
                k.Text == XCLNetTools.Enum.CommonEnum.FileExtInfoEnum.Office.ToString() ||
                k.Text == XCLNetTools.Enum.CommonEnum.FileExtInfoEnum.Pdf.ToString() ||
                k.Text == XCLNetTools.Enum.CommonEnum.FileExtInfoEnum.Video.ToString()
            ).SelectMany(k => k.Description.Split(',')).ToList();
        }).Invoke();

        /// <summary>
        /// 根据文件id,返回用于网站上显示的文件地址
        /// </summary>
        public static string GetAttachmentAbsoluteURL(long id)
        {
            if (id <= 0)
            {
                return null;
            }
            XCLCMS.Data.Model.View.v_Attachment model = null;
            var request = XCLCMS.Lib.WebAPI.Library.CreateRequest<XCLCMS.Data.WebAPIEntity.RequestEntity.Attachment.DetailEntity>();
            request.Body = new Data.WebAPIEntity.RequestEntity.Attachment.DetailEntity();
            request.Body.AttachmentID = id;
            var response = XCLCMS.Lib.WebAPI.AttachmentAPI.Detail(request);
            if (null != response)
            {
                model = response.Body.Attachment;
            }
            return null != model ? GetAttachmentAbsoluteURL(model.URL) : null;
        }

        /// <summary>
        /// 将文件管理中的文件相对路径转为url绝对路径
        /// 如:~/upload/files/123.jpg -> //www.w.com/filemanager/upload/files/123.jpg
        /// </summary>
        public static string GetAttachmentAbsoluteURL(string relativeUrl)
        {
            if (string.IsNullOrWhiteSpace(relativeUrl))
            {
                throw new ArgumentNullException("relativeUrl", "必须指定参数:relativeUrl!");
            }
            return System.Web.HttpUtility.UrlDecode(relativeUrl).Trim().Replace("~/", XCLCMS.Lib.Common.Setting.SettingModel.FileManager_RootURL);
        }

        #endregion 文件管理相关

        #region 其它

        /// <summary>
        /// 类别枚举json
        /// </summary>
        public static readonly string GetAllEnumJson = XCLNetTools.Enum.EnumHelper.GetEnumJson(typeof(XCLCMS.Data.CommonHelper.EnumType));

        /// <summary>
        /// 重写json
        /// </summary>
        public static JsonResult XCLJsonResult(object data, JsonRequestBehavior jsonRequestBehavior = JsonRequestBehavior.DenyGet)
        {
            return new XCLNetTools.MVC.JsonResultFormat() { Data = data, JsonRequestBehavior = jsonRequestBehavior };
        }

        /// <summary>
        /// 获取当前应用程序的商户实体
        /// </summary>
        public static XCLCMS.Data.Model.Merchant GetCurrentApplicationMerchant()
        {
            return XCLCMS.Lib.Common.Comm.GetCurrentApplicationMerchantAppInfo().Merchant;
        }

        /// <summary>
        /// 获取当前应用程序的商户应用实体
        /// </summary>
        public static XCLCMS.Data.Model.MerchantApp GetCurrentApplicationMerchantApp()
        {
            return XCLCMS.Lib.Common.Comm.GetCurrentApplicationMerchantAppInfo().MerchantApp;
        }

        /// <summary>
        /// 获取当前应用程序的商户应用信息
        /// </summary>
        public static XCLCMS.Data.Model.Custom.MerchantAppInfoModel GetCurrentApplicationMerchantAppInfo()
        {
            XCLCMS.Data.Model.Custom.MerchantAppInfoModel model = null;
            var request = XCLCMS.Lib.WebAPI.Library.CreateRequest<object>();
            request.Body = XCLCMS.Lib.Common.Comm.AppKey;
            var response = XCLCMS.Lib.WebAPI.MerchantAppAPI.DetailByAppKey(request);
            if (null != response && null != response.Body && null != response.Body.Merchant && null != response.Body.MerchantApp)
            {
                model = response.Body;
                model.MerchantApp.CopyRight = model.MerchantApp.CopyRight?.Replace("{Year}", DateTime.Now.Year.ToString());
            }
            else
            {
                throw new Exception("商户应用信息获取失败,请配置有效的AppKey!");
            }
            return model;
        }

        /// <summary>
        /// 获取当前应用程序的商户主账号token
        /// </summary>
        public static string GetCurrentApplicationMerchantMainUserToken()
        {
            var request = XCLCMS.Lib.WebAPI.Library.CreateRequest<XCLCMS.Data.WebAPIEntity.RequestEntity.Open.LogonCheckEntity>(null);
            request.Body = new XCLCMS.Data.WebAPIEntity.RequestEntity.Open.LogonCheckEntity();
            request.Body.UserName = XCLNetTools.XML.ConfigClass.GetConfigString("MainUserName");
            request.Body.Pwd = XCLNetTools.XML.ConfigClass.GetConfigString("MainPwd");
            if (string.IsNullOrWhiteSpace(request.Body.UserName) || string.IsNullOrWhiteSpace(request.Body.Pwd))
            {
                return string.Empty;
            }
            var response = XCLCMS.Lib.WebAPI.OpenAPI.LogonCheck(request);
            return response?.Body?.Token;
        }

        #endregion 其它
    }
}


text:
package finspaceiface

import (
	"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws"
	"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request"
	"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/finspace"
)

// FinspaceAPI provides an interface to enable mocking the
// finspace.Finspace service client's API operation,
// paginators, and waiters. This make unit testing your code that calls out
// to the SDK's service client's calls easier.
//
// The best way to use this interface is so the SDK's service client's calls
// can be stubbed out for unit testing your code with the SDK without needing
// to inject custom request handlers into the SDK's request pipeline.
//
//	// myFunc uses an SDK service client to make a request to
//	// FinSpace User Environment Management service.
//	func myFunc(svc finspaceiface.FinspaceAPI) bool {
//	    // Make svc.CreateEnvironment request
//	}
//
//	func main() {
//	    sess := session.New()
//	    svc := finspace.New(sess)
//
//	    myFunc(svc)
//	}
//
// In your _test.go file:
//
//	// Define a mock struct to be used in your unit tests of myFunc.
//	type mockFinspaceClient struct {
//	    finspaceiface.FinspaceAPI
//	}
//	func (m *mockFinspaceClient) CreateEnvironment(input *finspace.CreateEnvironmentInput) (*finspace.CreateEnvironmentOutput, error) {
//	    // mock response/functionality
//	}
//
//	func TestMyFunc(t *testing.T) {
//	    // Setup Test
//	    mockSvc := &mockFinspaceClient{}
//
//	    myfunc(mockSvc)
//
//	    // Verify myFunc's functionality
//	}
//
// It is important to note that this interface will have breaking changes
// when the service model is updated and adds new API operations, paginators,
// and waiters. Its suggested to use the pattern above for testing, or using
// tooling to generate mocks to satisfy the interfaces.
type FinspaceAPI interface {
	CreateEnvironment(*finspace.CreateEnvironmentInput) (*finspace.CreateEnvironmentOutput, error)
	CreateEnvironmentWithContext(aws.Context, *finspace.CreateEnvironmentInput, ...request.Option) (*finspace.CreateEnvironmentOutput, error)
	CreateEnvironmentRequest(*finspace.CreateEnvironmentInput) (*request.Request, *finspace.CreateEnvironmentOutput)

	DeleteEnvironment(*finspace.DeleteEnvironmentInput) (*finspace.DeleteEnvironmentOutput, error)
	DeleteEnvironmentWithContext(aws.Context, *finspace.DeleteEnvironmentInput, ...request.Option) (*finspace.DeleteEnvironmentOutput, error)
	DeleteEnvironmentRequest(*finspace.DeleteEnvironmentInput) (*request.Request, *finspace.DeleteEnvironmentOutput)

	GetEnvironment(*finspace.GetEnvironmentInput) (*finspace.GetEnvironmentOutput, error)
	GetEnvironmentWithContext(aws.Context, *finspace.GetEnvironmentInput, ...request.Option) (*finspace.GetEnvironmentOutput, error)
	GetEnvironmentRequest(*finspace.GetEnvironmentInput) (*request.Request, *finspace.GetEnvironmentOutput)

	ListEnvironments(*finspace.ListEnvironmentsInput) (*finspace.ListEnvironmentsOutput, error)
	ListEnvironmentsWithContext(aws.Context, *finspace.ListEnvironmentsInput, ...request.Option) (*finspace.ListEnvironmentsOutput, error)
	ListEnvironmentsRequest(*finspace.ListEnvironmentsInput) (*request.Request, *finspace.ListEnvironmentsOutput)

	ListTagsForResource(*finspace.ListTagsForResourceInput) (*finspace.ListTagsForResourceOutput, error)
	ListTagsForResourceWithContext(aws.Context, *finspace.ListTagsForResourceInput, ...request.Option) (*finspace.ListTagsForResourceOutput, error)
	ListTagsForResourceRequest(*finspace.ListTagsForResourceInput) (*request.Request, *finspace.ListTagsForResourceOutput)

	TagResource(*finspace.TagResourceInput) (*finspace.TagResourceOutput, error)
	TagResourceWithContext(aws.Context, *finspace.TagResourceInput, ...request.Option) (*finspace.TagResourceOutput, error)
	TagResourceRequest(*finspace.TagResourceInput) (*request.Request, *finspace.TagResourceOutput)

	UntagResource(*finspace.UntagResourceInput) (*finspace.UntagResourceOutput, error)
	UntagResourceWithContext(aws.Context, *finspace.UntagResourceInput, ...request.Option) (*finspace.UntagResourceOutput, error)
	UntagResourceRequest(*finspace.UntagResourceInput) (*request.Request, *finspace.UntagResourceOutput)

	UpdateEnvironment(*finspace.UpdateEnvironmentInput) (*finspace.UpdateEnvironmentOutput, error)
	UpdateEnvironmentWithContext(aws.Context, *finspace.UpdateEnvironmentInput, ...request.Option) (*finspace.UpdateEnvironmentOutput, error)
	UpdateEnvironmentRequest(*finspace.UpdateEnvironmentInput) (*request.Request, *finspace.UpdateEnvironmentOutput)
}

var _ FinspaceAPI = (*finspace.Finspace)(nil)


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _15.Max_Combination
{
    class Program
    {
        static void Main(string[] args)
        {
            int start = int.Parse(Console.ReadLine());
            int end = int.Parse(Console.ReadLine());
            int maxCombinations = int.Parse(Console.ReadLine());
            int count = 0;

            for (int i = start; i <= end; i++)
            {
                for (int j = start; j <= end; j++)
                {

                    Console.Write($"<{i}-{j}>");
                    count++;
                    if (count == maxCombinations)
                    {
                        return;
                    }
                }
            }

        }
    }
}


text:
package org.mozartoz.truffle.runtime;

public class OzCell {

	Object value;

	public OzCell(Object value) {
		this.value = value;
	}

	public Object getValue() {
		return value;
	}

	public void setValue(Object value) {
		this.value = value;
	}

	public Object exchange(Object newValue) {
		Object oldValue = value;
		value = newValue;
		return oldValue;
	}

	@Override
	public String toString() {
		return "<Cell " + value + ">";
	}

}


text:
#pragma once
#include <aws/workmail/WorkMail_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace WorkMail
{
namespace Model
{
  class AWS_WORKMAIL_API CreateMobileDeviceAccessRuleResult
  {
  public:
    CreateMobileDeviceAccessRuleResult();
    CreateMobileDeviceAccessRuleResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
    CreateMobileDeviceAccessRuleResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);

    /**
     *
The identifier for the newly created mobile device access rule.

     */
    inline const Aws::String& GetMobileDeviceAccessRuleId() const{ return m_mobileDeviceAccessRuleId; }

    /**
     *
The identifier for the newly created mobile device access rule.

     */
    inline void SetMobileDeviceAccessRuleId(const Aws::String& value) { m_mobileDeviceAccessRuleId = value; }

    /**
     *
The identifier for the newly created mobile device access rule.

     */
    inline void SetMobileDeviceAccessRuleId(Aws::String&& value) { m_mobileDeviceAccessRuleId = std::move(value); }

    /**
     *
The identifier for the newly created mobile device access rule.

     */
    inline void SetMobileDeviceAccessRuleId(const char* value) { m_mobileDeviceAccessRuleId.assign(value); }

    /**
     *
The identifier for the newly created mobile device access rule.

     */
    inline CreateMobileDeviceAccessRuleResult& WithMobileDeviceAccessRuleId(const Aws::String& value) { SetMobileDeviceAccessRuleId(value); return *this;}

    /**
     *
The identifier for the newly created mobile device access rule.

     */
    inline CreateMobileDeviceAccessRuleResult& WithMobileDeviceAccessRuleId(Aws::String&& value) { SetMobileDeviceAccessRuleId(std::move(value)); return *this;}

    /**
     *
The identifier for the newly created mobile device access rule.

     */
    inline CreateMobileDeviceAccessRuleResult& WithMobileDeviceAccessRuleId(const char* value) { SetMobileDeviceAccessRuleId(value); return *this;}

  private:

    Aws::String m_mobileDeviceAccessRuleId;
  };

} // namespace Model
} // namespace WorkMail
} // namespace Aws


text:
<?php

namespace SlaxWeb\Database\Interfaces;

interface Result
{
    /**
     * Magic Get Method
     *
     * Retrieves the result row column value and returns it to the caller. If the
     * internal index is not pointing to a valid row, or the requested column is
     * not part of the result set, an exception is thrown.
     *
     * @param string $name Name of the column
     * @return mixed
     *
     * @exceptions \SlaxWeb\Database\Exception\ResultRowNotFoundException
     *             \SlaxWeb\Database\Exception\ColumnNotFoundException
     */
    public function __get(string $name);

    /**
     * Next row
     *
     * Move the internal pointer to the next row of the result array. If there is
     * no row found under the next index, bool(false) is returned, otherwise bool(true)
     * is returned.
     *
     * @return bool
     */
    public function next(): bool;

    /**
     * Previous row
     *
     * Move the internal pointer to the previous row of the result array. If there
     * is no row found under the previous index, bool(false) is returned, otherwise
     * bool(true) is returned.
     *
     * @return bool
     */
    public function prev(): bool;

    /**
     * Jump to row
     *
     * Move the internal pointer to the passed in row of the result array. If there
     * is no row found under the passed in row, bool(false) is returned, otherwise
     * bool(true) is returned.
     *
     * @param int $row Row number
     * @return bool
     */
    public function row(int $row): bool;

    /**
     * Get row count
     *
     * Get the row count of the result set.
     *
     * @return int
     */
    public function rowCount(): int;

    /**
     * Get result set
     *
     * Returns the raw result set array to the caller.
     *
     * @return array
     */
    public function getResults(): array;

    /**
     * Get Row
     *
     * Returns the row object to the caller. If the row does not exists, an exception
     * is thrown.
     *
     * @return \stdClass
     *
     * @exceptions \SlaxWeb\Database\Exception\ResultRowNotFoundException
     */
    public function get(): \stdClass;
}


text:
import scala.tools.partest.ReplTest

object Test extends ReplTest {
  def code = """
:paste -raw
package scala { object T { @scala.annotation.migration("text", "2.8.0") def muh: String = "muuh" } }
\u0004
scala.T.muh    // no warn
:setting -Xmigration:none
scala.T.muh    // no warn
:setting -Xmigration:any
scala.T.muh    // warn
:setting -Xmigration:2.8
scala.T.muh    // no warn
:setting -Xmigration:2.7
scala.T.muh    // warn
:setting -Xmigration:2.11
scala.T.muh    // no warn
:setting -Xmigration // same as :any
scala.T.muh    // warn
  """
}


text:
<!doctype html>

    <link rel="stylesheet" type="text/css" href="../bower_components/qunit/qunit/qunit.css"/>

SystemJS Test Suite


text:
using FlashpackerFlights.Core.Interfaces.Persistance;
using FlashpackerFlights.Core.Model;
using Solution.Base.Interfaces.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FlashpackerFlights.Core.Interfaces.Services
{
    public interface IOpportunityService : IBaseEntityService<Opportunity>
    {

    }
}


text:
<?php

class Ecocode_Profiler_IndexController extends Ecocode_Profiler_Controller_AbstractController
{
    public function indexAction()
    {
        $this->loadLayout('profiler_default');
        $this->renderLayout();
    }

    public function toolbarAction()
    {
        $token    = $this->getRequest()->getParam(Ecocode_Profiler_Model_Profiler::URL_TOKEN_PARAMETER);
        $profiler = $this->getProfiler();

        $profile = $profiler->loadProfile($token);
        Mage::register('current_profile', $profile);

        $this->loadLayout(false);
        $this->renderLayout();
    }

    public function searchAction()
    {
        /** @var Mage_Core_Controller_Request_Http$request */
        $request  = $this->getRequest();

        $ip     = preg_replace('/[^:\d\.]/', '', $request->getParam('ip'));
        $method = $request->getParam('method');
        $url    = $request->getParam('url');
        $start  = $request->getParam('start');
        $end    = $request->getParam('end');
        $limit  = $request->getParam('limit');
        $token  = $request->getParam('_token');

        if ($session = Mage::getSingleton('ecocode_profiler/session')) {
            /** @var Ecocode_Profiler_Model_Session $session */
            $session->setData('search_ip', $ip);
            $session->setData('search_method', $method);
            $session->setData('search_url', $url);
            $session->setData('search_start', $start);
            $session->setData('search_end', $end);
            $session->setData('search_limit', $limit);
            $session->setData('search_token', $token);
        }

        if (!empty($token)) {
            return $this->_redirect('_profiler/index/panel', [Ecocode_Profiler_Model_Profiler::URL_TOKEN_PARAMETER => $token]);
        }

        return $this->_redirect('_profiler/index/searchResults',
            [
                'ip'     => $ip,
                'method' => $method,
                'url'    => $url,
                'start'  => $start,
                'end'    => $end,
                'limit'  => $limit,
            ]
        );
    }

    public function searchResultsAction()
    {
        /** @var Mage_Core_Controller_Request_Http$request */
        $request  = $this->getRequest();
        /** @var Ecocode_Profiler_Model_Profiler $profiler */
        $profiler = $this->getProfiler();

        if ($request->getParam('purge')) {
            $profiler->purgeAll();
        }

        $ip         = $request->getParam('ip');
        $method     = $request->getParam('method');
        $statusCode = $request->getParam('status_code');
        $url        = $request->getParam('url');
        $start      = $request->getParam('start');
        $end        = $request->getParam('end');
        $limit      = $request->getParam('limit');

        $data = [
            'request'     => $request,
            'tokens'      => $profiler->find($ip, $url, $limit, $method, $start, $end),
            'ip'          => $ip,
            'method'      => $method,
            'status_code' => $statusCode,
            'url'         => $url,
            'start'       => $start,
            'end'         => $end,
            'limit'       => $limit,
            'panel'       => null,
        ];

        $this->loadLayout('profiler_default');

        $this
            ->getLayout()
            ->getBlock('profiler.search.results')
            ->addData($data);

        $this->renderLayout();
    }

    public function panelAction()
    {
        $profiler = $this->getProfiler();

        /** @var Mage_Core_Controller_Request_Http $request */
        $request = $this->getRequest();

        $token = $request->getParam(Ecocode_Profiler_Model_Profiler::URL_TOKEN_PARAMETER);
        if (!$token) {
            return $this->_redirect('_profiler');
        }

        $panel = $request->getParam('panel', 'request');

        if ('latest' === $token && $latest = current($profiler->find(null, null, 1, null, null, null))) {
            $token = $latest['token'];
        }

        if (!$profile = $this->profiler->loadProfile($token)) {
            return $this->norouteAction();
        }

        /** @var Ecocode_Profiler_Model_Profile $profile */
        if (!$profile->hasCollector($panel)) {
            throw new Exception(sprintf('Panel "%s" is not available for token "%s".', $panel, $token));
        }

        Mage::register('current_profile', $profile);
        Mage::register('current_panel', $panel);

        $collector = $profile->getCollector($panel);

        $layoutHandler = 'collector_' . $collector->getName();
        $this->loadLayout(['profiler_default', $layoutHandler]);

        $panelBlock = $this->getLayout()->getBlock('panel');

        /** @var Ecocode_Profiler_Model_Profile $profile */
        if (!$panelBlock) {
            throw new Exception(sprintf('Panel Block for "%s" is not available for token "%s".', $panel, $token));
        }
        if (!($panelBlock instanceof Ecocode_Profiler_Block_Collector_Base)) {
            throw new Exception(sprintf('Panel Block must extend "Ecocode_Profiler_Block_Collector_AbstractBase"'));
        }

        $panelBlock->setCollector($collector);

        return $this->renderLayout();
    }

    /**
     * @codeCoverageIgnore
     */
    public function phpinfoAction()
    {
        phpinfo();
    }
}


text:
/*
 *  grfmt_imageio.h
 *
 *
 *  Created by Morgan Conbere on 5/17/07.
 *
 */

#ifndef _GRFMT_IMAGEIO_H_
#define _GRFMT_IMAGEIO_H_

#ifdef HAVE_IMAGEIO

#include "grfmt_base.hpp"
#include <TargetConditionals.h>

#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR

#include <MobileCoreServices/MobileCoreServices.h>
#include <ImageIO/ImageIO.h>

#else

#include <ApplicationServices/ApplicationServices.h>

#endif

namespace cv
{

class ImageIODecoder : public BaseImageDecoder
{
public:

    ImageIODecoder();
    ~ImageIODecoder();

    bool  readData( Mat& img );
    bool  readHeader();
    void  close();

    size_t signatureLength() const;
    bool checkSignature( const string& signature ) const;

    ImageDecoder newDecoder() const;

protected:

    CGImageRef imageRef;
};

class ImageIOEncoder : public BaseImageEncoder
{
public:
    ImageIOEncoder();
    ~ImageIOEncoder();

    bool  write( const Mat& img, const vector<int>& params );

    ImageEncoder newEncoder() const;
};

}

#endif/*HAVE_IMAGEIO*/

#endif/*_GRFMT_IMAGEIO_H_*/


text:
namespace optimization_guide {

std::unique_ptr<proto::PredictionModel> GetValidDecisionTreePredictionModel() {
  std::unique_ptr<proto::PredictionModel> prediction_model =
      std::make_unique<proto::PredictionModel>();
  prediction_model->mutable_model()->mutable_threshold()->set_value(5.0);

  proto::DecisionTree decision_tree_model = proto::DecisionTree();
  decision_tree_model.set_weight(2.0);

  proto::TreeNode* tree_node = decision_tree_model.add_nodes();
  tree_node->mutable_node_id()->set_value(0);
  tree_node->mutable_binary_node()->mutable_left_child_id()->set_value(1);
  tree_node->mutable_binary_node()->mutable_right_child_id()->set_value(2);
  tree_node->mutable_binary_node()
      ->mutable_inequality_left_child_test()
      ->mutable_feature_id()
      ->mutable_id()
      ->set_value("agg1");
  tree_node->mutable_binary_node()
      ->mutable_inequality_left_child_test()
      ->set_type(proto::InequalityTest::LESS_OR_EQUAL);
  tree_node->mutable_binary_node()
      ->mutable_inequality_left_child_test()
      ->mutable_threshold()
      ->set_float_value(1.0);

  tree_node = decision_tree_model.add_nodes();
  tree_node->mutable_node_id()->set_value(1);
  tree_node->mutable_leaf()->mutable_vector()->add_value()->set_double_value(
      2.);

  tree_node = decision_tree_model.add_nodes();
  tree_node->mutable_node_id()->set_value(2);
  tree_node->mutable_leaf()->mutable_vector()->add_value()->set_double_value(
      4.);

  *prediction_model->mutable_model()->mutable_decision_tree() =
      decision_tree_model;
  return prediction_model;
}

std::unique_ptr<proto::PredictionModel> GetValidEnsemblePredictionModel() {
  std::unique_ptr<proto::PredictionModel> prediction_model =
      std::make_unique<proto::PredictionModel>();
  prediction_model->mutable_model()->mutable_threshold()->set_value(5.0);
  proto::Ensemble ensemble = proto::Ensemble();
  *ensemble.add_members()->mutable_submodel() =
      *GetValidDecisionTreePredictionModel()->mutable_model();

  *ensemble.add_members()->mutable_submodel() =
      *GetValidDecisionTreePredictionModel()->mutable_model();

  *prediction_model->mutable_model()->mutable_ensemble() = ensemble;
  return prediction_model;
}

TEST(DecisionTreePredictionModel, ValidDecisionTreeModel) {
  std::unique_ptr<proto::PredictionModel> prediction_model =
      GetValidDecisionTreePredictionModel();

  proto::ModelInfo* model_info = prediction_model->mutable_model_info();
  model_info->set_version(1);
  model_info->add_supported_model_types(
      proto::ModelType::MODEL_TYPE_DECISION_TREE);
  model_info->add_supported_model_features(
      proto::ClientModelFeature::
          CLIENT_MODEL_FEATURE_EFFECTIVE_CONNECTION_TYPE);
  model_info->add_supported_host_model_features("agg1");

  std::unique_ptr<PredictionModel> model =
      PredictionModel::Create(std::move(prediction_model));
  EXPECT_TRUE(model);

  double prediction_score;
  EXPECT_EQ(OptimizationTargetDecision::kPageLoadDoesNotMatch,
            model->Predict({{"agg1", 1.0}}, &prediction_score));
  EXPECT_EQ(4., prediction_score);
  EXPECT_EQ(OptimizationTargetDecision::kPageLoadMatches,
            model->Predict({{"agg1", 2.0}}, &prediction_score));
  EXPECT_EQ(8., prediction_score);
}

TEST(DecisionTreePredictionModel, InequalityLessThan) {
  std::unique_ptr<proto::PredictionModel> prediction_model =
      GetValidDecisionTreePredictionModel();

  prediction_model->mutable_model()
      ->mutable_decision_tree()
      ->mutable_nodes(0)
      ->mutable_binary_node()
      ->mutable_inequality_left_child_test()
      ->set_type(proto::InequalityTest::LESS_THAN);

  proto::ModelInfo* model_info = prediction_model->mutable_model_info();
  model_info->set_version(1);
  model_info->add_supported_model_types(
      proto::ModelType::MODEL_TYPE_DECISION_TREE);
  model_info->add_supported_model_features(
      proto::ClientModelFeature::
          CLIENT_MODEL_FEATURE_EFFECTIVE_CONNECTION_TYPE);
  model_info->add_supported_host_model_features("agg1");

  std::unique_ptr<PredictionModel> model =
      PredictionModel::Create(std::move(prediction_model));
  EXPECT_TRUE(model);

  double prediction_score;
  EXPECT_EQ(OptimizationTargetDecision::kPageLoadDoesNotMatch,
            model->Predict({{"agg1", 0.5}}, &prediction_score));
  EXPECT_EQ(4., prediction_score);
  EXPECT_EQ(OptimizationTargetDecision::kPageLoadMatches,
            model->Predict({{"agg1", 2.0}}, &prediction_score));
  EXPECT_EQ(8., prediction_score);
}

TEST(DecisionTreePredictionModel, InequalityGreaterOrEqual) {
  std::unique_ptr<proto::PredictionModel> prediction_model =
      GetValidDecisionTreePredictionModel();

  prediction_model->mutable_model()
      ->mutable_decision_tree()
      ->mutable_nodes(0)
      ->mutable_binary_node()
      ->mutable_inequality_left_child_test()
      ->set_type(proto::InequalityTest::GREATER_OR_EQUAL);

  proto::ModelInfo* model_info = prediction_model->mutable_model_info();
  model_info->set_version(1);
  model_info->add_supported_model_types(
      proto::ModelType::MODEL_TYPE_DECISION_TREE);
  model_info->add_supported_model_features(
      proto::ClientModelFeature::
          CLIENT_MODEL_FEATURE_EFFECTIVE_CONNECTION_TYPE);
  model_info->add_supported_host_model_features("agg1");

  std::unique_ptr<PredictionModel> model =
      PredictionModel::Create(std::move(prediction_model));
  EXPECT_TRUE(model);

  double prediction_score;
  EXPECT_EQ(OptimizationTargetDecision::kPageLoadMatches,
            model->Predict({{"agg1", 0.5}}, &prediction_score));
  EXPECT_EQ(8., prediction_score);
  EXPECT_EQ(OptimizationTargetDecision::kPageLoadDoesNotMatch,
            model->Predict({{"agg1", 1.0}}, &prediction_score));
  EXPECT_EQ(4., prediction_score);
}

TEST(DecisionTreePredictionModel, InequalityGreaterThan) {
  std::unique_ptr<proto::PredictionModel> prediction_model =
      GetValidDecisionTreePredictionModel();

  prediction_model->mutable_model()
      ->mutable_decision_tree()
      ->mutable_nodes(0)
      ->mutable_binary_node()
      ->mutable_inequality_left_child_test()
      ->set_type(proto::InequalityTest::GREATER_THAN);

  proto::ModelInfo* model_info = prediction_model->mutable_model_info();
  model_info->set_version(1);
  model_info->add_supported_model_types(
      proto::ModelType::MODEL_TYPE_DECISION_TREE);
  model_info->add_supported_model_features(
      proto::ClientModelFeature::
          CLIENT_MODEL_FEATURE_EFFECTIVE_CONNECTION_TYPE);
  model_info->add_supported_host_model_features("agg1");

  std::unique_ptr<PredictionModel> model =
      PredictionModel::Create(std::move(prediction_model));
  EXPECT_TRUE(model);

  double prediction_score;
  EXPECT_EQ(OptimizationTargetDecision::kPageLoadMatches,
            model->Predict({{"agg1", 0.5}}, &prediction_score));
  EXPECT_EQ(8., prediction_score);
  EXPECT_EQ(OptimizationTargetDecision::kPageLoadDoesNotMatch,
            model->Predict({{"agg1", 2.0}}, &prediction_score));
  EXPECT_EQ(4., prediction_score);
}

TEST(DecisionTreePredictionModel, MissingInequalityTest) {
  std::unique_ptr<proto::PredictionModel> prediction_model =
      GetValidDecisionTreePredictionModel();

  prediction_model->mutable_model()
      ->mutable_decision_tree()
      ->mutable_nodes(0)
      ->mutable_binary_node()
      ->mutable_inequality_left_child_test()
      ->Clear();

  proto::ModelInfo* model_info = prediction_model->mutable_model_info();
  model_info->set_version(1);
  model_info->add_supported_model_types(
      proto::ModelType::MODEL_TYPE_DECISION_TREE);
  model_info->add_supported_model_features(
      proto::ClientModelFeature::
          CLIENT_MODEL_FEATURE_EFFECTIVE_CONNECTION_TYPE);
  model_info->add_supported_host_model_features("agg1");

  std::unique_ptr<PredictionModel> model =
      PredictionModel::Create(std::move(prediction_model));
  EXPECT_FALSE(model);
}

TEST(DecisionTreePredictionModel, NoDecisionTreeThreshold) {
  std::unique_ptr<proto::PredictionModel> prediction_model =
      GetValidDecisionTreePredictionModel();

  prediction_model->mutable_model()->clear_threshold();

  proto::ModelInfo* model_info = prediction_model->mutable_model_info();
  model_info->set_version(1);
  model_info->add_supported_model_types(
      proto::ModelType::MODEL_TYPE_DECISION_TREE);
  model_info->add_supported_model_features(
      proto::ClientModelFeature::
          CLIENT_MODEL_FEATURE_EFFECTIVE_CONNECTION_TYPE);
  model_info->add_supported_host_model_features("agg1");

  std::unique_ptr<PredictionModel> model =
      PredictionModel::Create(std::move(prediction_model));
  EXPECT_FALSE(model);
}

TEST(DecisionTreePredictionModel, EmptyTree) {
  std::unique_ptr<proto::PredictionModel> prediction_model =
      GetValidDecisionTreePredictionModel();

  prediction_model->mutable_model()->mutable_decision_tree()->clear_nodes();

  proto::ModelInfo* model_info = prediction_model->mutable_model_info();
  model_info->set_version(1);
  model_info->add_supported_model_types(
      proto::ModelType::MODEL_TYPE_DECISION_TREE);
  model_info->add_supported_model_features(
      proto::ClientModelFeature::
          CLIENT_MODEL_FEATURE_EFFECTIVE_CONNECTION_TYPE);
  model_info->add_supported_host_model_features("agg1");

  std::unique_ptr<PredictionModel> model =
      PredictionModel::Create(std::move(prediction_model));
  EXPECT_FALSE(model);
}

TEST(DecisionTreePredictionModel, ModelFeatureNotInFeatureMap) {
  std::unique_ptr<proto::PredictionModel> prediction_model =
      GetValidDecisionTreePredictionModel();

  prediction_model->mutable_model()->mutable_decision_tree()->clear_nodes();

  proto::ModelInfo* model_info = prediction_model->mutable_model_info();
  model_info->set_version(1);
  model_info->add_supported_model_types(
      proto::ModelType::MODEL_TYPE_DECISION_TREE);
  model_info->add_supported_model_features(
      proto::ClientModelFeature::
          CLIENT_MODEL_FEATURE_EFFECTIVE_CONNECTION_TYPE);
  model_info->add_supported_host_model_features("agg1");

  std::unique_ptr<PredictionModel> model =
      PredictionModel::Create(std::move(prediction_model));
  EXPECT_FALSE(model);
}

TEST(DecisionTreePredictionModel, DecisionTreeMissingLeaf) {
  std::unique_ptr<proto::PredictionModel> prediction_model =
      GetValidDecisionTreePredictionModel();

  prediction_model->mutable_model()
      ->mutable_decision_tree()
      ->mutable_nodes(1)
      ->mutable_leaf()
      ->Clear();

  proto::ModelInfo* model_info = prediction_model->mutable_model_info();
  model_info->set_version(1);
  model_info->add_supported_model_types(
      proto::ModelType::MODEL_TYPE_DECISION_TREE);
  model_info->add_supported_model_features(
      proto::ClientModelFeature::
          CLIENT_MODEL_FEATURE_EFFECTIVE_CONNECTION_TYPE);
  model_info->add_supported_host_model_features("agg1");

  std::unique_ptr<PredictionModel> model =
      PredictionModel::Create(std::move(prediction_model));
  EXPECT_FALSE(model);
}

TEST(DecisionTreePredictionModel, DecisionTreeLeftChildIndexInvalid) {
  std::unique_ptr<proto::PredictionModel> prediction_model =
      GetValidDecisionTreePredictionModel();

  prediction_model->mutable_model()
      ->mutable_decision_tree()
      ->mutable_nodes(0)
      ->mutable_binary_node()
      ->mutable_left_child_id()
      ->set_value(3);

  proto::ModelInfo* model_info = prediction_model->mutable_model_info();
  model_info->set_version(1);
  model_info->add_supported_model_types(
      proto::ModelType::MODEL_TYPE_DECISION_TREE);
  model_info->add_supported_model_features(
      proto::ClientModelFeature::
          CLIENT_MODEL_FEATURE_EFFECTIVE_CONNECTION_TYPE);
  model_info->add_supported_host_model_features("agg1");

  std::unique_ptr<PredictionModel> model =
      PredictionModel::Create(std::move(prediction_model));
  EXPECT_FALSE(model);
}

TEST(DecisionTreePredictionModel, DecisionTreeRightChildIndexInvalid) {
  std::unique_ptr<proto::PredictionModel> prediction_model =
      GetValidDecisionTreePredictionModel();

  prediction_model->mutable_model()
      ->mutable_decision_tree()
      ->mutable_nodes(0)
      ->mutable_binary_node()
      ->mutable_right_child_id()
      ->set_value(3);

  proto::ModelInfo* model_info = prediction_model->mutable_model_info();
  model_info->set_version(1);
  model_info->add_supported_model_types(
      proto::ModelType::MODEL_TYPE_DECISION_TREE);
  model_info->add_supported_model_features(
      proto::ClientModelFeature::
          CLIENT_MODEL_FEATURE_EFFECTIVE_CONNECTION_TYPE);
  model_info->add_supported_host_model_features("agg1");

  std::unique_ptr<PredictionModel> model =
      PredictionModel::Create(std::move(prediction_model));
  EXPECT_FALSE(model);
}

TEST(DecisionTreePredictionModel, DecisionTreeWithLoopOnLeftChild) {
  std::unique_ptr<proto::PredictionModel> prediction_model =
      GetValidDecisionTreePredictionModel();

  proto::TreeNode* tree_node =
      prediction_model->mutable_model()->mutable_decision_tree()->mutable_nodes(
          1);

  tree_node->mutable_node_id()->set_value(0);
  tree_node->mutable_binary_node()
      ->mutable_inequality_left_child_test()
      ->mutable_feature_id()
      ->mutable_id()
      ->set_value("agg1");
  tree_node->mutable_binary_node()
      ->mutable_inequality_left_child_test()
      ->set_type(proto::InequalityTest::LESS_OR_EQUAL);
  tree_node->mutable_binary_node()
      ->mutable_inequality_left_child_test()
      ->mutable_threshold()
      ->set_float_value(1.0);

  tree_node->mutable_binary_node()->mutable_left_child_id()->set_value(0);
  tree_node->mutable_binary_node()->mutable_right_child_id()->set_value(2);

  proto::ModelInfo* model_info = prediction_model->mutable_model_info();
  model_info->set_version(1);
  model_info->add_supported_model_types(
      proto::ModelType::MODEL_TYPE_DECISION_TREE);
  model_info->add_supported_model_features(
      proto::ClientModelFeature::
          CLIENT_MODEL_FEATURE_EFFECTIVE_CONNECTION_TYPE);
  model_info->add_supported_host_model_features("agg1");

  std::unique_ptr<PredictionModel> model =
      PredictionModel::Create(std::move(prediction_model));
  EXPECT_FALSE(model);
}

TEST(DecisionTreePredictionModel, DecisionTreeWithLoopOnRightChild) {
  std::unique_ptr<proto::PredictionModel> prediction_model =
      GetValidDecisionTreePredictionModel();

  proto::TreeNode* tree_node =
      prediction_model->mutable_model()->mutable_decision_tree()->mutable_nodes(
          1);

  tree_node->mutable_node_id()->set_value(0);
  tree_node->mutable_binary_node()
      ->mutable_inequality_left_child_test()
      ->mutable_feature_id()
      ->mutable_id()
      ->set_value("agg1");
  tree_node->mutable_binary_node()
      ->mutable_inequality_left_child_test()
      ->set_type(proto::InequalityTest::LESS_OR_EQUAL);
  tree_node->mutable_binary_node()
      ->mutable_inequality_left_child_test()
      ->mutable_threshold()
      ->set_float_value(1.0);

  tree_node->mutable_binary_node()->mutable_left_child_id()->set_value(2);
  tree_node->mutable_binary_node()->mutable_right_child_id()->set_value(0);

  proto::ModelInfo* model_info = prediction_model->mutable_model_info();
  model_info->set_version(1);
  model_info->add_supported_model_types(
      proto::ModelType::MODEL_TYPE_DECISION_TREE);
  model_info->add_supported_model_features(
      proto::ClientModelFeature::
          CLIENT_MODEL_FEATURE_EFFECTIVE_CONNECTION_TYPE);
  model_info->add_supported_host_model_features("agg1");

  std::unique_ptr<PredictionModel> model =
      PredictionModel::Create(std::move(prediction_model));
  EXPECT_FALSE(model);
}

TEST(DecisionTreePredictionModel, ValidEnsembleModel) {
  std::unique_ptr<proto::PredictionModel> prediction_model =
      GetValidEnsemblePredictionModel();

  proto::ModelInfo* model_info = prediction_model->mutable_model_info();
  model_info->set_version(1);
  model_info->add_supported_model_types(
      proto::ModelType::MODEL_TYPE_DECISION_TREE);
  model_info->add_supported_model_features(
      proto::ClientModelFeature::
          CLIENT_MODEL_FEATURE_EFFECTIVE_CONNECTION_TYPE);
  model_info->add_supported_host_model_features("agg1");

  std::unique_ptr<PredictionModel> model =
      PredictionModel::Create(std::move(prediction_model));
  EXPECT_TRUE(model);

  double prediction_score;
  EXPECT_EQ(OptimizationTargetDecision::kPageLoadDoesNotMatch,
            model->Predict({{"agg1", 1.0}}, &prediction_score));
  EXPECT_EQ(4., prediction_score);
  EXPECT_EQ(OptimizationTargetDecision::kPageLoadMatches,
            model->Predict({{"agg1", 2.0}}, &prediction_score));
  EXPECT_EQ(8., prediction_score);
}

TEST(DecisionTreePredictionModel, EnsembleWithNoMembers) {
  std::unique_ptr<proto::PredictionModel> prediction_model =
      GetValidEnsemblePredictionModel();
  prediction_model->mutable_model()
      ->mutable_ensemble()
      ->mutable_members()
      ->Clear();

  proto::ModelInfo* model_info = prediction_model->mutable_model_info();
  model_info->set_version(1);
  model_info->add_supported_model_types(
      proto::ModelType::MODEL_TYPE_DECISION_TREE);
  model_info->add_supported_model_features(
      proto::ClientModelFeature::
          CLIENT_MODEL_FEATURE_EFFECTIVE_CONNECTION_TYPE);
  model_info->add_supported_host_model_features("agg1");

  std::unique_ptr<PredictionModel> model =
      PredictionModel::Create(std::move(prediction_model));
  EXPECT_FALSE(model);
}

}  // namespace optimization_guide


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- From: file:/C:/Users/RXUsagi/Desktop/volleyball/MyApplication5/facebook/res/values-es-rES/messenger_button_strings.xml -->
    <eat-comment/>
    <string name="messenger_send_button_text">Enviar</string>
</resources>


text:
A JavaScript based Cloud Foundry Api client targeting the v2 api.

This client supports running in the browser via an AMD compatible loader (such as requirejs) and on the server under Node.js

## Status

The client is under heavy development so expect some issues. It would be great to see it evolve in to a comprehensive client
covering the entire Cloud Foundry Api but initially functionality will be added in the order that we need it for in other projects.

## Dependencies

### Browser Dependencies

* RequireJS (or AMD compatible loader)
* jQuery (exported as 'jquery')
* Underscore (exported as 'underscore')
* Event Emitter (exported as 'event-emitter')

Browser dependencies must be pulled in via your AMD loader e.g. if using requirejs you would configure your paths as:

```
paths:{
    jquery: 'cloud-foundry-client/vendor/jquery/jquery-1.10.1.min',
    underscore: 'cloud-foundry-client/vendor/underscore/underscore-1.4.4.min',
    'event-emitter': 'cloud-foundry-client/vendor/event-emitter/event-emitter.4.0.3.min',
}
```

You may point these paths at your own copies of the dependencies if you're already using them elsewhere in your project.

Browser dependencies are bundled in the ```/vendor``` directory.

### Node.js Dependencies

* Request
* Underscore (or lodash)

Node.js dependencies are pulled in via NPM

## Notes About Cross Domain Requests

Cloud Foundry v2 doesn't support cross domain requests out of the box. Until it does then there are a few ways to work
around it:

 1. Run your browser with cross domain security disabled (not recommended outside of development). In Chrome this can be
 achieved with the --disable-web-security flag.

  If you do this you'll notice that Cloud Foundry will throw a 500 internal server error when any API call is made with
  mismatched host and referrer headers, which makes it impossible to run cross domain requests (even if the browser
  allows them).

  You can patch your ```cloud_controller_ng``` by inserting the following code in ```line 50``` of ```cloud_controller_ng/lib/sinatra/vcap.rb```:

  ```
  # Allow browser based clients to talk to the CC Api across domains
  # This is not a full cross domain solution but it prevents Sinatra throwing a 500 error
  # when referrer and host headers do not match.
  # See https://github.com/sinatra/sinatra/issues/747

  app.set :protection, :except => [:remote_referrer, :json_csrf]

  ```

2. Use a reverse proxy to avoid cross domain requests all together.

## Tests

### Browser Tests

Open ```tests/test.html```

### Node.js Tests

Run ```npm run-script test```

## Usage

### Browser Usage

1. Load the api object via an AMD module loader (requirejs example below):
    ```
    main.js

    {
        baseUrl: "js/",
        paths: {
            'cloud-foundry-client': 'lib/cloud-foundry-client'
        }
    }
```

2. Use the api object in your code - note you are responsible for providing the token as well as providing a page to redirect to
that is capable of pulling the token from the url (see ```/examples/oauth.html```):

    ```
    define([
        'cloud-foundry-client/api'],
        function(CFApi){

            var cf_api = new CFApi(api_endpoint, {
                token: Utils.getCookie('cf_token'),
                redirect_uri: html_root + 'oauth.html'
               });

            cf_api.apps.list({
                        paging: {
                            'results-per-page': 1
                        },
                        filter: {
                            name: "instances",
                            value: ">1"
                       }},
                    function (err, page) {
                       if (err) {return console.log(err);}

                        console.log(page.data);

                        if (page.hasNextPage()) {
                            page.getNextPage(function (err, next_page) {
                                ...
                           });
                       }
                    }
               );
    });
    ```

### Node.js Usage

1. ```npm install cloud-foundry``` (or add 'cloud-foundry' as a dependency in your package.json)

2. Use the api object in your code - note that authentication isn't yet supported for Node.js so an expired/invalid token
will bubble out as an error. We would like to add support for refresh tokens and authentication via client credentials
at some stage:

 ```
 var CloudFoundryApi = require('cloud-foundry');

 var cf_api = new CloudFoundryApi(api_endpoint, {token: 'foobar'});

 cf_api.apps.list({
            paging: {
                'results-per-page': 1
            },
            filter: {
                name: "instances",
                value: ">1"
           }},
        function (err, page) {
           if (err) {return console.log(err);}

            console.log(page.data);

            if (page.hasNextPage()) {
                page.getNextPage(function (err, next_page) {
                    ...
               });
           }
        }
   );

 ```

## TODO:

1. Better test coverage

2. Implement support for refresh tokens

3. Implement authentication via client credentials (for resource servers) when running under Node.js

## Contributing

Pull requests and issues welcome!


text:
import glob
import json
import sys
import os

used = []
for _used in glob.glob('gen/log-used/*.json'):
  with open(_used) as f:
    used = used + json.load(f)
used = [_used for _used in set(used) if not _used.startswith('gen/')]
#print(used)

sources = []
for root in ['content', 'translators']:
  for (dirpath, dirnames, filenames) in os.walk(root):
    if dirpath == 'content/minitests':
      continue
    sources += [os.path.join(dirpath, filename) for filename in filenames if os.path.splitext(filename)[1] not in ['.xul', '.swp']]

unused = [src for src in sources if not src in used]

for src in unused:
  print(f'Not used: {src}')
sys.exit(len(unused))


text:
using System;
using System.Reflection;
using Microsoft.Extensions.Logging;
using NakedFramework.Architecture.Adapter;
using NakedFramework.Architecture.Facet;
using NakedFramework.Architecture.Framework;
using NakedFramework.Architecture.Interactions;
using NakedFramework.Core.Error;
using NakedFramework.Metamodel.Facet;
using NakedFramework.Metamodel.Serialization;
using NakedFunctions.Reflector.Utils;

namespace NakedFunctions.Reflector.Facet;

[Serializable]
public sealed class HideForContextViaFunctionFacet : FacetAbstract, IHideForContextFacet, IImperativeFacet {
    private readonly MethodSerializationWrapper methodWrapper;

    public HideForContextViaFunctionFacet(MethodInfo method, ILogger<HideForContextViaFunctionFacet> logger) => methodWrapper = SerializationFactory.Wrap(method, logger);

    public override Type FacetType => typeof(IHideForContextFacet);

    #region IHideForContextFacet Members

    public string Hides(IInteractionContext ic) => HiddenReason(ic.Target, ic.Framework);

    public Exception CreateExceptionFor(IInteractionContext ic) => new HiddenException(ic, Hides(ic));

    public string HiddenReason(INakedObjectAdapter nakedObjectAdapter, INakedFramework framework) {
        var isHidden = methodWrapper.Invoke<bool>(GetMethod().GetParameterValues(nakedObjectAdapter, framework));
        return isHidden ? NakedObjects.Resources.NakedObjects.Hidden : null;
    }

    #endregion

    #region IImperativeFacet Members

    /// <summary>
    ///     See <see cref="IImperativeFacet" />
    /// </summary>
    public MethodInfo GetMethod() => methodWrapper.GetMethod();

    public Func<object, object[], object> GetMethodDelegate() => methodWrapper.GetMethodDelegate();

    #endregion
}

// Copyright (c) Naked Objects Group Ltd.


text:
<% var namespace = _.camelize(appname).toLowerCase(); %>
describe( "validate email address", function () {
  var checkEmail = <%= namespace %>.utils.checkEmail;

  it("It's a valid email address", function () {
    expect(checkEmail("example@redhat.com")).toBe(true);
  });

  it("It's an invalid email address", function () {
    expect(checkEmail("eaample@redhatcom")).toBe(false);
  });
});


text:
Here you can find IPython notebooks and shell scripts that illustrate how to use DeepCpG.

To setup the required dependencies, execute `setup.sh`:

```shell
bash setup.sh
```

## Notebooks
`./notebooks` contains [IPython notebooks](https://ipython.org/notebook.html), which can be executed interactively. They can be exported to shell scripts and executed in the terminal by selecting `File -> Download as -> Bash (.sh)`. This is recommended for large-scale experiments, e.g. training models on the entire data set.

* [DeepCpG basics](./notebooks/basics/index.ipynb): Pre-processing data, training models, and evaluating models.
* [Fine-tuning](./notebooks/fine_tune/index.ipynb): Fine-tuning a pre-trained model to speed-up training.
* [Motif analysis](./notebooks/motifs/index.ipynb): Visualizing and analyzing learned motifs.
* [Mutations effects](./notebooks/snp/index.ipynb): Computing and visualizing mutations effects.
* [Predicting statistics](./notebooks/stats/index.ipynb): Predicting statistics such as cell-to-cell variance.

## Shell scripts
`./scripts` contains shell scrips with recommended default parameters. They may help you to easily build a DeepCpG pipeline for creating data, training models, and evaluating models. Set `test_mode` variable in scripts to `1` for testing, and `0` otherwise.

* [lib.sh](./scripts/lib.sh): Global variable definitions and functions.
* [data.sh](./scripts/data.sh): Creates DeepCpG data files.
* [train.sh](./scripts/train.sh): Trains DeepCpG DNA, CpG, and Joint model separately.
* [eval.sh](./scripts/eval.sh): Evaluates prediction performances and imputes methylation profiles.


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Diagnostics.CodeAnalysis;
using PutridParrot.Delimited.Data.Exceptions;

namespace PutridParrot.Delimited.Data
{
	/// <summary>
	/// Low-level writer, simply used to write rows of data
	/// </summary>
	public class DelimitedStreamWriter : IDisposable
	{
		[SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
		protected Stream stream;
		[SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
		protected StreamWriter writer;
		[SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
		protected IDelimitedSeparatedWriter dsWriter;
		[SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
		protected bool disposed;

		public DelimitedStreamWriter(IDelimitedSeparatedWriter delimiterSeparatedWriter, Stream stream) :
			this(delimiterSeparatedWriter, stream, null)
		{
		}

		public DelimitedStreamWriter(IDelimitedSeparatedWriter delimiterSeparatedWriter, Stream stream, Encoding encoding)
		{
			if (stream == null)
			{
				throw new ArgumentNullException("stream");
			}

			dsWriter = delimiterSeparatedWriter;
			this.stream = stream;
			if (!stream.CanWrite)
			{
				throw new DelimitedStreamWriterException("Unable to write to the supplied stream");
			}
			writer = (encoding != null) ? new StreamWriter(stream, encoding) : new StreamWriter(stream);
		}

		[ExcludeFromCodeCoverage]
		public DelimitedStreamWriter(IDelimitedSeparatedWriter delimiterSeparatedWriter, string path) :
			this(delimiterSeparatedWriter, path, null)
		{
		}

		[ExcludeFromCodeCoverage]
		[SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")]
		public DelimitedStreamWriter(IDelimitedSeparatedWriter delimiterSeparatedWriter, string path, Encoding encoding) :
			this(delimiterSeparatedWriter, new FileStream(path, FileMode.Create, FileAccess.Write), encoding)
		{
		}

		public void Dispose()
		{
			Dispose(true);
			GC.SuppressFinalize(this);
		}

		protected virtual void Dispose(bool disposing)
		{
			if (!disposed)
			{
				if (disposing)
				{
					Close();
				}
			}
			disposed = true;
		}

		public void Close()
		{
			if (writer != null)
			{
				writer.Close();
				writer = null;
				stream = null;
			}
			else if (stream != null)
			{
				stream.Close();
				stream = null;
			}
		}

		public void Flush()
		{
			if (writer != null)
			{
				writer.Flush();
			}
		}

		[SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "StreamWriter")]
		public void Write(IEnumerable<string> data)
		{
			if (writer == null)
				throw new DelimitedStreamWriterException("StreamWriter is null");

			dsWriter.Write(writer, data);
		}

		public void WriteLine(IEnumerable<string> data)
		{
			Write(data);
			writer.WriteLine();
		}
	}

}


text:
require "spec_helper"

describe StaticController do
  let(:user) { FactoryGirl.create(:user) }

  before do
    sign_in user
  end

  describe "GET index" do
    subject { get :index }

    it { should be_successful }
  end
end


text:
ACCEPTED

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

#### Published in
Mycotaxon 40: 163 (1991)

#### Original name
Ustilago carbo var. lepturi Thüm.

### Remarks
null


text:
package com.github.rlishtaba.commutable

import jssc.SerialPortList

object Utils {
  def rs232portNames: Array[String] = {
    SerialPortList.getPortNames()
  }
}


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

<title>Dimension (JOGL, NativeWindow and NEWT APIs)</title>
<meta name="date" content="2014-01-31">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

javax.media.nativewindow.util

Class Dimension

java.lang.Object

javax.media.nativewindow.util.Dimension

All Implemented Interfaces:

WriteCloneable, Cloneable, Comparable<DimensionImmutable>, DimensionImmutable

public class Dimension
extends Object
implements Cloneable, DimensionImmutable

Constructor Summary

Constructors

Constructor and Description

Dimension()

Dimension(int width,
         int height)

Method Summary

Methods

Modifier and Type
Method and Description

Dimension
add(Dimension pd)

Object
clone()

Object
cloneMutable()

int
compareTo(DimensionImmutable d)

 Compares square of size.

boolean
equals(Object obj)

Checks whether two dimensions objects are equal.

int
getHeight()

int
getWidth()

int
hashCode()

Dimension
scale(int s)

void
set(int width,
   int height)

void
setHeight(int height)

void
setWidth(int width)

String
toString()

Methods inherited from class java.lang.Object

getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

Dimension

public Dimension()

Dimension

public Dimension(int width,
         int height)

Method Detail

cloneMutable

public Object cloneMutable()

Specified by:

cloneMutable in interface WriteCloneable

clone

public Object clone()

Overrides:

clone in class Object

getWidth

public final int getWidth()

Specified by:

getWidth in interface DimensionImmutable

getHeight

public final int getHeight()

Specified by:

getHeight in interface DimensionImmutable

set

public final void set(int width,
       int height)

setWidth

public final void setWidth(int width)

setHeight

public final void setHeight(int height)

scale

public final Dimension scale(int s)

add

public final Dimension add(Dimension pd)

toString

public String toString()

Overrides:

toString in class Object

compareTo

public int compareTo(DimensionImmutable d)

Description copied from interface: DimensionImmutable

 Compares square of size.

Specified by:

compareTo in interface Comparable<DimensionImmutable>

Specified by:

compareTo in interface DimensionImmutable

equals

public boolean equals(Object obj)

Description copied from interface: DimensionImmutable

Checks whether two dimensions objects are equal. Two instances
 of DimensionReadOnly are equal if two components
 height and width are equal.

Specified by:

equals in interface DimensionImmutable

Overrides:

equals in class Object

Returns:

true if the two dimensions are equal;
          otherwise false.

hashCode

public int hashCode()

Specified by:

hashCode in interface DimensionImmutable

Overrides:

hashCode in class Object

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Copyright 2010 JogAmp Community.


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

    <ImageView
        android:id="@+id/first_recycler_img"
        android:layout_width="150dp"
        android:layout_height="200dp"
        android:scaleType="fitXY"
        android:src="@mipmap/icon_my_home_activity"/>

</LinearLayout>


text:
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osuTK;
using osuTK.Graphics;

namespace osu.Game.Screens.Play.PlayerSettings
{
    public abstract class PlayerSettingsGroup : Container
    {
        /// <summary>
        /// The title to be displayed in the header of this group.
        /// </summary>
        protected abstract string Title { get; }

        private const float transition_duration = 250;
        private const int container_width = 270;
        private const int border_thickness = 2;
        private const int header_height = 30;
        private const int corner_radius = 5;

        private readonly FillFlowContainer content;
        private readonly IconButton button;

        private bool expanded = true;

        public bool Expanded
        {
            get => expanded;
            set
            {
                if (expanded == value) return;

                expanded = value;

                content.ClearTransforms();

                if (expanded)
                    content.AutoSizeAxes = Axes.Y;
                else
                {
                    content.AutoSizeAxes = Axes.None;
                    content.ResizeHeightTo(0, transition_duration, Easing.OutQuint);
                }

                updateExpanded();
            }
        }

        private Color4 expandedColour;

        protected PlayerSettingsGroup()
        {
            AutoSizeAxes = Axes.Y;
            Width = container_width;
            Masking = true;
            CornerRadius = corner_radius;
            BorderColour = Color4.Black;
            BorderThickness = border_thickness;

            InternalChildren = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour = Color4.Black,
                    Alpha = 0.5f,
                },
                new FillFlowContainer
                {
                    Direction = FillDirection.Vertical,
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes = Axes.Y,
                    Children = new Drawable[]
                    {
                        new Container
                        {
                            Name = @"Header",
                            Origin = Anchor.TopCentre,
                            Anchor = Anchor.TopCentre,
                            RelativeSizeAxes = Axes.X,
                            Height = header_height,
                            Children = new Drawable[]
                            {
                                new OsuSpriteText
                                {
                                    Origin = Anchor.CentreLeft,
                                    Anchor = Anchor.CentreLeft,
                                    Text = Title.ToUpperInvariant(),
                                    Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 17),
                                    Margin = new MarginPadding { Left = 10 },
                                },
                                button = new IconButton
                                {
                                    Origin = Anchor.Centre,
                                    Anchor = Anchor.CentreRight,
                                    Position = new Vector2(-15, 0),
                                    Icon = FontAwesome.Bars,
                                    Scale = new Vector2(0.75f),
                                    Action = () => Expanded = !Expanded,
                                },
                            }
                        },
                        content = new FillFlowContainer
                        {
                            Name = @"Content",
                            Origin = Anchor.TopCentre,
                            Anchor = Anchor.TopCentre,
                            Direction = FillDirection.Vertical,
                            RelativeSizeAxes = Axes.X,
                            AutoSizeDuration = transition_duration,
                            AutoSizeEasing = Easing.OutQuint,
                            AutoSizeAxes = Axes.Y,
                            Padding = new MarginPadding(15),
                            Spacing = new Vector2(0, 15),
                        }
                    }
                },
            };
        }

        private const float fade_duration = 800;
        private const float inactive_alpha = 0.5f;

        protected override void LoadComplete()
        {
            base.LoadComplete();
            this.Delay(600).FadeTo(inactive_alpha, fade_duration, Easing.OutQuint);
        }

        protected override bool OnHover(HoverEvent e)
        {
            this.FadeIn(fade_duration, Easing.OutQuint);
            return true;
        }

        protected override void OnHoverLost(HoverLostEvent e)
        {
            this.FadeTo(inactive_alpha, fade_duration, Easing.OutQuint);
            base.OnHoverLost(e);
        }

        [BackgroundDependencyLoader]
        private void load(OsuColour colours)
        {
            expandedColour = colours.Yellow;

            updateExpanded();
        }

        private void updateExpanded() => button.FadeColour(expanded ? expandedColour : Color4.White, 200, Easing.InOutQuint);

        protected override Container<Drawable> Content => content;

        protected override bool OnMouseDown(MouseDownEvent e) => true;
    }
}


text:
package com.facebook.thrift.meta_data;

@SuppressWarnings("serial")
public class SetMetaData extends FieldValueMetaData {
  public final FieldValueMetaData elemMetaData;

  public SetMetaData(byte type, FieldValueMetaData eMetaData){
    super(type);
    this.elemMetaData = eMetaData;
  }
}


text:
==========
User Guide
==========

Adding an Account
=================

Once you have Security Monkey up and running you will need to add an account to monitor. Security Monkey does not
monitor the account it is running in by default and requires you to add the account through the GUI.

Navigate to http://FQDN:WEB_PORT/SecurityMonkey/web/ui.html/#/createaccount

Fill in the required information and create an account.


text:
Newsletter

    <form class="form-stacked" action="https://tinyletter.com/{{site.tinyletter}}" method="post" target="popupwindow"
      onsubmit="window.open('https://tinyletter.com/{{site.tinyletter}}', 'popupwindow', 'scrollbars=yes,width=800,height=600');return true">
      <input type="text" name="email" id="tlemail" class="field-light" placeholder="{{ site.text.contact.email }}" />
      <input type="hidden" value="1" name="embed" />
      <input type="submit" value="Subscribe" class="button button-blue button-big mobile-block" />
    </form>


text:
   project "png"
      kind "StaticLib"
      language "C"
      files { "*.h", "*.c" }
      excludes { "example*" }

      targetdir("lib")

      includedirs {
         "../zlib"
      }

	  flags {  "StaticRuntime", "FloatFast", "NoRTTI" }

      configuration "Debug"
         defines { "DEBUG" }
         flags { "Symbols" }

      configuration "Release"
         defines { "NDEBUG" }
         flags { "Optimize" }


text:
package org.scalatest.examples.featurespec.tagging

import org.scalatest.Tag

object SlowTest extends Tag("com.mycompany.tags.SlowTest")
object DbTest extends Tag("com.mycompany.tags.DbTest")

import org.scalatest.FeatureSpec

class TVSet {
  private var on: Boolean = false
  def isOn: Boolean = on
  def pressPowerButton() {
    on = !on
  }
}

class TVSetSpec extends FeatureSpec {

  feature("TV power button") {
    scenario("User presses power button when TV is off", SlowTest) {
      val tv = new TVSet
      assert(!tv.isOn)
      tv.pressPowerButton()
      assert(tv.isOn)
    }

    scenario("User presses power button when TV is on", SlowTest, DbTest) {
      val tv = new TVSet
      tv.pressPowerButton()
      assert(tv.isOn)
      tv.pressPowerButton()
      assert(!tv.isOn)
    }
  }
}


text:
class CreateApiSamplerTags < ActiveRecord::Migration[5.0]
  def change
    create_table :api_sampler_tags do |t|
      t.text :name, null: false
      t.timestamps
    end
    add_index :api_sampler_tags, :name, unique: true
  end
end


text:
#ifndef CGENC_CORE_H_
#define CGENC_CORE_H_

#include "cgen.h"

/* This file contains procedures for writing the core functions of a C
   compilation job.  In particular, this package writes the following
   portions of the .c file:
     1) The public constructors for the structures.
     2) The public destructors for the structures.
     3) The public initializers for the structure members.
     4) All the "core" functions.
   The functions in group 4 are static, and so are a part of the "private"
   interface for the generated code. This file writes the prototypes and the
   definitions for all of these functions.
*/

CJobStatus write_source_public_funcs(CJob *job);
CJobStatus write_source_core_funcs(CJob *job);

#endif


text:
<?php

/**
 * @category   ZFDebug
 * @package    ZFDebug_Controller
 * @subpackage Plugins
 * @copyright  Copyright (c) 2008-2009 ZF Debug Bar Team (http://code.google.com/p/zfdebug)
 * @license    http://code.google.com/p/zfdebug/wiki/License     New BSD License
 */
class ZFDebug_Controller_Plugin_Debug_Plugin_Text implements ZFDebug_Controller_Plugin_Debug_Plugin_Interface
{
    /**
     * @var string
     */
    protected $_tab = '';

    /**
     * @var string
     */
    protected $_panel = '';

    /**
     * Contains plugin identifier name
     *
     * @var string
     */
    protected $_identifier = 'text';

    /**
     * Contains plugin icon data
     *
     * @var string
     */
    protected $_icondata = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHhSURBVDjLpZI9SJVxFMZ/r2YFflw/kcQsiJt5b1ije0tDtbQ3GtFQYwVNFbQ1ujRFa1MUJKQ4VhYqd7K4gopK3UIly+57nnMaXjHjqotnOfDnnOd/nt85SURwkDi02+ODqbsldxUlD0mvHw09ubSXQF1t8512nGJ/Uz/5lnxi0tB+E9QI3D//+EfVqhtppGxUNzCzmf0Ekojg4fS9cBeSoyzHQNuZxNyYXp5ZM5Mk1ZkZT688b6thIBenG/N4OB5B4InciYBCVyGnEBHO+/LH3SFKQuF4OEs/51ndXMXC8Ajqknrcg1O5PGa2h4CJUqVES0OO7sYevv2qoFBmJ/4gF4boaOrg6rPLYWaYiVfDo0my8w5uj12PQleB0vcp5I6HsHAUoqUhR29zH+5B4IxNTvDmxljy3x2YCYUwZVlbzXJh9UKeQY6t2m0Lt94Oh5loPdqK3EkjzZi4MM/Y9Db3MTv/mYWVxaqkw9IOATNR7B5ABHPrZQrtg9sb8XDKa1+QOwsri4zeHD9SAzE1wxBTXz9xtvMc5ZU5lirLSKIz18nJnhOZjb22YKkhd4odg5icpcoyL669TAAujlyIvmPHSWXY1ti1AmZ8mJ3ElP1ips1/YM3H300g+W+51nc95YPEX8fEbdA2ReVYAAAAAElFTkSuQmCC';

    /**
     * Create ZFDebug_Controller_Plugin_Debug_Plugin_Text
     *
     * @param string $tab
     * @paran string $panel
     * @return void
     */
    public function __construct(array $options = array())
    {
        if (isset($options['tab'])) {
            $this->setTab($options['tab']);
        }
        if (isset($options['panel'])) {
            $this->setPanel($options['panel']);
        }
    }

    /**
     * Gets identifier for this plugin
     *
     * @return string
     */
    public function getIdentifier()
    {
        return $this->_identifier;
    }

    /**
     * Sets identifier for this plugin
     *
     * @param string $name
     * @return ZFDebug_Controller_Plugin_Debug_Plugin_Text Provides a fluent interface
     */
    public function setIdentifier($name)
    {
        $this->_identifier = $name;
        return $this;
    }

    /**
     * Returns the base64 encoded icon
     *
     * @return string
     **/
    public function getIconData()
    {
        return $this->_icondata;
    }

    /**
     * Sets icon data for this plugin
     *
     * @param string $data
     * @return ZFDebug_Controller_Plugin_Debug_Plugin_Text Provides a fluent interface
     */
    public function setIconData($data)
    {
        $this->_icondata = $data;
        return $this;
    }

    /**
     * Gets menu tab for the Debugbar
     *
     * @return string
     */
    public function getTab()
    {
        return $this->_tab;
    }

    /**
     * Gets content panel for the Debugbar
     *
     * @return string
     */
    public function getPanel()
    {
        return $this->_panel;
    }

    /**
     * Sets tab content
     *
     * @param string $tab
     * @return ZFDebug_Controller_Plugin_Debug_Plugin_Text Provides a fluent interface
     */
    public function setTab($tab)
    {
        $this->_tab = $tab;
        return $this;
    }

    /**
     * Sets panel content
     *
     * @param string $panel
     * @return ZFDebug_Controller_Plugin_Debug_Plugin_Text Provides a fluent interface
     */
    public function setPanel($panel)
    {
        $this->_panel = $panel;
        return $this;
    }
}


text:
celix_status_t commandDown_create(bundle_context_pt bundle_context_ptr, command_pt *command_ptr);
celix_status_t commandDown_destroy(command_pt *command_ptr);

void commandDown_down(command_pt command, char *line, void (*out)(char *), void (*err)(char *));

#endif //_LUMINIS_DEVCON_COMMAND_DOWN_H_


text:
CREATE PROCEDURE [HumanResources].[uspUpdateEmployeeHireInfo]
    @BusinessEntityID [int],
    @JobTitle [nvarchar](50),
    @HireDate [datetime],
    @RateChangeDate [datetime],
    @Rate [money],
    @PayFrequency [tinyint],
    @CurrentFlag [dbo].[Flag]
WITH EXECUTE AS CALLER
AS
BEGIN
    SET NOCOUNT ON;

    BEGIN TRY
        BEGIN TRANSACTION;

        UPDATE [HumanResources].[Employee]
        SET [JobTitle] = @JobTitle
            ,[HireDate] = @HireDate
            ,[CurrentFlag] = @CurrentFlag
        WHERE [BusinessEntityID] = @BusinessEntityID;

        INSERT INTO [HumanResources].[EmployeePayHistory]
            ([BusinessEntityID]
            ,[RateChangeDate]
            ,[Rate]
            ,[PayFrequency])
        VALUES (@BusinessEntityID, @RateChangeDate, @Rate, @PayFrequency);

        COMMIT TRANSACTION;
    END TRY
    BEGIN CATCH
        -- Rollback any active or uncommittable transactions before
        -- inserting information in the ErrorLog
        IF @@TRANCOUNT > 0
        BEGIN
            ROLLBACK TRANSACTION;
        END

        EXECUTE [dbo].[uspLogError];
    END CATCH;
END;


text:
package collections.interfaces;

/**
 * @author yvesbeutler
 * A Locator based Heap which allows to store key - element pairs and allows
 * for O(log n) removal and for O(log n) key replacement and insertion
 * @param <K> The type of the key (has to extend a comparable class)
 * @param <E> The type of the elements stored
 */
public interface Heap<K extends Comparable<? super K>,E> {

    /**
     * @return the Locator with a minimal key of this
     * PriorityQueue (does not remove this Locator from the PriorityQueue)
     */
    Locator<K,E> showMin();

    /**
     * @return the Locator with a minimal key of this
     * PriorityQueue (the Locator is removed from the PriorityQueue)
     */
    Locator<K,E> removeMin();

    /**
     * @return the Locator where  the ('key', 'element') pair is stored
     */
    Locator<K,E> insert(K key, E element);

    /**
     * @param loc a valid locator belonging to this PriorityQueue
     */
    void remove(Locator<K,E> loc);

    /**
     * @param newKey the new key to be stored at 'loc' (the element does not change)
     */
    void replaceKey(Locator<K,E> loc, K newKey );

    /**
     * @return true if there is no (valid) locator in this PriorityQueue
     */
    boolean isEmpty();

    /**
     * @return the number of locators to be stored at this PriorityQueue
     */
    int size();
}


text:
module Sidekiq
  module Lock
    class Middleware
      def call(worker, msg, _queue)
        options = lock_options(worker)
        setup_lock(options, msg['args']) unless options.nil?

        yield
      end

      private

      def setup_lock(options, payload)
        Sidekiq.lock_container.store(RedisLock.new(options, payload))
      end

      def lock_options(worker)
        worker.class.get_sidekiq_options['lock']
      end
    end
  end
end