text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using gView.Framework.UI;
using gView.Framework.Data;
using gView.Framework.Geometry;
using gView.Framework.UI.Dialogs;
using gView.Framework.FDB;
using gView.Framework.system;
using gView.Framework.UI.Controls.Filter;

namespace gView.DataSources.Fdb.UI
{
    [gView.Framework.system.RegisterPlugIn("30B86C28-FB47-4ee2-B15F-06D4BD8F47D2")]
    public partial class FeatureClassExplorerTabPage : UserControl, IExplorerTabPage
    {
        private IExplorerObject _exObject = null;

        public FeatureClassExplorerTabPage()
        {
            InitializeComponent();
        }

        #region IExplorerTabPage Members

        public new Control Control
        {
            get { return this; }
        }

        public void OnCreate(object hook)
        {

        }

        public void OnShow()
        {
            listView1.Items.Clear();
            if (_exObject == null || !(_exObject.Object is IFeatureClass)) return;

            IFeatureClass fc = (IFeatureClass)_exObject.Object;

            if (fc.Fields == null) return;
            foreach (IField field in fc.Fields.ToEnumerable())
            {
                int iIndex = (field is IAutoField) ? 5 : 0;
                switch (field.type)
                {
                    case FieldType.ID:
                        iIndex = 4;
                        break;
                    case FieldType.Shape:
                        switch (fc.GeometryType)
                        {
                            case geometryType.Point:
                            case geometryType.Multipoint:
                                iIndex = 1;
                                break;
                            case geometryType.Polyline:
                                iIndex = 2;
                                break;
                            case geometryType.Envelope:
                            case geometryType.Polygon:
                                iIndex = 3;
                                break;
                        }
                        break;
                }
                listView1.Items.Add(new FieldListViewItem(new Field(field), iIndex));
            }
        }

        public void OnHide()
        {

        }

        public IExplorerObject ExplorerObject
        {
            get
            {
                return _exObject;
            }
            set
            {
                if (value != null || value.Object is IFeatureClass)
                {
                    _exObject = value;
                }
                else
                {
                    _exObject = null;
                }
            }
        }

        public bool ShowWith(IExplorerObject exObject)
        {
            if (exObject == null) return false;
            //return exObject.Object is IFeatureClass;
            return TypeHelper.Match(exObject.ObjectType, typeof(IFeatureClass));
        }

        public string Title
        {
            get { return "FeatureClass"; }
        }

        public void RefreshContents()
        {
        }
        #endregion

        #region IOrder Members

        public int SortOrder
        {
            get { return 0; }
        }

        #endregion

        #region ContextMenu
        ListViewItem _contextItem = null;
        private void listView1_Click(object sender, EventArgs e)
        {
            ShowContextMenu();
        }

        private void listView1_MouseDown(object sender, MouseEventArgs e)
        {
            _button = e.Button;
            if (listView1.GetItemAt(_mx, _my) != null) return;

            ShowContextMenu();
        }

        private void ShowContextMenu()
        {
            if (_button != MouseButtons.Right) return;
            _contextItem = listView1.GetItemAt(_mx, _my);

            contextItem_AddField.Visible =
                contextItem_ImportFields.Visible = _contextItem == null;

            contextItem_Remove.Visible =
                contextItem_Properties.Visible = _contextItem != null;

            contextMenuStrip.Show(this, _mx, _my);
        }

        int _mx = 0, _my = 0;
        MouseButtons _button = MouseButtons.None;
        private void listView1_MouseMove(object sender, MouseEventArgs e)
        {
            _mx = e.X;
            _my = e.Y;
        }
        #endregion

        private void contextItem_AddField_Click(object sender, EventArgs e)
        {
            Field nField = new Field("NewField", FieldType.String);
            FormPropertyGrid dlg = new FormPropertyGrid(nField);

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                nField = dlg.SelectedObject as Field;

                if (AlterTable == null)
                {
                    MessageBox.Show("Change properties is not implemented for this feature...");
                    return;
                }

                if (!AlterTable.AlterTable(_exObject.Name, null, nField))
                {
                    MessageBox.Show("ERROR: " + ((AlterTable is IDatabase) ? ((IDatabase)AlterTable).lastErrorMsg : ""));
                    return;
                }

                this.OnShow();
            }
        }

        private void contextItem_ImportFields_Click(object sender, EventArgs e)
        {
            if (AlterTable == null)
            {
                MessageBox.Show("Change properties is not implemented for this feature...");
                return;
            }
            if (_exObject == null || !(_exObject.Object is ITableClass)) return;

            List<ExplorerDialogFilter> filters=new List<ExplorerDialogFilter>();
            filters.Add(new OpenFeatureclassFilter());

            ExplorerDialog dlg = new ExplorerDialog("Open Featureclass", filters, true);
            dlg.MulitSelection = false;

            if (dlg.ShowDialog() == DialogResult.OK &&
                dlg.ExplorerObjects != null &&
                dlg.ExplorerObjects.Count == 1 &&
                dlg.ExplorerObjects[0].Object is ITableClass)
            {
                ITableClass tcFrom = dlg.ExplorerObjects[0].Object as ITableClass;
                ITableClass tcTo = _exObject.Object as ITableClass;

                FormSelectFields selDlg = new FormSelectFields(tcFrom, tcTo);
                if (selDlg.ShowDialog() == DialogResult.OK)
                {
                    foreach (IField field in selDlg.SelectedFields)
                    {
                        if (!AlterTable.AlterTable(_exObject.Name, null, new Field(field)))
                        {
                            MessageBox.Show("ERROR :" + ((AlterTable is IDatabase) ? ((IDatabase)AlterTable).lastErrorMsg : ""));
                            break;
                        }
                    }
                    this.OnShow();
                }
            }
        }

        private void contextItem_Remove_Click(object sender, EventArgs e)
        {
            if (AlterTable == null)
            {
                MessageBox.Show("Change properties is not implemented for this feature...");
                return;
            }

            foreach (ListViewItem item in listView1.SelectedItems)
            {
                if (!(item is FieldListViewItem)) continue;
                Field oField = ((FieldListViewItem)item).Field;

                if (!AlterTable.AlterTable(_exObject.Name, oField, null))
                {
                    MessageBox.Show("ERROR :" + ((AlterTable is IDatabase) ? ((IDatabase)AlterTable).lastErrorMsg : ""));
                    break;
                }
            }
            this.OnShow();
        }

        private void contextItem_Properties_Click(object sender, EventArgs e)
        {

            if (_contextItem is FieldListViewItem)
            {
                Field oField=((FieldListViewItem)_contextItem).Field;
                FormPropertyGrid dlg = new FormPropertyGrid(
                    new Field(oField));

                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    Field nField = dlg.SelectedObject as Field;
                    if (!oField.Equals(nField))
                    {
                        if (AlterTable == null)
                        {
                            MessageBox.Show("Change properties is not implemented for this feature...");
                            return;
                        }

                        if (!AlterTable.AlterTable(_exObject.Name, oField, nField))
                        {
                            MessageBox.Show("ERROR: " + ((AlterTable is IDatabase) ? ((IDatabase)AlterTable).lastErrorMsg : ""));
                            return;
                        }

                        this.OnShow();
                    }
                }
            }
        }

        private gView.Framework.FDB.IAltertable AlterTable
        {
            get
            {
                if (_exObject == null) return null;
                if (!(_exObject.Object is ITableClass)) return null;

                ITableClass tc = _exObject.Object as ITableClass;
                if (tc.Dataset == null || tc.Dataset.Database == null) return null;

                return tc.Dataset.Database as gView.Framework.FDB.IAltertable;
            }
        }
    }

    internal class FieldListViewItem : ListViewItem
    {
        private Field _field;

        public FieldListViewItem(Field field,int iIndex)
        {
            _field = field;
            if (_field == null) return;

            this.Text = field.name;
            this.SubItems.Add(field.aliasname);
            this.SubItems.Add(field.type.ToString());

            this.ImageIndex = iIndex;
        }

        public Field Field
        {
            get { return _field; }
        }
    }
}


text:
using System;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using Discord.Commands;
using Serilog;

namespace KiteBotCore.Modules
{
    public class Food : ModuleBase
    {
        public static string MealFileLocation = Directory.GetCurrentDirectory() + "/Content/Meals.txt";
        private static readonly string[] MealResponses = File.ReadAllLines(MealFileLocation);
        public Random Random { get; set; }

        private Stopwatch _stopwatch;
        protected override void BeforeExecute(CommandInfo command)
        {
            _stopwatch = new Stopwatch();
            _stopwatch.Start();
        }

        protected override void AfterExecute(CommandInfo command)
        {
            _stopwatch.Stop();
            Log.Debug($"Food Command: {_stopwatch.ElapsedMilliseconds.ToString()} ms");
        }

        [Command("dinner")]
        [Alias("lunch", "meal", "food")]
        [Summary("Suggests dinner or lunch.")]
        public async Task FoodyCommand()
        {
            await ReplyAsync(MealResponses[Random.Next(0, MealResponses.Length)]
                .Replace("USER", Context.User.Username));
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
use std::fs;
use std::io::{self, Read};
use std::net::TcpListener;
use std::process::{Child, Stdio};
use std::thread;

use cargo_test_support::{project, slow_cpu_multiplier};

#[cargo_test]
fn ctrl_c_kills_everyone() {
    let listener = TcpListener::bind("127.0.0.1:0").unwrap();
    let addr = listener.local_addr().unwrap();

    let p = project()
        .file(
            "Cargo.toml",
            r#"
            [package]
            name = "foo"
            version = "0.0.1"
            authors = []
            build = "build.rs"
        "#,
        )
        .file("src/lib.rs", "")
        .file(
            "build.rs",
            &format!(
                r#"
            use std::net::TcpStream;
            use std::io::Read;

            fn main() {{
                let mut socket = TcpStream::connect("{}").unwrap();
                let _ = socket.read(&mut [0; 10]);
                panic!("that read should never return");
            }}
        "#,
                addr
            ),
        )
        .build();

    let mut cargo = p.cargo("build").build_command();
    cargo
        .stdin(Stdio::piped())
        .stdout(Stdio::piped())
        .stderr(Stdio::piped())
        .env("__CARGO_TEST_SETSID_PLEASE_DONT_USE_ELSEWHERE", "1");
    let mut child = cargo.spawn().unwrap();

    let mut sock = listener.accept().unwrap().0;
    ctrl_c(&mut child);

    assert!(!child.wait().unwrap().success());
    match sock.read(&mut [0; 10]) {
        Ok(n) => assert_eq!(n, 0),
        Err(e) => assert_eq!(e.kind(), io::ErrorKind::ConnectionReset),
    }

    // Ok so what we just did was spawn cargo that spawned a build script, then
    // we killed cargo in hopes of it killing the build script as well. If all
    // went well the build script is now dead. On Windows, however, this is
    // enforced with job objects which means that it may actually be in the
    // *process* of being torn down at this point.
    //
    // Now on Windows we can't completely remove a file until all handles to it
    // have been closed. Including those that represent running processes. So if
    // we were to return here then there may still be an open reference to some
    // file in the build directory. What we want to actually do is wait for the
    // build script to *complete* exit. Take care of that by blowing away the
    // build directory here, and panicking if we eventually spin too long
    // without being able to.
    for i in 0..10 {
        match fs::remove_dir_all(&p.root().join("target")) {
            Ok(()) => return,
            Err(e) => println!("attempt {}: {}", i, e),
        }
        thread::sleep(slow_cpu_multiplier(100));
    }

    panic!(
        "couldn't remove build directory after a few tries, seems like \
         we won't be able to!"
    );
}

#[cfg(unix)]
pub fn ctrl_c(child: &mut Child) {
    let r = unsafe { libc::kill(-(child.id() as i32), libc::SIGINT) };
    if r < 0 {
        panic!("failed to kill: {}", io::Error::last_os_error());
    }
}

#[cfg(windows)]
pub fn ctrl_c(child: &mut Child) {
    child.kill().unwrap();
}


text:
import os
import re
import codecs
from setuptools import setup, find_packages

script_dir = os.path.dirname(os.path.abspath(__file__))

def find_version(*path):
    with codecs.open(os.path.join(script_dir, *path), 'r', 'utf8') as f:
        contents = f.read()

    # The version line must have the form
    # version_info = (X, Y, Z)
    m = re.search(
        r'^version_info\s*=\s*\(\s*(?P<v0>\d+)\s*,\s*(?P<v1>\d+)\s*,\s*(?P<v2>\d+)\s*\)\s*$',
        contents,
        re.MULTILINE,
    )
    if m:
        return '%s.%s.%s' % (m.group('v0'), m.group('v1'), m.group('v2'))
    raise RuntimeError('Unable to determine package version.')

with codecs.open(os.path.join(script_dir, 'README.rst'), 'r', 'utf8') as f:
    long_description = f.read()

setup(
    name='kwonly-args',
    version=find_version('src', 'kwonly_args', '__init__.py'),
    description='Python2 keyword-only argument emulation as a decorator. Python 3 compatible.',
    keywords='kwonly keyword only arguments args decorator',
    long_description=long_description,

    url='https://github.com/pasztorpisti/kwonly-args',

    author='István Pásztor',
    author_email='pasztorpisti@gmail.com',

    license='MIT',

    classifiers=[
        'License :: OSI Approved :: MIT License',

        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Developers',
        'Topic :: Software Development :: Libraries :: Python Modules',

        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: Implementation :: CPython',
        'Programming Language :: Python :: Implementation :: PyPy',
    ],

    packages=find_packages('src'),
    package_dir={'': 'src'},

    test_suite='tests',
    tests_require=['mock'],
)


text:
task blink();
task coneCount();
task autoPreloader();
int cones = 0; //Current cone count
bool apPreload = false; //If auto preloading preloads (true) or ground loads (false)

task usercontrol(){
	int DY, DT;
	bool isReset = false;
	startTask(blink);
	startTask(coneCount);

	while(true){
		//Driving
		DY = threshold(vexRT[Ch2]^2 / MAX_POWER, 5) + ((vexRT[Btn8U] - vexRT[Btn8D]) * MAX_POWER);
		DT = threshold(vexRT[Ch1]^2 / MAX_POWER, 5) + ((vexRT[Btn8R] - vexRT[Btn8L]) * MAX_POWER);
		drive(DY, DT);

		//Mogo
		mogo(threshold(PAIRED_CH3, 15) - (DY + DT > 5 ? MOGO_LOCK : 0));
		SensorValue[leftMogoIndicator] = SensorValue[leftMogoDetector];
		SensorValue[rightMogoIndicator] = SensorValue[rightMogoDetector];

		//Arm
		arm((PAIRED_BTN6U - PAIRED_BTN6D) * MAX_POWER);

		//Lift
		lift((PAIRED_BTN7U - PAIRED_BTN7D) * MAX_POWER);

		//Intake
		intake((PAIRED_BTN5U - PAIRED_BTN5D) * MAX_POWER);

		//Run AutoPreloader (blocking)
		if(SensorValue[Btn7L]){
			startTask(autoPreloader);
			waitUntil(!SensorValue[Btn7L]);
			stopTask(autoPreloader);
		}

		//Reset (can be done multiple times, only required once)
		if(abs(SensorValue[aclZ]) > 50){ //Warn if bot has been lifted
			startTask(blink);
		}
		if(SensorValue[resetButton]){ //Reset sensors if reset button is pressed
			setHome();
			isReset = true;
			stopTask(blink);
			SensorValue[resetLED] = false;
			waitUntil(!SensorValue[resetButton]);
		}
	}
}

//Blink the warning LED is the sensors need to be reset
task blink(){
	while(true){
		SensorValue[resetLED] = !SensorValue[resetLED];
		wait1Msec(1000);
	}
}

//Handle the automated preloader stuff to allow stopping and starting at any point
task autoPreloader(){
	apPreload = SensorValue[armEncoder] > -1380;
	while(true){
		//Return for pickup
		intake(MAX_POWER);
		setArmPosition(apPreload ? -1380 : -1500);
		setLiftPosition(0);
		//Pickup cone
		wait1Msec(500);
		//Bring cone to tower
		setLiftPosition(cones * 15);
		setArmPosition(cones * 20);
		//Release cone
		intake(-MAX_POWER);
		setArmPosition(-1000);
	}
}

//Allows the partner to count the cones but not add more that 1 per button and not block the driver
task coneCount(){
	while(true){
		//Tell AutoPreloader the current cone total
		if(PAIRED_BTN7R){
			cones = 0;
		} else if(vexRT[Btn8UXmtr2]){
			cones += 1;
			waitUntil(!vexRT[Btn8UXmtr2]);
		} else if(vexRT[Btn8DXmtr2]){
			cones -= 1;
			waitUntil(!vexRT[Btn8DXmtr2]);
		}
	}
}


text:
import React, { Component } from 'react'

class KickAssDebugger extends Component {
    render(){
        return(

 The Kick Ass On Screen Debugger React Component

                {JSON.stringify(this.props.data, null, 2)}

        )
    }
}

export default KickAssDebugger


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

		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		<title>pongimme 1.0-SNAPSHOT Reference</title>
		<link rel="stylesheet" type="text/css" href="stylesheet.css" title="style" />

			All Classes

Packages

				pongimme

				pongimme.entities

				pongimme.logic

				pongimme.table


text:
package com.github.anba.es6draft.ast;

/**
 *
14 ECMAScript Language: Functions and Classes

 *

 *
14.4 Generator Functions Definitions
 *

 */
public interface GeneratorDefinition extends FunctionNode {
}


text:
// Copyright (c) 2012 Ecma International.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
es5id: 10.6-6-4
description: >
    'length' property of arguments object for 0 argument function call
    is 0 even with formal parameters
flags: [noStrict]
---*/

function testcase() {
      var arguments= undefined;
	(function (a,b,c) { assert.sameValue(arguments.length, 0); })();
 }
testcase();


text:
using System;
using System.Collections.Generic;
using System.Threading;
using Thriot.Framework.Logging;
using Thriot.Platform.Model.Messaging;

namespace Thriot.Platform.PersistentConnections
{
    public abstract class PersistentConnectionWorker
    {
        protected readonly PusherRegistry _pusherRegistry;
        protected readonly IMessagingOperations _outgoingMessageReader;
        private readonly TimeSpan _batchWaitTimeLimit;
        private readonly int _batchWaitSizeLimit;
        private readonly CancellationTokenSource _cancellationTokenSource;
        private readonly AutoResetEvent _taskEndWaitEvent;
        private readonly AutoResetEvent _taskStartWaitEvent;
        private static readonly ILogger Logger = LoggerFactory.GetCurrentClassLogger();

        protected PersistentConnectionWorker(PusherRegistry pusherRegistry, IMessagingOperations outgoingMessageReader, TimeSpan batchWaitTimeLimit, int batchWaitSizeLimit)
        {
            _pusherRegistry = pusherRegistry;
            _outgoingMessageReader = outgoingMessageReader;
            _batchWaitTimeLimit = batchWaitTimeLimit;
            _batchWaitSizeLimit = batchWaitSizeLimit;
            _cancellationTokenSource = new CancellationTokenSource();
            _taskEndWaitEvent = new AutoResetEvent(false);
            _taskStartWaitEvent = new AutoResetEvent(false);
        }

        public void Start()
        {
            new Thread(() => Body(_cancellationTokenSource.Token)).Start();
            _taskStartWaitEvent.WaitOne();
        }

        public void Stop()
        {
            _cancellationTokenSource.Cancel();
            _taskEndWaitEvent.WaitOne((int)_batchWaitTimeLimit.TotalMilliseconds * 5);
        }

        protected abstract IPersistentConnection GetNextConnection();

        protected abstract IDictionary<long, OutgoingMessageToStoreWithState> ProcessManyItems(IEnumerable<long> ids);

        protected abstract void PostProcessConnections(IDictionary<long, IPersistentConnection> allConnections, IDictionary<long, OutgoingMessageToStoreWithState> firedConnections);

        private void Body(CancellationToken cancellationToken)
        {
            _taskStartWaitEvent.Set();

            while (!cancellationToken.IsCancellationRequested)
            {
                var items = new Dictionary<long, IPersistentConnection>();

                var lastProcessTime = DateTime.UtcNow;
                while ((DateTime.UtcNow - lastProcessTime) < _batchWaitTimeLimit && items.Count < _batchWaitSizeLimit)
                {
                    var connection = GetNextConnection();
                    if (connection != null)
                    {
                        items[connection.NumericDeviceId] = connection;
                    }
                }
                if (items.Keys.Count == 0)
                {
                    Thread.Sleep(10);
                    continue;
                }

                IDictionary<long, OutgoingMessageToStoreWithState> results = null;
                try
                {
                    results = ProcessManyItems(items.Keys);
                }
                catch(Exception ex)
                {
                    Logger.Error("Process many items error. {0}", ex.ToString());
                    continue;
                }

                PostProcessConnections(items, results);

                if (results.Count > 0)
                {
                    foreach (var item in items)
                    {
                        var result = results[item.Key];

                        if (result.HasMessage)
                        {
                            try
                            {
                                item.Value.SendMessage(result);
                            }
                            catch(Exception ex)
                            {
                                Logger.Error("Send error. Device: {0}. {1}", item.Value.DeviceId, ex.ToString());
                            }
                        }
                    }
                    Thread.Sleep(1);
                }
                else
                {
                    Thread.Sleep(10);
                }
            }

            _taskEndWaitEvent.Set();
        }
    }
}


text:
package conf

import (
	"errors"
	"flag"

	"go-common/library/cache/memcache"
	"go-common/library/conf"
	"go-common/library/database/orm"
	ecode "go-common/library/ecode/tip"
	"go-common/library/log"
	bm "go-common/library/net/http/blademaster"
	"go-common/library/net/http/blademaster/middleware/permit"
	"go-common/library/net/rpc/warden"
	"go-common/library/net/trace"
	xtime "go-common/library/time"

	"github.com/BurntSushi/toml"
)

var (
	confPath string
	client   *conf.Client
	// Conf of config
	Conf = &Config{}
)

// Memcache memcache.
type Memcache struct {
	*memcache.Config
	CmsExpire xtime.Duration
}

// Config def.
type Config struct {
	// base
	// http
	HTTPServer *bm.ServerConfig
	// auth
	Auth *permit.Config
	// db
	ORM *orm.Config
	// dbshow
	ORMShow *orm.Config
	// log
	Log *log.Config
	// tracer
	Tracer *trace.Config
	// httpsearch
	HTTPSearch *HTTPSearch
	// Cfg
	Cfg *Cfg
	// HTTPClient .
	HTTPClient *bm.ClientConfig
	// URLConf
	URLConf *URLConf
	// YSTParam
	YSTParam *YSTParam
	// Bfs
	Bfs *Bfs
	// grpc
	ArcClient *warden.ClientConfig
	AccClient *warden.ClientConfig
	// Ecode Cfg
	Ecode *ecode.Config
	//mc
	Memcache *Memcache
}

// Cfg def
type Cfg struct {
	Playpath      string // playurl
	AuditRSize    int    // page size for audit result checking
	PlayurlAPI    string // pgc playurl api
	SearInterMax  int
	IntervLimit   int
	PGCTypes      []string          // pgc types that need to filter archives
	PgcNames      map[string]string // pgc category name in CN
	ModIntMaxSize int               // ModIntMaxSize module intervene max size
	TypesLoad     xtime.Duration    // reloading type duratio
	UPlayurlAPI   string            // ugc playurl api
	SupportCat    *SupportCat
	MangoErr      string // mango error indication message
	LoadSnFre     xtime.Duration
	RefLabel      *RefLabel     // refresh label original data frequency
	AuditConsult  *AuditConsult // audit consult cfg
	Hosts         *Hosts
	Abnormal      *Abnormal // abnormal cid export related cfg
	EsIdx         *EsIdx    // es index cfg
}

// EsIdx def.
type EsIdx struct {
	UgcIdx *EsCfg
}

// EsCfg def.
type EsCfg struct {
	Business string
	Index    string
}

// RefLabel def.
type RefLabel struct {
	Fre      xtime.Duration
	PgcAPI   string // pgc api host
	UgcType  string
	UgcTime  string
	AllValue string
	AllName  string
}

// Hosts def.
type Hosts struct {
	ESUgc   string // ESUgc api
	Manager string // manager host
}

// AuditConsult related cfg
type AuditConsult struct {
	LikeLimit  int
	UnshelveNb int
	MatchPS    int64
}

// Abnormal cid export def
type Abnormal struct {
	CriticalCid  int64 // 12780000, critical cid for transcoding
	AbnormHours  int   // ugc abnormal cid interval hour
	ReloadFre    xtime.Duration
	ExportTitles []string // export titles
}

// SupportCat means the pgc&ugc types that we support to fill the modules
type SupportCat struct {
	PGCTypes  []int32
	UGCTypes  []int32
	ReloadFre xtime.Duration
}

// URLConf url conf
type URLConf struct {
	GetRemotePanelUrl string
	SyncPanelUrl      string
}

// YSTParam yst config param
type YSTParam struct {
	QueryPanelType  string
	InsertPanelType string
	Source          string
	Insert          string
	Update          string
}

// Bfs struct
type Bfs struct {
	Key     string
	Secret  string
	Host    string
	Timeout int
	Bucket  string
}

// HTTPSearch http client of search
type HTTPSearch struct {
	*bm.ClientConfig
	FullURL string
}

func local() (err error) {
	_, err = toml.DecodeFile(confPath, &Conf)
	return
}

func remote() (err error) {
	if client, err = conf.New(); err != nil {
		return
	}
	if err = load(); err != nil {
		return
	}
	go func() {
		for range client.Event() {
			log.Info("config reload")
			if load() != nil {
				log.Error("config reload error (%v)", err)
			}
		}
	}()
	return
}

func load() (err error) {
	var (
		s       string
		ok      bool
		tmpConf *Config
	)
	if s, ok = client.Toml2(); !ok {
		return errors.New("load config center error")
	}
	if _, err = toml.Decode(s, &tmpConf); err != nil {
		return errors.New("could not decode config")
	}
	*Conf = *tmpConf
	return
}

func init() {
	flag.StringVar(&confPath, "conf", "", "default config path")
}

// Init int config
func Init() error {
	if confPath != "" {
		return local()
	}
	return remote()
}


text:
"""Test the Elk-M1 Control config flow."""

from homeassistant import config_entries, setup
from homeassistant.components.elkm1.const import DOMAIN

from tests.async_mock import AsyncMock, MagicMock, PropertyMock, patch

def mock_elk(invalid_auth=None, sync_complete=None):
    """Mock m1lib Elk."""
    mocked_elk = MagicMock()
    type(mocked_elk).invalid_auth = PropertyMock(return_value=invalid_auth)
    type(mocked_elk).sync_complete = AsyncMock()
    return mocked_elk

async def test_form_user_with_secure_elk(hass):
    """Test we can setup a secure elk."""
    await setup.async_setup_component(hass, "persistent_notification", {})
    result = await hass.config_entries.flow.async_init(
        DOMAIN, context={"source": config_entries.SOURCE_USER}
    )
    assert result["type"] == "form"
    assert result["errors"] == {}

    mocked_elk = mock_elk(invalid_auth=False)

    with patch(
        "homeassistant.components.elkm1.config_flow.elkm1.Elk",
        return_value=mocked_elk,
    ), patch(
        "homeassistant.components.elkm1.async_setup", return_value=True
    ) as mock_setup, patch(
        "homeassistant.components.elkm1.async_setup_entry",
        return_value=True,
    ) as mock_setup_entry:
        result2 = await hass.config_entries.flow.async_configure(
            result["flow_id"],
            {
                "protocol": "secure",
                "address": "1.2.3.4",
                "username": "test-username",
                "password": "test-password",
                "temperature_unit": "°F",
                "prefix": "",
            },
        )

    assert result2["type"] == "create_entry"
    assert result2["title"] == "ElkM1"
    assert result2["data"] == {
        "auto_configure": True,
        "host": "elks://1.2.3.4",
        "password": "test-password",
        "prefix": "",
        "temperature_unit": "°F",
        "username": "test-username",
    }
    await hass.async_block_till_done()
    assert len(mock_setup.mock_calls) == 1
    assert len(mock_setup_entry.mock_calls) == 1

async def test_form_user_with_non_secure_elk(hass):
    """Test we can setup a non-secure elk."""
    await setup.async_setup_component(hass, "persistent_notification", {})
    result = await hass.config_entries.flow.async_init(
        DOMAIN, context={"source": config_entries.SOURCE_USER}
    )
    assert result["type"] == "form"
    assert result["errors"] == {}

    mocked_elk = mock_elk(invalid_auth=False)

    with patch(
        "homeassistant.components.elkm1.config_flow.elkm1.Elk",
        return_value=mocked_elk,
    ), patch(
        "homeassistant.components.elkm1.async_setup", return_value=True
    ) as mock_setup, patch(
        "homeassistant.components.elkm1.async_setup_entry",
        return_value=True,
    ) as mock_setup_entry:
        result2 = await hass.config_entries.flow.async_configure(
            result["flow_id"],
            {
                "protocol": "non-secure",
                "address": "1.2.3.4",
                "temperature_unit": "°F",
                "prefix": "guest_house",
            },
        )

    assert result2["type"] == "create_entry"
    assert result2["title"] == "guest_house"
    assert result2["data"] == {
        "auto_configure": True,
        "host": "elk://1.2.3.4",
        "prefix": "guest_house",
        "username": "",
        "password": "",
        "temperature_unit": "°F",
    }
    await hass.async_block_till_done()
    assert len(mock_setup.mock_calls) == 1
    assert len(mock_setup_entry.mock_calls) == 1

async def test_form_user_with_serial_elk(hass):
    """Test we can setup a serial elk."""
    await setup.async_setup_component(hass, "persistent_notification", {})
    result = await hass.config_entries.flow.async_init(
        DOMAIN, context={"source": config_entries.SOURCE_USER}
    )
    assert result["type"] == "form"
    assert result["errors"] == {}

    mocked_elk = mock_elk(invalid_auth=False)

    with patch(
        "homeassistant.components.elkm1.config_flow.elkm1.Elk",
        return_value=mocked_elk,
    ), patch(
        "homeassistant.components.elkm1.async_setup", return_value=True
    ) as mock_setup, patch(
        "homeassistant.components.elkm1.async_setup_entry",
        return_value=True,
    ) as mock_setup_entry:
        result2 = await hass.config_entries.flow.async_configure(
            result["flow_id"],
            {
                "protocol": "serial",
                "address": "/dev/ttyS0:115200",
                "temperature_unit": "°C",
                "prefix": "",
            },
        )

    assert result2["type"] == "create_entry"
    assert result2["title"] == "ElkM1"
    assert result2["data"] == {
        "auto_configure": True,
        "host": "serial:///dev/ttyS0:115200",
        "prefix": "",
        "username": "",
        "password": "",
        "temperature_unit": "°C",
    }
    await hass.async_block_till_done()
    assert len(mock_setup.mock_calls) == 1
    assert len(mock_setup_entry.mock_calls) == 1

async def test_form_cannot_connect(hass):
    """Test we handle cannot connect error."""
    result = await hass.config_entries.flow.async_init(
        DOMAIN, context={"source": config_entries.SOURCE_USER}
    )

    mocked_elk = mock_elk(invalid_auth=False)

    with patch(
        "homeassistant.components.elkm1.config_flow.elkm1.Elk",
        return_value=mocked_elk,
    ), patch(
        "homeassistant.components.elkm1.config_flow.async_wait_for_elk_to_sync",
        return_value=False,
    ):  # async_wait_for_elk_to_sync is being patched to avoid making the test wait 45s
        result2 = await hass.config_entries.flow.async_configure(
            result["flow_id"],
            {
                "protocol": "secure",
                "address": "1.2.3.4",
                "username": "test-username",
                "password": "test-password",
                "temperature_unit": "°F",
                "prefix": "",
            },
        )

    assert result2["type"] == "form"
    assert result2["errors"] == {"base": "cannot_connect"}

async def test_form_invalid_auth(hass):
    """Test we handle invalid auth error."""
    result = await hass.config_entries.flow.async_init(
        DOMAIN, context={"source": config_entries.SOURCE_USER}
    )

    mocked_elk = mock_elk(invalid_auth=True)

    with patch(
        "homeassistant.components.elkm1.config_flow.elkm1.Elk",
        return_value=mocked_elk,
    ):
        result2 = await hass.config_entries.flow.async_configure(
            result["flow_id"],
            {
                "protocol": "secure",
                "address": "1.2.3.4",
                "username": "test-username",
                "password": "test-password",
                "temperature_unit": "°F",
                "prefix": "",
            },
        )

    assert result2["type"] == "form"
    assert result2["errors"] == {"base": "invalid_auth"}

async def test_form_import(hass):
    """Test we get the form with import source."""
    await setup.async_setup_component(hass, "persistent_notification", {})

    mocked_elk = mock_elk(invalid_auth=False)
    with patch(
        "homeassistant.components.elkm1.config_flow.elkm1.Elk",
        return_value=mocked_elk,
    ), patch(
        "homeassistant.components.elkm1.async_setup", return_value=True
    ) as mock_setup, patch(
        "homeassistant.components.elkm1.async_setup_entry",
        return_value=True,
    ) as mock_setup_entry:
        result = await hass.config_entries.flow.async_init(
            DOMAIN,
            context={"source": config_entries.SOURCE_IMPORT},
            data={
                "host": "elks://1.2.3.4",
                "username": "friend",
                "password": "love",
                "temperature_unit": "C",
                "auto_configure": False,
                "keypad": {
                    "enabled": True,
                    "exclude": [],
                    "include": [[1, 1], [2, 2], [3, 3]],
                },
                "output": {"enabled": False, "exclude": [], "include": []},
                "counter": {"enabled": False, "exclude": [], "include": []},
                "plc": {"enabled": False, "exclude": [], "include": []},
                "prefix": "ohana",
                "setting": {"enabled": False, "exclude": [], "include": []},
                "area": {"enabled": False, "exclude": [], "include": []},
                "task": {"enabled": False, "exclude": [], "include": []},
                "thermostat": {"enabled": False, "exclude": [], "include": []},
                "zone": {
                    "enabled": True,
                    "exclude": [[15, 15], [28, 208]],
                    "include": [],
                },
            },
        )

    assert result["type"] == "create_entry"
    assert result["title"] == "ohana"

    assert result["data"] == {
        "auto_configure": False,
        "host": "elks://1.2.3.4",
        "keypad": {"enabled": True, "exclude": [], "include": [[1, 1], [2, 2], [3, 3]]},
        "output": {"enabled": False, "exclude": [], "include": []},
        "password": "love",
        "plc": {"enabled": False, "exclude": [], "include": []},
        "prefix": "ohana",
        "setting": {"enabled": False, "exclude": [], "include": []},
        "area": {"enabled": False, "exclude": [], "include": []},
        "counter": {"enabled": False, "exclude": [], "include": []},
        "task": {"enabled": False, "exclude": [], "include": []},
        "temperature_unit": "C",
        "thermostat": {"enabled": False, "exclude": [], "include": []},
        "username": "friend",
        "zone": {"enabled": True, "exclude": [[15, 15], [28, 208]], "include": []},
    }
    await hass.async_block_till_done()
    assert len(mock_setup.mock_calls) == 1
    assert len(mock_setup_entry.mock_calls) == 1


text:
from __future__ import unicode_literals

from django.db import migrations

class Migration(migrations.Migration):

    dependencies = [
        ('projects', '0010_actionlistitem_deadline'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='project',
            options={'ordering': ['pk']},
        ),
    ]


text:
<?xml version="1.0"?>
<tool_dependency>
    <package name="bwa" version="0.7.7">
        <install version="1.0">
            <actions>
                <action type="download_by_url" sha256sum="2c44b63c23b04b878e28d5dc0c6145bbb2d6244ef9b588cdc0cdfeebac75e569">https://depot.galaxyproject.org/software/bwa/bwa_0.7.7_src_all.tar.bz2</action>
                <action type="shell_command">make</action>
                <action type="move_file">
                    <source>bwa</source>
                    <destination>$INSTALL_DIR/bin</destination>
                </action>
                <action type="set_environment">
                    <environment_variable name="PATH" action="prepend_to">$INSTALL_DIR/bin</environment_variable>
                </action>
            </actions>
        </install>
    </package>
</tool_dependency>


text:
require 'apilint'

module Apilint
  module Lint
    describe MinifiedJson do
      describe '#check' do
        let(:req) { Apilint::Request.new('http://foo.com', '/foo/123.json') }

        context 'with empty response' do
          let(:lint) { MinifiedJson.new }
          let(:resp) { Apilint::Response.new(200, [], "") }

          before { lint.check(req, resp) }
          it "should not add an offense" do
            expect(lint.offenses).to be_empty
          end
        end

        context 'with correctly minified json' do
          let(:lint) { MinifiedJson.new }
          let(:resp) { Apilint::Response.new(200, [], "{}") }

          before { lint.check(req, resp) }
          it "should not add an offense" do
            expect(lint.offenses).to be_empty
          end
        end

        context 'with bigger json than needed' do
          let(:resp) { Apilint::Response.new(200, [], "{   }") }
          let(:lint) { MinifiedJson.new }

          before  { lint.check(req, resp) }

          it "should add an offense" do
            expect(lint.offenses).to_not be_empty
          end
        end
      end
    end
  end
end


text:
#ifndef IVW_EVENT_H
#define IVW_EVENT_H

#include <inviwo/core/common/inviwocoredefine.h>
#include <inviwo/core/io/serialization/serializable.h>
#include <vector>

namespace inviwo {

class Processor;

class IVW_CORE_API Event : public Serializable {
public:
    Event() = default;
    Event(const Event& rhs) = default;
    Event& operator=(const Event& that) = default;
    virtual Event* clone() const;
    virtual ~Event() = default;

    // Check if this event has the same type and selectors as aEvent.
    // this should be the selector, and aEvent the "real" event.
    virtual bool matching(const Event* aEvent) const { return false; }
    virtual bool equalSelectors(const Event* aEvent) const { return false; }

    void markAsUsed();
    bool hasBeenUsed() const;

    void markAsVisited(Processor*);
    bool hasVisitedProcessor(Processor*) const;

    // Can be used to figure out where an event came from.
    // Processors are added in chronological order.
    const std::vector<Processor*>& getVisitedProcessors() const;

    virtual void serialize(Serializer& s) const override;
    virtual void deserialize(Deserializer& d) override;

private:
    bool used_ = false;
    #include <warn/push>
    #include <warn/ignore/dll-interface>
    std::vector<Processor*> visitedProcessors_;
    #include <warn/pop>
};

}  // namespace

#endif  // IVW_EVENT_H


text:
<?php
declare(strict_types=1);

namespace JDWil\Xsd\Type;

use JDWil\Xsd\Exception\ValidationException;

class AnyURI extends AbstractStringType
{
    /**
     * AnyURI constructor.
     * @param string $value
     * @throws ValidationException
     */
    public function __construct(string $value)
    {
        if (!$this->isValidURI($value)) {
            $this->throwNotValid();
        }

        $this->value = $value;
    }

    /**
     * @return string
     * @throws ValidationException
     */
    public function __toString(): string
    {
        return $this->value;
    }

    /**
     * @param string $uri
     * @return bool
     */
    private function isValidURI(string $uri): bool
    {
        return filter_var($uri, FILTER_VALIDATE_URL) !== false;
    }

    /**
     * @throws ValidationException
     */
    private function throwNotValid()
    {
        throw new ValidationException('value must be a valid URI');
    }
}


text:
Lastfm = (function () {
    "use strict";

    var BASE_URL = "http://ws.audioscrobbler.com/2.0/";

    function makeSignedKey(args) {
        var output = "";
        Object.keys(args).sort().forEach(function (key) {
            output += key + args[key];
        });

        return md5(output + Config.constants.lastfm_api_sig);
    }

    function makeAPIRequest(requestMethod, isSigned, options, onload, onerror) {
        if (typeof options === "function") {
            onerror = onload;
            onload = options;
            options = {};
        }

        options.api_key = Config.constants.lastfm_api_key;

        if (isSigned)
            options.api_sig = makeSignedKey(options);

        loadResource(BASE_URL, {
            responseType: "xml",
            method: requestMethod,
            data: options,
            onload: function (xml) {
                if (!xml || xml.documentElement.getAttribute("status") === "failed")
                    return onerror();

                onload(xml);
            },
            onerror: onerror
        }, this);
    }

    return {
        getArtistInfo: function Lastfm_getInfo(searchQuery, callback) {
            searchQuery = searchQuery.split(" ").map(function (part) {
                return part.charAt(0).toUpperCase() + part.substr(1).toLowerCase();
            }).join(" ");

            parallel({
                info: function (callback) {
                    makeAPIRequest("GET", false, {
                        method: "artist.getinfo",
                        artist: searchQuery
                    }, function (xml) {
                        callback(xml.querySelector("bio > summary").textContent);
                    }, function () {
                        callback(null);
                    });
                },
                similar: function (callback) {
                    // @todo similar есть и в просто artist.getInfo
                    makeAPIRequest("GET", false, {
                        method: "artist.getSimilar",
                        artist: searchQuery,
                        limit: 10,
                        autocorrect: 1
                    }, function (xml) {
                        var artists = [];
                        [].forEach.call(xml.querySelectorAll("artist > name"), function (artistName) {
                            artists.push(artistName.textContent);
                        });

                        callback(artists);
                    }, function () {
                        callback(null);
                    });
                },
                tracks: function (callback) {
                    makeAPIRequest("GET", false, {
                        method: "artist.gettoptracks",
                        limit: 10,
                        artist: searchQuery
                    }, function (xml) {
                        var tracks = [];

                        [].forEach.call(xml.querySelectorAll("toptracks > track"), function (track) {
                            tracks.push({
                                song: track.querySelector("name").textContent,
                                duration: track.querySelector("duration").textContent
                            });
                        });

                        callback(tracks);
                    }, function () {
                        callback([]);
                    });
                },
                albums: function (callback) {
                    makeAPIRequest("GET", false, {
                        method: "artist.gettopalbums",
                        artist: searchQuery
                    }, function (xml) {
                        var albums = [];

                        [].forEach.call(xml.querySelectorAll("topalbums > album"), function (album) {
                            var image = (album.querySelector("image[size='large']") || album.querySelector("image[size='medium']") || album.querySelector("image[size='small']"));

                            albums.push({
                                title: album.querySelector("name").textContent,
                                cover: image ? image.textContent : "",
                                mbid: album.querySelector("mbid").textContent
                            });
                        });

                        callback(albums);
                    }, function () {
                        callback([]);
                    });
                }
            }, callback);
        },

        getAlbumInfo: function Lastfm_getAlbumInfo(searchData, callback) {
            searchData.method = "album.getinfo";

            makeAPIRequest("GET", false, searchData, function (xml) {
                var cover = (xml.querySelector("album > image[size='large']") || xml.querySelector("album > image[size='medium']") || xml.querySelector("album > image[size='small']"));
                var shortDescriptionNode = xml.querySelector("album > wiki > summary");
                var fullDescriptionNode = xml.querySelector("album > wiki > content");

                var output = {
                    artist: xml.querySelector("album > artist").textContent,
                    title: xml.querySelector("album > name").textContent,
                    albumDescription: shortDescriptionNode ? shortDescriptionNode.textContent : "",
                    fullDescription: fullDescriptionNode ? fullDescriptionNode.textContent : "",
                    cover: cover ? cover.textContent : "",
                    songs: []
                };

                [].forEach.call(xml.querySelectorAll("album > tracks > track"), function (track) {
                    output.songs.push({
                        number: track.getAttribute("rank"),
                        title: track.querySelector("name").textContent,
                        duration: track.querySelector("duration").textContent
                    });
                });

                callback(output);
            }, function () {
                callback(null);
            });
        },

        getSession: function Lastfm_getSession(token, callback) {
            makeAPIRequest("GET", true, {
                method: "auth.getSession",
                token: token,
                api_key: Config.constants.lastfm_api_key
            }, function (xml) {
                callback({
                    name: xml.querySelector("session > name").textContent,
                    key: xml.querySelector("session > key").textContent
                });
            }, function () {
                callback(null);
            });
        },

        get isAuthorized() {
            return (Settings.get("lastfmToken").length > 0);
        },

        updateNowPlaying: function Lastfm_updateNowPlaying(artist, trackTitle, album, trackNumber, durationSec) {
            var options = {
                method: "track.updateNowPlaying",
                artist: artist,
                track: trackTitle,
                sk: Settings.get("lastfmToken")
            };

            if (album)
                options.album = album;

            if (typeof trackNumber === "number")
                options.trackNumber = trackNumber;

            if (durationSec)
                options.duration = durationSec;

            makeAPIRequest("POST", true, options, function (xml) {
                chrome.storage.local.get("installId", function (records) {
                    CPA.sendEvent("Actions", "LFM_updateNowPlaying", {
                        artist: artist,
                        title: trackTitle,
                        id: records.installId
                    });
                });
            });
        },

        scrobble: function Lastfm_scrobble(artist, trackTitle, album, trackNumber, durationSec) {
            var options = {
                method: "track.scrobble",
                artist: artist,
                track: trackTitle,
                timestamp: Math.round(Date.now() / 1000) - durationSec,
                sk: Settings.get("lastfmToken")
            };

            // @todo chosenByUser[i] (Optional) : Set to 1 if the user chose this song, or 0 if the song was chosen by someone else (such as a radio station or recommendation service). Assumes 1 if not specified
            // id3v1

            if (album)
                options.album = album;

            if (typeof trackNumber === "number")
                options.trackNumber = trackNumber;

            if (durationSec)
                options.duration = durationSec;

            makeAPIRequest("POST", true, options, function (xml) {
                chrome.storage.local.get("installId", function (records) {
                    CPA.sendEvent("Actions", "LFM_scrobble", {
                        artist: artist,
                        title: trackTitle,
                        id: records.installId
                    });
                });
            });
        }
    };
})();


text:
using GlobalWeatherAngular.Web.Infrastructure.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.Xml;

namespace GlobalWeatherAngular.Web.Controllers
{
    [RoutePrefix("api/city")]
    public class CityController : ApiBaseController
    {
        private readonly GlobalWeatherService.GlobalWeatherSoap _client;

        public CityController(GlobalWeatherService.GlobalWeatherSoap client)
        {
            _client = client;
        }

        [HttpGet]
        [AllowAnonymous]
        [Route("list")]
        public HttpResponseMessage Get(HttpRequestMessage request, string countryName)
        {
            var data = _client.GetCitiesByCountry(countryName);

            var cities = GetCities(data);

            var response = request.CreateResponse(HttpStatusCode.OK, cities);

            return response;
        }

        private List<string> GetCities(string xml)
        {
            var ret = new List<string>();
            var doc = new XmlDocument();
            doc.LoadXml(xml);

            foreach (XmlNode node in doc.SelectNodes("//City"))
            {
                ret.Add(node.InnerText);
            }

            return ret;
        }
    }
}


text:
using System;

namespace U2F.Server.Data
{
	[Serializable]
	public class EnrollSessionData
	{
		private const long serialVersionUID = 1750990095756334568L;

		public String AccountName { get; private set; }
		public byte[] Challenge { get; private set; }
		public String AppId { get; private set; }

		public EnrollSessionData(String accountName, String appId, byte[] challenge)
		{
			AccountName = accountName;
			Challenge = challenge;
			AppId = appId;
		}
	}
}


text:
var createGame = require('voxel-engine');
var walk = require('voxel-walk')

var game = createGame({
  chunkDistance: 2,
  generate: function(x, y, z) {
    return (y === 0) ? 1 : 0
  },
  materials: [['grass', 'dirt', 'grass_dirt'], 'brick'],
  texturePath: 'textures/'
})
var container = document.body
game.appendTo(container)
game.paused = false

// create a player
var createPlayer = require('voxel-player')(game)
var player = createPlayer('textures/shama.png')
player.yaw.position.set(0, 2, 0)
player.possess()

// use debug
var debug = require('./')(game)
debug.axis([0, 2, 0])


text:
package io.microprofile.showcase.vote.persistence;

import java.util.Collection;

import io.microprofile.showcase.vote.model.Attendee;

public interface AttendeeDAO {

    Attendee createNewAttendee(Attendee attendee);

    Attendee updateAttendee(Attendee attendee);

    Collection<Attendee> getAllAttendees();

    void clearAllAttendees();

    Attendee getAttendee(String id);

    void deleteAttendee(String id);

    boolean isAccessible();

}


text:
from django.core.validators import (
    RegexValidator,
    validate_email,
)
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _, ungettext_lazy

import re

validate_username = RegexValidator(
    regex=r'^[_]?(?=[a-zA-Z])(?=.{4,})([a-zA-Z0-9]+[_\.\-]?)*[a-zA-Z0-9]+$',
    message='至少4位,只能使用数字,英文,符号(_-.)'
)
validate_number_id = RegexValidator(
    regex=r'^\d+$',
    message="只能是数字",
)
validate_mobile_phone = RegexValidator(
    regex=r'^0?1[34578]\d{9}$',
    message=u'手机号码格式错误'
)
validate_password = RegexValidator(
    regex=r'^(?=.{6,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9]).*$',
    message='至少6位,并且至少包含数字和大小写英文字母各一个'
)
validate_password_weak = RegexValidator(
    regex=r'^[A-Za-z0-9\.!@#$%^&\*\(\)_\-\+=]{6,}$',
    message='至少6位',
)
validate_password_strong = RegexValidator(
    regex=r'^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[\.!@#$%^&\*\(\)_\-\+=]).*$',
    message='至少8位,并且至少包含数字和大小写英文字母及特殊字符(.!@#$%^&*()_-+=)各一个'
)

class ChineseIdentityValidator(object):

    message = _('必须符合中国大陆居民身份证格式')
    regex = re.compile(r'^'
        '((?:1[1-5]|2[1-3]|3[1-7]|4[1-6]|5[0-4]|6[1-5]|71|81|82)\d{4})'
        '((?:19|20)\d{2})'
        '((?:01|03|05|07|08|10|12)(?:[0-2]\d|3[01])|(?:04|06|09|11)(?:[0-2]\d|30)|02[0-2]\d)'
        '(\d{3}[0-9Xx])'
        '$'
    )
    digits  = '0123456789'
    mdigits = '10X98765432'

    weights = (7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2, 1)

    def __init__(self, code=None):
        self.code = code

    def __call__(self, value):
        matched = self.regex.match(value.upper())
        if not matched:
            raise ValidationError(self.message, code=self.code)
        match = matched.groups()
        # for YYYY-02-29
        year = int(match[1])
        mndy = int(match[2])
        mon = mndy // 100
        day = mndy % 100
        if (mon == 2) and (day == 29):
            if year % 400 == 0 or (year % 4 == 0 and year % 100 != 0):
                pass
            else:
                raise ValidationError(self.message, code=self.code)
        # for checksum
        w = sum([self.weights[i] * self.digits.index(c) for i, c in enumerate(value[:-1])])
        m = self.mdigits[w % 11]
        if match[-1][-1] != m:
            raise ValidationError(self.message, self.code)
        # pass

    def __eq__(self, that):
        return isinstance(that, ChineseIdentityValidator) and self.code == that.code

    def __ne__(self, that):
        return not (self == that)

validate_identity_chinese = ChineseIdentityValidator()

def same_validator_collection(some, that):
    if len(some) != len(that):
        return False
    for validator in some:
        matched = False
        for temp in that:
            if temp == validator:
                matched = True
        if not matched:
            return False
    return True

# 多个 validators, 任意一个成功即成功, 全部失败才失败
class GeneralUsernameValidator(object):

    # message = _('Enter a valid general username.')

    def __init__(self, message, code, validators):
        self.validators = validators
        self.message = message
        self.code = code
        self.effected = None

    def __call__(self, value):
        for validator in self.validators:
            try:
                validator(value)
                self.effected = validator
                return value
            except ValidationError:
                pass
        raise ValidationError(self.message, code=self.code)

    def __eq__(self, that):
        return (
            isinstance(that, GeneralUsernameValidator) and
            same_validator_collection(self.validators, that.validators) and
            self.message == that.message and
            self.code == that.code
        )

    def __ne__(self, that):
        return not (self == that)

validate_username_socialized = GeneralUsernameValidator(
    '请输入正确的邮箱地址/手机号码',
    'invalid_socialized_username',
    [
        validate_email,
        validate_mobile_phone,
    ],
)
validate_username_general = GeneralUsernameValidator(
    '请输入正确的帐号/邮箱地址/手机号码',
    'invalid_general_username',
    [
        validate_username,
        validate_email,
        validate_mobile_phone,
    ],
)
validate_username_or_pk = GeneralUsernameValidator(
    '请输入正确的帐号/编号',
    'invalid_username_or_id',
    [
        validate_username,
        validate_number_id,
    ],
)

def get_validator_identifier(validator):
    if isinstance(validator, RegexValidator):
        return validator.regex.pattern
    if isinstance(validator, GeneralUsernameValidator):
        return validator.code

# 额外限定的 validators 中任意一个成功,则失败
class ConfusedValidator(object):

    def __init__(self, validator, *exclude_validators, **kwargs):
        self.validator = validator
        self.exclude_validators = exclude_validators
        self.messages = kwargs.get('messages', {})

    def __call__(self, value):
        try:
            self.validator(value)
        except ValidationError as e:
            raise e
        if not self.exclude_validators:
            pass
        for validator in self.exclude_validators:
            try:
                validator(value)
            except:
                continue
            raise ValidationError(self.messages.get(get_validator_identifier(validator)))

    def __eq__(self, that):
        return (
            isinstance(that, ConfusedValidator) and
            self.validator == that.validator and
            same_validator_collection(self.validators, that.validators) and
            True
        )

    def __ne__(self, that):
        return not (self == that)

confused_username_messages = {
    get_validator_identifier(validate_email)        : "用户名不能是邮箱",
    get_validator_identifier(validate_mobile_phone) : "用户名不能是手机号",
    get_validator_identifier(validate_number_id)    : "用户名不能是纯数字",
}
# 用户名 不能是 纯数字
validate_username_not_id = ConfusedValidator(
    validate_username,
    validate_number_id,
    messages=confused_username_messages
)
# 用户名 不能是 邮箱or电话
validate_username_not_socialize = ConfusedValidator(
    validate_username,
    validate_email, validate_mobile_phone,
    messages=confused_username_messages
)
# 用户名 不能是 邮箱or电话or纯数字
validate_username_not_socialize_or_id = ConfusedValidator(
    validate_username,
    validate_email, validate_mobile_phone, validate_number_id,
    messages=confused_username_messages
)

# 是否匹配了 邮箱
def is_validator_email(validator):
    if validator == validate_email:
        return True
    if not isinstance(validator, GeneralUsernameValidator):
        return False
    return validator.effected == validate_email

# 是否匹配了 电话
def is_validator_mobile(validator):
    if validator == validate_mobile_phone:
        return True
    if not isinstance(validator, GeneralUsernameValidator):
        return False
    return validator.effected == validate_mobile_phone


text:
package com.amazonaws.services.gamelift.model;

import javax.annotation.Generated;

/**
 *
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public enum FleetStatus {

    NEW("NEW"),
    DOWNLOADING("DOWNLOADING"),
    VALIDATING("VALIDATING"),
    BUILDING("BUILDING"),
    ACTIVATING("ACTIVATING"),
    ACTIVE("ACTIVE"),
    DELETING("DELETING"),
    ERROR("ERROR"),
    TERMINATED("TERMINATED");

    private String value;

    private FleetStatus(String value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return this.value;
    }

    /**
     * Use this in place of valueOf.
     *
     * @param value
     *        real value
     * @return FleetStatus corresponding to the value
     */
    public static FleetStatus fromValue(String value) {
        if (value == null || "".equals(value)) {
            throw new IllegalArgumentException("Value cannot be null or empty!");
        }

        for (FleetStatus enumEntry : FleetStatus.values()) {
            if (enumEntry.toString().equals(value)) {
                return enumEntry;
            }
        }

        throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
    }
}


text:
layout     : post
title      : "Create an empty git branch"
date       : 2014-05-04
categories : programming git github
tags       : article
permalink  : /2014-05-04-create-an-empty-git-branch/
---

It's really easy to create a new empty git branch with no parents (AKA orphan branches). First create an orphan branch with `git checkout --orphan newbranch`. Now you can remove any files in the directory with `git rm -rf *` and finally push it to a github repository with  `git push origin newbranch`.

If you create branch in Github it'll create the branch from **master** (which is what you're going to do most of the time). Sometimes it makes more sense to create new branches. Example:

  * Documentations
  * Code Rewrites
  * Github Pages

I learned this a while ago from a [Github Post](https://help.github.com/articles/creating-project-pages-manually).


text:
#import "DWUWebView.h"
#import <WebKit/WebKit.h>

static void * DWUWebViewKVOContext = &DWUWebViewKVOContext;

@interface DWUWebView () <WKNavigationDelegate>

@property (nonnull, nonatomic, strong) WKWebView *wkWebView;

- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER;

@end

@implementation DWUWebView

- (void)setFrame:(CGRect)frame {
    [super setFrame:frame];
    self.wkWebView.frame = self.bounds;
}

+ (UIWebViewNavigationType)_enumHelperForNavigationType:(WKNavigationType)wkNavigationType {
    switch (wkNavigationType) {
        case WKNavigationTypeLinkActivated:
            return UIWebViewNavigationTypeLinkClicked;
            break;
        case WKNavigationTypeFormSubmitted:
            return UIWebViewNavigationTypeFormSubmitted;
            break;
        case WKNavigationTypeBackForward:
            return UIWebViewNavigationTypeBackForward;
            break;
        case WKNavigationTypeReload:
            return UIWebViewNavigationTypeReload;
            break;
        case WKNavigationTypeFormResubmitted:
            return UIWebViewNavigationTypeFormResubmitted;
            break;
        case WKNavigationTypeOther:
        default:
            return UIWebViewNavigationTypeOther;
            break;
    }
}

- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
    if ([self.delegate respondsToSelector:@selector(webView:shouldStartLoadWithRequest:navigationType:)]) {
        BOOL result = [self.delegate webView:(id)self shouldStartLoadWithRequest:[NSURLRequest requestWithURL:webView.URL] navigationType:[DWUWebView _enumHelperForNavigationType:navigationAction.navigationType]];
        if (result) {
            decisionHandler(WKNavigationActionPolicyAllow);
        } else {
            decisionHandler(WKNavigationActionPolicyCancel);
        }
    } else {
        decisionHandler(WKNavigationActionPolicyAllow);
    }
}

- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation {
    if ([self.delegate respondsToSelector:@selector(webViewDidStartLoad:)]) {
        [self.delegate webViewDidStartLoad:(id)self];
    }
}

- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation {
    if ([self.delegate respondsToSelector:@selector(webViewDidFinishLoad:)]) {
        [self.delegate webViewDidFinishLoad:(id)self];
    }
}

- (void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error {
    if ([self.delegate respondsToSelector:@selector(webView:didFailLoadWithError:)]) {
        [self.delegate webView:(id)self didFailLoadWithError:error];
    }
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    return [super initWithCoder:aDecoder];
}

- (nonnull instancetype)initWithFrame:(CGRect)frame {
    if ((self = [super initWithFrame:frame])) {
        _wkWebView = [[WKWebView alloc] initWithFrame:self.bounds];
        _wkWebView.navigationDelegate = self;
        [self addSubview:_wkWebView];
        [_wkWebView addObserver:self forKeyPath:@"estimatedProgress" options:0 context:DWUWebViewKVOContext];
    }
    return self;
}

- (void)dealloc {
    [self.wkWebView removeObserver:self forKeyPath:@"estimatedProgress" context:DWUWebViewKVOContext];
}

- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSString *,id> *)change context:(void *)context {
    if (context == DWUWebViewKVOContext) {
        if ([self.progressDelegate respondsToSelector:@selector(webViewUpdateProgress:)]) {
            [self.progressDelegate webViewUpdateProgress:self.wkWebView.estimatedProgress];
        }
    }
}

- (UIScrollView *)scrollView {
    return self.wkWebView.scrollView;
}

- (void)loadRequest:(nonnull NSURLRequest *)request {
    //Ignore the returned WKNavigation object
    [self.wkWebView loadRequest:request];
}

- (void)loadHTMLString:(nonnull NSString *)string baseURL:(nullable NSURL *)baseURL {
    //Ignore the returned WKNavigation object
    [self.wkWebView loadHTMLString:string baseURL:baseURL];
}

- (void)loadData:(nonnull NSData *)data MIMEType:(nonnull NSString *)MIMEType textEncodingName:(nonnull NSString *)textEncodingName baseURL:(nonnull NSURL *)baseURL {
    //Ignore the returned WKNavigation object
    [self.wkWebView loadData:data MIMEType:MIMEType characterEncodingName:textEncodingName baseURL:baseURL];
}

- (NSURLRequest *)request {
    return [NSURLRequest requestWithURL:self.wkWebView.URL];
}

- (void)reload {
    //Ignore the returned WKNavigation object
    [self.wkWebView reload];
}

- (void)stopLoading {
    [self.wkWebView stopLoading];
}

- (void)goBack {
    //Ignore the returned WKNavigation object
    [self.wkWebView goBack];
}

- (void)goForward {
    //Ignore the returned WKNavigation object
    [self.wkWebView goForward];
}

- (BOOL)canGoBack {
    return self.wkWebView.canGoBack;
}

- (BOOL)canGoForward {
    return self.wkWebView.canGoForward;
}

- (BOOL)isLoading {
    return self.wkWebView.isLoading;
}

- (nullable NSString *)stringByEvaluatingJavaScriptFromString:(nonnull NSString *)script {
    __block NSString *resultString = @"Garbage Value.";
    [self.wkWebView evaluateJavaScript:script completionHandler:^(id _Nullable result, NSError * _Nullable error) {
            if (error == nil) {
                if (result != nil) {
                    resultString = [NSString stringWithFormat:@"%@", result];
                }
            }
    }];
    return resultString;
}

- (BOOL)allowsLinkPreview {
    return self.wkWebView.allowsLinkPreview;
}

- (void)setAllowsLinkPreview:(BOOL)allowsLinkPreview {
    self.wkWebView.allowsLinkPreview = allowsLinkPreview;
}

- (BOOL)scalesPageToFit {
    //This API is not found in WKWebView
    return NO;
}

- (void)setScalesPageToFit:(BOOL)scalesPageToFit {
    //This API is not found in WKWebView
}

- (UIDataDetectorTypes)dataDetectorTypes {
    //This API is not found in WKWebView
    return UIDataDetectorTypeNone;
}

- (void)setDataDetectorTypes:(UIDataDetectorTypes)dataDetectorTypes {
    //This API is not found in WKWebView
}

- (BOOL)allowsInlineMediaPlayback {
    return self.wkWebView.configuration.allowsInlineMediaPlayback;
}

- (void)setAllowsInlineMediaPlayback:(BOOL)allowsInlineMediaPlayback {
    //This property is not settable after web view initialization
}

- (BOOL)mediaPlaybackRequiresUserAction {
    return self.wkWebView.configuration.mediaPlaybackRequiresUserAction;
}

- (void)setMediaPlaybackRequiresUserAction:(BOOL)mediaPlaybackRequiresUserAction {
    //This property is not settable after web view initialization
}

- (BOOL)mediaPlaybackAllowsAirPlay {
    return self.wkWebView.configuration.mediaPlaybackAllowsAirPlay;
}

- (void)setMediaPlaybackAllowsAirPlay:(BOOL)mediaPlaybackAllowsAirPlay {
    //This property is not settable after web view initialization
}

- (BOOL)suppressesIncrementalRendering {
    return self.wkWebView.configuration.suppressesIncrementalRendering;
}

- (void)setSuppressesIncrementalRendering:(BOOL)suppressesIncrementalRendering {
    //This property is not settable after web view initialization
}

- (BOOL)keyboardDisplayRequiresUserAction {
    //This API is not found in WKWebView
    return NO;
}

- (void)setKeyboardDisplayRequiresUserAction:(BOOL)keyboardDisplayRequiresUserAction {
    //This API is not found in WKWebView
}

- (UIWebPaginationMode)paginationMode {
    //This API is not found in WKWebView
    return UIWebPaginationModeUnpaginated;
}

- (void)setPaginationMode:(UIWebPaginationMode)paginationMode {
    //This API is not found in WKWebView
}

- (UIWebPaginationBreakingMode)paginationBreakingMode {
    //This API is not found in WKWebView
    return UIWebPaginationBreakingModePage;
}

- (CGFloat)pageLength {
    //This API is not found in WKWebView
    return 0;
}

- (void)setPageLength:(CGFloat)pageLength {
    //This API is not found in WKWebView
}

- (CGFloat)gapBetweenPages {
    //This API is not found in WKWebView
    return 0;
}

- (void)setGapBetweenPages:(CGFloat)gapBetweenPages {
    //This API is not found in WKWebView
}

- (NSUInteger)pageCount {
    //This API is not found in WKWebView
    return 0;
}

- (BOOL)allowsPictureInPictureMediaPlayback {
    return self.wkWebView.configuration.allowsPictureInPictureMediaPlayback;
}

- (void)setAllowsPictureInPictureMediaPlayback:(BOOL)allowsPictureInPictureMediaPlayback {
    //This property is not settable after web view initialization
}

@end


text:
exports = module.exports = function(templates, api, io) {

};


text:
layout: talk
title: "JavaScript головного мозга. Фреймворк, которого все так долго ждали"
modified:
categories: talks
author: [zuev_dmitry]
excerpt:
tags:
image:
  feature:
talk: meetup_201804
date: 2018-04-26
comments: true
share: true
announce: true
---

Расскажем о том, как можно пересобирать огромное Web-SPA с помощью 1000 программистов без боли!


text:
            Chaquinán

CICLEANDO POR LA ANTIGUA

RUTA DEL TREN

        <img class="img-responsive" src="<?php bloginfo('template_url'); ?>/library/images/chaquinan/colibri.png">


text:
#pragma once

#include "utils/meta_tables/abstract_meta_table.hpp"

namespace hyrise {

/**
 * This is a class for showing information about static system properties such as hardware capabilities.
 */
class MetaSystemInformationTable : public AbstractMetaTable {
 public:
  MetaSystemInformationTable();

  const std::string& name() const final;

 protected:
  std::shared_ptr<Table> _on_generate() const final;

  static size_t _cpu_count();
  static size_t _ram_size();
  static std::string _cpu_model();
};

}  // namespace hyrise


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

<title>G-Index</title>
<meta name="date" content="2014-04-17">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A B C D E F G I J N O P Q R S T U V W Z

G

getAccessedDate() - Method in class za.co.neilson.sqlite.orm.DatabaseInfo

getAll(String, Object[], String, Integer) - Method in class za.co.neilson.sqlite.orm.android.AndroidObjectModel

getAll() - Method in class za.co.neilson.sqlite.orm.ObjectModel

getAll(String) - Method in class za.co.neilson.sqlite.orm.ObjectModel

getAll(String, Object...) - Method in class za.co.neilson.sqlite.orm.ObjectModel

getAll(String, Object[], String) - Method in class za.co.neilson.sqlite.orm.ObjectModel

getAll(String, Object[], String, Integer) - Method in class za.co.neilson.sqlite.orm.ObjectModel

getChild() - Method in class za.co.neilson.sqlite.orm.Relationship

getChildKeyField() - Method in class za.co.neilson.sqlite.orm.Relationship

getChildReferenceField() - Method in class za.co.neilson.sqlite.orm.Relationship

getChildType() - Method in class za.co.neilson.sqlite.orm.Relationship

getColumnNames() - Method in class za.co.neilson.sqlite.orm.ObjectModel

getColumnValue(Cursor, ObjectModelColumn, int) - Method in class za.co.neilson.sqlite.orm.android.AndroidObjectModel

 Gets the value of the field represented by the ObjectModelColumn supplied
 from the ResultSet returned by a database query.

getColumnValue(R, ObjectModelColumn, int) - Method in class za.co.neilson.sqlite.orm.ObjectModel

 Gets the value of the field represented by the ObjectModelColumn supplied
 from the ResultSet returned by a database query.

getConnection() - Method in class za.co.neilson.sqlite.orm.android.AndroidSqliteDatabaseDriverInterface

Creates / returns the database connection.

getCreatedDate() - Method in class za.co.neilson.sqlite.orm.DatabaseInfo

getCursor(String, Object[], String, String, String, Integer) - Method in class za.co.neilson.sqlite.orm.android.AndroidObjectModel

Used internally by other query methods to obtain a ResultSet of a
 query's results

getDatabaseDriverInterface() - Method in class za.co.neilson.sqlite.orm.DatabaseModel

getDatabaseFile() - Method in class za.co.neilson.sqlite.orm.android.AndroidSqliteDatabaseDriverInterface

getDatabaseFile() - Method in interface za.co.neilson.sqlite.orm.DatabaseDriverInterface

getDatabaseInfoModel() - Method in class za.co.neilson.sqlite.orm.DatabaseModel

getDatabaseModel() - Method in class za.co.neilson.sqlite.orm.ObjectModel

getDatabaseName() - Method in class za.co.neilson.sqlite.orm.DatabaseModel

The getDatabaseName() method must be overridden to supply a unique name
 for the database.

getDatabaseVersion() - Method in class za.co.neilson.sqlite.orm.DatabaseModel

The getDatabaseVersion() method must be overridden to return the database
 version number.

getFieldValue(T) - Method in class za.co.neilson.collections.queryable.Queryable.Field

getFirst(String, Object[]) - Method in class za.co.neilson.sqlite.orm.android.AndroidObjectModel

getFirst(String) - Method in class za.co.neilson.sqlite.orm.ObjectModel

getFirst(String, Object[]) - Method in class za.co.neilson.sqlite.orm.ObjectModel

getFirstColumnIndex() - Method in class za.co.neilson.sqlite.orm.android.AndroidSqliteDatabaseDriverInterface

getFirstColumnIndex() - Method in interface za.co.neilson.sqlite.orm.DatabaseDriverInterface

Returns the index of the first column of a database result returned by
 this driver.

getForeignKeyParentColumn() - Method in class za.co.neilson.sqlite.orm.ObjectModelColumn

getForeignKeyParentTable() - Method in class za.co.neilson.sqlite.orm.ObjectModelColumn

getInstance(R) - Method in class za.co.neilson.sqlite.orm.ObjectModel

Create an instance of the Object represented by this model using the
 ResultSet returned by a database query

getName() - Method in class za.co.neilson.sqlite.orm.ObjectModelColumn

getObjectModel(Class<T>) - Method in class za.co.neilson.sqlite.orm.DatabaseModel

Returns the ObjectModel instance for the specified ObjectModel Type

getObjectModelColumns() - Method in class za.co.neilson.sqlite.orm.ObjectModel

getObjectModelForObjectType(Type) - Method in class za.co.neilson.sqlite.orm.DatabaseModel

Returns the ObjectModel instance for the specified Object Type

getObjectModels() - Method in class za.co.neilson.sqlite.orm.DatabaseModel

getObjetType() - Method in class za.co.neilson.sqlite.orm.ObjectModel

Get the actual type of the generic type argument used to extend the
 ObjectModel class.

getParent() - Method in class za.co.neilson.sqlite.orm.Relationship

getParentKeyField() - Method in class za.co.neilson.sqlite.orm.Relationship

getParentReferenceField() - Method in class za.co.neilson.sqlite.orm.Relationship

getParentType() - Method in class za.co.neilson.sqlite.orm.Relationship

getRelationships() - Method in class za.co.neilson.sqlite.orm.ObjectModelColumn

getRelationshipType() - Method in class za.co.neilson.sqlite.orm.Relationship

getResultSet(String, Object[], String, String, String, Integer) - Method in class za.co.neilson.sqlite.orm.ObjectModel

Used internally by other query methods to obtain a ResultSet of a
 query's results

getTableName() - Method in class za.co.neilson.sqlite.orm.ObjectModel

getType() - Method in class za.co.neilson.sqlite.orm.ObjectModelColumn

getVersion() - Method in class za.co.neilson.sqlite.orm.DatabaseInfo

A B C D E F G I J N O P Q R S T U V W Z

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes