hexsha
stringlengths
40
40
size
int64
5
1.05M
ext
stringclasses
588 values
lang
stringclasses
305 values
max_stars_repo_path
stringlengths
3
363
max_stars_repo_name
stringlengths
5
118
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
10
max_stars_count
float64
1
191k
max_stars_repo_stars_event_min_datetime
stringdate
2015-01-01 00:00:35
2022-03-31 23:43:49
max_stars_repo_stars_event_max_datetime
stringdate
2015-01-01 12:37:38
2022-03-31 23:59:52
max_issues_repo_path
stringlengths
3
363
max_issues_repo_name
stringlengths
5
118
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
10
max_issues_count
float64
1
134k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
363
max_forks_repo_name
stringlengths
5
135
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
10
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringdate
2015-01-01 00:01:02
2022-03-31 23:27:27
max_forks_repo_forks_event_max_datetime
stringdate
2015-01-03 08:55:07
2022-03-31 23:59:24
content
stringlengths
5
1.05M
avg_line_length
float64
1.13
1.04M
max_line_length
int64
1
1.05M
alphanum_fraction
float64
0
1
484bb67db268ce7e6ac6d798188cc8726496a87b
247
rst
reStructuredText
docs/license.rst
swang373/vhbbtools
437d79d77e22a3708591d6c6c0c211036b5845f8
[ "Apache-2.0", "MIT" ]
1
2017-10-13T17:54:06.000Z
2017-10-13T17:54:06.000Z
docs/license.rst
swang373/vhbbtools
437d79d77e22a3708591d6c6c0c211036b5845f8
[ "Apache-2.0", "MIT" ]
null
null
null
docs/license.rst
swang373/vhbbtools
437d79d77e22a3708591d6c6c0c211036b5845f8
[ "Apache-2.0", "MIT" ]
null
null
null
License ======= vhbbtools is licensed under the MIT License, so you're free to do whatever you please with it as long as a copy of the following license is distributed along with your stuff in some fashion: .. include:: ../LICENSE :literal:
22.454545
78
0.732794
604dd3ba47ae1d6dc52e28d957f1f4fbdb63a835
482
rst
reStructuredText
sample/source/index.rst
murnana/sphinx-extention-sample
4b6578441d17eefab21b04ba43568351dd937e4b
[ "MIT" ]
null
null
null
sample/source/index.rst
murnana/sphinx-extention-sample
4b6578441d17eefab21b04ba43568351dd937e4b
[ "MIT" ]
null
null
null
sample/source/index.rst
murnana/sphinx-extention-sample
4b6578441d17eefab21b04ba43568351dd937e4b
[ "MIT" ]
null
null
null
.. sample-todo documentation master file, created by sphinx-quickstart on Tue Aug 28 07:53:54 2018. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. Welcome to sample-todo's documentation! ========================================= .. todo:: hoge .. todo:: page .. todo:: foo .. todo:: bar .. todolist:: Indices and tables ==================== * :ref:`genindex` * :ref:`modindex` * :ref:`search`
15.0625
76
0.591286
35de7c00bc405ad4a3fbcf30f7b233cc7e59ab7c
384
rst
reStructuredText
docs/source/api/polynomials.rst
deisenroth/prysm
53a400ef89697041f67192e879e61ad28c451318
[ "MIT" ]
1
2021-12-06T14:28:02.000Z
2021-12-06T14:28:02.000Z
docs/source/api/polynomials.rst
mjhoptics/prysm
5dea335e068d04d1006741d8eb02278181751f73
[ "MIT" ]
null
null
null
docs/source/api/polynomials.rst
mjhoptics/prysm
5dea335e068d04d1006741d8eb02278181751f73
[ "MIT" ]
null
null
null
***************** prysm.polynomials ***************** .. automodule:: prysm.polynomials :members: .. automodule:: prysm.polynomials.zernike :members: .. automodule:: prysm.polynomials.qpoly :members: .. automodule:: prysm.polynomials.jacobi :members: .. automodule:: prysm.polynomials.cheby :members: .. automodule:: prysm.polynomials.legendre :members:
17.454545
42
0.638021
69a2c17c721387b9a2f1f53dfd45ece316e46ae3
2,425
rst
reStructuredText
old-reference-manuals/plone_3_theming/buildingblocks/skin/layers/precedence.rst
Acidburn0zzz/documentation
360a6741c62e24c0e487436438d0be97ce9ee2a1
[ "CC-BY-4.0" ]
null
null
null
old-reference-manuals/plone_3_theming/buildingblocks/skin/layers/precedence.rst
Acidburn0zzz/documentation
360a6741c62e24c0e487436438d0be97ce9ee2a1
[ "CC-BY-4.0" ]
null
null
null
old-reference-manuals/plone_3_theming/buildingblocks/skin/layers/precedence.rst
Acidburn0zzz/documentation
360a6741c62e24c0e487436438d0be97ce9ee2a1
[ "CC-BY-4.0" ]
null
null
null
Customizing through Order of Precedence ======================================= How skin layers work and how they can be used in customization. If you've worked with Plone 2, you'll be familiar with this type of customization. As we mentioned earlier, the order of layers in a skin determines which page templates, CSS files and Python scripts are processed first. To inspect the order of precedence: - Site > Zope Management Interface > portal\_skins - click the Properties tab You should see the layers of the Plone Default skin listed there. Layers such as 'plone\_templates' come from the main Plone theme but there will also be layers providing templates from specific add-on products (the visual editor kupu for instance). |screenshot of Skin layers in the ZMI|\ When asked to process a specific template, Plone will work from the top of this list downwards, looking in each layer in turn to retrieve the template. At the top is a custom layer; any template placed in here will be found and used first. So, to create your own version of a Plone template or CSS file, give it the same name as the Plone version but put it in the custom layer. This is the simplest approach, but just ensuring that your version lives in a layer higher in the order of precedence in a skin than the main Plone theme layers will be enough to ensure that Plone finds it first and ignores the original version. This technique can be used in two ways using the custom folder through the Zope Management Interface, you can add your own versions of templates, style sheets etc to the custom folder. This always comes at the top, so you can be sure your versions will be found first. adding your own skin layers in your own theme product on the file system, create one or two skin layers, and ensure that on installation these layers are put just below the custom folder in the order or precedence. There's more information on how to do this in the next section. Probably the most comprehensive description of skins, layers and order or precedence can be found in the first two sections of `Chapter 7 of The Definitive Guide to Plone <http://docs.neuroinf.de/PloneBook/ch7.rst>`_ (note that most of this book refers to Plone 2, but these sections are still relevant for Plone 3). .. |screenshot of Skin layers in the ZMI| image:: /old-reference-manuals/plone_3_theming/images/order_of_precedence.png
43.303571
119
0.769485
a9a2d6ca87f8b43695fb0d2b934af45f80a76711
243
rst
reStructuredText
apetools/parameters/api/apetools.parameters.iperf_server_parameters.IperfParametersEnum.udp.rst
rsnakamura/oldape
b4d1c77e1d611fe2b30768b42bdc7493afb0ea95
[ "Apache-2.0" ]
null
null
null
apetools/parameters/api/apetools.parameters.iperf_server_parameters.IperfParametersEnum.udp.rst
rsnakamura/oldape
b4d1c77e1d611fe2b30768b42bdc7493afb0ea95
[ "Apache-2.0" ]
null
null
null
apetools/parameters/api/apetools.parameters.iperf_server_parameters.IperfParametersEnum.udp.rst
rsnakamura/oldape
b4d1c77e1d611fe2b30768b42bdc7493afb0ea95
[ "Apache-2.0" ]
null
null
null
apetools.parameters.iperf_server_parameters.IperfParametersEnum.udp =================================================================== .. currentmodule:: apetools.parameters.iperf_server_parameters .. autoattribute:: IperfParametersEnum.udp
40.5
67
0.625514
f8790742f0264b1149d773d5b4c9cdde6f5d190f
2,402
rst
reStructuredText
README.rst
appu1232/discord.webhooks
7aa497fb3410a196f13ad0388172220a77e3a5d3
[ "MIT" ]
3
2019-11-08T11:57:01.000Z
2022-03-04T16:20:39.000Z
README.rst
appu1232/discord.webhooks
7aa497fb3410a196f13ad0388172220a77e3a5d3
[ "MIT" ]
null
null
null
README.rst
appu1232/discord.webhooks
7aa497fb3410a196f13ad0388172220a77e3a5d3
[ "MIT" ]
null
null
null
discord.webhooks ================ .. raw:: html <!--- TODO: Change all of these badges later. ---> .. image:: https://api.codacy.com/project/badge/Grade/b505a5b0cf5e4b57b4b4c56fefe833b0 :alt: Codacy Badge :target: https://www.codacy.com/app/AraHaan/discord-webhooks?utm_source=github.com&utm_medium=referral&utm_content=AraHaan/discord.webhooks&utm_campaign=badger .. image:: https://img.shields.io/pypi/v/discord.webhooks.svg :target: https://pypi.python.org/pypi/discord.webhooks/ .. image:: https://img.shields.io/pypi/pyversions/discord.webhooks.svg :target: https://pypi.python.org/pypi/discord.webhooks/ This is an extension to discord.py that allows you to use webhooks for discord bots. This does depend on discord.py being installed however it is not installed when installing this package. All dependencies should be installed already. The reason why I do not do this is when someone needs to keep the voice support of discord.py installed. To install on Windows --------------------- .. code:: sh path\to\python.exe -m pip install --upgrade discord.webhooks To install on Linux ------------------- .. code:: sh pip3 install --upgrade discord.webhooks Requirements ------------ - discord.py - Python 3.4+ Documentation ------------- See `docs/usage.rst <docs/usage.rst>`__ for documentation. Example ------- example cog using the commands extension in discord.py that uses discord.webhooks: .. code:: py from discord.ext import commands from discord_webhooks import * class WebhookExample: """webhook example cog class that contains an webhook example command.""" def __init__(self, bot): self.webhook_class = Webhook(bot) self.request_webhook = self.webhook_class.request_webhook # to request an webhook. @commands.command(name='examplecommand', pass_context=True, no_pm=True) async def examplecommand_command(self, ctx): """ sends whatever you typed into the command after the bot prefix + 'examplecommand' via webhook. """ msgdata = ctx.message.content[len(ctx.prefix + "examplecommand"):].strip() await self.request_webhook('/{channel id}/{webhook token}', content=msgdata) def setup(bot): """ example webhook cog. """ new_cog = WebHooks(bot) bot.add_cog(new_cog)
28.595238
162
0.676103
84e526022f215f884eeedc4be519e65f6305f920
199
rst
reStructuredText
source/iocom-reference/message-format/message-format.rst
iocafe/iocafe-doc
b5b29fc55caedddc538bf7fdea1921cebca04822
[ "MIT" ]
1
2020-04-28T23:26:45.000Z
2020-04-28T23:26:45.000Z
source/iocom-reference/message-format/message-format.rst
iocafe/iocafe-doc
b5b29fc55caedddc538bf7fdea1921cebca04822
[ "MIT" ]
null
null
null
source/iocom-reference/message-format/message-format.rst
iocafe/iocafe-doc
b5b29fc55caedddc538bf7fdea1921cebca04822
[ "MIT" ]
null
null
null
Message framing and formats ============================= .. toctree:: :maxdepth: 2 :caption: Contents: 200219-message-framing 210910-authentication-message 200118-data-compression
16.583333
32
0.61809
15f328215c4a41311e4361b5eab70b1f7e0fed73
2,083
rst
reStructuredText
documents/aws-php-developers-guide/doc_source/s3-examples-static-web-host.rst
siagholami/aws-documentation
2d06ee9011f3192b2ff38c09f04e01f1ea9e0191
[ "CC-BY-4.0" ]
5
2021-08-13T09:20:58.000Z
2021-12-16T22:13:54.000Z
documents/aws-php-developers-guide/doc_source/s3-examples-static-web-host.rst
siagholami/aws-documentation
2d06ee9011f3192b2ff38c09f04e01f1ea9e0191
[ "CC-BY-4.0" ]
null
null
null
documents/aws-php-developers-guide/doc_source/s3-examples-static-web-host.rst
siagholami/aws-documentation
2d06ee9011f3192b2ff38c09f04e01f1ea9e0191
[ "CC-BY-4.0" ]
null
null
null
.. Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ################################################################### Using an |S3| Bucket as a Static Web Host with |sdk-php| Version 3 ################################################################### .. meta:: :description: Get, set, and remove website configuration for an Amazon S3 bucket with the AWS SDK for PHP version 3. :keywords: Amazon S3 code examples You can host a static website on |S3|. To learn more, see :S3-dg:`Hosting a Static Website on S3 <WebsiteHosting>`. The following example shows how to: * Get the website configuration for a bucket using :aws-php-class:`GetBucketWebsite <api-s3-2006-03-01.html#getbucketwebsite>`. * Set the website configuration for a bucket using :aws-php-class:`PutBucketWebsite <api-s3-2006-03-01.html#putbucketwebsite>`. * Remove the website configuration from a bucket using :aws-php-class:`DeleteBucketWebsite <api-s3-2006-03-01.html#deletebucketwebsite>`. All the example code for the |sdk-php| Version 3 is available `here on GitHub <https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/php/example_code>`_. Credentials =========== Before running the example code, configure your AWS credentials. See :doc:`guide_credentials`. Get, Set, and Delete the Website Configuration for a Bucket =========================================================== **Imports** .. literalinclude:: s3.php.webhost.import.txt :language: php **Sample Code** .. literalinclude:: s3.php.webhost.main.txt :language: php
42.510204
159
0.68603
b8d7b5eb1aea7bd37327858e059adb7e2b34f9ea
3,865
rst
reStructuredText
documentation/sphinx/getting_started/build/build.rst
tonyhuang84/foxbms
45113f205e943b6368c9e91ad6a9a99a1466875a
[ "CC-BY-4.0" ]
null
null
null
documentation/sphinx/getting_started/build/build.rst
tonyhuang84/foxbms
45113f205e943b6368c9e91ad6a9a99a1466875a
[ "CC-BY-4.0" ]
null
null
null
documentation/sphinx/getting_started/build/build.rst
tonyhuang84/foxbms
45113f205e943b6368c9e91ad6a9a99a1466875a
[ "CC-BY-4.0" ]
null
null
null
.. include:: ../../macros.rst .. _GETTING_STARTED_BUILD: ============================================== Building the foxBMS Software and Documentation ============================================== Requirements ------------ The build process of |foxbms| heavily depends on Python, for example, for code generation purposes. |foxbms| hence comes with its own Python distribution, called |foxconda3|, powered by `Anaconda <https://continuum.io>`_. These build instructions assume that |foxconda3| was successfully installed and that the ``PATH`` environment has been adjusted accordingly. For further information refer to the |foxconda3| documentation (:ref:`getting_started_foxconda`). Obtaining the Sources --------------------- Download or clone the |foxbms| repository from `github.com/foxBMS/ <https://github.com/foxBMS/foxbms>`_. .. warning:: Do not change directory names or the structure inside ``foxbms``. If this is changed most, if not all, ``wscript``\ s, have to be heavily adpated and this can get very complex extremly fast. Building the Binaries and Documentation --------------------------------------- .. note:: All commands described here must be run in the ``Anaconda Prompt`` provided by |foxconda3|. |foxbms| targets can be build using the command line or using the |foxbms| Eclipse workspace. This section describes the build from command line. Details on building the binaries using the Eclipse Workspace can be found in ":ref:`getting_started_eclipse_workspace`". The tool for building targets is found in ``foxbms\tools`` and is called ``waf``. A help is displayed by running ``python tools\waf -h``. In the |foxbms| project, several targets can be built. The output is stored in a subdirectory of ``\build\``. - To be able to build binaries and documentation, the project needs to be configured once: .. code-block:: console python tools\waf configure This will create a directory ``build`` including the configuration files. - Primary MCU: - Doxygen documentation - This target is built with ``python tools\waf doxygen_primary``. - The output directory is ``build\primary\doxygen``. - The main document of the software documentation is found at ``build\primary\doxygen\html\index.html``. - Binaries - This target is built with ``python tools\waf build_primary``. - The output directory is ``build\primary\embedded-software``. - The files generated in the directory ``build\primary\embedded-software\mcu-primary\src\general`` are: - ``foxbms_primary.elf``, - ``foxbms_primary_flash.bin``, - ``foxbms_primary_flashheader.bin`` and - ``foxbms_primary.hex``. - The primary mcu binaries and documentation are cleaned by running ``python tools\waf clean_primary``. - Secondary MCU: - Doxygen documentation - This target is built with ``python tools\waf doxygen_secondary``. - The output directory is ``build\secondary\doxygen``. - The main document of the software documentation is found at ``build\secondary\doxygen\html\index.html``. - Binaries - This target is built with ``python tools\waf build_secondary``. - The output directory is ``build\secondary\embedded-software``. - The files generated in the directory ``build\secondary\embedded-software\mcu-secondary\src\general`` are: - ``foxbms_secondary.elf``, - ``foxbms_secondary_flash.bin``, - ``foxbms_secondary_flashheader.bin`` and - ``foxbms_secondary.hex``. - The secondary mcu binaries and documentation are cleaned by running ``python tools\waf clean_secondary``. - General documentation (``sphinx`` documentation): - This target is built with ``python tools\waf sphinx``. - The output directory is ``build\sphinx``. - The main document of the software documentation is found in ``build\documentation\index.html``.
34.81982
110
0.70401
415be1b81aa4bfa08d9bfb71466fd8b706a2c3e1
1,209
rst
reStructuredText
doc/source/measurements.rst
tourbillon-python/tourbillon-nginx
dbb82e79af4e8039d139b3a5aad3c457750a85e8
[ "Apache-2.0" ]
null
null
null
doc/source/measurements.rst
tourbillon-python/tourbillon-nginx
dbb82e79af4e8039d139b3a5aad3c457750a85e8
[ "Apache-2.0" ]
null
null
null
doc/source/measurements.rst
tourbillon-python/tourbillon-nginx
dbb82e79af4e8039d139b3a5aad3c457750a85e8
[ "Apache-2.0" ]
null
null
null
Measurements ************ tourbillon-nginx collects metrics about the server status. Please refers to `http://nginx.org/en/docs/http/ngx_http_stub_status_module.html <http://nginx.org/en/docs/http/ngx_http_stub_status_module.html>`_ for more information. Nginx stats =========== tourbillon-nginx store metrics in the ``nginx_stats`` series. Each datapoint is tagged with the Nginx instance hostname and the values collected are: Tags ---- * **host**: Nginx instance hostname Fields ------ * **connections**: current number of active client connections including waiting connections * **total_accepts**: total number of accepted client connections * **total_handled**: total number of handled connections. Generally, the parameter value is the same as accepts unless some resource limits have been reached (for example, the worker_connections limit) * **total_requests**: total number of client requests * **reading**: current number of connections where nginx is reading the request header * **writing**: current number of connections where nginx is writing the response back to the client * **waiting**: current number of idle client connections waiting for a request
39
205
0.74938
82df8c3b78090f0cd18338d9999aa3049909ab1e
9,038
rst
reStructuredText
specs/kilo/rootwrap-daemon-mode.rst
openstack/neutron-specs
89c638cd71aebb29399537414f8bcb63c900f61a
[ "CC-BY-3.0" ]
51
2015-01-29T20:10:42.000Z
2021-12-23T13:07:25.000Z
specs/kilo/rootwrap-daemon-mode.rst
godaddy/neutron-specs
2e94925b527095774c6bd2149d485d17efa8ee3e
[ "CC-BY-3.0" ]
null
null
null
specs/kilo/rootwrap-daemon-mode.rst
godaddy/neutron-specs
2e94925b527095774c6bd2149d485d17efa8ee3e
[ "CC-BY-3.0" ]
34
2015-01-26T23:32:29.000Z
2019-11-28T08:09:00.000Z
.. This work is licensed under a Creative Commons Attribution 3.0 Unported License. http://creativecommons.org/licenses/by/3.0/legalcode ==================== rootwrap daemon mode ==================== https://blueprints.launchpad.net/neutron/+spec/rootwrap-daemon-mode Neutron is one of projects that heavily depends on executing actions on network nodes that require root priviledges on Linux system. Currently this is achieved with oslo.rootwrap that has to be run with sudo. Both sudo and rootwrap produce significant performance overhead. This blueprint covers mitigating the sudo and rootwrap introduced part of the overhead by using the new mode of rootwrap operation called 'daemon mode'. Problem Description =================== As Miguel Angel Ajo stated in [#ml]_: .. On a database with 1 public network, 192 private networks, 192 routers, and 192 nano VMs, with OVS plugin: Network node setup time (rootwrap): 24 minutes Network node setup time (sudo): 10 minutes As you can see, rootwrap presents major overhead comparing to plain sudo usage and most of this overhead is due to long Python interpreter startup time required for every request. Details of the overhead are covered in [#rw_bp]_. Proposed Change =============== This blueprint proposes adopting oslo.rootwrap daemon model which allows to run rootwrap as a daemon. The daemon works just as a usual rootwrap but will accept commands to be run over authenticated UNIX domain socket instead of command line, running continuously in background. An overview of rootwrap daemon is at [#rw_eth]_. Two new configuration options should be added: * ``rootwrap_mode`` = daemon | process will make agents use daemon or the usual rootwrap process; daemon will be enabled by default. This option could be deprecated in the future if we consider the daemon mode performs as we expect. * ``rootwrap_config`` will provide path to rootwrap config file used to run daemon, by default it will point to the neutron provider rootwrap files. Since ``root_helper`` is passed around in Neutron (as opposed to use of global config in other projects) we have to make root_helper as some object encapsulating all necessary info to run commands with root priviledges. This is done in the first patch [#cr_rh]_. The patch introduces two root helper classes: * ``ProcessHelper`` (base) simply runs command as is, with no wrappers; * ``WrappedProcessHelper`` runs commands with a wrapper just as ``root_helper`` option used to do. These classes have two interface methods: * ``create_process`` starts a process and returns Popen instance associated with it; * ``execute`` starts a process (using ``create_process`` by default), feeds it some input and captures return code along with stdout and stderr output. Note that ``create_process`` and ``execute`` methods in the ``neutron.agent.linux.utils`` module are still there but they just preprocess arguments and pass them to appropriate methods of ``root_helper``. The second step [#cr_rw]_ would be to create those configuration options and add another root helper class ``RootwrapDaemonHelper``. This class would employ one rootwrap client for all instances with same rootwrap_config. Its ``execute`` method would just call ``execute`` method of rootwrap client that would pass request to the daemon. Note that we can't currently start long-running processes using daemon so ``create_process`` will use usual rootwrap to start the process. Also the gain for long running processes is negligible. Data Model Impact ----------------- None REST API Impact --------------- None Security Impact --------------- This change will start oslo rootwrap daemons running as root, and available to neutron via a well authenticated (OTP) unix domain socket. Therefore ``neutron-rootwrap-daemon`` should be added to the ``sudoers`` file, with the same settings used for neutron-rootwrap. Security is handled by oslo-rootwrap which is quite well proven. All security issues with using client+daemon instead of plain rootwrap are covered in [#rw_bp]_. Notifications Impact -------------------- None Other End User Impact --------------------- None Performance Impact ------------------ This change introduces performance boost for agents that rely on calling a huge amount of commands with rootwrap. Current state of rootwrap daemon shows over 10x speedup comparing to usual ``sudo rootwrap`` call. Total speedup for agents will be less impressive but should be very noticeable. The rootwrap daemon implementation includes a benchmark which generated the speedup results. Other Deployer Impact --------------------- This change introduces two new config variables: * ``rootwrap_mode`` using ``daemon`` as default; * ``rootwrap_config`` must point to ``rootwrap.conf`` deployed for Neutron (default ``/etc/neutron/rootwrap.conf``). Note that by default ``use_rootwrap_daemon`` will be turned off so to get the speedup one will have to turn it on. With it turned on ``root_helper`` config option is ignored and ``neutron-rootwrap-daemon`` is used to run most commands that require root priviledges. This change also introduces new binary ``neutron-rootwrap-daemon`` that should be deployed beside ``neutron-rootwrap`` and added to ``sudoers``. Developer Impact ---------------- None Community Impact ---------------- The community is broadly interested in faster agent operation. Alternatives ------------ * Use sudo without rootwrap, at the cost of lower security, or by implementing specific sudo plugins to allow equivalent equivalent rootwrap filtering. That would require maintaining C sudo plugins specific for openstack. * Rewrite rootwrap into C, but that requires code auditing, and also deviates from the standard python of the openstack community. * Automatically translate rootwrap into C++, and obtain a compiled version, this option has been explored, and seems to be possible via shedskin with small modifications to rootwrap to avoid dynamic typing. By the way, shedskin is experimental, and some python modules are not implemented. Also the C++ produced code is not easily human readable, and may need a security assesment. This solution doesn't eliminate the sudo performance impact, which is not negligible. Other Solutions ---------------- Other solutions are mostly related to rootwrap optimizations and are covered in [#rw_bp]_ (some of them are covered in [#eth]_). This is not the only option of what can be done on the Neutron side besides switching to rootwrap daemon (see [#eth]_ for details): * Avoid unnecessary locking in router processing in L3 agent * Avoid unnecessary calls * Consolidate system calls: Carl Baldwin explored this option, and proved to be very difficult and invasive to the code base. All of these can be done with rootwrap daemon as well since every call to the daemon still impose some overhead. IPv6 Impact ----------- None Implementation ============== Assignee(s) ----------- Primary assignee: * twilson (Terry Wilson, otherwiseguy @ freenode) Original contributor: * yorik-sar (Yuriy Taraday, YorikSar @ freenode) Work Items ---------- * Abstract out root_helper calls to classes - done [#cr_rh]_; * Implement rootwrap daemon support - done, needs rebase [#cr_rw]_; Dependencies ============ None Testing ======= Tempest Tests ------------- This change doesn't change APIs so it doesn't require additional integration tests. If tempest is happy with ``use_rootwrap_daemon`` turned on, the feature works. Functional Tests ---------------- Existing functional tests will exercise the rootwrap client side when performing agents functional testing. Rootwrap also has it's own functional testing for the rootwrap client/daemon pieces [#rw_func]_. API Tests --------- No API tests are required. Documentation Impact ==================== User Documentation ------------------ As we are including two new configuration settings, those need to be properly documented. Developer Documentation ----------------------- Developer documentation may be updated to describe how to use the new interface to execute system commands, if any change were made to the interface. References ========== .. [#rw_bp] oslo.rootwrap blueprint: https://blueprints.launchpad.net/oslo.rootwrap/+spec/rootwrap-daemon-mode .. [#ml] Original mailing list thread: http://lists.openstack.org/pipermail/openstack-dev/2014-March/029017.html .. [#rw_eth] Daemon design overview: https://etherpad.openstack.org/p/rootwrap-agent .. [#cr_rh] Change request "Abstract out root_helper calls to classes": https://review.openstack.org/82787 .. [#cr_rw] Change request "Implement rootwrap daemon support": https://review.openstack.org/84667 .. [#eth] Original problem statement summarized here: https://etherpad.openstack.org/p/neutron-agent-exec-performance .. [#rw_func] Rootwrap daemon functional testing https://github.com/openstack/oslo.rootwrap/blob/master/tests/test_functional.py
31.381944
82
0.745408
65015903fc8782379f294a714008309e8d7377f9
2,260
rst
reStructuredText
docs/vim/host/HostProxySwitch.rst
nandonov/pyvmomi
ad9575859087177623f08b92c24132ac019fb6d9
[ "Apache-2.0" ]
12
2016-09-14T21:59:46.000Z
2019-12-18T18:02:55.000Z
docs/vim/host/HostProxySwitch.rst
nandonov/pyvmomi
ad9575859087177623f08b92c24132ac019fb6d9
[ "Apache-2.0" ]
2
2019-01-07T12:02:47.000Z
2019-01-07T12:05:34.000Z
docs/vim/host/HostProxySwitch.rst
nandonov/pyvmomi
ad9575859087177623f08b92c24132ac019fb6d9
[ "Apache-2.0" ]
8
2020-05-21T03:26:03.000Z
2022-01-26T11:29:21.000Z
.. _int: https://docs.python.org/2/library/stdtypes.html .. _str: https://docs.python.org/2/library/stdtypes.html .. _bool: https://docs.python.org/2/library/stdtypes.html .. _vim.KeyValue: ../../vim/KeyValue.rst .. _vSphere API 4.0: ../../vim/version.rst#vimversionversion5 .. _vmodl.DynamicData: ../../vmodl/DynamicData.rst .. _vim.host.PhysicalNic: ../../vim/host/PhysicalNic.rst .. _vim.host.HostProxySwitch.Specification: ../../vim/host/HostProxySwitch/Specification.rst .. _vim.host.HostProxySwitch.HostLagConfig: ../../vim/host/HostProxySwitch/HostLagConfig.rst vim.host.HostProxySwitch ======================== The HostProxySwitch is a software entity which represents the component of a DistributedVirtualSwitch on a particular host. :extends: vmodl.DynamicData_ :since: `vSphere API 4.0`_ Attributes: dvsUuid (`str`_): The uuid of the DistributedVirtualSwitch that the HostProxySwitch is a part of. dvsName (`str`_): The name of the DistributedVirtualSwitch that the HostProxySwitch is part of. key (`str`_): The proxy switch key. numPorts (`int`_): The number of ports that this switch currently has. configNumPorts (`int`_, optional): The configured number of ports that this switch has. If configured number of ports is changed, a host reboot is required for the new value to take effect. numPortsAvailable (`int`_): The number of ports that are available on this virtual switch. uplinkPort ([`vim.KeyValue`_], optional): The list of ports that can be potentially used by physical nics. This property contains the keys and names of such ports. mtu (`int`_, optional): The maximum transmission unit (MTU) associated with this switch in bytes. pnic ([`vim.host.PhysicalNic`_], optional): The set of physical network adapters associated with this switch. spec (`vim.host.HostProxySwitch.Specification`_): The specification of the switch. hostLag ([`vim.host.HostProxySwitch.HostLagConfig`_], optional): The Link Aggregation Control Protocol group and Uplink ports in the group. networkReservationSupported (`bool`_, optional): Indicates whether network reservation is supported on this switch
35.873016
161
0.717699
a388a01ea88486846b8c25e17b206a93464f5863
2,861
rst
reStructuredText
docs/pages/Object_API.rst
AO-StreetArt/Aesel
3e7bd400508c2a2dbcb2f0b1f45ed3e763ca2c7f
[ "Apache-2.0" ]
2
2021-02-24T16:44:49.000Z
2021-10-30T02:38:47.000Z
docs/pages/Object_API.rst
AO-StreetArt/Aesel
3e7bd400508c2a2dbcb2f0b1f45ed3e763ca2c7f
[ "Apache-2.0" ]
10
2018-02-22T07:09:05.000Z
2019-08-22T23:53:44.000Z
docs/pages/Object_API.rst
AO-StreetArt/Aesel
3e7bd400508c2a2dbcb2f0b1f45ed3e763ca2c7f
[ "Apache-2.0" ]
null
null
null
Object API ========== An Object is represented by a transformation matrix representing it’s position in 3-space, as well as a collection of Assets (Mesh files, Texture files, Shader scripts, etc.). Objects are meant to be interacted with by individual devices, and these changes will be streamed to either devices via the forthcoming UDP API. This API exposes CRUD and Query operations for Objects. Objects may also have a frame/timestamp, as well as animation graph handles. Both of these are, however, optional. Object Creation ~~~~~~~~~~~~~~~ .. http:post:: /v1/scene/(scene_key)/object/ Create a new object with key `obj_key` in scene `scene_key`. The generated key of the object will be returned in the response. :reqheader Content-Type: Application/json :statuscode 200: Success .. include:: _examples/object/object_create.rst Object Update ~~~~~~~~~~~~~ .. http:post:: /v1/scene/(scene_key)/object/(object_key) Update an existing object with name `obj_name` in scene `scene_name`. :reqheader Content-Type: Application/json :statuscode 200: Success .. include:: _examples/object/object_update.rst Object Retrieval ~~~~~~~~~~~~~~~~ .. http:get:: /v1/scene/(scene_key)/object/(object_key) Get an object with key `obj_key` in scene `scene_key`. :statuscode 200: Success .. include:: _examples/object/object_get.rst Object Deletion ~~~~~~~~~~~~~~~ .. http:delete:: /v1/scene/(scene_key)/object/(object_key) Delete an object. :statuscode 200: Success .. include:: _examples/object/object_delete.rst Object Query ~~~~~~~~~~~~ .. http:post:: /v1/scene/(scene_key)/object/query Query for objects in scene `scene_key`. .. include:: _examples/object/object_query.rst Object Lock ~~~~~~~~~~~ .. http:get:: /v1/scene/(scene_key)/object/(object_key)/lock A lock allows a single client to obtain 'ownership' of an object. This is an atomic operation, and is guaranteed to return a lock to one and only one client who requests it. Keep in mind, however, that no checks are performed within CLyman to verify that the object's owner is the only one updating it, it is the responsibility of the client to obtain a lock prior to making updates. :statuscode 200: Success :statuscode 423: Object Lock Failed :query string device: Required. The ID of the Device requesting the lock. .. include:: _examples/object/object_lock.rst Object Unlock ~~~~~~~~~~~~~ .. http:delete:: /v1/scene/(scene_key)/object/(object_key)/lock Unlocking allows a client to release 'ownership' of an object. This is an atomic operation, and no additional locks will be granted on a locked object until this method is called by the owner. :statuscode 200: Success :query string device: Required. The ID of the Device requesting the lock. .. include:: _examples/object/object_unlock.rst
28.61
85
0.719678
c7ef23634db9d938a846a139095d9a8f4de9c294
88
rst
reStructuredText
docs/sources/CSVShape_class.rst
philbarker/csv2shex
01127c34becc1b5a7ce8d750c0e69435a72fcbdf
[ "CC0-1.0" ]
null
null
null
docs/sources/CSVShape_class.rst
philbarker/csv2shex
01127c34becc1b5a7ce8d750c0e69435a72fcbdf
[ "CC0-1.0" ]
null
null
null
docs/sources/CSVShape_class.rst
philbarker/csv2shex
01127c34becc1b5a7ce8d750c0e69435a72fcbdf
[ "CC0-1.0" ]
null
null
null
CSVShape class ^^^^^^^^^^^^^^ .. autoclass:: csv2shex.csvshape.CSVShape :members:
12.571429
41
0.602273
252512d2c0076eb9463cdeb78781fa2c470bbc18
2,938
rst
reStructuredText
THANKS.rst
demianw/nipype
52d64c30d96ecd94f1833156e28dce32c4f05ebe
[ "BSD-3-Clause" ]
null
null
null
THANKS.rst
demianw/nipype
52d64c30d96ecd94f1833156e28dce32c4f05ebe
[ "BSD-3-Clause" ]
null
null
null
THANKS.rst
demianw/nipype
52d64c30d96ecd94f1833156e28dce32c4f05ebe
[ "BSD-3-Clause" ]
1
2016-10-11T19:18:53.000Z
2016-10-11T19:18:53.000Z
.. -*- mode: rst -*- Code contributors ----------------- Contributors to Nipype include but are not limited to: .. hlist:: * Aimi Watanabe * Alexander Schaefer * Alexandre Gramfort * Alexandre Savio * Anisha Keshavan * Ariel Rokem * Ben Acland * Ben Cipollini * Basile Pinsard * Brendan Moloney * Brian Cheung * Charl Linssen * Chris Filo Gorgolewski * Chris Steele * Christian Haselgrove * Christopher Burns * Cindee Madison * Claire Tarbert * Colin Buchanan * Daniel Ginsburg * Daniel Haehn * Daniel Margulies * Dav Clark * David Welch * Drew Erickson * Erik Kastman * Félix C. Morency * Gael Varoquaux * Hans Johnson * Janosch Linkersdörfer * Januzz * Jarrod Millman * Jeff Lai * Jessica Forbes * John Salvatore * Lijie Huang * Michael Hallquist * Michael Hanke * Michael Notter * Michael Waskom * Nolan Nichols * Oliver Hinds * Oscar Esteban * Rosalia Tungaraza * Satrajit Ghosh * Sharad Sikka * Stephan Gerhard * Erik Ziegler * Valentin Haenel * Xiangzhen Kong * Xu Wang * Yannick Schwartz * Yaroslav O. Halchenko For full most up to date list see `Ohloh <https://www.ohloh.net/p/nipype/contributors>`__. Other contributors ------------------ .. hlist:: * Matthew Brett * Michael Castelle * Philippe Ciuciu * Yann Cointepas * Mark D'Esposito * Susan Gabrieli * Brian Hawthorne * Tim Leslie * Fernando Perez * Tyler Perrachione * Jean-Baptiste Poline * Alexis Roche * Denis Riviere * Gretchen Reynolds * Jonathan Taylor * Bertrand Thirion * Bernjamin Thyreau * Mike Trumpis * Karl Young * Tom Waite We would also like to thank `JetBrains <http://www.jetbrains.com/>`__ for providing `Pycharm <http://www.jetbrains.com/pycharm/>`__ licenses. Funding ------- Satrajit Ghosh work on this project was partially funded by NIBIB R03 EB008673 (PI: Ghosh and Whitfield-Gabrieli) and by the `INCF <http://www.incf.org>`__ through a contract with TankThink Labs, LLC. Chris Burns was supported by NIMH grant 5R01MH081909-02 (PI: Desposito). Hans Jonson was supported by `2 U54 EB005149 - 06 Core 2b Huntington's Disease - Driving Biological Project <http://projectreporter.nih.gov/project_info_description.cfm?aid=8153616&icde=16158743&ddparam=&ddvalue=&ddsub=&cr=18&csb=PT&cs=ASC>`__, `S10 RR023392 Enterprise Storage In A Collaborative Neuroimaging Environment <http://projectreporter.nih.gov/project_info_description.cfm?aid=7209718&icde=16158552&ddparam=&ddvalue=&ddsub=&cr=1&csb=default&cs=ASC>`__, `R01 NS040068 Neurobiological Predictors of Huntington's Disease <http://projectreporter.nih.gov/project_info_description.cfm?aid=6266377&icde=16158103>`__, and `UL1 TR000442 University of Iowa Clinical and Translational Science Program <http://projectreporter.nih.gov/project_info_description.cfm?aid=8467220&icde=16159156&ddparam=&ddvalue=&ddsub=&cr=1&csb=default&cs=ASC>`__.
28.524272
220
0.72226
0060b3d11438215502e9ca9ac4b0849c29cece29
403
rst
reStructuredText
README.rst
tgdane/timpani
28e4e2428a4a4241d984c1b78f4cef14b1116ee0
[ "MIT" ]
2
2019-03-28T21:30:05.000Z
2021-10-03T07:05:54.000Z
README.rst
tgdane/timpani
28e4e2428a4a4241d984c1b78f4cef14b1116ee0
[ "MIT" ]
6
2018-11-30T17:06:13.000Z
2021-06-01T23:00:43.000Z
README.rst
tgdane/timpani
28e4e2428a4a4241d984c1b78f4cef14b1116ee0
[ "MIT" ]
null
null
null
Timpani ======= .. image:: https://circleci.com/gh/tgdane/timpani.svg?style=svg :target: https://circleci.com/gh/tgdane/timpani ---- Test impact analysis for python. ---- This project is based on the blog post for performing test impact analysis on python projects written by Paul Hammant: https://paulhammant.com/2015/01/18/reducing-test-times-by-only-running-impacted-tests-python-edition/
22.388889
101
0.741935
bcdb6b02fe7377cce19918b9260c420566c42e5f
160
rst
reStructuredText
docs/source/generated/alfred3.element.misc.WebExitEnabler.web_widget.rst
mate-code/alfred
e687e9318ecefe3a49565027841ca8d910647978
[ "MIT" ]
9
2020-05-11T08:13:12.000Z
2022-01-20T11:35:14.000Z
docs/source/generated/alfred3.element.misc.WebExitEnabler.web_widget.rst
mate-code/alfred
e687e9318ecefe3a49565027841ca8d910647978
[ "MIT" ]
77
2019-02-22T07:34:58.000Z
2022-02-23T15:32:34.000Z
docs/source/generated/alfred3.element.misc.WebExitEnabler.web_widget.rst
mate-code/alfred
e687e9318ecefe3a49565027841ca8d910647978
[ "MIT" ]
6
2020-11-11T16:51:04.000Z
2022-02-21T10:29:02.000Z
WebExitEnabler.web\_widget ============================================== .. currentmodule:: alfred3.element.misc .. autoattribute:: WebExitEnabler.web_widget
26.666667
46
0.575
e5a56ec9340332cc80bd8b819e7b813d359ee02f
7,028
rst
reStructuredText
README.rst
KarlTDebiec/Ramaplot
3e23039eaaaffe92a23890cdcb83eabc7dbab868
[ "BSD-3-Clause" ]
5
2015-09-25T16:37:56.000Z
2020-06-08T11:06:42.000Z
README.rst
KarlTDebiec/Ramaplot
3e23039eaaaffe92a23890cdcb83eabc7dbab868
[ "BSD-3-Clause" ]
1
2016-08-06T18:24:16.000Z
2016-08-07T18:28:01.000Z
README.rst
KarlTDebiec/Ramaplot
3e23039eaaaffe92a23890cdcb83eabc7dbab868
[ "BSD-3-Clause" ]
3
2015-09-25T16:38:01.000Z
2022-03-27T18:28:37.000Z
Introduction ============ Ramaplot is a Python program used to generate `Ramachandran plot <https://en.wikipedia.org/wiki/Ramachandran_plot>`_ figures using matplotlib. Ramachandran plots are a powerful method of visualizing the distribution of backbone Φ and Ψ dihedral angles in peptides and proteins, or of other properites as a function of Φ and Ψ. Ramaplot configuration is powered by `myplotspec <http://karltdebiec.github.io/myplotspec>`_, enabling powerful configuration options from `YAML <http://www.yaml.org/spec/1.2/spec.html>`_-format text files. Several types of experimental and simulated datasets are currently supported. .. image:: examples/example.png Supported Datasets ------------------ Experiment ~~~~~~~~~~ Neighbor-Dependent Ramachandran Distributions _____________________________________________ The Neighbor-Dependent Ramachandran Distribution (NDRD) dataset is a collection of Φ/Ψ probability distributions measured from the loop (non-α/β) regions of solved structures. In addition to distributions for all 20 amino acids, left- and right-neighbor distributions are available for each pair of amino acids, which may be used to calculate distributions of each amino-acid triplet. The complete dataset includes residues identified as turn, coil, bridge, π helix, and 3\ :sub:`10` helix; versions including only turn, coil, and bridge, only turn, and only coil are available as well. This dataset may be obtained from `<http://dunbrack.fccc.edu/ndrd>`_. `Ting, Daniel, Wang, Guoli, Shapovalov, Maxim, Mitra, Rajib, Jordan, Michael I, Dunbrack Jr. Roland L. Neighbor-Dependent Ramachandran Probability Distributions of Amino Acids Developed from a Hierarchical Dirichlet Process Model. PLoS Computational Biology. 2010. 6. e1000763. <http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1000763>`_ Conformation-Dependent Library ______________________________ The Conformation-Dependent Library (CDL) dataset is a collection of averages and standard deviations of backbone bond lengths, angles, and ω as a function of Φ and Ψ, measured from solved structures. The dataset is divided into 8 classes: isoleucine/valine, glycine, proline, and all other residues, each leading into proline or residues other than proline. This dataset may be obtained from `<http://dunbrack.fccc.edu/nmhrcm>`_ and `<http://dunbrack.fccc.edu/omega>`_. `Berkholz, Donald S., Shapovalov, Maxim V., Dunbrack Jr. Roland L., Karplus, P. Andrew. Conformation Dependence of Backbone Geometry in Proteins. Structure. 2009. 17. 1316-1325. <http://www.sciencedirect.com/science/article/pii/S0969212609003359>`_ `Berkholz, Donald S., Driggers, Camden M., Shapovalov, Maxim V., Dunbrack Jr., Roland L., Karplus, P. Andrew. Nonplanar Peptide Bonds in Proteins are Common and Conserved but not Biased Toward Active Sites. Proceedings of the National Acadedemy of the Sciences of the United States of America. 2012. 109. 449-453. <http://www.pnas.org/content/109/2/449>`_ Simulation ~~~~~~~~~~ Molecular Dynamics Simulation _____________________________ The distribution of observed Φ and Ψ dihedral angles from a molecular dynamics simulation may be calculated from a text file containing a timeseries, typically calculated from the trajectory using `cpptraj <https://github.com/Amber-MD/cpptraj>`_. Alternatively, the average value of another property as a function of Φ and Ψ may be calculated. `Roe, Daniel R., Cheatham III, Thomas E. PTRAJ and CPPTRAJ: Software for Processing and Analysis of Molecular Dynamics Trajectory Data. Journal of Chemical Theory and Computation. 2013. 93084–3095. <http://pubs.acs.org/doi/abs/10.1021/ct400341p>`_ Umbrella Sampling/Weighted Histogram Analysis Method ____________________________________________________ As an alternative to brute-force sampling of a simulated protein system using a long continuous unbiased trajectory, it is possible to obtain comparable results in less simulation time using the Umbrella Sampling method of enhanced sampling. In this method, the system is restrained to selected values along one or more coordinates of interest (such as the Φ and Ψ dihedral angles), typically using a harmonic restraint. Provided that the sampling within each 'window' overlaps with its neighbors, the true free energy of the system as a function of the chosen coordinate(s) may be subsequently calculated using the `Weighted Histogram Analysis Method (WHAM) <http://membrane.urmc.rochester.edu/content/wham>`_ `Grossfield, Alan. WHAM: The Weighted Histogram Analysis Method. Version 2.0.9. <http://membrane.urmc.rochester.edu/content/wham>`_ Molecular Mechanics Force Fields ________________________________ The distribution of Φ and Ψ dihedral angles sampled in a molecular dynamics simulation are a function of the force field parameters used, in particular the fourier series used to model the potential energy surface along Φ and Ψ. These parameters may be loaded from an `Amber-format force field <http://ambermd.org/#ff>`_ (parm*.dat). (Work in progress) Images ~~~~~~ In order to enable more direct comparison to published Ramachandran plots, Ramaplot supports plotting of image files. Example Usage ------------- The example output shown above may be generated using the following command: :: python Ramaplot.py -yaml examples/example.yml example.yml ~~~~~~~~~~~ :: preset: notebook figures: 0: outfile: examples/example.png ncols: 3 bottom: 0.9 subplots: 0: preset: colorbar_bottom title: AMBER ff14SB datasets: 0: kind: wham infile: examples/ff14SB.dat 1: title: CHARMM36 datasets: 0: kind: wham infile: examples/charmm36.dat 2: preset: [diff, colorbar_bottom] title: ff14SB - CHARMM36 datasets: 0: dataset_kw: minuend: kind: wham infile: examples/ff14SB.dat subtrahend: kind: wham infile: examples/charmm36.dat mask_cutoff: 5 Dependencies ------------ Ramaplot supports Python 2.7 and 3.4, and requires the following packages: - matplotlib - numpy - pandas - six - yaml Ramaplot has been tested with Anaconda Python 2.2.0 on Arch Linux, OSX Yosemite, and Windows 8.1. Authorship ---------- Ramaplot is developed by Karl T. Debiec, a graduate student at the University of Pittsburgh advised by Professors Lillian T. Chong and Angela M. Gronenborn. License ------- Released under a 3-clause BSD license.
39.706215
86
0.705179
957f7eead167c9ecf9925db9c319f198c9c27911
674
rst
reStructuredText
site/content/Email.rst
andrewhowdencom/documentation-development
2dfcabbaea22e15eefd30b494492f09f44923b57
[ "BSD-Source-Code" ]
null
null
null
site/content/Email.rst
andrewhowdencom/documentation-development
2dfcabbaea22e15eefd30b494492f09f44923b57
[ "BSD-Source-Code" ]
11
2015-08-31T23:02:44.000Z
2015-09-24T08:39:14.000Z
site/content/Email.rst
andrewhowdencom/documentation-development
2dfcabbaea22e15eefd30b494492f09f44923b57
[ "BSD-Source-Code" ]
null
null
null
Naming Standards ---------------- ================== ===== =================== Construct Std Example ================== ===== =================== Delimiter ``-`` ================== ===== =================== Standard Addresses ------------------ ============================= ============================ Bug fixes / software updates [email protected] Website Administrators [email protected] Support / Help [email protected] ============================= ============================ Standard Signature ------------------ Example User Job Title T: 0438 123 456 | E: [email protected] | W: http://litleman.co
26.96
63
0.376855
3222311a9752698863a9bf20c6eda1d8b321edb3
7,270
rst
reStructuredText
docs/updating.rst
stevear22/FreeField
44263e6df01d5202ca29457a228a48baae854d4d
[ "Apache-2.0" ]
null
null
null
docs/updating.rst
stevear22/FreeField
44263e6df01d5202ca29457a228a48baae854d4d
[ "Apache-2.0" ]
null
null
null
docs/updating.rst
stevear22/FreeField
44263e6df01d5202ca29457a228a48baae854d4d
[ "Apache-2.0" ]
null
null
null
Installing updates ================== The FreeField developers periodically release updates that improve the performance or add new features to FreeField. It is recommended that you always install stable updates when released. If you have installed FreeField using releases from GitHub, updates can be installed from the updates section of the administration interface. If you installed FreeField using ``git clone``, you must update using ``git pull`` instead. The updates section on the administration lists the current version, and any currently available versions, offering you to install them. .. image:: _images/updating-01-update-interface.png Update branches --------------- FreeField offers several release branches that can be chosen when updating, ranging from alpha to stable. The alpha release will often contain the latest bleeding-edge releases very soon after they are added to the codebase, but may have significant bugs and can break unexpectedly. Once an alpha release reaches feature parity for its corresponding version milestone, it is pushed to beta. New beta releases will only contain minor updates and bugfixes. When beta versions are deemed stable for production use, they are pushed to the release candidate (rc) channel, and documentation will be written. Once documentation has been written, and any remaining reported bugs are fixed, the update is considered complete, and is pushed to the stable channel, prompting update alerts in all FreeField installations. Minor updates may skip one or more release channels. Updates to the field research list, for example, are generally pushed directly to the stable branch, given their extremely small likelihood to cause issues, and time-sensitive nature of publication. Most users are recommended to use the release candidate (rc) or stable branches for production usage. Administrators who wish to try out new features quickly may opt to use beta or even alpha release channels, offering new features sooner, at the cost of reduced stability. Installing an update -------------------- Navigate to the updates section of the administration pages and click on :guilabel:`Check for updates now` to check for new updates. If an update is found, its release channel will be displayed in a list on that page. Click on your desired release to find changelogs for the update and a button to install the update. .. caution:: The FreeField developers cannot guarantee the stability of any updates or the update process itself. If you proceed with the installation of any updates, including updates considered stable, you do so at your own risk and responsibility. .. attention:: Read the changelog carefully before installing updates. Updates may contain breaking changes, and changelogs contain important information that may affect the way you use FreeField. .. image:: _images/updating-02-changelog.png A window will pop up, asking you to confirm installation of the update. If you accept and initiate the update, FreeField will download and install the update automatically. .. danger:: Once you have initiated an update, do not close the browser window until the installation is complete and you are told by the updater that it is safe to exit. **Failure to do so may result in corruption of your FreeField installation.** A successful update will look like this (the exact steps displayed may vary): .. image:: _images/updating-03-complete.png Troubleshooting --------------- Installation of updates is a sensitive process, and errors have the potential to break your installation. Update failures can be classified into two categories. Non-fatal errors ^^^^^^^^^^^^^^^^ .. compound:: If the following warning message **does not appear** in the update log:: Warning: If the upgrade fails after this point, your installation may become irreversibly broken! then the updater script has experienced a **non-fatal error**, and your installation has not been changed in any way. You can try to simply re-install the update and see if the cause was intermittent. If it still does not work, you can try waiting for a while before redoing the update. Alternatively: - Read the update log in the browser to determine if any checks fail, and fix the corresponding issues before retrying the update. - Click on :guilabel:`Check for new updates` before retrying. FreeField caches the list of available updates, and if an updated release has been pulled from the repository for stability reasons, and FreeField uses a cached download link for this update that thus no longer works, the updater will not find the release file, causing the update to fail. - Check that your server's firewall allows outbound connections. FreeField connects to api.github.com over HTTPS (port 443/tcp) to check for and download update packages. - Search for issues on the issue tracker on GitHub, or create a new one, pasting the output of the update log in the issue to seek further help. Fatal errors ^^^^^^^^^^^^ .. compound:: If the following warning message **appears** in the update log:: Warning: If the upgrade fails after this point, your installation may become irreversibly broken! and the installation has **failed**, then the updater script has experienced a **fatal error**, and your installation may be corrupted. You will likely have to reinstall FreeField. Please thoroughly check whether your FreeField installation works before proceeding with the instructions below. .. danger:: This is a disaster recovery procedure. If you follow the below instructions, please note that you do so **at your own risk** and that the FreeField developers are **not to be held responsible** for any damage caused to your system as a result of following these steps. A basic understanding of your server's operating system is required. Do not execute any commands listed here unless you are fully aware of their effects and accept any risk associated with executing them. First, take a backup of your entire FreeField installation, using e.g. .. code-block:: bash user@host:/var/www/html$ tar czvpf /tmp/freefield-backup.tgz * Then, remove all files and directories in the FreeField installation directory, except for the ``includes`` directory. Within ``includes``, delete all files and directories except ``userdata``. Download the latest version of FreeField and extract it on top of the old installation directory. When complete, your installation should contain an includes/userdata directory with configuration files already present. Attempt to access the FreeField installation again; it should now be in a working state. If the installation does not work, clear the installation directory completely and restore the backup, using e.g. .. code-block:: bash root@host:/var/www/html# rm -rf * root@host:/var/www/html# tar xzvf /tmp/freefield-backup.tgz . Remove the same files as above, then download and install the version of FreeField you were updating from (not the latest version) in the same way as above.
45.4375
103
0.758597
c502415011e18904eeb428449bb337eab420dfac
576
rest
reStructuredText
rest.api.test/TCT.laneattendance.rest
chumpon-asaneerat/DMT.Server
7a082d308787efe611367355db99ac73278123dd
[ "MIT" ]
null
null
null
rest.api.test/TCT.laneattendance.rest
chumpon-asaneerat/DMT.Server
7a082d308787efe611367355db99ac73278123dd
[ "MIT" ]
1
2020-05-27T21:37:50.000Z
2020-05-27T21:37:50.000Z
rest.api.test/TCT.laneattendance.rest
chumpon-asaneerat/DMT.Server
7a082d308787efe611367355db99ac73278123dd
[ "MIT" ]
null
null
null
### Send user attendace POST http://localhost:3000/api/TCT/LaneAttendance/save content-type: application/json { "jobid": "D0001", "tsbid": "311", "plazaid": "3101", "laneid": "DD02", "userid": "14124", "boj": "2020-08-06T19:30:43.511Z", "eoj": "2020-08-06T20:18:43.511Z" } ### Search user coupon (By TA program) POST http://localhost:3000/api/user/LaneAttendance/search content-type: application/json { "plazagroupid": "DD", "userid": "14124", "startdate": "2020-08-06T18:00:43.511Z", "enddate": "2020-08-07T01:25:43.511Z" }
22.153846
57
0.628472
6033930b6598f6be6a57aa21905e5ca6df628f55
2,835
rst
reStructuredText
source/micropython/advanced/pycharm.rst
BPI-STEAM/Docs-English
a013e50d5c39e599601639644b9fac6dad5d6056
[ "MIT" ]
null
null
null
source/micropython/advanced/pycharm.rst
BPI-STEAM/Docs-English
a013e50d5c39e599601639644b9fac6dad5d6056
[ "MIT" ]
null
null
null
source/micropython/advanced/pycharm.rst
BPI-STEAM/Docs-English
a013e50d5c39e599601639644b9fac6dad5d6056
[ "MIT" ]
null
null
null
使用 Pycharm IDE 编程 ===================================================== 是时候换一个顶级的 Python 专业 IDE 来编程了,你觉得呢?本文将教你如何在 Pycharm 里写 MicroPython 并运行。 获取 intellij-MicroPython 插件 ------------------------------------------------------ 在此下载 :download:`intellij-micropython <https://github.com/BPI-STEAM/BPI-BIT-MicroPython/releases/tag/pycharm>` 。 可以在此查看,`项目主页 <https://github.com/junhuanchen/intellij-micropython>`_ 。 安装 pycharm 社区版 --------------------------- 获取 `pycharm`_ 使用 windows 系统 `点此下载 2019.1 版本`_ (community 版免费使用) 安装完成打开即可,按 默认 的设置一路进入到以下界面即可。 |image0| 新建一个项目 --------------------------- 点击 Create New Project 弹出以下界面。 |image1| 如果没有安装 Python 则是以下界面 |image2| 最后可以看到项目已经建立完成。 |image3| 安装 intellij-MicroPython 插件 --------------------------- |image4| |image5| |image6| 提示:该版本已经修改了底层为 mpfshell,并没有完全整合到官方,所以仍和主仓的插件同名,因此 IDE 提示插件需要升级或是其他修复的时候,会被替换回原版,遇到这种情况的时候,忽视了就好。 |image7| 运行一个文件 --------------------------- 安装好插件后,在项目中启动它。 |image8| 你可以在设置里搜索 ``MicroPython``\ 得到以上页面。 |image9| 现在启动它,依次点开如图设置,Enable MicroPython support。 |image10| 选择 ESP8266 (ESP32)配置设备类型,再点击 Detect 可以自动判断你连接的板子的路径(或名称),此时的 Detect 一定会失败,因为关键的依赖还没安装。 |image11| 当出现自动识别串口失败,则需要你自己填入自己板子的串口名称(包括路径),或是其他连接参数,比如:ws:192.168.1.1,1234,这和 ``mpfshell`` 的 open 是一样的。 |image12| 此时已经设定好板子的连接参数了,现在可以在 untitled 处右键新建一个 python 文件,第一次使用的时候,务必创建一个文件来触发安装依赖,安装完成后才能使用自动识别串口 和 其他工具(菜单项中的 Tools)。 |image13| 在右侧代码编辑框中写入一句\ ``print(helloworld!)``\ 。 |image14| 第一次使用的时候,会提示你需要安装依赖项,因此点击消息的 Install requirements 即可在后台自动下载安装。 |image15| 耐心等待一会就可以了。 |image16| 安装完成会提示。 |image17| 现在我们可以运行 main.py 文件了,在编辑框的任意地方右键显示菜单选取 Run ‘Flash main.py’,即可自动生成运行文件配置并在板子中运行。 .. Attention:: 如果 Linux 系统出现串口连接不上,须核对串口是否对一般用户有权限,如果不确定,请核对这条指令\ ``usermod -a -G dialout Username && sudo reboot``\ ,Username 是指你的用户名,不是 Username 。 |image18| 可以看到运行结果如下 |image19| 直接使用 Mpfshell --------------------------- 在 MicroPython -> Run Mpfshell Tools 中可以使用 REPL 和 Mpfshell 的快捷功能。 |image20| .. _pycharm: https://www.jetbrains.com/pycharm/ .. _点此下载 2019.1 版本: https://download-cf.jetbrains.com/python/pycharm-community-2019.1.exe .. |image0| image:: pycharm/03.png .. |image1| image:: pycharm/05.png .. |image2| image:: pycharm/04.png .. |image3| image:: pycharm/06.png .. |image4| image:: pycharm/07.png .. |image5| image:: pycharm/08.png .. |image6| image:: pycharm/29.jpg .. |image7| image:: pycharm/09.png .. |image8| image:: pycharm/10.png .. |image9| image:: pycharm/11.png .. |image10| image:: pycharm/12.png .. |image11| image:: pycharm/13.png .. |image12| image:: pycharm/14.png .. |image13| image:: pycharm/15.png .. |image14| image:: pycharm/16.png .. |image15| image:: pycharm/17.png .. |image16| image:: pycharm/18.png .. |image17| image:: pycharm/19.png .. |image18| image:: pycharm/20.png .. |image19| image:: pycharm/21.png .. |image20| image:: pycharm/22.png
20.845588
137
0.67231
6784e2f07e0276378629d80cfaddde973ae80aae
4,204
rst
reStructuredText
docs/student_implementations.rst
tonybaloney/pybryt
3ba34e71b5de8ad47b3718c491d0600f02d0b178
[ "MIT" ]
null
null
null
docs/student_implementations.rst
tonybaloney/pybryt
3ba34e71b5de8ad47b3718c491d0600f02d0b178
[ "MIT" ]
null
null
null
docs/student_implementations.rst
tonybaloney/pybryt
3ba34e71b5de8ad47b3718c491d0600f02d0b178
[ "MIT" ]
null
null
null
Student Implementations ======================= For tracking and managing student implementations, stored in PyBryt as a list of 2-tuples of the objects observed while tracing students' code and the timestamps of those objects, PyBryt provides the :py:class:`StudentImplementation<pybryt.StudentImplementation>` class. The constructor for this class takes in either a path to a Jupyter Notebook file or a notebook object read in with ``nbformat``. .. code-block:: python stu = pybryt.StudentImplementation("subm.ipynb") # or... nb = nbformat.read("subm.ipynb") stu = pybryt.StudentImplementation(nb) Notebook Execution ------------------ The constructor reads the notebook file and stores the student's code. It then proceeds to execute the student's notebook using ``nbformat``'s ``ExecutePreprocessor``. The memory footprint of the student's code is constructed by executing the notebook with a trace function that tracks every value created and accessed **by the student's code** and the timestamps at which those values were observed. To trace into code written in specific files, use the ``addl_filenames`` argument of the constructor to pass a list of absolute paths of files to trace inside of. This can be useful for cases in which a testing harness is being used to test student's code and the student's *actual* submission is written in a Python script (which PyBryt would by default not trace). .. code-block:: python stu = pybryt.StudentImplementation("harness.ipynb", addl_filenames=["subm.py"]) PyBryt also employs various custom notebook preprocessors for handling special cases that occur in the code to allow different types of values to be checked. To see the exact version of the code that PyBryt executes, set ``output`` to a path to a notebook that PyBryt will write with the executed notebook. This can be useful e.g. for debugging reference implementations by inserting ``print`` statements that show the values at various stages of execution. .. code-block:: python stu = pybryt.StudentImplementation("subm.ipynb", output="executed-subm.ipynb") Checking Implementations ------------------------ To reconcile a student implementation with a set of reference implementations, use the :py:meth:`StudentImplementation.check<pybryt.StudentImplementation.check>` method, which takes in a single :py:class:`ReferenceImplementation<pybryt.ReferenceImplementation>` object, or a list of them, and returns a :py:class:`ReferenceResult<pybryt.ReferenceResult>` object (or a list of them). This method simply abstracts away managing the memory footprint tracked by the :py:class:`StudentImplementation<pybryt.StudentImplementation>` object and calls the :py:meth:`ReferenceImplementation.run<pybryt.ReferenceImplementation.run>` method for each provided reference implementation. .. code-block:: python ref = pybryt.ReferenceImplementation.load("reference.ipynb") stu = pybryt.StudentImplementation("subm.ipynb") stu.check(ref) To run the references for a single group of annotations, pass the ``group`` argument, which should be a string that corresponds to the name of a group of annotations. For example, to run the checks for a single question in a reference that contains multiple questions, the pattern might be .. code-block:: python stu.check(ref, group="q1") Storing Implementations ----------------------- Because generating the memory footprints of students' code can be time consuming and computationally expensive, :py:class:`StudentImplementation<pybryt.StudentImplementation>` objects can also be serialized to make multiple runs across sessions easier. The :py:class:`StudentImplementation<pybryt.StudentImplementation>` class provides the :py:class:`dump<pybryt.StudentImplementation.dump>` and :py:class:`load<pybryt.StudentImplementation.load>` methods, which function the same as with :ref:`reference implementations<storing_refs>`. :py:class:`StudentImplementation<pybryt.StudentImplementation>` objects can also be serialized to base-64-encoded strings using the :py:class:`dumps<pybryt.StudentImplementation.dumps>` and :py:class:`loads<pybryt.StudentImplementation.loads>` methods.
47.772727
101
0.773549
af54a65d53b543cfcdfd62fff0b8a6ba05b8bbe6
126
rst
reStructuredText
docs/tickets/101.rst
lino-framework/lino_book
4eab916832cd8f48ff1b9fc8c2789f0b437da0f8
[ "BSD-2-Clause" ]
3
2016-08-25T05:58:09.000Z
2019-12-05T11:13:45.000Z
docs/tickets/101.rst
lino-framework/lino_book
4eab916832cd8f48ff1b9fc8c2789f0b437da0f8
[ "BSD-2-Clause" ]
18
2016-11-12T21:38:58.000Z
2019-12-03T17:54:38.000Z
docs/tickets/101.rst
lino-framework/lino_book
4eab916832cd8f48ff1b9fc8c2789f0b437da0f8
[ "BSD-2-Clause" ]
9
2016-10-15T11:12:33.000Z
2021-09-22T04:37:37.000Z
================================ #101 : Upgrade from ExtJS 3 to 5 ================================ This is now :ticket:`37`.
21
32
0.31746
7309b6d055228eb1bac3a1ae97bd2930133b115a
12,032
rst
reStructuredText
issues/REEMISSIONPROB.rst
simoncblyth/j
9e7783d70dcee53425713192b84d11918c8856f0
[ "Apache-2.0" ]
1
2021-10-31T13:12:31.000Z
2021-10-31T13:12:31.000Z
issues/REEMISSIONPROB.rst
simoncblyth/j
9e7783d70dcee53425713192b84d11918c8856f0
[ "Apache-2.0" ]
null
null
null
issues/REEMISSIONPROB.rst
simoncblyth/j
9e7783d70dcee53425713192b84d11918c8856f0
[ "Apache-2.0" ]
null
null
null
REEMISSIONPROB ================= :: epsilon:ana blyth$ jgr REEMISSIONPROB ./Simulation/DetSimV2/PhysiSim/src/DsG4ScintSimple.cc: aMaterialPropertiesTable->GetProperty("REEMISSIONPROB"); ./Simulation/DetSimV2/PhysiSim/src/DsG4ScintSimple.cc: aMaterialPropertiesTable->GetProperty("REEMISSIONPROB"); ./Simulation/DetSimV2/PhysiSim/src/DsG4ScintSimple.cc: G4cout << " Building the material properties table for REEMISSIONPROB" << G4endl; ./Simulation/DetSimV2/PhysiSim/src/DsG4OpAbsReemit.cc: m_label_reemiprob = label+"REEMISSIONPROB"; ./Simulation/DetSimV2/PhysiSim/src/DsG4Scintillation.cc: aMaterialPropertiesTable->GetProperty("REEMISSIONPROB"); ./Simulation/DetSimV2/PhysiSim/src/DsG4Scintillation.cc: aMaterialPropertiesTable->GetProperty("REEMISSIONPROB"); ./Simulation/DetSimV2/PhysiSim/src/DsG4Scintillation.cc: G4cout << " Building the material properties table for REEMISSIONPROB" << G4endl; ./Simulation/DetSimV2/G4DAEChroma/src/phys/DAEDsG4Scintillation.cc: aMaterialPropertiesTable->GetProperty("REEMISSIONPROB"); ./Simulation/DetSimV2/G4DAEChroma/src/phys/DAEDsG4Scintillation.cc: aMaterialPropertiesTable->GetProperty("REEMISSIONPROB"); ./Simulation/DetSimV2/G4DAEChroma/src/phys/DAEDsG4Scintillation.cc: G4cout << " Building the material properties table for REEMISSIONPROB" << G4endl; ./Simulation/DetSimV2/MCParamsSvc/share/filldb.C: " FASTCOMPONENT, REEMISSIONPROB, RAYLEIGH, " ./Simulation/DetSimV2/MCParamsSvc/share/filldb.C: " '%s', '%s', '%s', " // FASTCOMPONENT, REEMISSIONPROB, RAYLEIGH, ./Simulation/DetSimV2/MCParamsSvc/share/filldb.C: TString reem = load("Material.LS.REEMISSIONPROB"); ./Simulation/DetSimV2/MCParamsSvc/share/filldb.C: fastc.Data(), reem.Data(), rayleigh.Data(), // FASTCOMPONENT, REEMISSIONPROB, RAYLEIGH, ./Simulation/DetSimV2/MCParamsSvc/share/gen_all.py: ("Material.LS.REEMISSIONPROB", "vec_d2d"), ./Simulation/DetSimV2/MCParamsSvc/share/mc.json: "objectType": "Material.LS.REEMISSIONPROB", ./Simulation/DetSimV2/MCParamsSvc/share/create.sql: `REEMISSIONPROB` longblob COMMENT '', ./Simulation/DetSimV2/MCParamsSvc/src/MCParamsDBSvc.cc: {"Material.LS.REEMISSIONPROB", "vec_d2d"}, ./Simulation/DetSimV2/MCParamsSvc/src/test/TestAlg.cc: st = m_params_svc->Get("Material.LS.REEMISSIONPROB", LS_reemprob); ./Simulation/DetSimV2/MCParamsSvc/src/test/TestAlg.cc: if (st) { LogInfo << "LS.REEMISSIONPROB: " << LS_reemprob.size() << std::endl; } ./Simulation/DetSimV2/MCParamsSvc/src/test/TestAlg.cc: save_it("LS_REEMISSIONPROB", LS_reemprob); ./Simulation/DetSimV2/CalibUnit/share/LS.gdml: <matrix coldim="2" name="REEMISSIONPROB0x252b070" values="1.55e-06 0 ./Simulation/DetSimV2/CalibUnit/share/LS.gdml: <property name="REEMISSIONPROB" ref="REEMISSIONPROB0x252b070"/> ./Simulation/DetSimV2/DetSimOptions/src/LSExpDetectorConstructionMaterial.icc: LSMPT->AddProperty("REEMISSIONPROB", GdLSReemEnergy, GdLSReem, 28); ./Simulation/DetSimV2/DetSimOptions/src/LSExpDetectorConstructionMaterial.icc: // + XXXREEMISSIONPROB ./Simulation/DetSimV2/DetSimOptions/src/LSExpDetectorConstructionMaterial.icc: LSMPT->AddProperty("PPOREEMISSIONPROB", PPO_ReemMomentum, PPO_Reemission, 15); ./Simulation/DetSimV2/DetSimOptions/src/LSExpDetectorConstructionMaterial.icc: LSMPT->AddProperty("bisMSBREEMISSIONPROB", bisMSB_ReemMomentum, bisMSB_Reemission, 23); ./Simulation/DetSimV2/DetSimOptions/src/LSExpDetectorConstructionMaterial.icc: helper_mpt(LSMPT, "REEMISSIONPROB", mcgt.data(), "Material.LS.REEMISSIONPROB"); ./Simulation/DetSimV2/DetSimOptions/src/LSExpDetectorConstructionMaterial.icc: helper_mpt(LSMPT, "PPOREEMISSIONPROB", mcgt.data(), "Material.LS.PPOREEMISSIONPROB"); ./Simulation/DetSimV2/DetSimOptions/src/LSExpDetectorConstructionMaterial.icc: helper_mpt(LSMPT, "bisMSBREEMISSIONPROB", mcgt.data(), "Material.LS.bisMSBREEMISSIONPROB"); ./Simulation/DetSimV2/AnalysisCode/src/OpticalParameterAnaMgr.cc: // REEMISSIONPROB ./Simulation/DetSimV2/AnalysisCode/src/OpticalParameterAnaMgr.cc: get_matprop(tbl_LS, "REEMISSIONPROB", LS_ReEmission_n, LS_ReEmission_energy, LS_ReEmission_prob); ./Simulation/DetSimV2/AnalysisCode/src/OpticalParameterAnaMgr.cc: get_matprop(tbl_LS, "PPOREEMISSIONPROB", LS_PPOReEmission_n, LS_PPOReEmission_energy, LS_PPOReEmission_prob); ./Simulation/DetSimV2/AnalysisCode/src/OpticalParameterAnaMgr.cc: get_matprop(tbl_LS, "bisMSBREEMISSIONPROB", LS_bisReEmission_n, LS_bisReEmission_energy, LS_bisReEmission_prob); epsilon:offline blyth$ epsilon:offline blyth$ jgr LSExpDetectorConstructionMaterial.icc ./Simulation/DetSimV2/DetSimOptions/src/LSExpDetectorConstruction.cc:#include "LSExpDetectorConstructionMaterial.icc" ./Doc/detsim/material.md: * `LSExpDetectorConstructionMaterial.icc` ./Doc/oum/source/detsim/material.md: * `LSExpDetectorConstructionMaterial.icc` epsilon:offline blyth$ :: jcv LSExpDetectorConstruction LSExpDetectorConstructionMaterial 185 private: 186 bool helper_mpt(G4MaterialPropertiesTable*, const std::string&, IMCParamsSvc*, const std::string&, double scale=1.0); 1806 bool 1807 LSExpDetectorConstruction::helper_mpt(G4MaterialPropertiesTable* MPT, const std::string& mname, IMCParamsSvc* params, const std::string& name, double scale) { 1808 IMCParamsSvc::vec_d2d props; 1809 bool st = params->Get(name, props); 1810 if (!st) { 1811 LogError << "can't find material property: " << name << std::endl; 1812 return false; 1813 } 1814 G4MaterialPropertyVector* vec = new G4MaterialPropertyVector(0,0,0); 1815 1816 int N = props.size(); 1817 if (!N) { 1818 LogError << "empty material property: " << name << std::endl; 1819 return false; 1820 } 1821 for (int i = 0; i < N; ++i) { 1822 vec->InsertValues(props[i].get<0>(), props[i].get<1>()*scale); 1823 } 1824 MPT->AddProperty(mname.c_str(), vec); 1825 return true; 1826 } :: 131 SniperPtr<IMCParamsSvc> mcgt(*m_scope, "MCParamsSvc"); 132 if (mcgt.invalid()) { 133 G4cout << "Can't find MCParamsSvc." << G4endl; 134 assert(0); 135 } 136 ... 288 289 helper_mpt(LSMPT, "RINDEX", mcgt.data(), "Material.LS.RINDEX"); 290 helper_mpt(LSMPT, "FASTCOMPONENT", mcgt.data(), "Material.LS.FASTCOMPONENT"); 291 helper_mpt(LSMPT, "SLOWCOMPONENT", mcgt.data(), "Material.LS.FASTCOMPONENT"); 292 helper_mpt(LSMPT, "REEMISSIONPROB", mcgt.data(), "Material.LS.REEMISSIONPROB"); 293 helper_mpt(LSMPT, "RAYLEIGH", mcgt.data(), "Material.LS.RAYLEIGH", scale_rayleigh); 294 :: epsilon:offline blyth$ jgr get_implv1 ./Simulation/DetSimV2/MCParamsSvc/src/MCParamsFileSvc.cc: return get_implv1(param, props); ./Simulation/DetSimV2/MCParamsSvc/src/MCParamsFileSvc.cc: return get_implv1(param, props); ./Simulation/DetSimV2/MCParamsSvc/src/MCParamsFileSvc.cc: st = get_implv1(param, vec_props); ./Simulation/DetSimV2/MCParamsSvc/src/utils.hh:bool get_implv1(const std::string& param, epsilon:offline blyth$ vi Simulation/DetSimV2/MCParamsSvc/src/utils.hh epsilon:offline blyth$ :: P[blyth@localhost LS]$ cat $JUNOTOP/data/Simulation/DetSim/Material/LS/REEMISSIONPROB 1.55000*eV 0 1.73987*eV 0 2.15315*eV 0.0587 2.42867*eV 0.1141 2.45963*eV 0.1259 2.49129*eV 0.1215 2.52368*eV 0.116 2.55682*eV 0.1372 2.59075*eV 0.1344 2.62547*eV 0.1409 2.66104*eV 0.1417 2.69747*eV 0.1712 2.73481*eV 0.1936 2.77308*eV 0.1969 2.81231*eV 0.2203 2.85255*eV 0.2354 2.89384*eV 0.3004 2.93621*eV 0.4165 2.97972*eV 0.6353 3.02439*eV 0.8022 3.07030*eV 0.8004 3.21588*eV 0.8006 3.80628*eV 0.8 5.87347*eV 0.45 6.20000*eV 0.42 7.75000*eV 0.40 10.33 *eV 0.40 15.5 *eV 0.40 P[blyth@localhost LS]$ epsilon:ana blyth$ ./ls.py wavelen rindex abslen scatlen reemprob groupvel 60.000 1.454 0.003 546.429 0.400 206.241 80.000 1.454 0.003 546.429 0.400 206.241 100.000 1.454 0.003 546.429 0.400 206.241 120.000 1.454 0.003 546.429 0.400 192.299 140.000 1.664 0.003 546.429 0.400 173.446 160.000 1.793 0.003 546.429 0.400 118.988 180.000 1.527 0.003 546.429 0.410 139.949 200.000 1.618 0.003 547.535 0.420 177.249 220.000 1.600 0.198 1415.292 0.477 166.321 240.000 1.582 0.392 2283.049 0.538 166.320 260.000 1.563 0.586 3150.806 0.599 166.319 280.000 1.545 0.781 4018.563 0.660 166.319 300.000 1.526 0.975 4887.551 0.721 177.207 320.000 1.521 1.169 7505.381 0.782 186.734 340.000 1.516 1.364 10123.211 0.800 186.733 360.000 1.511 5.664 12741.041 0.800 186.733 380.000 1.505 12.239 15358.871 0.801 186.733 400.000 1.500 195.518 17976.701 0.800 189.766 420.000 1.497 40892.633 23161.414 0.497 193.682 440.000 1.495 84240.547 29164.996 0.222 195.357 460.000 1.494 78284.352 33453.633 0.169 195.915 480.000 1.492 92540.648 37742.270 0.135 195.684 500.000 1.490 114196.219 43987.516 0.123 195.369 520.000 1.488 88688.727 52136.293 0.106 195.275 540.000 1.487 91878.211 60285.070 0.089 196.430 560.000 1.485 93913.664 75733.656 0.072 198.024 580.000 1.485 67581.016 98222.445 0.057 198.572 600.000 1.484 46056.891 116999.734 0.048 198.683 620.000 1.483 44640.812 132183.031 0.040 198.732 640.000 1.482 15488.402 147366.312 0.031 198.733 660.000 1.481 20362.018 162549.594 0.023 198.733 680.000 1.480 20500.150 177732.875 0.014 199.247 700.000 1.480 13182.578 192957.234 0.005 200.349 720.000 1.479 7429.221 218677.828 0.000 200.931 740.000 1.479 5515.074 244398.406 0.000 200.931 760.000 1.479 2898.857 270119.000 0.000 200.931 780.000 1.478 10900.813 295839.562 0.000 200.936 800.000 1.478 9584.489 321429.000 0.000 201.905 820.000 1.478 5822.304 321429.000 0.000 202.823 epsilon:ana blyth$ epsilon:ana blyth$
62.341969
189
0.603557
0bf36fe937542d888890a7f6cb5b210915a5ef1f
2,026
rst
reStructuredText
README.rst
m-thielen/django-webdav-storage
c40d2ba53f171e23684769c0b41f0d12da4c9a49
[ "BSD-3-Clause" ]
17
2015-02-02T14:44:52.000Z
2021-03-14T22:20:30.000Z
README.rst
m-thielen/django-webdav-storage
c40d2ba53f171e23684769c0b41f0d12da4c9a49
[ "BSD-3-Clause" ]
17
2015-02-02T12:08:45.000Z
2020-01-21T05:17:57.000Z
README.rst
m-thielen/django-webdav-storage
c40d2ba53f171e23684769c0b41f0d12da4c9a49
[ "BSD-3-Clause" ]
23
2015-02-02T11:54:15.000Z
2022-02-08T12:56:01.000Z
django-webdav-storage ===================== .. image:: https://badge.fury.io/py/django-webdav-storage.svg :target: https://badge.fury.io/py/django-webdav-storage .. image:: https://img.shields.io/pypi/l/django-webdav-storage :target: https://raw.githubusercontent.com/marazmiki/django-webdav-storage/master/LICENSE :alt: The project license .. image:: https://travis-ci.org/marazmiki/django-webdav-storage.svg?branch=master :target: https://travis-ci.org/marazmiki/django-webdav-storage :alt: Travis CI build status .. image:: https://coveralls.io/repos/marazmiki/django-webdav-storage/badge.svg?branch=master :target: https://coveralls.io/r/marazmiki/django-webdav-storage?branch=master :alt: Code coverage percentage .. image:: https://pypip.in/wheel/django-webdav-storage/badge.svg :target: https://pypi.python.org/pypi/django-webdav-storage/ :alt: Wheel Status .. image:: https://img.shields.io/pypi/pyversions/django-webdav-storage.svg :target: https://img.shields.io/pypi/pyversions/django-webdav-storage.svg :alt: Supported Python versions .. image:: https://img.shields.io/pypi/djversions/django-webdav-storage.svg :target: https://pypi.org/project/django-webdav-storage/ :alt: Supported Django versions .. image:: https://readthedocs.org/projects/django-webdav-storage/badge/?version=latest :target: https://django-ulogin.readthedocs.io/ru/latest/?badge=latest :alt: Documentation Status .. image:: https://api.codacy.com/project/badge/Grade/8eb2817e37cf4c2e98edc3dcbf886e6d :alt: Codacy Badge :target: https://app.codacy.com/manual/marazmiki/django-webdav-storage?utm_source=github.com&utm_medium=referral&utm_content=marazmiki/django-webdav-storage&utm_campaign=Badge_Grade_Dashboard Description ----------- This application allows you easily save media and static files into webdav storage. Documentation ------------- Please see full documentation at `Read the Docs <http://django-webdav-storage.readthedocs.io/en/latest/>`_
41.346939
194
0.741362
fc25078c4f18fd77d29eb03058497c41980f57b8
357
rst
reStructuredText
includes_inspec_resources/includes_inspec_resource_bond_matcher_params.rst
jblaine/chef-docs
dc540f7bbc2d3eedb05a74f34b1caf25f1a5d7d3
[ "CC-BY-3.0" ]
null
null
null
includes_inspec_resources/includes_inspec_resource_bond_matcher_params.rst
jblaine/chef-docs
dc540f7bbc2d3eedb05a74f34b1caf25f1a5d7d3
[ "CC-BY-3.0" ]
1
2021-06-27T17:03:16.000Z
2021-06-27T17:03:16.000Z
includes_inspec_resources/includes_inspec_resource_bond_matcher_params.rst
jblaine/chef-docs
dc540f7bbc2d3eedb05a74f34b1caf25f1a5d7d3
[ "CC-BY-3.0" ]
null
null
null
.. The contents of this file may be included in multiple topics (using the includes directive). .. The contents of this file should be modified in a way that preserves its ability to appear in multiple topics. The ``params`` matcher tests arbitrary parameters for the bonded network interface: .. code-block:: ruby its('params') { should eq 'value' }
39.666667
113
0.7507
070bd16483318156a9c5917b7537732f8e32de49
103
rst
reStructuredText
AUTHORS.rst
ukmo-ansaulter/ww3-grid
0f58c2bfc11339a0238d519531b6a274b1d1906f
[ "BSD-3-Clause" ]
null
null
null
AUTHORS.rst
ukmo-ansaulter/ww3-grid
0f58c2bfc11339a0238d519531b6a274b1d1906f
[ "BSD-3-Clause" ]
null
null
null
AUTHORS.rst
ukmo-ansaulter/ww3-grid
0f58c2bfc11339a0238d519531b6a274b1d1906f
[ "BSD-3-Clause" ]
null
null
null
======= Credits ======= Contributors ------------ Tom Durrant Andy Saulter Chris Bunney JianGuo Li
7.923077
13
0.582524
08c03f5a2880a6dd33f144d389fb93361ce923f2
301
rst
reStructuredText
CHANGELOG.rst
mcflugen/changelog
b1d05800b394113981a7730155209afedf708772
[ "MIT" ]
null
null
null
CHANGELOG.rst
mcflugen/changelog
b1d05800b394113981a7730155209afedf708772
[ "MIT" ]
null
null
null
CHANGELOG.rst
mcflugen/changelog
b1d05800b394113981a7730155209afedf708772
[ "MIT" ]
null
null
null
Change Log ========== All notable changes to landlab will be documented in this file. The format is based on `Keep a Changelog <http://keepachangelog.com/>`_ and this project adheres to `Semantic Versioning <http://semver.org/>`_. This file was auto-generated using ``scripts/make_changelog.py``.
27.363636
72
0.737542
f4916caea6efa0825ae65d41cc25918d76ce38f8
3,353
rst
reStructuredText
doc/source/sdk/guides/ces.rst
zsoltn/python-otcextensions
4c0fa22f095ebd5f9636ae72acbae5048096822c
[ "Apache-2.0" ]
10
2018-03-03T17:59:59.000Z
2020-01-08T10:03:00.000Z
doc/source/sdk/guides/ces.rst
zsoltn/python-otcextensions
4c0fa22f095ebd5f9636ae72acbae5048096822c
[ "Apache-2.0" ]
208
2020-02-10T08:27:46.000Z
2022-03-29T15:24:21.000Z
doc/source/sdk/guides/ces.rst
zsoltn/python-otcextensions
4c0fa22f095ebd5f9636ae72acbae5048096822c
[ "Apache-2.0" ]
15
2020-04-01T20:45:54.000Z
2022-03-23T12:45:43.000Z
Cloud Eye Service (CES) ========================= Cloud Eye (CES) is a high-performance monitoring service with integrated alarm functions. Open Telekom Cloud users benefit from a dashboard with a basic overview of resources and their current status. Users can configure the alarm function in such a way that they receive notifications via SMS or email. Monitoring with the Cloud Eye Service is activated by default; the free service does not need to be booked or activated. .. contents:: Table of Contents :local: CES Alarm Rule -------------- The alarm function is based on collected metrics. You can set alarm rules for key metrics of cloud services. When the metric data triggers the conditions set in the alarm rule, Cloud Eye sends emails, or text messages, to you, or sends HTTP/HTTPS requests to the servers. In this way, you are immediately informed of cloud service exceptions and can quickly handle the faults to avoid service losses. Cloud Eye uses the SMN service to notify users. This requires you to create a topic and add subscriptions to this topic on the SMN console first. Then when you create alarm rules, you can enable the Alarm Notification function and select the created topic. When an error occurs, Cloud Eye can broadcast alarm information to those subscriptions in real time. Create Alarm Rule ^^^^^^^^^^^^^^^^^ This interface is used to create a CES alarm with parameters. .. literalinclude:: ../examples/ces/create_alarm.py :lines: 16-89 Get Alarm Rule ^^^^^^^^^^^^^^ This interface is used to get a CES alarm rule by name or ID or an instance of class :class:`~otcextensions.sdk.ces.v1.alarm.Alarm`. .. literalinclude:: ../examples/ces/get_alarm.py :lines: 16-24 Delete Alarm Rule ^^^^^^^^^^^^^^^^^ This interface is used to delete a CES Alarm Rule instance by id or an instance of class :class:`~otcextensions.sdk.cts.v1.tracker.Tracker`. .. literalinclude:: ../examples/ces/delete_alarm.py :lines: 16-25 Switch Alarm Rule State ^^^^^^^^^^^^^^^^^^^^^^^^ This interface is used to switch the Alarm Rule State by using name or id. .. literalinclude:: ../examples/ces/switch_alarm_state.py :lines: 16-25 Monitoring Data Management -------------------------- Monitoring / Metric data is used to generate and query custom monitoring data. List Metric Data ^^^^^^^^^^^^^^^^ This interface is used to query all CES metric data and to filter the output with query parameters. .. literalinclude:: ../examples/ces/list_metric_data.py :lines: 16-34 Miscellaneous ------------- List Metrics ^^^^^^^^^^^^ This API is used to query the metric list. You can specify the namespace, metric, dimension, sorting order, start records, and the maximum number of records when using this API to query metrics. .. literalinclude:: ../examples/ces/list_metrics.py :lines: 16-23 List Quotas ^^^^^^^^^^^ This API is used to query a resource quota and the used amount. The current resource refers to alarm rules only. .. literalinclude:: ../examples/ces/list_quotas.py :lines: 16-23 List Host Configuration / Event Data ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This API is used to query the host configuration for a specified event type in a specified period of time. You can specify the dimension of data to be queried. .. literalinclude:: ../examples/ces/list_event_data.py :lines: 16-32
28.905172
78
0.720847
fe7041f65563940f72bf0e68fc7e5bf8dd9d848b
2,619
rst
reStructuredText
doc/source/appendix--building-with-gcc.rst
sam-roth/autobind
df230f43335f2636fe32b370c359650391ed1ee1
[ "BSD-3-Clause" ]
1
2017-05-20T19:38:28.000Z
2017-05-20T19:38:28.000Z
doc/source/appendix--building-with-gcc.rst
sam-roth/autobind
df230f43335f2636fe32b370c359650391ed1ee1
[ "BSD-3-Clause" ]
null
null
null
doc/source/appendix--building-with-gcc.rst
sam-roth/autobind
df230f43335f2636fe32b370c359650391ed1ee1
[ "BSD-3-Clause" ]
null
null
null
.. _appendix--building-with-gcc: =========================== Appendix: Building with GCC =========================== :abstract: On GNU/Linux and other GNU systems, it may be desirable to build Autobind using GCC and libstdc++, rather than Clang and libc++. This is due to the fragile binary interface problem: Attempting to use premade binaries built using one toolchain with a different toolchain may cause linking errors, or worse, especially when working with C++ code. Compilation Procedure ===================== :you'll need: • Clang ≥ 3.5 (with headers) • GCC ≥ 4.8 • Boost.Regex (libstdc++ has no regex support [≤ 4.8], so we'll use Boost as a standin) • Python ≥ 3.3 (with headers) • CMake .. note:: If you're using Ubuntu, you can install these dependencies with:: $ sudo apt-get install build-essential libclang-3.5-dev clang-3.5 gcc-4.8 \ libboost-regex-dev cmake libpython3.4-dev python3.4-dev python3.4 1. Install the dependencies 2. Clone the repository:: $ hg clone https://[email protected]/saroth/autobind $ cd autobind 3. Create a file called :file:`CMakeLists.user.cmake` in the root of the repository. Note the extension: ``.cmake``, rather than ``.txt``, which is typical for CMakeLists files. Put the following directives into the file and save it: .. code-block:: cmake set(STDLIB_FLAG "-DAB_NO_STD_REGEX") set(EXTRA_LIBS dl pthread boost_regex tinfo) The first line defines a preprocessor macro that causes Autobind to include ``<boost/tr1/regex.hpp>`` in place of ``<regex>``, and to bring those names into scope. The second line directs the linker to link with several extra libraries, including ``boost_regex``, that are necessary when working on a GNU system. 4. Continue with the build procedure as normal:: $ cmake . $ make -j4 Using the Wrapper Script in a Mixed Clang/GCC Environment ========================================================= Currently, the wrapper script only supports using Clang as a compiler. When you use the wrapper script, you must set the ``CXX`` environment variable to point to Clang. You may use a directive like the following to temporarily set this environment variable for the duration of the script:: $ CXX=clang++ /path/to/autobind.py build -c mymodule.cpp If you're using Fish, rather than a Bourne-like shell, the equivalent command is:: > env CXX=clang++ /path/to/autobind.py build -c mymodule.cpp
34.460526
103
0.651394
ebf7972536f2d729c83912c83640b6915c586cd5
375
rst
reStructuredText
FW/edk2-ws/edk2/CryptoPkg/Library/OpensslLib/openssl/krb5/doc/user/user_commands/sclient.rst
daxx-linux/edk-Lab_Material_FW
0c92b0b861e33d949a73e3be96929570e6c7ec61
[ "BSD-2-Clause" ]
372
2016-10-28T10:50:35.000Z
2022-03-18T19:54:37.000Z
FW/edk2-ws/edk2/CryptoPkg/Library/OpensslLib/openssl/krb5/doc/user/user_commands/sclient.rst
daxx-linux/edk-Lab_Material_FW
0c92b0b861e33d949a73e3be96929570e6c7ec61
[ "BSD-2-Clause" ]
317
2016-11-02T17:41:48.000Z
2021-11-08T20:28:19.000Z
FW/edk2-ws/edk2/CryptoPkg/Library/OpensslLib/openssl/krb5/doc/user/user_commands/sclient.rst
daxx-linux/edk-Lab_Material_FW
0c92b0b861e33d949a73e3be96929570e6c7ec61
[ "BSD-2-Clause" ]
107
2016-11-03T19:25:16.000Z
2022-03-20T21:15:22.000Z
.. _sclient(1): sclient ======= SYNOPSIS -------- **sclient** *remotehost* DESCRIPTION ----------- sclient is a sample application, primarily useful for testing purposes. It contacts a sample server :ref:`sserver(8)` and authenticates to it using Kerberos version 5 tickets, then displays the server's response. SEE ALSO -------- :ref:`kinit(1)`, :ref:`sserver(8)`
15
67
0.669333
7dbced4a204140583f756891a1067aa0fc516bef
575
rst
reStructuredText
src/libmongoc/doc/mongoc_uri_option_is_int64.rst
MahdiMaarouf2016/mongo-c-driver-build
345a1fb0b2b33fa14b19b64f6fe4404ccaeca02e
[ "Apache-2.0" ]
null
null
null
src/libmongoc/doc/mongoc_uri_option_is_int64.rst
MahdiMaarouf2016/mongo-c-driver-build
345a1fb0b2b33fa14b19b64f6fe4404ccaeca02e
[ "Apache-2.0" ]
null
null
null
src/libmongoc/doc/mongoc_uri_option_is_int64.rst
MahdiMaarouf2016/mongo-c-driver-build
345a1fb0b2b33fa14b19b64f6fe4404ccaeca02e
[ "Apache-2.0" ]
null
null
null
:man_page: mongoc_uri_option_is_int64 mongoc_uri_option_is_int64() ============================ Synopsis -------- .. code-block:: c bool mongoc_uri_option_is_int64 (const char *option); Parameters ---------- * ``option``: The name of an option, case insensitive. Description ----------- Returns true if the option is a known MongoDB URI option of 64-bit integer type. For example, "wTimeoutMS=100" is a valid 64-bit integer MongoDB URI option, so ``mongoc_uri_option_is_int64 ("wTimeoutMS")`` is true. See Also -------- * :symbol:`mongoc_uri_option_is_int32()`
20.535714
214
0.674783
556d2fc848c8b5b62df37bc9faf93a3d17a92a37
2,426
rst
reStructuredText
HISTORY.rst
django-ftl/django-ftl
c34e4956741b17b3af10c3f543a90a0fdc6c8dd7
[ "MIT" ]
38
2018-05-19T15:17:23.000Z
2022-03-03T17:52:55.000Z
HISTORY.rst
django-ftl/django-ftl
c34e4956741b17b3af10c3f543a90a0fdc6c8dd7
[ "MIT" ]
3
2020-04-02T09:22:55.000Z
2021-11-22T21:19:52.000Z
HISTORY.rst
django-ftl/django-ftl
c34e4956741b17b3af10c3f543a90a0fdc6c8dd7
[ "MIT" ]
3
2019-04-17T10:07:27.000Z
2021-11-23T11:50:50.000Z
.. :changelog: History ------- 0.13 (2021-09-16) +++++++++++++++++ * Dropped support for Python 2.7 * Added support for Django 3.2 * Added support for custom functions to the Bundle constructor * Dropped useless mandatory configuration of ``mode`` parameter for template tags - it now defaults to ``'server'`` which is the only allowed option anyway. 0.12.1 (2020-05-09) +++++++++++++++++++ * Fixed broken (and undocumented) ``check_all`` method. 0.12 (2020-04-02) +++++++++++++++++ * Switch to the new APIs available in ``fluent_compiler`` 0.2. * Performance improvements - large reduction in the percentage overhead introduced by django-ftl (compared to raw ``fluent_compiler`` performance). * Undocumented ``MessageFinderBase`` class has changed slightly: its ``load`` method now returns a ``fluent_compiler.resource.FtlResource`` object instead of a string. If you used a custom ``finder`` for ``Bundle`` you may need to update it for this change. 0.11 (2020-03-24) +++++++++++++++++ * Switched to using ``fluent_compiler`` as backend instead of experimental branch in ``fluent.runtime``. This means **import changes are required**: * ``fluent_number`` and ``fluent_date``, if you are using them, should be imported from ``fluent_compiler.types`` instead of ``fluent.runtime.types`` * Added ``Bundle.check_all`` method. * Django 3.0 support * Dropped support for Python 3.4 (it may work, but recent versions of lxml do not install on it, which made running tests harder). 0.10 (2019-05-23) +++++++++++++++++ * Upgraded to more recent version of fluent.runtime (0.1 with modifications) * Fixed ``use_isolating`` behavior (BDI characters are now inserted for HTML messages) * Thread-safety fixes for loading bundles. * Corrected order of using 'locales' directories found via ``INSTALLED_APPS`` to be consistent with normal Django convention. 0.9.1 (2019-03-02) ++++++++++++++++++ * Changed development autoreload mechanism to not interfere with Django's development server autoreload. * Bug fix for case when invalid mode is specified in template tag. * Various fixes and improvements to middlewares (plus tests) * Thread-safe Bundle * Method for configuring ``ftlmsg`` via context processor. 0.9 (2018-09-10) ++++++++++++++++ * Working version * Depends on our version of python-fluent 0.0.1 (2018-05-19) ++++++++++++++++++ * First release on PyPI - empty placeholder package
31.921053
86
0.699093
700a06402dbd5aac0b2daa8b3ae6aa5fdf25af1f
478
rst
reStructuredText
docs/concepts_skills/software_engineering/python_comparison_with_other_languages.rst
KarrLab/python_package_tutorial
dd20e0d3056138904e7e7fbbf6bb884d64dbf8f6
[ "MIT" ]
15
2018-01-06T11:33:01.000Z
2022-03-01T15:18:40.000Z
docs/concepts_skills/software_engineering/python_comparison_with_other_languages.rst
KarrLab/python_package_tutorial
dd20e0d3056138904e7e7fbbf6bb884d64dbf8f6
[ "MIT" ]
2
2018-01-30T23:21:12.000Z
2018-03-23T20:22:06.000Z
docs/concepts_skills/software_engineering/python_comparison_with_other_languages.rst
KarrLab/python_package_tutorial
dd20e0d3056138904e7e7fbbf6bb884d64dbf8f6
[ "MIT" ]
8
2018-01-08T21:40:19.000Z
2022-01-04T14:48:02.000Z
Comparison between Python and other languages ============================================= Python vs MATLAB ---------------- Several websites have nice summaries of the advantages of Python over MATLAB: * `Python vs MATLAB <http://www.pyzo.org/python_vs_matlab.html>`_ * `A Python Primer for MATLAB Users <http://bastibe.de/2013-01-20-a-python-primer-for-matlab-users.html>`_ * `NumPy for MATLAB users <https://docs.scipy.org/doc/numpy-dev/user/numpy-for-matlab-users.html>`_
47.8
106
0.675732
41dc3003b6034b23b0e64b7f4ea47e5b92238b19
2,819
rst
reStructuredText
README.rst
LaudateCorpus1/tiktokgo
abce05f0da38a2aeaaef5ec25e2c99d1f4c59ec0
[ "Unlicense" ]
8
2021-02-23T00:56:37.000Z
2022-03-17T08:40:21.000Z
README.rst
siongui/tiktokgo
abce05f0da38a2aeaaef5ec25e2c99d1f4c59ec0
[ "Unlicense" ]
1
2021-10-02T05:58:11.000Z
2021-10-02T05:58:11.000Z
README.rst
LaudateCorpus1/tiktokgo
abce05f0da38a2aeaaef5ec25e2c99d1f4c59ec0
[ "Unlicense" ]
2
2021-02-23T00:57:25.000Z
2021-10-02T05:58:02.000Z
======== tiktokgo ======== .. image:: https://img.shields.io/badge/Language-Go-blue.svg :target: https://golang.org/ .. image:: https://godoc.org/github.com/siongui/tiktokgo?status.svg :target: https://godoc.org/github.com/siongui/tiktokgo .. image:: https://github.com/siongui/tiktokgo/workflows/Test%20Package/badge.svg :target: https://github.com/siongui/tiktokgo/blob/master/.github/workflows/build.yml .. image:: https://goreportcard.com/badge/github.com/siongui/tiktokgo :target: https://goreportcard.com/report/github.com/siongui/tiktokgo .. image:: https://img.shields.io/badge/license-Unlicense-blue.svg :target: https://raw.githubusercontent.com/siongui/tiktokgo/master/UNLICENSE **tiktokgo** downloads user avatar photo and videos. Currently this package can - download user avatar photos and latest 5 video items (with watermark) without login if the user account is not private. - download video item (with watermark) by the item URL. Visit `example <tiktokdl/example/>`_ directory for examples. Tested on: - `Ubuntu 20.10`_ - `Go 1.16`_ Important Tricks ++++++++++++++++ According to README in `drawrowfly/tiktok-scraper`_, the video play/download address is binded to the **tt_webid_v2** cookie value. To download the video successfully, the same headers/cookies must be used both when access API or metadata and when access/download videos. The following three are necessary part (values copied from README in `drawrowfly/tiktok-scraper`_ for illustration purpose): .. code-block:: txt headers: { "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36", "referer": "https://www.tiktok.com/", "cookie": "tt_webid_v2=689854141086886123" }, UNLICENSE +++++++++ Released in public domain. See UNLICENSE_. References ++++++++++ .. [1] | `github tiktok - Google search <https://www.google.com/search?q=github+tiktok>`_ | `github tiktok - DuckDuckGo search <https://duckduckgo.com/?q=github+tiktok>`_ | `github tiktok - Ecosia search <https://www.ecosia.org/search?q=github+tiktok>`_ | `github tiktok - Qwant search <https://www.qwant.com/?q=github+tiktok>`_ | `github tiktok - Bing search <https://www.bing.com/search?q=github+tiktok>`_ | `github tiktok - Yahoo search <https://search.yahoo.com/search?p=github+tiktok>`_ | `github tiktok - Baidu search <https://www.baidu.com/s?wd=github+tiktok>`_ | `github tiktok - Yandex search <https://www.yandex.com/search/?text=github+tiktok>`_ .. _Go: https://golang.org/ .. _Ubuntu 20.10: https://releases.ubuntu.com/20.10/ .. _Go 1.16: https://golang.org/dl/ .. _UNLICENSE: https://unlicense.org/ .. _drawrowfly/tiktok-scraper: https://github.com/drawrowfly/tiktok-scraper
35.2375
141
0.711955
eb9b30b46455e435aeabc91a8828b171a301a48e
746
rst
reStructuredText
docs/contents/support.rst
useblocks/libpdf
2c1cf007ac9c7a74871342d67bff118254ee8dd5
[ "MIT" ]
7
2021-01-21T20:42:01.000Z
2022-03-16T06:11:49.000Z
docs/contents/support.rst
useblocks/libpdf
2c1cf007ac9c7a74871342d67bff118254ee8dd5
[ "MIT" ]
8
2021-01-19T09:27:15.000Z
2022-02-04T22:50:15.000Z
docs/contents/support.rst
useblocks/libpdf
2c1cf007ac9c7a74871342d67bff118254ee8dd5
[ "MIT" ]
null
null
null
.. _support: Support ======= If you find bugs, have any questions or see room for improvements, feel free to open an issue at `Github <https://github.com/useblocks/libpdf/issues>`_. We are happy for each new issue and try to support you wherever we can. Professional Support -------------------- If you need professional support you should get in contact with our company `useblocks <https://useblocks.com>`_. We are a bunch of passionated developers, who commonly work on processes, tools or embedded projects in the automotive area for companies around the world. Fastest way of reaching us is via e-mail: [email protected]. .. image:: ../_static/useblocks_logo.png :align: center :width: 100px :target: https://useblocks.com
29.84
113
0.733244
0d423183b0ceb42f4f103da6f64176774b627ca4
7,750
rst
reStructuredText
manual/source/Tutorial/SequenceIO.rst
churchlab/seqan
1fc5658d194c79ef85d3247acf767c97408767f7
[ "BSD-3-Clause" ]
null
null
null
manual/source/Tutorial/SequenceIO.rst
churchlab/seqan
1fc5658d194c79ef85d3247acf767c97408767f7
[ "BSD-3-Clause" ]
null
null
null
manual/source/Tutorial/SequenceIO.rst
churchlab/seqan
1fc5658d194c79ef85d3247acf767c97408767f7
[ "BSD-3-Clause" ]
1
2018-10-13T00:14:23.000Z
2018-10-13T00:14:23.000Z
.. sidebar:: ToC .. contents:: .. _tutorial-sequence-io: Sequence I/O ============ Learning Objective You will learn how to read and write sequence files in FASTA, FASTQ, EMBL or GenBank format. Difficulty Basic Duration 20 min Prerequisites :ref:`tutorial-sequences`, :ref:`tutorial-input-output-overview` This tutorial explains how to read and write sequence files using the :dox:`SeqFileIn` and :dox:`SeqFileOut` classes. These classes provide an API for accessing sequence files in different file formats, either compressed or uncompressed. FASTA/FASTQ Format ------------------ FASTA/FASTQ are record-based files. A FASTA record contains the sequence id and the sequence characters. Here is an example of FASTA file: :: >seq1 CCCCCCCCCCCCCCC >seq2 CGATCGATC >seq3 TTTTTTT In addition to that, a FASTQ record contains also a quality value for each sequence character. Here is an example of FASTQ file: :: @seq1 CCCCCCCCCCCCCCC + IIIIIHIIIIIIIII @seq2 CGATCGATC + IIIIIIIII @seq3 TTTTTTT + IIIIHHG SeqFile Formats --------------- We can read sequence files with the :dox:`SeqFileIn` class and write them with the :dox:`SeqFileOut` class. These classes support files in FASTA, FASTQ, EMBL or GenBank format. Note that :dox:`SeqFileOut` will guess the format from the file name. A file ending in ``.fa`` and ``.fasta`` mean FASTA, ``.fq`` and ``.fastq`` means FASTQ. A First Working Example ----------------------- Let us start out with a minimal working example. The following program reads a FASTA file called ``example.fa`` and prints out the identifier and the sequence of the first record. .. includefrags:: demos/tutorial/seq_io/example1.cpp We call the :dox:`FormattedFile#FormattedFile SeqFileIn constructor` with the path to the file to read. Successively, we call the function :dox:`SeqFileIn#readRecord` to read the first record from the file. Note that, differently from all others :dox:`FormattedFileIn` classes, :dox:`SeqFileIn#readRecord` accepts **separate** identifier and sequence :dox:`String Strings` rather than one single record object. Assignment 1 """""""""""" .. container:: assignment Type Reproduction Objective Copy the above example of FASTA file in a new file ``example.fa`` in a directory of your choice. Copy the program above into a new application ``basic_seq_io_example``, adjust the path ``"example.fa"`` to the just created FASTA file, compile the program, and run it. For example, if you stored the file ``example.fa`` in ``/home/username/example.fa``, you replace the line ``seqan::SeqFileIn seqFileIn("example.fa");`` from above with ``seqan::SeqFileIn seqFileIn("/home/username/example.fa");``. You should see the following output: .. code-block:: console # basic_seq_io seq1 CCCCCCCCCCCCCCC Solution .. container:: foldable .. includefrags:: demos/tutorial/seq_io/solution1.cpp Handling Errors --------------- As explained in the :ref:`tutorial-input-output-overview` tutorial, :dox:`SeqFileIn` and :dox:`SeqFileOut` throw exceptions to signal eventual errors. Invalid characters inside an input file will be signaled by :dox:`SeqFileIn#readRecord` via parsing exceptions. Assignment 2 """""""""""" .. container:: assignment Type Application Objective Improve the above program to handle errors. Solution .. container:: foldable .. includefrags:: demos/tutorial/seq_io/solution2.cpp Accessing Records in Batches ---------------------------- There are three use cases for reading or writing record-based files: #. read or write the file **record by record**; #. read or write a **batch of records**, e.g. 100k records at a time; #. read or write **all records** from or to the file. The class :dox:`SeqFileIn` provides the functions :dox:`SeqFileIn#readRecord` and :dox:`SeqFileIn#readRecords`, while the class :dox:`SeqFileOut` provides the functions :dox:`SeqFileOut#writeRecord` and :dox:`SeqFileOut#writeRecords`. .. tip:: Reading records in batches is more efficient than reading single records. Note that the function :dox:`SeqFileIn#readRecords` use :dox:`StringSet` instead of :dox:`String`. By default, :dox:`SeqFileIn#readRecords` reads **all** remaining records. Optionally, one can specify a batch of records to be read. .. code-block:: cpp seqan::StringSet<seqan::CharString> ids; seqan::StringSet<seqan::Dna5String> seqs; seqan::SeqFileIn seqFileIn("example.fq"); // Reads up to 10 records. readRecords(ids, seqs, seqFileIn, 10); // Reads all remaining records. readRecords(ids, seqs, seqFileIn); Assignment 3 """""""""""" .. container:: assignment Type Application Objective Change your program from above to load all sequences and print them in the same fashion. You should be able to run your program on the example file we created above and see the following output: .. code-block:: console # basic_seq_io_example example.fa seq1 CCCCCCCCCCCCCCC seq2 CGATCGATC seq3 TTTTTTT Hint You can use the function :dox:`SeqFileIn#readRecords` to load all records at once. Solution .. container:: foldable .. includefrags:: demos/tutorial/seq_io/solution3.cpp Accessing Qualities ------------------- Functions :dox:`SeqFileIn#readRecord`, :dox:`SeqFileIn#readRecords`, :dox:`SeqFileOut#writeRecord` and :dox:`SeqFileOut#writeRecords` are available in two variants: #. the first variant accepts only the sequence identifier and sequence characters, besides the :dox:`SeqFileIn` object; #. the second variant accepts an additional :dox:`CharString` for a PHRED base quality string. If the first variant is used on an output file containing qualities, e.g. a FASTQ file, then :dox:`SeqFileOut#writeRecord` writes qualities as ``'I'``, i.e. PHRED score 40. If the second variant is used on an input file containing no qualities, e.g. a FASTA file, then :dox:`SeqFileIn#readRecord` returns **empty** quality strings. Here is an example for the second variant of :dox:`SeqFileIn#readRecord`: .. code-block:: cpp seqan::CharString id; seqan::Dna5String seq; seqan::CharString qual; seqan::SeqFileIn seqFileIn("in.fq"); readRecord(id, seq, qual, seqFileIn); .. tip:: When :dox:`DnaQ` or :dox:`Dna5Q` :dox:`String Strings` are used, then you should use the second variant. The qualities are simply stored directly in the sequence characters. Assignment 4 """""""""""" .. container:: assignment Type Application Objective Copy the above example of FASTQ file in a new file ``example.fq`` in a directory of your choice. Change your result of Assignment 3 to use the variant of :dox:`SeqFileIn#readRecord` that also reads in the qualities and writes them next to the sequences. When your program is called on this file, the result should look as follows. .. code-block:: console # basic_seq_io_example example.fq seq1 CCCCCCCCCCCCCCC IIIIIHIIIIIIIII seq2 CGATCGATC IIIIIIIII seq3 TTTTTTT IIIIHHG Solution .. container:: foldable .. includefrags:: demos/tutorial/seq_io/solution4.cpp Next Steps ---------- * Read the Wikipedia articles about the `FASTA file format <http://en.wikipedia.org/wiki/FASTA_format>`_ and the `FASTQ file format and quality values <http://en.wikipedia.org/wiki/FASTQ_format>`_ to refresh your knowledge. * Read the :ref:`tutorial-indexed-fasta-io` tutorial to learn how to read FASTA files efficiently in a random-access fashion. * Continue with the :ref:`tutorial`.
29.693487
234
0.706452
fcc76f6e321749eb1ba140cf5261f5a2ecc59b4e
2,226
rst
reStructuredText
doc/sphinx/source/utils.rst
TomasTorsvik-tools/ESMValTool-TTfork
c9f14d86dcadc579bbc81536100e32b6dde8b99f
[ "Apache-2.0" ]
null
null
null
doc/sphinx/source/utils.rst
TomasTorsvik-tools/ESMValTool-TTfork
c9f14d86dcadc579bbc81536100e32b6dde8b99f
[ "Apache-2.0" ]
null
null
null
doc/sphinx/source/utils.rst
TomasTorsvik-tools/ESMValTool-TTfork
c9f14d86dcadc579bbc81536100e32b6dde8b99f
[ "Apache-2.0" ]
null
null
null
.. _utils: Utilities ********* This section provides information on small tools that are available in the `esmvaltool/utils <https://github.com/ESMValGroup/ESMValTool/tree/master/esmvaltool/utils>`_ directory. .. _draft_release_notes.py: draft_release_notes.py ====================== This is a script for drafting release notes based on the titles and labels of the GitHub pull requests that have been merged since the previous release. To use the tool, install the package pygithub_: .. code-block:: bash pip install pygithub Create a `GitHub access token`_ (leave all boxes for additional permissions unchecked) and store it in the file ``~/.github_api_key``. Edit the script and update the date and time of the previous release. If needed, change it so it uses the correct repository. Run the script: .. code-block:: bash python esmvaltool/utils/draft_release_notes.py Review the resulting output (in ``.rst`` format) and if anything needs changing, change it on GitHub and re-run the script until the changelog looks acceptable. In particular, make sure that pull requests have the correct label, so they are listed in the correct category. Finally, copy and paste the generated content at the top of the changelog. nclcodestyle ============ A tool for checking the style of NCL code, based on pycodestyle. Install ESMValTool in development mode (``pip install -e '.[develop]'``) to make it available. To use it, run .. code-block:: bash nclcodestyle /path/to/file.ncl xml2yml ======= A tool for converting version 1 recipes to version 2 recipes. See the README.md file in the directory esmvaltool/utils/xml2yml for detailed usage instructions. testing ======= Tools for testing recipes. test recipe settings -------------------- A tool for generating recipes with various diagnostic settings, to test of those work. Install ESMValTool in development mode (``pip install -e '.[develop]'``) to make it available. To use it, run .. code-block:: bash test_recipe --help .. _GitHub access token: https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line .. _pygithub: https://pygithub.readthedocs.io/en/latest/introduction.html
28.177215
137
0.746181
3db8f2acfee7d95b4bbcd9c2b97f3abbfb8282dc
12,743
rst
reStructuredText
source/khronos18/note3.rst
showa-yojyo/notebook
82c15074c24d64a1dfcb70a526bc1deb2ecffe68
[ "MIT" ]
14
2016-04-13T08:10:02.000Z
2021-04-19T09:42:51.000Z
source/khronos18/note3.rst
showa-yojyo/note
5f262ecda3df132cb66206c465d16e174061d6b9
[ "MIT" ]
88
2017-09-27T15:07:05.000Z
2019-10-02T04:05:03.000Z
source/khronos18/note3.rst
showa-yojyo/note
5f262ecda3df132cb66206c465d16e174061d6b9
[ "MIT" ]
null
null
null
====================================================================== OpenGL Shading Language 4.60 Specification 読書ノート Part 3 ====================================================================== `仕様書該当部分 <https://www.khronos.org/registry/OpenGL/specs/gl/GLSLangSpec.4.60.html#basics>`__ .. contents:: ノート目次 3. Basics ====================================================================== 3.1. Character Set and Phases of Compilation ---------------------------------------------------------------------- OpenGL Shading Language に使用されるソースコードを構成する文字集合は UTF-8 符号規格の Unicode だ。 前処理後の GLSL トークンストリームでは、以下の文字だけが使用可能だ: * ``[a-zA-Z_]`` * ``[0-9]`` * 記号各種 それ以外の文字を GLSL のトークンに使用した場合は、コンパイルエラーになる。 * 行は、コンパイラーの診断内容や前処理器に関係する。 * 行は、キャリッジリターンまたはラインフィードで終了する。 * 両者が同時に使用された場合は、一つの行終端としてカウントされる。 * この文書では、これらの組み合わせを単に改行と呼ぶことにする。 * 行の長さは自由に設定できる。 * 一般的に、この言語では文字集合の大文字と小文字を区別する。 * 文字や文字列のデータ型がないため、引用符文字も含まれない。 * ファイル終端文字もない。 より正式には、コンパイルは以下の論理的局面が順番に実行されるように行われる: 1. ソースとなる文字列が連結され、単一の入力となる。改行はすべて保持される。 2. 行番号は、現在のすべての改行に基づいて表示され、後に改行が削除されても変更されない。 3. 改行の直前にバックスラッシュがある場合は、両方とも削除される (空白は置換されないので、一つのトークンが改行をまたぐことができる)。 新たに生成されたバックスラッシュと改行は取り除かれず、 局面 1. 以降に最初に生成された対しか取り除かれない。 4. すべてのコメントは単一の空白文字で置き換えられる。ただし、 ``//`` スタイルのコメントは、終了する改行の前で終わり、空白は一般的に前処理に関係する。 5. 前処理が行われ、上記の文字集合から形成された GLSL トークンの一連の並びが得られる。 6. 一連の GLSL トークンに対して GLSL 処理が行われる。 3.2. Source Strings ---------------------------------------------------------------------- 単一のシェーダーに対するソースとは、文字集合の文字列の配列だ。 単一のシェーダーはこれらの文字列を連結したものからなる。 各文字列は改行で区切られた複数の行を含むことができる。 一つの文字列の中に改行がある必要はなく、複数の文字列から単一行を形成することができる。 文字列を連結して単一シェーダーを形成する際には、実装は改行やその他の文字を挿入しない。 複数のシェーダーをリンクして単一のプログラムにすることができる。 シェーダーのコンパイルから返される診断内容は、 文字列内の行番号と、その伝達内容がどのソース文字列に該当するかの両方を特定する必要がある。 ソース文字列は、最初の文字列を文字列 0 として順次カウントされる。 行番号は、処理された新しい行の数よりも一つ多くなるが、これには、 行継続文字によって削除される新しい行をカウントすることも含まれる。 改行 (a new-line) の前にあって、行継続文字により区切られた行(複数形)は、 コメント処理や前処理の前に連結される。 これは行継続文字の代わりに空白文字が使われることはないことを意味する。 すなわち、ある行の終わりの文字とその次の行の始まりの文字を連結することで、単一トークンが形成される。 .. code:: glsl // equivalent to "float foo;" float f\ oo; .. note:: Pygments (2.9.0) は上記コード片を正しくハイライトできない。 3.3. Preprocessor ---------------------------------------------------------------------- コンパイルの一環としてソース文字列を処理する前処理器がある。 後で記す点を除けば C++ 標準の前処理器として動作する。 .. note:: 指示子の一覧省略。 各記号 ``#`` は、その行の前に空白またはタブしか置くことができない。 また、空白やタブを、指令の前に置くこともできる。 各指令は改行で終了する。前処理では、文字列中の改行の数や相対的な位置は変更されない。 前処理は、行継続文字によって改行が取り除かれた後に行われる。 行中の記号 ``#`` は無視される。上記以外の指令は、コンパイル時にエラーになる。 C++ 前処理器の標準機能である ``#define`` および ``#undef`` 機能は、 マクロパラメーターを持つマクロ定義と持たないマクロ定義の両方で定義される。 ---- 以下の定義済みマクロが用意されている: .. code:: glsl __LINE__ __FILE__ __VERSION__ ``__LINE__`` は、現在のソース文字列における先行する改行数よりも 1 多い十進数の整数定数に置換される。 ``__FILE__`` は、どのソース文字列番号が現在処理されているのかを示す十進数の整数定数に置換される。 ``__VERSION__`` は、OpenGL シェーディング言語のバージョン番号を反映した十進数の整数に置換される。 この文書によるシェーディング言語のバージョンは 460 に置換される。 慣習上、二つ以上の連続したアンダースコアを含むすべてのマクロ名は、 下位のソフトウェア層が使用するために予約済みだ。 シェーダー内でこのような名前を定義したり定義解除したりしても、それ自体がエラーになることはないものの、 同じ名前が複数定義されていることに起因する意図しない動作が発生する可能性がある。 また、``GL_`` から始まるマクロ名もすべて予約済みで、このような名前を定義したり、 定義解除したりすると、コンパイル時にエラーになる。 実装では、マクロ名の長さを最大 1024 文字まで対処する必要がある。 実装では、1024 文字を超える長さのマクロ名に対してエラーを生成することも、 そのようなマクロ名を対処することも許可されている。 ---- ``#if``, ``#ifdef``, ``#ifndef``, ``#else``, ``#elif``, ``#endif`` は、 以下の点を除き、C++ 前処理器の標準的な動作をするように定義されている: * ``#if`` および ``#elif`` に続く式は次の二つに制限される: * リテラルの整数定数と、 * 演算子 ``defined`` によって消費される識別子を操作する式 * 文字定数は対処されていない。 ---- 使用できる演算子の表省略。 ---- 演算子 ``defined`` は、以下のいずれかの方法で使用できる: | ``defined`` *identifier* | ``defined`` ``(`` *identifier* ``)`` マクロ内の二つのトークンは C++ 前処理器で標準的に使用されているトークン貼り付け演算子 ``##`` を使用して 一つのトークンに連結できる。結果は一つの有効トークンでなければならず、 そのトークンはマクロ展開の対象となる。 つまり、マクロ展開はトークン貼り付けの後にしか行われない。 その他の数字記号に基づく演算子 (``#``, ``#@``, etc.) はなく、演算子 ``sizeof`` もない。 前処理器で整数リテラルに演算子を適用する際の意味論は OpenGL Shading Language のものではなく、C++ 前処理器の標準的なものと一致する。 前処理器の式は、シェーダーが対象とする処理器ではなく、ホスト処理器の動作に従って評価される。 ``#error`` が発生すると、実装はコンパイル時の診断内容をシェーダーオブジェクトの情報ログに記録する。 伝達内容は ``#error`` 指令に続くトークンで、最初の改行までとなる。 実装では ``#error`` 指令の存在をコンパイルエラーとして扱わなければならない。 ``#pragma`` は、実装依存コンパイラー制御を許す。 ``#pragma`` に続くトークンは、前処理器のマクロ展開の対象にはならない。 実装が ``#pragma`` に続くトークンを認識しない場合は、それを無視する。 次の pragmas は言語の一部として定義されている: .. code:: glsl #pragma STDGL ``STDGL`` pragma は、この言語の将来の改訂版で使用するための pragma を予約するために使用される。 どのような実装でも、最初のトークンが ``STDGL`` である pragma を使用することは許さない。 .. code:: glsl #pragma optimize(on) #pragma optimize(off) ``optimize`` pragma はシェーダーの開発やデバッグを支援するために、最適化を切るために使用できる。 これは、関数定義の外側でしか使用できない。 既定では、すべてのシェーダーで ``optimize`` がオンになっている。 .. code:: glsl #pragma debug(on) #pragma debug(off) ``debug`` pragma はデバッグ情報を付加してシェーダーをコンパイルし、 デバッガーでそれを使用できるようにするために使用される。 この pragma は、関数定義の外側でしか使用できない。 既定では ``debug`` は効いていない。 シェーダーは言語のバージョンを宣言する必要がある。それは次のように指定される: .. code:: glsl #version number profile_opt ここで ``number`` は言語のバージョンでなければならず、上記の __VERSION__ と同じ規則に従う。 言語のバージョン 4.60 を使用するシェーダーでは ``#version 460`` という指令が必要だ。 コンパイラーが対処していない言語のバージョンを表す数字を入力すると、コンパイルエラーが発生する。 言語のバージョン 1.10 では、シェーダーにこの指令を含める必要はない。 ``#version`` 指令を含まないシェーダーは、バージョン 1.10 を対象としているものとして扱われる。 バージョン 100, 300, 310 を指定したシェーダーは、 OpenGL ES Shading Language のバージョン 1.00, 3.00, 3.10 を対象としたものとしてそれぞれ扱われる。 .. admonition:: コメント WebGL をやるときに特にこの知識が必要になる。 オプションの ``profile`` 引数を指定する場合は、 OpenGL プロファイルの名前である必要がある。現在、選択肢が三つある: | ``core`` | ``compatibility`` | ``es`` 引数 ``profile`` はバージョン 150 以上でしか使用できない。 引数 ``profile`` が指定されておらず、バージョンが 150 以上の場合、既定は ``core`` だ。 バージョン 300 または 310 が指定されている場合、 引数 ``profile`` はオプションではなく ``es`` でなければならず、 そうでない場合はコンパイルエラーとなる。 ``es`` プロファイルの言語仕様は The OpenGL ES Shading Language specification で規定されている。 異なるバージョンを宣言している ``core`` または ``compatibility`` プロファイルのシェーダーを一緒にリンクすることができる。 ただし、 ``es`` プロファイルのシェーダーを非 ``es`` プロファイルのシェーダーや バージョンの異なる ``es`` プロファイルのシェーダーとリンクすることはできず、リンクエラーとなる。 これらの規則で許可されたバージョンのシェーダーをリンクする場合、 残りのリンクエラーは、シェーダーがリンクされているコンテキストのバージョンに対応する GLSL バージョンのリンク規則に従って与えられる。 シェーダーのコンパイルエラーは、各シェーダー内で宣言された(または既定で設定された) バージョンに厳密に基づいて与えられなければならない。 特に指定のない限り、本仕様書はコアプロファイルを文書化しており、 コアプロファイルに指定されているものはすべて互換性プロファイルでも利用可能だ。 互換性プロファイルに特に属すると指定された機能は、コアプロファイルでは利用可能でない。 互換性プロファイルの機能は SPIR-V の生成時には利用可能でない。 実装が対処する各プロファイルには組み込みマクロ定義がある。 すべての実装には次のマクロが用意されている: .. code:: glsl #define GL_core_profile 1 互換性プロファイルを提供する実装には次のマクロが用意されている: .. code:: glsl #define GL_compatibility_profile 1 ``es`` プロファイルを提供する実装では、次のマクロが用意されている: .. code:: glsl #define GL_es_profile 1 シェーダーの中では、コメントや空白を除いて、何よりも先に ``#version`` 指令を記述しなければならない。 既定では、この言語のコンパイラーは、この仕様に適合していないシェーダーに対して コンパイル時に字句エラーや文法エラーを出さなければならない。 どんな拡張された動作も、最初に有効にする必要がある。 拡張機能に関するコンパイラーの動作を制御するための指令は ``#extension`` 指令で宣言される: .. code:: glsl #extension extension_name : behavior #extension all : behavior ここで ``extension_name`` は拡張の名前だ。 拡張の名前は当仕様では文書化されていない。 トークン ``all`` はその動作がコンパイラーで対処されている拡張子すべてに適用されることを意味する。 動作は以下のいずれかになる: .. glossary:: ``require`` 拡張 ``extension_name`` で指定されたとおりに動作する。 拡張 ``extension_name`` が対処されていない場合や、 ``all`` が指定されている場合は ``#extension`` に対するコンパイルエラーとなる。 ``enable`` 拡張 ``extension_name`` で指定されたとおりに動作する。 拡張 ``extension_name`` が対処されていない場合 ``#extension`` に警告する。 ``all`` が指定されている場合は ``#extension`` に対するコンパイルエラーとなる。 ``warn`` 拡張 ``extension_name`` で指定されたとおりに動作する。 ただし、他の有効または必須の拡張で対処されている場合を除き、 その拡張の使用が検出された場合は警告を発する。 ``all`` が指定された場合、使用されているすべての拡張の検出可能な使用に対して警告する。 拡張 ``extension_name`` が対処されていない場合は ``#extension`` に対して警告する。 ``disable`` Warn on the #extension if the extension extension_name is not supported. 拡張 ``extension_name`` が言語定義に含まれていないかのような動作(エラーや警告を含む)をする。 ``all`` が指定された場合は、コンパイル先の言語の拡張されていない コアバージョンの動作に撤回しなければならない。 拡張 ``extension_name`` が対処されていない場合は ``#extension`` に対して警告する。 ``extension`` 指令は、各拡張の動作を設定するための単純で低水準の仕組みだ。 どのような組み合わせが適切なのかといったポリシーは定義しない。 各拡張の動作を設定する際には、指令の順番が重要だ。 遅れて出てきた指令は早く出てきたものを上書きする。 ``all`` の変種は拡張すべてに対する動作を設定し、以前に発令されたすべての拡張機能の指令を上書きするが、 ``warn`` と ``disable`` の動作しか上書きされない。 コンパイラーの初期状態は、あたかも指令: .. code:: glsl #extension all : disable すべてのエラーや警告の報告は、この仕様に基づいて行われなければならず、拡張は無視されることをコンパイラに伝える。 が発令されたかのように、「すべてのエラーや警告の報告はこの仕様に基づいて行われなければならず、拡張は無視される」 ことをコンパイラーに教える。 各拡張は、許容されるスコープの粒度を定義することができる。 何も言われなければ、粒度はシェーダー(つまり単一コンパイル単位)で、 拡張指示は前処理器以外のトークンの前でなければならない。 必要であれば、リンカーは単一コンパイル単位よりも大きな粒度を強制することができる。 その場合、関係する各シェーダーは必要な拡張指令を含まなければならない。 マクロの展開は ``#extension`` と ``#version`` 指令を含む行では行われない。 ``#line`` はマクロ置換後、次のいずれかの形式とならなければならない: | #line *line* | #line *line* *source-string-number* ここで *line* と *source-string-number* は定整数式だ。 これらの定数式が整数リテラルでない場合の動作は未定義だ。 この指令(改行を含む)を処理した後、実装はまるで行番号 *line* とソース文字列番号 *source-string-number* でコンパイルしているかのように動作する。 後続のソース文字列は、他の ``#line`` 指令がその番号を上書きするまで、連続して番号が付けられる。 .. note:: ``#line`` 指令の中で定数表現を許可している実装と、そうでない実装がある。 式が対処される場合でも、文法が曖昧なので、結果は実装依存となる。例えば: .. code:: glsl #line +2 +2 // Line number set to 4, or file to 2 and line to 2 OpenGL SPIR-V 用にシェーダーをコンパイルした場合、次の定義済みマクロが利用できる: .. code:: glsl #define GL_SPIRV 100 Vulkan を対象にする場合、次の定義済みマクロが利用できる: .. code:: glsl #define VULKAN 100 3.4. Comments ---------------------------------------------------------------------- コメントは ``/*`` と ``*/``、または ``//`` と改行で区切られる。 コメント開始時の区切りパターンは、コメント内ではそれとして認識されないため、 コメントを入れ子にすることはできない。 コメント ``/*`` はコメント終了時の区切りパターン ``*/`` を含む。 しかし ``//`` コメントは終端の改行を含まない(つまり排除する)。 コメント内では、値が 0 のバイトを除き、任意のバイト値を使用することができる。 コメントの内容については、エラーは発生せず、コメントの内容を検証する必要もない。 コメントが処理される前に、論理的には行継続文字による改行の除去が行われる。 つまり、文字 ``\`` で終わる単一行コメントは、次の行も含めてコメントになる。 .. code:: glsl // a single-line comment containing the next line \ a = b; // this is still in the first comment 3.5. Tokens ---------------------------------------------------------------------- 前処理を終えた言語は、トークンの順序のある並びだ。 | *token* : | *keyword* | *identifier* | *integer-constant* | *floating-constant* | *operator* | ``;`` ``{`` ``}`` 3.6. Keywords ---------------------------------------------------------------------- この節の前半にある一覧が当言語のキーワードであり、前処理以降はこの仕様書に記載されているとおりにしか使用できず、 そうでない場合はコンパイル時にエラーが発生する。 Vulkan を対象にする場合には追加のキーワードが存在する。 さらに、将来使用するために予約されてるキーワードが多数定義されている。 これらを使用すると、コンパイルエラーが発生する。 その上、前述のダブルアンダースコア規則が適用される。 3.7. Identifiers ---------------------------------------------------------------------- 識別子は、変数名、関数名、構造体名、フィールドセレクター(構造体のメンバーと同様に、 フィールドセレクターはベクトルや行列の構成要素を選択する)に使用される。 .. admonition:: コメント 識別子の BNF みたいな表がここにあるが省略。 * ``gl_`` で始まる識別子は予約されており、一般的にはシェーダ内で宣言することはできない。 * 前述の 1024 文字ルールがここでも適用される。 3.8. Definitions ---------------------------------------------------------------------- 後述する言語規則のいくつかは、次の定義に依存する。 3.8.1. Static Use ---------------------------------------------------------------------- シェーダーに変数 ``x`` が **静的に使用されている** (a static use) のは、 前処理後にシェーダーに ``x`` の任意の部分にアクセスするような文が含まれている場合であり、 制御の流れによってその文が実行されるかどうかには関係ない。 このような変数は、 **静的に使用されている** (statically used) と呼ばれる。 アクセスが書き込みの場合、``x`` は **静的に割り当てられている** (statically assigned) とも言われる。 3.8.2. Dynamically Uniform Expressions and Uniform Control Flow ---------------------------------------------------------------------- 一部の操作では、式が **動的に一様である** (dynamically uniform) ことや、 **一様な制御フロー** (uniform control flow) の中に配置されていることが要求される。 これらの要件は以下の定義集合で定義されている。 **呼び出し** (an invocation) とは、特定の段階における ``main()`` の単一実行のことあって、 その段階のシェーダー内で明示的に公開されているデータ量に対してしか作用しない (データの追加的なインスタンスに対する暗黙の操作は、追加的な呼び出しとなる)。 例えば、計算実行モデルでは、単一の呼び出しが単一の作業項目に対してしか作用せず、 頂点実行モデルでは、単一の呼び出しが単一の頂点に対してしか作用しない。 **呼び出しグループ** (an invocation group) とは、特定の計算作業グループまたは グラフィック操作をまとめて処理する呼び出しの完全な集合だ。 「グラフィック操作」の範囲は実装に依存するが、クライアント API で定義されているように、 少なくとも単一の三角形またはパッチと同じ大きさであり、最大でも一つのレンダリング命令と同じ大きさだ。 単一の呼び出しで、単一のシェーダー文が複数回実行され、その命令の **動的インスタンス** (dynamic instances) が複数得られる。 これは、命令がループ内で実行される場合や、複数の呼び出し場所から呼び出される関数内で実行される場合、 あるいはこれらの複数の組み合わせで発生する。 ループの繰り返しや、関数と呼び出し場所の動的な連鎖が異なると、 そのような命令の動的インスタンスも異なる。 動的インスタンスは、どの呼び出しが実行されたかではなく、呼び出し内の制御フローの経路によって区別される。 つまり、``main()`` の異なる呼び出しは、同じ制御フロー経路をたどる場合、 その命令の同じ動的インスタンスを実行する。 ある式がそれを消費するある動的インスタンスに対して **動的に一様** (dynamically uniform) であるとは、 動的インスタンスを実行する(呼び出しグループ内の)呼び出しすべてに対してその値が同じであるときに言う。 **一様制御フロー** (収束制御フロー)は、呼び出しグループ内のすべての呼び出しが同じ制御フロー経路 (したがって、命令の動的インスタンスの順序も同じ)を実行するときに発生する。 一様制御フローは ``main()`` に入ったときの初期状態であり、 条件分岐が異なる呼び出しに対して異なる制御経路を取るまで続く (非一様制御フローまたは発散制御フロー)。 このような発散は再収束し、すべての呼び出しが再び同じ制御フローの経路を実行するようになり、 これにより一様制御フローの存在が再び確立される。 選択肢やループに入ったときに制御フローが一様であり、その後、 呼び出しグループのすべての呼び出しがその選択肢やループから離れると、制御フローは一様に収束し直す。 .. code:: glsl main() { float a = ...; // this is uniform control flow if (a < b) { // this expression is true for some fragments, not all ...; // non-uniform control flow } else { ...; // non-uniform control flow } ...; // uniform control flow again } 定数式は動的に一様であることは自明だ。 これにより、定数式に基づく典型的なループ計数器も動的に一様であることがわかる。 .. admonition:: コメント 解析の教科書のような文章に読み取ってしまった。
25.43513
91
0.714118
3dd8fc004d357960c336214f0358d1fd06013f7f
750
rst
reStructuredText
docs/docsource/operation/bucket_operations/delete_a_replication_workflow.rst
scality/Zenko
22eba11403f3fc9cd88c0dad0d8b4714634bef5f
[ "Apache-2.0" ]
453
2017-07-11T13:14:05.000Z
2022-03-31T20:50:01.000Z
docs/docsource/operation/bucket_operations/delete_a_replication_workflow.rst
scality/Zenko
22eba11403f3fc9cd88c0dad0d8b4714634bef5f
[ "Apache-2.0" ]
987
2017-07-11T16:56:45.000Z
2022-03-31T19:36:10.000Z
docs/docsource/operation/bucket_operations/delete_a_replication_workflow.rst
scality/Zenko
22eba11403f3fc9cd88c0dad0d8b4714634bef5f
[ "Apache-2.0" ]
100
2017-07-11T16:16:29.000Z
2022-03-11T15:07:54.000Z
.. _Delete a Replication Workflow: Delete a Replication Workflow ============================= To delete a replication workflow rule: #. Click the **Workflows** tab. The Workflow panel displays. .. image:: ../../graphics/xdm_ui_workflow_panel.png #. Select a workflow to delete. Click the **Delete Workflow** button. #. The workflow is removed from the menu. If no workflows remain, you are prompted to create a new worflow. Deleting a Replication Workflow Using the AWS CLI ------------------------------------------------- The following command deletes a replication configuration from a bucket named "my-bucket":: $ aws s3api delete-bucket-replication --bucket my-bucket For API operation, see :ref:`DELETE Bucket Replication`.
27.777778
77
0.674667
2125011028306c46304b4cb3df05b98591625f0c
225
rst
reStructuredText
Protogame.Docs/network/index.rst
yurisouza/Protogame
289e6f70a8f941756ef3d6dce588f13e83c16ca3
[ "Unlicense", "MIT" ]
163
2016-01-05T23:38:28.000Z
2022-03-31T11:17:42.000Z
Protogame.Docs/network/index.rst
yurisouza/Protogame
289e6f70a8f941756ef3d6dce588f13e83c16ca3
[ "Unlicense", "MIT" ]
11
2016-09-03T03:45:06.000Z
2017-08-26T18:36:10.000Z
Protogame.Docs/network/index.rst
yurisouza/Protogame
289e6f70a8f941756ef3d6dce588f13e83c16ca3
[ "Unlicense", "MIT" ]
42
2016-04-11T17:49:55.000Z
2022-03-22T22:56:21.000Z
Networking: Multiplayer ================================ The networking module provides classes for building multiplayer games. .. toctree:: :maxdepth: 2 :caption: Table of contents :glob: api/*.gen
20.454545
70
0.577778
9f654f3b89446348b4fabc567d2f785401e468a6
9,649
rst
reStructuredText
Openharmony v1.0/vendor/hisi/hi35xx/third_party/uboot/doc/driver-model/livetree.rst
clkbit123/TheOpenHarmony
0e6bcd9dee9f1a2481d762966b8bbd24baad6159
[ "MIT" ]
1
2021-11-21T19:56:29.000Z
2021-11-21T19:56:29.000Z
machine/qemu/sources/u-boot/doc/driver-model/livetree.rst
muddessir/framework
5b802b2dd7ec9778794b078e748dd1f989547265
[ "MIT" ]
null
null
null
machine/qemu/sources/u-boot/doc/driver-model/livetree.rst
muddessir/framework
5b802b2dd7ec9778794b078e748dd1f989547265
[ "MIT" ]
null
null
null
.. SPDX-License-Identifier: GPL-2.0+ .. sectionauthor:: Simon Glass <[email protected]> Live Device Tree ================ Introduction ------------ Traditionally U-Boot has used a 'flat' device tree. This means that it reads directly from the device tree binary structure. It is called a flat device tree because nodes are listed one after the other, with the hierarchy detected by tags in the format. This document describes U-Boot's support for a 'live' device tree, meaning that the tree is loaded into a hierarchical data structure within U-Boot. Motivation ---------- The flat device tree has several advantages: - it is the format produced by the device tree compiler, so no translation is needed - it is fairly compact (e.g. there is no need for pointers) - it is accessed by the libfdt library, which is well tested and stable However the flat device tree does have some limitations. Adding new properties can involve copying large amounts of data around to make room. The overall tree has a fixed maximum size so sometimes the tree must be rebuilt in a new location to create more space. Even if not adding new properties or nodes, scanning the tree can be slow. For example, finding the parent of a node is a slow process. Reading from nodes involves a small amount parsing which takes a little time. Driver model scans the entire device tree sequentially on start-up which avoids the worst of the flat tree's limitations. But if the tree is to be modified at run-time, a live tree is much faster. Even if no modification is necessary, parsing the tree once and using a live tree from then on seems to save a little time. Implementation -------------- In U-Boot a live device tree ('livetree') is currently supported only after relocation. Therefore we need a mechanism to specify a device tree node regardless of whether it is in the flat tree or livetree. The 'ofnode' type provides this. An ofnode can point to either a flat tree node (when the live tree node is not yet set up) or a livetree node. The caller of an ofnode function does not need to worry about these details. The main users of the information in a device tree are drivers. These have a 'struct udevice \*' which is attached to a device tree node. Therefore it makes sense to be able to read device tree properties using the 'struct udevice \*', rather than having to obtain the ofnode first. The 'dev_read\_...()' interface provides this. It allows properties to be easily read from the device tree using only a device pointer. Under the hood it uses ofnode so it works with both flat and live device trees. Enabling livetree ----------------- CONFIG_OF_LIVE enables livetree. When this option is enabled, the flat tree will be used in SPL and before relocation in U-Boot proper. Just before relocation a livetree is built, and this is used for U-Boot proper after relocation. Most checks for livetree use CONFIG_IS_ENABLED(OF_LIVE). This means that for SPL, the CONFIG_SPL_OF_LIVE option is checked. At present this does not exist, since SPL does not support livetree. Porting drivers --------------- Many existing drivers use the fdtdec interface to read device tree properties. This only works with a flat device tree. The drivers should be converted to use the dev_read_() interface. For example, the old code may be like this: .. code-block:: c struct udevice *bus; const void *blob = gd->fdt_blob; int node = dev_of_offset(bus); i2c_bus->regs = (struct i2c_ctlr *)devfdt_get_addr(dev); plat->frequency = fdtdec_get_int(blob, node, "spi-max-frequency", 500000); The new code is: .. code-block:: c struct udevice *bus; i2c_bus->regs = (struct i2c_ctlr *)dev_read_addr(dev); plat->frequency = dev_read_u32_default(bus, "spi-max-frequency", 500000); The dev_read\_...() interface is more convenient and works with both the flat and live device trees. See include/dm/read.h for a list of functions. Where properties must be read from sub-nodes or other nodes, you must fall back to using ofnode. For example, for old code like this: .. code-block:: c const void *blob = gd->fdt_blob; int subnode; fdt_for_each_subnode(subnode, blob, dev_of_offset(dev)) { freq = fdtdec_get_int(blob, node, "spi-max-frequency", 500000); ... } you should use: .. code-block:: c ofnode subnode; ofnode_for_each_subnode(subnode, dev_ofnode(dev)) { freq = ofnode_read_u32(node, "spi-max-frequency", 500000); ... } Useful ofnode functions ----------------------- The internal data structures of the livetree are defined in include/dm/of.h : :struct device_node: holds information about a device tree node :struct property: holds information about a property within a node Nodes have pointers to their first property, their parent, their first child and their sibling. This allows nodes to be linked together in a hierarchical tree. Properties have pointers to the next property. This allows all properties of a node to be linked together in a chain. It should not be necessary to use these data structures in normal code. In particular, you should refrain from using functions which access the livetree directly, such as of_read_u32(). Use ofnode functions instead, to allow your code to work with a flat tree also. Some conversion functions are used internally. Generally these are not needed for driver code. Note that they will not work if called in the wrong context. For example it is invalid to call ofnode_to_no() when a flat tree is being used. Similarly it is not possible to call ofnode_to_offset() on a livetree node. ofnode_to_np(): converts ofnode to struct device_node * ofnode_to_offset(): converts ofnode to offset no_to_ofnode(): converts node pointer to ofnode offset_to_ofnode(): converts offset to ofnode Other useful functions: of_live_active(): returns true if livetree is in use, false if flat tree ofnode_valid(): return true if a given node is valid ofnode_is_np(): returns true if a given node is a livetree node ofnode_equal(): compares two ofnodes ofnode_null(): returns a null ofnode (for which ofnode_valid() returns false) Phandles -------- There is full phandle support for live tree. All functions make use of struct ofnode_phandle_args, which has an ofnode within it. This supports both livetree and flat tree transparently. See for example ofnode_parse_phandle_with_args(). Reading addresses ----------------- You should use dev_read_addr() and friends to read addresses from device-tree nodes. fdtdec ------ The existing fdtdec interface will eventually be retired. Please try to avoid using it in new code. Modifying the livetree ---------------------- This is not currently supported. Once implemented it should provide a much more efficient implementation for modification of the device tree than using the flat tree. Internal implementation ----------------------- The dev_read\_...() functions have two implementations. When CONFIG_DM_DEV_READ_INLINE is enabled, these functions simply call the ofnode functions directly. This is useful when livetree is not enabled. The ofnode functions call ofnode_is_np(node) which will always return false if livetree is disabled, just falling back to flat tree code. This optimisation means that without livetree enabled, the dev_read\_...() and ofnode interfaces do not noticeably add to code size. The CONFIG_DM_DEV_READ_INLINE option defaults to enabled when livetree is disabled. Most livetree code comes directly from Linux and is modified as little as possible. This is deliberate since this code is fairly stable and does what we want. Some features (such as get/put) are not supported. Internal macros take care of removing these features silently. Within the of_access.c file there are pointers to the alias node, the chosen node and the stdout-path alias. Errors ------ With a flat device tree, libfdt errors are returned (e.g. -FDT_ERR_NOTFOUND). For livetree normal 'errno' errors are returned (e.g. -ENOTFOUND). At present the ofnode and dev_read\_...() functions return either one or other type of error. This is clearly not desirable. Once tests are added for all the functions this can be tidied up. Adding new access functions --------------------------- Adding a new function for device-tree access involves the following steps: - Add two dev_read() functions: - inline version in the read.h header file, which calls an ofnode function - standard version in the read.c file (or perhaps another file), which also calls an ofnode function The implementations of these functions can be the same. The purpose of the inline version is purely to reduce code size impact. - Add an ofnode function. This should call ofnode_is_np() to work out whether a livetree or flat tree is used. For the livetree it should call an of\_...() function. For the flat tree it should call an fdt\_...() function. The livetree version will be optimised out at compile time if livetree is not enabled. - Add an of\_...() function for the livetree implementation. If a similar function is available in Linux, the implementation should be taken from there and modified as little as possible (generally not at all). Future work ----------- Live tree support was introduced in U-Boot 2017.07. There is still quite a bit of work to do to flesh this out: - tests for all access functions - support for livetree modification - addition of more access functions as needed - support for livetree in SPL and before relocation (if desired)
33.620209
80
0.748782
48d264f30e7b4214ab52d2cffd5ee33967489623
6,766
rst
reStructuredText
src/frr/doc/user/fabricd.rst
zhouhaifeng/vpe
9c644ffd561988e5740021ed26e0f7739844353d
[ "Apache-2.0" ]
null
null
null
src/frr/doc/user/fabricd.rst
zhouhaifeng/vpe
9c644ffd561988e5740021ed26e0f7739844353d
[ "Apache-2.0" ]
null
null
null
src/frr/doc/user/fabricd.rst
zhouhaifeng/vpe
9c644ffd561988e5740021ed26e0f7739844353d
[ "Apache-2.0" ]
null
null
null
.. _fabricd: ********** OpenFabric ********** OpenFabric, specified in :t:`draft-white-openfabric-06.txt`, is a routing protocol derived from IS-IS, providing link-state routing with efficient flooding for topologies like spine-leaf networks. FRR implements OpenFabric in a daemon called *fabricd* .. _configuring-fabricd: Configuring fabricd =================== There are no *fabricd* specific options. Common options can be specified (:ref:`common-invocation-options`) to *fabricd*. *fabricd* needs to acquire interface information from *zebra* in order to function. Therefore *zebra* must be running before invoking *fabricd*. Also, if *zebra* is restarted then *fabricd* must be too. Like other daemons, *fabricd* configuration is done in an OpenFabric specific configuration file :file:`fabricd.conf`. .. _openfabric-router: OpenFabric router ================= To enable the OpenFabric routing protocol, an OpenFabric router needs to be created in the configuration: .. clicmd:: router openfabric WORD Enable or disable the OpenFabric process by specifying the OpenFabric domain with 'WORD'. .. clicmd:: net XX.XXXX. ... .XXX.XX Set/Unset network entity title (NET) provided in ISO format. .. clicmd:: domain-password [clear | md5] <password> Configure the authentication password for a domain, as clear text or md5 one. .. clicmd:: attached-bit [receive ignore | send] Set attached bit for inter-area traffic: - receive If LSP received with attached bit set, create default route to neighbor - send If L1|L2 router, set attached bit in LSP sent to L1 router .. clicmd:: log-adjacency-changes Log changes in adjacency state. .. clicmd:: set-overload-bit Set overload bit to avoid any transit traffic. .. clicmd:: purge-originator Enable or disable :rfc:`6232` purge originator identification. .. clicmd:: fabric-tier (0-14) Configure a static tier number to advertise as location in the fabric .. _openfabric-timer: OpenFabric Timer ================ .. clicmd:: lsp-gen-interval (1-120) Set minimum interval in seconds between regenerating same LSP. .. clicmd:: lsp-refresh-interval (1-65235) Set LSP refresh interval in seconds. .. clicmd:: max-lsp-lifetime (360-65535) Set LSP maximum LSP lifetime in seconds. .. clicmd:: spf-interval (1-120) Set minimum interval between consecutive SPF calculations in seconds. .. _openfabric-interface: OpenFabric interface ==================== .. clicmd:: ip router openfabric WORD .. _ip-router-openfabric-word: Activate OpenFabric on this interface. Note that the name of OpenFabric instance must be the same as the one used to configure the routing process (see command :clicmd:`router openfabric WORD`). .. clicmd:: openfabric csnp-interval (1-600) Set CSNP interval in seconds. .. clicmd:: openfabric hello-interval (1-600) Set Hello interval in seconds. .. clicmd:: openfabric hello-multiplier (2-100) Set multiplier for Hello holding time. .. clicmd:: openfabric metric (0-16777215) Set interface metric value. .. clicmd:: openfabric passive Configure the passive mode for this interface. .. clicmd:: openfabric password [clear | md5] <password> Configure the authentication password (clear or encoded text) for the interface. .. clicmd:: openfabric psnp-interval (1-120) Set PSNP interval in seconds. .. _showing-openfabric-information: Showing OpenFabric information ============================== .. clicmd:: show openfabric summary Show summary information about OpenFabric. .. clicmd:: show openfabric hostname Show which hostnames are associated with which OpenFabric system ids. .. clicmd:: show openfabric interface .. clicmd:: show openfabric interface detail .. clicmd:: show openfabric interface <interface name> Show state and configuration of specified OpenFabric interface, or all interfaces if no interface is given with or without details. .. clicmd:: show openfabric neighbor .. clicmd:: show openfabric neighbor <System Id> .. clicmd:: show openfabric neighbor detail Show state and information of specified OpenFabric neighbor, or all neighbors if no system id is given with or without details. .. clicmd:: show openfabric database .. clicmd:: show openfabric database [detail] .. clicmd:: show openfabric database <LSP id> [detail] .. clicmd:: show openfabric database detail <LSP id> Show the OpenFabric database globally, for a specific LSP id without or with details. .. clicmd:: show openfabric topology Show calculated OpenFabric paths and associated topology information. .. _debugging-openfabric: Debugging OpenFabric ==================== .. clicmd:: debug openfabric adj-packets OpenFabric Adjacency related packets. .. clicmd:: debug openfabric checksum-errors OpenFabric LSP checksum errors. .. clicmd:: debug openfabric events OpenFabric Events. .. clicmd:: debug openfabric local-updates OpenFabric local update packets. .. clicmd:: debug openfabric lsp-gen Generation of own LSPs. .. clicmd:: debug openfabric lsp-sched Debug scheduling of generation of own LSPs. .. clicmd:: debug openfabric packet-dump OpenFabric packet dump. .. clicmd:: debug openfabric protocol-errors OpenFabric LSP protocol errors. .. clicmd:: debug openfabric route-events OpenFabric Route related events. .. clicmd:: debug openfabric snp-packets OpenFabric CSNP/PSNP packets. .. clicmd:: debug openfabric spf-events .. clicmd:: debug openfabric spf-statistics .. clicmd:: debug openfabric spf-triggers OpenFabric Shortest Path First Events, Timing and Statistic Data and triggering events. .. clicmd:: debug openfabric update-packets Update-related packets. .. clicmd:: show debugging openfabric Print which OpenFabric debug levels are active. Sample configuration ==================== A simple example: .. code-block:: frr ! interface lo ip address 192.0.2.1/32 ip router openfabric 1 ipv6 address 2001:db8::1/128 ipv6 router openfabric 1 ! interface eth0 ip router openfabric 1 ipv6 router openfabric 1 ! interface eth1 ip router openfabric 1 ipv6 router openfabric 1 ! router openfabric 1 net 49.0000.0000.0001.00 Alternative example: .. code-block:: frr hostname fabricd router openfabric DEAD net 47.0023.0000.0003.0300.0100.0102.0304.0506.00 lsp-lifetime 65535 hostname isisd-router domain-password foobar interface eth0 ip router openfabric DEAD openfabric hello-interval 5 openfabric lsp-interval 1000 ! -- optional openfabric retransmit-interval 10 openfabric retransmit-throttle-interval
22.183607
84
0.720367
725561103ed050739a069c14bcac0133029d72c9
99
rst
reStructuredText
HISTORY.rst
Allan-Nava/django-db-conn-pool
3f205d9337ee1c180140fb44a037eba8a5e723fa
[ "Apache-2.0" ]
5
2019-05-04T03:55:14.000Z
2022-02-04T18:21:22.000Z
HISTORY.rst
Allan-Nava/django-db-conn-pool
3f205d9337ee1c180140fb44a037eba8a5e723fa
[ "Apache-2.0" ]
1
2021-09-15T10:42:54.000Z
2021-09-15T10:42:54.000Z
HISTORY.rst
Allan-Nava/django-db-conn-pool
3f205d9337ee1c180140fb44a037eba8a5e723fa
[ "Apache-2.0" ]
3
2020-07-08T11:14:30.000Z
2022-03-18T09:44:42.000Z
.. :changelog: Release History --------------- 1.0.0 (2019-05-04) ++++++++++++++++++ - Birthday
9.9
18
0.424242
632748257d4e74576485260e4e59d6e5fab2bdec
215
rst
reStructuredText
docs/index.rst
fab-bar/SpellvarDetection
624f472f9eec9636650bace9c091ba1fe9cda313
[ "MIT" ]
1
2019-11-08T08:02:21.000Z
2019-11-08T08:02:21.000Z
docs/index.rst
fab-bar/SpellvarDetection
624f472f9eec9636650bace9c091ba1fe9cda313
[ "MIT" ]
null
null
null
docs/index.rst
fab-bar/SpellvarDetection
624f472f9eec9636650bace9c091ba1fe9cda313
[ "MIT" ]
null
null
null
.. mdinclude:: ../README.md :end-line: 31 .. toctree:: :maxdepth: 1 :caption: For users overview input pipeline utils .. toctree:: :maxdepth: 1 :caption: For developers development
11.944444
27
0.604651
a1d209d776063995032af99a582f502477da03c9
7,373
rst
reStructuredText
doc/src/split-apply-combine.rst
swift-nav/albatross
54f2edec3f19149f04a2e2e3bbb0b05aba7faba6
[ "MIT" ]
15
2018-04-10T02:05:06.000Z
2022-02-07T23:33:27.000Z
doc/src/split-apply-combine.rst
swift-nav/albatross
54f2edec3f19149f04a2e2e3bbb0b05aba7faba6
[ "MIT" ]
79
2018-04-19T20:36:18.000Z
2021-08-04T16:21:19.000Z
doc/src/split-apply-combine.rst
swift-nav/albatross
54f2edec3f19149f04a2e2e3bbb0b05aba7faba6
[ "MIT" ]
4
2018-04-06T03:12:16.000Z
2020-09-11T03:25:08.000Z
############################## Group By : Split Apply Combine ############################## .. _split-apply-combine: The split apply combine workflow is something that is heavily used in the popular python package `pandas`_ and which we've borrowed in ``albatross``. The general idea is that many data manipulation operations can be broken into three steps in which a dataset is first split apart into groups, a function is then applied to each of the groups and the result is recombined into a new dataset. This technique can be used in ``albatross`` using syntax that ends up very similar to that of ``pandas`` .. code-block:: c dataset.group_by(my_criteria).apply(some_operation).combine(); .. _`pandas` : https://pandas.pydata.org/pandas-docs/stable/user_guide/groupby.html ----------------- Group By ----------------- The grouping (and applying) can be done using anything callable which takes a single ``FeatureType`` as an argument, for example: .. code-block:: c int my_criteria(const double &x) { return round(x); } struct MyCritera { int operator() (const double &x) { return my_criteria(x); } } void examples() { RegressionDataset<double> dataset = make_dataset(); // using a free function dataset.group_by(my_criteria); // using a lambda dataset.group_by([](const auto &x){return my_criteria(x);}); // using a callable object MyCritera criteria; dataset.group_by(criteria); } The result of ``group_by(f).groups()`` can be treated as if it were a ``std::map``, for example to get the third group: .. code-block:: c auto dataset_3 = dataset.group_by(my_criteria).groups()[3]; Not all operations can be efficiently done working with the grouped datasets, for these cases you may find it helpful to work directly with the indices of each group: .. code-block:: c std::vector<std::size_t> inds_3 = dataset.group_by(my_criteria).indexers()[3]; The ``group_by`` technique can also be used directly on vectors: .. code-block:: c std::vector<double> values = make_values(); group_by(values, my_criteria); In this case the ``groups()`` will return a map from ``int`` to ``std::vector<double>``. ----------------- Apply ----------------- Similar to ``group_by`` an apply function can be anything callable and should take either the key value pair or just the value as arguments and can (optionally) return a new object. In other words an apply function should have one of the following signatures. ``ApplyType f(KeyType &key, ValueType &value)`` The result will be a new map-like from ``KeyType`` to ``ApplyType`` .. code-block:: c auto sum = [](const int &key, const RegressionDataset<double>& value) { return value.targets.mean.sum(); }; std::map<int, double> sums = dataset.group_by(my_criteria).apply(sum); ``void f(KeyType &key, ValueType &value)`` The return type will be void. .. code-block:: c auto print_sum = [](const int &key, const RegressionDataset<double>& value) { std::cout << key << " : " << value.targets.mean.sum() << std::endl; }; dataset.group_by(my_criteria).apply(print_sum); ``ApplyType f(ValueType &value)`` The result will be a new map-like from ``KeyType`` to ``ApplyType`` .. code-block:: c auto sum = [](const RegressionDataset<double>& value) { return value.targets.mean.sum(); }; std::map<int, double> sums = dataset.group_by(my_criteria).apply(sum); ``void f(KeyType &key, ValueType &value)`` The return type will be void. .. code-block:: c auto print_sum = [](const RegressionDataset<double>& value) { std::cout << value.targets.mean.sum() << std::endl; }; dataset.group_by(my_criteria).apply(print_sum); For example, we could do something like: .. code-block:: c RegressionDataset<Bar> dataset; auto get_foo = [](const Bar &bar) { return Foo(bar); }; dataset.group_by(get_foo).apply(f); In this situation the ``ValueType = RegressionDataset<Bar>`` and ``KeyType = Foo``. ``auto`` can be used for the argument types in which case a single argument is assumed to be a ``ValueType``. For example, .. code-block:: c dataset.group_by(get_foo).apply([](const auto &data) {return f(data);}); ----------------- Combine ----------------- In the apply step there are very few restrictions on what can be returned from an apply function. When it comes to the combine step however, there are a few restrictions. Namely combine only supports ``RegressionDataset<>``, ``std::vector<>`` and ``double`` types. In this example you can see how you could start with a dataset, split it into groups compute some metric for each group and recombine into a vector of the results: .. code-block:: c auto compute_something = [](const RegressionDataset<Bar> &data) -> double { double something = data.features[0].foo; return something; } Eigen::VectorXd results = dataset.group_by(get_group).apply(compute_something).combine(); -------------------- Motivational Example -------------------- One common pattern when working with data is the need to break a dataset apart and do something with each of the resulting groups. For example, in the ``group_by_example`` we built a dataset which contains a bunch of people defined by their age and gender: .. code-block:: c struct Person { enum Gender {FEMALE, MALE}; Gender gender; int age; }; In ``albatross`` we store data using the ``RegressionDataset<>`` type which consists of a vector of features and an ``Eigen::VectorXd`` of targets. You can think of the features as an object containing all the information you need to describe some measurement and the ``targets`` as containing the actual measurements. We might then, for example, want to take our dataset of people and print out the average salary depending on the gender. Here's how you might do that manually: .. code-block:: c std::size_t female_count = 0; double female_average = 0.; std::size_t male_count = 0; double male_average = 0.; for (std::size_t i = 0; i < dataset.size(); ++i) { if (dataset.features[i].gender == Person::Female) { female_average += dataset.targets.mean[i]; ++female_count; } else { male_average += dataset.targets.mean[i]; ++male_count; } } female_average /= female_count; male_average /= male_count; std::cout << "female : " << female_average << std::endl; std::cout << "male : " << male_average << std::endl; There are several issues with this though. If there are no males (or females) in the dataset we'll end up dividing by zero. Also, if you are dealing with more than two options the details of the for loop (which are already a bit difficult to follow) could get very complicated. Instead we can use the ``group_by`` and ``apply`` methods to come up with an alternative approach: .. code-block:: c const RegressionDataset<Person> dataset = make_data(); auto get_gender = [](const auto &f){return f.gender;}; auto print_average_salary = [](const auto &gender, const auto &dataset) { std::cout << to_string(gender) << " : " << dataset.targets.mean.mean() << std::endl; }; dataset.group_by(get_gender).apply(print_average_salary); Not only will this avoid the pitfall of missing groups, but the split-apply approach forces the use of smaller helper functions which ends up making everything much easier to read.
32.768889
180
0.689814
4327864c8c15a4d156b9eb11c3bc716690ff6f07
3,266
rst
reStructuredText
blogweb/gsoc/georgeLisca/roadmap.rst
hacke1978/blog
026bb03e8207d569b5e1393ec5592daaf4506c7d
[ "BSD-3-Clause" ]
5
2017-11-02T19:07:07.000Z
2020-05-25T09:34:15.000Z
blogweb/gsoc/georgeLisca/roadmap.rst
hacke1978/blog
026bb03e8207d569b5e1393ec5592daaf4506c7d
[ "BSD-3-Clause" ]
3
2015-12-02T17:05:21.000Z
2020-04-18T08:34:43.000Z
blogweb/gsoc/georgeLisca/roadmap.rst
hacke1978/blog
026bb03e8207d569b5e1393ec5592daaf4506c7d
[ "BSD-3-Clause" ]
2
2015-11-30T15:35:33.000Z
2016-04-09T16:37:04.000Z
Roadmap ======= .. _georgeLisca_roadmap: Abstract -------- During the summer we will work out a general framework for registration and SLAM in the PCL. Overview -------- The PCL contains many algorithms that are usable in the registration and SLAM context like features, kd trees and octrees. What is missing, is a general framework to combine all of it and integrate it with other SLAM algorithms from literature. This project will try to bring all of this together to create a new SLAM experience. For this we will look into different approaches out there and put them into the PCL context, meaning mainly getting familiar with the needed algorithms, integrate them into the PCL and add them to the SLAM framework. Part 0: Getting into the PCL ---------------------------- * work through the `tutorials <http://www.pointclouds.org/documentation/tutorials/>`_ for PCL * get familiar with `SLAM <http://en.wikipedia.org/wiki/Simultaneous_localization_and_mapping>`_, ICP and graph SLAM variants * write a registration prototype using the ICP in PCL Part I: GICP ------------ As a starting point we will integrate `GICP <http://stanford.edu/~avsegal/generalized_icp.html>`_ into the PCL. Work Plan ^^^^^^^^^ * get GICP running * write a wrapper to use it from inside the PCL and that does the data structure conversion * integrate it with the ICP implementation in the PCL * write unit tests * write documentation * bonus: visualize the registration process Milestone ^^^^^^^^^ A visualize of the registration using GICP. the optimal result would be a small program loading a set of .pcd files, visualize the registration one by one and prints the resulting transformations to screen as well as writing a registered point cloud to the hard drive. Part II: RGBD-SLAM ------------------ RGBD-SLAM was one of the participants in the `ROS 3D <http://www.ros.org/wiki/openni/Contests/ROS%203D>`_ contest and by that time it used the PCL to do its computations. Due to licensing restrictions we can not integrate it right away but we can bring in all dependencies and re implement the rest. Work Plan ^^^^^^^^^ * get `RGBD-SLAM <http://www.ros.org/wiki/openni/Contests/ROS%203D/RGBD-6D-SLAM>`_ running * record a test data set * find usable alternatives for its dependencies or write a wrapper around them * port it to PCL version 1 * test it using the recorded data * make it work using live Kinect data * write unit tests * write documentation Milestone ^^^^^^^^^ A small application using data from the Kinect showing the registered point cloud as seen in the `video <http://www.ros.org/wiki/openni/Contests/ROS%203D/RGBD-6D-SLAM#Video>`_. Part III: Integrate new Features -------------------------------- By now :ref:`Pararth Shah <pararthshah_roadmap>`, how is working on feature base registration, should have something to test. So we should try to integrate it into the SLAM process. Work Plan ^^^^^^^^^ * learn how to use the new code * write an example application to use it * integrate it into the pipeline * find a good test case Milestone ^^^^^^^^^ Final Result ------------ An awesome SLAM framework using all kinds of nifty algorithms capable of processing everything from Kinect to large laser scanner data as well as a tutorial how to use it.
44.739726
546
0.744948
c2cf9180a28ea496236ac6d5b9a4cbd9ec79d35b
182
rst
reStructuredText
docs/source/apis/dependency/index.rst
hjjvandam/CMakePackagingProject
ae88cf4d54cf7738e0c2b4bd0bac6f1452b8ce46
[ "Apache-2.0" ]
null
null
null
docs/source/apis/dependency/index.rst
hjjvandam/CMakePackagingProject
ae88cf4d54cf7738e0c2b4bd0bac6f1452b8ce46
[ "Apache-2.0" ]
null
null
null
docs/source/apis/dependency/index.rst
hjjvandam/CMakePackagingProject
ae88cf4d54cf7738e0c2b4bd0bac6f1452b8ce46
[ "Apache-2.0" ]
null
null
null
dependency ########## Contents ======== .. toctree:: :maxdepth: 2 cpp_helper_target_made cpp_set_helper_target cpp_get_dependency_dir cpp_get_dependency_root
12.133333
27
0.67033
a54a349d5680a02d489970537bdc66a6cfb59f36
2,344
rst
reStructuredText
docs/api/_autosummary/pynrc.reduce.calib.nircam_cal.rst
JarronL/pyNRC
0354f0635dd4c5391ca3a769fa9e5ead83661c30
[ "MIT" ]
6
2017-01-09T05:11:11.000Z
2022-02-25T18:30:41.000Z
docs/api/_autosummary/pynrc.reduce.calib.nircam_cal.rst
JarronL/pyNRC
0354f0635dd4c5391ca3a769fa9e5ead83661c30
[ "MIT" ]
24
2017-05-25T04:45:47.000Z
2022-02-25T18:31:48.000Z
docs/api/_autosummary/pynrc.reduce.calib.nircam_cal.rst
JarronL/pyNRC
0354f0635dd4c5391ca3a769fa9e5ead83661c30
[ "MIT" ]
11
2017-01-27T22:40:55.000Z
2021-03-30T18:41:46.000Z
pynrc.reduce.calib.nircam\_cal ============================== .. currentmodule:: pynrc.reduce.calib .. autoclass:: nircam_cal :members: :inherited-members: :show-inheritance: .. automethod:: __init__ .. rubric:: Methods .. autosummary:: ~nircam_cal.__init__ ~nircam_cal.calc_cds_noise ~nircam_cal.deconvolve_supers ~nircam_cal.get_cds_dict ~nircam_cal.get_column_variations ~nircam_cal.get_dark_slope_image ~nircam_cal.get_effective_noise ~nircam_cal.get_ipc ~nircam_cal.get_ktc_noise ~nircam_cal.get_linear_coeffs ~nircam_cal.get_nonlinear_coeffs ~nircam_cal.get_pixel_slope_averages ~nircam_cal.get_power_spectrum ~nircam_cal.get_ref_pixel_noise ~nircam_cal.get_super_bias_init ~nircam_cal.get_super_bias_update ~nircam_cal.get_super_dark_ramp ~nircam_cal.get_super_flats ~nircam_cal.plot_bias_darks ~nircam_cal.plot_cds_noise ~nircam_cal.plot_dark_distribution ~nircam_cal.plot_dark_overview ~nircam_cal.plot_dark_ramps ~nircam_cal.plot_dark_ramps_ch ~nircam_cal.plot_eff_noise ~nircam_cal.plot_eff_noise_patterns ~nircam_cal.plot_ipc_ppc ~nircam_cal.plot_power_spectrum ~nircam_cal.plot_reset_overview .. rubric:: Attributes .. autosummary:: ~nircam_cal.allfiles ~nircam_cal.cds_act_dict ~nircam_cal.cds_ref_dict ~nircam_cal.chsize ~nircam_cal.column_prob_bad ~nircam_cal.column_variations ~nircam_cal.dark_ramp_dict ~nircam_cal.dark_shape ~nircam_cal.datadir ~nircam_cal.eff_noise_dict ~nircam_cal.ipc_alpha_frac ~nircam_cal.kernel_ipc ~nircam_cal.kernel_ppc ~nircam_cal.ktc_noise ~nircam_cal.lindir ~nircam_cal.linfiles ~nircam_cal.mask_act ~nircam_cal.mask_channels ~nircam_cal.mask_ref ~nircam_cal.nchan ~nircam_cal.nchans ~nircam_cal.outdir ~nircam_cal.pow_spec_dict ~nircam_cal.ppc_frac ~nircam_cal.ref_pixel_dict ~nircam_cal.super_bias ~nircam_cal.super_bias_deconv ~nircam_cal.super_dark ~nircam_cal.super_dark_deconv ~nircam_cal.super_dark_ramp ~nircam_cal.temperature_dict ~nircam_cal.time_arr
26.044444
42
0.694966
007db59fd02ee16c4310bd20eccde62262012707
14,607
prg
xBase
source/ActiveQt/QAxBase.prg
lediz/qt5xhb-cpp11
8bc6f1f4f986d4315cca2accc246a3419dd3fc9c
[ "MIT" ]
null
null
null
source/ActiveQt/QAxBase.prg
lediz/qt5xhb-cpp11
8bc6f1f4f986d4315cca2accc246a3419dd3fc9c
[ "MIT" ]
null
null
null
source/ActiveQt/QAxBase.prg
lediz/qt5xhb-cpp11
8bc6f1f4f986d4315cca2accc246a3419dd3fc9c
[ "MIT" ]
null
null
null
/* Qt5xHb/C++11 - Bindings libraries for Harbour/xHarbour and Qt Framework 5 Copyright (C) 2020 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com> */ /* DO NOT EDIT THIS FILE - the content was created using a source code generator */ #include "hbclass.ch" #ifndef QT5XHB_NO_REQUESTS REQUEST QAXOBJECT REQUEST QVARIANT #endif CLASS QAxBase DATA pointer DATA self_destruction INIT .F. METHOD delete METHOD asVariant METHOD clear METHOD control METHOD disableClassInfo METHOD disableEventSink METHOD disableMetaObject METHOD dynamicCall METHOD generateDocumentation METHOD isNull METHOD propertyWritable METHOD querySubObject METHOD setControl METHOD setPropertyWritable METHOD verbs METHOD classContext METHOD setClassContext METHOD newFrom METHOD newFromObject METHOD newFromPointer METHOD selfDestruction METHOD setSelfDestruction DESTRUCTOR destroyObject END CLASS PROCEDURE destroyObject() CLASS QAxBase IF ::self_destruction ::delete() ENDIF RETURN #pragma BEGINDUMP #include <QtCore/Qt> #ifndef __XHARBOUR__ #include <ActiveQt/QAxBase> #endif #include "qt5xhb_common.h" #include "qt5xhb_macros.h" #include "qt5xhb_utils.h" #ifdef __XHARBOUR__ #include <ActiveQt/QAxBase> #endif #include <ActiveQt/QAxObject> #include <QtCore/QStringList> HB_FUNC_STATIC( QAXBASE_DELETE ) { auto obj = (QAxBase *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj != nullptr ) { delete obj; obj = nullptr; PHB_ITEM self = hb_stackSelfItem(); PHB_ITEM ptr = hb_itemPutPtr( nullptr, nullptr ); hb_objSendMsg( self, "_pointer", 1, ptr ); hb_itemRelease( ptr ); } hb_itemReturn( hb_stackSelfItem() ); } /* QVariant asVariant() const */ HB_FUNC_STATIC( QAXBASE_ASVARIANT ) { auto obj = (QAxBase *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR(0) ) { #endif auto ptr = new QVariant( obj->asVariant() ); Qt5xHb::createReturnClass( ptr, "QVARIANT", true ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } } /* virtual void clear() */ HB_FUNC_STATIC( QAXBASE_CLEAR ) { auto obj = (QAxBase *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR(0) ) { #endif obj->clear(); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } hb_itemReturn( hb_stackSelfItem() ); } /* QString control() const */ HB_FUNC_STATIC( QAXBASE_CONTROL ) { auto obj = (QAxBase *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR(0) ) { #endif RQSTRING( obj->control() ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } } /* void disableClassInfo() */ HB_FUNC_STATIC( QAXBASE_DISABLECLASSINFO ) { auto obj = (QAxBase *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR(0) ) { #endif obj->disableClassInfo(); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } hb_itemReturn( hb_stackSelfItem() ); } /* void disableEventSink() */ HB_FUNC_STATIC( QAXBASE_DISABLEEVENTSINK ) { auto obj = (QAxBase *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR(0) ) { #endif obj->disableEventSink(); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } hb_itemReturn( hb_stackSelfItem() ); } /* void disableMetaObject() */ HB_FUNC_STATIC( QAXBASE_DISABLEMETAOBJECT ) { auto obj = (QAxBase *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR(0) ) { #endif obj->disableMetaObject(); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } hb_itemReturn( hb_stackSelfItem() ); } /* QVariant dynamicCall( const char * function, const QVariant & var1 = QVariant(), const QVariant & var2 = QVariant(), const QVariant & var3 = QVariant(), const QVariant & var4 = QVariant(), const QVariant & var5 = QVariant(), const QVariant & var6 = QVariant(), const QVariant & var7 = QVariant(), const QVariant & var8 = QVariant() ) */ void QAxBase_dynamicCall1() { auto obj = (QAxBase *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj != nullptr ) { auto ptr = new QVariant( obj->dynamicCall( PCONSTCHAR(1), ISNIL(2)? QVariant() : *(QVariant *) Qt5xHb::itemGetPtr(2), ISNIL(3)? QVariant() : *(QVariant *) Qt5xHb::itemGetPtr(3), ISNIL(4)? QVariant() : *(QVariant *) Qt5xHb::itemGetPtr(4), ISNIL(5)? QVariant() : *(QVariant *) Qt5xHb::itemGetPtr(5), ISNIL(6)? QVariant() : *(QVariant *) Qt5xHb::itemGetPtr(6), ISNIL(7)? QVariant() : *(QVariant *) Qt5xHb::itemGetPtr(7), ISNIL(8)? QVariant() : *(QVariant *) Qt5xHb::itemGetPtr(8), ISNIL(9)? QVariant() : *(QVariant *) Qt5xHb::itemGetPtr(9) ) ); Qt5xHb::createReturnClass( ptr, "QVARIANT", true ); } } /* QVariant dynamicCall( const char * function, QList<QVariant> & vars ) */ void QAxBase_dynamicCall2() { auto obj = (QAxBase *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj != nullptr ) { auto ptr = new QVariant( obj->dynamicCall( PCONSTCHAR(1), PQVARIANTLIST(2) ) ); Qt5xHb::createReturnClass( ptr, "QVARIANT", true ); } } HB_FUNC_STATIC( QAXBASE_DYNAMICCALL ) { if( ISBETWEEN(1,9) && ISCHAR(1) && (ISQVARIANT(2)||ISNIL(2)) && (ISQVARIANT(3)||ISNIL(3)) && (ISQVARIANT(4)||ISNIL(4)) && (ISQVARIANT(5)||ISNIL(5)) && (ISQVARIANT(6)||ISNIL(6)) && (ISQVARIANT(7)||ISNIL(7)) && (ISQVARIANT(8)||ISNIL(8)) && (ISQVARIANT(9)||ISNIL(9)) ) { QAxBase_dynamicCall1(); } else if( ISNUMPAR(2) && ISCHAR(1) && ISARRAY(2) ) { QAxBase_dynamicCall2(); } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } } /* QString generateDocumentation() */ HB_FUNC_STATIC( QAXBASE_GENERATEDOCUMENTATION ) { auto obj = (QAxBase *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR(0) ) { #endif RQSTRING( obj->generateDocumentation() ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } } /* bool isNull() const */ HB_FUNC_STATIC( QAXBASE_ISNULL ) { auto obj = (QAxBase *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR(0) ) { #endif RBOOL( obj->isNull() ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } } /* virtual bool propertyWritable( const char * prop ) const */ HB_FUNC_STATIC( QAXBASE_PROPERTYWRITABLE ) { auto obj = (QAxBase *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR(1) && ISCHAR(1) ) { #endif RBOOL( obj->propertyWritable( PCONSTCHAR(1) ) ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } } /* QAxObject * querySubObject( const char * name, const QVariant & var1 = QVariant(), const QVariant & var2 = QVariant(), const QVariant & var3 = QVariant(), const QVariant & var4 = QVariant(), const QVariant & var5 = QVariant(), const QVariant & var6 = QVariant(), const QVariant & var7 = QVariant(), const QVariant & var8 = QVariant() ) */ void QAxBase_querySubObject1() { auto obj = (QAxBase *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj != nullptr ) { QAxObject * ptr = obj->querySubObject( PCONSTCHAR(1), ISNIL(2)? QVariant() : *(QVariant *) Qt5xHb::itemGetPtr(2), ISNIL(3)? QVariant() : *(QVariant *) Qt5xHb::itemGetPtr(3), ISNIL(4)? QVariant() : *(QVariant *) Qt5xHb::itemGetPtr(4), ISNIL(5)? QVariant() : *(QVariant *) Qt5xHb::itemGetPtr(5), ISNIL(6)? QVariant() : *(QVariant *) Qt5xHb::itemGetPtr(6), ISNIL(7)? QVariant() : *(QVariant *) Qt5xHb::itemGetPtr(7), ISNIL(8)? QVariant() : *(QVariant *) Qt5xHb::itemGetPtr(8), ISNIL(9)? QVariant() : *(QVariant *) Qt5xHb::itemGetPtr(9) ); Qt5xHb::createReturnQObjectClass( ptr, "QAXOBJECT" ); } } /* QAxObject * querySubObject( const char * name, QList<QVariant> & vars ) */ void QAxBase_querySubObject2() { auto obj = (QAxBase *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj != nullptr ) { QAxObject * ptr = obj->querySubObject( PCONSTCHAR(1), PQVARIANTLIST(2) ); Qt5xHb::createReturnQObjectClass( ptr, "QAXOBJECT" ); } } HB_FUNC_STATIC( QAXBASE_QUERYSUBOBJECT ) { if( ISBETWEEN(1,9) && ISCHAR(1) && (ISQVARIANT(2)||ISNIL(2)) && (ISQVARIANT(3)||ISNIL(3)) && (ISQVARIANT(4)||ISNIL(4)) && (ISQVARIANT(5)||ISNIL(5)) && (ISQVARIANT(6)||ISNIL(6)) && (ISQVARIANT(7)||ISNIL(7)) && (ISQVARIANT(8)||ISNIL(8)) && (ISQVARIANT(9)||ISNIL(9)) ) { QAxBase_querySubObject1(); } else if( ISNUMPAR(2) && ISCHAR(1) && ISARRAY(2) ) { QAxBase_querySubObject2(); } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } } /* bool setControl( const QString & ) */ HB_FUNC_STATIC( QAXBASE_SETCONTROL ) { auto obj = (QAxBase *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR(1) && ISCHAR(1) ) { #endif RBOOL( obj->setControl( PQSTRING(1) ) ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } } /* virtual void setPropertyWritable( const char * prop, bool ok ) */ HB_FUNC_STATIC( QAXBASE_SETPROPERTYWRITABLE ) { auto obj = (QAxBase *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR(2) && ISCHAR(1) && ISLOG(2) ) { #endif obj->setPropertyWritable( PCONSTCHAR(1), PBOOL(2) ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } hb_itemReturn( hb_stackSelfItem() ); } /* QStringList verbs() const */ HB_FUNC_STATIC( QAXBASE_VERBS ) { auto obj = (QAxBase *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR(0) ) { #endif RQSTRINGLIST( obj->verbs() ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } } /* unsigned long classContext() const */ HB_FUNC_STATIC( QAXBASE_CLASSCONTEXT ) { #if (QT_VERSION >= QT_VERSION_CHECK(5,13,0)) auto obj = (QAxBase *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR(0) ) { #endif RUNSIGNEDLONG( obj->classContext() ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } #endif } /* void setClassContext( unsigned long classContext ) */ HB_FUNC_STATIC( QAXBASE_SETCLASSCONTEXT ) { #if (QT_VERSION >= QT_VERSION_CHECK(5,13,0)) auto obj = (QAxBase *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR(1) && ISNUM(1) ) { #endif obj->setClassContext( PUNSIGNEDLONG(1) ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } hb_itemReturn( hb_stackSelfItem() ); #endif } HB_FUNC_STATIC( QAXBASE_NEWFROM ) { PHB_ITEM self = hb_stackSelfItem(); if( hb_pcount() == 1 && ISOBJECT(1) ) { PHB_ITEM ptr = hb_itemPutPtr( nullptr, (void *) hb_itemGetPtr( hb_objSendMsg( hb_param(1, HB_IT_OBJECT ), "POINTER", 0 ) ) ); hb_objSendMsg( self, "_pointer", 1, ptr ); hb_itemRelease( ptr ); PHB_ITEM des = hb_itemPutL( nullptr, false ); hb_objSendMsg( self, "_self_destruction", 1, des ); hb_itemRelease( des ); } else if( hb_pcount() == 1 && ISPOINTER(1) ) { PHB_ITEM ptr = hb_itemPutPtr( nullptr, (void *) hb_itemGetPtr( hb_param(1, HB_IT_POINTER ) ) ); hb_objSendMsg( self, "_pointer", 1, ptr ); hb_itemRelease( ptr ); PHB_ITEM des = hb_itemPutL( nullptr, false ); hb_objSendMsg( self, "_self_destruction", 1, des ); hb_itemRelease( des ); } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } hb_itemReturn( self ); } HB_FUNC_STATIC( QAXBASE_NEWFROMOBJECT ) { HB_FUNC_EXEC( QAXBASE_NEWFROM ); } HB_FUNC_STATIC( QAXBASE_NEWFROMPOINTER ) { HB_FUNC_EXEC( QAXBASE_NEWFROM ); } HB_FUNC_STATIC( QAXBASE_SELFDESTRUCTION ) { hb_retl( (bool) hb_itemGetL( hb_objSendMsg( hb_stackSelfItem(), "SELF_DESTRUCTION", 0 ) ) ); } HB_FUNC_STATIC( QAXBASE_SETSELFDESTRUCTION ) { PHB_ITEM self = hb_stackSelfItem(); if( hb_pcount() == 1 && ISLOG(1) ) { PHB_ITEM des = hb_itemPutL( nullptr, hb_parl(1) ); hb_objSendMsg( self, "_self_destruction", 1, des ); hb_itemRelease( des ); } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } hb_itemReturn( self ); } #pragma ENDDUMP
24.345
546
0.649483
872031f80b65f514fa8cb6980ff0c8a2468150a1
3,969
prg
xBase
source/QtMultimedia/QMediaContainerControl.prg
lediz/qt5xhb-cpp11
8bc6f1f4f986d4315cca2accc246a3419dd3fc9c
[ "MIT" ]
null
null
null
source/QtMultimedia/QMediaContainerControl.prg
lediz/qt5xhb-cpp11
8bc6f1f4f986d4315cca2accc246a3419dd3fc9c
[ "MIT" ]
null
null
null
source/QtMultimedia/QMediaContainerControl.prg
lediz/qt5xhb-cpp11
8bc6f1f4f986d4315cca2accc246a3419dd3fc9c
[ "MIT" ]
null
null
null
/* Qt5xHb/C++11 - Bindings libraries for Harbour/xHarbour and Qt Framework 5 Copyright (C) 2020 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com> */ /* DO NOT EDIT THIS FILE - the content was created using a source code generator */ #include "hbclass.ch" #ifndef QT5XHB_NO_REQUESTS #endif CLASS QMediaContainerControl INHERIT QMediaControl METHOD delete METHOD containerDescription METHOD containerFormat METHOD setContainerFormat METHOD supportedContainers DESTRUCTOR destroyObject END CLASS PROCEDURE destroyObject() CLASS QMediaContainerControl IF ::self_destruction ::delete() ENDIF RETURN #pragma BEGINDUMP #include <QtCore/Qt> #ifndef __XHARBOUR__ #include <QtMultimedia/QMediaContainerControl> #endif #include "qt5xhb_common.h" #include "qt5xhb_macros.h" #include "qt5xhb_utils.h" #include "qt5xhb_events.h" #include "qt5xhb_signals.h" #ifdef __XHARBOUR__ #include <QtMultimedia/QMediaContainerControl> #endif #include <QtCore/QStringList> /* explicit QMediaContainerControl(QObject *parent = nullptr) [protected] */ /* virtual ~QMediaContainerControl() */ HB_FUNC_STATIC( QMEDIACONTAINERCONTROL_DELETE ) { auto obj = (QMediaContainerControl *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj != nullptr ) { Qt5xHb::Events_disconnect_all_events( obj, true ); Qt5xHb::Signals_disconnect_all_signals( obj, true ); delete obj; obj = nullptr; PHB_ITEM self = hb_stackSelfItem(); PHB_ITEM ptr = hb_itemPutPtr( nullptr, nullptr ); hb_objSendMsg( self, "_pointer", 1, ptr ); hb_itemRelease( ptr ); } hb_itemReturn( hb_stackSelfItem() ); } /* virtual QString containerDescription(const QString & formatMimeType) const = 0 */ HB_FUNC_STATIC( QMEDIACONTAINERCONTROL_CONTAINERDESCRIPTION ) { auto obj = (QMediaContainerControl *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR(1) && ISCHAR(1) ) { #endif RQSTRING( obj->containerDescription( PQSTRING(1) ) ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } } /* virtual QString containerFormat() const = 0 */ HB_FUNC_STATIC( QMEDIACONTAINERCONTROL_CONTAINERFORMAT ) { auto obj = (QMediaContainerControl *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR(0) ) { #endif RQSTRING( obj->containerFormat() ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } } /* virtual void setContainerFormat(const QString & format) = 0 */ HB_FUNC_STATIC( QMEDIACONTAINERCONTROL_SETCONTAINERFORMAT ) { auto obj = (QMediaContainerControl *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR(1) && ISCHAR(1) ) { #endif obj->setContainerFormat( PQSTRING(1) ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } hb_itemReturn( hb_stackSelfItem() ); } /* virtual QStringList supportedContainers() const = 0 */ HB_FUNC_STATIC( QMEDIACONTAINERCONTROL_SUPPORTEDCONTAINERS ) { auto obj = (QMediaContainerControl *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR(0) ) { #endif RQSTRINGLIST( obj->supportedContainers() ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } } #pragma ENDDUMP
21.928177
87
0.692114
3118ad915929e568f09958e9bf107856e0aaeee2
169
prg
xBase
Tests/Applications/C175/Prg/C175.prg
SHirsch78/XSharpDev
dd0b7b72d44f51d67603ac75e6e4adcc4a0aa5d5
[ "Apache-2.0" ]
29
2019-10-17T17:51:29.000Z
2022-03-02T01:59:30.000Z
Tests/Applications/C175/Prg/C175.prg
SHirsch78/XSharpDev
dd0b7b72d44f51d67603ac75e6e4adcc4a0aa5d5
[ "Apache-2.0" ]
7
2020-07-06T08:28:19.000Z
2022-03-09T09:36:39.000Z
Tests/Applications/C175/Prg/C175.prg
SHirsch78/XSharpDev
dd0b7b72d44f51d67603ac75e6e4adcc4a0aa5d5
[ "Apache-2.0" ]
10
2019-10-18T07:33:53.000Z
2022-03-09T17:14:39.000Z
// 175. error XS1503: Argument 1: cannot convert from 'uint' to 'string' FUNCTION Start() AS VOID LOCAL nAlias AS DWORD nAlias := Select("test.dbf") (nAlias)->DBSkip()
24.142857
72
0.710059
dcbab0188b078e5aaa75af7981423ce70a10e0dc
554
prg
xBase
Runtime/VOSDK/Source/VOSDK/RDD_Classes_SDK/DBSelIndex.prg
JohanNel/XSharpPublic
cea3ea0c65dedcb6341cb1747046711625a5019b
[ "Apache-2.0" ]
null
null
null
Runtime/VOSDK/Source/VOSDK/RDD_Classes_SDK/DBSelIndex.prg
JohanNel/XSharpPublic
cea3ea0c65dedcb6341cb1747046711625a5019b
[ "Apache-2.0" ]
null
null
null
Runtime/VOSDK/Source/VOSDK/RDD_Classes_SDK/DBSelIndex.prg
JohanNel/XSharpPublic
cea3ea0c65dedcb6341cb1747046711625a5019b
[ "Apache-2.0" ]
null
null
null
CLASS DBSelectionIndex PROTECT oServer AS DBSERVER PROTECT cExpression AS STRING PROTECT cbExpression AS _CODEBLOCK PROTECT nSelect AS INT METHOD Eval( ) LOCAL nOldSelect AS DWORD LOCAL xRet AS USUAL VODBSelect( DWORD(SELF:nSelect), @nOldSelect ) xRet := Eval( SELF:cbExpression ) VODBSetSelect( LONGINT(nOldSelect) ) RETURN xRet CONSTRUCTOR( oDBServer, cExp, nWorkArea ) SELF:oServer := oDBServer SELF:cExpression := cExp SELF:cbExpression := MExec( MCompile( "{ || " + cExp + " }" ) ) SELF:nSelect := nWorkArea RETURN END CLASS
21.307692
64
0.736462
43a878a4ca29a0c2608909225276fa946bd39636
3,696
prg
xBase
projects/android/assets/main.prg
Cpasjuste/bennugd-monolithic
60ee3389efcf9b402d66035e87f33d17d70cbd83
[ "Zlib" ]
null
null
null
projects/android/assets/main.prg
Cpasjuste/bennugd-monolithic
60ee3389efcf9b402d66035e87f33d17d70cbd83
[ "Zlib" ]
1
2021-12-08T11:02:35.000Z
2021-12-08T13:29:52.000Z
projects/android/assets/main.prg
Cpasjuste/bennugd-monolithic
60ee3389efcf9b402d66035e87f33d17d70cbd83
[ "Zlib" ]
1
2022-01-18T21:28:13.000Z
2022-01-18T21:28:13.000Z
/** * Android test * Joseba García Etxebarria - (C) 2012 * Use as you wish */ import "mod_video" import "mod_map" import "mod_draw" import "mod_say" import "mod_file" import "mod_text" import "mod_wm" import "mod_mouse" import "mod_joy" GLOBAL // Set to your liking width = 600; height = 800; quit = 0; Process Main() Private int song=0, num_fingers=0, num_joys=0, i=0; int g_w=0, g_h=0; int text1=0, text2=0, text3=0, text4=0; string text; Begin // Get the real screen resolution we're running at width = graphic_info(0, 0, G_WIDTH); height = graphic_info(0, 0, G_HEIGHT); // Set scale_resolution to width/2xheight/2 scale_resolution = width*10000+height; scale_resolution_aspectratio=SRA_PRESERVE; set_mode(320, 480, 32); // Paint the background red so that you know what it looks like drawing_color( rgb(255,0,0) ); drawing_map( 0, 0 ); draw_box(0, 0, width, height); // Write some debug info to the screen num_joys = joy_number(); write(0, 320, 0, 2, "Width: "+width+" Height:"+height); write(0, 320, 10, 2, "scale_resolution: 0"+scale_resolution); write(0, 160, 120, 4, "Detected joysticks: "+num_joys); for(i=0; i<num_joys; i++) write(0, 160, 130+10*i, 4, "Joy "+i+": "+joy_name(i)+" Axes: "+joy_numaxes(i)); end; /* Some touchscreens cannot detect all 5 fingers at once */ while(num_fingers < 4 && focus_status == 1) // Position the pointer x = mouse.x; y = mouse.y; // Write pointer position according to both mod_mouse and mod_multi text2 = write(0, 0, 10, 0, "Mouse: "+mouse.x+"x"+mouse.y); if(mouse.right) point_set(0, graph, 0, 0, 0); end; text = ""; if(joy_getaxis(0, 0) < -10000) text += " JOY.LEFT "+joy_getaxis(0, 0); end if(joy_getaxis(0, 0) > 10000) text += " JOY.RIGHT "+joy_getaxis(0, 0); end if(joy_getaxis(0, 1) < -10000) text += " JOY.UP "+joy_getaxis(0, 1); end if(joy_getaxis(0, 1) > 10000) text += " JOY.DOWN "+joy_getaxis(0, 1); end if(joy_getbutton(0, 13)) text += " LT (13) "; end if(joy_getbutton(0,14)) text += " RT (14) "; end if(joy_getbutton(0,0)) text += " UP (0) "; end if(joy_getbutton(0,1)) text += " DOWN (1) "; end if(joy_getbutton(0,3)) text += " RIGHT (3) "; end if(joy_getbutton(0,2)) text += " LEFT (2) "; end if(joy_getbutton(0,5)) text += " O (5) "; end if(joy_getbutton(0,8)) text += " U (8) "; end if(joy_getbutton(0,9)) text += " Y (9) "; end if(joy_getbutton(0,6)) text += " A (6) "; end if(joy_getbutton(0,12)) text += " R1 (12) "; end if(joy_getbutton(0,11)) text += " L1 (11) "; end if(joy_getbutton(0,15)) text += " Joy press/L3 (15) "; end if(joy_getbutton(0,16)) text += " Joy press/R3 (16) "; end if(joy_getbutton(0,19)) text += " LT (19) "; end if(mouse.left) text += " M.LEFT "; end if(mouse.right) text += " M.RIGHT "; end if(mouse.middle) text += " M.MIDDLE "; end frame; delete_text(text1); delete_text(text2); delete_text(text3); delete_text(text4); End; unload_map(0, graph); quit = 1; say("Quitting"); End;
26.028169
87
0.515152
23a698e58877d774e942a1d996e381847e91c7f8
381
prg
xBase
Tests/Applications/C625/Prg/C625.prg
SHirsch78/XSharpDev
dd0b7b72d44f51d67603ac75e6e4adcc4a0aa5d5
[ "Apache-2.0" ]
29
2019-10-17T17:51:29.000Z
2022-03-02T01:59:30.000Z
Tests/Applications/C625/Prg/C625.prg
SHirsch78/XSharpDev
dd0b7b72d44f51d67603ac75e6e4adcc4a0aa5d5
[ "Apache-2.0" ]
7
2020-07-06T08:28:19.000Z
2022-03-09T09:36:39.000Z
Tests/Applications/C625/Prg/C625.prg
SHirsch78/XSharpDev
dd0b7b72d44f51d67603ac75e6e4adcc4a0aa5d5
[ "Apache-2.0" ]
10
2019-10-18T07:33:53.000Z
2022-03-09T17:14:39.000Z
// 625. Namespace aliases not working // error XS0246: The type or namespace name 'abc' could not be found (are you missing a using directive or an assembly reference?) USING abc := a.b.c BEGIN NAMESPACE a.b.c CLASS d END CLASS END NAMESPACE FUNCTION Start( ) AS VOID LOCAL oo AS a.b.c.d oo := a.b.c.d{} // ok LOCAL o AS abc.d o := abc.d{} // error ? o:ToString() RETURN
21.166667
130
0.682415
3cf715397c9c6ceadc2e261270386afdc3c9734f
1,936
prw
xBase
Estudos/Modelos/Terminal/AdvPL-master/Fontes/zLibPed.prw
ccpn1988/ADVPL
97b3f94353cce7cbeccddde3069a954e6696986f
[ "MIT" ]
1
2021-12-07T18:16:25.000Z
2021-12-07T18:16:25.000Z
Estudos/Modelos/Terminal/AdvPL-master/Fontes/zLibPed.prw
ccpn1988/ADVPL
97b3f94353cce7cbeccddde3069a954e6696986f
[ "MIT" ]
null
null
null
Estudos/Modelos/Terminal/AdvPL-master/Fontes/zLibPed.prw
ccpn1988/ADVPL
97b3f94353cce7cbeccddde3069a954e6696986f
[ "MIT" ]
null
null
null
//Bibliotecas #Include "Protheus.ch" /*/{Protheus.doc} zLibPed Função para liberação de pedido de venda @type function @author Atilio @since 28/08/2016 @version 1.0 @param cPedido, character, Número do Pedido @example u_zLibPed("000001") @obs Função utilizada para testes! /*/ User Function zLibPed(cPedido) Local aArea := GetArea() Local aAreaC5 := SC5->(GetArea()) Local aAreaC6 := SC6->(GetArea()) Local aAreaC9 := SC9->(GetArea()) Local aAreaAux := {} Local cBlqCred := " " Local cBlqEst := " " Local aLocal := {} Default cPedido := "" DbSelectArea('SC5') SC5->(DbSetOrder(1)) //C5_FILIAL + C5_NUM SC5->(DbGoTop()) DbSelectArea('SC6') SC6->(DbSetOrder(1)) //C6_FILIAL + C6_NUM + C6_ITEM SC6->(DbGoTop()) DbSelectArea('SC9') SC9->(DbSetOrder(1)) //C9_FILIAL + C9_PEDIDO + C9_ITEM SC9->(DbGoTop()) //Se conseguir posicionar no pedido If SC5->(DbSeek(FWxFilial('SC5') + cPedido)) //Se conseguir posicionar nos itens do pedido If SC6->(DbSeek(FWxFilial('SC6') + cPedido)) aAreaAux := SC6->(GetArea()) //Percorre todos os itens While ! SC6->(EoF()) .And. SC6->C6_FILIAL = FWxFilial('SC6') .And. SC6->C6_NUM == cPedido //Posiciona na liberação do item do pedido e estorna a liberação SC9->(DbSeek(FWxFilial('SC9')+SC6->C6_NUM+SC6->C6_ITEM)) While (!SC9->(Eof())) .AND. SC9->(C9_FILIAL+C9_PEDIDO+C9_ITEM) == FWxFilial('SC9')+SC6->(C6_NUM+C6_ITEM) SC9->(a460Estorna(.T.)) SC9->(DbSkip()) EndDo SC6->(DbSkip()) EndDo RecLock("SC5", .F.) C5_LIBEROK := "" SC5->(MsUnLock()) //Percorre todos os itens RestArea(aAreaAux) While ! SC6->(EoF()) .And. SC6->C6_FILIAL = FWxFilial('SC6') .And. SC6->C6_NUM == cPedido StaticCall(FATXFUN, MaGravaSC9, SC6->C6_QTDVEN, cBlqCred, cBlqEst, aLocal) SC6->(DbSkip()) EndDo EndIf EndIf RestArea(aAreaC9) RestArea(aAreaC6) RestArea(aAreaC5) RestArea(aArea) Return
25.473684
109
0.651343
7877c2b220910635412afb02a06b4a362e5e5648
16,291
prg
xBase
source/QtSql/QSqlRecord.prg
marcosgambeta/Qt5xHb-cpp11
aaae121a2cb36c88a8f205503073aee0da4fa069
[ "MIT" ]
null
null
null
source/QtSql/QSqlRecord.prg
marcosgambeta/Qt5xHb-cpp11
aaae121a2cb36c88a8f205503073aee0da4fa069
[ "MIT" ]
null
null
null
source/QtSql/QSqlRecord.prg
marcosgambeta/Qt5xHb-cpp11
aaae121a2cb36c88a8f205503073aee0da4fa069
[ "MIT" ]
null
null
null
/* Qt5xHb/C++11 - Bindings libraries for Harbour/xHarbour and Qt Framework 5 Copyright (C) 2022 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com> */ /* DO NOT EDIT THIS FILE - the content was created using a source code generator */ #include "hbclass.ch" #ifndef QT5XHB_NO_REQUESTS REQUEST QSQLFIELD REQUEST QVARIANT #endif CLASS QSqlRecord DATA pointer DATA self_destruction INIT .F. METHOD new METHOD delete METHOD append METHOD clear METHOD clearValues METHOD contains METHOD count METHOD field METHOD fieldName METHOD indexOf METHOD insert METHOD isEmpty METHOD isGenerated METHOD isNull METHOD remove METHOD replace METHOD setGenerated METHOD setNull METHOD setValue METHOD value METHOD keyValues METHOD newFrom METHOD newFromObject METHOD newFromPointer METHOD selfDestruction METHOD setSelfDestruction DESTRUCTOR destroyObject END CLASS PROCEDURE destroyObject() CLASS QSqlRecord IF ::self_destruction ::delete() ENDIF RETURN #pragma BEGINDUMP #include <QtCore/Qt> #ifndef __XHARBOUR__ #include <QtSql/QSqlRecord> #endif #include "qt5xhb_common.h" #include "qt5xhb_macros.h" #include "qt5xhb_utils.h" #ifdef __XHARBOUR__ #include <QtSql/QSqlRecord> #endif #include <QtCore/QVariant> #include <QtSql/QSqlField> HB_FUNC_STATIC( QSQLRECORD_NEW ) { if( ISNUMPAR( 0 ) ) { /* QSqlRecord() */ auto obj = new QSqlRecord(); Qt5xHb::returnNewObject( obj, true ); } else if( ISNUMPAR( 1 ) && ISQSQLRECORD( 1 ) ) { /* QSqlRecord( const QSqlRecord & other ) */ auto obj = new QSqlRecord( *PQSQLRECORD( 1 ) ); Qt5xHb::returnNewObject( obj, true ); } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } } HB_FUNC_STATIC( QSQLRECORD_DELETE ) { auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { delete obj; obj = nullptr; PHB_ITEM self = hb_stackSelfItem(); PHB_ITEM ptr = hb_itemPutPtr( nullptr, nullptr ); hb_objSendMsg( self, "_pointer", 1, ptr ); hb_itemRelease( ptr ); } hb_itemReturn( hb_stackSelfItem() ); } /* void append( const QSqlField & field ) */ HB_FUNC_STATIC( QSQLRECORD_APPEND ) { auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR( 1 ) && ISQSQLFIELD( 1 ) ) { #endif obj->append( *PQSQLFIELD( 1 ) ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } hb_itemReturn( hb_stackSelfItem() ); } /* void clear() */ HB_FUNC_STATIC( QSQLRECORD_CLEAR ) { auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR( 0 ) ) { #endif obj->clear(); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } hb_itemReturn( hb_stackSelfItem() ); } /* void clearValues() */ HB_FUNC_STATIC( QSQLRECORD_CLEARVALUES ) { auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR( 0 ) ) { #endif obj->clearValues(); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } hb_itemReturn( hb_stackSelfItem() ); } /* bool contains( const QString & name ) const */ HB_FUNC_STATIC( QSQLRECORD_CONTAINS ) { auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR( 1 ) && HB_ISCHAR( 1 ) ) { #endif RBOOL( obj->contains( PQSTRING( 1 ) ) ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } } /* int count() const */ HB_FUNC_STATIC( QSQLRECORD_COUNT ) { auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR( 0 ) ) { #endif RINT( obj->count() ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } } HB_FUNC_STATIC( QSQLRECORD_FIELD ) { if( ISNUMPAR( 1 ) && HB_ISNUM( 1 ) ) { /* QSqlField field( int index ) const */ auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { auto ptr = new QSqlField( obj->field( PINT( 1 ) ) ); Qt5xHb::createReturnClass( ptr, "QSQLFIELD", true ); } } else if( ISNUMPAR( 1 ) && HB_ISCHAR( 1 ) ) { /* QSqlField field( const QString & name ) const */ auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { auto ptr = new QSqlField( obj->field( PQSTRING( 1 ) ) ); Qt5xHb::createReturnClass( ptr, "QSQLFIELD", true ); } } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } } /* QString fieldName( int index ) const */ HB_FUNC_STATIC( QSQLRECORD_FIELDNAME ) { auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR( 1 ) && HB_ISNUM( 1 ) ) { #endif RQSTRING( obj->fieldName( PINT( 1 ) ) ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } } /* int indexOf( const QString & name ) const */ HB_FUNC_STATIC( QSQLRECORD_INDEXOF ) { auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR( 1 ) && HB_ISCHAR( 1 ) ) { #endif RINT( obj->indexOf( PQSTRING( 1 ) ) ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } } /* void insert( int pos, const QSqlField & field ) */ HB_FUNC_STATIC( QSQLRECORD_INSERT ) { auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR( 2 ) && HB_ISNUM( 1 ) && ISQSQLFIELD( 2 ) ) { #endif obj->insert( PINT( 1 ), *PQSQLFIELD( 2 ) ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } hb_itemReturn( hb_stackSelfItem() ); } /* bool isEmpty() const */ HB_FUNC_STATIC( QSQLRECORD_ISEMPTY ) { auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR( 0 ) ) { #endif RBOOL( obj->isEmpty() ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } } HB_FUNC_STATIC( QSQLRECORD_ISGENERATED ) { if( ISNUMPAR( 1 ) && HB_ISCHAR( 1 ) ) { /* bool isGenerated( const QString & name ) const */ auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { RBOOL( obj->isGenerated( PQSTRING( 1 ) ) ); } } else if( ISNUMPAR( 1 ) && HB_ISNUM( 1 ) ) { /* bool isGenerated( int index ) const */ auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { RBOOL( obj->isGenerated( PINT( 1 ) ) ); } } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } } HB_FUNC_STATIC( QSQLRECORD_ISNULL ) { if( ISNUMPAR( 1 ) && HB_ISCHAR( 1 ) ) { /* bool isNull( const QString & name ) const */ auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { RBOOL( obj->isNull( PQSTRING( 1 ) ) ); } } else if( ISNUMPAR( 1 ) && HB_ISNUM( 1 ) ) { /* bool isNull( int index ) const */ auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { RBOOL( obj->isNull( PINT( 1 ) ) ); } } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } } /* void remove( int pos ) */ HB_FUNC_STATIC( QSQLRECORD_REMOVE ) { auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR( 1 ) && HB_ISNUM( 1 ) ) { #endif obj->remove( PINT( 1 ) ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } hb_itemReturn( hb_stackSelfItem() ); } /* void replace( int pos, const QSqlField & field ) */ HB_FUNC_STATIC( QSQLRECORD_REPLACE ) { auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR( 2 ) && HB_ISNUM( 1 ) && ISQSQLFIELD( 2 ) ) { #endif obj->replace( PINT( 1 ), *PQSQLFIELD( 2 ) ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } hb_itemReturn( hb_stackSelfItem() ); } HB_FUNC_STATIC( QSQLRECORD_SETGENERATED ) { if( ISNUMPAR( 2 ) && HB_ISCHAR( 1 ) && HB_ISLOG( 2 ) ) { /* void setGenerated( const QString & name, bool generated ) */ auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { obj->setGenerated( PQSTRING( 1 ), PBOOL( 2 ) ); } hb_itemReturn( hb_stackSelfItem() ); } else if( ISNUMPAR( 2 ) && HB_ISNUM( 1 ) && HB_ISLOG( 2 ) ) { /* void setGenerated( int index, bool generated ) */ auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { obj->setGenerated( PINT( 1 ), PBOOL( 2 ) ); } hb_itemReturn( hb_stackSelfItem() ); } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } } HB_FUNC_STATIC( QSQLRECORD_SETNULL ) { if( ISNUMPAR( 1 ) && HB_ISNUM( 1 ) ) { /* void setNull( int index ) */ auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { obj->setNull( PINT( 1 ) ); } hb_itemReturn( hb_stackSelfItem() ); } else if( ISNUMPAR( 1 ) && HB_ISCHAR( 1 ) ) { /* void setNull( const QString & name ) */ auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { obj->setNull( PQSTRING( 1 ) ); } hb_itemReturn( hb_stackSelfItem() ); } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } } HB_FUNC_STATIC( QSQLRECORD_SETVALUE ) { if( ISNUMPAR( 2 ) && HB_ISNUM( 1 ) && ISQVARIANT( 2 ) ) { /* void setValue( int index, const QVariant & val ) */ auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { obj->setValue( PINT( 1 ), *PQVARIANT( 2 ) ); } hb_itemReturn( hb_stackSelfItem() ); } else if( ISNUMPAR( 2 ) && HB_ISCHAR( 1 ) && ISQVARIANT( 2 ) ) { /* void setValue( const QString & name, const QVariant & val ) */ auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { obj->setValue( PQSTRING( 1 ), *PQVARIANT( 2 ) ); } hb_itemReturn( hb_stackSelfItem() ); } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } } HB_FUNC_STATIC( QSQLRECORD_VALUE ) { if( ISNUMPAR( 1 ) && HB_ISNUM( 1 ) ) { /* QVariant value( int index ) const */ auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { auto ptr = new QVariant( obj->value( PINT( 1 ) ) ); Qt5xHb::createReturnClass( ptr, "QVARIANT", true ); } } else if( ISNUMPAR( 1 ) && HB_ISCHAR( 1 ) ) { /* QVariant value( const QString & name ) const */ auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { auto ptr = new QVariant( obj->value( PQSTRING( 1 ) ) ); Qt5xHb::createReturnClass( ptr, "QVARIANT", true ); } } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } } /* QSqlRecord keyValues( const QSqlRecord & keyFields ) const */ HB_FUNC_STATIC( QSQLRECORD_KEYVALUES ) { auto obj = static_cast< QSqlRecord * >( Qt5xHb::itemGetPtrStackSelfItem() ); if( obj != nullptr ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR( 1 ) && ISQSQLRECORD( 1 ) ) { #endif auto ptr = new QSqlRecord( obj->keyValues( *PQSQLRECORD( 1 ) ) ); Qt5xHb::createReturnClass( ptr, "QSQLRECORD", true ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } } HB_FUNC_STATIC( QSQLRECORD_NEWFROM ) { PHB_ITEM self = hb_stackSelfItem(); if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { PHB_ITEM ptr = hb_itemPutPtr( nullptr, static_cast< void * >( hb_itemGetPtr( hb_objSendMsg( hb_param( 1, HB_IT_OBJECT ), "POINTER", 0 ) ) ) ); hb_objSendMsg( self, "_pointer", 1, ptr ); hb_itemRelease( ptr ); PHB_ITEM des = hb_itemPutL( nullptr, false ); hb_objSendMsg( self, "_self_destruction", 1, des ); hb_itemRelease( des ); } else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) { PHB_ITEM ptr = hb_itemPutPtr( nullptr, static_cast< void * >( hb_itemGetPtr( hb_param( 1, HB_IT_POINTER ) ) ) ); hb_objSendMsg( self, "_pointer", 1, ptr ); hb_itemRelease( ptr ); PHB_ITEM des = hb_itemPutL( nullptr, false ); hb_objSendMsg( self, "_self_destruction", 1, des ); hb_itemRelease( des ); } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } hb_itemReturn( self ); } HB_FUNC_STATIC( QSQLRECORD_NEWFROMOBJECT ) { HB_FUNC_EXEC( QSQLRECORD_NEWFROM ); } HB_FUNC_STATIC( QSQLRECORD_NEWFROMPOINTER ) { HB_FUNC_EXEC( QSQLRECORD_NEWFROM ); } HB_FUNC_STATIC( QSQLRECORD_SELFDESTRUCTION ) { hb_retl( static_cast< bool >( hb_itemGetL( hb_objSendMsg( hb_stackSelfItem(), "SELF_DESTRUCTION", 0 ) ) ) ); } HB_FUNC_STATIC( QSQLRECORD_SETSELFDESTRUCTION ) { PHB_ITEM self = hb_stackSelfItem(); if( hb_pcount() == 1 && HB_ISLOG( 1 ) ) { PHB_ITEM des = hb_itemPutL( nullptr, hb_parl( 1 ) ); hb_objSendMsg( self, "_self_destruction", 1, des ); hb_itemRelease( des ); } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } hb_itemReturn( self ); } #pragma ENDDUMP
21.896505
147
0.611319
b5c90f329c0b20f1d6cc3ac46638a3723fbcfce6
5,776
prg
xBase
source/QtSql/QSqlRelation.prg
orangesocks/Qt5xHb
03aa383d9ae86cdadf7289d846018f8a3382a0e4
[ "MIT" ]
11
2017-01-30T14:19:11.000Z
2020-05-30T13:39:16.000Z
source/QtSql/QSqlRelation.prg
orangesocks/Qt5xHb
03aa383d9ae86cdadf7289d846018f8a3382a0e4
[ "MIT" ]
1
2017-02-24T20:57:32.000Z
2018-05-29T13:43:05.000Z
source/QtSql/QSqlRelation.prg
orangesocks/Qt5xHb
03aa383d9ae86cdadf7289d846018f8a3382a0e4
[ "MIT" ]
5
2017-01-30T14:19:12.000Z
2020-03-28T08:54:56.000Z
/* Qt5xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 5 Copyright (C) 2021 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com> */ /* DO NOT EDIT THIS FILE - the content was created using a source code generator */ #include "hbclass.ch" #ifndef QT5XHB_NO_REQUESTS #endif CLASS QSqlRelation DATA pointer DATA self_destruction INIT .F. METHOD new METHOD delete METHOD displayColumn METHOD indexColumn METHOD isValid METHOD tableName METHOD newFrom METHOD newFromObject METHOD newFromPointer METHOD selfDestruction METHOD setSelfDestruction DESTRUCTOR destroyObject END CLASS PROCEDURE destroyObject() CLASS QSqlRelation IF ::self_destruction ::delete() ENDIF RETURN #pragma BEGINDUMP #include <QtCore/Qt> #ifndef __XHARBOUR__ #include <QtSql/QSqlRelation> #endif #include "qt5xhb_common.h" #include "qt5xhb_macros.h" #include "qt5xhb_utils.h" #ifdef __XHARBOUR__ #include <QtSql/QSqlRelation> #endif /* QSqlRelation() */ void QSqlRelation_new1() { QSqlRelation * obj = new QSqlRelation(); Qt5xHb::returnNewObject( obj, true ); } /* QSqlRelation( const QString & tableName, const QString & indexColumn, const QString & displayColumn ) */ void QSqlRelation_new2() { QSqlRelation * obj = new QSqlRelation( PQSTRING(1), PQSTRING(2), PQSTRING(3) ); Qt5xHb::returnNewObject( obj, true ); } HB_FUNC_STATIC( QSQLRELATION_NEW ) { if( ISNUMPAR(0) ) { QSqlRelation_new1(); } else if( ISNUMPAR(3) && HB_ISCHAR(1) && HB_ISCHAR(2) && HB_ISCHAR(3) ) { QSqlRelation_new2(); } else { hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } } HB_FUNC_STATIC( QSQLRELATION_DELETE ) { QSqlRelation * obj = (QSqlRelation *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj ) { delete obj; obj = NULL; PHB_ITEM self = hb_stackSelfItem(); PHB_ITEM ptr = hb_itemPutPtr( NULL, NULL ); hb_objSendMsg( self, "_pointer", 1, ptr ); hb_itemRelease( ptr ); } hb_itemReturn( hb_stackSelfItem() ); } /* QString displayColumn() const */ HB_FUNC_STATIC( QSQLRELATION_DISPLAYCOLUMN ) { QSqlRelation * obj = (QSqlRelation *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR(0) ) { #endif RQSTRING( obj->displayColumn() ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } } /* QString indexColumn() const */ HB_FUNC_STATIC( QSQLRELATION_INDEXCOLUMN ) { QSqlRelation * obj = (QSqlRelation *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR(0) ) { #endif RQSTRING( obj->indexColumn() ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } } /* bool isValid() const */ HB_FUNC_STATIC( QSQLRELATION_ISVALID ) { QSqlRelation * obj = (QSqlRelation *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR(0) ) { #endif RBOOL( obj->isValid() ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } } /* QString tableName() const */ HB_FUNC_STATIC( QSQLRELATION_TABLENAME ) { QSqlRelation * obj = (QSqlRelation *) Qt5xHb::itemGetPtrStackSelfItem(); if( obj ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR(0) ) { #endif RQSTRING( obj->tableName() ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } } HB_FUNC_STATIC( QSQLRELATION_NEWFROM ) { PHB_ITEM self = hb_stackSelfItem(); if( hb_pcount() == 1 && HB_ISOBJECT(1) ) { PHB_ITEM ptr = hb_itemPutPtr( NULL, (void *) hb_itemGetPtr( hb_objSendMsg( hb_param(1, HB_IT_OBJECT ), "POINTER", 0 ) ) ); hb_objSendMsg( self, "_pointer", 1, ptr ); hb_itemRelease( ptr ); PHB_ITEM des = hb_itemPutL( NULL, false ); hb_objSendMsg( self, "_self_destruction", 1, des ); hb_itemRelease( des ); } else if( hb_pcount() == 1 && HB_ISPOINTER(1) ) { PHB_ITEM ptr = hb_itemPutPtr( NULL, (void *) hb_itemGetPtr( hb_param(1, HB_IT_POINTER ) ) ); hb_objSendMsg( self, "_pointer", 1, ptr ); hb_itemRelease( ptr ); PHB_ITEM des = hb_itemPutL( NULL, false ); hb_objSendMsg( self, "_self_destruction", 1, des ); hb_itemRelease( des ); } else { hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } hb_itemReturn( self ); } HB_FUNC_STATIC( QSQLRELATION_NEWFROMOBJECT ) { HB_FUNC_EXEC( QSQLRELATION_NEWFROM ); } HB_FUNC_STATIC( QSQLRELATION_NEWFROMPOINTER ) { HB_FUNC_EXEC( QSQLRELATION_NEWFROM ); } HB_FUNC_STATIC( QSQLRELATION_SELFDESTRUCTION ) { hb_retl( (bool) hb_itemGetL( hb_objSendMsg( hb_stackSelfItem(), "SELF_DESTRUCTION", 0 ) ) ); } HB_FUNC_STATIC( QSQLRELATION_SETSELFDESTRUCTION ) { PHB_ITEM self = hb_stackSelfItem(); if( hb_pcount() == 1 && HB_ISLOG(1) ) { PHB_ITEM des = hb_itemPutL( NULL, hb_parl(1) ); hb_objSendMsg( self, "_self_destruction", 1, des ); hb_itemRelease( des ); } else { hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } hb_itemReturn( self ); } #pragma ENDDUMP
21.157509
127
0.658068
506b780b4c0c69d563d897232bc535da933371dc
598
prw
xBase
Codigos/MBrowser.prw
Joao2208/Codigod-ADVPL
0c2fbf3d2dd8bc005f76193933406c46b01132db
[ "MIT" ]
null
null
null
Codigos/MBrowser.prw
Joao2208/Codigod-ADVPL
0c2fbf3d2dd8bc005f76193933406c46b01132db
[ "MIT" ]
null
null
null
Codigos/MBrowser.prw
Joao2208/Codigod-ADVPL
0c2fbf3d2dd8bc005f76193933406c46b01132db
[ "MIT" ]
null
null
null
#include 'totvs.ch' #include 'protheus.ch' #include 'parmtype.ch' User Function MBR00() Local cAlias := "Z19" Private cTitulo := "Cadastro produtos teste" Private aRotina := {} Private cCadastro := "Cadastro de Produtos" AADD(aRotina,{"Pesquisa" ,"AxPesqui" ,0,1}) AADD(aRotina,{"Visualizar" ,"AxVisual" ,0,2}) AADD(aRotina,{"Incluir" ,"AxInclui" ,0,3}) AADD(aRotina,{"Trocar" ,"AxAltera" ,0,4}) AADD(aRotina,{"Excluir" ,"AxDeleta" ,0,5}) dbSelectArea(cAlias) dbSetOrder(1) MBrowse(,,,,cAlias) Return nil
23
54
0.595318
b774df69944832649efeaae34119b49c35d064bb
92,803
prg
xBase
hc.prg
omm/harbour-commander
81a2dc7075c923b4bdd2002790b295ccc8d660de
[ "MIT" ]
1
2022-01-13T22:21:13.000Z
2022-01-13T22:21:13.000Z
hc.prg
omm/harbour-commander
81a2dc7075c923b4bdd2002790b295ccc8d660de
[ "MIT" ]
3
2019-01-21T21:09:10.000Z
2022-01-18T10:52:06.000Z
hc.prg
omm/harbour-commander
81a2dc7075c923b4bdd2002790b295ccc8d660de
[ "MIT" ]
3
2019-04-03T02:57:37.000Z
2022-01-22T01:02:49.000Z
/* Copyright 2017-2019 Rafał Jopek ( rafaljopek at hotmail com ) */ /* Harbour Commander */ #include "box.ch" #include "directry.ch" #include "fileio.ch" #include "hbgtinfo.ch" #include "inkey.ch" #include "setcurs.ch" #define DIR_PREFIX( v ) iif( "D" $ v[ F_ATTR ], "A", "B" ) #if defined( __PLATFORM__WINDOWS ) #define OSUPPER( x ) Upper( x ) #else #define OSUPPER( x ) ( x ) #endif #define _nTop 1 #define _nLeft 2 #define _nBottom 3 #define _nRight 4 #define _cCurrentDir 5 #define _aDirectory 6 #define _nRowBar 7 #define _nRowNo 8 #define _cComdLine 9 #define _nComdCol 10 #define _nComdColNo 11 #define _nIdPanel 12 #define _nWinHndl 13 #define _nElements 13 STATIC aConfig #define _nElementConfig 6 #define _aStackWindow 1 #define _nMaxRow 2 // here save MaxRow() of physical screen #define _nMaxCol 3 // here save MaxCol() of physical screen #define nCmdHndl 4 // handle of window for cmd #define aCmdHist 5 // command's history #define nBBarHndl 6 // handle of window for bottom bar /* FError() */ #define MEANING 2 #define F_STATUS 6 /* select file, directory */ #define FXO_SHARELOCK 0x4000 /* emulate DOS SH_DENY* mode in POSIX OS */ STATIC aWinStack #define nWinSession 1 #define GetSession aWinStack[ nWinSession ] #define GetPanels aWinStack[ GetSession ] #define GetPanelActive aWinStack[ GetSession, GetPanels[ idPanelActive ] ] #define SetPanelActive( xId ) GetPanels[ idPanelActive ] := xId #define IsPanelActive( xId ) iif( GetPanelActive[ _nIdPanel ] == xId, .T., .F. ) STATIC aPanels // array of panels and id of active panel #define idPanelLeft 1 #define idPanelRight 2 #define idPanelActive 3 // Active panel { 1 - left, 2 - right } PROCEDURE Main() Set( _SET_DATEFORMAT, "yyyy-mm-dd" ) Set( _SET_SCOREBOARD, .F. ) Set( _SET_EVENTMASK, hb_bitOr( INKEY_KEYBOARD, HB_INKEY_GTEVENT, INKEY_ALL ) ) Set( _SET_INSERT, .T. ) /* Setup input CP of the translation */ hb_cdpSelect( "UTF8EX" ) hb_gtInfo( HB_GTI_COMPATBUFFER, .F. ) hb_gtInfo( HB_GTI_BOXCP, hb_cdpSelect() ) /* Configure terminal and OS codepage */ hb_SetTermCP( hb_cdpTerm() ) Set( _SET_OSCODEPAGE, hb_cdpOS() ) Set( _SET_DBCODEPAGE, "EN" ) hb_gtInfo( HB_GTI_RESIZEMODE, HB_GTI_RESIZEMODE_ROWS ) hb_gtInfo( HB_GTI_WINTITLE, "Harbour Commander" ) /* restore configuration*/ aConfig := hb_deserialize( hb_memoread( "hc.cfg" ) ) IF ! HB_ISARRAY( aConfig ) ConfigInit() /* add new sessins to windows stack */ IF !hb_IsArray( aWinStack ) aWinStack := {} /* in first element we save active session number, initial is 2 (should be greater then 1) */ AAdd( aWinStack, 2 ) /* next elements of aWinStack is array( 3 ), { left panel, right panel , active panel (default: left) } */ AAdd( aWinStack, { PanelInit( idPanelLeft ), PanelInit( idPanelRight ), idPanelLeft } ) ENDIF aConfig[ _aStackWindow ] := aWinStack ELSE aWinStack := aConfig[ _aStackWindow ] ENDIF aConfig[ _nMaxRow ] := MaxRow() aConfig[ _nMaxCol ] := MaxCol() Prompt() hb_Scroll() SetPos( 0, 0 ) RETURN STATIC PROCEDURE ConfigInit() aConfig := Array( _nElementConfig ) aConfig[ _aStackWindow ] := {} aConfig[ _nMaxRow ] := NIL aConfig[ _nMaxCol ] := NIL aConfig[ nCmdHndl ] := NIL aConfig[ aCmdHist ] := {} aConfig[ nBBarHndl ] := NIL RETURN STATIC FUNCTION PanelInit( IdPanel ) LOCAL aInit aInit := Array( _nElements ) aInit[ _nTop ] := 0 aInit[ _nLeft ] := 0 aInit[ _nBottom ] := 0 aInit[ _nRight ] := 0 aInit[ _cCurrentDir ] := hb_cwd() /* hb_cwd () returns the full current working directory containing the disk and final path separator */ aInit[ _aDirectory ] := {} aInit[ _nRowBar ] := 1 aInit[ _nRowNo ] := 0 aInit[ _cComdLine ] := "" aInit[ _nComdCol ] := 0 aInit[ _nComdColNo ] := 0 aInit[ _nIdPanel ] := IdPanel aInit[ _nWinHndl ] := NIL // handle to window RETURN aInit STATIC PROCEDURE FetchData() PanelFetchList( GetPanels[ idPanelLeft ] ) PanelFetchList( GetPanels[ idPanelRight ] ) AutoSize() RETURN STATIC PROCEDURE PanelFetchList( aPanel ) LOCAL i, nPos, a2Dot, aDots := { ".", ".." }, iDot CheckDirExists( @aPanel[ _cCurrentDir ] ) aPanel[ _aDirectory ] := hb_vfDirectory( aPanel[ _cCurrentDir ], "HSD" ) /* Add .T. to each element of the array. */ FOR i := 1 TO Len( aPanel[ _aDirectory ] ) // ? na AEval() AAdd( aPanel[ _aDirectory ][ i ], .T. ) NEXT FOR EACH iDot in aDots IF ( nPos := AScan( aPanel[ _aDirectory ], {| x | x[ F_NAME ] == iDot } ) ) > 0 IF iDot:__enumIndex == 2 a2Dot := aPanel[ _aDirectory ][ nPos ] ENDIF hb_ADel( aPanel[ _aDirectory ], nPos, .T. ) ENDIF NEXT ASort( aPanel[ _aDirectory ],,, {| x, y | DIR_PREFIX( x ) + OSUPPER( x[ F_NAME ] ) < DIR_PREFIX( y ) + OSUPPER( y[ F_NAME ] ) } ) IF HB_ISARRAY( a2Dot ) hb_AIns( aPanel[ _aDirectory ], 1, a2Dot, .T. ) ENDIF RETURN STATIC PROCEDURE CheckDirExists( cDir ) LOCAL nPs WHILE ! hb_DirExists( cDir ) nPs := hb_Rat( hb_ps(), cDir,, iif( Right( cDir, 1 ) == hb_ps(), Len( cDir ) - 1, NIL ) ) cDir := SubStr( cDir, 1, nPs ) CheckDirExists( @cDir ) END RETURN STATIC PROCEDURE AutoSize() Resize( GetPanels[ idPanelLeft ], 0, 0, aConfig[ _nMaxRow ] - 2, aConfig[ _nMaxCol ] / 2 ) Resize( GetPanels[ idPanelRight ], 0, aConfig[ _nMaxCol ] / 2 + 1, aConfig[ _nMaxRow ] - 2, aConfig[ _nMaxCol ] ) RETURN STATIC PROCEDURE Resize( aPanel, nTop, nLeft, nBottom, nRight ) aPanel[ _nTop ] := nTop aPanel[ _nLeft ] := nLeft aPanel[ _nBottom ] := nBottom aPanel[ _nRight ] := nRight RETURN STATIC PROCEDURE Prompt() LOCAL lContinue := .T. LOCAL nMaxRow := 0, nMaxCol := 0 LOCAL nKey, nKeyStd LOCAL nPos LOCAL cFileName LOCAL pHandle LOCAL nMRow, nMCol LOCAL nCol LOCAL cSpaces LOCAL nErrorCode LOCAL cNewDrive LOCAL i LOCAL lCtrlO := .F. LOCAL _nPanelActive := 0 LOCAL _nPanelRowBar := 0 #if defined( __PLATFORM__WINDOWS ) // optimized, PLATFORM_LINUX ? #else LOCAL result := "" LOCAL ctuxCmd := "xdg-open " LOCAL cTerminal := "" #endif /* Ok, now fetch the data */ FetchData() DO WHILE lContinue DispBegin() IF ( GetPanels[ idPanelLeft ][ _nWinHndl ] == NIL .OR. GetPanels[ idPanelRight ][ _nWinHndl ] == NIL ) .OR.; _nPanelActive != GetPanels[ idPanelActive ] .OR.; _nPanelRowBar != GetPanelActive[ _nRowBar ] + GetPanelActive[ _nRowNo ] IF _nPanelActive != GetPanels[ idPanelActive ] _nPanelActive := GetPanels[ idPanelActive ] ENDIF IF _nPanelRowBar != GetPanelActive[ _nRowBar ] + GetPanelActive[ _nRowNo ] _nPanelRowBar := GetPanelActive[ _nRowBar ] + GetPanelActive[ _nRowNo ] ENDIF AutoSize() PanelDisplay( GetPanels[ idPanelLeft ] ) PanelDisplay( GetPanels[ idPanelRight ] ) BottomBar() nMaxRow := MaxRow() nMaxCol := MaxCol() ENDIF ComdLineDisplay( ) DispEnd() WSelect( aConfig[ nCmdHndl ] ) SetCursor( SC_NORMAL ) nKey := Inkey( 0 ) nKeyStd := hb_keyStd( nKey ) SWITCH nKeyStd CASE K_ESC IF ! Empty( GetPanelActive[ _cComdLine ] ) GetPanelActive[ _cComdLine ] := "" GetPanelActive[ _nComdCol ] := 0 ComdLineDisplay( ) ELSE lContinue := .F. /* save configuration on exit*/ GetPanels[ idPanelLeft ][ _nWinHndl ] := NIL GetPanels[ idPanelRight ][ _nWinHndl ] := NIL aConfig[ _aStackWindow ] := aWinStack aConfig[ nCmdHndl ] := NIL aConfig[ nBBarHndl ] := NIL hb_MemoWrit( StartUpPath() + "hc.cfg", hb_Serialize( aConfig ) ) ENDIF EXIT CASE K_ENTER nPos := GetPanelActive[ _nRowBar ] + GetPanelActive[ _nRowNo ] IF Empty( GetPanelActive[ _cComdLine ] ) /* if we stand on a file */ IF At( "D", GetPanelActive[ _aDirectory ][ nPos ][ F_ATTR ] ) == 0 #if defined( __PLATFORM__WINDOWS ) hb_run( Chr( 34 ) + GetPanelActive[ _cCurrentDir ] + GetPanelActive[ _aDirectory ][ nPos ][ F_NAME ] + Chr( 34 ) ) #else IF hb_vfExists( "/usr/bin/nautilus" ) cTerminal = "gnome-terminal" ELSEIF hb_vfExists( "/usr/bin/thunar" ) cTerminal = "xfce4-terminal" ELSEIF hb_vfExists( "/usr/bin/pcmanfm" ) cTerminal = "lxterminal" ELSEIF hb_vfExists( "/usr/bin/caja" ) cTerminal = "mate-terminal" ELSEIF hb_vfExists( "/usr/bin/dolphin" ) cTerminal = "konsole" ENDIF hb_processRun( "sh -c 'file " + GetPanelActive[ _cCurrentDir ] + GetPanelActive[ _aDirectory ][ nPos ][ F_NAME ] + "'" + Chr( 34 ),, @result ) IF At( "ELF", result ) > 0 ctuxCmd = "" ELSEIF At( "script", result ) > 0 ctuxCmd = cterminal + " -x " ENDIF hb_run( ctuxCmd + Chr( 34 ) + GetPanelActive[ _cCurrentDir ] + GetPanelActive[ _aDirectory ][ nPos ][ F_NAME ] + Chr( 34 ) ) #endif ELSE ChangeDir( GetPanelActive ) ENDIF ELSE // hb_Scroll() // hb_processRun( GetPanelActive[ _cComdLine ] ) hb_processRun( getEnv( "COMSPEC" ) + " /c start " + GetPanelActive[ _cComdLine ] ) AAdd( aConfig[ aCmdHist ], GetPanelActive[ _cComdLine ] ) GetPanelActive[ _cComdLine ] := "" // Inkey( 0 ) // nMaxRow := 0 GetPanelActive[ _nComdCol ] := 0 PanelRefresh( GetPanelActive ) ENDIF EXIT CASE K_TAB IF ! lCtrlO IF IsPanelActive( idPanelLeft ) SetPanelActive( idPanelRight ) GetPanelActive[ _cComdLine ] := GetPanels[ idPanelLeft, _cComdLine ] GetPanelActive[ _nComdCol ] := GetPanels[ idPanelLeft, _nComdCol ] GetPanels[ idPanelLeft, _cComdLine ] := "" GetPanels[ idPanelLeft, _nComdCol ] := 0 ELSE SetPanelActive( idPanelLeft ) GetPanelActive[ _cComdLine ] := GetPanels[ idPanelRight, _cComdLine ] GetPanelActive[ _nComdCol ] := GetPanels[ idPanelRight, _nComdCol ] GetPanels[ idPanelRight, _cComdLine ] := "" GetPanels[ idPanelRight, _nComdCol ] := 0 ENDIF ShowSession() ENDIF EXIT CASE HB_K_RESIZE WClose( GetPanels[ idPanelLeft, _nWinHndl ] ) GetPanels[ idPanelLeft, _nWinHndl ] := NIL WClose( GetPanels[ idPanelRight, _nWinHndl ] ) GetPanels[ idPanelRight, _nWinHndl ] := NIL WClose( aConfig[ nCmdHndl ] ) aConfig[ nCmdHndl ] := NIL WClose( aConfig[ nBBarHndl ] ) aConfig[ nBBarHndl ] := NIL WSelect( 0 ) aConfig[ _nMaxRow ] := MaxRow() aConfig[ _nMaxCol ] := MaxCol() CASE K_MOUSEMOVE DispBegin() nMRow := MRow() nCol := Int( nMaxCol / 10 ) + 1 BottomBar() IF nMRow > nMaxRow - 1 cSpaces := Space( nCol - 8 ) SWITCH Int( MCol() / nCol ) + 1 CASE 1 ; hb_DispOutAt( nMRow, 2, "Help " + cSpaces, 0xb0 ) ; EXIT CASE 2 ; hb_DispOutAt( nMRow, nCol + 2, "Menu " + cSpaces, 0xb0 ) ; EXIT CASE 3 ; hb_DispOutAt( nMRow, nCol * 2 + 2, "View " + cSpaces, 0xb0 ) ; EXIT CASE 4 ; hb_DispOutAt( nMRow, nCol * 3 + 2, "Edit " + cSpaces, 0xb0 ) ; EXIT CASE 5 ; hb_DispOutAt( nMRow, nCol * 4 + 2, "Copy " + cSpaces, 0xb0 ) ; EXIT CASE 6 ; hb_DispOutAt( nMRow, nCol * 5 + 2, "RenMov" + cSpaces, 0xb0 ) ; EXIT CASE 7 ; hb_DispOutAt( nMRow, nCol * 6 + 2, "MkDir " + cSpaces, 0xb0 ) ; EXIT CASE 8 ; hb_DispOutAt( nMRow, nCol * 7 + 2, "Delete" + cSpaces, 0xb0 ) ; EXIT CASE 9 ; hb_DispOutAt( nMRow, nCol * 8 + 2, "PullDn" + cSpaces, 0xb0 ) ; EXIT CASE 10 ; hb_DispOutAt( nMRow, nCol * 9 + 2, "Quit " + cSpaces, 0xb0 ) ; EXIT ENDSWITCH ENDIF DispEnd() EXIT CASE K_LDBLCLK IF ! lCtrlO nPos := GetPanelActive[ _nRowBar ] + GetPanelActive[ _nRowNo ] /* if we stand on a file */ IF At( "D", GetPanelActive[ _aDirectory ][ nPos ][ F_ATTR ] ) == 0 #if defined( __PLATFORM__WINDOWS ) hb_run( Chr( 34 ) + GetPanelActive[ _cCurrentDir ] + GetPanelActive[ _aDirectory ][ nPos ][ F_NAME ] + Chr( 34 ) ) #else IF hb_vfExists( "/usr/bin/nautilus" ) cTerminal = "gnome-terminal" ELSEIF hb_vfExists( "/usr/bin/thunar" ) cTerminal = "xfce4-terminal" ELSEIF hb_vfExists( "/usr/bin/pcmanfm" ) cTerminal = "lxterminal" ELSEIF hb_vfExists( "/usr/bin/caja" ) cTerminal = "mate-terminal" ELSEIF hb_vfExists( "/usr/bin/dolphin" ) cTerminal = "konsole" ENDIF hb_processRun( "sh -c 'file " + GetPanelActive[ _cCurrentDir ] + GetPanelActive[ _aDirectory ][ nPos ][ F_NAME ] + "'" + Chr( 34 ),, @result ) IF At( "ELF", result ) > 0 ctuxCmd = "" ELSEIF At( "script", result ) > 0 ctuxCmd = cterminal + " -x " ENDIF hb_run( ctuxCmd + Chr( 34 ) + GetPanelActive[ _cCurrentDir ] + GetPanelActive[ _aDirectory ][ nPos ][ F_NAME ] + Chr( 34 ) ) #endif ELSE ChangeDir( GetPanelActive ) ENDIF ENDIF EXIT CASE K_RBUTTONDOWN IF ! lCtrlO nMRow := MRow() nMCol := MCol() IF nMRow > 0 .AND. nMRow < MaxRow() - 1 .AND. nMCol < Int( MaxCol() / 2 ) + 1 GetPanelActive := aPanels[ idPanelLeft ] IF nMRow <= Len( GetPanelActive[ _aDirectory ] ) GetPanelActive[ _nRowBar ] := nMRow ENDIF ENDIF IF nMRow > 0 .AND. nMRow < MaxRow() - 1 .AND. nMCol > Int( MaxCol() / 2 ) GetPanelActive := aPanels[ idPanelRight ] IF nMRow <= Len( GetPanelActive[ _aDirectory ] ) GetPanelActive[ _nRowBar ] := nMRow ENDIF ENDIF nPos := GetPanelActive[ _nRowBar ] + GetPanelActive[ _nRowNo ] IF GetPanelActive[ _aDirectory ][ nPos ][ F_NAME ] != ".." // ? /* Marking the deletion status of the current item in the table */ IF GetPanelActive[ _aDirectory ][ nPos ][ F_STATUS ] GetPanelActive[ _aDirectory ][ nPos ][ F_STATUS ] := .F. ELSE /* return the delete status of the current item in the array */ GetPanelActive[ _aDirectory ][ nPos ][ F_STATUS ] := .T. ENDIF ENDIF PanelDisplay( GetPanels[ idPanelLeft ] ) PanelDisplay( GetPanels[ idPanelRight ] ) ENDIF EXIT CASE K_LBUTTONDOWN IF ! lCtrlO nMRow := MRow() nMCol := MCol() IF nMRow > 0 .AND. nMRow < MaxRow() - 1 .AND. nMCol < Int( MaxCol() / 2 ) + 1 GetPanelActive := aPanels[ idPanelLeft ] IF nMRow <= Len( GetPanelActive[ _aDirectory ] ) GetPanelActive[ _nRowBar ] := nMRow ENDIF ENDIF IF nMRow > 0 .AND. nMRow < MaxRow() - 1 .AND. nMCol > Int( MaxCol() / 2 ) GetPanelActive := aPanels[ idPanelRight ] IF nMRow <= Len( GetPanelActive[ _aDirectory ] ) GetPanelActive[ _nRowBar ] := nMRow ENDIF ENDIF /* BottomBar */ nCol := Int( nMaxCol / 10 ) + 1 IF nMRow > nMaxRow - 1 SWITCH Int( MCol() / nCol ) + 1 CASE 1 ; FunctionKey_F1() ; EXIT CASE 2 ; FunctionKey_F2() ; EXIT CASE 3 ; FunctionKey_F3( GetPanelActive ) ; EXIT CASE 4 ; FunctionKey_F4( GetPanelActive ) ; EXIT CASE 5 ; FunctionKey_F5( GetPanelActive ) ; EXIT CASE 6 ; FunctionKey_F6( GetPanelActive ) ; EXIT CASE 7 ; FunctionKey_F7( GetPanelActive ) ; EXIT CASE 8 ; FunctionKey_F8( GetPanelActive ) ; EXIT CASE 9 ; EXIT CASE 10 IF HC_Alert( "The Harbour Commander", "Do you want to quit the Harbour Commander?", { "Yes", "No!" }, 0x8f ) == 1 lContinue := .F. ENDIF EXIT ENDSWITCH ENDIF PanelDisplay( GetPanels[ idPanelLeft ] ) PanelDisplay( GetPanels[ idPanelRight ] ) ENDIF EXIT CASE K_MWFORWARD IF GetPanelActive[ _nRowBar ] > 1 --GetPanelActive[ _nRowBar ] ELSE IF GetPanelActive[ _nRowNo ] >= 1 --GetPanelActive[ _nRowNo ] ENDIF ENDIF EXIT CASE K_MWBACKWARD IF GetPanelActive[ _nRowBar ] < GetPanelActive[ _nBottom ] - 1 .AND. GetPanelActive[ _nRowBar ] <= Len( GetPanelActive[ _aDirectory ] ) - 1 ++GetPanelActive[ _nRowBar ] ELSE IF GetPanelActive[ _nRowNo ] + GetPanelActive[ _nRowBar ] <= Len( GetPanelActive[ _aDirectory ] ) - 1 ++GetPanelActive[ _nRowNo ] ENDIF ENDIF EXIT CASE K_UP IF ! lCtrlO IF GetPanelActive[ _nRowBar ] > 1 --GetPanelActive[ _nRowBar ] ELSE IF GetPanelActive[ _nRowNo ] >= 1 --GetPanelActive[ _nRowNo ] ENDIF ENDIF ENDIF EXIT CASE K_DOWN IF ! lCtrlO IF GetPanelActive[ _nRowBar ] < GetPanelActive[ _nBottom ] - 1 .AND. GetPanelActive[ _nRowBar ] <= Len( GetPanelActive[ _aDirectory ] ) - 1 ++GetPanelActive[ _nRowBar ] ELSE IF GetPanelActive[ _nRowNo ] + GetPanelActive[ _nRowBar ] <= Len( GetPanelActive[ _aDirectory ] ) - 1 ++GetPanelActive[ _nRowNo ] ENDIF ENDIF ENDIF EXIT CASE K_LEFT IF ! lCtrlO IF GetPanelActive[ _nComdCol ] > 0 GetPanelActive[ _nComdCol ]-- ELSE IF GetPanelActive[ _nComdColNo ] >= 1 GetPanelActive[ _nComdColNo ]-- ENDIF ENDIF ENDIF EXIT CASE K_RIGHT IF ! lCtrlO IF GetPanelActive[ _nComdCol ] < nMaxCol - Len( GetPanelActive[ _cCurrentDir ] ) .AND. GetPanelActive[ _nComdCol ] < Len( GetPanelActive[ _cComdLine ] ) GetPanelActive[ _nComdCol ]++ ELSE IF GetPanelActive[ _nComdColNo ] + GetPanelActive[ _nComdCol ] < Len( GetPanelActive[ _cComdLine ] ) GetPanelActive[ _nComdColNo ]++ ENDIF ENDIF ENDIF EXIT CASE K_HOME IF ! lCtrlO GetPanelActive[ _nComdCol ] := 0 ENDIF EXIT CASE K_END IF ! lCtrlO GetPanelActive[ _nComdCol ] := Len( GetPanelActive[ _cComdLine ] ) ENDIF EXIT CASE K_PGUP IF ! lCtrlO IF GetPanelActive[ _nRowBar ] <= 1 IF GetPanelActive[ _nRowNo ] - nMaxRow >= 0 GetPanelActive[ _nRowNo ] -= nMaxRow ENDIF ENDIF GetPanelActive[ _nRowBar ] := 1 ENDIF EXIT CASE K_PGDN IF ! lCtrlO IF GetPanelActive[ _nRowBar ] >= nMaxRow - 3 IF GetPanelActive[ _nRowNo ] + nMaxRow <= Len( GetPanelActive[ _aDirectory ] ) GetPanelActive[ _nRowNo ] += nMaxRow ENDIF ENDIF GetPanelActive[ _nRowBar ] := Min( nMaxRow - 3, Len( GetPanelActive[ _aDirectory ] ) - GetPanelActive[ _nRowNo ] ) ENDIF EXIT CASE K_INS IF ! lCtrlO nPos := GetPanelActive[ _nRowBar ] + GetPanelActive[ _nRowNo ] IF GetPanelActive[ _aDirectory ][ nPos ][ F_NAME ] != ".." // ? /* Marking the deletion status of the current item in the table */ IF GetPanelActive[ _aDirectory ][ nPos ][ F_STATUS ] GetPanelActive[ _aDirectory ][ nPos ][ F_STATUS ] := .F. ELSE /* return the delete status of the current item in the array */ GetPanelActive[ _aDirectory ][ nPos ][ F_STATUS ] := .T. ENDIF IF GetPanelActive[ _nRowBar ] < GetPanelActive[ _nBottom ] - 1 .AND. GetPanelActive[ _nRowBar ] <= Len( GetPanelActive[ _aDirectory ] ) - 1 ++GetPanelActive[ _nRowBar ] ELSE IF GetPanelActive[ _nRowNo ] + GetPanelActive[ _nRowBar ] <= Len( GetPanelActive[ _aDirectory ] ) - 1 ++GetPanelActive[ _nRowNo ] ENDIF ENDIF ENDIF ENDIF EXIT CASE K_DEL IF GetPanelActive[ _nComdCol ] >= 0 GetPanelActive[ _cComdLine ] := Stuff( GetPanelActive[ _cComdLine ], GetPanelActive[ _nComdCol ] + 1, 1, "" ) ENDIF EXIT CASE K_BS IF GetPanelActive[ _nComdCol ] > 0 GetPanelActive[ _cComdLine ] := Stuff( GetPanelActive[ _cComdLine ], GetPanelActive[ _nComdCol ], 1, "" ) GetPanelActive[ _nComdCol ]-- ENDIF EXIT CASE K_CTRL_O IF ! lCtrlO lCtrlO := .T. WClose( aConfig[ nCmdHndl ] ) WSelect( 0 ) SetColor( "N" ) aConfig[ nCmdHndl ] := WOpen( 0, 0, MaxRow() - 1, MaxCol(), .T. ) ELSE lCtrlO := .F. WClose( aConfig[ nCmdHndl ] ) aConfig[ nCmdHndl ] := NIL ShowSession() ENDIF EXIT CASE K_F1 FunctionKey_F1() EXIT CASE K_F2 FunctionKey_F2() EXIT CASE K_F3 IF ! lCtrlO FunctionKey_F3( GetPanelActive ) ENDIF EXIT CASE K_F4 IF ! lCtrlO FunctionKey_F4( GetPanelActive ) ENDIF EXIT CASE K_F5 IF ! lCtrlO FunctionKey_F5( GetPanelActive ) ENDIF EXIT CASE K_F6 IF ! lCtrlO FunctionKey_F6( GetPanelActive ) ENDIF EXIT CASE K_F7 IF ! lCtrlO FunctionKey_F7( GetPanelActive ) ENDIF EXIT CASE K_F8 IF ! lCtrlO FunctionKey_F8( GetPanelActive ) ENDIF EXIT CASE K_F9 IF ! lCtrlO FunctionKey_F9( ) ENDIF EXIT CASE K_F10 lContinue := .F. EXIT #if defined( __PLATFORM__WINDOWS ) CASE K_ALT_F1 IF ! lCtrlO /* change directory to the left panel mount point, the last parameter sets the dialog: NIL center, 0x0 to the left and 0x1 to the right AllDrives () returns an array */ IF ( cNewDrive := HC_Alert( "Drive letter", "Choose left drive:", AllDrives(), 0x8a, 0x0 ) ) != 0 hb_CurDrive( AllDrives()[ cNewDrive ] ) PanelFetchList( aPanels[ idPanelLeft ], hb_cwd() ) PanelDisplay( aPanels[ idPanelLeft ] ) ENDIF ENDIF EXIT CASE K_ALT_F2 IF ! lCtrlO /* change directory to the right panel mount point, the last parameter sets the dialog: NIL center, 0x0 to the left and 0x1 to the right AllDrives () returns an array */ IF ( cNewDrive := HC_Alert( "Drive letter", "Choose right drive:", AllDrives(), 0x8a, 0x1 ) ) != 0 hb_CurDrive( AllDrives()[ cNewDrive ] ) PanelFetchList( aPanels[ idPanelRight ], hb_cwd() ) PanelDisplay( aPanels[ idPanelRight ] ) ENDIF ENDIF EXIT #endif CASE K_SH_F4 IF ! lCtrlO nPos := GetPanelActive[ _nRowBar ] + GetPanelActive[ _nRowNo ] /* if we stand on a file */ IF At( "D", GetPanelActive[ _aDirectory ][ nPos ][ F_ATTR ] ) == 0 IF HB_ISSTRING( cFileName := MsgBox( "Create file.", GetPanelActive[ _cCurrentDir ] + GetPanelActive[ _aDirectory ][ nPos ][ F_NAME ], { "Yes", "No!" } ) ) IF hb_vfExists( cFileName ) HCEdit( cFileName, .T. ) ELSE IF ( pHandle := hb_vfOpen( cFileName, FO_CREAT + FO_TRUNC + FO_WRITE ) ) != NIL IF ! hb_vfClose( pHandle ) IF ( nErrorCode := AScan( FileError(), {| x | x[ 1 ] == FError() } ) ) > 0 HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make file, error:;" + FileError()[ nErrorCode ][ MEANING ] ) ELSE HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make file, error:;" + hb_ntos( FError() ) ) ENDIF ENDIF PanelRefresh( GetPanelActive ) ELSE IF ( nErrorCode := AScan( FileError(), {| x | x[ 1 ] == FError() } ) ) > 0 HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make file, error:;" + FileError()[ nErrorCode ][ MEANING ] ) ELSE HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make file, error:;" + hb_ntos( FError() ) ) ENDIF ENDIF ENDIF ENDIF ELSE /* if we stand on the catalog */ IF HB_ISSTRING( cFileName := MsgBox( "Create file.", NIL, { "Yes", "No!" } ) ) IF ( pHandle := hb_vfOpen( GetPanelActive[ _cCurrentDir ] + cFileName, FO_CREAT + FO_TRUNC + FO_WRITE ) ) != NIL IF ! hb_vfClose( pHandle ) IF ( nErrorCode := AScan( FileError(), {| x | x[ 1 ] == FError() } ) ) > 0 HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make file, error:;" + FileError()[ nErrorCode ][ MEANING ] ) ELSE HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make file, error:;" + hb_ntos( FError() ) ) ENDIF ENDIF PanelRefresh( GetPanelActive, cFileName ) ELSE IF ( nErrorCode := AScan( FileError(), {| x | x[ 1 ] == FError() } ) ) > 0 HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make file, error:;" + FileError()[ nErrorCode ][ MEANING ] ) ELSE HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make file, error:;" + hb_ntos( FError() ) ) ENDIF ENDIF ENDIF ENDIF ENDIF EXIT CASE 43 /* select a group of files. */ IF ! lCtrlO FOR i := 1 TO Len( GetPanelActive[ _aDirectory ] ) IF GetPanelActive[ _aDirectory ][ i ][ F_NAME ] != ".." GetPanelActive[ _aDirectory ][ i ][ F_STATUS ] := .F. ENDIF NEXT ENDIF EXIT CASE 95 /* Unselect a group of files. */ IF ! lCtrlO FOR i := 1 TO Len( GetPanelActive[ _aDirectory ] ) IF GetPanelActive[ _aDirectory ][ i ][ F_NAME ] != ".." GetPanelActive[ _aDirectory ][ i ][ F_STATUS ] := .T. ENDIF NEXT ENDIF EXIT OTHERWISE IF ( nKeyStd >= 32 .AND. nKeyStd <= 126 ) .OR. ( nKeyStd >= 160 .AND. nKeyStd <= 255 ) .OR. ! hb_keyChar( nKeyStd ) == "" GetPanelActive[ _cComdLine ] := Stuff( GetPanelActive[ _cComdLine ], GetPanelActive[ _nComdCol ] + GetPanelActive[ _nComdColNo ] + 1, 0, hb_keyChar( nKeyStd ) ) IF GetPanelActive[ _nComdCol ] < nMaxCol - Len( GetPanelActive[ _cCurrentDir ] ) GetPanelActive[ _nComdCol ]++ ELSE GetPanelActive[ _nComdColNo ]++ ENDIF ENDIF ENDSWITCH ENDDO RETURN STATIC PROCEDURE FunctionKey_F1() LOCAL cAddr := "https://github.com/omm/harbour-commander/issues/new" LOCAL cStdOut, cOutErr IF HC_Alert( "Report an error", ; "Creating an issue;" + ; ";Issues can be used to keep track of bugs, enhancements, or;" + ; "other requests.;" + ; ";Any GitHub user can create an issue in a public repository;" + ; "where issues have not been disabled.;" + ; ";You can open a new issue based on code from an existing pull;" + ; "request.;", ; { "Click New issue." } ) == 1 #if defined( __PLATFORM__WINDOWS ) hb_processRun( "start " + cAddr,, @cStdOut, @cOuterr ) hb_alert( cStdOut + hb_eol() + "and" + hb_eol() + cOutErr ) //hb_run( "start " + cAddr ) #else hb_run( "xdg-open " + cAddr ) #endif ENDIF RETURN STATIC PROCEDURE FunctionKey_F2() HC_MenuF2() RETURN STATIC PROCEDURE FunctionKey_F3( aPanel ) LOCAL nPos LOCAL /* aTarget := {}, */ aItem /*, aDirScan */ /* LOCAL nLengthName := 0 */ LOCAL nSizeDir nPos := aPanel[ _nRowBar ] + aPanel[ _nRowNo ] /* if we stand on a file */ IF At( "D", aPanel[ _aDirectory ][ nPos ][ F_ATTR ] ) == 0 HCEdit( aPanel[ _cCurrentDir ] + aPanel[ _aDirectory ][ nPos ][ F_NAME ], .F. ) ELSE IF aPanel[ _aDirectory ][ nPos ][ F_NAME ] == ".." nSizeDir := 0 FOR EACH aItem IN aPanel[ _aDirectory ] nSizeDir += aItem[ 2 ] NEXT ENDIF MsgBox( "Size of files in " + aPanel[ _cCurrentDir ],; { transform( nSizeDir, "999,999,999" ) + " bytes",; transform( nSizeDir/ 1024, "999,999,999" ) + " KiB",; transform( nSizeDir/ 1024/ 1024, "999,999.999" ) + " MiB" }, { "OK" } ) /* hb_alert( "Size of files in " + aPanel[ _cCurrentDir ] + hb_eol(); + transform( nSizeDir, "999,999,999" ) + " bytes" + hb_eol(); + transform( nSizeDir/ 1024, "999,999,999" ) + " KiB" + hb_eol(); + transform( nSizeDir/ 1024/ 1024, "999,999.999" ) + " MiB" ) */ /* aDirScan := hb_DirScan( aPanel[ _aDirectory ][ nPos ][ F_NAME ], hb_osFileMask() ) AScan( aDirScan, {| x | nLengthName := Max( nLengthName, Len( x[ 1 ] ) ) } ) FOR EACH aItem IN aDirScan AAdd( aTarget, ; PadR( aItem[ F_NAME ], nLengthName ) + " " + ; Transform( hb_ntos( aItem[ F_SIZE ] ), "9 999 999 999" ) + " " + ; hb_TToC( aItem[ F_DATE ] ) + " " + ; aItem[ F_ATTR ] ) NEXT SaveFile( aTarget, "DirScan.txt" ) // where to save ? HCEdit( "DirScan.txt", .F. ) */ ENDIF RETURN STATIC PROCEDURE FunctionKey_F4( aPanel ) LOCAL nPos nPos := aPanel[ _nRowBar ] + aPanel[ _nRowNo ] /* if we stand on a file go to editing */ IF At( "D", aPanel[ _aDirectory ][ nPos ][ F_ATTR ] ) == 0 HCEdit( aPanel[ _cCurrentDir ] + aPanel[ _aDirectory ][ nPos ][ F_NAME ], .T. ) ELSE HC_Alert( "No file selected", "Select the file to edit",, 0x8f ) ENDIF RETURN STATIC PROCEDURE FunctionKey_F5( aPanel ) LOCAL nPos LOCAL nErrorCode nPos := aPanel[ _nRowBar ] + aPanel[ _nRowNo ] IF aPanel[ _aDirectory ][ nPos ][ F_NAME ] == ".." HC_Alert( "Copy", "The item to be copy has not been selected.",, 0x8f ) ELSE IF aPanel == aPanels[ idPanelLeft ] /* if we stand on a file */ IF At( "D", aPanel[ _aDirectory ][ nPos ][ F_ATTR ] ) == 0 IF HB_ISSTRING( MsgBox( "Copy file " + '"' + aPanels[ idPanelLeft ][ _aDirectory ][ nPos ][ F_NAME ] + '"' + " to", ; aPanels[ idPanelRight ][ _cCurrentDir ] + aPanels[ idPanelLeft ][ _aDirectory ][ nPos ][ F_NAME ], { "Yes", "No!" } ) ) // IF hb_vfCopyFile( aPanels[ idPanelLeft ][ _cCurrentDir ] + aPanels[ idPanelLeft ][ _aDirectory ][ nPos ][ F_NAME ], ; IF HC_CopyFile( aPanels[ idPanelLeft ][ _cCurrentDir ] + aPanels[ idPanelLeft ][ _aDirectory ][ nPos ][ F_NAME ], ; aPanels[ idPanelRight ][ _cCurrentDir ] + aPanels[ idPanelLeft ][ _aDirectory ][ nPos ][ F_NAME ] ) == 0 PanelRefresh( GetPanels[ idPanelRight ] ) ELSE IF ( nErrorCode := AScan( FileError(), {| x | x[ 1 ] == FError() } ) ) > 0 HC_Alert( "Error", "Test for errors after a binary file operation.;The file can not be copied;" + FileError()[ nErrorCode ][ MEANING ] ) ELSE HC_Alert( "Error", "Test for errors after a binary file operation.;The file can not be copied;" + hb_ntos( FError() ) ) ENDIF ENDIF ENDIF ELSE IF HB_ISSTRING( MsgBox( "Copy directory " + '"' + aPanels[ idPanelLeft ][ _aDirectory ][ nPos ][ F_NAME ] + '"' + " to", ; aPanels[ idPanelRight ][ _cCurrentDir ], { "Yes", "No!" } ) ) IF HC_CopyDirectory( aPanels[ idPanelLeft ][ _cCurrentDir ] + aPanels[ idPanelLeft ][ _aDirectory ][ nPos ][ F_NAME ], ; aPanels[ idPanelRight ][ _cCurrentDir ] ) == 0 // ? PanelRefresh( GetPanels[ idPanelRight ] ) ELSE IF ( nErrorCode := AScan( FileError(), {| x | x[ 1 ] == FError() } ) ) > 0 HC_Alert( "Error", "Test for errors after a binary file operation.;The directory can not be copied;" + FileError()[ nErrorCode ][ MEANING ] ) ELSE HC_Alert( "Error", "Test for errors after a binary file operation.;The directory can not be copied;" + hb_ntos( FError() ) ) ENDIF ENDIF ENDIF ENDIF ELSE /* if we stand on a file */ IF At( "D", aPanel[ _aDirectory ][ nPos ][ F_ATTR ] ) == 0 IF HB_ISSTRING( MsgBox( "Copy file " + '"' + aPanels[ idPanelRight ][ _aDirectory ][ nPos ][ F_NAME ] + '"' + " to", ; aPanels[ idPanelLeft ][ _cCurrentDir ] + aPanels[ idPanelRight ][ _aDirectory ][ nPos ][ F_NAME ], { "Yes", "No!" } ) ) IF HC_CopyFile( aPanels[ idPanelRight ][ _cCurrentDir ] + aPanels[ idPanelRight ][ _aDirectory ][ nPos ][ F_NAME ], ; aPanels[ idPanelLeft ][ _cCurrentDir ] + aPanels[ idPanelRight ][ _aDirectory ][ nPos ][ F_NAME ] ) == 0 PanelRefresh( GetPanels[ idPanelLeft ] ) ELSE IF ( nErrorCode := AScan( FileError(), {| x | x[ 1 ] == FError() } ) ) > 0 HC_Alert( "Error", "Test for errors after a binary file operation.;The file can not be copied;" + FileError()[ nErrorCode ][ MEANING ] ) ELSE HC_Alert( "Error", "Test for errors after a binary file operation.;The file can not be copied;" + hb_ntos( FError() ) ) ENDIF ENDIF ENDIF ELSE IF HB_ISSTRING( MsgBox( "Copy directory " + '"' + aPanels[ idPanelRight ][ _aDirectory ][ nPos ][ F_NAME ] + '"' + " to", ; aPanels[ idPanelLeft ][ _cCurrentDir ], { "Yes", "No!" } ) ) IF HC_CopyDirectory( aPanels[ idPanelRight ][ _cCurrentDir ] + aPanels[ idPanelRight ][ _aDirectory ][ nPos ][ F_NAME ], ; aPanels[ idPanelLeft ][ _cCurrentDir ] ) == 0 // ? PanelRefresh( GetPanels[ idPanelLeft ] ) ELSE IF ( nErrorCode := AScan( FileError(), {| x | x[ 1 ] == FError() } ) ) > 0 HC_Alert( "Error", "Test for errors after a binary file operation.;The directory can not be copied;" + FileError()[ nErrorCode ][ MEANING ] ) ELSE HC_Alert( "Error", "Test for errors after a binary file operation.;The directory can not be copied;" + hb_ntos( FError() ) ) ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF RETURN STATIC PROCEDURE FunctionKey_F6( aPanel ) LOCAL nPos LOCAL nErrorCode nPos := aPanel[ _nRowBar ] + aPanel[ _nRowNo ] IF aPanel[ _aDirectory ][ nPos ][ F_NAME ] == ".." HC_Alert( "Rename or move", "The item to be copy has not been selected.",, 0x8f ) ELSE IF aPanel == aPanels[ idPanelLeft ] /* if we stand on a file */ IF At( "D", aPanel[ _aDirectory ][ nPos ][ F_ATTR ] ) == 0 IF HB_ISSTRING( MsgBox( "Move file " + '"' + aPanels[ idPanelLeft ][ _aDirectory ][ nPos ][ F_NAME ] + '"' + " to", ; aPanels[ idPanelRight ][ _cCurrentDir ], { "Yes", "No!" } ) ) IF HC_CopyFile( aPanels[ idPanelLeft ][ _cCurrentDir ] + aPanels[ idPanelLeft ][ _aDirectory ][ nPos ][ F_NAME ], ; aPanels[ idPanelRight ][ _cCurrentDir ] + aPanels[ idPanelLeft ][ _aDirectory ][ nPos ][ F_NAME ] ) == 0 PanelRefresh( GetPanels[ idPanelRight ] ) IF hb_DirRemoveAll( aPanels[ idPanelLeft ][ _cCurrentDir ] + aPanels[ idPanelLeft ][ _aDirectory ][ nPos ][ F_NAME ] ) == .T. PanelRefresh( GetPanels[ idPanelLeft ] ) ELSE IF ( nErrorCode := AScan( FileError(), {| x | x[ 1 ] == FError() } ) ) > 0 HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make file, error:;" + FileError()[ nErrorCode ][ MEANING ] ) ELSE HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make file, error:;" + hb_ntos( FError() ) ) ENDIF ENDIF ELSE IF ( nErrorCode := AScan( FileError(), {| x | x[ 1 ] == FError() } ) ) > 0 HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make file, error:;" + FileError()[ nErrorCode ][ MEANING ] ) ELSE HC_Alert( "Error", "Test for errors after a binary file operation.;annot make file, error:;" + hb_ntos( FError() ) ) ENDIF ENDIF ENDIF ELSE IF HB_ISSTRING( MsgBox( "Move directory " + '"' + aPanels[ idPanelLeft ][ _aDirectory ][ nPos ][ F_NAME ] + '"' + " to", ; aPanels[ idPanelRight ][ _cCurrentDir ], { "Yes", "No!" } ) ) IF HC_CopyDirectory( aPanels[ idPanelLeft ][ _cCurrentDir ] + aPanels[ idPanelLeft ][ _aDirectory ][ nPos ][ F_NAME ], ; aPanels[ idPanelRight ][ _cCurrentDir ] ) == 0 // ? PanelRefresh( GetPanels[ idPanelRight ] ) IF hb_DirRemoveAll( aPanels[ idPanelLeft ][ _cCurrentDir ] + aPanels[ idPanelLeft ][ _aDirectory ][ nPos ][ F_NAME ] ) == .T. PanelRefresh( GetPanels[ idPanelLeft ] ) ELSE IF ( nErrorCode := AScan( FileError(), {| x | x[ 1 ] == FError() } ) ) > 0 HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make directory, error:;" + FileError()[ nErrorCode ][ MEANING ] ) ELSE HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make directory, error:;" + hb_ntos( FError() ) ) ENDIF ENDIF ELSE IF ( nErrorCode := AScan( FileError(), {| x | x[ 1 ] == FError() } ) ) > 0 HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make directory, error:;" + FileError()[ nErrorCode ][ MEANING ] ) ELSE HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make directory, error:;" + hb_ntos( FError() ) ) ENDIF ENDIF ENDIF ENDIF ELSE /* if we stand on a file */ IF At( "D", aPanel[ _aDirectory ][ nPos ][ F_ATTR ] ) == 0 IF HB_ISSTRING( MsgBox( "Move file " + '"' + aPanels[ idPanelRight ][ _aDirectory ][ nPos ][ F_NAME ] + '"' + " to", ; aPanels[ idPanelLeft ][ _cCurrentDir ], { "Yes", "No!" } ) ) IF HC_CopyFile( aPanels[ idPanelRight ][ _cCurrentDir ] + aPanels[ idPanelRight ][ _aDirectory ][ nPos ][ F_NAME ], ; aPanels[ idPanelLeft ][ _cCurrentDir ] + aPanels[ idPanelRight ][ _aDirectory ][ nPos ][ F_NAME ] ) == 0 PanelRefresh( GetPanels[ idPanelLeft ] ) IF hb_DirRemoveAll( aPanels[ idPanelRight ][ _cCurrentDir ] + aPanels[ idPanelRight ][ _aDirectory ][ nPos ][ F_NAME ] ) == .T. PanelRefresh( GetPanels[ idPanelRight ] ) ELSE IF ( nErrorCode := AScan( FileError(), {| x | x[ 1 ] == FError() } ) ) > 0 HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make file, error:;" + FileError()[ nErrorCode ][ MEANING ] ) ELSE HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make file, error:;" + hb_ntos( FError() ) ) ENDIF ENDIF ELSE IF ( nErrorCode := AScan( FileError(), {| x | x[ 1 ] == FError() } ) ) > 0 HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make file, error:;" + FileError()[ nErrorCode ][ MEANING ] ) ELSE HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make file, error:;" + hb_ntos( FError() ) ) ENDIF ENDIF ENDIF ELSE IF HB_ISSTRING( MsgBox( "Move directory " + '"' + aPanels[ idPanelRight ][ _aDirectory ][ nPos ][ F_NAME ] + '"' + " to", ; aPanels[ idPanelLeft ][ _cCurrentDir ], { "Yes", "No!" } ) ) IF HC_CopyDirectory( aPanels[ idPanelRight ][ _cCurrentDir ] + aPanels[ idPanelRight ][ _aDirectory ][ nPos ][ F_NAME ], ; aPanels[ idPanelLeft ][ _cCurrentDir ] ) == 0 // ? PanelRefresh( GetPanels[ idPanelLeft ] ) IF hb_DirRemoveAll( aPanels[ idPanelRight ][ _cCurrentDir ] + aPanels[ idPanelRight ][ _aDirectory ][ nPos ][ F_NAME ] ) == .T. PanelRefresh( GetPanels[ idPanelRight ] ) ELSE IF ( nErrorCode := AScan( FileError(), {| x | x[ 1 ] == FError() } ) ) > 0 HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make directory, error:;" + FileError()[ nErrorCode ][ MEANING ] ) ELSE HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make directory, error:;" + hb_ntos( FError() ) ) ENDIF ENDIF ELSE IF ( nErrorCode := AScan( FileError(), {| x | x[ 1 ] == FError() } ) ) > 0 HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make directory, error:;" + FileError()[ nErrorCode ][ MEANING ] ) ELSE HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make directory, error:;" + hb_ntos( FError() ) ) ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF /* if we remove being the RowBar indicator in the last position then - 1 */ // IF Len( aPanel[ _aDirectory ] ) < aPanel[ _nRowBar ] + aPanel[ _nRowNo ] // aPanel[ _nRowBar ] -= 1 // ENDIF RETURN STATIC PROCEDURE FunctionKey_F7( aPanel ) LOCAL cNewDir LOCAL nErrorCode IF HB_ISSTRING( cNewDir := MsgBox( "Create the directory.", NIL, { "Yes", "No!" } ) ) IF hb_vfDirMake( aPanel[ _cCurrentDir ] + cNewDir ) == 0 PanelRefresh( GetPanels, cNewDir ) ELSE IF ( nErrorCode := AScan( FileError(), {| x | x[ 1 ] == FError() } ) ) > 0 HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make directory, error:;" + FileError()[ nErrorCode ][ MEANING ] ) ELSE HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make directory, error:;" + hb_ntos( FError() ) ) ENDIF ENDIF ENDIF RETURN STATIC PROCEDURE FunctionKey_F8( aPanel ) LOCAL nPos LOCAL nErrorCode nPos := aPanel[ _nRowBar ] + aPanel[ _nRowNo ] IF aPanel[ _aDirectory ][ nPos ][ F_NAME ] == ".." HC_Alert( "Up Directory", "The item to be deleted has not been selected." ) ELSE nPos := aPanel[ _nRowBar ] + aPanel[ _nRowNo ] /* if we stand on a file */ IF At( "D", aPanel[ _aDirectory ][ nPos ][ F_ATTR ] ) == 0 /* Marking the deletion status of the current item in the table */ IF GetPanelActive[ _aDirectory ][ nPos ][ F_STATUS ] GetPanelActive[ _aDirectory ][ nPos ][ F_STATUS ] := .F. ENDIF PanelDisplay( aPanel ) IF HC_Alert( "Delete file", "Do you really want to delete the selected file:;" + '"' + aPanel[ _aDirectory ][ nPos ][ F_NAME ] + '"', { "Yes", "No!" } ) == 1 // IF hb_vfErase( aPanel[ _cCurrentDir ] + aPanel[ _aDirectory ][ nPos ][ F_NAME ] ) == 0 IF HC_DeleteFile( GetPanelActive ) == 0 PanelRefresh( GetPanels ) ELSE IF ( nErrorCode := AScan( FileError(), {| x | x[ 1 ] == FError() } ) ) > 0 HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make file, error:;" + FileError()[ nErrorCode ][ MEANING ] ) ELSE HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make file, error:;" + hb_ntos( FError() ) ) ENDIF ENDIF ELSE /* return the delete status of the current item in the array */ GetPanelActive[ _aDirectory ][ nPos ][ F_STATUS ] := .T. ENDIF ELSE /* if we stand on the catalog */ IF HC_Alert( "Down Directory", "Do you really want to delete the selected directory:;" + '"' + aPanel[ _aDirectory ][ nPos ][ F_NAME ] + '"', { "Yes", "No!" }, 0x9f ) == 1 IF hb_vfDirRemove( aPanel[ _cCurrentDir ] + aPanel[ _aDirectory ][ nPos ][ F_NAME ] ) == 0 PanelRefresh( aPanel ) ELSE IF HC_Alert( "Down Directory", "The following subdirectory is not empty. ;" + ; '"' + aPanel[ _aDirectory ][ nPos ][ F_NAME ] + '"' + ";" + ; "Do you still wish to delete it?", { "Delete", "No!" } ) == 1 IF hb_DirRemoveAll( aPanel[ _cCurrentDir ] + aPanel[ _aDirectory ][ nPos ][ F_NAME ] ) == .T. PanelRefresh( aPanel ) ELSE IF ( nErrorCode := AScan( FileError(), {| x | x[ 1 ] == FError() } ) ) > 0 HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make directory, error:;" + FileError()[ nErrorCode ][ MEANING ] ) ELSE HC_Alert( "Error", "Test for errors after a binary file operation.;Cannot make directory, error:;" + hb_ntos( FError() ) ) ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF /* if we remove being the RowBar + RowNo indicator in the last position then - 1 */ // IF Len( aPanel[ _aDirectory ] ) < aPanel[ _nRowBar ] + aPanel[ _nRowNo ] // aPanel[ _nRowBar ] -= 1 // ENDIF RETURN STATIC PROCEDURE FunctionKey_F9( ) LOCAL nTop, nLeft, nRight LOCAL /*cScreen,*/ cScreenSub LOCAL nKey, nKeyStd LOCAL lReDraw := .T. LOCAL lContinue := .T. LOCAL i LOCAL iMenu := 1 LOCAL aF9Menu := { "Left", "Option", "Right" } LOCAL aF9MenuPos := { 1 } LOCAL aF9SubMenu := { "Option" => { "Panel settings", "Save settings" } } LOCAL nResult LOCAL nBottomSub LOCAL nLeftSub nTop := 0 nLeft := 0 WSelect( 0 ) nRight := MaxCol() aEval( aF9Menu, {| x, y | Aadd( aF9MenuPos, aF9MenuPos[ y ] + Len( x ) + 1 ) },, Len( aF9Menu ) - 1 ) // cScreen := SaveScreen( nTop, nLeft, nTop, nRight ) // hb_DispBox( nTop, nLeft, nTop, nRight, hb_UTF8ToStrBox( " █ " ), 0x22 ) WOpen( nTop, nLeft, nTop, nRight ) hb_DispBox( 0, 0, nTop, nRight, hb_UTF8ToStrBox( " █ " ), 0x22 ) DO WHILE lContinue IF lReDraw DispBegin() FOR EACH i IN aF9Menu hb_DispOutAt( nTop, aF9MenuPos[ i:__enumIndex ], i, iif( i:__enumIndex == iMenu, 0x8f, 0x20 ) ) NEXT DispEnd() lReDraw := .F. ENDIF nKey := Inkey( 0 ) nKeyStd := hb_keyStd( nKey ) SWITCH nKeyStd CASE K_ESC lContinue := .F. ShoWSession() EXIT CASE K_LEFT iMenu -- IF iMenu < 1 iMenu := Len( aF9Menu ) ENDIF lReDraw := .T. EXIT CASE K_RIGHT iMEnu ++ IF iMenu > Len( aF9Menu ) iMenu := 1 ENDIF lReDraw := .T. EXIT CASE K_ENTER IF HB_HHasKey( aF9SubMenu, aF9Menu[ iMenu ] ) nLeftSub := 0 nBottomSub := Min( nTop + 1 + Len( aF9SubMenu[ aF9Menu[ iMenu ] ] ) + 1, MaxRow() ) aEval( aF9SubMenu[ aF9Menu[ iMenu ] ], {| x | nLeftSub := Max( Len( x ), nLeftSub ) } ) nLeftSub := Min( aF9MenuPos[ iMenu ] + nLeftSub + 1, MaxCol() ) cScreenSub := SaveScreen( nTop + 1, aF9MenuPos[ iMenu ], nBottomSub, nLeftSub ) hb_DispBox( nTop + 1, aF9MenuPos[ iMenu ], nBottomSub, nLeftSub, HB_B_DOUBLE_UNI + " " /*hb_UTF8ToStrBox( " _ " )*/, 0x8a ) nResult := Achoice( nTop + 2, aF9MenuPos[ iMenu ] + 1, nBottomSub -1, nLeftSub - 1, aF9SubMenu[ aF9Menu[ iMenu ] ] ) if nResult > 0 HC_ALERT( "SubMenu", "Your choice is '" + aF9SubMenu[ aF9Menu[ iMenu ] ][ nResult ] + "'" ) endif RestScreen( nTop + 1, aF9MenuPos[ iMenu ], nBottomSub, nLeftSub, cScreenSub ) ELSE HC_ALERT( "Warning", "Not implemented yet",, 0x8f ) ENDIF EXIT ENDSWITCH ENDDO // RestScreen( nTop, nLeft, nTop, nRight, cScreen ) RETURN // STATIC PROCEDURE FunctionKey_F10( aPanel ) // RETURN STATIC FUNCTION HC_CopyFile( cSourceFile, cTargetFile ) LOCAL nRow, nCol LOCAL nWidth LOCAL nTop, nLeft, nBottom, nRight LOCAL cScreen LOCAL nReturn := 0 LOCAL nMaxRow := MaxRow(), nMaxCol := MaxCol() LOCAL pSource LOCAL pTarget LOCAL nPosition LOCAL nBufferSize := 65536 LOCAL cBuffer LOCAL tsDateTime LOCAL nFileSize nWidth := Max( Len( cSourceFile ), Len( cTargetFile ) ) + 2 nRow := Int( nMaxRow / 3 ) nCol := Int( ( nMaxCol - nWidth ) / 2 ) nTop := nRow nLeft := nCol - 1 nBottom := nRow + 7 nRight := nCol + nWidth cScreen := SaveScreen( nTop, nLeft, nBottom + 1, nRight + 2 ) hb_DispBox( nTop, nLeft, nBottom, nRight, HB_B_DOUBLE_UNI + " ", 0x8f ) hb_Shadow( nTop, nLeft, nBottom, nRight ) cBuffer := Space( nBufferSize ) /* file is opened for reading, do not deny any further attempts to open the file */ IF ( pSource := hb_vfOpen( cSourceFile, FO_READ + FO_SHARED + FXO_SHARELOCK ) ) != NIL /* shared lock, file is opened for writing, deny further attempts to open the file, emulate DOS SH_DENY* mode in POSIX OS */ IF ( pTarget := hb_vfOpen( cTargetFile, FO_CREAT + FO_WRITE + FO_EXCLUSIVE + FXO_SHARELOCK ) ) != NIL hb_DispOutAt( ++nRow, nCol, PadC( "Copying the file", nWidth ), 0x8f ) hb_DispOutAt( ++nRow, nCol, PadC( cSourceFile, nWidth ), 0x8f ) hb_DispOutAt( ++nRow, nCol, PadC( "to", nWidth ), 0x8f ) hb_DispOutAt( ++nRow, nCol, PadC( cTargetFile, nWidth ), 0x8f ) /* FS_SET Seek from beginning of file, FS_END Seek from end of file */ nPosition := hb_vfSeek( pSource, FS_SET, FS_END ) nFileSize := nPosition hb_vfSeek( pSource, FS_SET ) DO WHILE ( nPosition > FS_SET ) IF nPosition < nBufferSize nBufferSize := nPosition ENDIF IF nBufferSize != hb_vfRead( pSource, @cBuffer, nBufferSize ) nReturn := FError() EXIT ENDIF IF nBufferSize != hb_vfWrite( pTarget, @cBuffer, nBufferSize ) nReturn := FError() EXIT ENDIF nPosition -= nBufferSize DispBegin() hb_DispOutAt( ++nRow, nCol, PadC( hb_ntos( 100 * ( nFileSize - nPosition ) / nFileSize ) + " %", nWidth ), 0x8a ) hb_DispOutAt( ++nRow, nCol, Replicate( " ", nWidth ), 0x0 ) hb_DispOutAt( nRow, nCol, Replicate( " ", nWidth * ( nFileSize - nPosition ) / nFileSize ), 0x22 ) DispEnd() nRow := Int( nMaxRow / 3 ) + 4 ENDDO hb_vfClose( pTarget ) hb_vfClose( pSource ) /* get date file time, set date file time */ hb_vfTimeGet( cSourceFile, @tsDateTime ) hb_vfTimeSet( cTargetFile, tsDateTime ) ELSE hb_vfClose( pSource ) nReturn := FError() ENDIF ENDIF RestScreen( nTop, nLeft, nBottom + 1, nRight + 2, cScreen ) RETURN nReturn STATIC FUNCTION HC_CopyDirectory( cSourceFile, cTargetFile ) LOCAL aCatalog LOCAL nRows LOCAL i LOCAL cSubCat cSubCat := hb_FNameNameExt( cSourceFile ) IF hb_DirCreate( cTargetFile + cSubCat ) != 0 RETURN FError() ENDIF aCatalog := hb_vfDirectory( cSourceFile + hb_ps(), "HSD" ) nRows := Len( aCatalog ) FOR i := 1 TO nRows IF aCatalog[ i ][ F_NAME ] == "." .OR. aCatalog[ i ][ F_NAME ] == ".." ELSEIF "D" $ aCatalog[ i ][ F_ATTR ] IF HC_CopyDirectory( cSourceFile + hb_ps() + aCatalog[ i ][ F_NAME ], cTargetFile + cSubCat + hb_ps() ) == -1 RETURN FError() ENDIF ELSE IF HC_CopyFile( cSourceFile + hb_ps() + aCatalog[ i ][ F_NAME ], cTargetFile + cSubCat + hb_ps() + aCatalog[ i ][ F_NAME ] ) != 0 RETURN FError() ENDIF ENDIF NEXT RETURN 0 STATIC FUNCTION HC_DeleteFile( aPanel ) // ? LOCAL i FOR i := 1 TO Len( aPanel[ _aDirectory ] ) IF aPanel[ _aDirectory ][ i ][ F_STATUS ] == .F. DO WHILE hb_vfErase( aPanel[ _cCurrentDir ] + aPanel[ _aDirectory ][ i ][ F_NAME ] ) == -1 // ? RETURN FError() ENDDO /* if we remove being the RowBar or RowBar + RowNo indicator in the last position then - 1 */ // IF Len( aPanel[ _aDirectory ] ) < aPanel[ _nRowBar ] + aPanel[ _nRowNo ] // how to remove nRowNo nRowBar? aPanel[ _nRowBar ] -= 1 // ENDIF ENDIF NEXT RETURN 0 STATIC PROCEDURE PanelDisplay( aPanel ) LOCAL nRow, nPos := 1 LOCAL nLengthName := 4 /* 4 is len of top element ".." plus brackets "[" and "]" */ LOCAL nLengthSize := 0 AScan( aPanel[ _aDirectory ], {| x | ; nLengthName := Max( nLengthName, Len( x[ 1 ] ) ), ; nLengthSize := Max( nLengthSize, Len( Str( x[ 2 ] ) ) ) } ) IF aPanel[ _nWinHndl ] == NIL SetColor( NToColor( 0x1f ) ) aPanel[ _nWinHndl ] := WOpen( aPanel[ _nTop ], aPanel[ _nLeft ], aPanel[ _nBottom ], aPanel[ _nRight ] ) // SetCursor( SC_NONE ) //@-1,1 say hb_ntos( aPanel[ _nWinHndl ] ) + ", " + hb_ntos( wselect() ) ELSE WSelect( aPanel[ _nWinHndl ] ) hb_Scroll() ENDIF WFormat() IF GetPanels[ idPanelActive ] == aPanel[ _nIdPanel ] WBox( ) ELSE WBox( 1 ) ENDIF DispBegin() nPos += aPanel[ _nRowNo ] FOR nRow := aPanel[ _nTop ] TO aPanel[ _nBottom ] - 1 IF nPos <= Len( aPanel[ _aDirectory ] ) hb_DispOutAt( nRow, 0, ; PadR( Expression( nLengthName, nLengthSize, ; aPanel[ _aDirectory ][ nPos ][ F_NAME ], ; aPanel[ _aDirectory ][ nPos ][ F_SIZE ], ; aPanel[ _aDirectory ][ nPos ][ F_DATE ], ; aPanel[ _aDirectory ][ nPos ][ F_ATTR ] ), ; aPanel[ _nRight ] - aPanel[ _nLeft ] - 1 ), ; iif( GetPanelActive[ _nIdPanel ] == aPanel[ _nIdPanel ] .AND. nPos == aPanel[ _nRowBar ] + aPanel[ _nRowNo ], ; iif( ! aPanel[ _aDirectory ][ nPos ][ F_STATUS ], 0x3e, 0x30 ), ; ColoringSyntax( aPanel[ _aDirectory ][ nPos ][ F_ATTR ], aPanel[ _aDirectory ][ nPos ][ F_STATUS ] ) ) ) ++nPos ELSE EXIT ENDIF NEXT PanelTitleDisplay( aPanel ) DispEnd() RETURN STATIC PROCEDURE ComdLineDisplay( ) LOCAL cPromptEnd LOCAL aPanel := GetPanelActive IF "Windows" $ os() cPromptEnd := ">" ELSE cPromptEnd := "$" ENDIF IF aConfig[ nCmdHndl ] == NIL /* Create the first window (handle is 1), it's for commands, outputs, etc... It has initial size is one row from 0 to maxcol() at maxrow() - 1 position */ IF ( aConfig[ nCmdHndl ] := wOpen( aConfig[ _nMaxRow ] - 1, 0, aConfig[ _nMaxRow ] - 1, aConfig[ _nMaxCol ] ) ) == -1 /* if can't create a window, stop app */ RETURN ENDIF ELSE WSelect( aConfig[ nCmdHndl ] ) ENDIF DispBegin() hb_DispOutAt( 0, 0, ; PadR( aPanel[ _cCurrentDir ] + cPromptEnd + SubStr( aPanel[ _cComdLine ], 1 + aPanel[ _nComdColNo ], MaxCol() + aPanel[ _nComdColNo ] ), MaxCol() ), 0x7 ) SetPos( 0, aPanel[ _nComdCol ] + Len( aPanel[ _cCurrentDir ] ) + 1 ) DispEnd() RETURN STATIC PROCEDURE PanelTitleDisplay( aPanel ) LOCAL cPanelTitle := aPanel[ _cCurrentDir ] LOCAL nWidthPanel nWidthPanel := WLastCol() - WCol() - 1 /*aPanel[ _nRight ] - aPanel[ _nLeft ] - 2*/ IF Len( cPanelTitle ) < nWidthPanel cPanelTitle := PadR( aPanel[ _cCurrentDir ], Min( Len( aPanel[ _cCurrentDir ] ), nWidthPanel ), Space( 1 ) ) ELSE cPanelTitle := SubStr( cPanelTitle, 1, 3 ) + "..." + Right( cPanelTitle, nWidthPanel - 5 ) ENDIF DispBegin() hb_DispOutAt( -1, 0, cPanelTitle, "W/B" ) DispEnd() RETURN STATIC FUNCTION Expression( nLengthName, nLengthSize, cName, cSize, dDate, cAttr ) LOCAL cFileName, cFileSize, dFileDate, cFileAttr cFileName := PadR( cName + Space( nLengthName ), nLengthName ) + " " IF cName == ".." cFileName := PadR( "[" + AllTrim( cFileName ) + "]" + Space( nLengthName ), nLengthName ) + " " ENDIF IF cAttr == "D" .OR. cAttr == "HD" .OR. cAttr == "HSD" .OR. cAttr == "HSDL" .OR. cAttr == "RHSA" .OR. cAttr == "RD" .OR. cAttr == "AD" .OR. cAttr == "RHD" cFileSize := PadL( Iif( rTrim( cFileName ) == "[..]", "UP--DIR", "DIR"), nLengthSize + 3 ) + " " ELSE cFileSize := PadL( Transform( cSize, "9 999 999 999" ), nLengthSize + 3 ) + " " ENDIF dFileDate := hb_TToC( dDate ) + " " cFileAttr := PadL( cAttr, 3 ) RETURN cFileName + cFileSize + dFileDate + cFileAttr STATIC FUNCTION ColoringSyntax( cAttr, lStatus ) LOCAL nColor IF cAttr == "HD" .OR. cAttr == "HSD" .OR. cAttr == "HSDL" .OR. cAttr == "RHSA" .OR. cAttr == "RD" nColor := 0x13 ELSE nColor := 0x1f ENDIF IF ! lStatus nColor := 0x1e ENDIF RETURN nColor STATIC PROCEDURE PanelRefresh( aPanel, nRowBar2cDir ) LOCAL _nRowBarNew IF GetPanels[ idPanelLeft ][ _cCurrentDir ] == GetPanels[ idPanelRight ][ _cCurrentDir ] PanelFetchList( GetPanels[ idPanelLeft ], GetPanels[ idPanelLeft ][ _cCurrentDir ] ) PanelFetchList( GetPanels[ idPanelRight ], GetPanels[ idPanelRight ][ _cCurrentDir ] ) IF HB_ISSTRING( nRowBar2cDir ) _nRowBarNew := GetRowBarPos( GetPanels[ idPanelLeft ], nRowBar2cDir ) GetPanels[ idPanelLeft ][ _nRowBar ] := _nRowBarNew GetPanels[ idPanelRight ][ _nRowBar ] := _nRowBarNew ENDIF PanelDisplay( GetPanels[ idPanelLeft ] ) PanelDisplay( GetPanels[ idPanelRight ] ) ELSE PanelFetchList( aPanel, aPanel[ _cCurrentDir ] ) IF HB_ISSTRING( nRowBar2cDir ) _nRowBarNew := GetRowBarPos( aPanel, nRowBar2cDir ) aPanel[ _nRowBar ] := _nRowBarNew ENDIF PanelDisplay( aPanel ) ENDIF RETURN STATIC FUNCTION GetRowBarPos( aPanel, nRowBar2cDir ) LOCAL nPos nPos := Ascan( aPanel[ _aDirectory ], {| x | x[ F_NAME ] == nRowBar2cDir } ) RETURN iif( nPos == 0, 1, nPos ) PROCEDURE ShowSession( nMode ) LOCAL aWin IF nMode == NIL aWin := {; iif( IsPanelActive( idPanelLeft ), GetPanels[ idPanelRight, _nWinHndl ], GetPanels[ idPanelLeft, _nWinHndl ] ),; iif( IsPanelActive( idPanelLeft ), GetPanels[ idPanelLeft, _nWinHndl ], GetPanels[ idPanelRight, _nWinHndl ] ) } WSelect( aWin[ 1 ] ) WSelect( aWin[ 2 ] ) ELSEIF nMode == 1 WSelect( 0, .T. ) ENDIF WSelect( aConfig[ nCmdHndl ] ) RETURN STATIC PROCEDURE ChangeDir( aPanel ) LOCAL nPos, cDir, cDir0 LOCAL nPosLast nPos := aPanel[ _nRowBar ] + aPanel[ _nRowNo ] IF At( "D", aPanel[ _aDirectory ][ nPos ][ F_ATTR ] ) == 0 RETURN ENDIF IF aPanel[ _aDirectory ][ nPos ][ F_NAME ] == ".." cDir := aPanel[ _cCurrentDir ] cDir0 := SubStr( cDir, RAt( hb_ps(), Left( cDir, Len( cDir ) - 1 ) ) + 1 ) cDir0 := SubStr( cDir0, 1, Len( cDir0 ) - 1 ) /*cDir*/ aPanel[ _cCurrentDir ] := Left( cDir, RAt( hb_ps(), Left( cDir, Len( cDir ) - 1 ) ) ) PanelFetchList( aPanel ) nPosLast := Max( AScan( aPanel[ _aDirectory ], {| x | x[ F_NAME ] == cDir0 } ), 1 ) IF nPosLast > GetPanelActive[ _nBottom ] - 1 GetPanelActive[ _nRowNo ] := nPosLast % ( GetPanelActive[ _nBottom ] - 1 ) GetPanelActive[ _nRowBar ] := GetPanelActive[ _nBottom ] - 1 ELSE GetPanelActive[ _nRowNo ] := 0 GetPanelActive[ _nRowBar ] := nPosLast ENDIF ELSE aPanel[ _cCurrentDir ] += aPanel[ _aDirectory ][ nPos ][ F_NAME ] + hb_ps() aPanel[ _nRowBar ] := 1 aPanel[ _nRowNo ] := 0 PanelFetchList( aPanel ) ENDIF RETURN STATIC FUNCTION AllDrives() LOCAL i LOCAL aArrayDrives := {} FOR i := 1 TO 26 IF DiskChange( Chr( i + 64 ) ) AAdd( aArrayDrives, Chr( i + 64 ) ) ENDIF NEXT RETURN aArrayDrives STATIC PROCEDURE BottomBar() LOCAL nRow LOCAL cSpaces LOCAL nCol IF aConfig[ nBBarHndl ] == NIL /* Create the window for bottom bar */ aConfig[ nBBarHndl ] := wOpen( aConfig[ _nMaxRow ], 0, aConfig[ _nMaxRow ], aConfig[ _nMaxCol ] ) ELSE WSelect( aConfig[ nBBarHndl ] ) ENDIF nRow := MaxRow() nCol := Int( MaxCol() / 10 ) + 1 cSpaces := Space( nCol - 8 ) hb_DispOutAt( nRow, 0, " 1", 0x7 ) hb_DispOutAt( nRow, 2, "Help " + cSpaces, 0x30 ) hb_DispOutAt( nRow, nCol, " 2", 0x7 ) hb_DispOutAt( nRow, nCol + 2, "Menu " + cSpaces, 0x30 ) hb_DispOutAt( nRow, nCol * 2, " 3", 0x7 ) hb_DispOutAt( nRow, nCol * 2 + 2, "View " + cSpaces, 0x30 ) hb_DispOutAt( nRow, nCol * 3, " 4", 0x7 ) hb_DispOutAt( nRow, nCol * 3 + 2, "Edit " + cSpaces, 0x30 ) hb_DispOutAt( nRow, nCol * 4, " 5", 0x7 ) hb_DispOutAt( nRow, nCol * 4 + 2, "Copy " + cSpaces, 0x30 ) hb_DispOutAt( nRow, nCol * 5, " 6", 0x7 ) hb_DispOutAt( nRow, nCol * 5 + 2, "RenMov" + cSpaces, 0x30 ) hb_DispOutAt( nRow, nCol * 6, " 7", 0x7 ) hb_DispOutAt( nRow, nCol * 6 + 2, "MkDir " + cSpaces, 0x30 ) hb_DispOutAt( nRow, nCol * 7, " 8", 0x7 ) hb_DispOutAt( nRow, nCol * 7 + 2, "Delete" + cSpaces, 0x30 ) hb_DispOutAt( nRow, nCol * 8, " 9", 0x7 ) hb_DispOutAt( nRow, nCol * 8 + 2, "PullDn" + cSpaces, 0x30 ) hb_DispOutAt( nRow, nCol * 9, "10", 0x7 ) hb_DispOutAt( nRow, nCol * 9 + 2, "Quit " + cSpaces, 0x30 ) RETURN STATIC FUNCTION MsgBox( cMessage, aMessage, aOptions ) LOCAL nMaxRow := 0, nMaxCol := 0 LOCAL cScreen LOCAL aOptionsOK := {}, aPosButtons LOCAL lContinue := .T. LOCAL i LOCAL nChoice := 1 LOCAL nOpWidth, nWidth, nInitCol, expValue LOCAL nOldRow, nOldCol LOCAL nKey, nKeyStd LOCAL cString LOCAL nCol := 0, nColNo := 0 nOldRow := Row() nOldCol := Col() FOR EACH i IN hb_defaultValue( aOptions, {} ) IF HB_ISSTRING( i ) .AND. ! i == "" AAdd( aOptionsOK, i ) ENDIF NEXT IF Len( aOptionsOK ) == 0 aOptionsOK := { "Ok" } ENDIF /* aMessage is not currently an array */ IF Empty( aMessage ) cString := "" ELSE cString := aMessage nCol := Len( aMessage ) ENDIF DO WHILE lContinue DispBegin() IF nMaxRow != Int( MaxRow() / 3 ) .OR. nMaxCol != Int( MaxCol() / 2 ) nMaxRow := Int( MaxRow() / 3 ) nMaxCol := Int( MaxCol() / 2 ) aPosButtons := {} nOpWidth := 0 cScreen := SaveScreen( nMaxRow - 2, nMaxCol - 36, nMaxRow + 4, nMaxCol + 38 ) AEval( aOptionsOK, {| x | nOpWidth += Len( x ) + 4 } ) nWidth := nOpWidth + 2 nInitCol := Int( ( ( MaxCol() - ( nWidth + 2 ) ) / 2 ) + 0.5 ) expValue := nInitCol + Int( ( nWidth - nOpWidth ) / 2 ) + 2 AEval( aOptionsOK, {| x | AAdd( aPosButtons, expValue ), expValue += Len( x ) + 4 } ) hb_DispBox( nMaxRow - 2, nMaxCol - 36, nMaxRow + 3, nMaxCol + 36, HB_B_SINGLE_UNI + " ", 0x8f ) hb_Shadow( nMaxRow - 2, nMaxCol - 36, nMaxRow + 3, nMaxCol + 36 ) hb_DispOutAt( nMaxRow - 1, nMaxCol - 34, cMessage, 0x8f ) FOR i := 1 TO Len( aOptionsOK ) hb_DispOutAt( nMaxRow + 2, aPosButtons[ i ], " " + aOptionsOK[ i ] + " ", iif( i == nChoice, 0x07, 0x8f ) ) NEXT MsgBoxDisplay( cString, nCol, nColNo ) ENDIF DispEnd() MsgBoxDisplay( cString, nCol, nColNo ) nKey := Inkey( 0 ) nKeyStd := hb_keyStd( nKey ) SWITCH nKeyStd CASE K_ESC lContinue := .F. nChoice := 0 EXIT CASE K_ENTER lContinue := .F. EXIT CASE K_F1 EXIT CASE K_F10 lContinue := .F. nChoice := 0 EXIT CASE K_LEFT IF nCol > 0 nCol-- ELSE IF nColNo >= 1 nColNo-- ENDIF ENDIF EXIT CASE K_RIGHT IF nCol < 68 .AND. nCol < Len( cString ) nCol++ ELSE IF nColNo + nCol < Len( cString ) nColNo++ ENDIF ENDIF EXIT CASE K_HOME nCol := 0 EXIT CASE K_END nCol := Len( cString ) EXIT CASE K_DEL IF nCol >= 0 cString := Stuff( cString, nCol + 1, 1, "" ) ENDIF EXIT CASE K_BS IF nCol > 0 cString := Stuff( cString, nCol, 1, "" ) nCol-- ENDIF EXIT CASE K_TAB IF Len( aOptionsOK ) > 1 nChoice++ IF nChoice > Len( aOptionsOK ) nChoice := 1 ENDIF ENDIF FOR i := 1 TO Len( aOptionsOK ) hb_DispOutAt( nMaxRow + 2, aPosButtons[ i ], " " + aOptionsOK[ i ] + " ", iif( i == nChoice, 0x07, 0x8f ) ) NEXT EXIT CASE HB_K_RESIZE hb_Scroll() AutoSize() PanelDisplay( aPanels[ idPanelLeft ] ) PanelDisplay( aPanels[ idPanelRight ] ) ComdLineDisplay( ) BottomBar() EXIT OTHERWISE IF ( nKeyStd >= 32 .AND. nKeyStd <= 126 ) .OR. ( nKeyStd >= 160 .AND. nKeyStd <= 255 ) .OR. ! hb_keyChar( nKeyStd ) == "" cString := Stuff( cString, nCol + nColNo + 1, 0, hb_keyChar( nKeyStd ) ) IF nCol < 68 nCol++ ELSE nColNo++ ENDIF ENDIF ENDSWITCH ENDDO RestScreen( nMaxRow - 2, nMaxCol - 36, nMaxRow + 4, nMaxCol + 38, cScreen ) SetPos( nOldRow, nOldCol ) RETURN iif( nChoice == 1, iif( Empty( cString ), 0, cString ), 0 ) // ?? STATIC PROCEDURE MsgBoxDisplay( cString, nCol, nColNo ) LOCAL nMaxRow := Int( MaxRow() / 3 ), nMaxCol := Int( MaxCol() / 2 ) DispBegin() hb_DispOutAt( nMaxRow, nMaxCol - 34, PadR( SubStr( cString, 1 + nColNo, 69 + nColNo ), 69 ) ) SetPos( nMaxRow, nMaxCol - 34 + nCol ) DispEnd() RETURN STATIC FUNCTION HC_Alert( cTitle, xMessage, xOptions, nColorNorm, nArg ) LOCAL nOldCursor := SetCursor( SC_NONE ) // LOCAL nRowPos := Row(), nColPos := Col() LOCAL aMessage, aOptions, aPos LOCAL nColorHigh LOCAL nLenOptions, nLenMessage LOCAL nWidth := 0 LOCAL nLenght := 0 LOCAL nPos LOCAL i LOCAL nMaxRow := 0, nMaxCol := 0 LOCAL nRow, nCol LOCAL nKey, nKeyStd LOCAL nTop, nLeft, nBottom, nRight LOCAL nChoice := 1 LOCAL nMRow, nMCol /* LOCAL nWinAlert */ DO CASE CASE ValType( cTitle ) == "U" cTitle := "OK" ENDCASE DO CASE CASE ValType( xMessage ) == "U" aMessage := { "" } CASE ValType( xMessage ) == "C" aMessage := hb_ATokens( xMessage, ";" ) CASE ValType( xMessage ) == "A" aMessage := xMessage CASE ValType( xMessage ) == "N" aMessage := hb_ATokens( hb_CStr( xMessage ) ) ENDCASE DO CASE CASE ValType( xOptions ) == "U" aOptions := { "OK" } CASE ValType( xOptions ) == "C" aOptions := hb_ATokens( xOptions, ";" ) CASE ValType( xOptions ) == "A" aOptions := xOptions ENDCASE DO CASE CASE ValType( nColorNorm ) == "U" nColorNorm := 0x4f nColorHigh := 0x1f CASE ValType( nColorNorm ) == "N" nColorNorm := hb_bitAnd( nColorNorm, 0xff ) nColorHigh := hb_bitAnd( hb_bitOr( hb_bitShift( nColorNorm, - 4 ), hb_bitShift( nColorNorm, 4 ) ), 0x77 ) ENDCASE nLenOptions := Len( aOptions ) FOR i := 1 TO nLenOptions nWidth += Len( aOptions[ i ] ) + 2 nLenght += Len( aOptions[ i ] ) + 2 NEXT /* in the loop I go through nWidth, I choose what is bigger */ nLenMessage := Len( aMessage ) FOR i := 1 TO nLenMessage nWidth := Max( nWidth, Len( aMessage[ i ] ) ) NEXT DO WHILE .T. DispBegin() /* save the second setting! */ IF nMaxRow != MaxRow( .T. ) .OR. nMaxCol != iif( nArg == NIL, MaxCol( .T. ), iif( nArg == 0x0, Int( MaxCol( .T. ) / 2 ), MaxCol( .T. ) + Int( MaxCol( .T. ) / 2 ) ) ) WSelect( 1 ) nMaxRow := MaxRow( .T. ) /* the last parameter sets the dialog box: NIL middle, 0x0 to the left and 0x1 to the right */ nMaxCol := iif( nArg == NIL, MaxCol( .T. ), iif( nArg == 0x0, Int( MaxCol( .T. ) / 2 ), MaxCol( .T. ) + Int( MaxCol( .T. ) / 2 ) ) ) nTop := Int( nMaxRow / 3 ) - 3 nLeft := Int( ( nMaxCol - nWidth ) / 2 ) - 2 nBottom := nTop + 4 + nLenMessage nRight := Int( ( nMaxCol + nWidth ) / 2 ) - 1 + 2 //WClose( 1 ) WSetShadow( 0x8 ) WOpen( nTop, nLeft, nBottom, nRight, .T. ) hb_DispBox( 0, 0, nMaxRow, nMaxCol, hb_UTF8ToStrBox( " █ " ), nColorNorm ) hb_DispOutAt( 0, 0, Center( cTitle ), hb_bitShift( nColorNorm, 4 ) ) FOR nPos := 1 TO Len( aMessage ) hb_DispOutAt( 1 + nPos, 0, Center( aMessage[ nPos ] ), nColorNorm ) NEXT ENDIF /* saves the coordinates of the aOptions buttons */ aPos := {} nRow := nPos + 2 nCol := Int( ( MaxCol() + 1 - nLenght - nLenOptions + 1 ) / 2 ) FOR i := 1 TO nLenOptions AAdd( aPos, nCol ) hb_DispOutAt( nRow, nCol, " " + aOptions[ i ] + " ", iif( i == nChoice, nColorHigh, nColorNorm ) ) nCol += Len( aOptions[ i ] ) + 3 NEXT DispEnd() nKey := Inkey( 0 ) nKeyStd := hb_keyStd( nKey ) DO CASE CASE nKeyStd == K_ESC nChoice := 0 EXIT CASE nKeyStd == K_ENTER .OR. nKeyStd == K_SPACE EXIT CASE nKeyStd == K_MOUSEMOVE FOR i := 1 TO nLenOptions IF MRow() == nPos + 2 .AND. MCol() >= aPos[ i ] .AND. MCol() <= aPos[ i ] + Len( aOptions[ i ] ) + 1 nChoice := i ENDIF NEXT CASE nKeyStd == K_LBUTTONDOWN nMCol := MCol() nMRow := MRow() IF MRow() == 0 .AND. MCol() >= 0 .AND. MCol() <= MaxCol() DO WHILE MLeftDown() WMove( WRow() + MRow() - nMRow, WCol() + MCol() - nMCol ) ENDDO ENDIF FOR i := 1 TO nLenOptions IF MRow() == nPos + 2 .AND. MCol() >= aPos[ i ] .AND. MCol() <= aPos[ i ] + Len( aOptions[ i ] ) + 1 nChoice := i EXIT ENDIF NEXT IF nChoice == i EXIT ENDIF CASE ( nKeyStd == K_LEFT .OR. nKeyStd == K_SH_TAB ) .AND. nLenOptions > 1 nChoice-- IF nChoice == 0 nChoice := nLenOptions ENDIF CASE ( nKeyStd == K_RIGHT .OR. nKeyStd == K_TAB ) .AND. nLenOptions > 1 nChoice++ IF nChoice > nLenOptions nChoice := 1 ENDIF CASE nKeyStd == K_CTRL_UP WMove( WRow() - 1, WCol() ) CASE nKeyStd == K_CTRL_DOWN WMove( WRow() + 1, WCol() ) CASE nKeyStd == K_CTRL_LEFT WMove( WRow(), WCol() - 1 ) CASE nKeyStd == K_CTRL_RIGHT WMove( WRow(), WCol() + 1 ) CASE nKeyStd == HB_K_RESIZE //WClose( 1 ) AutoSize() PanelDisplay( aPanels[ idPanelLeft ] ) PanelDisplay( aPanels[ idPanelRight ] ) ComdLineDisplay( ) BottomBar() ENDCASE ENDDO WClose( ) SetCursor( nOldCursor ) // SetPos( nRowPos, nColPos ) RETURN iif( nKey == 0, 0, nChoice ) STATIC FUNCTION HC_MenuF2() LOCAL cFile := "hc.menu" LOCAL cCopyExample := "" LOCAL i, aLine, aMenu := {}, cLine LOCAL nMaxRow := 0, nMaxCol := 0 LOCAL nRow := 1 LOCAL nKey, nKeyStd LOCAL nColLength := 0 LOCAL nTop, nLeft, nBottom, nRight LOCAL nChoice := 1 LOCAL nRowPos := 1, nColPos := 2 LOCAL nMRow, nMCol /* LOCAL nWinMnu */ IF ! hb_vfExists( StartUpPath() + "hc.menu" ) /* Example of menu structure, saves string to disk file, editing from file hc.menu */ cCopyExample += "F1:Compilation of my project in Harbour" + hb_eol() cCopyExample += Space( 8 ) + "hbmk2 hc.prg" + hb_eol() cCopyExample += "F2:Checking version of GCC compiler" + hb_eol() cCopyExample += Space( 8 ) + "gcc --version" + hb_eol() cCopyExample += "F3:What is my OS version" + hb_eol() cCopyExample += Space( 8 ) + "uname -a" /* If no path is specified, hb_MemoWrit () saves cCopyExample in the current directory */ hb_MemoWrit( StartUpPath() + "hc.menu", cCopyExample ) ENDIF aLine := hb_ATokens( hb_MemoRead( cFile ), .T. ) FOR i := 1 TO Len( aLine ) IF SubStr( aLine[ i ], 1, 1 ) == "F" AAdd( aMenu, aLine[ i ] ) ENDIF NEXT AScan( aMenu, {| str | nColLength := Max( nColLength, Len( str ) ) } ) DO WHILE .T. DispBegin() IF nMaxRow != MaxRow( .T. ) .OR. nMaxCol != MaxCol( .T. ) WSelect( 0 ) nMaxRow := MaxRow( .T. ) nMaxCol := MaxCol( .T. ) nTop := Int( nMaxRow / 3 ) - 3 nLeft := Int( ( nMaxCol - nColLength ) / 2 ) - 2 nBottom := nTop + 2 + Len( aMenu ) nRight := Int( ( nMaxCol + nColLength ) / 2 ) - 1 + 2 WSetShadow( 0x8 ) WOpen( nTop, nLeft, nBottom, nRight, .T. ) hb_DispBox( 0, 0, nMaxRow, nMaxCol, hb_UTF8ToStrBox( " █ " ), 0x9f ) hb_DispOutAt( 0, 0, Center( /*hb_UserName() +*/ "Main menu" ), 0xf0 ) hb_DispBox( 1, 0, MaxRow(), MaxCol(), HB_B_SINGLE_UNI, 0x9f ) ENDIF DispEnd() FOR EACH cLine IN aMenu hb_DispOutAt( nRowPos + cLine:__enumIndex(), nColPos, ; PadR( cLine, nColLength ), ; iif( cLine:__enumIndex() == nRow, 0xf, 0x9f ) ) iif( cLine:__enumIndex() == nRow, nChoice := cLine:__enumIndex(), NIL ) NEXT DispEnd() SetCursor( SC_NONE ) nKey := Inkey( 0 ) nKeyStd := hb_keyStd( nKey ) DO CASE CASE nKeyStd == K_ESC nChoice := 0 EXIT CASE nKeyStd == K_ENTER .OR. nKeyStd == K_SPACE EXIT CASE nKeyStd == K_MOUSEMOVE IF nRowPos < MRow() .AND. nColPos < MCol() .AND. nRowPos + Len( aMenu ) >= MRow() .AND. nColPos + nColLength > MCol() nRow := MRow() - nRowPos ENDIF CASE nKeyStd == K_LBUTTONDOWN nMCol := MCol() nMRow := MRow() IF MRow() == 0 .AND. MCol() >= 0 .AND. MCol() <= MaxCol() DO WHILE MLeftDown() WMove( WRow() + MRow() - nMRow, WCol() + MCol() - nMCol ) ENDDO ENDIF IF nRowPos < MRow() .AND. nColPos < MCol() .AND. nRowPos + Len( aMenu ) >= MRow() .AND. nColPos + nColLength > MCol() RETURN nChoice ENDIF CASE nKeyStd == K_MWFORWARD IF nRowPos < MRow() .AND. nColPos < MCol() .AND. nRowPos + Len( aMenu ) >= MRow() .AND. nColPos + nColLength > MCol() IF nRow > 1 nRow-- ELSE nRow := Len( aMenu ) ENDIF ENDIF CASE nKeyStd == K_MWBACKWARD IF nRowPos < MRow() .AND. nColPos < MCol() .AND. nRowPos + Len( aMenu ) >= MRow() .AND. nColPos + nColLength > MCol() IF nRow < Len( aMenu ) nRow++ ELSE nRow := 1 ENDIF ENDIF CASE nKeyStd == K_UP IF nRow > 1 nRow-- ELSE nRow := Len( aMenu ) ENDIF CASE nKeyStd == K_DOWN IF nRow < Len( aMenu ) nRow++ ELSE nRow := 1 ENDIF CASE nKeyStd == K_CTRL_UP WMove( WRow() - 1, WCol() ) CASE nKeyStd == K_CTRL_DOWN WMove( WRow() + 1, WCol() ) CASE nKeyStd == K_CTRL_LEFT WMove( WRow(), WCol() - 1 ) CASE nKeyStd == K_CTRL_RIGHT WMove( WRow(), WCol() + 1 ) CASE nKeyStd == HB_K_RESIZE WClose( ) AutoSize() PanelDisplay( aPanels[ idPanelLeft ] ) PanelDisplay( aPanels[ idPanelRight ] ) ComdLineDisplay( ) BottomBar() ENDCASE ENDDO WClose( ) RETURN iif( nKey == 0, 0, nChoice ) STATIC PROCEDURE HCEdit( cFileName, lArg ) LOCAL cString LOCAL aString LOCAL lContinue := .T. LOCAL nMaxRow := 0, nMaxCol := 0 LOCAL nRow := 1, nCol := 0, nRowNo := 0, nColNo := 0 LOCAL cStringEditingRow LOCAL cSubString LOCAL lToggleInsert := .F. LOCAL nKey, nKeyStd /* LOCAL nOldRow, nOldCol */ /* LOCAL cScreen */ LOCAL tsDateTime /* LOCAL nEdtHndl */ /* nOldRow := Row() nOldCol := Col() */ WOpen( 0, 0, aConfig[ _nMaxRow ], aConfig[ _nMaxCol ] ) IF HB_ISSTRING( cFileName ) // ? cString := hb_MemoRead( cFileName ) aString := hb_ATokens( cString, .T. ) DO WHILE lContinue IF nMaxRow != MaxRow() .OR. nMaxCol != MaxCol() nMaxRow := MaxRow() nMaxCol := MaxCol() IF nRow > nMaxRow - 1 nRow := nMaxRow - 1 ENDIF HCEditDisplay( aString, nRow, nCol, nRowNo ) ENDIF DispBegin() hb_DispOutAt( 0, 0, ; PadR( cFileName + " ", nMaxCol + 1 ), 0x30 ) HCEditDisplay( aString, nRow, nCol, nRowNo ) hb_vfTimeGet( cFileName, @tsDateTime ) hb_DispOutAt( nMaxRow, 0, ; PadR( " Row(" + hb_ntos( nRow + nRowNo ) + ") Col(" + hb_ntos( nCol + 1 ) + ") Size(" + hb_ntos( hb_vfSize( cFileName ) ) + ") Date(" + hb_TToC( tsDateTime ) + ")", nMaxCol + 1 ), 0x30 ) DispEnd() nKey := Inkey( 0 ) nKeyStd := hb_keyStd( nKey ) SWITCH nKeyStd CASE K_ESC lContinue := .F. EXIT CASE K_LBUTTONDOWN IF MRow() > 0 .AND. MCol() > 0 .AND. MRow() < Len( aString ) + 1 .AND. MCol() < nMaxCol nRow := MRow() nCol := Len( aString[ nRowNo + nRow ] ) ENDIF EXIT CASE K_MWFORWARD IF nRowNo >= 1 nRowNo-- ENDIF EXIT CASE K_MWBACKWARD IF nRow + nRowNo < Len( aString ) nRowNo++ ENDIF EXIT CASE K_UP IF nRow > 1 nRow-- ELSE IF nRowNo >= 1 nRowNo-- ENDIF ENDIF IF aString[ nRowNo + nRow ] == "" nCol := 0 ELSE IF nCol > Len( aString[ nRowNo + nRow ] ) nCol := Len( aString[ nRowNo + nRow ] ) ENDIF ENDIF EXIT CASE K_LEFT IF nCol > 0 nCol-- ELSE IF nColNo > 0 nColNo-- ENDIF ENDIF EXIT CASE K_DOWN IF nRow < nMaxRow - 1 .AND. nRow < Len( aString ) nRow++ ELSE IF nRowNo + nRow < Len( aString ) nRowNo++ ENDIF ENDIF IF aString[ nRowNo + nRow ] == "" nCol := 0 ELSE IF nCol > Len( aString[ nRowNo + nRow ] ) nCol := Len( aString[ nRowNo + nRow ] ) ENDIF ENDIF EXIT CASE K_RIGHT IF nCol < Len( aString[ nRowNo + nRow ] ) nCol++ ENDIF EXIT CASE K_HOME nCol := 0 EXIT CASE K_END nCol := Len( aString[ nRowNo + nRow ] ) EXIT CASE K_PGUP IF nRow <= 1 IF nRowNo - nMaxRow >= 0 nRowNo -= nMaxRow ENDIF ENDIF nRow := 1 EXIT CASE K_PGDN IF nRow >= nMaxRow - 1 IF nRowNo + nMaxRow <= Len( aString ) nRowNo += nMaxRow ENDIF ENDIF nRow := Min( nMaxRow - 1, Len( aString ) - nRowNo ) hb_Scroll( 1, 0, nMaxRow, nMaxCol ) EXIT CASE K_CTRL_PGUP nRow := 0 nRowNo := 0 EXIT CASE K_CTRL_PGDN nRow := nMaxRow - 1 nRowNo := Len( aString ) - nMaxRow + 1 EXIT CASE K_ENTER IF lArg IF aString[ nRowNo + nRow ] == "" .OR. nCol == 0 hb_AIns( aString, nRowNo + nRow, "", .T. ) nRow++ ELSE IF nCol == Len( aString[ nRowNo + nRow ] ) hb_AIns( aString, nRowNo + nRow + 1, "", .T. ) nRow++ nCol := 0 ELSE cSubString := Right( aString[ nRowNo + nRow ], Len( aString[ nRowNo + nRow ] ) - nCol ) cStringEditingRow := aString[ nRowNo + nRow ] aString[ nRowNo + nRow ] := Stuff( cStringEditingRow, nCol + 1, Len( aString[ nRowNo + nRow ] ) - nCol, "" ) hb_AIns( aString, nRowNo + nRow + 1, cSubString, .T. ) nRow++ nCol := 0 ENDIF ENDIF SaveFile( aString, cFileName ) ENDIF EXIT CASE K_INS IF lArg IF lToggleInsert SetCursor( SC_NORMAL ) lToggleInsert := .F. ELSE SetCursor( SC_INSERT ) lToggleInsert := .T. ENDIF ENDIF EXIT CASE K_DEL IF lArg IF aString[ nRowNo + nRow ] == "" IF nRow >= 0 hb_ADel( aString, nRowNo + nRow, .T. ) ENDIF ELSE IF nCol == Len( aString[ nRowNo + nRow ] ) aString[ nRowNo + nRow ] += aString[ nRowNo + nRow + 1 ] hb_ADel( aString, nRowNo + nRow + 1, .T. ) ELSE cStringEditingRow := aString[ nRowNo + nRow ] aString[ nRowNo + nRow ] := Stuff( cStringEditingRow, nCol + 1, 1, "" ) ENDIF ENDIF SaveFile( aString, cFileName ) ENDIF EXIT CASE K_BS IF lArg IF aString[ nRowNo + nRow ] == "" IF nRow > 1 hb_ADel( aString, nRowNo + nRow, .T. ) nRow-- nCol := Len( aString[ nRowNo + nRow ] ) ENDIF ELSE IF nCol > 0 cStringEditingRow := aString[ nRowNo + nRow ] aString[ nRowNo + nRow ] := Stuff( cStringEditingRow, nCol, 1, "" ) nCol-- ELSE IF nRow > 1 IF aString[ nRowNo + nRow - 1 ] == "" nCol := 0 ELSE nCol := Len( aString[ nRowNo + nRow - 1 ] ) ENDIF aString[ nRowNo + nRow - 1 ] += aString[ nRowNo + nRow ] hb_ADel( aString, nRowNo + nRow, .T. ) nRow-- ENDIF ENDIF ENDIF SaveFile( aString, cFileName ) ENDIF EXIT CASE K_TAB IF lArg cStringEditingRow := aString[ nRowNo + nRow ] aString[ nRowNo + nRow ] := Stuff( cStringEditingRow, nCol + 1, iif( lToggleInsert, 1, 0 ), " " ) nCol += 3 SaveFile( aString, cFileName ) ENDIF EXIT OTHERWISE IF lArg IF ( nKeyStd >= 32 .AND. nKeyStd <= 126 ) .OR. ( nKeyStd >= 160 .AND. nKeyStd <= 255 ) .OR. ! hb_keyChar( nKeyStd ) == "" cStringEditingRow := aString[ nRowNo + nRow ] aString[ nRowNo + nRow ] := Stuff( cStringEditingRow, nCol + 1, iif( lToggleInsert, 1, 0 ), hb_keyChar( nKeyStd ) ) nCol++ SaveFile( aString, cFileName ) ENDIF ENDIF ENDSWITCH ENDDO ELSE HC_Alert( "Error reading:;" + cFileName ) RETURN ENDIF WClose() RETURN STATIC PROCEDURE HCEditDisplay( aString, nRow, nCol, nRowNo ) LOCAL i LOCAL nMaxRow := MaxRow(), nMaxCol := MaxCol() LOCAL nLine hb_Scroll( 2, 0, nMaxRow - 2, nMaxCol ) FOR i := 1 TO nMaxRow nLine := i + nRowNo IF nLine <= Len( aString ) hb_DispOutAt( i, 0, ; PadR( aString[ nLine ], nMaxCol + 1 ), ; iif( i == nRow, 0x8f, 0x7 ) ) ELSE hb_Scroll( i, 0, nMaxRow, nMaxCol + 1 ) hb_DispOutAt( i, 1, ">> EOF <<", 0x01 ) EXIT ENDIF NEXT SetPos( nRow, nCol ) RETURN STATIC PROCEDURE SaveFile( aString, cFileName ) LOCAL cString := "" AEval( aString, {| e | cString += e + hb_eol() } ) hb_MemoWrit( cFileName, cString ) RETURN STATIC FUNCTION FileError() RETURN { ; { 0, "The operation completed successfully." }, ; { 2, "The system cannot find the file specified." }, ; { 3, "The system cannot find the path specified." }, ; { 4, "The system cannot open the file." }, ; { 5, "Access is denied." }, ; { 6, "The handle is invalid." }, ; { 8, "Not enough storage is available to process this command." }, ; { 15, "The system cannot find the drive specified." }, ; { 16, "The directory cannot be removed." }, ; { 17, "The system cannot move the file to a different disk drive." }, ; { 18, "There are no more files." }, ; { 19, "Attempted to write to a write-protected disk." }, ; { 21, "The device is not ready." }, ; { 23, "Data error (cyclic redundancy check)." }, ; { 29, "The system cannot write to the specified device." }, ; { 30, "The system cannot read from the specified device." }, ; { 32, "The process cannot access the file because ; it is being used by another process." }, ; { 33, "The process cannot access the file because ; another process has locked a portion of the file." }, ; { 36, "Too many files opened for sharing." }, ; { 38, "Reached the end of the file." }, ; { 62, "Space to store the file waiting to be printed ; is not available on the server." }, ; { 63, "Your file waiting to be printed was deleted." }, ; { 80, "The file exists." }, ; { 82, "The directory or file cannot be created." }, ; { 110, "The system cannot open the device or file specified." }, ; { 111, "The file name is too long" }, ; { 113, "No more internal file identifiers available." }, ; { 114, "The target internal file identifier is incorrect." }, ; { 123, "The filename, directory name, ; or volume label syntax is incorrect." }, ; { 130, "Attempt to use a file handle to an open disk ; partition for an operation other than raw disk I/O." }, ; { 131, "An attempt was made to move the file pointer ; before the beginning of the file." }, ; { 132, "The file pointer cannot be set on the specified ; device or file." }, ; { 138, "The system tried to join a drive ; to a directory on a joined drive." }, ; { 139, "The system tried to substitute a drive ; to a directory on a substituted drive." }, ; { 140, "The system tried to join a drive ; to a directory on a substituted drive." }, ; { 141, "The system tried to SUBST a drive ; to a directory on a joined drive." }, ; { 143, "The system cannot join or substitute a drive ; to or for a directory on the same drive." }, ; { 144, "The directory is not a subdirectory of the root directory." }, ; { 145, "The directory is not empty." }, ; { 150, "System trace information was not specified ; in your CONFIG.SYS file, or tracing is disallowed." }, ; { 154, "The volume label you entered exceeds ; the label character limit of the target file system." }, ; { 167, "Unable to lock a region of a file." }, ; { 174, "The file system does not support ; atomic changes to the lock type." }, ; } // ==================================== FUNCTION Q( xPar ) RETURN Alert( hb_ValToExp( xPar ) ) // ==================================== FUNCTION StartUpPath() LOCAL cDir := "" hb_FNameSplit( hb_argv( 0 ), @cDir ) RETURN cDir
31.373563
198
0.528765
a5a8922eb2f3c2f28fea82a0a72991d02223f9c1
6,667
prg
xBase
source/QtCore/QMetaType.prg
marcosgambeta/Qt5xHb-cpp11
aaae121a2cb36c88a8f205503073aee0da4fa069
[ "MIT" ]
null
null
null
source/QtCore/QMetaType.prg
marcosgambeta/Qt5xHb-cpp11
aaae121a2cb36c88a8f205503073aee0da4fa069
[ "MIT" ]
null
null
null
source/QtCore/QMetaType.prg
marcosgambeta/Qt5xHb-cpp11
aaae121a2cb36c88a8f205503073aee0da4fa069
[ "MIT" ]
null
null
null
/* Qt5xHb/C++11 - Bindings libraries for Harbour/xHarbour and Qt Framework 5 Copyright (C) 2022 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com> */ /* DO NOT EDIT THIS FILE - the content was created using a source code generator */ #include "hbclass.ch" #ifndef QT5XHB_NO_REQUESTS #endif CLASS QMetaType DATA pointer DATA self_destruction INIT .F. METHOD registerTypedef METHOD type METHOD typeName METHOD isRegistered METHOD construct METHOD destroy METHOD save METHOD load METHOD newFrom METHOD newFromObject METHOD newFromPointer METHOD selfDestruction METHOD setSelfDestruction DESTRUCTOR destroyObject END CLASS PROCEDURE destroyObject() CLASS QMetaType IF ::self_destruction ::delete() ENDIF RETURN #pragma BEGINDUMP #include <QtCore/Qt> #ifndef __XHARBOUR__ #include <QtCore/QMetaType> #endif #include "qt5xhb_common.h" #include "qt5xhb_macros.h" #include "qt5xhb_utils.h" #ifdef __XHARBOUR__ #include <QtCore/QMetaType> #endif /* static int registerTypedef( const char * typeName, int aliasId ) */ HB_FUNC_STATIC( QMETATYPE_REGISTERTYPEDEF ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR( 2 ) && HB_ISCHAR( 1 ) && HB_ISNUM( 2 ) ) { #endif RINT( QMetaType::registerTypedef( PCONSTCHAR( 1 ), PINT( 2 ) ) ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } /* static int type( const char * typeName ) */ HB_FUNC_STATIC( QMETATYPE_TYPE ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR( 1 ) && HB_ISCHAR( 1 ) ) { #endif RINT( QMetaType::type( PCONSTCHAR( 1 ) ) ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } /* static const char * typeName( int type ) */ HB_FUNC_STATIC( QMETATYPE_TYPENAME ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR( 1 ) && HB_ISNUM( 1 ) ) { #endif hb_retc( static_cast< const char * >( QMetaType::typeName( PINT( 1 ) ) ) ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } /* static bool isRegistered( int type ) */ HB_FUNC_STATIC( QMETATYPE_ISREGISTERED ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR( 1 ) && HB_ISNUM( 1 ) ) { #endif RBOOL( QMetaType::isRegistered( PINT( 1 ) ) ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } /* static void * construct( int type, void * where, const void * copy ) */ HB_FUNC_STATIC( QMETATYPE_CONSTRUCT ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR( 3 ) && HB_ISNUM( 1 ) && HB_ISPOINTER( 2 ) && HB_ISPOINTER( 3 ) ) { #endif hb_retptr( static_cast< void * >( QMetaType::construct( PINT( 1 ), static_cast< void * >( hb_parptr( 2 ) ), static_cast< const void * >( hb_parptr( 3 ) ) ) ) ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } /* static void destroy( int type, void * data ) */ HB_FUNC_STATIC( QMETATYPE_DESTROY ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR( 2 ) && HB_ISNUM( 1 ) && HB_ISPOINTER( 2 ) ) { #endif QMetaType::destroy( PINT( 1 ), static_cast< void * >( hb_parptr( 2 ) ) ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif hb_itemReturn( hb_stackSelfItem() ); } /* static bool save( QDataStream & stream, int type, const void * data ) */ HB_FUNC_STATIC( QMETATYPE_SAVE ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR( 3 ) && ISQDATASTREAM( 1 ) && HB_ISNUM( 2 ) && HB_ISPOINTER( 3 ) ) { #endif RBOOL( QMetaType::save( *PQDATASTREAM( 1 ), PINT( 2 ), static_cast< const void * >( hb_parptr( 3 ) ) ) ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } /* static bool load( QDataStream & stream, int type, void * data ) */ HB_FUNC_STATIC( QMETATYPE_LOAD ) { #ifndef QT5XHB_DONT_CHECK_PARAMETERS if( ISNUMPAR( 3 ) && ISQDATASTREAM( 1 ) && HB_ISNUM( 2 ) && HB_ISPOINTER( 3 ) ) { #endif RBOOL( QMetaType::load( *PQDATASTREAM( 1 ), PINT( 2 ), static_cast< void * >( hb_parptr( 3 ) ) ) ); #ifndef QT5XHB_DONT_CHECK_PARAMETERS } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } #endif } HB_FUNC_STATIC( QMETATYPE_NEWFROM ) { PHB_ITEM self = hb_stackSelfItem(); if( hb_pcount() == 1 && HB_ISOBJECT( 1 ) ) { PHB_ITEM ptr = hb_itemPutPtr( nullptr, static_cast< void * >( hb_itemGetPtr( hb_objSendMsg( hb_param( 1, HB_IT_OBJECT ), "POINTER", 0 ) ) ) ); hb_objSendMsg( self, "_pointer", 1, ptr ); hb_itemRelease( ptr ); PHB_ITEM des = hb_itemPutL( nullptr, false ); hb_objSendMsg( self, "_self_destruction", 1, des ); hb_itemRelease( des ); } else if( hb_pcount() == 1 && HB_ISPOINTER( 1 ) ) { PHB_ITEM ptr = hb_itemPutPtr( nullptr, static_cast< void * >( hb_itemGetPtr( hb_param( 1, HB_IT_POINTER ) ) ) ); hb_objSendMsg( self, "_pointer", 1, ptr ); hb_itemRelease( ptr ); PHB_ITEM des = hb_itemPutL( nullptr, false ); hb_objSendMsg( self, "_self_destruction", 1, des ); hb_itemRelease( des ); } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } hb_itemReturn( self ); } HB_FUNC_STATIC( QMETATYPE_NEWFROMOBJECT ) { HB_FUNC_EXEC( QMETATYPE_NEWFROM ); } HB_FUNC_STATIC( QMETATYPE_NEWFROMPOINTER ) { HB_FUNC_EXEC( QMETATYPE_NEWFROM ); } HB_FUNC_STATIC( QMETATYPE_SELFDESTRUCTION ) { hb_retl( static_cast< bool >( hb_itemGetL( hb_objSendMsg( hb_stackSelfItem(), "SELF_DESTRUCTION", 0 ) ) ) ); } HB_FUNC_STATIC( QMETATYPE_SETSELFDESTRUCTION ) { PHB_ITEM self = hb_stackSelfItem(); if( hb_pcount() == 1 && HB_ISLOG( 1 ) ) { PHB_ITEM des = hb_itemPutL( nullptr, hb_parl( 1 ) ); hb_objSendMsg( self, "_self_destruction", 1, des ); hb_itemRelease( des ); } else { hb_errRT_BASE( EG_ARG, 3012, nullptr, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } hb_itemReturn( self ); } #pragma ENDDUMP
23.641844
165
0.665967
791435bcfdc2fa33eb4a4e8dd988834016a9e4dc
407
prg
xBase
british-calendar.prg
GyPapi/calendar
3d959d124994dd4cc293b69a62a8c8773013a344
[ "Unlicense" ]
4
2018-12-14T12:18:59.000Z
2021-05-19T20:48:52.000Z
british-calendar.prg
GyPapi/calendar
3d959d124994dd4cc293b69a62a8c8773013a344
[ "Unlicense" ]
null
null
null
british-calendar.prg
GyPapi/calendar
3d959d124994dd4cc293b69a62a8c8773013a344
[ "Unlicense" ]
1
2020-03-31T15:04:21.000Z
2020-03-31T15:04:21.000Z
*!* BritishCalendar *!* A Gregorian Calendar subclass for the British Calendar. * install dependencies DO gregorian-calendar.prg * install itself IF !SYS(16) $ SET("Procedure") SET PROCEDURE TO (SYS(16)) ADDITIVE ENDIF DEFINE CLASS BritishCalendar AS GregorianCalendar AdoptionYear = 1752 AdoptionMonth = 9 AdoptionDay = 14 LastJulianYear = 1752 LastJulianMonth = 9 LastJulianDay = 2 ENDDEFINE
17.695652
59
0.766585