text
stringlengths
2
97.5k
meta
dict
import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import td from 'testdouble'; import {Checkbox} from '../../../packages/checkbox/index'; import {MDCCheckboxAdapter} from '@material/checkbox/adapter'; import {coerceForTesting} from '../helpers/types'; suite('Checkbox'); const getAdapter = (instance: Checkbox): MDCCheckboxAdapter => { // @ts-ignore adapter_ is a protected property, we need to override it return instance.foundation.adapter_; }; test('creates foundation', () => { const wrapper = shallow<Checkbox>(<Checkbox />); assert.exists(wrapper.instance().foundation); }); test('has mdc-checkbox class', () => { const wrapper = shallow(<Checkbox />); assert.exists(wrapper.find('.mdc-checkbox')); }); test('renders native control', () => { const wrapper = shallow(<Checkbox />); assert.exists(wrapper.find('.mdc-checkbox__native-control')); }); test('classNames adds classes', () => { const wrapper = shallow(<Checkbox className='test-class-name' />); assert.isTrue(wrapper.hasClass('test-class-name')); }); test('has disabled class when props.disabled is true', () => { const wrapper = shallow(<Checkbox disabled />); assert.isTrue( wrapper.find('.mdc-checkbox').hasClass('mdc-checkbox--disabled') ); }); test('has disabled class when foundation calls setDisabled is true', () => { const wrapper = shallow<Checkbox>(<Checkbox />); getAdapter(wrapper.instance()).setNativeControlDisabled(true); wrapper.update(); assert.isTrue( wrapper.find('.mdc-checkbox').hasClass('mdc-checkbox--disabled') ); }); test('native control props.disabled is true when props.disabled is true', () => { const wrapper = shallow(<Checkbox disabled />); const nativeControl = wrapper.childAt(0); assert.isTrue(nativeControl.props().disabled); }); test('native control props.disabled when foundation calls setDisabled is true', () => { const wrapper = shallow<Checkbox>(<Checkbox />); getAdapter(wrapper.instance()).setNativeControlDisabled(true); wrapper.update(); const nativeControl = wrapper.childAt(0); assert.isTrue(nativeControl.props().disabled); }); test('native control props.checked is true when props.checked is true', () => { const wrapper = shallow(<Checkbox checked />); const nativeControl = wrapper.childAt(0); assert.isTrue(nativeControl.props().checked); }); test('#foundation.handleChange gets called when prop.checked updates', () => { const wrapper = shallow<Checkbox>(<Checkbox />); wrapper.instance().foundation.handleChange = td.func<() => null>(); wrapper.setProps({checked: true}); td.verify(wrapper.instance().foundation.handleChange(), {times: 1}); }); test('#foundation.handleChange gets called when prop.indeterminate updates', () => { const wrapper = shallow<Checkbox>(<Checkbox />); wrapper.instance().foundation.handleChange = td.func<() => null>(); wrapper.setProps({indeterminate: true}); td.verify(wrapper.instance().foundation.handleChange(), {times: 1}); }); test('#foundation.setDisabled gets called when prop.disabled updates', () => { const wrapper = shallow<Checkbox>(<Checkbox />); wrapper.instance().foundation.setDisabled = td.func< (disabled: boolean) => null >(); wrapper.setProps({disabled: true}); td.verify(wrapper.instance().foundation.setDisabled(true), {times: 1}); }); test('#componentWillUnmount destroys foundation', () => { const wrapper = shallow<Checkbox>(<Checkbox />); const foundation = wrapper.instance().foundation; foundation.destroy = td.func<() => void>(); wrapper.unmount(); td.verify(foundation.destroy(), {times: 1}); }); test('#adapter.addClass adds class to state.classList', () => { const wrapper = shallow<Checkbox>(<Checkbox />); getAdapter(wrapper.instance()).addClass('test-class-name'); assert.isTrue(wrapper.state().classList.has('test-class-name')); }); test('#adapter.removeClass removes class from state.classList', () => { const wrapper = shallow<Checkbox>(<Checkbox />); wrapper.setState({classList: new Set(['test-class-name'])}); getAdapter(wrapper.instance()).removeClass('test-class-name'); assert.isFalse(wrapper.state().classList.has('test-class-name')); }); test('#adapter.isChecked returns state.checked if true', () => { const wrapper = shallow<Checkbox>(<Checkbox />); wrapper.setState({checked: true}); assert.isTrue(getAdapter(wrapper.instance()).isChecked()); }); test('#adapter.isChecked returns state.checked if false', () => { const wrapper = shallow<Checkbox>(<Checkbox />); wrapper.setState({checked: false}); assert.isFalse(getAdapter(wrapper.instance()).isChecked()); }); test('#adapter.isIndeterminate returns state.indeterminate if true', () => { const wrapper = shallow<Checkbox>(<Checkbox />); wrapper.setState({indeterminate: true}); assert.isTrue(getAdapter(wrapper.instance()).isIndeterminate()); }); test('#adapter.isIndeterminate returns state.indeterminate if false', () => { const wrapper = shallow<Checkbox>(<Checkbox />); wrapper.setState({indeterminate: false}); assert.isFalse(getAdapter(wrapper.instance()).isIndeterminate()); }); test('#adapter.setNativeControlAttr sets aria-checked state', () => { const wrapper = shallow<Checkbox>(<Checkbox />); getAdapter(wrapper.instance()).setNativeControlAttr('aria-checked', 'true'); assert.equal(wrapper.state()['aria-checked'], 'true'); }); test('#adapter.removeNativeControlAttr sets aria-checked state as false', () => { const wrapper = shallow<Checkbox>(<Checkbox />); wrapper.setState({'aria-checked': 'true'}); getAdapter(wrapper.instance()).removeNativeControlAttr('aria-checked'); assert.isFalse(wrapper.state()['aria-checked']); }); test('passes nativeControlId to NativeControl through props', () => { const wrapper = shallow(<Checkbox nativeControlId='test-id' />); assert.equal(wrapper.childAt(0).props().id, 'test-id'); }); test('passes name to NativeControl through props', () => { const wrapper = shallow(<Checkbox name='test-name' />); assert.equal(wrapper.childAt(0).props().name, 'test-name'); }); test('calls foundation.handleChange in native control props.onChange', () => { const wrapper = shallow<Checkbox>(<Checkbox />); const nativeControl = wrapper.childAt(0); const mockEvt = { target: { checked: true, indeterminate: false, }, }; wrapper.instance().foundation.handleChange = td.func<() => void>(); nativeControl.simulate('change', mockEvt); td.verify(wrapper.instance().foundation.handleChange(), {times: 1}); }); test('calls props.onChange in native control props.onChange', () => { const onChange = coerceForTesting< (evt: React.ChangeEvent<HTMLInputElement>) => void >(td.func()); const wrapper = shallow(<Checkbox onChange={onChange} />); const nativeControl = wrapper.childAt(0); const mockEvt = coerceForTesting<React.ChangeEvent<HTMLInputElement>>({ target: { checked: true, indeterminate: false, }, }); nativeControl.simulate('change', mockEvt); td.verify(onChange(mockEvt), {times: 1}); });
{ "pile_set_name": "Github" }
/* Package cli implements the CLI cmd's methods. Includes methods for manipulating wallets files and interacting with the REST API to query a skycoin node's status. */ package cli import ( "encoding/json" "errors" "flag" "fmt" "net/url" "path/filepath" "strings" "syscall" "os" "github.com/spf13/cobra" "github.com/spf13/pflag" "golang.org/x/crypto/ssh/terminal" "github.com/amherag/skycoin/src/api" "github.com/amherag/skycoin/src/util/file" ) var ( // Version is the CLI Version Version = "0.26.0" ) const ( walletExt = ".wlt" defaultCoin = "skycoin" defaultWalletName = "$COIN_cli" + walletExt defaultWalletDir = "$DATA_DIR/wallets" defaultRPCAddress = "http://127.0.0.1:6420" defaultDataDir = "$HOME/.$COIN/" ) var ( envVarsHelp = fmt.Sprintf(`ENVIRONMENT VARIABLES: RPC_ADDR: Address of RPC node. Must be in scheme://host format. Default "%s" RPC_USER: Username for RPC API, if enabled in the RPC. RPC_PASS: Password for RPC API, if enabled in the RPC. COIN: Name of the coin. Default "%s" WALLET_DIR: Directory where wallets are stored. This value is overridden by any subcommand flag specifying a wallet filename, if that filename includes a path. Default "%s" WALLET_NAME: Name of wallet file (without path). This value is overridden by any subcommand flag specifying a wallet filename. Default "%s" DATA_DIR: Directory where everything is stored. Default "%s"`, defaultRPCAddress, defaultCoin, defaultWalletDir, defaultWalletName, defaultDataDir) helpTemplate = fmt.Sprintf(`USAGE:{{if .Runnable}} {{.UseLine}}{{end}}{{if .HasAvailableSubCommands}} {{.CommandPath}} [command] [flags] [arguments...]{{end}}{{with (or .Long .Short)}} DESCRIPTION: {{. | trimTrailingWhitespaces}}{{end}}{{if .HasExample}} EXAMPLES: {{.Example}}{{end}}{{if .HasAvailableSubCommands}} COMMANDS:{{range .Commands}}{{if (or .IsAvailableCommand (eq .Name "help"))}} {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}} FLAGS: {{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}} GLOBAL FLAGS: {{.InheritedFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasHelpSubCommands}} Additional help topics:{{range .Commands}}{{if .IsAdditionalHelpTopicCommand}} {{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableSubCommands}} Use "{{.CommandPath}} [command] --help" for more information about a command.{{end}} %s `, envVarsHelp) // ErrWalletName is returned if the wallet file name is invalid ErrWalletName = fmt.Errorf("error wallet file name, must have %s extension", walletExt) // ErrAddress is returned if an address is invalid ErrAddress = errors.New("invalid address") // ErrJSONMarshal is returned if JSON marshaling failed ErrJSONMarshal = errors.New("json marshal failed") ) var ( cliConfig Config apiClient *api.Client quitChan = make(chan struct{}) ) // Config cli's configuration struct type Config struct { WalletDir string `json:"wallet_directory"` WalletName string `json:"wallet_name"` DataDir string `json:"data_directory"` Coin string `json:"coin"` RPCAddress string `json:"rpc_address"` RPCUsername string `json:"-"` RPCPassword string `json:"-"` } // LoadConfig loads config from environment, prior to parsing CLI flags func LoadConfig() (Config, error) { // get coin name from env coin := os.Getenv("COIN") if coin == "" { coin = defaultCoin } // get rpc address from env rpcAddr := os.Getenv("RPC_ADDR") if rpcAddr == "" { rpcAddr = defaultRPCAddress } if _, err := url.Parse(rpcAddr); err != nil { return Config{}, errors.New("RPC_ADDR must be in scheme://host format") } rpcUser := os.Getenv("RPC_USER") rpcPass := os.Getenv("RPC_PASS") home := file.UserHome() // get data dir dir from env dataDir := os.Getenv("DATA_DIR") if dataDir == "" { dataDir = filepath.Join(home, fmt.Sprintf(".%s", coin)) } // get wallet dir from env wltDir := os.Getenv("WALLET_DIR") if wltDir == "" { wltDir = filepath.Join(dataDir, "wallets") } // get wallet name from env wltName := os.Getenv("WALLET_NAME") if wltName == "" { wltName = fmt.Sprintf("%s_cli%s", coin, walletExt) } if !strings.HasSuffix(wltName, walletExt) { return Config{}, ErrWalletName } return Config{ WalletDir: wltDir, WalletName: wltName, DataDir: dataDir, Coin: coin, RPCAddress: rpcAddr, RPCUsername: rpcUser, RPCPassword: rpcPass, }, nil } // FullWalletPath returns the joined wallet dir and wallet name path func (c Config) FullWalletPath() string { return filepath.Join(c.WalletDir, c.WalletName) } // FullDBPath returns the joined data directory and db file name path func (c Config) FullDBPath() string { return filepath.Join(c.DataDir, "data.db") } // Returns a full wallet path based on cfg and optional cli arg specifying wallet file // FIXME: A CLI flag for the wallet filename is redundant with the envvar. Remove the flags or the envvar. func resolveWalletPath(cfg Config, w string) (string, error) { if w == "" { w = cfg.FullWalletPath() } if !strings.HasSuffix(w, walletExt) { return "", ErrWalletName } // If w is only the basename, use the default wallet directory if filepath.Base(w) == w { w = filepath.Join(cfg.WalletDir, w) } absW, err := filepath.Abs(w) if err != nil { return "", fmt.Errorf("Invalid wallet path %s: %v", w, err) } return absW, nil } func resolveDBPath(cfg Config, db string) (string, error) { if db == "" { db = cfg.FullDBPath() } // If db is only the basename, use the default data dir if filepath.Base(db) == db { db = filepath.Join(cfg.DataDir, db) } absDB, err := filepath.Abs(db) if err != nil { return "", fmt.Errorf("Invalid data path %s: %v", db, err) } return absDB, nil } // NewCLI creates a cli instance func NewCLI(cfg Config) (*cobra.Command, error) { apiClient = api.NewClient(cfg.RPCAddress) apiClient.SetAuth(cfg.RPCUsername, cfg.RPCPassword) cliConfig = cfg skyCLI := &cobra.Command{ Short: fmt.Sprintf("The %s command line interface", cfg.Coin), Use: fmt.Sprintf("%s-cli", cfg.Coin), } commands := []*cobra.Command{ addPrivateKeyCmd(), addressBalanceCmd(), addressGenCmd(), fiberAddressGenCmd(), addressOutputsCmd(), blocksCmd(), broadcastTxCmd(), checkDBCmd(), checkDBEncodingCmd(), createRawTxnCmd(), decodeRawTxnCmd(), decryptWalletCmd(), encryptWalletCmd(), lastBlocksCmd(), listAddressesCmd(), listWalletsCmd(), sendCmd(), showConfigCmd(), showSeedCmd(), statusCmd(), transactionCmd(), verifyTransactionCmd(), verifyAddressCmd(), versionCmd(), walletCreateCmd(), walletAddAddressesCmd(), walletBalanceCmd(), walletDirCmd(), walletHisCmd(), walletOutputsCmd(), richlistCmd(), addressTransactionsCmd(), pendingTransactionsCmd(), addresscountCmd(), } skyCLI.Version = Version skyCLI.SuggestionsMinimumDistance = 1 skyCLI.AddCommand(commands...) skyCLI.SetHelpTemplate(helpTemplate) skyCLI.SetUsageTemplate(helpTemplate) pflag.CommandLine.AddGoFlagSet(flag.CommandLine) return skyCLI, nil } func printHelp(c *cobra.Command) { c.Printf("See '%s %s --help'\n", c.Parent().Name(), c.Name()) } func formatJSON(obj interface{}) ([]byte, error) { d, err := json.MarshalIndent(obj, "", " ") if err != nil { return nil, ErrJSONMarshal } return d, nil } func printJSON(obj interface{}) error { d, err := formatJSON(obj) if err != nil { return err } fmt.Println(string(d)) return nil } // readPasswordFromTerminal promotes user to enter password and read it. func readPasswordFromTerminal() ([]byte, error) { // Promotes to enter the wallet password fmt.Fprint(os.Stdout, "enter password:") bp, err := terminal.ReadPassword(int(syscall.Stdin)) // nolint: unconvert if err != nil { return nil, err } fmt.Fprintln(os.Stdout, "") return bp, nil } // PUBLIC // WalletLoadError is returned if a wallet could not be loaded type WalletLoadError struct { error } func (e WalletLoadError) Error() string { return fmt.Sprintf("Load wallet failed: %v", e.error) } // WalletSaveError is returned if a wallet could not be saved type WalletSaveError struct { error } func (e WalletSaveError) Error() string { return fmt.Sprintf("Save wallet failed: %v", e.error) } // PasswordReader is an interface for getting password type PasswordReader interface { Password() ([]byte, error) } // PasswordFromBytes represents an implementation of PasswordReader, // which reads password from the bytes itself. type PasswordFromBytes []byte // Password implements the PasswordReader's Password method func (p PasswordFromBytes) Password() ([]byte, error) { return []byte(p), nil } // PasswordFromTerm reads password from terminal type PasswordFromTerm struct{} // Password implements the PasswordReader's Password method func (p PasswordFromTerm) Password() ([]byte, error) { v, err := readPasswordFromTerminal() if err != nil { return nil, err } return v, nil } // NewPasswordReader creats a PasswordReader instance, // reads password from the input bytes first, if it's empty, then read from terminal. func NewPasswordReader(p []byte) PasswordReader { if len(p) != 0 { return PasswordFromBytes(p) } return PasswordFromTerm{} }
{ "pile_set_name": "Github" }
// Copyright (c) 2015-2020 Vladimir Schneider <vladimir.schneider@gmail.com> Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.vladsch.md.nav.psi.index; import com.intellij.psi.stubs.StubIndexKey; import com.vladsch.md.nav.psi.MdPlainText; import org.jetbrains.annotations.NotNull; public class MdPlainTextElementIndex extends MdStubIndexExtension<MdPlainText> { public static final StubIndexKey<String, MdPlainText> KEY = StubIndexKey.createIndexKey("markdown.plain-text-element.index"); private static final MdPlainTextElementIndex ourInstance = new MdPlainTextElementIndex(); public static MdPlainTextElementIndex getInstance() { return ourInstance; } @NotNull public StubIndexKey<String, MdPlainText> getKey() { return KEY; } }
{ "pile_set_name": "Github" }
https://patreon.com/BaldPhone
{ "pile_set_name": "Github" }
.. role:: hidden :class: hidden-section .. _tips_and_tricks: Tips and Tricks ************************* .. note:: - See the notebook `here <https://github.com/GRAAL-Research/poutyne/blob/master/examples/tips_and_tricks.ipynb>`_ - Run in `Google Colab <https://colab.research.google.com/github/GRAAL-Research/poutyne/blob/master/examples/tips_and_tricks.ipynb>`_ Poutyne also over a variety of tools for fine-tuning the information generated during the training, such as colouring the training update message, a progress bar, multi-GPUs, user callbacks interface and a user naming interface for the metrics' names. We will explore those tools using a different problem than the one presented in :ref:`intro` Let's import all the needed packages. .. code-block:: python import os import pickle import fasttext import fasttext.util import requests import torch import torch.nn as nn import torch.optim as optim from sklearn.metrics import roc_auc_score from torch.nn.utils.rnn import pad_packed_sequence, pack_padded_sequence, pad_sequence from torch.utils.data import DataLoader from poutyne import set_seeds, Model, ModelCheckpoint, CSVLogger, Callback, SKLearnMetrics Also, we need to set Pythons's, NumPy's and PyTorch's seeds by using Poutyne function so that our training is (almost) reproducible. .. code-block:: python set_seeds(42) Train a Recurrent Neural Network (RNN) ====================================== In this notebook, we train an RNN, or more precisely, an LSTM, to predict the sequence of tags associated with a given address, known as parsing address. This task consists of detecting, by tagging, the different parts of an address such as the civic number, the street name or the postal code (or zip code). The following figure shows an example of such a tagging. .. image:: /_static/img/address_parsing.png Since addresses are written in a predetermined sequence, RNN is the best way to crack this problem. For our architecture, we will use two components, an RNN and a fully-connected layer. Now, let's set our training constants. We first have the CUDA device used for training if one is present. Second, we set the batch size (i.e. the number of elements to see before updating the model) and the learning rate for the optimizer. .. code-block:: python cuda_device = 0 device = torch.device("cuda:%d" % cuda_device if torch.cuda.is_available() else "cpu") batch_size = 32 lr = 0.1 RNN --- For the first component, instead of using a vanilla RNN, we use a variant of it, known as a long short-term memory (LSTM) (to learn more about `LSTM <http://colah.github.io/posts/2015-08-Understanding-LSTMs/>`_. For now, we use a single-layer unidirectional LSTM. Also, since our data is textual, we will use the well-known word embeddings to encode the textual information. The LSTM input and hidden state dimensions will be of the same size. This size corresponds to the word embeddings dimension, which in our case will be the `French pre trained <https://fasttext.cc/docs/en/crawl-vectors.html>`_ fastText embeddings of dimension ``300``. .. Note:: See this `discussion <https://discuss.pytorch.org/t/could-someone-explain-batch-first-true-in-lstm/15402>`_ for the explanation why we use the ``batch_first`` argument. .. code-block:: python dimension = 300 num_layer = 1 bidirectional = False lstm_network = nn.LSTM(input_size=dimension, hidden_size=dimension, num_layers=num_layer, bidirectional=bidirectional, batch_first=True) Fully-connected Layer --------------------- We use this layer to map the representation of the LSTM (``300``) to the tag space (8, the number of tags) and predict the most likely tag using a softmax. .. code-block:: python input_dim = dimension # the output of the LSTM tag_dimension = 8 fully_connected_network = nn.Linear(input_dim, tag_dimension) The Dataset ----------- Now let's download our dataset; it's already split into a train, valid and test set using the following. .. code-block:: python def download_data(saving_dir, data_type): """ Function to download the dataset using data_type to specify if we want the train, valid or test. """ root_url = "https://graal-research.github.io/poutyne-external-assets/tips_and_tricks_assets/{}.p" url = root_url.format(data_type) r = requests.get(url) os.makedirs(saving_dir, exist_ok=True) open(os.path.join(saving_dir, f"{data_type}.p"), 'wb').write(r.content) download_data('./data/', "train") download_data('./data/', "valid") download_data('./data/', "test") Now let's load in memory the data. .. code-block:: python train_data = pickle.load(open("./data/train.p", "rb")) # 80,000 examples valid_data = pickle.load(open("./data/valid.p", "rb")) # 20,000 examples test_data = pickle.load(open("./data/test.p", "rb")) # 30,000 examples If we take a look at the training dataset, it's a list of ``80,000`` tuples where the first element is the full address, and the second element is a list of the tag (the ground truth). .. code-block:: python train_data[0:2] Here a snapshot of the output .. image:: /_static/img/data_snapshot.png Since the address is a text, we need to *convert* it into categorical value, such as word embeddings, for that we will use a vectorizer. This embedding vectorizer will be able to extract for every word embedding value. .. code-block:: python class EmbeddingVectorizer: def __init__(self): """ Embedding vectorizer """ fasttext.util.download_model('fr', if_exists='ignore') self.embedding_model = fasttext.load_model("./cc.fr.``300``.bin") def __call__(self, address): """ Convert address to embedding vectors :param address: The address to convert :return: The embeddings vectors """ embeddings = [] for word in address.split(): embeddings.append(self.embedding_model[word]) return embeddings embedding_model = EmbeddingVectorizer() We also need a vectorizer to convert the address tag (e.g. StreeNumber, StreetName) into categorical values. So we will use a Vectorizer class that can use the embedding vectorizer and convert the address tag. .. code-block:: python class Vectorizer: def __init__(self, dataset, embedding_model): self.data = dataset self.embedding_model = embedding_model self.tags_set = { "StreetNumber": 0, "StreetName": 1, "Unit": 2, "Municipality": 3, "Province": 4, "PostalCode": 5, "Orientation": 6, "GeneralDelivery": 7 } def __len__(self): # for the dataloader return len(self.data) def __getitem__(self, item): data = self.data[item] address = data[0] address_vector = self.embedding_model(address) tags = data[1] idx_tags = self._convert_tags_to_idx(tags) return address_vector, idx_tags def _convert_tags_to_idx(self, tags): idx_tags = [] for tag in tags: idx_tags.append(self.tags_set[tag]) return idx_tags .. code-block:: python train_data_vectorize = Vectorizer(train_data, embedding_model) valid_data_vectorize = Vectorizer(valid_data, embedding_model) test_data_vectorize = Vectorizer(test_data, embedding_model) DataLoader ^^^^^^^^^^ Now, since all the addresses are not of the same size, it is impossible to batch them together since all elements of a tensor must have the same lengths. But there is a trick, padding! The idea is simple. We add *empty* tokens at the end of each sequence up to the longest one in a batch. For the word vectors, we add vectors of 0 as padding. For the tag indices, we pad with -100s. We do so because of the :class:`~torch.nn.CrossEntropyLoss`, the accuracy metric and the :class:`~poutyne.F1` metric all ignore targets with values of ``-100``. To do this padding, we use the ``collate_fn`` argument of the PyTorch :class:`~torch.utils.data.DataLoader` and on running time, that process will be done. One thing to take into account, since we pad the sequence, we need each sequence's lengths to unpad them in the forward pass. That way, we can pad and pack the sequence to minimize the training time (read `this good explanation <https://stackoverflow.com/questions/51030782/why-do-we-pack-the-sequences-in-pytorch>`_ of why we pad and pack sequences). .. code-block:: python def pad_collate_fn(batch): """ The collate_fn that can add padding to the sequences so all can have the same length as the longest one. Args: batch (List[List, List]): The batch data, where the first element of the tuple are the word idx and the second element are the target label. Returns: A tuple (x, y). The element x is a tuple containing (1) a tensor of padded word vectors and (2) their respective lengths of the sequences. The element y is a tensor of padded tag indices. The word vectors are padded with vectors of 0s and the tag indices are padded with -100s. Padding with -100 is done because the cross-entropy loss, the accuracy metric and the F1 metric ignores the targets with values -100. """ # This gets us two lists of tensors and a list of integer. # Each tensor in the first list is a sequence of word vectors. # Each tensor in the second list is a sequence of tag indices. # The list of integer consist of the lengths of the sequences in order. sequences_vectors, sequences_labels, lengths = zip(*[ (torch.FloatTensor(seq_vectors), torch.LongTensor(labels), len(seq_vectors)) for (seq_vectors, labels) in sorted(batch, key=lambda x: len(x[0]), reverse=True) ]) lengths = torch.LongTensor(lengths) padded_sequences_vectors = pad_sequence(sequences_vectors, batch_first=True, padding_value=0) padded_sequences_labels = pad_sequence(sequences_labels, batch_first=True, padding_value=-100) return (padded_sequences_vectors, lengths), padded_sequences_labels .. code-block:: python train_loader = DataLoader(train_data_vectorize, batch_size=batch_size, shuffle=True, collate_fn=pad_collate_fn) valid_loader = DataLoader(valid_data_vectorize, batch_size=batch_size, collate_fn=pad_collate_fn) test_loader = DataLoader(test_data_vectorize, batch_size=batch_size, collate_fn=pad_collate_fn) Full Network ^^^^^^^^^^^^ Now, since we have packed the sequence, we cannot use the PyTorch :class:`~torch.nn.Sequential` constructor to define our model, so we will define the forward pass for it to unpack the sequences (again, read `this good explanation <https://stackoverflow.com/questions/51030782/why-do-we-pack-the-sequences-in-pytorch>`_ of why we pad and pack sequences). .. code-block:: python class FullNetWork(nn.Module): def __init__(self, lstm_network, fully_connected_network): super().__init__() self.hidden_state = None self.lstm_network = lstm_network self.fully_connected_network = fully_connected_network def forward(self, padded_sequences_vectors, lengths): """ Defines the computation performed at every call. """ total_length = padded_sequences_vectors.shape[1] pack_padded_sequences_vectors = pack_padded_sequence(padded_sequences_vectors, lengths, batch_first=True) lstm_out, self.hidden_state = self.lstm_network(pack_padded_sequences_vectors) lstm_out, _ = pad_packed_sequence(lstm_out, batch_first=True, total_length=total_length) tag_space = self.fully_connected_network(lstm_out) return tag_space.transpose(-1, 1) # we need to transpose since it's a sequence full_network = FullNetWork(lstm_network, fully_connected_network) Summary ------- So we have created an LSTM network (``lstm_network``), a fully connected network (``fully_connected_network``), those two components are used in the full network. This full network used padded, packed sequences (defined in the forward pass), so we created the ``pad_collate_fn`` function to process the needed work. The DataLoader will conduct that process. Finally, when we load the data, this will be done using the vectorizer, so the address will be represented using word embeddings. Also, the address components will be converted into categorical value (from 0 to 7). Now that we have all the components for the network let's define our SGD optimizer. .. code-block:: python optimizer = optim.SGD(full_network.parameters(), lr) Poutyne Callbacks ================= One nice feature of Poutyne is :class:`callbacks <poutyne.Callback>`. Callbacks allow doing actions during the training of the neural network. In the following example, we use three callbacks. One that saves the latest weights in a file to be able to continue the optimization at the end of training if more epochs are needed. Another one that saves the best weights according to the performance on the validation dataset. Finally, another one that saves the displayed logs into a TSV file. .. code-block:: python name_of_network = "lstm_unidirectional" callbacks = [ # Save the latest weights to be able to continue the optimization at the end for more epochs. ModelCheckpoint(name_of_network + '_last_epoch.ckpt', temporary_filename='last_epoch.ckpt.tmp'), # Save the weights in a new file when the current model is better than all previous models. ModelCheckpoint(name_of_network + '_best_epoch_{epoch}.ckpt', monitor='val_accuracy', mode='max', save_best_only=True, restore_best=True, verbose=True, temporary_filename='best_epoch.ckpt.tmp'), # Save the losses and accuracies for each epoch in a TSV. CSVLogger(name_of_network + '_log.tsv', separator='\t'), ] .. _making_your_own_callback: Making Your own Callback ======================== While Poutyne provides a great number of :class:`predefined callbacks <poutyne.Callback>`, it is sometimes useful to make your own callback. In the following example, we want to see the effect of temperature on the optimization of our neural network. To do so, we either increase or decrease the temperature during the optimization. As one can see in the result, temperature either as no effect or has a detrimental effect on the performance of the neural network. This is so because the temperature has for effect to artificially changing the learning rates. Since we have found the right learning rate, increasing or decreasing, it shows no improvement on the results. .. code-block:: python class CrossEntropyLossWithTemperature(nn.Module): """ This loss module is the cross-entropy loss function with temperature. It divides the logits by a temperature value before computing the cross-entropy loss. Args: initial_temperature (float): The initial value of the temperature. """ def __init__(self, initial_temperature): super().__init__() self.temperature = initial_temperature self.celoss = nn.CrossEntropyLoss() def forward(self, y_pred, y_true): y_pred = y_pred / self.temperature return self.celoss(y_pred, y_true) class TemperatureCallback(Callback): """ This callback multiply the loss temperature with a decay before each batch. Args: celoss_with_temp (CrossEntropyLossWithTemperature): the loss module. decay (float): The value of the temperature decay. """ def __init__(self, celoss_with_temp, decay): super().__init__() self.celoss_with_temp = celoss_with_temp self.decay = decay def on_train_batch_begin(self, batch, logs): self.celoss_with_temp.temperature *= self.decay So our loss function will be the cross-entropy with temperature with an initial temperature of ``0.1`` and a temperature decay of ``1.0008``. .. code-block:: python loss_function = CrossEntropyLossWithTemperature(0.1) callbacks = callbacks + [TemperatureCallback(loss_function, 1.0008)] Now let's test our training loop for one epoch using the accuracy as the batch metric. .. code-block:: python model = Model(full_network, optimizer, loss_function, batch_metrics=['accuracy']) model.to(device) model.fit_generator(train_loader, valid_loader, epochs=1, callbacks=callbacks) Coloring ======== Also, Poutyne use by default a coloring template of the training step when the package ``colorama`` is installed. One could either remove the coloring (``progress_options=dict(coloring=False)``) or set a different coloring template using the fields: ``text_color``, ``ratio_color``, ``metric_value_color``, ``time_color`` and ``progress_bar_color``. If a field is not specified, the default colour will be used. Here an example where we set the ``text_color`` to MAGENTA and the ``ratio_color`` to BLUE. .. code-block:: python model.fit_generator(train_loader, valid_loader, epochs=1, callbacks=callbacks, progress_options=dict(coloring={"text_color": "MAGENTA", "ratio_color":"BLUE"})) Epoch metrics ============= It's also possible to used epoch metrics such as :class:`~poutyne.F1`. You could also define your own epoch metric using the :class:`~poutyne.EpochMetric` interface. .. code-block:: python model = Model(full_network, optimizer, loss_function, batch_metrics=['accuracy'], epoch_metrics=['f1']) model.to(device) model.fit_generator(train_loader, valid_loader, epochs=1, callbacks=callbacks) Furthermore, you could also use the :class:`~poutyne.SKLearnMetrics` wrapper to wrap a Scikit-learn metric as an epoch metric. Below, we show how to compute the AUC ROC using the :class:`~poutyne.SKLearnMetrics` class. We have to inherit the class so that the data is passed into the right format for the scikit-learn ``roc_auc_score`` function. .. code-block:: python class FlattenSKLearnMetrics(SKLearnMetrics): def forward(self, y_pred, y_true): y_pred = y_pred.softmax(1) y_pred = y_pred.transpose(2, 1).flatten(0, 1) y_true = y_true.flatten() return super().forward(y_pred, y_true) roc_epoch_metric = FlattenSKLearnMetrics(roc_auc_score, kwargs=dict(multi_class='ovr', average='macro')) model = Model(full_network, optimizer, loss_function, batch_metrics=['accuracy'], epoch_metrics=['f1', roc_epoch_metric]) model.to(device) model.fit_generator(train_loader, valid_loader, epochs=1, callbacks=callbacks) Metric naming ============= It's also possible to name the metric using a tuple format ``(<metric name>, metric)``. That way, it's possible to use multiple times the same metric type (i.e. having micro and macro F1-score). .. code-block:: python model = Model(full_network, optimizer, loss_function, batch_metrics=[("My accuracy name", accuracy)], epoch_metrics=[("My metric name", F1())]) model.to(device) model.fit_generator(train_loader, valid_loader, epochs=1) Multi-GPUs ========== Finally, it's also possible to use multi-GPUs for your training either by specifying a list of devices or using the arg ``"all"`` to take them all. .. Note:: Obviously, you need more than one GPUs for that option. .. code-block:: python model = Model(full_network, optimizer, loss_function, batch_metrics=[("My accuracy name", accuracy)], epoch_metrics=[("My metric name", F1())]) model.to("all") model.fit_generator(train_loader, valid_loader, epochs=1)
{ "pile_set_name": "Github" }
'use strict'; // Generates a custom Modernizr build that includes only the tests you // reference in your app module.exports = { devFile : '<%= paths.app %>/bower_components/modernizr/modernizr.js', outputFile : '<%= paths.dist %>/bower_components/modernizr/modernizr.js', files : [ '<%= paths.dist %>/scripts/{,*/}*.js', '<%= paths.dist %>/styles/{,*/}*.css', '!<%= paths.dist %>/scripts/vendor/*' ], uglify : true };
{ "pile_set_name": "Github" }
/* * Copyright 2016 Stormpath, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.stormpath.sdk.saml; import com.stormpath.sdk.query.Criteria; /** * A {@link SamlServiceProviderRegistration}-specific {@link Criteria} class, enabling a SamlServiceProviderRegistration-specific * <a href="http://en.wikipedia.org/wiki/Fluent_interface">fluent</a>query DSL. PhoneCriteria instances can be * constructed by using the {@link SamlServiceProviderRegistrations} utility class, for example: * <pre> * SamlServiceProviderRegistrations.where(SamlServiceProviderRegistrations.createdAt().eq("2016-01-01")... * * @since 1.3.0 */ public interface SamlServiceProviderRegistrationCriteria extends Criteria<SamlServiceProviderRegistrationCriteria>, SamlServiceProviderRegistrationOptions<SamlServiceProviderRegistrationCriteria>{ /** * Ensures that the query results are ordered by group {@link SamlServiceProviderRegistration#getStatus() status}. * <p/> * Please see the {@link SamlServiceProviderRegistrationCriteria class-level documentation} for controlling sort order (ascending or * descending) and chaining multiple {@code orderBy} clauses. * * @return this instance for method chaining */ SamlServiceProviderRegistrationCriteria orderByStatus(); /** * Ensures that the query results are ordered by group {@link SamlServiceProviderRegistration#getDefaultRelayState() defaultRelayState}. * <p/> * Please see the {@link SamlServiceProviderRegistrationCriteria class-level documentation} for controlling sort order (ascending or * descending) and chaining multiple {@code orderBy} clauses. * * @return this instance for method chaining */ SamlServiceProviderRegistrationCriteria orderByDefaultRelayState(); }
{ "pile_set_name": "Github" }
/* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // Package dns implements a dns resolver to be installed as the default resolver // in grpc. package dns import ( "context" "encoding/json" "errors" "fmt" "net" "os" "strconv" "strings" "sync" "time" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal/grpcrand" "google.golang.org/grpc/resolver" "google.golang.org/grpc/serviceconfig" ) // EnableSRVLookups controls whether the DNS resolver attempts to fetch gRPCLB // addresses from SRV records. Must not be changed after init time. var EnableSRVLookups = false func init() { resolver.Register(NewBuilder()) } const ( defaultPort = "443" defaultDNSSvrPort = "53" golang = "GO" // txtPrefix is the prefix string to be prepended to the host name for txt record lookup. txtPrefix = "_grpc_config." // In DNS, service config is encoded in a TXT record via the mechanism // described in RFC-1464 using the attribute name grpc_config. txtAttribute = "grpc_config=" ) var ( errMissingAddr = errors.New("dns resolver: missing address") // Addresses ending with a colon that is supposed to be the separator // between host and port is not allowed. E.g. "::" is a valid address as // it is an IPv6 address (host only) and "[::]:" is invalid as it ends with // a colon as the host and port separator errEndsWithColon = errors.New("dns resolver: missing port after port-separator colon") ) var ( defaultResolver netResolver = net.DefaultResolver // To prevent excessive re-resolution, we enforce a rate limit on DNS // resolution requests. minDNSResRate = 30 * time.Second ) var customAuthorityDialler = func(authority string) func(ctx context.Context, network, address string) (net.Conn, error) { return func(ctx context.Context, network, address string) (net.Conn, error) { var dialer net.Dialer return dialer.DialContext(ctx, network, authority) } } var customAuthorityResolver = func(authority string) (netResolver, error) { host, port, err := parseTarget(authority, defaultDNSSvrPort) if err != nil { return nil, err } authorityWithPort := net.JoinHostPort(host, port) return &net.Resolver{ PreferGo: true, Dial: customAuthorityDialler(authorityWithPort), }, nil } // NewBuilder creates a dnsBuilder which is used to factory DNS resolvers. func NewBuilder() resolver.Builder { return &dnsBuilder{} } type dnsBuilder struct{} // Build creates and starts a DNS resolver that watches the name resolution of the target. func (b *dnsBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error) { host, port, err := parseTarget(target.Endpoint, defaultPort) if err != nil { return nil, err } // IP address. if ipAddr, ok := formatIP(host); ok { addr := []resolver.Address{{Addr: ipAddr + ":" + port}} cc.UpdateState(resolver.State{Addresses: addr}) return deadResolver{}, nil } // DNS address (non-IP). ctx, cancel := context.WithCancel(context.Background()) d := &dnsResolver{ host: host, port: port, ctx: ctx, cancel: cancel, cc: cc, rn: make(chan struct{}, 1), disableServiceConfig: opts.DisableServiceConfig, } if target.Authority == "" { d.resolver = defaultResolver } else { d.resolver, err = customAuthorityResolver(target.Authority) if err != nil { return nil, err } } d.wg.Add(1) go d.watcher() d.ResolveNow(resolver.ResolveNowOptions{}) return d, nil } // Scheme returns the naming scheme of this resolver builder, which is "dns". func (b *dnsBuilder) Scheme() string { return "dns" } type netResolver interface { LookupHost(ctx context.Context, host string) (addrs []string, err error) LookupSRV(ctx context.Context, service, proto, name string) (cname string, addrs []*net.SRV, err error) LookupTXT(ctx context.Context, name string) (txts []string, err error) } // deadResolver is a resolver that does nothing. type deadResolver struct{} func (deadResolver) ResolveNow(resolver.ResolveNowOptions) {} func (deadResolver) Close() {} // dnsResolver watches for the name resolution update for a non-IP target. type dnsResolver struct { host string port string resolver netResolver ctx context.Context cancel context.CancelFunc cc resolver.ClientConn // rn channel is used by ResolveNow() to force an immediate resolution of the target. rn chan struct{} // wg is used to enforce Close() to return after the watcher() goroutine has finished. // Otherwise, data race will be possible. [Race Example] in dns_resolver_test we // replace the real lookup functions with mocked ones to facilitate testing. // If Close() doesn't wait for watcher() goroutine finishes, race detector sometimes // will warns lookup (READ the lookup function pointers) inside watcher() goroutine // has data race with replaceNetFunc (WRITE the lookup function pointers). wg sync.WaitGroup disableServiceConfig bool } // ResolveNow invoke an immediate resolution of the target that this dnsResolver watches. func (d *dnsResolver) ResolveNow(resolver.ResolveNowOptions) { select { case d.rn <- struct{}{}: default: } } // Close closes the dnsResolver. func (d *dnsResolver) Close() { d.cancel() d.wg.Wait() } func (d *dnsResolver) watcher() { defer d.wg.Done() for { select { case <-d.ctx.Done(): return case <-d.rn: } state := d.lookup() d.cc.UpdateState(*state) // Sleep to prevent excessive re-resolutions. Incoming resolution requests // will be queued in d.rn. t := time.NewTimer(minDNSResRate) select { case <-t.C: case <-d.ctx.Done(): t.Stop() return } } } func (d *dnsResolver) lookupSRV() []resolver.Address { if !EnableSRVLookups { return nil } var newAddrs []resolver.Address _, srvs, err := d.resolver.LookupSRV(d.ctx, "grpclb", "tcp", d.host) if err != nil { grpclog.Infof("grpc: failed dns SRV record lookup due to %v.\n", err) return nil } for _, s := range srvs { lbAddrs, err := d.resolver.LookupHost(d.ctx, s.Target) if err != nil { grpclog.Infof("grpc: failed load balancer address dns lookup due to %v.\n", err) continue } for _, a := range lbAddrs { a, ok := formatIP(a) if !ok { grpclog.Errorf("grpc: failed IP parsing due to %v.\n", err) continue } addr := a + ":" + strconv.Itoa(int(s.Port)) newAddrs = append(newAddrs, resolver.Address{Addr: addr, Type: resolver.GRPCLB, ServerName: s.Target}) } } return newAddrs } var filterError = func(err error) error { if dnsErr, ok := err.(*net.DNSError); ok && !dnsErr.IsTimeout && !dnsErr.IsTemporary { // Timeouts and temporary errors should be communicated to gRPC to // attempt another DNS query (with backoff). Other errors should be // suppressed (they may represent the absence of a TXT record). return nil } return err } func (d *dnsResolver) lookupTXT() *serviceconfig.ParseResult { ss, err := d.resolver.LookupTXT(d.ctx, txtPrefix+d.host) if err != nil { err = filterError(err) if err != nil { err = fmt.Errorf("error from DNS TXT record lookup: %v", err) grpclog.Infoln("grpc:", err) return &serviceconfig.ParseResult{Err: err} } return nil } var res string for _, s := range ss { res += s } // TXT record must have "grpc_config=" attribute in order to be used as service config. if !strings.HasPrefix(res, txtAttribute) { grpclog.Warningf("grpc: DNS TXT record %v missing %v attribute", res, txtAttribute) // This is not an error; it is the equivalent of not having a service config. return nil } sc := canaryingSC(strings.TrimPrefix(res, txtAttribute)) return d.cc.ParseServiceConfig(sc) } func (d *dnsResolver) lookupHost() []resolver.Address { var newAddrs []resolver.Address addrs, err := d.resolver.LookupHost(d.ctx, d.host) if err != nil { grpclog.Warningf("grpc: failed dns A record lookup due to %v.\n", err) return nil } for _, a := range addrs { a, ok := formatIP(a) if !ok { grpclog.Errorf("grpc: failed IP parsing due to %v.\n", err) continue } addr := a + ":" + d.port newAddrs = append(newAddrs, resolver.Address{Addr: addr}) } return newAddrs } func (d *dnsResolver) lookup() *resolver.State { srv := d.lookupSRV() state := &resolver.State{ Addresses: append(d.lookupHost(), srv...), } if !d.disableServiceConfig { state.ServiceConfig = d.lookupTXT() } return state } // formatIP returns ok = false if addr is not a valid textual representation of an IP address. // If addr is an IPv4 address, return the addr and ok = true. // If addr is an IPv6 address, return the addr enclosed in square brackets and ok = true. func formatIP(addr string) (addrIP string, ok bool) { ip := net.ParseIP(addr) if ip == nil { return "", false } if ip.To4() != nil { return addr, true } return "[" + addr + "]", true } // parseTarget takes the user input target string and default port, returns formatted host and port info. // If target doesn't specify a port, set the port to be the defaultPort. // If target is in IPv6 format and host-name is enclosed in square brackets, brackets // are stripped when setting the host. // examples: // target: "www.google.com" defaultPort: "443" returns host: "www.google.com", port: "443" // target: "ipv4-host:80" defaultPort: "443" returns host: "ipv4-host", port: "80" // target: "[ipv6-host]" defaultPort: "443" returns host: "ipv6-host", port: "443" // target: ":80" defaultPort: "443" returns host: "localhost", port: "80" func parseTarget(target, defaultPort string) (host, port string, err error) { if target == "" { return "", "", errMissingAddr } if ip := net.ParseIP(target); ip != nil { // target is an IPv4 or IPv6(without brackets) address return target, defaultPort, nil } if host, port, err = net.SplitHostPort(target); err == nil { if port == "" { // If the port field is empty (target ends with colon), e.g. "[::1]:", this is an error. return "", "", errEndsWithColon } // target has port, i.e ipv4-host:port, [ipv6-host]:port, host-name:port if host == "" { // Keep consistent with net.Dial(): If the host is empty, as in ":80", the local system is assumed. host = "localhost" } return host, port, nil } if host, port, err = net.SplitHostPort(target + ":" + defaultPort); err == nil { // target doesn't have port return host, port, nil } return "", "", fmt.Errorf("invalid target address %v, error info: %v", target, err) } type rawChoice struct { ClientLanguage *[]string `json:"clientLanguage,omitempty"` Percentage *int `json:"percentage,omitempty"` ClientHostName *[]string `json:"clientHostName,omitempty"` ServiceConfig *json.RawMessage `json:"serviceConfig,omitempty"` } func containsString(a *[]string, b string) bool { if a == nil { return true } for _, c := range *a { if c == b { return true } } return false } func chosenByPercentage(a *int) bool { if a == nil { return true } return grpcrand.Intn(100)+1 <= *a } func canaryingSC(js string) string { if js == "" { return "" } var rcs []rawChoice err := json.Unmarshal([]byte(js), &rcs) if err != nil { grpclog.Warningf("grpc: failed to parse service config json string due to %v.\n", err) return "" } cliHostname, err := os.Hostname() if err != nil { grpclog.Warningf("grpc: failed to get client hostname due to %v.\n", err) return "" } var sc string for _, c := range rcs { if !containsString(c.ClientLanguage, golang) || !chosenByPercentage(c.Percentage) || !containsString(c.ClientHostName, cliHostname) || c.ServiceConfig == nil { continue } sc = string(*c.ServiceConfig) break } return sc }
{ "pile_set_name": "Github" }
org.quartz.scheduler.instanceName: DefaultQuartzScheduler org.quartz.scheduler.rmi.export: false org.quartz.scheduler.rmi.proxy: false org.quartz.scheduler.wrapJobExecutionInUserTransaction: false org.quartz.threadPool.class: org.quartz.simpl.SimpleThreadPool org.quartz.threadPool.threadCount: 10 org.quartz.threadPool.threadPriority: 5 org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread: true org.quartz.jobStore.misfireThreshold: 60000 org.quartz.jobStore.class: org.quartz.simpl.RAMJobStore org.quartz.scheduler.skipUpdateCheck=true
{ "pile_set_name": "Github" }
<annotation> <folder>widerface</folder> <filename>49--Greeting_49_Greeting_peoplegreeting_49_693.jpg</filename> <source> <database>wider face Database</database> <annotation>PASCAL VOC2007</annotation> <image>flickr</image> <flickrid>-1</flickrid> </source> <owner> <flickrid>yanyu</flickrid> <name>yanyu</name> </owner> <size> <width>1024</width> <height>683</height> <depth>3</depth> </size> <segmented>0</segmented> <object> <name>face</name> <pose>Unspecified</pose> <truncated>1</truncated> <difficult>0</difficult> <bndbox> <xmin>434</xmin> <ymin>252</ymin> <xmax>504</xmax> <ymax>330</ymax> </bndbox> <lm> <x1>447.688</x1> <y1>288.022</y1> <x2>475.933</x2> <y2>282.571</y2> <x3>460.571</x3> <y3>293.473</y3> <x4>455.121</x4> <y4>312.799</y4> <x5>476.924</x5> <y5>307.844</y5> <visible>0</visible> <blur>0.73</blur> </lm> <has_lm>1</has_lm> </object> <object> <name>face</name> <pose>Unspecified</pose> <truncated>1</truncated> <difficult>0</difficult> <bndbox> <xmin>530</xmin> <ymin>254</ymin> <xmax>590</xmax> <ymax>346</ymax> </bndbox> <lm> <x1>539.92</x1> <y1>287.982</y1> <x2>543.375</x2> <y2>292.589</y2> <x3>530.705</x3> <y3>299.5</y3> <x4>551.438</x4> <y4>318.504</y4> <x5>554.893</x5> <y5>321.96</y5> <visible>1</visible> <blur>0.65</blur> </lm> <has_lm>1</has_lm> </object> <object> <name>face</name> <pose>Unspecified</pose> <truncated>1</truncated> <difficult>0</difficult> <bndbox> <xmin>916</xmin> <ymin>100</ymin> <xmax>1022</xmax> <ymax>260</ymax> </bndbox> <lm> <x1>961.009</x1> <y1>180.504</y1> <x2>1020.272</x2> <y2>180.504</y2> <x3>995.161</x3> <y3>205.616</y3> <x4>970.049</x4> <y4>232.737</y4> <x5>1007.214</x5> <y5>236.754</y5> <visible>0</visible> <blur>0.58</blur> </lm> <has_lm>1</has_lm> </object> </annotation>
{ "pile_set_name": "Github" }
// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.components.offline_items_collection.bridges; import android.net.Uri; import android.text.TextUtils; import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.JNINamespace; import org.chromium.components.offline_items_collection.OfflineItemShareInfo; /** * The Java counterpart to the C++ class OfflineItemShareInfoBridge * (components/offline_items_collection/core/android/offline_item_share_info_bridge.h). This class * has no public members or methods and is meant as a private factory to build * {@link OfflineItemShareInfo} instances. */ @JNINamespace("offline_items_collection::android") public final class OfflineItemShareInfoBridge { private OfflineItemShareInfoBridge() {} /** * This is a helper method to allow C++ to create an {@link OfflineItemShareInfo} object. * @return The newly created {@link OfflineItemShareInfo} based on the input parameters. */ @CalledByNative private static OfflineItemShareInfo createOfflineItemShareInfo(String uri) { OfflineItemShareInfo shareInfo = new OfflineItemShareInfo(); if (!TextUtils.isEmpty(uri)) shareInfo.uri = Uri.parse(uri); return shareInfo; } }
{ "pile_set_name": "Github" }
/* jshint browser:true */ /* global require, module */ /** * @fileOverview * * This file contains the key filter, used to convert a collection of models * into an array of models. */ 'use strict'; var _ = require('lodash'); /** * Converts the model from an object to an array. Orders the result of a goQuery * given the $$index on the model. * @public * @returns {function} The goangular filter function */ module.exports = function keyFilter() { var mPrimToObj = memoize(primToObj); return function(model, enabled) { enabled = (_.isBoolean(enabled)) ? enabled : true; // Default: true if (!model || !_.isObject(model) || _.isArray(model) || !enabled) { return model; } var output = []; var data = null; if (!_.has(model, '$$index')) { data = _.keys(model); } else if (_.has(model, '$omit') && model.$$index.length === 0) { data = _.keys(model.$omit()); } else { data = model.$$index; } _.each(data, function(key) { var value = model[key]; if (!_.isObject(value)) { value = mPrimToObj(key, value); } else { value.$name = key; } output.push(value); }); return output; }; }; /** * Creates a new model for primitives to hold the key $name and $value. * @private * @returns {object} Model for primitives */ function primToObj(name, value) { return { $value: value, $name: name }; } /** * Memoizes a function and uses both the key name and value to cache results. * @private * @returns {function} A memoize-wrapped function. */ function memoize(func) { var memoized = function() { var cache = memoized.cache; var name = arguments[0]; var value = arguments[1]; cache[name] = cache[name] || {}; if (!_.isUndefined(cache[name][value])) { return cache[name][value]; } cache[name][value] = func.call(null, name, value); return cache[name][value]; }; memoized.cache = {}; return memoized; }
{ "pile_set_name": "Github" }
<?php /* * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many individuals * and is licensed under the MIT license. For more information, see * <http://www.doctrine-project.org>. */ namespace Doctrine\ORM\Tools\Export\Driver; use Doctrine\ORM\Mapping\ClassMetadataInfo; use SimpleXMLElement; /** * ClassMetadata exporter for Doctrine XML mapping files. * * @link www.doctrine-project.org * @since 2.0 * @author Jonathan Wage <jonwage@gmail.com> * * @deprecated 2.7 This class is being removed from the ORM and won't have any replacement */ class XmlExporter extends AbstractExporter { /** * @var string */ protected $_extension = '.dcm.xml'; /** * {@inheritdoc} */ public function exportClassMetadata(ClassMetadataInfo $metadata) { $xml = new SimpleXmlElement('<?xml version="1.0" encoding="utf-8"?><doctrine-mapping ' . 'xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" ' . 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' . 'xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd" />'); if ($metadata->isMappedSuperclass) { $root = $xml->addChild('mapped-superclass'); } else { $root = $xml->addChild('entity'); } if ($metadata->customRepositoryClassName) { $root->addAttribute('repository-class', $metadata->customRepositoryClassName); } $root->addAttribute('name', $metadata->name); if (isset($metadata->table['name'])) { $root->addAttribute('table', $metadata->table['name']); } if (isset($metadata->table['schema'])) { $root->addAttribute('schema', $metadata->table['schema']); } if ($metadata->inheritanceType && $metadata->inheritanceType !== ClassMetadataInfo::INHERITANCE_TYPE_NONE) { $root->addAttribute('inheritance-type', $this->_getInheritanceTypeString($metadata->inheritanceType)); } if (isset($metadata->table['options'])) { $optionsXml = $root->addChild('options'); $this->exportTableOptions($optionsXml, $metadata->table['options']); } if ($metadata->discriminatorColumn) { $discriminatorColumnXml = $root->addChild('discriminator-column'); $discriminatorColumnXml->addAttribute('name', $metadata->discriminatorColumn['name']); $discriminatorColumnXml->addAttribute('type', $metadata->discriminatorColumn['type']); if (isset($metadata->discriminatorColumn['length'])) { $discriminatorColumnXml->addAttribute('length', $metadata->discriminatorColumn['length']); } } if ($metadata->discriminatorMap) { $discriminatorMapXml = $root->addChild('discriminator-map'); foreach ($metadata->discriminatorMap as $value => $className) { $discriminatorMappingXml = $discriminatorMapXml->addChild('discriminator-mapping'); $discriminatorMappingXml->addAttribute('value', $value); $discriminatorMappingXml->addAttribute('class', $className); } } $trackingPolicy = $this->_getChangeTrackingPolicyString($metadata->changeTrackingPolicy); if ( $trackingPolicy != 'DEFERRED_IMPLICIT') { $root->addChild('change-tracking-policy', $trackingPolicy); } if (isset($metadata->table['indexes'])) { $indexesXml = $root->addChild('indexes'); foreach ($metadata->table['indexes'] as $name => $index) { $indexXml = $indexesXml->addChild('index'); $indexXml->addAttribute('name', $name); $indexXml->addAttribute('columns', implode(',', $index['columns'])); if (isset($index['flags'])) { $indexXml->addAttribute('flags', implode(',', $index['flags'])); } } } if (isset($metadata->table['uniqueConstraints'])) { $uniqueConstraintsXml = $root->addChild('unique-constraints'); foreach ($metadata->table['uniqueConstraints'] as $name => $unique) { $uniqueConstraintXml = $uniqueConstraintsXml->addChild('unique-constraint'); $uniqueConstraintXml->addAttribute('name', $name); $uniqueConstraintXml->addAttribute('columns', implode(',', $unique['columns'])); } } $fields = $metadata->fieldMappings; $id = []; foreach ($fields as $name => $field) { if (isset($field['id']) && $field['id']) { $id[$name] = $field; unset($fields[$name]); } } foreach ($metadata->associationMappings as $name => $assoc) { if (isset($assoc['id']) && $assoc['id']) { $id[$name] = [ 'fieldName' => $name, 'associationKey' => true ]; } } if ( ! $metadata->isIdentifierComposite && $idGeneratorType = $this->_getIdGeneratorTypeString($metadata->generatorType)) { $id[$metadata->getSingleIdentifierFieldName()]['generator']['strategy'] = $idGeneratorType; } if ($id) { foreach ($id as $field) { $idXml = $root->addChild('id'); $idXml->addAttribute('name', $field['fieldName']); if (isset($field['type'])) { $idXml->addAttribute('type', $field['type']); } if (isset($field['columnName'])) { $idXml->addAttribute('column', $field['columnName']); } if (isset($field['length'])) { $idXml->addAttribute('length', $field['length']); } if (isset($field['associationKey']) && $field['associationKey']) { $idXml->addAttribute('association-key', 'true'); } if ($idGeneratorType = $this->_getIdGeneratorTypeString($metadata->generatorType)) { $generatorXml = $idXml->addChild('generator'); $generatorXml->addAttribute('strategy', $idGeneratorType); $this->exportSequenceInformation($idXml, $metadata); } } } if ($fields) { foreach ($fields as $field) { $fieldXml = $root->addChild('field'); $fieldXml->addAttribute('name', $field['fieldName']); $fieldXml->addAttribute('type', $field['type']); if (isset($field['columnName'])) { $fieldXml->addAttribute('column', $field['columnName']); } if (isset($field['length'])) { $fieldXml->addAttribute('length', $field['length']); } if (isset($field['precision'])) { $fieldXml->addAttribute('precision', $field['precision']); } if (isset($field['scale'])) { $fieldXml->addAttribute('scale', $field['scale']); } if (isset($field['unique']) && $field['unique']) { $fieldXml->addAttribute('unique', 'true'); } if (isset($field['options'])) { $optionsXml = $fieldXml->addChild('options'); foreach ($field['options'] as $key => $value) { $optionXml = $optionsXml->addChild('option', $value); $optionXml->addAttribute('name', $key); } } if (isset($field['version'])) { $fieldXml->addAttribute('version', $field['version']); } if (isset($field['columnDefinition'])) { $fieldXml->addAttribute('column-definition', $field['columnDefinition']); } if (isset($field['nullable'])) { $fieldXml->addAttribute('nullable', $field['nullable'] ? 'true' : 'false'); } } } $orderMap = [ ClassMetadataInfo::ONE_TO_ONE, ClassMetadataInfo::ONE_TO_MANY, ClassMetadataInfo::MANY_TO_ONE, ClassMetadataInfo::MANY_TO_MANY, ]; uasort($metadata->associationMappings, function($m1, $m2) use (&$orderMap){ $a1 = array_search($m1['type'], $orderMap); $a2 = array_search($m2['type'], $orderMap); return strcmp($a1, $a2); }); foreach ($metadata->associationMappings as $associationMapping) { $associationMappingXml = null; if ($associationMapping['type'] == ClassMetadataInfo::ONE_TO_ONE) { $associationMappingXml = $root->addChild('one-to-one'); } elseif ($associationMapping['type'] == ClassMetadataInfo::MANY_TO_ONE) { $associationMappingXml = $root->addChild('many-to-one'); } elseif ($associationMapping['type'] == ClassMetadataInfo::ONE_TO_MANY) { $associationMappingXml = $root->addChild('one-to-many'); } elseif ($associationMapping['type'] == ClassMetadataInfo::MANY_TO_MANY) { $associationMappingXml = $root->addChild('many-to-many'); } $associationMappingXml->addAttribute('field', $associationMapping['fieldName']); $associationMappingXml->addAttribute('target-entity', $associationMapping['targetEntity']); if (isset($associationMapping['mappedBy'])) { $associationMappingXml->addAttribute('mapped-by', $associationMapping['mappedBy']); } if (isset($associationMapping['inversedBy'])) { $associationMappingXml->addAttribute('inversed-by', $associationMapping['inversedBy']); } if (isset($associationMapping['indexBy'])) { $associationMappingXml->addAttribute('index-by', $associationMapping['indexBy']); } if (isset($associationMapping['orphanRemoval']) && $associationMapping['orphanRemoval'] !== false) { $associationMappingXml->addAttribute('orphan-removal', 'true'); } if (isset($associationMapping['fetch'])) { $associationMappingXml->addAttribute('fetch', $this->_getFetchModeString($associationMapping['fetch'])); } $cascade = []; if ($associationMapping['isCascadeRemove']) { $cascade[] = 'cascade-remove'; } if ($associationMapping['isCascadePersist']) { $cascade[] = 'cascade-persist'; } if ($associationMapping['isCascadeRefresh']) { $cascade[] = 'cascade-refresh'; } if ($associationMapping['isCascadeMerge']) { $cascade[] = 'cascade-merge'; } if ($associationMapping['isCascadeDetach']) { $cascade[] = 'cascade-detach'; } if (count($cascade) === 5) { $cascade = ['cascade-all']; } if ($cascade) { $cascadeXml = $associationMappingXml->addChild('cascade'); foreach ($cascade as $type) { $cascadeXml->addChild($type); } } if (isset($associationMapping['joinTable']) && $associationMapping['joinTable']) { $joinTableXml = $associationMappingXml->addChild('join-table'); $joinTableXml->addAttribute('name', $associationMapping['joinTable']['name']); $joinColumnsXml = $joinTableXml->addChild('join-columns'); foreach ($associationMapping['joinTable']['joinColumns'] as $joinColumn) { $joinColumnXml = $joinColumnsXml->addChild('join-column'); $joinColumnXml->addAttribute('name', $joinColumn['name']); $joinColumnXml->addAttribute('referenced-column-name', $joinColumn['referencedColumnName']); if (isset($joinColumn['onDelete'])) { $joinColumnXml->addAttribute('on-delete', $joinColumn['onDelete']); } } $inverseJoinColumnsXml = $joinTableXml->addChild('inverse-join-columns'); foreach ($associationMapping['joinTable']['inverseJoinColumns'] as $inverseJoinColumn) { $inverseJoinColumnXml = $inverseJoinColumnsXml->addChild('join-column'); $inverseJoinColumnXml->addAttribute('name', $inverseJoinColumn['name']); $inverseJoinColumnXml->addAttribute('referenced-column-name', $inverseJoinColumn['referencedColumnName']); if (isset($inverseJoinColumn['onDelete'])) { $inverseJoinColumnXml->addAttribute('on-delete', $inverseJoinColumn['onDelete']); } if (isset($inverseJoinColumn['columnDefinition'])) { $inverseJoinColumnXml->addAttribute('column-definition', $inverseJoinColumn['columnDefinition']); } if (isset($inverseJoinColumn['nullable'])) { $inverseJoinColumnXml->addAttribute('nullable', $inverseJoinColumn['nullable']); } if (isset($inverseJoinColumn['orderBy'])) { $inverseJoinColumnXml->addAttribute('order-by', $inverseJoinColumn['orderBy']); } } } if (isset($associationMapping['joinColumns'])) { $joinColumnsXml = $associationMappingXml->addChild('join-columns'); foreach ($associationMapping['joinColumns'] as $joinColumn) { $joinColumnXml = $joinColumnsXml->addChild('join-column'); $joinColumnXml->addAttribute('name', $joinColumn['name']); $joinColumnXml->addAttribute('referenced-column-name', $joinColumn['referencedColumnName']); if (isset($joinColumn['onDelete'])) { $joinColumnXml->addAttribute('on-delete', $joinColumn['onDelete']); } if (isset($joinColumn['columnDefinition'])) { $joinColumnXml->addAttribute('column-definition', $joinColumn['columnDefinition']); } if (isset($joinColumn['nullable'])) { $joinColumnXml->addAttribute('nullable', $joinColumn['nullable']); } } } if (isset($associationMapping['orderBy'])) { $orderByXml = $associationMappingXml->addChild('order-by'); foreach ($associationMapping['orderBy'] as $name => $direction) { $orderByFieldXml = $orderByXml->addChild('order-by-field'); $orderByFieldXml->addAttribute('name', $name); $orderByFieldXml->addAttribute('direction', $direction); } } } if (isset($metadata->lifecycleCallbacks) && count($metadata->lifecycleCallbacks)>0) { $lifecycleCallbacksXml = $root->addChild('lifecycle-callbacks'); foreach ($metadata->lifecycleCallbacks as $name => $methods) { foreach ($methods as $method) { $lifecycleCallbackXml = $lifecycleCallbacksXml->addChild('lifecycle-callback'); $lifecycleCallbackXml->addAttribute('type', $name); $lifecycleCallbackXml->addAttribute('method', $method); } } } $this->processEntityListeners($metadata, $root); return $this->_asXml($xml); } /** * Exports (nested) option elements. * * @param SimpleXMLElement $parentXml * @param array $options */ private function exportTableOptions(SimpleXMLElement $parentXml, array $options) : void { foreach ($options as $name => $option) { $isArray = is_array($option); $optionXml = $isArray ? $parentXml->addChild('option') : $parentXml->addChild('option', (string) $option); $optionXml->addAttribute('name', (string) $name); if ($isArray) { $this->exportTableOptions($optionXml, $option); } } } /** * Export sequence information (if available/configured) into the current identifier XML node * * @param SimpleXMLElement $identifierXmlNode * @param ClassMetadataInfo $metadata * * @return void */ private function exportSequenceInformation(SimpleXMLElement $identifierXmlNode, ClassMetadataInfo $metadata) : void { $sequenceDefinition = $metadata->sequenceGeneratorDefinition; if (! ($metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE && $sequenceDefinition)) { return; } $sequenceGeneratorXml = $identifierXmlNode->addChild('sequence-generator'); $sequenceGeneratorXml->addAttribute('sequence-name', $sequenceDefinition['sequenceName']); $sequenceGeneratorXml->addAttribute('allocation-size', $sequenceDefinition['allocationSize']); $sequenceGeneratorXml->addAttribute('initial-value', $sequenceDefinition['initialValue']); } private function _asXml(SimpleXMLElement $simpleXml) : string { $dom = new \DOMDocument('1.0', 'UTF-8'); $dom->loadXML($simpleXml->asXML()); $dom->formatOutput = true; return $dom->saveXML(); } private function processEntityListeners(ClassMetadataInfo $metadata, SimpleXMLElement $root): void { if (0 === \count($metadata->entityListeners)) { return; } $entityListenersXml = $root->addChild('entity-listeners'); $entityListenersXmlMap = []; $this->generateEntityListenerXml($metadata, $entityListenersXmlMap, $entityListenersXml); } private function generateEntityListenerXml(ClassMetadataInfo $metadata, array $entityListenersXmlMap, SimpleXMLElement $entityListenersXml): void { foreach ($metadata->entityListeners as $event => $entityListenerConfig) { foreach ($entityListenerConfig as $entityListener) { $entityListenerXml = $this->addClassToMapIfExists( $entityListenersXmlMap, $entityListener, $entityListenersXml ); $entityListenerCallbackXml = $entityListenerXml->addChild('lifecycle-callback'); $entityListenerCallbackXml->addAttribute('type', $event); $entityListenerCallbackXml->addAttribute('method', $entityListener['method']); } } } private function addClassToMapIfExists(array $entityListenersXmlMap, array $entityListener, SimpleXMLElement $entityListenersXml): SimpleXMLElement { if (isset($entityListenersXmlMap[$entityListener['class']])) { return $entityListenersXmlMap[$entityListener['class']]; } $entityListenerXml = $entityListenersXml->addChild('entity-listener'); $entityListenerXml->addAttribute('class', $entityListener['class']); $entityListenersXmlMap[$entityListener['class']] = $entityListenerXml; return $entityListenerXml; } }
{ "pile_set_name": "Github" }
using System; using System.Collections; using System.Collections.Generic; namespace AspectCore.DynamicProxy.Parameters { public sealed class ParameterCollection : IEnumerable<Parameter>, IReadOnlyList<Parameter> { private static readonly object[] emptyValues = new object[0]; private readonly int _count; private readonly Parameter[] _parameterEntries; internal ParameterCollection(Parameter[] parameters) { _count = parameters.Length; _parameterEntries = parameters; } public Parameter this[int index] { get { if (index < 0 || index >= _count) { throw new ArgumentOutOfRangeException(nameof(index), "index value out of range."); } return _parameterEntries[index]; } } public Parameter this[string name] { get { if (name == null) { throw new ArgumentNullException(nameof(name)); } var count = _count; var parameters = _parameterEntries; if (count == 1) { var descriptor = parameters[0]; if (descriptor.Name == name) { return descriptor; } throw ThrowNotFound(); } Parameter parameter; for (var i = 0; i < count; i++) { parameter = parameters[i]; if (parameters[i].Name == name) return parameter; } throw ThrowNotFound(); InvalidOperationException ThrowNotFound() { return new InvalidOperationException($"Not found the parameter named \"{name}\"."); } } } public int Count { get { return _count; } } public IEnumerator<Parameter> GetEnumerator() { for (var i = 0; i < _count; i++) { yield return _parameterEntries[i]; } } public object[] GetValues() { if (_count == 0) { return emptyValues; } var values = new object[_count]; for (var i = 0; i < _count; i++) { values[i] = _parameterEntries[i].Value; } return values; } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } }
{ "pile_set_name": "Github" }
=head1 NAME Apache::*::Table - Table classes for Apache::Request, Apache::Upload, and Apache::Cookie. =for testing use Apache::Upload; use Apache::Cookie; use APR::Pool; use APR::Table; $r = APR::Pool->new; # environment object =head1 SYNOPSIS =for example begin my $table = Apache::Request::Table->new($r); $table->{test} = 1; $table->{foo} = "bar1"; $table->add(foo => "bar2"); { my $do_data = ""; $table->do( sub { $do_data .= "@_,"; 1 } ); ok $do_data eq "test 1,foo bar1,foo bar2,"; } =for example end =for example_testing #run the above tests, don't just compile them =head1 DESCRIPTION This manpage documents the Apache::*::Table classes provided by the Apache::Request, Apache::Upload, and Apache::Cookie modules. Table classes are all derived from APR::Table, however since the underlying values they contain are not simple character arrays, the C<merge>, C<compress>, and C<overlap> methods from APR::Table are not implemented. =head1 Apache::Request::Table These tables arise as parameter tables generated by the C<args>, C<body>, and C<param> methods of Apache::Request. Their values are representable by orinary perl scalars, but unlike APR::Table, the '\0' character may be safely embedded in a value without truncating it. =for example begin my $table = Apache::Request::Table->new($r); my $value = "bar\0quux"; $table->{foo} = $value; =for example end =for example_testing is $table->{foo}, $value; =head1 Apache::Upload::Table These tables arise from the C<Apache::Request::upload> method (which is provided by Apache::Upload). Their values are Apache::Upload objects. =for example begin my $upload = Apache::Upload->new($r, name => "foo", file => __FILE__); my $table = Apache::Upload::Table->new($r); $table->add($upload); $upload = $table->{foo}; =for example end =for example_testing ok $upload->isa("Apache::Upload"); =head1 Apache::Cookie::Table These tables arise from the C<cookies> method of Apache::Cookie::Jar, and their values are Apache::Cookie objects (or Apache::Cookie derived objects- see the discussion of C<VALUE_CLASS> in L<Apache::Cookie>). =for example begin my $cookie = Apache::Cookie->new($r, name =>"foo", value => "bar"); my $table = Apache::Cookie::Table->new($r); $table->{foo} = $cookie; $cookie = $table->{foo}; =for example end ok $cookie->isa("Apache::Cookie"); =for example_testing =head1 SEE ALSO L<Apache::Request>, L<Apache::Cookie>, L<Apache::Upload> APR::Table(3) =head1 COPYRIGHT Copyright 2003-2005 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
{ "pile_set_name": "Github" }
Shawn Lawrence Otto is an American novelist, nonfiction author, filmmaker, political strategist, speaker, science advocate, and screenwriter and co-producer of the movie House of Sand and Fog .
{ "pile_set_name": "Github" }
;;; jupyter-zmq-channel-ioloop.el --- IOLoop functions for Jupyter channels -*- lexical-binding: t -*- ;; Copyright (C) 2018-2020 Nathaniel Nicandro ;; Author: Nathaniel Nicandro <nathanielnicandro@gmail.com> ;; Created: 08 Nov 2018 ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License as ;; published by the Free Software Foundation; either version 3, or (at ;; your option) any later version. ;; This program is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Commentary: ;; A `jupyter-channel-ioloop' using `jupyter-zmq-channel' to send and receive ;; messages. Whenever a message is received on a channel an event that looks ;; like the following will be sent back to the parent process ;; ;; (message CHANNEL-TYPE IDENTS . MSG) ;; ;; where CHANNEL-TYPE is the channel on which the message was received (one of ;; `jupyter-socket-types'), IDENTS are ZMQ identities, typically ignored, and ;; MSG is the message plist. ;;; Code: (require 'jupyter-base) (require 'jupyter-channel-ioloop) (require 'jupyter-zmq-channel) (defclass jupyter-zmq-channel-ioloop (jupyter-channel-ioloop) () :documentation "A `jupyter-ioloop' configured for Jupyter channels.") (cl-defmethod initialize-instance ((ioloop jupyter-zmq-channel-ioloop) &optional _slots) (cl-call-next-method) (jupyter-ioloop-add-setup ioloop (require 'jupyter-zmq-channel-ioloop) (push 'jupyter-zmq-channel-ioloop--recv-messages jupyter-ioloop-post-hook) (cl-loop for channel in '(:shell :stdin :iopub) unless (object-assoc channel :type jupyter-channel-ioloop-channels) do (push (jupyter-zmq-channel :session jupyter-channel-ioloop-session :type channel) jupyter-channel-ioloop-channels)))) (defun jupyter-zmq-channel-ioloop--recv-messages (events) "Print the received messages described in EVENTS. EVENTS is a list of socket events as returned by `zmq-poller-wait-all'. If any of the sockets in EVENTS matches one of the sockets in `jupyter-channel-ioloop-channels', receive a message on the channel and print a list with the form (message CHANNEL-TYPE . MSG...) to stdout. CHANNEL-TYPE is the channel on which MSG was received, either :shell, :stdin, or :iopub. MSG is a list as returned by `jupyter-recv'." (let (messages) (dolist (channel jupyter-channel-ioloop-channels) (with-slots (type socket) channel (when (zmq-assoc socket events) (push (cons type (jupyter-recv channel)) messages)))) (when messages ;; Send messages (mapc (lambda (msg) (prin1 (cons 'message msg))) (nreverse messages)) (zmq-flush 'stdout)))) (provide 'jupyter-zmq-channel-ioloop) ;;; jupyter-zmq-channel-ioloop.el ends here
{ "pile_set_name": "Github" }
page: background_image: draft.png base: font_size: 9 font_color: #000000 line_height: 1.3 title_page: logo: top: 10% image: image:ocpi_logo.png[pdfwidth=40%] align: center align: center title: top: 40% font: size: 54 color: 000000 style: bold subtitle: font: size: 17 color: 000000 code: font: size: 8 table: font: size: 9 body: stripe_background_color: transparent border_width: 0.1 grid_width: 0.1 border_color: BBBBBB grid_color: BBBBBB cell: padding: [4, 4, 4, 4] header: height: 0.7cm line_height: 1 border_color: BBBBBB border_width: 0.2 verso: left: content: '' center: content: '{document_header}' right: content: '' recto: left: content: '' center: content: '{document_header}' right: content: '' font: size: 8 border_color: 666666 style: bold footer: height: 0.7cm line_height: 1 border_color: BBBBBB border_width: 0.2 verso: left: content: '' center: content: '{page-number}' right: content: '' recto: left: content: '' center: content: '{page-number}' right: content: '' font: size: 8 border_color: 666666 style: bold
{ "pile_set_name": "Github" }
# # Makefile for the linux ncp filesystem routines. # obj-$(CONFIG_NCP_FS) += ncpfs.o ncpfs-y := dir.o file.o inode.o ioctl.o mmap.o ncplib_kernel.o sock.o \ ncpsign_kernel.o getopt.o ncpfs-$(CONFIG_NCPFS_EXTRAS) += symlink.o ncpfs-$(CONFIG_NCPFS_NFS_NS) += symlink.o # If you want debugging output, please uncomment the following line # ccflags-y := -DDEBUG_NCP=1 CFLAGS_ncplib_kernel.o := -finline-functions
{ "pile_set_name": "Github" }
#! /usr/bin/ruby # coding:utf-8 sent = [] while line=gets do #客 きゃく 客 名詞 6 普通名詞 1 * 0 * 0 "代表表記:客/きゃく 漢字読み:音 カテゴリ:人 ドメイン:家庭・暮らし;ビジネス" next if line =~ /^[*+#\@!]/ next if line =~ /^\s*$/ if line =~ /(^EOS|^EOP)/ puts sent.join(" ") sent = [] next end sp = line.split(" ") if(line =~ /代表表記:([^\s"]*)/) sent << ($1) else sent << (sp[2] + "/" + sp[2]) end end
{ "pile_set_name": "Github" }
local ffi = require('ffi') local fun = require('fun') local merger = require('merger') local ibuf_t = ffi.typeof('struct ibuf') local merge_source_t = ffi.typeof('struct merge_source') -- Create a source from one buffer. merger.new_source_frombuffer = function(buf) local func_name = 'merger.new_source_frombuffer' if type(buf) ~= 'cdata' or not ffi.istype(ibuf_t, buf) then error(('Usage: %s(<cdata<struct ibuf>>)'):format(func_name), 0) end return merger.new_buffer_source(fun.iter({buf})) end -- Create a source from one table. merger.new_source_fromtable = function(tbl) local func_name = 'merger.new_source_fromtable' if type(tbl) ~= 'table' then error(('Usage: %s(<table>)'):format(func_name), 0) end return merger.new_table_source(fun.iter({tbl})) end local methods = { ['select'] = merger.internal.select, ['pairs'] = merger.internal.ipairs, ['ipairs'] = merger.internal.ipairs, } ffi.metatype(merge_source_t, { __index = function(self, key) return methods[key] end, -- Lua 5.2 compatibility __pairs = merger.internal.ipairs, __ipairs = merger.internal.ipairs, })
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleDisplayName</key> <string>${PRODUCT_NAME}</string> <key>CFBundleExecutable</key> <string>${EXECUTABLE_NAME}</string> <key>CFBundleIcons</key> <dict> <key>CFBundlePrimaryIcon</key> <dict> <key>CFBundleIconFiles</key> <array> <string>Icon.png</string> <string>Icon@2x.png</string> <string>Default.png</string> <string>Default@2x.png</string> <string>Icon~ipad.png</string> <string>Icon~ipad@2x.png</string> <string>Default-Portrait~ipad.png</string> <string>Default-Portrait@2x~ipad.png</string> <string>Default-Landscape~ipad.png</string> <string>Default-Landscape@2x~ipad.png</string> </array> </dict> </dict> <key>CFBundleIdentifier</key> <string>com.sadun.${PRODUCT_NAME:rfc1034identifier}</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>${PRODUCT_NAME}</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>1.0</string> <key>LSRequiresIPhoneOS</key> <true/> <key>UIRequiredDeviceCapabilities</key> <array> <string>armv7</string> </array> <key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> </array> <key>UISupportedInterfaceOrientations~ipad</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortraitUpsideDown</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> </array> </dict> </plist>
{ "pile_set_name": "Github" }
/* LUFA Library Copyright (C) Dean Camera, 2010. dean [at] fourwalledcubicle [dot] com www.fourwalledcubicle.com */ /* Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that the copyright notice and this permission notice and warranty disclaimer appear in supporting documentation, and that the name of the author not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaim all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall the author be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software. */ /** \file * \brief Board specific LED driver header for the XPLAIN. * * Board specific LED driver header for the XPLAIN. * * \note This file should not be included directly. It is automatically included as needed by the LEDs driver * dispatch header located in LUFA/Drivers/Board/LEDs.h. */ /** \ingroup Group_LEDs * @defgroup Group_LEDs_XPLAIN XPLAIN * * Board specific LED driver header for the XPLAIN. * * \note This file should not be included directly. It is automatically included as needed by the LEDs driver * dispatch header located in LUFA/Drivers/Board/LEDs.h. * * @{ */ #ifndef __LEDS_XPLAIN_H__ #define __LEDS_XPLAIN_H__ /* Includes: */ #include <avr/io.h> #include "../../../Common/Common.h" /* Enable C linkage for C++ Compilers: */ #if defined(__cplusplus) extern "C" { #endif /* Preprocessor Checks: */ #if !defined(__INCLUDE_FROM_LEDS_H) #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. #endif /* Public Interface - May be used in end-application: */ /* Macros: */ /** LED mask for the first LED on the board. */ #define LEDS_LED1 (1 << 6) /** LED mask for all the LEDs on the board. */ #define LEDS_ALL_LEDS LEDS_LED1 /** LED mask for the none of the board LEDs. */ #define LEDS_NO_LEDS 0 /* Inline Functions: */ #if !defined(__DOXYGEN__) static inline void LEDs_Init(void) { DDRB |= LEDS_ALL_LEDS; PORTB |= LEDS_ALL_LEDS; } static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) { PORTB &= ~LEDMask; } static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask) { PORTB |= LEDMask; } static inline void LEDs_SetAllLEDs(const uint8_t LEDMask) { PORTB = ((PORTB | LEDS_ALL_LEDS) & ~LEDMask); } static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, const uint8_t ActiveMask) { PORTB = ((PORTB | (LEDMask & LEDS_ALL_LEDS)) & (~ActiveMask & LEDS_ALL_LEDS)); } static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) { PORTD = (PORTB ^ (LEDMask & LEDS_ALL_LEDS)); } static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; static inline uint8_t LEDs_GetLEDs(void) { return (~PORTB & LEDS_ALL_LEDS); } #endif /* Disable C linkage for C++ Compilers: */ #if defined(__cplusplus) } #endif #endif /** @} */
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <project xmlns="http://www.netbeans.org/ns/project/1"> <type>org.netbeans.modules.apisupport.project</type> <configuration> <data xmlns="http://www.netbeans.org/ns/nb-module-project/3"> <code-name-base>org.netbeans.modules.netbinox</code-name-base> <module-dependencies> <dependency> <code-name-base>org.netbeans.core.netigso</code-name-base> <build-prerequisite/> <compile-dependency/> <run-dependency> <specification-version>1.14</specification-version> </run-dependency> </dependency> <dependency> <code-name-base>org.netbeans.libs.osgi</code-name-base> <build-prerequisite/> <compile-dependency/> <run-dependency> <specification-version>1.0</specification-version> </run-dependency> </dependency> <dependency> <code-name-base>org.openide.modules</code-name-base> <build-prerequisite/> <compile-dependency/> <run-dependency> <specification-version>7.11</specification-version> </run-dependency> </dependency> <dependency> <code-name-base>org.openide.util.ui</code-name-base> <build-prerequisite/> <compile-dependency/> <run-dependency> <specification-version>9.3</specification-version> </run-dependency> </dependency> <dependency> <code-name-base>org.openide.util</code-name-base> <build-prerequisite/> <compile-dependency/> <run-dependency> <specification-version>9.3</specification-version> </run-dependency> </dependency> <dependency> <code-name-base>org.openide.util.lookup</code-name-base> <build-prerequisite/> <compile-dependency/> <run-dependency> <specification-version>8.0.0.1</specification-version> </run-dependency> </dependency> </module-dependencies> <test-dependencies> <test-type> <name>unit</name> <test-dependency> <code-name-base>org.netbeans.core.netigso</code-name-base> <recursive/> <compile-dependency/> <test/> </test-dependency> <test-dependency> <code-name-base>org.netbeans.libs.junit4</code-name-base> <compile-dependency/> </test-dependency> <test-dependency> <code-name-base>org.netbeans.modules.nbjunit</code-name-base> <recursive/> <compile-dependency/> </test-dependency> </test-type> </test-dependencies> <public-packages> <package>org.eclipse.core.runtime.adaptor</package> <package>org.eclipse.osgi.baseadaptor</package> <package>org.eclipse.osgi.baseadaptor.bundlefile</package> <package>org.eclipse.osgi.baseadaptor.hooks</package> <package>org.eclipse.osgi.baseadaptor.loader</package> <package>org.eclipse.osgi.event</package> <package>org.eclipse.osgi.framework.adaptor</package> <package>org.eclipse.osgi.framework.console</package> <package>org.eclipse.osgi.framework.debug</package> <package>org.eclipse.osgi.framework.eventmgr</package> <package>org.eclipse.osgi.framework.log</package> <package>org.eclipse.osgi.framework.util</package> <package>org.eclipse.osgi.service.datalocation</package> <package>org.eclipse.osgi.service.debug</package> <package>org.eclipse.osgi.service.environment</package> <package>org.eclipse.osgi.service.internal.composite</package> <package>org.eclipse.osgi.service.localization</package> <package>org.eclipse.osgi.service.pluginconversion</package> <package>org.eclipse.osgi.service.resolver</package> <package>org.eclipse.osgi.service.runnable</package> <package>org.eclipse.osgi.service.security</package> <package>org.eclipse.osgi.service.urlconversion</package> <package>org.eclipse.osgi.signedcontent</package> <package>org.eclipse.osgi.storagemanager</package> <package>org.eclipse.osgi.util</package> </public-packages> <class-path-extension> <runtime-relative-path>ext/org.eclipse.osgi_3.9.1.nb9.jar</runtime-relative-path> <binary-origin>external/org.eclipse.osgi_3.9.1.nb9.jar</binary-origin> </class-path-extension> </data> </configuration> </project>
{ "pile_set_name": "Github" }
package tools; /** * This class represents a vector, or a position, in the map. * PTSP-Competition * Created by Diego Perez, University of Essex. * Date: 19/12/11 */ public class Vector2d { /** * X-coordinate of the vector. */ public double x; /** * Y-coordinate of the vector. */ public double y; /** * Default constructor. */ public Vector2d() { this(0, 0); } /** * Checks if a vector and this are the same. * @param o the other vector to check * @return true if their coordinates are the same. */ @Override public boolean equals(Object o) { if (o instanceof Vector2d) { Vector2d v = (Vector2d) o; return x == v.x && y == v.y; } else { return false; } } /** * Builds a vector from its coordinates. * @param x x coordinate * @param y y coordinate */ public Vector2d(double x, double y) { this.x = x; this.y = y; } /** * Builds a vector from another vector. * @param v Vector to copy from. */ public Vector2d(Vector2d v) { this.x = v.x; this.y = v.y; } /** * Creates a copy of this vector * @return a copy of this vector */ public Vector2d copy() { return new Vector2d(x,y); } /** * Sets this vector's coordinates to the coordinates of another vector. * @param v that other vector. */ public void set(Vector2d v) { this.x = v.x; this.y = v.y; } /** * Sets this vector's coordinates to the coordinates given. * @param x x coordinate. * @param y y coordinate. */ public void set(double x, double y) { this.x = x; this.y = y; } /** * Sets the vector's coordinates to (0,0) */ public void zero() { x = 0.0; y = 0.0; } /** * Returns a representative String of this vector. * @return a representative String of this vector. */ @Override public String toString() { return x + " : " + y; } /** * Adds another vector to this. * @param v vector to add. * @return this, after the addition. */ public Vector2d add(Vector2d v) { this.x += v.x; this.y += v.y; return this; } /** * Adds to this vector two coordinates * @param x x coordinate * @param y y coordinate * @return returns this, after the addition. */ public Vector2d add(double x, double y) { this.x += x; this.y += y; return this; } /** * Adds to this vector another vector, scaled it by a factor.. * @param v Vector to add, to be scaled by w * @param w Scale of v. * @return this vector, after the addition. */ public Vector2d add(Vector2d v, double w) { // weighted addition this.x += w * v.x; this.y += w * v.y; return this; } /** * Performs a wrap operation over this vector. * @param w width * @param h height * @return This vector, after the wrap. */ public Vector2d wrap(double w, double h) { // w = 2 * w; // h = 2 * h; x = (x + w) % w; y = (y + h) % h; return this; } /** * Subtracts another vector from this. * @param v vector to subtract. * @return this, after the subtraction. */ public Vector2d subtract(Vector2d v) { this.x -= v.x; this.y -= v.y; return this; } /** * Subtracts two coordinates to this vector. * @param x x coordinate * @param y y coordinate * @return returns this, after the subtraction. */ public Vector2d subtract(double x, double y) { this.x -= x; this.y -= y; return this; } /** * Multiplies this vector by a factor. * @param fac factor to multiply this vector by. * @return This vector, after the operation. */ public Vector2d mul(double fac) { x *= fac; y *= fac; return this; } /** * Rotates the vector an angle given, in radians. * @param theta angle given, in radians */ public void rotate(double theta) { // rotate this vector by the angle made to the horizontal by this line // theta is in radians double cosTheta = Math.cos(theta); double sinTheta = Math.sin(theta); double nx = x * cosTheta - y * sinTheta; double ny = x * sinTheta + y * cosTheta; x = nx; y = ny; } /** * Calculates the scalar product of this vector and the one passed by parameter * @param v vector to do the scalar product with. * @return the value of the scalar product. */ public double scalarProduct(Vector2d v) { return x * v.x + y * v.y; } /** * Gets the square value of the parameter passed. * @param x parameter * @return x * x */ public static double sqr(double x) { return x * x; } /** * Returns the square distance from this vector to the one in the arguments. * @param v the other vector, to calculate the distance to. * @return the square distance, in pixels, between this vector and v. */ public double sqDist(Vector2d v) { return sqr(x - v.x) + sqr(y - v.y); } /** * Gets the magnitude of the vector. * @return the magnitude of the vector (Math.sqrt(sqr(x) + sqr(y))) */ public double mag() { return Math.sqrt(sqr(x) + sqr(y)); } /** * Returns the distance from this vector to the one in the arguments. * @param v the other vector, to calculate the distance to. * @return the distance, in pixels, between this vector and v. */ public double dist(Vector2d v) { return Math.sqrt(sqDist(v)); } /** * Returns the distance from this vector to a pair of coordinates. * @param xx x coordinate * @param yy y coordinate * @return the distance, in pixels, between this vector and the pair of coordinates. */ public double dist(double xx, double yy) { return Math.sqrt(sqr(x - xx) + sqr(y - yy)); } /** * Returns the atan2 of this vector. * @return the atan2 of this vector. */ public double theta() { return Math.atan2(y, x); } /** * Normalises this vector. */ public void normalise() { double mag = mag(); if(mag == 0) { x = y = 0; }else{ x /= mag; y /= mag; } } /** * Calculates the dot product between this vector and the one passed by parameter. * @param v the other vector. * @return the dot product between these two vectors. */ public double dot(Vector2d v) { double tot = this.x * v.x + this.y * v.y; return tot; } public Vector2d unitVector() { double l = this.mag(); if(l > 0) { return new Vector2d(this.x/l,this.y/l); } else return new Vector2d(1,0); } }
{ "pile_set_name": "Github" }
/** * @file lv_tutorial_keyboard_simkpad.c * */ /* * ------------------------------------------- * Learn how to use a keyboard/keypad device * ------------------------------------------- * * You need two things to use keypad/keyboard: * * INPUT DEVICE DRIVER * - Similarly to touchpad you need to register an 'lv_indev_drv_t' driver * - For control keys you should use LV_KEY_... from lv_group.h (e.g. LV_KEY_NEXT) * - * * * OBJECT GROUP * - You can iterate through objects in a group (like using 'tab' on PC) and adjust/modify them * - Firstly you need to create an object group: `lv_group_t *g = lv_group_create();` * - And add objects to it: `lv_group_add_obj(g, btn1);` * - Then you can send data to the object in focus: lv_group_send_data(g, 'a'); * lv_group_send_data(g, LV_GROUP_UP); * - Or focus on the next/prev. object: lv_group_focus_next(g); * */ /********************* * INCLUDES *********************/ #include "lv_tutorial_keyboard.h" #if LV_USE_TUTORIALS && LV_USE_GROUP /********************* * DEFINES *********************/ /********************** * TYPEDEFS **********************/ /********************** * STATIC PROTOTYPES **********************/ static void gui_create(void); static void kaypad_create(void); static bool emulated_keypad_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data); static void mbox_event_cb(lv_obj_t * mbox, lv_event_t event); static void keypad_event_cb(lv_obj_t * btn, lv_event_t event); static void message_btn_event_cb(lv_obj_t * btn, lv_event_t event); /********************** * STATIC VARIABLES **********************/ static lv_obj_t * btn_enable; /*An enable button*/ static lv_style_t style_mbox_bg; /*Black bg. style with opacity*/ static lv_group_t * g; /*An Object Group*/ static lv_indev_t * emulated_kp_indev; /*The input device of the emulated keypad*/ static lv_indev_state_t last_state = LV_INDEV_STATE_REL; static uint32_t last_key = 0; /********************** * MACROS **********************/ /********************** * GLOBAL FUNCTIONS **********************/ /** * Create a simple GUI to demonstrate encoder control capability * kp_indev optinonally pass a keypad input device to control the object (NULL if unused) */ void lv_tutorial_keyboard(lv_indev_t * kp_indev) { /*Register the emulated keyboard*/ lv_indev_drv_t kp_drv; lv_indev_drv_init(&kp_drv); kp_drv.type = LV_INDEV_TYPE_KEYPAD; kp_drv.read_cb = emulated_keypad_read; emulated_kp_indev = lv_indev_drv_register(&kp_drv); /*Create an object group*/ g = lv_group_create(); /*Assig the input device(s) to the created group*/ lv_indev_set_group(emulated_kp_indev, g); if(kp_indev) lv_indev_set_group(kp_indev, g); /*Create a demo GUI*/ gui_create(); /*Create virtual encoder*/ kaypad_create(); } /********************** * STATIC FUNCTIONS **********************/ /** * Create a demo GUI */ static void gui_create(void) { lv_obj_t * scr = lv_disp_get_scr_act(NULL); /*Get the current screen*/ /*Create a drop down list*/ lv_obj_t * ddlist = lv_ddlist_create(scr, NULL); lv_ddlist_set_options(ddlist, "Low\nMedium\nHigh"); lv_obj_set_pos(ddlist, LV_DPI / 4, LV_DPI / 4); lv_group_add_obj(g, ddlist); /*Add the object to the group*/ /*Create a holder and check boxes on it*/ lv_obj_t * holder = lv_cont_create(scr, NULL); /*Create a transparent holder*/ lv_cont_set_fit(holder, LV_FIT_TIGHT); lv_cont_set_layout(holder, LV_LAYOUT_COL_L); lv_obj_set_style(holder, &lv_style_transp); lv_obj_align(holder, ddlist, LV_ALIGN_OUT_RIGHT_TOP, LV_DPI / 4, 0); lv_obj_t * cb = lv_cb_create(holder, NULL); /*First check box*/ lv_cb_set_text(cb, "Red"); lv_group_add_obj(g, cb); /*Add to the group*/ cb = lv_cb_create(holder, cb); /*Copy the first check box. Automatically added to the same group*/ lv_cb_set_text(cb, "Green"); cb = lv_cb_create(holder, cb); /*Copy the second check box. Automatically added to the same group*/ lv_cb_set_text(cb, "Blue"); /*Create a sliders*/ lv_obj_t * slider = lv_slider_create(scr, NULL); lv_obj_set_size(slider, LV_DPI, LV_DPI / 3); lv_obj_align(slider, holder, LV_ALIGN_OUT_RIGHT_TOP, LV_DPI / 4, 0); lv_bar_set_range(slider, 0, 20); lv_group_add_obj(g, slider); /*Add to the group*/ /*Create a button*/ btn_enable = lv_btn_create(scr, NULL); lv_obj_set_event_cb(btn_enable, message_btn_event_cb); lv_btn_set_fit(btn_enable, LV_FIT_TIGHT); lv_group_add_obj(g, btn_enable); /*Add to the group*/ lv_obj_t * l = lv_label_create(btn_enable, NULL); lv_label_set_text(l, "Message"); lv_obj_align(btn_enable, slider, LV_ALIGN_OUT_BOTTOM_MID, 0, LV_DPI / 2); /* Create a dark plain style for a message box's background (modal)*/ lv_style_copy(&style_mbox_bg, &lv_style_plain); style_mbox_bg.body.main_color = LV_COLOR_BLACK; style_mbox_bg.body.grad_color = LV_COLOR_BLACK; style_mbox_bg.body.opa = LV_OPA_50; } /** * Create virtual keypad using 4 buttons: * - Next: focus on the next object in the group * - Increment: increment the object value * - Decrement: decrement the object value * - Enter: Select something */ static void kaypad_create(void) { lv_obj_t * scr = lv_disp_get_scr_act(NULL); /*Get the current screen*/ /*Next button*/ lv_obj_t * btn_next = lv_btn_create(scr, NULL); lv_obj_set_event_cb(btn_next, keypad_event_cb); lv_btn_set_fit(btn_next, LV_FIT_TIGHT); lv_obj_t * l = lv_label_create(btn_next, NULL); lv_label_set_text(l, "Next"); lv_obj_align(btn_next, NULL, LV_ALIGN_IN_BOTTOM_LEFT, LV_DPI / 4, - LV_DPI / 4); /*Increment button*/ lv_obj_t * btn_inc = lv_btn_create(scr, btn_next); l = lv_label_create(btn_inc, NULL); lv_label_set_text(l, "Dec"); lv_obj_align(btn_inc, btn_next, LV_ALIGN_OUT_RIGHT_MID, LV_DPI / 4, 0); /*Decrement button*/ lv_obj_t * btn_dec = lv_btn_create(scr, btn_next); l = lv_label_create(btn_dec, NULL); lv_label_set_text(l, "Inc"); lv_obj_align(btn_dec, btn_inc, LV_ALIGN_OUT_RIGHT_MID, LV_DPI / 4, 0); /*Enter button*/ lv_obj_t * btn_enter = lv_btn_create(scr, btn_next); l = lv_label_create(btn_enter, NULL); lv_label_set_text(l, "Enter"); lv_obj_align(btn_enter, btn_dec, LV_ALIGN_OUT_RIGHT_MID, LV_DPI / 4, 0); } static bool emulated_keypad_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data) { (void)indev_drv; /*Unused*/ data->key = last_key; data->state = last_state; return false; } /** * Called when the Enable button is released. Show a message box to really enable or not? * @param btn pointer to the Enable button * @param indev_proc pointer to the caller display input or NULL if the encoder used * @return LV_RES_OK: because the button is not deleted */ static void message_btn_event_cb(lv_obj_t * btn, lv_event_t event) { if(event != LV_EVENT_RELEASED) return; /*We only care only with the release event*/ /*If the butto nsi released the show message box to be sure about the Enable*/ if(lv_btn_get_state(btn) == LV_BTN_STATE_REL) { /* Create a dark screen sized bg. with opacity to show * the other objects are not available now*/ lv_obj_set_style(lv_disp_get_layer_top(NULL), &style_mbox_bg); lv_obj_set_click(lv_disp_get_layer_top(NULL), false); /*It should be `true` but it'd block the emulated keyboard too*/ /*Create a message box*/ lv_obj_t * mbox = lv_mbox_create(lv_disp_get_layer_top(NULL), NULL); lv_mbox_set_text(mbox, "Turn on something?"); lv_obj_set_event_cb(mbox, mbox_event_cb); lv_group_add_obj(g, mbox); /*Add to he group*/ /*Add two buttons*/ static const char * btns[] = {"Yes", "No", ""}; lv_mbox_add_btns(mbox, btns); lv_obj_align(mbox, NULL, LV_ALIGN_CENTER, 0, - LV_DPI / 2); /*Focus on the new message box, can freeze focus on it*/ lv_group_focus_obj(mbox); lv_group_focus_freeze(g, true); } /*Just disable without message*/ else { lv_btn_set_state(btn_enable, LV_BTN_STATE_REL); } } /** * Called when a message box button is clicked * @param mbox pointer to message box * @param event event type */ static void mbox_event_cb(lv_obj_t * mbox, lv_event_t event) { if(event != LV_EVENT_CLICKED) return; const char * btn_txt = lv_mbox_get_active_btn_text(mbox); if(btn_txt) { lv_group_focus_freeze(g, false); /*Release the freeze*/ /*Revert the top layer to not block*/ lv_obj_set_style(lv_disp_get_layer_top(NULL), &lv_style_transp); lv_obj_set_click(lv_disp_get_layer_top(NULL), false); /*Mark the enabled state by toggling the button*/ if(strcmp(btn_txt, "No") == 0) lv_btn_set_state(btn_enable, LV_BTN_STATE_REL); else if(strcmp(btn_txt, "Yes") == 0) lv_btn_set_state(btn_enable, LV_BTN_STATE_TGL_REL); lv_obj_del(mbox); } } /** * Called the handle the emulated keys' events * @param btn pointer to the button * @return LV_RES_OK: because the button is not deleted */ static void keypad_event_cb(lv_obj_t * btn, lv_event_t event) { if(event == LV_EVENT_PRESSED) { lv_obj_t * label = lv_obj_get_child(btn, NULL); const char * txt = lv_label_get_text(label); if(strcmp(txt, "Next") == 0) last_key = LV_KEY_NEXT; else if (strcmp(txt, "Inc") == 0) last_key = LV_KEY_UP; else if (strcmp(txt, "Dec") == 0) last_key = LV_KEY_DOWN; else if (strcmp(txt, "Enter") == 0) last_key = LV_KEY_ENTER; else last_key = 0; last_state = LV_INDEV_STATE_PR; /*Save the state*/ } else if(event == LV_EVENT_RELEASED || event == LV_EVENT_PRESS_LOST) { last_state = LV_INDEV_STATE_REL; } } #endif /*LV_USE_TUTORIALS*/
{ "pile_set_name": "Github" }
.class public abstract Landroid/view/LayoutInflater; .super Ljava/lang/Object; .source "LayoutInflater.java" # annotations .annotation system Ldalvik/annotation/MemberClasses; value = { Landroid/view/LayoutInflater$FactoryMerger;, Landroid/view/LayoutInflater$Factory;, Landroid/view/LayoutInflater$Filter; } .end annotation # static fields .field private static final TAG_INCLUDE:Ljava/lang/String; = "include" .field private static final TAG_MERGE:Ljava/lang/String; = "merge" .field private static final TAG_REQUEST_FOCUS:Ljava/lang/String; = "requestFocus" .field private static final mConstructorSignature:[Ljava/lang/Class; .field private static final sConstructorMap:Ljava/util/HashMap; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/HashMap", "<", "Ljava/lang/String;", "Ljava/lang/reflect/Constructor;", ">;" } .end annotation .end field # instance fields .field private final DEBUG:Z .field private final mConstructorArgs:[Ljava/lang/Object; .field protected final mContext:Landroid/content/Context; .field private mFactory:Landroid/view/LayoutInflater$Factory; .field private mFactorySet:Z .field private mFilter:Landroid/view/LayoutInflater$Filter; .field private mFilterMap:Ljava/util/HashMap; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/HashMap", "<", "Ljava/lang/String;", "Ljava/lang/Boolean;", ">;" } .end annotation .end field # direct methods .method static constructor <clinit>()V .locals 3 .prologue const/4 v0, 0x2 new-array v0, v0, [Ljava/lang/Class; const/4 v1, 0x0 const-class v2, Landroid/content/Context; aput-object v2, v0, v1 const/4 v1, 0x1 const-class v2, Landroid/util/AttributeSet; aput-object v2, v0, v1 sput-object v0, Landroid/view/LayoutInflater;->mConstructorSignature:[Ljava/lang/Class; new-instance v0, Ljava/util/HashMap; invoke-direct {v0}, Ljava/util/HashMap;-><init>()V sput-object v0, Landroid/view/LayoutInflater;->sConstructorMap:Ljava/util/HashMap; return-void .end method .method protected constructor <init>(Landroid/content/Context;)V .locals 1 .parameter "context" .prologue invoke-direct {p0}, Ljava/lang/Object;-><init>()V const/4 v0, 0x0 iput-boolean v0, p0, Landroid/view/LayoutInflater;->DEBUG:Z const/4 v0, 0x2 new-array v0, v0, [Ljava/lang/Object; iput-object v0, p0, Landroid/view/LayoutInflater;->mConstructorArgs:[Ljava/lang/Object; iput-object p1, p0, Landroid/view/LayoutInflater;->mContext:Landroid/content/Context; return-void .end method .method protected constructor <init>(Landroid/view/LayoutInflater;Landroid/content/Context;)V .locals 1 .parameter "original" .parameter "newContext" .prologue invoke-direct {p0}, Ljava/lang/Object;-><init>()V const/4 v0, 0x0 iput-boolean v0, p0, Landroid/view/LayoutInflater;->DEBUG:Z const/4 v0, 0x2 new-array v0, v0, [Ljava/lang/Object; iput-object v0, p0, Landroid/view/LayoutInflater;->mConstructorArgs:[Ljava/lang/Object; iput-object p2, p0, Landroid/view/LayoutInflater;->mContext:Landroid/content/Context; iget-object v0, p1, Landroid/view/LayoutInflater;->mFactory:Landroid/view/LayoutInflater$Factory; iput-object v0, p0, Landroid/view/LayoutInflater;->mFactory:Landroid/view/LayoutInflater$Factory; iget-object v0, p1, Landroid/view/LayoutInflater;->mFilter:Landroid/view/LayoutInflater$Filter; iput-object v0, p0, Landroid/view/LayoutInflater;->mFilter:Landroid/view/LayoutInflater$Filter; return-void .end method .method private failNotAllowed(Ljava/lang/String;Ljava/lang/String;Landroid/util/AttributeSet;)V .locals 3 .parameter "name" .parameter "prefix" .parameter "attrs" .prologue new-instance v0, Landroid/view/InflateException; new-instance v1, Ljava/lang/StringBuilder; invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V invoke-interface {p3}, Landroid/util/AttributeSet;->getPositionDescription()Ljava/lang/String; move-result-object v2 invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v1 const-string v2, ": Class not allowed to be inflated " invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v1 if-eqz p2, :cond_0 new-instance v2, Ljava/lang/StringBuilder; invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V invoke-virtual {v2, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v2 invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v2 invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v2 :goto_0 invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v1 invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v1 invoke-direct {v0, v1}, Landroid/view/InflateException;-><init>(Ljava/lang/String;)V .local v0, ie:Landroid/view/InflateException; throw v0 .end local v0 #ie:Landroid/view/InflateException; :cond_0 move-object v2, p1 goto :goto_0 .end method .method public static from(Landroid/content/Context;)Landroid/view/LayoutInflater; .locals 3 .parameter "context" .prologue const-string v1, "layout_inflater" invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object; move-result-object v0 check-cast v0, Landroid/view/LayoutInflater; .local v0, LayoutInflater:Landroid/view/LayoutInflater; if-nez v0, :cond_0 new-instance v1, Ljava/lang/AssertionError; const-string v2, "LayoutInflater not found." invoke-direct {v1, v2}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V throw v1 :cond_0 return-object v0 .end method .method private parseInclude(Lorg/xmlpull/v1/XmlPullParser;Landroid/view/View;Landroid/util/AttributeSet;)V .locals 23 .parameter "parser" .parameter "parent" .parameter "attrs" .annotation system Ldalvik/annotation/Throws; value = { Lorg/xmlpull/v1/XmlPullParserException;, Ljava/io/IOException; } .end annotation .prologue move-object/from16 v0, p2 instance-of v0, v0, Landroid/view/ViewGroup; move/from16 v19, v0 if-eqz v19, :cond_c const/16 v19, 0x0 const-string v20, "layout" const/16 v21, 0x0 move-object/from16 v0, p3 move-object/from16 v1, v19 move-object/from16 v2, v20 move/from16 v3, v21 invoke-interface {v0, v1, v2, v3}, Landroid/util/AttributeSet;->getAttributeResourceValue(Ljava/lang/String;Ljava/lang/String;I)I move-result v13 .local v13, layout:I if-nez v13, :cond_1 const/16 v19, 0x0 const-string v20, "layout" move-object/from16 v0, p3 move-object/from16 v1, v19 move-object/from16 v2, v20 invoke-interface {v0, v1, v2}, Landroid/util/AttributeSet;->getAttributeValue(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; move-result-object v16 .local v16, value:Ljava/lang/String; if-nez v16, :cond_0 new-instance v19, Landroid/view/InflateException; const-string v20, "You must specifiy a layout in the include tag: <include layout=\"@layout/layoutID\" />" invoke-direct/range {v19 .. v20}, Landroid/view/InflateException;-><init>(Ljava/lang/String;)V throw v19 :cond_0 new-instance v19, Landroid/view/InflateException; new-instance v20, Ljava/lang/StringBuilder; invoke-direct/range {v20 .. v20}, Ljava/lang/StringBuilder;-><init>()V const-string v21, "You must specifiy a valid layout reference. The layout ID " invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v20 move-object/from16 v0, v20 move-object/from16 v1, v16 invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v20 const-string v21, " is not valid." invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v20 invoke-virtual/range {v20 .. v20}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v20 invoke-direct/range {v19 .. v20}, Landroid/view/InflateException;-><init>(Ljava/lang/String;)V throw v19 .end local v16 #value:Ljava/lang/String; :cond_1 invoke-virtual/range {p0 .. p0}, Landroid/view/LayoutInflater;->getContext()Landroid/content/Context; move-result-object v19 invoke-virtual/range {v19 .. v19}, Landroid/content/Context;->getResources()Landroid/content/res/Resources; move-result-object v19 move-object/from16 v0, v19 move v1, v13 invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getLayout(I)Landroid/content/res/XmlResourceParser; move-result-object v8 .local v8, childParser:Landroid/content/res/XmlResourceParser; :try_start_0 invoke-static {v8}, Landroid/util/Xml;->asAttributeSet(Lorg/xmlpull/v1/XmlPullParser;)Landroid/util/AttributeSet; move-result-object v6 .local v6, childAttrs:Landroid/util/AttributeSet; :cond_2 invoke-interface {v8}, Landroid/content/res/XmlResourceParser;->next()I move-result v15 .local v15, type:I const/16 v19, 0x2 move v0, v15 move/from16 v1, v19 if-eq v0, v1, :cond_3 const/16 v19, 0x1 move v0, v15 move/from16 v1, v19 if-ne v0, v1, :cond_2 :cond_3 const/16 v19, 0x2 move v0, v15 move/from16 v1, v19 if-eq v0, v1, :cond_4 new-instance v19, Landroid/view/InflateException; new-instance v20, Ljava/lang/StringBuilder; invoke-direct/range {v20 .. v20}, Ljava/lang/StringBuilder;-><init>()V invoke-interface {v8}, Landroid/content/res/XmlResourceParser;->getPositionDescription()Ljava/lang/String; move-result-object v21 invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v20 const-string v21, ": No start tag found!" invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v20 invoke-virtual/range {v20 .. v20}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v20 invoke-direct/range {v19 .. v20}, Landroid/view/InflateException;-><init>(Ljava/lang/String;)V throw v19 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 .end local v6 #childAttrs:Landroid/util/AttributeSet; .end local v15 #type:I :catchall_0 move-exception v19 invoke-interface {v8}, Landroid/content/res/XmlResourceParser;->close()V throw v19 .restart local v6 #childAttrs:Landroid/util/AttributeSet; .restart local v15 #type:I :cond_4 :try_start_1 invoke-interface {v8}, Landroid/content/res/XmlResourceParser;->getName()Ljava/lang/String; move-result-object v7 .local v7, childName:Ljava/lang/String; const-string v19, "merge" move-object/from16 v0, v19 move-object v1, v7 invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result v19 if-eqz v19, :cond_8 move-object/from16 v0, p0 move-object v1, v8 move-object/from16 v2, p2 move-object v3, v6 invoke-direct {v0, v1, v2, v3}, Landroid/view/LayoutInflater;->rInflate(Lorg/xmlpull/v1/XmlPullParser;Landroid/view/View;Landroid/util/AttributeSet;)V :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 :goto_0 invoke-interface {v8}, Landroid/content/res/XmlResourceParser;->close()V invoke-interface/range {p1 .. p1}, Lorg/xmlpull/v1/XmlPullParser;->getDepth()I move-result v9 .local v9, currentDepth:I :cond_5 invoke-interface/range {p1 .. p1}, Lorg/xmlpull/v1/XmlPullParser;->next()I move-result v15 const/16 v19, 0x3 move v0, v15 move/from16 v1, v19 if-ne v0, v1, :cond_6 invoke-interface/range {p1 .. p1}, Lorg/xmlpull/v1/XmlPullParser;->getDepth()I move-result v19 move/from16 v0, v19 move v1, v9 if-le v0, v1, :cond_7 :cond_6 const/16 v19, 0x1 move v0, v15 move/from16 v1, v19 if-ne v0, v1, :cond_5 :cond_7 return-void .end local v9 #currentDepth:I :cond_8 :try_start_2 move-object/from16 v0, p0 move-object v1, v7 move-object v2, v6 invoke-virtual {v0, v1, v2}, Landroid/view/LayoutInflater;->createViewFromTag(Ljava/lang/String;Landroid/util/AttributeSet;)Landroid/view/View; move-result-object v17 .local v17, view:Landroid/view/View; move-object/from16 v0, p2 check-cast v0, Landroid/view/ViewGroup; move-object v11, v0 :try_end_2 .catchall {:try_start_2 .. :try_end_2} :catchall_0 .local v11, group:Landroid/view/ViewGroup; const/4 v14, 0x0 .local v14, params:Landroid/view/ViewGroup$LayoutParams; :try_start_3 move-object v0, v11 move-object/from16 v1, p3 invoke-virtual {v0, v1}, Landroid/view/ViewGroup;->generateLayoutParams(Landroid/util/AttributeSet;)Landroid/view/ViewGroup$LayoutParams; :try_end_3 .catchall {:try_start_3 .. :try_end_3} :catchall_1 .catch Ljava/lang/RuntimeException; {:try_start_3 .. :try_end_3} :catch_0 move-result-object v14 if-eqz v14, :cond_9 :try_start_4 move-object/from16 v0, v17 move-object v1, v14 invoke-virtual {v0, v1}, Landroid/view/View;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V :cond_9 :goto_1 move-object/from16 v0, p0 move-object v1, v8 move-object/from16 v2, v17 move-object v3, v6 invoke-direct {v0, v1, v2, v3}, Landroid/view/LayoutInflater;->rInflate(Lorg/xmlpull/v1/XmlPullParser;Landroid/view/View;Landroid/util/AttributeSet;)V move-object/from16 v0, p0 iget-object v0, v0, Landroid/view/LayoutInflater;->mContext:Landroid/content/Context; move-object/from16 v19, v0 sget-object v20, Lcom/android/internal/R$styleable;->View:[I const/16 v21, 0x0 const/16 v22, 0x0 move-object/from16 v0, v19 move-object/from16 v1, p3 move-object/from16 v2, v20 move/from16 v3, v21 move/from16 v4, v22 invoke-virtual {v0, v1, v2, v3, v4}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[III)Landroid/content/res/TypedArray; move-result-object v5 .local v5, a:Landroid/content/res/TypedArray; const/16 v19, 0x8 const/16 v20, -0x1 move-object v0, v5 move/from16 v1, v19 move/from16 v2, v20 invoke-virtual {v0, v1, v2}, Landroid/content/res/TypedArray;->getResourceId(II)I move-result v12 .local v12, id:I const/16 v19, 0x14 const/16 v20, -0x1 move-object v0, v5 move/from16 v1, v19 move/from16 v2, v20 invoke-virtual {v0, v1, v2}, Landroid/content/res/TypedArray;->getInt(II)I move-result v18 .local v18, visibility:I invoke-virtual {v5}, Landroid/content/res/TypedArray;->recycle()V const/16 v19, -0x1 move v0, v12 move/from16 v1, v19 if-eq v0, v1, :cond_a move-object/from16 v0, v17 move v1, v12 invoke-virtual {v0, v1}, Landroid/view/View;->setId(I)V :cond_a packed-switch v18, :pswitch_data_0 :goto_2 move-object v0, v11 move-object/from16 v1, v17 invoke-virtual {v0, v1}, Landroid/view/ViewGroup;->addView(Landroid/view/View;)V :try_end_4 .catchall {:try_start_4 .. :try_end_4} :catchall_0 goto/16 :goto_0 .end local v5 #a:Landroid/content/res/TypedArray; .end local v12 #id:I .end local v18 #visibility:I :catch_0 move-exception v10 .local v10, e:Ljava/lang/RuntimeException; :try_start_5 invoke-virtual {v11, v6}, Landroid/view/ViewGroup;->generateLayoutParams(Landroid/util/AttributeSet;)Landroid/view/ViewGroup$LayoutParams; :try_end_5 .catchall {:try_start_5 .. :try_end_5} :catchall_1 move-result-object v14 if-eqz v14, :cond_9 :try_start_6 move-object/from16 v0, v17 move-object v1, v14 invoke-virtual {v0, v1}, Landroid/view/View;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V goto :goto_1 .end local v10 #e:Ljava/lang/RuntimeException; :catchall_1 move-exception v19 if-eqz v14, :cond_b move-object/from16 v0, v17 move-object v1, v14 invoke-virtual {v0, v1}, Landroid/view/View;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V :cond_b throw v19 .restart local v5 #a:Landroid/content/res/TypedArray; .restart local v12 #id:I .restart local v18 #visibility:I :pswitch_0 const/16 v19, 0x0 move-object/from16 v0, v17 move/from16 v1, v19 invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V goto :goto_2 :pswitch_1 const/16 v19, 0x4 move-object/from16 v0, v17 move/from16 v1, v19 invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V goto :goto_2 :pswitch_2 const/16 v19, 0x8 move-object/from16 v0, v17 move/from16 v1, v19 invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V :try_end_6 .catchall {:try_start_6 .. :try_end_6} :catchall_0 goto :goto_2 .end local v5 #a:Landroid/content/res/TypedArray; .end local v6 #childAttrs:Landroid/util/AttributeSet; .end local v7 #childName:Ljava/lang/String; .end local v8 #childParser:Landroid/content/res/XmlResourceParser; .end local v11 #group:Landroid/view/ViewGroup; .end local v12 #id:I .end local v13 #layout:I .end local v14 #params:Landroid/view/ViewGroup$LayoutParams; .end local v15 #type:I .end local v17 #view:Landroid/view/View; .end local v18 #visibility:I :cond_c new-instance v19, Landroid/view/InflateException; const-string v20, "<include /> can only be used inside of a ViewGroup" invoke-direct/range {v19 .. v20}, Landroid/view/InflateException;-><init>(Ljava/lang/String;)V throw v19 nop :pswitch_data_0 .packed-switch 0x0 :pswitch_0 :pswitch_1 :pswitch_2 .end packed-switch .end method .method private parseRequestFocus(Lorg/xmlpull/v1/XmlPullParser;Landroid/view/View;)V .locals 3 .parameter "parser" .parameter "parent" .annotation system Ldalvik/annotation/Throws; value = { Lorg/xmlpull/v1/XmlPullParserException;, Ljava/io/IOException; } .end annotation .prologue invoke-virtual {p2}, Landroid/view/View;->requestFocus()Z invoke-interface {p1}, Lorg/xmlpull/v1/XmlPullParser;->getDepth()I move-result v0 .local v0, currentDepth:I :cond_0 invoke-interface {p1}, Lorg/xmlpull/v1/XmlPullParser;->next()I move-result v1 .local v1, type:I const/4 v2, 0x3 if-ne v1, v2, :cond_1 invoke-interface {p1}, Lorg/xmlpull/v1/XmlPullParser;->getDepth()I move-result v2 if-le v2, v0, :cond_2 :cond_1 const/4 v2, 0x1 if-ne v1, v2, :cond_0 :cond_2 return-void .end method .method private rInflate(Lorg/xmlpull/v1/XmlPullParser;Landroid/view/View;Landroid/util/AttributeSet;)V .locals 9 .parameter "parser" .parameter "parent" .parameter "attrs" .annotation system Ldalvik/annotation/Throws; value = { Lorg/xmlpull/v1/XmlPullParserException;, Ljava/io/IOException; } .end annotation .prologue invoke-interface {p1}, Lorg/xmlpull/v1/XmlPullParser;->getDepth()I move-result v1 .local v1, depth:I :cond_0 :goto_0 invoke-interface {p1}, Lorg/xmlpull/v1/XmlPullParser;->next()I move-result v4 .local v4, type:I const/4 v7, 0x3 if-ne v4, v7, :cond_1 invoke-interface {p1}, Lorg/xmlpull/v1/XmlPullParser;->getDepth()I move-result v7 if-le v7, v1, :cond_6 :cond_1 const/4 v7, 0x1 if-eq v4, v7, :cond_6 const/4 v7, 0x2 if-ne v4, v7, :cond_0 invoke-interface {p1}, Lorg/xmlpull/v1/XmlPullParser;->getName()Ljava/lang/String; move-result-object v2 .local v2, name:Ljava/lang/String; const-string v7, "requestFocus" invoke-virtual {v7, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result v7 if-eqz v7, :cond_2 invoke-direct {p0, p1, p2}, Landroid/view/LayoutInflater;->parseRequestFocus(Lorg/xmlpull/v1/XmlPullParser;Landroid/view/View;)V goto :goto_0 :cond_2 const-string v7, "include" invoke-virtual {v7, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result v7 if-eqz v7, :cond_4 invoke-interface {p1}, Lorg/xmlpull/v1/XmlPullParser;->getDepth()I move-result v7 if-nez v7, :cond_3 new-instance v7, Landroid/view/InflateException; const-string v8, "<include /> cannot be the root element" invoke-direct {v7, v8}, Landroid/view/InflateException;-><init>(Ljava/lang/String;)V throw v7 :cond_3 invoke-direct {p0, p1, p2, p3}, Landroid/view/LayoutInflater;->parseInclude(Lorg/xmlpull/v1/XmlPullParser;Landroid/view/View;Landroid/util/AttributeSet;)V goto :goto_0 :cond_4 const-string v7, "merge" invoke-virtual {v7, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result v7 if-eqz v7, :cond_5 new-instance v7, Landroid/view/InflateException; const-string v8, "<merge /> must be the root element" invoke-direct {v7, v8}, Landroid/view/InflateException;-><init>(Ljava/lang/String;)V throw v7 :cond_5 invoke-virtual {p0, v2, p3}, Landroid/view/LayoutInflater;->createViewFromTag(Ljava/lang/String;Landroid/util/AttributeSet;)Landroid/view/View; move-result-object v5 .local v5, view:Landroid/view/View; move-object v0, p2 check-cast v0, Landroid/view/ViewGroup; move-object v6, v0 .local v6, viewGroup:Landroid/view/ViewGroup; invoke-virtual {v6, p3}, Landroid/view/ViewGroup;->generateLayoutParams(Landroid/util/AttributeSet;)Landroid/view/ViewGroup$LayoutParams; move-result-object v3 .local v3, params:Landroid/view/ViewGroup$LayoutParams; invoke-direct {p0, p1, v5, p3}, Landroid/view/LayoutInflater;->rInflate(Lorg/xmlpull/v1/XmlPullParser;Landroid/view/View;Landroid/util/AttributeSet;)V invoke-virtual {v6, v5, v3}, Landroid/view/ViewGroup;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V goto :goto_0 .end local v2 #name:Ljava/lang/String; .end local v3 #params:Landroid/view/ViewGroup$LayoutParams; .end local v5 #view:Landroid/view/View; .end local v6 #viewGroup:Landroid/view/ViewGroup; :cond_6 invoke-virtual {p2}, Landroid/view/View;->onFinishInflate()V return-void .end method # virtual methods .method public abstract cloneInContext(Landroid/content/Context;)Landroid/view/LayoutInflater; .end method .method public final createView(Ljava/lang/String;Ljava/lang/String;Landroid/util/AttributeSet;)Landroid/view/View; .locals 11 .parameter "name" .parameter "prefix" .parameter "attrs" .annotation system Ldalvik/annotation/Throws; value = { Ljava/lang/ClassNotFoundException;, Landroid/view/InflateException; } .end annotation .prologue const/4 v9, 0x1 const-string v10, ": Error inflating class " sget-object v7, Landroid/view/LayoutInflater;->sConstructorMap:Ljava/util/HashMap; invoke-virtual {v7, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v4 check-cast v4, Ljava/lang/reflect/Constructor; .local v4, constructor:Ljava/lang/reflect/Constructor; const/4 v3, 0x0 .local v3, clazz:Ljava/lang/Class; if-nez v4, :cond_3 :try_start_0 iget-object v7, p0, Landroid/view/LayoutInflater;->mContext:Landroid/content/Context; invoke-virtual {v7}, Landroid/content/Context;->getClassLoader()Ljava/lang/ClassLoader; move-result-object v7 if-eqz p2, :cond_2 new-instance v8, Ljava/lang/StringBuilder; invoke-direct {v8}, Ljava/lang/StringBuilder;-><init>()V invoke-virtual {v8, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v8 invoke-virtual {v8, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v8 invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v8 :goto_0 invoke-virtual {v7, v8}, Ljava/lang/ClassLoader;->loadClass(Ljava/lang/String;)Ljava/lang/Class; move-result-object v3 iget-object v7, p0, Landroid/view/LayoutInflater;->mFilter:Landroid/view/LayoutInflater$Filter; if-eqz v7, :cond_0 if-eqz v3, :cond_0 iget-object v7, p0, Landroid/view/LayoutInflater;->mFilter:Landroid/view/LayoutInflater$Filter; invoke-interface {v7, v3}, Landroid/view/LayoutInflater$Filter;->onLoadClass(Ljava/lang/Class;)Z move-result v0 .local v0, allowed:Z if-nez v0, :cond_0 invoke-direct {p0, p1, p2, p3}, Landroid/view/LayoutInflater;->failNotAllowed(Ljava/lang/String;Ljava/lang/String;Landroid/util/AttributeSet;)V .end local v0 #allowed:Z :cond_0 sget-object v7, Landroid/view/LayoutInflater;->mConstructorSignature:[Ljava/lang/Class; invoke-virtual {v3, v7}, Ljava/lang/Class;->getConstructor([Ljava/lang/Class;)Ljava/lang/reflect/Constructor; move-result-object v4 sget-object v7, Landroid/view/LayoutInflater;->sConstructorMap:Ljava/util/HashMap; invoke-virtual {v7, p1, v4}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; :cond_1 :goto_1 iget-object v2, p0, Landroid/view/LayoutInflater;->mConstructorArgs:[Ljava/lang/Object; .local v2, args:[Ljava/lang/Object; const/4 v7, 0x1 aput-object p3, v2, v7 invoke-virtual {v4, v2}, Ljava/lang/reflect/Constructor;->newInstance([Ljava/lang/Object;)Ljava/lang/Object; move-result-object p0 .end local p0 check-cast p0, Landroid/view/View; return-object p0 .end local v2 #args:[Ljava/lang/Object; .restart local p0 :cond_2 move-object v8, p1 goto :goto_0 :cond_3 iget-object v7, p0, Landroid/view/LayoutInflater;->mFilter:Landroid/view/LayoutInflater$Filter; if-eqz v7, :cond_1 iget-object v7, p0, Landroid/view/LayoutInflater;->mFilterMap:Ljava/util/HashMap; invoke-virtual {v7, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v1 check-cast v1, Ljava/lang/Boolean; .local v1, allowedState:Ljava/lang/Boolean; if-nez v1, :cond_6 iget-object v7, p0, Landroid/view/LayoutInflater;->mContext:Landroid/content/Context; invoke-virtual {v7}, Landroid/content/Context;->getClassLoader()Ljava/lang/ClassLoader; move-result-object v7 if-eqz p2, :cond_4 new-instance v8, Ljava/lang/StringBuilder; invoke-direct {v8}, Ljava/lang/StringBuilder;-><init>()V invoke-virtual {v8, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v8 invoke-virtual {v8, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v8 invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v8 :goto_2 invoke-virtual {v7, v8}, Ljava/lang/ClassLoader;->loadClass(Ljava/lang/String;)Ljava/lang/Class; move-result-object v3 if-eqz v3, :cond_5 iget-object v7, p0, Landroid/view/LayoutInflater;->mFilter:Landroid/view/LayoutInflater$Filter; invoke-interface {v7, v3}, Landroid/view/LayoutInflater$Filter;->onLoadClass(Ljava/lang/Class;)Z move-result v7 if-eqz v7, :cond_5 move v0, v9 .restart local v0 #allowed:Z :goto_3 iget-object v7, p0, Landroid/view/LayoutInflater;->mFilterMap:Ljava/util/HashMap; invoke-static {v0}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean; move-result-object v8 invoke-virtual {v7, p1, v8}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; if-nez v0, :cond_1 invoke-direct {p0, p1, p2, p3}, Landroid/view/LayoutInflater;->failNotAllowed(Ljava/lang/String;Ljava/lang/String;Landroid/util/AttributeSet;)V :try_end_0 .catch Ljava/lang/NoSuchMethodException; {:try_start_0 .. :try_end_0} :catch_0 .catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_1 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_2 goto :goto_1 .end local v0 #allowed:Z .end local v1 #allowedState:Ljava/lang/Boolean; .end local p0 :catch_0 move-exception v7 move-object v5, v7 .local v5, e:Ljava/lang/NoSuchMethodException; new-instance v6, Landroid/view/InflateException; new-instance v7, Ljava/lang/StringBuilder; invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V invoke-interface {p3}, Landroid/util/AttributeSet;->getPositionDescription()Ljava/lang/String; move-result-object v8 invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v7 const-string v8, ": Error inflating class " invoke-virtual {v7, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v7 if-eqz p2, :cond_7 new-instance v8, Ljava/lang/StringBuilder; invoke-direct {v8}, Ljava/lang/StringBuilder;-><init>()V invoke-virtual {v8, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v8 invoke-virtual {v8, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v8 invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v8 :goto_4 invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v7 invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v7 invoke-direct {v6, v7}, Landroid/view/InflateException;-><init>(Ljava/lang/String;)V .local v6, ie:Landroid/view/InflateException; invoke-virtual {v6, v5}, Landroid/view/InflateException;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable; throw v6 .end local v5 #e:Ljava/lang/NoSuchMethodException; .end local v6 #ie:Landroid/view/InflateException; .restart local v1 #allowedState:Ljava/lang/Boolean; .restart local p0 :cond_4 move-object v8, p1 goto :goto_2 :cond_5 const/4 v7, 0x0 move v0, v7 goto :goto_3 :cond_6 :try_start_1 sget-object v7, Ljava/lang/Boolean;->FALSE:Ljava/lang/Boolean; invoke-virtual {v1, v7}, Ljava/lang/Boolean;->equals(Ljava/lang/Object;)Z move-result v7 if-eqz v7, :cond_1 invoke-direct {p0, p1, p2, p3}, Landroid/view/LayoutInflater;->failNotAllowed(Ljava/lang/String;Ljava/lang/String;Landroid/util/AttributeSet;)V :try_end_1 .catch Ljava/lang/NoSuchMethodException; {:try_start_1 .. :try_end_1} :catch_0 .catch Ljava/lang/ClassNotFoundException; {:try_start_1 .. :try_end_1} :catch_1 .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_2 goto/16 :goto_1 .end local v1 #allowedState:Ljava/lang/Boolean; .end local p0 :catch_1 move-exception v7 move-object v5, v7 .local v5, e:Ljava/lang/ClassNotFoundException; throw v5 .local v5, e:Ljava/lang/NoSuchMethodException; :cond_7 move-object v8, p1 goto :goto_4 .end local v5 #e:Ljava/lang/NoSuchMethodException; :catch_2 move-exception v7 move-object v5, v7 .local v5, e:Ljava/lang/Exception; new-instance v6, Landroid/view/InflateException; new-instance v7, Ljava/lang/StringBuilder; invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V invoke-interface {p3}, Landroid/util/AttributeSet;->getPositionDescription()Ljava/lang/String; move-result-object v8 invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v7 const-string v8, ": Error inflating class " invoke-virtual {v7, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v7 if-nez v3, :cond_8 const-string v8, "<unknown>" :goto_5 invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v7 invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v7 invoke-direct {v6, v7}, Landroid/view/InflateException;-><init>(Ljava/lang/String;)V .restart local v6 #ie:Landroid/view/InflateException; invoke-virtual {v6, v5}, Landroid/view/InflateException;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable; throw v6 .end local v6 #ie:Landroid/view/InflateException; :cond_8 invoke-virtual {v3}, Ljava/lang/Class;->getName()Ljava/lang/String; move-result-object v8 goto :goto_5 .end method .method createViewFromTag(Ljava/lang/String;Landroid/util/AttributeSet;)Landroid/view/View; .locals 6 .parameter "name" .parameter "attrs" .prologue const/4 v4, 0x0 const-string v5, ": Error inflating class " const-string v3, "view" invoke-virtual {p1, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result v3 if-eqz v3, :cond_0 const-string v3, "class" invoke-interface {p2, v4, v3}, Landroid/util/AttributeSet;->getAttributeValue(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; move-result-object p1 :cond_0 :try_start_0 iget-object v3, p0, Landroid/view/LayoutInflater;->mFactory:Landroid/view/LayoutInflater$Factory; if-nez v3, :cond_2 move-object v2, v4 .local v2, view:Landroid/view/View; :goto_0 if-nez v2, :cond_1 const/4 v3, -0x1 const/16 v4, 0x2e invoke-virtual {p1, v4}, Ljava/lang/String;->indexOf(I)I move-result v4 if-ne v3, v4, :cond_3 invoke-virtual {p0, p1, p2}, Landroid/view/LayoutInflater;->onCreateView(Ljava/lang/String;Landroid/util/AttributeSet;)Landroid/view/View; move-result-object v2 :cond_1 :goto_1 return-object v2 .end local v2 #view:Landroid/view/View; :cond_2 iget-object v3, p0, Landroid/view/LayoutInflater;->mFactory:Landroid/view/LayoutInflater$Factory; iget-object v4, p0, Landroid/view/LayoutInflater;->mContext:Landroid/content/Context; invoke-interface {v3, p1, v4, p2}, Landroid/view/LayoutInflater$Factory;->onCreateView(Ljava/lang/String;Landroid/content/Context;Landroid/util/AttributeSet;)Landroid/view/View; move-result-object v3 move-object v2, v3 goto :goto_0 .restart local v2 #view:Landroid/view/View; :cond_3 const/4 v3, 0x0 invoke-virtual {p0, p1, v3, p2}, Landroid/view/LayoutInflater;->createView(Ljava/lang/String;Ljava/lang/String;Landroid/util/AttributeSet;)Landroid/view/View; :try_end_0 .catch Landroid/view/InflateException; {:try_start_0 .. :try_end_0} :catch_0 .catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_1 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_2 move-result-object v2 goto :goto_1 .end local v2 #view:Landroid/view/View; :catch_0 move-exception v3 move-object v0, v3 .local v0, e:Landroid/view/InflateException; throw v0 .end local v0 #e:Landroid/view/InflateException; :catch_1 move-exception v3 move-object v0, v3 .local v0, e:Ljava/lang/ClassNotFoundException; new-instance v1, Landroid/view/InflateException; new-instance v3, Ljava/lang/StringBuilder; invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V invoke-interface {p2}, Landroid/util/AttributeSet;->getPositionDescription()Ljava/lang/String; move-result-object v4 invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v3 const-string v4, ": Error inflating class " invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v3 invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v3 invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v3 invoke-direct {v1, v3}, Landroid/view/InflateException;-><init>(Ljava/lang/String;)V .local v1, ie:Landroid/view/InflateException; invoke-virtual {v1, v0}, Landroid/view/InflateException;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable; throw v1 .end local v0 #e:Ljava/lang/ClassNotFoundException; .end local v1 #ie:Landroid/view/InflateException; :catch_2 move-exception v3 move-object v0, v3 .local v0, e:Ljava/lang/Exception; new-instance v1, Landroid/view/InflateException; new-instance v3, Ljava/lang/StringBuilder; invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V invoke-interface {p2}, Landroid/util/AttributeSet;->getPositionDescription()Ljava/lang/String; move-result-object v4 invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v3 const-string v4, ": Error inflating class " invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v3 invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v3 invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v3 invoke-direct {v1, v3}, Landroid/view/InflateException;-><init>(Ljava/lang/String;)V .restart local v1 #ie:Landroid/view/InflateException; invoke-virtual {v1, v0}, Landroid/view/InflateException;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable; throw v1 .end method .method public getContext()Landroid/content/Context; .locals 1 .prologue iget-object v0, p0, Landroid/view/LayoutInflater;->mContext:Landroid/content/Context; return-object v0 .end method .method public final getFactory()Landroid/view/LayoutInflater$Factory; .locals 1 .prologue iget-object v0, p0, Landroid/view/LayoutInflater;->mFactory:Landroid/view/LayoutInflater$Factory; return-object v0 .end method .method public getFilter()Landroid/view/LayoutInflater$Filter; .locals 1 .prologue iget-object v0, p0, Landroid/view/LayoutInflater;->mFilter:Landroid/view/LayoutInflater$Filter; return-object v0 .end method .method public inflate(ILandroid/view/ViewGroup;)Landroid/view/View; .locals 1 .parameter "resource" .parameter "root" .prologue if-eqz p2, :cond_0 const/4 v0, 0x1 :goto_0 invoke-virtual {p0, p1, p2, v0}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View; move-result-object v0 return-object v0 :cond_0 const/4 v0, 0x0 goto :goto_0 .end method .method public inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View; .locals 2 .parameter "resource" .parameter "root" .parameter "attachToRoot" .prologue invoke-virtual {p0}, Landroid/view/LayoutInflater;->getContext()Landroid/content/Context; move-result-object v1 invoke-virtual {v1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources; move-result-object v1 invoke-virtual {v1, p1}, Landroid/content/res/Resources;->getLayout(I)Landroid/content/res/XmlResourceParser; move-result-object v0 .local v0, parser:Landroid/content/res/XmlResourceParser; :try_start_0 invoke-virtual {p0, v0, p2, p3}, Landroid/view/LayoutInflater;->inflate(Lorg/xmlpull/v1/XmlPullParser;Landroid/view/ViewGroup;Z)Landroid/view/View; :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 move-result-object v1 invoke-interface {v0}, Landroid/content/res/XmlResourceParser;->close()V return-object v1 :catchall_0 move-exception v1 invoke-interface {v0}, Landroid/content/res/XmlResourceParser;->close()V throw v1 .end method .method public inflate(Lorg/xmlpull/v1/XmlPullParser;Landroid/view/ViewGroup;)Landroid/view/View; .locals 1 .parameter "parser" .parameter "root" .prologue if-eqz p2, :cond_0 const/4 v0, 0x1 :goto_0 invoke-virtual {p0, p1, p2, v0}, Landroid/view/LayoutInflater;->inflate(Lorg/xmlpull/v1/XmlPullParser;Landroid/view/ViewGroup;Z)Landroid/view/View; move-result-object v0 return-object v0 :cond_0 const/4 v0, 0x0 goto :goto_0 .end method .method public inflate(Lorg/xmlpull/v1/XmlPullParser;Landroid/view/ViewGroup;Z)Landroid/view/View; .locals 18 .parameter "parser" .parameter "root" .parameter "attachToRoot" .prologue move-object/from16 v0, p0 iget-object v0, v0, Landroid/view/LayoutInflater;->mConstructorArgs:[Ljava/lang/Object; move-object v13, v0 monitor-enter v13 :try_start_0 invoke-static/range {p1 .. p1}, Landroid/util/Xml;->asAttributeSet(Lorg/xmlpull/v1/XmlPullParser;)Landroid/util/AttributeSet; move-result-object v4 .local v4, attrs:Landroid/util/AttributeSet; move-object/from16 v0, p0 iget-object v0, v0, Landroid/view/LayoutInflater;->mConstructorArgs:[Ljava/lang/Object; move-object v14, v0 const/4 v15, 0x0 aget-object v7, v14, v15 check-cast v7, Landroid/content/Context; .local v7, lastContext:Landroid/content/Context; move-object/from16 v0, p0 iget-object v0, v0, Landroid/view/LayoutInflater;->mConstructorArgs:[Ljava/lang/Object; move-object v14, v0 const/4 v15, 0x0 move-object/from16 v0, p0 iget-object v0, v0, Landroid/view/LayoutInflater;->mContext:Landroid/content/Context; move-object/from16 v16, v0 aput-object v16, v14, v15 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_1 move-object/from16 v10, p2 .local v10, result:Landroid/view/View; :cond_0 :try_start_1 invoke-interface/range {p1 .. p1}, Lorg/xmlpull/v1/XmlPullParser;->next()I move-result v12 .local v12, type:I const/4 v14, 0x2 if-eq v12, v14, :cond_1 const/4 v14, 0x1 if-ne v12, v14, :cond_0 :cond_1 const/4 v14, 0x2 if-eq v12, v14, :cond_2 new-instance v14, Landroid/view/InflateException; new-instance v15, Ljava/lang/StringBuilder; invoke-direct {v15}, Ljava/lang/StringBuilder;-><init>()V invoke-interface/range {p1 .. p1}, Lorg/xmlpull/v1/XmlPullParser;->getPositionDescription()Ljava/lang/String; move-result-object v16 invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v15 const-string v16, ": No start tag found!" invoke-virtual/range {v15 .. v16}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v15 invoke-virtual {v15}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v15 invoke-direct {v14, v15}, Landroid/view/InflateException;-><init>(Ljava/lang/String;)V throw v14 :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 .catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_1 .. :try_end_1} :catch_0 .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_1 .end local v12 #type:I :catch_0 move-exception v14 move-object v5, v14 .local v5, e:Lorg/xmlpull/v1/XmlPullParserException; :try_start_2 new-instance v6, Landroid/view/InflateException; invoke-virtual {v5}, Lorg/xmlpull/v1/XmlPullParserException;->getMessage()Ljava/lang/String; move-result-object v14 invoke-direct {v6, v14}, Landroid/view/InflateException;-><init>(Ljava/lang/String;)V .local v6, ex:Landroid/view/InflateException; invoke-virtual {v6, v5}, Landroid/view/InflateException;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable; throw v6 :try_end_2 .catchall {:try_start_2 .. :try_end_2} :catchall_0 .end local v5 #e:Lorg/xmlpull/v1/XmlPullParserException; .end local v6 #ex:Landroid/view/InflateException; :catchall_0 move-exception v14 :try_start_3 move-object/from16 v0, p0 iget-object v0, v0, Landroid/view/LayoutInflater;->mConstructorArgs:[Ljava/lang/Object; move-object v15, v0 const/16 v16, 0x0 aput-object v7, v15, v16 move-object/from16 v0, p0 iget-object v0, v0, Landroid/view/LayoutInflater;->mConstructorArgs:[Ljava/lang/Object; move-object v15, v0 const/16 v16, 0x1 const/16 v17, 0x0 aput-object v17, v15, v16 throw v14 .end local v4 #attrs:Landroid/util/AttributeSet; .end local v7 #lastContext:Landroid/content/Context; .end local v10 #result:Landroid/view/View; :catchall_1 move-exception v14 monitor-exit v13 :try_end_3 .catchall {:try_start_3 .. :try_end_3} :catchall_1 throw v14 .restart local v4 #attrs:Landroid/util/AttributeSet; .restart local v7 #lastContext:Landroid/content/Context; .restart local v10 #result:Landroid/view/View; .restart local v12 #type:I :cond_2 :try_start_4 invoke-interface/range {p1 .. p1}, Lorg/xmlpull/v1/XmlPullParser;->getName()Ljava/lang/String; move-result-object v8 .local v8, name:Ljava/lang/String; const-string v14, "merge" invoke-virtual {v14, v8}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result v14 if-eqz v14, :cond_6 if-eqz p2, :cond_3 if-nez p3, :cond_4 :cond_3 new-instance v14, Landroid/view/InflateException; const-string v15, "<merge /> can be used only with a valid ViewGroup root and attachToRoot=true" invoke-direct {v14, v15}, Landroid/view/InflateException;-><init>(Ljava/lang/String;)V throw v14 :try_end_4 .catchall {:try_start_4 .. :try_end_4} :catchall_0 .catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_4 .. :try_end_4} :catch_0 .catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_1 .end local v8 #name:Ljava/lang/String; .end local v12 #type:I :catch_1 move-exception v14 move-object v5, v14 .local v5, e:Ljava/io/IOException; :try_start_5 new-instance v6, Landroid/view/InflateException; new-instance v14, Ljava/lang/StringBuilder; invoke-direct {v14}, Ljava/lang/StringBuilder;-><init>()V invoke-interface/range {p1 .. p1}, Lorg/xmlpull/v1/XmlPullParser;->getPositionDescription()Ljava/lang/String; move-result-object v15 invoke-virtual {v14, v15}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v14 const-string v15, ": " invoke-virtual {v14, v15}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v14 invoke-virtual {v5}, Ljava/io/IOException;->getMessage()Ljava/lang/String; move-result-object v15 invoke-virtual {v14, v15}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v14 invoke-virtual {v14}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v14 invoke-direct {v6, v14}, Landroid/view/InflateException;-><init>(Ljava/lang/String;)V .restart local v6 #ex:Landroid/view/InflateException; invoke-virtual {v6, v5}, Landroid/view/InflateException;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable; throw v6 :try_end_5 .catchall {:try_start_5 .. :try_end_5} :catchall_0 .end local v5 #e:Ljava/io/IOException; .end local v6 #ex:Landroid/view/InflateException; .restart local v8 #name:Ljava/lang/String; .restart local v12 #type:I :cond_4 :try_start_6 move-object/from16 v0, p0 move-object/from16 v1, p1 move-object/from16 v2, p2 move-object v3, v4 invoke-direct {v0, v1, v2, v3}, Landroid/view/LayoutInflater;->rInflate(Lorg/xmlpull/v1/XmlPullParser;Landroid/view/View;Landroid/util/AttributeSet;)V :try_end_6 .catchall {:try_start_6 .. :try_end_6} :catchall_0 .catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_6 .. :try_end_6} :catch_0 .catch Ljava/io/IOException; {:try_start_6 .. :try_end_6} :catch_1 :cond_5 :goto_0 :try_start_7 move-object/from16 v0, p0 iget-object v0, v0, Landroid/view/LayoutInflater;->mConstructorArgs:[Ljava/lang/Object; move-object v14, v0 const/4 v15, 0x0 aput-object v7, v14, v15 move-object/from16 v0, p0 iget-object v0, v0, Landroid/view/LayoutInflater;->mConstructorArgs:[Ljava/lang/Object; move-object v14, v0 const/4 v15, 0x1 const/16 v16, 0x0 aput-object v16, v14, v15 monitor-exit v13 :try_end_7 .catchall {:try_start_7 .. :try_end_7} :catchall_1 return-object v10 :cond_6 :try_start_8 move-object/from16 v0, p0 move-object v1, v8 move-object v2, v4 invoke-virtual {v0, v1, v2}, Landroid/view/LayoutInflater;->createViewFromTag(Ljava/lang/String;Landroid/util/AttributeSet;)Landroid/view/View; move-result-object v11 .local v11, temp:Landroid/view/View; const/4 v9, 0x0 .local v9, params:Landroid/view/ViewGroup$LayoutParams; if-eqz p2, :cond_7 move-object/from16 v0, p2 move-object v1, v4 invoke-virtual {v0, v1}, Landroid/view/ViewGroup;->generateLayoutParams(Landroid/util/AttributeSet;)Landroid/view/ViewGroup$LayoutParams; move-result-object v9 if-nez p3, :cond_7 invoke-virtual {v11, v9}, Landroid/view/View;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V :cond_7 move-object/from16 v0, p0 move-object/from16 v1, p1 move-object v2, v11 move-object v3, v4 invoke-direct {v0, v1, v2, v3}, Landroid/view/LayoutInflater;->rInflate(Lorg/xmlpull/v1/XmlPullParser;Landroid/view/View;Landroid/util/AttributeSet;)V if-eqz p2, :cond_8 if-eqz p3, :cond_8 move-object/from16 v0, p2 move-object v1, v11 move-object v2, v9 invoke-virtual {v0, v1, v2}, Landroid/view/ViewGroup;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V :try_end_8 .catchall {:try_start_8 .. :try_end_8} :catchall_0 .catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_8 .. :try_end_8} :catch_0 .catch Ljava/io/IOException; {:try_start_8 .. :try_end_8} :catch_1 :cond_8 if-eqz p2, :cond_9 if-nez p3, :cond_5 :cond_9 move-object v10, v11 goto :goto_0 .end method .method protected onCreateView(Ljava/lang/String;Landroid/util/AttributeSet;)Landroid/view/View; .locals 1 .parameter "name" .parameter "attrs" .annotation system Ldalvik/annotation/Throws; value = { Ljava/lang/ClassNotFoundException; } .end annotation .prologue const-string v0, "android.view." invoke-virtual {p0, p1, v0, p2}, Landroid/view/LayoutInflater;->createView(Ljava/lang/String;Ljava/lang/String;Landroid/util/AttributeSet;)Landroid/view/View; move-result-object v0 return-object v0 .end method .method public setFactory(Landroid/view/LayoutInflater$Factory;)V .locals 2 .parameter "factory" .prologue iget-boolean v0, p0, Landroid/view/LayoutInflater;->mFactorySet:Z if-eqz v0, :cond_0 new-instance v0, Ljava/lang/IllegalStateException; const-string v1, "A factory has already been set on this LayoutInflater" invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V throw v0 :cond_0 if-nez p1, :cond_1 new-instance v0, Ljava/lang/NullPointerException; const-string v1, "Given factory can not be null" invoke-direct {v0, v1}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V throw v0 :cond_1 const/4 v0, 0x1 iput-boolean v0, p0, Landroid/view/LayoutInflater;->mFactorySet:Z iget-object v0, p0, Landroid/view/LayoutInflater;->mFactory:Landroid/view/LayoutInflater$Factory; if-nez v0, :cond_2 iput-object p1, p0, Landroid/view/LayoutInflater;->mFactory:Landroid/view/LayoutInflater$Factory; :goto_0 return-void :cond_2 new-instance v0, Landroid/view/LayoutInflater$FactoryMerger; iget-object v1, p0, Landroid/view/LayoutInflater;->mFactory:Landroid/view/LayoutInflater$Factory; invoke-direct {v0, p1, v1}, Landroid/view/LayoutInflater$FactoryMerger;-><init>(Landroid/view/LayoutInflater$Factory;Landroid/view/LayoutInflater$Factory;)V iput-object v0, p0, Landroid/view/LayoutInflater;->mFactory:Landroid/view/LayoutInflater$Factory; goto :goto_0 .end method .method public setFilter(Landroid/view/LayoutInflater$Filter;)V .locals 1 .parameter "filter" .prologue iput-object p1, p0, Landroid/view/LayoutInflater;->mFilter:Landroid/view/LayoutInflater$Filter; if-eqz p1, :cond_0 new-instance v0, Ljava/util/HashMap; invoke-direct {v0}, Ljava/util/HashMap;-><init>()V iput-object v0, p0, Landroid/view/LayoutInflater;->mFilterMap:Ljava/util/HashMap; :cond_0 return-void .end method
{ "pile_set_name": "Github" }
# # Copyright (C) 2009 David Cooper <dave@kupesoft.com> # Copyright (C) 2006-2010 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # VIDEO_MENU:=Video Support V4L2_DIR=v4l2-core V4L2_USB_DIR=usb # # Video Display # define KernelPackage/backlight SUBMENU:=$(VIDEO_MENU) TITLE:=Backlight support DEPENDS:=@DISPLAY_SUPPORT HIDDEN:=1 KCONFIG:=CONFIG_BACKLIGHT_CLASS_DEVICE \ CONFIG_BACKLIGHT_LCD_SUPPORT=y \ CONFIG_LCD_CLASS_DEVICE=n \ CONFIG_BACKLIGHT_GENERIC=n \ CONFIG_BACKLIGHT_ADP8860=n \ CONFIG_BACKLIGHT_ADP8870=n \ CONFIG_BACKLIGHT_OT200=n \ CONFIG_BACKLIGHT_PM8941_WLED=n FILES:=$(LINUX_DIR)/drivers/video/backlight/backlight.ko AUTOLOAD:=$(call AutoProbe,video backlight) endef define KernelPackage/backlight/description Kernel module for Backlight support. endef $(eval $(call KernelPackage,backlight)) define KernelPackage/backlight-pwm SUBMENU:=$(VIDEO_MENU) TITLE:=PWM Backlight support DEPENDS:=+kmod-backlight KCONFIG:=CONFIG_BACKLIGHT_PWM FILES:=$(LINUX_DIR)/drivers/video/backlight/pwm_bl.ko AUTOLOAD:=$(call AutoProbe,video pwm_bl) endef define KernelPackage/backlight-pwm/description Kernel module for PWM based Backlight support. endef $(eval $(call KernelPackage,backlight-pwm)) define KernelPackage/fb SUBMENU:=$(VIDEO_MENU) TITLE:=Framebuffer and framebuffer console support DEPENDS:=@DISPLAY_SUPPORT KCONFIG:= \ CONFIG_FB \ CONFIG_FB_MXS=n \ CONFIG_FB_SM750=n \ CONFIG_FRAMEBUFFER_CONSOLE=y \ CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y \ CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y \ CONFIG_FONTS=y \ CONFIG_FONT_8x8=y \ CONFIG_FONT_8x16=y \ CONFIG_FONT_6x11=n \ CONFIG_FONT_7x14=n \ CONFIG_FONT_PEARL_8x8=n \ CONFIG_FONT_ACORN_8x8=n \ CONFIG_FONT_MINI_4x6=n \ CONFIG_FONT_6x10=n \ CONFIG_FONT_SUN8x16=n \ CONFIG_FONT_SUN12x22=n \ CONFIG_FONT_10x18=n \ CONFIG_VT=y \ CONFIG_CONSOLE_TRANSLATIONS=y \ CONFIG_VT_CONSOLE=y \ CONFIG_VT_HW_CONSOLE_BINDING=y FILES:=$(LINUX_DIR)/drivers/video/fbdev/core/fb.ko \ $(LINUX_DIR)/lib/fonts/font.ko AUTOLOAD:=$(call AutoLoad,06,fb font) endef define KernelPackage/fb/description Kernel support for framebuffers and framebuffer console. endef define KernelPackage/fb/x86 FILES+=$(LINUX_DIR)/arch/x86/video/fbdev.ko AUTOLOAD:=$(call AutoLoad,06,fbdev fb font) endef $(eval $(call KernelPackage,fb)) define KernelPackage/fb-cfb-fillrect SUBMENU:=$(VIDEO_MENU) TITLE:=Framebuffer software rectangle filling support DEPENDS:=+kmod-fb KCONFIG:=CONFIG_FB_CFB_FILLRECT FILES:=$(LINUX_DIR)/drivers/video/fbdev/core/cfbfillrect.ko AUTOLOAD:=$(call AutoLoad,07,cfbfillrect) endef define KernelPackage/fb-cfb-fillrect/description Kernel support for software rectangle filling endef $(eval $(call KernelPackage,fb-cfb-fillrect)) define KernelPackage/fb-cfb-copyarea SUBMENU:=$(VIDEO_MENU) TITLE:=Framebuffer software copy area support DEPENDS:=+kmod-fb KCONFIG:=CONFIG_FB_CFB_COPYAREA FILES:=$(LINUX_DIR)/drivers/video/fbdev/core/cfbcopyarea.ko AUTOLOAD:=$(call AutoLoad,07,cfbcopyarea) endef define KernelPackage/fb-cfb-copyarea/description Kernel support for software copy area endef $(eval $(call KernelPackage,fb-cfb-copyarea)) define KernelPackage/fb-cfb-imgblt SUBMENU:=$(VIDEO_MENU) TITLE:=Framebuffer software image blit support DEPENDS:=+kmod-fb KCONFIG:=CONFIG_FB_CFB_IMAGEBLIT FILES:=$(LINUX_DIR)/drivers/video/fbdev/core/cfbimgblt.ko AUTOLOAD:=$(call AutoLoad,07,cfbimgblt) endef define KernelPackage/fb-cfb-imgblt/description Kernel support for software image blitting endef $(eval $(call KernelPackage,fb-cfb-imgblt)) define KernelPackage/fb-sys-fops SUBMENU:=$(VIDEO_MENU) TITLE:=Framebuffer software sys ops support DEPENDS:=+kmod-fb KCONFIG:=CONFIG_FB_SYS_FOPS FILES:=$(LINUX_DIR)/drivers/video/fbdev/core/fb_sys_fops.ko AUTOLOAD:=$(call AutoLoad,07,fbsysfops) endef define KernelPackage/fb-sys-fops/description Kernel support for framebuffer sys ops endef $(eval $(call KernelPackage,fb-sys-fops)) define KernelPackage/drm SUBMENU:=$(VIDEO_MENU) TITLE:=Direct Rendering Manager (DRM) support HIDDEN:=1 DEPENDS:=+kmod-dma-buf +kmod-i2c-core KCONFIG:=CONFIG_DRM FILES:=$(LINUX_DIR)/drivers/gpu/drm/drm.ko AUTOLOAD:=$(call AutoLoad,05,drm) endef define KernelPackage/drm/description Direct Rendering Manager (DRM) core support endef $(eval $(call KernelPackage,drm)) define KernelPackage/drm-imx SUBMENU:=$(VIDEO_MENU) TITLE:=Freescale i.MX DRM support DEPENDS:=@TARGET_imx6 +kmod-drm +kmod-fb +kmod-fb-cfb-copyarea +kmod-fb-cfb-imgblt +kmod-fb-cfb-fillrect +kmod-fb-sys-fops KCONFIG:=CONFIG_DRM_IMX \ CONFIG_DRM_FBDEV_EMULATION=y \ CONFIG_DRM_FBDEV_OVERALLOC=100 \ CONFIG_IMX_IPUV3_CORE \ CONFIG_RESET_CONTROLLER=y \ CONFIG_DRM_IMX_IPUV3 \ CONFIG_IMX_IPUV3 \ CONFIG_DRM_KMS_HELPER \ CONFIG_FB_SYS_FILLRECT \ CONFIG_FB_SYS_COPYAREA \ CONFIG_FB_SYS_IMAGEBLIT \ CONFIG_DRM_KMS_FB_HELPER=y \ CONFIG_DRM_GEM_CMA_HELPER=y \ CONFIG_DRM_KMS_CMA_HELPER=y \ CONFIG_DRM_IMX_FB_HELPER \ CONFIG_DRM_IMX_PARALLEL_DISPLAY=n \ CONFIG_DRM_IMX_TVE=n \ CONFIG_DRM_IMX_LDB=n \ CONFIG_DRM_IMX_HDMI=n FILES:= \ $(LINUX_DIR)/drivers/gpu/drm/imx/imxdrm.ko \ $(LINUX_DIR)/drivers/gpu/ipu-v3/imx-ipu-v3.ko \ $(LINUX_DIR)/drivers/video/fbdev/core/syscopyarea.ko \ $(LINUX_DIR)/drivers/video/fbdev/core/sysfillrect.ko \ $(LINUX_DIR)/drivers/video/fbdev/core/sysimgblt.ko \ $(LINUX_DIR)/drivers/gpu/drm/drm_kms_helper.ko AUTOLOAD:=$(call AutoLoad,05,imxdrm imx-ipu-v3 imx-ipuv3-crtc) endef define KernelPackage/drm-imx/description Direct Rendering Manager (DRM) support for Freescale i.MX endef $(eval $(call KernelPackage,drm-imx)) define KernelPackage/drm-imx-hdmi SUBMENU:=$(VIDEO_MENU) TITLE:=Freescale i.MX HDMI DRM support DEPENDS:=+kmod-sound-core kmod-drm-imx KCONFIG:=CONFIG_DRM_IMX_HDMI \ CONFIG_DRM_DW_HDMI_AHB_AUDIO \ CONFIG_DRM_DW_HDMI_I2S_AUDIO FILES:= \ $(LINUX_DIR)/drivers/gpu/drm/bridge/synopsys/dw-hdmi.ko \ $(LINUX_DIR)/drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.ko \ $(LINUX_DIR)/drivers/gpu/drm/imx/dw_hdmi-imx.ko AUTOLOAD:=$(call AutoLoad,05,dw-hdmi dw-hdmi-ahb-audio.ko dw_hdmi-imx) endef define KernelPackage/drm-imx-hdmi/description Direct Rendering Manager (DRM) support for Freescale i.MX HDMI endef $(eval $(call KernelPackage,drm-imx-hdmi)) define KernelPackage/drm-imx-ldb SUBMENU:=$(VIDEO_MENU) TITLE:=Freescale i.MX LVDS DRM support DEPENDS:=+kmod-backlight kmod-drm-imx KCONFIG:=CONFIG_DRM_IMX_LDB \ CONFIG_DRM_PANEL_SIMPLE \ CONFIG_DRM_PANEL=y \ CONFIG_DRM_PANEL_SAMSUNG_LD9040=n \ CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0=n \ CONFIG_DRM_PANEL_LG_LG4573=n \ CONFIG_DRM_PANEL_LD9040=n \ CONFIG_DRM_PANEL_LVDS=n \ CONFIG_DRM_PANEL_S6E8AA0=n \ CONFIG_DRM_PANEL_SITRONIX_ST7789V=n FILES:=$(LINUX_DIR)/drivers/gpu/drm/imx/imx-ldb.ko \ $(LINUX_DIR)/drivers/gpu/drm/panel/panel-simple.ko AUTOLOAD:=$(call AutoLoad,05,imx-ldb) endef define KernelPackage/drm-imx-ldb/description Direct Rendering Manager (DRM) support for Freescale i.MX LVDS endef $(eval $(call KernelPackage,drm-imx-ldb)) # # Video Capture # define KernelPackage/video-core SUBMENU:=$(VIDEO_MENU) TITLE=Video4Linux support DEPENDS:=@PCI_SUPPORT||USB_SUPPORT +PACKAGE_kmod-i2c-core:kmod-i2c-core KCONFIG:= \ CONFIG_MEDIA_SUPPORT \ CONFIG_MEDIA_CAMERA_SUPPORT=y \ CONFIG_VIDEO_DEV \ CONFIG_VIDEO_V4L1=y \ CONFIG_VIDEO_ALLOW_V4L1=y \ CONFIG_VIDEO_CAPTURE_DRIVERS=y \ CONFIG_V4L_USB_DRIVERS=y \ CONFIG_V4L_PCI_DRIVERS=y \ CONFIG_V4L_PLATFORM_DRIVERS=y \ CONFIG_V4L_ISA_PARPORT_DRIVERS=y FILES:= \ $(LINUX_DIR)/drivers/media/$(V4L2_DIR)/v4l2-common.ko \ $(LINUX_DIR)/drivers/media/$(V4L2_DIR)/videodev.ko AUTOLOAD:=$(call AutoLoad,60, videodev v4l2-common) endef define KernelPackage/video-core/description Kernel modules for Video4Linux support endef $(eval $(call KernelPackage,video-core)) define AddDepends/video SUBMENU:=$(VIDEO_MENU) DEPENDS+=kmod-video-core $(1) endef define AddDepends/camera $(AddDepends/video) KCONFIG+=CONFIG_MEDIA_USB_SUPPORT=y \ CONFIG_MEDIA_CAMERA_SUPPORT=y endef define KernelPackage/video-videobuf2 TITLE:=videobuf2 lib DEPENDS:=+kmod-dma-buf KCONFIG:= \ CONFIG_VIDEOBUF2_CORE \ CONFIG_VIDEOBUF2_MEMOPS \ CONFIG_VIDEOBUF2_VMALLOC FILES:= \ $(LINUX_DIR)/drivers/media/$(V4L2_DIR)/videobuf2-core.ko \ $(LINUX_DIR)/drivers/media/$(V4L2_DIR)/videobuf2-v4l2.ko@ge4.4 \ $(LINUX_DIR)/drivers/media/$(V4L2_DIR)/videobuf2-memops.ko \ $(LINUX_DIR)/drivers/media/$(V4L2_DIR)/videobuf2-vmalloc.ko AUTOLOAD:=$(call AutoLoad,65,videobuf2-core videobuf-v4l2@ge4.4 videobuf2-memops videobuf2-vmalloc) $(call AddDepends/video) endef define KernelPackage/video-videobuf2/description Kernel modules that implements three basic types of media buffers. endef $(eval $(call KernelPackage,video-videobuf2)) define KernelPackage/video-cpia2 TITLE:=CPIA2 video driver DEPENDS:=@USB_SUPPORT +kmod-usb-core KCONFIG:=CONFIG_VIDEO_CPIA2 FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/cpia2/cpia2.ko AUTOLOAD:=$(call AutoProbe,cpia2) $(call AddDepends/camera) endef define KernelPackage/video-cpia2/description Kernel modules for supporting CPIA2 USB based cameras endef $(eval $(call KernelPackage,video-cpia2)) define KernelPackage/video-pwc TITLE:=Philips USB webcam support DEPENDS:=@USB_SUPPORT +kmod-usb-core +kmod-video-videobuf2 KCONFIG:= \ CONFIG_USB_PWC \ CONFIG_USB_PWC_DEBUG=n FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/pwc/pwc.ko AUTOLOAD:=$(call AutoProbe,pwc) $(call AddDepends/camera) endef define KernelPackage/video-pwc/description Kernel modules for supporting Philips USB based cameras endef $(eval $(call KernelPackage,video-pwc)) define KernelPackage/video-uvc TITLE:=USB Video Class (UVC) support DEPENDS:=@USB_SUPPORT +kmod-usb-core +kmod-video-videobuf2 +kmod-input-core KCONFIG:= CONFIG_USB_VIDEO_CLASS FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/uvc/uvcvideo.ko AUTOLOAD:=$(call AutoProbe,uvcvideo) $(call AddDepends/camera) endef define KernelPackage/video-uvc/description Kernel modules for supporting USB Video Class (UVC) devices endef $(eval $(call KernelPackage,video-uvc)) define KernelPackage/video-gspca-core MENU:=1 TITLE:=GSPCA webcam core support framework DEPENDS:=@USB_SUPPORT +kmod-usb-core +kmod-input-core KCONFIG:=CONFIG_USB_GSPCA FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_main.ko AUTOLOAD:=$(call AutoProbe,gspca_main) $(call AddDepends/camera) endef define KernelPackage/video-gspca-core/description Kernel modules for supporting GSPCA based webcam devices. Note this is just the core of the driver, please select a submodule that supports your webcam. endef $(eval $(call KernelPackage,video-gspca-core)) define AddDepends/camera-gspca SUBMENU:=$(VIDEO_MENU) DEPENDS+=kmod-video-gspca-core $(1) endef define KernelPackage/video-gspca-conex TITLE:=conex webcam support KCONFIG:=CONFIG_USB_GSPCA_CONEX FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_conex.ko AUTOLOAD:=$(call AutoProbe,gspca_conex) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-conex/description The Conexant Camera Driver (conex) kernel module endef $(eval $(call KernelPackage,video-gspca-conex)) define KernelPackage/video-gspca-etoms TITLE:=etoms webcam support KCONFIG:=CONFIG_USB_GSPCA_ETOMS FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_etoms.ko AUTOLOAD:=$(call AutoProbe,gspca_etoms) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-etoms/description The Etoms USB Camera Driver (etoms) kernel module endef $(eval $(call KernelPackage,video-gspca-etoms)) define KernelPackage/video-gspca-finepix TITLE:=finepix webcam support KCONFIG:=CONFIG_USB_GSPCA_FINEPIX FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_finepix.ko AUTOLOAD:=$(call AutoProbe,gspca_finepix) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-finepix/description The Fujifilm FinePix USB V4L2 driver (finepix) kernel module endef $(eval $(call KernelPackage,video-gspca-finepix)) define KernelPackage/video-gspca-mars TITLE:=mars webcam support KCONFIG:=CONFIG_USB_GSPCA_MARS FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_mars.ko AUTOLOAD:=$(call AutoProbe,gspca_mars) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-mars/description The Mars USB Camera Driver (mars) kernel module endef $(eval $(call KernelPackage,video-gspca-mars)) define KernelPackage/video-gspca-mr97310a TITLE:=mr97310a webcam support KCONFIG:=CONFIG_USB_GSPCA_MR97310A FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_mr97310a.ko AUTOLOAD:=$(call AutoProbe,gspca_mr97310a) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-mr97310a/description The Mars-Semi MR97310A USB Camera Driver (mr97310a) kernel module endef $(eval $(call KernelPackage,video-gspca-mr97310a)) define KernelPackage/video-gspca-ov519 TITLE:=ov519 webcam support KCONFIG:=CONFIG_USB_GSPCA_OV519 FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_ov519.ko AUTOLOAD:=$(call AutoProbe,gspca_ov519) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-ov519/description The OV519 USB Camera Driver (ov519) kernel module endef $(eval $(call KernelPackage,video-gspca-ov519)) define KernelPackage/video-gspca-ov534 TITLE:=ov534 webcam support KCONFIG:=CONFIG_USB_GSPCA_OV534 FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_ov534.ko AUTOLOAD:=$(call AutoProbe,gspca_ov534) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-ov534/description The OV534 USB Camera Driver (ov534) kernel module endef $(eval $(call KernelPackage,video-gspca-ov534)) define KernelPackage/video-gspca-ov534-9 TITLE:=ov534-9 webcam support KCONFIG:=CONFIG_USB_GSPCA_OV534_9 FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_ov534_9.ko AUTOLOAD:=$(call AutoProbe,gspca_ov534_9) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-ov534-9/description The OV534-9 USB Camera Driver (ov534_9) kernel module endef $(eval $(call KernelPackage,video-gspca-ov534-9)) define KernelPackage/video-gspca-pac207 TITLE:=pac207 webcam support KCONFIG:=CONFIG_USB_GSPCA_PAC207 FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_pac207.ko AUTOLOAD:=$(call AutoProbe,gspca_pac207) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-pac207/description The Pixart PAC207 USB Camera Driver (pac207) kernel module endef $(eval $(call KernelPackage,video-gspca-pac207)) define KernelPackage/video-gspca-pac7311 TITLE:=pac7311 webcam support KCONFIG:=CONFIG_USB_GSPCA_PAC7311 FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_pac7311.ko AUTOLOAD:=$(call AutoProbe,gspca_pac7311) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-pac7311/description The Pixart PAC7311 USB Camera Driver (pac7311) kernel module endef $(eval $(call KernelPackage,video-gspca-pac7311)) define KernelPackage/video-gspca-se401 TITLE:=se401 webcam support KCONFIG:=CONFIG_USB_GSPCA_SE401 FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_se401.ko AUTOLOAD:=$(call AutoProbe,gspca_se401) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-se401/description The SE401 USB Camera Driver kernel module endef $(eval $(call KernelPackage,video-gspca-se401)) define KernelPackage/video-gspca-sn9c20x TITLE:=sn9c20x webcam support KCONFIG:=CONFIG_USB_GSPCA_SN9C20X FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_sn9c20x.ko AUTOLOAD:=$(call AutoProbe,gspca_sn9c20x) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-sn9c20x/description The SN9C20X USB Camera Driver (sn9c20x) kernel module endef $(eval $(call KernelPackage,video-gspca-sn9c20x)) define KernelPackage/video-gspca-sonixb TITLE:=sonixb webcam support KCONFIG:=CONFIG_USB_GSPCA_SONIXB FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_sonixb.ko AUTOLOAD:=$(call AutoProbe,gspca_sonixb) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-sonixb/description The SONIX Bayer USB Camera Driver (sonixb) kernel module endef $(eval $(call KernelPackage,video-gspca-sonixb)) define KernelPackage/video-gspca-sonixj TITLE:=sonixj webcam support KCONFIG:=CONFIG_USB_GSPCA_SONIXJ FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_sonixj.ko AUTOLOAD:=$(call AutoProbe,gspca_sonixj) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-sonixj/description The SONIX JPEG USB Camera Driver (sonixj) kernel module endef $(eval $(call KernelPackage,video-gspca-sonixj)) define KernelPackage/video-gspca-spca500 TITLE:=spca500 webcam support KCONFIG:=CONFIG_USB_GSPCA_SPCA500 FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_spca500.ko AUTOLOAD:=$(call AutoProbe,gspca_spca500) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-spca500/description The SPCA500 USB Camera Driver (spca500) kernel module endef $(eval $(call KernelPackage,video-gspca-spca500)) define KernelPackage/video-gspca-spca501 TITLE:=spca501 webcam support KCONFIG:=CONFIG_USB_GSPCA_SPCA501 FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_spca501.ko AUTOLOAD:=$(call AutoProbe,gspca_spca501) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-spca501/description The SPCA501 USB Camera Driver (spca501) kernel module endef $(eval $(call KernelPackage,video-gspca-spca501)) define KernelPackage/video-gspca-spca505 TITLE:=spca505 webcam support KCONFIG:=CONFIG_USB_GSPCA_SPCA505 FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_spca505.ko AUTOLOAD:=$(call AutoProbe,gspca_spca505) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-spca505/description The SPCA505 USB Camera Driver (spca505) kernel module endef $(eval $(call KernelPackage,video-gspca-spca505)) define KernelPackage/video-gspca-spca506 TITLE:=spca506 webcam support KCONFIG:=CONFIG_USB_GSPCA_SPCA506 FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_spca506.ko AUTOLOAD:=$(call AutoProbe,gspca_spca506) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-spca506/description The SPCA506 USB Camera Driver (spca506) kernel module endef $(eval $(call KernelPackage,video-gspca-spca506)) define KernelPackage/video-gspca-spca508 TITLE:=spca508 webcam support KCONFIG:=CONFIG_USB_GSPCA_SPCA508 FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_spca508.ko AUTOLOAD:=$(call AutoProbe,gspca_spca508) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-spca508/description The SPCA508 USB Camera Driver (spca508) kernel module endef $(eval $(call KernelPackage,video-gspca-spca508)) define KernelPackage/video-gspca-spca561 TITLE:=spca561 webcam support KCONFIG:=CONFIG_USB_GSPCA_SPCA561 FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_spca561.ko AUTOLOAD:=$(call AutoProbe,gspca_spca561) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-spca561/description The SPCA561 USB Camera Driver (spca561) kernel module endef $(eval $(call KernelPackage,video-gspca-spca561)) define KernelPackage/video-gspca-sq905 TITLE:=sq905 webcam support KCONFIG:=CONFIG_USB_GSPCA_SQ905 FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_sq905.ko AUTOLOAD:=$(call AutoProbe,gspca_sq905) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-sq905/description The SQ Technologies SQ905 based USB Camera Driver (sq905) kernel module endef $(eval $(call KernelPackage,video-gspca-sq905)) define KernelPackage/video-gspca-sq905c TITLE:=sq905c webcam support KCONFIG:=CONFIG_USB_GSPCA_SQ905C FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_sq905c.ko AUTOLOAD:=$(call AutoProbe,gspca_sq905c) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-sq905c/description The SQ Technologies SQ905C based USB Camera Driver (sq905c) kernel module endef $(eval $(call KernelPackage,video-gspca-sq905c)) define KernelPackage/video-gspca-stk014 TITLE:=stk014 webcam support KCONFIG:=CONFIG_USB_GSPCA_STK014 FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_stk014.ko AUTOLOAD:=$(call AutoProbe,gspca_stk014) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-stk014/description The Syntek DV4000 (STK014) USB Camera Driver (stk014) kernel module endef $(eval $(call KernelPackage,video-gspca-stk014)) define KernelPackage/video-gspca-sunplus TITLE:=sunplus webcam support KCONFIG:=CONFIG_USB_GSPCA_SUNPLUS FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_sunplus.ko AUTOLOAD:=$(call AutoProbe,gspca_sunplus) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-sunplus/description The SUNPLUS USB Camera Driver (sunplus) kernel module endef $(eval $(call KernelPackage,video-gspca-sunplus)) define KernelPackage/video-gspca-t613 TITLE:=t613 webcam support KCONFIG:=CONFIG_USB_GSPCA_T613 FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_t613.ko AUTOLOAD:=$(call AutoProbe,gspca_t613) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-t613/description The T613 (JPEG Compliance) USB Camera Driver (t613) kernel module endef $(eval $(call KernelPackage,video-gspca-t613)) define KernelPackage/video-gspca-tv8532 TITLE:=tv8532 webcam support KCONFIG:=CONFIG_USB_GSPCA_TV8532 FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_tv8532.ko AUTOLOAD:=$(call AutoProbe,gspca_tv8532) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-tv8532/description The TV8532 USB Camera Driver (tv8532) kernel module endef $(eval $(call KernelPackage,video-gspca-tv8532)) define KernelPackage/video-gspca-vc032x TITLE:=vc032x webcam support KCONFIG:=CONFIG_USB_GSPCA_VC032X FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_vc032x.ko AUTOLOAD:=$(call AutoProbe,gspca_vc032x) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-vc032x/description The VC032X USB Camera Driver (vc032x) kernel module endef $(eval $(call KernelPackage,video-gspca-vc032x)) define KernelPackage/video-gspca-zc3xx TITLE:=zc3xx webcam support KCONFIG:=CONFIG_USB_GSPCA_ZC3XX FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_zc3xx.ko AUTOLOAD:=$(call AutoProbe,gspca_zc3xx) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-zc3xx/description The ZC3XX USB Camera Driver (zc3xx) kernel module endef $(eval $(call KernelPackage,video-gspca-zc3xx)) define KernelPackage/video-gspca-m5602 TITLE:=m5602 webcam support KCONFIG:=CONFIG_USB_M5602 FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/m5602/gspca_m5602.ko AUTOLOAD:=$(call AutoProbe,gspca_m5602) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-m5602/description The ALi USB m5602 Camera Driver (m5602) kernel module endef $(eval $(call KernelPackage,video-gspca-m5602)) define KernelPackage/video-gspca-stv06xx TITLE:=stv06xx webcam support KCONFIG:=CONFIG_USB_STV06XX FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/stv06xx/gspca_stv06xx.ko AUTOLOAD:=$(call AutoProbe,gspca_stv06xx) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-stv06xx/description The STV06XX USB Camera Driver (stv06xx) kernel module endef $(eval $(call KernelPackage,video-gspca-stv06xx)) define KernelPackage/video-gspca-gl860 TITLE:=gl860 webcam support KCONFIG:=CONFIG_USB_GL860 FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gl860/gspca_gl860.ko AUTOLOAD:=$(call AutoProbe,gspca_gl860) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-gl800/description The GL860 USB Camera Driver (gl860) kernel module endef $(eval $(call KernelPackage,video-gspca-gl860)) define KernelPackage/video-gspca-jeilinj TITLE:=jeilinj webcam support KCONFIG:=CONFIG_USB_GSPCA_JEILINJ FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_jeilinj.ko AUTOLOAD:=$(call AutoProbe,gspca_jeilinj) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-jeilinj/description The JEILINJ USB Camera Driver (jeilinj) kernel module endef $(eval $(call KernelPackage,video-gspca-jeilinj)) define KernelPackage/video-gspca-konica TITLE:=konica webcam support KCONFIG:=CONFIG_USB_GSPCA_KONICA FILES:=$(LINUX_DIR)/drivers/media/$(V4L2_USB_DIR)/gspca/gspca_konica.ko AUTOLOAD:=$(call AutoProbe,gspca_konica) $(call AddDepends/camera-gspca) endef define KernelPackage/video-gspca-konica/description The Konica USB Camera Driver (konica) kernel module endef $(eval $(call KernelPackage,video-gspca-konica))
{ "pile_set_name": "Github" }
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Mupen64plus - regcache.h * * Mupen64Plus homepage: https://mupen64plus.org/ * * Copyright (C) 2002 Hacktarux * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef M64P_DEVICE_R4300_X86_REGCACHE_H #define M64P_DEVICE_R4300_X86_REGCACHE_H struct r4300_core; struct precomp_instr; struct precomp_block; void init_cache(struct r4300_core* r4300, struct precomp_instr* start); void free_all_registers(struct r4300_core* r4300); void free_register(struct r4300_core* r4300, int reg); int allocate_register(struct r4300_core* r4300, unsigned int *addr); int allocate_64_register1(struct r4300_core* r4300, unsigned int *addr); int allocate_64_register2(struct r4300_core* r4300, unsigned int *addr); int is64(struct r4300_core* r4300, unsigned int *addr); void build_wrappers(struct r4300_core* r4300, struct precomp_instr*, int, int, struct precomp_block*); int lru_register(struct r4300_core* r4300); int allocate_register_w(struct r4300_core* r4300, unsigned int *addr); int allocate_64_register1_w(struct r4300_core* r4300, unsigned int *addr); int allocate_64_register2_w(struct r4300_core* r4300, unsigned int *addr); void set_register_state(struct r4300_core* r4300, int reg, unsigned int *addr, int dirty); void set_64_register_state(struct r4300_core* r4300, int reg1, int reg2, unsigned int *addr, int dirty); void allocate_register_manually(struct r4300_core* r4300, int reg, unsigned int *addr); void allocate_register_manually_w(struct r4300_core* r4300, int reg, unsigned int *addr, int load); int lru_register_exc1(struct r4300_core* r4300, int exc1); void simplify_access(struct r4300_core* r4300); #endif /* M64P_DEVICE_R4300_X86_REGCACHE_H */
{ "pile_set_name": "Github" }
{ "aliases": { "lib_paths_darwin_x64": ["${lib_paths}/mac.x86_64/"] }, "platform": { "darwin_x64": { "importlibpath_debug": ["${lib_paths_darwin_x64}/debug"], "importlibpath_profile": ["${lib_paths_darwin_x64}/profile"], "importlibpath_release": ["${lib_paths_darwin_x64}/release"], "importlibpath_performance": ["${lib_paths_darwin_x64}/release"], "import": [ "lib${lib_names}_static_64.a" ] } } }
{ "pile_set_name": "Github" }
/* * Copyright (C) 2007-2009 Sergio Pistone <sergio_pistone@yahoo.com.ar> * Copyright (C) 2010-2018 Mladen Milinkovic <max@smoothware.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "adjusttimesdialog.h" #include "widgets/timeedit.h" #include <QLabel> #include <QGroupBox> #include <QGridLayout> #include <KLocalizedString> using namespace SubtitleComposer; AdjustTimesDialog::AdjustTimesDialog(QWidget *parent) : ActionDialog(i18n("Adjust"), parent) { QGroupBox *settingsGroupBox = createGroupBox(i18nc("@title:group", "New Times")); m_firstLineTimeEdit = new TimeEdit(settingsGroupBox); QLabel *firstLineLabel = new QLabel(settingsGroupBox); firstLineLabel->setText(i18n("First spoken line:")); firstLineLabel->setBuddy(m_firstLineTimeEdit); m_lastLineTimeEdit = new TimeEdit(settingsGroupBox); QLabel *lastLineLabel = new QLabel(settingsGroupBox); lastLineLabel->setText(i18n("Last spoken line:")); lastLineLabel->setBuddy(m_lastLineTimeEdit); QGridLayout *settingsLayout = createLayout(settingsGroupBox); settingsLayout->addWidget(firstLineLabel, 0, 0, Qt::AlignRight | Qt::AlignVCenter); settingsLayout->addWidget(m_firstLineTimeEdit, 0, 1); settingsLayout->addWidget(lastLineLabel, 1, 0, Qt::AlignRight | Qt::AlignVCenter); settingsLayout->addWidget(m_lastLineTimeEdit, 1, 1); } Time AdjustTimesDialog::firstLineTime() const { return Time(m_firstLineTimeEdit->value()); } void AdjustTimesDialog::setFirstLineTime(const Time &time) { m_firstLineTimeEdit->setValue(time.toMillis()); } Time AdjustTimesDialog::lastLineTime() const { return Time(m_lastLineTimeEdit->value()); } void AdjustTimesDialog::setLastLineTime(const Time &time) { m_lastLineTimeEdit->setValue(time.toMillis()); }
{ "pile_set_name": "Github" }
<html> <head> <title>libogg - function - ogg_sync_reset</title> <link rel=stylesheet href="style.css" type="text/css"> </head> <body bgcolor=white text=black link="#5555ff" alink="#5555ff" vlink="#5555ff"> <table border=0 width=100%> <tr> <td><p class=tiny>libogg documentation</p></td> <td align=right><p class=tiny>libogg release 1.3.2 - 20140527</p></td> </tr> </table> <h1>ogg_sync_reset</h1> <p><i>declared in "ogg/ogg.h";</i></p> <p>This function is used to reset the internal counters of the <a href="ogg_sync_state.html">ogg_sync_state</a> struct to initial values. <p>It is a good idea to call this before seeking within a bitstream. <br><br> <table border=0 color=black cellspacing=0 cellpadding=7> <tr bgcolor=#cccccc> <td> <pre><b> int ogg_sync_reset(<a href="ogg_sync_state.html">ogg_sync_state</a> *oy); </b></pre> </td> </tr> </table> <h3>Parameters</h3> <dl> <dt><i>oy</i></dt> <dd>Pointer to a previously declared <a href="ogg_sync_state.html">ogg_sync_state</a> struct.</dd> </dl> <h3>Return Values</h3> <blockquote> <li> 0 is always returned.</li> </blockquote> <p> <br><br> <hr noshade> <table border=0 width=100%> <tr valign=top> <td><p class=tiny>copyright &copy; 2000-2014 Xiph.Org</p></td> <td align=right><p class=tiny><a href="http://www.xiph.org/ogg/">Ogg Container Format</a></p></td> </tr><tr> <td><p class=tiny>libogg documentation</p></td> <td align=right><p class=tiny>libogg release 1.3.2 - 20140527</p></td> </tr> </table> </body> </html>
{ "pile_set_name": "Github" }
#register SLF4JBridgeHandler as handler for the j.u.l. root logger handlers = org.slf4j.bridge.SLF4JBridgeHandler
{ "pile_set_name": "Github" }
package teammates.ui.output; /** * The API output format of a archived course status. */ public class CourseArchiveData extends ApiOutput { private final String courseId; private final boolean isArchived; public CourseArchiveData(String courseId, boolean isArchived) { this.courseId = courseId; this.isArchived = isArchived; } public String getCourseId() { return courseId; } public boolean getIsArchived() { return isArchived; } }
{ "pile_set_name": "Github" }
/* UnoJoy.h * Alan Chatham - 2012 * RMIT Exertion Games Lab * * This library gives you a standard way to create Arduino code that talks * to the UnoJoy firmware in order to make native USB game controllers. * Functions: * setupMegaJoy() * getBlankDataForController() * setControllerData(megaJoyControllerData_t dataToSet) * * NOTE: You cannot use pins 0 or 1 if you use this code - they are used by the serial communication. * Also, the setupMegaJoy() function starts the serial port at 38400, so if you're using * the serial port to debug and it's not working, this may be your problem. * * === How to use this library === * If you want, you can move this file into your Arduino/Libraries folder, then use it like a normal library. * However, since you'll need to refer to the details of the megaJoyControllerData_t struct in this file, I would suggest you use * it by adding it to your Arduino sketch manually (in Arduino, go to Sketch->Add file...) * * To use this library to make a controller, you'll need to do 3 things: * Call setupMegaJoy(); in the setup() block * Create and populate a megaJoyControllerData_t type variable and fill it with your data * The getBlankDataForController() function is good for that. * Call setControllerData(yourData); where yourData is the variable from above, * somewhere in your loop(), once you're ready to push your controller data to the system. * If you forget to call sendControllerData in your loop, your controller won't ever do anything * * You can then debug the controller with the included Processing sketch, UnoJoyProcessingVisualizer * * To turn it into an actual USB video game controller, you'll reflash the * Arduino's communication's chip using the instructions found in the 'Firmware' folder, * then unplug and re-plug in the Arduino. * * Details about the megaJoyControllerData_t type are below, but in order to create and use it, * you'll declare it like: * * megaJoyControllerData_t sexyControllerData; * * and then control button presses and analog stick movement with statements like: * * sexyControllerData.triangleOn = 1; // Marks the triangle button as pressed * sexyControllerData.squareOn = 0; // Marks the square button as unpressed * sexyControllerData.leftStickX = 90; // Analog stick values can range from 0 - 255 */ #ifndef UNOJOY_H #define UNOJOY_H #include <stdint.h> #include <util/atomic.h> #include <Arduino.h> // This struct is the core of the library. // You'll create an instance of this and manipulate it, // then use the setControllerData function to send that data out. // Don't change this - the order of the fields is important for // the communication between the Arduino and it's communications chip. #define BUTTON_ARRAY_SIZE 8 #define ANALOG_AXIS_ARRAY_SIZE 12 typedef struct megaJoyControllerData_t { uint8_t buttonArray[BUTTON_ARRAY_SIZE]; uint8_t dpad0LeftOn : 1; uint8_t dpad0UpOn : 1; uint8_t dpad0RightOn : 1; uint8_t dpad0DownOn : 1; uint8_t dpad1LeftOn : 1; uint8_t dpad1UpOn : 1; uint8_t dpad1RightOn : 1; uint8_t dpad1DownOn : 1; int16_t analogAxisArray[ANALOG_AXIS_ARRAY_SIZE]; } megaJoyControllerData_t; // Call setupMegaJoy in the setup block of your program. // It sets up the hardware UnoJoy needs to work properly void setupMegaJoy(void); // This sets the controller to reflect the button and // joystick positions you input (as a megaJoyControllerData_t). // The controller will just send a zeroed (joysticks centered) // signal until you tell it otherwise with this function. void setControllerData(megaJoyControllerData_t); // This function gives you a quick way to get a fresh // megaJoyControllerData_t with: // No buttons pressed // Joysticks centered // Very useful for starting each loop with a blank controller, for instance. // It returns a megaJoyControllerData_t, so you want to call it like: // myControllerData = getBlankDataForController(); megaJoyControllerData_t getBlankDataForMegaController(void); // You can also call the setup function with an integer argument // declaring how often, in milliseconds, the buffer should send its data // via the serial port. Use it if you need to do a lot of processing and // the serial stuff is messing you up, but it'll make your controller // more laggy. // IMPORTANT - you can't make this value greater than 20 or so - the code // on the communications chip times out on each serial read after 25ms. // If you need more time than 20ms, you'll have to alter the code for the // ATmega8u2 as well void setupMegaJoy(int); //----- End of the interface code you should be using -----// //----- Below here is the actual implementation of // This megaJoyControllerData_t is used to store // the controller data that you want to send // out to the controller. You shouldn't mess // with this directly - call setControllerData instead megaJoyControllerData_t controllerDataBuffer; // This updates the data that the controller is sending out. // The system actually works as following: // The UnoJoy firmware on the ATmega8u2 regularly polls the // Arduino chip for individual bytes of a megaJoyControllerData_t. // void setControllerData(megaJoyControllerData_t controllerData){ // Probably unecessary, but this guarantees that the data // gets copied to our buffer all at once. ATOMIC_BLOCK(ATOMIC_FORCEON){ controllerDataBuffer = controllerData; } } // serialCheckInterval governs how many ms between // checks to the serial port for data. // It shouldn't go above 20 or so, otherwise you might // get unreliable data transmission to the UnoJoy firmware, // since after it sends a request, it waits 25 ms for a response. // If you really need to make it bigger than that, you'll have to // adjust that timeout in the UnoJoy ATmega8u2 firmware code as well. volatile int serialCheckInterval = 1; // This is an internal counter variable to count ms between // serial check times int serialCheckCounter = 0; // This is the setup function - it sets up the serial communication // and the timer interrupt for actually sending the data back and forth. void setupMegaJoy(void){ // First, let's zero out our controller data buffer (center the sticks) controllerDataBuffer = getBlankDataForController(); // Start the serial port at the specific, low-error rate UnoJoy uses. // If you want to change the rate, you'll have to change it in the // firmware for the ATmega8u2 as well. 250,000 is actually the best rate, // but it's not supported on Macs, breaking the processing debugger. Serial.begin(38400); // Now set up the Timer 0 compare register A // so that Timer0 (used for millis() and such) // also fires an interrupt when it's equal to // 128, not just on overflow. // This will fire our timer interrupt almost // every 1 ms (1024 us to be exact). OCR0A = 128; TIMSK0 |= (1 << OCIE0A); } // If you really need to change the serial polling // interval, use this function to initialize UnoJoy. // interval is the polling frequency, in ms. void setupMegaJoy(int interval){ serialCheckInterval = interval; setupMegaJoy(); } // This interrupt gets called approximately once per ms. // It counts how many ms between serial port polls, // and if it's been long enough, polls the serial // port to see if the UnoJoy firmware requested data. // If it did, it transmits the appropriate data back. ISR(TIMER0_COMPA_vect){ serialCheckCounter++; if (serialCheckCounter >= serialCheckInterval){ serialCheckCounter = 0; // If there is incoming data stored in the Arduino serial buffer while (Serial.available() > 0) { //pinMode(13, OUTPUT); //digitalWrite(13, HIGH); // Get incoming byte from the ATmega8u2 byte inByte = Serial.read(); // That number tells us which byte of the megaJoyControllerData_t struct // to send out. Serial.write(((uint8_t*)&controllerDataBuffer)[inByte]); //digitalWrite(13, LOW); } } } // Returns a zeroed out (joysticks centered) // megaJoyControllerData_t variable megaJoyControllerData_t getBlankDataForMegaController(void){ // Create a megaJoyControllerData_t megaJoyControllerData_t controllerData; // Make the buttons zero for (int i = 0; i < 8; i++){ controllerData.buttonArray[i] = 0; } controllerData.dpad0LeftOn = 0; controllerData.dpad0UpOn = 0; controllerData.dpad0RightOn = 0; controllerData.dpad0DownOn = 0; controllerData.dpad1LeftOn = 0; controllerData.dpad1UpOn = 0; controllerData.dpad1RightOn = 0; controllerData.dpad1DownOn = 0; //Set the sticks to 512 - centered for (int i = 0; i < ANALOG_AXIS_ARRAY_SIZE; i++{ controllerData.analogAxisArray[i] = 512; } // And return the data! return controllerData; } #endif
{ "pile_set_name": "Github" }
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; class CreateReleaseextrafullTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('releaseextrafull', function (Blueprint $table) { $table->engine = 'InnoDB'; $table->charset = 'utf8'; $table->collation = 'utf8_unicode_ci'; $table->integer('releases_id')->unsigned()->primary()->comment('FK to releases.id'); $table->text('mediainfo', 65535)->nullable(); $table->foreign('releases_id', 'FK_ref_releases')->references('id')->on('releases')->onUpdate('CASCADE')->onDelete('CASCADE'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::drop('releaseextrafull'); } }
{ "pile_set_name": "Github" }
# Swaggest JSON-schema implementation for PHP [![Build Status](https://travis-ci.org/swaggest/php-json-schema.svg?branch=master)](https://travis-ci.org/swaggest/php-json-schema) [![Code Climate](https://codeclimate.com/github/swaggest/php-json-schema/badges/gpa.svg)](https://codeclimate.com/github/swaggest/php-json-schema) [![codecov](https://codecov.io/gh/swaggest/php-json-schema/branch/master/graph/badge.svg)](https://codecov.io/gh/swaggest/php-json-schema) ![Code lines](https://sloc.xyz/github/swaggest/php-json-schema/?category=code) ![Comments](https://sloc.xyz/github/swaggest/php-json-schema/?category=comments) High definition PHP structures with JSON-schema based validation. Supported schemas: * [JSON Schema Draft 7](http://json-schema.org/specification-links.html#draft-7) * [JSON Schema Draft 6](http://json-schema.org/specification-links.html#draft-6) * [JSON Schema Draft 4](http://json-schema.org/specification-links.html#draft-4) ## Installation ``` composer require swaggest/json-schema ``` ## Usage Structure definition can be done either with `json-schema` or with `PHP` class extending `Swaggest\JsonSchema\Structure\ClassStructure` ### Validating JSON data against given schema Define your json-schema ```php $schemaJson = <<<'JSON' { "type": "object", "properties": { "id": { "type": "integer" }, "name": { "type": "string" }, "orders": { "type": "array", "items": { "$ref": "#/definitions/order" } } }, "required":["id"], "definitions": { "order": { "type": "object", "properties": { "id": { "type": "integer" }, "price": { "type": "number" }, "updated": { "type": "string", "format": "date-time" } }, "required":["id"] } } } JSON; ``` Load it ```php $schema = Schema::import(json_decode($schemaJson)); ``` Validate data ```php $schema->in(json_decode(<<<'JSON' { "id": 1, "name":"John Doe", "orders":[ { "id":1 }, { "price":1.0 } ] } JSON )); // Exception: Required property missing: id at #->properties:orders->items[1]->#/definitions/order ``` You can also call `Schema::import` on string `uri` to schema json data. ```php $schema = Schema::import('http://localhost:1234/my_schema.json'); ``` Or with boolean argument. ```php $schema = Schema::import(true); // permissive schema, always validates $schema = Schema::import(false); // restrictive schema, always invalidates ``` ### Understanding error cause With complex schemas it may be hard to find out what's wrong with your data. Exception message can look like: ``` No valid results for oneOf { 0: Enum failed, enum: ["a"], data: "f" at #->properties:root->patternProperties[^[a-zA-Z0-9_]+$]:zoo->oneOf[0] 1: Enum failed, enum: ["b"], data: "f" at #->properties:root->patternProperties[^[a-zA-Z0-9_]+$]:zoo->oneOf[1] 2: No valid results for anyOf { 0: Enum failed, enum: ["c"], data: "f" at #->properties:root->patternProperties[^[a-zA-Z0-9_]+$]:zoo->oneOf[2]->$ref[#/cde]->anyOf[0] 1: Enum failed, enum: ["d"], data: "f" at #->properties:root->patternProperties[^[a-zA-Z0-9_]+$]:zoo->oneOf[2]->$ref[#/cde]->anyOf[1] 2: Enum failed, enum: ["e"], data: "f" at #->properties:root->patternProperties[^[a-zA-Z0-9_]+$]:zoo->oneOf[2]->$ref[#/cde]->anyOf[2] } at #->properties:root->patternProperties[^[a-zA-Z0-9_]+$]:zoo->oneOf[2]->$ref[#/cde] } at #->properties:root->patternProperties[^[a-zA-Z0-9_]+$]:zoo ``` For ambiguous schemas defined with `oneOf`/`anyOf` message is indented multi-line string. Processing path is a combination of schema and data pointers. You can use `InvalidValue->getSchemaPointer()` and `InvalidValue->getDataPointer()` to extract schema/data pointer. You can receive `Schema` instance that failed validation with `InvalidValue->getFailedSubSchema`. You can build error tree using `InvalidValue->inspect()`. ### PHP structured classes with validation ```php /** * @property int $quantity PHPDoc defined dynamic properties will be validated on every set */ class User extends ClassStructure { /* Native (public) properties will be validated only on import and export of structure data */ /** @var int */ public $id; public $name; /** @var Order[] */ public $orders; /** @var UserInfo */ public $info; /** * @param Properties|static $properties * @param Schema $ownerSchema */ public static function setUpProperties($properties, Schema $ownerSchema) { // You can add custom meta to your schema $dbTable = new DbTable; $dbTable->tableName = 'users'; $ownerSchema->addMeta($dbTable); // Setup property schemas $properties->id = Schema::integer(); $properties->id->addMeta(new DbId($dbTable)); // You can add meta to property. $properties->name = Schema::string(); // You can embed structures to main level with nested schemas $properties->info = UserInfo::schema()->nested(); // You can set default value for property $defaultOptions = new UserOptions(); $defaultOptions->autoLogin = true; $defaultOptions->groupName = 'guest'; // UserOptions::schema() is safe to change as it is protected with lazy cloning $properties->options = UserOptions::schema()->setDefault(UserOptions::export($defaultOptions)); // Dynamic (phpdoc-defined) properties can be used as well $properties->quantity = Schema::integer(); $properties->quantity->minimum = 0; // Property can be any complex structure $properties->orders = Schema::create(); $properties->orders->items = Order::schema(); $ownerSchema->required = array(self::names()->id); } } class UserInfo extends ClassStructure { public $firstName; public $lastName; public $birthDay; /** * @param Properties|static $properties * @param Schema $ownerSchema */ public static function setUpProperties($properties, Schema $ownerSchema) { $properties->firstName = Schema::string(); $properties->lastName = Schema::string(); $properties->birthDay = Schema::string(); } } class UserOptions extends ClassStructure { public $autoLogin; public $groupName; /** * @param Properties|static $properties * @param Schema $ownerSchema */ public static function setUpProperties($properties, Schema $ownerSchema) { $properties->autoLogin = Schema::boolean(); $properties->groupName = Schema::string(); } } class Order implements ClassStructureContract { use ClassStructureTrait; // You can use trait if you can't/don't want to extend ClassStructure const FANCY_MAPPING = 'fAnCy'; // You can create additional mapping namespace public $id; public $userId; public $dateTime; public $price; /** * @param Properties|static $properties * @param Schema $ownerSchema */ public static function setUpProperties($properties, Schema $ownerSchema) { // Add some meta data to your schema $dbMeta = new DbTable(); $dbMeta->tableName = 'orders'; $ownerSchema->addMeta($dbMeta); // Define properties $properties->id = Schema::integer(); $properties->userId = User::properties()->id; // referencing property of another schema keeps meta $properties->dateTime = Schema::string(); $properties->dateTime->format = Format::DATE_TIME; $properties->price = Schema::number(); $ownerSchema->required[] = self::names()->id; // Define default mapping if any $ownerSchema->addPropertyMapping('date_time', Order::names()->dateTime); // Define additional mapping $ownerSchema->addPropertyMapping('DaTe_TiMe', Order::names()->dateTime, self::FANCY_MAPPING); $ownerSchema->addPropertyMapping('Id', Order::names()->id, self::FANCY_MAPPING); $ownerSchema->addPropertyMapping('PrIcE', Order::names()->price, self::FANCY_MAPPING); } } ``` Validation of dynamic properties is performed on set, this can help to find source of invalid data at cost of some performance drop ```php $user = new User(); $user->quantity = -1; // Exception: Value more than 0 expected, -1 received ``` Validation of native properties is performed only on import/export ```php $user = new User(); $user->quantity = 10; User::export($user); // Exception: Required property missing: id ``` Error messages provide a path to invalid data ```php $user = new User(); $user->id = 1; $user->name = 'John Doe'; $order = new Order(); $order->dateTime = (new \DateTime())->format(DATE_RFC3339); $user->orders[] = $order; User::export($user); // Exception: Required property missing: id at #->properties:orders->items[0] ``` #### Nested structures Nested structures allow you to make composition: flatten several objects in one and separate back. ```php $user = new User(); $user->id = 1; $info = new UserInfo(); $info->firstName = 'John'; $info->lastName = 'Doe'; $info->birthDay = '1970-01-01'; $user->info = $info; $json = <<<JSON { "id": 1, "firstName": "John", "lastName": "Doe", "birthDay": "1970-01-01" } JSON; $exported = User::export($user); $this->assertSame($json, json_encode($exported, JSON_PRETTY_PRINT)); $imported = User::import(json_decode($json)); $this->assertSame('John', $imported->info->firstName); $this->assertSame('Doe', $imported->info->lastName); ``` You can also use `\Swaggest\JsonSchema\Structure\Composition` to dynamically create schema compositions. This can be helpful to deal with results of database query on joined data. ```php $schema = new Composition(UserInfo::schema(), Order::schema()); $json = <<<JSON { "id": 1, "firstName": "John", "lastName": "Doe", "price": 2.66 } JSON; $object = $schema->import(json_decode($json)); // Get particular object with `pick` accessor $info = UserInfo::pick($object); $order = Order::pick($object); // Data is imported objects of according classes $this->assertTrue($order instanceof Order); $this->assertTrue($info instanceof UserInfo); $this->assertSame(1, $order->id); $this->assertSame('John', $info->firstName); $this->assertSame('Doe', $info->lastName); $this->assertSame(2.66, $order->price); ``` #### Keys mapping If property names of PHP objects should be different from raw data you can call `->addPropertyMapping` on owner schema. ```php // Define default mapping if any $ownerSchema->addPropertyMapping('date_time', Order::names()->dateTime); // Define additional mapping $ownerSchema->addPropertyMapping('DaTe_TiMe', Order::names()->dateTime, self::FANCY_MAPPING); $ownerSchema->addPropertyMapping('Id', Order::names()->id, self::FANCY_MAPPING); $ownerSchema->addPropertyMapping('PrIcE', Order::names()->price, self::FANCY_MAPPING); ``` It will affect data mapping: ```php $order = new Order(); $order->id = 1; $order->dateTime = '2015-10-28T07:28:00Z'; $order->price = 2.2; $exported = Order::export($order); $json = <<<JSON { "id": 1, "date_time": "2015-10-28T07:28:00Z", "price": 2.2 } JSON; $this->assertSame($json, json_encode($exported, JSON_PRETTY_PRINT)); $imported = Order::import(json_decode($json)); $this->assertSame('2015-10-28T07:28:00Z', $imported->dateTime); ``` You can have multiple mapping namespaces, controlling with `mapping` property of `Context` ```php $options = new Context(); $options->mapping = Order::FANCY_MAPPING; $exported = Order::export($order, $options); $json = <<<JSON { "Id": 1, "DaTe_TiMe": "2015-10-28T07:28:00Z", "PrIcE": 2.2 } JSON; $this->assertSame($json, json_encode($exported, JSON_PRETTY_PRINT)); $imported = Order::import(json_decode($json), $options); $this->assertSame('2015-10-28T07:28:00Z', $imported->dateTime); ``` You can create your own pre-processor implementing `Swaggest\JsonSchema\DataPreProcessor`. #### Meta `Meta` is a way to complement `Schema` with your own data. You can keep and retrieve it. You can store it. ```php $dbMeta = new DbTable(); $dbMeta->tableName = 'orders'; $ownerSchema->addMeta($dbMeta); ``` And get back. ```php // Retrieving meta $dbTable = DbTable::get(Order::schema()); $this->assertSame('orders', $dbTable->tableName); ``` #### Mapping without validation If you want to tolerate invalid data or improve mapping performance you can specify `skipValidation` flag in processing `Context` ```php $schema = Schema::object(); $schema->setProperty('one', Schema::integer()); $schema->properties->one->minimum = 5; $options = new Context(); $options->skipValidation = true; $res = $schema->in(json_decode('{"one":4}'), $options); $this->assertSame(4, $res->one); ``` #### Overriding mapping classes If you want to map data to a different class you can register mapping at top level of your importer structure. ```php class CustomSwaggerSchema extends SwaggerSchema { public static function import($data, Context $options = null) { if ($options === null) { $options = new Context(); } $options->objectItemClassMapping[Schema::className()] = CustomSchema::className(); return parent::import($data, $options); } } ``` Or specify it in processing context ```php $context = new Context(); $context->objectItemClassMapping[Schema::className()] = CustomSchema::className(); $schema = SwaggerSchema::schema()->in(json_decode( file_get_contents(__DIR__ . '/../../../../spec/petstore-swagger.json') ), $context); $this->assertInstanceOf(CustomSchema::className(), $schema->definitions['User']); ``` ## Code quality and test coverage Some code quality best practices are deliberately violated here (see [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/swaggest/php-json-schema/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/swaggest/php-json-schema/?branch=master) ) to allow best performance at maintenance cost. Those violations are secured by comprehensive test coverage: * draft-04, draft-06, draft-07 of [JSON-Schema-Test-Suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite) * test cases (excluding `$data` and few tests) of [epoberezkin/ajv](https://github.com/epoberezkin/ajv/tree/master/spec) (a mature js implementation) ## Contributing Issues and pull requests are welcome! [![](https://sourcerer.io/fame/vearutop/swaggest/php-json-schema/images/0)](https://sourcerer.io/fame/vearutop/swaggest/php-json-schema/links/0)[![](https://sourcerer.io/fame/vearutop/swaggest/php-json-schema/images/1)](https://sourcerer.io/fame/vearutop/swaggest/php-json-schema/links/1)[![](https://sourcerer.io/fame/vearutop/swaggest/php-json-schema/images/2)](https://sourcerer.io/fame/vearutop/swaggest/php-json-schema/links/2)[![](https://sourcerer.io/fame/vearutop/swaggest/php-json-schema/images/3)](https://sourcerer.io/fame/vearutop/swaggest/php-json-schema/links/3)[![](https://sourcerer.io/fame/vearutop/swaggest/php-json-schema/images/4)](https://sourcerer.io/fame/vearutop/swaggest/php-json-schema/links/4)[![](https://sourcerer.io/fame/vearutop/swaggest/php-json-schema/images/5)](https://sourcerer.io/fame/vearutop/swaggest/php-json-schema/links/5)[![](https://sourcerer.io/fame/vearutop/swaggest/php-json-schema/images/6)](https://sourcerer.io/fame/vearutop/swaggest/php-json-schema/links/6)[![](https://sourcerer.io/fame/vearutop/swaggest/php-json-schema/images/7)](https://sourcerer.io/fame/vearutop/swaggest/php-json-schema/links/7)
{ "pile_set_name": "Github" }
@echo off powershell -c ".\deploy.ps1 -source (Join-Path target (Get-Item -Path .\target\* -Filter *.jar)[0].Name) -dest ripme.jar"
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" tools:context="com.ocnyang.contourviewdemo.ContourActivity"> <android.support.design.widget.AppBarLayout android:id="@+id/app_bar" android:layout_width="match_parent" android:layout_height="@dimen/app_bar_height" android:fitsSystemWindows="true" android:theme="@style/AppBarOverlay"> <android.support.design.widget.CollapsingToolbarLayout android:id="@+id/toolbar_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" app:contentScrim="?attr/colorPrimary" app:layout_scrollFlags="scroll|exitUntilCollapsed" app:toolbarId="@+id/toolbar"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" app:layout_collapseMode="pin" app:popupTheme="@style/PopupOverlay"/> </android.support.design.widget.CollapsingToolbarLayout> </android.support.design.widget.AppBarLayout> <include layout="@layout/content_contour"/> <android.support.design.widget.FloatingActionButton android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="@dimen/fab_margin" app:layout_anchor="@id/app_bar" app:layout_anchorGravity="bottom|end" app:srcCompat="@drawable/github"/> </android.support.design.widget.CoordinatorLayout>
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html> <head> <title>cancel</title> <link rel="stylesheet" href="prism.css"> <link rel="stylesheet" href="style.css"> </head> <body> <div id="header"> <div class="doc-title"><a href="folktale.html"><span class="doc-title"><span class="product-name">Folktale</span><span class="version">v2.0.1</span></span></a><ul class="navigation"><li class="navigation-item"><a href="https://github.com/origamitower/folktale" title="">GitHub</a></li><li class="navigation-item"><a href="folktale.html#cat-2-support" title="">Support</a></li><li class="navigation-item"><a href="folktale.html#cat-3-contributing" title="">Contributing</a></li></ul></div> </div> <div id="content-wrapper"><div id="content-panel"><h1 class="entity-title">cancel</h1><div class="highlight-summary"><div><p>Resolves a deferred with a cancellation value.</p> </div></div><div class="definition"><h2 class="section-title" id="signature">Signature</h2><div class="signature">cancel()</div><div class="type-definition"><div class="type-definition-container"><div class="type-title-container"><strong class="type-title">Type</strong><a class="info" href="guides.type-notation-used-in-signatures.html">(what is this?)</a></div><pre class="type"><code class="language-haskell">('a: Deferred 'f 's).() =&gt; 'a :: mutates 'a</code></pre></div></div></div><h2 class="section-title">Documentation</h2><div class="documentation"><div><p>Resolves a deferred with a cancellation value.</p> </div></div><div class="members"><h2 class="section-title" id="properties">Properties</h2></div><div class="source-code"><h2 class="section-title" id="source-code">Source Code</h2><div class="source-location">Defined in source/concurrency/future/_deferred.js at line 58, column 21</div><pre class="source-code"><code class="language-javascript">cancel() { moveToState(this, Cancelled()); return this; }</code></pre></div></div><div id="meta-panel"><div class="meta-section"><div class="meta-field"><strong class="meta-field-title">Licence</strong><div class="meta-field-value">MIT</div></div><div class="meta-field"><strong class="meta-field-title">Module</strong><div class="meta-field-value">folktale/concurrency/future/_deferred</div></div></div><div class="table-of-contents"><div class="meta-section-title">On This Page</div><ul class="toc-list level-1"><li class="toc-item"><a href="#signature">Signature</a></li><li class="toc-item"><span class="no-anchor">Documentation</span><ul class="toc-list level-2"></ul></li><li class="toc-item"><a href="#properties">Properties</a><ul class="toc-list level-2"></ul></li><li class="toc-item"><a href="#source-code">Source Code</a></li></ul></div><div class="meta-section"><strong class="meta-section-title">Authors</strong><div class="meta-field"><strong class="meta-field-title">Copyright</strong><div class="meta-field-value">(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS</div></div><div class="meta-field"><strong class="meta-field-title">Authors</strong><div class="meta-field-value"><ul class="meta-list"><li>Quildreen Motta</li></ul></div></div><div class="meta-field"><strong class="meta-field-title">Maintainers</strong><div class="meta-field-value"><ul class="meta-list"><li>Quildreen Motta &lt;queen@robotlolita.me&gt; (http://robotlolita.me/)</li></ul></div></div></div></div></div> <script> void function() { var xs = document.querySelectorAll('.documentation pre code'); for (var i = 0; i < xs.length; ++i) { xs[i].className = 'language-javascript code-block'; } }() </script> <script src="prism.js"></script> </body> </html>
{ "pile_set_name": "Github" }
/* Processed by ecpg (regression mode) */ /* These include files are added by the preprocessor */ #include <ecpglib.h> #include <ecpgerrno.h> #include <sqlca.h> /* End of automatic include section */ #define ECPGdebug(X, Y) ECPGdebug((X) + 100, (Y)) #line 1 "define.pgc" #include <stdlib.h> #include <string.h> #include <stdlib.h> #include <stdio.h> #line 1 "regression.h" #line 6 "define.pgc" /* exec sql whenever sqlerror sqlprint ; */ #line 8 "define.pgc" /* exec sql type intarray is int [ 6 ] */ #line 13 "define.pgc" typedef int intarray[6]; int main(void) { /* exec sql begin declare section */ typedef char string[8]; #line 21 "define.pgc" #line 22 "define.pgc" intarray amount; #line 23 "define.pgc" char name[6][8]; #line 24 "define.pgc" char letter[6][1]; /* exec sql end declare section */ #line 29 "define.pgc" int i, j; ECPGdebug(1, stderr); { ECPGconnect(__LINE__, 0, "regress1", NULL, NULL, NULL, 0); #line 34 "define.pgc" if (sqlca.sqlcode < 0) sqlprint(); } #line 34 "define.pgc" { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table test ( name char ( 8 ) , amount int , letter char ( 1 ) )", ECPGt_EOIT, ECPGt_EORT); #line 36 "define.pgc" if (sqlca.sqlcode < 0) sqlprint(); } #line 36 "define.pgc" { ECPGtrans(__LINE__, NULL, "commit"); #line 37 "define.pgc" if (sqlca.sqlcode < 0) sqlprint(); } #line 37 "define.pgc" { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into Test ( name , amount , letter ) values ( 'false' , 1 , 'f' )", ECPGt_EOIT, ECPGt_EORT); #line 39 "define.pgc" if (sqlca.sqlcode < 0) sqlprint(); } #line 39 "define.pgc" { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into test ( name , amount , letter ) values ( 'true' , 2 , 't' )", ECPGt_EOIT, ECPGt_EORT); #line 40 "define.pgc" if (sqlca.sqlcode < 0) sqlprint(); } #line 40 "define.pgc" { ECPGtrans(__LINE__, NULL, "commit"); #line 41 "define.pgc" if (sqlca.sqlcode < 0) sqlprint(); } #line 41 "define.pgc" { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select * from test", ECPGt_EOIT, ECPGt_char, (name), (long)8, (long)6, (8) * sizeof(char), ECPGt_NO_INDICATOR, NULL, 0L, 0L, 0L, ECPGt_int, (amount), (long)1, (long)6, sizeof(int), ECPGt_NO_INDICATOR, NULL, 0L, 0L, 0L, ECPGt_char, (letter), (long)1, (long)6, (1) * sizeof(char), ECPGt_NO_INDICATOR, NULL, 0L, 0L, 0L, ECPGt_EORT); #line 43 "define.pgc" if (sqlca.sqlcode < 0) sqlprint(); } #line 43 "define.pgc" for (i = 0, j = sqlca.sqlerrd[2]; i < j; i++) { /* exec sql begin declare section */ #line 48 "define.pgc" char n[8], l = letter[i][0]; #line 49 "define.pgc" int a = amount[i]; /* exec sql end declare section */ #line 50 "define.pgc" strncpy(n, name[i], 8); printf("name[%d]=%8.8s\tamount[%d]=%d\tletter[%d]=%c\n", i, n, i, a, i, l); } { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "drop table test", ECPGt_EOIT, ECPGt_EORT); #line 56 "define.pgc" if (sqlca.sqlcode < 0) sqlprint(); } #line 56 "define.pgc" { ECPGtrans(__LINE__, NULL, "commit"); #line 57 "define.pgc" if (sqlca.sqlcode < 0) sqlprint(); } #line 57 "define.pgc" { ECPGdisconnect(__LINE__, "CURRENT"); #line 58 "define.pgc" if (sqlca.sqlcode < 0) sqlprint(); } #line 58 "define.pgc" return (0); }
{ "pile_set_name": "Github" }
/*! * \copy * Copyright (c) 2013, Cisco Systems * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * */ // wels_func_ptr_def.h #ifndef WELS_ENCODER_FUNCTION_POINTERS_DEFINITION_H_ #define WELS_ENCODER_FUNCTION_POINTERS_DEFINITION_H_ #include "typedefs.h" #include "wels_common_basis.h" #include "svc_enc_macroblock.h" #include "mb_cache.h" #include "slice.h" #include "svc_enc_slice_segment.h" #include "svc_enc_frame.h" #include "expand_pic.h" #include "rc.h" #include "IWelsVP.h" #include "mc.h" namespace WelsEnc { typedef struct TagWelsEncCtx sWelsEncCtx; typedef struct TagWelsFuncPointerList SWelsFuncPtrList; typedef struct TagVAAFrameInfo SVAAFrameInfo; typedef struct TagWelsME SWelsME; typedef struct TagWelsMD SWelsMD; typedef void (*PSetMemoryZero) (void* pDst, int32_t iSize); typedef void (*PDctFunc) (int16_t* pDct, uint8_t* pSample1, int32_t iStride1, uint8_t* pSample2, int32_t iStride2); typedef void (*PCopyFunc) (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS); typedef void (*PIDctFunc) (uint8_t* pRec, int32_t iStride, uint8_t* pPred, int32_t iPredStride, int16_t* pRes); typedef void (*PDeQuantizationFunc) (int16_t* pRes, const uint16_t* kpQpTable); typedef void (*PDeQuantizationHadamardFunc) (int16_t* pRes, const uint16_t kuiMF); typedef int32_t (*PGetNoneZeroCountFunc) (int16_t* pLevel); typedef void (*PScanFunc) (int16_t* pLevel, int16_t* pDct); typedef int32_t (*PCalculateSingleCtrFunc) (int16_t* pDct); typedef void (*PTransformHadamard4x4Func) (int16_t* pLumaDc, int16_t* pDct); typedef void (*PQuantizationFunc) (int16_t* pDct, const int16_t* pFF, const int16_t* pMF); typedef void (*PQuantizationMaxFunc) (int16_t* pDct, const int16_t* pFF, const int16_t* pMF, int16_t* pMax); typedef void (*PQuantizationDcFunc) (int16_t* pDct, int16_t iFF, int16_t iMF); typedef int32_t (*PQuantizationSkipFunc) (int16_t* pDct, int16_t iFF, int16_t iMF); typedef int32_t (*PQuantizationHadamardFunc) (int16_t* pRes, const int16_t kiFF, int16_t iMF, int16_t* pDct, int16_t* pBlock); typedef void (*PLumaDeblockingLT4Func) (uint8_t* iSampleY, int32_t iStride, int32_t iAlpha, int32_t iBeta, int8_t* iTc); typedef void (*PLumaDeblockingEQ4Func) (uint8_t* iSampleY, int32_t iStride, int32_t iAlpha, int32_t iBeta); typedef void (*PChromaDeblockingLT4Func) (uint8_t* iSampleCb, uint8_t* iSampleCr, int32_t iStride, int32_t iAlpha, int32_t iBeta, int8_t* iTc); typedef void (*PChromaDeblockingEQ4Func) (uint8_t* iSampleCb, uint8_t* iSampleCr, int32_t iStride, int32_t iAlpha, int32_t iBeta); typedef void (*PDeblockingBSCalc) (SWelsFuncPtrList* pFunc, SMB* pCurMb, uint8_t uiBS[2][4][4], Mb_Type uiCurMbType, int32_t iMbStride, int32_t iLeftFlag, int32_t iTopFlag); typedef void (*PDeblockingFilterSlice) (SDqLayer* pCurDq, SWelsFuncPtrList* pFunc, const int32_t kiSliceIdx); typedef struct tagDeblockingFunc { PLumaDeblockingLT4Func pfLumaDeblockingLT4Ver; PLumaDeblockingEQ4Func pfLumaDeblockingEQ4Ver; PLumaDeblockingLT4Func pfLumaDeblockingLT4Hor; PLumaDeblockingEQ4Func pfLumaDeblockingEQ4Hor; PChromaDeblockingLT4Func pfChromaDeblockingLT4Ver; PChromaDeblockingEQ4Func pfChromaDeblockingEQ4Ver; PChromaDeblockingLT4Func pfChromaDeblockingLT4Hor; PChromaDeblockingEQ4Func pfChromaDeblockingEQ4Hor; PDeblockingBSCalc pfDeblockingBSCalc; PDeblockingFilterSlice pfDeblockingFilterSlice; } DeblockingFunc; typedef void (*PSetNoneZeroCountZeroFunc) (int8_t* pNonZeroCount); typedef int32_t (*PIntraFineMdFunc) (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SMB* pCurMb, SMbCache* pMbCache); typedef void (*PInterFineMdFunc) (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SSlice* slice, SMB* pCurMb, int32_t bestCost); typedef bool (*PInterMdFirstIntraModeFunc) (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SMB* pCurMb, SMbCache* pMbCache); typedef void (*PFillInterNeighborCacheFunc) (SMbCache* pMbCache, SMB* pCurMb, int32_t iMbWidth, int8_t* pVaaBgMbFlag); typedef void (*PAccumulateSadFunc) (uint32_t* pSumDiff, int32_t* pGomForegroundBlockNum, int32_t* iSad8x8, int8_t* pVaaBgMbFlag);//for RC typedef bool (*PDynamicSlicingStepBackFunc) (sWelsEncCtx* pEncCtx, SSlice* pSlice, SSliceCtx* pSliceCtx, SMB* pCurMb, SDynamicSlicingStack* pDynamicSlicingStack); // 2010.8.17 typedef bool (*PInterMdBackgroundDecisionFunc) (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SSlice* slice, SMB* pCurMb, SMbCache* pMbCache, bool* pKeepPskip); typedef void (*PInterMdBackgroundInfoUpdateFunc) (SDqLayer* pCurLayer, SMB* pCurMb, const bool bFlag, const int32_t kiRefPictureType); typedef bool (*PInterMdScrollingPSkipDecisionFunc) (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SSlice* slice, SMB* pCurMb, SMbCache* pMbCache); typedef void (*PSetScrollingMv) (SVAAFrameInfo* pVaa, SWelsMD* pMd); typedef void (*PInterMdFunc) (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SSlice* slice, SMB* pCurMb, SMbCache* pMbCache); typedef int32_t (*PSampleSadSatdCostFunc) (uint8_t*, int32_t, uint8_t*, int32_t); typedef void (*PSample4SadCostFunc) (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); typedef int32_t (*PIntraPred4x4Combined3Func) (uint8_t*, int32_t, uint8_t*, int32_t, uint8_t*, int32_t*, int32_t, int32_t, int32_t); typedef int32_t (*PIntraPred16x16Combined3Func) (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*); typedef int32_t (*PIntraPred8x8Combined3Func) (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*, uint8_t*, uint8_t*); typedef uint32_t (*PSampleSadHor8Func) (uint8_t*, int32_t, uint8_t*, int32_t, uint16_t*, int32_t*); typedef void (*PMotionSearchFunc) (SWelsFuncPtrList* pFuncList, SDqLayer* pCurDqLayer, SWelsME* pMe, SSlice* pSlice); typedef void (*PSearchMethodFunc) (SWelsFuncPtrList* pFuncList, SWelsME* pMe, SSlice* pSlice, const int32_t kiEncStride, const int32_t kiRefStride); typedef void (*PCalculateSatdFunc) (PSampleSadSatdCostFunc pSatd, SWelsME* pMe, const int32_t kiEncStride, const int32_t kiRefStride); typedef bool (*PCheckDirectionalMv) (PSampleSadSatdCostFunc pSad, SWelsME* pMe, const SMVUnitXY ksMinMv, const SMVUnitXY ksMaxMv, const int32_t kiEncStride, const int32_t kiRefStride, int32_t& iBestSadCost); typedef void (*PLineFullSearchFunc) (SWelsFuncPtrList* pFuncList, SWelsME* pMe, uint16_t* pMvdTable, const int32_t kiEncStride, const int32_t kiRefStride, const int16_t kiMinMv, const int16_t kiMaxMv, const bool bVerticalSearch); typedef void (*PInitializeHashforFeatureFunc) (uint32_t* pTimesOfFeatureValue, uint16_t* pBuf, const int32_t kiListSize, uint16_t** pLocationOfFeature, uint16_t** pFeatureValuePointerList); typedef void (*PFillQpelLocationByFeatureValueFunc) (uint16_t* pFeatureOfBlock, const int32_t kiWidth, const int32_t kiHeight, uint16_t** pFeatureValuePointerList); typedef void (*PCalculateBlockFeatureOfFrame) (uint8_t* pRef, const int32_t kiWidth, const int32_t kiHeight, const int32_t kiRefStride, uint16_t* pFeatureOfBlock, uint32_t pTimesOfFeatureValue[]); typedef int32_t (*PCalculateSingleBlockFeature) (uint8_t* pRef, const int32_t kiRefStride); typedef void (*PUpdateFMESwitch) (SDqLayer* pCurLayer); #define MAX_BLOCK_TYPE BLOCK_SIZE_ALL typedef struct TagSampleDealingFunc { PSampleSadSatdCostFunc pfSampleSad[MAX_BLOCK_TYPE]; PSampleSadSatdCostFunc pfSampleSatd[MAX_BLOCK_TYPE]; PSample4SadCostFunc pfSample4Sad[MAX_BLOCK_TYPE]; PIntraPred4x4Combined3Func pfIntra4x4Combined3Satd; PIntraPred16x16Combined3Func pfIntra16x16Combined3Satd; PIntraPred16x16Combined3Func pfIntra16x16Combined3Sad; PIntraPred8x8Combined3Func pfIntra8x8Combined3Satd; PIntraPred8x8Combined3Func pfIntra8x8Combined3Sad; PSampleSadSatdCostFunc* pfMdCost; PSampleSadSatdCostFunc* pfMeCost; PIntraPred16x16Combined3Func pfIntra16x16Combined3; PIntraPred8x8Combined3Func pfIntra8x8Combined3; PIntraPred4x4Combined3Func pfIntra4x4Combined3; } SSampleDealingFunc; typedef void (*PGetIntraPredFunc) (uint8_t* pPrediction, uint8_t* pRef, const int32_t kiStride); typedef int32_t (*PGetVarianceFromIntraVaaFunc) (uint8_t* pSampelY, const int32_t kiStride); typedef uint8_t (*PGetMbSignFromInterVaaFunc) (int32_t* pSad8x8); typedef void (*PUpdateMbMvFunc) (SMVUnitXY* pMvUnit, const SMVUnitXY ksMv); typedef bool (*PBuildRefListFunc) (sWelsEncCtx* pCtx, const int32_t iPOC, int32_t iBestLtrRefIdx); typedef void (*PMarkPicFunc) (sWelsEncCtx* pCtx); typedef bool (*PUpdateRefListFunc) (sWelsEncCtx* pCtx); typedef void (*PEndofUpdateRefListFunc) (sWelsEncCtx* pCtx); typedef void (*PAfterBuildRefListFunc) (sWelsEncCtx* pCtx); typedef int32_t (*PCavlcParamCalFunc) (int16_t* pCoff, uint8_t* pRun, int16_t* pLevel, int32_t* pTotalCoeffs, int32_t iEndIdx); typedef int32_t (*PWelsSpatialWriteMbSyn) (sWelsEncCtx* pCtx, SSlice* pSlice, SMB* pCurMb); typedef void (*PStashMBStatus) (SDynamicSlicingStack* pDss, SSlice* pSlice, int32_t iMbSkipRun); typedef int32_t (*PStashPopMBStatus) (SDynamicSlicingStack* pDss, SSlice* pSlice); struct TagWelsFuncPointerList { SExpandPicFunc sExpandPicFunc; PFillInterNeighborCacheFunc pfFillInterNeighborCache; PGetVarianceFromIntraVaaFunc pfGetVarianceFromIntraVaa; PGetMbSignFromInterVaaFunc pfGetMbSignFromInterVaa; PUpdateMbMvFunc pfUpdateMbMv; PInterMdFirstIntraModeFunc pfFirstIntraMode; //svc_encode_slice.c svc_mode_decision.c svc_base_layer_md.c PIntraFineMdFunc pfIntraFineMd; //svc_encode_slice.c svc_mode_decision.c svc_base_layer_md.c PInterFineMdFunc pfInterFineMd; //svc_encode_slice.c svc_base_layer_md.c PInterMdFunc pfInterMd; PInterMdBackgroundDecisionFunc pfInterMdBackgroundDecision; PInterMdBackgroundInfoUpdateFunc pfInterMdBackgroundInfoUpdate; PInterMdScrollingPSkipDecisionFunc pfSCDPSkipDecision; PSetScrollingMv pfSetScrollingMv; SMcFunc sMcFuncs; SSampleDealingFunc sSampleDealingFuncs; PGetIntraPredFunc pfGetLumaI16x16Pred[I16_PRED_DC_A]; PGetIntraPredFunc pfGetLumaI4x4Pred[I4_PRED_A]; PGetIntraPredFunc pfGetChromaPred[C_PRED_A]; PSampleSadHor8Func pfSampleSadHor8[2]; // 1: for 16x16 square; 0: for 8x8 square PMotionSearchFunc pfMotionSearch[BLOCK_STATIC_IDC_ALL]; //svc_encode_slice.c svc_mode_decision.c svc_enhance_layer_md.c svc_base_layer_md.c PSearchMethodFunc pfSearchMethod[BLOCK_SIZE_ALL]; PCalculateSatdFunc pfCalculateSatd; PCheckDirectionalMv pfCheckDirectionalMv; PInitializeHashforFeatureFunc pfInitializeHashforFeature; PFillQpelLocationByFeatureValueFunc pfFillQpelLocationByFeatureValue; PCalculateBlockFeatureOfFrame pfCalculateBlockFeatureOfFrame[2];//0 - for 8x8, 1 for 16x16 PCalculateSingleBlockFeature pfCalculateSingleBlockFeature[2];//0 - for 8x8, 1 for 16x16 PLineFullSearchFunc pfVerticalFullSearch; PLineFullSearchFunc pfHorizontalFullSearch; PUpdateFMESwitch pfUpdateFMESwitch; PCopyFunc pfCopy16x16Aligned; //svc_encode_slice.c svc_mode_decision.c svc_base_layer_md.c PCopyFunc pfCopy16x16NotAligned; //md.c PCopyFunc pfCopy8x8Aligned; //svc_encode_slice.c svc_mode_decision.c svc_base_layer_md.c md.c PCopyFunc pfCopy16x8NotAligned; //for MeRefineFracPixel 16x8 based PCopyFunc pfCopy8x16Aligned; //for MeRefineFracPixel 8x16 based PCopyFunc pfCopy4x4; //not sure if aligned or not, need further tune PCopyFunc pfCopy8x4; //not sure if aligned or not, need further tune PCopyFunc pfCopy4x8; //not sure if aligned or not, need further tune PDctFunc pfDctT4; PDctFunc pfDctFourT4; PCalculateSingleCtrFunc pfCalculateSingleCtr4x4; PScanFunc pfScan4x4; //DC/AC PScanFunc pfScan4x4Ac; PQuantizationFunc pfQuantization4x4; PQuantizationFunc pfQuantizationFour4x4; PQuantizationDcFunc pfQuantizationDc4x4; PQuantizationMaxFunc pfQuantizationFour4x4Max; PQuantizationHadamardFunc pfQuantizationHadamard2x2; PQuantizationSkipFunc pfQuantizationHadamard2x2Skip; PTransformHadamard4x4Func pfTransformHadamard4x4Dc; PGetNoneZeroCountFunc pfGetNoneZeroCount; PDeQuantizationFunc pfDequantization4x4; PDeQuantizationFunc pfDequantizationFour4x4; PDeQuantizationHadamardFunc pfDequantizationIHadamard4x4; PIDctFunc pfIDctFourT4; PIDctFunc pfIDctT4; PIDctFunc pfIDctI16x16Dc; // OPTI: if MT under diff uiSliceMode, need change here //PDynamicSlicingStepBackFunc dynslc_funcpointer_stepback;//svc_encode_slice.c //DYNSLC_LNGTH_CRTL dynslc_funcpointer_slcsize_ctrl; /* For Deblocking */ DeblockingFunc pfDeblocking; PSetNoneZeroCountZeroFunc pfSetNZCZero; SWelsRcFunc pfRc; PAccumulateSadFunc pfAccumulateSadForRc; PSetMemoryZero pfSetMemZeroSize8; // for size is times to 8 PSetMemoryZero pfSetMemZeroSize64Aligned16; // for size is times of 64, and address is align to 16 PSetMemoryZero pfSetMemZeroSize64; // for size is times of 64, and don't know address is align to 16 or not PBuildRefListFunc pBuildRefList; PMarkPicFunc pMarkPic; PUpdateRefListFunc pUpdateRefList; PEndofUpdateRefListFunc pEndofUpdateRefList; PAfterBuildRefListFunc pAfterBuildRefList; PCavlcParamCalFunc pfCavlcParamCal; PWelsSpatialWriteMbSyn pfWelsSpatialWriteMbSyn; PStashMBStatus pfStashMBStatus; PStashPopMBStatus pfStashPopMBStatus; }; } //end of namespace WelsEnc { #endif//WELS_ENCODER_FUNCTION_POINTERS_DEFINITION_H_
{ "pile_set_name": "Github" }
*> \brief \b DLARF * * =========== DOCUMENTATION =========== * * Online html documentation available at * http://www.netlib.org/lapack/explore-html/ * *> \htmlonly *> Download DLARF + dependencies *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlarf.f"> *> [TGZ]</a> *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlarf.f"> *> [ZIP]</a> *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlarf.f"> *> [TXT]</a> *> \endhtmlonly * * Definition: * =========== * * SUBROUTINE DLARF( SIDE, M, N, V, INCV, TAU, C, LDC, WORK ) * * .. Scalar Arguments .. * CHARACTER SIDE * INTEGER INCV, LDC, M, N * DOUBLE PRECISION TAU * .. * .. Array Arguments .. * DOUBLE PRECISION C( LDC, * ), V( * ), WORK( * ) * .. * * *> \par Purpose: * ============= *> *> \verbatim *> *> DLARF applies a real elementary reflector H to a real m by n matrix *> C, from either the left or the right. H is represented in the form *> *> H = I - tau * v * v**T *> *> where tau is a real scalar and v is a real vector. *> *> If tau = 0, then H is taken to be the unit matrix. *> \endverbatim * * Arguments: * ========== * *> \param[in] SIDE *> \verbatim *> SIDE is CHARACTER*1 *> = 'L': form H * C *> = 'R': form C * H *> \endverbatim *> *> \param[in] M *> \verbatim *> M is INTEGER *> The number of rows of the matrix C. *> \endverbatim *> *> \param[in] N *> \verbatim *> N is INTEGER *> The number of columns of the matrix C. *> \endverbatim *> *> \param[in] V *> \verbatim *> V is DOUBLE PRECISION array, dimension *> (1 + (M-1)*abs(INCV)) if SIDE = 'L' *> or (1 + (N-1)*abs(INCV)) if SIDE = 'R' *> The vector v in the representation of H. V is not used if *> TAU = 0. *> \endverbatim *> *> \param[in] INCV *> \verbatim *> INCV is INTEGER *> The increment between elements of v. INCV <> 0. *> \endverbatim *> *> \param[in] TAU *> \verbatim *> TAU is DOUBLE PRECISION *> The value tau in the representation of H. *> \endverbatim *> *> \param[in,out] C *> \verbatim *> C is DOUBLE PRECISION array, dimension (LDC,N) *> On entry, the m by n matrix C. *> On exit, C is overwritten by the matrix H * C if SIDE = 'L', *> or C * H if SIDE = 'R'. *> \endverbatim *> *> \param[in] LDC *> \verbatim *> LDC is INTEGER *> The leading dimension of the array C. LDC >= max(1,M). *> \endverbatim *> *> \param[out] WORK *> \verbatim *> WORK is DOUBLE PRECISION array, dimension *> (N) if SIDE = 'L' *> or (M) if SIDE = 'R' *> \endverbatim * * Authors: * ======== * *> \author Univ. of Tennessee *> \author Univ. of California Berkeley *> \author Univ. of Colorado Denver *> \author NAG Ltd. * *> \date November 2011 * *> \ingroup doubleOTHERauxiliary * * ===================================================================== SUBROUTINE DLARF( SIDE, M, N, V, INCV, TAU, C, LDC, WORK ) * * -- LAPACK auxiliary routine (version 3.4.0) -- * -- LAPACK is a software package provided by Univ. of Tennessee, -- * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- * November 2011 * * .. Scalar Arguments .. CHARACTER SIDE INTEGER INCV, LDC, M, N DOUBLE PRECISION TAU * .. * .. Array Arguments .. DOUBLE PRECISION C( LDC, * ), V( * ), WORK( * ) * .. * * ===================================================================== * * .. Parameters .. DOUBLE PRECISION ONE, ZERO PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 ) * .. * .. Local Scalars .. LOGICAL APPLYLEFT INTEGER I, LASTV, LASTC * .. * .. External Subroutines .. EXTERNAL DGEMV, DGER * .. * .. External Functions .. LOGICAL LSAME INTEGER ILADLR, ILADLC EXTERNAL LSAME, ILADLR, ILADLC * .. * .. Executable Statements .. * APPLYLEFT = LSAME( SIDE, 'L' ) LASTV = 0 LASTC = 0 IF( TAU.NE.ZERO ) THEN ! Set up variables for scanning V. LASTV begins pointing to the end ! of V. IF( APPLYLEFT ) THEN LASTV = M ELSE LASTV = N END IF IF( INCV.GT.0 ) THEN I = 1 + (LASTV-1) * INCV ELSE I = 1 END IF ! Look for the last non-zero row in V. DO WHILE( LASTV.GT.0 .AND. V( I ).EQ.ZERO ) LASTV = LASTV - 1 I = I - INCV END DO IF( APPLYLEFT ) THEN ! Scan for the last non-zero column in C(1:lastv,:). LASTC = ILADLC(LASTV, N, C, LDC) ELSE ! Scan for the last non-zero row in C(:,1:lastv). LASTC = ILADLR(M, LASTV, C, LDC) END IF END IF ! Note that lastc.eq.0 renders the BLAS operations null; no special ! case is needed at this level. IF( APPLYLEFT ) THEN * * Form H * C * IF( LASTV.GT.0 ) THEN * * w(1:lastc,1) := C(1:lastv,1:lastc)**T * v(1:lastv,1) * CALL DGEMV( 'Transpose', LASTV, LASTC, ONE, C, LDC, V, INCV, $ ZERO, WORK, 1 ) * * C(1:lastv,1:lastc) := C(...) - v(1:lastv,1) * w(1:lastc,1)**T * CALL DGER( LASTV, LASTC, -TAU, V, INCV, WORK, 1, C, LDC ) END IF ELSE * * Form C * H * IF( LASTV.GT.0 ) THEN * * w(1:lastc,1) := C(1:lastc,1:lastv) * v(1:lastv,1) * CALL DGEMV( 'No transpose', LASTC, LASTV, ONE, C, LDC, $ V, INCV, ZERO, WORK, 1 ) * * C(1:lastc,1:lastv) := C(...) - w(1:lastc,1) * v(1:lastv,1)**T * CALL DGER( LASTC, LASTV, -TAU, WORK, 1, V, INCV, C, LDC ) END IF END IF RETURN * * End of DLARF * END
{ "pile_set_name": "Github" }
"Public/SubExtraFactorRecover.res" { "BG_Security" { "ControlName" "ImagePanel" "fieldName" "BG_Security" "xpos" "0" "ypos" "20" "wide" "360" "tall" "344" "AutoResize" "0" "PinCorner" "0" "visible" "1" "enabled" "1" "tabPosition" "0" "paintbackground" "1" "image" "graphics/bg_security_wizard" "fillcolor" "" "gradientStart" "" "gradientEnd" "" "gradientVertical" "0" "scaleImage" "0" "zpos" "1" } "SubExtraFactorRecover" { "ControlName" "SubExtraFactorRecover" "fieldName" "SubExtraFactorRecover" "xpos" "5" "ypos" "20" "wide" "320" "tall" "450" "autoResize" "0" "pinCorner" "0" "visible" "1" "enabled" "1" "tabPosition" "1" "WizardWide" "0" "WizardTall" "0" "zpos" "2" } "Label1" { "ControlName" "Label" "fieldName" "Label1" "xpos" "24" "ypos" "10" "wide" "200" "tall" "96" "autoResize" "0" "pinCorner" "0" "visible" "1" "enabled" "1" "tabPosition" "0" "labelText" "#Steam_RecoverLocked_StartRecovery" "textAlignment" "west" "dulltext" "1" "brighttext" "0" "wrap" "1" "zpos" "2" } "Label2" { "ControlName" "Label" "fieldName" "Label2" "xpos" "80" "ypos" "50" "wide" "260" "tall" "96" "autoResize" "0" "pinCorner" "0" "visible" "1" "enabled" "1" "tabPosition" "0" "labelText" "#Steam_RecoverLocked_StartRecovery2" "textAlignment" "west" "dulltext" "1" "brighttext" "0" "wrap" "1" "zpos" "2" } "Label3" { "ControlName" "Label" "fieldName" "Label3" "xpos" "24" "ypos" "135" "wide" "296" "tall" "96" "autoResize" "0" "pinCorner" "0" "visible" "1" "enabled" "1" "tabPosition" "0" "labelText" "#Steam_RecoverLocked_StartRecovery3" "textAlignment" "west" "dulltext" "1" "brighttext" "0" "wrap" "1" "zpos" "2" } "URLLabel1" { "ControlName" "URLLabel" "fieldName" "URLLabel1" "xpos" "24" "ypos" "260" "wide" "320" "tall" "24" "AutoResize" "0" "PinCorner" "0" "visible" "1" "enabled" "1" "tabPosition" "0" "labelText" "#Steam_RecoverLocked_RecoverySupportLink" "textAlignment" "west" "wrap" "0" "URLText" "https://support.steampowered.com/kb_article.php?ref=4020-ALZM-5519" "zpos" "2" } "IconSteam" { "ControlName" "ImagePanel" "fieldName" "IconSteam" "xpos" "4" "ypos" "50" "wide" "67" "tall" "31" "AutoResize" "0" "PinCorner" "0" "visible" "1" "enabled" "1" "tabPosition" "0" "paintbackground" "1" "image" "graphics/icon_security_steam" "fillcolor" "" "gradientStart" "" "gradientEnd" "" "gradientVertical" "0" "scaleImage" "0" "zpos" "2" } styles { header { font-size=14 } } }
{ "pile_set_name": "Github" }
@if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @rem @rem ########################################################################## @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS= @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if "%ERRORLEVEL%" == "0" goto init echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo. echo Please set the JAVA_HOME variable in your environment to match the echo location of your Java installation. goto fail :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto init echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo. echo Please set the JAVA_HOME variable in your environment to match the echo location of your Java installation. goto fail :init @rem Get command-line arguments, handling Windows variants if not "%OS%" == "Windows_NT" goto win9xME_args :win9xME_args @rem Slurp the command line arguments. set CMD_LINE_ARGS= set _SKIP=2 :win9xME_args_slurp if "x%~1" == "x" goto execute set CMD_LINE_ARGS=%* :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% :end @rem End local scope for the variables with windows NT shell if "%ERRORLEVEL%"=="0" goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 exit /b 1 :mainEnd if "%OS%"=="Windows_NT" endlocal :omega
{ "pile_set_name": "Github" }
[launch.installed] description = "Launch an installed app" match = """ (open|launch|start|run) [app:appName] """ [[launch.installed.example]] phrase = "Open Google Maps" [[launch.installed.example]] phrase = "Launch Spotify" [launch.uninstalled] description = "Launch an app that is not installed" match = """ (open|launch|start|run) [app] """ [[launch.uninstalled.example]] phrase = "Open Libretto" [[launch.ybinstalled.example]] phrase = "Launch Geometry Dash"
{ "pile_set_name": "Github" }
<div class="card card-profile"> <div class="card-header" style="background-image: url({{ site.data.photos[18].small }});"></div> <div class="card-body text-center"> <img class="card-profile-img" src="{{ site.data.users[4].photo }}"> <h3 class="mb-3">{{ site.data.users[4].name }} {{ site.data.users[4].surname }}</h3> <p class="mb-4"> Big belly rude boy, million dollar hustler. Unemployed. </p> <button class="btn btn-outline-primary btn-sm"> <span class="fa fa-twitter"></span> Follow </button> </div> </div>
{ "pile_set_name": "Github" }
// // main.m // CH12_MIDIToAUSamplerIOS // // Created by Chris Adamson on 1/2/12. // Copyright (c) 2012 Subsequently and Furthermore, Inc. All rights reserved. // #import <UIKit/UIKit.h> #import "AppDelegate.h" int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); } }
{ "pile_set_name": "Github" }
// <auto-generated> // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // </auto-generated> namespace Microsoft.Azure.Management.Network.Fluent { using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; using System.Collections; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; /// <summary> /// AvailableDelegationsOperations operations. /// </summary> public partial interface IAvailableDelegationsOperations { /// <summary> /// Gets all of the available subnet delegations for this subscription /// in this region. /// </summary> /// <param name='location'> /// The location of the subnet. /// </param> /// <param name='customHeaders'> /// The headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="Microsoft.Rest.Azure.CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="Microsoft.Rest.SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="Microsoft.Rest.ValidationException"> /// Thrown when a required parameter is null /// </exception> Task<AzureOperationResponse<IPage<AvailableDelegationInner>>> ListWithHttpMessagesAsync(string location, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// <summary> /// Gets all of the available subnet delegations for this subscription /// in this region. /// </summary> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> /// <param name='customHeaders'> /// The headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="Microsoft.Rest.Azure.CloudException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="Microsoft.Rest.SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="Microsoft.Rest.ValidationException"> /// Thrown when a required parameter is null /// </exception> Task<AzureOperationResponse<IPage<AvailableDelegationInner>>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } }
{ "pile_set_name": "Github" }
apiVersion: v1 appVersion: 11.7.1-fp1.2180 description: IBM Enterprise Search name: ug engine: gotpl keywords: - igc - governance - amd64 - Commercial - RHOCP - Analytics maintainers: - name: IBM Watson Knowledge Catalog tillerVersion: '>=2.9.0' kubeVersion: ">=1.11.0" version: 3.2.2180
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>Editor</title> <style type="text/css" media="screen"> .ace_editor { border: 1px solid lightgray; margin: auto; height: 800px; width: 400px; font-size: 26px!important; max-width: 30%; } .scrollmargin { height: 80px; text-align: center; } #editor1, #editor2, #editor3 { display:inline-block } .wrapper { text-align: center; perspective: 500px; margin-top: 50px; } #editor1 { transform: rotateY(10deg) rotateX(-1deg); } #editor2 { transform: translateZ(-36px) rotateX(-1deg); } #editor3 { transform: rotateY(-10deg) rotateX(-1deg); } #editor4 { transform: scale(-1,1) rotateX(-1deg); } .transformed { transform: scale(0.5); transform-origin: center 12% } #editor { width: 100%; min-width: 100% } body { background: #a9bfc7; mix-blend-mode: multiply; } </style> </head> <body> <div class="transformed"> <div class="wrapper"> <pre id="editor1">editor1</pre> <pre id="editor2">editor2</pre> <pre id="editor3">editor3</pre> <textarea></textarea> </div> <div class="scrollmargin"></div> <pre id="editor4">editor4</pre> <div class="scrollmargin"> <textarea></textarea> </div> <pre id="editor">editor</pre> <div class="scrollmargin"> </div> </div> <div class="scrollmargin"> <input type="checkbox" id="option">Auto scroll into view</input> </div> <!-- load ace --> <script src="../src/ace.js"></script> <script> var editor1 = ace.edit("editor1"); editor1.setOptions({ theme: "ace/theme/tomorrow_night_blue", mode: "ace/mode/html" }); var editor2 = ace.edit("editor2"); editor2.setOptions({ theme: "ace/theme/kuroir", mode: "ace/mode/html" }); var editor3 = ace.edit("editor3"); editor3.setOptions({ theme: "ace/theme/tomorrow_night_eighties", mode: "ace/mode/html" }); var editor4 = ace.edit("editor4"); editor4.setOptions({ theme: "ace/theme/solarized_light", mode: "ace/mode/html" }); var editor = ace.edit("editor"); editor.setOptions({ mode: "ace/mode/html", value: "editor 4\n from a mirror", }); editor.renderer.setScrollMargin(10, 10, 10, 10); var checkbox = document.getElementById("option"); checkbox.onchange = function() { editor1.setOption("autoScrollEditorIntoView", checkbox.checked); editor2.setOption("autoScrollEditorIntoView", checkbox.checked); editor3.setOption("autoScrollEditorIntoView", checkbox.checked); editor4.setOption("autoScrollEditorIntoView", checkbox.checked); editor.setOption("autoScrollEditorIntoView", checkbox.checked); }; checkbox.onchange(); </script> <script src="./show_own_source.js"></script> </body> </html>
{ "pile_set_name": "Github" }
/*! * jQuery UI Slider 1.10.3 * http://jqueryui.com * * Copyright 2013 jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Slider#theming */ .ui-slider { position: relative; text-align: left; } .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } /* For IE8 - See #6727 */ .ui-slider.ui-state-disabled .ui-slider-handle, .ui-slider.ui-state-disabled .ui-slider-range { filter: inherit; } .ui-slider-horizontal { height: .8em; } .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } .ui-slider-horizontal .ui-slider-range-min { left: 0; } .ui-slider-horizontal .ui-slider-range-max { right: 0; } .ui-slider-vertical { width: .8em; height: 100px; } .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } .ui-slider-vertical .ui-slider-range-min { bottom: 0; } .ui-slider-vertical .ui-slider-range-max { top: 0; }
{ "pile_set_name": "Github" }
#ifndef BOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP #define BOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) # pragma once #endif /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // common_oarchive.hpp // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for updates, documentation, and revision history. #include <boost/config.hpp> #include <boost/archive/detail/basic_oarchive.hpp> #include <boost/archive/detail/interface_oarchive.hpp> #ifdef BOOST_MSVC # pragma warning(push) # pragma warning(disable : 4511 4512) #endif namespace boost { namespace archive { namespace detail { // note: referred to as Curiously Recurring Template Patter (CRTP) template<class Archive> class BOOST_SYMBOL_VISIBLE common_oarchive : public basic_oarchive, public interface_oarchive<Archive> { friend class interface_oarchive<Archive>; private: virtual void vsave(const version_type t){ * this->This() << t; } virtual void vsave(const object_id_type t){ * this->This() << t; } virtual void vsave(const object_reference_type t){ * this->This() << t; } virtual void vsave(const class_id_type t){ * this->This() << t; } virtual void vsave(const class_id_reference_type t){ * this->This() << t; } virtual void vsave(const class_id_optional_type t){ * this->This() << t; } virtual void vsave(const class_name_type & t){ * this->This() << t; } virtual void vsave(const tracking_type t){ * this->This() << t; } protected: // default processing - invoke serialization library template<class T> void save_override(T & t){ archive::save(* this->This(), t); } void save_start(const char * /*name*/){} void save_end(const char * /*name*/){} common_oarchive(unsigned int flags = 0) : basic_oarchive(flags), interface_oarchive<Archive>() {} }; } // namespace detail } // namespace archive } // namespace boost #ifdef BOOST_MSVC #pragma warning(pop) #endif #endif // BOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP
{ "pile_set_name": "Github" }
<?php $value = ( isset( $value ) ) ? $value : $this->get_setting( $key ); $class = ( isset( $class ) ) ? 'class="' . $class . '"' : ''; $disabled = ( isset( $disabled ) && $disabled ) ? 'disabled' : ''; ?> <div id="<?php echo $key; ?>-wrap" data-checkbox="<?php echo $key; ?>" class="as3cf-switch <?php echo $disabled; ?>"> <span class="on <?php echo $value ? 'checked' : ''; ?>">ON</span> <span class="off <?php echo ! $value ? 'checked' : ''; ?>">OFF</span> <input type="hidden" name="<?php echo $key; ?>" value="0" /> <input type="checkbox" name="<?php echo $key; ?>" value="1" id="<?php echo $key; ?>" <?php echo $value ? 'checked="checked" ' : ''; ?> <?php echo $class ?>/> </div>
{ "pile_set_name": "Github" }
/dts-v1/; #include "bcm6368.dtsi" #include <dt-bindings/input/input.h> / { model = "Zyxel P870HW-51a v2"; compatible = "zyxel,p870hw-51a-v2", "brcm,bcm6368"; gpio-keys-polled { compatible = "gpio-keys-polled"; #address-cells = <1>; #size-cells = <0>; poll-interval = <20>; debounce-interval = <60>; reset { label = "reset"; gpios = <&gpio1 2 1>; linux,code = <KEY_RESTART>; }; wps { label = "wps"; gpios = <&gpio1 3 1>; linux,code = <KEY_WPS_BUTTON>; }; }; gpio-leds { compatible = "gpio-leds"; power_green { label = "P870HW-51a:green:power"; gpios = <&gpio0 0 0>; default-state = "on"; }; dsl_green { label = "P870HW-51a:green:dsl"; gpios = <&gpio0 2 1>; }; inet_green { label = "P870HW-51a:green:inet"; gpios = <&gpio0 22 1>; }; wps_orange { label = "P870HW-51a:orange:wps"; gpios = <&gpio0 24 1>; }; inet_red { label = "P870HW-51a:red:inet"; gpios = <&gpio1 1 1>; }; }; }; &pflash { status = "ok"; linux,part-probe = "bcm63xxpart"; cfe@0 { label = "CFE"; reg = <0x000000 0x010000>; read-only; }; linux@10000 { label = "linux"; reg = <0x010000 0x3e0000>; }; nvram@3f0000 { label = "nvram"; reg = <0x3f0000 0x010000>; }; };
{ "pile_set_name": "Github" }
#!/bin/bash # -------------------------------------------------------------- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # # -------------------------------------------------------------- # This extension script will be executed to start the servers. # -------------------------------------------------------------- # log=/var/log/apache-stratos/cartridge-agent-extensions.log echo "Starting servers" | tee -a $log export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin" NODEJS_HOME=<%= @stratos_app_path %> npm install express node web.js > /dev/null 2&1 &
{ "pile_set_name": "Github" }
\name{showGitOutput} \alias{showGitOutput} \title{Display last git output} \usage{ showGitOutput(obj) } \arguments{ \item{obj}{gitR object} } \description{ Displays the output of the last git command in a separate window. }
{ "pile_set_name": "Github" }
function hundredDoors(numDoors){ //create array to hold answer var doors = []; /*Because you are only opening doors that are perfect squares, you only have to loop through whatever the sqrt is of the number of doors you pass into the function. In this example I am passing in 100 for 100 doors which has a square root of 10, so if I take every number between 1 & 10 and multiply it by itself I will find all the perfect square between 1 & 100. */ for(var i = 1; i <= Math.sqrt(numDoors); i++){ //push the open doors to answer array doors.push('Door #'+ i*i + ' is open.'); } return doors; } hundredDoors(100); /*Explaination: To cut down the time complexity of this problem you have to figure out the mathematical pattern, which in this case is that only the doors whose numbers are perfect squares will be left open. This is because perfect square have an odd number of factors. Take the nummber 4 for example. 4 has the following factors [1, 2, 4] for a total of 3 factors. Because the number of factors is odd, it works out that the door will always be left open. Ex: Door #64 (Should end up open because it is a perfect square) 64 has the following factors: 1,2,4,8,16,32,64 so door #64 will be toggled on any of the cycles that conincide with one of its factors. Cycles: 0: All doors start out closed 1: Door is opened 2: Door is closed 4: opened 8: closed 16: opened 32: closed 64: opened After the 64th cycle the door is not toggled again and remains open. */
{ "pile_set_name": "Github" }
--- features: - Add description parameter to create_user, available on Keystone v3
{ "pile_set_name": "Github" }
namespace Accelerider.Windows.Views { /// <summary> /// Interaction logic for ShellSettingsTabItem.xaml /// </summary> public partial class ShellSettingsTabItem { public ShellSettingsTabItem() { InitializeComponent(); } } }
{ "pile_set_name": "Github" }
// Licensed under the Apache License, Version 2.0 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option. // All files in the project carrying such notice may not be copied, modified, or distributed // except according to those terms. use shared::basetsd::DWORD_PTR; pub const ALIGN_SIZE: DWORD_PTR = 0x00000008;
{ "pile_set_name": "Github" }
[]
{ "pile_set_name": "Github" }
//===--- ASTDiagnostic.h - Diagnostics for the AST library ------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_DIAGNOSTICAST_H #define LLVM_CLANG_DIAGNOSTICAST_H #include "clang/Basic/Diagnostic.h" namespace clang { namespace diag { enum { #define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP,\ SFINAE,ACCESS,NOWERROR,SHOWINSYSHEADER,CATEGORY) ENUM, #define ASTSTART #include "clang/Basic/DiagnosticASTKinds.inc" #undef DIAG NUM_BUILTIN_AST_DIAGNOSTICS }; } // end namespace diag /// \brief DiagnosticsEngine argument formatting function for diagnostics that /// involve AST nodes. /// /// This function formats diagnostic arguments for various AST nodes, /// including types, declaration names, nested name specifiers, and /// declaration contexts, into strings that can be printed as part of /// diagnostics. It is meant to be used as the argument to /// \c DiagnosticsEngine::SetArgToStringFn(), where the cookie is an \c /// ASTContext pointer. void FormatASTNodeDiagnosticArgument( DiagnosticsEngine::ArgumentKind Kind, intptr_t Val, const char *Modifier, unsigned ModLen, const char *Argument, unsigned ArgLen, const DiagnosticsEngine::ArgumentValue *PrevArgs, unsigned NumPrevArgs, SmallVectorImpl<char> &Output, void *Cookie, ArrayRef<intptr_t> QualTypeVals); } // end namespace clang #endif
{ "pile_set_name": "Github" }
using System; using Bounds = UnityEngine.Bounds; using Vector2 = UnityEngine.Vector2; using Vector3 = UnityEngine.Vector3; using Mathf = UnityEngine.Mathf; using Debug = UnityEngine.Debug; using UnitySceneExtensions; using UnityEngine.Profiling; namespace Chisel.Core { [Serializable] public struct ChiselSphereDefinition : IChiselGenerator { public const string kNodeTypeName = "Sphere"; public const float kMinSphereDiameter = 0.01f; public const float kDefaultRotation = 0.0f; public const int kDefaultHorizontalSegments = 12; public const int kDefaultVerticalSegments = 12; public const bool kDefaultGenerateFromCenter = false; public static readonly Vector3 kDefaultDiameter = Vector3.one; [DistanceValue] public Vector3 diameterXYZ; public float offsetY; public bool generateFromCenter; public float rotation; // TODO: useless? public int horizontalSegments; public int verticalSegments; [NamedItems(overflow = "Side {0}")] public ChiselSurfaceDefinition surfaceDefinition; public void Reset() { diameterXYZ = kDefaultDiameter; offsetY = 0; rotation = kDefaultRotation; horizontalSegments = kDefaultHorizontalSegments; verticalSegments = kDefaultVerticalSegments; generateFromCenter = kDefaultGenerateFromCenter; if (surfaceDefinition != null) surfaceDefinition.Reset(); } public void Validate() { if (surfaceDefinition == null) surfaceDefinition = new ChiselSurfaceDefinition(); diameterXYZ.x = Mathf.Max(kMinSphereDiameter, Mathf.Abs(diameterXYZ.x)); diameterXYZ.y = Mathf.Max(0, Mathf.Abs(diameterXYZ.y)) * (diameterXYZ.y < 0 ? -1 : 1); diameterXYZ.z = Mathf.Max(kMinSphereDiameter, Mathf.Abs(diameterXYZ.z)); horizontalSegments = Mathf.Max(horizontalSegments, 3); verticalSegments = Mathf.Max(verticalSegments, 2); surfaceDefinition.EnsureSize(6); } public bool Generate(ref ChiselBrushContainer brushContainer) { return BrushMeshFactory.GenerateSphere(ref brushContainer, ref this); } // // TODO: code below needs to be cleaned up & simplified // const float kLineDash = 2.0f; const float kVertLineThickness = 0.75f; const float kHorzLineThickness = 1.0f; const float kCapLineThickness = 2.0f; const float kCapLineThicknessSelected = 2.5f; static void DrawOutline(IChiselHandleRenderer renderer, ChiselSphereDefinition definition, Vector3[] vertices, LineMode lineMode) { var sides = definition.horizontalSegments; var extraVertices = 2; var bottomVertex = 1; var topVertex = 0; var rings = (vertices.Length - extraVertices) / sides; var prevColor = renderer.color; var color = prevColor; color.a *= 0.6f; renderer.color = color; for (int i = 0, j = extraVertices; i < rings; i++, j += sides) { renderer.DrawLineLoop(vertices, j, sides, lineMode: lineMode, thickness: kHorzLineThickness, dashSize: kLineDash); } for (int k = 0; k < sides; k++) { renderer.DrawLine(vertices[topVertex], vertices[extraVertices + k], lineMode: lineMode, thickness: kVertLineThickness); for (int i = 0, j = extraVertices; i < rings - 1; i++, j += sides) renderer.DrawLine(vertices[j + k], vertices[j + k + sides], lineMode: lineMode, thickness: kVertLineThickness); renderer.DrawLine(vertices[bottomVertex], vertices[extraVertices + k + ((rings - 1) * sides)], lineMode: lineMode, thickness: kVertLineThickness); } renderer.color = prevColor; } static Vector3[] vertices = null; // TODO: store this per instance? or just allocate every frame? public void OnEdit(IChiselHandles handles) { var baseColor = handles.color; var normal = Vector3.up; if (BrushMeshFactory.GenerateSphereVertices(this, ref vertices)) { handles.color = handles.GetStateColor(baseColor, false, false); DrawOutline(handles, this, vertices, lineMode: LineMode.ZTest); handles.color = handles.GetStateColor(baseColor, false, true); DrawOutline(handles, this, vertices, lineMode: LineMode.NoZTest); handles.color = baseColor; } Vector3 center, topPoint, bottomPoint; if (!this.generateFromCenter) { center = normal * (this.offsetY + (this.diameterXYZ.y * 0.5f)); topPoint = normal * (this.offsetY + this.diameterXYZ.y); bottomPoint = normal * (this.offsetY); } else { center = normal * (this.offsetY); topPoint = normal * (this.offsetY + (this.diameterXYZ.y * 0.5f)); bottomPoint = normal * (this.offsetY + (this.diameterXYZ.y * -0.5f)); } if (this.diameterXYZ.y < 0) normal = -normal; var radius2D = new Vector2(this.diameterXYZ.x, this.diameterXYZ.z) * 0.5f; { // TODO: make it possible to (optionally) size differently in x & z var radiusX = radius2D.x; handles.DoRadiusHandle(ref radiusX, normal, center); radius2D.x = radiusX; { var isBottomBackfaced = false; // TODO: how to do this? handles.backfaced = isBottomBackfaced; handles.DoDirectionHandle(ref bottomPoint, -normal); handles.backfaced = false; } { var isTopBackfaced = false; // TODO: how to do this? handles.backfaced = isTopBackfaced; handles.DoDirectionHandle(ref topPoint, normal); handles.backfaced = false; } } if (handles.modified) { var diameter = this.diameterXYZ; diameter.y = topPoint.y - bottomPoint.y; diameter.x = radius2D.x * 2.0f; diameter.z = radius2D.x * 2.0f; this.offsetY = bottomPoint.y; this.diameterXYZ = diameter; // TODO: handle sizing down (needs to modify transformation?) } } public void OnMessages(IChiselMessages messages) { } } }
{ "pile_set_name": "Github" }
#include "tactionworker.h"
{ "pile_set_name": "Github" }
#!/usr/bin/env python # Back up all of my photos. import sys import os import subprocess import tempfile import time import io try: from ansicolor import red, green, blue except ImportError: print("Could not load `ansicolor'; ensure that the module is installed.") all_jobs = [("/g/Photography/", "kepler.gquad.space:/volume1/Pictures/Photography/"), ("/g/Lightroom/", "kepler.gquad.space:/volume1/Pictures/Lightroom/")] #all_locations = [path for job in jobs for path in job] jobs = [] print("Checking for sync locations...") for job in all_jobs: if (":" not in job[0] and not os.path.exists(job[0])) \ or (":" not in job[1] and not os.path.exists(job[1])): print(red("Excluding %s -> %s." % (job[0], job[1]))) continue else: jobs.append(job) print(green("Including %s -> %s." % (job[0], job[1]))) for job in jobs: print("Syncing %s to %s..." % (job[0], job[1])) process = subprocess.Popen(["rsync", "-WOaiv", "--no-p", "--delete", "--exclude", "@eaDir", "--exclude", "*@SynoResource", "-h", job[0], job[1]], stdout=subprocess.PIPE, bufsize=1) while process.poll() is None: sys.stdout.write("> %s" % process.stdout.readline()) tail = process.communicate()[0] if len(tail): print("> %s" % process.communicate()[0]) if process.returncode == 0: print(green("Sync completed successfully.")) else: print(red("Sync exited with non-zero status.")) process = None
{ "pile_set_name": "Github" }
Component({ properties: { /* 延迟关闭时间 */ delay: { type: Number, value: 1500 }, /* 显示的类型 success warn error */ type: { type: 'String', value: 'default' }, /* 是否显示 */ show: { type: Boolean, value: false }, /* 显示标题信息 */ title: { type: String, value: '', observer(newVal, oldVal) { let { delay } = this.properties; this.setData({ show: true }); clearTimeout(this.timer); this.timer = setTimeout(() => this.hide(), delay); } } }, methods: { hide() { this.setData({ title: '', show: false }); this.triggerEvent('hide', {}); } } })
{ "pile_set_name": "Github" }
# Copyright 2020 Cortex Labs, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Source: https://github.com/aws/aws-neuron-sdk/blob/master/docs/neuron-container-tools/k8s-neuron-device-plugin-rbac.yml # Source: https://github.com/aws/aws-neuron-sdk/blob/master/docs/neuron-container-tools/k8s-neuron-device-plugin.yml kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: name: neuron-device-plugin rules: - apiGroups: - "" resources: - nodes verbs: - get - list - watch - apiGroups: - "" resources: - events verbs: - create - patch - apiGroups: - "" resources: - pods verbs: - update - patch - get - list - watch - apiGroups: - "" resources: - nodes/status verbs: - patch - update --- apiVersion: v1 kind: ServiceAccount metadata: name: neuron-device-plugin namespace: kube-system --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: neuron-device-plugin namespace: kube-system roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: neuron-device-plugin subjects: - kind: ServiceAccount name: neuron-device-plugin namespace: kube-system --- apiVersion: apps/v1 kind: DaemonSet metadata: name: neuron-device-plugin-daemonset namespace: kube-system spec: selector: matchLabels: name: neuron-device-plugin-ds updateStrategy: type: RollingUpdate template: metadata: annotations: scheduler.alpha.kubernetes.io/critical-pod: "" labels: name: neuron-device-plugin-ds spec: serviceAccount: neuron-device-plugin tolerations: - key: CriticalAddonsOnly operator: Exists - key: aws.amazon.com/neuron operator: Exists effect: NoSchedule - key: workload operator: Exists effect: NoSchedule # Mark this pod as a critical add-on; when enabled, the critical add-on # scheduler reserves resources for critical add-on pods so that they can # be rescheduled after a failure. # See https://kubernetes.io/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/ priorityClassName: "system-node-critical" affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: "beta.kubernetes.io/instance-type" operator: In values: - inf1.xlarge - inf1.2xlarge - inf1.6xlarge - inf1.4xlarge - matchExpressions: - key: "node.kubernetes.io/instance-type" operator: In values: - inf1.xlarge - inf1.2xlarge - inf1.6xlarge - inf1.24xlarge containers: #Device Plugin containers are available both in us-east and us-west ecr #repos - image: $CORTEX_IMAGE_INFERENTIA imagePullPolicy: Always name: neuron-device-plugin env: - name: KUBECONFIG value: /etc/kubernetes/kubelet.conf - name: NODE_NAME valueFrom: fieldRef: fieldPath: spec.nodeName securityContext: allowPrivilegeEscalation: false capabilities: drop: ["ALL"] volumeMounts: - name: device-plugin mountPath: /var/lib/kubelet/device-plugins - name: infa-map mountPath: /run resources: requests: cpu: 100m memory: 100Mi nodeSelector: workload: "true" volumes: - name: device-plugin hostPath: path: /var/lib/kubelet/device-plugins - name: infa-map hostPath: path: /run
{ "pile_set_name": "Github" }
import * as external from 'external-esm-default'; import * as dep from './dep'; t.deepEqual(dep, { default: 'default' }); t.deepEqual(external, { default: 'bar' });
{ "pile_set_name": "Github" }
// +build !ignore_autogenerated /* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by conversion-gen. DO NOT EDIT. package v1beta1 import ( unsafe "unsafe" v1beta1 "k8s.io/api/admission/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" types "k8s.io/apimachinery/pkg/types" admission "k8s.io/kubernetes/pkg/apis/admission" authenticationv1 "k8s.io/kubernetes/pkg/apis/authentication/v1" ) func init() { localSchemeBuilder.Register(RegisterConversions) } // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { if err := s.AddGeneratedConversionFunc((*v1beta1.AdmissionRequest)(nil), (*admission.AdmissionRequest)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_AdmissionRequest_To_admission_AdmissionRequest(a.(*v1beta1.AdmissionRequest), b.(*admission.AdmissionRequest), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*admission.AdmissionRequest)(nil), (*v1beta1.AdmissionRequest)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_admission_AdmissionRequest_To_v1beta1_AdmissionRequest(a.(*admission.AdmissionRequest), b.(*v1beta1.AdmissionRequest), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*v1beta1.AdmissionResponse)(nil), (*admission.AdmissionResponse)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_AdmissionResponse_To_admission_AdmissionResponse(a.(*v1beta1.AdmissionResponse), b.(*admission.AdmissionResponse), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*admission.AdmissionResponse)(nil), (*v1beta1.AdmissionResponse)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_admission_AdmissionResponse_To_v1beta1_AdmissionResponse(a.(*admission.AdmissionResponse), b.(*v1beta1.AdmissionResponse), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*v1beta1.AdmissionReview)(nil), (*admission.AdmissionReview)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_AdmissionReview_To_admission_AdmissionReview(a.(*v1beta1.AdmissionReview), b.(*admission.AdmissionReview), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*admission.AdmissionReview)(nil), (*v1beta1.AdmissionReview)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_admission_AdmissionReview_To_v1beta1_AdmissionReview(a.(*admission.AdmissionReview), b.(*v1beta1.AdmissionReview), scope) }); err != nil { return err } return nil } func autoConvert_v1beta1_AdmissionRequest_To_admission_AdmissionRequest(in *v1beta1.AdmissionRequest, out *admission.AdmissionRequest, s conversion.Scope) error { out.UID = types.UID(in.UID) out.Kind = in.Kind out.Resource = in.Resource out.SubResource = in.SubResource out.RequestKind = (*v1.GroupVersionKind)(unsafe.Pointer(in.RequestKind)) out.RequestResource = (*v1.GroupVersionResource)(unsafe.Pointer(in.RequestResource)) out.RequestSubResource = in.RequestSubResource out.Name = in.Name out.Namespace = in.Namespace out.Operation = admission.Operation(in.Operation) if err := authenticationv1.Convert_v1_UserInfo_To_authentication_UserInfo(&in.UserInfo, &out.UserInfo, s); err != nil { return err } if err := runtime.Convert_runtime_RawExtension_To_runtime_Object(&in.Object, &out.Object, s); err != nil { return err } if err := runtime.Convert_runtime_RawExtension_To_runtime_Object(&in.OldObject, &out.OldObject, s); err != nil { return err } out.DryRun = (*bool)(unsafe.Pointer(in.DryRun)) if err := runtime.Convert_runtime_RawExtension_To_runtime_Object(&in.Options, &out.Options, s); err != nil { return err } return nil } // Convert_v1beta1_AdmissionRequest_To_admission_AdmissionRequest is an autogenerated conversion function. func Convert_v1beta1_AdmissionRequest_To_admission_AdmissionRequest(in *v1beta1.AdmissionRequest, out *admission.AdmissionRequest, s conversion.Scope) error { return autoConvert_v1beta1_AdmissionRequest_To_admission_AdmissionRequest(in, out, s) } func autoConvert_admission_AdmissionRequest_To_v1beta1_AdmissionRequest(in *admission.AdmissionRequest, out *v1beta1.AdmissionRequest, s conversion.Scope) error { out.UID = types.UID(in.UID) out.Kind = in.Kind out.Resource = in.Resource out.SubResource = in.SubResource out.RequestKind = (*v1.GroupVersionKind)(unsafe.Pointer(in.RequestKind)) out.RequestResource = (*v1.GroupVersionResource)(unsafe.Pointer(in.RequestResource)) out.RequestSubResource = in.RequestSubResource out.Name = in.Name out.Namespace = in.Namespace out.Operation = v1beta1.Operation(in.Operation) if err := authenticationv1.Convert_authentication_UserInfo_To_v1_UserInfo(&in.UserInfo, &out.UserInfo, s); err != nil { return err } if err := runtime.Convert_runtime_Object_To_runtime_RawExtension(&in.Object, &out.Object, s); err != nil { return err } if err := runtime.Convert_runtime_Object_To_runtime_RawExtension(&in.OldObject, &out.OldObject, s); err != nil { return err } out.DryRun = (*bool)(unsafe.Pointer(in.DryRun)) if err := runtime.Convert_runtime_Object_To_runtime_RawExtension(&in.Options, &out.Options, s); err != nil { return err } return nil } // Convert_admission_AdmissionRequest_To_v1beta1_AdmissionRequest is an autogenerated conversion function. func Convert_admission_AdmissionRequest_To_v1beta1_AdmissionRequest(in *admission.AdmissionRequest, out *v1beta1.AdmissionRequest, s conversion.Scope) error { return autoConvert_admission_AdmissionRequest_To_v1beta1_AdmissionRequest(in, out, s) } func autoConvert_v1beta1_AdmissionResponse_To_admission_AdmissionResponse(in *v1beta1.AdmissionResponse, out *admission.AdmissionResponse, s conversion.Scope) error { out.UID = types.UID(in.UID) out.Allowed = in.Allowed out.Result = (*v1.Status)(unsafe.Pointer(in.Result)) out.Patch = *(*[]byte)(unsafe.Pointer(&in.Patch)) out.PatchType = (*admission.PatchType)(unsafe.Pointer(in.PatchType)) out.AuditAnnotations = *(*map[string]string)(unsafe.Pointer(&in.AuditAnnotations)) out.Warnings = *(*[]string)(unsafe.Pointer(&in.Warnings)) return nil } // Convert_v1beta1_AdmissionResponse_To_admission_AdmissionResponse is an autogenerated conversion function. func Convert_v1beta1_AdmissionResponse_To_admission_AdmissionResponse(in *v1beta1.AdmissionResponse, out *admission.AdmissionResponse, s conversion.Scope) error { return autoConvert_v1beta1_AdmissionResponse_To_admission_AdmissionResponse(in, out, s) } func autoConvert_admission_AdmissionResponse_To_v1beta1_AdmissionResponse(in *admission.AdmissionResponse, out *v1beta1.AdmissionResponse, s conversion.Scope) error { out.UID = types.UID(in.UID) out.Allowed = in.Allowed out.Result = (*v1.Status)(unsafe.Pointer(in.Result)) out.Patch = *(*[]byte)(unsafe.Pointer(&in.Patch)) out.PatchType = (*v1beta1.PatchType)(unsafe.Pointer(in.PatchType)) out.AuditAnnotations = *(*map[string]string)(unsafe.Pointer(&in.AuditAnnotations)) out.Warnings = *(*[]string)(unsafe.Pointer(&in.Warnings)) return nil } // Convert_admission_AdmissionResponse_To_v1beta1_AdmissionResponse is an autogenerated conversion function. func Convert_admission_AdmissionResponse_To_v1beta1_AdmissionResponse(in *admission.AdmissionResponse, out *v1beta1.AdmissionResponse, s conversion.Scope) error { return autoConvert_admission_AdmissionResponse_To_v1beta1_AdmissionResponse(in, out, s) } func autoConvert_v1beta1_AdmissionReview_To_admission_AdmissionReview(in *v1beta1.AdmissionReview, out *admission.AdmissionReview, s conversion.Scope) error { if in.Request != nil { in, out := &in.Request, &out.Request *out = new(admission.AdmissionRequest) if err := Convert_v1beta1_AdmissionRequest_To_admission_AdmissionRequest(*in, *out, s); err != nil { return err } } else { out.Request = nil } out.Response = (*admission.AdmissionResponse)(unsafe.Pointer(in.Response)) return nil } // Convert_v1beta1_AdmissionReview_To_admission_AdmissionReview is an autogenerated conversion function. func Convert_v1beta1_AdmissionReview_To_admission_AdmissionReview(in *v1beta1.AdmissionReview, out *admission.AdmissionReview, s conversion.Scope) error { return autoConvert_v1beta1_AdmissionReview_To_admission_AdmissionReview(in, out, s) } func autoConvert_admission_AdmissionReview_To_v1beta1_AdmissionReview(in *admission.AdmissionReview, out *v1beta1.AdmissionReview, s conversion.Scope) error { if in.Request != nil { in, out := &in.Request, &out.Request *out = new(v1beta1.AdmissionRequest) if err := Convert_admission_AdmissionRequest_To_v1beta1_AdmissionRequest(*in, *out, s); err != nil { return err } } else { out.Request = nil } out.Response = (*v1beta1.AdmissionResponse)(unsafe.Pointer(in.Response)) return nil } // Convert_admission_AdmissionReview_To_v1beta1_AdmissionReview is an autogenerated conversion function. func Convert_admission_AdmissionReview_To_v1beta1_AdmissionReview(in *admission.AdmissionReview, out *v1beta1.AdmissionReview, s conversion.Scope) error { return autoConvert_admission_AdmissionReview_To_v1beta1_AdmissionReview(in, out, s) }
{ "pile_set_name": "Github" }
/******************************************************************************* * Project: Nebula * @file CmdOnGetNodeCustomConf.cpp * @brief 获取节点自定义配置 * @author Bwar * @date: 2019年9月14日 * @note * Modify history: ******************************************************************************/ #include "CmdOnGetNodeCustomConf.hpp" #include "labor/NodeInfo.hpp" namespace neb { CmdOnGetNodeCustomConf::CmdOnGetNodeCustomConf(int32 iCmd) : Cmd(iCmd) { } CmdOnGetNodeCustomConf::~CmdOnGetNodeCustomConf() { } bool CmdOnGetNodeCustomConf::AnyMessage( std::shared_ptr<SocketChannel> pChannel, const MsgHead& oInMsgHead, const MsgBody& oInMsgBody) { MsgBody oOutMsgBody; ConfigInfo oConfigInfo; CJsonObject oCurrentConf = GetLabor(this)->GetNodeConf(); oConfigInfo.set_file_name(GetLabor(this)->GetNodeInfo().strConfFile); oConfigInfo.set_file_content(oCurrentConf["custom"].ToFormattedString()); //oOutMsgBody.set_data(oConfigInfo.SerializeAsString()); oConfigInfo.SerializeToString(&m_strDataString); oOutMsgBody.set_data(m_strDataString); oOutMsgBody.mutable_rsp_result()->set_code(ERR_OK); oOutMsgBody.mutable_rsp_result()->set_msg("success"); SendTo(pChannel, oInMsgHead.cmd(), oInMsgHead.seq(), oOutMsgBody); return(true); } } /* namespace neb */
{ "pile_set_name": "Github" }
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab // Copyright (C) 2002-2004 - INRIA - Vincent COUVERT // // Copyright (C) 2012 - 2016 - Scilab Enterprises // // This file is hereby licensed under the terms of the GNU GPL v2.0, // pursuant to article 5.3.4 of the CeCILL v.2.1. // This file was originally licensed under the terms of the CeCILL v2.1, // and continues to be available under such terms. // For more information, see the COPYING file which you should have received // along with this program. function mtlb_hold(flag) // Emulation function for Matlab hold() rhs=argn(2) if rhs<=0 then a=gca(); if a.auto_clear=="off" then a.auto_clear="on" else a.auto_clear="off" end else if flag=="on" then a=gca();a.auto_clear="off" elseif flag=="off" then a=gca();a.auto_clear="on" else error(msprintf(gettext("%s: Not yet implemented.\n"),"mtlb_hold")) end end endfunction
{ "pile_set_name": "Github" }
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; class XmlCompleteConfigurationTest extends CompleteConfigurationTest { protected function getLoader(ContainerBuilder $container) { return new XmlFileLoader($container, new FileLocator(__DIR__.'/Fixtures/xml')); } protected function getFileExtension() { return 'xml'; } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema Version 2.0 The primary goals of this format is to allow a simple XML format that is mostly human readable. The generation and parsing of the various data types are done through the TypeConverter classes associated with the data types. Example: ... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="version">2.0</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <value>[base64 mime encoded serialized .NET Framework object]</value> </data> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <comment>This is a comment</comment> </data> There are any number of "resheader" rows that contain simple name/value pairs. Each data row contains a name, and value. The row also contains a type or mimetype. Type corresponds to a .NET class that support text/value conversion through the TypeConverter architecture. Classes that don't support this are serialized and stored with the mimetype set. The mimetype is used for serialized objects, and tells the ResXResourceReader how to depersist the object. This is currently not extensible. For a given mimetype the value must be set accordingly: Note - application/x-microsoft.net.object.binary.base64 is the format that the ResXResourceWriter will generate, however the reader can read any of the formats listed below. mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> <xsd:choice maxOccurs="unbounded"> <xsd:element name="metadata"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" /> </xsd:sequence> <xsd:attribute name="name" use="required" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="assembly"> <xsd:complexType> <xsd:attribute name="alias" type="xsd:string" /> <xsd:attribute name="name" type="xsd:string" /> </xsd:complexType> </xsd:element> <xsd:element name="data"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="resheader"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" /> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:schema> <resheader name="resmimetype"> <value>text/microsoft-resx</value> </resheader> <resheader name="version"> <value>2.0</value> </resheader> <resheader name="reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <data name="AudioTracks" xml:space="preserve"> <value>Pistes audio</value> </data> <data name="CastTo" xml:space="preserve"> <value>Caster sur</value> </data> <data name="ClosedCaptions" xml:space="preserve"> <value>Sous-titres</value> </data> <data name="Disable" xml:space="preserve"> <value>Désactiver</value> </data> <data name="Error" xml:space="preserve"> <value>Erreur</value> </data> <data name="OK" xml:space="preserve"> <value>OK</value> </data> <data name="Track" xml:space="preserve"> <value>Piste {0}</value> </data> </root>
{ "pile_set_name": "Github" }
package org.javacord.api.util.cache; /** * This class is used to cache message. */ public interface MessageCache { /** * Gets the capacity of the message cache. * Please notice that the cache is cleared only once every minute! * * @return The capacity of the message cache. */ int getCapacity(); /** * Sets the capacity of the message cache. * Messages which are cached forever are not included in this limit. * Please notice that the cache is cleared only once every minute! * * @param capacity The capacity of the message cache. */ void setCapacity(int capacity); /** * Gets the maximum age of the message in seconds. * Please notice that the cache is cleared only once every minute! * * @return The maximum age of the message in seconds. */ int getStorageTimeInSeconds(); /** * Sets maximum age of old messages in seconds. * Please notice that the cache is cleared only once every minute! * * @param storageTimeInSeconds The maximum age in seconds. */ void setStorageTimeInSeconds(int storageTimeInSeconds); /** * Sets whether automatic message cache cleanup is enabled. * * @param automaticCleanupEnabled Whether automatic message cache cleanup is enabled. */ void setAutomaticCleanupEnabled(boolean automaticCleanupEnabled); }
{ "pile_set_name": "Github" }
<?php /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE_AFL.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@magento.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade Magento to newer * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magento.com for more information. * * @category design * @package default_default * @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> <div class="entry-edit custom-options product-custom-options"> <div id="dynamic-price-warrning" style="display:none"> <ul class="messages"> <li class="error-msg"> <ul> <li><?php echo $this->__('Bundle with dynamic pricing cannot include custom defined options. Options will not be saved.') ?></li> </ul> </li> </ul> </div> <div class="entry-edit-head"> <h4><?php echo Mage::helper('catalog')->__('Custom Options') ?></h4> <div class="right"><?php echo $this->getAddButtonHtml() ?></div> </div> <div id="product_options_container" class="box"> <div id="product_options_container_top"></div> <?php echo $this->getOptionsBoxHtml() ?> </div> </div> <script type="text/javascript"> // re-bind form elements onchange varienWindowOnload(true); //show error message if ($('price_type')) { if ($('price_type').value == '0' && $('dynamic-price-warrning')) { $('dynamic-price-warrning').show(); } } </script>
{ "pile_set_name": "Github" }
// Copyright 2013-2020 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. using System; using System.Collections.Generic; using System.Linq; using Serilog.Debugging; using Serilog.Events; namespace Serilog.Core.Sinks { class SafeAggregateSink : ILogEventSink { readonly ILogEventSink[] _sinks; public SafeAggregateSink(IEnumerable<ILogEventSink> sinks) { if (sinks == null) throw new ArgumentNullException(nameof(sinks)); _sinks = sinks.ToArray(); } public void Emit(LogEvent logEvent) { foreach (var sink in _sinks) { try { sink.Emit(logEvent); } catch (Exception ex) { SelfLog.WriteLine("Caught exception while emitting to sink {0}: {1}", sink, ex); } } } } }
{ "pile_set_name": "Github" }
#ifdef _MSC_VER #include <stdlib.h> #include <io.h> #include <windows.h> #define R_OK 4 /* Read permission. */ #define W_OK 2 /* Write permission. */ #define F_OK 0 /* Existence. */ #define access _access #else /* _MSC_VER */ #include <unistd.h> #endif #include "scorer.h" #include <iostream> #include <fstream> #include "lm/config.hh" #include "lm/model.hh" #include "lm/state.hh" #include "util/string_piece.hh" #include "decoder_utils.h" static const int32_t MAGIC = 'TRIE'; static const int32_t FILE_VERSION = 6; int Scorer::init(const std::string& lm_path, const Alphabet& alphabet) { set_alphabet(alphabet); return load_lm(lm_path); } int Scorer::init(const std::string& lm_path, const std::string& alphabet_config_path) { int err = alphabet_.init(alphabet_config_path.c_str()); if (err != 0) { return err; } setup_char_map(); return load_lm(lm_path); } void Scorer::set_alphabet(const Alphabet& alphabet) { alphabet_ = alphabet; setup_char_map(); } void Scorer::setup_char_map() { // (Re-)Initialize character map char_map_.clear(); SPACE_ID_ = alphabet_.GetSpaceLabel(); for (int i = 0; i < alphabet_.GetSize(); i++) { // The initial state of FST is state 0, hence the index of chars in // the FST should start from 1 to avoid the conflict with the initial // state, otherwise wrong decoding results would be given. char_map_[alphabet_.DecodeSingle(i)] = i + 1; } } int Scorer::load_lm(const std::string& lm_path) { // Check if file is readable to avoid KenLM throwing an exception const char* filename = lm_path.c_str(); if (access(filename, R_OK) != 0) { return DS_ERR_SCORER_UNREADABLE; } // Check if the file format is valid to avoid KenLM throwing an exception lm::ngram::ModelType model_type; if (!lm::ngram::RecognizeBinary(filename, model_type)) { return DS_ERR_SCORER_INVALID_LM; } // Load the LM lm::ngram::Config config; config.load_method = util::LoadMethod::LAZY; language_model_.reset(lm::ngram::LoadVirtual(filename, config)); max_order_ = language_model_->Order(); uint64_t package_size; { util::scoped_fd fd(util::OpenReadOrThrow(filename)); package_size = util::SizeFile(fd.get()); } uint64_t trie_offset = language_model_->GetEndOfSearchOffset(); if (package_size <= trie_offset) { // File ends without a trie structure return DS_ERR_SCORER_NO_TRIE; } // Read metadata and trie from file std::ifstream fin(lm_path, std::ios::binary); fin.seekg(trie_offset); return load_trie(fin, lm_path); } int Scorer::load_trie(std::ifstream& fin, const std::string& file_path) { int magic; fin.read(reinterpret_cast<char*>(&magic), sizeof(magic)); if (magic != MAGIC) { std::cerr << "Error: Can't parse scorer file, invalid header. Try updating " "your scorer file." << std::endl; return DS_ERR_SCORER_INVALID_TRIE; } int version; fin.read(reinterpret_cast<char*>(&version), sizeof(version)); if (version != FILE_VERSION) { std::cerr << "Error: Scorer file version mismatch (" << version << " instead of expected " << FILE_VERSION << "). "; if (version < FILE_VERSION) { std::cerr << "Update your scorer file."; } else { std::cerr << "Downgrade your scorer file or update your version of DeepSpeech."; } std::cerr << std::endl; return DS_ERR_SCORER_VERSION_MISMATCH; } fin.read(reinterpret_cast<char*>(&is_utf8_mode_), sizeof(is_utf8_mode_)); // Read hyperparameters from header double alpha, beta; fin.read(reinterpret_cast<char*>(&alpha), sizeof(alpha)); fin.read(reinterpret_cast<char*>(&beta), sizeof(beta)); reset_params(alpha, beta); fst::FstReadOptions opt; opt.mode = fst::FstReadOptions::MAP; opt.source = file_path; dictionary.reset(FstType::Read(fin, opt)); return DS_ERR_OK; } bool Scorer::save_dictionary(const std::string& path, bool append_instead_of_overwrite) { std::ios::openmode om; if (append_instead_of_overwrite) { om = std::ios::in|std::ios::out|std::ios::binary|std::ios::ate; } else { om = std::ios::out|std::ios::binary; } std::fstream fout(path, om); if (!fout ||fout.bad()) { std::cerr << "Error opening '" << path << "'" << std::endl; return false; } fout.write(reinterpret_cast<const char*>(&MAGIC), sizeof(MAGIC)); if (fout.bad()) { std::cerr << "Error writing MAGIC '" << path << "'" << std::endl; return false; } fout.write(reinterpret_cast<const char*>(&FILE_VERSION), sizeof(FILE_VERSION)); if (fout.bad()) { std::cerr << "Error writing FILE_VERSION '" << path << "'" << std::endl; return false; } fout.write(reinterpret_cast<const char*>(&is_utf8_mode_), sizeof(is_utf8_mode_)); if (fout.bad()) { std::cerr << "Error writing is_utf8_mode '" << path << "'" << std::endl; return false; } fout.write(reinterpret_cast<const char*>(&alpha), sizeof(alpha)); if (fout.bad()) { std::cerr << "Error writing alpha '" << path << "'" << std::endl; return false; } fout.write(reinterpret_cast<const char*>(&beta), sizeof(beta)); if (fout.bad()) { std::cerr << "Error writing beta '" << path << "'" << std::endl; return false; } fst::FstWriteOptions opt; opt.align = true; opt.source = path; return dictionary->Write(fout, opt); } bool Scorer::is_scoring_boundary(PathTrie* prefix, size_t new_label) { if (is_utf8_mode()) { if (prefix->character == -1) { return false; } unsigned char first_byte; int distance_to_boundary = prefix->distance_to_codepoint_boundary(&first_byte, alphabet_); int needed_bytes; if ((first_byte >> 3) == 0x1E) { needed_bytes = 4; } else if ((first_byte >> 4) == 0x0E) { needed_bytes = 3; } else if ((first_byte >> 5) == 0x06) { needed_bytes = 2; } else if ((first_byte >> 7) == 0x00) { needed_bytes = 1; } else { assert(false); // invalid byte sequence. should be unreachable, disallowed by vocabulary/trie return false; } return distance_to_boundary == needed_bytes; } else { return new_label == SPACE_ID_; } } double Scorer::get_log_cond_prob(const std::vector<std::string>& words, bool bos, bool eos) { return get_log_cond_prob(words.begin(), words.end(), bos, eos); } double Scorer::get_log_cond_prob(const std::vector<std::string>::const_iterator& begin, const std::vector<std::string>::const_iterator& end, bool bos, bool eos) { const auto& vocab = language_model_->BaseVocabulary(); lm::ngram::State state_vec[2]; lm::ngram::State *in_state = &state_vec[0]; lm::ngram::State *out_state = &state_vec[1]; if (bos) { language_model_->BeginSentenceWrite(in_state); } else { language_model_->NullContextWrite(in_state); } double cond_prob = 0.0; for (auto it = begin; it != end; ++it) { lm::WordIndex word_index = vocab.Index(*it); // encounter OOV if (word_index == lm::kUNK) { return OOV_SCORE; } cond_prob = language_model_->BaseScore(in_state, word_index, out_state); std::swap(in_state, out_state); } if (eos) { cond_prob = language_model_->BaseScore(in_state, vocab.EndSentence(), out_state); } // return loge prob return cond_prob/NUM_FLT_LOGE; } void Scorer::reset_params(float alpha, float beta) { this->alpha = alpha; this->beta = beta; } std::vector<std::string> Scorer::split_labels_into_scored_units(const std::vector<unsigned int>& labels) { if (labels.empty()) return {}; std::string s = alphabet_.Decode(labels); std::vector<std::string> words; if (is_utf8_mode_) { words = split_into_codepoints(s); } else { words = split_str(s, " "); } return words; } std::vector<std::string> Scorer::make_ngram(PathTrie* prefix) { std::vector<std::string> ngram; PathTrie* current_node = prefix; PathTrie* new_node = nullptr; for (int order = 0; order < max_order_; order++) { if (!current_node || current_node->character == -1) { break; } std::vector<unsigned int> prefix_vec; if (is_utf8_mode_) { new_node = current_node->get_prev_grapheme(prefix_vec, alphabet_); } else { new_node = current_node->get_prev_word(prefix_vec, alphabet_); } current_node = new_node->parent; // reconstruct word std::string word = alphabet_.Decode(prefix_vec); ngram.push_back(word); } std::reverse(ngram.begin(), ngram.end()); return ngram; } void Scorer::fill_dictionary(const std::unordered_set<std::string>& vocabulary) { // ConstFst is immutable, so we need to use a MutableFst to create the trie, // and then we convert to a ConstFst for the decoder and for storing on disk. fst::StdVectorFst dictionary; // For each unigram convert to ints and put in trie for (const auto& word : vocabulary) { if (word != START_TOKEN && word != UNK_TOKEN && word != END_TOKEN) { add_word_to_dictionary(word, char_map_, is_utf8_mode_, SPACE_ID_ + 1, &dictionary); } } /* Simplify FST * This gets rid of "epsilon" transitions in the FST. * These are transitions that don't require a string input to be taken. * Getting rid of them is necessary to make the FST deterministic, but * can greatly increase the size of the FST */ fst::RmEpsilon(&dictionary); std::unique_ptr<fst::StdVectorFst> new_dict(new fst::StdVectorFst); /* This makes the FST deterministic, meaning for any string input there's * only one possible state the FST could be in. It is assumed our * dictionary is deterministic when using it. * (lest we'd have to check for multiple transitions at each state) */ fst::Determinize(dictionary, new_dict.get()); /* Finds the simplest equivalent fst. This is unnecessary but decreases * memory usage of the dictionary */ fst::Minimize(new_dict.get()); // Now we convert the MutableFst to a ConstFst (Scorer::FstType) via its ctor std::unique_ptr<FstType> converted(new FstType(*new_dict)); this->dictionary = std::move(converted); }
{ "pile_set_name": "Github" }
--- Code generation compatible with Java7 *or* Java8 syntax {-- ## Concepts ### Data types Representation of data types doesn't change. ### Instances Instance functions can now be called directly via the instance object, instead of first getting a function pointer. ### Higher order functions Arguments that have a function type are always strict. ### Function arity The code generator keeps track of the arity of functions. For example, in @flip :: (a -> b -> c) -> b -> a -> c@ it will pass and expect a @Func2@. If you pass a function @f@ with arity 1 to @flip@, it will be wrapped in an extra lambda @\a\b -> (f a) $ b@. When you pass a function @g@ with a higher arity, say 4, it will be wrapped in a lambda @(\a\b -> (\x3\x4 -> g a b x3 x4))@. Fortunately, the compiler will have established type soundness during type checking, so that in the first case we know that the unary function actually returns another unary function and the application @flip g a b@ yields a binary function. ### Partial applications Partial applications like @flip (-)@ are eta-expanded to @\a\b -> flip (-) a b@. A special case of partial application is when a function is not applied at all - like in @fold (+) 0 xs@. ### Lazy values Lazy values will be instances of @java.run.Lazy@, that is in Java8 notation @() -> some code@. Those are not shared. Shared lazy values (i.e. in @let@ or arguments for constructors) are @new Thunk(() -> value)@. Thunk and Lazy know their return type, i.e. they are generic types. ## The Four Reasons for Stack Overflow ### Tail Calls Tail calls are dangerous, unless the tail called function is _tail call safe_. A function is _tail call safe_ if one of the following applies: - it is a constructor - it is a native function - it is not recursive and calls only tail call safe functions In particular, a function passed as argument is not tail call safe. If the result of a function that is not tail call safe is a (full) application of another function, and this function is itself not tail call safe, or a full application of a non tail call safe function appears in a strict position, then a Lazy closure must be returned instead of doing the call directly. Examples: > even 0 = true > even n = odd (n-a) > odd 0 = false > odd n = even (n-1) Both @even@ and @odd@ are clearly unsafe, hence the code for @even@ should be: > Lazy<java.lang.Boolean> even(int n) { > if (n==0) then return new Thunk(true); > return new Thunk(() -> even(n-1)); > } ### @foldr@ Recursion > foldr f d [] = d > foldr f d (x:xs) = x `f` foldr f d xs If `f` is strict in its right argument, this leads to recursion as deep as the length of the list. This could be solved when the currently evaluating thread -} module frege.compiler.passes.GenCode where import Lib.PP(pretty) import Data.TreeMap(TreeMap, values) import Data.Graph (stronglyConnectedComponents tsort) import Compiler.Utilities as U() import Compiler.types.Global import Compiler.types.JNames import Compiler.types.Symbols import Compiler.types.QNames(QName) import Compiler.types.Packs(pPreludeBase, pPreludeList) import Compiler.types.Strictness(Strictness(isStrict)) import Compiler.common.AnnotateG (annoG, annoListG, notNil) import Compiler.common.JavaName import Compiler.gen.java.Common import Compiler.types.AbstractJava import Compiler.gen.java.Constants(makeConstants) import Compiler.gen.java.VarCode(varCode) import Compiler.gen.java.DataCode(dataCode) import Compiler.gen.java.InstanceCode(classCode, instanceCode, lowerKindSpecialClasses) pass :: StIO (String, Int) pass = do g ← getSTT let modul = JClass{attr=attrs [JFinal, JPublic], name = g.gen.main, gvars=[], extend = fmap (sigmaJT g) g.options.extending, implement = map (sigmaJT g) g.options.implementing, defs=[]} headline = (pretty 2000 (annoG g modul)).replaceAll ´}´ "" -- class my.modul.Name extends ... implements ... { -- Note that we don't make a JClass that contains all compiled definitions, -- although this would be the natural approach. Instead we compile and -- pretty print the definitions individually. This allows us to -- do the pretty printing concurrently maybe later. U.println headline -- print the embedded Java code reconstruct (g.options.code) -- prepare abstract functions of special classes oldg ← liftStG lowerKindSpecialClasses g ← getSTT -- classes let classes = [ s | s@SymC {} <- values g.thisTab ] liftStG (concat <$> mapM classCode classes) >>= liftIO . ppDecls g -- instances let instances = [ s | s@SymI {} <- values g.thisTab ] liftStG (concat <$> mapM instanceCode instances) >>= liftIO . ppDecls g -- data definitions let datas = [ s | s@SymT {} <- values g.thisTab ] liftStG (concat <$> mapM dataCode datas) >>= liftIO . ppDecls g -- do variables in dependency order, this is so that CAFs refer only to CAFs -- whose java initialization occurs earlier let vars = [ s | s@SymV {} <- values g.thisTab ] liftStG ( mapSt U.fundep vars >>= mapSt U.findV . concat . tsort >>= mapSt (varCode TreeMap.empty)) >>= liftIO . ppDecls g . concat -- generate the class for constants liftStG makeConstants >>= liftIO . ppDecls g . maybeToList let baseExtras = [ "final public static<T> TMaybe<T> _toMaybe(T it) {", " return it == null ? TMaybe.DNothing.<T>mk()", " : TMaybe.DJust.<T>mk(Thunk.<T>lazy(it));", "}", ] when (g.thisPack == pPreludeBase) (forM_ baseExtras U.println) let listExtras = [ "/*", " * The following is used to instantiate kind-lowered contexts to the type", " * they are actually used at.", " *", " * The context is declared at the raw type like ", " * static<A extends Kind.U<A,?>, B> ... method(CListView<A> ctx1, ...)", " * ", " * This shall work only for the type classes defined here!", " */", "@SuppressWarnings(\"unchecked\")", "public static<A extends Kind.U<A,?>, B> CListEmpty<Kind.U<A, B>> kindedCtx(CListEmpty<A> ctx) {", " return (CListEmpty<Kind.U<A, B>>)(Object) ctx;", "}", "@SuppressWarnings(\"unchecked\")", "public static<A extends Kind.U<A,?>, B> CListMonoid<Kind.U<A, B>> kindedCtx(CListMonoid<A> ctx) {", " return (CListMonoid<Kind.U<A, B>>)(Object) ctx;", "}", "@SuppressWarnings(\"unchecked\")", "public static<A extends Kind.U<A,?>, B> CListSemigroup<Kind.U<A, B>> kindedCtx(CListSemigroup<A> ctx) {", " return (CListSemigroup<Kind.U<A, B>>)(Object) ctx;", "}", "@SuppressWarnings(\"unchecked\")", "public static<A extends Kind.U<A,?>, B> CListView<Kind.U<A, B>> kindedCtx(CListView<A> ctx) {", " return (CListView<Kind.U<A, B>>)(Object) ctx;", "}", "@SuppressWarnings(\"unchecked\")", "public static<A extends Kind.U<A,?>, B> CListSource<Kind.U<A, B>> kindedCtx(CListSource<A> ctx) {", " return (CListSource<Kind.U<A, B>>)(Object) ctx;", "}" ] when (g.thisPack == pPreludeList) (forM_ listExtras U.println) -- restore unchanged symtabs changeSTT Global.{packages = oldg.packages} -- check if we have a main function, and print it mapM_ U.println (maybe [] (mainCode g) (haveMain g)) U.println "}" -- supply the } that was removed from the headline return ("Gen78", 1) --- Print some declarations stacked ppDecls :: Global -> [JDecl] → IO () ppDecls g decls = do PP.prettyIO g.printer 128 . PP.stack . filter notNil . map (annoG g) $ decls g.printer.println --- the java code to run the main function {-- > public static void main(final java.lang.String[] argv) { > $type ret = > PreludeBase.TST.performUnsafe($name > ( $list ) > ); > if ret then System.exit(0) else System.exit(1); or System.exit(ret&255); or empty > } -} mainCode ∷ Global → Symbol → [String] mainCode g sym = [ " public static void main(final java.lang.String[] argv) {", " try {", " frege.run.RunTM.argv = argv;", " " ++ if isInt then "int ret =" else if isBool then "boolean ret =" else "", " PreludeBase.TST.<" ++ targ ++ ">performUnsafe(" ++ name, if sym.depth > 0 then " (" ++ list ++ ").call()" else " .call()", -- evaluate a possibly lazy main " ).call();", -- evaluate result of performUnsafe " frege.runtime.Runtime.stdout.get().close();", " frege.runtime.Runtime.stderr.get().close();", if isInt then " System.exit(ret&255);" else if isBool then " System.exit(ret ? 0 : 1);" else "", " } finally { " ++ shutdown ++ "(); }", " }" ] where shutdown = "frege.run.Concurrent.shutDownIfExists"; name = (symJavaName g sym).base jtype = tauJT g (fst (U.returnType sym.typ.rho)) isInt | Func{gargs=[a,b]} ← jtype = show b == "Integer" | otherwise = false isBool | Func{gargs=[a,b]} ← jtype = show b == "Boolean" | otherwise = false targ = if isInt then "Integer" else if isBool then "Boolean" else "Short" strict = case sym.strsig of Strictness.S (s:_) = isStrict s _ = false; stol = "PreludeArrays.IListSource_JArray.<String/*<Character>*/>toList(argv)" lazy x = "Thunk.lazy(" ++ x ++ ")" list = if strict then stol else lazy stol --- tell if there is a main function in this module -- haveMain :: Global -> Bool haveMain g = case Global.findit g (VName g.thisPack "main") of Just sym | sym.name.pack == g.thisPack = Just sym other = Nothing
{ "pile_set_name": "Github" }
# 0.4.18 / 2017-06-13 * Fixed CESU-8 regression in Node v8. # 0.4.17 / 2017-04-22 * Updated typescript definition file to support Angular 2 AoT mode (#153 by @larssn) # 0.4.16 / 2017-04-22 * Added support for React Native (#150) * Changed iso8859-1 encoding to usine internal 'binary' encoding, as it's the same thing (#147 by @mscdex) * Fixed typo in Readme (#138 by @jiangzhuo) * Fixed build for Node v6.10+ by making correct version comparison * Added a warning if iconv-lite is loaded not as utf-8 (see #142) # 0.4.15 / 2016-11-21 * Fixed typescript type definition (#137) # 0.4.14 / 2016-11-20 * Preparation for v1.0 * Added Node v6 and latest Node versions to Travis CI test rig * Deprecated Node v0.8 support * Typescript typings (@larssn) * Fix encoding of Euro character in GB 18030 (inspired by @lygstate) * Add ms prefix to dbcs windows encodings (@rokoroku) # 0.4.13 / 2015-10-01 * Fix silly mistake in deprecation notice. # 0.4.12 / 2015-09-26 * Node v4 support: * Added CESU-8 decoding (#106) * Added deprecation notice for `extendNodeEncodings` * Added Travis tests for Node v4 and io.js latest (#105 by @Mithgol) # 0.4.11 / 2015-07-03 * Added CESU-8 encoding. # 0.4.10 / 2015-05-26 * Changed UTF-16 endianness heuristic to take into account any ASCII chars, not just spaces. This should minimize the importance of "default" endianness. # 0.4.9 / 2015-05-24 * Streamlined BOM handling: strip BOM by default, add BOM when encoding if addBOM: true. Added docs to Readme. * UTF16 now uses UTF16-LE by default. * Fixed minor issue with big5 encoding. * Added io.js testing on Travis; updated node-iconv version to test against. Now we just skip testing SBCS encodings that node-iconv doesn't support. * (internal refactoring) Updated codec interface to use classes. * Use strict mode in all files. # 0.4.8 / 2015-04-14 * added alias UNICODE-1-1-UTF-7 for UTF-7 encoding (#94) # 0.4.7 / 2015-02-05 * stop official support of Node.js v0.8. Should still work, but no guarantees. reason: Packages needed for testing are hard to get on Travis CI. * work in environment where Object.prototype is monkey patched with enumerable props (#89). # 0.4.6 / 2015-01-12 * fix rare aliases of single-byte encodings (thanks @mscdex) * double the timeout for dbcs tests to make them less flaky on travis # 0.4.5 / 2014-11-20 * fix windows-31j and x-sjis encoding support (@nleush) * minor fix: undefined variable reference when internal error happens # 0.4.4 / 2014-07-16 * added encodings UTF-7 (RFC2152) and UTF-7-IMAP (RFC3501 Section 5.1.3) * fixed streaming base64 encoding # 0.4.3 / 2014-06-14 * added encodings UTF-16BE and UTF-16 with BOM # 0.4.2 / 2014-06-12 * don't throw exception if `extendNodeEncodings()` is called more than once # 0.4.1 / 2014-06-11 * codepage 808 added # 0.4.0 / 2014-06-10 * code is rewritten from scratch * all widespread encodings are supported * streaming interface added * browserify compatibility added * (optional) extend core primitive encodings to make usage even simpler * moved from vows to mocha as the testing framework
{ "pile_set_name": "Github" }
# Insert blackhole slave into regular replication chain # We hide any output below due using untouched result files of rpl suite --disable_warnings --disable_query_log connection master; # Connect blackhole slave to master. connect (blackhole_slave,127.0.0.1,root,,test,$BHS_MYPORT,); connection blackhole_slave; source include/have_blackhole.inc; SET storage_engine=BLACKHOLE; STOP SLAVE; source include/wait_for_slave_to_stop.inc; RESET SLAVE; eval CHANGE MASTER TO MASTER_USER='root', MASTER_CONNECT_RETRY=1, MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT; START SLAVE; source include/wait_for_slave_to_start.inc; # Stop slave and reconnect to blackhole slave connection slave; STOP SLAVE; RESET SLAVE; eval CHANGE MASTER TO MASTER_USER='root', MASTER_CONNECT_RETRY=1, MASTER_HOST='127.0.0.1', MASTER_PORT=$BHS_MYPORT; START SLAVE; source include/wait_for_slave_to_start.inc; --enable_query_log --enable_warnings
{ "pile_set_name": "Github" }
// author: Jannik Strötgen // email: stroetgen@uni-hd.de // date: 2015-03-24 // This file contains regular expression patterns for 2-digit year. \d\d
{ "pile_set_name": "Github" }
(function() { var $$ = kendo.jQuery; describe("kendo jQuery", function () { beforeEach(function() { kendo.support.touch = true; }); afterEach(function() { kendo.support.touch = false; }); it("Executes listener event handler", function() { var div = $$("<div />").handler({ _click: function() { assert.isOk(true) } }); div.on("click", "_click"); div.trigger("click"); }); it("Unbinds all listeners", function() { var div = $$("<div />").handler({ _click: function() { assert.isOk(true) } }); div.autoApplyNS(); div.on("click", "_click"); div.trigger("click"); div.kendoDestroy(); div.trigger("click"); }); // https://developer.mozilla.org/en/DOM/document.createEvent for the insanity below function dispatchRealEvent(element, eventType) { var evt = document.createEvent("MouseEvents"); evt.initMouseEvent(eventType, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); element[0].dispatchEvent(evt); } if (!kendo.support.browser.msie) { it("Recognizes event aliases", function() { var div = $$("<div />").handler({ _up: function() { assert.isOk(true) } }); div.on("up", "_up"); div.trigger("mouseup"); div.trigger("touchend"); }); it("Skips synthetic mouse events", function() { var mouseAndTouchPresent = kendo.support.mouseAndTouchPresent; kendo.support.mouseAndTouchPresent = true; try { var div = $$("<div />").appendTo(Mocha.fixture).handler({ _down: function() { assert.isOk(true) }, _move: function() { assert.isOk(true) }, _up: function() { assert.isOk(true) } }); div.on("up", "_up"); div.on("move", "_move"); div.on("down", "_down"); div.trigger("touchstart"); div.trigger("touchmove"); div.trigger("touchend"); dispatchRealEvent(div, "mousedown"); dispatchRealEvent(div, "mousemove"); dispatchRealEvent(div, "mouseup"); } finally { kendo.support.mouseAndTouchPresent = mouseAndTouchPresent; } }); it("Registers real mouse events", function(done) { var div = $$("<div />").handler({ _down: function() { assert.isOk(true) } }); div.on("down", "_down"); div.trigger("touchstart"); div.trigger("touchmove"); div.trigger("touchend"); setTimeout(function() { dispatchRealEvent(div, "mousedown"); dispatchRealEvent(div, "mousemove"); dispatchRealEvent(div, "mouseup"); done(); }, 500); }); } it("Is instance of jQuery", function() { assert.isOk($$() instanceof jQuery); }); it("Creates instances of kendo.jQuery", function() { assert.isOk($$() instanceof $$); }); it("find returns instances of kendo.jQuery", function() { assert.isOk($$().find("body") instanceof $$); }); }); }());
{ "pile_set_name": "Github" }
<!DOCTYPE html><html><head> <title>Untitled Document</title> <!--Generated by LaTeXML (version 0.8.4) http://dlmf.nist.gov/LaTeXML/.--> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link type="text/css" rel="stylesheet" href="../../../../dist/css/index.css"></head> <body> <div class="ltx_page_main"> <div class="ltx_page_content"> <article class="ltx_document"> <div id="p1" class="ltx_para"> <p class="ltx_p"><span>http link: <a href="http://link.co.uk/to#something">http://link.co.uk/to#something</a> </span><br class="ltx_break"><span>https link: <a href="https://link.info?param">https://link.info?param</a> url </span><br class="ltx_break"><span>link with trailing period: <a href="https://example.com.">https://example.com.</a> (FIXME: known failure) </span><br class="ltx_break">this should not make a link: foo.bar <br class="ltx_break"><span>this is a link without leading space: badlatex.<a href="http://example.com">http://example.com</a> </span><br class="ltx_break">this is already a link with href: <a href="http://example.com" title="" class="ltx_ref ltx_href">example.com</a> <br class="ltx_break"> <br class="ltx_break">href <a href="http://example.com" title="" class="ltx_ref ltx_href">example.com</a> <br class="ltx_break"> <br class="ltx_break">href without http://, Engrafo should add it: <a href="http://example.com" title="" class="ltx_ref ltx_href">example.com</a> <br class="ltx_break"></p> </div> </article> </div> <footer class="ltx_page_footer"> <div class="ltx_page_logo">Generated by <a href="http://dlmf.nist.gov/LaTeXML/">LaTeXML <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAOCAYAAAD5YeaVAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wKExQZLWTEaOUAAAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAdpJREFUKM9tkL+L2nAARz9fPZNCKFapUn8kyI0e4iRHSR1Kb8ng0lJw6FYHFwv2LwhOpcWxTjeUunYqOmqd6hEoRDhtDWdA8ApRYsSUCDHNt5ul13vz4w0vWCgUnnEc975arX6ORqN3VqtVZbfbTQC4uEHANM3jSqXymFI6yWazP2KxWAXAL9zCUa1Wy2tXVxheKA9YNoR8Pt+aTqe4FVVVvz05O6MBhqUIBGk8Hn8HAOVy+T+XLJfLS4ZhTiRJgqIoVBRFIoric47jPnmeB1mW/9rr9ZpSSn3Lsmir1fJZlqWlUonKsvwWwD8ymc/nXwVBeLjf7xEKhdBut9Hr9WgmkyGEkJwsy5eHG5vN5g0AKIoCAEgkEkin0wQAfN9/cXPdheu6P33fBwB4ngcAcByHJpPJl+fn54mD3Gg0NrquXxeLRQAAwzAYj8cwTZPwPH9/sVg8PXweDAauqqr2cDjEer1GJBLBZDJBs9mE4zjwfZ85lAGg2+06hmGgXq+j3+/DsixYlgVN03a9Xu8jgCNCyIegIAgx13Vfd7vdu+FweG8YRkjXdWy329+dTgeSJD3ieZ7RNO0VAXAPwDEAO5VKndi2fWrb9jWl9Esul6PZbDY9Go1OZ7PZ9z/lyuD3OozU2wAAAABJRU5ErkJggg==" alt="[LOGO]"></a> </div></footer> </div> <script type="text/javascript" src="../../../../dist/javascript/index.js"></script></body></html>
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8" ?> <appendix id="appendixes.configuration"> <title>The XML Configuration File</title> <section id="appendixes.configuration.phpunit"> <title>PHPUnit</title> <para> The attributes of the <literal><![CDATA[<phpunit>]]></literal> element can be used to configure PHPUnit's core functionality. </para> <screen><![CDATA[<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.0/phpunit.xsd" backupGlobals="true" backupStaticAttributes="false" <!--bootstrap="/path/to/bootstrap.php"--> cacheTokens="false" colors="false" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" forceCoversAnnotation="false" mapTestClassNameToCoveredClassName="false" printerClass="PHPUnit_TextUI_ResultPrinter" <!--printerFile="/path/to/ResultPrinter.php"--> processIsolation="false" stopOnError="false" stopOnFailure="false" stopOnIncomplete="false" stopOnSkipped="false" stopOnRisky="false" testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader" <!--testSuiteLoaderFile="/path/to/StandardTestSuiteLoader.php"--> timeoutForSmallTests="1" timeoutForMediumTests="10" timeoutForLargeTests="60" verbose="false"> <!-- ... --> </phpunit>]]></screen> <para> The XML configuration above corresponds to the default behaviour of the TextUI test runner documented in <xref linkend="textui.clioptions" />. </para> <para> Additional options that are not available as command-line options are: </para> <variablelist> <varlistentry> <term><literal>convertErrorsToExceptions</literal></term> <listitem> <para> By default, PHPUnit will install an error handler that converts the following errors to exceptions: </para> <itemizedlist> <listitem><literal>E_WARNING</literal></listitem> <listitem><literal>E_NOTICE</literal></listitem> <listitem><literal>E_USER_ERROR</literal></listitem> <listitem><literal>E_USER_WARNING</literal></listitem> <listitem><literal>E_USER_NOTICE</literal></listitem> <listitem><literal>E_STRICT</literal></listitem> <listitem><literal>E_RECOVERABLE_ERROR</literal></listitem> <listitem><literal>E_DEPRECATED</literal></listitem> <listitem><literal>E_USER_DEPRECATED</literal></listitem> </itemizedlist> <para> Set <literal>convertErrorsToExceptions</literal> to <literal>false</literal> to disable this feature. </para> </listitem> </varlistentry> <varlistentry> <term><literal>convertNoticesToExceptions</literal></term> <listitem> <para> When set to <literal>false</literal>, the error handler installed by <literal>convertErrorsToExceptions</literal> will not convert <literal>E_NOTICE</literal>, <literal>E_USER_NOTICE</literal>, or <literal>E_STRICT</literal> errors to exceptions. </para> </listitem> </varlistentry> <varlistentry> <term><literal>convertWarningsToExceptions</literal></term> <listitem> <para> When set to <literal>false</literal>, the error handler installed by <literal>convertErrorsToExceptions</literal> will not convert <literal>E_WARNING</literal> or <literal>E_USER_WARNING</literal> errors to exceptions. </para> </listitem> </varlistentry> <varlistentry> <term><literal>forceCoversAnnotation</literal></term> <listitem> <para> Code Coverage will only be recorded for tests that use the <literal>@covers</literal> annotation documented in <xref linkend="appendixes.annotations.covers" />. </para> </listitem> </varlistentry> <varlistentry> <term><literal>timeoutForLargeTests</literal></term> <listitem> <para> If time limits based on test size are enforced then this attribute sets the timeout for all tests marked as <literal>@large</literal>. If a test does not complete within its configured timeout, it will fail. </para> </listitem> </varlistentry> <varlistentry> <term><literal>timeoutForMediumTests</literal></term> <listitem> <para> If time limits based on test size are enforced then this attribute sets the timeout for all tests marked as <literal>@medium</literal>. If a test does not complete within its configured timeout, it will fail. </para> </listitem> </varlistentry> <varlistentry> <term><literal>timeoutForSmallTests</literal></term> <listitem> <para> If time limits based on test size are enforced then this attribute sets the timeout for all tests not marked as <literal>@medium</literal> or <literal>@large</literal>. If a test does not complete within its configured timeout, it will fail. </para> </listitem> </varlistentry> </variablelist> </section> <section id="appendixes.configuration.testsuites"> <title>Test Suites</title> <para> <indexterm><primary>Test Suite</primary></indexterm> The <literal><![CDATA[<testsuites>]]></literal> element and its one or more <literal><![CDATA[<testsuite>]]></literal> children can be used to compose a test suite out of test suites and test cases. </para> <screen><![CDATA[<testsuites> <testsuite name="My Test Suite"> <directory>/path/to/*Test.php files</directory> <file>/path/to/MyTest.php</file> <exclude>/path/to/exclude</exclude> </testsuite> </testsuites>]]></screen> <para> Using the <literal>phpVersion</literal> and <literal>phpVersionOperator</literal> attributes, a required PHP version can be specified. The example below will only add the <filename>/path/to/*Test.php</filename> files and <filename>/path/to/MyTest.php</filename> file if the PHP version is at least 5.3.0. </para> <screen><![CDATA[ <testsuites> <testsuite name="My Test Suite"> <directory suffix="Test.php" phpVersion="5.3.0" phpVersionOperator=">=">/path/to/files</directory> <file phpVersion="5.3.0" phpVersionOperator=">=">/path/to/MyTest.php</file> </testsuite> </testsuites>]]></screen> <para> The <literal>phpVersionOperator</literal> attribute is optional and defaults to <literal><![CDATA[>=]]></literal>. </para> </section> <section id="appendixes.configuration.groups"> <title>Groups</title> <para> <indexterm><primary>Test Groups</primary></indexterm> The <literal><![CDATA[<groups>]]></literal> element and its <literal><![CDATA[<include>]]></literal>, <literal><![CDATA[<exclude>]]></literal>, and <literal><![CDATA[<group>]]></literal> children can be used to select groups of tests marked with the <literal>@group</literal> annotation (documented in <xref linkend="appendixes.annotations.group" />) that should (not) be run. </para> <screen><![CDATA[<groups> <include> <group>name</group> </include> <exclude> <group>name</group> </exclude> </groups>]]></screen> <para> The XML configuration above corresponds to invoking the TextUI test runner with the following options: </para> <itemizedlist> <listitem><para><literal>--group name</literal></para></listitem> <listitem><para><literal>--exclude-group name</literal></para></listitem> </itemizedlist> </section> <section id="appendixes.configuration.whitelisting-files"> <title>Whitelisting Files for Code Coverage</title> <para> <indexterm><primary>Code Coverage</primary></indexterm> <indexterm><primary>Whitelist</primary></indexterm> The <literal><![CDATA[<filter>]]></literal> element and its children can be used to configure the whitelist for the code coverage reporting. </para> <screen><![CDATA[<filter> <whitelist processUncoveredFilesFromWhitelist="true"> <directory suffix=".php">/path/to/files</directory> <file>/path/to/file</file> <exclude> <directory suffix=".php">/path/to/files</directory> <file>/path/to/file</file> </exclude> </whitelist> </filter>]]></screen> </section> <section id="appendixes.configuration.logging"> <title>Logging</title> <para> <indexterm><primary>Logging</primary></indexterm> The <literal><![CDATA[<logging>]]></literal> element and its <literal><![CDATA[<log>]]></literal> children can be used to configure the logging of the test execution. </para> <screen><![CDATA[<logging> <log type="coverage-html" target="/tmp/report" lowUpperBound="35" highLowerBound="70"/> <log type="coverage-clover" target="/tmp/coverage.xml"/> <log type="coverage-php" target="/tmp/coverage.serialized"/> <log type="coverage-text" target="php://stdout" showUncoveredFiles="false"/> <log type="junit" target="/tmp/logfile.xml"/> <log type="testdox-html" target="/tmp/testdox.html"/> <log type="testdox-text" target="/tmp/testdox.txt"/> </logging>]]></screen> <para> The XML configuration above corresponds to invoking the TextUI test runner with the following options: </para> <itemizedlist> <listitem><para><literal>--coverage-html /tmp/report</literal></para></listitem> <listitem><para><literal>--coverage-clover /tmp/coverage.xml</literal></para></listitem> <listitem><para><literal>--coverage-php /tmp/coverage.serialized</literal></para></listitem> <listitem><para><literal>--coverage-text</literal></para></listitem> <listitem><para><literal><![CDATA[>]]> /tmp/logfile.txt</literal></para></listitem> <listitem><para><literal>--log-junit /tmp/logfile.xml</literal></para></listitem> <listitem><para><literal>--testdox-html /tmp/testdox.html</literal></para></listitem> <listitem><para><literal>--testdox-text /tmp/testdox.txt</literal></para></listitem> </itemizedlist> <para> The <literal>lowUpperBound</literal>, <literal>highLowerBound</literal>, and <literal>showUncoveredFiles</literal> attributes have no equivalent TextUI test runner option. </para> <itemizedlist> <listitem><para><literal>lowUpperBound</literal>: Maximum coverage percentage to be considered "lowly" covered.</para></listitem> <listitem><para><literal>highLowerBound</literal>: Minimum coverage percentage to be considered "highly" covered.</para></listitem> <listitem><para><literal>showUncoveredFiles</literal>: Show all whitelisted files in <literal>--coverage-text</literal> output not just the ones with coverage information.</para></listitem> <listitem><para><literal>showOnlySummary</literal>: Show only the summary in <literal>--coverage-text</literal> output.</para></listitem> </itemizedlist> </section> <section id="appendixes.configuration.test-listeners"> <title>Test Listeners</title> <para> <indexterm><primary>PHPUnit\Framework\TestListener</primary></indexterm> <indexterm><primary>Test Listener</primary></indexterm> The <literal><![CDATA[<listeners>]]></literal> element and its <literal><![CDATA[<listener>]]></literal> children can be used to attach additional test listeners to the test execution. </para> <screen><![CDATA[<listeners> <listener class="MyListener" file="/optional/path/to/MyListener.php"> <arguments> <array> <element key="0"> <string>Sebastian</string> </element> </array> <integer>22</integer> <string>April</string> <double>19.78</double> <null/> <object class="stdClass"/> </arguments> </listener> </listeners>]]></screen> <para> The XML configuration above corresponds to attaching the <literal>$listener</literal> object (see below) to the test execution: </para> <screen><![CDATA[$listener = new MyListener( ['Sebastian'], 22, 'April', 19.78, null, new stdClass );]]></screen> </section> <section id="appendixes.configuration.php-ini-constants-variables"> <title>Setting PHP INI settings, Constants and Global Variables</title> <para> <indexterm><primary>Constant</primary></indexterm> <indexterm><primary>Global Variable</primary></indexterm> <indexterm><primary><literal>php.ini</literal></primary></indexterm> The <literal><![CDATA[<php>]]></literal> element and its children can be used to configure PHP settings, constants, and global variables. It can also be used to prepend the <literal>include_path</literal>. </para> <screen><![CDATA[<php> <includePath>.</includePath> <ini name="foo" value="bar"/> <const name="foo" value="bar"/> <var name="foo" value="bar"/> <env name="foo" value="bar"/> <post name="foo" value="bar"/> <get name="foo" value="bar"/> <cookie name="foo" value="bar"/> <server name="foo" value="bar"/> <files name="foo" value="bar"/> <request name="foo" value="bar"/> </php>]]></screen> <para> The XML configuration above corresponds to the following PHP code: </para> <screen><![CDATA[ini_set('foo', 'bar'); define('foo', 'bar'); $GLOBALS['foo'] = 'bar'; $_ENV['foo'] = 'bar'; $_POST['foo'] = 'bar'; $_GET['foo'] = 'bar'; $_COOKIE['foo'] = 'bar'; $_SERVER['foo'] = 'bar'; $_FILES['foo'] = 'bar'; $_REQUEST['foo'] = 'bar';]]></screen> </section> </appendix>
{ "pile_set_name": "Github" }
$(function() { $('.open-embed').click(function(event) { event.preventDefault(); $('.embed, .close-embed').show(); $('.open-embed').hide(); }); $('.close-embed').click(function(event) { event.preventDefault(); $('.embed, .close-embed').hide(); $('.open-embed').show(); }); $('.embed textarea').on('focus', function() { this.select(); }); $('.embed a').on('click', function() { $('.embed a').toggleClass('current'); $('.embed textarea').toggleClass('hidden'); return false; }); });
{ "pile_set_name": "Github" }
package com.planet_ink.coffee_mud.Abilities.Druid; import com.planet_ink.coffee_mud.core.interfaces.*; import com.planet_ink.coffee_mud.core.*; import com.planet_ink.coffee_mud.core.collections.*; import com.planet_ink.coffee_mud.Abilities.interfaces.*; import com.planet_ink.coffee_mud.Areas.interfaces.*; import com.planet_ink.coffee_mud.Behaviors.interfaces.*; import com.planet_ink.coffee_mud.CharClasses.interfaces.*; import com.planet_ink.coffee_mud.Commands.interfaces.*; import com.planet_ink.coffee_mud.Common.interfaces.*; import com.planet_ink.coffee_mud.Exits.interfaces.*; import com.planet_ink.coffee_mud.Items.interfaces.*; import com.planet_ink.coffee_mud.Libraries.interfaces.*; import com.planet_ink.coffee_mud.Locales.interfaces.*; import com.planet_ink.coffee_mud.MOBS.interfaces.*; import com.planet_ink.coffee_mud.Races.interfaces.*; import java.util.*; /* Copyright 2003-2020 Bo Zimmerman Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ public class Chant_ManicMoon extends Chant { @Override public String ID() { return "Chant_ManicMoon"; } private final static String localizedName = CMLib.lang().L("Manic Moon"); @Override public String name() { return localizedName; } private final static String localizedStaticDisplay = CMLib.lang().L("(Manic Moon)"); @Override public String displayText() { return localizedStaticDisplay; } @Override public int abstractQuality() { return Ability.QUALITY_MALICIOUS; } @Override protected int canAffectCode() { return CAN_ROOMS; } @Override protected int canTargetCode() { return 0; } @Override public int classificationCode() { return Ability.ACODE_CHANT|Ability.DOMAIN_MOONALTERING; } @Override public void unInvoke() { if((affected instanceof Room)&&(canBeUninvoked())) ((Room)affected).showHappens(CMMsg.MSG_OK_VISUAL,L("The manic moon sets.")); super.unInvoke(); } @Override public boolean tick(final Tickable ticking, final int tickID) { if(!super.tick(ticking,tickID)) return false; if(affected==null) return false; if(affected instanceof Room) { final Room room=(Room)affected; if(!room.getArea().getClimateObj().canSeeTheMoon(room,this)) unInvoke(); else for(int i=0;i<room.numInhabitants();i++) { final MOB M=room.fetchInhabitant(i); if((M!=null)&&(M!=invoker)) { if(M.isInCombat()) { if(CMLib.dice().rollPercentage()<20) M.setVictim(null); else { final MOB newvictim=M.location().fetchRandomInhabitant(); if(newvictim!=M) M.setVictim(newvictim); } } else if(CMLib.dice().rollPercentage()<20) { final MOB newvictim=M.location().fetchRandomInhabitant(); if(newvictim!=M) M.setVictim(newvictim); } } } final MOB M=room.fetchRandomInhabitant(); if((CMLib.dice().rollPercentage()<50)&&(M!=null)&&(M!=invoker)) switch(CMLib.dice().roll(1,5,0)) { case 1: room.show(M,null,CMMsg.MSG_NOISE,L("<S-NAME> howl(s) at the moon!")); break; case 2: room.show(M,null,CMMsg.MSG_NOISYMOVEMENT,L("<S-NAME> wig(s) out!")); break; case 3: room.show(M,null,CMMsg.MSG_QUIETMOVEMENT,L("<S-NAME> get(s) confused!")); break; case 4: room.show(M,null,CMMsg.MSG_NOISE,L("<S-NAME> sing(s) randomly!")); break; case 5: room.show(M,null,CMMsg.MSG_NOISE,L("<S-NAME> go(es) nuts!")); break; } } return true; } @Override public int castingQuality(final MOB mob, final Physical target) { if(mob!=null) { if(mob.isMonster()) { if(mob.location().numInhabitants()<2) return Ability.QUALITY_INDIFFERENT; } final Room R=mob.location(); if(R!=null) { if(!R.getArea().getClimateObj().canSeeTheMoon(R,null)) return Ability.QUALITY_INDIFFERENT; for(final Enumeration<Ability> a=R.effects();a.hasMoreElements();) { final Ability A=a.nextElement(); if((A!=null) &&((A.classificationCode()&Ability.ALL_DOMAINS)==Ability.DOMAIN_MOONALTERING)) return Ability.QUALITY_INDIFFERENT; } } } return super.castingQuality(mob,target); } @Override public boolean invoke(final MOB mob, final List<String> commands, final Physical givenTarget, final boolean auto, final int asLevel) { final Room target=mob.location(); if(target==null) return false; if(!target.getArea().getClimateObj().canSeeTheMoon(target,null)) { mob.tell(L("You must be able to see the moon for this magic to work.")); return false; } if(target.fetchEffect(ID())!=null) { mob.tell(L("This place is already under the manic moon.")); return false; } for(final Enumeration<Ability> a=target.effects();a.hasMoreElements();) { final Ability A=a.nextElement(); if((A!=null) &&((A.classificationCode()&Ability.ALL_DOMAINS)==Ability.DOMAIN_MOONALTERING)) { mob.tell(L("The moon is already under @x1, and can not be changed until this magic is gone.",A.name())); return false; } } if(!super.invoke(mob,commands,givenTarget,auto,asLevel)) return false; final boolean success=proficiencyCheck(mob,0,auto); if(success) { invoker=mob; final CMMsg msg=CMClass.getMsg(mob,target,this,verbalCastCode(mob,target,auto),auto?"":L("^S<S-NAME> chant(s) to the sky.^?")); if(mob.location().okMessage(mob,msg)) { mob.location().send(mob,msg); if(msg.value()<=0) { mob.location().showHappens(CMMsg.MSG_OK_VISUAL,L("The Manic Moon Rises!")); beneficialAffect(mob,target,asLevel,0); } } } else return maliciousFizzle(mob,target,L("<S-NAME> chant(s) to the sky, but the magic fades.")); // return whether it worked return success; } }
{ "pile_set_name": "Github" }
# Hungarian translations for Ruby on Rails # by Richard Abonyi (richard.abonyi@gmail.com) # thanks to KKata, replaced and #hup.hu # Cleaned up by László Bácsi (http://lackac.hu) # updated by kfl62 kfl62g@gmail.com "hu": date: formats: default: "%Y.%m.%d." short: "%b %e." long: "%Y. %B %e." day_names: [vasárnap, hétfő, kedd, szerda, csütörtök, péntek, szombat] abbr_day_names: [v., h., k., sze., cs., p., szo.] month_names: [~, január, február, március, április, május, június, július, augusztus, szeptember, október, november, december] abbr_month_names: [~, jan., febr., márc., ápr., máj., jún., júl., aug., szept., okt., nov., dec.] order: [ :year, :month, :day ] time: formats: default: "%Y. %b %e., %H:%M" time: "%H:%M" short: "%b %e., %H:%M" long: "%Y. %B %e., %A, %H:%M" am: "de." pm: "du." datetime: distance_in_words: half_a_minute: 'fél perc' less_than_x_seconds: # zero: 'kevesebb, mint 1 másodperc' one: 'kevesebb, mint 1 másodperc' other: 'kevesebb, mint {{count}} másodperc' x_seconds: one: '1 másodperc' other: '{{count}} másodperc' less_than_x_minutes: # zero: 'kevesebb, mint 1 perc' one: 'kevesebb, mint 1 perc' other: 'kevesebb, mint {{count}} perc' x_minutes: one: '1 perc' other: '{{count}} perc' about_x_hours: one: 'majdnem 1 óra' other: 'majdnem {{count}} óra' x_days: one: '1 nap' other: '{{count}} nap' about_x_months: one: 'majdnem 1 hónap' other: 'majdnem {{count}} hónap' x_months: one: '1 hónap' other: '{{count}} hónap' about_x_years: one: 'majdnem 1 év' other: 'majdnem {{count}} év' over_x_years: one: 'több, mint 1 év' other: 'több, mint {{count}} év' almost_x_years: one: "almost 1 year" other: "almost {{count}} years" prompts: year: "Év" month: "Hónap" day: "Nap" hour: "Óra" minute: "Perc" second: "Másodperc" number: format: precision: 2 separator: ',' delimiter: ' ' currency: format: unit: 'Ft' precision: 0 format: '%n %u' separator: "" delimiter: "" percentage: format: delimiter: "" precision: format: delimiter: "" human: format: delimiter: "" precision: 1 storage_units: format: "%n %u" units: byte: one: "bájt" other: "bájt" kb: "KB" mb: "MB" gb: "GB" tb: "TB" support: array: # sentence_connector: "és" # skip_last_comma: true words_connector: ", " two_words_connector: " és " last_word_connector: " és " activerecord: errors: template: header: one: "1 hiba miatt nem menthető a következő: {{model}}" other: "{{count}} hiba miatt nem menthető a következő: {{model}}" body: "Problémás mezők:" messages: inclusion: "nincs a listában" exclusion: "nem elérhető" invalid: "nem megfelelő" confirmation: "nem egyezik" accepted: "nincs elfogadva" empty: "nincs megadva" blank: "nincs megadva" too_long: "túl hosszú (nem lehet több {{count}} karakternél)" too_short: "túl rövid (legalább {{count}} karakter kell legyen)" wrong_length: "nem megfelelő hosszúságú ({{count}} karakter szükséges)" taken: "már foglalt" not_a_number: "nem szám" greater_than: "nagyobb kell legyen, mint {{count}}" greater_than_or_equal_to: "legalább {{count}} kell legyen" equal_to: "pontosan {{count}} kell legyen" less_than: "kevesebb, mint {{count}} kell legyen" less_than_or_equal_to: "legfeljebb {{count}} lehet" odd: "páratlan kell legyen" even: "páros kell legyen" greater_than_start_date: "nagyobbnak kell lennie, mint az indítás dátuma" not_same_project: "nem azonos projekthez tartozik" circular_dependency: "Ez a kapcsolat egy körkörös függőséget eredményez" actionview_instancetag_blank_option: Kérem válasszon general_text_No: 'Nem' general_text_Yes: 'Igen' general_text_no: 'nem' general_text_yes: 'igen' general_lang_name: 'Magyar' general_csv_separator: ',' general_csv_decimal_separator: '.' general_csv_encoding: ISO-8859-2 general_pdf_encoding: ISO-8859-2 general_first_day_of_week: '1' notice_account_updated: A fiók adatai sikeresen frissítve. notice_account_invalid_creditentials: Hibás felhasználói név, vagy jelszó notice_account_password_updated: A jelszó módosítása megtörtént. notice_account_wrong_password: Hibás jelszó notice_account_register_done: A fiók sikeresen létrehozva. Aktiválásához kattints az e-mailben kapott linkre notice_account_unknown_email: Ismeretlen felhasználó. notice_can_t_change_password: A fiók külső azonosítási forrást használ. A jelszó megváltoztatása nem lehetséges. notice_account_lost_email_sent: Egy e-mail üzenetben postáztunk Önnek egy leírást az új jelszó beállításáról. notice_account_activated: Fiókját aktiváltuk. Most már be tud jelentkezni a rendszerbe. notice_successful_create: Sikeres létrehozás. notice_successful_update: Sikeres módosítás. notice_successful_delete: Sikeres törlés. notice_successful_connection: Sikeres bejelentkezés. notice_file_not_found: Az oldal, amit meg szeretne nézni nem található, vagy átkerült egy másik helyre. notice_locking_conflict: Az adatot egy másik felhasználó idő közben módosította. notice_not_authorized: Nincs hozzáférési engedélye ehhez az oldalhoz. notice_email_sent: "Egy e-mail üzenetet küldtünk a következő címre {{value}}" notice_email_error: "Hiba történt a levél küldése közben ({{value}})" notice_feeds_access_key_reseted: Az RSS hozzáférési kulcsát újra generáltuk. notice_failed_to_save_issues: "Nem sikerült a {{count}} feladat(ok) mentése a {{total}} -ban kiválasztva: {{ids}}." notice_no_issue_selected: "Nincs feladat kiválasztva! Kérem jelölje meg melyik feladatot szeretné szerkeszteni!" notice_account_pending: "A fiókja létrejött, és adminisztrátori jóváhagyásra vár." notice_default_data_loaded: Az alapértelmezett konfiguráció betöltése sikeresen megtörtént. error_can_t_load_default_data: "Az alapértelmezett konfiguráció betöltése nem lehetséges: {{value}}" error_scm_not_found: "A bejegyzés, vagy revízió nem található a tárolóban." error_scm_command_failed: "A tároló elérése közben hiba lépett fel: {{value}}" error_scm_annotate: "A bejegyzés nem létezik, vagy nics jegyzetekkel ellátva." error_issue_not_found_in_project: 'A feladat nem található, vagy nem ehhez a projekthez tartozik' mail_subject_lost_password: Az Ön Redmine jelszava mail_body_lost_password: 'A Redmine jelszó megváltoztatásához, kattintson a következő linkre:' mail_subject_register: Redmine azonosító aktiválása mail_body_register: 'A Redmine azonosítója aktiválásához, kattintson a következő linkre:' mail_body_account_information_external: "A {{value}} azonosító használatával bejelentkezhet a Redmineba." mail_body_account_information: Az Ön Redmine azonosítójának információi mail_subject_account_activation_request: Redmine azonosító aktiválási kérelem mail_body_account_activation_request: "Egy új felhasználó ({{value}}) regisztrált, azonosítója jóváhasgyásra várakozik:" gui_validation_error: 1 hiba gui_validation_error_plural: "{{count}} hiba" field_name: Név field_description: Leírás field_summary: Összegzés field_is_required: Kötelező field_firstname: Keresztnév field_lastname: Vezetéknév field_mail: E-mail field_filename: Fájl field_filesize: Méret field_downloads: Letöltések field_author: Szerző field_created_on: Létrehozva field_updated_on: Módosítva field_field_format: Formátum field_is_for_all: Minden projekthez field_possible_values: Lehetséges értékek field_regexp: Reguláris kifejezés field_min_length: Minimum hossz field_max_length: Maximum hossz field_value: Érték field_category: Kategória field_title: Cím field_project: Projekt field_issue: Feladat field_status: Státusz field_notes: Feljegyzések field_is_closed: Feladat lezárva field_is_default: Alapértelmezett érték field_tracker: Típus field_subject: Tárgy field_due_date: Befejezés dátuma field_assigned_to: Felelős field_priority: Prioritás field_fixed_version: Cél verzió field_user: Felhasználó field_role: Szerepkör field_homepage: Weboldal field_is_public: Nyilvános field_parent: Szülő projekt field_is_in_roadmap: Feladatok látszanak az életútban field_login: Azonosító field_mail_notification: E-mail értesítések field_admin: Adminisztrátor field_last_login_on: Utolsó bejelentkezés field_language: Nyelv field_effective_date: Dátum field_password: Jelszó field_new_password: Új jelszó field_password_confirmation: Megerősítés field_version: Verzió field_type: Típus field_host: Kiszolgáló field_port: Port field_account: Felhasználói fiók field_base_dn: Base DN field_attr_login: Bejelentkezési tulajdonság field_attr_firstname: Családnév field_attr_lastname: Utónév field_attr_mail: E-mail field_onthefly: On-the-fly felhasználó létrehozás field_start_date: Kezdés dátuma field_done_ratio: Elkészült (%) field_auth_source: Azonosítási mód field_hide_mail: Rejtse el az e-mail címem field_comments: Megjegyzés field_url: URL field_start_page: Kezdőlap field_subproject: Alprojekt field_hours: Óra field_activity: Aktivitás field_spent_on: Dátum field_identifier: Azonosító field_is_filter: Szűrőként használható field_issue_to: Kapcsolódó feladat field_delay: Késés field_assignable: Feladat rendelhető ehhez a szerepkörhöz field_redirect_existing_links: Létező linkek átirányítása field_estimated_hours: Becsült idő field_column_names: Oszlopok field_time_zone: Időzóna field_searchable: Kereshető field_default_value: Alapértelmezett érték field_comments_sorting: Feljegyzések megjelenítése setting_app_title: Alkalmazás címe setting_app_subtitle: Alkalmazás alcíme setting_welcome_text: Üdvözlő üzenet setting_default_language: Alapértelmezett nyelv setting_login_required: Azonosítás szükséges setting_self_registration: Regisztráció setting_attachment_max_size: Melléklet max. mérete setting_issues_export_limit: Feladatok exportálásának korlátja setting_mail_from: Kibocsátó e-mail címe setting_bcc_recipients: Titkos másolat címzet (bcc) setting_host_name: Kiszolgáló neve setting_text_formatting: Szöveg formázás setting_wiki_compression: Wiki történet tömörítés setting_feeds_limit: RSS tartalom korlát setting_default_projects_public: Az új projektek alapértelmezés szerint nyilvánosak setting_autofetch_changesets: Commitok automatikus lehúzása setting_sys_api_enabled: WS engedélyezése a tárolók kezeléséhez setting_commit_ref_keywords: Hivatkozó kulcsszavak setting_commit_fix_keywords: Javítások kulcsszavai setting_autologin: Automatikus bejelentkezés setting_date_format: Dátum formátum setting_time_format: Idő formátum setting_cross_project_issue_relations: Kereszt-projekt feladat hivatkozások engedélyezése setting_issue_list_default_columns: Az alapértelmezésként megjelenített oszlopok a feladat listában setting_repositories_encodings: Tárolók kódolása setting_emails_footer: E-mail lábléc setting_protocol: Protokol setting_per_page_options: Objektum / oldal opciók setting_user_format: Felhasználók megjelenítésének formája setting_activity_days_default: Napok megjelenítése a project aktivitásnál setting_display_subprojects_issues: Alapértelmezettként mutassa az alprojektek feladatait is a projekteken project_module_issue_tracking: Feladat követés project_module_time_tracking: Idő rögzítés project_module_news: Hírek project_module_documents: Dokumentumok project_module_files: Fájlok project_module_wiki: Wiki project_module_repository: Tároló project_module_boards: Fórumok label_user: Felhasználó label_user_plural: Felhasználók label_user_new: Új felhasználó label_project: Projekt label_project_new: Új projekt label_project_plural: Projektek label_x_projects: zero: no projects one: 1 project other: "{{count}} projects" label_project_all: Az összes projekt label_project_latest: Legutóbbi projektek label_issue: Feladat label_issue_new: Új feladat label_issue_plural: Feladatok label_issue_view_all: Minden feladat megtekintése label_issues_by: "{{value}} feladatai" label_issue_added: Feladat hozzáadva label_issue_updated: Feladat frissítve label_document: Dokumentum label_document_new: Új dokumentum label_document_plural: Dokumentumok label_document_added: Dokumentum hozzáadva label_role: Szerepkör label_role_plural: Szerepkörök label_role_new: Új szerepkör label_role_and_permissions: Szerepkörök, és jogosultságok label_member: Résztvevő label_member_new: Új résztvevő label_member_plural: Résztvevők label_tracker: Feladat típus label_tracker_plural: Feladat típusok label_tracker_new: Új feladat típus label_workflow: Workflow label_issue_status: Feladat státusz label_issue_status_plural: Feladat státuszok label_issue_status_new: Új státusz label_issue_category: Feladat kategória label_issue_category_plural: Feladat kategóriák label_issue_category_new: Új kategória label_custom_field: Egyéni mező label_custom_field_plural: Egyéni mezők label_custom_field_new: Új egyéni mező label_enumerations: Felsorolások label_enumeration_new: Új érték label_information: Információ label_information_plural: Információk label_please_login: Jelentkezzen be label_register: Regisztráljon label_password_lost: Elfelejtett jelszó label_home: Kezdőlap label_my_page: Saját kezdőlapom label_my_account: Fiókom adatai label_my_projects: Saját projektem label_administration: Adminisztráció label_login: Bejelentkezés label_logout: Kijelentkezés label_help: Súgó label_reported_issues: Bejelentett feladatok label_assigned_to_me_issues: A nekem kiosztott feladatok label_last_login: Utolsó bejelentkezés label_registered_on: Regisztrált label_activity: Tevékenységek label_overall_activity: Teljes aktivitás label_new: Új label_logged_as: Bejelentkezve, mint label_environment: Környezet label_authentication: Azonosítás label_auth_source: Azonosítás módja label_auth_source_new: Új azonosítási mód label_auth_source_plural: Azonosítási módok label_subproject_plural: Alprojektek label_and_its_subprojects: "{{value}} és alprojektjei" label_min_max_length: Min - Max hossz label_list: Lista label_date: Dátum label_integer: Egész label_float: Lebegőpontos label_boolean: Logikai label_string: Szöveg label_text: Hosszú szöveg label_attribute: Tulajdonság label_attribute_plural: Tulajdonságok label_download: "{{count}} Letöltés" label_download_plural: "{{count}} Letöltések" label_no_data: Nincs megjeleníthető adat label_change_status: Státusz módosítása label_history: Történet label_attachment: Fájl label_attachment_new: Új fájl label_attachment_delete: Fájl törlése label_attachment_plural: Fájlok label_file_added: Fájl hozzáadva label_report: Jelentés label_report_plural: Jelentések label_news: Hírek label_news_new: Hír hozzáadása label_news_plural: Hírek label_news_latest: Legutóbbi hírek label_news_view_all: Minden hír megtekintése label_news_added: Hír hozzáadva label_settings: Beállítások label_overview: Áttekintés label_version: Verzió label_version_new: Új verzió label_version_plural: Verziók label_confirmation: Jóváhagyás label_export_to: Exportálás label_read: Olvas... label_public_projects: Nyilvános projektek label_open_issues: nyitott label_open_issues_plural: nyitott label_closed_issues: lezárt label_closed_issues_plural: lezárt label_x_open_issues_abbr_on_total: zero: 0 open / {{total}} one: 1 open / {{total}} other: "{{count}} open / {{total}}" label_x_open_issues_abbr: zero: 0 open one: 1 open other: "{{count}} open" label_x_closed_issues_abbr: zero: 0 closed one: 1 closed other: "{{count}} closed" label_total: Összesen label_permissions: Jogosultságok label_current_status: Jelenlegi státusz label_new_statuses_allowed: Státusz változtatások engedélyei label_all: mind label_none: nincs label_nobody: senki label_next: Következő label_previous: Előző label_used_by: Használja label_details: Részletek label_add_note: Jegyzet hozzáadása label_per_page: Oldalanként label_calendar: Naptár label_months_from: hónap, kezdve label_gantt: Gantt label_internal: Belső label_last_changes: "utolsó {{count}} változás" label_change_view_all: Minden változás megtekintése label_personalize_page: Az oldal testreszabása label_comment: Megjegyzés label_comment_plural: Megjegyzés label_x_comments: zero: no comments one: 1 comment other: "{{count}} comments" label_comment_add: Megjegyzés hozzáadása label_comment_added: Megjegyzés hozzáadva label_comment_delete: Megjegyzések törlése label_query: Egyéni lekérdezés label_query_plural: Egyéni lekérdezések label_query_new: Új lekérdezés label_filter_add: Szűrő hozzáadása label_filter_plural: Szűrők label_equals: egyenlő label_not_equals: nem egyenlő label_in_less_than: kevesebb, mint label_in_more_than: több, mint label_in: in label_today: ma label_all_time: mindenkor label_yesterday: tegnap label_this_week: aktuális hét label_last_week: múlt hét label_last_n_days: "az elmúlt {{count}} nap" label_this_month: aktuális hónap label_last_month: múlt hónap label_this_year: aktuális év label_date_range: Dátum intervallum label_less_than_ago: kevesebb, mint nappal ezelőtt label_more_than_ago: több, mint nappal ezelőtt label_ago: nappal ezelőtt label_contains: tartalmazza label_not_contains: nem tartalmazza label_day_plural: nap label_repository: Tároló label_repository_plural: Tárolók label_browse: Tallóz label_modification: "{{count}} változás" label_modification_plural: "{{count}} változások" label_revision: Revízió label_revision_plural: Revíziók label_associated_revisions: Kapcsolt revíziók label_added: hozzáadva label_modified: módosítva label_deleted: törölve label_latest_revision: Legutolsó revízió label_latest_revision_plural: Legutolsó revíziók label_view_revisions: Revíziók megtekintése label_max_size: Maximális méret label_sort_highest: Az elejére label_sort_higher: Eggyel feljebb label_sort_lower: Eggyel lejjebb label_sort_lowest: Az aljára label_roadmap: Életút label_roadmap_due_in: "Elkészültéig várhatóan még {{value}}" label_roadmap_overdue: "{{value}} késésben" label_roadmap_no_issues: Nincsenek feladatok ehhez a verzióhoz label_search: Keresés label_result_plural: Találatok label_all_words: Minden szó label_wiki: Wiki label_wiki_edit: Wiki szerkesztés label_wiki_edit_plural: Wiki szerkesztések label_wiki_page: Wiki oldal label_wiki_page_plural: Wiki oldalak label_index_by_title: Cím szerint indexelve label_index_by_date: Dátum szerint indexelve label_current_version: Jelenlegi verzió label_preview: Előnézet label_feed_plural: Visszajelzések label_changes_details: Változások részletei label_issue_tracking: Feladat követés label_spent_time: Ráfordított idő label_f_hour: "{{value}} óra" label_f_hour_plural: "{{value}} óra" label_time_tracking: Idő követés label_change_plural: Változások label_statistics: Statisztikák label_commits_per_month: Commits havonta label_commits_per_author: Commits szerzőnként label_view_diff: Különbségek megtekintése label_diff_inline: soronként label_diff_side_by_side: egymás mellett label_options: Opciók label_copy_workflow_from: Workflow másolása innen label_permissions_report: Jogosultsági riport label_watched_issues: Megfigyelt feladatok label_related_issues: Kapcsolódó feladatok label_applied_status: Alkalmazandó státusz label_loading: Betöltés... label_relation_new: Új kapcsolat label_relation_delete: Kapcsolat törlése label_relates_to: kapcsolódik label_duplicates: duplikálja label_blocks: zárolja label_blocked_by: zárolta label_precedes: megelőzi label_follows: követi label_end_to_start: végétől indulásig label_end_to_end: végétől végéig label_start_to_start: indulástól indulásig label_start_to_end: indulástól végéig label_stay_logged_in: Emlékezzen rám label_disabled: kikapcsolva label_show_completed_versions: A kész verziók mutatása label_me: én label_board: Fórum label_board_new: Új fórum label_board_plural: Fórumok label_topic_plural: Témák label_message_plural: Üzenetek label_message_last: Utolsó üzenet label_message_new: Új üzenet label_message_posted: Üzenet hozzáadva label_reply_plural: Válaszok label_send_information: Fiók infomációk küldése a felhasználónak label_year: Év label_month: Hónap label_week: Hét label_date_from: 'Kezdet:' label_date_to: 'Vége:' label_language_based: A felhasználó nyelve alapján label_sort_by: "{{value}} szerint rendezve" label_send_test_email: Teszt e-mail küldése label_feeds_access_key_created_on: "RSS hozzáférési kulcs létrehozva ennyivel ezelőtt: {{value}}" label_module_plural: Modulok label_added_time_by: "{{author}} adta hozzá ennyivel ezelőtt: {{age}}" label_updated_time: "Utolsó módosítás ennyivel ezelőtt: {{value}}" label_jump_to_a_project: Ugrás projekthez... label_file_plural: Fájlok label_changeset_plural: Changesets label_default_columns: Alapértelmezett oszlopok label_no_change_option: (Nincs változás) label_bulk_edit_selected_issues: A kiválasztott feladatok kötegelt szerkesztése label_theme: Téma label_default: Alapértelmezett label_search_titles_only: Keresés csak a címekben label_user_mail_option_all: "Minden eseményről minden saját projektemben" label_user_mail_option_selected: "Minden eseményről a kiválasztott projektekben..." label_user_mail_option_none: "Csak a megfigyelt dolgokról, vagy, amiben részt veszek" label_user_mail_no_self_notified: "Nem kérek értesítést az általam végzett módosításokról" label_registration_activation_by_email: Fiók aktiválása e-mailben label_registration_manual_activation: Manuális fiók aktiválás label_registration_automatic_activation: Automatikus fiók aktiválás label_display_per_page: "Oldalanként: {{value}}" label_age: Kor label_change_properties: Tulajdonságok változtatása label_general: Általános label_more: továbbiak label_scm: SCM label_plugins: Pluginek label_ldap_authentication: LDAP azonosítás label_downloads_abbr: D/L label_optional_description: Opcionális leírás label_add_another_file: Újabb fájl hozzáadása label_preferences: Tulajdonságok label_chronological_order: Időrendben label_reverse_chronological_order: Fordított időrendben label_planning: Tervezés button_login: Bejelentkezés button_submit: Elfogad button_save: Mentés button_check_all: Mindent kijelöl button_uncheck_all: Kijelölés törlése button_delete: Töröl button_create: Létrehoz button_test: Teszt button_edit: Szerkeszt button_add: Hozzáad button_change: Változtat button_apply: Alkalmaz button_clear: Töröl button_lock: Zárol button_unlock: Felold button_download: Letöltés button_list: Lista button_view: Megnéz button_move: Mozgat button_back: Vissza button_cancel: Mégse button_activate: Aktivál button_sort: Rendezés button_log_time: Idő rögzítés button_rollback: Visszaáll erre a verzióra button_watch: Megfigyel button_unwatch: Megfigyelés törlése button_reply: Válasz button_archive: Archivál button_unarchive: Dearchivál button_reset: Reset button_rename: Átnevez button_change_password: Jelszó megváltoztatása button_copy: Másol button_annotate: Jegyzetel button_update: Módosít button_configure: Konfigurál status_active: aktív status_registered: regisztrált status_locked: zárolt text_select_mail_notifications: Válasszon eseményeket, amelyekről e-mail értesítést kell küldeni. text_regexp_info: eg. ^[A-Z0-9]+$ text_min_max_length_info: 0 = nincs korlátozás text_project_destroy_confirmation: Biztosan törölni szeretné a projektet és vele együtt minden kapcsolódó adatot ? text_subprojects_destroy_warning: "Az alprojekt(ek): {{value}} szintén törlésre kerülnek." text_workflow_edit: Válasszon egy szerepkört, és egy trackert a workflow szerkesztéséhez text_are_you_sure: Biztos benne ? text_tip_task_begin_day: a feladat ezen a napon kezdődik text_tip_task_end_day: a feladat ezen a napon ér véget text_tip_task_begin_end_day: a feladat ezen a napon kezdődik és ér véget text_project_identifier_info: 'Kis betűk (a-z), számok és kötőjel megengedett.<br />Mentés után az azonosítót megváltoztatni nem lehet.' text_caracters_maximum: "maximum {{count}} karakter." text_caracters_minimum: "Legkevesebb {{count}} karakter hosszúnek kell lennie." text_length_between: "Legalább {{min}} és legfeljebb {{max}} hosszú karakter." text_tracker_no_workflow: Nincs workflow definiálva ehhez a tracker-hez text_unallowed_characters: Tiltott karakterek text_comma_separated: Több érték megengedett (vesszővel elválasztva) text_issues_ref_in_commit_messages: Hivatkozás feladatokra, feladatok javítása a commit üzenetekben text_issue_added: "Issue {{id}} has been reported by {{author}}." text_issue_updated: "Issue {{id}} has been updated by {{author}}." text_wiki_destroy_confirmation: Biztosan törölni szeretné ezt a wiki-t minden tartalmával együtt ? text_issue_category_destroy_question: "Néhány feladat ({{count}}) hozzá van rendelve ehhez a kategóriához. Mit szeretne tenni ?" text_issue_category_destroy_assignments: Kategória hozzárendelés megszűntetése text_issue_category_reassign_to: Feladatok újra hozzárendelése a kategóriához text_user_mail_option: "A nem kiválasztott projektekről csak akkor kap értesítést, ha figyelést kér rá, vagy részt vesz benne (pl. Ön a létrehozó, vagy a hozzárendelő)" text_no_configuration_data: "Szerepkörök, trackerek, feladat státuszok, és workflow adatok még nincsenek konfigurálva.\nErősen ajánlott, az alapértelmezett konfiguráció betöltése, és utána módosíthatja azt." text_load_default_configuration: Alapértelmezett konfiguráció betöltése text_status_changed_by_changeset: "Applied in changeset {{value}}." text_issues_destroy_confirmation: 'Biztos benne, hogy törölni szeretné a kijelölt feladato(ka)t ?' text_select_project_modules: 'Válassza ki az engedélyezett modulokat ehhez a projekthez:' text_default_administrator_account_changed: Alapértelmezett adminisztrátor fiók megváltoztatva text_file_repository_writable: Fájl tároló írható text_rmagick_available: RMagick elérhető (opcionális) text_destroy_time_entries_question: "{{hours}} órányi munka van rögzítve a feladatokon, amiket törölni szeretne. Mit szeretne tenni ?" text_destroy_time_entries: A rögzített órák törlése text_assign_time_entries_to_project: A rögzített órák hozzárendelése a projekthez text_reassign_time_entries: 'A rögzített órák újra hozzárendelése ehhez a feladathoz:' default_role_manager: Vezető default_role_developper: Fejlesztő default_role_reporter: Bejelentő default_tracker_bug: Hiba default_tracker_feature: Fejlesztés default_tracker_support: Support default_issue_status_new: Új default_issue_status_in_progress: In Progress default_issue_status_resolved: Megoldva default_issue_status_feedback: Visszajelzés default_issue_status_closed: Lezárt default_issue_status_rejected: Elutasított default_doc_category_user: Felhasználói dokumentáció default_doc_category_tech: Technikai dokumentáció default_priority_low: Alacsony default_priority_normal: Normál default_priority_high: Magas default_priority_urgent: Sürgős default_priority_immediate: Azonnal default_activity_design: Tervezés default_activity_development: Fejlesztés enumeration_issue_priorities: Feladat prioritások enumeration_doc_categories: Dokumentum kategóriák enumeration_activities: Tevékenységek (idő rögzítés) mail_body_reminder: "{{count}} neked kiosztott feladat határidős az elkövetkező {{days}} napban:" mail_subject_reminder: "{{count}} feladat határidős az elkövetkező napokban" text_user_wrote: "{{value}} írta:" label_duplicated_by: duplikálta setting_enabled_scm: Forráskódkezelő (SCM) engedélyezése text_enumeration_category_reassign_to: 'Újra hozzárendelés ehhez:' text_enumeration_destroy_question: "{{count}} objektum van hozzárendelve ehhez az értékhez." label_incoming_emails: Beérkezett levelek label_generate_key: Kulcs generálása setting_mail_handler_api_enabled: Web Service engedélyezése a beérkezett levelekhez setting_mail_handler_api_key: API kulcs text_email_delivery_not_configured: "Az E-mail küldés nincs konfigurálva, és az értesítések ki vannak kapcsolva.\nÁllítsd be az SMTP szervert a config/email.yml fájlban és indítsd újra az alkalmazást, hogy érvénybe lépjen." field_parent_title: Szülő oldal label_issue_watchers: Megfigyelők setting_commit_logs_encoding: Commit üzenetek kódlapja button_quote: Hozzászólás / Idézet / Kérdés setting_sequential_project_identifiers: Szekvenciális projekt azonosítók generálása notice_unable_delete_version: A verziót nem lehet törölni label_renamed: átnevezve label_copied: lemásolva setting_plain_text_mail: csak szöveg (nem HTML) permission_view_files: Fájlok megtekintése permission_edit_issues: Feladatok szerkesztése permission_edit_own_time_entries: Saját időnapló szerkesztése permission_manage_public_queries: Nyilvános kérések kezelése permission_add_issues: Feladat felvétele permission_log_time: Idő rögzítése permission_view_changesets: Változáskötegek megtekintése permission_view_time_entries: Időrögzítések megtekintése permission_manage_versions: Verziók kezelése permission_manage_wiki: Wiki kezelése permission_manage_categories: Feladat kategóriák kezelése permission_protect_wiki_pages: Wiki oldalak védelme permission_comment_news: Hírek kommentelése permission_delete_messages: Üzenetek törlése permission_select_project_modules: Projekt modulok kezelése permission_manage_documents: Dokumentumok kezelése permission_edit_wiki_pages: Wiki oldalak szerkesztése permission_add_issue_watchers: Megfigyelők felvétele permission_view_gantt: Gannt diagramm megtekintése permission_move_issues: Feladatok mozgatása permission_manage_issue_relations: Feladat kapcsolatok kezelése permission_delete_wiki_pages: Wiki oldalak törlése permission_manage_boards: Fórumok kezelése permission_delete_wiki_pages_attachments: Csatolmányok törlése permission_view_wiki_edits: Wiki történet megtekintése permission_add_messages: Üzenet beküldése permission_view_messages: Üzenetek megtekintése permission_manage_files: Fájlok kezelése permission_edit_issue_notes: Jegyzetek szerkesztése permission_manage_news: Hírek kezelése permission_view_calendar: Naptár megtekintése permission_manage_members: Tagok kezelése permission_edit_messages: Üzenetek szerkesztése permission_delete_issues: Feladatok törlése permission_view_issue_watchers: Megfigyelők listázása permission_manage_repository: Tárolók kezelése permission_commit_access: Commit hozzáférés permission_browse_repository: Tároló böngészése permission_view_documents: Dokumetumok megtekintése permission_edit_project: Projekt szerkesztése permission_add_issue_notes: Jegyzet rögzítése permission_save_queries: Kérések mentése permission_view_wiki_pages: Wiki megtekintése permission_rename_wiki_pages: Wiki oldalak átnevezése permission_edit_time_entries: Időnaplók szerkesztése permission_edit_own_issue_notes: Saját jegyzetek szerkesztése setting_gravatar_enabled: Felhasználói fényképek engedélyezése label_example: Példa text_repository_usernames_mapping: "Állítsd be a felhasználó összerendeléseket a Redmine, és a tároló logban található felhasználók között.\nAz azonos felhasználó nevek összerendelése automatikusan megtörténik." permission_edit_own_messages: Saját üzenetek szerkesztése permission_delete_own_messages: Saját üzenetek törlése label_user_activity: "{{value}} tevékenységei" label_updated_time_by: "Módosította {{author}} ennyivel ezelőtt: {{age}}" text_diff_truncated: '... A diff fájl vége nem jelenik meg, mert hosszab, mint a megjeleníthető sorok száma.' setting_diff_max_lines_displayed: A megjelenítendő sorok száma (maximum) a diff fájloknál text_plugin_assets_writable: Plugin eszközök könyvtár írható warning_attachments_not_saved: "{{count}} fájl mentése nem sikerült." button_create_and_continue: Létrehozás és folytatás text_custom_field_possible_values_info: 'Értékenként egy sor' label_display: Megmutat field_editable: Szerkeszthető setting_repository_log_display_limit: Maximum hány revíziót mutasson meg a log megjelenítésekor setting_file_max_size_displayed: Maximum mekkora szövegfájlokat jelenítsen meg soronkénti összehasonlításnál field_watcher: Megfigyelő setting_openid: OpenID regisztráció és bejelentkezés engedélyezése field_identity_url: OpenID URL label_login_with_open_id_option: bejelentkezés OpenID használatával field_content: Tartalom label_descending: Csökkenő label_sort: Rendezés label_ascending: Növekvő label_date_from_to: "{{start}} -tól {{end}} -ig" label_greater_or_equal: ">=" label_less_or_equal: "<=" text_wiki_page_destroy_question: Ennek az oldalnak {{descendants}} gyermek-, és leszármazott oldala van. Mit szeretne tenni? text_wiki_page_reassign_children: Az aloldalak hozzárendelése ehhez a szülő oldalhoz text_wiki_page_nullify_children: Az aloldalak megtartása, mint főoldalak text_wiki_page_destroy_children: Minden aloldal és leszármazottjának törlése setting_password_min_length: Minimum jelszó hosszúság field_group_by: Szerint csoportosítva mail_subject_wiki_content_updated: "'{{page}}' wiki oldal frissítve" label_wiki_content_added: Wiki oldal hozzáadve mail_subject_wiki_content_added: "Új wiki oldal: '{{page}}'" mail_body_wiki_content_added: A '{{page}}' wiki oldalt {{author}} hozta létre. label_wiki_content_updated: Wiki oldal frissítve mail_body_wiki_content_updated: A '{{page}}' wiki oldalt {{author}} frissítette. permission_add_project: Projekt létrehozása setting_new_project_user_role_id: Projekt létrehozási jog nem adminisztrátor felhasználóknak label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch error_no_tracker_in_project: No tracker is associated to this project. Please check the Project settings. error_no_default_issue_status: No default issue status is defined. Please check your configuration (Go to "Administration -> Issue statuses"). text_journal_changed: "{{label}} changed from {{old}} to {{new}}" text_journal_set_to: "{{label}} set to {{value}}" text_journal_deleted: "{{label}} deleted ({{old}})" label_group_plural: Groups label_group: Group label_group_new: New group label_time_entry_plural: Spent time text_journal_added: "{{label}} {{value}} added" field_active: Active enumeration_system_activity: System Activity permission_delete_issue_watchers: Delete watchers version_status_closed: closed version_status_locked: locked version_status_open: open error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened label_user_anonymous: Anonymous button_move_and_follow: Move and follow setting_default_projects_modules: Default enabled modules for new projects setting_gravatar_default: Default Gravatar image field_sharing: Sharing label_version_sharing_hierarchy: With project hierarchy label_version_sharing_system: With all projects label_version_sharing_descendants: With subprojects label_version_sharing_tree: With project tree label_version_sharing_none: Not shared error_can_not_archive_project: This project can not be archived button_duplicate: Duplicate button_copy_and_follow: Copy and follow label_copy_source: Source setting_issue_done_ratio: Calculate the issue done ratio with setting_issue_done_ratio_issue_status: Use the issue status error_issue_done_ratios_not_updated: Issue done ratios not updated. error_workflow_copy_target: Please select target tracker(s) and role(s) setting_issue_done_ratio_issue_field: Use the issue field label_copy_same_as_target: Same as target label_copy_target: Target notice_issue_done_ratios_updated: Issue done ratios updated. error_workflow_copy_source: Please select a source tracker or role label_update_issue_done_ratios: Update issue done ratios setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker label_revision_id: Revision {{value}} label_api_access_key: API access key label_api_access_key_created_on: API access key created {{value}} ago label_feeds_access_key: RSS access key notice_api_access_key_reseted: Your API access key was reset. setting_rest_api_enabled: Enable REST web service label_missing_api_access_key: Missing an API access key label_missing_feeds_access_key: Missing a RSS access key button_show: Show text_line_separated: Multiple values allowed (one line for each value). setting_mail_handler_body_delimiters: Truncate emails after one of these lines permission_add_subprojects: Create subprojects label_subproject_new: New subproject text_own_membership_delete_confirmation: |- You are about to remove some or all of your permissions and may no longer be able to edit this project after that. Are you sure you want to continue? label_close_versions: Close completed versions label_board_sticky: Sticky label_board_locked: Locked permission_export_wiki_pages: Export wiki pages setting_cache_formatted_text: Cache formatted text permission_manage_project_activities: Manage project activities label_project_copy_notifications: Send email notifications during the project copy
{ "pile_set_name": "Github" }
namespace InheritanceAndPolymorphism.Interfaces { using System; using System.Linq; public interface ILocalCourse : ICourse { string Lab { get; set; } } }
{ "pile_set_name": "Github" }
#ifndef DIAGNOSTICSCREEN_H #define DIAGNOSTICSCREEN_H #include "DiagnosticParticleBinningBase.h" class DiagnosticScreen : public DiagnosticParticleBinningBase { friend class SmileiMPI; friend class Checkpoints; public : //! Default constructor DiagnosticScreen( Params &params, SmileiMPI *smpi, Patch *patch, int diagId ); //! Default destructor ~DiagnosticScreen(); bool prepare( int timestep ) override; void run( Patch *patch, int timestep, SimWindow *simWindow ) override; bool writeNow( int timestep ) override; //! Clear the array void clear() override; static std::vector<std::string> excludedAxes( int idiag ) { std::string shape = ""; PyTools::extract( "shape", shape, "DiagScreen", idiag ); std::vector<std::string> excluded_axes( 0 ); if( shape == "plane" ) { excluded_axes.push_back( "theta_yx" ); excluded_axes.push_back( "theta_zx" ); } else { excluded_axes.push_back( "a" ); excluded_axes.push_back( "b" ); } return excluded_axes; } std::vector<double> * getData() { return &data_sum; } private : std::string screen_shape; //! Relates to the shape of the screen (plane=0, sphere=1) int screen_type; //! Screen reference point (plane point or sphere center) std::vector<double> screen_point; //! Screen reference vector (plane normal or sphere radius) std::vector<double> screen_vector; std::vector<double> screen_unitvector; //! norm of the vector double screen_vectornorm; //! Vectors forming an orthogonal base with the screen vector std::vector<double> screen_vector_a, screen_vector_b; //! How to account for the particle direction: "both", "canceling", "forward" or "backward" std::string direction; int direction_type; //! Copy of the timestep double dt; }; #endif
{ "pile_set_name": "Github" }
package com.crm.qa.pages; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; import com.crm.qa.base.TestBase; public class LoginPage extends TestBase{ //Page Factory - OR: @FindBy(name="username") WebElement username; @FindBy(name="password") WebElement password; @FindBy(xpath="//input[@type='submit']") WebElement loginBtn; @FindBy(xpath="//button[contains(text(),'Sign Up')]") WebElement signUpBtn; @FindBy(xpath="//img[contains(@class,'img-responsive')]") WebElement crmLogo; //Initializing the Page Objects: public LoginPage(){ PageFactory.initElements(driver, this); } //Actions: public String validateLoginPageTitle(){ return driver.getTitle(); } public boolean validateCRMImage(){ return crmLogo.isDisplayed(); } public HomePage login(String un, String pwd){ username.sendKeys(un); password.sendKeys(pwd); //loginBtn.click(); JavascriptExecutor js = (JavascriptExecutor)driver; js.executeScript("arguments[0].click();", loginBtn); return new HomePage(); } }
{ "pile_set_name": "Github" }
// // StringExtension.swift // // Copyright (c) 2016 POSSIBLE Mobile (https://possiblemobile.com) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // import Foundation extension String { func truncate(length: Int) -> String { if self.characters.count > length { return self.substring(to: self.characters.index(self.startIndex, offsetBy: length)) } else { return self } } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Debug|x64"> <Configuration>Debug</Configuration> <Platform>x64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release|Win32"> <Configuration>Release</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release|x64"> <Configuration>Release</Configuration> <Platform>x64</Platform> </ProjectConfiguration> </ItemGroup> <ItemGroup> <ClInclude Include="yaml.h" /> </ItemGroup> <ItemGroup> <ClCompile Include="yaml.cpp" /> </ItemGroup> <PropertyGroup Label="Globals"> <ProjectGuid>{F62BDA0A-95E6-4A57-987C-EDFE5F90F4B6}</ProjectGuid> <Keyword>Win32Proj</Keyword> <RootNamespace>mordoryaml</RootNamespace> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <PlatformToolset>v120</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <PlatformToolset>v120</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> <PlatformToolset>v120</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> <PlatformToolset>v120</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="thirdPartyPaths-win32-v12.Debug.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="thirdPartyPaths-win64-v12.Debug.props" /> </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="thirdPartyPaths-win32-v12.Release.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="thirdPartyPaths-win64-v12.Release.props" /> </ImportGroup> <PropertyGroup Label="UserMacros" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> <IntDir>$(Platform)\$(Configuration)\</IntDir> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> <IntDir>$(Platform)\$(Configuration)\</IntDir> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> <IntDir>$(Platform)\$(Configuration)\</IntDir> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> <IntDir>$(Platform)\$(Configuration)\</IntDir> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> <WarningLevel>Level3</WarningLevel> <Optimization>Disabled</Optimization> <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <TreatWarningAsError>true</TreatWarningAsError> <MultiProcessorCompilation>true</MultiProcessorCompilation> <DisableSpecificWarnings>4345</DisableSpecificWarnings> </ClCompile> <Link> <SubSystem>Windows</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ClCompile> <WarningLevel>Level3</WarningLevel> <Optimization>Disabled</Optimization> <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <TreatWarningAsError>true</TreatWarningAsError> <MultiProcessorCompilation>true</MultiProcessorCompilation> <DisableSpecificWarnings>4345</DisableSpecificWarnings> </ClCompile> <Link> <SubSystem>Windows</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ClCompile> <WarningLevel>Level3</WarningLevel> <Optimization>MaxSpeed</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <TreatWarningAsError>true</TreatWarningAsError> <MultiProcessorCompilation>true</MultiProcessorCompilation> <DisableSpecificWarnings>4345</DisableSpecificWarnings> </ClCompile> <Link> <SubSystem>Windows</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ClCompile> <WarningLevel>Level3</WarningLevel> <Optimization>MaxSpeed</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <TreatWarningAsError>true</TreatWarningAsError> <MultiProcessorCompilation>true</MultiProcessorCompilation> <DisableSpecificWarnings>4345</DisableSpecificWarnings> </ClCompile> <Link> <SubSystem>Windows</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> </Link> </ItemDefinitionGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> </Project>
{ "pile_set_name": "Github" }
{ "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "filename" : "summericons_100px_01@2x.png", "scale" : "2x" }, { "idiom" : "universal", "filename" : "summericons_100px_01@3x.png", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } }
{ "pile_set_name": "Github" }
@model ChangePasswordViewModel @{ ViewData.SetActivePageAndTitle(ManageNavPages.ChangePassword, "Change password"); } <partial name="_StatusMessage" /> @if (!this.ViewContext.ModelState.IsValid) { <div class="row"> <div class="col-md-6"> <div asp-validation-summary="All" class="text-danger"></div> </div> </div> } <div class="row"> <div class="col-md-6"> <form method="post"> <div class="form-group"> <label asp-for="OldPassword"></label> <input asp-for="OldPassword" class="form-control" /> <span asp-validation-for="OldPassword" class="text-danger"></span> </div> <div class="form-group"> <label asp-for="NewPassword"></label> <input asp-for="NewPassword" class="form-control" /> <span asp-validation-for="NewPassword" class="text-danger"></span> </div> <div class="form-group"> <label asp-for="ConfirmPassword"></label> <input asp-for="ConfirmPassword" class="form-control" /> <span asp-validation-for="ConfirmPassword" class="text-danger"></span> </div> <button type="submit" class="btn btn-primary" id="UpdatePassword">Update password</button> </form> </div> </div> @section Scripts { @await Html.PartialAsync("_ValidationScriptsPartial") }
{ "pile_set_name": "Github" }
/******************************* Docs *******************************/ /* Paths used for "serve-docs" and "build-docs" tasks */ module.exports = { base: '', globs: { eco: '**/*.html.eco' }, paths: { clean: '../docs/out/dist/', source: { config : 'src/theme.config', definitions : 'src/definitions/', site : 'src/site/', themes : 'src/themes/' }, output: { examples : '../docs/out/examples/', less : '../docs/out/src/', metadata : '../docs/out/', packaged : '../docs/out/dist/', uncompressed : '../docs/out/dist/components/', compressed : '../docs/out/dist/components/', themes : '../docs/out/dist/themes/' }, template: { eco: '../docs/server/documents/' }, } };
{ "pile_set_name": "Github" }
/* ### * IP: GHIDRA * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ghidra.app.plugin.core.codebrowser.hover; import ghidra.app.CorePluginPackage; import ghidra.app.plugin.PluginCategoryNames; import ghidra.framework.plugintool.*; import ghidra.framework.plugintool.util.PluginStatus; /** * A plugin to show tool tip text for hovering over function names in the listing. * * */ //@formatter:off @PluginInfo( status = PluginStatus.RELEASED, packageName = CorePluginPackage.NAME, category = PluginCategoryNames.CODE_VIEWER, shortDescription = "Function Name Hover", description = "Displays the function name of labels within functions in the Code Viewer.", servicesProvided = { ListingHoverService.class } ) //@formatter:on public class FunctionNameListingHoverPlugin extends Plugin { private FunctionNameListingHover functionNameHoverService; public FunctionNameListingHoverPlugin(PluginTool tool) { super(tool); functionNameHoverService = new FunctionNameListingHover(tool); registerServiceProvided(ListingHoverService.class, functionNameHoverService); } @Override public void dispose() { functionNameHoverService.dispose(); } }
{ "pile_set_name": "Github" }
// mkerrors.sh -m64 // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT // +build amd64,freebsd // Created by cgo -godefs - DO NOT EDIT // cgo -godefs -- -m64 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_ARP = 0x23 AF_ATM = 0x1e AF_BLUETOOTH = 0x24 AF_CCITT = 0xa AF_CHAOS = 0x5 AF_CNT = 0x15 AF_COIP = 0x14 AF_DATAKIT = 0x9 AF_DECnet = 0xc AF_DLI = 0xd AF_E164 = 0x1a AF_ECMA = 0x8 AF_HYLINK = 0xf AF_IEEE80211 = 0x25 AF_IMPLINK = 0x3 AF_INET = 0x2 AF_INET6 = 0x1c AF_INET6_SDP = 0x2a AF_INET_SDP = 0x28 AF_IPX = 0x17 AF_ISDN = 0x1a AF_ISO = 0x7 AF_LAT = 0xe AF_LINK = 0x12 AF_LOCAL = 0x1 AF_MAX = 0x2a AF_NATM = 0x1d AF_NETBIOS = 0x6 AF_NETGRAPH = 0x20 AF_OSI = 0x7 AF_PUP = 0x4 AF_ROUTE = 0x11 AF_SCLUSTER = 0x22 AF_SIP = 0x18 AF_SLOW = 0x21 AF_SNA = 0xb AF_UNIX = 0x1 AF_UNSPEC = 0x0 AF_VENDOR00 = 0x27 AF_VENDOR01 = 0x29 AF_VENDOR02 = 0x2b AF_VENDOR03 = 0x2d AF_VENDOR04 = 0x2f AF_VENDOR05 = 0x31 AF_VENDOR06 = 0x33 AF_VENDOR07 = 0x35 AF_VENDOR08 = 0x37 AF_VENDOR09 = 0x39 AF_VENDOR10 = 0x3b AF_VENDOR11 = 0x3d AF_VENDOR12 = 0x3f AF_VENDOR13 = 0x41 AF_VENDOR14 = 0x43 AF_VENDOR15 = 0x45 AF_VENDOR16 = 0x47 AF_VENDOR17 = 0x49 AF_VENDOR18 = 0x4b AF_VENDOR19 = 0x4d AF_VENDOR20 = 0x4f AF_VENDOR21 = 0x51 AF_VENDOR22 = 0x53 AF_VENDOR23 = 0x55 AF_VENDOR24 = 0x57 AF_VENDOR25 = 0x59 AF_VENDOR26 = 0x5b AF_VENDOR27 = 0x5d AF_VENDOR28 = 0x5f AF_VENDOR29 = 0x61 AF_VENDOR30 = 0x63 AF_VENDOR31 = 0x65 AF_VENDOR32 = 0x67 AF_VENDOR33 = 0x69 AF_VENDOR34 = 0x6b AF_VENDOR35 = 0x6d AF_VENDOR36 = 0x6f AF_VENDOR37 = 0x71 AF_VENDOR38 = 0x73 AF_VENDOR39 = 0x75 AF_VENDOR40 = 0x77 AF_VENDOR41 = 0x79 AF_VENDOR42 = 0x7b AF_VENDOR43 = 0x7d AF_VENDOR44 = 0x7f AF_VENDOR45 = 0x81 AF_VENDOR46 = 0x83 AF_VENDOR47 = 0x85 B0 = 0x0 B110 = 0x6e B115200 = 0x1c200 B1200 = 0x4b0 B134 = 0x86 B14400 = 0x3840 B150 = 0x96 B1800 = 0x708 B19200 = 0x4b00 B200 = 0xc8 B230400 = 0x38400 B2400 = 0x960 B28800 = 0x7080 B300 = 0x12c B38400 = 0x9600 B460800 = 0x70800 B4800 = 0x12c0 B50 = 0x32 B57600 = 0xe100 B600 = 0x258 B7200 = 0x1c20 B75 = 0x4b B76800 = 0x12c00 B921600 = 0xe1000 B9600 = 0x2580 BIOCFEEDBACK = 0x8004427c BIOCFLUSH = 0x20004268 BIOCGBLEN = 0x40044266 BIOCGDIRECTION = 0x40044276 BIOCGDLT = 0x4004426a BIOCGDLTLIST = 0xc0104279 BIOCGETBUFMODE = 0x4004427d BIOCGETIF = 0x4020426b BIOCGETZMAX = 0x4008427f BIOCGHDRCMPLT = 0x40044274 BIOCGRSIG = 0x40044272 BIOCGRTIMEOUT = 0x4010426e BIOCGSEESENT = 0x40044276 BIOCGSTATS = 0x4008426f BIOCGTSTAMP = 0x40044283 BIOCIMMEDIATE = 0x80044270 BIOCLOCK = 0x2000427a BIOCPROMISC = 0x20004269 BIOCROTZBUF = 0x40184280 BIOCSBLEN = 0xc0044266 BIOCSDIRECTION = 0x80044277 BIOCSDLT = 0x80044278 BIOCSETBUFMODE = 0x8004427e BIOCSETF = 0x80104267 BIOCSETFNR = 0x80104282 BIOCSETIF = 0x8020426c BIOCSETWF = 0x8010427b BIOCSETZBUF = 0x80184281 BIOCSHDRCMPLT = 0x80044275 BIOCSRSIG = 0x80044273 BIOCSRTIMEOUT = 0x8010426d BIOCSSEESENT = 0x80044277 BIOCSTSTAMP = 0x80044284 BIOCVERSION = 0x40044271 BPF_A = 0x10 BPF_ABS = 0x20 BPF_ADD = 0x0 BPF_ALIGNMENT = 0x8 BPF_ALU = 0x4 BPF_AND = 0x50 BPF_B = 0x10 BPF_BUFMODE_BUFFER = 0x1 BPF_BUFMODE_ZBUF = 0x2 BPF_DIV = 0x30 BPF_H = 0x8 BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 BPF_JMP = 0x5 BPF_JSET = 0x40 BPF_K = 0x0 BPF_LD = 0x0 BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXBUFSIZE = 0x80000 BPF_MAXINSNS = 0x200 BPF_MEM = 0x60 BPF_MEMWORDS = 0x10 BPF_MINBUFSIZE = 0x20 BPF_MINOR_VERSION = 0x1 BPF_MISC = 0x7 BPF_MSH = 0xa0 BPF_MUL = 0x20 BPF_NEG = 0x80 BPF_OR = 0x40 BPF_RELEASE = 0x30bb6 BPF_RET = 0x6 BPF_RSH = 0x70 BPF_ST = 0x2 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAX = 0x0 BPF_TXA = 0x80 BPF_T_BINTIME = 0x2 BPF_T_BINTIME_FAST = 0x102 BPF_T_BINTIME_MONOTONIC = 0x202 BPF_T_BINTIME_MONOTONIC_FAST = 0x302 BPF_T_FAST = 0x100 BPF_T_FLAG_MASK = 0x300 BPF_T_FORMAT_MASK = 0x3 BPF_T_MICROTIME = 0x0 BPF_T_MICROTIME_FAST = 0x100 BPF_T_MICROTIME_MONOTONIC = 0x200 BPF_T_MICROTIME_MONOTONIC_FAST = 0x300 BPF_T_MONOTONIC = 0x200 BPF_T_MONOTONIC_FAST = 0x300 BPF_T_NANOTIME = 0x1 BPF_T_NANOTIME_FAST = 0x101 BPF_T_NANOTIME_MONOTONIC = 0x201 BPF_T_NANOTIME_MONOTONIC_FAST = 0x301 BPF_T_NONE = 0x3 BPF_T_NORMAL = 0x0 BPF_W = 0x0 BPF_X = 0x8 BRKINT = 0x2 CFLUSH = 0xf CLOCAL = 0x8000 CLOCK_MONOTONIC = 0x4 CLOCK_MONOTONIC_FAST = 0xc CLOCK_MONOTONIC_PRECISE = 0xb CLOCK_PROCESS_CPUTIME_ID = 0xf CLOCK_PROF = 0x2 CLOCK_REALTIME = 0x0 CLOCK_REALTIME_FAST = 0xa CLOCK_REALTIME_PRECISE = 0x9 CLOCK_SECOND = 0xd CLOCK_THREAD_CPUTIME_ID = 0xe CLOCK_UPTIME = 0x5 CLOCK_UPTIME_FAST = 0x8 CLOCK_UPTIME_PRECISE = 0x7 CLOCK_VIRTUAL = 0x1 CREAD = 0x800 CS5 = 0x0 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTART = 0x11 CSTATUS = 0x14 CSTOP = 0x13 CSTOPB = 0x400 CSUSP = 0x1a CTL_MAXNAME = 0x18 CTL_NET = 0x4 DLT_A429 = 0xb8 DLT_A653_ICM = 0xb9 DLT_AIRONET_HEADER = 0x78 DLT_AOS = 0xde DLT_APPLE_IP_OVER_IEEE1394 = 0x8a DLT_ARCNET = 0x7 DLT_ARCNET_LINUX = 0x81 DLT_ATM_CLIP = 0x13 DLT_ATM_RFC1483 = 0xb DLT_AURORA = 0x7e DLT_AX25 = 0x3 DLT_AX25_KISS = 0xca DLT_BACNET_MS_TP = 0xa5 DLT_BLUETOOTH_HCI_H4 = 0xbb DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 0xc9 DLT_CAN20B = 0xbe DLT_CAN_SOCKETCAN = 0xe3 DLT_CHAOS = 0x5 DLT_CHDLC = 0x68 DLT_CISCO_IOS = 0x76 DLT_C_HDLC = 0x68 DLT_C_HDLC_WITH_DIR = 0xcd DLT_DBUS = 0xe7 DLT_DECT = 0xdd DLT_DOCSIS = 0x8f DLT_DVB_CI = 0xeb DLT_ECONET = 0x73 DLT_EN10MB = 0x1 DLT_EN3MB = 0x2 DLT_ENC = 0x6d DLT_ERF = 0xc5 DLT_ERF_ETH = 0xaf DLT_ERF_POS = 0xb0 DLT_FC_2 = 0xe0 DLT_FC_2_WITH_FRAME_DELIMS = 0xe1 DLT_FDDI = 0xa DLT_FLEXRAY = 0xd2 DLT_FRELAY = 0x6b DLT_FRELAY_WITH_DIR = 0xce DLT_GCOM_SERIAL = 0xad DLT_GCOM_T1E1 = 0xac DLT_GPF_F = 0xab DLT_GPF_T = 0xaa DLT_GPRS_LLC = 0xa9 DLT_GSMTAP_ABIS = 0xda DLT_GSMTAP_UM = 0xd9 DLT_HHDLC = 0x79 DLT_IBM_SN = 0x92 DLT_IBM_SP = 0x91 DLT_IEEE802 = 0x6 DLT_IEEE802_11 = 0x69 DLT_IEEE802_11_RADIO = 0x7f DLT_IEEE802_11_RADIO_AVS = 0xa3 DLT_IEEE802_15_4 = 0xc3 DLT_IEEE802_15_4_LINUX = 0xbf DLT_IEEE802_15_4_NOFCS = 0xe6 DLT_IEEE802_15_4_NONASK_PHY = 0xd7 DLT_IEEE802_16_MAC_CPS = 0xbc DLT_IEEE802_16_MAC_CPS_RADIO = 0xc1 DLT_IPFILTER = 0x74 DLT_IPMB = 0xc7 DLT_IPMB_LINUX = 0xd1 DLT_IPNET = 0xe2 DLT_IPOIB = 0xf2 DLT_IPV4 = 0xe4 DLT_IPV6 = 0xe5 DLT_IP_OVER_FC = 0x7a DLT_JUNIPER_ATM1 = 0x89 DLT_JUNIPER_ATM2 = 0x87 DLT_JUNIPER_ATM_CEMIC = 0xee DLT_JUNIPER_CHDLC = 0xb5 DLT_JUNIPER_ES = 0x84 DLT_JUNIPER_ETHER = 0xb2 DLT_JUNIPER_FIBRECHANNEL = 0xea DLT_JUNIPER_FRELAY = 0xb4 DLT_JUNIPER_GGSN = 0x85 DLT_JUNIPER_ISM = 0xc2 DLT_JUNIPER_MFR = 0x86 DLT_JUNIPER_MLFR = 0x83 DLT_JUNIPER_MLPPP = 0x82 DLT_JUNIPER_MONITOR = 0xa4 DLT_JUNIPER_PIC_PEER = 0xae DLT_JUNIPER_PPP = 0xb3 DLT_JUNIPER_PPPOE = 0xa7 DLT_JUNIPER_PPPOE_ATM = 0xa8 DLT_JUNIPER_SERVICES = 0x88 DLT_JUNIPER_SRX_E2E = 0xe9 DLT_JUNIPER_ST = 0xc8 DLT_JUNIPER_VP = 0xb7 DLT_JUNIPER_VS = 0xe8 DLT_LAPB_WITH_DIR = 0xcf DLT_LAPD = 0xcb DLT_LIN = 0xd4 DLT_LINUX_EVDEV = 0xd8 DLT_LINUX_IRDA = 0x90 DLT_LINUX_LAPD = 0xb1 DLT_LINUX_PPP_WITHDIRECTION = 0xa6 DLT_LINUX_SLL = 0x71 DLT_LOOP = 0x6c DLT_LTALK = 0x72 DLT_MATCHING_MAX = 0xf6 DLT_MATCHING_MIN = 0x68 DLT_MFR = 0xb6 DLT_MOST = 0xd3 DLT_MPEG_2_TS = 0xf3 DLT_MPLS = 0xdb DLT_MTP2 = 0x8c DLT_MTP2_WITH_PHDR = 0x8b DLT_MTP3 = 0x8d DLT_MUX27010 = 0xec DLT_NETANALYZER = 0xf0 DLT_NETANALYZER_TRANSPARENT = 0xf1 DLT_NFC_LLCP = 0xf5 DLT_NFLOG = 0xef DLT_NG40 = 0xf4 DLT_NULL = 0x0 DLT_PCI_EXP = 0x7d DLT_PFLOG = 0x75 DLT_PFSYNC = 0x79 DLT_PPI = 0xc0 DLT_PPP = 0x9 DLT_PPP_BSDOS = 0x10 DLT_PPP_ETHER = 0x33 DLT_PPP_PPPD = 0xa6 DLT_PPP_SERIAL = 0x32 DLT_PPP_WITH_DIR = 0xcc DLT_PPP_WITH_DIRECTION = 0xa6 DLT_PRISM_HEADER = 0x77 DLT_PRONET = 0x4 DLT_RAIF1 = 0xc6 DLT_RAW = 0xc DLT_RIO = 0x7c DLT_SCCP = 0x8e DLT_SITA = 0xc4 DLT_SLIP = 0x8 DLT_SLIP_BSDOS = 0xf DLT_STANAG_5066_D_PDU = 0xed DLT_SUNATM = 0x7b DLT_SYMANTEC_FIREWALL = 0x63 DLT_TZSP = 0x80 DLT_USB = 0xba DLT_USB_LINUX = 0xbd DLT_USB_LINUX_MMAPPED = 0xdc DLT_USER0 = 0x93 DLT_USER1 = 0x94 DLT_USER10 = 0x9d DLT_USER11 = 0x9e DLT_USER12 = 0x9f DLT_USER13 = 0xa0 DLT_USER14 = 0xa1 DLT_USER15 = 0xa2 DLT_USER2 = 0x95 DLT_USER3 = 0x96 DLT_USER4 = 0x97 DLT_USER5 = 0x98 DLT_USER6 = 0x99 DLT_USER7 = 0x9a DLT_USER8 = 0x9b DLT_USER9 = 0x9c DLT_WIHART = 0xdf DLT_X2E_SERIAL = 0xd5 DLT_X2E_XORAYA = 0xd6 DT_BLK = 0x6 DT_CHR = 0x2 DT_DIR = 0x4 DT_FIFO = 0x1 DT_LNK = 0xa DT_REG = 0x8 DT_SOCK = 0xc DT_UNKNOWN = 0x0 DT_WHT = 0xe ECHO = 0x8 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EVFILT_AIO = -0x3 EVFILT_FS = -0x9 EVFILT_LIO = -0xa EVFILT_PROC = -0x5 EVFILT_READ = -0x1 EVFILT_SIGNAL = -0x6 EVFILT_SYSCOUNT = 0xb EVFILT_TIMER = -0x7 EVFILT_USER = -0xb EVFILT_VNODE = -0x4 EVFILT_WRITE = -0x2 EV_ADD = 0x1 EV_CLEAR = 0x20 EV_DELETE = 0x2 EV_DISABLE = 0x8 EV_DISPATCH = 0x80 EV_DROP = 0x1000 EV_ENABLE = 0x4 EV_EOF = 0x8000 EV_ERROR = 0x4000 EV_FLAG1 = 0x2000 EV_ONESHOT = 0x10 EV_RECEIPT = 0x40 EV_SYSFLAGS = 0xf000 EXTA = 0x4b00 EXTATTR_NAMESPACE_EMPTY = 0x0 EXTATTR_NAMESPACE_SYSTEM = 0x2 EXTATTR_NAMESPACE_USER = 0x1 EXTB = 0x9600 EXTPROC = 0x800 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FLUSHO = 0x800000 F_CANCEL = 0x5 F_DUP2FD = 0xa F_DUP2FD_CLOEXEC = 0x12 F_DUPFD = 0x0 F_DUPFD_CLOEXEC = 0x11 F_GETFD = 0x1 F_GETFL = 0x3 F_GETLK = 0xb F_GETOWN = 0x5 F_OGETLK = 0x7 F_OK = 0x0 F_OSETLK = 0x8 F_OSETLKW = 0x9 F_RDAHEAD = 0x10 F_RDLCK = 0x1 F_READAHEAD = 0xf F_SETFD = 0x2 F_SETFL = 0x4 F_SETLK = 0xc F_SETLKW = 0xd F_SETLK_REMOTE = 0xe F_SETOWN = 0x6 F_UNLCK = 0x2 F_UNLCKSYS = 0x4 F_WRLCK = 0x3 HUPCL = 0x4000 ICANON = 0x100 ICMP6_FILTER = 0x12 ICRNL = 0x100 IEXTEN = 0x400 IFAN_ARRIVAL = 0x0 IFAN_DEPARTURE = 0x1 IFF_ALLMULTI = 0x200 IFF_ALTPHYS = 0x4000 IFF_BROADCAST = 0x2 IFF_CANTCHANGE = 0x218f72 IFF_CANTCONFIG = 0x10000 IFF_DEBUG = 0x4 IFF_DRV_OACTIVE = 0x400 IFF_DRV_RUNNING = 0x40 IFF_DYING = 0x200000 IFF_LINK0 = 0x1000 IFF_LINK1 = 0x2000 IFF_LINK2 = 0x4000 IFF_LOOPBACK = 0x8 IFF_MONITOR = 0x40000 IFF_MULTICAST = 0x8000 IFF_NOARP = 0x80 IFF_OACTIVE = 0x400 IFF_POINTOPOINT = 0x10 IFF_PPROMISC = 0x20000 IFF_PROMISC = 0x100 IFF_RENAMING = 0x400000 IFF_RUNNING = 0x40 IFF_SIMPLEX = 0x800 IFF_SMART = 0x20 IFF_STATICARP = 0x80000 IFF_UP = 0x1 IFNAMSIZ = 0x10 IFT_1822 = 0x2 IFT_A12MPPSWITCH = 0x82 IFT_AAL2 = 0xbb IFT_AAL5 = 0x31 IFT_ADSL = 0x5e IFT_AFLANE8023 = 0x3b IFT_AFLANE8025 = 0x3c IFT_ARAP = 0x58 IFT_ARCNET = 0x23 IFT_ARCNETPLUS = 0x24 IFT_ASYNC = 0x54 IFT_ATM = 0x25 IFT_ATMDXI = 0x69 IFT_ATMFUNI = 0x6a IFT_ATMIMA = 0x6b IFT_ATMLOGICAL = 0x50 IFT_ATMRADIO = 0xbd IFT_ATMSUBINTERFACE = 0x86 IFT_ATMVCIENDPT = 0xc2 IFT_ATMVIRTUAL = 0x95 IFT_BGPPOLICYACCOUNTING = 0xa2 IFT_BRIDGE = 0xd1 IFT_BSC = 0x53 IFT_CARP = 0xf8 IFT_CCTEMUL = 0x3d IFT_CEPT = 0x13 IFT_CES = 0x85 IFT_CHANNEL = 0x46 IFT_CNR = 0x55 IFT_COFFEE = 0x84 IFT_COMPOSITELINK = 0x9b IFT_DCN = 0x8d IFT_DIGITALPOWERLINE = 0x8a IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba IFT_DLSW = 0x4a IFT_DOCSCABLEDOWNSTREAM = 0x80 IFT_DOCSCABLEMACLAYER = 0x7f IFT_DOCSCABLEUPSTREAM = 0x81 IFT_DS0 = 0x51 IFT_DS0BUNDLE = 0x52 IFT_DS1FDL = 0xaa IFT_DS3 = 0x1e IFT_DTM = 0x8c IFT_DVBASILN = 0xac IFT_DVBASIOUT = 0xad IFT_DVBRCCDOWNSTREAM = 0x93 IFT_DVBRCCMACLAYER = 0x92 IFT_DVBRCCUPSTREAM = 0x94 IFT_ENC = 0xf4 IFT_EON = 0x19 IFT_EPLRS = 0x57 IFT_ESCON = 0x49 IFT_ETHER = 0x6 IFT_FAITH = 0xf2 IFT_FAST = 0x7d IFT_FASTETHER = 0x3e IFT_FASTETHERFX = 0x45 IFT_FDDI = 0xf IFT_FIBRECHANNEL = 0x38 IFT_FRAMERELAYINTERCONNECT = 0x3a IFT_FRAMERELAYMPI = 0x5c IFT_FRDLCIENDPT = 0xc1 IFT_FRELAY = 0x20 IFT_FRELAYDCE = 0x2c IFT_FRF16MFRBUNDLE = 0xa3 IFT_FRFORWARD = 0x9e IFT_G703AT2MB = 0x43 IFT_G703AT64K = 0x42 IFT_GIF = 0xf0 IFT_GIGABITETHERNET = 0x75 IFT_GR303IDT = 0xb2 IFT_GR303RDT = 0xb1 IFT_H323GATEKEEPER = 0xa4 IFT_H323PROXY = 0xa5 IFT_HDH1822 = 0x3 IFT_HDLC = 0x76 IFT_HDSL2 = 0xa8 IFT_HIPERLAN2 = 0xb7 IFT_HIPPI = 0x2f IFT_HIPPIINTERFACE = 0x39 IFT_HOSTPAD = 0x5a IFT_HSSI = 0x2e IFT_HY = 0xe IFT_IBM370PARCHAN = 0x48 IFT_IDSL = 0x9a IFT_IEEE1394 = 0x90 IFT_IEEE80211 = 0x47 IFT_IEEE80212 = 0x37 IFT_IEEE8023ADLAG = 0xa1 IFT_IFGSN = 0x91 IFT_IMT = 0xbe IFT_INFINIBAND = 0xc7 IFT_INTERLEAVE = 0x7c IFT_IP = 0x7e IFT_IPFORWARD = 0x8e IFT_IPOVERATM = 0x72 IFT_IPOVERCDLC = 0x6d IFT_IPOVERCLAW = 0x6e IFT_IPSWITCH = 0x4e IFT_IPXIP = 0xf9 IFT_ISDN = 0x3f IFT_ISDNBASIC = 0x14 IFT_ISDNPRIMARY = 0x15 IFT_ISDNS = 0x4b IFT_ISDNU = 0x4c IFT_ISO88022LLC = 0x29 IFT_ISO88023 = 0x7 IFT_ISO88024 = 0x8 IFT_ISO88025 = 0x9 IFT_ISO88025CRFPINT = 0x62 IFT_ISO88025DTR = 0x56 IFT_ISO88025FIBER = 0x73 IFT_ISO88026 = 0xa IFT_ISUP = 0xb3 IFT_L2VLAN = 0x87 IFT_L3IPVLAN = 0x88 IFT_L3IPXVLAN = 0x89 IFT_LAPB = 0x10 IFT_LAPD = 0x4d IFT_LAPF = 0x77 IFT_LOCALTALK = 0x2a IFT_LOOP = 0x18 IFT_MEDIAMAILOVERIP = 0x8b IFT_MFSIGLINK = 0xa7 IFT_MIOX25 = 0x26 IFT_MODEM = 0x30 IFT_MPC = 0x71 IFT_MPLS = 0xa6 IFT_MPLSTUNNEL = 0x96 IFT_MSDSL = 0x8f IFT_MVL = 0xbf IFT_MYRINET = 0x63 IFT_NFAS = 0xaf IFT_NSIP = 0x1b IFT_OPTICALCHANNEL = 0xc3 IFT_OPTICALTRANSPORT = 0xc4 IFT_OTHER = 0x1 IFT_P10 = 0xc IFT_P80 = 0xd IFT_PARA = 0x22 IFT_PFLOG = 0xf6 IFT_PFSYNC = 0xf7 IFT_PLC = 0xae IFT_POS = 0xab IFT_PPP = 0x17 IFT_PPPMULTILINKBUNDLE = 0x6c IFT_PROPBWAP2MP = 0xb8 IFT_PROPCNLS = 0x59 IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5 IFT_PROPDOCSWIRELESSMACLAYER = 0xb4 IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6 IFT_PROPMUX = 0x36 IFT_PROPVIRTUAL = 0x35 IFT_PROPWIRELESSP2P = 0x9d IFT_PTPSERIAL = 0x16 IFT_PVC = 0xf1 IFT_QLLC = 0x44 IFT_RADIOMAC = 0xbc IFT_RADSL = 0x5f IFT_REACHDSL = 0xc0 IFT_RFC1483 = 0x9f IFT_RS232 = 0x21 IFT_RSRB = 0x4f IFT_SDLC = 0x11 IFT_SDSL = 0x60 IFT_SHDSL = 0xa9 IFT_SIP = 0x1f IFT_SLIP = 0x1c IFT_SMDSDXI = 0x2b IFT_SMDSICIP = 0x34 IFT_SONET = 0x27 IFT_SONETOVERHEADCHANNEL = 0xb9 IFT_SONETPATH = 0x32 IFT_SONETVT = 0x33 IFT_SRP = 0x97 IFT_SS7SIGLINK = 0x9c IFT_STACKTOSTACK = 0x6f IFT_STARLAN = 0xb IFT_STF = 0xd7 IFT_T1 = 0x12 IFT_TDLC = 0x74 IFT_TERMPAD = 0x5b IFT_TR008 = 0xb0 IFT_TRANSPHDLC = 0x7b IFT_TUNNEL = 0x83 IFT_ULTRA = 0x1d IFT_USB = 0xa0 IFT_V11 = 0x40 IFT_V35 = 0x2d IFT_V36 = 0x41 IFT_V37 = 0x78 IFT_VDSL = 0x61 IFT_VIRTUALIPADDRESS = 0x70 IFT_VOICEEM = 0x64 IFT_VOICEENCAP = 0x67 IFT_VOICEFXO = 0x65 IFT_VOICEFXS = 0x66 IFT_VOICEOVERATM = 0x98 IFT_VOICEOVERFRAMERELAY = 0x99 IFT_VOICEOVERIP = 0x68 IFT_X213 = 0x5d IFT_X25 = 0x5 IFT_X25DDN = 0x4 IFT_X25HUNTGROUP = 0x7a IFT_X25MLP = 0x79 IFT_X25PLE = 0x28 IFT_XETHER = 0x1a IGNBRK = 0x1 IGNCR = 0x80 IGNPAR = 0x4 IMAXBEL = 0x2000 INLCR = 0x40 INPCK = 0x10 IN_CLASSA_HOST = 0xffffff IN_CLASSA_MAX = 0x80 IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 0x18 IN_CLASSB_HOST = 0xffff IN_CLASSB_MAX = 0x10000 IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 0x10 IN_CLASSC_HOST = 0xff IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 0x8 IN_CLASSD_HOST = 0xfffffff IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 0x1c IN_LOOPBACKNET = 0x7f IN_RFC3021_MASK = 0xfffffffe IPPROTO_3PC = 0x22 IPPROTO_ADFS = 0x44 IPPROTO_AH = 0x33 IPPROTO_AHIP = 0x3d IPPROTO_APES = 0x63 IPPROTO_ARGUS = 0xd IPPROTO_AX25 = 0x5d IPPROTO_BHA = 0x31 IPPROTO_BLT = 0x1e IPPROTO_BRSATMON = 0x4c IPPROTO_CARP = 0x70 IPPROTO_CFTP = 0x3e IPPROTO_CHAOS = 0x10 IPPROTO_CMTP = 0x26 IPPROTO_CPHB = 0x49 IPPROTO_CPNX = 0x48 IPPROTO_DDP = 0x25 IPPROTO_DGP = 0x56 IPPROTO_DIVERT = 0x102 IPPROTO_DONE = 0x101 IPPROTO_DSTOPTS = 0x3c IPPROTO_EGP = 0x8 IPPROTO_EMCON = 0xe IPPROTO_ENCAP = 0x62 IPPROTO_EON = 0x50 IPPROTO_ESP = 0x32 IPPROTO_ETHERIP = 0x61 IPPROTO_FRAGMENT = 0x2c IPPROTO_GGP = 0x3 IPPROTO_GMTP = 0x64 IPPROTO_GRE = 0x2f IPPROTO_HELLO = 0x3f IPPROTO_HIP = 0x8b IPPROTO_HMP = 0x14 IPPROTO_HOPOPTS = 0x0 IPPROTO_ICMP = 0x1 IPPROTO_ICMPV6 = 0x3a IPPROTO_IDP = 0x16 IPPROTO_IDPR = 0x23 IPPROTO_IDRP = 0x2d IPPROTO_IGMP = 0x2 IPPROTO_IGP = 0x55 IPPROTO_IGRP = 0x58 IPPROTO_IL = 0x28 IPPROTO_INLSP = 0x34 IPPROTO_INP = 0x20 IPPROTO_IP = 0x0 IPPROTO_IPCOMP = 0x6c IPPROTO_IPCV = 0x47 IPPROTO_IPEIP = 0x5e IPPROTO_IPIP = 0x4 IPPROTO_IPPC = 0x43 IPPROTO_IPV4 = 0x4 IPPROTO_IPV6 = 0x29 IPPROTO_IRTP = 0x1c IPPROTO_KRYPTOLAN = 0x41 IPPROTO_LARP = 0x5b IPPROTO_LEAF1 = 0x19 IPPROTO_LEAF2 = 0x1a IPPROTO_MAX = 0x100 IPPROTO_MAXID = 0x34 IPPROTO_MEAS = 0x13 IPPROTO_MH = 0x87 IPPROTO_MHRP = 0x30 IPPROTO_MICP = 0x5f IPPROTO_MOBILE = 0x37 IPPROTO_MPLS = 0x89 IPPROTO_MTP = 0x5c IPPROTO_MUX = 0x12 IPPROTO_ND = 0x4d IPPROTO_NHRP = 0x36 IPPROTO_NONE = 0x3b IPPROTO_NSP = 0x1f IPPROTO_NVPII = 0xb IPPROTO_OLD_DIVERT = 0xfe IPPROTO_OSPFIGP = 0x59 IPPROTO_PFSYNC = 0xf0 IPPROTO_PGM = 0x71 IPPROTO_PIGP = 0x9 IPPROTO_PIM = 0x67 IPPROTO_PRM = 0x15 IPPROTO_PUP = 0xc IPPROTO_PVP = 0x4b IPPROTO_RAW = 0xff IPPROTO_RCCMON = 0xa IPPROTO_RDP = 0x1b IPPROTO_RESERVED_253 = 0xfd IPPROTO_RESERVED_254 = 0xfe IPPROTO_ROUTING = 0x2b IPPROTO_RSVP = 0x2e IPPROTO_RVD = 0x42 IPPROTO_SATEXPAK = 0x40 IPPROTO_SATMON = 0x45 IPPROTO_SCCSP = 0x60 IPPROTO_SCTP = 0x84 IPPROTO_SDRP = 0x2a IPPROTO_SEND = 0x103 IPPROTO_SEP = 0x21 IPPROTO_SHIM6 = 0x8c IPPROTO_SKIP = 0x39 IPPROTO_SPACER = 0x7fff IPPROTO_SRPC = 0x5a IPPROTO_ST = 0x7 IPPROTO_SVMTP = 0x52 IPPROTO_SWIPE = 0x35 IPPROTO_TCF = 0x57 IPPROTO_TCP = 0x6 IPPROTO_TLSP = 0x38 IPPROTO_TP = 0x1d IPPROTO_TPXX = 0x27 IPPROTO_TRUNK1 = 0x17 IPPROTO_TRUNK2 = 0x18 IPPROTO_TTP = 0x54 IPPROTO_UDP = 0x11 IPPROTO_UDPLITE = 0x88 IPPROTO_VINES = 0x53 IPPROTO_VISA = 0x46 IPPROTO_VMTP = 0x51 IPPROTO_WBEXPAK = 0x4f IPPROTO_WBMON = 0x4e IPPROTO_WSN = 0x4a IPPROTO_XNET = 0xf IPPROTO_XTP = 0x24 IPV6_AUTOFLOWLABEL = 0x3b IPV6_BINDANY = 0x40 IPV6_BINDV6ONLY = 0x1b IPV6_CHECKSUM = 0x1a IPV6_DEFAULT_MULTICAST_HOPS = 0x1 IPV6_DEFAULT_MULTICAST_LOOP = 0x1 IPV6_DEFHLIM = 0x40 IPV6_DONTFRAG = 0x3e IPV6_DSTOPTS = 0x32 IPV6_FAITH = 0x1d IPV6_FLOWINFO_MASK = 0xffffff0f IPV6_FLOWLABEL_MASK = 0xffff0f00 IPV6_FRAGTTL = 0x78 IPV6_FW_ADD = 0x1e IPV6_FW_DEL = 0x1f IPV6_FW_FLUSH = 0x20 IPV6_FW_GET = 0x22 IPV6_FW_ZERO = 0x21 IPV6_HLIMDEC = 0x1 IPV6_HOPLIMIT = 0x2f IPV6_HOPOPTS = 0x31 IPV6_IPSEC_POLICY = 0x1c IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_MAXHLIM = 0xff IPV6_MAXOPTHDR = 0x800 IPV6_MAXPACKET = 0xffff IPV6_MAX_GROUP_SRC_FILTER = 0x200 IPV6_MAX_MEMBERSHIPS = 0xfff IPV6_MAX_SOCK_SRC_FILTER = 0x80 IPV6_MIN_MEMBERSHIPS = 0x1f IPV6_MMTU = 0x500 IPV6_MSFILTER = 0x4a IPV6_MULTICAST_HOPS = 0xa IPV6_MULTICAST_IF = 0x9 IPV6_MULTICAST_LOOP = 0xb IPV6_NEXTHOP = 0x30 IPV6_PATHMTU = 0x2c IPV6_PKTINFO = 0x2e IPV6_PORTRANGE = 0xe IPV6_PORTRANGE_DEFAULT = 0x0 IPV6_PORTRANGE_HIGH = 0x1 IPV6_PORTRANGE_LOW = 0x2 IPV6_PREFER_TEMPADDR = 0x3f IPV6_RECVDSTOPTS = 0x28 IPV6_RECVHOPLIMIT = 0x25 IPV6_RECVHOPOPTS = 0x27 IPV6_RECVPATHMTU = 0x2b IPV6_RECVPKTINFO = 0x24 IPV6_RECVRTHDR = 0x26 IPV6_RECVTCLASS = 0x39 IPV6_RTHDR = 0x33 IPV6_RTHDRDSTOPTS = 0x23 IPV6_RTHDR_LOOSE = 0x0 IPV6_RTHDR_STRICT = 0x1 IPV6_RTHDR_TYPE_0 = 0x0 IPV6_SOCKOPT_RESERVED1 = 0x3 IPV6_TCLASS = 0x3d IPV6_UNICAST_HOPS = 0x4 IPV6_USE_MIN_MTU = 0x2a IPV6_V6ONLY = 0x1b IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 IP_ADD_MEMBERSHIP = 0xc IP_ADD_SOURCE_MEMBERSHIP = 0x46 IP_BINDANY = 0x18 IP_BLOCK_SOURCE = 0x48 IP_DEFAULT_MULTICAST_LOOP = 0x1 IP_DEFAULT_MULTICAST_TTL = 0x1 IP_DF = 0x4000 IP_DONTFRAG = 0x43 IP_DROP_MEMBERSHIP = 0xd IP_DROP_SOURCE_MEMBERSHIP = 0x47 IP_DUMMYNET3 = 0x31 IP_DUMMYNET_CONFIGURE = 0x3c IP_DUMMYNET_DEL = 0x3d IP_DUMMYNET_FLUSH = 0x3e IP_DUMMYNET_GET = 0x40 IP_FAITH = 0x16 IP_FW3 = 0x30 IP_FW_ADD = 0x32 IP_FW_DEL = 0x33 IP_FW_FLUSH = 0x34 IP_FW_GET = 0x36 IP_FW_NAT_CFG = 0x38 IP_FW_NAT_DEL = 0x39 IP_FW_NAT_GET_CONFIG = 0x3a IP_FW_NAT_GET_LOG = 0x3b IP_FW_RESETLOG = 0x37 IP_FW_TABLE_ADD = 0x28 IP_FW_TABLE_DEL = 0x29 IP_FW_TABLE_FLUSH = 0x2a IP_FW_TABLE_GETSIZE = 0x2b IP_FW_TABLE_LIST = 0x2c IP_FW_ZERO = 0x35 IP_HDRINCL = 0x2 IP_IPSEC_POLICY = 0x15 IP_MAXPACKET = 0xffff IP_MAX_GROUP_SRC_FILTER = 0x200 IP_MAX_MEMBERSHIPS = 0xfff IP_MAX_SOCK_MUTE_FILTER = 0x80 IP_MAX_SOCK_SRC_FILTER = 0x80 IP_MAX_SOURCE_FILTER = 0x400 IP_MF = 0x2000 IP_MINTTL = 0x42 IP_MIN_MEMBERSHIPS = 0x1f IP_MSFILTER = 0x4a IP_MSS = 0x240 IP_MULTICAST_IF = 0x9 IP_MULTICAST_LOOP = 0xb IP_MULTICAST_TTL = 0xa IP_MULTICAST_VIF = 0xe IP_OFFMASK = 0x1fff IP_ONESBCAST = 0x17 IP_OPTIONS = 0x1 IP_PORTRANGE = 0x13 IP_PORTRANGE_DEFAULT = 0x0 IP_PORTRANGE_HIGH = 0x1 IP_PORTRANGE_LOW = 0x2 IP_RECVDSTADDR = 0x7 IP_RECVIF = 0x14 IP_RECVOPTS = 0x5 IP_RECVRETOPTS = 0x6 IP_RECVTOS = 0x44 IP_RECVTTL = 0x41 IP_RETOPTS = 0x8 IP_RF = 0x8000 IP_RSVP_OFF = 0x10 IP_RSVP_ON = 0xf IP_RSVP_VIF_OFF = 0x12 IP_RSVP_VIF_ON = 0x11 IP_SENDSRCADDR = 0x7 IP_TOS = 0x3 IP_TTL = 0x4 IP_UNBLOCK_SOURCE = 0x49 ISIG = 0x80 ISTRIP = 0x20 IXANY = 0x800 IXOFF = 0x400 IXON = 0x200 LOCK_EX = 0x2 LOCK_NB = 0x4 LOCK_SH = 0x1 LOCK_UN = 0x8 MADV_AUTOSYNC = 0x7 MADV_CORE = 0x9 MADV_DONTNEED = 0x4 MADV_FREE = 0x5 MADV_NOCORE = 0x8 MADV_NORMAL = 0x0 MADV_NOSYNC = 0x6 MADV_PROTECT = 0xa MADV_RANDOM = 0x1 MADV_SEQUENTIAL = 0x2 MADV_WILLNEED = 0x3 MAP_32BIT = 0x80000 MAP_ALIGNED_SUPER = 0x1000000 MAP_ALIGNMENT_MASK = -0x1000000 MAP_ALIGNMENT_SHIFT = 0x18 MAP_ANON = 0x1000 MAP_ANONYMOUS = 0x1000 MAP_COPY = 0x2 MAP_EXCL = 0x4000 MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_HASSEMAPHORE = 0x200 MAP_NOCORE = 0x20000 MAP_NORESERVE = 0x40 MAP_NOSYNC = 0x800 MAP_PREFAULT_READ = 0x40000 MAP_PRIVATE = 0x2 MAP_RENAME = 0x20 MAP_RESERVED0080 = 0x80 MAP_RESERVED0100 = 0x100 MAP_SHARED = 0x1 MAP_STACK = 0x400 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MSG_CMSG_CLOEXEC = 0x40000 MSG_COMPAT = 0x8000 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 MSG_DONTWAIT = 0x80 MSG_EOF = 0x100 MSG_EOR = 0x8 MSG_NBIO = 0x4000 MSG_NOSIGNAL = 0x20000 MSG_NOTIFICATION = 0x2000 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_TRUNC = 0x10 MSG_WAITALL = 0x40 MS_ASYNC = 0x1 MS_INVALIDATE = 0x2 MS_SYNC = 0x0 NAME_MAX = 0xff NET_RT_DUMP = 0x1 NET_RT_FLAGS = 0x2 NET_RT_IFLIST = 0x3 NET_RT_IFLISTL = 0x5 NET_RT_IFMALIST = 0x4 NET_RT_MAXID = 0x6 NOFLSH = 0x80000000 NOTE_ATTRIB = 0x8 NOTE_CHILD = 0x4 NOTE_DELETE = 0x1 NOTE_EXEC = 0x20000000 NOTE_EXIT = 0x80000000 NOTE_EXTEND = 0x4 NOTE_FFAND = 0x40000000 NOTE_FFCOPY = 0xc0000000 NOTE_FFCTRLMASK = 0xc0000000 NOTE_FFLAGSMASK = 0xffffff NOTE_FFNOP = 0x0 NOTE_FFOR = 0x80000000 NOTE_FORK = 0x40000000 NOTE_LINK = 0x10 NOTE_LOWAT = 0x1 NOTE_MSECONDS = 0x2 NOTE_NSECONDS = 0x8 NOTE_PCTRLMASK = 0xf0000000 NOTE_PDATAMASK = 0xfffff NOTE_RENAME = 0x20 NOTE_REVOKE = 0x40 NOTE_SECONDS = 0x1 NOTE_TRACK = 0x1 NOTE_TRACKERR = 0x2 NOTE_TRIGGER = 0x1000000 NOTE_USECONDS = 0x4 NOTE_WRITE = 0x2 OCRNL = 0x10 ONLCR = 0x2 ONLRET = 0x40 ONOCR = 0x20 ONOEOT = 0x8 OPOST = 0x1 O_ACCMODE = 0x3 O_APPEND = 0x8 O_ASYNC = 0x40 O_CLOEXEC = 0x100000 O_CREAT = 0x200 O_DIRECT = 0x10000 O_DIRECTORY = 0x20000 O_EXCL = 0x800 O_EXEC = 0x40000 O_EXLOCK = 0x20 O_FSYNC = 0x80 O_NDELAY = 0x4 O_NOCTTY = 0x8000 O_NOFOLLOW = 0x100 O_NONBLOCK = 0x4 O_RDONLY = 0x0 O_RDWR = 0x2 O_SHLOCK = 0x10 O_SYNC = 0x80 O_TRUNC = 0x400 O_TTY_INIT = 0x80000 O_WRONLY = 0x1 PARENB = 0x1000 PARMRK = 0x8 PARODD = 0x2000 PENDIN = 0x20000000 PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 PROT_EXEC = 0x4 PROT_NONE = 0x0 PROT_READ = 0x1 PROT_WRITE = 0x2 RLIMIT_AS = 0xa RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 RLIMIT_NOFILE = 0x8 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 RTAX_BRD = 0x7 RTAX_DST = 0x0 RTAX_GATEWAY = 0x1 RTAX_GENMASK = 0x3 RTAX_IFA = 0x5 RTAX_IFP = 0x4 RTAX_MAX = 0x8 RTAX_NETMASK = 0x2 RTA_AUTHOR = 0x40 RTA_BRD = 0x80 RTA_DST = 0x1 RTA_GATEWAY = 0x2 RTA_GENMASK = 0x8 RTA_IFA = 0x20 RTA_IFP = 0x10 RTA_NETMASK = 0x4 RTF_BLACKHOLE = 0x1000 RTF_BROADCAST = 0x400000 RTF_DONE = 0x40 RTF_DYNAMIC = 0x10 RTF_FMASK = 0x1004d808 RTF_GATEWAY = 0x2 RTF_GWFLAG_COMPAT = 0x80000000 RTF_HOST = 0x4 RTF_LLDATA = 0x400 RTF_LLINFO = 0x400 RTF_LOCAL = 0x200000 RTF_MODIFIED = 0x20 RTF_MULTICAST = 0x800000 RTF_PINNED = 0x100000 RTF_PRCLONING = 0x10000 RTF_PROTO1 = 0x8000 RTF_PROTO2 = 0x4000 RTF_PROTO3 = 0x40000 RTF_REJECT = 0x8 RTF_RNH_LOCKED = 0x40000000 RTF_STATIC = 0x800 RTF_STICKY = 0x10000000 RTF_UP = 0x1 RTF_XRESOLVE = 0x200 RTM_ADD = 0x1 RTM_CHANGE = 0x3 RTM_DELADDR = 0xd RTM_DELETE = 0x2 RTM_DELMADDR = 0x10 RTM_GET = 0x4 RTM_IEEE80211 = 0x12 RTM_IFANNOUNCE = 0x11 RTM_IFINFO = 0xe RTM_LOCK = 0x8 RTM_LOSING = 0x5 RTM_MISS = 0x7 RTM_NEWADDR = 0xc RTM_NEWMADDR = 0xf RTM_OLDADD = 0x9 RTM_OLDDEL = 0xa RTM_REDIRECT = 0x6 RTM_RESOLVE = 0xb RTM_RTTUNIT = 0xf4240 RTM_VERSION = 0x5 RTV_EXPIRE = 0x4 RTV_HOPCOUNT = 0x2 RTV_MTU = 0x1 RTV_RPIPE = 0x8 RTV_RTT = 0x40 RTV_RTTVAR = 0x80 RTV_SPIPE = 0x10 RTV_SSTHRESH = 0x20 RTV_WEIGHT = 0x100 RT_ALL_FIBS = -0x1 RT_CACHING_CONTEXT = 0x1 RT_DEFAULT_FIB = 0x0 RT_NORTREF = 0x2 RUSAGE_CHILDREN = -0x1 RUSAGE_SELF = 0x0 RUSAGE_THREAD = 0x1 SCM_BINTIME = 0x4 SCM_CREDS = 0x3 SCM_RIGHTS = 0x1 SCM_TIMESTAMP = 0x2 SHUT_RD = 0x0 SHUT_RDWR = 0x2 SHUT_WR = 0x1 SIOCADDMULTI = 0x80206931 SIOCADDRT = 0x8040720a SIOCAIFADDR = 0x8040691a SIOCAIFGROUP = 0x80286987 SIOCALIFADDR = 0x8118691b SIOCATMARK = 0x40047307 SIOCDELMULTI = 0x80206932 SIOCDELRT = 0x8040720b SIOCDIFADDR = 0x80206919 SIOCDIFGROUP = 0x80286989 SIOCDIFPHYADDR = 0x80206949 SIOCDLIFADDR = 0x8118691d SIOCGDRVSPEC = 0xc028697b SIOCGETSGCNT = 0xc0207210 SIOCGETVIFCNT = 0xc028720f SIOCGHIWAT = 0x40047301 SIOCGIFADDR = 0xc0206921 SIOCGIFBRDADDR = 0xc0206923 SIOCGIFCAP = 0xc020691f SIOCGIFCONF = 0xc0106924 SIOCGIFDESCR = 0xc020692a SIOCGIFDSTADDR = 0xc0206922 SIOCGIFFIB = 0xc020695c SIOCGIFFLAGS = 0xc0206911 SIOCGIFGENERIC = 0xc020693a SIOCGIFGMEMB = 0xc028698a SIOCGIFGROUP = 0xc0286988 SIOCGIFINDEX = 0xc0206920 SIOCGIFMAC = 0xc0206926 SIOCGIFMEDIA = 0xc0306938 SIOCGIFMETRIC = 0xc0206917 SIOCGIFMTU = 0xc0206933 SIOCGIFNETMASK = 0xc0206925 SIOCGIFPDSTADDR = 0xc0206948 SIOCGIFPHYS = 0xc0206935 SIOCGIFPSRCADDR = 0xc0206947 SIOCGIFSTATUS = 0xc331693b SIOCGLIFADDR = 0xc118691c SIOCGLIFPHYADDR = 0xc118694b SIOCGLOWAT = 0x40047303 SIOCGPGRP = 0x40047309 SIOCGPRIVATE_0 = 0xc0206950 SIOCGPRIVATE_1 = 0xc0206951 SIOCIFCREATE = 0xc020697a SIOCIFCREATE2 = 0xc020697c SIOCIFDESTROY = 0x80206979 SIOCIFGCLONERS = 0xc0106978 SIOCSDRVSPEC = 0x8028697b SIOCSHIWAT = 0x80047300 SIOCSIFADDR = 0x8020690c SIOCSIFBRDADDR = 0x80206913 SIOCSIFCAP = 0x8020691e SIOCSIFDESCR = 0x80206929 SIOCSIFDSTADDR = 0x8020690e SIOCSIFFIB = 0x8020695d SIOCSIFFLAGS = 0x80206910 SIOCSIFGENERIC = 0x80206939 SIOCSIFLLADDR = 0x8020693c SIOCSIFMAC = 0x80206927 SIOCSIFMEDIA = 0xc0206937 SIOCSIFMETRIC = 0x80206918 SIOCSIFMTU = 0x80206934 SIOCSIFNAME = 0x80206928 SIOCSIFNETMASK = 0x80206916 SIOCSIFPHYADDR = 0x80406946 SIOCSIFPHYS = 0x80206936 SIOCSIFRVNET = 0xc020695b SIOCSIFVNET = 0xc020695a SIOCSLIFPHYADDR = 0x8118694a SIOCSLOWAT = 0x80047302 SIOCSPGRP = 0x80047308 SOCK_CLOEXEC = 0x10000000 SOCK_DGRAM = 0x2 SOCK_MAXADDRLEN = 0xff SOCK_NONBLOCK = 0x20000000 SOCK_RAW = 0x3 SOCK_RDM = 0x4 SOCK_SEQPACKET = 0x5 SOCK_STREAM = 0x1 SOL_SOCKET = 0xffff SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x2 SO_ACCEPTFILTER = 0x1000 SO_BINTIME = 0x2000 SO_BROADCAST = 0x20 SO_DEBUG = 0x1 SO_DONTROUTE = 0x10 SO_ERROR = 0x1007 SO_KEEPALIVE = 0x8 SO_LABEL = 0x1009 SO_LINGER = 0x80 SO_LISTENINCQLEN = 0x1013 SO_LISTENQLEN = 0x1012 SO_LISTENQLIMIT = 0x1011 SO_NOSIGPIPE = 0x800 SO_NO_DDP = 0x8000 SO_NO_OFFLOAD = 0x4000 SO_OOBINLINE = 0x100 SO_PEERLABEL = 0x1010 SO_PROTOCOL = 0x1016 SO_PROTOTYPE = 0x1016 SO_RCVBUF = 0x1002 SO_RCVLOWAT = 0x1004 SO_RCVTIMEO = 0x1006 SO_REUSEADDR = 0x4 SO_REUSEPORT = 0x200 SO_SETFIB = 0x1014 SO_SNDBUF = 0x1001 SO_SNDLOWAT = 0x1003 SO_SNDTIMEO = 0x1005 SO_TIMESTAMP = 0x400 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 SO_USER_COOKIE = 0x1015 SO_VENDOR = 0x80000000 TCIFLUSH = 0x1 TCIOFLUSH = 0x3 TCOFLUSH = 0x2 TCP_CA_NAME_MAX = 0x10 TCP_CONGESTION = 0x40 TCP_INFO = 0x20 TCP_KEEPCNT = 0x400 TCP_KEEPIDLE = 0x100 TCP_KEEPINIT = 0x80 TCP_KEEPINTVL = 0x200 TCP_MAXBURST = 0x4 TCP_MAXHLEN = 0x3c TCP_MAXOLEN = 0x28 TCP_MAXSEG = 0x2 TCP_MAXWIN = 0xffff TCP_MAX_SACK = 0x4 TCP_MAX_WINSHIFT = 0xe TCP_MD5SIG = 0x10 TCP_MINMSS = 0xd8 TCP_MSS = 0x218 TCP_NODELAY = 0x1 TCP_NOOPT = 0x8 TCP_NOPUSH = 0x4 TCP_VENDOR = 0x80000000 TCSAFLUSH = 0x2 TIOCCBRK = 0x2000747a TIOCCDTR = 0x20007478 TIOCCONS = 0x80047462 TIOCDRAIN = 0x2000745e TIOCEXCL = 0x2000740d TIOCEXT = 0x80047460 TIOCFLUSH = 0x80047410 TIOCGDRAINWAIT = 0x40047456 TIOCGETA = 0x402c7413 TIOCGETD = 0x4004741a TIOCGPGRP = 0x40047477 TIOCGPTN = 0x4004740f TIOCGSID = 0x40047463 TIOCGWINSZ = 0x40087468 TIOCMBIC = 0x8004746b TIOCMBIS = 0x8004746c TIOCMGDTRWAIT = 0x4004745a TIOCMGET = 0x4004746a TIOCMSDTRWAIT = 0x8004745b TIOCMSET = 0x8004746d TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DCD = 0x40 TIOCM_DSR = 0x100 TIOCM_DTR = 0x2 TIOCM_LE = 0x1 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_RTS = 0x4 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x20007471 TIOCNXCL = 0x2000740e TIOCOUTQ = 0x40047473 TIOCPKT = 0x80047470 TIOCPKT_DATA = 0x0 TIOCPKT_DOSTOP = 0x20 TIOCPKT_FLUSHREAD = 0x1 TIOCPKT_FLUSHWRITE = 0x2 TIOCPKT_IOCTL = 0x40 TIOCPKT_NOSTOP = 0x10 TIOCPKT_START = 0x8 TIOCPKT_STOP = 0x4 TIOCPTMASTER = 0x2000741c TIOCSBRK = 0x2000747b TIOCSCTTY = 0x20007461 TIOCSDRAINWAIT = 0x80047457 TIOCSDTR = 0x20007479 TIOCSETA = 0x802c7414 TIOCSETAF = 0x802c7416 TIOCSETAW = 0x802c7415 TIOCSETD = 0x8004741b TIOCSIG = 0x2004745f TIOCSPGRP = 0x80047476 TIOCSTART = 0x2000746e TIOCSTAT = 0x20007465 TIOCSTI = 0x80017472 TIOCSTOP = 0x2000746f TIOCSWINSZ = 0x80087467 TIOCTIMESTAMP = 0x40107459 TIOCUCNTL = 0x80047466 TOSTOP = 0x400000 VDISCARD = 0xf VDSUSP = 0xb VEOF = 0x0 VEOL = 0x1 VEOL2 = 0x2 VERASE = 0x3 VERASE2 = 0x7 VINTR = 0x8 VKILL = 0x5 VLNEXT = 0xe VMIN = 0x10 VQUIT = 0x9 VREPRINT = 0x6 VSTART = 0xc VSTATUS = 0x12 VSTOP = 0xd VSUSP = 0xa VTIME = 0x11 VWERASE = 0x4 WCONTINUED = 0x4 WCOREFLAG = 0x80 WEXITED = 0x10 WLINUXCLONE = 0x80000000 WNOHANG = 0x1 WNOWAIT = 0x8 WSTOPPED = 0x2 WTRAPPED = 0x20 WUNTRACED = 0x2 ) // Errors const ( E2BIG = syscall.Errno(0x7) EACCES = syscall.Errno(0xd) EADDRINUSE = syscall.Errno(0x30) EADDRNOTAVAIL = syscall.Errno(0x31) EAFNOSUPPORT = syscall.Errno(0x2f) EAGAIN = syscall.Errno(0x23) EALREADY = syscall.Errno(0x25) EAUTH = syscall.Errno(0x50) EBADF = syscall.Errno(0x9) EBADMSG = syscall.Errno(0x59) EBADRPC = syscall.Errno(0x48) EBUSY = syscall.Errno(0x10) ECANCELED = syscall.Errno(0x55) ECAPMODE = syscall.Errno(0x5e) ECHILD = syscall.Errno(0xa) ECONNABORTED = syscall.Errno(0x35) ECONNREFUSED = syscall.Errno(0x3d) ECONNRESET = syscall.Errno(0x36) EDEADLK = syscall.Errno(0xb) EDESTADDRREQ = syscall.Errno(0x27) EDOM = syscall.Errno(0x21) EDOOFUS = syscall.Errno(0x58) EDQUOT = syscall.Errno(0x45) EEXIST = syscall.Errno(0x11) EFAULT = syscall.Errno(0xe) EFBIG = syscall.Errno(0x1b) EFTYPE = syscall.Errno(0x4f) EHOSTDOWN = syscall.Errno(0x40) EHOSTUNREACH = syscall.Errno(0x41) EIDRM = syscall.Errno(0x52) EILSEQ = syscall.Errno(0x56) EINPROGRESS = syscall.Errno(0x24) EINTR = syscall.Errno(0x4) EINVAL = syscall.Errno(0x16) EIO = syscall.Errno(0x5) EISCONN = syscall.Errno(0x38) EISDIR = syscall.Errno(0x15) ELAST = syscall.Errno(0x60) ELOOP = syscall.Errno(0x3e) EMFILE = syscall.Errno(0x18) EMLINK = syscall.Errno(0x1f) EMSGSIZE = syscall.Errno(0x28) EMULTIHOP = syscall.Errno(0x5a) ENAMETOOLONG = syscall.Errno(0x3f) ENEEDAUTH = syscall.Errno(0x51) ENETDOWN = syscall.Errno(0x32) ENETRESET = syscall.Errno(0x34) ENETUNREACH = syscall.Errno(0x33) ENFILE = syscall.Errno(0x17) ENOATTR = syscall.Errno(0x57) ENOBUFS = syscall.Errno(0x37) ENODEV = syscall.Errno(0x13) ENOENT = syscall.Errno(0x2) ENOEXEC = syscall.Errno(0x8) ENOLCK = syscall.Errno(0x4d) ENOLINK = syscall.Errno(0x5b) ENOMEM = syscall.Errno(0xc) ENOMSG = syscall.Errno(0x53) ENOPROTOOPT = syscall.Errno(0x2a) ENOSPC = syscall.Errno(0x1c) ENOSYS = syscall.Errno(0x4e) ENOTBLK = syscall.Errno(0xf) ENOTCAPABLE = syscall.Errno(0x5d) ENOTCONN = syscall.Errno(0x39) ENOTDIR = syscall.Errno(0x14) ENOTEMPTY = syscall.Errno(0x42) ENOTRECOVERABLE = syscall.Errno(0x5f) ENOTSOCK = syscall.Errno(0x26) ENOTSUP = syscall.Errno(0x2d) ENOTTY = syscall.Errno(0x19) ENXIO = syscall.Errno(0x6) EOPNOTSUPP = syscall.Errno(0x2d) EOVERFLOW = syscall.Errno(0x54) EOWNERDEAD = syscall.Errno(0x60) EPERM = syscall.Errno(0x1) EPFNOSUPPORT = syscall.Errno(0x2e) EPIPE = syscall.Errno(0x20) EPROCLIM = syscall.Errno(0x43) EPROCUNAVAIL = syscall.Errno(0x4c) EPROGMISMATCH = syscall.Errno(0x4b) EPROGUNAVAIL = syscall.Errno(0x4a) EPROTO = syscall.Errno(0x5c) EPROTONOSUPPORT = syscall.Errno(0x2b) EPROTOTYPE = syscall.Errno(0x29) ERANGE = syscall.Errno(0x22) EREMOTE = syscall.Errno(0x47) EROFS = syscall.Errno(0x1e) ERPCMISMATCH = syscall.Errno(0x49) ESHUTDOWN = syscall.Errno(0x3a) ESOCKTNOSUPPORT = syscall.Errno(0x2c) ESPIPE = syscall.Errno(0x1d) ESRCH = syscall.Errno(0x3) ESTALE = syscall.Errno(0x46) ETIMEDOUT = syscall.Errno(0x3c) ETOOMANYREFS = syscall.Errno(0x3b) ETXTBSY = syscall.Errno(0x1a) EUSERS = syscall.Errno(0x44) EWOULDBLOCK = syscall.Errno(0x23) EXDEV = syscall.Errno(0x12) ) // Signals const ( SIGABRT = syscall.Signal(0x6) SIGALRM = syscall.Signal(0xe) SIGBUS = syscall.Signal(0xa) SIGCHLD = syscall.Signal(0x14) SIGCONT = syscall.Signal(0x13) SIGEMT = syscall.Signal(0x7) SIGFPE = syscall.Signal(0x8) SIGHUP = syscall.Signal(0x1) SIGILL = syscall.Signal(0x4) SIGINFO = syscall.Signal(0x1d) SIGINT = syscall.Signal(0x2) SIGIO = syscall.Signal(0x17) SIGIOT = syscall.Signal(0x6) SIGKILL = syscall.Signal(0x9) SIGLIBRT = syscall.Signal(0x21) SIGLWP = syscall.Signal(0x20) SIGPIPE = syscall.Signal(0xd) SIGPROF = syscall.Signal(0x1b) SIGQUIT = syscall.Signal(0x3) SIGSEGV = syscall.Signal(0xb) SIGSTOP = syscall.Signal(0x11) SIGSYS = syscall.Signal(0xc) SIGTERM = syscall.Signal(0xf) SIGTHR = syscall.Signal(0x20) SIGTRAP = syscall.Signal(0x5) SIGTSTP = syscall.Signal(0x12) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x10) SIGUSR1 = syscall.Signal(0x1e) SIGUSR2 = syscall.Signal(0x1f) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errors = [...]string{ 1: "operation not permitted", 2: "no such file or directory", 3: "no such process", 4: "interrupted system call", 5: "input/output error", 6: "device not configured", 7: "argument list too long", 8: "exec format error", 9: "bad file descriptor", 10: "no child processes", 11: "resource deadlock avoided", 12: "cannot allocate memory", 13: "permission denied", 14: "bad address", 15: "block device required", 16: "device busy", 17: "file exists", 18: "cross-device link", 19: "operation not supported by device", 20: "not a directory", 21: "is a directory", 22: "invalid argument", 23: "too many open files in system", 24: "too many open files", 25: "inappropriate ioctl for device", 26: "text file busy", 27: "file too large", 28: "no space left on device", 29: "illegal seek", 30: "read-only file system", 31: "too many links", 32: "broken pipe", 33: "numerical argument out of domain", 34: "result too large", 35: "resource temporarily unavailable", 36: "operation now in progress", 37: "operation already in progress", 38: "socket operation on non-socket", 39: "destination address required", 40: "message too long", 41: "protocol wrong type for socket", 42: "protocol not available", 43: "protocol not supported", 44: "socket type not supported", 45: "operation not supported", 46: "protocol family not supported", 47: "address family not supported by protocol family", 48: "address already in use", 49: "can't assign requested address", 50: "network is down", 51: "network is unreachable", 52: "network dropped connection on reset", 53: "software caused connection abort", 54: "connection reset by peer", 55: "no buffer space available", 56: "socket is already connected", 57: "socket is not connected", 58: "can't send after socket shutdown", 59: "too many references: can't splice", 60: "operation timed out", 61: "connection refused", 62: "too many levels of symbolic links", 63: "file name too long", 64: "host is down", 65: "no route to host", 66: "directory not empty", 67: "too many processes", 68: "too many users", 69: "disc quota exceeded", 70: "stale NFS file handle", 71: "too many levels of remote in path", 72: "RPC struct is bad", 73: "RPC version wrong", 74: "RPC prog. not avail", 75: "program version wrong", 76: "bad procedure for program", 77: "no locks available", 78: "function not implemented", 79: "inappropriate file type or format", 80: "authentication error", 81: "need authenticator", 82: "identifier removed", 83: "no message of desired type", 84: "value too large to be stored in data type", 85: "operation canceled", 86: "illegal byte sequence", 87: "attribute not found", 88: "programming error", 89: "bad message", 90: "multihop attempted", 91: "link has been severed", 92: "protocol error", 93: "capabilities insufficient", 94: "not permitted in capability mode", 95: "state not recoverable", 96: "previous owner died", } // Signal table var signals = [...]string{ 1: "hangup", 2: "interrupt", 3: "quit", 4: "illegal instruction", 5: "trace/BPT trap", 6: "abort trap", 7: "EMT trap", 8: "floating point exception", 9: "killed", 10: "bus error", 11: "segmentation fault", 12: "bad system call", 13: "broken pipe", 14: "alarm clock", 15: "terminated", 16: "urgent I/O condition", 17: "suspended (signal)", 18: "suspended", 19: "continued", 20: "child exited", 21: "stopped (tty input)", 22: "stopped (tty output)", 23: "I/O possible", 24: "cputime limit exceeded", 25: "filesize limit exceeded", 26: "virtual timer expired", 27: "profiling timer expired", 28: "window size changes", 29: "information request", 30: "user defined signal 1", 31: "user defined signal 2", 32: "unknown signal", 33: "unknown signal", }
{ "pile_set_name": "Github" }
name: com.gemserk.upmgitpusher displayName: UnityPackageManagerGitPusher description: Unity Package Manager Git Publish Plugin repoUrl: 'https://github.com/acoppes/upmgitpusher' parentRepoUrl: null licenseSpdxId: MIT licenseName: MIT License topics: - package-management - utilities hunter: acoppes gitTagPrefix: gitTagIgnore: '' image: >- https://github.com/acoppes/upmgitpusher/blob/master/images/example.gif?raw=true createdAt: 1587847192972
{ "pile_set_name": "Github" }
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Style x:Key="ExpanderRightHeaderStyle" TargetType="{x:Type ToggleButton}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ToggleButton}"> <Border Padding="{TemplateBinding Padding}"> <Grid Background="Transparent" SnapsToDevicePixels="False"> <Grid.RowDefinitions> <RowDefinition Height="19" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Grid> <Grid.LayoutTransform> <TransformGroup> <TransformGroup.Children> <TransformCollection> <RotateTransform Angle="-90" /> </TransformCollection> </TransformGroup.Children> </TransformGroup> </Grid.LayoutTransform> <Ellipse x:Name="circle" Width="19" Height="19" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{DynamicResource Expander.Static.Circle.Fill}" Stroke="{DynamicResource Expander.Static.Circle.Stroke}" /> <Path x:Name="arrow" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 1,1.5 L 4.5,5 L 8,1.5" SnapsToDevicePixels="false" Stroke="{DynamicResource Expander.Static.Arrow.Stroke}" StrokeThickness="2" /> </Grid> <ContentPresenter Grid.Row="1" Margin="0,4,0,0" HorizontalAlignment="Center" VerticalAlignment="Top" RecognizesAccessKey="True" SnapsToDevicePixels="True" /> </Grid> </Border> <ControlTemplate.Triggers> <Trigger Property="IsChecked" Value="true"> <Setter TargetName="arrow" Property="Data" Value="M 1,4.5 L 4.5,1 L 8,4.5" /> </Trigger> <Trigger Property="IsMouseOver" Value="true"> <Setter TargetName="circle" Property="Stroke" Value="{DynamicResource Expander.MouseOver.Circle.Stroke}" /> <Setter TargetName="circle" Property="Fill" Value="{DynamicResource Expander.MouseOver.Circle.Fill}" /> <Setter TargetName="arrow" Property="Stroke" Value="{DynamicResource Expander.MouseOver.Arrow.Stroke}" /> </Trigger> <Trigger Property="IsPressed" Value="true"> <Setter TargetName="circle" Property="Stroke" Value="{DynamicResource Expander.Pressed.Circle.Stroke}" /> <Setter TargetName="circle" Property="StrokeThickness" Value="1.5" /> <Setter TargetName="circle" Property="Fill" Value="{DynamicResource Expander.Pressed.Circle.Fill}" /> <Setter TargetName="arrow" Property="Stroke" Value="{DynamicResource Expander.Pressed.Arrow.Stroke}" /> </Trigger> <Trigger Property="IsEnabled" Value="false"> <Setter TargetName="circle" Property="Stroke" Value="{DynamicResource Expander.Disabled.Circle.Stroke}" /> <Setter TargetName="circle" Property="Fill" Value="{DynamicResource Expander.Disabled.Circle.Fill}" /> <Setter TargetName="arrow" Property="Stroke" Value="{DynamicResource Expander.Disabled.Arrow.Stroke}" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style x:Key="ExpanderUpHeaderStyle" TargetType="{x:Type ToggleButton}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ToggleButton}"> <Border Padding="{TemplateBinding Padding}"> <Grid Background="Transparent" SnapsToDevicePixels="False"> <Grid.ColumnDefinitions> <ColumnDefinition Width="19" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Grid> <Grid.LayoutTransform> <TransformGroup> <TransformGroup.Children> <TransformCollection> <RotateTransform Angle="180" /> </TransformCollection> </TransformGroup.Children> </TransformGroup> </Grid.LayoutTransform> <Ellipse x:Name="circle" Width="19" Height="19" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{DynamicResource Expander.Static.Circle.Fill}" Stroke="{DynamicResource Expander.Static.Circle.Stroke}" /> <Path x:Name="arrow" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 1,1.5 L 4.5,5 L 8,1.5" SnapsToDevicePixels="false" Stroke="{DynamicResource Expander.Static.Arrow.Stroke}" StrokeThickness="2" /> </Grid> <ContentPresenter Grid.Column="1" Margin="4,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" RecognizesAccessKey="True" SnapsToDevicePixels="True" /> </Grid> </Border> <ControlTemplate.Triggers> <Trigger Property="IsChecked" Value="true"> <Setter TargetName="arrow" Property="Data" Value="M 1,4.5 L 4.5,1 L 8,4.5" /> </Trigger> <Trigger Property="IsMouseOver" Value="true"> <Setter TargetName="circle" Property="Stroke" Value="{DynamicResource Expander.MouseOver.Circle.Stroke}" /> <Setter TargetName="circle" Property="Fill" Value="{DynamicResource Expander.MouseOver.Circle.Fill}" /> <Setter TargetName="arrow" Property="Stroke" Value="{DynamicResource Expander.MouseOver.Arrow.Stroke}" /> </Trigger> <Trigger Property="IsPressed" Value="true"> <Setter TargetName="circle" Property="Stroke" Value="{DynamicResource Expander.Pressed.Circle.Stroke}" /> <Setter TargetName="circle" Property="StrokeThickness" Value="1.5" /> <Setter TargetName="circle" Property="Fill" Value="{DynamicResource Expander.Pressed.Circle.Fill}" /> <Setter TargetName="arrow" Property="Stroke" Value="{DynamicResource Expander.Pressed.Arrow.Stroke}" /> </Trigger> <Trigger Property="IsEnabled" Value="false"> <Setter TargetName="circle" Property="Stroke" Value="{DynamicResource Expander.Disabled.Circle.Stroke}" /> <Setter TargetName="circle" Property="Fill" Value="{DynamicResource Expander.Disabled.Circle.Fill}" /> <Setter TargetName="arrow" Property="Stroke" Value="{DynamicResource Expander.Disabled.Arrow.Stroke}" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style x:Key="ExpanderLeftHeaderStyle" TargetType="{x:Type ToggleButton}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ToggleButton}"> <Border Padding="{TemplateBinding Padding}"> <Grid Background="Transparent" SnapsToDevicePixels="False"> <Grid.RowDefinitions> <RowDefinition Height="19" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Grid> <Grid.LayoutTransform> <TransformGroup> <TransformGroup.Children> <TransformCollection> <RotateTransform Angle="90" /> </TransformCollection> </TransformGroup.Children> </TransformGroup> </Grid.LayoutTransform> <Ellipse x:Name="circle" Width="19" Height="19" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{DynamicResource Expander.Static.Circle.Fill}" Stroke="{DynamicResource Expander.Static.Circle.Stroke}" /> <Path x:Name="arrow" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 1,1.5 L 4.5,5 L 8,1.5" SnapsToDevicePixels="false" Stroke="{DynamicResource Expander.Static.Arrow.Stroke}" StrokeThickness="2" /> </Grid> <ContentPresenter Grid.Row="1" Margin="0,4,0,0" HorizontalAlignment="Center" VerticalAlignment="Top" RecognizesAccessKey="True" SnapsToDevicePixels="True" /> </Grid> </Border> <ControlTemplate.Triggers> <Trigger Property="IsChecked" Value="true"> <Setter TargetName="arrow" Property="Data" Value="M 1,4.5 L 4.5,1 L 8,4.5" /> </Trigger> <Trigger Property="IsMouseOver" Value="true"> <Setter TargetName="circle" Property="Stroke" Value="{DynamicResource Expander.MouseOver.Circle.Stroke}" /> <Setter TargetName="circle" Property="Fill" Value="{DynamicResource Expander.MouseOver.Circle.Fill}" /> <Setter TargetName="arrow" Property="Stroke" Value="{DynamicResource Expander.MouseOver.Arrow.Stroke}" /> </Trigger> <Trigger Property="IsPressed" Value="true"> <Setter TargetName="circle" Property="Stroke" Value="{DynamicResource Expander.Pressed.Circle.Stroke}" /> <Setter TargetName="circle" Property="StrokeThickness" Value="1.5" /> <Setter TargetName="circle" Property="Fill" Value="{DynamicResource Expander.Pressed.Circle.Fill}" /> <Setter TargetName="arrow" Property="Stroke" Value="{DynamicResource Expander.Pressed.Arrow.Stroke}" /> </Trigger> <Trigger Property="IsEnabled" Value="false"> <Setter TargetName="circle" Property="Stroke" Value="{DynamicResource Expander.Disabled.Circle.Stroke}" /> <Setter TargetName="circle" Property="Fill" Value="{DynamicResource Expander.Disabled.Circle.Fill}" /> <Setter TargetName="arrow" Property="Stroke" Value="{DynamicResource Expander.Disabled.Arrow.Stroke}" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style x:Key="ExpanderHeaderFocusVisual"> <Setter Property="Control.Template"> <Setter.Value> <ControlTemplate> <Border> <Rectangle Margin="0" SnapsToDevicePixels="true" Stroke="Black" StrokeThickness="1" StrokeDashArray="1 2" /> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style x:Key="ExpanderDownHeaderStyle" TargetType="{x:Type ToggleButton}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ToggleButton}"> <Border Padding="{TemplateBinding Padding}"> <Grid Background="Transparent" SnapsToDevicePixels="False"> <Grid.ColumnDefinitions> <ColumnDefinition Width="19" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Ellipse x:Name="circle" Width="19" Height="19" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{DynamicResource Expander.Static.Circle.Fill}" Stroke="{DynamicResource Expander.Static.Circle.Stroke}" /> <Path x:Name="arrow" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 1,1.5 L 4.5,5 L 8,1.5" SnapsToDevicePixels="false" Stroke="{DynamicResource Expander.Static.Arrow.Stroke}" StrokeThickness="2" /> <ContentPresenter Grid.Column="1" Margin="4,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" RecognizesAccessKey="True" SnapsToDevicePixels="True" /> </Grid> </Border> <ControlTemplate.Triggers> <Trigger Property="IsChecked" Value="true"> <Setter TargetName="arrow" Property="Data" Value="M 1,4.5 L 4.5,1 L 8,4.5" /> </Trigger> <Trigger Property="IsMouseOver" Value="true"> <Setter TargetName="circle" Property="Stroke" Value="{DynamicResource Expander.MouseOver.Circle.Stroke}" /> <Setter TargetName="circle" Property="Fill" Value="{DynamicResource Expander.MouseOver.Circle.Fill}" /> <Setter TargetName="arrow" Property="Stroke" Value="{DynamicResource Expander.MouseOver.Arrow.Stroke}" /> </Trigger> <Trigger Property="IsPressed" Value="true"> <Setter TargetName="circle" Property="Stroke" Value="{DynamicResource Expander.Pressed.Circle.Stroke}" /> <Setter TargetName="circle" Property="StrokeThickness" Value="1.5" /> <Setter TargetName="circle" Property="Fill" Value="{DynamicResource Expander.Pressed.Circle.Fill}" /> <Setter TargetName="arrow" Property="Stroke" Value="{DynamicResource Expander.Pressed.Arrow.Stroke}" /> </Trigger> <Trigger Property="IsEnabled" Value="false"> <Setter TargetName="circle" Property="Stroke" Value="{DynamicResource Expander.Disabled.Circle.Stroke}" /> <Setter TargetName="circle" Property="Fill" Value="{DynamicResource Expander.Disabled.Circle.Fill}" /> <Setter TargetName="arrow" Property="Stroke" Value="{DynamicResource Expander.Disabled.Arrow.Stroke}" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style TargetType="{x:Type Expander}"> <Setter Property="Foreground" Value="{DynamicResource Control.Foreground}" /> <Setter Property="Background" Value="Transparent" /> <Setter Property="HorizontalContentAlignment" Value="Stretch" /> <Setter Property="VerticalContentAlignment" Value="Stretch" /> <Setter Property="BorderBrush" Value="Transparent" /> <Setter Property="BorderThickness" Value="1" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Expander}"> <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="3" SnapsToDevicePixels="true"> <DockPanel> <ToggleButton x:Name="HeaderSite" MinWidth="0" MinHeight="0" Margin="1" Padding="{TemplateBinding Padding}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" ContentTemplate="{TemplateBinding HeaderTemplate}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" Content="{TemplateBinding Header}" DockPanel.Dock="Top" Foreground="{TemplateBinding Foreground}" FontWeight="{TemplateBinding FontWeight}" FocusVisualStyle="{StaticResource ExpanderHeaderFocusVisual}" FontStyle="{TemplateBinding FontStyle}" FontStretch="{TemplateBinding FontStretch}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ExpanderDownHeaderStyle}" /> <ContentPresenter x:Name="ExpandSite" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" DockPanel.Dock="Bottom" Focusable="false" Visibility="Collapsed" /> </DockPanel> </Border> <ControlTemplate.Triggers> <Trigger Property="IsExpanded" Value="true"> <Setter TargetName="ExpandSite" Property="Visibility" Value="Visible" /> </Trigger> <Trigger Property="ExpandDirection" Value="Right"> <Setter TargetName="ExpandSite" Property="DockPanel.Dock" Value="Right" /> <Setter TargetName="HeaderSite" Property="DockPanel.Dock" Value="Left" /> <Setter TargetName="HeaderSite" Property="Style" Value="{StaticResource ExpanderRightHeaderStyle}" /> </Trigger> <Trigger Property="ExpandDirection" Value="Up"> <Setter TargetName="ExpandSite" Property="DockPanel.Dock" Value="Top" /> <Setter TargetName="HeaderSite" Property="DockPanel.Dock" Value="Bottom" /> <Setter TargetName="HeaderSite" Property="Style" Value="{StaticResource ExpanderUpHeaderStyle}" /> </Trigger> <Trigger Property="ExpandDirection" Value="Left"> <Setter TargetName="ExpandSite" Property="DockPanel.Dock" Value="Left" /> <Setter TargetName="HeaderSite" Property="DockPanel.Dock" Value="Right" /> <Setter TargetName="HeaderSite" Property="Style" Value="{StaticResource ExpanderLeftHeaderStyle}" /> </Trigger> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Foreground" Value="{DynamicResource Control.GrayText}" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> </ResourceDictionary>
{ "pile_set_name": "Github" }