text
stringlengths
2
99.9k
meta
dict
=========== Development =========== Useful Resources ================ IRC channels on chat.freenode.net (quick communication and discussion): * #moin-dev (core development topics) * #moin (user support, extensions) Wikis: * https://moinmo.in/ (production wiki, using moin 1.9) Documentation (installation, configuration, user docs, api reference): * http://readthedocs.org/docs/moin-20/en/latest/ Repository, Issue tracker (bugs, proposals, todo), Code Review, etc.: * https://github.com/moinwiki/moin Pastebin (temporary storage - do not use for code review or any long-term need): * http://rn0.ru/ Requirements for development ============================ The `virtualenv` Python package is required. The installation process for `virtualenv` varies with your OS and Python distribution. Many linux distributions have a package manager that may do the installation. Windows users (and perhaps others) may download setuptools from https://pypi.python.org/pypi/setuptools. Once setuptools is installed, do "`easy_install virtualenv`". Current ActiveState distributions include virtualenv in the installation bundle. If all else fails, try Google. git is required should you wish to contribute patches to the moin2 development effort. Even if you do not intend to contribute, git is highly recommended as it will make it easy for you to obtain fixes and enhancements from the moin2 repositories. git can be installed with most linux package managers or downloaded from https://git-scm.com/. You can also find GUI clients there. Typical development workflow ============================ This is the typical workflow for anyone that wants to contribute to the development of Moin2. create your development environment ----------------------------------- * if you do not have a github account, create one at https://github.com/ * fork the main repository: https://github.com/moinwiki/moin to your gh user * clone your gh repo to your local development machine:: cd <parent_directory_of_your_future_repo> git clone https://github.com/yourname/moin.git * create the virtualenv and download packages:: python quickinstall.py * create a wiki instance and load sample data:: ./m sample # Windows: m sample * start the built-in server:: ./m run # Windows: m run * point your browser at http://127.0.0.1:8080/ to access your development wiki * key ctrl+C to stop the built-in server add more tools, exercise tools ------------------------------ * install additional software that developers may require:: ./m extras # Windows: m extras * run the unit tests, note any existing test failures:: ./m tests # Windows: m tests * install NodeJS and NPM with Linux package manager; Windows users may download both from http://nodejs.org/download/ * On Ubuntu 14.04 or any distribution based on Ubuntu you need to install "npm" and "nodejs-legacy" (to get the "node" command). * install lessc ("less" below is not a typo):: sudo npm install less -g # Windows: npm install less -g lessc --version" # show version number to prove it works * regenerate CSS files:: ./m css # Windows: m css git diff # verify nothing changed * check for coding errors (tabs, trailing spaces, line endings, template indentation and spacing):: ./m coding-std # Windows: m coding-std git diff # verify nothing changed * revert any changes from above:: git reset --hard * create local docs:: ./m docs # Windows: m docs * set options on your favorite editor or IDE - convert tabs to 4 spaces - delete trailing blanks on file save - use unix line endings (use Windows line endings on .bat and .cmd files) - use mono-spaced font for editing * if you are new to git, read about it (https://git-scm.com/book/), consider printing a cheatsheet * if you want a Python IDE, try http://www.jetbrains.com/pycharm/ Free Community Edition * join #moin-dev IRC channel; ask questions, learn what other developers are doing review configuration options ---------------------------- * review https://moin-20.readthedocs.org/en/latest/admin/configure.html * following the instructions in wikiconfig.py, create wikiconfig_local.py and wikiconfig_editme.py * configure options by editing wikiconfig_editme.py * set superuser privileges on at least one username * the default configuration options are commonly used, it is likely new bugs can be found by testing different options find a task to work on ---------------------- * look at the issue tracker to find a task you can solve * in case you find a new bug or want to work on some (non-trivial) new issue or idea that is not on the issue tracker, create an issue with a detailed description * discuss your chosen task with other developers on the #moin-dev IRC channel * to avoid duplicate work, add a comment on the issue tracker that you are working on that issue * just before you start to code changes, bring your repo up to date:: git checkout master # make sure you are on master branch git pull mm master # update your master branch git checkout -b mychange # create a new branch "mychange" ... # implement your change tox # run the tests, fix any new failure! git status # check what new files you created git diff # check what changes you did git add ... # add the files you want to commit git commit # commit, write a nice commit comment git push # push to your gh user's moin repo ... # go to gh moinwiki/moin and make a PR develop a testing strategy -------------------------- * if you fix something that had no test, first try to write a correct, but failing test for it, then fix the code and see a successful test * if you implement new functionality, write tests for it first, then implement it * make a plan for using a browser to test your changes; which wiki pages are effected, how many browsers must be tested develop a working solution -------------------------- * work in your local repo on your local development machine (be sure you work in the right branch) * concentrate on one issue / one topic, create a clean set of changes (that means not doing more than needed to fix the issue, but also it means fixing the issue completely and everywhere) * write good, clean, easy-to-understand code * obey PEP-8 * do not fix or change code unrelated to your task, if you find unrelated bugs, create new issues on the tracker * regularly run the unit tests ("./m tests"), the amount of failing tests shall not increase due to your changes review your working solution ---------------------------- * use git diff, git status - read everything you changed - slowly, look for things that can be improved - if you have TortoiseGIT, use those graphical tools to review changes * look for poor variable names, spelling errors in comments, accidental addition or deletion of blank lines, complex code without comments, missing/extra spaces * fix everything you find before requesting feedback from others * run tests again "./m tests" * check for trailing spaces, line endings, template indentation "./m coding-std" * if Javascript files were changed, run http://jslint.com/ publish your change ------------------- * do some final testing - practically and using the unit tests * commit your changes to your local repo, use a concise commit comment describing the change * while a commit message may have multiple lines, many tools show only 80 characters of the first line * stuff as much info as possible into those first 80 characters:: <concise description of your change>, fixes #123 * push the changeset to your public github repo * create a pull request so your changes will get reviewed and pulled into the main repository * if you fixed an issue from the issue tracker, be sure the issue gets closed after your fix has been pulled into main repo. * celebrate, loop back to "find a task to work on" update your virtualenv ---------------------- Every week or so, do "m quickinstall" to install new releases of dependent packages. If any new packages are installed, do a quick check for breakages by running tests, starting the build-in server, modify an item, etc. MoinMoin architecture ===================== moin2 is a WSGI application and uses: * flask as framework - flask-script for command line scripts - flask-babel / babel / pytz for i18n/l10n - flask-theme for theme switching - flask-caching as cache storage abstraction * werkzeug for low level web/http page serving, debugging, builtin server, etc. * jinja2 for templating, such as the theme and user interface * flatland for form data processing * EmeraldTree for xml and tree processing * blinker for signalling * pygments for syntax highlighting * for stores: filesystem, sqlite3, sqlalchemy, memory * jquery javascript lib, a simple jQuery i18n plugin `Plugin <https://github.com/recurser/jquery-i18n>`_ * CKeditor, the GUI editor for (x)html * TWikiDraw, AnyWikiDraw, svgdraw drawing tools How MoinMoin works ================== This is a very high level overview about how moin works. If you would like to acquire a more in-depth understanding, please read the other docs and code. WSGI application creation ------------------------- First, the moin Flask application is created; see `MoinMoin.app.create_app`: * load the configuration (app.cfg) * register some modules that handle different parts of the functionality - MoinMoin.apps.frontend - most of what a normal user uses - MoinMoin.apps.admin - for admins - MoinMoin.apps.feed - feeds, e.g. atom - MoinMoin.apps.serve - serving some configurable static third party code * register before/after request handlers * initialize the cache (app.cache) * initialize index and storage (app.storage) * initialize the translation system * initialize theme support This app is then given to a WSGI compatible server somehow and will be called by the server for each request for it. Request processing ------------------ Let's look at how it shows a wiki item: * the Flask app receives a GET request for /WikiItem * Flask's routing rules determine that this request should be served by `MoinMoin.apps.frontend.show_item`. * Flask calls the before request handler of this module, which: - sets up the user as flaskg.user - an anonymous user or logged in user - initializes dicts/groups as flaskg.dicts, flaskg.groups - initializes jinja2 environment - templating * Flask then calls the handler function `MoinMoin.apps.frontend.show_item`, which: - creates an in-memory Item + by fetching the item of name "WikiItem" from storage + it looks at the contenttype of this item, which is stored in the metadata + it creates an appropriately typed Item instance, depending on the contenttype - calls Item._render_data() to determine what the rendered item looks like as HTML - renders the `show_item.html` template and returns the rendered item html - returns the result to Flask * Flask calls the after request handler which does some cleanup * Flask returns an appropriate response to the server Storage ------- Moin supports different stores, like storing directly into files / directories, using key/value stores, using an SQL database etc, see `MoinMoin.storage.stores`. A store is extremely simple: store a value for a key and retrieve the value using the key + iteration over keys. A backend is one layer above. It deals with objects that have metadata and data, see `MoinMoin.storage.backends`. Above that, there is miscellaneous functionality in `MoinMoin.storage.middleware` for: * routing by namespace to some specific backend * indexing metadata and data + comfortable and fast index-based access, selection and search * protecting items by ACLs (Access Control Lists) DOM based transformations ------------------------- How does moin know what the HTML rendering of an item looks like? Each Item has some contenttype that is stored in the metadata, also called the input contenttype. We also know what we want as output, also called the output contenttype. Moin uses converters to transform the input data into the output data in multiple steps. It also has a registry that knows all converters and their supported input and output mimetypes / contenttypes. For example, if the contenttype is `text/x-moin-wiki;charset=utf-8`, it will find that the input converter handling this is the one defined in `converter.moinwiki_in`. It then feeds the data of this item into this converter. The converter parses this input and creates an in-memory `dom tree` representation from it. This dom tree is then transformed through multiple dom-to-dom converters for example: * link processing * include processing * smileys * macros Finally, the dom-tree will reach the output converter, which will transform it into the desired output format, such as `text/html`. This is just one example of a supported transformation. There are quite a few converters in `MoinMoin.converter` supporting different input formats, dom-dom transformations and output formats. Templates and Themes -------------------- Moin uses jinja2 as its templating engine and Flask-Themes as a flask extension to support multiple themes. There is a ``MoinMoin/templates`` directory that contains a base set of templates designed for the Modernized theme. Other themes may override or add to the base templates with a directory named ``themes/<theme_name>/templates``. When rendering a template, the template is expanded within an environment of values it can use. In addition to this general environment, parameters can also be given directly to the render call. Each theme has a ``static/css`` directory. Stylesheets for the Basic theme in MoinMoin are compiled using the source ``theme.less`` file in the Basic theme's ``static/custom-less`` directory. ./m css # Windows: m css Internationalization in MoinMoin's JS ------------------------------------- Any string which has to be translated and used in the JavaScript code, has to be defined at ``MoinMoin/templates/dictionary.js``. This dictionary is loaded when the page loads and the translation for any string can be received by passing it as a parameter to the ``_`` function, also defined in the same file. For example, if we add the following to ``i18n_dict`` in ``dictionary.js`` :: "Delete this" : "{{ _("Delete this") }}", The translated version of "somestring" can be accessed in the JavaScript code by :: var a = _("Delete this"); Testing ======= We use pytest for automated testing. It is currently automatically installed into your virtualenv as a dependency. Running the tests ----------------- To run all the tests, the easiest way is to do:: ./m tests # windows: m tests To run selected tests, activate your virtual env and invoke pytest from the toplevel directory:: pytest --pep8 # run all tests, including pep8 checks pytest -rs # run all tests and output information about skipped tests pytest -k somekeyword # run the tests matching somekeyword only pytest --pep8 -k pep8 # runs pep8 checks only pytest sometests.py # run the tests contained in sometests.py Tests output ------------ Most output is quite self-explanatory. The characters mean:: . test ran OK s test was skipped E error happened while running the test F test failed x test was expected to fail (xfail) If something goes wrong, you will also see tracebacks in stdout/stderr. Writing tests ------------- Writing tests with `pytest` is easy and has little overhead. Just use the `assert` statements. For more information, please read: http://pytest.org/ Documentation ============= Sphinx (http://sphinx.pocoo.org/) and reST markup are used for documenting moin. Documentation reST source code, example files and some other text files are located in the `docs/` directory in the source tree. Creating docs ------------- Sphinx can create all kinds of documentation formats. The most common are the local HTML docs that are linked to under the User tab. To generate local docs:: ./m docs # Windows: m docs Moin Shell ========== While the make.py utility provides a menu of the most frequently used commands, there may be an occasional need to access the moin shell directly:: source <path-to-venv>/bin/activate # or ". activate" windows: "activate" moin -h # show help
{ "pile_set_name": "Github" }
.\" Copyright (c) 1990, 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" Chris Torek and the American National Standards Committee X3, .\" on Information Processing Systems. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. 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. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. .\" .\" @(#)memcpy.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD: src/lib/libc/string/memcpy.3,v 1.9 2009/04/07 13:42:53 trasz Exp $ .\" .Dd June 4, 1993 .Dt MEMCPY 3 .Os .Sh NAME .Nm memcpy .Nd copy memory area .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In string.h .Ft void * .Fo memcpy .Fa "void *restrict dst" .Fa "const void *restrict src" .Fa "size_t n" .Fc .Sh DESCRIPTION The .Fn memcpy function copies .Fa n bytes from memory area .Fa src to memory area .Fa dst . If .Fa dst and .Fa src overlap, behavior is undefined. Applications in which .Fa dst and .Fa src might overlap should use .Xr memmove 3 instead. .Sh RETURN VALUES The .Fn memcpy function returns the original value of .Fa dst . .Sh SEE ALSO .Xr bcopy 3 , .Xr memccpy 3 , .Xr memmove 3 , .Xr strcpy 3 , .Xr wmemcpy 3 .Sh STANDARDS The .Fn memcpy function conforms to .St -isoC .
{ "pile_set_name": "Github" }
// Signature format: 3.0 package androidx.preference { public class CheckBoxPreference extends androidx.preference.TwoStatePreference { ctor public CheckBoxPreference(android.content.Context!, android.util.AttributeSet!, int); ctor public CheckBoxPreference(android.content.Context!, android.util.AttributeSet!, int, int); ctor public CheckBoxPreference(android.content.Context!, android.util.AttributeSet!); ctor public CheckBoxPreference(android.content.Context!); } public abstract class DialogPreference extends androidx.preference.Preference { ctor public DialogPreference(android.content.Context!, android.util.AttributeSet!, int, int); ctor public DialogPreference(android.content.Context!, android.util.AttributeSet!, int); ctor public DialogPreference(android.content.Context!, android.util.AttributeSet!); ctor public DialogPreference(android.content.Context!); method public android.graphics.drawable.Drawable! getDialogIcon(); method public int getDialogLayoutResource(); method public CharSequence! getDialogMessage(); method public CharSequence! getDialogTitle(); method public CharSequence! getNegativeButtonText(); method public CharSequence! getPositiveButtonText(); method public void setDialogIcon(android.graphics.drawable.Drawable!); method public void setDialogIcon(int); method public void setDialogLayoutResource(int); method public void setDialogMessage(CharSequence!); method public void setDialogMessage(int); method public void setDialogTitle(CharSequence!); method public void setDialogTitle(int); method public void setNegativeButtonText(CharSequence!); method public void setNegativeButtonText(int); method public void setPositiveButtonText(CharSequence!); method public void setPositiveButtonText(int); } public static interface DialogPreference.TargetFragment { method public <T extends androidx.preference.Preference> T? findPreference(CharSequence); } public class DropDownPreference extends androidx.preference.ListPreference { ctor public DropDownPreference(android.content.Context!); ctor public DropDownPreference(android.content.Context!, android.util.AttributeSet!); ctor public DropDownPreference(android.content.Context!, android.util.AttributeSet!, int); ctor public DropDownPreference(android.content.Context!, android.util.AttributeSet!, int, int); method protected android.widget.ArrayAdapter! createAdapter(); } public class EditTextPreference extends androidx.preference.DialogPreference { ctor public EditTextPreference(android.content.Context!, android.util.AttributeSet!, int, int); ctor public EditTextPreference(android.content.Context!, android.util.AttributeSet!, int); ctor public EditTextPreference(android.content.Context!, android.util.AttributeSet!); ctor public EditTextPreference(android.content.Context!); method public String! getText(); method public void setOnBindEditTextListener(androidx.preference.EditTextPreference.OnBindEditTextListener?); method public void setText(String!); } public static interface EditTextPreference.OnBindEditTextListener { method public void onBindEditText(android.widget.EditText); } public static final class EditTextPreference.SimpleSummaryProvider implements androidx.preference.Preference.SummaryProvider<androidx.preference.EditTextPreference> { method public static androidx.preference.EditTextPreference.SimpleSummaryProvider! getInstance(); method public CharSequence! provideSummary(androidx.preference.EditTextPreference!); } @Deprecated public class EditTextPreferenceDialogFragment extends androidx.preference.PreferenceDialogFragment { ctor @Deprecated public EditTextPreferenceDialogFragment(); method @Deprecated public static androidx.preference.EditTextPreferenceDialogFragment! newInstance(String!); method @Deprecated protected void onBindDialogView(android.view.View!); method @Deprecated public void onDialogClosed(boolean); } public class EditTextPreferenceDialogFragmentCompat extends androidx.preference.PreferenceDialogFragmentCompat { ctor public EditTextPreferenceDialogFragmentCompat(); method public static androidx.preference.EditTextPreferenceDialogFragmentCompat! newInstance(String!); method public void onDialogClosed(boolean); } public class ListPreference extends androidx.preference.DialogPreference { ctor public ListPreference(android.content.Context!, android.util.AttributeSet!, int, int); ctor public ListPreference(android.content.Context!, android.util.AttributeSet!, int); ctor public ListPreference(android.content.Context!, android.util.AttributeSet!); ctor public ListPreference(android.content.Context!); method public int findIndexOfValue(String!); method public CharSequence![]! getEntries(); method public CharSequence! getEntry(); method public CharSequence![]! getEntryValues(); method public String! getValue(); method public void setEntries(CharSequence![]!); method public void setEntries(@ArrayRes int); method public void setEntryValues(CharSequence![]!); method public void setEntryValues(@ArrayRes int); method public void setValue(String!); method public void setValueIndex(int); } public static final class ListPreference.SimpleSummaryProvider implements androidx.preference.Preference.SummaryProvider<androidx.preference.ListPreference> { method public static androidx.preference.ListPreference.SimpleSummaryProvider! getInstance(); method public CharSequence! provideSummary(androidx.preference.ListPreference!); } @Deprecated public class ListPreferenceDialogFragment extends androidx.preference.PreferenceDialogFragment { ctor @Deprecated public ListPreferenceDialogFragment(); method @Deprecated public static androidx.preference.ListPreferenceDialogFragment! newInstance(String!); method @Deprecated public void onDialogClosed(boolean); method @Deprecated protected void onPrepareDialogBuilder(android.app.AlertDialog.Builder!); } public class ListPreferenceDialogFragmentCompat extends androidx.preference.PreferenceDialogFragmentCompat { ctor public ListPreferenceDialogFragmentCompat(); method public static androidx.preference.ListPreferenceDialogFragmentCompat! newInstance(String!); method public void onDialogClosed(boolean); } public class MultiSelectListPreference extends androidx.preference.DialogPreference { ctor public MultiSelectListPreference(android.content.Context!, android.util.AttributeSet!, int, int); ctor public MultiSelectListPreference(android.content.Context!, android.util.AttributeSet!, int); ctor public MultiSelectListPreference(android.content.Context!, android.util.AttributeSet!); ctor public MultiSelectListPreference(android.content.Context!); method public int findIndexOfValue(String!); method public CharSequence![]! getEntries(); method public CharSequence![]! getEntryValues(); method protected boolean[]! getSelectedItems(); method public java.util.Set<java.lang.String!>! getValues(); method public void setEntries(CharSequence![]!); method public void setEntries(@ArrayRes int); method public void setEntryValues(CharSequence![]!); method public void setEntryValues(@ArrayRes int); method public void setValues(java.util.Set<java.lang.String!>!); } @Deprecated public class MultiSelectListPreferenceDialogFragment extends androidx.preference.PreferenceDialogFragment { ctor @Deprecated public MultiSelectListPreferenceDialogFragment(); method @Deprecated public static androidx.preference.MultiSelectListPreferenceDialogFragment! newInstance(String!); method @Deprecated public void onDialogClosed(boolean); method @Deprecated protected void onPrepareDialogBuilder(android.app.AlertDialog.Builder!); } public class MultiSelectListPreferenceDialogFragmentCompat extends androidx.preference.PreferenceDialogFragmentCompat { ctor public MultiSelectListPreferenceDialogFragmentCompat(); method public static androidx.preference.MultiSelectListPreferenceDialogFragmentCompat! newInstance(String!); method public void onDialogClosed(boolean); } public class Preference implements java.lang.Comparable<androidx.preference.Preference> { ctor public Preference(android.content.Context!, android.util.AttributeSet!, int, int); ctor public Preference(android.content.Context!, android.util.AttributeSet!, int); ctor public Preference(android.content.Context!, android.util.AttributeSet!); ctor public Preference(android.content.Context!); method public boolean callChangeListener(Object!); method public int compareTo(androidx.preference.Preference); method protected <T extends androidx.preference.Preference> T? findPreferenceInHierarchy(String); method public android.content.Context! getContext(); method public String! getDependency(); method public android.os.Bundle! getExtras(); method public String! getFragment(); method public android.graphics.drawable.Drawable! getIcon(); method public android.content.Intent! getIntent(); method public String! getKey(); method public final int getLayoutResource(); method public androidx.preference.Preference.OnPreferenceChangeListener! getOnPreferenceChangeListener(); method public androidx.preference.Preference.OnPreferenceClickListener! getOnPreferenceClickListener(); method public int getOrder(); method public androidx.preference.PreferenceGroup? getParent(); method protected boolean getPersistedBoolean(boolean); method protected float getPersistedFloat(float); method protected int getPersistedInt(int); method protected long getPersistedLong(long); method protected String! getPersistedString(String!); method public java.util.Set<java.lang.String!>! getPersistedStringSet(java.util.Set<java.lang.String!>!); method public androidx.preference.PreferenceDataStore? getPreferenceDataStore(); method public androidx.preference.PreferenceManager! getPreferenceManager(); method public android.content.SharedPreferences! getSharedPreferences(); method public boolean getShouldDisableView(); method public CharSequence! getSummary(); method public final androidx.preference.Preference.SummaryProvider? getSummaryProvider(); method public CharSequence! getTitle(); method public final int getWidgetLayoutResource(); method public boolean hasKey(); method public boolean isCopyingEnabled(); method public boolean isEnabled(); method public boolean isIconSpaceReserved(); method public boolean isPersistent(); method public boolean isSelectable(); method public final boolean isShown(); method public boolean isSingleLineTitle(); method public final boolean isVisible(); method protected void notifyChanged(); method public void notifyDependencyChange(boolean); method protected void notifyHierarchyChanged(); method public void onAttached(); method protected void onAttachedToHierarchy(androidx.preference.PreferenceManager!); method public void onBindViewHolder(androidx.preference.PreferenceViewHolder!); method protected void onClick(); method public void onDependencyChanged(androidx.preference.Preference!, boolean); method public void onDetached(); method protected Object! onGetDefaultValue(android.content.res.TypedArray!, int); method @Deprecated @CallSuper public void onInitializeAccessibilityNodeInfo(androidx.core.view.accessibility.AccessibilityNodeInfoCompat!); method public void onParentChanged(androidx.preference.Preference!, boolean); method protected void onPrepareForRemoval(); method protected void onRestoreInstanceState(android.os.Parcelable!); method protected android.os.Parcelable! onSaveInstanceState(); method @Deprecated protected void onSetInitialValue(boolean, Object!); method protected void onSetInitialValue(Object?); method public android.os.Bundle! peekExtras(); method protected boolean persistBoolean(boolean); method protected boolean persistFloat(float); method protected boolean persistInt(int); method protected boolean persistLong(long); method protected boolean persistString(String!); method public boolean persistStringSet(java.util.Set<java.lang.String!>!); method public void restoreHierarchyState(android.os.Bundle!); method public void saveHierarchyState(android.os.Bundle!); method public void setCopyingEnabled(boolean); method public void setDefaultValue(Object!); method public void setDependency(String!); method public void setEnabled(boolean); method public void setFragment(String!); method public void setIcon(android.graphics.drawable.Drawable!); method public void setIcon(int); method public void setIconSpaceReserved(boolean); method public void setIntent(android.content.Intent!); method public void setKey(String!); method public void setLayoutResource(int); method public void setOnPreferenceChangeListener(androidx.preference.Preference.OnPreferenceChangeListener!); method public void setOnPreferenceClickListener(androidx.preference.Preference.OnPreferenceClickListener!); method public void setOrder(int); method public void setPersistent(boolean); method public void setPreferenceDataStore(androidx.preference.PreferenceDataStore!); method public void setSelectable(boolean); method public void setShouldDisableView(boolean); method public void setSingleLineTitle(boolean); method public void setSummary(CharSequence!); method public void setSummary(int); method public final void setSummaryProvider(androidx.preference.Preference.SummaryProvider?); method public void setTitle(CharSequence!); method public void setTitle(int); method public void setViewId(int); method public final void setVisible(boolean); method public void setWidgetLayoutResource(int); method public boolean shouldDisableDependents(); method protected boolean shouldPersist(); field public static final int DEFAULT_ORDER = 2147483647; // 0x7fffffff } public static class Preference.BaseSavedState extends android.view.AbsSavedState { ctor public Preference.BaseSavedState(android.os.Parcel!); ctor public Preference.BaseSavedState(android.os.Parcelable!); field public static final android.os.Parcelable.Creator<androidx.preference.Preference.BaseSavedState!>! CREATOR; } public static interface Preference.OnPreferenceChangeListener { method public boolean onPreferenceChange(androidx.preference.Preference!, Object!); } public static interface Preference.OnPreferenceClickListener { method public boolean onPreferenceClick(androidx.preference.Preference!); } public static interface Preference.SummaryProvider<T extends androidx.preference.Preference> { method public CharSequence! provideSummary(T!); } public class PreferenceCategory extends androidx.preference.PreferenceGroup { ctor public PreferenceCategory(android.content.Context!, android.util.AttributeSet!, int, int); ctor public PreferenceCategory(android.content.Context!, android.util.AttributeSet!, int); ctor public PreferenceCategory(android.content.Context!, android.util.AttributeSet!); ctor public PreferenceCategory(android.content.Context!); } public abstract class PreferenceDataStore { ctor public PreferenceDataStore(); method public boolean getBoolean(String!, boolean); method public float getFloat(String!, float); method public int getInt(String!, int); method public long getLong(String!, long); method public String? getString(String!, String?); method public java.util.Set<java.lang.String!>? getStringSet(String!, java.util.Set<java.lang.String!>?); method public void putBoolean(String!, boolean); method public void putFloat(String!, float); method public void putInt(String!, int); method public void putLong(String!, long); method public void putString(String!, String?); method public void putStringSet(String!, java.util.Set<java.lang.String!>?); } @Deprecated public abstract class PreferenceDialogFragment extends android.app.DialogFragment implements android.content.DialogInterface.OnClickListener { ctor @Deprecated public PreferenceDialogFragment(); method @Deprecated public androidx.preference.DialogPreference! getPreference(); method @Deprecated protected void onBindDialogView(android.view.View!); method @Deprecated public void onClick(android.content.DialogInterface!, int); method @Deprecated public void onCreate(android.os.Bundle!); method @Deprecated public android.app.Dialog onCreateDialog(android.os.Bundle!); method @Deprecated protected android.view.View! onCreateDialogView(android.content.Context!); method @Deprecated public abstract void onDialogClosed(boolean); method @Deprecated public void onDismiss(android.content.DialogInterface!); method @Deprecated protected void onPrepareDialogBuilder(android.app.AlertDialog.Builder!); method @Deprecated public void onSaveInstanceState(android.os.Bundle); field @Deprecated protected static final String ARG_KEY = "key"; } public abstract class PreferenceDialogFragmentCompat extends androidx.fragment.app.DialogFragment implements android.content.DialogInterface.OnClickListener { ctor public PreferenceDialogFragmentCompat(); method public androidx.preference.DialogPreference! getPreference(); method protected void onBindDialogView(android.view.View!); method public void onClick(android.content.DialogInterface!, int); method protected android.view.View! onCreateDialogView(android.content.Context!); method public abstract void onDialogClosed(boolean); method protected void onPrepareDialogBuilder(androidx.appcompat.app.AlertDialog.Builder!); field protected static final String ARG_KEY = "key"; } @Deprecated public abstract class PreferenceFragment extends android.app.Fragment implements androidx.preference.DialogPreference.TargetFragment androidx.preference.PreferenceManager.OnDisplayPreferenceDialogListener androidx.preference.PreferenceManager.OnNavigateToScreenListener androidx.preference.PreferenceManager.OnPreferenceTreeClickListener { ctor @Deprecated public PreferenceFragment(); method @Deprecated public void addPreferencesFromResource(@XmlRes int); method @Deprecated public <T extends androidx.preference.Preference> T! findPreference(CharSequence!); method @Deprecated public final androidx.recyclerview.widget.RecyclerView! getListView(); method @Deprecated public androidx.preference.PreferenceManager! getPreferenceManager(); method @Deprecated public androidx.preference.PreferenceScreen! getPreferenceScreen(); method @Deprecated public void onCreate(android.os.Bundle!); method @Deprecated protected androidx.recyclerview.widget.RecyclerView.Adapter! onCreateAdapter(androidx.preference.PreferenceScreen!); method @Deprecated public androidx.recyclerview.widget.RecyclerView.LayoutManager! onCreateLayoutManager(); method @Deprecated public abstract void onCreatePreferences(android.os.Bundle!, String!); method @Deprecated public androidx.recyclerview.widget.RecyclerView! onCreateRecyclerView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!); method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!); method @Deprecated public void onDestroyView(); method @Deprecated public void onDisplayPreferenceDialog(androidx.preference.Preference!); method @Deprecated public void onNavigateToScreen(androidx.preference.PreferenceScreen!); method @Deprecated public boolean onPreferenceTreeClick(androidx.preference.Preference!); method @Deprecated public void onSaveInstanceState(android.os.Bundle!); method @Deprecated public void onStart(); method @Deprecated public void onStop(); method @Deprecated public void onViewCreated(android.view.View!, android.os.Bundle!); method @Deprecated public void scrollToPreference(String!); method @Deprecated public void scrollToPreference(androidx.preference.Preference!); method @Deprecated public void setDivider(android.graphics.drawable.Drawable!); method @Deprecated public void setDividerHeight(int); method @Deprecated public void setPreferenceScreen(androidx.preference.PreferenceScreen!); method @Deprecated public void setPreferencesFromResource(@XmlRes int, String?); field @Deprecated public static final String ARG_PREFERENCE_ROOT = "androidx.preference.PreferenceFragmentCompat.PREFERENCE_ROOT"; } @Deprecated public static interface PreferenceFragment.OnPreferenceDisplayDialogCallback { method @Deprecated public boolean onPreferenceDisplayDialog(androidx.preference.PreferenceFragment, androidx.preference.Preference!); } @Deprecated public static interface PreferenceFragment.OnPreferenceStartFragmentCallback { method @Deprecated public boolean onPreferenceStartFragment(androidx.preference.PreferenceFragment!, androidx.preference.Preference!); } @Deprecated public static interface PreferenceFragment.OnPreferenceStartScreenCallback { method @Deprecated public boolean onPreferenceStartScreen(androidx.preference.PreferenceFragment!, androidx.preference.PreferenceScreen!); } public abstract class PreferenceFragmentCompat extends androidx.fragment.app.Fragment implements androidx.preference.DialogPreference.TargetFragment androidx.preference.PreferenceManager.OnDisplayPreferenceDialogListener androidx.preference.PreferenceManager.OnNavigateToScreenListener androidx.preference.PreferenceManager.OnPreferenceTreeClickListener { ctor public PreferenceFragmentCompat(); method public void addPreferencesFromResource(@XmlRes int); method public <T extends androidx.preference.Preference> T? findPreference(CharSequence); method public final androidx.recyclerview.widget.RecyclerView! getListView(); method public androidx.preference.PreferenceManager! getPreferenceManager(); method public androidx.preference.PreferenceScreen! getPreferenceScreen(); method protected androidx.recyclerview.widget.RecyclerView.Adapter! onCreateAdapter(androidx.preference.PreferenceScreen!); method public androidx.recyclerview.widget.RecyclerView.LayoutManager! onCreateLayoutManager(); method public abstract void onCreatePreferences(android.os.Bundle!, String!); method public androidx.recyclerview.widget.RecyclerView! onCreateRecyclerView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!); method public void onDisplayPreferenceDialog(androidx.preference.Preference!); method public void onNavigateToScreen(androidx.preference.PreferenceScreen!); method public boolean onPreferenceTreeClick(androidx.preference.Preference!); method public void scrollToPreference(String!); method public void scrollToPreference(androidx.preference.Preference!); method public void setDivider(android.graphics.drawable.Drawable!); method public void setDividerHeight(int); method public void setPreferenceScreen(androidx.preference.PreferenceScreen!); method public void setPreferencesFromResource(@XmlRes int, String?); field public static final String ARG_PREFERENCE_ROOT = "androidx.preference.PreferenceFragmentCompat.PREFERENCE_ROOT"; } public static interface PreferenceFragmentCompat.OnPreferenceDisplayDialogCallback { method public boolean onPreferenceDisplayDialog(androidx.preference.PreferenceFragmentCompat, androidx.preference.Preference!); } public static interface PreferenceFragmentCompat.OnPreferenceStartFragmentCallback { method public boolean onPreferenceStartFragment(androidx.preference.PreferenceFragmentCompat!, androidx.preference.Preference!); } public static interface PreferenceFragmentCompat.OnPreferenceStartScreenCallback { method public boolean onPreferenceStartScreen(androidx.preference.PreferenceFragmentCompat!, androidx.preference.PreferenceScreen!); } public abstract class PreferenceGroup extends androidx.preference.Preference { ctor public PreferenceGroup(android.content.Context!, android.util.AttributeSet!, int, int); ctor public PreferenceGroup(android.content.Context!, android.util.AttributeSet!, int); ctor public PreferenceGroup(android.content.Context!, android.util.AttributeSet!); method public void addItemFromInflater(androidx.preference.Preference!); method public boolean addPreference(androidx.preference.Preference!); method protected void dispatchRestoreInstanceState(android.os.Bundle!); method protected void dispatchSaveInstanceState(android.os.Bundle!); method public <T extends androidx.preference.Preference> T? findPreference(CharSequence); method public int getInitialExpandedChildrenCount(); method public androidx.preference.Preference! getPreference(int); method public int getPreferenceCount(); method protected boolean isOnSameScreenAsChildren(); method public boolean isOrderingAsAdded(); method protected boolean onPrepareAddPreference(androidx.preference.Preference!); method public void removeAll(); method public boolean removePreference(androidx.preference.Preference!); method public boolean removePreferenceRecursively(CharSequence); method public void setInitialExpandedChildrenCount(int); method public void setOrderingAsAdded(boolean); } public static interface PreferenceGroup.PreferencePositionCallback { method public int getPreferenceAdapterPosition(String!); method public int getPreferenceAdapterPosition(androidx.preference.Preference!); } public class PreferenceManager { method public androidx.preference.PreferenceScreen! createPreferenceScreen(android.content.Context!); method public <T extends androidx.preference.Preference> T? findPreference(CharSequence); method public android.content.Context! getContext(); method public static android.content.SharedPreferences! getDefaultSharedPreferences(android.content.Context!); method public androidx.preference.PreferenceManager.OnDisplayPreferenceDialogListener! getOnDisplayPreferenceDialogListener(); method public androidx.preference.PreferenceManager.OnNavigateToScreenListener! getOnNavigateToScreenListener(); method public androidx.preference.PreferenceManager.OnPreferenceTreeClickListener! getOnPreferenceTreeClickListener(); method public androidx.preference.PreferenceManager.PreferenceComparisonCallback! getPreferenceComparisonCallback(); method public androidx.preference.PreferenceDataStore? getPreferenceDataStore(); method public androidx.preference.PreferenceScreen! getPreferenceScreen(); method public android.content.SharedPreferences! getSharedPreferences(); method public int getSharedPreferencesMode(); method public String! getSharedPreferencesName(); method public boolean isStorageDefault(); method public boolean isStorageDeviceProtected(); method public static void setDefaultValues(android.content.Context!, int, boolean); method public static void setDefaultValues(android.content.Context!, String!, int, int, boolean); method public void setOnDisplayPreferenceDialogListener(androidx.preference.PreferenceManager.OnDisplayPreferenceDialogListener!); method public void setOnNavigateToScreenListener(androidx.preference.PreferenceManager.OnNavigateToScreenListener!); method public void setOnPreferenceTreeClickListener(androidx.preference.PreferenceManager.OnPreferenceTreeClickListener!); method public void setPreferenceComparisonCallback(androidx.preference.PreferenceManager.PreferenceComparisonCallback!); method public void setPreferenceDataStore(androidx.preference.PreferenceDataStore!); method public boolean setPreferences(androidx.preference.PreferenceScreen!); method public void setSharedPreferencesMode(int); method public void setSharedPreferencesName(String!); method public void setStorageDefault(); method public void setStorageDeviceProtected(); method public void showDialog(androidx.preference.Preference!); field public static final String KEY_HAS_SET_DEFAULT_VALUES = "_has_set_default_values"; } public static interface PreferenceManager.OnDisplayPreferenceDialogListener { method public void onDisplayPreferenceDialog(androidx.preference.Preference!); } public static interface PreferenceManager.OnNavigateToScreenListener { method public void onNavigateToScreen(androidx.preference.PreferenceScreen!); } public static interface PreferenceManager.OnPreferenceTreeClickListener { method public boolean onPreferenceTreeClick(androidx.preference.Preference!); } public abstract static class PreferenceManager.PreferenceComparisonCallback { ctor public PreferenceManager.PreferenceComparisonCallback(); method public abstract boolean arePreferenceContentsTheSame(androidx.preference.Preference!, androidx.preference.Preference!); method public abstract boolean arePreferenceItemsTheSame(androidx.preference.Preference!, androidx.preference.Preference!); } public static class PreferenceManager.SimplePreferenceComparisonCallback extends androidx.preference.PreferenceManager.PreferenceComparisonCallback { ctor public PreferenceManager.SimplePreferenceComparisonCallback(); method public boolean arePreferenceContentsTheSame(androidx.preference.Preference!, androidx.preference.Preference!); method public boolean arePreferenceItemsTheSame(androidx.preference.Preference!, androidx.preference.Preference!); } public final class PreferenceScreen extends androidx.preference.PreferenceGroup { method public void setShouldUseGeneratedIds(boolean); method public boolean shouldUseGeneratedIds(); } public class PreferenceViewHolder extends androidx.recyclerview.widget.RecyclerView.ViewHolder { method public android.view.View! findViewById(@IdRes int); method public boolean isDividerAllowedAbove(); method public boolean isDividerAllowedBelow(); method public void setDividerAllowedAbove(boolean); method public void setDividerAllowedBelow(boolean); } public class SeekBarPreference extends androidx.preference.Preference { ctor public SeekBarPreference(android.content.Context!, android.util.AttributeSet!, int, int); ctor public SeekBarPreference(android.content.Context!, android.util.AttributeSet!, int); ctor public SeekBarPreference(android.content.Context!, android.util.AttributeSet!); ctor public SeekBarPreference(android.content.Context!); method public int getMax(); method public int getMin(); method public final int getSeekBarIncrement(); method public boolean getShowSeekBarValue(); method public boolean getUpdatesContinuously(); method public int getValue(); method public boolean isAdjustable(); method public void setAdjustable(boolean); method public final void setMax(int); method public void setMin(int); method public final void setSeekBarIncrement(int); method public void setShowSeekBarValue(boolean); method public void setUpdatesContinuously(boolean); method public void setValue(int); } public class SwitchPreference extends androidx.preference.TwoStatePreference { ctor public SwitchPreference(android.content.Context!, android.util.AttributeSet!, int, int); ctor public SwitchPreference(android.content.Context!, android.util.AttributeSet!, int); ctor public SwitchPreference(android.content.Context!, android.util.AttributeSet!); ctor public SwitchPreference(android.content.Context!); method public CharSequence! getSwitchTextOff(); method public CharSequence! getSwitchTextOn(); method public void setSwitchTextOff(CharSequence!); method public void setSwitchTextOff(int); method public void setSwitchTextOn(CharSequence!); method public void setSwitchTextOn(int); } public class SwitchPreferenceCompat extends androidx.preference.TwoStatePreference { ctor public SwitchPreferenceCompat(android.content.Context!, android.util.AttributeSet!, int, int); ctor public SwitchPreferenceCompat(android.content.Context!, android.util.AttributeSet!, int); ctor public SwitchPreferenceCompat(android.content.Context!, android.util.AttributeSet!); ctor public SwitchPreferenceCompat(android.content.Context!); method public CharSequence! getSwitchTextOff(); method public CharSequence! getSwitchTextOn(); method public void setSwitchTextOff(CharSequence!); method public void setSwitchTextOff(int); method public void setSwitchTextOn(CharSequence!); method public void setSwitchTextOn(int); } public abstract class TwoStatePreference extends androidx.preference.Preference { ctor public TwoStatePreference(android.content.Context!, android.util.AttributeSet!, int, int); ctor public TwoStatePreference(android.content.Context!, android.util.AttributeSet!, int); ctor public TwoStatePreference(android.content.Context!, android.util.AttributeSet!); ctor public TwoStatePreference(android.content.Context!); method public boolean getDisableDependentsState(); method public CharSequence! getSummaryOff(); method public CharSequence! getSummaryOn(); method public boolean isChecked(); method public void setChecked(boolean); method public void setDisableDependentsState(boolean); method public void setSummaryOff(CharSequence!); method public void setSummaryOff(int); method public void setSummaryOn(CharSequence!); method public void setSummaryOn(int); method protected void syncSummaryView(androidx.preference.PreferenceViewHolder!); field protected boolean mChecked; } }
{ "pile_set_name": "Github" }
var baseForOwnRight = require('./_baseForOwnRight'), castFunction = require('./_castFunction'); /** * This method is like `_.forOwn` except that it iterates over properties of * `object` in the opposite order. * * @static * @memberOf _ * @since 2.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forOwn * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forOwnRight(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. */ function forOwnRight(object, iteratee) { return object && baseForOwnRight(object, castFunction(iteratee)); } module.exports = forOwnRight;
{ "pile_set_name": "Github" }
/*- * #%L * rapidoid-commons * %% * Copyright (C) 2014 - 2020 Nikolche Mihajlovski and 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. * #L% */ package org.rapidoid.pool; import org.rapidoid.RapidoidThing; /** * @author Nikolche Mihajlovski * @since 4.1.0 */ public class SynchronizedPool<T> extends RapidoidThing implements Pool<T> { private final Pool<T> pool; public SynchronizedPool(Pool<T> pool) { this.pool = pool; } public synchronized T get() { return pool.get(); } public synchronized void release(T obj) { pool.release(obj); } public synchronized int objectsCreated() { return pool.objectsCreated(); } @Override public synchronized int size() { return pool.size(); } @Override public void clear() { pool.clear(); } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <Scheme LastUpgradeVersion = "0700" version = "1.3"> <BuildAction parallelizeBuildables = "YES" buildImplicitDependencies = "YES"> <BuildActionEntries> <BuildActionEntry buildForTesting = "YES" buildForRunning = "YES" buildForProfiling = "YES" buildForArchiving = "YES" buildForAnalyzing = "YES"> <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "46EC34871B71255F00A407DC" BuildableName = "EasyFormValidator.app" BlueprintName = "EasyFormValidator" ReferencedContainer = "container:EasyFormValidator.xcodeproj"> </BuildableReference> </BuildActionEntry> </BuildActionEntries> </BuildAction> <TestAction buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> <Testables> </Testables> <MacroExpansion> <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "46EC34871B71255F00A407DC" BuildableName = "EasyFormValidator.app" BlueprintName = "EasyFormValidator" ReferencedContainer = "container:EasyFormValidator.xcodeproj"> </BuildableReference> </MacroExpansion> <AdditionalOptions> </AdditionalOptions> </TestAction> <LaunchAction buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" allowLocationSimulation = "YES"> <BuildableProductRunnable runnableDebuggingMode = "0"> <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "46EC34871B71255F00A407DC" BuildableName = "EasyFormValidator.app" BlueprintName = "EasyFormValidator" ReferencedContainer = "container:EasyFormValidator.xcodeproj"> </BuildableReference> </BuildableProductRunnable> <AdditionalOptions> </AdditionalOptions> </LaunchAction> <ProfileAction buildConfiguration = "Release" shouldUseLaunchSchemeArgsEnv = "YES" savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES"> <BuildableProductRunnable runnableDebuggingMode = "0"> <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "46EC34871B71255F00A407DC" BuildableName = "EasyFormValidator.app" BlueprintName = "EasyFormValidator" ReferencedContainer = "container:EasyFormValidator.xcodeproj"> </BuildableReference> </BuildableProductRunnable> </ProfileAction> <AnalyzeAction buildConfiguration = "Debug"> </AnalyzeAction> <ArchiveAction buildConfiguration = "Release" revealArchiveInOrganizer = "YES"> </ArchiveAction> </Scheme>
{ "pile_set_name": "Github" }
// Copyright 2015 The etcd 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 logutil import ( "fmt" "sync" "time" "github.com/coreos/pkg/capnslog" ) var ( defaultMergePeriod = time.Second defaultTimeOutputScale = 10 * time.Millisecond outputInterval = time.Second ) // line represents a log line that can be printed out // through capnslog.PackageLogger. type line struct { level capnslog.LogLevel str string } func (l line) append(s string) line { return line{ level: l.level, str: l.str + " " + s, } } // status represents the merge status of a line. type status struct { period time.Duration start time.Time // start time of latest merge period count int // number of merged lines from starting } func (s *status) isInMergePeriod(now time.Time) bool { return s.period == 0 || s.start.Add(s.period).After(now) } func (s *status) isEmpty() bool { return s.count == 0 } func (s *status) summary(now time.Time) string { ts := s.start.Round(defaultTimeOutputScale) took := now.Round(defaultTimeOutputScale).Sub(ts) return fmt.Sprintf("[merged %d repeated lines in %s]", s.count, took) } func (s *status) reset(now time.Time) { s.start = now s.count = 0 } // MergeLogger supports merge logging, which merges repeated log lines // and prints summary log lines instead. // // For merge logging, MergeLogger prints out the line when the line appears // at the first time. MergeLogger holds the same log line printed within // defaultMergePeriod, and prints out summary log line at the end of defaultMergePeriod. // It stops merging when the line doesn't appear within the // defaultMergePeriod. type MergeLogger struct { *capnslog.PackageLogger mu sync.Mutex // protect statusm statusm map[line]*status } func NewMergeLogger(logger *capnslog.PackageLogger) *MergeLogger { l := &MergeLogger{ PackageLogger: logger, statusm: make(map[line]*status), } go l.outputLoop() return l } func (l *MergeLogger) MergeInfo(entries ...interface{}) { l.merge(line{ level: capnslog.INFO, str: fmt.Sprint(entries...), }) } func (l *MergeLogger) MergeInfof(format string, args ...interface{}) { l.merge(line{ level: capnslog.INFO, str: fmt.Sprintf(format, args...), }) } func (l *MergeLogger) MergeNotice(entries ...interface{}) { l.merge(line{ level: capnslog.NOTICE, str: fmt.Sprint(entries...), }) } func (l *MergeLogger) MergeNoticef(format string, args ...interface{}) { l.merge(line{ level: capnslog.NOTICE, str: fmt.Sprintf(format, args...), }) } func (l *MergeLogger) MergeWarning(entries ...interface{}) { l.merge(line{ level: capnslog.WARNING, str: fmt.Sprint(entries...), }) } func (l *MergeLogger) MergeWarningf(format string, args ...interface{}) { l.merge(line{ level: capnslog.WARNING, str: fmt.Sprintf(format, args...), }) } func (l *MergeLogger) MergeError(entries ...interface{}) { l.merge(line{ level: capnslog.ERROR, str: fmt.Sprint(entries...), }) } func (l *MergeLogger) MergeErrorf(format string, args ...interface{}) { l.merge(line{ level: capnslog.ERROR, str: fmt.Sprintf(format, args...), }) } func (l *MergeLogger) merge(ln line) { l.mu.Lock() // increase count if the logger is merging the line if status, ok := l.statusm[ln]; ok { status.count++ l.mu.Unlock() return } // initialize status of the line l.statusm[ln] = &status{ period: defaultMergePeriod, start: time.Now(), } // release the lock before IO operation l.mu.Unlock() // print out the line at its first time l.PackageLogger.Logf(ln.level, ln.str) } func (l *MergeLogger) outputLoop() { for now := range time.Tick(outputInterval) { var outputs []line l.mu.Lock() for ln, status := range l.statusm { if status.isInMergePeriod(now) { continue } if status.isEmpty() { delete(l.statusm, ln) continue } outputs = append(outputs, ln.append(status.summary(now))) status.reset(now) } l.mu.Unlock() for _, o := range outputs { l.PackageLogger.Logf(o.level, o.str) } } }
{ "pile_set_name": "Github" }
<template> <component :is="componentType" :tag="tag" v-bind="$attrs" v-on="hooks" enter-active-class="zoomInUp" move-class="zoom-move" leave-active-class="zoomOutUp"> <slot></slot> </component> </template> <script> import {baseTransition} from '../mixins/index.js' export default { name: 'zoom-up-transition', props: { styles: { type: Object, default: () => { return { animationFillMode: 'both', animationTimingFunction: 'ease-out' } } } }, mixins: [baseTransition] } </script> <style lang="scss"> @import "move"; @keyframes zoomInUp { from { opacity: 0; transform: scaleY(0); transform-origin: top center; } 50% { opacity: 1; } to { transform: scaleY(1); } } .zoomInUp { animation-name: zoomInUp; } @keyframes zoomOutUp { from { opacity: 1; } 50% { transform: scaleY(0); } to { opacity: 0; } } .zoomOutUp { animation-name: zoomOutUp; } </style>
{ "pile_set_name": "Github" }
from .jsonobjects import IntegerProperty, StringProperty, FixedValueProperty, LimitedChoiceProperty from .jsonobjects import JSONObject # Event base classes (abstract, should not be used directly) class SylkRTCEventBase(JSONObject): platform = StringProperty(optional=True) app_id = StringProperty(optional=True) token = StringProperty() device_id = StringProperty(optional=True) silent = IntegerProperty(optional=True, default=0) call_id = StringProperty() def __init__(self, **kw): super(SylkRTCEventBase, self).__init__(**kw) class CallEventBase(SylkRTCEventBase): event = None # specified by subclass originator = StringProperty() from_display_name = StringProperty(optional=True, default=None) media_type = LimitedChoiceProperty(['audio', 'video']) # Events to use used in a SylkPushRequest class ConferenceInviteEvent(CallEventBase): event = FixedValueProperty('incoming_conference_request') to = StringProperty() @property def __data__(self): data = super(ConferenceInviteEvent, self).__data__ for key in data: # Fixup keys data[key.replace('_', '-')] = data.pop(key) data['from'] = data.pop('originator') return data
{ "pile_set_name": "Github" }
/*expected initial->s1_1->s1_2->s1_3->s1_4->s1_5->s1_2->s1_2; s1_3->s1_2; s1_4->s1_2; s1_5->s1_6; s1_2->s1_6; s1_3->s1_6; s1_4->s1_6->final; */ do { foo(); } while (a ?? b ?? c ?? d); /*DOT digraph { node[shape=box,style="rounded,filled",fillcolor=white]; initial[label="",shape=circle,style=filled,fillcolor=black,width=0.25,height=0.25]; final[label="",shape=doublecircle,style=filled,fillcolor=black,width=0.25,height=0.25]; s1_1[label="Program\nDoWhileStatement"]; s1_2[label="BlockStatement\nExpressionStatement\nCallExpression\nIdentifier (foo)\nLogicalExpression\nLogicalExpression\nLogicalExpression\nIdentifier (a)\nIdentifier:exit (foo)\nCallExpression:exit\nExpressionStatement:exit\nBlockStatement:exit\nIdentifier:exit (a)"]; s1_3[label="Identifier (b)\nIdentifier:exit (b)\nLogicalExpression:exit"]; s1_4[label="Identifier (c)\nIdentifier:exit (c)\nLogicalExpression:exit"]; s1_5[label="Identifier (d)\nIdentifier:exit (d)\nLogicalExpression:exit"]; s1_6[label="DoWhileStatement:exit\nProgram:exit"]; initial->s1_1->s1_2->s1_3->s1_4->s1_5->s1_2->s1_2; s1_3->s1_2; s1_4->s1_2; s1_5->s1_6; s1_2->s1_6; s1_3->s1_6; s1_4->s1_6->final; } */
{ "pile_set_name": "Github" }
/******************************************************************************* * This file is part of OpenNMS(R). * * Copyright (C) 2017 The OpenNMS Group, Inc. * OpenNMS(R) is Copyright (C) 1999-2017 The OpenNMS Group, Inc. * * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. * * OpenNMS(R) is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, * or (at your option) any later version. * * OpenNMS(R) 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with OpenNMS(R). If not, see: * http://www.gnu.org/licenses/ * * For more information contact: * OpenNMS(R) Licensing <[email protected]> * http://www.opennms.org/ * http://www.opennms.com/ *******************************************************************************/ package org.opennms.smoketest; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.junit.Before; import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; import org.openqa.selenium.By; import org.openqa.selenium.support.ui.Select; @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class KSCEditorIT extends OpenNMSSeleniumIT { protected void goToMainPage() { driver.get(getBaseUrlInternal() + "opennms/KSC/index.jsp"); } @Before public void setUp() throws Exception { // Create the test requisition, this will block until the test node is actually created createRequisition(); } @Test public void testKSCReports() throws Exception { goToMainPage(); checkMainPage(); goToMainPage(); createReport(); goToMainPage(); editExistingReport(); goToMainPage(); deleteExistingReport(); } protected void checkMainPage() throws Exception { // main KSC page assertEquals(3, countElementsMatchingCss("div.card-header")); findElementByXpath("//div[@class='card-header']/span[text()='Customized Reports']"); findElementByXpath("//div[@class='card-header']/span[text()='Node & Domain Interface Reports']"); findElementByXpath("//div[@class='card-header']/span[text()='Descriptions']"); assertElementDoesNotExist(By.name("report:Smoke Test Report 1")); assertElementDoesNotExist(By.name("report:Smoke Test Report Uno")); assertEquals("TestMachine1", findElementByName("resource:TestMachine1").getText()); } protected void createReport() throws Exception { // create a new report clickElementByXpath("//button[text()='Create New']"); // set the title enterText(By.name("report_title"), "Smoke Test Report 1"); // add the ICMP graph clickElementByXpath("//button[text()='Add New Graph']"); // select the first subresource (TestMachine1) clickElementByName("subresource:Node:TestMachine1"); clickElementByXpath("//button[text()='View Child Resource']"); // select the first subresource (127.0.0.1) clickElementByName("subresource:Response Time:127.0.0.1"); clickElementByXpath("//button[text()='View Child Resource']"); // choose the resource clickElementByXpath("//button[text()='Choose this resource']"); // name the graph enterText(By.name("title"), "Smoke Test Graph Title 1"); // finish up clickElementByXpath("//button[text()='Done with edits to this graph']"); clickElementByXpath("//button[text()='Save Report']"); assertEquals("Smoke Test Report 1", findElementByName("report:Smoke Test Report 1").getText()); // view the report to confirm it's right waitForElement(By.name("report:Smoke Test Report 1")); Thread.sleep(100); clickElementByName("report:Smoke Test Report 1"); clickElementByXpath("//button[text()='View']"); findElementByXpath("//div[@class='card-header']/span[text()='Custom View: Smoke Test Report 1']"); findElementByXpath("//div[contains(@class, 'graph-container')]"); findElementByXpath("//div[contains(@class, 'graph-container')]//canvas"); } protected void editExistingReport() throws Exception { // edit report 0 (should be the Smoke Test Report 1 from b_test*) clickElementByName("report:Smoke Test Report 1"); clickElementByXpath("//button[text()='Customize']"); // check that the defaults are set as expected assertFalse(findElementByName("show_timespan").isSelected()); assertFalse(findElementByName("show_graphtype").isSelected()); final Select gpl = new Select(findElementByName("graphs_per_line")); assertEquals("default", gpl.getFirstSelectedOption().getText()); // change graphs per line to 3, check "show timespan" and "show graphtype", and change the title gpl.selectByVisibleText("3"); clickElementByName("show_timespan"); clickElementByName("show_graphtype"); enterText(By.name("report_title"), "Smoke Test Report Uno"); // now confirm that the checkboxes got checked assertTrue(findElementByName("show_timespan").isSelected()); assertTrue(findElementByName("show_graphtype").isSelected()); // modify the graph and give it a new title clickElementByXpath("//button[text()='Modify']"); enterText(By.name("title"), "Smoke Test Graph Title I"); // update the timespan final Select timespan = new Select(findElementByName("timespan")); timespan.selectByVisibleText("3 month"); // then finish modifying the graph clickElementByXpath("//button[text()='Done with edits to this graph']"); // then finish modifying the report clickElementByXpath("//button[text()='Save Report']"); } protected void deleteExistingReport() throws Exception { // edit report 0 (should be the Smoke Test Report 1 from b_test*) clickElementByName("report:Smoke Test Report Uno"); clickElementByXpath("//button[text()='Delete']"); assertElementDoesNotExist(By.name("report:Smoke Test Report Uno")); } private void clickElementByName(final String name) { findElementByName(name).click(); } private void clickElementByXpath(final String xpath) { findElementByXpath(xpath).click(); } private void createRequisition() throws Exception { final String req = "<model-import xmlns=\"http://xmlns.opennms.org/xsd/config/model-import\" date-stamp=\"2006-03-09T00:03:09\" foreign-source=\"" + REQUISITION_NAME + "\">" + "<node node-label=\"TestMachine1\" foreign-id=\"TestMachine1\">" + "<interface ip-addr=\"127.0.0.1\" snmp-primary=\"P\" descr=\"localhost\">" + "<monitored-service service-name=\"ICMP\"/>" + "<monitored-service service-name=\"HTTP\"/>" + "</interface>" + "</node>" + "</model-import>"; createRequisition(REQUISITION_NAME, req, 1); } }
{ "pile_set_name": "Github" }
#ifndef QMLCOLOR_H #define QMLCOLOR_H #include <QObject> #include <QColor> namespace lv { class QmlColor : public QObject { Q_OBJECT public: explicit QmlColor(QObject *parent = nullptr); public slots: QColor RgbToHsv(QColor rgb); }; } #endif // QMLCOLOR_H
{ "pile_set_name": "Github" }
# Python3 code to Check for balanced parentheses in an expression open_list = ["[","{","("] close_list = ["]","}",")"] # Function to check parentheses def check(myStr): stack = [] for i in myStr: if i in open_list: stack.append(i) elif i in close_list: pos = close_list.index(i) if ((len(stack) > 0) and (open_list[pos] == stack[len(stack)-1])): stack.pop() else: return "Unbalanced" if len(stack) == 0: return "Balanced" # Driver code string = "{[]{()}}" print(string,"-", check(string)) string = "[{}{})(]" print(string,"-", check(string))
{ "pile_set_name": "Github" }
glabel func_80A20A88 /* 00CC8 80A20A88 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 /* 00CCC 80A20A8C AFBF0014 */ sw $ra, 0x0014($sp) /* 00CD0 80A20A90 3C1880A2 */ lui $t8, %hi(func_80A20AC0) ## $t8 = 80A20000 /* 00CD4 80A20A94 240E0001 */ addiu $t6, $zero, 0x0001 ## $t6 = 00000001 /* 00CD8 80A20A98 240F0050 */ addiu $t7, $zero, 0x0050 ## $t7 = 00000050 /* 00CDC 80A20A9C 27180AC0 */ addiu $t8, $t8, %lo(func_80A20AC0) ## $t8 = 80A20AC0 /* 00CE0 80A20AA0 A08E0260 */ sb $t6, 0x0260($a0) ## 00000260 /* 00CE4 80A20AA4 A48F0244 */ sh $t7, 0x0244($a0) ## 00000244 /* 00CE8 80A20AA8 0C287FE3 */ jal func_80A1FF8C /* 00CEC 80A20AAC AC98014C */ sw $t8, 0x014C($a0) ## 0000014C /* 00CF0 80A20AB0 8FBF0014 */ lw $ra, 0x0014($sp) /* 00CF4 80A20AB4 27BD0018 */ addiu $sp, $sp, 0x0018 ## $sp = 00000000 /* 00CF8 80A20AB8 03E00008 */ jr $ra /* 00CFC 80A20ABC 00000000 */ nop
{ "pile_set_name": "Github" }
{ "version": "2.0", "service": "<fullname>AWS Service Catalog</fullname> <p> <a href=\"https://aws.amazon.com/servicecatalog/\">AWS Service Catalog</a> enables organizations to create and manage catalogs of IT services that are approved for use on AWS. To get the most out of this documentation, you should be familiar with the terminology discussed in <a href=\"http://docs.aws.amazon.com/servicecatalog/latest/adminguide/what-is_concepts.html\">AWS Service Catalog Concepts</a>.</p>", "operations": { "AcceptPortfolioShare": "<p>Accepts an offer to share the specified portfolio.</p>", "AssociatePrincipalWithPortfolio": "<p>Associates the specified principal ARN with the specified portfolio.</p>", "AssociateProductWithPortfolio": "<p>Associates the specified product with the specified portfolio.</p>", "AssociateTagOptionWithResource": "<p>Associate the specified TagOption with the specified portfolio or product.</p>", "CopyProduct": "<p>Copies the specified source product to the specified target product or a new product.</p> <p>You can copy a product to the same account or another account. You can copy a product to the same region or another region.</p> <p>This operation is performed asynchronously. To track the progress of the operation, use <a>DescribeCopyProductStatus</a>.</p>", "CreateConstraint": "<p>Creates a constraint.</p>", "CreatePortfolio": "<p>Creates a portfolio.</p>", "CreatePortfolioShare": "<p>Shares the specified portfolio with the specified account.</p>", "CreateProduct": "<p>Creates a product.</p>", "CreateProvisioningArtifact": "<p>Creates a provisioning artifact (also known as a version) for the specified product.</p> <p>You cannot create a provisioning artifact for a product that was shared with you.</p>", "CreateTagOption": "<p>Creates a TagOption.</p>", "DeleteConstraint": "<p>Deletes the specified constraint.</p>", "DeletePortfolio": "<p>Deletes the specified portfolio.</p> <p>You cannot delete a portfolio if it was shared with you or if it has associated products, users, constraints, or shared accounts.</p>", "DeletePortfolioShare": "<p>Stops sharing the specified portfolio with the specified account.</p>", "DeleteProduct": "<p>Deletes the specified product.</p> <p>You cannot delete a product if it was shared with you or is associated with a portfolio.</p>", "DeleteProvisioningArtifact": "<p>Deletes the specified provisioning artifact (also known as a version) for the specified product.</p> <p>You cannot delete a provisioning artifact associated with a product that was shared with you. You cannot delete the last provisioning artifact for a product, because a product must have at least one provisioning artifact.</p>", "DescribeConstraint": "<p>Gets information about the specified constraint.</p>", "DescribeCopyProductStatus": "<p>Gets the status of the specified copy product operation.</p>", "DescribePortfolio": "<p>Gets information about the specified portfolio.</p>", "DescribeProduct": "<p>Gets information about the specified product.</p>", "DescribeProductAsAdmin": "<p>Gets information about the specified product. This operation is run with administrator access.</p>", "DescribeProductView": "<p>Gets information about the specified product.</p>", "DescribeProvisionedProduct": "<p>Gets information about the specified provisioned product.</p>", "DescribeProvisioningArtifact": "<p>Gets information about the specified provisioning artifact (also known as a version) for the specified product.</p>", "DescribeProvisioningParameters": "<p>Gets information about the configuration required to provision the specified product using the specified provisioning artifact.</p> <p>If the output contains a TagOption key with an empty list of values, there is a TagOption conflict for that key. The end user cannot take action to fix the conflict, and launch is not blocked. In subsequent calls to <a>ProvisionProduct</a>, do not include conflicted TagOption keys as tags, or this will cause the error \"Parameter validation failed: Missing required parameter in Tags[<i>N</i>]:<i>Value</i>\" and tag the provisioned product with the value <code>sc-tagoption-conflict-portfolioId-productId</code>.</p>", "DescribeRecord": "<p>Gets information about the specified request operation.</p> <p>Use this operation after calling a request operation (for example, <a>ProvisionProduct</a>, <a>TerminateProvisionedProduct</a>, or <a>UpdateProvisionedProduct</a>). </p>", "DescribeTagOption": "<p>Gets information about the specified TagOption.</p>", "DisassociatePrincipalFromPortfolio": "<p>Disassociates a previously associated principal ARN from a specified portfolio.</p>", "DisassociateProductFromPortfolio": "<p>Disassociates the specified product from the specified portfolio. </p>", "DisassociateTagOptionFromResource": "<p>Disassociates the specified TagOption from the specified resource.</p>", "ListAcceptedPortfolioShares": "<p>Lists all portfolios for which sharing was accepted by this account.</p>", "ListConstraintsForPortfolio": "<p>Lists the constraints for the specified portfolio and product.</p>", "ListLaunchPaths": "<p>Lists the paths to the specified product. A path is how the user has access to a specified product, and is necessary when provisioning a product. A path also determines the constraints put on the product.</p>", "ListPortfolioAccess": "<p>Lists the account IDs that have access to the specified portfolio.</p>", "ListPortfolios": "<p>Lists all portfolios in the catalog.</p>", "ListPortfoliosForProduct": "<p>Lists all portfolios that the specified product is associated with.</p>", "ListPrincipalsForPortfolio": "<p>Lists all principal ARNs associated with the specified portfolio.</p>", "ListProvisioningArtifacts": "<p>Lists all provisioning artifacts (also known as versions) for the specified product.</p>", "ListRecordHistory": "<p>Lists the specified requests or all performed requests.</p>", "ListResourcesForTagOption": "<p>Lists the resources associated with the specified TagOption.</p>", "ListTagOptions": "<p>Lists the specified TagOptions or all TagOptions.</p>", "ProvisionProduct": "<p>Provisions the specified product.</p> <p>A provisioned product is a resourced instance of a product. For example, provisioning a product based on a CloudFormation template launches a CloudFormation stack and its underlying resources. You can check the status of this request using <a>DescribeRecord</a>.</p> <p>If the request contains a tag key with an empty list of values, there is a tag conflict for that key. Do not include conflicted keys as tags, or this will cause the error \"Parameter validation failed: Missing required parameter in Tags[<i>N</i>]:<i>Value</i>\".</p>", "RejectPortfolioShare": "<p>Rejects an offer to share the specified portfolio.</p>", "ScanProvisionedProducts": "<p>Lists the provisioned products that are available (not terminated).</p>", "SearchProducts": "<p>Gets information about the products to which the caller has access.</p>", "SearchProductsAsAdmin": "<p>Gets information about the products for the specified portfolio or all products.</p>", "TerminateProvisionedProduct": "<p>Terminates the specified provisioned product.</p> <p>This operation does not delete any records associated with the provisioned product.</p> <p>You can check the status of this request using <a>DescribeRecord</a>.</p>", "UpdateConstraint": "<p>Updates the specified constraint.</p>", "UpdatePortfolio": "<p>Updates the specified portfolio.</p> <p>You cannot update a product that was shared with you.</p>", "UpdateProduct": "<p>Updates the specified product.</p>", "UpdateProvisionedProduct": "<p>Requests updates to the configuration of the specified provisioned product.</p> <p>If there are tags associated with the object, they cannot be updated or added. Depending on the specific updates requested, this operation can update with no interruption, with some interruption, or replace the provisioned product entirely.</p> <p>You can check the status of this request using <a>DescribeRecord</a>.</p>", "UpdateProvisioningArtifact": "<p>Updates the specified provisioning artifact (also known as a version) for the specified product.</p> <p>You cannot update a provisioning artifact for a product that was shared with you.</p>", "UpdateTagOption": "<p>Updates the specified TagOption.</p>" }, "shapes": { "AcceptLanguage": { "base": null, "refs": { "AcceptPortfolioShareInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "AssociatePrincipalWithPortfolioInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "AssociateProductWithPortfolioInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "CopyProductInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "CreateConstraintInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "CreatePortfolioInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "CreatePortfolioShareInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "CreateProductInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "CreateProvisioningArtifactInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "DeleteConstraintInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "DeletePortfolioInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "DeletePortfolioShareInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "DeleteProductInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "DeleteProvisioningArtifactInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "DescribeConstraintInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "DescribeCopyProductStatusInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "DescribePortfolioInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "DescribeProductAsAdminInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "DescribeProductInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "DescribeProductViewInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "DescribeProvisionedProductInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "DescribeProvisioningArtifactInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "DescribeProvisioningParametersInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "DescribeRecordInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "DisassociatePrincipalFromPortfolioInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "DisassociateProductFromPortfolioInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "ListAcceptedPortfolioSharesInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "ListConstraintsForPortfolioInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "ListLaunchPathsInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "ListPortfolioAccessInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "ListPortfoliosForProductInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "ListPortfoliosInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "ListPrincipalsForPortfolioInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "ListProvisioningArtifactsInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "ListRecordHistoryInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "ProvisionProductInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "RejectPortfolioShareInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "ScanProvisionedProductsInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "SearchProductsAsAdminInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "SearchProductsInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "TerminateProvisionedProductInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "UpdateConstraintInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "UpdatePortfolioInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "UpdateProductInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "UpdateProvisionedProductInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>", "UpdateProvisioningArtifactInput$AcceptLanguage": "<p>The language code.</p> <ul> <li> <p> <code>en</code> - English (default)</p> </li> <li> <p> <code>jp</code> - Japanese</p> </li> <li> <p> <code>zh</code> - Chinese</p> </li> </ul>" } }, "AcceptPortfolioShareInput": { "base": null, "refs": { } }, "AcceptPortfolioShareOutput": { "base": null, "refs": { } }, "AccessLevelFilter": { "base": "<p>The access level to use to filter results.</p>", "refs": { "ListRecordHistoryInput$AccessLevelFilter": "<p>The access level to use to obtain results. The default is <code>User</code>.</p>", "ScanProvisionedProductsInput$AccessLevelFilter": "<p>The access level to use to obtain results. The default is <code>User</code>.</p>" } }, "AccessLevelFilterKey": { "base": null, "refs": { "AccessLevelFilter$Key": "<p>The access level.</p> <ul> <li> <p> <code>Account</code> - Filter results based on the account.</p> </li> <li> <p> <code>Role</code> - Filter results based on the federated role of the specified user.</p> </li> <li> <p> <code>User</code> - Filter results based on the specified user.</p> </li> </ul>" } }, "AccessLevelFilterValue": { "base": null, "refs": { "AccessLevelFilter$Value": "<p>The user to which the access level applies. The only supported value is <code>Self</code>.</p>" } }, "AccountId": { "base": null, "refs": { "AccountIds$member": null, "ConstraintDetail$Owner": "<p>The owner of the constraint.</p>", "CreatePortfolioShareInput$AccountId": "<p>The AWS account ID.</p>", "DeletePortfolioShareInput$AccountId": "<p>The AWS account ID.</p>" } }, "AccountIds": { "base": null, "refs": { "ListPortfolioAccessOutput$AccountIds": "<p>Information about the AWS accounts with access to the portfolio.</p>" } }, "AddTags": { "base": null, "refs": { "CreatePortfolioInput$Tags": "<p>The tags to associate with the portfolio.</p>", "CreateProductInput$Tags": "<p>The tags to associate with the product.</p>", "UpdatePortfolioInput$AddTags": "<p>The tags to add.</p>", "UpdateProductInput$AddTags": "<p>The tags to add to the product.</p>" } }, "AllowedValue": { "base": null, "refs": { "AllowedValues$member": null } }, "AllowedValues": { "base": null, "refs": { "ParameterConstraints$AllowedValues": "<p>The values that the administrator has allowed for the parameter.</p>" } }, "ApproximateCount": { "base": null, "refs": { "ProductViewAggregationValue$ApproximateCount": "<p>An approximate count of the products that match the value.</p>" } }, "AssociatePrincipalWithPortfolioInput": { "base": null, "refs": { } }, "AssociatePrincipalWithPortfolioOutput": { "base": null, "refs": { } }, "AssociateProductWithPortfolioInput": { "base": null, "refs": { } }, "AssociateProductWithPortfolioOutput": { "base": null, "refs": { } }, "AssociateTagOptionWithResourceInput": { "base": null, "refs": { } }, "AssociateTagOptionWithResourceOutput": { "base": null, "refs": { } }, "AttributeValue": { "base": null, "refs": { "ProductViewAggregationValue$Value": "<p>The value of the product view aggregation.</p>" } }, "ConstraintDescription": { "base": null, "refs": { "ConstraintDetail$Description": "<p>The description of the constraint.</p>", "ConstraintSummary$Description": "<p>The description of the constraint.</p>", "CreateConstraintInput$Description": "<p>The description of the constraint.</p>", "UpdateConstraintInput$Description": "<p>The updated description of the constraint.</p>" } }, "ConstraintDetail": { "base": "<p>Information about a constraint.</p>", "refs": { "ConstraintDetails$member": null, "CreateConstraintOutput$ConstraintDetail": "<p>Information about the constraint.</p>", "DescribeConstraintOutput$ConstraintDetail": "<p>Information about the constraint.</p>", "UpdateConstraintOutput$ConstraintDetail": "<p>Information about the constraint.</p>" } }, "ConstraintDetails": { "base": null, "refs": { "ListConstraintsForPortfolioOutput$ConstraintDetails": "<p>Information about the constraints.</p>" } }, "ConstraintParameters": { "base": null, "refs": { "CreateConstraintInput$Parameters": "<p>The constraint parameters, in JSON format. The syntax depends on the constraint type as follows:</p> <dl> <dt>LAUNCH</dt> <dd> <p>Specify the <code>RoleArn</code> property as follows:</p> <p>\\\"RoleArn\\\" : \\\"arn:aws:iam::123456789012:role/LaunchRole\\\"</p> </dd> <dt>NOTIFICATION</dt> <dd> <p>Specify the <code>NotificationArns</code> property as follows:</p> <p>\\\"NotificationArns\\\" : [\\\"arn:aws:sns:us-east-1:123456789012:Topic\\\"]</p> </dd> <dt>TEMPLATE</dt> <dd> <p>Specify the <code>Rules</code> property. For more information, see <a href=\"http://docs.aws.amazon.com/servicecatalog/latest/adminguide/reference-template_constraint_rules.html\">Template Constraint Rules</a>.</p> </dd> </dl>", "CreateConstraintOutput$ConstraintParameters": "<p>The constraint parameters.</p>", "DescribeConstraintOutput$ConstraintParameters": "<p>The constraint parameters.</p>", "UpdateConstraintOutput$ConstraintParameters": "<p>The constraint parameters.</p>" } }, "ConstraintSummaries": { "base": null, "refs": { "DescribeProvisioningParametersOutput$ConstraintSummaries": "<p>Information about the constraints used to provision the product.</p>", "LaunchPathSummary$ConstraintSummaries": "<p>The constraints on the portfolio-product relationship.</p>" } }, "ConstraintSummary": { "base": "<p>Summary information about a constraint.</p>", "refs": { "ConstraintSummaries$member": null } }, "ConstraintType": { "base": null, "refs": { "ConstraintDetail$Type": "<p>The type of constraint.</p> <ul> <li> <p> <code>LAUNCH</code> </p> </li> <li> <p> <code>NOTIFICATION</code> </p> </li> <li> <p> <code>TEMPLATE</code> </p> </li> </ul>", "ConstraintSummary$Type": "<p>The type of constraint.</p> <ul> <li> <p> <code>LAUNCH</code> </p> </li> <li> <p> <code>NOTIFICATION</code> </p> </li> <li> <p> <code>TEMPLATE</code> </p> </li> </ul>", "CreateConstraintInput$Type": "<p>The type of constraint.</p> <ul> <li> <p> <code>LAUNCH</code> </p> </li> <li> <p> <code>NOTIFICATION</code> </p> </li> <li> <p> <code>TEMPLATE</code> </p> </li> </ul>" } }, "CopyOption": { "base": null, "refs": { "CopyOptions$member": null } }, "CopyOptions": { "base": null, "refs": { "CopyProductInput$CopyOptions": "<p>The copy options. If the value is <code>CopyTags</code>, the tags from the source product are copied to the target product.</p>" } }, "CopyProductInput": { "base": null, "refs": { } }, "CopyProductOutput": { "base": null, "refs": { } }, "CopyProductStatus": { "base": null, "refs": { "DescribeCopyProductStatusOutput$CopyProductStatus": "<p>The status of the copy product operation.</p>" } }, "CreateConstraintInput": { "base": null, "refs": { } }, "CreateConstraintOutput": { "base": null, "refs": { } }, "CreatePortfolioInput": { "base": null, "refs": { } }, "CreatePortfolioOutput": { "base": null, "refs": { } }, "CreatePortfolioShareInput": { "base": null, "refs": { } }, "CreatePortfolioShareOutput": { "base": null, "refs": { } }, "CreateProductInput": { "base": null, "refs": { } }, "CreateProductOutput": { "base": null, "refs": { } }, "CreateProvisioningArtifactInput": { "base": null, "refs": { } }, "CreateProvisioningArtifactOutput": { "base": null, "refs": { } }, "CreateTagOptionInput": { "base": null, "refs": { } }, "CreateTagOptionOutput": { "base": null, "refs": { } }, "CreatedTime": { "base": null, "refs": { "ProductViewDetail$CreatedTime": "<p>The UTC timestamp of the creation time.</p>", "ProvisionedProductDetail$CreatedTime": "<p>The UTC timestamp of the creation time.</p>", "RecordDetail$CreatedTime": "<p>The UTC timestamp of the creation time.</p>" } }, "CreationTime": { "base": null, "refs": { "PortfolioDetail$CreatedTime": "<p>The UTC timestamp of the creation time.</p>", "ProvisioningArtifactDetail$CreatedTime": "<p>The UTC timestamp of the creation time.</p>" } }, "DefaultValue": { "base": null, "refs": { "ProvisioningArtifactParameter$DefaultValue": "<p>The default value.</p>" } }, "DeleteConstraintInput": { "base": null, "refs": { } }, "DeleteConstraintOutput": { "base": null, "refs": { } }, "DeletePortfolioInput": { "base": null, "refs": { } }, "DeletePortfolioOutput": { "base": null, "refs": { } }, "DeletePortfolioShareInput": { "base": null, "refs": { } }, "DeletePortfolioShareOutput": { "base": null, "refs": { } }, "DeleteProductInput": { "base": null, "refs": { } }, "DeleteProductOutput": { "base": null, "refs": { } }, "DeleteProvisioningArtifactInput": { "base": null, "refs": { } }, "DeleteProvisioningArtifactOutput": { "base": null, "refs": { } }, "DescribeConstraintInput": { "base": null, "refs": { } }, "DescribeConstraintOutput": { "base": null, "refs": { } }, "DescribeCopyProductStatusInput": { "base": null, "refs": { } }, "DescribeCopyProductStatusOutput": { "base": null, "refs": { } }, "DescribePortfolioInput": { "base": null, "refs": { } }, "DescribePortfolioOutput": { "base": null, "refs": { } }, "DescribeProductAsAdminInput": { "base": null, "refs": { } }, "DescribeProductAsAdminOutput": { "base": null, "refs": { } }, "DescribeProductInput": { "base": null, "refs": { } }, "DescribeProductOutput": { "base": null, "refs": { } }, "DescribeProductViewInput": { "base": null, "refs": { } }, "DescribeProductViewOutput": { "base": null, "refs": { } }, "DescribeProvisionedProductInput": { "base": null, "refs": { } }, "DescribeProvisionedProductOutput": { "base": null, "refs": { } }, "DescribeProvisioningArtifactInput": { "base": null, "refs": { } }, "DescribeProvisioningArtifactOutput": { "base": null, "refs": { } }, "DescribeProvisioningParametersInput": { "base": null, "refs": { } }, "DescribeProvisioningParametersOutput": { "base": null, "refs": { } }, "DescribeRecordInput": { "base": null, "refs": { } }, "DescribeRecordOutput": { "base": null, "refs": { } }, "DescribeTagOptionInput": { "base": null, "refs": { } }, "DescribeTagOptionOutput": { "base": null, "refs": { } }, "Description": { "base": null, "refs": { "ProvisioningArtifactParameter$Description": "<p>The description of the parameter.</p>", "RecordOutput$Description": "<p>The description of the output.</p>" } }, "DisassociatePrincipalFromPortfolioInput": { "base": null, "refs": { } }, "DisassociatePrincipalFromPortfolioOutput": { "base": null, "refs": { } }, "DisassociateProductFromPortfolioInput": { "base": null, "refs": { } }, "DisassociateProductFromPortfolioOutput": { "base": null, "refs": { } }, "DisassociateTagOptionFromResourceInput": { "base": null, "refs": { } }, "DisassociateTagOptionFromResourceOutput": { "base": null, "refs": { } }, "DuplicateResourceException": { "base": "<p>The specified resource is a duplicate.</p>", "refs": { } }, "ErrorCode": { "base": null, "refs": { "RecordError$Code": "<p>The numeric value of the error.</p>" } }, "ErrorDescription": { "base": null, "refs": { "RecordError$Description": "<p>The description of the error.</p>" } }, "HasDefaultPath": { "base": null, "refs": { "ProductViewSummary$HasDefaultPath": "<p>Indicates whether the product has a default path. If the product does not have a default path, call <a>ListLaunchPaths</a> to disambiguate between paths. Otherwise, <a>ListLaunchPaths</a> is not required, and the output of <a>ProductViewSummary</a> can be used directly with <a>DescribeProvisioningParameters</a>.</p>" } }, "Id": { "base": null, "refs": { "AcceptPortfolioShareInput$PortfolioId": "<p>The portfolio identifier.</p>", "AssociatePrincipalWithPortfolioInput$PortfolioId": "<p>The portfolio identifier.</p>", "AssociateProductWithPortfolioInput$ProductId": "<p>The product identifier.</p>", "AssociateProductWithPortfolioInput$PortfolioId": "<p>The portfolio identifier.</p>", "AssociateProductWithPortfolioInput$SourcePortfolioId": "<p>The identifier of the source portfolio.</p>", "ConstraintDetail$ConstraintId": "<p>The identifier of the constraint.</p>", "CopyProductInput$TargetProductId": "<p>The identifier of the target product. By default, a new product is created.</p>", "CopyProductOutput$CopyProductToken": "<p>The token to use to track the progress of the operation.</p>", "CreateConstraintInput$PortfolioId": "<p>The portfolio identifier.</p>", "CreateConstraintInput$ProductId": "<p>The product identifier.</p>", "CreatePortfolioShareInput$PortfolioId": "<p>The portfolio identifier.</p>", "CreateProvisioningArtifactInput$ProductId": "<p>The product identifier.</p>", "DeleteConstraintInput$Id": "<p>The identifier of the constraint.</p>", "DeletePortfolioInput$Id": "<p>The portfolio identifier.</p>", "DeletePortfolioShareInput$PortfolioId": "<p>The portfolio identifier.</p>", "DeleteProductInput$Id": "<p>The product identifier.</p>", "DeleteProvisioningArtifactInput$ProductId": "<p>The product identifier.</p>", "DeleteProvisioningArtifactInput$ProvisioningArtifactId": "<p>The identifier of the provisioning artifact.</p>", "DescribeConstraintInput$Id": "<p>The identifier of the constraint.</p>", "DescribeCopyProductStatusInput$CopyProductToken": "<p>The token for the copy product operation. This token is returned by <a>CopyProduct</a>.</p>", "DescribeCopyProductStatusOutput$TargetProductId": "<p>The identifier of the copied product.</p>", "DescribePortfolioInput$Id": "<p>The portfolio identifier.</p>", "DescribeProductAsAdminInput$Id": "<p>The product identifier.</p>", "DescribeProductInput$Id": "<p>The product identifier.</p>", "DescribeProductViewInput$Id": "<p>The product view identifier.</p>", "DescribeProvisionedProductInput$Id": "<p>The provisioned product identifier.</p>", "DescribeProvisioningArtifactInput$ProvisioningArtifactId": "<p>The identifier of the provisioning artifact.</p>", "DescribeProvisioningArtifactInput$ProductId": "<p>The product identifier.</p>", "DescribeProvisioningParametersInput$ProductId": "<p>The product identifier.</p>", "DescribeProvisioningParametersInput$ProvisioningArtifactId": "<p>The identifier of the provisioning artifact.</p>", "DescribeProvisioningParametersInput$PathId": "<p>The path identifier of the product. This value is optional if the product has a default path, and required if the product has more than one path. To list the paths for a product, use <a>ListLaunchPaths</a>.</p>", "DescribeRecordInput$Id": "<p>The record identifier of the provisioned product. This identifier is returned by the request operation.</p>", "DisassociatePrincipalFromPortfolioInput$PortfolioId": "<p>The portfolio identifier.</p>", "DisassociateProductFromPortfolioInput$ProductId": "<p>The product identifier.</p>", "DisassociateProductFromPortfolioInput$PortfolioId": "<p>The portfolio identifier.</p>", "LaunchPathSummary$Id": "<p>The identifier of the product path.</p>", "ListConstraintsForPortfolioInput$PortfolioId": "<p>The portfolio identifier.</p>", "ListConstraintsForPortfolioInput$ProductId": "<p>The product identifier.</p>", "ListLaunchPathsInput$ProductId": "<p>The product identifier.</p>", "ListPortfolioAccessInput$PortfolioId": "<p>The portfolio identifier.</p>", "ListPortfoliosForProductInput$ProductId": "<p>The product identifier.</p>", "ListPrincipalsForPortfolioInput$PortfolioId": "<p>The portfolio identifier.</p>", "ListProvisioningArtifactsInput$ProductId": "<p>The product identifier.</p>", "PortfolioDetail$Id": "<p>The portfolio identifier.</p>", "ProductViewSummary$Id": "<p>The product view identifier.</p>", "ProductViewSummary$ProductId": "<p>The product identifier.</p>", "ProvisionProductInput$ProductId": "<p>The product identifier.</p>", "ProvisionProductInput$ProvisioningArtifactId": "<p>The identifier of the provisioning artifact.</p>", "ProvisionProductInput$PathId": "<p>The path identifier of the product. This value is optional if the product has a default path, and required if the product has more than one path. To list the paths for a product, use <a>ListLaunchPaths</a>.</p>", "ProvisioningArtifact$Id": "<p>The identifier of the provisioning artifact.</p>", "ProvisioningArtifactDetail$Id": "<p>The identifier of the provisioning artifact.</p>", "ProvisioningArtifactSummary$Id": "<p>The identifier of the provisioning artifact.</p>", "RecordDetail$RecordId": "<p>The identifier of the record.</p>", "RecordDetail$ProvisionedProductId": "<p>The identifier of the provisioned product.</p>", "RecordDetail$ProductId": "<p>The product identifier.</p>", "RecordDetail$ProvisioningArtifactId": "<p>The identifier of the provisioning artifact.</p>", "RecordDetail$PathId": "<p>The path identifier.</p>", "RejectPortfolioShareInput$PortfolioId": "<p>The portfolio identifier.</p>", "SearchProductsAsAdminInput$PortfolioId": "<p>The portfolio identifier.</p>", "TerminateProvisionedProductInput$ProvisionedProductId": "<p>The identifier of the provisioned product. You cannot specify both <code>ProvisionedProductName</code> and <code>ProvisionedProductId</code>.</p>", "UpdateConstraintInput$Id": "<p>The identifier of the constraint.</p>", "UpdatePortfolioInput$Id": "<p>The portfolio identifier.</p>", "UpdateProductInput$Id": "<p>The product identifier.</p>", "UpdateProvisionedProductInput$ProvisionedProductId": "<p>The identifier of the provisioned product. You cannot specify both <code>ProvisionedProductName</code> and <code>ProvisionedProductId</code>.</p>", "UpdateProvisionedProductInput$ProductId": "<p>The identifier of the provisioned product.</p>", "UpdateProvisionedProductInput$ProvisioningArtifactId": "<p>The identifier of the provisioning artifact.</p>", "UpdateProvisionedProductInput$PathId": "<p>The new path identifier. This value is optional if the product has a default path, and required if the product has more than one path.</p>", "UpdateProvisioningArtifactInput$ProductId": "<p>The product identifier.</p>", "UpdateProvisioningArtifactInput$ProvisioningArtifactId": "<p>The identifier of the provisioning artifact.</p>" } }, "IdempotencyToken": { "base": null, "refs": { "CopyProductInput$IdempotencyToken": "<p> A unique identifier that you provide to ensure idempotency. If multiple requests differ only by the idempotency token, the same response is returned for each repeated request. </p>", "CreateConstraintInput$IdempotencyToken": "<p>A unique identifier that you provide to ensure idempotency. If multiple requests differ only by the idempotency token, the same response is returned for each repeated request.</p>", "CreatePortfolioInput$IdempotencyToken": "<p>A unique identifier that you provide to ensure idempotency. If multiple requests differ only by the idempotency token, the same response is returned for each repeated request.</p>", "CreateProductInput$IdempotencyToken": "<p>A unique identifier that you provide to ensure idempotency. If multiple requests differ only by the idempotency token, the same response is returned for each repeated request.</p>", "CreateProvisioningArtifactInput$IdempotencyToken": "<p>A unique identifier that you provide to ensure idempotency. If multiple requests differ only by the idempotency token, the same response is returned for each repeated request.</p>", "ProvisionProductInput$ProvisionToken": "<p>An idempotency token that uniquely identifies the provisioning request.</p>", "ProvisionedProductDetail$IdempotencyToken": "<p>A unique identifier that you provide to ensure idempotency. If multiple requests differ only by the idempotency token, the same response is returned for each repeated request.</p>", "TerminateProvisionedProductInput$TerminateToken": "<p>An idempotency token that uniquely identifies the termination request. This token is only valid during the termination process. After the provisioned product is terminated, subsequent requests to terminate the same provisioned product always return <b>ResourceNotFound</b>.</p>", "UpdateProvisionedProductInput$UpdateToken": "<p>The idempotency token that uniquely identifies the provisioning update rquest.</p>" } }, "IgnoreErrors": { "base": null, "refs": { "TerminateProvisionedProductInput$IgnoreErrors": "<p>If set to true, AWS Service Catalog stops managing the specified provisioned product even if it cannot delete the underlying resources.</p>" } }, "InstructionType": { "base": null, "refs": { "UsageInstruction$Type": "<p>The usage instruction type for the value.</p>" } }, "InstructionValue": { "base": null, "refs": { "UsageInstruction$Value": "<p>The usage instruction value for this type.</p>" } }, "InvalidParametersException": { "base": "<p>One or more parameters provided to the operation are not valid.</p>", "refs": { } }, "InvalidStateException": { "base": "<p>An attempt was made to modify a resource that is in a state that is not valid. Check your resources to ensure that they are in valid states before retrying the operation.</p>", "refs": { } }, "LastRequestId": { "base": null, "refs": { "ProvisionedProductDetail$LastRecordId": "<p>The record identifier of the last request performed on this provisioned product.</p>" } }, "LaunchPathSummaries": { "base": null, "refs": { "ListLaunchPathsOutput$LaunchPathSummaries": "<p>Information about the launch path.</p>" } }, "LaunchPathSummary": { "base": "<p>Summary information about a product path for a user.</p>", "refs": { "LaunchPathSummaries$member": null } }, "LimitExceededException": { "base": "<p>The current limits of the service would have been exceeded by this operation. Decrease your resource use or increase your service limits and retry the operation.</p>", "refs": { } }, "ListAcceptedPortfolioSharesInput": { "base": null, "refs": { } }, "ListAcceptedPortfolioSharesOutput": { "base": null, "refs": { } }, "ListConstraintsForPortfolioInput": { "base": null, "refs": { } }, "ListConstraintsForPortfolioOutput": { "base": null, "refs": { } }, "ListLaunchPathsInput": { "base": null, "refs": { } }, "ListLaunchPathsOutput": { "base": null, "refs": { } }, "ListPortfolioAccessInput": { "base": null, "refs": { } }, "ListPortfolioAccessOutput": { "base": null, "refs": { } }, "ListPortfoliosForProductInput": { "base": null, "refs": { } }, "ListPortfoliosForProductOutput": { "base": null, "refs": { } }, "ListPortfoliosInput": { "base": null, "refs": { } }, "ListPortfoliosOutput": { "base": null, "refs": { } }, "ListPrincipalsForPortfolioInput": { "base": null, "refs": { } }, "ListPrincipalsForPortfolioOutput": { "base": null, "refs": { } }, "ListProvisioningArtifactsInput": { "base": null, "refs": { } }, "ListProvisioningArtifactsOutput": { "base": null, "refs": { } }, "ListRecordHistoryInput": { "base": null, "refs": { } }, "ListRecordHistoryOutput": { "base": null, "refs": { } }, "ListRecordHistorySearchFilter": { "base": "<p>The search filter to use when listing history records.</p>", "refs": { "ListRecordHistoryInput$SearchFilter": "<p>The search filter to scope the results.</p>" } }, "ListResourcesForTagOptionInput": { "base": null, "refs": { } }, "ListResourcesForTagOptionOutput": { "base": null, "refs": { } }, "ListTagOptionsFilters": { "base": "<p>Filters to use when listing TagOptions.</p>", "refs": { "ListTagOptionsInput$Filters": "<p>The search filters. If no search filters are specified, the output includes all TagOptions.</p>" } }, "ListTagOptionsInput": { "base": null, "refs": { } }, "ListTagOptionsOutput": { "base": null, "refs": { } }, "NoEcho": { "base": null, "refs": { "ProvisioningArtifactParameter$IsNoEcho": "<p>If this value is true, the value for this parameter is obfuscated from view when the parameter is retrieved. This parameter is used to hide sensitive information.</p>" } }, "NotificationArn": { "base": null, "refs": { "NotificationArns$member": null } }, "NotificationArns": { "base": null, "refs": { "ProvisionProductInput$NotificationArns": "<p>Passed to CloudFormation. The SNS topic ARNs to which to publish stack-related events.</p>" } }, "OutputKey": { "base": null, "refs": { "RecordOutput$OutputKey": "<p>The output key.</p>" } }, "OutputValue": { "base": null, "refs": { "RecordOutput$OutputValue": "<p>The output value.</p>" } }, "PageSize": { "base": null, "refs": { "DescribeRecordInput$PageSize": "<p>The maximum number of items to return with this call.</p>", "ListAcceptedPortfolioSharesInput$PageSize": "<p>The maximum number of items to return with this call.</p>", "ListConstraintsForPortfolioInput$PageSize": "<p>The maximum number of items to return with this call.</p>", "ListLaunchPathsInput$PageSize": "<p>The maximum number of items to return with this call.</p>", "ListPortfoliosForProductInput$PageSize": "<p>The maximum number of items to return with this call.</p>", "ListPortfoliosInput$PageSize": "<p>The maximum number of items to return with this call.</p>", "ListPrincipalsForPortfolioInput$PageSize": "<p>The maximum number of items to return with this call.</p>", "ListRecordHistoryInput$PageSize": "<p>The maximum number of items to return with this call.</p>", "ListResourcesForTagOptionInput$PageSize": "<p>The maximum number of items to return with this call.</p>", "ListTagOptionsInput$PageSize": "<p>The maximum number of items to return with this call.</p>", "ScanProvisionedProductsInput$PageSize": "<p>The maximum number of items to return with this call.</p>", "SearchProductsAsAdminInput$PageSize": "<p>The maximum number of items to return with this call.</p>", "SearchProductsInput$PageSize": "<p>The maximum number of items to return with this call.</p>" } }, "PageToken": { "base": null, "refs": { "DescribeRecordInput$PageToken": "<p>The page token for the next set of results. To retrieve the first set of results, use null.</p>", "DescribeRecordOutput$NextPageToken": "<p>The page token to use to retrieve the next set of results. If there are no additional results, this value is null.</p>", "ListAcceptedPortfolioSharesInput$PageToken": "<p>The page token for the next set of results. To retrieve the first set of results, use null.</p>", "ListAcceptedPortfolioSharesOutput$NextPageToken": "<p>The page token to use to retrieve the next set of results. If there are no additional results, this value is null.</p>", "ListConstraintsForPortfolioInput$PageToken": "<p>The page token for the next set of results. To retrieve the first set of results, use null.</p>", "ListConstraintsForPortfolioOutput$NextPageToken": "<p>The page token to use to retrieve the next set of results. If there are no additional results, this value is null.</p>", "ListLaunchPathsInput$PageToken": "<p>The page token for the next set of results. To retrieve the first set of results, use null.</p>", "ListLaunchPathsOutput$NextPageToken": "<p>The page token to use to retrieve the next set of results. If there are no additional results, this value is null.</p>", "ListPortfolioAccessOutput$NextPageToken": "<p>The page token to use to retrieve the next set of results. If there are no additional results, this value is null.</p>", "ListPortfoliosForProductInput$PageToken": "<p>The page token for the next set of results. To retrieve the first set of results, use null.</p>", "ListPortfoliosForProductOutput$NextPageToken": "<p>The page token to use to retrieve the next set of results. If there are no additional results, this value is null.</p>", "ListPortfoliosInput$PageToken": "<p>The page token for the next set of results. To retrieve the first set of results, use null.</p>", "ListPortfoliosOutput$NextPageToken": "<p>The page token to use to retrieve the next set of results. If there are no additional results, this value is null.</p>", "ListPrincipalsForPortfolioInput$PageToken": "<p>The page token for the next set of results. To retrieve the first set of results, use null.</p>", "ListPrincipalsForPortfolioOutput$NextPageToken": "<p>The page token to use to retrieve the next set of results. If there are no additional results, this value is null.</p>", "ListProvisioningArtifactsOutput$NextPageToken": "<p>The page token to use to retrieve the next set of results. If there are no additional results, this value is null.</p>", "ListRecordHistoryInput$PageToken": "<p>The page token for the next set of results. To retrieve the first set of results, use null.</p>", "ListRecordHistoryOutput$NextPageToken": "<p>The page token to use to retrieve the next set of results. If there are no additional results, this value is null.</p>", "ListResourcesForTagOptionInput$PageToken": "<p>The page token for the next set of results. To retrieve the first set of results, use null.</p>", "ListResourcesForTagOptionOutput$PageToken": "<p>The page token for the next set of results. To retrieve the first set of results, use null.</p>", "ListTagOptionsInput$PageToken": "<p>The page token for the next set of results. To retrieve the first set of results, use null.</p>", "ListTagOptionsOutput$PageToken": "<p>The page token for the next set of results. To retrieve the first set of results, use null.</p>", "ScanProvisionedProductsInput$PageToken": "<p>The page token for the next set of results. To retrieve the first set of results, use null.</p>", "ScanProvisionedProductsOutput$NextPageToken": "<p>The page token to use to retrieve the next set of results. If there are no additional results, this value is null.</p>", "SearchProductsAsAdminInput$PageToken": "<p>The page token for the next set of results. To retrieve the first set of results, use null.</p>", "SearchProductsAsAdminOutput$NextPageToken": "<p>The page token to use to retrieve the next set of results. If there are no additional results, this value is null.</p>", "SearchProductsInput$PageToken": "<p>The page token for the next set of results. To retrieve the first set of results, use null.</p>", "SearchProductsOutput$NextPageToken": "<p>The page token to use to retrieve the next set of results. If there are no additional results, this value is null.</p>" } }, "ParameterConstraints": { "base": "<p>The constraints that the administrator has put on the parameter.</p>", "refs": { "ProvisioningArtifactParameter$ParameterConstraints": "<p>Constraints that the administrator has put on a parameter.</p>" } }, "ParameterKey": { "base": null, "refs": { "ProvisioningArtifactParameter$ParameterKey": "<p>The parameter key.</p>", "ProvisioningParameter$Key": "<p>The parameter key.</p>", "UpdateProvisioningParameter$Key": "<p>The parameter key.</p>" } }, "ParameterType": { "base": null, "refs": { "ProvisioningArtifactParameter$ParameterType": "<p>The parameter type.</p>" } }, "ParameterValue": { "base": null, "refs": { "ProvisioningParameter$Value": "<p>The parameter value.</p>", "UpdateProvisioningParameter$Value": "<p>The parameter value.</p>" } }, "PortfolioDescription": { "base": null, "refs": { "CreatePortfolioInput$Description": "<p>The description of the portfolio.</p>", "PortfolioDetail$Description": "<p>The description of the portfolio.</p>", "UpdatePortfolioInput$Description": "<p>The updated description of the portfolio.</p>" } }, "PortfolioDetail": { "base": "<p>Information about a portfolio.</p>", "refs": { "CreatePortfolioOutput$PortfolioDetail": "<p>Information about the portfolio.</p>", "DescribePortfolioOutput$PortfolioDetail": "<p>Information about the portfolio.</p>", "PortfolioDetails$member": null, "UpdatePortfolioOutput$PortfolioDetail": "<p>Information about the portfolio.</p>" } }, "PortfolioDetails": { "base": null, "refs": { "ListAcceptedPortfolioSharesOutput$PortfolioDetails": "<p>Information about the portfolios.</p>", "ListPortfoliosForProductOutput$PortfolioDetails": "<p>Information about the portfolios.</p>", "ListPortfoliosOutput$PortfolioDetails": "<p>Information about the portfolios.</p>" } }, "PortfolioDisplayName": { "base": null, "refs": { "CreatePortfolioInput$DisplayName": "<p>The name to use for display purposes.</p>", "PortfolioDetail$DisplayName": "<p>The name to use for display purposes.</p>", "UpdatePortfolioInput$DisplayName": "<p>The name to use for display purposes.</p>" } }, "PortfolioName": { "base": null, "refs": { "LaunchPathSummary$Name": "<p>The name of the portfolio to which the user was assigned.</p>" } }, "Principal": { "base": "<p>Information about a principal.</p>", "refs": { "Principals$member": null } }, "PrincipalARN": { "base": null, "refs": { "AssociatePrincipalWithPortfolioInput$PrincipalARN": "<p>The ARN of the principal (IAM user, role, or group).</p>", "DisassociatePrincipalFromPortfolioInput$PrincipalARN": "<p>The ARN of the principal (IAM user, role, or group).</p>", "Principal$PrincipalARN": "<p>The ARN of the principal (IAM user, role, or group).</p>" } }, "PrincipalType": { "base": null, "refs": { "AssociatePrincipalWithPortfolioInput$PrincipalType": "<p>The principal type. The supported value is <code>IAM</code>.</p>", "Principal$PrincipalType": "<p>The principal type. The supported value is <code>IAM</code>.</p>" } }, "Principals": { "base": null, "refs": { "ListPrincipalsForPortfolioOutput$Principals": "<p>The IAM principals (users or roles) associated with the portfolio.</p>" } }, "ProductArn": { "base": null, "refs": { "CopyProductInput$SourceProductArn": "<p>The Amazon Resource Name (ARN) of the source product.</p>" } }, "ProductSource": { "base": null, "refs": { "SearchProductsAsAdminInput$ProductSource": "<p>Access level of the source of the product.</p>" } }, "ProductType": { "base": null, "refs": { "CreateProductInput$ProductType": "<p>The type of product.</p>", "ProductViewSummary$Type": "<p>The product type. Contact the product administrator for the significance of this value. If this value is <code>MARKETPLACE</code>, the product was created by AWS Marketplace.</p>" } }, "ProductViewAggregationType": { "base": null, "refs": { "ProductViewAggregations$key": null } }, "ProductViewAggregationValue": { "base": "<p>A single product view aggregation value/count pair, containing metadata about each product to which the calling user has access.</p>", "refs": { "ProductViewAggregationValues$member": null } }, "ProductViewAggregationValues": { "base": null, "refs": { "ProductViewAggregations$value": null } }, "ProductViewAggregations": { "base": null, "refs": { "SearchProductsOutput$ProductViewAggregations": "<p>The product view aggregations.</p>" } }, "ProductViewDetail": { "base": "<p>Information about a product view.</p>", "refs": { "CreateProductOutput$ProductViewDetail": "<p>Information about the product view.</p>", "DescribeProductAsAdminOutput$ProductViewDetail": "<p>Information about the product view.</p>", "ProductViewDetails$member": null, "UpdateProductOutput$ProductViewDetail": "<p>Information about the product view.</p>" } }, "ProductViewDetails": { "base": null, "refs": { "SearchProductsAsAdminOutput$ProductViewDetails": "<p>Information about the product views.</p>" } }, "ProductViewDistributor": { "base": null, "refs": { "ProductViewSummary$Distributor": "<p>The distributor of the product. Contact the product administrator for the significance of this value.</p>" } }, "ProductViewFilterBy": { "base": null, "refs": { "ProductViewFilters$key": null } }, "ProductViewFilterValue": { "base": null, "refs": { "ProductViewFilterValues$member": null } }, "ProductViewFilterValues": { "base": null, "refs": { "ProductViewFilters$value": null } }, "ProductViewFilters": { "base": null, "refs": { "SearchProductsAsAdminInput$Filters": "<p>The search filters. If no search filters are specified, the output includes all products to which the administrator has access.</p>", "SearchProductsInput$Filters": "<p>The search filters. If no search filters are specified, the output includes all products to which the caller has access.</p>" } }, "ProductViewName": { "base": null, "refs": { "CopyProductInput$TargetProductName": "<p>A name for the target product. The default is the name of the source product.</p>", "CreateProductInput$Name": "<p>The name of the product.</p>", "ProductViewSummary$Name": "<p>The name of the product.</p>", "UpdateProductInput$Name": "<p>The updated product name.</p>" } }, "ProductViewOwner": { "base": null, "refs": { "CreateProductInput$Owner": "<p>The owner of the product.</p>", "CreateProductInput$Distributor": "<p>The distributor of the product.</p>", "ProductViewSummary$Owner": "<p>The owner of the product. Contact the product administrator for the significance of this value.</p>", "UpdateProductInput$Owner": "<p>The updated owner of the product.</p>", "UpdateProductInput$Distributor": "<p>The updated distributor of the product.</p>" } }, "ProductViewShortDescription": { "base": null, "refs": { "CreateProductInput$Description": "<p>The description of the product.</p>", "ProductViewSummary$ShortDescription": "<p>Short description of the product.</p>", "UpdateProductInput$Description": "<p>The updated description of the product.</p>" } }, "ProductViewSortBy": { "base": null, "refs": { "SearchProductsAsAdminInput$SortBy": "<p>The sort field. If no value is specified, the results are not sorted.</p>", "SearchProductsInput$SortBy": "<p>The sort field. If no value is specified, the results are not sorted.</p>" } }, "ProductViewSummaries": { "base": null, "refs": { "SearchProductsOutput$ProductViewSummaries": "<p>Information about the product views.</p>" } }, "ProductViewSummary": { "base": "<p>Summary information about a product view.</p>", "refs": { "DescribeProductOutput$ProductViewSummary": "<p>Summary information about the product view.</p>", "DescribeProductViewOutput$ProductViewSummary": "<p>Summary information about the product.</p>", "ProductViewDetail$ProductViewSummary": "<p>Summary information about the product view.</p>", "ProductViewSummaries$member": null } }, "ProviderName": { "base": null, "refs": { "CreatePortfolioInput$ProviderName": "<p>The name of the portfolio provider.</p>", "PortfolioDetail$ProviderName": "<p>The name of the portfolio provider.</p>", "UpdatePortfolioInput$ProviderName": "<p>The updated name of the portfolio provider.</p>" } }, "ProvisionProductInput": { "base": null, "refs": { } }, "ProvisionProductOutput": { "base": null, "refs": { } }, "ProvisionedProductDetail": { "base": "<p>Information about a provisioned product.</p>", "refs": { "DescribeProvisionedProductOutput$ProvisionedProductDetail": "<p>Information about the provisioned product.</p>", "ProvisionedProductDetails$member": null } }, "ProvisionedProductDetails": { "base": null, "refs": { "ScanProvisionedProductsOutput$ProvisionedProducts": "<p>Information about the provisioned products.</p>" } }, "ProvisionedProductId": { "base": null, "refs": { "ProvisionedProductDetail$Id": "<p>The identifier of the provisioned product.</p>" } }, "ProvisionedProductName": { "base": null, "refs": { "ProvisionProductInput$ProvisionedProductName": "<p>A user-friendly name for the provisioned product. This value must be unique for the AWS account and cannot be updated after the product is provisioned.</p>", "RecordDetail$ProvisionedProductName": "<p>The user-friendly name of the provisioned product.</p>" } }, "ProvisionedProductNameOrArn": { "base": null, "refs": { "ProvisionedProductDetail$Name": "<p>The user-friendly name of the provisioned product.</p>", "ProvisionedProductDetail$Arn": "<p>The ARN of the provisioned product.</p>", "TerminateProvisionedProductInput$ProvisionedProductName": "<p>The name of the provisioned product. You cannot specify both <code>ProvisionedProductName</code> and <code>ProvisionedProductId</code>.</p>", "UpdateProvisionedProductInput$ProvisionedProductName": "<p>The updated name of the provisioned product. You cannot specify both <code>ProvisionedProductName</code> and <code>ProvisionedProductId</code>.</p>" } }, "ProvisionedProductStatus": { "base": null, "refs": { "ProvisionedProductDetail$Status": "<p>The current status of the provisioned product.</p> <ul> <li> <p> <code>AVAILABLE</code> - Stable state, ready to perform any operation. The most recent operation succeeded and completed.</p> </li> <li> <p> <code>UNDER_CHANGE</code> - Transitive state, operations performed might not have valid results. Wait for an <code>AVAILABLE</code> status before performing operations.</p> </li> <li> <p> <code>TAINTED</code> - Stable state, ready to perform any operation. The stack has completed the requested operation but is not exactly what was requested. For example, a request to update to a new version failed and the stack rolled back to the current version.</p> </li> <li> <p> <code>ERROR</code> - An unexpected error occurred, the provisioned product exists but the stack is not running. For example, CloudFormation received a parameter value that was not valid and could not launch the stack.</p> </li> </ul>" } }, "ProvisionedProductStatusMessage": { "base": null, "refs": { "ProvisionedProductDetail$StatusMessage": "<p>The current status message of the provisioned product.</p>" } }, "ProvisionedProductType": { "base": null, "refs": { "ProvisionedProductDetail$Type": "<p>The type of provisioned product. The supported value is <code>CFN_STACK</code>.</p>", "RecordDetail$ProvisionedProductType": "<p>The type of provisioned product. The supported value is <code>CFN_STACK</code>.</p>" } }, "ProvisioningArtifact": { "base": "<p>Information about a provisioning artifact. A provisioning artifact is also known as a product version.</p>", "refs": { "ProvisioningArtifacts$member": null } }, "ProvisioningArtifactActive": { "base": null, "refs": { "ProvisioningArtifactDetail$Active": "<p>Indicates whether the product version is active.</p>", "UpdateProvisioningArtifactInput$Active": "<p>Indicates whether the product version is active.</p>" } }, "ProvisioningArtifactCreatedTime": { "base": null, "refs": { "ProvisioningArtifact$CreatedTime": "<p>The UTC timestamp of the creation time.</p>", "ProvisioningArtifactSummary$CreatedTime": "<p>The UTC timestamp of the creation time.</p>" } }, "ProvisioningArtifactDescription": { "base": null, "refs": { "ProvisioningArtifact$Description": "<p>The description of the provisioning artifact.</p>", "ProvisioningArtifactProperties$Description": "<p>The description of the provisioning artifact, including how it differs from the previous provisioning artifact.</p>", "ProvisioningArtifactSummary$Description": "<p>The description of the provisioning artifact.</p>", "UpdateProvisioningArtifactInput$Description": "<p>The updated description of the provisioning artifact.</p>" } }, "ProvisioningArtifactDetail": { "base": "<p>Information about a provisioning artifact (also known as a version) for a product.</p>", "refs": { "CreateProductOutput$ProvisioningArtifactDetail": "<p>Information about the provisioning artifact.</p>", "CreateProvisioningArtifactOutput$ProvisioningArtifactDetail": "<p>Information about the provisioning artifact.</p>", "DescribeProvisioningArtifactOutput$ProvisioningArtifactDetail": "<p>Information about the provisioning artifact.</p>", "ProvisioningArtifactDetails$member": null, "UpdateProvisioningArtifactOutput$ProvisioningArtifactDetail": "<p>Information about the provisioning artifact.</p>" } }, "ProvisioningArtifactDetails": { "base": null, "refs": { "ListProvisioningArtifactsOutput$ProvisioningArtifactDetails": "<p>Information about the provisioning artifacts.</p>" } }, "ProvisioningArtifactInfo": { "base": null, "refs": { "CreateProvisioningArtifactOutput$Info": "<p>The URL of the CloudFormation template in Amazon S3, in JSON format.</p>", "DescribeProvisioningArtifactOutput$Info": "<p>The URL of the CloudFormation template in Amazon S3.</p>", "ProvisioningArtifactProperties$Info": "<p>The URL of the CloudFormation template in Amazon S3. Specify the URL in JSON format as follows:</p> <p> <code>\"LoadTemplateFromURL\": \"https://s3.amazonaws.com/cf-templates-ozkq9d3hgiq2-us-east-1/...\"</code> </p>", "ProvisioningArtifactSummary$ProvisioningArtifactMetadata": "<p>The metadata for the provisioning artifact. This is used with AWS Marketplace products.</p>", "UpdateProvisioningArtifactOutput$Info": "<p>The URL of the CloudFormation template in Amazon S3.</p>" } }, "ProvisioningArtifactInfoKey": { "base": null, "refs": { "ProvisioningArtifactInfo$key": null } }, "ProvisioningArtifactInfoValue": { "base": null, "refs": { "ProvisioningArtifactInfo$value": null } }, "ProvisioningArtifactName": { "base": null, "refs": { "ProvisioningArtifact$Name": "<p>The name of the provisioning artifact.</p>", "ProvisioningArtifactDetail$Name": "<p>The name of the provisioning artifact.</p>", "ProvisioningArtifactDetail$Description": "<p>The description of the provisioning artifact.</p>", "ProvisioningArtifactProperties$Name": "<p>The name of the provisioning artifact (for example, v1 v2beta). No spaces are allowed.</p>", "ProvisioningArtifactSummary$Name": "<p>The name of the provisioning artifact.</p>", "UpdateProvisioningArtifactInput$Name": "<p>The updated name of the provisioning artifact.</p>" } }, "ProvisioningArtifactParameter": { "base": "<p>Information about a parameter used to provision a product.</p>", "refs": { "ProvisioningArtifactParameters$member": null } }, "ProvisioningArtifactParameters": { "base": null, "refs": { "DescribeProvisioningParametersOutput$ProvisioningArtifactParameters": "<p>Information about the parameters used to provision the product.</p>" } }, "ProvisioningArtifactProperties": { "base": "<p>Information about a provisioning artifact (also known as a version) for a product.</p>", "refs": { "CreateProductInput$ProvisioningArtifactParameters": "<p>The configuration of the provisioning artifact.</p>", "CreateProvisioningArtifactInput$Parameters": "<p>The configuration for the provisioning artifact.</p>" } }, "ProvisioningArtifactPropertyName": { "base": null, "refs": { "SourceProvisioningArtifactPropertiesMap$key": null } }, "ProvisioningArtifactPropertyValue": { "base": null, "refs": { "SourceProvisioningArtifactPropertiesMap$value": null } }, "ProvisioningArtifactSummaries": { "base": null, "refs": { "DescribeProductAsAdminOutput$ProvisioningArtifactSummaries": "<p>Information about the provisioning artifacts (also known as versions) for the specified product.</p>" } }, "ProvisioningArtifactSummary": { "base": "<p>Summary information about a provisioning artifact (also known as a version) for a product.</p>", "refs": { "ProvisioningArtifactSummaries$member": null } }, "ProvisioningArtifactType": { "base": null, "refs": { "ProvisioningArtifactDetail$Type": "<p>The type of provisioning artifact.</p> <ul> <li> <p> <code>CLOUD_FORMATION_TEMPLATE</code> - AWS CloudFormation template</p> </li> <li> <p> <code>MARKETPLACE_AMI</code> - AWS Marketplace AMI</p> </li> <li> <p> <code>MARKETPLACE_CAR</code> - AWS Marketplace Clusters and AWS Resources</p> </li> </ul>", "ProvisioningArtifactProperties$Type": "<p>The type of provisioning artifact.</p> <ul> <li> <p> <code>CLOUD_FORMATION_TEMPLATE</code> - AWS CloudFormation template</p> </li> <li> <p> <code>MARKETPLACE_AMI</code> - AWS Marketplace AMI</p> </li> <li> <p> <code>MARKETPLACE_CAR</code> - AWS Marketplace Clusters and AWS Resources</p> </li> </ul>" } }, "ProvisioningArtifacts": { "base": null, "refs": { "DescribeProductOutput$ProvisioningArtifacts": "<p>Information about the provisioning artifacts for the specified product.</p>", "DescribeProductViewOutput$ProvisioningArtifacts": "<p>Information about the provisioning artifacts for the product.</p>" } }, "ProvisioningParameter": { "base": "<p>Information about a parameter used to provision a product.</p>", "refs": { "ProvisioningParameters$member": null } }, "ProvisioningParameters": { "base": null, "refs": { "ProvisionProductInput$ProvisioningParameters": "<p>Parameters specified by the administrator that are required for provisioning the product.</p>" } }, "RecordDetail": { "base": "<p>Information about a request operation.</p>", "refs": { "DescribeRecordOutput$RecordDetail": "<p>Information about the product.</p>", "ProvisionProductOutput$RecordDetail": "<p>Information about the result of <a>ProvisionProduct</a>.</p>", "RecordDetails$member": null, "TerminateProvisionedProductOutput$RecordDetail": "<p>Information about the result of this request.</p>", "UpdateProvisionedProductOutput$RecordDetail": "<p>Information about the result of the request.</p>" } }, "RecordDetails": { "base": null, "refs": { "ListRecordHistoryOutput$RecordDetails": "<p>The records, in reverse chronological order.</p>" } }, "RecordError": { "base": "<p>The error code and description resulting from an operation.</p>", "refs": { "RecordErrors$member": null } }, "RecordErrors": { "base": null, "refs": { "RecordDetail$RecordErrors": "<p>The errors that occurred while processing the request.</p>" } }, "RecordOutput": { "base": "<p>The output for the product created as the result of a request. For example, the output for a CloudFormation-backed product that creates an S3 bucket would include the S3 bucket URL.</p>", "refs": { "RecordOutputs$member": null } }, "RecordOutputs": { "base": null, "refs": { "DescribeRecordOutput$RecordOutputs": "<p>Information about the product created as the result of a request. For example, the output for a CloudFormation-backed product that creates an S3 bucket would include the S3 bucket URL.</p>" } }, "RecordStatus": { "base": null, "refs": { "RecordDetail$Status": "<p>The status of the provisioned product.</p> <ul> <li> <p> <code>CREATED</code> - The request was created but the operation has not started.</p> </li> <li> <p> <code>IN_PROGRESS</code> - The requested operation is in progress.</p> </li> <li> <p> <code>IN_PROGRESS_IN_ERROR</code> - The provisioned product is under change but the requested operation failed and some remediation is occurring. For example, a rollback.</p> </li> <li> <p> <code>SUCCEEDED</code> - The requested operation has successfully completed.</p> </li> <li> <p> <code>FAILED</code> - The requested operation has unsuccessfully completed. Investigate using the error messages returned.</p> </li> </ul>" } }, "RecordTag": { "base": "<p>A tag associated with the record, stored as a key-value pair.</p>", "refs": { "RecordTags$member": null } }, "RecordTagKey": { "base": null, "refs": { "RecordTag$Key": "<p>The key for this tag.</p>" } }, "RecordTagValue": { "base": null, "refs": { "RecordTag$Value": "<p>The value for this tag.</p>" } }, "RecordTags": { "base": null, "refs": { "RecordDetail$RecordTags": "<p>The tags associated with this record.</p>" } }, "RecordType": { "base": null, "refs": { "RecordDetail$RecordType": "<p>The record type for this record.</p> <ul> <li> <p> <code>PROVISION_PRODUCT</code> </p> </li> <li> <p> <code>UPDATE_PROVISIONED_PRODUCT</code> </p> </li> <li> <p> <code>TERMINATE_PROVISIONED_PRODUCT</code> </p> </li> </ul>" } }, "RejectPortfolioShareInput": { "base": null, "refs": { } }, "RejectPortfolioShareOutput": { "base": null, "refs": { } }, "ResourceARN": { "base": null, "refs": { "PortfolioDetail$ARN": "<p>The ARN assigned to the portfolio.</p>", "ProductViewDetail$ProductARN": "<p>The ARN of the product.</p>" } }, "ResourceDetail": { "base": "<p>Information about a resource.</p>", "refs": { "ResourceDetails$member": null } }, "ResourceDetailARN": { "base": null, "refs": { "ResourceDetail$ARN": "<p>The ARN of the resource.</p>" } }, "ResourceDetailCreatedTime": { "base": null, "refs": { "ResourceDetail$CreatedTime": "<p>The creation time of the resource.</p>" } }, "ResourceDetailDescription": { "base": null, "refs": { "ResourceDetail$Description": "<p>The description of the resource.</p>" } }, "ResourceDetailId": { "base": null, "refs": { "ResourceDetail$Id": "<p>The identifier of the resource.</p>" } }, "ResourceDetailName": { "base": null, "refs": { "ResourceDetail$Name": "<p>The name of the resource.</p>" } }, "ResourceDetails": { "base": null, "refs": { "ListResourcesForTagOptionOutput$ResourceDetails": "<p>Information about the resources.</p>" } }, "ResourceId": { "base": null, "refs": { "AssociateTagOptionWithResourceInput$ResourceId": "<p>The resource identifier.</p>", "DisassociateTagOptionFromResourceInput$ResourceId": "<p>The resource identifier.</p>" } }, "ResourceInUseException": { "base": "<p>A resource that is currently in use. Ensure the resource is not in use and retry the operation.</p>", "refs": { } }, "ResourceNotFoundException": { "base": "<p>The specified resource was not found.</p>", "refs": { } }, "ResourceType": { "base": null, "refs": { "ListResourcesForTagOptionInput$ResourceType": "<p>The resource type.</p> <ul> <li> <p> <code>Portfolio</code> </p> </li> <li> <p> <code>Product</code> </p> </li> </ul>" } }, "ScanProvisionedProductsInput": { "base": null, "refs": { } }, "ScanProvisionedProductsOutput": { "base": null, "refs": { } }, "SearchFilterKey": { "base": null, "refs": { "ListRecordHistorySearchFilter$Key": "<p>The filter key.</p> <ul> <li> <p> <code>product</code> - Filter results based on the specified product identifier.</p> </li> <li> <p> <code>provisionedproduct</code> - Filter results based on the provisioned product identifier.</p> </li> </ul>" } }, "SearchFilterValue": { "base": null, "refs": { "ListRecordHistorySearchFilter$Value": "<p>The filter value.</p>" } }, "SearchProductsAsAdminInput": { "base": null, "refs": { } }, "SearchProductsAsAdminOutput": { "base": null, "refs": { } }, "SearchProductsInput": { "base": null, "refs": { } }, "SearchProductsOutput": { "base": null, "refs": { } }, "SortOrder": { "base": null, "refs": { "SearchProductsAsAdminInput$SortOrder": "<p>The sort order. If no value is specified, the results are not sorted.</p>", "SearchProductsInput$SortOrder": "<p>The sort order. If no value is specified, the results are not sorted.</p>" } }, "SourceProvisioningArtifactProperties": { "base": null, "refs": { "CopyProductInput$SourceProvisioningArtifactIdentifiers": "<p>The identifiers of the provisioning artifacts (also known as versions) of the product to copy. By default, all provisioning artifacts are copied.</p>" } }, "SourceProvisioningArtifactPropertiesMap": { "base": null, "refs": { "SourceProvisioningArtifactProperties$member": null } }, "Status": { "base": null, "refs": { "CreateConstraintOutput$Status": "<p>The status of the current request.</p>", "CreateProvisioningArtifactOutput$Status": "<p>The status of the current request.</p>", "DescribeConstraintOutput$Status": "<p>The status of the current request.</p>", "DescribeProvisioningArtifactOutput$Status": "<p>The status of the current request.</p>", "ProductViewDetail$Status": "<p>The status of the product.</p> <ul> <li> <p> <code>AVAILABLE</code> - The product is ready for use.</p> </li> <li> <p> <code>CREATING</code> - Product creation has started; the product is not ready for use.</p> </li> <li> <p> <code>FAILED</code> - An action failed.</p> </li> </ul>", "UpdateConstraintOutput$Status": "<p>The status of the current request.</p>", "UpdateProvisioningArtifactOutput$Status": "<p>The status of the current request.</p>" } }, "StatusDetail": { "base": null, "refs": { "DescribeCopyProductStatusOutput$StatusDetail": "<p>The status message.</p>" } }, "SupportDescription": { "base": null, "refs": { "CreateProductInput$SupportDescription": "<p>The support information about the product.</p>", "ProductViewSummary$SupportDescription": "<p>The description of the support for this Product.</p>", "UpdateProductInput$SupportDescription": "<p>The updated support description for the product.</p>" } }, "SupportEmail": { "base": null, "refs": { "CreateProductInput$SupportEmail": "<p>The contact email for product support.</p>", "ProductViewSummary$SupportEmail": "<p>The email contact information to obtain support for this Product.</p>", "UpdateProductInput$SupportEmail": "<p>The updated support email for the product.</p>" } }, "SupportUrl": { "base": null, "refs": { "CreateProductInput$SupportUrl": "<p>The contact URL for product support.</p>", "ProductViewSummary$SupportUrl": "<p>The URL information to obtain support for this Product.</p>", "UpdateProductInput$SupportUrl": "<p>The updated support URL for the product.</p>" } }, "Tag": { "base": "<p>Information about a tag. A tag is a key-value pair. Tags are entirely discretionary and are propagated to the resources created when provisioning a product.</p>", "refs": { "AddTags$member": null, "Tags$member": null } }, "TagKey": { "base": null, "refs": { "Tag$Key": "<p>The tag key.</p>", "TagKeys$member": null } }, "TagKeys": { "base": null, "refs": { "UpdatePortfolioInput$RemoveTags": "<p>The tags to remove.</p>", "UpdateProductInput$RemoveTags": "<p>The tags to remove from the product.</p>" } }, "TagOptionActive": { "base": null, "refs": { "ListTagOptionsFilters$Active": "<p>The active state.</p>", "TagOptionDetail$Active": "<p>The TagOption active state.</p>", "UpdateTagOptionInput$Active": "<p>The updated active state.</p>" } }, "TagOptionDetail": { "base": "<p>Information about a TagOption.</p>", "refs": { "CreateTagOptionOutput$TagOptionDetail": "<p>Information about the TagOption.</p>", "DescribeTagOptionOutput$TagOptionDetail": "<p>Information about the TagOption.</p>", "TagOptionDetails$member": null, "UpdateTagOptionOutput$TagOptionDetail": "<p>Information about the TagOption.</p>" } }, "TagOptionDetails": { "base": null, "refs": { "DescribePortfolioOutput$TagOptions": "<p>Information about the TagOptions associated with the portfolio.</p>", "DescribeProductAsAdminOutput$TagOptions": "<p>Information about the TagOptions associated with the product.</p>", "ListTagOptionsOutput$TagOptionDetails": "<p>Information about the TagOptions.</p>" } }, "TagOptionId": { "base": null, "refs": { "AssociateTagOptionWithResourceInput$TagOptionId": "<p>The TagOption identifier.</p>", "DescribeTagOptionInput$Id": "<p>The TagOption identifier.</p>", "DisassociateTagOptionFromResourceInput$TagOptionId": "<p>The TagOption identifier.</p>", "ListResourcesForTagOptionInput$TagOptionId": "<p>The TagOption identifier.</p>", "TagOptionDetail$Id": "<p>The TagOption identifier.</p>", "UpdateTagOptionInput$Id": "<p>The TagOption identifier.</p>" } }, "TagOptionKey": { "base": null, "refs": { "CreateTagOptionInput$Key": "<p>The TagOption key.</p>", "ListTagOptionsFilters$Key": "<p>The TagOption key.</p>", "TagOptionDetail$Key": "<p>The TagOption key.</p>", "TagOptionSummary$Key": "<p>The TagOption key.</p>" } }, "TagOptionNotMigratedException": { "base": "<p>An operation requiring TagOptions failed because the TagOptions migration process has not been performed for this account. Please use the AWS console to perform the migration process before retrying the operation.</p>", "refs": { } }, "TagOptionSummaries": { "base": null, "refs": { "DescribeProvisioningParametersOutput$TagOptions": "<p>Information about the TagOptions associated with the resource.</p>" } }, "TagOptionSummary": { "base": "<p>Summary information about a TagOption.</p>", "refs": { "TagOptionSummaries$member": null } }, "TagOptionValue": { "base": null, "refs": { "CreateTagOptionInput$Value": "<p>The TagOption value.</p>", "ListTagOptionsFilters$Value": "<p>The TagOption value.</p>", "TagOptionDetail$Value": "<p>The TagOption value.</p>", "TagOptionValues$member": null, "UpdateTagOptionInput$Value": "<p>The updated value.</p>" } }, "TagOptionValues": { "base": null, "refs": { "TagOptionSummary$Values": "<p>The TagOption value.</p>" } }, "TagValue": { "base": null, "refs": { "Tag$Value": "<p>The value for this key.</p>" } }, "Tags": { "base": null, "refs": { "CreatePortfolioOutput$Tags": "<p>Information about the tags associated with the portfolio.</p>", "CreateProductOutput$Tags": "<p>Information about the tags associated with the product.</p>", "DescribePortfolioOutput$Tags": "<p>Information about the tags associated with the portfolio.</p>", "DescribeProductAsAdminOutput$Tags": "<p>Information about the tags associated with the product.</p>", "LaunchPathSummary$Tags": "<p>The tags associated with this product path.</p>", "ProvisionProductInput$Tags": "<p>The tags to use as provisioning options.</p>", "UpdatePortfolioOutput$Tags": "<p>Information about the tags associated with the portfolio.</p>", "UpdateProductOutput$Tags": "<p>Information about the tags associated with the product.</p>" } }, "TerminateProvisionedProductInput": { "base": null, "refs": { } }, "TerminateProvisionedProductOutput": { "base": null, "refs": { } }, "UpdateConstraintInput": { "base": null, "refs": { } }, "UpdateConstraintOutput": { "base": null, "refs": { } }, "UpdatePortfolioInput": { "base": null, "refs": { } }, "UpdatePortfolioOutput": { "base": null, "refs": { } }, "UpdateProductInput": { "base": null, "refs": { } }, "UpdateProductOutput": { "base": null, "refs": { } }, "UpdateProvisionedProductInput": { "base": null, "refs": { } }, "UpdateProvisionedProductOutput": { "base": null, "refs": { } }, "UpdateProvisioningArtifactInput": { "base": null, "refs": { } }, "UpdateProvisioningArtifactOutput": { "base": null, "refs": { } }, "UpdateProvisioningParameter": { "base": "<p>The parameter key-value pair used to update a provisioned product.</p>", "refs": { "UpdateProvisioningParameters$member": null } }, "UpdateProvisioningParameters": { "base": null, "refs": { "UpdateProvisionedProductInput$ProvisioningParameters": "<p>The new parameters.</p>" } }, "UpdateTagOptionInput": { "base": null, "refs": { } }, "UpdateTagOptionOutput": { "base": null, "refs": { } }, "UpdatedTime": { "base": null, "refs": { "RecordDetail$UpdatedTime": "<p>The time when the record was last updated.</p>" } }, "UsageInstruction": { "base": "<p>Additional information provided by the administrator.</p>", "refs": { "UsageInstructions$member": null } }, "UsageInstructions": { "base": null, "refs": { "DescribeProvisioningParametersOutput$UsageInstructions": "<p>Any additional metadata specifically related to the provisioning of the product. For example, see the <code>Version</code> field of the CloudFormation template.</p>" } }, "UsePreviousValue": { "base": null, "refs": { "UpdateProvisioningParameter$UsePreviousValue": "<p>If set to true, <code>Value</code> is ignored and the previous parameter value is kept.</p>" } }, "Verbose": { "base": null, "refs": { "DescribeProvisioningArtifactInput$Verbose": "<p>Indicates whether a verbose level of detail is enabled.</p>" } } } }
{ "pile_set_name": "Github" }
{ "description": "id provider description", "displayName": "Enonic Id Provider", "idProviderConfig": null, "idProviderMode": null, "key": "enonic", "permissions": [ { "access": "ADMINISTRATOR", "principal": { "description": null, "displayName": "User 1", "key": "user:system:user1", "modifiedTime": "1970-01-01T00:00:00Z" } } ] }
{ "pile_set_name": "Github" }
/* ============================================================================== This file is part of the JUCE library. Copyright (c) 2017 - ROLI Ltd. JUCE is an open source library subject to commercial or open-source licensing. By using JUCE, you agree to the terms of both the JUCE 5 End-User License Agreement and JUCE 5 Privacy Policy (both updated and effective as of the 27th April 2017). End User License Agreement: www.juce.com/juce-5-licence Privacy Policy: www.juce.com/juce-5-privacy-policy Or: You may also use this code under the terms of the GPL v3 (see www.gnu.org/licenses). JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE DISCLAIMED. ============================================================================== */ namespace juce { //============================================================================== /** A MouseListener can be registered with a component to receive callbacks about mouse events that happen to that component. @see Component::addMouseListener, Component::removeMouseListener @tags{GUI} */ class JUCE_API MouseListener { public: /** Destructor. */ virtual ~MouseListener() {} /** Called when the mouse moves inside a component. If the mouse button isn't pressed and the mouse moves over a component, this will be called to let the component react to this. A component will always get a mouseEnter callback before a mouseMove. @param event details about the position and status of the mouse event, including the source component in which it occurred @see mouseEnter, mouseExit, mouseDrag, contains */ virtual void mouseMove (const MouseEvent& event); /** Called when the mouse first enters a component. If the mouse button isn't pressed and the mouse moves into a component, this will be called to let the component react to this. When the mouse button is pressed and held down while being moved in or out of a component, no mouseEnter or mouseExit callbacks are made - only mouseDrag messages are sent to the component that the mouse was originally clicked on, until the button is released. @param event details about the position and status of the mouse event, including the source component in which it occurred @see mouseExit, mouseDrag, mouseMove, contains */ virtual void mouseEnter (const MouseEvent& event); /** Called when the mouse moves out of a component. This will be called when the mouse moves off the edge of this component. If the mouse button was pressed, and it was then dragged off the edge of the component and released, then this callback will happen when the button is released, after the mouseUp callback. @param event details about the position and status of the mouse event, including the source component in which it occurred @see mouseEnter, mouseDrag, mouseMove, contains */ virtual void mouseExit (const MouseEvent& event); /** Called when a mouse button is pressed. The MouseEvent object passed in contains lots of methods for finding out which button was pressed, as well as which modifier keys (e.g. shift, ctrl) were held down at the time. Once a button is held down, the mouseDrag method will be called when the mouse moves, until the button is released. @param event details about the position and status of the mouse event, including the source component in which it occurred @see mouseUp, mouseDrag, mouseDoubleClick, contains */ virtual void mouseDown (const MouseEvent& event); /** Called when the mouse is moved while a button is held down. When a mouse button is pressed inside a component, that component receives mouseDrag callbacks each time the mouse moves, even if the mouse strays outside the component's bounds. @param event details about the position and status of the mouse event, including the source component in which it occurred @see mouseDown, mouseUp, mouseMove, contains, setDragRepeatInterval */ virtual void mouseDrag (const MouseEvent& event); /** Called when a mouse button is released. A mouseUp callback is sent to the component in which a button was pressed even if the mouse is actually over a different component when the button is released. The MouseEvent object passed in contains lots of methods for finding out which buttons were down just before they were released. @param event details about the position and status of the mouse event, including the source component in which it occurred @see mouseDown, mouseDrag, mouseDoubleClick, contains */ virtual void mouseUp (const MouseEvent& event); /** Called when a mouse button has been double-clicked on a component. The MouseEvent object passed in contains lots of methods for finding out which button was pressed, as well as which modifier keys (e.g. shift, ctrl) were held down at the time. @param event details about the position and status of the mouse event, including the source component in which it occurred @see mouseDown, mouseUp */ virtual void mouseDoubleClick (const MouseEvent& event); /** Called when the mouse-wheel is moved. This callback is sent to the component that the mouse is over when the wheel is moved. If not overridden, a component will forward this message to its parent, so that parent components can collect mouse-wheel messages that happen to child components which aren't interested in them. @param event details about the mouse event @param wheel details about the wheel movement */ virtual void mouseWheelMove (const MouseEvent& event, const MouseWheelDetails& wheel); private: #if JUCE_CATCH_DEPRECATED_CODE_MISUSE // This is just here to cause a compile error in old code that hasn't been // updated to use the new version of this method. virtual int mouseWheelMove (const MouseEvent&, float, float) { return 0; } #endif }; } // namespace juce
{ "pile_set_name": "Github" }
{ "copyright": "Damon Oehlman", "url": "https://github.com/DamonOehlman", "email": "[email protected]" }
{ "pile_set_name": "Github" }
# @lion/listbox ## 0.1.1 ### Patch Changes - 27bc8058: Remove usage of public class fields ## 0.1.0 ### Minor Changes - 0ec72ac3: Adds a new listbox package. A listbox widget presents a list of options and allows a user to select one or more of them. ### Patch Changes - Updated dependencies [75107a4b] - Updated dependencies [60d5d1d3] - @lion/[email protected] - @lion/[email protected]
{ "pile_set_name": "Github" }
# Palabras que me crean regomeyo - Backport: No encuentro una traducción adecuada. - Branch/Branching: Lo traduzco como *rama*/*ramificación*, pero pongo entre () el término original. - Checkin: No encuentro una traducción adecuada. - Checkout: No encuentro una traducción adecuada. - Checksum: Lo traduzco como *suma de comprobación* a regañadientes, pongo entre () el término original. - Commit/Committed: Lo traduzco como *confirmar*/*confirmado*, pero pongo entre () el término original. - Diff: Lo traduzco como *diferencia*. - Fork: Lo traduzco como *bifurcación*, pero pongo entre () el término original. - Hook: Lo traduzco como *gancho* a regañadientes, pongo entre () el término original. - Kernel: La traducción habitual es *núcleo*, así que la usaré. - Manpage: Lo traduzco como *página del manual*, pero pongo entre () el término original. - Merge: Lo traduzco como *unión*, pero pongo entre () el término original. - Rebase: No encuentro una traducción adecuada. - Pull: Lo traduzco como *recibir*, pero pongo entre () el término original. No quiero usar *descargar* o *bajar*, porque parece que hace referencia a entornos cliente/servidor. - Push: Lo traduzco como *mandar*, pero pongo entre () el término original. No quiero usar *subir*, porque parece que hace referencia a entornos cliente/servidor. - Remote: Lo traduzco como *repositorio remoto* o *remoto*. - Snapshot: Lo traduzco como *instantánea*. - Stage/Staged: Lo traduzco como *preparar*/*preparado*, pero pongo entre () el término original. - Staging area: Parece ser un término militar. Se refiere a una localización temporal donde se reúnen recursos antes de un ataque o invasión. Lo traduzco como *área de preparación*, pero pongo entre () el término original. - Track/Tracking: Lo traduzco como *seguir*/*seguimiento*. # Anotaciones sobre las anotaciones [afgomez] - No creo que sea necesario poner entre parentesis los términos originales de "rama" y "unión". Es una traduccion lo suficientemente clara como para no necesitarlos. - A lo largo del texto se utilizan guiones '-' para indicar aclaraciones en el texto. En Español el signo correcto es la raya ('—', &mdash; en HTML), y debe ir siempre cerrado, por lo que se han modificado en el texto. Más información: http://es.wikipedia.org/wiki/Raya_%28puntuaci%C3%B3n%29
{ "pile_set_name": "Github" }
/** * Copyright (c) 2016 DeepCortex GmbH <[email protected]> * Authors: * - Paul Asmuth <[email protected]> * - Laura Schlimmer <[email protected]> * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License ("the license") as * published by the Free Software Foundation, either version 3 of the License, * or any later version. * * In accordance with Section 7(e) of the license, the licensing of the Program * under the license does not imply a trademark license. Therefore any rights, * title and interest in our trademarks remain entirely with us. * * 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 license for more details. * * You can be released from the requirements of the license by purchasing a * commercial license. Buying such a license is mandatory as soon as you develop * commercial activities involving this program without disclosing the source * code of your own applications */ #pragma once #include <eventql/util/stdtypes.h> #include <eventql/util/option.h> #include <eventql/sql/svalue.h> #include <eventql/sql/qtree/TableExpressionNode.h> #include <eventql/sql/qtree/ValueExpressionNode.h> #include <eventql/sql/qtree/SelectListNode.h> #include "eventql/eventql.h" namespace csql { class SubqueryNode : public TableExpressionNode { public: SubqueryNode( RefPtr<QueryTreeNode> subquery, Vector<RefPtr<SelectListNode>> select_list, Option<RefPtr<ValueExpressionNode>> where_expr); SubqueryNode(const SubqueryNode& other); RefPtr<QueryTreeNode> subquery() const; Vector<RefPtr<SelectListNode>> selectList() const; Vector<String> getResultColumns() const override; Vector<QualifiedColumn> getAvailableColumns() const override; size_t getComputedColumnIndex( const String& column_name, bool allow_add = false) override; size_t getNumComputedColumns() const override; SType getColumnType(size_t idx) const override; Option<RefPtr<ValueExpressionNode>> whereExpression() const; RefPtr<QueryTreeNode> deepCopy() const override; String toString() const override; const String& tableAlias() const; void setTableAlias(const String& alias); static void encode( QueryTreeCoder* coder, const SubqueryNode& node, OutputStream* os); static RefPtr<QueryTreeNode> decode( QueryTreeCoder* coder, InputStream* is); protected: RefPtr<QueryTreeNode> subquery_; Vector<String> column_names_; Vector<RefPtr<SelectListNode>> select_list_; Option<RefPtr<ValueExpressionNode>> where_expr_; String alias_; }; } // namespace csql
{ "pile_set_name": "Github" }
package create import ( "fmt" "io" "strings" "github.com/spf13/cobra" "k8s.io/kubernetes/pkg/api/meta" cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" "k8s.io/kubernetes/pkg/runtime" "github.com/openshift/origin/pkg/client" "github.com/openshift/origin/pkg/cmd/util/clientcmd" userapi "github.com/openshift/origin/pkg/user/api" ) const ( IdentityRecommendedName = "identity" identityLong = ` This command can be used to create an identity object. Typically, identities are created automatically during login. If automatic creation is disabled (by using the "lookup" mapping method), identities must be created manually. Corresponding user and useridentitymapping objects must also be created to allow logging in with the created identity.` identityExample = ` # Create an identity with identity provider "acme_ldap" and the identity provider username "adamjones" %[1]s acme_ldap:adamjones` ) type CreateIdentityOptions struct { ProviderName string ProviderUserName string IdentityClient client.IdentityInterface Mapper meta.RESTMapper OutputFormat string Out io.Writer Printer ObjectPrinter } // NewCmdCreateIdentity is a macro command to create a new identity func NewCmdCreateIdentity(name, fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command { o := &CreateIdentityOptions{Out: out} cmd := &cobra.Command{ Use: name + " <PROVIDER_NAME>:<PROVIDER_USER_NAME>", Short: "Manually create an identity (only needed if automatic creation is disabled).", Long: identityLong, Example: fmt.Sprintf(identityExample, fullName), Run: func(cmd *cobra.Command, args []string) { cmdutil.CheckErr(o.Complete(cmd, f, args)) cmdutil.CheckErr(o.Validate()) cmdutil.CheckErr(o.Run()) }, } cmdutil.AddPrinterFlags(cmd) return cmd } func (o *CreateIdentityOptions) Complete(cmd *cobra.Command, f *clientcmd.Factory, args []string) error { switch len(args) { case 0: return fmt.Errorf("identity name in the format <PROVIDER_NAME>:<PROVIDER_USER_NAME> is required") case 1: parts := strings.Split(args[0], ":") if len(parts) != 2 { return fmt.Errorf("identity name in the format <PROVIDER_NAME>:<PROVIDER_USER_NAME> is required") } o.ProviderName = parts[0] o.ProviderUserName = parts[1] default: return fmt.Errorf("exactly one argument (username) is supported, not: %v", args) } client, _, err := f.Clients() if err != nil { return err } o.IdentityClient = client.Identities() o.Mapper, _ = f.Object(false) o.OutputFormat = cmdutil.GetFlagString(cmd, "output") o.Printer = func(obj runtime.Object, out io.Writer) error { return f.PrintObject(cmd, o.Mapper, obj, out) } return nil } func (o *CreateIdentityOptions) Validate() error { if len(o.ProviderName) == 0 { return fmt.Errorf("provider name is required") } if len(o.ProviderUserName) == 0 { return fmt.Errorf("provider user name is required") } if o.IdentityClient == nil { return fmt.Errorf("IdentityClient is required") } if o.Mapper == nil { return fmt.Errorf("Mapper is required") } if o.Out == nil { return fmt.Errorf("Out is required") } if o.Printer == nil { return fmt.Errorf("Printer is required") } return nil } func (o *CreateIdentityOptions) Run() error { identity := &userapi.Identity{} identity.ProviderName = o.ProviderName identity.ProviderUserName = o.ProviderUserName actualIdentity, err := o.IdentityClient.Create(identity) if err != nil { return err } if useShortOutput := o.OutputFormat == "name"; useShortOutput || len(o.OutputFormat) == 0 { cmdutil.PrintSuccess(o.Mapper, useShortOutput, o.Out, "identity", actualIdentity.Name, "created") return nil } return o.Printer(actualIdentity, o.Out) }
{ "pile_set_name": "Github" }
1,/DISPATCH2/c\ .TS\ r l l l l l l l l. s/-/\\-/g /DISPATCH3/,$c\ .TE
{ "pile_set_name": "Github" }
/* * qrencode - QR Code encoder * * Masking for Micro QR Code. * Copyright (C) 2006-2011 Kentaro Fukuchi <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if HAVE_CONFIG_H # include "config.h" #endif #include <stdlib.h> #include <string.h> #include <limits.h> #include <errno.h> #include "qrencode.h" #include "mqrspec.h" #include "mmask.h" __STATIC void MMask_writeFormatInformation(int version, int width, unsigned char *frame, int mask, QRecLevel level) { unsigned int format; unsigned char v; int i; format = MQRspec_getFormatInfo(mask, version, level); for(i=0; i<8; i++) { v = 0x84 | (format & 1); frame[width * (i + 1) + 8] = v; format = format >> 1; } for(i=0; i<7; i++) { v = 0x84 | (format & 1); frame[width * 8 + 7 - i] = v; format = format >> 1; } } #define MASKMAKER(__exp__) \ int x, y;\ \ for(y=0; y<width; y++) {\ for(x=0; x<width; x++) {\ if(*s & 0x80) {\ *d = *s;\ } else {\ *d = *s ^ ((__exp__) == 0);\ }\ s++; d++;\ }\ } static void Mask_mask0(int width, const unsigned char *s, unsigned char *d) { MASKMAKER(y&1) } static void Mask_mask1(int width, const unsigned char *s, unsigned char *d) { MASKMAKER(((y/2)+(x/3))&1) } static void Mask_mask2(int width, const unsigned char *s, unsigned char *d) { MASKMAKER((((x*y)&1)+(x*y)%3)&1) } static void Mask_mask3(int width, const unsigned char *s, unsigned char *d) { MASKMAKER((((x+y)&1)+((x*y)%3))&1) } #define maskNum (4) typedef void MaskMaker(int, const unsigned char *, unsigned char *); static MaskMaker *maskMakers[maskNum] = { Mask_mask0, Mask_mask1, Mask_mask2, Mask_mask3 }; #ifdef WITH_TESTS unsigned char *MMask_makeMaskedFrame(int width, unsigned char *frame, int mask) { unsigned char *masked; masked = (unsigned char *)malloc(width * width); if(masked == NULL) return NULL; maskMakers[mask](width, frame, masked); return masked; } #endif unsigned char *MMask_makeMask(int version, unsigned char *frame, int mask, QRecLevel level) { unsigned char *masked; int width; if(mask < 0 || mask >= maskNum) { errno = EINVAL; return NULL; } width = MQRspec_getWidth(version); masked = (unsigned char *)malloc(width * width); if(masked == NULL) return NULL; maskMakers[mask](width, frame, masked); MMask_writeFormatInformation(version, width, masked, mask, level); return masked; } __STATIC int MMask_evaluateSymbol(int width, unsigned char *frame) { int x, y; unsigned char *p; int sum1 = 0, sum2 = 0; p = frame + width * (width - 1); for(x=1; x<width; x++) { sum1 += (p[x] & 1); } p = frame + width * 2 - 1; for(y=1; y<width; y++) { sum2 += (*p & 1); p += width; } return (sum1 <= sum2)?(sum1 * 16 + sum2):(sum2 * 16 + sum1); } unsigned char *MMask_mask(int version, unsigned char *frame, QRecLevel level) { int i; unsigned char *mask, *bestMask; int maxScore = 0; int score; int width; width = MQRspec_getWidth(version); mask = (unsigned char *)malloc(width * width); if(mask == NULL) return NULL; bestMask = NULL; for(i=0; i<maskNum; i++) { score = 0; maskMakers[i](width, frame, mask); MMask_writeFormatInformation(version, width, mask, i, level); score = MMask_evaluateSymbol(width, mask); if(score > maxScore) { maxScore = score; free(bestMask); bestMask = mask; mask = (unsigned char *)malloc(width * width); if(mask == NULL) break; } } free(mask); return bestMask; }
{ "pile_set_name": "Github" }
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = _default; exports.CodeGenerator = void 0; var _sourceMap = _interopRequireDefault(require("./source-map")); var _printer = _interopRequireDefault(require("./printer")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class Generator extends _printer.default { constructor(ast, opts = {}, code) { const format = normalizeOptions(code, opts); const map = opts.sourceMaps ? new _sourceMap.default(opts, code) : null; super(format, map); this.ast = ast; } generate() { return super.generate(this.ast); } } function normalizeOptions(code, opts) { const format = { auxiliaryCommentBefore: opts.auxiliaryCommentBefore, auxiliaryCommentAfter: opts.auxiliaryCommentAfter, shouldPrintComment: opts.shouldPrintComment, retainLines: opts.retainLines, retainFunctionParens: opts.retainFunctionParens, comments: opts.comments == null || opts.comments, compact: opts.compact, minified: opts.minified, concise: opts.concise, jsonCompatibleStrings: opts.jsonCompatibleStrings, indent: { adjustMultilineComment: true, style: " ", base: 0 }, decoratorsBeforeExport: !!opts.decoratorsBeforeExport, jsescOption: Object.assign({ quotes: "double", wrap: true }, opts.jsescOption), recordAndTupleSyntaxType: opts.recordAndTupleSyntaxType }; if (format.minified) { format.compact = true; format.shouldPrintComment = format.shouldPrintComment || (() => format.comments); } else { format.shouldPrintComment = format.shouldPrintComment || (value => format.comments || value.indexOf("@license") >= 0 || value.indexOf("@preserve") >= 0); } if (format.compact === "auto") { format.compact = code.length > 500000; if (format.compact) { console.error("[BABEL] Note: The code generator has deoptimised the styling of " + `${opts.filename} as it exceeds the max of ${"500KB"}.`); } } if (format.compact) { format.indent.adjustMultilineComment = false; } return format; } class CodeGenerator { constructor(ast, opts, code) { this._generator = new Generator(ast, opts, code); } generate() { return this._generator.generate(); } } exports.CodeGenerator = CodeGenerator; function _default(ast, opts, code) { const gen = new Generator(ast, opts, code); return gen.generate(); }
{ "pile_set_name": "Github" }
/* 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 informer-gen. DO NOT EDIT. package v1beta1 import ( time "time" policyv1beta1 "k8s.io/api/policy/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" v1beta1 "k8s.io/client-go/listers/policy/v1beta1" cache "k8s.io/client-go/tools/cache" ) // PodDisruptionBudgetInformer provides access to a shared informer and lister for // PodDisruptionBudgets. type PodDisruptionBudgetInformer interface { Informer() cache.SharedIndexInformer Lister() v1beta1.PodDisruptionBudgetLister } type podDisruptionBudgetInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewPodDisruptionBudgetInformer constructs a new informer for PodDisruptionBudget type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewPodDisruptionBudgetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredPodDisruptionBudgetInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredPodDisruptionBudgetInformer constructs a new informer for PodDisruptionBudget type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredPodDisruptionBudgetInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.PolicyV1beta1().PodDisruptionBudgets(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.PolicyV1beta1().PodDisruptionBudgets(namespace).Watch(options) }, }, &policyv1beta1.PodDisruptionBudget{}, resyncPeriod, indexers, ) } func (f *podDisruptionBudgetInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredPodDisruptionBudgetInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *podDisruptionBudgetInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&policyv1beta1.PodDisruptionBudget{}, f.defaultInformer) } func (f *podDisruptionBudgetInformer) Lister() v1beta1.PodDisruptionBudgetLister { return v1beta1.NewPodDisruptionBudgetLister(f.Informer().GetIndexer()) }
{ "pile_set_name": "Github" }
using System; using UnityEngine; namespace UnityStandardAssets.Utility { public class AutoMoveAndRotate : MonoBehaviour { public Vector3andSpace moveUnitsPerSecond; public Vector3andSpace rotateDegreesPerSecond; public bool ignoreTimescale; private float m_LastRealTime; private void Start() { m_LastRealTime = Time.realtimeSinceStartup; } // Update is called once per frame private void Update() { float deltaTime = Time.deltaTime; if (ignoreTimescale) { deltaTime = (Time.realtimeSinceStartup - m_LastRealTime); m_LastRealTime = Time.realtimeSinceStartup; } transform.Translate(moveUnitsPerSecond.value*deltaTime, moveUnitsPerSecond.space); transform.Rotate(rotateDegreesPerSecond.value*deltaTime, moveUnitsPerSecond.space); } [Serializable] public class Vector3andSpace { public Vector3 value; public Space space = Space.Self; } } }
{ "pile_set_name": "Github" }
/*************************************************************************/ /* managed_callable.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* 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. */ /*************************************************************************/ #ifndef MANAGED_CALLABLE_H #define MANAGED_CALLABLE_H #include <mono/metadata/object.h> #include "core/callable.h" #include "core/os/mutex.h" #include "core/self_list.h" #include "mono_gc_handle.h" #include "mono_gd/gd_mono_method.h" class ManagedCallable : public CallableCustom { friend class CSharpLanguage; MonoGCHandleData delegate_handle; GDMonoMethod *delegate_invoke; #ifdef GD_MONO_HOT_RELOAD SelfList<ManagedCallable> self_instance = this; static SelfList<ManagedCallable>::List instances; static Map<ManagedCallable *, Array> instances_pending_reload; static Mutex instances_mutex; #endif public: uint32_t hash() const override; String get_as_text() const override; CompareEqualFunc get_compare_equal_func() const override; CompareLessFunc get_compare_less_func() const override; ObjectID get_object() const override; void call(const Variant **p_arguments, int p_argcount, Variant &r_return_value, Callable::CallError &r_call_error) const override; _FORCE_INLINE_ MonoDelegate *get_delegate() { return (MonoDelegate *)delegate_handle.get_target(); } void set_delegate(MonoDelegate *p_delegate); static bool compare_equal(const CallableCustom *p_a, const CallableCustom *p_b); static bool compare_less(const CallableCustom *p_a, const CallableCustom *p_b); static constexpr CompareEqualFunc compare_equal_func_ptr = &ManagedCallable::compare_equal; static constexpr CompareEqualFunc compare_less_func_ptr = &ManagedCallable::compare_less; ManagedCallable(MonoDelegate *p_delegate); ~ManagedCallable(); }; #endif // MANAGED_CALLABLE_H
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 2826b03ccaa826a42af0e68bfd49d948 AudioImporter: externalObjects: {} serializedVersion: 6 defaultSettings: loadType: 0 sampleRateSetting: 0 sampleRateOverride: 44100 compressionFormat: 1 quality: 1 conversionMode: 0 platformSettingOverrides: {} forceToMono: 0 normalize: 1 preloadAudioData: 1 loadInBackground: 0 ambisonic: 0 3D: 1 userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
# AWS::AutoScalingPlans::ScalingPlan PredefinedScalingMetricSpecification<a name="aws-properties-autoscalingplans-scalingplan-predefinedscalingmetricspecification"></a> `PredefinedScalingMetricSpecification` is a subproperty of [TargetTrackingConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscalingplans-scalingplan-targettrackingconfiguration.html) that specifies a customized scaling metric for a target tracking configuration to use with AWS Auto Scaling\. ## Syntax<a name="aws-properties-autoscalingplans-scalingplan-predefinedscalingmetricspecification-syntax"></a> To declare this entity in your AWS CloudFormation template, use the following syntax: ### JSON<a name="aws-properties-autoscalingplans-scalingplan-predefinedscalingmetricspecification-syntax.json"></a> ``` { "[PredefinedScalingMetricType](#cfn-autoscalingplans-scalingplan-predefinedscalingmetricspecification-predefinedscalingmetrictype)" : String, "[ResourceLabel](#cfn-autoscalingplans-scalingplan-predefinedscalingmetricspecification-resourcelabel)" : String } ``` ### YAML<a name="aws-properties-autoscalingplans-scalingplan-predefinedscalingmetricspecification-syntax.yaml"></a> ``` [PredefinedScalingMetricType](#cfn-autoscalingplans-scalingplan-predefinedscalingmetricspecification-predefinedscalingmetrictype): String [ResourceLabel](#cfn-autoscalingplans-scalingplan-predefinedscalingmetricspecification-resourcelabel): String ``` ## Properties<a name="aws-properties-autoscalingplans-scalingplan-predefinedscalingmetricspecification-properties"></a> `PredefinedScalingMetricType` <a name="cfn-autoscalingplans-scalingplan-predefinedscalingmetricspecification-predefinedscalingmetrictype"></a> The metric type\. The `ALBRequestCountPerTarget` metric type applies only to Auto Scaling groups, Spot Fleet requests, and ECS services\. *Required*: Yes *Type*: String *Allowed values*: `ALBRequestCountPerTarget | ASGAverageCPUUtilization | ASGAverageNetworkIn | ASGAverageNetworkOut | DynamoDBReadCapacityUtilization | DynamoDBWriteCapacityUtilization | EC2SpotFleetRequestAverageCPUUtilization | EC2SpotFleetRequestAverageNetworkIn | EC2SpotFleetRequestAverageNetworkOut | ECSServiceAverageCPUUtilization | ECSServiceAverageMemoryUtilization | RDSReaderAverageCPUUtilization | RDSReaderAverageDatabaseConnections` *Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt) `ResourceLabel` <a name="cfn-autoscalingplans-scalingplan-predefinedscalingmetricspecification-resourcelabel"></a> Identifies the resource associated with the metric type\. You can't specify a resource label unless the metric type is `ALBRequestCountPerTarget` and there is a target group for an Application Load Balancer attached to the Auto Scaling group, Spot Fleet request, or ECS service\. Elastic Load Balancing sends data about your load balancers to Amazon CloudWatch\. CloudWatch collects the data and specifies the format to use to access the data\. The format is app/<load\-balancer\-name>/<load\-balancer\-id>/targetgroup/<target\-group\-name>/<target\-group\-id>, where: + app/<load\-balancer\-name>/<load\-balancer\-id> is the final portion of the load balancer ARN\. + targetgroup/<target\-group\-name>/<target\-group\-id> is the final portion of the target group ARN\. To find the ARN for an Application Load Balancer, use the [DescribeLoadBalancers](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html) API operation\. To find the ARN for the target group, use the [DescribeTargetGroups](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html) API operation\. *Required*: Conditional *Type*: String *Minimum*: `1` *Maximum*: `1023` *Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt) ## See also<a name="aws-properties-autoscalingplans-scalingplan-predefinedscalingmetricspecification--seealso"></a> + [AWS Auto Scaling User Guide](https://docs.aws.amazon.com/autoscaling/plans/userguide/what-is-aws-auto-scaling.html)
{ "pile_set_name": "Github" }
CREATE PROCEDURE [dbo].[BugNet_Permission_GetPermissionsByRole] @RoleId int AS SELECT BugNet_Permissions.PermissionId, PermissionKey, PermissionName FROM BugNet_Permissions INNER JOIN BugNet_RolePermissions on BugNet_RolePermissions.PermissionId = BugNet_Permissions.PermissionId WHERE RoleId = @RoleId
{ "pile_set_name": "Github" }
<div class="usajobs-grid-full usajobs-open-opps-opportunity-item__header"> <h2 class="usajobs-form__title">Step 3 - Review draft and submit</h2> <div class="usajobs-width-two-thirds"> <h1 class="usajobs-open-opps-opportunity-item__title"><%- data.title %></h1> <div class="usajobs-open-opps-opportunity__desc"> <div class="skills"> <div>Desired skills:</div> <% _.each(madlibTags['skill'], function (t) { %> <a class="skill-label" href="/tasks?search=<%= t.name %>"><%= t.name %></a> <% }) %> </div> </div> </div> <div class="usajobs-width-one-third"> <div class="usajobs-open-opps-opportunity-requestor__wrapper"> <div class="usajobs-open-opps-opportunity-requestor"> <div class="usajobs-open-opps-opportunity-requestor__figure-body"> <div class="usajobs-open-opps-opportunity-requestor__figure dos"> </div> <div class="usajobs-open-opps-opportunity-requestor__body"> <p class="usajobs-open-opps-opportunity-requestor__name dos"> U.S. Department of State </p> </div> </div> </div> </div> </div> </div> <div class="usajobs-grid-full preview"> <div class="usa-width-one-third personnel-needed mobile"> <div class="usajobs-opop__task-intro"> <h4>Bureau</h4> <div><%- data.bureauName %></div> <% if (data.officeName) { %> <h4>Office/post</h4> <div><%- data.officeName %></div> <% } %> <h4>Location</h4> <div> <% if (data.countrySubdivision) { %> <%= (data.cityName) ? data.cityName + ', ' + data.countrySubdivision : 'Virtual' %> <% } else { %> <%= (data.cityName) ? data.cityName : 'Virtual' %> <% } %> </div> <% if (data.country) { %> <h4>Country</h4> <div><%- data.country %></div> <% } %> <h4>Time Commitment</h4> <div><%-moment(data.cycleStartDate).format('MMMM YYYY')%> - <%-moment(data.cycleEndDate).format('MMMM YYYY')%></div> <div>32-40 hrs per week</div> <h4>Number of Interns</h4> <div><%- data.interns %></div> <h4>Required security level</h4> <div> <% if (data.suggestedSecurityClearance == 'None') { %> None (Low Risk Public Trust Certificate) <% } else { %> <%- data.suggestedSecurityClearance %> <% } %> </div> </div> </div> <div class="usa-width-two-thirds opportunity-description"> <div class="usajobs-open-opps-opportunity__desc"> <h3>Who we are</h3> <div><%= data.aboutHtml %></div> </div> <div class="usajobs-open-opps-opportunity__desc"> <h3>What you'll do</h3> <div><%= data.detailsHtml %></div> </div> <% if (data.language.length > 0) { %> <div class="usajobs-open-opps-opportunity__desc"> <h3>Foreign language</h3> <p class="usajobs-form__help-brief">The following language(s) may be helpful in the internship.</p> <% _.each(data.language, function (l,index) { %> <div class="usajobs-grid-full"> <h4><%- l.selectLanguage %></h4> <div class="usajobs-width-one-half"> <ul class="languages-drawer-content__list"> <li class="languages-drawer-content__item"> <h5 class="languages-drawer-content__item-label">Speaking language skill level</h5> <p><%- l.spokenSkillLevel %></p> </li> <li class="languages-drawer-content__item"> <h5 class="languages-drawer-content__item-label">Reading language skill level</h5> <p><%- l.readSkillLevel %></p> </li> </ul> </div> <div class="usajobs-width-one-half"> <ul class="languages-drawer-content__list"> <li class="languages-drawer-content__item"> <h5 class="languages-drawer-content__item-label">Writing language skill level</h5> <p><%- l.writtenSkillLevel %></p> </li> </ul> </div> </div> <% }); %> </div> <% } %> </div> <div class="usa-width-one-third personnel-needed desktop"> <div class="usajobs-opop__task-intro"> <h4>Bureau</h4> <div><%- data.bureauName %></div> <% if (data.officeName) { %> <h4>Office/post</h4> <div><%- data.officeName %></div> <% } %> <h4>Location</h4> <div> <% if (data.countrySubdivision) { %> <%= (data.cityName) ? data.cityName + ', ' + data.countrySubdivision : 'Virtual' %> <% } else { %> <%= (data.cityName) ? data.cityName : 'Virtual' %> <% } %> </div> <% if (data.country) { %> <h4>Country</h4> <div><%- data.country %></div> <% } %> <h4>Time Commitment</h4> <div><%- moment(data.cycleStartDate).format('MMMM YYYY')%> - <%-moment(data.cycleEndDate).format('MMMM YYYY')%></div> <div>32-40 hrs per week</div> <h4>Number of Interns</h4> <div><%- data.interns %></div> <h4>Required security level</h4> <div> <% if (data.suggestedSecurityClearance == 'None') { %> None (Low Risk Public Trust Certificate) <% } else { %> <%- data.suggestedSecurityClearance %> <% } %> </div> </div> </div> </div> </div> <div class="usajobs-button_bar--slim task-footer"> <div class="usajobs-button_bar__body"> <button class="usa-button usa-button-secondary usa-button-left internship-button" data-state="edit" id="edit">Make changes</button> <% if (data.state === 'draft' || data.state === 'canceled') { %> <button class="usa-button usa-button-secondary internship-button" data-state="draft">Save for later</button> <% } %> <% if (_.contains(['draft', 'canceled', 'submitted'], data.state)) { %> <button class="usa-button usa-button-primary internship-button" data-state="submit" id="submit">Submit</button> <% } else { %> <button class="usa-button usa-button-primary internship-button" data-state="save" id="save">Save</button> <% } %> </div> </div>
{ "pile_set_name": "Github" }
/* Copyright 2011 David Malcolm <[email protected]> Copyright 2011 Red Hat, Inc. This 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 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, see <http://www.gnu.org/licenses/>. */ #include <Python.h> /* Test of correct usage of PyErr_SetString */ PyObject * test(PyObject *self, PyObject *args) { PyErr_SetString(PyExc_RuntimeError, "This test method always fails"); return NULL; } static PyMethodDef test_methods[] = { {"test_method", test, METH_VARARGS, NULL}, {NULL, NULL, 0, NULL} /* Sentinel */ }; /* PEP-7 Local variables: c-basic-offset: 4 indent-tabs-mode: nil End: */
{ "pile_set_name": "Github" }
import { <%= classify(name) %>Middleware } from './<%= name %>.middleware'; describe('<%= classify(name) %>Middleware', () => { it('should be defined', () => { expect(new <%= classify(name) %>Middleware()).toBeDefined(); }); });
{ "pile_set_name": "Github" }
/* * 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. */ package org.apache.druid.indexing.overlord.supervisor; import com.google.common.collect.ImmutableMap; import org.apache.druid.indexing.overlord.DataSourceMetadata; import javax.annotation.Nullable; import java.util.Map; public interface Supervisor { void start(); /** * @param stopGracefully If true, supervisor will cleanly shutdown managed tasks if possible (for example signalling * them to publish their segments and exit). The implementation may block until the tasks have * either acknowledged or completed. If false, supervisor will stop immediately and leave any * running tasks as they are. */ void stop(boolean stopGracefully); SupervisorReport getStatus(); SupervisorStateManager.State getState(); default Map<String, Map<String, Object>> getStats() { return ImmutableMap.of(); } @Nullable default Boolean isHealthy() { return null; // default implementation for interface compatability; returning null since true or false is misleading } void reset(DataSourceMetadata dataSourceMetadata); /** * The definition of checkpoint is not very strict as currently it does not affect data or control path. * On this call Supervisor can potentially checkpoint data processed so far to some durable storage * for example - Kafka/Kinesis Supervisor uses this to merge and handoff segments containing at least the data * represented by {@param currentCheckpoint} DataSourceMetadata * * @param taskGroupId unique Identifier to figure out for which sequence to do checkpointing * @param checkpointMetadata metadata for the sequence to currently checkpoint */ void checkpoint(int taskGroupId, DataSourceMetadata checkpointMetadata); }
{ "pile_set_name": "Github" }
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _pure = require('recompose/pure'); var _pure2 = _interopRequireDefault(_pure); var _SvgIcon = require('material-ui/SvgIcon'); var _SvgIcon2 = _interopRequireDefault(_SvgIcon); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var SvgIconCustom = global.__MUI_SvgIcon__ || _SvgIcon2.default; var _ref = _react2.default.createElement('path', { d: 'M8 5v14l11-7z' }); var PlayArrow = function PlayArrow(props) { return _react2.default.createElement( SvgIconCustom, props, _ref ); }; PlayArrow = (0, _pure2.default)(PlayArrow); PlayArrow.muiName = 'SvgIcon'; exports.default = PlayArrow;
{ "pile_set_name": "Github" }
/* * Copyright (c) 2008, SQL Power Group Inc. * * This file is part of Power*Architect. * * Power*Architect 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 of the License, or * (at your option) any later version. * * Power*Architect 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, see <http://www.gnu.org/licenses/>. */ package ca.sqlpower.architect.swingui; import java.awt.Window; import java.awt.datatransfer.Transferable; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.prefs.Preferences; import ca.sqlpower.architect.ArchitectSession; import ca.sqlpower.architect.CoreUserSettings; import ca.sqlpower.enterprise.client.SPServerInfoManager; import ca.sqlpower.sql.DataSourceCollection; import ca.sqlpower.sql.JDBCDataSource; import ca.sqlpower.sql.PlDotIni; import ca.sqlpower.sql.SpecificDataSourceCollection; import ca.sqlpower.sqlobject.SQLObjectException; import ca.sqlpower.sqlobject.SQLObjectRuntimeException; import ca.sqlpower.swingui.RecentMenu; /** * Minimally functional session context implementation that creates and returns an instance of * StubArchitectSwingSession on the createSession method calls */ public class TestingArchitectSwingSessionContext implements ArchitectSwingSessionContext { private Preferences prefs; private CoreUserSettings userSettings; private RecentMenu recent; private final List<ArchitectSession> sessions = new ArrayList<ArchitectSession>(); /** * The parsed list of connections. */ private DataSourceCollection<JDBCDataSource> plDotIni; /** * The location of the PL.INI file. */ private String plDotIniPath; private static final boolean MAC_OS_X = (System.getProperty("os.name").toLowerCase().startsWith("mac os x")); public TestingArchitectSwingSessionContext() throws IOException { prefs = Preferences.userNodeForPackage(ArchitectSwingSessionContextImpl.class); userSettings = new CoreUserSettings(prefs); recent = new RecentMenu(this.getClass()) { @Override public void loadFile(String fileName) throws IOException { } }; File newPlIniFile = File.createTempFile("pl_test", "ini"); newPlIniFile.deleteOnExit(); setPlDotIniPath(newPlIniFile.getPath()); } public ArchitectSwingSession createSession() throws SQLObjectException { ArchitectSwingSession session = new TestingArchitectSwingSession(this); sessions.add(session); return session; } public ArchitectSwingSession createSession(InputStream in) throws SQLObjectException, IOException { return this.createSession(); } public Collection<ArchitectSession> getSessions() { return sessions; } public Preferences getPrefs() { return prefs; } public RecentMenu getRecentMenu() { return recent; } public CoreUserSettings getUserSettings() { return userSettings; } public boolean isMacOSX() { return MAC_OS_X; } public ArchitectSwingSession createSession(InputStream in, boolean showGUI) throws SQLObjectException, FileNotFoundException, IOException { return null; } /** * Doesn't actually do anything! */ public void closeAll() { // no op } /** * Always returns false. */ public boolean getExitAfterAllSessionsClosed() { return false; } /** * Doesn't actually do anything! */ public void setExitAfterAllSessionsClosed(boolean allowExit) { // no op } /** * Doesn't actually do anything! */ public void showConnectionManager(Window owner) { // no op } /** * Doesn't actually do anything! */ public void showPreferenceDialog(Window owner) { // no op } public List<JDBCDataSource> getConnections() { return getPlDotIni().getConnections(); } public DataSourceCollection<JDBCDataSource> getPlDotIni() { String path = getPlDotIniPath(); if (path == null) return null; if (plDotIni == null) { PlDotIni newPlDotIni = new PlDotIni(); try { newPlDotIni.read(getClass().getClassLoader().getResourceAsStream("ca/sqlpower/sql/default_database_types.ini")); } catch (IOException e) { throw new SQLObjectRuntimeException(new SQLObjectException("Failed to read system resource default_database_types.ini",e)); } try { if (newPlDotIni != null) { newPlDotIni.read(new File(path)); } } catch (IOException e) { throw new SQLObjectRuntimeException(new SQLObjectException("Failed to read pl.ini at \""+getPlDotIniPath()+"\"", e)); } plDotIni = new SpecificDataSourceCollection<JDBCDataSource>(newPlDotIni, JDBCDataSource.class); } return plDotIni; } public String getPlDotIniPath() { return plDotIniPath; } public void setPlDotIniPath(String plDotIniPath) { if (this.plDotIniPath != null && this.plDotIniPath.equals(plDotIniPath)) { return; } this.plDotIniPath = plDotIniPath; this.plDotIni = null; } public Transferable getClipboardContents() { throw new IllegalStateException("Getting clipboard contents not currently implemented."); } public void setClipboardContents(Transferable t) { throw new IllegalStateException("Setting clipboard contents not currently implemented."); } public SPServerInfoManager getServerManager() { // TODO Auto-generated method stub return null; } public void registerFrame(ArchitectFrame frame) { // TODO Auto-generated method stub } }
{ "pile_set_name": "Github" }
require 'xsd/qname' module WSDL; module Anonymous # {urn:lp}Header # header3 - SOAP::SOAPString class Header attr_accessor :header3 def initialize(header3 = nil) @header3 = header3 end end # {urn:lp}ExtraInfo class ExtraInfo < ::Array # {}Entry # key - SOAP::SOAPString # value - SOAP::SOAPString class Entry attr_accessor :key attr_accessor :value def initialize(key = nil, value = nil) @key = key @value = value end end end # {urn:lp}loginResponse # loginResult - WSDL::Anonymous::LoginResponse::LoginResult class LoginResponse # inner class for member: loginResult # {}loginResult # sessionID - SOAP::SOAPString class LoginResult attr_accessor :sessionID def initialize(sessionID = nil) @sessionID = sessionID end end attr_accessor :loginResult def initialize(loginResult = nil) @loginResult = loginResult end end # {urn:lp}Pack # header - WSDL::Anonymous::Pack::Header class Pack # inner class for member: Header # {}Header # header1 - SOAP::SOAPString class Header attr_accessor :header1 def initialize(header1 = nil) @header1 = header1 end end attr_accessor :header def initialize(header = nil) @header = header end end # {urn:lp}Envelope # header - WSDL::Anonymous::Envelope::Header class Envelope # inner class for member: Header # {}Header # header2 - SOAP::SOAPString class Header attr_accessor :header2 def initialize(header2 = nil) @header2 = header2 end end attr_accessor :header def initialize(header = nil) @header = header end end # {urn:lp}login # loginRequest - WSDL::Anonymous::Login::LoginRequest class Login # inner class for member: loginRequest # {}loginRequest # username - SOAP::SOAPString # password - SOAP::SOAPString # timezone - SOAP::SOAPString class LoginRequest attr_accessor :username attr_accessor :password attr_accessor :timezone def initialize(username = nil, password = nil, timezone = nil) @username = username @password = password @timezone = timezone end end attr_accessor :loginRequest def initialize(loginRequest = nil) @loginRequest = loginRequest end end end; end
{ "pile_set_name": "Github" }
/* Name: 3024 day Author: Jan T. Sott (http://github.com/idleberg) CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */ .cm-s-3024-day.CodeMirror { background: #f7f7f7; color: #3a3432; } .cm-s-3024-day div.CodeMirror-selected { background: #d6d5d4; } .cm-s-3024-day .CodeMirror-line::selection, .cm-s-3024-day .CodeMirror-line > span::selection, .cm-s-3024-day .CodeMirror-line > span > span::selection { background: #d6d5d4; } .cm-s-3024-day .CodeMirror-line::-moz-selection, .cm-s-3024-day .CodeMirror-line > span::-moz-selection, .cm-s-3024-day .CodeMirror-line > span > span::selection { background: #d9d9d9; } .cm-s-3024-day .CodeMirror-gutters { background: #f7f7f7; border-right: 0px; } .cm-s-3024-day .CodeMirror-guttermarker { color: #db2d20; } .cm-s-3024-day .CodeMirror-guttermarker-subtle { color: #807d7c; } .cm-s-3024-day .CodeMirror-linenumber { color: #807d7c; } .cm-s-3024-day .CodeMirror-cursor { border-left: 1px solid #5c5855; } .cm-s-3024-day span.cm-comment { color: #cdab53; } .cm-s-3024-day span.cm-atom { color: #a16a94; } .cm-s-3024-day span.cm-number { color: #a16a94; } .cm-s-3024-day span.cm-property, .cm-s-3024-day span.cm-attribute { color: #01a252; } .cm-s-3024-day span.cm-keyword { color: #db2d20; } .cm-s-3024-day span.cm-string { color: #fded02; } .cm-s-3024-day span.cm-variable { color: #01a252; } .cm-s-3024-day span.cm-variable-2 { color: #01a0e4; } .cm-s-3024-day span.cm-def { color: #e8bbd0; } .cm-s-3024-day span.cm-bracket { color: #3a3432; } .cm-s-3024-day span.cm-tag { color: #db2d20; } .cm-s-3024-day span.cm-link { color: #a16a94; } .cm-s-3024-day span.cm-error { background: #db2d20; color: #5c5855; } .cm-s-3024-day .CodeMirror-activeline-background { background: #e8f2ff; } .cm-s-3024-day .CodeMirror-matchingbracket { text-decoration: underline; color: #a16a94 !important; }
{ "pile_set_name": "Github" }
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateRelationshipsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('relationships', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('post_id'); $table->unsignedBigInteger('another'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('relationships'); } }
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 48881cb6a8fc44bba97eb256edc502c8 timeCreated: 1565857492
{ "pile_set_name": "Github" }
{% if error_warning %} <div class="alert alert-warning alert-dismissible"><i class="fas fa-exclamation-circle"></i> {{ error_warning }}</div> {% endif %} {% if payment_methods %} <p>{{ text_payment_method }}</p> {% for payment_method in payment_methods %} <div class="form-check"> <label> {% if payment_method.code == code or not code %} {% set code = payment_method.code %} <input type="radio" name="payment_method" value="{{ payment_method.code }}" class="form-check-input" checked="checked"/> {% else %} <input type="radio" name="payment_method" value="{{ payment_method.code }}" class="form-check-input"/> {% endif %} {{ payment_method.title }} {% if payment_method.terms %} ({{ payment_method.terms }}) {% endif %} </label> </div> {% endfor %} {% endif %} <br/> <p><strong>{{ text_comments }}</strong></p> <p> <textarea name="comment" rows="8" class="form-control">{{ comment }}</textarea> </p> {% if text_agree %} <div class="d-inline-block pt-2 pd-2 w-100"> <div class="float-right">{{ text_agree }} {% if agree %} <input type="checkbox" name="agree" value="1" checked="checked"/> {% else %} <input type="checkbox" name="agree" value="1"/> {% endif %} &nbsp; <button type="button" id="button-payment-method" data-loading-text="{{ text_loading }}" class="btn btn-primary">{{ button_continue }}</button> </div> </div> {% else %} <div class="d-inline-block pt-2 pd-2 w-100"> <div class="float-right"> <button type="button" id="button-payment-method" data-loading-text="{{ text_loading }}" class="btn btn-primary">{{ button_continue }}</button> </div> </div> {% endif %} <script type="text/javascript"><!-- // Payment Method $('#button-payment-method').on('click', function() { chain.attach(function() { return $.ajax({ url: 'index.php?route=checkout/payment_method/save', type: 'post', data: $('#collapse-payment-method input[type=\'radio\']:checked, #collapse-payment-method input[type=\'checkbox\']:checked, #collapse-payment-method textarea'), dataType: 'json', beforeSend: function() { $('#button-payment-method').button('loading'); }, success: function(json) { $('.alert-dismissible, .text-danger').remove(); if (json['redirect']) { location = json['redirect']; } else if (json['error']) { $('#button-payment-method').button('reset'); if (json['error']['warning']) { $('#collapse-payment-method .card-body').prepend('<div class="alert alert-danger alert-dismissible"><i class="fas fa-exclamation-circle"></i> ' + json['error']['warning'] + '<button type="button" class="close" data-dismiss="alert">&times;</button></div>'); } } else { chain.attach(function() { return $.ajax({ url: 'index.php?route=checkout/confirm', dataType: 'html', complete: function() { $('#button-payment-method').button('reset'); }, success: function(html) { $('#collapse-checkout-confirm .card-body').html(html); $('#heading-checkout-confirm').attr('data-toggle', 'collapse'); $('#heading-checkout-confirm').trigger('click'); }, error: function(xhr, ajaxOptions, thrownError) { alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); } }); }); } }, error: function(xhr, ajaxOptions, thrownError) { alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); } }); }); }); //--></script>
{ "pile_set_name": "Github" }
import { expect } from '@open-wc/testing'; import { getWeekdayNames } from '../../src/date/getWeekdayNames.js'; /** * @param {TemplateStringsArray} strings */ function s(strings) { return strings[0].split(' '); } describe('getWeekdayNames', () => { it('generates weekday names for a given locale with defaults (from Sunday, long style)', () => { expect(getWeekdayNames({ locale: 'en-GB' })).to.deep.equal( s`Sunday Monday Tuesday Wednesday Thursday Friday Saturday`, ); expect(getWeekdayNames({ locale: 'nl-NL' })).to.deep.equal( s`zondag maandag dinsdag woensdag donderdag vrijdag zaterdag`, ); expect(getWeekdayNames({ locale: 'zh-CH' })).to.deep.equal( s`星期日 星期一 星期二 星期三 星期四 星期五 星期六`, ); }); it('allows to specify a day when a week starts', () => { expect(getWeekdayNames({ locale: 'en-GB', firstDayOfWeek: 7 })).to.deep.equal( s`Sunday Monday Tuesday Wednesday Thursday Friday Saturday`, ); expect(getWeekdayNames({ locale: 'en-GB', firstDayOfWeek: 1 })).to.deep.equal( s`Monday Tuesday Wednesday Thursday Friday Saturday Sunday`, ); expect(getWeekdayNames({ locale: 'en-GB', firstDayOfWeek: 2 })).to.deep.equal( s`Tuesday Wednesday Thursday Friday Saturday Sunday Monday`, ); expect(getWeekdayNames({ locale: 'en-GB', firstDayOfWeek: 3 })).to.deep.equal( s`Wednesday Thursday Friday Saturday Sunday Monday Tuesday`, ); expect(getWeekdayNames({ locale: 'en-GB', firstDayOfWeek: 4 })).to.deep.equal( s`Thursday Friday Saturday Sunday Monday Tuesday Wednesday`, ); expect(getWeekdayNames({ locale: 'en-GB', firstDayOfWeek: 5 })).to.deep.equal( s`Friday Saturday Sunday Monday Tuesday Wednesday Thursday`, ); expect(getWeekdayNames({ locale: 'en-GB', firstDayOfWeek: 6 })).to.deep.equal( s`Saturday Sunday Monday Tuesday Wednesday Thursday Friday`, ); }); it('supports "short" style', () => { expect(getWeekdayNames({ locale: 'en-GB', style: 'short' })).to.deep.equal( s`Sun Mon Tue Wed Thu Fri Sat`, ); expect(getWeekdayNames({ locale: 'nl-NL', style: 'short' })).to.deep.equal( s`zo ma di wo do vr za`, ); expect(getWeekdayNames({ locale: 'zh-CH', style: 'short' })).to.deep.equal( s`周日 周一 周二 周三 周四 周五 周六`, ); }); it('supports "narrow" style', () => { expect(getWeekdayNames({ locale: 'en-GB', style: 'narrow' })).to.deep.equal(s`S M T W T F S`); expect(getWeekdayNames({ locale: 'nl-NL', style: 'narrow' })).to.deep.equal(s`Z M D W D V Z`); expect(getWeekdayNames({ locale: 'zh-CH', style: 'narrow' })).to.deep.equal( s`日 一 二 三 四 五 六`, ); }); });
{ "pile_set_name": "Github" }
#!/bin/bash curl -f -u$BINTRAY_USERNAME:$BINTRAY_API_KEY -X GET \ https://api.bintray.com/repos/docker-compose/${CIRCLE_BRANCH} if test $? -ne 0; then echo "Bintray repository ${CIRCLE_BRANCH} does not exist ; abandoning upload attempt" exit 0 fi curl -u$BINTRAY_USERNAME:$BINTRAY_API_KEY -X POST \ -d "{\ \"name\": \"${PKG_NAME}\", \"desc\": \"auto\", \"licenses\": [\"Apache-2.0\"], \ \"vcs_url\": \"${CIRCLE_REPOSITORY_URL}\" \ }" -H "Content-Type: application/json" \ https://api.bintray.com/packages/docker-compose/${CIRCLE_BRANCH} curl -u$BINTRAY_USERNAME:$BINTRAY_API_KEY -X POST -d "{\ \"name\": \"$CIRCLE_BRANCH\", \ \"desc\": \"Automated build of the ${CIRCLE_BRANCH} branch.\", \ }" -H "Content-Type: application/json" \ https://api.bintray.com/packages/docker-compose/${CIRCLE_BRANCH}/${PKG_NAME}/versions curl -f -T dist/docker-compose-${OS_NAME}-x86_64 -u$BINTRAY_USERNAME:$BINTRAY_API_KEY \ -H "X-Bintray-Package: ${PKG_NAME}" -H "X-Bintray-Version: $CIRCLE_BRANCH" \ -H "X-Bintray-Override: 1" -H "X-Bintray-Publish: 1" -X PUT \ https://api.bintray.com/content/docker-compose/${CIRCLE_BRANCH}/docker-compose-${OS_NAME}-x86_64 || exit 1 # Upload folder format of docker-compose for macOS in addition to binary. if [ "${OS_NAME}" == "Darwin" ]; then curl -f -T dist/docker-compose-${OS_NAME}-x86_64.tgz -u$BINTRAY_USERNAME:$BINTRAY_API_KEY \ -H "X-Bintray-Package: ${PKG_NAME}" -H "X-Bintray-Version: $CIRCLE_BRANCH" \ -H "X-Bintray-Override: 1" -H "X-Bintray-Publish: 1" -X PUT \ https://api.bintray.com/content/docker-compose/${CIRCLE_BRANCH}/docker-compose-${OS_NAME}-x86_64.tgz || exit 1 fi
{ "pile_set_name": "Github" }
// CS0428: Cannot convert method group `a' to non-delegate type `int'. Consider using parentheses to invoke the method // Line: 12 class X { int a (int a) { return 0; } void b () { int x = a; } }
{ "pile_set_name": "Github" }
<?php // // ______ ______ __ __ ______ // /\ ___\ /\ ___\ /\_\ /\_\ /\ __ \ // \/\ __\ \/\ \____ \/\_\ \/\_\ \/\ \_\ \ // \/\_____\ \/\_____\ /\_\/\_\ \/\_\ \/\_\ \_\ // \/_____/ \/_____/ \/__\/_/ \/_/ \/_/ /_/ // // 上海商创网络科技有限公司 // // --------------------------------------------------------------------------------- // // 一、协议的许可和权利 // // 1. 您可以在完全遵守本协议的基础上,将本软件应用于商业用途; // 2. 您可以在协议规定的约束和限制范围内修改本产品源代码或界面风格以适应您的要求; // 3. 您拥有使用本产品中的全部内容资料、商品信息及其他信息的所有权,并独立承担与其内容相关的 // 法律义务; // 4. 获得商业授权之后,您可以将本软件应用于商业用途,自授权时刻起,在技术支持期限内拥有通过 // 指定的方式获得指定范围内的技术支持服务; // // 二、协议的约束和限制 // // 1. 未获商业授权之前,禁止将本软件用于商业用途(包括但不限于企业法人经营的产品、经营性产品 // 以及以盈利为目的或实现盈利产品); // 2. 未获商业授权之前,禁止在本产品的整体或在任何部分基础上发展任何派生版本、修改版本或第三 // 方版本用于重新开发; // 3. 如果您未能遵守本协议的条款,您的授权将被终止,所被许可的权利将被收回并承担相应法律责任; // // 三、有限担保和免责声明 // // 1. 本软件及所附带的文件是作为不提供任何明确的或隐含的赔偿或担保的形式提供的; // 2. 用户出于自愿而使用本软件,您必须了解使用本软件的风险,在尚未获得商业授权之前,我们不承 // 诺提供任何形式的技术支持、使用担保,也不承担任何因使用本软件而产生问题的相关责任; // 3. 上海商创网络科技有限公司不对使用本产品构建的商城中的内容信息承担责任,但在不侵犯用户隐 // 私信息的前提下,保留以任何方式获取用户信息及商品信息的权利; // // 有关本产品最终用户授权协议、商业授权与技术服务的详细内容,均由上海商创网络科技有限公司独家 // 提供。上海商创网络科技有限公司拥有在不事先通知的情况下,修改授权协议的权力,修改后的协议对 // 改变之日起的新授权用户生效。电子文本形式的授权协议如同双方书面签署的协议一样,具有完全的和 // 等同的法律效力。您一旦开始修改、安装或使用本产品,即被视为完全理解并接受本协议的各项条款, // 在享有上述条款授予的权力的同时,受到相关的约束和限制。协议许可范围以外的行为,将直接违反本 // 授权协议并构成侵权,我们有权随时终止授权,责令停止损害,并保留追究相关责任的权力。 // // --------------------------------------------------------------------------------- // namespace Ecjia\System\Admins\SessionLogins; use Royalcms\Component\Database\Eloquent\Model; class SessionLoginsModel extends Model { protected $table = 'session_logins'; protected $primaryKey = 'id'; /** * 可以被批量赋值的属性。 * * @var array */ protected $fillable = [ 'id', 'user_id', 'user_type', 'user_agent', 'login_time', 'login_ip', 'login_ip_location', 'from_type', 'from_value', ]; /** * 该模型是否被自动维护时间戳 * * @var bool */ public $timestamps = false; } // end
{ "pile_set_name": "Github" }
/* * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code 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 * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. * */ package sun.jvm.hotspot.utilities; import java.io.*; import sun.jvm.hotspot.oops.*; import sun.jvm.hotspot.tools.jcore.*; /** Class loader that loads classes from the process/core image of the debuggee. */ public class ProcImageClassLoader extends ClassLoader { public ProcImageClassLoader(ClassLoader parent) { super(parent); } public ProcImageClassLoader() { this(Thread.currentThread().getContextClassLoader()); } protected Class findClass(String className) throws ClassNotFoundException { try { ByteArrayOutputStream bos = new ByteArrayOutputStream(); InstanceKlass klass = SystemDictionaryHelper.findInstanceKlass(className); ClassWriter cw = new ClassWriter(klass, bos); cw.write(); byte[] buf = bos.toByteArray(); return defineClass(className, buf, 0, buf.length); } catch (Exception e) { throw (ClassNotFoundException) new ClassNotFoundException().initCause(e); } } }
{ "pile_set_name": "Github" }
</div> <!-- Footer --> <div class="footer"> <div class="copyright">Copyright {global.yearCreated} {global.companyName} | All Rights Reserved</div> </div> </div> </body> </html>
{ "pile_set_name": "Github" }
/******************************************************************************/ /** @file test_behaviour_open_address_file_hash.c @author Eric Huang @brief Behaviour tests for the Open Address File Hash implementation. @copyright Copyright 2017 The University of British Columbia, IonDB Project Contributors (see AUTHORS.md) @par Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @par 1.Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. @par 2.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. @par 3.Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @par 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. */ /******************************************************************************/ #include "../../../planck-unit/src/planck_unit.h" #include "../behaviour_dictionary.h" #include "../../../../dictionary/open_address_file_hash/open_address_file_hash_dictionary_handler.h" #include "test_behaviour_open_address_file_hash.h" void runalltests_behaviour_open_address_file_hash( void ) { fdeleteall(); bhdct_run_tests(oafdict_init, 200, ION_BHDCT_ALL_TESTS & ~ION_BHDCT_DUPLICATES); }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <debug-info version="2"> <root> <file name="BehaviorAspectDescriptor.java"> <unit at="11,0,22,0" name="jetbrains.mps.test.testMigration.behavior.BehaviorAspectDescriptor" /> </file> </root> </debug-info>
{ "pile_set_name": "Github" }
// // This file is auto-generated by script docgen.py. // DO NOT EDIT BY HAND! // // tag::infos_hashtable[] [width="100%",cols="^1,^2,6,6,8",options="header"] |=== | Extension | Nom | Description | Table de hachage (entrée) | Table de hachage (sortie) | irc | irc_message_parse | analyse un message IRC | "message" : message IRC, "server" : nom du serveur (optionnel) | "tags" : étiquettes, "message_without_tags" : message sans les étiquettes, "nick" : pseudo, "user" : nom d'utilisateur, "host" : nom d'hôte, "command" : commande, "channel" : canal, "arguments" : paramètres (inclut le canal), "text" : texte (par exemple message utilisateur), "pos_command" : index de "command" dans le message ("-1" si "command" n'a pas été trouvé), "pos_arguments" : index de "arguments" dans le message ("-1" si "arguments" n'a pas été trouvé), "pos_channel" : index de "channel" dans le message ("-1" si "channel" n'a pas été trouvé), "pos_text" : index de "text" dans le message ("-1" si "text" n'a pas été trouvé) | irc | irc_message_split | découper un message IRC (pour tenir dans les 512 octets par défaut) | "message" : message IRC, "server" : nom du serveur (optionnel) | "msg1" ... "msgN" : messages à envoyer (sans le "\r\n" final), "args1" ... "argsN" : paramètres des messages, "count" : nombre de messages | weechat | focus_info | obtenir l'information de focus | "x" : coordonnée x (chaîne avec un entier >= 0), "y" : coordonnée y (chaîne avec un entier >= 0) | voir la fonction hook_focus dans la Référence API extension |=== // end::infos_hashtable[]
{ "pile_set_name": "Github" }
module Xcodeproj class Project class UUIDGenerator require 'digest' def initialize(projects) @projects = Array(projects) @paths_by_object = {} end def generate! generate_all_paths_by_objects(@projects) new_objects_by_project = Hash[@projects.map do |project| [project, switch_uuids(project)] end] all_new_objects_by_project = new_objects_by_project.values.flat_map(&:values) all_objects_by_uuid = @projects.map(&:objects_by_uuid).inject(:merge) all_objects = @projects.flat_map(&:objects) verify_no_duplicates!(all_objects, all_new_objects_by_project) @projects.each { |project| fixup_uuid_references(project, all_objects_by_uuid) } new_objects_by_project.each do |project, new_objects_by_uuid| project.instance_variable_set(:@generated_uuids, project.instance_variable_get(:@available_uuids)) project.instance_variable_set(:@objects_by_uuid, new_objects_by_uuid) end end private UUID_ATTRIBUTES = [:remote_global_id_string, :container_portal, :target_proxy].freeze def verify_no_duplicates!(all_objects, all_new_objects) duplicates = all_objects - all_new_objects UserInterface.warn "[Xcodeproj] Generated duplicate UUIDs:\n\n" << duplicates.map { |d| "#{d.isa} -- #{@paths_by_object[d]}" }.join("\n") unless duplicates.empty? end def fixup_uuid_references(target_project, all_objects_by_uuid) fixup = ->(object, attr) do if object.respond_to?(attr) && link = all_objects_by_uuid[object.send(attr)] object.send(:"#{attr}=", link.uuid) end end target_project.objects.each do |object| UUID_ATTRIBUTES.each do |attr| fixup[object, attr] end end end def generate_all_paths_by_objects(projects) projects.each { |project| generate_paths(project.root_object, project.path.basename.to_s) } end def generate_paths(object, path = '') existing = @paths_by_object[object] || path return existing if @paths_by_object.key?(object) @paths_by_object[object] = path.size > existing.size ? path : existing object.to_one_attributes.each do |attrb| obj = attrb.get_value(object) generate_paths(obj, path + '/' << attrb.plist_name) if obj end object.to_many_attributes.each do |attrb| attrb.get_value(object).each do |o| generate_paths(o, path + '/' << attrb.plist_name << "/#{path_component_for_object(o)}") end end object.references_by_keys_attributes.each do |attrb| attrb.get_value(object).each do |dictionary| dictionary.each do |key, value| generate_paths(value, path + '/' << attrb.plist_name << "/k:#{key}/#{path_component_for_object(value)}") end end end end def switch_uuids(project) project.mark_dirty! project.objects.each_with_object({}) do |object, hash| next unless path = @paths_by_object[object] uuid = uuid_for_path(path) object.instance_variable_set(:@uuid, uuid) hash[uuid] = object end end def uuid_for_path(path) Digest::MD5.hexdigest(path).upcase end def path_component_for_object(object) @path_component_for_object ||= Hash.new do |cache, key| component = tree_hash_to_path(key.to_tree_hash) component << key.hierarchy_path.to_s if key.respond_to?(:hierarchy_path) cache[key] = component end @path_component_for_object[object] end def tree_hash_to_path(object, depth = 4) return '|' if depth.zero? case object when Hash object.sort.each_with_object('') do |(key, value), string| string << key << ':' << tree_hash_to_path(value, depth - 1) << ',' end when Array object.map do |value| tree_hash_to_path(value, depth - 1) end.join(',') else object.to_s end end end end end
{ "pile_set_name": "Github" }
import createRange from '../../src/utils/createRange'; describe('createRange()', () => { it('returns an array using start and stop', () => { expect(createRange(2, 6)).toEqual(['2', '3', '4', '5', '6']); }); it('supports a stepper', () => { expect(createRange(2, 6, 2)).toEqual(['2', '4', '6']); }); });
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <string xmlns="http://tempuri.org/">{ "Info": [ { "IsSuccess": "True", "InAddress": "彰化縣溪州鄉尾厝村溪下路570號", "InSRS": "EPSG:4326", "InFuzzyType": "[單雙號機制]+[最近門牌號機制]", "InFuzzyBuffer": "0", "InIsOnlyFullMatch": "False", "InIsLockCounty": "True", "InIsLockTown": "False", "InIsLockVillage": "False", "InIsLockRoadSection": "False", "InIsLockLane": "False", "InIsLockAlley": "False", "InIsLockArea": "False", "InIsSameNumber_SubNumber": "True", "InCanIgnoreVillage": "True", "InCanIgnoreNeighborhood": "True", "InReturnMaxCount": "0", "OutTotal": "1", "OutMatchType": "模糊比對", "OutMatchCode": "[彰化縣]\tT:1,V:1,R:1,S:-1,L:-1,A:-1,SA:-1,T:-1,AR:-1,NO:1,E:-1,N:-1", "OutTraceInfo": "[彰化縣]\t { 模糊比對 } (溪州鄉)\t找到符合的[鄉鎮市區],(尾厝村)\t找到符合的[村里],(溪下路)\t找到符合的[路街名],(570號)\t找到符合的[門牌號碼],模糊比對找到 1 筆符合的門牌地址。" } ], "AddressList": [ { "FULL_ADDR": "彰化縣溪州鄉尾厝村1鄰溪下路四段570號", "COUNTY": "彰化縣", "TOWN": "溪州鄉", "VILLAGE": "尾厝村", "NEIGHBORHOOD": "1鄰", "ROAD": "溪下路", "SECTION": "4", "LANE": "", "ALLEY": "", "SUB_ALLEY": "", "TONG": "", "NUMBER": "570號", "X": 120.498354, "Y": 23.851344 } ] }</string>
{ "pile_set_name": "Github" }
package org.jetbrains.plugins.scala.lang.psi.impl.toplevel.typedef import com.intellij.psi.{PsiClass, PsiMember, PsiMethod, PsiNamedElement} import org.jetbrains.plugins.scala.extensions.{OptionExt, PsiElementExt, TraversableExt} import org.jetbrains.plugins.scala.lang.psi.api.{PropertyMethods, ScalaPsiElement} import org.jetbrains.plugins.scala.lang.psi.api.PropertyMethods.{DefinitionRole, EQ, SETTER, isApplicable, methodName} import org.jetbrains.plugins.scala.lang.psi.api.base.ScPrimaryConstructor import org.jetbrains.plugins.scala.lang.psi.api.statements.{ScFunction, ScTypeAlias, ScValue, ScValueOrVariable} import org.jetbrains.plugins.scala.lang.psi.api.toplevel.{ScNamedElement, ScTypedDefinition} import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.{ScClass, ScMember, ScObject, ScTemplateDefinition, ScTypeDefinition} import org.jetbrains.plugins.scala.lang.psi.impl.ScalaPsiManager import org.jetbrains.plugins.scala.lang.psi.impl.toplevel.synthetic.ScSyntheticClass import org.jetbrains.plugins.scala.lang.psi.types.recursiveUpdate.ScSubstitutor import org.jetbrains.plugins.scala.lang.psi.types.{PhysicalMethodSignature, ScCompoundType, Signature, TermSignature, TypeSignature} import org.jetbrains.plugins.scala.project.ProjectContext import scala.annotation.tailrec trait SignatureProcessor[T <: Signature] { type Sink = SignatureSink[T] def shouldSkip(t: T): Boolean def process(t: T, sink: Sink): Unit = { if (!shouldSkip(t)) sink.put(t) } def processJava(clazz: PsiClass, subst: ScSubstitutor, processor: Sink): Unit def processScala(template: ScTemplateDefinition, subst: ScSubstitutor, sink: Sink): Unit def processRefinement(cp: ScCompoundType, sink: Sink): Unit //noinspection ScalaWrongMethodsUsage protected def isStaticJava(m: PsiMember): Boolean = !m.isInstanceOf[ScalaPsiElement] && m.hasModifierProperty("static") @tailrec final def processAll(clazz: PsiClass, substitutor: ScSubstitutor, sink: Sink): Unit = { clazz match { case null => () case syn: ScSyntheticClass => processAll(realClass(syn), substitutor, sink) case td: ScTemplateDefinition => processScala(td, substitutor, sink) case _ => processJava(clazz, substitutor, sink) } } private def realClass(syn: ScSyntheticClass): ScTemplateDefinition = syn.elementScope.getCachedClass(syn.getQualifiedName) .filterByType[ScTemplateDefinition].orNull } object TypesCollector extends SignatureProcessor[TypeSignature] { override def shouldSkip(t: TypeSignature): Boolean = t.namedElement match { case _: ScObject => true case _: ScTypeDefinition | _: ScTypeAlias => false case c: PsiClass => isStaticJava(c) case _ => true } override def processJava(clazz: PsiClass, subst: ScSubstitutor, sink: Sink): Unit = { for (inner <- clazz.getInnerClasses) { process(TypeSignature(inner, subst), sink) } } override def processScala(template: ScTemplateDefinition, subst: ScSubstitutor, sink: Sink): Unit = { for (member <- template.membersWithSynthetic.filterByType[ScNamedElement]) { process(TypeSignature(member, subst), sink) } } override def processRefinement(cp: ScCompoundType, sink: Sink): Unit = { for ((_, aliasSig) <- cp.typesMap) { process(TypeSignature(aliasSig.typeAlias, aliasSig.substitutor), sink) } } } abstract class TermsCollector extends SignatureProcessor[TermSignature] { protected def relevantMembers(td: ScTemplateDefinition): Seq[ScMember] override def shouldSkip(t: TermSignature): Boolean = t.namedElement match { case f: ScFunction => f.isConstructor case m: PsiMethod => m.isConstructor || isStaticJava(m) case m: PsiMember => isStaticJava(m) case _ => false } override def processJava(clazz: PsiClass, subst: ScSubstitutor, sink: Sink): Unit = { for (method <- clazz.getMethods) { val phys = new PhysicalMethodSignature(method, subst) process(phys, sink) } for (field <- clazz.getFields) { val sig = TermSignature.withoutParams(field.getName, subst, field) process(sig, sink) } } override def processScala(template: ScTemplateDefinition, subst: ScSubstitutor, sink: Sink): Unit = { implicit val ctx: ProjectContext = template def addSignature(s: TermSignature): Unit = { process(s, sink) } if (template.qualifiedName == "scala.AnyVal") { addAnyValObjectMethods(template, addSignature) } for (member <- relevantMembers(template)) { member match { case v: ScValueOrVariable => v.declaredElements .foreach(addPropertySignatures(_, subst, addSignature)) case constr: ScPrimaryConstructor => constr.parameters .foreach(addPropertySignatures(_, subst, addSignature)) case f: ScFunction => addSignature(new PhysicalMethodSignature(f, subst)) case o: ScObject => addSignature(TermSignature(o, subst)) case c: ScTypeDefinition => syntheticSignaturesFromInnerClass(c, subst) .foreach(addSignature) case _ => } } } override def processRefinement(cp: ScCompoundType, sink: Sink): Unit = { for ((sign, _) <- cp.signatureMap) { process(sign, sink) } } private def addAnyValObjectMethods(template: ScTemplateDefinition, addSignature: TermSignature => Unit): Unit = { //some methods of java.lang.Object are available for value classes val javaObject = ScalaPsiManager.instance(template.projectContext) .getCachedClass(template.resolveScope, "java.lang.Object") for (obj <- javaObject; method <- obj.getMethods) { method.getName match { case "equals" | "hashCode" | "toString" => addSignature(new PhysicalMethodSignature(method, ScSubstitutor.empty)) case _ => } } } /** * @param named is class parameter, or part of ScValue or ScVariable * */ private def addPropertySignatures(named: ScTypedDefinition, subst: ScSubstitutor, addSignature: TermSignature => Unit): Unit = { PropertyMethods.allRoles .filter(isApplicable(_, named, noResolve = true)) .map(signature(named, subst, _)) .foreach(addSignature) } private def signature(named: ScTypedDefinition, subst: ScSubstitutor, role: DefinitionRole): TermSignature = role match { case SETTER | EQ => TermSignature.setter(methodName(named.name, role), named, subst) case _ => TermSignature.withoutParams(methodName(named.name, role), subst, named) } private def syntheticSignaturesFromInnerClass(td: ScTypeDefinition, subst: ScSubstitutor): Seq[TermSignature] = { val companionSig = td.fakeCompanionModule.map(TermSignature(_, subst)) val implicitClassFun = td match { case c: ScClass if c.hasModifierProperty("implicit") => c.getSyntheticImplicitMethod.map(new PhysicalMethodSignature(_, subst)) case _ => None } companionSig.toList ::: implicitClassFun.toList } } object TermsCollector extends TermsCollector { override def relevantMembers(td: ScTemplateDefinition): Seq[ScMember] = td.membersWithSynthetic } object StableTermsCollector extends TermsCollector { override def relevantMembers(td: ScTemplateDefinition): Seq[ScMember] = { (td.members ++ td.syntheticMembers ++ td.syntheticTypeDefinitions) .filter(mayContainStable) } override def shouldSkip(t: TermSignature): Boolean = !isStable(t.namedElement) || super.shouldSkip(t) private def isStable(named: PsiNamedElement): Boolean = named match { case _: ScObject => true case t: ScTypedDefinition => t.isStable case _ => false } private def mayContainStable(m: ScMember): Boolean = m match { case _: ScTypeDefinition | _: ScValue | _: ScPrimaryConstructor => true case _ => false } }
{ "pile_set_name": "Github" }
CRC=0xbd3d0d33
{ "pile_set_name": "Github" }
/* ---------------------------------------------------------------------------- * SAM Software Package License * ---------------------------------------------------------------------------- * Copyright (c) 2012, Atmel Corporation * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following condition is met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the disclaimer below. * * Atmel's name may not be used to endorse or promote products derived from * this software without specific prior written permission. * * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE * DISCLAIMED. IN NO EVENT SHALL ATMEL 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. * ---------------------------------------------------------------------------- */ #ifndef _SAM3N1B_PIO_ #define _SAM3N1B_PIO_ #define PIO_PA0 (1u << 0) /**< \brief Pin Controlled by PA0 */ #define PIO_PA1 (1u << 1) /**< \brief Pin Controlled by PA1 */ #define PIO_PA2 (1u << 2) /**< \brief Pin Controlled by PA2 */ #define PIO_PA3 (1u << 3) /**< \brief Pin Controlled by PA3 */ #define PIO_PA4 (1u << 4) /**< \brief Pin Controlled by PA4 */ #define PIO_PA5 (1u << 5) /**< \brief Pin Controlled by PA5 */ #define PIO_PA6 (1u << 6) /**< \brief Pin Controlled by PA6 */ #define PIO_PA7 (1u << 7) /**< \brief Pin Controlled by PA7 */ #define PIO_PA8 (1u << 8) /**< \brief Pin Controlled by PA8 */ #define PIO_PA9 (1u << 9) /**< \brief Pin Controlled by PA9 */ #define PIO_PA10 (1u << 10) /**< \brief Pin Controlled by PA10 */ #define PIO_PA11 (1u << 11) /**< \brief Pin Controlled by PA11 */ #define PIO_PA12 (1u << 12) /**< \brief Pin Controlled by PA12 */ #define PIO_PA13 (1u << 13) /**< \brief Pin Controlled by PA13 */ #define PIO_PA14 (1u << 14) /**< \brief Pin Controlled by PA14 */ #define PIO_PA15 (1u << 15) /**< \brief Pin Controlled by PA15 */ #define PIO_PA16 (1u << 16) /**< \brief Pin Controlled by PA16 */ #define PIO_PA17 (1u << 17) /**< \brief Pin Controlled by PA17 */ #define PIO_PA18 (1u << 18) /**< \brief Pin Controlled by PA18 */ #define PIO_PA19 (1u << 19) /**< \brief Pin Controlled by PA19 */ #define PIO_PA20 (1u << 20) /**< \brief Pin Controlled by PA20 */ #define PIO_PA21 (1u << 21) /**< \brief Pin Controlled by PA21 */ #define PIO_PA22 (1u << 22) /**< \brief Pin Controlled by PA22 */ #define PIO_PA23 (1u << 23) /**< \brief Pin Controlled by PA23 */ #define PIO_PA24 (1u << 24) /**< \brief Pin Controlled by PA24 */ #define PIO_PA25 (1u << 25) /**< \brief Pin Controlled by PA25 */ #define PIO_PA26 (1u << 26) /**< \brief Pin Controlled by PA26 */ #define PIO_PA27 (1u << 27) /**< \brief Pin Controlled by PA27 */ #define PIO_PA28 (1u << 28) /**< \brief Pin Controlled by PA28 */ #define PIO_PA29 (1u << 29) /**< \brief Pin Controlled by PA29 */ #define PIO_PA30 (1u << 30) /**< \brief Pin Controlled by PA30 */ #define PIO_PA31 (1u << 31) /**< \brief Pin Controlled by PA31 */ #define PIO_PB0 (1u << 0) /**< \brief Pin Controlled by PB0 */ #define PIO_PB1 (1u << 1) /**< \brief Pin Controlled by PB1 */ #define PIO_PB2 (1u << 2) /**< \brief Pin Controlled by PB2 */ #define PIO_PB3 (1u << 3) /**< \brief Pin Controlled by PB3 */ #define PIO_PB4 (1u << 4) /**< \brief Pin Controlled by PB4 */ #define PIO_PB5 (1u << 5) /**< \brief Pin Controlled by PB5 */ #define PIO_PB6 (1u << 6) /**< \brief Pin Controlled by PB6 */ #define PIO_PB7 (1u << 7) /**< \brief Pin Controlled by PB7 */ #define PIO_PB8 (1u << 8) /**< \brief Pin Controlled by PB8 */ #define PIO_PB9 (1u << 9) /**< \brief Pin Controlled by PB9 */ #define PIO_PB10 (1u << 10) /**< \brief Pin Controlled by PB10 */ #define PIO_PB11 (1u << 11) /**< \brief Pin Controlled by PB11 */ #define PIO_PB12 (1u << 12) /**< \brief Pin Controlled by PB12 */ #define PIO_PB13 (1u << 13) /**< \brief Pin Controlled by PB13 */ #define PIO_PB14 (1u << 14) /**< \brief Pin Controlled by PB14 */ /* ========== Pio definition for ADC peripheral ========== */ #define PIO_PA17X1_AD0 (1u << 17) /**< \brief Adc signal: AD0 */ #define PIO_PA18X1_AD1 (1u << 18) /**< \brief Adc signal: AD1 */ #define PIO_PC13X1_AD10 (1u << 13) /**< \brief Adc signal: AD10 */ #define PIO_PC15X1_AD11 (1u << 15) /**< \brief Adc signal: AD11 */ #define PIO_PC12X1_AD12 (1u << 12) /**< \brief Adc signal: AD12 */ #define PIO_PC29X1_AD13 (1u << 29) /**< \brief Adc signal: AD13 */ #define PIO_PC30X1_AD14 (1u << 30) /**< \brief Adc signal: AD14 */ #define PIO_PC31X1_AD15 (1u << 31) /**< \brief Adc signal: AD15 */ #define PIO_PA19X1_AD2 (1u << 19) /**< \brief Adc signal: AD2/WKUP9 */ #define PIO_PA19X1_WKUP9 (1u << 19) /**< \brief Adc signal: AD2/WKUP9 */ #define PIO_PA20X1_AD3 (1u << 20) /**< \brief Adc signal: AD3/WKUP10 */ #define PIO_PA20X1_WKUP10 (1u << 20) /**< \brief Adc signal: AD3/WKUP10 */ #define PIO_PB0X1_AD4 (1u << 0) /**< \brief Adc signal: AD4 */ #define PIO_PB1X1_AD5 (1u << 1) /**< \brief Adc signal: AD5 */ #define PIO_PB2X1_AD6 (1u << 2) /**< \brief Adc signal: AD6/WKUP12 */ #define PIO_PB2X1_WKUP12 (1u << 2) /**< \brief Adc signal: AD6/WKUP12 */ #define PIO_PB3X1_AD7 (1u << 3) /**< \brief Adc signal: AD7 */ #define PIO_PA21X1_AD8 (1u << 21) /**< \brief Adc signal: AD8 */ #define PIO_PA22X1_AD9 (1u << 22) /**< \brief Adc signal: AD9 */ #define PIO_PA8B_ADTRG (1u << 8) /**< \brief Adc signal: ADTRG */ /* ========== Pio definition for DACC peripheral ========== */ #define PIO_PB13X1_DAC0 (1u << 13) /**< \brief Dacc signal: DAC0 */ #define PIO_PA2C_DATRG (1u << 2) /**< \brief Dacc signal: DATRG */ /* ========== Pio definition for PMC peripheral ========== */ #define PIO_PA6B_PCK0 (1u << 6) /**< \brief Pmc signal: PCK0 */ #define PIO_PB13B_PCK0 (1u << 13) /**< \brief Pmc signal: PCK0 */ #define PIO_PC16B_PCK0 (1u << 16) /**< \brief Pmc signal: PCK0 */ #define PIO_PA17B_PCK1 (1u << 17) /**< \brief Pmc signal: PCK1 */ #define PIO_PA21B_PCK1 (1u << 21) /**< \brief Pmc signal: PCK1 */ #define PIO_PC17B_PCK1 (1u << 17) /**< \brief Pmc signal: PCK1 */ #define PIO_PA18B_PCK2 (1u << 18) /**< \brief Pmc signal: PCK2 */ #define PIO_PA31B_PCK2 (1u << 31) /**< \brief Pmc signal: PCK2 */ #define PIO_PB3B_PCK2 (1u << 3) /**< \brief Pmc signal: PCK2 */ #define PIO_PC14B_PCK2 (1u << 14) /**< \brief Pmc signal: PCK2 */ /* ========== Pio definition for PWM peripheral ========== */ #define PIO_PA0A_PWM0 (1u << 0) /**< \brief Pwm signal: PWM0 */ #define PIO_PA11B_PWM0 (1u << 11) /**< \brief Pwm signal: PWM0 */ #define PIO_PA23B_PWM0 (1u << 23) /**< \brief Pwm signal: PWM0 */ #define PIO_PB0A_PWM0 (1u << 0) /**< \brief Pwm signal: PWM0 */ #define PIO_PC8B_PWM0 (1u << 8) /**< \brief Pwm signal: PWM0 */ #define PIO_PC18B_PWM0 (1u << 18) /**< \brief Pwm signal: PWM0 */ #define PIO_PC22B_PWM0 (1u << 22) /**< \brief Pwm signal: PWM0 */ #define PIO_PA1A_PWM1 (1u << 1) /**< \brief Pwm signal: PWM1 */ #define PIO_PA12B_PWM1 (1u << 12) /**< \brief Pwm signal: PWM1 */ #define PIO_PA24B_PWM1 (1u << 24) /**< \brief Pwm signal: PWM1 */ #define PIO_PB1A_PWM1 (1u << 1) /**< \brief Pwm signal: PWM1 */ #define PIO_PC9B_PWM1 (1u << 9) /**< \brief Pwm signal: PWM1 */ #define PIO_PC19B_PWM1 (1u << 19) /**< \brief Pwm signal: PWM1 */ #define PIO_PA2A_PWM2 (1u << 2) /**< \brief Pwm signal: PWM2 */ #define PIO_PA13B_PWM2 (1u << 13) /**< \brief Pwm signal: PWM2 */ #define PIO_PA25B_PWM2 (1u << 25) /**< \brief Pwm signal: PWM2 */ #define PIO_PB4B_PWM2 (1u << 4) /**< \brief Pwm signal: PWM2 */ #define PIO_PC10B_PWM2 (1u << 10) /**< \brief Pwm signal: PWM2 */ #define PIO_PC20B_PWM2 (1u << 20) /**< \brief Pwm signal: PWM2 */ #define PIO_PA7B_PWM3 (1u << 7) /**< \brief Pwm signal: PWM3 */ #define PIO_PA14B_PWM3 (1u << 14) /**< \brief Pwm signal: PWM3 */ #define PIO_PB14B_PWM3 (1u << 14) /**< \brief Pwm signal: PWM3 */ #define PIO_PC11B_PWM3 (1u << 11) /**< \brief Pwm signal: PWM3 */ #define PIO_PC21B_PWM3 (1u << 21) /**< \brief Pwm signal: PWM3 */ /* ========== Pio definition for SPI peripheral ========== */ #define PIO_PA12A_MISO (1u << 12) /**< \brief Spi signal: MISO */ #define PIO_PA13A_MOSI (1u << 13) /**< \brief Spi signal: MOSI */ #define PIO_PA11A_NPCS0 (1u << 11) /**< \brief Spi signal: NPCS0 */ #define PIO_PA9B_NPCS1 (1u << 9) /**< \brief Spi signal: NPCS1 */ #define PIO_PA31A_NPCS1 (1u << 31) /**< \brief Spi signal: NPCS1 */ #define PIO_PB14A_NPCS1 (1u << 14) /**< \brief Spi signal: NPCS1 */ #define PIO_PC4B_NPCS1 (1u << 4) /**< \brief Spi signal: NPCS1 */ #define PIO_PA10B_NPCS2 (1u << 10) /**< \brief Spi signal: NPCS2 */ #define PIO_PA30B_NPCS2 (1u << 30) /**< \brief Spi signal: NPCS2 */ #define PIO_PB2B_NPCS2 (1u << 2) /**< \brief Spi signal: NPCS2 */ #define PIO_PC7B_NPCS2 (1u << 7) /**< \brief Spi signal: NPCS2 */ #define PIO_PA3B_NPCS3 (1u << 3) /**< \brief Spi signal: NPCS3 */ #define PIO_PA5B_NPCS3 (1u << 5) /**< \brief Spi signal: NPCS3 */ #define PIO_PA22B_NPCS3 (1u << 22) /**< \brief Spi signal: NPCS3 */ #define PIO_PA14A_SPCK (1u << 14) /**< \brief Spi signal: SPCK */ /* ========== Pio definition for TC0 peripheral ========== */ #define PIO_PA4B_TCLK0 (1u << 4) /**< \brief Tc0 signal: TCLK0 */ #define PIO_PA28B_TCLK1 (1u << 28) /**< \brief Tc0 signal: TCLK1 */ #define PIO_PA29B_TCLK2 (1u << 29) /**< \brief Tc0 signal: TCLK2 */ #define PIO_PA0B_TIOA0 (1u << 0) /**< \brief Tc0 signal: TIOA0 */ #define PIO_PA15B_TIOA1 (1u << 15) /**< \brief Tc0 signal: TIOA1 */ #define PIO_PA26B_TIOA2 (1u << 26) /**< \brief Tc0 signal: TIOA2 */ #define PIO_PA1B_TIOB0 (1u << 1) /**< \brief Tc0 signal: TIOB0 */ #define PIO_PA16B_TIOB1 (1u << 16) /**< \brief Tc0 signal: TIOB1 */ #define PIO_PA27B_TIOB2 (1u << 27) /**< \brief Tc0 signal: TIOB2 */ /* ========== Pio definition for TWI0 peripheral ========== */ #define PIO_PA4A_TWCK0 (1u << 4) /**< \brief Twi0 signal: TWCK0 */ #define PIO_PA3A_TWD0 (1u << 3) /**< \brief Twi0 signal: TWD0 */ /* ========== Pio definition for TWI1 peripheral ========== */ #define PIO_PB5A_TWCK1 (1u << 5) /**< \brief Twi1 signal: TWCK1 */ #define PIO_PB4A_TWD1 (1u << 4) /**< \brief Twi1 signal: TWD1 */ /* ========== Pio definition for UART0 peripheral ========== */ #define PIO_PA9A_URXD0 (1u << 9) /**< \brief Uart0 signal: URXD0 */ #define PIO_PA10A_UTXD0 (1u << 10) /**< \brief Uart0 signal: UTXD0 */ /* ========== Pio definition for UART1 peripheral ========== */ #define PIO_PB2A_URXD1 (1u << 2) /**< \brief Uart1 signal: URXD1 */ #define PIO_PB3A_UTXD1 (1u << 3) /**< \brief Uart1 signal: UTXD1 */ /* ========== Pio definition for USART0 peripheral ========== */ #define PIO_PA8A_CTS0 (1u << 8) /**< \brief Usart0 signal: CTS0 */ #define PIO_PA7A_RTS0 (1u << 7) /**< \brief Usart0 signal: RTS0 */ #define PIO_PA5A_RXD0 (1u << 5) /**< \brief Usart0 signal: RXD0 */ #define PIO_PA2B_SCK0 (1u << 2) /**< \brief Usart0 signal: SCK0 */ #define PIO_PA6A_TXD0 (1u << 6) /**< \brief Usart0 signal: TXD0 */ /* ========== Pio definition for USART1 peripheral ========== */ #define PIO_PA25A_CTS1 (1u << 25) /**< \brief Usart1 signal: CTS1 */ #define PIO_PA24A_RTS1 (1u << 24) /**< \brief Usart1 signal: RTS1 */ #define PIO_PA21A_RXD1 (1u << 21) /**< \brief Usart1 signal: RXD1 */ #define PIO_PA23A_SCK1 (1u << 23) /**< \brief Usart1 signal: SCK1 */ #define PIO_PA22A_TXD1 (1u << 22) /**< \brief Usart1 signal: TXD1 */ /* ========== Pio indexes ========== */ #define PIO_PA0_IDX 0 #define PIO_PA1_IDX 1 #define PIO_PA2_IDX 2 #define PIO_PA3_IDX 3 #define PIO_PA4_IDX 4 #define PIO_PA5_IDX 5 #define PIO_PA6_IDX 6 #define PIO_PA7_IDX 7 #define PIO_PA8_IDX 8 #define PIO_PA9_IDX 9 #define PIO_PA10_IDX 10 #define PIO_PA11_IDX 11 #define PIO_PA12_IDX 12 #define PIO_PA13_IDX 13 #define PIO_PA14_IDX 14 #define PIO_PA15_IDX 15 #define PIO_PA16_IDX 16 #define PIO_PA17_IDX 17 #define PIO_PA18_IDX 18 #define PIO_PA19_IDX 19 #define PIO_PA20_IDX 20 #define PIO_PA21_IDX 21 #define PIO_PA22_IDX 22 #define PIO_PA23_IDX 23 #define PIO_PA24_IDX 24 #define PIO_PA25_IDX 25 #define PIO_PA26_IDX 26 #define PIO_PA27_IDX 27 #define PIO_PA28_IDX 28 #define PIO_PA29_IDX 29 #define PIO_PA30_IDX 30 #define PIO_PA31_IDX 31 #define PIO_PB0_IDX 32 #define PIO_PB1_IDX 33 #define PIO_PB2_IDX 34 #define PIO_PB3_IDX 35 #define PIO_PB4_IDX 36 #define PIO_PB5_IDX 37 #define PIO_PB6_IDX 38 #define PIO_PB7_IDX 39 #define PIO_PB8_IDX 40 #define PIO_PB9_IDX 41 #define PIO_PB10_IDX 42 #define PIO_PB11_IDX 43 #define PIO_PB12_IDX 44 #define PIO_PB13_IDX 45 #define PIO_PB14_IDX 46 #endif /* _SAM3N1B_PIO_ */
{ "pile_set_name": "Github" }
<?xml version="1.0"?> <resources> <string name="app_name">Velociraptor</string> <!--Generic--> <string name="configure">Configure</string> <string name="done">Pronto</string> <string name="show">Mostre</string> <string name="hide">Esconda</string> <string name="dismiss">Feche</string> <string name="kmph">%s km/h</string> <string name="mph">%s MPH</string> <string name="percent">%s%%</string> <string name="notif_content">Pressione para configurar</string> <string name="notif_title">Velociraptor ativado</string> <!--Permission Settings--> <string name="open_settings_page">Abra para configurar</string> <string name="enable_floating_desc">Dê permissão ao Velociraptor para aparecer sobre outros aplicativos</string> <string name="open_settings_failed_overlay">Não foi possível abrir a página de configurações. Por favor, dê a permissão ao Velociraptor para aparecer sobre outros aplicativos.</string> <string name="enable_accessibility_service">Habilite o serviço de acesso</string> <string name="enable_accessibility_service_desc">Dê a permissão ao Velociraptor para reconhecer o aplicativo atual o ativando no serviço de acessibilidade</string> <string name="accessibility_service_description">Dê a permissão ao Velociraptor para reconhecer aplicativos e aparecer automaticamente.\n\nO Velociraptor não usa nenhuma outra informação além do aplicativo atual.</string> <string name="open_settings_failed_accessibility">Não pôde abrir a página de configurações. Por favor, dê a permissão ao Velociraptor no serviço de acessibilidade</string> <string name="grant_permission">Dê a permissão</string> <string name="enable_location_desc">Dê a permissão ao Velociraptor para acessar sua localização</string> <string name="permissions_warning">O Velociraptor não tem as permissões adequadas. Por favor, abra o aplicativo e as configure.</string> <string name="location_settings_warning">O GPS não está ligado</string> <string name="network_warning">Rede desconectada</string> <!--General Settings--> <string name="general">Geral</string> <string name="show_speedometer">Velocímetro</string> <string name="sound_alert">Alerta sonoro</string> <string name="test">Teste</string> <string name="speed_unit">Unidades de velocidade</string> <string name="style">Estilo</string> <string name="united_states">Estados Unidos</string> <string name="international">Internacional</string> <string name="size">Tamanho</string> <string name="size_limit_overview">Limite de velocidade: %s</string> <string name="size_speedometer_overview">Velocímetro: %s</string> <string name="transparency">Transparência</string> <string name="speeding_amount">Tolerância para o excesso de velocidade</string> <string name="tolerance_dialog_text">Avise quando o limite de velocidade for excedido por:</string> <string name="plus">mais</string> <string name="or">ou</string> <string name="tolerance_desc">%1$s %2$s %3$s</string> <!--About Dialog--> <string name="about">Sobre</string> <string name="about_dialog_title">Velociraptor v%s</string> <string name="about_body"><![CDATA[ <b>Velociraptor</b> é um monitor da velocidade máxima com velocímetro e avisos, usando dados sobre a velocidade máxima do OpenStreetMap e do HERE Maps. <br/><br/> Desenvolvido por <b>Daniel Ciao</b><br/> <a href="http://pluscubed.com">Website</a>&nbsp;&nbsp; <a href="mailto:[email protected]">Email</a>&nbsp;&nbsp; <a href="https://twitter.com/plusCubed">Twitter</a>&nbsp;&nbsp; <a href="https://google.com/+DanielCiao">Google+</a>&nbsp;&nbsp; <a href="https://github.com/pluscubed">GitHub</a>&nbsp;&nbsp; <a href="https://www.linkedin.com/in/dciao">LinkedIn</a><br/><br/> <a href="https://play.google.com/store/apps/details?id=com.pluscubed.velociraptor">Avalie o Velociraptor na Play Store!</a><br/><br/> <a href="https://github.com/pluscubed/velociraptor">GitHub</a> para o código fonte, problemas e sugestões<br/> <a href="http://pluscubed.oneskyapp.com/collaboration/project/64120">OneSky</a> para traduzir o Velociraptor para sua língua<br/> <a href="https://play.google.com/apps/testing/com.pluscubed.velociraptor">Teste beta</a>]]></string> <!--Speed limit providers--> <!--Activation Settings--> <string name="show_in_apps">Aparecer sobre estes aplicativos:</string> <string name="persistent_notification_controls">Mostre controles na notificação</string> <string name="controls_notif_title">Controles do Velociraptor</string> <string name="controls_notif_desc">Mostre ou esconda a velocidade máxima</string> <!--App selection--> <string name="select_apps">Selecione aplicativos</string> <string name="show_map_apps">Mostre aplicativos de mapas</string> <!---Advanced settings--> <string name="advanced">Avançada</string> <string name="debugging_stats">Estatísticas de atividades</string> <!--Changelog--> <string name="changelog">Lista de alterações</string> <!--Support development--> <string name="support_development">Apóie o desenvolvimento</string> <string name="in_app_unavailable">Não está disponível cobrança no aplicativo</string> <string name="support_dev_dialog">Usado para custear o servidor e o uso de APIs. A quantia sugerida é US$1.00 por mês. Um distintivo será mostrado aqui em sinal de minha sincera gratidão.</string> <string name="per_month">%s por mês</string> <string name="one_time">%s uma única vez</string> <!--Notification Channels--> </resources>
{ "pile_set_name": "Github" }
/-- This set of tests checks UTF-8 support with the DFA matching functionality of pcre_dfa_exec(), excluding Unicode property support. The -dfa flag must be used with pcretest when running it. --/ < forbid W /\x{100}ab/8 \x{100}ab /a\x{100}*b/8 ab a\x{100}b a\x{100}\x{100}b /a\x{100}+b/8 a\x{100}b a\x{100}\x{100}b *** Failers ab /\bX/8 Xoanon +Xoanon \x{300}Xoanon *** Failers YXoanon /\BX/8 YXoanon *** Failers Xoanon +Xoanon \x{300}Xoanon /X\b/8 X+oanon ZX\x{300}oanon FAX *** Failers Xoanon /X\B/8 Xoanon *** Failers X+oanon ZX\x{300}oanon FAX /[^a]/8 abcd a\x{100} /^[abc\x{123}\x{400}-\x{402}]{2,3}\d/8 ab99 \x{123}\x{123}45 \x{400}\x{401}\x{402}6 *** Failers d99 \x{123}\x{122}4 \x{400}\x{403}6 \x{400}\x{401}\x{402}\x{402}6 /a.b/8 acb a\x7fb a\x{100}b *** Failers a\nb /a(.{3})b/8 a\x{4000}xyb a\x{4000}\x7fyb a\x{4000}\x{100}yb *** Failers a\x{4000}b ac\ncb /a(.*?)(.)/ a\xc0\x88b /a(.*?)(.)/8 a\x{100}b /a(.*)(.)/ a\xc0\x88b /a(.*)(.)/8 a\x{100}b /a(.)(.)/ a\xc0\x92bcd /a(.)(.)/8 a\x{240}bcd /a(.?)(.)/ a\xc0\x92bcd /a(.?)(.)/8 a\x{240}bcd /a(.??)(.)/ a\xc0\x92bcd /a(.??)(.)/8 a\x{240}bcd /a(.{3})b/8 a\x{1234}xyb a\x{1234}\x{4321}yb a\x{1234}\x{4321}\x{3412}b *** Failers a\x{1234}b ac\ncb /a(.{3,})b/8 a\x{1234}xyb a\x{1234}\x{4321}yb a\x{1234}\x{4321}\x{3412}b axxxxbcdefghijb a\x{1234}\x{4321}\x{3412}\x{3421}b *** Failers a\x{1234}b /a(.{3,}?)b/8 a\x{1234}xyb a\x{1234}\x{4321}yb a\x{1234}\x{4321}\x{3412}b axxxxbcdefghijb a\x{1234}\x{4321}\x{3412}\x{3421}b *** Failers a\x{1234}b /a(.{3,5})b/8 a\x{1234}xyb a\x{1234}\x{4321}yb a\x{1234}\x{4321}\x{3412}b axxxxbcdefghijb a\x{1234}\x{4321}\x{3412}\x{3421}b axbxxbcdefghijb axxxxxbcdefghijb *** Failers a\x{1234}b axxxxxxbcdefghijb /a(.{3,5}?)b/8 a\x{1234}xyb a\x{1234}\x{4321}yb a\x{1234}\x{4321}\x{3412}b axxxxbcdefghijb a\x{1234}\x{4321}\x{3412}\x{3421}b axbxxbcdefghijb axxxxxbcdefghijb *** Failers a\x{1234}b axxxxxxbcdefghijb /^[a\x{c0}]/8 *** Failers \x{100} /(?<=aXb)cd/8 aXbcd /(?<=a\x{100}b)cd/8 a\x{100}bcd /(?<=a\x{100000}b)cd/8 a\x{100000}bcd /(?:\x{100}){3}b/8 \x{100}\x{100}\x{100}b *** Failers \x{100}\x{100}b /\x{ab}/8 \x{ab} \xc2\xab *** Failers \x00{ab} /(?<=(.))X/8 WXYZ \x{256}XYZ *** Failers XYZ /[^a]+/8g bcd \x{100}aY\x{256}Z /^[^a]{2}/8 \x{100}bc /^[^a]{2,}/8 \x{100}bcAa /^[^a]{2,}?/8 \x{100}bca /[^a]+/8ig bcd \x{100}aY\x{256}Z /^[^a]{2}/8i \x{100}bc /^[^a]{2,}/8i \x{100}bcAa /^[^a]{2,}?/8i \x{100}bca /\x{100}{0,0}/8 abcd /\x{100}?/8 abcd \x{100}\x{100} /\x{100}{0,3}/8 \x{100}\x{100} \x{100}\x{100}\x{100}\x{100} /\x{100}*/8 abce \x{100}\x{100}\x{100}\x{100} /\x{100}{1,1}/8 abcd\x{100}\x{100}\x{100}\x{100} /\x{100}{1,3}/8 abcd\x{100}\x{100}\x{100}\x{100} /\x{100}+/8 abcd\x{100}\x{100}\x{100}\x{100} /\x{100}{3}/8 abcd\x{100}\x{100}\x{100}XX /\x{100}{3,5}/8 abcd\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}XX /\x{100}{3,}/8O abcd\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}XX /(?<=a\x{100}{2}b)X/8 Xyyya\x{100}\x{100}bXzzz /\D*/8O aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa /\D*/8O \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100} /\D/8 1X2 1\x{100}2 />\S/8 > >X Y > >\x{100} Y /\d/8 \x{100}3 /\s/8 \x{100} X /\D+/8 12abcd34 *** Failers 1234 /\D{2,3}/8 12abcd34 12ab34 *** Failers 1234 12a34 /\D{2,3}?/8 12abcd34 12ab34 *** Failers 1234 12a34 /\d+/8 12abcd34 *** Failers /\d{2,3}/8 12abcd34 1234abcd *** Failers 1.4 /\d{2,3}?/8 12abcd34 1234abcd *** Failers 1.4 /\S+/8 12abcd34 *** Failers \ \ /\S{2,3}/8 12abcd34 1234abcd *** Failers \ \ /\S{2,3}?/8 12abcd34 1234abcd *** Failers \ \ />\s+</8 12> <34 *** Failers />\s{2,3}</8 ab> <cd ab> <ce *** Failers ab> <cd />\s{2,3}?</8 ab> <cd ab> <ce *** Failers ab> <cd /\w+/8 12 34 *** Failers +++=*! /\w{2,3}/8 ab cd abcd ce *** Failers a.b.c /\w{2,3}?/8 ab cd abcd ce *** Failers a.b.c /\W+/8 12====34 *** Failers abcd /\W{2,3}/8 ab====cd ab==cd *** Failers a.b.c /\W{2,3}?/8 ab====cd ab==cd *** Failers a.b.c /[\x{100}]/8 \x{100} Z\x{100} \x{100}Z *** Failers /[Z\x{100}]/8 Z\x{100} \x{100} \x{100}Z *** Failers /[\x{100}\x{200}]/8 ab\x{100}cd ab\x{200}cd *** Failers /[\x{100}-\x{200}]/8 ab\x{100}cd ab\x{200}cd ab\x{111}cd *** Failers /[z-\x{200}]/8 ab\x{100}cd ab\x{200}cd ab\x{111}cd abzcd ab|cd *** Failers /[Q\x{100}\x{200}]/8 ab\x{100}cd ab\x{200}cd Q? *** Failers /[Q\x{100}-\x{200}]/8 ab\x{100}cd ab\x{200}cd ab\x{111}cd Q? *** Failers /[Qz-\x{200}]/8 ab\x{100}cd ab\x{200}cd ab\x{111}cd abzcd ab|cd Q? *** Failers /[\x{100}\x{200}]{1,3}/8 ab\x{100}cd ab\x{200}cd ab\x{200}\x{100}\x{200}\x{100}cd *** Failers /[\x{100}\x{200}]{1,3}?/8 ab\x{100}cd ab\x{200}cd ab\x{200}\x{100}\x{200}\x{100}cd *** Failers /[Q\x{100}\x{200}]{1,3}/8 ab\x{100}cd ab\x{200}cd ab\x{200}\x{100}\x{200}\x{100}cd *** Failers /[Q\x{100}\x{200}]{1,3}?/8 ab\x{100}cd ab\x{200}cd ab\x{200}\x{100}\x{200}\x{100}cd *** Failers /(?<=[\x{100}\x{200}])X/8 abc\x{200}X abc\x{100}X *** Failers X /(?<=[Q\x{100}\x{200}])X/8 abc\x{200}X abc\x{100}X abQX *** Failers X /(?<=[\x{100}\x{200}]{3})X/8 abc\x{100}\x{200}\x{100}X *** Failers abc\x{200}X X /[^\x{100}\x{200}]X/8 AX \x{150}X \x{500}X *** Failers \x{100}X \x{200}X /[^Q\x{100}\x{200}]X/8 AX \x{150}X \x{500}X *** Failers \x{100}X \x{200}X QX /[^\x{100}-\x{200}]X/8 AX \x{500}X *** Failers \x{100}X \x{150}X \x{200}X /[z-\x{100}]/8i z Z \x{100} *** Failers \x{102} y /[\xFF]/ >\xff< /[\xff]/8 >\x{ff}< /[^\xFF]/ XYZ /[^\xff]/8 XYZ \x{123} /^[ac]*b/8 xb /^[ac\x{100}]*b/8 xb /^[^x]*b/8i xb /^[^x]*b/8 xb /^\d*b/8 xb /(|a)/g8 catac a\x{256}a /^\x{85}$/8i \x{85} /^abc./mgx8<any> abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x{0085}abc7 \x{2028}abc8 \x{2029}abc9 JUNK /abc.$/mgx8<any> abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x{0085} abc7\x{2028} abc8\x{2029} abc9 /^a\Rb/8<bsr_unicode> a\nb a\rb a\r\nb a\x0bb a\x0cb a\x{85}b a\x{2028}b a\x{2029}b ** Failers a\n\rb /^a\R*b/8<bsr_unicode> ab a\nb a\rb a\r\nb a\x0bb a\x0c\x{2028}\x{2029}b a\x{85}b a\n\rb a\n\r\x{85}\x0cb /^a\R+b/8<bsr_unicode> a\nb a\rb a\r\nb a\x0bb a\x0c\x{2028}\x{2029}b a\x{85}b a\n\rb a\n\r\x{85}\x0cb ** Failers ab /^a\R{1,3}b/8<bsr_unicode> a\nb a\n\rb a\n\r\x{85}b a\r\n\r\nb a\r\n\r\n\r\nb a\n\r\n\rb a\n\n\r\nb ** Failers a\n\n\n\rb a\r /\h+\V?\v{3,4}/8O \x09\x20\x{a0}X\x0a\x0b\x0c\x0d\x0a /\V?\v{3,4}/8O \x20\x{a0}X\x0a\x0b\x0c\x0d\x0a /\h+\V?\v{3,4}/8O >\x09\x20\x{a0}X\x0a\x0a\x0a< /\V?\v{3,4}/8O >\x09\x20\x{a0}X\x0a\x0a\x0a< /\H\h\V\v/8 X X\x0a X\x09X\x0b ** Failers \x{a0} X\x0a /\H*\h+\V?\v{3,4}/8O \x09\x20\x{a0}X\x0a\x0b\x0c\x0d\x0a \x09\x20\x{a0}\x0a\x0b\x0c\x0d\x0a \x09\x20\x{a0}\x0a\x0b\x0c ** Failers \x09\x20\x{a0}\x0a\x0b /\H\h\V\v/8 \x{3001}\x{3000}\x{2030}\x{2028} X\x{180e}X\x{85} ** Failers \x{2009} X\x0a /\H*\h+\V?\v{3,4}/8O \x{1680}\x{180e}\x{2007}X\x{2028}\x{2029}\x0c\x0d\x0a \x09\x{205f}\x{a0}\x0a\x{2029}\x0c\x{2028}\x0a \x09\x20\x{202f}\x0a\x0b\x0c ** Failers \x09\x{200a}\x{a0}\x{2028}\x0b /a\Rb/I8<bsr_anycrlf> a\rb a\nb a\r\nb ** Failers a\x{85}b a\x0bb /a\Rb/I8<bsr_unicode> a\rb a\nb a\r\nb a\x{85}b a\x0bb ** Failers a\x{85}b\<bsr_anycrlf> a\x0bb\<bsr_anycrlf> /a\R?b/I8<bsr_anycrlf> a\rb a\nb a\r\nb ** Failers a\x{85}b a\x0bb /a\R?b/I8<bsr_unicode> a\rb a\nb a\r\nb a\x{85}b a\x0bb ** Failers a\x{85}b\<bsr_anycrlf> a\x0bb\<bsr_anycrlf> /X/8f<any> A\x{1ec5}ABCXYZ /abcd*/8 xxxxabcd\P xxxxabcd\P\P /abcd*/i8 xxxxabcd\P xxxxabcd\P\P XXXXABCD\P XXXXABCD\P\P /abc\d*/8 xxxxabc1\P xxxxabc1\P\P /abc[de]*/8 xxxxabcde\P xxxxabcde\P\P /\bthe cat\b/8 the cat\P the cat\P\P /ab\Cde/8 abXde /(?<=ab\Cde)X/8 /./8<CRLF> \r\P \r\P\P /.{2,3}/8<CRLF> \r\P \r\P\P \r\r\P \r\r\P\P \r\r\r\P \r\r\r\P\P /.{2,3}?/8<CRLF> \r\P \r\P\P \r\r\P \r\r\P\P \r\r\r\P \r\r\r\P\P /[^\x{100}]/8 \x{100}\x{101}X /[^\x{100}]+/8 \x{100}\x{101}X /-- End of testinput9 --/
{ "pile_set_name": "Github" }
//===- LowerWidenableCondition.cpp - Lower the guard intrinsic ---------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This pass lowers the llvm.widenable.condition intrinsic to default value // which is i1 true. // //===----------------------------------------------------------------------===// #include "llvm/Transforms/Scalar/LowerWidenableCondition.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Analysis/GuardUtils.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Function.h" #include "llvm/IR/InstIterator.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/Intrinsics.h" #include "llvm/IR/Module.h" #include "llvm/IR/PatternMatch.h" #include "llvm/Pass.h" #include "llvm/Transforms/Scalar.h" #include "llvm/Transforms/Utils/GuardUtils.h" using namespace llvm; namespace { struct LowerWidenableConditionLegacyPass : public FunctionPass { static char ID; LowerWidenableConditionLegacyPass() : FunctionPass(ID) { initializeLowerWidenableConditionLegacyPassPass( *PassRegistry::getPassRegistry()); } bool runOnFunction(Function &F) override; }; } static bool lowerWidenableCondition(Function &F) { // Check if we can cheaply rule out the possibility of not having any work to // do. auto *WCDecl = F.getParent()->getFunction( Intrinsic::getName(Intrinsic::experimental_widenable_condition)); if (!WCDecl || WCDecl->use_empty()) return false; using namespace llvm::PatternMatch; SmallVector<CallInst *, 8> ToLower; for (auto &I : instructions(F)) if (match(&I, m_Intrinsic<Intrinsic::experimental_widenable_condition>())) ToLower.push_back(cast<CallInst>(&I)); if (ToLower.empty()) return false; for (auto *CI : ToLower) { CI->replaceAllUsesWith(ConstantInt::getTrue(CI->getContext())); CI->eraseFromParent(); } return true; } bool LowerWidenableConditionLegacyPass::runOnFunction(Function &F) { return lowerWidenableCondition(F); } char LowerWidenableConditionLegacyPass::ID = 0; INITIALIZE_PASS(LowerWidenableConditionLegacyPass, "lower-widenable-condition", "Lower the widenable condition to default true value", false, false) Pass *llvm::createLowerWidenableConditionPass() { return new LowerWidenableConditionLegacyPass(); } PreservedAnalyses LowerWidenableConditionPass::run(Function &F, FunctionAnalysisManager &AM) { if (lowerWidenableCondition(F)) return PreservedAnalyses::none(); return PreservedAnalyses::all(); }
{ "pile_set_name": "Github" }
/** * 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. */ package org.apache.pinot.pql.parsers; import org.antlr.v4.runtime.RecognitionException; /** * Exceptions that occur while compiling PQL. */ public class Pql2CompilationException extends RuntimeException { public Pql2CompilationException(String message) { super(message); } public Pql2CompilationException(String msg, Object offendingSymbol, int line, int charPositionInLine, RecognitionException e) { super(line + ":" + charPositionInLine + ": '" + offendingSymbol + "' " + msg, e); } }
{ "pile_set_name": "Github" }
%AFFINE Construct affine (linear) mapping from parameters % % W = AFFINE(R,OFFSET,LABLIST_IN,LABLIST_OUT,SIZE_IN,SIZE_OUT) % W = AFFINE(R,OFFSET,A) % W = AFFINE(W1,W2) % % INPUT % R Matrix of a linear mapping from a K- to an L-dimensional space % OFFSET Shift applied after R; a row vector of the length L % (optional; default: zeros(1,L)) % LABLIST_IN Labels of the features of the input space % (optional; default: (1:K)') % LABLIST_OUT Labels of the features of the output space, e.g. class names % for linear classifiers (optional; default: (1:L)') % SIZE_IN If based on images: size vector of the input dimensionality % (optional; default: K) % SIZE_OUT If based on images: size vector of the output dimensionality % (optional; default: L) % A Dataset (LAB_IN_LIST and SIZE_IN are derived from A) % W1,W2 Affine mappings % % OUTPUT % W Affine mapping % % DESCRIPTION % This is a low level basic PRTools routine, not intended for direct use. % It efines a mapping W based on a linear transformation R and an offset. % R should be a [K x L] matrix describing a linear transformation from % a K-dimensional space to an L-dimensional space. If K=1, then R is % interpreted as the diagonal of an [L x L] diagonal matrix. OFFSET is % a row vector of the length L, added afterwards. % % Affine mappings are treated by PRTools in a special way. A scaling % defined for an affine mapping, e.g. by W = SETSCALE(W,SCALE) is directly % executed by a multiplication of the coefficients. Also, the product of % two affine mappings is directly converted to a new affine mapping. % This routine also executes W = AFFINE(W1,W2), if W1 and W2 are affine. % B = AFFINE(A,W), if A is a dataset and W is an affine mapping. % Finally, the transpose of an affine mapping exists and is defined as % an another affine mapping. % % An [M x K] dataset A can be mapped as D = A*W. The result is equivalent % to [+A, ones(M,1)]*[R; OFFSET]. The dataset D has feature labels stored % in LABLIST. The number of this labels should, thereby, be at least L. % % SEE ALSO (<a href="http://37steps.com/prtools">PRTools Guide</a>) % DATASETS, MAPPINGS % Copyright: R.P.W. Duin, [email protected] % Faculty EWI, Delft University of Technology % P.O. Box 5031, 2600 GA Delft, The Netherlands % $Id: affine.m,v 1.10 2009/03/17 10:03:51 duin Exp $ function w = affine(R,offset,lablist_in, lablist_out,size_in,size_out) if (nargin == 1) | (~isa(offset,'prmapping')) % Definition of an affine mapping [m,k] = size(R); if (nargin < 6) prwarning(5,'SIZE_OUT is not specified. The number of columns of R, %d, is assumed.', k); size_out = k; end if (nargin < 5) prwarning(5,'SIZE_IN is not specified. The number of rows of R, %d, is assumed.', m); size_in = m; end if (nargin < 4) prwarning(5,'LABLIST_OUT is not specified, [1:%d]'' assumed.', k); lablist_out = []; end if (nargin < 3) prwarning(5,'LABLIST_IN is not specified, [1:%d]'' assumed.', m); lablist_in = []; end if (nargin < 2) | (isempty(offset)) prwarning(3,'OFFSET not specified, a zero vector assumed.'); offset = zeros(1,k); end % Check consistencies if (~isa(R,'double')) error('No proper transformation matrix stored.') end if (size_in == 1) & nargin < 3 % R is a scaling vector size_in = size_out; end if (isempty(lablist_in)) lablist_in = genlab(1,[1:size_in]'); end cost = []; if (isa(lablist_in,'prdataset')) % Copy labels from dataset/datafile cost = lablist_in.cost; size_in = getfeatsize(lablist_in); lablist_in = getfeatlab(lablist_in); %if isempty(lablist_in) % lablist_in = num2str([1:size_in]'); %end % size_out = k; % Wrong for classifiers defined for 1D datasets end if ~isempty(lablist_in) & (size(lablist_in,1) < m) error('Wrong number of input labels supplied.') end if isempty(lablist_out) lablist_out = genlab(1,[1:size_out]'); end if (size(lablist_out,1) < k) error('Wrong number of output labels supplied.') end if any(size(offset) ~= [1,k]) error('Offset is not a row vector of the correct size.') end % Store the results: d.rot = R; d.offset = offset; d.lablist_in = lablist_in; w = prmapping(mfilename,'trained',d,lablist_out,size_in,size_out); w = setcost(w,cost); elseif isa(R,'prmapping') % Two mappings, stored in R and OFFSET, should be combined. w1 = R; w2 = offset; if (~isclassifier(w1)) & (~isclassifier(w2)) & (strcmp(getmapping_file(w1),'affine')) & (strcmp(getmapping_file(w2),'affine')) % Combine two affine mappings % If d1.rot or d2.rot are vectors, they have to be interpreted as % the diagonal matrices, unless the inner dimension does not fit. d1 = +w1; d2 = +w2; if (size(d1.rot,1) == 1) % d1.rot is a vector if (size(d2.rot) == 1) % d2.rot is a vector d.rot = d1.rot.*d2.rot; d.offset = d1.offset.*d2.rot + d2.offset; else % d2.rot is a matrix d.rot = repmat(d1.rot',1,size(d2.rot,2)).*d2.rot; d.offset = d1.offset*d2.rot + d2.offset; end else % d1.rot is a matrix %RD Here comes a bug fix that I needed to continue, I am not sure it %RD is sufficient It may even introduce new problems, especially for % 1D datasets. %if size(d2.rot,1) == 1 % d2.rot is vector if (size(d1.rot,2) > 1) & (size(d2.rot,1) == 1) % d2.rot is a vector d.rot = d1.rot.*repmat(d2.rot,size(d1.rot,1),1); d.offset = d1.offset.*d2.rot + d2.offset; else % d2.rot is a matrix d.rot = d1.rot*d2.rot; d.offset = d1.offset*d2.rot + d2.offset; end end d.lablist_in = d1.lablist_in; w = prmapping(mfilename,'trained',d,getlabels(w2),getsize_in(w1),getsize_out(w2)); else % Store a sequential mapping. w = sequential(w1,w2); end else % Execution of the affine mapping. % R is a dataset or double, OFFSET defines the mapping. v = offset; [m,k] = size(R); d = +v; if all(size(v) == 0) d.rot = repmat(d.rot,1,k); d.offset = zeros(1,k); end if (size(d.rot,1) == 1) & (k > 1) % No rotation, just a scaling x = zeros(m,k); Rdat = +R; if (m > k) % Necessary switch for handling large feature sizes. for j=1:k x(:,j) = Rdat(:,j)*d.rot(j); end else for i=1:m x(i,:) = Rdat(i,:).*d.rot; end end x = x + repmat(d.offset,m,1); else % Rotation. x = [+R,ones(m,1)] * [d.rot;d.offset]; end if size(v,2) == 2 & size(x,2) == 1 x = [x -x]; end if isdataset(R) w = setdat(R,x,v); else w = x; end end return;
{ "pile_set_name": "Github" }
<?php /* * This file is part of the Elcodi package. * * Copyright (c) 2014-2016 Elcodi Networks S.L. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * * Feel free to edit as you please, and have fun. * * @author Marc Morera <[email protected]> * @author Aldo Chiecchia <[email protected]> * @author Elcodi Team <[email protected]> */ namespace Elcodi\Component\Product\StockValidator\Interfaces; use Elcodi\Component\Product\Entity\Interfaces\PurchasableInterface; /** * Interface PurchasableStockValidatorInterface. */ interface PurchasableStockValidatorInterface { /** * Get the entity interface. * * @return string Namespace */ public function getPurchasableNamespace(); /** * Gets purchasable validation. * * @param PurchasableInterface $purchasable Purchasable * @param int $stockRequired Stock required * @param bool $useStock Use stock * * @return bool|int Is valid or the number of elements that can be used */ public function isStockAvailable( PurchasableInterface $purchasable, $stockRequired, $useStock ); }
{ "pile_set_name": "Github" }
require('./lib/accounts.js'); require('./lib/transactions.js'); require('./lib/peers.transactions.js'); require('./lib/peers.secondpassword.js'); require('./lib/peers.contacts.js'); require('./lib/peers.usernames.js'); require('./lib/miscellaneous.js'); require('./lib/peers.delegates.js'); require('./lib/peers.votes.js'); require('./lib/delegates.js'); require('./lib/dapps.js'); require('./lib/multisignatures.js');
{ "pile_set_name": "Github" }
/* * Copyright (C) 2014 The Android Open Source Project * * 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 dexfuzz.fuzzers; import dexfuzz.Options; import dexfuzz.listeners.BaseListener; import dexfuzz.program.Program; /** * Fuzz programs multiple times, testing each. */ public class FuzzerMultipleExecute extends FuzzerMultiple { public FuzzerMultipleExecute(BaseListener listener) { super(listener); addExecutors(); } @Override protected String getNextOutputFilename() { // In MultipleExecute, always use the same output. return Options.outputFile; } @Override public void run() { // TODO: Test that all seed files execute correctly before they are mutated! for (iterations = 0; iterations < Options.repeat; iterations++) { listener.handleIterationStarted(iterations); Program program = fuzz(); if (safeToExecute()) { execute(program); } listener.handleIterationFinished(iterations); } listener.handleSummary(); } }
{ "pile_set_name": "Github" }
/* Copyright 2015 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. */ package tokenreview import ( "fmt" "net/http" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apiserver/pkg/authentication/authenticator" genericapirequest "k8s.io/apiserver/pkg/endpoints/request" "k8s.io/kubernetes/pkg/apis/authentication" ) type REST struct { tokenAuthenticator authenticator.Request } func NewREST(tokenAuthenticator authenticator.Request) *REST { return &REST{tokenAuthenticator: tokenAuthenticator} } func (r *REST) New() runtime.Object { return &authentication.TokenReview{} } func (r *REST) Create(ctx genericapirequest.Context, obj runtime.Object, includeUninitialized bool) (runtime.Object, error) { tokenReview, ok := obj.(*authentication.TokenReview) if !ok { return nil, apierrors.NewBadRequest(fmt.Sprintf("not a TokenReview: %#v", obj)) } namespace := genericapirequest.NamespaceValue(ctx) if len(namespace) != 0 { return nil, apierrors.NewBadRequest(fmt.Sprintf("namespace is not allowed on this type: %v", namespace)) } if r.tokenAuthenticator == nil { return tokenReview, nil } // create a header that contains nothing but the token fakeReq := &http.Request{Header: http.Header{}} fakeReq.Header.Add("Authorization", "Bearer "+tokenReview.Spec.Token) tokenUser, ok, err := r.tokenAuthenticator.AuthenticateRequest(fakeReq) tokenReview.Status.Authenticated = ok if err != nil { tokenReview.Status.Error = err.Error() } if tokenUser != nil { tokenReview.Status.User = authentication.UserInfo{ Username: tokenUser.GetName(), UID: tokenUser.GetUID(), Groups: tokenUser.GetGroups(), Extra: map[string]authentication.ExtraValue{}, } for k, v := range tokenUser.GetExtra() { tokenReview.Status.User.Extra[k] = authentication.ExtraValue(v) } } return tokenReview, nil }
{ "pile_set_name": "Github" }
// // GPLessonData.h // GPHandMade // // Created by dandan on 16/5/25. // Copyright © 2016年 dandan. All rights reserved. // #import <Foundation/Foundation.h> @interface GPLessonData : NSObject @property (nonatomic,copy) NSString *subject; // 主标题 @property (nonatomic,copy) NSString *content; // 内容 @property (nonatomic,copy) NSString *price; // 目前价格 @property (nonatomic,copy) NSString *original_price; // 原始价格 @property (nonatomic,copy) NSString *start_time; // 上课时间 @property (nonatomic,copy) NSString *address; // 上课地点 @property (nonatomic, strong) NSArray *pic; // 轮播图片 @property (nonatomic,copy) NSString *people_min; //上课最少人数 @property (nonatomic,copy) NSString *people_max; // 上课最大人数 @property (nonatomic,copy) NSString *deadline; // 截止报名时间 @property (nonatomic,copy) NSString *buyer_num; // 已购买人数 @property (nonatomic,copy) NSString *view; //评分人数 @property (nonatomic, strong) NSArray *material; // 材料 @property (nonatomic, strong) NSArray *tools; // 工具 @property (nonatomic,copy) NSString *uname; //作者单位 @property (nonatomic,copy) NSString *teacher_des; // 作者简介 @property (nonatomic, strong) NSArray *other_class; // 老师其他课程 @property (nonatomic,copy) NSString *face_pic; // 头像 @property (nonatomic,copy) NSString *create_time; // 创建时间 @property (nonatomic,copy) NSString *material_price; //材料价格 @property (nonatomic, strong) NSArray *allInfoNew; // 以上所有信息 @property (nonatomic, strong) NSArray *appraise; // 老师其他课程 @end
{ "pile_set_name": "Github" }
/* 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 client-gen. DO NOT EDIT. package v1beta1 import ( "context" v1beta1 "k8s.io/api/authentication/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) // TokenReviewsGetter has a method to return a TokenReviewInterface. // A group's client should implement this interface. type TokenReviewsGetter interface { TokenReviews() TokenReviewInterface } // TokenReviewInterface has methods to work with TokenReview resources. type TokenReviewInterface interface { Create(ctx context.Context, tokenReview *v1beta1.TokenReview, opts v1.CreateOptions) (*v1beta1.TokenReview, error) TokenReviewExpansion } // tokenReviews implements TokenReviewInterface type tokenReviews struct { client rest.Interface } // newTokenReviews returns a TokenReviews func newTokenReviews(c *AuthenticationV1beta1Client) *tokenReviews { return &tokenReviews{ client: c.RESTClient(), } } // Create takes the representation of a tokenReview and creates it. Returns the server's representation of the tokenReview, and an error, if there is any. func (c *tokenReviews) Create(ctx context.Context, tokenReview *v1beta1.TokenReview, opts v1.CreateOptions) (result *v1beta1.TokenReview, err error) { result = &v1beta1.TokenReview{} err = c.client.Post(). Resource("tokenreviews"). VersionedParams(&opts, scheme.ParameterCodec). Body(tokenReview). Do(ctx). Into(result) return }
{ "pile_set_name": "Github" }
/** * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved. * * This source file is released under GPL v2 license (no other versions). * See the COPYING file included in the main directory of this source * distribution for the license terms and conditions. * * @File cthw20k2.h * * @Brief * This file contains the definition of hardware access methord. * * @Author Liu Chun * @Date May 13 2008 * */ #ifndef CTHW20K2_H #define CTHW20K2_H #include "cthardware.h" int create_20k2_hw_obj(struct hw **rhw); int destroy_20k2_hw_obj(struct hw *hw); #endif /* CTHW20K2_H */
{ "pile_set_name": "Github" }
$unittestResults; $test_name; $naked; $proc_x; $proc_y; $func_x; $func_y; $func_a; $n; $ok; $log; $count; $varToChange; $rand; $item; $text; $number_of_calls; $list2; $proc_z; $func_z; $x; $proc_w; $func_c; $if2; $i; $loglist; $changing_list; $list_copy; function unittest_report() { global $unittestResults; // Create test report. $report = array(); $summary = array(); $fails = 0; for ($x = 0; $x < count($unittestResults); $x++) { if ($unittestResults[$x][0]) { array_push($summary, "."); } else { array_push($summary, "F"); $fails++; array_push($report, ""); array_push($report, "FAIL: " . $unittestResults[$x][2]); array_push($report, $unittestResults[$x][1]); } } array_unshift($report, implode("", $summary)); array_push($report, ""); array_push($report, "Number of tests run: " . count($unittestResults)); array_push($report, ""); if ($fails) { array_push($report, "FAILED (failures=" . $fails . ")"); } else { array_push($report, "OK"); } return implode("\n", $report); } function assertEquals($actual, $expected, $message) { global $unittestResults; // Asserts that a value equals another value. if (!is_array($unittestResults)) { throw new Exception("Orphaned assert: " . $message); } if ($actual == $expected) { array_push($unittestResults, [true, "OK", $message]); } else { $expected = is_array($expected) ? implode(" ", $expected) : $expected; $actual = is_array($actual) ? implode(" ", $actual) : $actual; array_push($unittestResults, [false, "Expected: " . $expected . "\nActual: " . $actual, $message]); } } function unittest_fail($message) { global $unittestResults; // Always assert an error. if (!$unittestResults) { throw new Exception("Orphaned assert fail: " . $message); } array_push($unittestResults, [false, "Fail.", $message]); } // Describe this function... function test_if() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; if (false) { unittest_fail('if false'); } $ok = false; if (true) { $ok = true; } assertEquals($ok, true, 'if true'); $ok = false; if (false) { unittest_fail('if/else false'); } else { $ok = true; } assertEquals($ok, true, 'if/else false'); $ok = false; if (true) { $ok = true; } else { unittest_fail('if/else true'); } assertEquals($ok, true, 'if/else true'); $ok = false; if (false) { unittest_fail('elseif 1'); } else if (true) { $ok = true; } else if (true) { unittest_fail('elseif 2'); } else { unittest_fail('elseif 3'); } assertEquals($ok, true, 'elseif 4'); } // Describe this function... function test_ifelse() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $ok = false; if (true) { $ok = true; } else { unittest_fail('ifelse true'); } assertEquals($ok, true, 'ifelse true'); $ok = false; if (false) { unittest_fail('ifelse false'); } else { $ok = true; } assertEquals($ok, true, 'ifelse false'); } // Describe this function... function test_equalities() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(2 == 2, true, 'Equal yes'); assertEquals(3 == 4, false, 'Equal no'); assertEquals(5 != 6, true, 'Not equal yes'); assertEquals(3 == 4, false, 'Not equal no'); assertEquals(5 < 6, true, 'Smaller yes'); assertEquals(7 < 7, false, 'Smaller no'); assertEquals(9 > 8, true, 'Greater yes'); assertEquals(10 > 10, false, 'Greater no'); assertEquals(11 <= 11, true, 'Smaller-equal yes'); assertEquals(13 <= 12, false, 'Smaller-equal no'); assertEquals(14 >= 14, true, 'Greater-equal yes'); assertEquals(15 >= 16, false, 'Greater-equal no'); } // Describe this function... function test_and() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(true && true, true, 'And true/true'); assertEquals(false && true, false, 'And false/true'); assertEquals(true && false, false, 'And true/false'); assertEquals(false && false, false, 'And false/false'); } // Describe this function... function test_or() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(true || true, true, 'Or true/true'); assertEquals(false || true, true, 'Or false/true'); assertEquals(true || false, true, 'Or true/false'); assertEquals(false || false, false, 'Or false/false'); } // Describe this function... function test_ternary() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(true ? 42 : 99, 42, 'if true'); assertEquals(false ? 42 : 99, 99, 'if true'); } // Describe this function... function test_foreach() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $log = ''; foreach (array('a', 'b', 'c') as $x) { $log .= $x; } assertEquals($log, 'abc', 'for loop'); } // Describe this function... function test_repeat() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $count = 0; for ($count2 = 0; $count2 < 10; $count2++) { $count += 1; } assertEquals($count, 10, 'repeat 10'); } // Describe this function... function test_while() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; while (false) { unittest_fail('while 0'); } while (!true) { unittest_fail('until 0'); } $count = 1; while ($count != 10) { $count += 1; } assertEquals($count, 10, 'while 10'); $count = 1; while (!($count == 10)) { $count += 1; } assertEquals($count, 10, 'until 10'); } // Describe this function... function test_repeat_ext() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $count = 0; for ($count3 = 0; $count3 < 10; $count3++) { $count += 1; } assertEquals($count, 10, 'repeat 10'); } // Describe this function... function test_count_by() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $log = ''; for ($x = 1; $x <= 8; $x += 2) { $log .= $x; } assertEquals($log, '1357', 'count up ints'); $log = ''; for ($x = 8; $x >= 1; $x -= 2) { $log .= $x; } assertEquals($log, '8642', 'count down ints'); $loglist = array(); for ($x = 1; $x <= 8; $x += 1.5) { array_push($loglist, $x); } assertEquals($loglist, array(1, 2.5, 4, 5.5, 7), 'count with floats'); $loglist = array(); $_x_start = 1 + 0; $_x_end = 8 + 0; $_x_inc = abs(1 - 2); if ($_x_start > $_x_end) { $_x_inc = -$_x_inc; } for ($x = $_x_start; $_x_inc >= 0 ? $x <= $_x_end : $x >= $_x_end; $x += $_x_inc) { array_push($loglist, $x); } assertEquals($loglist, array(1, 2, 3, 4, 5, 6, 7, 8), 'count up non-trivial ints'); $loglist = array(); $_x_start2 = 8 + 0; $_x_end2 = 1 + 0; $_x_inc2 = 2; if ($_x_start2 > $_x_end2) { $_x_inc2 = -$_x_inc2; } for ($x = $_x_start2; $_x_inc2 >= 0 ? $x <= $_x_end2 : $x >= $_x_end2; $x += $_x_inc2) { array_push($loglist, $x); } assertEquals($loglist, array(8, 6, 4, 2), 'count down non-trivial ints'); $loglist = array(); $_x_start3 = 5 + 0.5; $_x_end3 = 1 + 0; $_x_inc3 = abs(1 + 0); if ($_x_start3 > $_x_end3) { $_x_inc3 = -$_x_inc3; } for ($x = $_x_start3; $_x_inc3 >= 0 ? $x <= $_x_end3 : $x >= $_x_end3; $x += $_x_inc3) { array_push($loglist, $x); } assertEquals($loglist, array(5.5, 4.5, 3.5, 2.5, 1.5), 'count with floats'); } // Describe this function... function test_count_loops() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $log = ''; for ($x = 1; $x <= 8; $x++) { $log .= $x; } assertEquals($log, '12345678', 'count up'); $log = ''; for ($x = 8; $x >= 1; $x--) { $log .= $x; } assertEquals($log, '87654321', 'count down'); $loglist = array(); $_x_start4 = 1 + 0; $_x_end4 = 4 + 0; $_x_inc4 = 1; if ($_x_start4 > $_x_end4) { $_x_inc4 = -$_x_inc4; } for ($x = $_x_start4; $_x_inc4 >= 0 ? $x <= $_x_end4 : $x >= $_x_end4; $x += $_x_inc4) { array_push($loglist, $x); } assertEquals($loglist, array(1, 2, 3, 4), 'count up non-trivial'); $loglist = array(); $_x_start5 = 3 + 1; $_x_end5 = 1 + 0; $_x_inc5 = 1; if ($_x_start5 > $_x_end5) { $_x_inc5 = -$_x_inc5; } for ($x = $_x_start5; $_x_inc5 >= 0 ? $x <= $_x_end5 : $x >= $_x_end5; $x += $_x_inc5) { array_push($loglist, $x); } assertEquals($loglist, array(4, 3, 2, 1), 'count down non-trivial'); } // Describe this function... function test_continue() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $log = ''; $count = 0; while ($count != 8) { $count += 1; if ($count == 5) { continue; } $log .= $count; } assertEquals($log, '1234678', 'while continue'); $log = ''; $count = 0; while (!($count == 8)) { $count += 1; if ($count == 5) { continue; } $log .= $count; } assertEquals($log, '1234678', 'until continue'); $log = ''; for ($x = 1; $x <= 8; $x++) { if ($x == 5) { continue; } $log .= $x; } assertEquals($log, '1234678', 'count continue'); $log = ''; foreach (array('a', 'b', 'c', 'd') as $x) { if ($x == 'c') { continue; } $log .= $x; } assertEquals($log, 'abd', 'for continue'); } // Describe this function... function test_break() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $count = 1; while ($count != 10) { if ($count == 5) { break; } $count += 1; } assertEquals($count, 5, 'while break'); $count = 1; while (!($count == 10)) { if ($count == 5) { break; } $count += 1; } assertEquals($count, 5, 'until break'); $log = ''; for ($x = 1; $x <= 8; $x++) { if ($x == 5) { break; } $log .= $x; } assertEquals($log, '1234', 'count break'); $log = ''; foreach (array('a', 'b', 'c', 'd') as $x) { if ($x == 'c') { break; } $log .= $x; } assertEquals($log, 'ab', 'for break'); } // Tests the "single" block. function test_single() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(sqrt(25), 5, 'sqrt'); assertEquals(abs(-25), 25, 'abs'); assertEquals(-(-25), 25, 'negate'); assertEquals(log(1), 0, 'ln'); assertEquals(log(100) / log(10), 2, 'log10'); assertEquals(exp(2), 7.38905609893065, 'exp'); assertEquals(pow(10,2), 100, 'power10'); } // Tests the "arithmetic" block for all operations and checks // parenthesis are properly generated for different orders. function test_arithmetic() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(1 + 2, 3, 'add'); assertEquals(1 - 2, -1, 'subtract'); assertEquals(1 - (0 + 2), -1, 'subtract order with add'); assertEquals(1 - (0 - 2), 3, 'subtract order with subtract'); assertEquals(4 * 2.5, 10, 'multiply'); assertEquals(4 * (0 + 2.5), 10, 'multiply order'); assertEquals(8.2 / -5, -1.64, 'divide'); assertEquals(8.2 / (0 + -5), -1.64, 'divide order'); assertEquals(10 ** 4, 10000, 'power'); assertEquals(10 ** (0 + 4), 10000, 'power order'); } // Tests the "trig" block. function test_trig() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(sin(90 / 180 * pi()), 1, 'sin'); assertEquals(cos(180 / 180 * pi()), -1, 'cos'); assertEquals(tan(0 / 180 * pi()), 0, 'tan'); assertEquals(asin(-1) / pi() * 180, -90, 'asin'); assertEquals(acos(1) / pi() * 180, 0, 'acos'); assertEquals(atan(1) / pi() * 180, 45, 'atan'); } // Tests the "constant" blocks. function test_constant() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(floor(M_PI * 1000), 3141, 'const pi'); assertEquals(floor(M_E * 1000), 2718, 'const e'); assertEquals(floor(((1 + sqrt(5)) / 2) * 1000), 1618, 'const golden'); assertEquals(floor(M_SQRT2 * 1000), 1414, 'const sqrt 2'); assertEquals(floor(M_SQRT1_2 * 1000), 707, 'const sqrt 0.5'); assertEquals(9999 < INF, true, 'const infinity'); } function math_isPrime($n) { // https://en.wikipedia.org/wiki/Primality_test#Naive_methods if ($n == 2 || $n == 3) { return true; } // False if n is NaN, negative, is 1, or not whole. // And false if n is divisible by 2 or 3. if (!is_numeric($n) || $n <= 1 || $n % 1 != 0 || $n % 2 == 0 || $n % 3 == 0) { return false; } // Check all the numbers of form 6k +/- 1, up to sqrt(n). for ($x = 6; $x <= sqrt($n) + 1; $x += 6) { if ($n % ($x - 1) == 0 || $n % ($x + 1) == 0) { return false; } } return true; } // Tests the "number property" blocks. function test_number_properties() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(42 % 2 == 0, true, 'even'); assertEquals(42.1 % 2 == 1, false, 'odd'); assertEquals(math_isPrime(5), true, 'prime 5'); assertEquals(math_isPrime(25), false, 'prime 25'); assertEquals(math_isPrime(-31.1), false, 'prime negative'); assertEquals(is_int(M_PI), false, 'whole'); assertEquals(INF > 0, true, 'positive'); assertEquals(-42 < 0, true, 'negative'); assertEquals(42 % 2 == 0, true, 'divisible'); } // Tests the "round" block. function test_round() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(round(42.42), 42, 'round'); assertEquals(ceil(-42.42), -42, 'round up'); assertEquals(floor(42.42), 42, 'round down'); } // Tests the "change" block. function test_change() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $varToChange = 100; $varToChange += 42; assertEquals($varToChange, 142, 'change'); } function math_mean($myList) { return array_sum($myList) / count($myList); } function math_median($arr) { sort($arr,SORT_NUMERIC); return (count($arr) % 2) ? $arr[floor(count($arr)/2)] : ($arr[floor(count($arr)/2)] + $arr[floor(count($arr)/2) - 1]) / 2; } function math_modes($values) { if (empty($values)) return array(); $counts = array_count_values($values); arsort($counts); // Sort counts in descending order $modes = array_keys($counts, current($counts), true); return $modes; } function math_standard_deviation($numbers) { $n = count($numbers); if (!$n) return null; $mean = array_sum($numbers) / count($numbers); foreach($numbers as $key => $num) $devs[$key] = pow($num - $mean, 2); return sqrt(array_sum($devs) / (count($devs) - 1)); } function math_random_list($list) { $x = rand(0, count($list)-1); return $list[$x]; } function indexOf($haystack, $needle) { for ($index = 0; $index < count($haystack); $index++) { if ($haystack[$index] == $needle) return $index + 1; } return 0; } // Tests the "list operation" blocks. function test_operations_on_list() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(array_sum((array(3, 4, 5))), 12, 'sum'); assertEquals(min((array(3, 4, 5))), 3, 'min'); assertEquals(max((array(3, 4, 5))), 5, 'max'); assertEquals(math_mean(array(3, 4, 5)), 4, 'average'); assertEquals(math_median(array(3, 4, 5, 1)), 3.5, 'median'); assertEquals(math_modes(array(3, 4, 3)), array(3), 'modes'); assertEquals(math_modes(array(3, 4, 3, 1, 4)), array(3, 4), 'modes multiple'); assertEquals(math_standard_deviation(array(3, 3, 3)), 0, 'standard dev'); assertEquals(indexOf(array(3, 4, 5), math_random_list(array(3, 4, 5))) > 0, true, 'random'); } // Tests the "mod" block. function test_mod() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(42 % 5, 2, 'mod'); } // Tests the "constrain" block. function test_constraint() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(min(max(100, 0), 42), 42, 'constraint'); } function math_random_int($a, $b) { if ($a > $b) { return rand($b, $a); } return rand($a, $b); } // Tests the "random integer" block. function test_random_integer() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $rand = math_random_int(5, 10); assertEquals($rand >= 5 && $rand <= 10, true, 'randRange'); assertEquals(is_int($rand), true, 'randInteger'); } // Tests the "random fraction" block. function test_random_fraction() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $rand = (float)rand()/(float)getrandmax(); assertEquals($rand >= 0 && $rand <= 1, true, 'randFloat'); } // Describe this function... function test_atan2() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(atan2(5, -5) / pi() * 180, 135, 'atan2'); assertEquals(atan2(-12, 0) / pi() * 180, -90, 'atan2'); } // Checks that the number of calls is one in order // to confirm that a function was only called once. function check_number_of_calls($test_name) { global $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $test_name .= 'number of calls'; assertEquals($number_of_calls, 1, $test_name); } // Tests the "create text with" block with varying number of inputs. function test_create_text() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals('', '', 'no text'); assertEquals('Hello', 'Hello', 'create single'); assertEquals(-1, '-1', 'create single number'); assertEquals('K' . 9, 'K9', 'create double text'); assertEquals(4 . 2, '42', 'create double text numbers'); assertEquals(implode('', array(1,2,3)), '123', 'create triple'); assertEquals(implode('', array(1,true ? 0 : null,'M')), '10M', 'create order'); } // Creates an empty string for use with the empty test. function get_empty() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; return ''; } // Tests the "is empty" block". function test_empty_text() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(empty('Google'), false, 'not empty'); assertEquals(empty(''), true, 'empty'); assertEquals(empty(get_empty()), true, 'empty complex'); assertEquals(empty(true ? '' : null), true, 'empty order'); } function length($value) { if (is_string($value)) { return strlen($value); } else { return count($value); } } // Tests the "length" block. function test_text_length() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(length(''), 0, 'zero length'); assertEquals(length('Google'), 6, 'non-zero length'); assertEquals(length(true ? 'car' : null), 3, 'length order'); } // Tests the "append text" block with different types of parameters. function test_append() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $item = 'Miserable'; $item .= 'Failure'; assertEquals($item, 'MiserableFailure', 'append text'); $item = 12; $item .= 34; assertEquals($item, '1234', 'append number'); $item = 'Something '; $item .= true ? 'Positive' : null; assertEquals($item, 'Something Positive', 'append order'); } function text_indexOf($text, $search) { $pos = strpos($text, $search); return $pos === false ? 0 : $pos + 1; } function text_lastIndexOf($text, $search) { $pos = strrpos($text, $search); return $pos === false ? 0 : $pos + 1; } // Tests the "find" block with a variable. function test_find_text_simple() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $text = 'Banana'; assertEquals(text_indexOf($text, 'an'), 2, 'find first simple'); assertEquals(text_lastIndexOf($text, 'an'), 4, 'find last simple'); assertEquals(text_indexOf($text, 'Peel'), 0, 'find none simple'); } // Creates a string for use with the find test. function get_fruit() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $number_of_calls += 1; return 'Banana'; } // Tests the "find" block with a function call. function test_find_text_complex() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $number_of_calls = 0; assertEquals(text_indexOf(get_fruit(), 'an'), 2, 'find first complex'); check_number_of_calls('find first complex'); $number_of_calls = 0; assertEquals(text_indexOf(true ? get_fruit() : null, 'an'), 2, 'find first order complex'); check_number_of_calls('find first order complex'); $number_of_calls = 0; assertEquals(text_lastIndexOf(get_fruit(), 'an'), 4, 'find last complex'); check_number_of_calls('find last complex'); $number_of_calls = 0; assertEquals(text_lastIndexOf(true ? get_fruit() : null, 'an'), 4, 'find last order complex'); check_number_of_calls('find last order complex'); $number_of_calls = 0; assertEquals(text_indexOf(get_fruit(), 'Peel'), 0, 'find none complex'); check_number_of_calls('find none complex'); $number_of_calls = 0; assertEquals(text_indexOf(true ? get_fruit() : null, 'Peel'), 0, 'find none order complex'); check_number_of_calls('find none order complex'); } function text_random_letter($text) { return $text[rand(0, strlen($text) - 1)]; } // Tests the "get letter" block with a variable. function test_get_text_simple() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $text = 'Blockly'; assertEquals(substr($text, 0, 1), 'B', 'get first simple'); assertEquals(substr($text, -1), 'y', 'get last simple'); assertEquals(text_indexOf($text, text_random_letter($text)) > 0, true, 'get random simple'); assertEquals(substr($text, 2, 1), 'o', 'get # simple'); assertEquals(substr($text, ((true ? 3 : null) - 1), 1), 'o', 'get # order simple'); assertEquals(substr($text, -3, 1), 'k', 'get #-end simple'); // The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index. assertEquals(substr($text, (-(0 + 3)), 1), 'k', 'get #-end order simple'); } // Creates a string for use with the get test. function get_Blockly() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $number_of_calls += 1; return 'Blockly'; } // Tests the "get letter" block with a function call. function test_get_text_complex() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $text = 'Blockly'; $number_of_calls = 0; assertEquals(substr(get_Blockly(), 0, 1), 'B', 'get first complex'); check_number_of_calls('get first complex'); $number_of_calls = 0; assertEquals(substr(true ? get_Blockly() : null, 0, 1), 'B', 'get first order complex'); check_number_of_calls('get first order complex'); $number_of_calls = 0; assertEquals(substr(get_Blockly(), -1), 'y', 'get last complex'); check_number_of_calls('get last complex'); $number_of_calls = 0; assertEquals(substr(true ? get_Blockly() : null, -1), 'y', 'get last order complex'); check_number_of_calls('get last order complex'); $number_of_calls = 0; assertEquals(text_indexOf($text, text_random_letter(get_Blockly())) > 0, true, 'get random complex'); check_number_of_calls('get random complex'); $number_of_calls = 0; assertEquals(text_indexOf($text, text_random_letter(true ? get_Blockly() : null)) > 0, true, 'get random order complex'); check_number_of_calls('get random order complex'); $number_of_calls = 0; assertEquals(substr(get_Blockly(), 2, 1), 'o', 'get # complex'); check_number_of_calls('get # complex'); $number_of_calls = 0; assertEquals(substr(true ? get_Blockly() : null, ((true ? 3 : null) - 1), 1), 'o', 'get # order complex'); check_number_of_calls('get # order complex'); $number_of_calls = 0; assertEquals(substr(get_Blockly(), -3, 1), 'k', 'get #-end complex'); check_number_of_calls('get #-end complex'); $number_of_calls = 0; // The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index. assertEquals(substr(true ? get_Blockly() : null, (-(0 + 3)), 1), 'k', 'get #-end order complex'); check_number_of_calls('get #-end order complex'); } // Creates a string for use with the substring test. function get_numbers() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $number_of_calls += 1; return '123456789'; } function text_get_substring($text, $where1, $at1, $where2, $at2) { if ($where1 == 'FROM_END') { $at1 = strlen($text) - 1 - $at1; } else if ($where1 == 'FIRST') { $at1 = 0; } else if ($where1 != 'FROM_START') { throw new Exception('Unhandled option (text_get_substring).'); } $length = 0; if ($where2 == 'FROM_START') { $length = $at2 - $at1 + 1; } else if ($where2 == 'FROM_END') { $length = strlen($text) - $at1 - $at2; } else if ($where2 == 'LAST') { $length = strlen($text) - $at1; } else { throw new Exception('Unhandled option (text_get_substring).'); } return substr($text, $at1, $length); } // Tests the "get substring" block with a variable. function test_substring_simple() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $text = '123456789'; assertEquals(text_get_substring($text, 'FROM_START', 1, 'FROM_START', 2), '23', 'substring # simple'); assertEquals(text_get_substring($text, 'FROM_START', ((true ? 2 : null) - 1), 'FROM_START', ((true ? 3 : null) - 1)), '23', 'substring # simple order'); assertEquals(text_get_substring($text, 'FROM_END', 2, 'FROM_END', 1), '78', 'substring #-end simple'); // The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index. assertEquals(text_get_substring($text, 'FROM_END', ((0 + 3) - 1), 'FROM_END', ((0 + 2) - 1)), '78', 'substring #-end simple order'); assertEquals($text, $text, 'substring first-last simple'); assertEquals(text_get_substring($text, 'FROM_START', 1, 'FROM_END', 1), '2345678', 'substring # #-end simple'); assertEquals(text_get_substring($text, 'FROM_END', 6, 'FROM_START', 3), '34', 'substring #-end # simple'); assertEquals(text_get_substring($text, 'FIRST', 0, 'FROM_START', 3), '1234', 'substring first # simple'); assertEquals(text_get_substring($text, 'FIRST', 0, 'FROM_END', 1), '12345678', 'substring first #-end simple'); assertEquals(text_get_substring($text, 'FROM_START', 6, 'LAST', 0), '789', 'substring # last simple'); assertEquals(text_get_substring($text, 'FROM_END', 2, 'LAST', 0), '789', 'substring #-end last simple'); assertEquals(text_get_substring($text, 'FROM_START', 0, 'FROM_END', 0), '123456789', 'substring all with # #-end simple'); assertEquals(text_get_substring($text, 'FROM_END', 8, 'FROM_START', 8), '123456789', 'substring all with #-end # simple'); // Checks that the whole string is properly retrieved even if the value for start and end is not a simple number. This is especially important in generators where substring uses [x:length - y] for # #-end. assertEquals(text_get_substring($text, 'FROM_START', ((0 + 1) - 1), 'FROM_END', ((0 + 1) - 1)), '123456789', 'substring all with # #-end math simple'); } // Tests the "get substring" block with a function call. function test_substring_complex() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $number_of_calls = 0; assertEquals(text_get_substring((get_numbers()), 'FROM_START', 1, 'FROM_START', 2), '23', 'substring # complex'); check_number_of_calls('substring # complex'); $number_of_calls = 0; assertEquals(text_get_substring((true ? get_numbers() : null), 'FROM_START', ((true ? 2 : null) - 1), 'FROM_START', ((true ? 3 : null) - 1)), '23', 'substring # complex order'); check_number_of_calls('substring # complex order'); $number_of_calls = 0; // The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index. assertEquals(text_get_substring((get_numbers()), 'FROM_END', 2, 'FROM_END', 1), '78', 'substring #-end complex'); check_number_of_calls('substring #-end complex'); $number_of_calls = 0; assertEquals(text_get_substring((true ? get_numbers() : null), 'FROM_END', ((0 + 3) - 1), 'FROM_END', ((0 + 2) - 1)), '78', 'substring #-end order order'); check_number_of_calls('substring #-end order order'); $number_of_calls = 0; assertEquals((get_numbers()), $text, 'substring first-last'); check_number_of_calls('substring first-last'); $number_of_calls = 0; assertEquals(text_get_substring((get_numbers()), 'FROM_START', 1, 'FROM_END', 1), '2345678', 'substring # #-end complex'); check_number_of_calls('substring # #-end complex'); $number_of_calls = 0; assertEquals(text_get_substring((get_numbers()), 'FROM_END', 6, 'FROM_START', 3), '34', 'substring #-end # complex'); check_number_of_calls('substring #-end # complex'); $number_of_calls = 0; assertEquals(text_get_substring((get_numbers()), 'FIRST', 0, 'FROM_START', 3), '1234', 'substring first # complex'); check_number_of_calls('substring first # complex'); $number_of_calls = 0; assertEquals(text_get_substring((get_numbers()), 'FIRST', 0, 'FROM_END', 1), '12345678', 'substring first #-end complex'); check_number_of_calls('substring first #-end complex'); $number_of_calls = 0; assertEquals(text_get_substring((get_numbers()), 'FROM_START', 6, 'LAST', 0), '789', 'substring # last complex'); check_number_of_calls('substring # last complex'); $number_of_calls = 0; assertEquals(text_get_substring((get_numbers()), 'FROM_END', 2, 'LAST', 0), '789', 'substring #-end last complex'); check_number_of_calls('substring #-end last complex'); $number_of_calls = 0; assertEquals(text_get_substring((get_numbers()), 'FROM_START', 0, 'FROM_END', 0), '123456789', 'substring all with # #-end complex'); check_number_of_calls('substring all with # #-end complex'); $number_of_calls = 0; assertEquals(text_get_substring((get_numbers()), 'FROM_END', 8, 'FROM_START', 8), '123456789', 'substring all with #-end # complex'); check_number_of_calls('substring all with #-end # complex'); $number_of_calls = 0; // Checks that the whole string is properly retrieved even if the value for start and end is not a simple number. This is especially important in generators where substring uses [x:length - y] for # #-end. assertEquals(text_get_substring((get_numbers()), 'FROM_START', ((0 + 1) - 1), 'FROM_END', ((0 + 1) - 1)), '123456789', 'substring all with # #-end math complex'); check_number_of_calls('substring all with # #-end math complex'); } // Tests the "change casing" block. function test_case() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $text = 'Hello World'; assertEquals(strtoupper($text), 'HELLO WORLD', 'uppercase'); assertEquals(strtoupper(true ? $text : null), 'HELLO WORLD', 'uppercase order'); $text = 'Hello World'; assertEquals(strtolower($text), 'hello world', 'lowercase'); assertEquals(strtolower(true ? $text : null), 'hello world', 'lowercase order'); $text = 'heLLo WorlD'; assertEquals(ucwords(strtolower($text)), 'Hello World', 'titlecase'); assertEquals(ucwords(strtolower(true ? $text : null)), 'Hello World', 'titlecase order'); } // Tests the "trim" block. function test_trim() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $text = ' abc def '; assertEquals(trim($text), 'abc def', 'trim both'); assertEquals(trim(true ? $text : null), 'abc def', 'trim both order'); assertEquals(ltrim($text), 'abc def ', 'trim left'); assertEquals(ltrim(true ? $text : null), 'abc def ', 'trim left order'); assertEquals(rtrim($text), ' abc def', 'trim right'); assertEquals(rtrim(true ? $text : null), ' abc def', 'trim right order'); } // Tests the "trim" block. function test_count_text() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $text = 'woolloomooloo'; assertEquals(strlen('o') === 0 ? strlen($text) + 1 : substr_count($text, 'o'), 8, 'len 1'); assertEquals(strlen('oo') === 0 ? strlen($text) + 1 : substr_count($text, 'oo'), 4, 'len 2'); assertEquals(strlen('loo') === 0 ? strlen($text) + 1 : substr_count($text, 'loo'), 2, 'len 3'); assertEquals(strlen('wool') === 0 ? strlen($text) + 1 : substr_count($text, 'wool'), 1, 'start'); assertEquals(strlen('chicken') === 0 ? strlen($text) + 1 : substr_count($text, 'chicken'), 0, 'missing'); assertEquals(strlen('') === 0 ? strlen($text) + 1 : substr_count($text, ''), 14, 'empty needle'); assertEquals(strlen('chicken') === 0 ? strlen('') + 1 : substr_count('', 'chicken'), 0, 'empty source'); } // Tests the "trim" block. function test_text_reverse() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(strrev(''), '', 'empty string'); assertEquals(strrev('a'), 'a', 'len 1'); assertEquals(strrev('ab'), 'ba', 'len 2'); assertEquals(strrev('woolloomooloo'), 'ooloomoolloow', 'longer'); } // Tests the "trim" block. function test_replace() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(str_replace('oo', '123', 'woolloomooloo'), 'w123ll123m123l123', 'replace all instances 1'); assertEquals(str_replace('.oo', 'X', 'woolloomooloo'), 'woolloomooloo', 'literal string replacement'); assertEquals(str_replace('abc', 'X', 'woolloomooloo'), 'woolloomooloo', 'not found'); assertEquals(str_replace('o', '', 'woolloomooloo'), 'wllml', 'empty replacement 1'); assertEquals(str_replace('aaaaa', '', 'aaaaa'), '', 'empty replacement 2'); assertEquals(str_replace('a', '', 'aaaaa'), '', 'empty replacement 3'); assertEquals(str_replace('a', 'chicken', ''), '', 'empty source'); } // Checks that the number of calls is one in order // to confirm that a function was only called once. function check_number_of_calls2($test_name) { global $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $test_name .= 'number of calls'; assertEquals($number_of_calls, 1, $test_name); } function lists_repeat($value, $count) { $array = array(); for ($index = 0; $index < $count; $index++) { $array[] = $value; } return $array; } // Tests the "create list with" and "create empty list" blocks. function test_create_lists() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(array(), array(), 'create empty'); assertEquals(array(true, 'love'), array(true, 'love'), 'create items'); assertEquals(lists_repeat('Eject', 3), array('Eject', 'Eject', 'Eject'), 'create repeated'); assertEquals(lists_repeat('Eject', 0 + 3), array('Eject', 'Eject', 'Eject'), 'create repeated order'); } // Creates an empty list for use with the empty test. function get_empty_list() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; return array(); } // Tests the "is empty" block. function test_lists_empty() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(empty((array(0))), false, 'not empty'); assertEquals(empty((array())), true, 'empty'); assertEquals(empty((get_empty_list())), true, 'empty complex'); assertEquals(empty((true ? array() : null)), true, 'empty order'); } // Tests the "length" block. function test_lists_length() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(length(array()), 0, 'zero length'); assertEquals(length(array('cat')), 1, 'one length'); assertEquals(length(array('cat', true, array())), 3, 'three length'); assertEquals(length(true ? array('cat', true) : null), 2, 'two length order'); } function lastIndexOf($haystack, $needle) { $last = 0; for ($index = 0; $index < count($haystack); $index++) { if ($haystack[$index] == $needle) $last = $index + 1; } return $last; } // Tests the "find" block with a variable. function test_find_lists_simple() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $list2 = array('Alice', 'Eve', 'Bob', 'Eve'); assertEquals(indexOf($list2, 'Eve'), 2, 'find first simple'); assertEquals(lastIndexOf($list2, 'Eve'), 4, 'find last simple'); assertEquals(indexOf($list2, 'Dave'), 0, 'find none simple'); } // Creates a list for use with the find test. function get_names() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $number_of_calls += 1; return array('Alice', 'Eve', 'Bob', 'Eve'); } // Tests the "find" block with a function call. function test_find_lists_complex() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $number_of_calls = 0; assertEquals(indexOf(get_names(), 'Eve'), 2, 'find first complex'); check_number_of_calls('find first complex'); $number_of_calls = 0; assertEquals(indexOf((true ? get_names() : null), 'Eve'), 2, 'find first order complex'); check_number_of_calls('find first order complex'); $number_of_calls = 0; assertEquals(lastIndexOf(get_names(), 'Eve'), 4, 'find last complex'); check_number_of_calls('find last complex'); $number_of_calls = 0; assertEquals(lastIndexOf((true ? get_names() : null), 'Eve'), 4, 'find last order complex'); check_number_of_calls('find last order complex'); $number_of_calls = 0; assertEquals(indexOf(get_names(), 'Dave'), 0, 'find none complex'); check_number_of_calls('find none complex'); $number_of_calls = 0; assertEquals(indexOf((true ? get_names() : null), 'Dave'), 0, 'find none order complex'); check_number_of_calls('find none order complex'); } function lists_get_random_item($list) { return $list[rand(0,count($list)-1)]; } // Tests the "get" block with a variable. function test_get_lists_simple() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $list2 = array('Kirk', 'Spock', 'McCoy'); assertEquals($list2[0], 'Kirk', 'get first simple'); assertEquals(end($list2), 'McCoy', 'get last simple'); assertEquals(indexOf($list2, lists_get_random_item($list2)) > 0, true, 'get random simple'); assertEquals($list2[1], 'Spock', 'get # simple'); assertEquals($list2[((true ? 2 : null) - 1)], 'Spock', 'get # order simple'); assertEquals(array_slice($list2, -3, 1)[0], 'Kirk', 'get #-end simple'); // The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index. assertEquals(array_slice($list2, (-(0 + 3)), 1)[0], 'Kirk', 'get #-end order simple'); } // Tests the "get" block with create list call. function test_get_lists_create_list() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(array('Kirk', 'Spock', 'McCoy')[0], 'Kirk', 'get first create list'); assertEquals(end(array('Kirk', 'Spock', 'McCoy')), 'McCoy', 'get last simple'); assertEquals(indexOf(array('Kirk', 'Spock', 'McCoy'), lists_get_random_item(array('Kirk', 'Spock', 'McCoy'))) > 0, true, 'get random simple'); assertEquals(array('Kirk', 'Spock', 'McCoy')[1], 'Spock', 'get # simple'); assertEquals(array('Kirk', 'Spock', 'McCoy')[((true ? 2 : null) - 1)], 'Spock', 'get # order simple'); assertEquals(array_slice(array('Kirk', 'Spock', 'McCoy'), -3, 1)[0], 'Kirk', 'get #-end simple'); // The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index. assertEquals(array_slice(array('Kirk', 'Spock', 'McCoy'), (-(0 + 3)), 1)[0], 'Kirk', 'get #-end order simple'); } // Creates a list for use with the get test. function get_star_wars() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $number_of_calls += 1; return array('Kirk', 'Spock', 'McCoy'); } // Tests the "get" block with a function call. function test_get_lists_complex() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $list2 = array('Kirk', 'Spock', 'McCoy'); $number_of_calls = 0; assertEquals(get_star_wars()[0], 'Kirk', 'get first complex'); check_number_of_calls('get first complex'); $number_of_calls = 0; assertEquals((true ? get_star_wars() : null)[0], 'Kirk', 'get first order complex'); check_number_of_calls('get first order complex'); $number_of_calls = 0; assertEquals(end(get_star_wars()), 'McCoy', 'get last complex'); check_number_of_calls('get last complex'); $number_of_calls = 0; assertEquals(end(true ? get_star_wars() : null), 'McCoy', 'get last order complex'); check_number_of_calls('get last order complex'); $number_of_calls = 0; assertEquals(indexOf($list2, lists_get_random_item(get_star_wars())) > 0, true, 'get random complex'); check_number_of_calls('get random complex'); $number_of_calls = 0; assertEquals(indexOf($list2, lists_get_random_item(true ? get_star_wars() : null)) > 0, true, 'get random order complex'); check_number_of_calls('get random order complex'); $number_of_calls = 0; assertEquals(get_star_wars()[1], 'Spock', 'get # complex'); check_number_of_calls('get # complex'); $number_of_calls = 0; assertEquals((true ? get_star_wars() : null)[((true ? 2 : null) - 1)], 'Spock', 'get # order complex'); check_number_of_calls('get # order complex'); $number_of_calls = 0; assertEquals(array_slice(get_star_wars(), -3, 1)[0], 'Kirk', 'get #-end complex'); check_number_of_calls('get #-end complex'); $number_of_calls = 0; // The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index. assertEquals(array_slice(true ? get_star_wars() : null, (-(0 + 3)), 1)[0], 'Kirk', 'get #-end order complex'); check_number_of_calls('get #-end order complex'); } function lists_get_remove_random_item(&$list) { $x = rand(0,count($list)-1); unset($list[$x]); return array_values($list); } // Tests the "get and remove" block. function test_getRemove() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $list2 = array('Kirk', 'Spock', 'McCoy'); assertEquals(array_shift($list2), 'Kirk', 'getremove first'); assertEquals($list2, array('Spock', 'McCoy'), 'getremove first list'); $list2 = array('Kirk', 'Spock', 'McCoy'); assertEquals(array_shift(true ? $list2 : null), 'Kirk', 'getremove first order'); assertEquals($list2, array('Spock', 'McCoy'), 'getremove first order list'); $list2 = array('Kirk', 'Spock', 'McCoy'); assertEquals(array_pop($list2), 'McCoy', 'getremove last'); assertEquals($list2, array('Kirk', 'Spock'), 'getremove last list'); $list2 = array('Kirk', 'Spock', 'McCoy'); assertEquals(array_pop(true ? $list2 : null), 'McCoy', 'getremove last order'); assertEquals($list2, array('Kirk', 'Spock'), 'getremove last order list'); $list2 = array('Kirk', 'Spock', 'McCoy'); assertEquals(indexOf($list2, lists_get_remove_random_item($list2)) == 0, true, 'getremove random'); assertEquals(length($list2), 2, 'getremove random list'); $list2 = array('Kirk', 'Spock', 'McCoy'); assertEquals(indexOf($list2, lists_get_remove_random_item(true ? $list2 : null)) == 0, true, 'getremove random order'); assertEquals(length($list2), 2, 'getremove random order list'); $list2 = array('Kirk', 'Spock', 'McCoy'); assertEquals(array_splice($list2, 1, 1)[0], 'Spock', 'getremove #'); assertEquals($list2, array('Kirk', 'McCoy'), 'getremove # list'); $list2 = array('Kirk', 'Spock', 'McCoy'); assertEquals(array_splice(true ? $list2 : null, ((true ? 2 : null) - 1), 1)[0], 'Spock', 'getremove # order'); assertEquals($list2, array('Kirk', 'McCoy'), 'getremove # order list'); $list2 = array('Kirk', 'Spock', 'McCoy'); assertEquals(array_splice($list2, count($list2) - 3, 1)[0], 'Kirk', 'getremove #-end'); assertEquals($list2, array('Spock', 'McCoy'), 'getremove #-end list'); $list2 = array('Kirk', 'Spock', 'McCoy'); // The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index. assertEquals(array_splice(true ? $list2 : null, count(true ? $list2 : null) - (0 + 3), 1)[0], 'Kirk', 'getremove #-end order'); assertEquals($list2, array('Spock', 'McCoy'), 'getremove #-end order list'); } function lists_remove_random_item(&$list) { unset($list[rand(0,count($list)-1)]); } // Tests the "remove" block. function test_remove() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $list2 = array('Kirk', 'Spock', 'McCoy'); array_shift($list2); assertEquals($list2, array('Spock', 'McCoy'), 'remove first list'); $list2 = array('Kirk', 'Spock', 'McCoy'); array_shift(true ? $list2 : null); assertEquals($list2, array('Spock', 'McCoy'), 'remove first order list'); $list2 = array('Kirk', 'Spock', 'McCoy'); array_pop($list2); assertEquals($list2, array('Kirk', 'Spock'), 'remove last list'); $list2 = array('Kirk', 'Spock', 'McCoy'); array_pop(true ? $list2 : null); assertEquals($list2, array('Kirk', 'Spock'), 'remove last order list'); $list2 = array('Kirk', 'Spock', 'McCoy'); lists_remove_random_item($list2); assertEquals(length($list2), 2, 'remove random list'); $list2 = array('Kirk', 'Spock', 'McCoy'); lists_remove_random_item(true ? $list2 : null); assertEquals(length($list2), 2, 'remove random order list'); $list2 = array('Kirk', 'Spock', 'McCoy'); array_splice($list2, 1, 1); assertEquals($list2, array('Kirk', 'McCoy'), 'remove # list'); $list2 = array('Kirk', 'Spock', 'McCoy'); array_splice(true ? $list2 : null, ((true ? 2 : null) - 1), 1); assertEquals($list2, array('Kirk', 'McCoy'), 'remove # order list'); $list2 = array('Kirk', 'Spock', 'McCoy'); array_splice($list2, count($list2) - 3, 1)[0]; assertEquals($list2, array('Spock', 'McCoy'), 'remove #-end list'); $list2 = array('Kirk', 'Spock', 'McCoy'); // The order for index for #-end is addition because this will catch // errors in generators where most perform the operation ... - index. array_splice(true ? $list2 : null, count(true ? $list2 : null) - (0 + 3), 1)[0]; assertEquals($list2, array('Spock', 'McCoy'), 'remove #-end order list'); } function lists_set_last_item(&$list, $value) { $list[count($list) - 1] = $value; } function lists_set_from_end(&$list, $at, $value) { $list[count($list) - $at] = $value; } // Tests the "set" block. function test_set() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $list2 = array('Picard', 'Riker', 'Crusher'); $list2[0] = 'Jean-Luc'; assertEquals($list2, array('Jean-Luc', 'Riker', 'Crusher'), 'set first list'); $list2 = array('Picard', 'Riker', 'Crusher'); (true ? $list2 : null)[0] = 'Jean-Luc'; assertEquals($list2, array('Jean-Luc', 'Riker', 'Crusher'), 'set first order list'); $list2 = array('Picard', 'Riker', 'Crusher'); lists_set_last_item($list2, 'Beverly'); assertEquals($list2, array('Picard', 'Riker', 'Beverly'), 'set last list'); $list2 = array('Picard', 'Riker', 'Crusher'); lists_set_last_item(true ? $list2 : null, 'Beverly'); assertEquals($list2, array('Picard', 'Riker', 'Beverly'), 'set last order list'); $list2 = array('Picard', 'Riker', 'Crusher'); $tmp_x = rand(0, count($list2)-1); $list2[$tmp_x] = 'Data'; assertEquals(length($list2), 3, 'set random list'); $list2 = array('Picard', 'Riker', 'Crusher'); $tmp_list = &(true ? $list2 : null); $tmp_x2 = rand(0, count($tmp_list)-1); $tmp_list[$tmp_x2] = 'Data'; assertEquals(length($list2), 3, 'set random order list'); $list2 = array('Picard', 'Riker', 'Crusher'); $list2[2] = 'Pulaski'; assertEquals($list2, array('Picard', 'Riker', 'Pulaski'), 'set # list'); $list2 = array('Picard', 'Riker', 'Crusher'); (true ? $list2 : null)[((true ? 3 : null) - 1)] = 'Pulaski'; assertEquals($list2, array('Picard', 'Riker', 'Pulaski'), 'set # order list'); $list2 = array('Picard', 'Riker', 'Crusher'); lists_set_from_end($list2, 1, 'Pulaski'); assertEquals($list2, array('Picard', 'Riker', 'Pulaski'), 'set #-end list'); $list2 = array('Picard', 'Riker', 'Crusher'); // The order for index for #-end is addition because this will catch // errors in generators where most perform the operation ... - index. lists_set_from_end(true ? $list2 : null, 0 + 2, 'Pulaski'); assertEquals($list2, array('Picard', 'Pulaski', 'Crusher'), 'set #-end order list'); } function lists_insert_from_end(&$list, $at, $value) { return array_splice($list, count($list) - $at, 0, $value); } // Tests the "insert" block. function test_insert() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $list2 = array('Picard', 'Riker', 'Crusher'); array_unshift($list2, 'Data'); assertEquals($list2, array('Data', 'Picard', 'Riker', 'Crusher'), 'insert first list'); $list2 = array('Picard', 'Riker', 'Crusher'); array_unshift(true ? $list2 : null, 'Data'); assertEquals($list2, array('Data', 'Picard', 'Riker', 'Crusher'), 'insert first order list'); $list2 = array('Picard', 'Riker', 'Crusher'); array_push($list2, 'Data'); assertEquals($list2, array('Picard', 'Riker', 'Crusher', 'Data'), 'insert last list'); $list2 = array('Picard', 'Riker', 'Crusher'); array_push(true ? $list2 : null, 'Data'); assertEquals($list2, array('Picard', 'Riker', 'Crusher', 'Data'), 'insert last order list'); $list2 = array('Picard', 'Riker', 'Crusher'); $tmp_x3 = rand(0, count($list2)-1); array_splice($list2, $tmp_x3, 0, 'Data'); assertEquals(length($list2), 4, 'insert random list'); $list2 = array('Picard', 'Riker', 'Crusher'); $tmp_list2 = &(true ? $list2 : null); $tmp_x4 = rand(0, count($tmp_list2)-1); array_splice($tmp_list2, $tmp_x4, 0, 'Data'); assertEquals(length($list2), 4, 'insert random order list'); $list2 = array('Picard', 'Riker', 'Crusher'); array_splice($list2, 2, 0, 'Data'); assertEquals($list2, array('Picard', 'Riker', 'Data', 'Crusher'), 'insert # list'); $list2 = array('Picard', 'Riker', 'Crusher'); array_splice(true ? $list2 : null, ((true ? 3 : null) - 1), 0, 'Data'); assertEquals($list2, array('Picard', 'Riker', 'Data', 'Crusher'), 'insert # order list'); $list2 = array('Picard', 'Riker', 'Crusher'); lists_insert_from_end($list2, 1, 'Data'); assertEquals($list2, array('Picard', 'Riker', 'Data', 'Crusher'), 'insert #-end list'); $list2 = array('Picard', 'Riker', 'Crusher'); // The order for index for #-end is addition because this will catch // errors in generators where most perform the operation ... - index. lists_insert_from_end(true ? $list2 : null, 0 + 2, 'Data'); assertEquals($list2, array('Picard', 'Data', 'Riker', 'Crusher'), 'insert #-end order list'); } // Tests the "get sub-list" block with a variable. function test_sublist_simple() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $list2 = array('Columbia', 'Challenger', 'Discovery', 'Atlantis', 'Endeavour'); assertEquals(array_slice($list2, 1, 2 - 1 + 1), array('Challenger', 'Discovery'), 'sublist # simple'); assertEquals(array_slice($list2, ((true ? 2 : null) - 1), ((true ? 3 : null) - 1) - ((true ? 2 : null) - 1) + 1), array('Challenger', 'Discovery'), 'sublist # simple order'); assertEquals(array_slice($list2, count($list2) - 3, count($list2) - 1 - (count($list2) - 3)), array('Discovery', 'Atlantis'), 'sublist #-end simple'); // The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index. assertEquals(array_slice($list2, count($list2) - (0 + 3), count($list2) - ((0 + 2) - 1) - (count($list2) - (0 + 3))), array('Discovery', 'Atlantis'), 'sublist #-end simple order'); assertEquals($list2, $list2, 'sublist first-last simple'); $changing_list = array('Columbia', 'Challenger', 'Discovery', 'Atlantis', 'Endeavour'); $list_copy = $changing_list; lists_remove_random_item($changing_list); assertEquals($list_copy, $list2, 'sublist first-last simple copy check'); assertEquals(array_slice($list2, 1, count($list2) - 1 - 1), array('Challenger', 'Discovery', 'Atlantis'), 'sublist # #-end simple'); assertEquals(array_slice($list2, count($list2) - 3, 3 - (count($list2) - 3) + 1), array('Discovery', 'Atlantis'), 'sublist #-end # simple'); assertEquals(array_slice($list2, 0, 3 - 0 + 1), array('Columbia', 'Challenger', 'Discovery', 'Atlantis'), 'sublist first # simple'); assertEquals(array_slice($list2, 0, count($list2) - 3 - 0), array('Columbia', 'Challenger'), 'sublist first #-end simple'); assertEquals(array_slice($list2, 3, count($list2) - 3), array('Atlantis', 'Endeavour'), 'sublist # last simple'); assertEquals(array_slice($list2, count($list2) - 4, count($list2) - (count($list2) - 4)), array('Challenger', 'Discovery', 'Atlantis', 'Endeavour'), 'sublist #-end last simple'); assertEquals(array_slice($list2, 0, count($list2) - 0 - 0), $list2, 'sublist all with # #-end simple'); assertEquals(array_slice($list2, count($list2) - 5, 4 - (count($list2) - 5) + 1), $list2, 'sublist all with #-end # simple'); // Checks that the whole list is properly retrieved even if the value for start and end is not a simple number. This is especially important in generators where sublist uses [x:length - y] for # #-end. assertEquals(array_slice($list2, ((0 + 1) - 1), count($list2) - ((0 + 1) - 1) - ((0 + 1) - 1)), $list2, 'sublist all with # #-end math simple'); } // Creates a list for use with the sublist test. function get_space_shuttles() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $number_of_calls += 1; return array('Columbia', 'Challenger', 'Discovery', 'Atlantis', 'Endeavour'); } function lists_get_sublist($list, $where1, $at1, $where2, $at2) { if ($where1 == 'FROM_END') { $at1 = count($list) - 1 - $at1; } else if ($where1 == 'FIRST') { $at1 = 0; } else if ($where1 != 'FROM_START') { throw new Exception('Unhandled option (lists_get_sublist).'); } $length = 0; if ($where2 == 'FROM_START') { $length = $at2 - $at1 + 1; } else if ($where2 == 'FROM_END') { $length = count($list) - $at1 - $at2; } else if ($where2 == 'LAST') { $length = count($list) - $at1; } else { throw new Exception('Unhandled option (lists_get_sublist).'); } return array_slice($list, $at1, $length); } // Tests the "get sub-list" block with a function call. function test_sublist_complex() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $number_of_calls = 0; assertEquals(array_slice(get_space_shuttles(), 1, 2 - 1 + 1), array('Challenger', 'Discovery'), 'sublist # start complex'); check_number_of_calls('sublist # start complex'); $number_of_calls = 0; assertEquals(array_slice(true ? get_space_shuttles() : null, ((true ? 2 : null) - 1), ((true ? 3 : null) - 1) - ((true ? 2 : null) - 1) + 1), array('Challenger', 'Discovery'), 'sublist # start order complex'); check_number_of_calls('sublist # start order complex'); $number_of_calls = 0; // The order for index for #-end is addition because this will catch errors in generators where most perform the operation ... - index. assertEquals(lists_get_sublist(get_space_shuttles(), 'FROM_END', 2, 'FROM_END', 1), array('Discovery', 'Atlantis'), 'sublist # end complex'); assertEquals($number_of_calls, 1, 'sublist # end complex number of calls'); $number_of_calls = 0; assertEquals(lists_get_sublist(true ? get_space_shuttles() : null, 'FROM_END', ((0 + 3) - 1), 'FROM_END', ((0 + 2) - 1)), array('Discovery', 'Atlantis'), 'sublist # end order complex'); check_number_of_calls('sublist # end order complex'); $number_of_calls = 0; assertEquals(get_space_shuttles(), $list2, 'sublist first-last complex'); check_number_of_calls('sublist first-last complex'); $number_of_calls = 0; assertEquals(lists_get_sublist(get_space_shuttles(), 'FROM_START', 1, 'FROM_END', 1), array('Challenger', 'Discovery', 'Atlantis'), 'sublist # #-end complex'); check_number_of_calls('sublist # #-end complex'); $number_of_calls = 0; assertEquals(lists_get_sublist(get_space_shuttles(), 'FROM_END', 2, 'FROM_START', 3), array('Discovery', 'Atlantis'), 'sublist #-end # complex'); check_number_of_calls('sublist #-end # complex'); $number_of_calls = 0; assertEquals(array_slice(get_space_shuttles(), 0, 3 - 0 + 1), array('Columbia', 'Challenger', 'Discovery', 'Atlantis'), 'sublist first # complex'); check_number_of_calls('sublist first # complex'); $number_of_calls = 0; assertEquals(lists_get_sublist(get_space_shuttles(), 'FIRST', 0, 'FROM_END', 3), array('Columbia', 'Challenger'), 'sublist first #-end complex'); check_number_of_calls('sublist first #-end complex'); $number_of_calls = 0; assertEquals(lists_get_sublist(get_space_shuttles(), 'FROM_START', 3, 'LAST', 0), array('Atlantis', 'Endeavour'), 'sublist # last complex'); check_number_of_calls('sublist # last complex'); $number_of_calls = 0; assertEquals(lists_get_sublist(get_space_shuttles(), 'FROM_END', 3, 'LAST', 0), array('Challenger', 'Discovery', 'Atlantis', 'Endeavour'), 'sublist #-end last simple'); check_number_of_calls('sublist #-end last simple'); $number_of_calls = 0; assertEquals(lists_get_sublist(get_space_shuttles(), 'FROM_START', 0, 'FROM_END', 0), $list2, 'sublist all with # #-end complex'); check_number_of_calls('sublist all with # #-end complex'); $number_of_calls = 0; assertEquals(lists_get_sublist(get_space_shuttles(), 'FROM_END', 4, 'FROM_START', 4), $list2, 'sublist all with #-end # complex'); check_number_of_calls('sublist all with #-end # complex'); $number_of_calls = 0; // Checks that the whole list is properly retrieved even if the value for start and end is not a simple number. This is especially important in generators where sublist uses [x:length - y] for # #-end. assertEquals(lists_get_sublist(get_space_shuttles(), 'FROM_START', ((0 + 1) - 1), 'FROM_END', ((0 + 1) - 1)), $list2, 'sublist all with # #-end math complex'); check_number_of_calls('sublist all with # #-end math complex'); } // Tests the "join" block. function test_join() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $list2 = array('Vulcan', 'Klingon', 'Borg'); assertEquals(implode(',', $list2), 'Vulcan,Klingon,Borg', 'join'); assertEquals(implode(',', true ? $list2 : null), 'Vulcan,Klingon,Borg', 'join order'); } // Tests the "split" block. function test_split() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $text = 'Vulcan,Klingon,Borg'; assertEquals(explode(',', $text), array('Vulcan', 'Klingon', 'Borg'), 'split'); assertEquals(explode(',', true ? $text : null), array('Vulcan', 'Klingon', 'Borg'), 'split order'); } function lists_sort($list, $type, $direction) { $sortCmpFuncs = array( "NUMERIC" => "strnatcasecmp", "TEXT" => "strcmp", "IGNORE_CASE" => "strcasecmp" ); $sortCmp = $sortCmpFuncs[$type]; $list2 = $list; usort($list2, $sortCmp); if ($direction == -1) { $list2 = array_reverse($list2); } return $list2; } // Tests the "alphabetic sort" block. function test_sort_alphabetic() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $list2 = array('Vulcan', 'klingon', 'Borg'); assertEquals(lists_sort($list2, "TEXT", 1), array('Borg', 'Vulcan', 'klingon'), 'sort alphabetic ascending'); assertEquals(lists_sort(true ? $list2 : null, "TEXT", 1), array('Borg', 'Vulcan', 'klingon'), 'sort alphabetic ascending order'); } // Tests the "alphabetic sort ignore case" block. function test_sort_ignoreCase() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $list2 = array('Vulcan', 'klingon', 'Borg'); assertEquals(lists_sort($list2, "IGNORE_CASE", 1), array('Borg', 'klingon', 'Vulcan'), 'sort ignore case ascending'); assertEquals(lists_sort(true ? $list2 : null, "IGNORE_CASE", 1), array('Borg', 'klingon', 'Vulcan'), 'sort ignore case ascending order'); } // Tests the "numeric sort" block. function test_sort_numeric() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $list2 = array(8, 18, -1); assertEquals(lists_sort($list2, "NUMERIC", -1), array(18, 8, -1), 'sort numeric descending'); assertEquals(lists_sort(true ? $list2 : null, "NUMERIC", -1), array(18, 8, -1), 'sort numeric descending order'); } // Tests the "list reverse" block. function test_lists_reverse() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $list2 = array(8, 18, -1, 64); assertEquals(array_reverse($list2), array(64, -1, 18, 8), 'reverse a copy'); assertEquals($list2, array(8, 18, -1, 64), 'reverse a copy original'); $list2 = array(); assertEquals(array_reverse($list2), array(), 'empty list'); } // Describe this function... function test_colour_picker() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals('#ff6600', '#ff6600', 'static colour'); } function colour_rgb($r, $g, $b) { $r = round(max(min($r, 100), 0) * 2.55); $g = round(max(min($g, 100), 0) * 2.55); $b = round(max(min($b, 100), 0) * 2.55); $hex = '#'; $hex .= str_pad(dechex($r), 2, '0', STR_PAD_LEFT); $hex .= str_pad(dechex($g), 2, '0', STR_PAD_LEFT); $hex .= str_pad(dechex($b), 2, '0', STR_PAD_LEFT); return $hex; } // Describe this function... function test_rgb() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(colour_rgb(100, 40, 0), '#ff6600', 'from rgb'); } function colour_random() { return '#' . str_pad(dechex(mt_rand(0, 0xFFFFFF)), 6, '0', STR_PAD_LEFT); } // Describe this function... function test_colour_random() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; for ($count4 = 0; $count4 < 100; $count4++) { $item = colour_random(); assertEquals(length($item), 7, 'length of random colour string: ' . $item); assertEquals(substr($item, 0, 1), '#', 'format of random colour string: ' . $item); for ($i = 1; $i <= 6; $i++) { assertEquals(0 != text_indexOf('abcdefABDEF0123456789', substr($item, (($i + 1) - 1), 1)), true, implode('', array('contents of random colour string: ',$item,' at index: ',$i + 1))); } } } function colour_blend($c1, $c2, $ratio) { $ratio = max(min($ratio, 1), 0); $r1 = hexdec(substr($c1, 1, 2)); $g1 = hexdec(substr($c1, 3, 2)); $b1 = hexdec(substr($c1, 5, 2)); $r2 = hexdec(substr($c2, 1, 2)); $g2 = hexdec(substr($c2, 3, 2)); $b2 = hexdec(substr($c2, 5, 2)); $r = round($r1 * (1 - $ratio) + $r2 * $ratio); $g = round($g1 * (1 - $ratio) + $g2 * $ratio); $b = round($b1 * (1 - $ratio) + $b2 * $ratio); $hex = '#'; $hex .= str_pad(dechex($r), 2, '0', STR_PAD_LEFT); $hex .= str_pad(dechex($g), 2, '0', STR_PAD_LEFT); $hex .= str_pad(dechex($b), 2, '0', STR_PAD_LEFT); return $hex; } // Describe this function... function test_blend() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(colour_blend('#ff0000', colour_rgb(100, 40, 0), 0.4), '#ff2900', 'blend'); } // Describe this function... function test_procedure() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; procedure_1(8, 2); assertEquals($proc_z, 4, 'procedure with global'); $proc_w = false; procedure_2(false); assertEquals($proc_w, true, 'procedure no return'); $proc_w = false; procedure_2(true); assertEquals($proc_w, false, 'procedure return'); } // Describe this function... function procedure_1($proc_x, $proc_y) { global $test_name, $naked, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $proc_z = $proc_x / $proc_y; } // Describe this function... function procedure_2($proc_x) { global $test_name, $naked, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; if ($proc_x) { return; } $proc_w = true; } // Describe this function... function test_function() { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; assertEquals(function_1(2, 3), -1, 'function with arguments'); assertEquals($func_z, 'side effect', 'function with side effect'); $func_a = 'unchanged'; $func_c = 'global'; assertEquals(function_2(2), '3global', 'function with global'); assertEquals($func_a, 'unchanged', 'function with scope'); assertEquals(function_3(true), true, 'function return'); assertEquals(function_3(false), false, 'function no return'); } // Describe this function... function function_1($func_x, $func_y) { global $test_name, $naked, $proc_x, $proc_y, $func_a, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $func_z = 'side effect'; return $func_x - $func_y; } // Describe this function... function function_2($func_a) { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; $func_a += 1; return $func_a . $func_c; } // Describe this function... function function_3($func_a) { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $n, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; if ($func_a) { return true; } return false; } // Describe this function... function recurse($n) { global $test_name, $naked, $proc_x, $proc_y, $func_x, $func_y, $func_a, $ok, $log, $count, $varToChange, $rand, $item, $text, $number_of_calls, $list2, $proc_z, $func_z, $x, $proc_w, $func_c, $if2, $i, $loglist, $changing_list, $list_copy, $unittestResults; if ($n > 0) { $text = implode('', array(recurse($n - 1),$n,recurse($n - 1))); } else { $text = '-'; } return $text; } $unittestResults = array(); print("\n====================\n\nRunning suite: Logic\n"); assertEquals(true, true, 'True'); assertEquals(false, false, 'False'); assertEquals(!false, true, 'Not true'); assertEquals(!true, false, 'Not false'); test_if(); test_ifelse(); test_equalities(); test_and(); test_or(); test_ternary(); print(unittest_report()); $unittestResults = null; $unittestResults = array(); print("\n====================\n\nRunning suite: Loops 1\n"); test_repeat(); test_repeat_ext(); test_while(); test_foreach(); print(unittest_report()); $unittestResults = null; $unittestResults = array(); print("\n====================\n\nRunning suite: Loops 2\n"); test_count_loops(); test_count_by(); print(unittest_report()); $unittestResults = null; $unittestResults = array(); print("\n====================\n\nRunning suite: Loops 3\n"); test_break(); test_continue(); print(unittest_report()); $unittestResults = null; $unittestResults = array(); print("\n====================\n\nRunning suite: Math\n"); test_arithmetic(); test_single(); test_trig(); test_constant(); test_change(); test_number_properties(); test_round(); test_operations_on_list(); test_constraint(); test_mod(); test_random_integer(); test_random_fraction(); test_atan2(); print(unittest_report()); $unittestResults = null; $unittestResults = array(); print("\n====================\n\nRunning suite: Text\n"); test_text_length(); test_empty_text(); test_create_text(); test_append(); test_find_text_simple(); test_find_text_complex(); test_get_text_simple(); test_get_text_complex(); test_substring_simple(); test_substring_complex(); test_case(); test_trim(); test_count_text(); test_text_reverse(); test_replace(); print(unittest_report()); $unittestResults = null; $unittestResults = array(); print("\n====================\n\nRunning suite: Lists\n"); test_create_lists(); test_lists_empty(); test_lists_length(); test_find_lists_simple(); test_find_lists_complex(); test_get_lists_simple(); test_get_lists_create_list(); test_get_lists_complex(); test_getRemove(); test_remove(); test_set(); test_insert(); test_sublist_simple(); test_sublist_complex(); test_join(); test_split(); test_sort_alphabetic(); test_sort_ignoreCase(); test_sort_numeric(); test_lists_reverse(); print(unittest_report()); $unittestResults = null; $unittestResults = array(); print("\n====================\n\nRunning suite: Colour\n"); test_colour_picker(); test_blend(); test_rgb(); test_colour_random(); print(unittest_report()); $unittestResults = null; $unittestResults = array(); print("\n====================\n\nRunning suite: Variables\n"); $item = 123; assertEquals($item, 123, 'variable'); $if2 = 123; assertEquals($if2, 123, 'reserved variable'); print(unittest_report()); $unittestResults = null; // Intentionally non-connected variable. $naked; $unittestResults = array(); print("\n====================\n\nRunning suite: Functions\n"); test_procedure(); test_function(); assertEquals(recurse(3), '-1-2-1-3-1-2-1-', 'test recurse'); print(unittest_report()); $unittestResults = null;
{ "pile_set_name": "Github" }
using System; using System.Reflection; using Novell.Directory.Ldap.Rfc2251; namespace Novell.Directory.Ldap.Utilclass { /// <summary> /// Takes an LdapExtendedResponse and returns an object /// (that implements the base class ParsedExtendedResponse) /// based on the OID. /// <p> /// You can then call methods defined in the child /// class to parse the contents of the response. The methods available /// depend on the child class. All child classes inherit from the /// ParsedExtendedResponse. /// </p> /// </summary> public class ExtResponseFactory { /// <summary> /// Used to Convert an RfcLdapMessage object to the appropriate /// LdapExtendedResponse object depending on the operation being performed. /// </summary> /// <param name="inResponse"> /// The LdapExtendedReponse object as returned by the /// extendedOperation method in the LdapConnection object. /// </param> /// <returns> /// An object of base class LdapExtendedResponse. The actual child /// class of this returned object depends on the operation being /// performed. /// </returns> public static LdapExtendedResponse ConvertToExtendedResponse(RfcLdapMessage inResponse) { var tempResponse = new LdapExtendedResponse(inResponse); // Get the oid stored in the Extended response var inOid = tempResponse.Id; if (inOid == null) { return tempResponse; } var regExtResponses = LdapExtendedResponse.RegisteredResponses; try { var extRespClass = regExtResponses.FindResponseExtension(inOid); if (extRespClass == null) { return tempResponse; } Type[] argsClass = {typeof(RfcLdapMessage) }; object[] args = {inResponse }; Exception ex; try { var extConstructor = extRespClass.GetConstructor(argsClass); try { object resp = null; resp = extConstructor.Invoke(args); return (LdapExtendedResponse)resp; } catch (UnauthorizedAccessException e) { ex = e; } catch (TargetInvocationException e) { ex = e; } catch (Exception e) { // Could not create the ResponseControl object // All possible exceptions are ignored. We fall through // and create a default LdapControl object ex = e; } } catch (MethodAccessException e) { // bad class was specified, fall through and return a // default LdapExtendedResponse object ex = e; } } catch (FieldAccessException ex) { Logger.Log.LogWarning("Exception swallowed", ex); } // If we get here we did not have a registered extendedresponse // for this oid. Return a default LdapExtendedResponse object. return tempResponse; } } }
{ "pile_set_name": "Github" }
//===--- AST.cpp - Utility AST functions -----------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #include "AST.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Decl.h" #include "clang/Basic/SourceManager.h" namespace clang { namespace clangd { using namespace llvm; SourceLocation findNameLoc(const clang::Decl* D) { const auto& SM = D->getASTContext().getSourceManager(); // FIXME: Revisit the strategy, the heuristic is limitted when handling // macros, we should use the location where the whole definition occurs. SourceLocation SpellingLoc = SM.getSpellingLoc(D->getLocation()); if (D->getLocation().isMacroID()) { std::string PrintLoc = SpellingLoc.printToString(SM); if (llvm::StringRef(PrintLoc).startswith("<scratch") || llvm::StringRef(PrintLoc).startswith("<command line>")) { // We use the expansion location for the following symbols, as spelling // locations of these symbols are not interesting to us: // * symbols formed via macro concatenation, the spelling location will // be "<scratch space>" // * symbols controlled and defined by a compile command-line option // `-DName=foo`, the spelling location will be "<command line>". SpellingLoc = SM.getExpansionRange(D->getLocation()).getBegin(); } } return SpellingLoc; } } // namespace clangd } // namespace clang
{ "pile_set_name": "Github" }
/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la) * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. * * Version: 1.3.8 * */ (function($) { $.fn.extend({ slimScroll: function(options) { var defaults = { // width in pixels of the visible scroll area width : 'auto', // height in pixels of the visible scroll area height : '250px', // width in pixels of the scrollbar and rail size : '7px', // scrollbar color, accepts any hex/color value color: '#000', // scrollbar position - left/right position : 'right', // distance in pixels between the side edge and the scrollbar distance : '1px', // default scroll position on load - top / bottom / $('selector') start : 'top', // sets scrollbar opacity opacity : .4, // enables always-on mode for the scrollbar alwaysVisible : false, // check if we should hide the scrollbar when user is hovering over disableFadeOut : false, // sets visibility of the rail railVisible : false, // sets rail color railColor : '#333', // sets rail opacity railOpacity : .2, // whether we should use jQuery UI Draggable to enable bar dragging railDraggable : true, // defautlt CSS class of the slimscroll rail railClass : 'slimScrollRail', // defautlt CSS class of the slimscroll bar barClass : 'slimScrollBar', // defautlt CSS class of the slimscroll wrapper wrapperClass : 'slimScrollDiv', // check if mousewheel should scroll the window if we reach top/bottom allowPageScroll : false, // scroll amount applied to each mouse wheel step wheelStep : 20, // scroll amount applied when user is using gestures touchScrollStep : 200, // sets border radius borderRadius: '7px', // sets border radius of the rail railBorderRadius : '7px' }; var o = $.extend(defaults, options); // do it for every element that matches selector this.each(function(){ var isOverPanel, isOverBar, isDragg, queueHide, touchDif, barHeight, percentScroll, lastScroll, divS = '<div></div>', minBarHeight = 30, releaseScroll = false; // used in event handlers and for better minification var me = $(this); // ensure we are not binding it again if (me.parent().hasClass(o.wrapperClass)) { // start from last bar position var offset = me.scrollTop(); // find bar and rail bar = me.siblings('.' + o.barClass); rail = me.siblings('.' + o.railClass); getBarHeight(); // check if we should scroll existing instance if ($.isPlainObject(options)) { // Pass height: auto to an existing slimscroll object to force a resize after contents have changed if ( 'height' in options && options.height == 'auto' ) { me.parent().css('height', 'auto'); me.css('height', 'auto'); var height = me.parent().parent().height(); me.parent().css('height', height); me.css('height', height); } else if ('height' in options) { var h = options.height; me.parent().css('height', h); me.css('height', h); } if ('scrollTo' in options) { // jump to a static point offset = parseInt(o.scrollTo); } else if ('scrollBy' in options) { // jump by value pixels offset += parseInt(o.scrollBy); } else if ('destroy' in options) { // remove slimscroll elements bar.remove(); rail.remove(); me.unwrap(); return; } // scroll content by the given offset scrollContent(offset, false, true); } return; } else if ($.isPlainObject(options)) { if ('destroy' in options) { return; } } // optionally set height to the parent's height o.height = (o.height == 'auto') ? me.parent().height() : o.height; // wrap content var wrapper = $(divS) .addClass(o.wrapperClass) .css({ position: 'relative', overflow: 'hidden', width: o.width, height: o.height }); // update style for the div me.css({ overflow: 'hidden', width: o.width, height: o.height }); // create scrollbar rail var rail = $(divS) .addClass(o.railClass) .css({ width: o.size, height: '100%', position: 'absolute', top: 0, display: (o.alwaysVisible && o.railVisible) ? 'block' : 'none', 'border-radius': o.railBorderRadius, background: o.railColor, opacity: o.railOpacity, zIndex: 90 }); // create scrollbar var bar = $(divS) .addClass(o.barClass) .css({ background: o.color, width: o.size, position: 'absolute', top: 0, opacity: o.opacity, display: o.alwaysVisible ? 'block' : 'none', 'border-radius' : o.borderRadius, BorderRadius: o.borderRadius, MozBorderRadius: o.borderRadius, WebkitBorderRadius: o.borderRadius, zIndex: 99 }); // set position var posCss = (o.position == 'right') ? { right: o.distance } : { left: o.distance }; rail.css(posCss); bar.css(posCss); // wrap it me.wrap(wrapper); // append to parent div me.parent().append(bar); me.parent().append(rail); // make it draggable and no longer dependent on the jqueryUI if (o.railDraggable){ bar.bind("mousedown", function(e) { var $doc = $(document); isDragg = true; t = parseFloat(bar.css('top')); pageY = e.pageY; $doc.bind("mousemove.slimscroll", function(e){ currTop = t + e.pageY - pageY; bar.css('top', currTop); scrollContent(0, bar.position().top, false);// scroll content }); $doc.bind("mouseup.slimscroll", function(e) { isDragg = false;hideBar(); $doc.unbind('.slimscroll'); }); return false; }).bind("selectstart.slimscroll", function(e){ e.stopPropagation(); e.preventDefault(); return false; }); } // on rail over rail.hover(function(){ showBar(); }, function(){ hideBar(); }); // on bar over bar.hover(function(){ isOverBar = true; }, function(){ isOverBar = false; }); // show on parent mouseover me.hover(function(){ isOverPanel = true; showBar(); hideBar(); }, function(){ isOverPanel = false; hideBar(); }); // support for mobile me.bind('touchstart', function(e,b){ if (e.originalEvent.touches.length) { // record where touch started touchDif = e.originalEvent.touches[0].pageY; } }); me.bind('touchmove', function(e){ // prevent scrolling the page if necessary if(!releaseScroll) { e.originalEvent.preventDefault(); } if (e.originalEvent.touches.length) { // see how far user swiped var diff = (touchDif - e.originalEvent.touches[0].pageY) / o.touchScrollStep; // scroll content scrollContent(diff, true); touchDif = e.originalEvent.touches[0].pageY; } }); // set up initial height getBarHeight(); // check start position if (o.start === 'bottom') { // scroll content to bottom bar.css({ top: me.outerHeight() - bar.outerHeight() }); scrollContent(0, true); } else if (o.start !== 'top') { // assume jQuery selector scrollContent($(o.start).position().top, null, true); // make sure bar stays hidden if (!o.alwaysVisible) { bar.hide(); } } // attach scroll events attachWheel(this); function _onWheel(e) { // use mouse wheel only when mouse is over if (!isOverPanel) { return; } var e = e || window.event; var delta = 0; if (e.wheelDelta) { delta = -e.wheelDelta/120; } if (e.detail) { delta = e.detail / 3; } var target = e.target || e.srcTarget || e.srcElement; if ($(target).closest('.' + o.wrapperClass).is(me.parent())) { // scroll content scrollContent(delta, true); } // stop window scroll if (e.preventDefault && !releaseScroll) { e.preventDefault(); } if (!releaseScroll) { e.returnValue = false; } } function scrollContent(y, isWheel, isJump) { releaseScroll = false; var delta = y; var maxTop = me.outerHeight() - bar.outerHeight(); if (isWheel) { // move bar with mouse wheel delta = parseInt(bar.css('top')) + y * parseInt(o.wheelStep) / 100 * bar.outerHeight(); // move bar, make sure it doesn't go out delta = Math.min(Math.max(delta, 0), maxTop); // if scrolling down, make sure a fractional change to the // scroll position isn't rounded away when the scrollbar's CSS is set // this flooring of delta would happened automatically when // bar.css is set below, but we floor here for clarity delta = (y > 0) ? Math.ceil(delta) : Math.floor(delta); // scroll the scrollbar bar.css({ top: delta + 'px' }); } // calculate actual scroll amount percentScroll = parseInt(bar.css('top')) / (me.outerHeight() - bar.outerHeight()); delta = percentScroll * (me[0].scrollHeight - me.outerHeight()); if (isJump) { delta = y; var offsetTop = delta / me[0].scrollHeight * me.outerHeight(); offsetTop = Math.min(Math.max(offsetTop, 0), maxTop); bar.css({ top: offsetTop + 'px' }); } // scroll content me.scrollTop(delta); // fire scrolling event me.trigger('slimscrolling', ~~delta); // ensure bar is visible showBar(); // trigger hide when scroll is stopped hideBar(); } function attachWheel(target) { if (window.addEventListener) { target.addEventListener('DOMMouseScroll', _onWheel, false ); target.addEventListener('mousewheel', _onWheel, false ); } else { document.attachEvent("onmousewheel", _onWheel) } } function getBarHeight() { // calculate scrollbar height and make sure it is not too small barHeight = Math.max((me.outerHeight() / me[0].scrollHeight) * me.outerHeight(), minBarHeight); bar.css({ height: barHeight + 'px' }); // hide scrollbar if content is not long enough var display = barHeight == me.outerHeight() ? 'none' : 'block'; bar.css({ display: display }); } function showBar() { // recalculate bar height getBarHeight(); clearTimeout(queueHide); // when bar reached top or bottom if (percentScroll == ~~percentScroll) { //release wheel releaseScroll = o.allowPageScroll; // publish approporiate event if (lastScroll != percentScroll) { var msg = (~~percentScroll == 0) ? 'top' : 'bottom'; me.trigger('slimscroll', msg); } } else { releaseScroll = false; } lastScroll = percentScroll; // show only when required if(barHeight >= me.outerHeight()) { //allow window scroll releaseScroll = true; return; } bar.stop(true,true).fadeIn('fast'); if (o.railVisible) { rail.stop(true,true).fadeIn('fast'); } } function hideBar() { // only hide when options allow it if (!o.alwaysVisible) { queueHide = setTimeout(function(){ if (!(o.disableFadeOut && isOverPanel) && !isOverBar && !isDragg) { bar.fadeOut('slow'); rail.fadeOut('slow'); } }, 1000); } } hideBar(); // ThinkGem 初始化完成滚动条自动隐藏 }); // maintain chainability return this; } }); $.fn.extend({ slimscroll: $.fn.slimScroll }); })(jQuery);
{ "pile_set_name": "Github" }
*** ChibiOS/RT Test Suite *** *** Compiled: Mar 18 2020 - 11:06:17 *** Platform: STM32H755 Dual Core Very High Performance with DSP and FPU *** Test Board: STMicroelectronics STM32 Nucleo144-H755ZI *** *** Text size: 41760 bytes *** RO data size: 10668 bytes *** Data size: 220 bytes *** BSS size: 9104 bytes ============================================================================ === Test Sequence 1 (Information) ---------------------------------------------------------------------------- --- Test Case 1.1 (Port Info) --- Architecture: ARMv7E-M --- Core Variant: Cortex-M7F --- Compiler: GCC 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599] --- Port Info: Advanced kernel mode --- Natural alignment: 4 --- Stack alignment: 8 --- Working area alignment: 8 --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 1.2 (Kernel Info) --- Product: ChibiOS/RT --- Stable Flag: 1 --- Version String: 6.1.0 --- Major Number: 6 --- Minor Number: 1 --- Patch Number: 0 --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 1.3 (Kernel Settings) --- CH_CFG_ST_RESOLUTION: 32 --- CH_CFG_ST_FREQUENCY: 10000 --- CH_CFG_INTERVALS_SIZE: 32 --- CH_CFG_TIME_TYPES_SIZE: 32 --- CH_CFG_ST_TIMEDELTA: 2 --- CH_CFG_TIME_QUANTUM: 0 --- CH_CFG_MEMCORE_SIZE: 0 --- CH_CFG_NO_IDLE_THREAD: 0 --- CH_CFG_OPTIMIZE_SPEED: 1 --- CH_CFG_USE_TM: 1 --- CH_CFG_USE_REGISTRY: 1 --- CH_CFG_USE_WAITEXIT: 1 --- CH_CFG_USE_SEMAPHORES: 1 --- CH_CFG_USE_SEMAPHORES_PRIORITY: 0 --- CH_CFG_USE_MUTEXES: 1 --- CH_CFG_USE_MUTEXES_RECURSIVE: 0 --- CH_CFG_USE_CONDVARS: 1 --- CH_CFG_USE_CONDVARS_TIMEOUT: 1 --- CH_CFG_USE_EVENTS: 1 --- CH_CFG_USE_EVENTS_TIMEOUT: 1 --- CH_CFG_USE_MESSAGES: 1 --- CH_CFG_USE_MESSAGES_PRIORITY: 0 --- CH_CFG_USE_DYNAMIC: 1 --- CH_DBG_STATISTICS: 0 --- CH_DBG_SYSTEM_STATE_CHECK: 0 --- CH_DBG_ENABLE_CHECKS: 0 --- CH_DBG_ENABLE_ASSERTS: 0 --- CH_DBG_TRACE_MASK: 0 --- CH_DBG_TRACE_BUFFER_SIZE: 128 --- CH_DBG_ENABLE_STACK_CHECK: 0 --- CH_DBG_FILL_THREADS: 0 --- CH_DBG_THREADS_PROFILING: 0 --- Result: SUCCESS ============================================================================ === Test Sequence 2 (System layer and port interface) ---------------------------------------------------------------------------- --- Test Case 2.1 (System integrity functionality) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 2.2 (Critical zones functionality) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 2.3 (Interrupts handling functionality) --- Result: SUCCESS ============================================================================ === Test Sequence 3 (Time and Intervals Functionality) ---------------------------------------------------------------------------- --- Test Case 3.1 (System Tick Counter functionality) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 3.2 (Time ranges functionality) --- Result: SUCCESS ============================================================================ === Test Sequence 4 (Threads Functionality) ---------------------------------------------------------------------------- --- Test Case 4.1 (Thread Sleep functionality) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 4.2 (Ready List functionality, threads priority order) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 4.3 (Priority change test) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 4.4 (Priority change test with Priority Inheritance) --- Result: SUCCESS ============================================================================ === Test Sequence 5 (Suspend/Resume) ---------------------------------------------------------------------------- --- Test Case 5.1 (Suspend and Resume functionality) --- Result: SUCCESS ============================================================================ === Test Sequence 6 (Counter Semaphores) ---------------------------------------------------------------------------- --- Test Case 6.1 (Semaphore primitives, no state change) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 6.2 (Semaphore enqueuing test) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 6.3 (Semaphore timeout test) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 6.4 (Testing chSemAddCounterI() functionality) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 6.5 (Testing chSemWaitSignal() functionality) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 6.6 (Testing Binary Semaphores special case) --- Result: SUCCESS ============================================================================ === Test Sequence 7 (Mutexes, Condition Variables and Priority Inheritance) ---------------------------------------------------------------------------- --- Test Case 7.1 (Priority enqueuing test) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 7.2 (Priority return verification) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 7.3 (Repeated locks, non recursive scenario) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 7.4 (Condition Variable signal test) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 7.5 (Condition Variable broadcast test) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 7.6 (Condition Variable priority boost test) --- Result: SUCCESS ============================================================================ === Test Sequence 8 (Synchronous Messages) ---------------------------------------------------------------------------- --- Test Case 8.1 (Messages Server loop) --- Result: SUCCESS ============================================================================ === Test Sequence 9 (Event Sources and Event Flags) ---------------------------------------------------------------------------- --- Test Case 9.1 (Events registration) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 9.2 (Event Flags dispatching) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 9.3 (Events Flags wait using chEvtWaitOne()) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 9.4 (Events Flags wait using chEvtWaitAny()) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 9.5 (Events Flags wait using chEvtWaitAll()) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 9.6 (Events Flags wait timeouts) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 9.7 (Broadcasting using chEvtBroadcast()) --- Result: SUCCESS ============================================================================ === Test Sequence 10 (Dynamic threads) ---------------------------------------------------------------------------- --- Test Case 10.1 (Threads creation from Memory Heap) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 10.2 (Threads creation from Memory Pool) --- Result: SUCCESS ============================================================================ === Test Sequence 11 (Benchmarks) ---------------------------------------------------------------------------- --- Test Case 11.1 (Messages performance #1) --- Score : 1714255 msgs/S, 3428510 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.2 (Messages performance #2) --- Score : 1554056 msgs/S, 3108112 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.3 (Messages performance #3) --- Score : 1558111 msgs/S, 3116222 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.4 (Context Switch performance) --- Score : 5338384 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.5 (Threads performance, full cycle) --- Score : 1087365 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.6 (Threads performance, create/exit only) --- Score : 1389931 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.7 (Mass reschedule performance) --- Score : 494992 reschedules/S, 2969952 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.8 (Round-Robin voluntary reschedule) --- Score : 3844540 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Virtual Timers set/reset performance) --- Score : 3222632 timers/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.10 (Semaphores wait/signal performance) --- Score : 7999872 wait+signal/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.11 (Mutexes lock/unlock performance) --- Score : 6575244 lock+unlock/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.12 (RAM Footprint) --- System: 2176 bytes --- Thread: 68 bytes --- Timer : 20 bytes --- Semaph: 12 bytes --- Mutex : 16 bytes --- CondV.: 8 bytes --- EventS: 4 bytes --- EventL: 20 bytes --- MailB.: 40 bytes --- Result: SUCCESS ---------------------------------------------------------------------------- Final result: SUCCESS *** ChibiOS OS Library Test Suite *** *** Compiled: Mar 18 2020 - 11:06:17 *** Platform: STM32H755 Dual Core Very High Performance with DSP and FPU *** Test Board: STMicroelectronics STM32 Nucleo144-H755ZI *** *** Text size: 41760 bytes *** RO data size: 10668 bytes *** Data size: 220 bytes *** BSS size: 9104 bytes ============================================================================ === Test Sequence 1 (Information) ---------------------------------------------------------------------------- --- Test Case 1.1 (Port Info) --- Architecture: ARMv7E-M --- Core Variant: Cortex-M7F --- Compiler: GCC 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599] --- Port Info: Advanced kernel mode --- Natural alignment: 4 --- Stack alignment: 8 --- Working area alignment: 8 --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 1.2 (OS Library Info) --- Product: ChibiOS/LIB --- Stable Flag: 1 --- Version String: 1.2.0 --- Major Number: 1 --- Minor Number: 2 --- Patch Number: 0 --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 1.3 (OS Library Settings) --- CH_CFG_USE_MAILBOXES: 1 --- CH_CFG_USE_MEMCORE: 1 --- CH_CFG_USE_HEAP: 1 --- CH_CFG_USE_MEMPOOLS: 1 --- CH_CFG_USE_OBJ_FIFOS: 1 --- CH_CFG_USE_PIPES: 1 --- CH_CFG_USE_OBJ_CACHES: 1 --- CH_CFG_USE_DELEGATES: 1 --- CH_CFG_USE_FACTORY: 1 --- CH_CFG_FACTORY_MAX_NAMES_LENGTH: 8 --- CH_CFG_FACTORY_OBJECTS_REGISTRY: 1 --- CH_CFG_FACTORY_GENERIC_BUFFERS: 1 --- CH_CFG_FACTORY_SEMAPHORES: 1 --- CH_CFG_FACTORY_MAILBOXES: 1 --- CH_CFG_FACTORY_OBJ_FIFOS: 1 --- CH_CFG_FACTORY_PIPES: 1 --- Result: SUCCESS ============================================================================ === Test Sequence 2 (Mailboxes) ---------------------------------------------------------------------------- --- Test Case 2.1 (Mailbox normal API, non-blocking tests) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 2.2 (Mailbox I-Class API, non-blocking tests) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 2.3 (Mailbox timeouts) --- Result: SUCCESS ============================================================================ === Test Sequence 3 (Pipes) ---------------------------------------------------------------------------- --- Test Case 3.1 (Pipes normal API, non-blocking tests) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 3.2 (Pipe timeouts) --- Result: SUCCESS ============================================================================ === Test Sequence 4 (Jobs Queues) ---------------------------------------------------------------------------- --- Test Case 4.1 (Dispatcher test) --- Result: SUCCESS ============================================================================ === Test Sequence 5 (Thread Delegates) ---------------------------------------------------------------------------- --- Test Case 5.1 (Dispatcher test) --- Result: SUCCESS ============================================================================ === Test Sequence 6 (Objects Caches) ---------------------------------------------------------------------------- --- Test Case 6.1 (Cache initialization) --- Result: SUCCESS ============================================================================ === Test Sequence 7 (Memory Pools) ---------------------------------------------------------------------------- --- Test Case 7.1 (Loading and emptying a memory pool) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 7.2 (Loading and emptying a guarded memory pool without waiting) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 7.3 (Guarded Memory Pools timeout) --- Result: SUCCESS ============================================================================ === Test Sequence 8 (Memory Heaps) ---------------------------------------------------------------------------- --- Test Case 8.1 (Allocation and fragmentation) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 8.2 (Default Heap) --- Result: SUCCESS ============================================================================ === Test Sequence 9 (Objects Factory) ---------------------------------------------------------------------------- --- Test Case 9.1 (Objects Registry) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 9.2 (Dynamic Buffers Factory) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 9.3 (Dynamic Semaphores Factory) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 9.4 (Dynamic Mailboxes Factory) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 9.5 (Dynamic Objects FIFOs Factory) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 9.6 (Dynamic Pipes Factory) --- Result: SUCCESS ---------------------------------------------------------------------------- Final result: SUCCESS
{ "pile_set_name": "Github" }
<div id="title"> <h1>Private Lives</h1> </div> <table class="table meta-table table-condensed"> <tbody> <tr> <td class="header-column"><strong>Contributed by</strong></td> <td>Dominik Gruntz</td> </tr> <tr> <td><strong>Source</strong></td> <td>N/A</td> </tr> <tr> <td><strong>First tested with Scala version</strong></td> <td>2.10.0</td> </tr> </tbody> </table> <div class="code-snippet"> <h3>What is the result of compiling the following code?</h3> <pre class="prettyprint lang-scala"> object Lives { class Private { def foo1: Any = new Private.C1 def foo2: Any = new Private.C2 } object Private { class C1 private {} private class C2 {} } } </pre> <ol> <li>Compiles without error</li> <li id="correct-answer">The compiler reports an error in the implementation of method <tt>foo1</tt></li> <li>The compiler reports an error in the implementation of method <tt>foo2</tt></li> <li>The compiler reports an error on the implementation of methods <tt>foo1</tt> and <tt>foo2</tt></li> </ol> </div> <button id="show-and-tell" class="btn btn-primary" href="#">Display the correct answer, explanation and comments</button> <div id="explanation" class="explanation" style="display:none"> <h3>Explanation</h3> <p> Object <tt>Private</tt> defines two classes <tt>C1</tt> and <tt>C2</tt>. <tt>C2</tt> is a private class which is only accessible in object <tt>Private</tt> and its companion class, whereas <tt>C1</tt> is a public class with a private default constructor, so this class can only be instantiated within class <tt>C1</tt>. </p> <p> As a consequence, method <tt>foo2</tt> just compiles fine (as the private class <tt>C2</tt> is visible in class <tt>Private</tt>), whereas the implementation of method <tt>foo1</tt> reports the following compiler error: <pre class="prettyprint lang-scala"> error: constructor C1 in class C1 cannot be accessed in class Private def foo1: Any = new Private.C1 ^ </pre> </p> <p> Note, that the result type of method <tt>foo2</tt> has to be set to a base type of <tt>Private.C2</tt>, otherwise the result type of this method would be a type which is invisible by any caller outside of class/object <tt>Private</tt> (the compiler would report that the private class <tt>C2</tt> escapes its defining scope). For method <tt>foo1</tt> this is not necessary. </p> </div>
{ "pile_set_name": "Github" }
#ifndef _VIDEO_ADDON_H #define _VIDEO_ADDON_H #include <media/MediaAddOn.h> #define TOUCH(x) ((void)(x)) extern "C" _EXPORT BMediaAddOn *make_media_addon(image_id you); class MediaAddOn : public BMediaAddOn { public: MediaAddOn(image_id imid); virtual ~MediaAddOn(); virtual status_t InitCheck(const char **out_failure_text); virtual int32 CountFlavors(); virtual status_t GetFlavorAt(int32 n, const flavor_info ** out_info); virtual BMediaNode *InstantiateNodeFor( const flavor_info * info, BMessage * config, status_t * out_error); virtual status_t GetConfigurationFor(BMediaNode *node, BMessage *message) { TOUCH(node); TOUCH(message); return B_OK; } virtual status_t SaveConfigInfo(BMediaNode *node, BMessage *message) { TOUCH(node); TOUCH(message); return B_OK; } virtual bool WantsAutoStart() { return false; } virtual status_t AutoStart(int in_count, BMediaNode **out_node, int32 *out_internal_id, bool *out_has_more) { TOUCH(in_count); TOUCH(out_node); TOUCH(out_internal_id); TOUCH(out_has_more); return B_ERROR; } private: status_t fInitStatus; flavor_info fFlavorInfo; media_format fMediaFormat; }; #endif
{ "pile_set_name": "Github" }
try: import serial except: print('You do not have pySerial installed, which is needed to control the serial port.') print('Information on pySerial is at:\nhttp://pyserial.wiki.sourceforge.net/pySerial') import reprap, time # Import the reprap and pySerial modules. reprap.serial = serial.Serial(0, 19200, timeout = reprap.snap.messageTimeout) # Initialise serial port, here the first port (0) is used. reprap.cartesian.x.active = True # These devices are present in network, will automatically scan in the future. reprap.cartesian.y.active = True reprap.cartesian.z.active = True reprap.extruder.active = True # The module is now ready to recieve commands # moveSpeed = 220 reprap.cartesian.homeReset( moveSpeed, True ) # Send all axies to home position. Wait until arrival. reprap.cartesian.seek( (1000, 1000, 0), moveSpeed, True ) # Seek to (1000, 1000, 0). Wait until arrival. time.sleep(2) # Pause. reprap.cartesian.seek( (500, 1000, 0), moveSpeed, True ) # Seek to (500, 1000, 0). Wait until arrival. time.sleep(2) reprap.cartesian.seek( (1000, 500, 0), moveSpeed, True ) # Seek to (1000, 500, 0). Wait until arrival. time.sleep(2) reprap.cartesian.seek( (100, 100, 0), moveSpeed, True ) # Seek to (100, 100, 0). Wait until arrival. reprap.cartesian.homeReset( moveSpeed, True ) # Send all axies to home position. Wait until arrival. reprap.cartesian.free() # Shut off power to all motors.
{ "pile_set_name": "Github" }
<?php /*! * This file is part of the DocDown package. * Copyright 2011-2012 John-David Dalton <http://allyoucanleet.com/> * Available under MIT license <http://mths.be/mit> */ /** * A class to simplify parsing a single JSDoc entry. */ class Entry { /** * The documentation entry. * @member Entry * @type String */ public $entry = ''; /** * The language highlighter used for code examples. * @member Entry * @type String */ public $lang = ''; /** * The source code. * @member Entry * @type String */ public $source = ''; /*--------------------------------------------------------------------------*/ /** * Entry constructor. * @constructor * @param {String} $entry The documentation entry to analyse. * @param {String} $source The source code. * @param {String} $lang The language highlighter used for code examples. */ public function __construct( $entry, $source, $lang = 'js' ) { $this->entry = $entry; $this->lang = $lang; $this->source = str_replace(PHP_EOL, "\n", $source); } /*--------------------------------------------------------------------------*/ /** * Extracts the documentation entries from source code. * @static * @member Entry * @param {String} $source The source code. * @returns {Array} The array of entries. */ public static function getEntries( $source ) { preg_match_all('#/\*\*(?![-!])[\s\S]*?\*/\s*[^\n]+#', $source, $result); return array_pop($result); } /*--------------------------------------------------------------------------*/ /** * Checks if the entry is a function reference. * @private * @member Entry * @returns {Boolean} Returns `true` if the entry is a function reference, else `false`. */ private function isFunction() { return !!( $this->isCtor() || count($this->getParams()) || count($this->getReturns()) || preg_match('/\*\s*@function\b/', $this->entry) ); } /*--------------------------------------------------------------------------*/ /** * Extracts the function call from the entry. * @member Entry * @returns {String} The function call. */ public function getCall() { preg_match('#\*/\s*(?:function ([^(]*)|(.*?)(?=[:=,]|return\b))#', $this->entry, $result); if ($result = array_pop($result)) { $result = array_pop(explode('var ', trim(trim(array_pop(explode('.', $result))), "'"))); } // resolve name // avoid $this->getName() because it calls $this->getCall() preg_match('#\*\s*@name\s+([^\n]+)#', $this->entry, $name); if (count($name)) { $name = trim($name[1]); } else { $name = $result; } // compile function call syntax if ($this->isFunction()) { // compose parts $result = array($result); $params = $this->getParams(); foreach ($params as $param) { $result[] = $param[1]; } // format $result = $name .'('. implode(array_slice($result, 1), ', ') .')'; $result = str_replace(', [', ' [, ', str_replace('], [', ', ', $result)); } return $result ? $result : $name; } /** * Extracts the entry description. * @member Entry * @returns {String} The entry description. */ public function getDesc() { preg_match('#/\*\*(?:\s*\*)?([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result); if (count($result)) { $type = $this->getType(); $result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1])); $result = ($type == 'Function' ? '' : '(' . str_replace('|', ', ', trim($type, '{}')) . '): ') . $result; } return $result; } /** * Extracts the entry `example` data. * @member Entry * @returns {String} The entry `example` data. */ public function getExample() { preg_match('#\*\s*@example\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result); if (count($result)) { $result = trim(preg_replace('/(?:^|\n)\s*\* ?/', "\n", $result[1])); $result = '~~~ ' . $this->lang . "\n" . $result . "\n~~~"; } return $result; } /** * Resolves the line number of the entry. * @member Entry * @returns {Number} The line number. */ public function getLineNumber() { preg_match_all('/\n/', substr($this->source, 0, strrpos($this->source, $this->entry) + strlen($this->entry)), $lines); return count(array_pop($lines)) + 1; } /** * Extracts the entry `member` data. * @member Entry * @param {Number} $index The index of the array value to return. * @returns {Array|String} The entry `member` data. */ public function getMembers( $index = null ) { preg_match('#\*\s*@member(?:Of)?\s+([^\n]+)#', $this->entry, $result); if (count($result)) { $result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1])); $result = preg_split('/,\s*/', $result); } return $index !== null ? @$result[$index] : $result; } /** * Extracts the entry `name` data. * @member Entry * @returns {String} The entry `name` data. */ public function getName() { preg_match('#\*\s*@name\s+([^\n]+)#', $this->entry, $result); if (count($result)) { $result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1])); } else { $result = array_shift(explode('(', $this->getCall())); } return $result; } /** * Extracts the entry `param` data. * @member Entry * @param {Number} $index The index of the array value to return. * @returns {Array} The entry `param` data. */ public function getParams( $index = null ) { preg_match_all('#\*\s*@param\s+\{([^}]+)\}\s+(\[[^]]+\]|[$\w]+)\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#i', $this->entry, $result); if (count($result = array_filter(array_slice($result, 1)))) { // repurpose array foreach ($result as $param) { foreach ($param as $key => $value) { if (!is_array($result[0][$key])) { $result[0][$key] = array(); } $result[0][$key][] = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $value)); } } $result = $result[0]; } return $index !== null ? @$result[$index] : $result; } /** * Extracts the entry `returns` data. * @member Entry * @returns {String} The entry `returns` data. */ public function getReturns() { preg_match('#\*\s*@returns\s+\{([^}]+)\}\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result); if (count($result)) { $result = array_map('trim', array_slice($result, 1)); $result[0] = str_replace('|', ', ', $result[0]); $result[1] = preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]); } return $result; } /** * Extracts the entry `type` data. * @member Entry * @returns {String} The entry `type` data. */ public function getType() { preg_match('#\*\s*@type\s+([^\n]+)#', $this->entry, $result); if (count($result)) { $result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1])); } else { $result = $this->isFunction() ? 'Function' : 'Unknown'; } return $result; } /** * Checks if an entry is a constructor. * @member Entry * @returns {Boolean} Returns true if a constructor, else false. */ public function isCtor() { return !!preg_match('/\*\s*@constructor\b/', $this->entry); } /** * Checks if an entry *is* assigned to a prototype. * @member Entry * @returns {Boolean} Returns true if assigned to a prototype, else false. */ public function isPlugin() { return !$this->isCtor() && !$this->isPrivate() && !$this->isStatic(); } /** * Checks if an entry is private. * @member Entry * @returns {Boolean} Returns true if private, else false. */ public function isPrivate() { return !!preg_match('/\*\s*@private\b/', $this->entry) || strrpos($this->entry, '@') === false; } /** * Checks if an entry is *not* assigned to a prototype. * @member Entry * @returns {Boolean} Returns true if not assigned to a prototype, else false. */ public function isStatic() { $public = !$this->isPrivate(); $result = $public && !!preg_match('/\*\s*@static\b/', $this->entry); // set in cases where it isn't explicitly stated if ($public && !$result) { if ($parent = array_pop(preg_split('/[#.]/', $this->getMembers(0)))) { foreach (Entry::getEntries($this->source) as $entry) { $entry = new Entry($entry, $this->source); if ($entry->getName() == $parent) { $result = !$entry->isCtor(); break; } } } else { $result = true; } } return $result; } } ?>
{ "pile_set_name": "Github" }
// Aleth: Ethereum C++ client, tools and libraries. // Copyright 2014-2019 Aleth Authors. // Licensed under the GNU General Public License, Version 3. #pragma once #include "CommonNet.h" #include <libp2p/Capability.h> #include <libp2p/CapabilityHost.h> namespace dev { namespace eth { class SnapshotStorageFace; constexpr unsigned c_WarpProtocolVersion = 1; enum WarpSubprotocolPacketType : byte { WarpStatusPacket = 0x00, GetSnapshotManifestPacket = 0x11, SnapshotManifestPacket = 0x12, GetSnapshotDataPacket = 0x13, SnapshotDataPacket = 0x14, WarpSubprotocolPacketCount }; char const* warpPacketTypeToString(WarpSubprotocolPacketType _packetType); struct WarpPeerStatus { /// Peer's protocol version. unsigned m_protocolVersion = 0; /// Peer's network id. u256 m_networkId; /// What, if anything, we last asked the other peer for. Asking m_asking = Asking::Nothing; /// When we asked for it. Allows a time out. time_t m_lastAsk; /// These are determined through either a Status message. h256 m_latestHash; ///< Peer's latest block's hash. u256 m_totalDifficulty; ///< Peer's latest block's total difficulty. h256 m_genesisHash; ///< Peer's genesis hash h256 m_snapshotHash; u256 m_snapshotNumber; }; class WarpPeerObserverFace { public: virtual ~WarpPeerObserverFace() {} virtual void onPeerStatus(NodeID const& _peerID) = 0; virtual void onPeerManifest(NodeID const& _peerID, RLP const& _r) = 0; virtual void onPeerBlockHeaders(NodeID const& _peerID, RLP const& _r) = 0; virtual void onPeerData(NodeID const& _peerID, RLP const& _r) = 0; virtual void onPeerDisconnect(NodeID const& _peerID, Asking _asking) = 0; }; class WarpCapability : public p2p::CapabilityFace { public: WarpCapability(std::shared_ptr<p2p::CapabilityHostFace> _host, BlockChain const& _blockChain, u256 const& _networkId, boost::filesystem::path const& _snapshotDownloadPath, std::shared_ptr<SnapshotStorageFace> _snapshotStorage); std::string name() const override { return "par"; } unsigned version() const override { return c_WarpProtocolVersion; } p2p::CapDesc descriptor() const override { return {name(), version()}; } unsigned messageCount() const override { return WarpSubprotocolPacketCount; } char const* packetTypeToString(unsigned _packetType) const override { return warpPacketTypeToString(static_cast<WarpSubprotocolPacketType>(_packetType)); } std::chrono::milliseconds backgroundWorkInterval() const override; u256 networkId() const { return m_networkId; } void onConnect(NodeID const& _peerID, u256 const& _peerCapabilityVersion) override; bool interpretCapabilityPacket(NodeID const& _peerID, unsigned _id, RLP const&) override; void onDisconnect(NodeID const& _peerID) override; void doBackgroundWork() override; p2p::CapabilityHostFace& capabilityHost() { return *m_host; } void requestStatus(NodeID const& _peerID, unsigned _hostProtocolVersion, u256 const& _hostNetworkId, u256 const& _chainTotalDifficulty, h256 const& _chainCurrentHash, h256 const& _chainGenesisHash, h256 const& _snapshotBlockHash, u256 const& _snapshotBlockNumber); void requestBlockHeaders(NodeID const& _peerID, unsigned _startNumber, unsigned _count, unsigned _skip, bool _reverse); void requestManifest(NodeID const& _peerID); bool requestData(NodeID const& _peerID, h256 const& _chunkHash); /// Validates whether peer is able to communicate with the host, disables peer if not bool validateStatus(NodeID const& _peerID, h256 const& _genesisHash, std::vector<unsigned> const& _protocolVersions, u256 const& _networkId); void disablePeer(NodeID const& _peerID, std::string const& _problem); private: static constexpr std::chrono::milliseconds c_backgroundWorkInterval{1000}; std::shared_ptr<WarpPeerObserverFace> createPeerObserver( boost::filesystem::path const& _snapshotDownloadPath); void setAsking(NodeID const& _peerID, Asking _a); void setIdle(NodeID const& _peerID) { setAsking(_peerID, Asking::Nothing); } std::shared_ptr<p2p::CapabilityHostFace> m_host; BlockChain const& m_blockChain; u256 const m_networkId; std::shared_ptr<SnapshotStorageFace> m_snapshot; std::shared_ptr<WarpPeerObserverFace> m_peerObserver; std::unordered_map<NodeID, WarpPeerStatus> m_peers; Logger m_logger{createLogger(VerbosityDebug, "warpcap")}; Logger m_loggerWarn{createLogger(VerbosityWarning, "warpcap")}; }; } // namespace eth } // namespace dev
{ "pile_set_name": "Github" }
/* * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #include <arch_helpers.h> #include <common/debug.h> #include <plat/arm/common/plat_arm.h> /* * For SGI575 which support FCM (with automatic interconnect enter/exit), * we should not do anything in these interface functions. * They are used to override the weak functions in cci drivers. */ /****************************************************************************** * Helper function to initialize ARM interconnect driver. *****************************************************************************/ void __init plat_arm_interconnect_init(void) { } /****************************************************************************** * Helper function to place current master into coherency *****************************************************************************/ void plat_arm_interconnect_enter_coherency(void) { } /****************************************************************************** * Helper function to remove current master from coherency *****************************************************************************/ void plat_arm_interconnect_exit_coherency(void) { }
{ "pile_set_name": "Github" }
// Copyright 2015 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. #ifndef MEDIA_BLINK_MULTIBUFFER_READER_H_ #define MEDIA_BLINK_MULTIBUFFER_READER_H_ #include <stdint.h> #include <limits> #include <map> #include <set> #include "base/callback.h" #include "base/memory/weak_ptr.h" #include "media/blink/media_blink_export.h" #include "media/blink/multibuffer.h" namespace media { // Wrapper for MultiBuffer that offers a simple byte-reading // interface with prefetch. class MEDIA_BLINK_EXPORT MultiBufferReader : NON_EXPORTED_BASE(public MultiBuffer::Reader) { public: // Note that |progress_callback| is guaranteed to be called if // a redirect happens and the url_data is updated. Otherwise // origin checks will become insecure. // Users probably want to call SetMaxBuffer & SetPreload after // creating the a MultiBufferReader. // The progress callback will be called when the "available range" // changes. (The number of bytes available for reading before and // after the current position.) The arguments for the progress // callback is the first byte available (from beginning of file) // and the last byte available + 1. Note that there may be other // regions of available data in the cache as well. // If |end| is not known, use -1. MultiBufferReader( MultiBuffer* multibuffer, int64_t start, int64_t end, const base::Callback<void(int64_t, int64_t)>& progress_callback); ~MultiBufferReader() override; // Returns number of bytes available for reading. When the rest of the file // is available, the number returned will be greater than the number // or readable bytes. If an error occurs, -1 is returned. int64_t Available() const; // Seek to a different position. // If there is a pending Wait(), it will be cancelled. void Seek(int64_t pos); // Returns the current position. int64_t Tell() const { return pos_; } // Tries to read |len| bytes and advance position. // Returns number of bytes read. // If there is a pending Wait(), it will be cancelled. int64_t TryRead(uint8_t* data, int64_t len); // Wait until |len| bytes are available for reading. // Returns net::OK if |len| bytes are already available, otherwise it will // return net::ERR_IO_PENDING and call |cb| at some point later. // |len| must be smaller or equal to max_buffer_forward. int Wait(int64_t len, const base::Closure& cb); // Set how much data we try to preload into the cache ahead of our current // location. Normally, we preload until we have preload_high bytes, then // stop until we fall below preload_low bytes. Note that preload can be // set higher than max_buffer_forward, but the result is usually that // some blocks will be freed between the current position and the preload // position. void SetPreload(int64_t preload_high, int64_t preload_low); // Change how much data we pin to the cache. // The range [current_position - backward ... current_position + forward) // will be locked in the cache. Calling Wait() or TryRead() with values // larger than |forward| is not supported. void SetPinRange(int64_t backward, int64_t forward); // Set how much memory usage we target. This memory is added to the global // LRU and shared between all multibuffers. We may end up using more memory // if no memory can be freed due to pinning. void SetMaxBuffer(int64_t bytes); // Returns true if we are currently loading data. bool IsLoading() const; // Reader implementation. void NotifyAvailableRange(const Interval<MultiBufferBlockId>& range) override; // Getters int64_t preload_high() const { return preload_high_; } int64_t preload_low() const { return preload_low_; } private: friend class MultibufferDataSourceTest; // Returns the block for a particular byte position. MultiBufferBlockId block(int64_t byte_pos) const { return byte_pos >> multibuffer_->block_size_shift(); } // Returns the block for a particular byte position, rounding up. MultiBufferBlockId block_ceil(int64_t byte_pos) const { return block(byte_pos + (1LL << multibuffer_->block_size_shift()) - 1); } // Unpin previous range, then pin the new range. void PinRange(MultiBuffer::BlockId begin, MultiBuffer::BlockId end); // Check if wait operation can complete now. void CheckWait(); // Recalculate preload_pos_ and update our entry in the multibuffer // reader index. Also call CheckWait(). This function is basically // called anything changes, like when we get more data or seek to // a new position. void UpdateInternalState(); // Update end_ if p-1 contains an end-of-stream block. void UpdateEnd(MultiBufferBlockId p); // Indirection function used to call callbacks. When we post a callback // we indirect it through a weak_ptr and this function to make sure we // don't call any callbacks after this object has been destroyed. void Call(const base::Closure& cb) const; // The multibuffer we're wrapping, not owned. MultiBuffer* multibuffer_; // We're not interested in reading past this position. int64_t end_; // Defer reading once we have this much data. int64_t preload_high_; // Stop deferring once we have this much data. int64_t preload_low_; // Pin this much data in the cache from the current position. int64_t max_buffer_forward_; int64_t max_buffer_backward_; // The amount of buffer we've added to the global LRU. int64_t current_buffer_size_; // Currently pinned range. Interval<MultiBuffer::BlockId> pinned_range_; // Current position in bytes. int64_t pos_; // [block(pos_)..preload_pos_) are known to be in the cache. // preload_pos_ is only allowed to point to a filled // cache position if it is equal to end_ or pos_+preload_. // This is a pointer to a slot in the cache, so the unit is // blocks. MultiBufferBlockId preload_pos_; // True if we've requested data from the cache by calling WaitFor(). bool loading_; // When Available() > current_wait_size_ we call cb_. int64_t current_wait_size_; base::Closure cb_; // Progress callback. base::Callback<void(int64_t, int64_t)> progress_callback_; base::WeakPtrFactory<MultiBufferReader> weak_factory_; }; } // namespace media #endif // MEDIA_BLINK_MULTIBUFFER_READER_H_
{ "pile_set_name": "Github" }
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Config\Resource; /** * ResourceInterface is the interface that must be implemented by all Resource classes. * * @author Fabien Potencier <[email protected]> */ interface ResourceInterface { /** * Returns a string representation of the Resource. * * This method is necessary to allow for resource de-duplication, for example by means * of array_unique(). The string returned need not have a particular meaning, but has * to be identical for different ResourceInterface instances referring to the same * resource; and it should be unlikely to collide with that of other, unrelated * resource instances. * * @return string A string representation unique to the underlying Resource */ public function __toString(); }
{ "pile_set_name": "Github" }
This directory contains only a part of the original LZMA sources. Some files were modified and are not an exact replica of the original files in order to be compiled with the PyLZMA library. If you are looking for the original LZMA sources, please visit the official homepage at http://www.7-zip.org. -- Joachim Bauch / [email protected]
{ "pile_set_name": "Github" }
# This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # Note that this schema.rb definition is the authoritative source for your # database schema. If you need to create the application database on another # system, you should be using db:schema:load, not running all the migrations # from scratch. The latter is a flawed and unsustainable approach (the more migrations # you'll amass, the slower it'll run and the greater likelihood for issues). # # It's strongly recommended that you check this file into your version control system. ActiveRecord::Schema.define(version: 20160812134213) do create_table "posts", force: :cascade do |t| t.string "title" t.datetime "created_at", null: false t.datetime "updated_at", null: false end end
{ "pile_set_name": "Github" }
"""Contains the FileManager base classes.""" import logging import os from mpf.file_interfaces.pickle_interface import PickleInterface from mpf.file_interfaces.yaml_interface import YamlInterface MYPY = False if MYPY: # pragma: no cover from typing import Dict, List # pylint: disable-msg=cyclic-import,unused-import class FileManager: """Manages file interfaces.""" __slots__ = [] # type: List[str] log = logging.getLogger('FileManager') file_interfaces = dict() # type: Dict[str, YamlInterface] initialized = False @classmethod def init(cls): """Initialise file interfaces.""" cls.file_interfaces[".yaml"] = YamlInterface() cls.file_interfaces[".bin"] = PickleInterface() FileManager.initialized = True @staticmethod def locate_file(filename) -> str: """Find a file location. Args: filename: Filename to locate Returns: Location of file """ if not filename: raise FileNotFoundError("No filename provided") if not FileManager.initialized: FileManager.init() ext = os.path.splitext(filename)[1] if not os.path.isfile(filename): # If the file doesn't have an extension, let's see if we can find # one if not ext: for config_processor in set(FileManager.file_interfaces.values()): questionable_file, ext = config_processor.find_file(filename) if isinstance(questionable_file, str): return questionable_file raise FileNotFoundError("File not found: {}".format(filename)) return filename @staticmethod def get_file_interface(filename): """Return a file interface.""" try: FileManager.locate_file(filename) except FileNotFoundError: return None ext = os.path.splitext(filename)[1] try: return FileManager.file_interfaces[ext] except KeyError: return None @staticmethod def load(filename, verify_version=False, halt_on_error=True): """Load a file by name.""" if not FileManager.initialized: FileManager.init() try: file = FileManager.locate_file(filename) except FileNotFoundError: if halt_on_error: raise IOError("Could not find file {}".format(filename)) return dict() if not file and halt_on_error: raise IOError( "Could not find file '{}'. Resolved abs path to {}".format( filename, os.path.abspath(filename))) ext = os.path.splitext(file)[1] try: interface = FileManager.file_interfaces[ext] except KeyError: raise AssertionError("No config file processor available for file type {}".format(ext)) return interface.load(file, verify_version, halt_on_error) @staticmethod def save(filename, data): """Save data to file.""" if not FileManager.initialized: FileManager.init() ext = os.path.splitext(filename)[1] # save to temp file and move afterwards. prevents broken files temp_file = os.path.dirname(filename) + os.sep + "_" + os.path.basename(filename) try: FileManager.file_interfaces[ext].save(temp_file, data) except KeyError: raise AssertionError("No config file processor available for file type {}".format(ext)) # move temp file os.replace(temp_file, filename)
{ "pile_set_name": "Github" }
/* * Copyright (c) 2015, Chuck Coffing * OcherBook is released under the GPLv3. See COPYING. */ #include "device/kobo/KoboEvents.h" #include "Container.h" #include "device/Device.h" #include "util/Debug.h" #include "util/Logger.h" #include <cerrno> #include <cstring> #include <fcntl.h> #include <linux/input.h> #include <unistd.h> #define LOG_NAME "ocher.dev.kobo" KoboEvents::KoboEvents(EventLoop& loop) : m_loop(loop) { // mxckpd m_buttonFd = open("/dev/input/event0", O_RDONLY | O_NONBLOCK); if (m_buttonFd != -1) { ev_io_init(&m_buttonWatcher, buttonCb, m_buttonFd, EV_READ); m_buttonWatcher.data = this; ev_io_start(m_loop.evLoop, &m_buttonWatcher); } // zForce-ir-touch m_touchFd = open("/dev/input/event1", O_RDONLY | O_NONBLOCK); if (m_touchFd != -1) { ev_io_init(&m_touchWatcher, touchCb, m_touchFd, EV_READ); m_touchWatcher.data = this; ev_io_start(m_loop.evLoop, &m_touchWatcher); } } KoboEvents::~KoboEvents() { if (m_buttonFd != -1) { close(m_buttonFd); } if (m_touchFd != -1) { close(m_touchFd); } } void KoboEvents::buttonCb(struct ev_loop* , ev_io* watcher, int) { static_cast<KoboEvents*>(watcher->data)->pollButton(); } void KoboEvents::pollButton() { while (true) { struct input_event ie; int r = read(m_buttonFd, &ie, sizeof(ie)); if (r == -1) { if (errno == EINTR) continue; ASSERT(errno == EAGAIN || errno == EWOULDBLOCK); break; } else if (r == sizeof(ie)) { bool fire = true; OcherEvent evt; Log::debug(LOG_NAME, "type %u code %u value %d", ie.type, ie.code, ie.value); switch (ie.type) { case EV_KEY: evt.type = OEVT_KEY; if (ie.code == KEY_HOME) { evt.key.subtype = ie.value ? OEVT_KEY_DOWN : OEVT_KEY_UP; evt.key.key = OEVTK_HOME; } else if (ie.code == KEY_POWER) { evt.key.subtype = ie.value ? OEVT_KEY_DOWN : OEVT_KEY_UP; evt.key.key = OEVTK_POWER; } else { fire = false; } if (fire) { m_loop.emitEvent(&evt); } break; default: Log::trace(LOG_NAME, "other button %d", ie.type); } } else { break; } } } void KoboEvents::touchCb(struct ev_loop*, ev_io* watcher, int) { static_cast<KoboEvents*>(watcher->data)->pollTouch(); } void KoboEvents::pollTouch() { // If this is not enough, libev will call again. Simple is good. struct input_event kevt[64]; int r; do { r = read(m_touchFd, kevt, sizeof(kevt)); } while (r == -1 && errno == EINTR); unsigned int n = r / sizeof(struct input_event); Log::trace(LOG_NAME, "read %u events", n); // http://www.kernel.org/doc/Documentation/input/event-codes.txt int syn = 0; m_evt.type = OEVT_MOUSE; OcherMouseEvent* evt = &m_evt.mouse; for (unsigned int i = 0; i < n; ++i) { Log::debug(LOG_NAME, "type %d code %d value %d", kevt[i].type, kevt[i].code, kevt[i].value); switch (kevt[i].type) { case EV_SYN: syn = 1; Log::trace(LOG_NAME, "syn"); break; case EV_ABS: if (kevt[i].code == ABS_X) { evt->x = kevt[i].value; Log::trace(LOG_NAME, "abs x %u", evt->x); } else if (kevt[i].code == ABS_Y) { evt->y = kevt[i].value; Log::trace(LOG_NAME, "abs y %u", evt->y); } else if (kevt[i].code == ABS_PRESSURE) { unsigned int pressure = kevt[i].value; Log::trace(LOG_NAME, "abs pressure %u", pressure); if (pressure == 0) evt->subtype = OEVT_MOUSE1_UP; else { // TODO: 100 down, 101 drag evt->subtype = OEVT_MOUSE1_DOWN; } } else { // ABS_DISTANCE // ABS_MT Log::trace(LOG_NAME, "other abs %d", kevt[i].code); } break; case EV_REL: Log::trace(LOG_NAME, "rel"); break; case EV_KEY: if (kevt[i].code == BTN_TOUCH) { // touching is the common case } else { Log::trace(LOG_NAME, "other mouse key %d", kevt[i].type); } default: Log::trace(LOG_NAME, "other mouse %d", kevt[i].type); break; } if (syn) { static bool flip = g_container->device->attrs[Device::ModelNumber] == "N905C"; if (flip) { // The zForce-ir-touch driver seems to be a mess. // input/touchscreen/zforce_i2c.c:255-262 swaps X/Y coords, // but only if a global gIsCustomerUi flag is set. // Perhaps only affects some Kobo Touch? // TODO How to set gptHWCFG? see mx50_ntx_io.c CM_HWCONFIG / CM_SET_HWCONFIG if (evt->subtype == OEVT_MOUSE1_DOWN) { evt->x = 600 - evt->y; evt->y = evt->x; } } Log::info(LOG_NAME, "mouse %u, %u %s", evt->x, evt->y, evt->subtype == OEVT_MOUSE1_DOWN ? "down" : "up"); m_loop.emitEvent(&m_evt); } } }
{ "pile_set_name": "Github" }
config BR2_PACKAGE_JSON_GLIB bool "json-glib" depends on BR2_USE_WCHAR # glib2 depends on BR2_TOOLCHAIN_HAS_THREADS # glib2 depends on BR2_USE_MMU # glib2 select BR2_PACKAGE_LIBGLIB2 select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT help JSON-GLib is a library providing serialization and deserialization support for the JavaScript Object Notation (JSON) format described by RFC 4627. https://live.gnome.org/JsonGlib/ comment "json-glib needs a toolchain w/ wchar, threads" depends on BR2_USE_MMU depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
{ "pile_set_name": "Github" }
# PHPQuickCheck [![Build Status](https://travis-ci.org/steos/php-quickcheck.svg?branch=master)](https://travis-ci.org/steos/php-quickcheck) PHPQuickCheck is a generative testing library for PHP based on clojure.test.check. > Don't write tests. Generate them. - John Hughes ## Huh? Generative testing, also called property-based testing, is about describing the behaviour of your system in terms of properties that should hold true for all possible input. ### Quickstart Install PHPQuickCheck: ``` composer require steos/quickcheck --dev ``` Create a property test `test/stringsAreNeverNumeric.php`: ```php <?php use QuickCheck\Generator as Gen; use QuickCheck\Test; Test::forAll( [Gen::asciiStrings()], function($str) { return !is_numeric($str); } ); ``` And run quickcheck against it: ``` $> vendor/bin/quickcheck test/stringsAreNeverNumeric.php -t 1000 ``` ``` PHPQuickCheck 2.0.0. Don't write tests. Generate them. 834/1000 [=========================================>--------] 83% Time: 454 ms, Memory: 4.00 MB, Seed: 1578763578270, maxSize: 200 Failing inputs: array ( 0 => '9E70', ) Shrinking inputs...done. (0.00 s) Smallest failing inputs: array ( 0 => '0', ) QED. (834 tests) ``` ### Documentation - [CLI Reference](doc/cli-reference.md) - [Writing CLI Tests](doc/cli-writing-tests.md) #### API - [Introduction](doc/introduction.md) - [PHPUnit Support](doc/phpunit.md) - [Using Annotations](doc/annotations.md) - [Generator Examples](doc/generators.md) #### Other Resources - [A QuickCheck Primer for PHP Developers](https://medium.com/@thinkfunctional/a-quickcheck-primer-for-php-developers-5ffbe20c16c8) - [Testing the hard stuff and staying sane (John Hughes)](https://www.youtube.com/watch?v=zi0rHwfiX1Q) ### xdebug PHPQuickCheck uses a lot of functional programming techniques which leads to a lot of nested functions. With xdebug default settings it can quickly lead to this error: ``` Error: Maximum function nesting level of '256' reached, aborting! ``` This happens due to the infinite recursion protection setting `xdebug.max_nesting_level`. Best is to disable this or set it to a high value. The phpunit config sets it to `9999`. ### Performance - Disable xdebug to get tests to run faster. It has a huge impact on the runtime performance. - Use the GMP extension. The RNG will use the gmp functions if available. Otherwise it falls back to very slow bit-fiddling in php userland. ## Project Status PHPQuickCheck is somewhat experimental. The core functionality of clojure.test.check (v0.5.9, August 2014) has been implemented. There have been a number of improvements to clojure.test.check since the initial port which have not been implemented yet. ### Contributing All contributions are welcome. Feel free to fork and send a pull request. If you intend to make major changes please get in touch so we can coordinate our efforts. #### Dev Setup The repository contains a Dockerfile to quickly set up a dev environment. It is based on the `php:7.3.18-cli` image and adds xdebug, gmp and composer. ``` $ docker build -t php-quickcheck-dev dev-env $ docker run --rm -it --mount src=$(pwd),target=/quickcheck,type=bind php-quickcheck-dev bash # cd /quickcheck # composer install # vendor/bin/phpunit # bin/quickcheck examples ``` The image also contains a small script `toggle-ext` to toggle php extensions on and off: ``` root@c871096e2c92:/quickcheck# toggle-ext xdebug xdebug is now disabled root@c871096e2c92:/quickcheck# ``` ## Credits All credit goes to clojure.test.check, this project is mostly just a port. ## Requirements Requires PHP 7.3.x with 64 bit integers. The gmp extension is recommended but not required. ## License Copyright © 2020, Stefan Oestreicher and contributors. Distributed under the terms of the BSD (3-Clause) license.
{ "pile_set_name": "Github" }
/*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Chris Torek. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. * * @(#)makebuf.c 8.1 (Berkeley) 6/4/93 * $FreeBSD: src/lib/libc/stdio/makebuf.c,v 1.6 2007/01/09 00:28:07 imp Exp $ */ #include "namespace.h" #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include "un-namespace.h" #include "libc_private.h" #include "local.h" /* * Allocate a file buffer, or switch to unbuffered I/O. * Per the ANSI C standard, ALL tty devices default to line buffered. * * As a side effect, we set __SOPT or __SNPT (en/dis-able fseek * optimisation) right after the _fstat() that finds the buffer size. */ void __smakebuf(FILE *fp) { void *p; int flags; size_t size; int couldbetty; if (fp->pub._flags & __SNBF) { fp->_bf._base = fp->pub._p = fp->_nbuf; fp->_bf._size = 1; return; } flags = __swhatbuf(fp, &size, &couldbetty); if ((p = malloc(size)) == NULL) { fp->pub._flags |= __SNBF; fp->_bf._base = fp->pub._p = fp->_nbuf; fp->_bf._size = 1; return; } __cleanup = _cleanup; flags |= __SMBF; fp->_bf._base = fp->pub._p = p; fp->_bf._size = size; if (couldbetty && isatty(fp->pub._fileno)) flags |= __SLBF; fp->pub._flags |= flags; } /* * Internal routine to determine `proper' buffering for a file. */ int __swhatbuf(FILE *fp, size_t *bufsize, int *couldbetty) { struct stat st; if (fp->pub._fileno < 0 || _fstat(fp->pub._fileno, &st) < 0) { *couldbetty = 0; *bufsize = BUFSIZ; return (__SNPT); } /* could be a tty iff it is a character device */ *couldbetty = (st.st_mode & S_IFMT) == S_IFCHR; if (st.st_blksize <= 0) { *bufsize = BUFSIZ; return (__SNPT); } /* * Optimise fseek() only if it is a regular file. (The test for * __sseek is mainly paranoia.) It is safe to set _blksize * unconditionally; it will only be used if __SOPT is also set. */ *bufsize = st.st_blksize; fp->_blksize = st.st_blksize; return ((st.st_mode & S_IFMT) == S_IFREG && fp->_seek == __sseek ? __SOPT : __SNPT); }
{ "pile_set_name": "Github" }
/* * @Author: zhaoyang.liang * @Github: https://github.com/LzyRapx * @Date: 2019-06-13 00:02:05 */ /* SCC O(E) tarjan算法 sccno[]强连通集合,用编号标示. */ #include <bits/stdc++.h> using namespace std; const int N = 10000; struct Edge { int u, v; } e[N * N]; int first[N], Next[N * N], pre[N], sccno[N], low[N]; int n, mt, dfs_clock, scnt; stack<int> s; void addedge(int a, int b) { e[mt].u = a; e[mt].v = b; Next[mt] = first[a]; first[a] = mt++; } void tarjan(int u) { // std::cout << "tarjan" << '\n'; int i, j, v; pre[u] = low[u] = ++dfs_clock; s.push(u); for (i = first[u]; i != -1; i = Next[i]) { v = e[i].v; if (!pre[v]) { tarjan(v); low[u] = min(low[u], low[v]); } else if (!sccno[v]) { //反向边更新 low[u] = min(low[u], low[v]); } } if (low[u] == pre[u]) { //存在强连通分量 int x = -1; scnt++; while (x != u) { x = s.top(); s.pop(); sccno[x] = scnt; } } } void find_scc() { // std::cout << "SCC" << '\n'; memset(pre, 0, sizeof(pre)); memset(sccno, 0, sizeof(sccno)); scnt = dfs_clock = 0; for (int i = 1; i <= n; i++) { if (!pre[i]) tarjan(i); } } int main() { n = 7; memset(first, -1, sizeof(first)); memset(Next, -1, sizeof(Next)); for (int i = 1; i <= 10; i++) { int u, v; std::cin >> u >> v; addedge(u, v); } // std::cout << "/* message */" << '\n'; find_scc(); std::cout << scnt << '\n'; } /* 1 2 2 1 1 2 5 4 3 2 6 5 3 7 6 3 7 6 2 5 answer: 4 */
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16B2659" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> <device id="retina4_7" orientation="portrait"> <adaptation id="fullscreen"/> </device> <dependencies> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <objects> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="222" id="KGk-i7-Jjw" customClass="XJDiscoverCell" customModule="XJ直播" customModuleProvider="target"> <rect key="frame" x="0.0" y="0.0" width="309" height="222"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM"> <rect key="frame" x="0.0" y="0.0" width="309" height="221"/> <autoresizingMask key="autoresizingMask"/> <subviews> <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="Ids-oC-at1"> <rect key="frame" x="0.0" y="0.0" width="309" height="221"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <collectionViewLayout key="collectionViewLayout" id="MO0-a9-b07" customClass="XJDiscoverContentViewLayout" customModule="XJ直播" customModuleProvider="target"/> </collectionView> </subviews> <constraints> <constraint firstAttribute="trailing" secondItem="Ids-oC-at1" secondAttribute="trailing" id="CgL-YQ-bIv"/> <constraint firstItem="Ids-oC-at1" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="MOp-Cf-09d"/> <constraint firstAttribute="bottom" secondItem="Ids-oC-at1" secondAttribute="bottom" id="aR1-tq-pMk"/> <constraint firstItem="Ids-oC-at1" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="pj7-6K-igy"/> </constraints> </tableViewCellContentView> <connections> <outlet property="collectionView" destination="Ids-oC-at1" id="Ubj-aJ-2jk"/> </connections> <point key="canvasLocation" x="-58" y="25"/> </tableViewCell> </objects> </document>
{ "pile_set_name": "Github" }
#pragma once #include <functional> #include <node.h> #include <nan.h> #include "async_call_wrapper.h" namespace GNodeJS { struct AsyncCallEnvironment { static uv_async_t asyncHandle; uv_thread_t mainThread; uv_mutex_t mutex; std::queue<AsyncCallWrapper *> queue; static void Initialize(); static void QueueHandler(uv_async_t* asyncHandle); bool IsSameThread() const; void Call(std::function<void()> fn); }; };
{ "pile_set_name": "Github" }
Any raw assets you want to be deployed with your application can be placed in this directory (and child directories) and given a Build Action of "AndroidAsset". These files will be deployed with you package and will be accessible using Android's AssetManager, like this: public class ReadAsset : Activity { protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); InputStream input = Assets.Open ("my_asset.txt"); } } Additionally, some Android functions will automatically load asset files: Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <seqTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/seq_template.xsd" identifier="pretestpost"> <metadata> <version> 1.0</version> <thumbnail>pretestpost.png</thumbnail> <title>PreTest-PostTest</title> <description>Stellt ein Vorabtest/Nachtest Szenario zur Verfügung </description> <replacenode>true</replacenode> </metadata> <item type="lesson"> <title>Vorabtest/Nachtest</title> <sequencing> <controlMode flow="false" choice="false"/> </sequencing> <item type="sco" nocopy="true" nodelete="true"> <title>Vorabtest</title> <sequencing> <controlMode choiceExit="false"/> <objectives> <primaryObjective satisfiedByMeasure="false" objectiveID="primary_obj"/> <objective satisfiedByMeasure="false" objectiveID="Vorabtest Lernziel 1"> <mapInfo targetObjectiveID="gobj1" readSatisfiedStatus="false" readNormalizedMeasure="false" writeSatisfiedStatus="true" writeNormalizedMeasure="true"/> </objective> <objective satisfiedByMeasure="false" objectiveID="Vorabtest Lernziel 2"> <mapInfo targetObjectiveID="gobj2" readSatisfiedStatus="false" readNormalizedMeasure="false" writeSatisfiedStatus="true" writeNormalizedMeasure="true"/> </objective> <objective satisfiedByMeasure="false" objectiveID="Vorabtest Lernziel 3"> <mapInfo targetObjectiveID="gobj2" readSatisfiedStatus="false" readNormalizedMeasure="false" writeSatisfiedStatus="true" writeNormalizedMeasure="true"/> </objective> </objectives> </sequencing> </item> <item type="sco"> <title>SCO 1</title> <sequencing> <sequencingRules> <preConditionRule> <ruleConditions conditionCombination="all"> <ruleCondition operator="noOp" referencedObjective="SCO 1 Objective" condition="satisfied"/> </ruleConditions> <ruleAction action="skip"/> </preConditionRule> </sequencingRules> <objectives> <primaryObjective objectiveID="SCO 1 Objective"> <mapInfo targetObjectiveID="gobj1" readSatisfiedStatus="true" readNormalizedMeasure="true" writeSatisfiedStatus="false" writeNormalizedMeasure="false"/> </primaryObjective> </objectives> </sequencing> </item> <item type="sco"> <title>SCO 2</title> <sequencing> <sequencingRules> <preConditionRule> <ruleConditions conditionCombination="all"> <ruleCondition operator="noOp" referencedObjective="SCO 2 Objective" condition="satisfied"/> </ruleConditions> <ruleAction action="skip"/> </preConditionRule> </sequencingRules> <objectives> <primaryObjective objectiveID="SCO 2 Objective"> <mapInfo targetObjectiveID="gobj2" readSatisfiedStatus="true" readNormalizedMeasure="true" writeSatisfiedStatus="false" writeNormalizedMeasure="false"/> </primaryObjective> </objectives> </sequencing> </item> <item type="sco"> <title>SCO 3</title> <sequencing> <sequencingRules> <preConditionRule> <ruleConditions conditionCombination="all"> <ruleCondition operator="noOp" referencedObjective="SCO 3 Objective" condition="satisfied"/> </ruleConditions> <ruleAction action="skip"/> </preConditionRule> </sequencingRules> <objectives> <primaryObjective objectiveID="SCO 3 Objective"> <mapInfo targetObjectiveID="gobj3" readSatisfiedStatus="true" readNormalizedMeasure="true" writeSatisfiedStatus="false" writeNormalizedMeasure="false"/> </primaryObjective> </objectives> </sequencing> </item> <item type="sco"> <title>Nachtest</title> <sequencing> <controlMode choiceExit="false"/> </sequencing> </item> </item> </seqTemplate>
{ "pile_set_name": "Github" }
package uk.ac.bbsrc.tgac.miso.core.service; import java.io.IOException; import java.util.List; import uk.ac.bbsrc.tgac.miso.core.data.impl.AttachmentCategory; public interface AttachmentCategoryService extends DeleterService<AttachmentCategory> { public List<AttachmentCategory> list() throws IOException; public long save(AttachmentCategory category) throws IOException; }
{ "pile_set_name": "Github" }
/** * * WARNING! This file was autogenerated by: * _ _ _ _ __ __ * | | | | | | |\ \ / / * | | | | |_| | \ V / * | | | | _ | / \ * | |_| | | | |/ /^\ \ * \___/\_| |_/\/ \/ * * This file was autogenerated by UnrealHxGenerator using UHT definitions. * It only includes UPROPERTYs and UFUNCTIONs. Do not modify it! * In order to add more definitions, create or edit a type with the same name/package, but with an `_Extra` suffix **/ package unreal.umg; @:umodule("UMG") @:glueCppIncludes("UMG.h", "Public/Components/DynamicEntryBox.h") @:uname("EDynamicBoxType") @:class @:uextern @:uenum extern enum EDynamicBoxType { Horizontal; Vertical; Wrap; Overlay; }
{ "pile_set_name": "Github" }
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright (c) 2013-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at * https://oss.oracle.com/licenses/CDDL+GPL-1.1 * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" * exception as provided by Oracle in the GPL Version 2 section of the License * file that accompanied this code. * * Modifications: * If applicable, add the following below the License Header, with the fields * enclosed by brackets [] replaced by your own identifying information: * "Portions Copyright [year] [name of copyright owner]" * * Contributor(s): * If you wish your version of this file to be governed by only the CDDL or * only the GPL Version 2, indicate your decision by adding "[Contributor] * elects to include this software in this distribution under the [CDDL or GPL * Version 2] license." If you don't indicate a single choice of license, a * recipient has the option to distribute your version of this file under * either the CDDL, the GPL Version 2 or to extend the choice of license to * its licensees as provided above. However, if you add GPL Version 2 code * and therefore, elected the GPL Version 2 license, then the option applies * only if the new code is made subject to such option by the copyright * holder. */ package org.glassfish.security.services.impl.authorization; import org.glassfish.security.services.api.authorization.*; import org.glassfish.security.services.api.common.Attribute; import org.glassfish.security.services.impl.common.AttributeImpl; import org.junit.After; import org.junit.Before; import org.junit.Test; import javax.security.auth.Subject; import java.net.URI; import java.security.AllPermission; import java.util.ArrayList; import java.util.List; import static junit.framework.Assert.*; import static org.glassfish.security.services.impl.authorization.AuthorizationServiceImpl.InitializationState.*; /** * @see AuthorizationServiceImpl */ public class AuthorizationServiceImplTest { private AuthorizationServiceImpl impl; @Before public void setUp() throws Exception { impl = new AuthorizationServiceImpl(); } @After public void tearDown() throws Exception { impl = null; } @Test public void testInitialize() throws Exception { assertSame( "NOT_INITIALIZED", NOT_INITIALIZED, impl.getInitializationState() ); try { impl.initialize(null); fail( "Expected initialize to fail." ); } catch ( RuntimeException e ) { } assertSame( "FAILED_INIT", FAILED_INIT, impl.getInitializationState() ); assertNotNull( "getReasonInitializationFailed", impl.getReasonInitializationFailed() ); } @Test public void testIsPermissionGranted() throws Exception { assertSame( "NOT_INITIALIZED", NOT_INITIALIZED, impl.getInitializationState() ); // Does not require service initialization impl.isPermissionGranted( new Subject(), new AllPermission() ); } @Test public void testIsAuthorized() throws Exception { assertSame( "NOT_INITIALIZED", NOT_INITIALIZED, impl.getInitializationState() ); try { impl.isAuthorized( new Subject(), new URI( "admin:///tenants/tenant/mytenant" ), "update" ); fail( "Expected fail not initialized." ); } catch ( RuntimeException e ) { } assertSame("NOT_INITIALIZED", NOT_INITIALIZED, impl.getInitializationState()); assertNotNull( "getReasonInitializationFailed", impl.getReasonInitializationFailed() ); } @Test public void testGetAuthorizationDecision() throws Exception { assertSame( "NOT_INITIALIZED", NOT_INITIALIZED, impl.getInitializationState() ); try { impl.getAuthorizationDecision( new AzSubjectImpl( new Subject() ), new AzResourceImpl( new URI( "admin:///tenants/tenant/mytenant" ) ), new AzActionImpl( "update" ) ); fail( "Expected fail not initialized." ); } catch ( RuntimeException e ) { } assertSame("NOT_INITIALIZED", NOT_INITIALIZED, impl.getInitializationState()); assertNotNull( "getReasonInitializationFailed", impl.getReasonInitializationFailed() ); } @Test public void testMakeAzSubject() throws Exception { try { impl.makeAzSubject(null); fail( "Expected fail with null." ); } catch ( IllegalArgumentException e ) { } Subject s = new Subject(); assertSame("Subject", s, impl.makeAzSubject(s).getSubject()); } @Test public void testMakeAzResource() throws Exception { try { impl.makeAzResource(null); fail( "Expected fail with null." ); } catch ( IllegalArgumentException e ) { } URI u = new URI( "admin:///" ); assertSame("URI", u, impl.makeAzResource(u).getUri()); } @Test public void testMakeAzAction() throws Exception { AzAction azAction; azAction = impl.makeAzAction( null ); assertNotNull( azAction ); assertNull( "Null", azAction.getAction() ); String action = "update"; azAction = impl.makeAzAction( action ); assertNotNull(azAction); assertEquals("action", action, azAction.getAction()); } @Test public void testFindOrCreateDeploymentContext() throws Exception { assertSame( "NOT_INITIALIZED", NOT_INITIALIZED, impl.getInitializationState() ); try { impl.findOrCreateDeploymentContext("foo"); fail( "Expected fail not initialized." ); } catch ( RuntimeException e ) { } assertSame("NOT_INITIALIZED", NOT_INITIALIZED, impl.getInitializationState()); assertNotNull("getReasonInitializationFailed", impl.getReasonInitializationFailed()); } @Test public void testAttributeResolvers() throws Exception { assertEquals( "initial", 0 , impl.getAttributeResolvers().size() ); final AzAttributeResolver testAr1 = new TestAttributeResolver( new AttributeImpl("1") ); final AzAttributeResolver testAr2 = new TestAttributeResolver( new AttributeImpl("2") ); assertTrue( "append 1", impl.appendAttributeResolver( testAr1 ) ); assertFalse( "append 1", impl.appendAttributeResolver( testAr1 ) ); assertTrue( "append 2", impl.appendAttributeResolver( testAr2 ) ); assertFalse( "append 2", impl.appendAttributeResolver( testAr2 ) ); List<AzAttributeResolver> arList = impl.getAttributeResolvers(); assertEquals( "size after append", 2, arList.size()); assertEquals( "append 1", "1", arList.get(0).resolve(null,null,null).getName() ); assertEquals( "append 2", "2", arList.get(1).resolve(null,null,null).getName() ); final AzAttributeResolver testAr3 = new TestAttributeResolver( new AttributeImpl("3") ); final AzAttributeResolver testAr4 = new TestAttributeResolver( new AttributeImpl("4") ); List<AzAttributeResolver> tempList = new ArrayList<AzAttributeResolver>(); tempList.add(testAr3); tempList.add(testAr4); impl.setAttributeResolvers( tempList ); List<AzAttributeResolver> arList2 = impl.getAttributeResolvers(); assertEquals("after get list 2", 2, arList2.size()); assertEquals("append 3", "3", arList2.get(0).resolve(null, null, null).getName()); assertEquals( "append 4", "4", arList2.get(1).resolve(null,null,null).getName() ); assertTrue( "removeAllAttributeResolvers", impl.removeAllAttributeResolvers() ); assertFalse( "removeAllAttributeResolvers", impl.removeAllAttributeResolvers() ); assertEquals( "final", 0 , impl.getAttributeResolvers().size() ); } /** * Fake test class */ private static class TestAttributeResolver implements AzAttributeResolver { final Attribute attr; private TestAttributeResolver(Attribute attr) { this.attr = attr; } @Override public Attribute resolve( String attributeName, AzAttributes collection, AzEnvironment environment) { return this.attr; } } }
{ "pile_set_name": "Github" }
var searchData= [ ['use_5fstatic_5finit',['USE_STATIC_INIT',['../arm__class__marks__example__f32_8c.html#a821d6c5973940580f5a045e7cf64b7f2',1,'arm_class_marks_example_f32.c']]] ];
{ "pile_set_name": "Github" }
go-radix [![Build Status](https://travis-ci.org/armon/go-radix.png)](https://travis-ci.org/armon/go-radix) ========= Provides the `radix` package that implements a [radix tree](http://en.wikipedia.org/wiki/Radix_tree). The package only provides a single `Tree` implementation, optimized for sparse nodes. As a radix tree, it provides the following: * O(k) operations. In many cases, this can be faster than a hash table since the hash function is an O(k) operation, and hash tables have very poor cache locality. * Minimum / Maximum value lookups * Ordered iteration For an immutable variant, see [go-immutable-radix](https://github.com/hashicorp/go-immutable-radix). Documentation ============= The full documentation is available on [Godoc](http://godoc.org/github.com/armon/go-radix). Example ======= Below is a simple example of usage ```go // Create a tree r := radix.New() r.Insert("foo", 1) r.Insert("bar", 2) r.Insert("foobar", 2) // Find the longest prefix match m, _, _ := r.LongestPrefix("foozip") if m != "foo" { panic("should be foo") } ```
{ "pile_set_name": "Github" }
<!DOCTYPE html> <!-- this file is auto-generated. DO NOT EDIT. /* ** Copyright (c) 2012 The Khronos Group Inc. ** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the ** "Materials"), to deal in the Materials without restriction, including ** without limitation the rights to use, copy, modify, merge, publish, ** distribute, sublicense, and/or sell copies of the Materials, and to ** permit persons to whom the Materials are 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 Materials. ** ** THE MATERIALS ARE 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 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. */ --> <html> <head> <meta charset="utf-8"> <title>WebGL GLSL conformance test: log2_009_to_012.html</title> <link rel="stylesheet" href="../../../../resources/js-test-style.css" /> <link rel="stylesheet" href="../../../resources/ogles-tests.css" /> <script src="../../../../resources/js-test-pre.js"></script> <script src="../../../resources/webgl-test-utils.js"></script> <script src="../../ogles-utils.js"></script> </head> <body> <canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas> <div id="description"></div> <div id="console"></div> </body> <script> "use strict"; OpenGLESTestRunner.run({ "tests": [ { "referenceProgram": { "vertexShader": "log2_vec2_vert_xvary_ref.vert", "fragmentShader": "../default/default.frag" }, "model": "grid", "testProgram": { "vertexShader": "log2_vec2_vert_xvary.vert", "fragmentShader": "../default/default.frag" }, "name": "log2_vec2_vert_xvary.test.html", "pattern": "compare" }, { "referenceProgram": { "vertexShader": "log2_vec2_vert_xvary01_ref.vert", "fragmentShader": "../default/default.frag" }, "model": "grid", "testProgram": { "vertexShader": "log2_vec2_vert_xvary01.vert", "fragmentShader": "../default/default.frag" }, "name": "log2_vec2_vert_xvary01.test.html", "pattern": "compare" }, { "referenceProgram": { "vertexShader": "log2_vec3_vert_xvary_ref.vert", "fragmentShader": "../default/default.frag" }, "model": "grid", "testProgram": { "vertexShader": "log2_vec3_vert_xvary.vert", "fragmentShader": "../default/default.frag" }, "name": "log2_vec3_vert_xvary.test.html", "pattern": "compare" }, { "referenceProgram": { "vertexShader": "log2_vec3_vert_xvary01_ref.vert", "fragmentShader": "../default/default.frag" }, "model": "grid", "testProgram": { "vertexShader": "log2_vec3_vert_xvary01.vert", "fragmentShader": "../default/default.frag" }, "name": "log2_vec3_vert_xvary01.test.html", "pattern": "compare" } ] }); var successfullyParsed = true; </script> </html>
{ "pile_set_name": "Github" }