text:
This is a handy and simple to use jQuery plugin for showcasing your (or anyone else's) repositories on your own web site. It simply fetches the repositories from the Github API and you can add custom styling with templates and more.

The code is completely client-side and has built-in client-side caching using `localStorage` if available (but can be customized, see below).

It provides a rendering-agnostic interface with an optional `tranform` method. All properties from [the Github API Repositories](https://developer.github.com/v3/repos/#list-user-repositories) are available for use.

A demo is available [here](http://jquery-github-showcase.artofcoding.nl/), and you can also [read the blog post](http://blog.artofcoding.nl/github-repositories-in-jquery/).

# Install

```
bower install jquery-github-showcase
```

# Usage

	<script src="js/jquery-github-showcase.js"></script>

Now you can start the plugin:

```js
$(document).ready(function() {
	$('#my-showcase').gh_showcase({
		'username': 'MichielvdVelde',
		'templateUrl': 'templates/github.tpl',
		'renderer': Mustache.render,
		'store': localStorage,
		'transform': function(repo) {
			// Use this method to transform repo properties when necessary
			// In this case, convert the date to dd-mm-YYYY
			var updated_at = new Date(repo.updated_at);
			repo.updated_at = updated_at.getDate() + '-' + (updated_at.getMonth() +1) + '-' + updated_at.getFullYear();
			return repo;
		}
	});
});
```

## Options

* `username`: The user name to load the repositories for (required)
* `sort`: The field to sort on (see Github API, default 'pushed')
* `direction`: The direction of the sort, either `desc` (default) or `asc`
* `template`: The template to use for rendering (this or `templateUrl` is required)
* `templateUrl`: The URL of the template to use for rendering (this or `template` is required)
* `cacheTime`: The cache time in hours. Defaults to 24h. Disable caching by setting `cacheTime` to 0
* `renderer` (**replaces `render`**): The render method. Should take `(template, scope)`. If no renderer is set, an error will be generated
* `store`: The cache store to use. Should have `setItem(key, value)` and `getItem(key)`. If no store is set, an error will be generated
* `transform`: An optional method to transform properties. See the example above

If both `template` and `templateUrl` are set, `templateUrl` takes precedence.

Another option is to just store the data in `sessionStorage`. This way you can disable the cache by setting `cacheTime` to `0`.

## To do

* Publish on Bower and stuff

## Changelog

* 6 December 2015
  * v0.0.3 - Published on Bower
  * Updated readme with **breaking changes**
  * Changed `options.render` to `options.renderer`
  * `Mustache` and `localStorage` are **not** included by default anymore. `options` must now have these two defined!
  * Rewrote cache expiry code
  * Fixed Github repository URL
* 3 December 2015
  * Make cache store type available in options
* 2 December 2015
  * Change `sort` default from `updated` to `pushed`
  * Add `options.direction`
  * First commit

## License

Copyright 2015 Michiel van der Velde.

This software is licensed under [the MIT License](LICENSE).


text:
using System;
using System.ComponentModel;

namespace Ooui.Forms.Renderers
{
    public class LinkViewRenderer : ViewRenderer<LinkView, Ooui.Anchor>
    {
        public LinkViewRenderer ()
            : base ("a")
        {
        }

        protected override void OnElementChanged (ElementChangedEventArgs<LinkView> e)
        {
            base.OnElementChanged (e);

            UpdateHRef ();
            UpdateTarget ();
        }

        protected override void OnElementPropertyChanged (object sender, PropertyChangedEventArgs e)
        {
            base.OnElementPropertyChanged (sender, e);

            if (Control == null)
                return;

            if (e.PropertyName == Ooui.Forms.LinkView.HRefProperty.PropertyName)
                UpdateHRef ();
            if (e.PropertyName == Ooui.Forms.LinkView.TargetProperty.PropertyName)
                UpdateTarget ();
        }

        void UpdateHRef ()
        {
            this.SetAttribute ("href", Element.HRef);
        }

        void UpdateTarget ()
        {
            this.SetAttribute ("target", Element.Target);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
`Home <index.html>`__ OpenStack-Ansible Installation Guide

Configure Identity Service (keystone) as a federated service provider
---------------------------------------------------------------------

The following settings must be set to configure a service provider (SP):

#. ``keystone_public_endpoint`` automatically set by default
   to the public endpoint's URI. This ensures that
   the redirections performed and token references all refer to the
   public endpoint which is accessible to clients and the trusted
   IDP.

#. ``horizon_keystone_endpoint`` automatically set by default
   to the public v3 API endpoint URL for keystone. Web-based single
   sign-on for horizon requires the use of the keystone v3 API.
   The value for this must use the same DNS name or IP address which
   is registered in the SSL certificate used for the endpoint.

#. If ADFS is to be used as the IdP, the keystone endpoint is
   **required** to have an HTTPS public endpoint. The endpoint may
   either be provided by keystone itself, or by an SSL offloading
   load balancer.

#. ``keystone_service_publicuri_proto`` must be set to https in order
   to ensure that the public endpoint is registered with https in the
   URL, to ensure that keystone publishes https in its references
   and to ensure that Shibboleth is configured to know that it should
   expect SSL URL's in the assertions (otherwise it will invalidate
   the assertions).

#. ADFS **requires** that a trusted SP have a trusted certificate that
   is not self-signed. This means that the certificate used for
   keystone must either be signed by a public CA, or an enterprise CA.

#. When using SSL for the keystone endpoint, the endpoint URI and the
   certificate must match. For example, if the certificate does not have
   the IP address of the endpoint, then the endpoint must be published with
   the appropriate name registered on the certificate. When
   using a DNS name for the keystone endpoint, both
   ``keystone_public_endpoint`` and ``horizon_keystone_endpoint`` must
   be set to use the DNS name.

#. ``horizon_endpoint_type`` must be set to ``publicURL`` to ensure that
   Horizon makes use of the public endpoint for all its references and
   queries.

#. ``keystone_sp`` is a dictionary attribute which contains various
   settings that describe both the SP and the IDP's it trusts. For example:

   .. code-block:: yaml

      keystone_sp:
        cert_duration_years: 5
        trusted_dashboard_list:
          - "https://{{ external_lb_vip_address }}/auth/websso/"
        trusted_idp_list:
          - name: 'testshib-idp'
            entity_ids:
              - 'https://idp.testshib.org/idp/shibboleth'
            metadata_uri: 'http://www.testshib.org/metadata/testshib-providers.xml'
            metadata_file: 'metadata-testshib-idp.xml'
            metadata_reload: 1800
            federated_identities:
              - domain: Default
                project: fedproject
                group: fedgroup
                role: _member_
            protocols:
              - name: saml2
                mapping:
                  name: testshib-idp-mapping
                  rules:
                    - remote:
                        - type: eppn
                      local:
                        - group:
                            name: fedgroup
                            domain:
                              name: Default
                        - user:
                            name: '{0}'

#. ``cert_duration_years`` designates the valid duration for the SP's
   signing certificate (for example, ``/etc/shibboleth/sp-key.pem``).

#. ``trusted_dashboard_list`` designates the list of trusted URLs from which
   keystone will accept redirects for Web Single-Sign. This
   list should contain all URLs that horizon is presented on,
   suffixed by ``/auth/websso/`` which is the path for horizon's WebSSO
   component.

#. ``trusted_idp_list`` is a dictionary attribute containing the list
   of settings which pertain to each trusted IdP for the SP.

#. ``trusted_idp_list.name`` is the name by which the IDP is known, is
   configured in keystone and is listed in horizon's login selection.

#. ``entity_ids`` is a list of reference entity IDs which specify where
   the login request to the SP will be redirected to in order to
   authenticate to the IdP.

#. ``metadata_uri`` is the location of the IdP's metadata which provides
   the SP with the signing key and all the IdP's supported endpoints.

#. ``metadata_file`` is the file name of the local cached version of
   the metadata which will be stored in ``/var/cache/shibboleth/``.

#. ``metadata_reload`` is the number of seconds between metadata
   refresh polls.

#. ``federated_identities`` is a list of domain, project, group and users
   which are to be mapped. See `Configure Identity Service (keystone) Domain-Project-Group-Role mappings <configure-federation-mapping.html>`_ for more information.

#. ``protocols`` is a list of protocols supported for the IdP and the set
   of mappings and attributes for each protocol. Only the protocol with the
   name ``saml2`` is supported at this time.

#. ``mapping`` is the local to remote mapping configuration for federated
   users. For more information, see `Configure Identity Service (keystone) Domain-Project-Group-Role mappings. <configure-federation-mapping.html>`_

--------------

.. include:: navigation.txt


text:
import json
import time
import logging
import requests

from wechatpy.client.base import BaseWeChatClient
from wechatpy.exceptions import WeChatClientException
from wechatpy.work.services import api

logger = logging.getLogger(__name__)

class WeChatServiceClient(BaseWeChatClient):
    """
    注意:access_token在第三方应用变更为suite_access_token参数
    """

    API_BASE_URL = "https://qyapi.weixin.qq.com/cgi-bin/"

    auth = api.WeChatAuth()
    miniprogram = api.WeChatMiniProgram()

    def __init__(
        self,
        corp_id,
        suite_id,
        suite_secret,
        suite_ticket,
        access_token=None,
        session=None,
        timeout=None,
        auto_retry=True,
    ):
        self.corp_id = corp_id
        self.suite_id = suite_id
        self.suite_secret = suite_secret
        self.suite_ticket = suite_ticket
        super().__init__(corp_id, access_token, session, timeout, auto_retry)

    @property
    def access_token_key(self):
        return f"services_{self.corp_id}_{self.suite_id}_access_token"

    def _fetch_access_token(self, url, params):
        """The real fetch access token"""
        logger.info("Fetching access token")
        res = self._http.post(url=url, json=params)
        try:
            res.raise_for_status()
        except requests.RequestException as reqe:
            raise WeChatClientException(
                errcode=None,
                errmsg=None,
                client=self,
                request=reqe.request,
                response=reqe.response,
            )
        result = res.json()
        if "errcode" in result and result["errcode"] != 0:
            raise WeChatClientException(
                result["errcode"],
                result["errmsg"],
                client=self,
                request=res.request,
                response=res,
            )

        expires_in = 7200
        if "expires_in" in result:
            expires_in = result["expires_in"]
        self.session.set(self.access_token_key, result["suite_access_token"], expires_in)
        self.expires_at = int(time.time()) + expires_in
        return result

    def _request(self, method, url_or_endpoint, **kwargs):
        if not url_or_endpoint.startswith(("http://", "https://")):
            api_base_url = kwargs.pop("api_base_url", self.API_BASE_URL)
            url = f"{api_base_url}{url_or_endpoint}"
        else:
            url = url_or_endpoint

        if "params" not in kwargs:
            kwargs["params"] = {}
        if isinstance(kwargs["params"], dict) and "suite_access_token" not in kwargs["params"]:
            kwargs["params"]["suite_access_token"] = self.access_token
        if isinstance(kwargs.get("data", ""), dict):
            body = json.dumps(kwargs["data"], ensure_ascii=False)
            body = body.encode("utf-8")
            kwargs["data"] = body

        kwargs["timeout"] = kwargs.get("timeout", self.timeout)
        result_processor = kwargs.pop("result_processor", None)
        res = self._http.request(method=method, url=url, **kwargs)
        try:
            res.raise_for_status()
        except requests.RequestException as reqe:
            raise WeChatClientException(
                errcode=None,
                errmsg=None,
                client=self,
                request=reqe.request,
                response=reqe.response,
            )

        return self._handle_result(res, method, url, result_processor, **kwargs)

    def fetch_access_token(self):
        """Fetch access token"""
        return self._fetch_access_token(
            url="https://qyapi.weixin.qq.com/cgi-bin/service/get_suite_token",
            params={"suite_id": self.suite_id, "suite_secret": self.suite_secret, "suite_ticket": self.suite_ticket},
        )


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.clouddebugger.v2.model;

/**
 * A CloudWorkspaceSourceContext denotes a workspace at a particular snapshot.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Stackdriver Debugger API. For a detailed explanation
 * see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class CloudWorkspaceSourceContext extends com.google.api.client.json.GenericJson {

  /**
   * The ID of the snapshot. An empty snapshot_id refers to the most recent snapshot.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String snapshotId;

  /**
   * The ID of the workspace.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private CloudWorkspaceId workspaceId;

  /**
   * The ID of the snapshot. An empty snapshot_id refers to the most recent snapshot.
   * @return value or {@code null} for none
   */
  public java.lang.String getSnapshotId() {
    return snapshotId;
  }

  /**
   * The ID of the snapshot. An empty snapshot_id refers to the most recent snapshot.
   * @param snapshotId snapshotId or {@code null} for none
   */
  public CloudWorkspaceSourceContext setSnapshotId(java.lang.String snapshotId) {
    this.snapshotId = snapshotId;
    return this;
  }

  /**
   * The ID of the workspace.
   * @return value or {@code null} for none
   */
  public CloudWorkspaceId getWorkspaceId() {
    return workspaceId;
  }

  /**
   * The ID of the workspace.
   * @param workspaceId workspaceId or {@code null} for none
   */
  public CloudWorkspaceSourceContext setWorkspaceId(CloudWorkspaceId workspaceId) {
    this.workspaceId = workspaceId;
    return this;
  }

  @Override
  public CloudWorkspaceSourceContext set(String fieldName, Object value) {
    return (CloudWorkspaceSourceContext) super.set(fieldName, value);
  }

  @Override
  public CloudWorkspaceSourceContext clone() {
    return (CloudWorkspaceSourceContext) super.clone();
  }

}


text:
package core.lsmo.octree;

import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;

import core.io.Block;
import core.io.Bucket;

public class OctreeTextWriter implements OctreeVisitor {
	File dir;
	int version;
	Bucket cur; // the current bucket used to write data
	int blockIdx;

	public OctreeTextWriter(File dir, int version) {
		this.dir = dir;
		this.version = version;
	}

	public static File octFile(File dir, int version) {
		return new File(dir, String.format("%d.octs", version));
	}

	public static File idxFile(File dir, int version) {
		return new File(dir, String.format("%d.idx", version));
	}

	public void open() throws FileNotFoundException {
	}

	public void visitIntern(OctreeNode octreeNode) {
		// first visit the upper octants
		for (int i = 4; i < 8; i++) {
			octreeNode.getChild(i).visit(this);
		}

		for (int i = 0; i < 4; i++) {
			octreeNode.getChild(i).visit(this);
		}
	}

	/**
	 * the visiting of the parent controls the setup of bucket
	 *
	 * @param octreeNode
	 * @throws IOException
	 */
	public void visitLeaf(OctreeNode octreeNode) {
		if (octreeNode.size() > 0) {
			ByteArrayOutputStream baos = new ByteArrayOutputStream();
			DataOutputStream dos = new DataOutputStream(baos);
			try {
				octreeNode.write(dos);
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
			byte[] data = baos.toByteArray();
			if (cur == null || !cur.canStore(data.length)) {
				cur = new Bucket(blockIdx * Block.BLOCK_SIZE);
			}

			System.out.println(
					String.format("leaf node: %s, id:%s;", octreeNode.getEncoding(), cur.blockIdx().toString()));
			cur.storeOctant(data);
		}
	}
}


text:
/*global define*/
define(['lodash'], function(_) {
    'use strict';
    // Wraps the **/api/v2/utils** API.
    var UtilService = function(Restangular, ErrorService) {
        // We instantiate 2 root restangular instances with different configurations.
        // The first one is for simple JSON API requests.
        var restangular = Restangular.withConfig(function(RestangularConfigurer) {
            RestangularConfigurer.setBaseUrl('/api/v1/').setErrorInterceptor(ErrorService.errorInterceptor);
        });
        // The second gives us access to the raw response so we can look at the status code.
        // Useful for APIs that return 202 responses for asynchronous tasks.
        var restangularFull = Restangular.withConfig(function(RestangularConfigurer) {
            RestangularConfigurer.setBaseUrl('/api/v1/').setFullResponse(true).setErrorInterceptor(ErrorService.errorInterceptor);
        });

        // **Constructor**
        var Service = function() {
            this.restangular = restangular;
            this.restangularFull = restangularFull;
        };
        Service.prototype = _.extend(Service.prototype, {
             // **getVerify**
            // **@returns** a promise with user varification.
            getVerifyUser: function(userObject) {
                return this.restangular.all('auth/login').post(userObject);
            },
            // **getVerify**
            // **@returns** a promise with host varification.
            getVerifyHost: function(hostObject) {
                return this.restangular.all('utils/validate-host').post(hostObject);
            },
            // **getList**
            // **@returns** a promise with ssh fingerprint.
            getSshFingerprint: function(ipAddress) {
                return this.restangular.one('utils/get_ssh_fingerprint', ipAddress).get().then(function(result) {
                    return result['ssh_key_fingerprint'];
                });
            },
            // **get**
            // **@returns** a promise with IP Address.
            getIpAddress: function(hostname) {
                return this.restangular.one('utils/resolve_hostname', hostname).get().then(function(result) {
                    if(!_.isEmpty(result['IP_Address'])) {
                        return _.first(result['IP_Address']);
                    }
                    return;
                });
            },
            // **acceptHosts**
            // **@returns** accept the salt-keys of the hosts.
            acceptHosts: function(hosts) {
                return this.restangular.all('utils/accept-hosts').post(hosts);
            },
        });
        return new Service();
    };
    return ['Restangular', 'ErrorService', UtilService];
});


text:
namespace Shapes
{
    public class Triangle : Shape
    {
        public Triangle(int inputWidth, int inputHeight)
        {
            this.Width = inputWidth;
            this.Height = inputHeight;
        }

        public override decimal CalculateSurface()
        {
            return ((decimal)this.Width * this.Height) / 2;
        }
    }
}


text: generate werf environment variables for specified CI system


text:
//===- MCJITTest.cpp - Unit tests for the MCJIT ---------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This test suite verifies basic MCJIT functionality such as making function
// calls, using global variables, and compiling multpile modules.
//
//===----------------------------------------------------------------------===//

#include "llvm/ExecutionEngine/MCJIT.h"
#include "llvm/Support/DynamicLibrary.h"
#include "MCJITTestBase.h"
#include "gtest/gtest.h"

using namespace llvm;

namespace {

class MCJITTest : public testing::Test, public MCJITTestBase {
protected:
  void SetUp() override { M.reset(createEmptyModule("<main>")); }
};

// FIXME: Ensure creating an execution engine does not crash when constructed
//        with a null module.
/*
TEST_F(MCJITTest, null_module) {
  createJIT(0);
}
*/

// FIXME: In order to JIT an empty module, there needs to be
// an interface to ExecutionEngine that forces compilation but
// does not require retrieval of a pointer to a function/global.
/*
TEST_F(MCJITTest, empty_module) {
  createJIT(M.take());
  //EXPECT_NE(0, TheJIT->getObjectImage())
  //  << "Unable to generate executable loaded object image";
}
*/

TEST_F(MCJITTest, global_variable) {
  SKIP_UNSUPPORTED_PLATFORM;

  int initialValue = 5;
  GlobalValue *Global = insertGlobalInt32(M.get(), "test_global", initialValue);
  createJIT(std::move(M));
  void *globalPtr =  TheJIT->getPointerToGlobal(Global);
  EXPECT_TRUE(nullptr != globalPtr)
    << "Unable to get pointer to global value from JIT";

  EXPECT_EQ(initialValue, *(int32_t*)globalPtr)
    << "Unexpected initial value of global";
}

TEST_F(MCJITTest, add_function) {
  SKIP_UNSUPPORTED_PLATFORM;

  Function *F = insertAddFunction(M.get());
  createJIT(std::move(M));
  uint64_t addPtr = TheJIT->getFunctionAddress(F->getName().str());
  EXPECT_TRUE(0 != addPtr)
    << "Unable to get pointer to function from JIT";

  ASSERT_TRUE(addPtr != 0) << "Unable to get pointer to function .";
  int (*AddPtr)(int, int) = (int(*)(int, int))addPtr ;
  EXPECT_EQ(0,   AddPtr(0, 0));
  EXPECT_EQ(1,   AddPtr(1, 0));
  EXPECT_EQ(3,   AddPtr(1, 2));
  EXPECT_EQ(-5,  AddPtr(-2, -3));
  EXPECT_EQ(30,  AddPtr(10, 20));
  EXPECT_EQ(-30, AddPtr(-10, -20));
  EXPECT_EQ(-40, AddPtr(-10, -30));
}

TEST_F(MCJITTest, run_main) {
  SKIP_UNSUPPORTED_PLATFORM;

  int rc = 6;
  Function *Main = insertMainFunction(M.get(), 6);
  createJIT(std::move(M));
  uint64_t ptr = TheJIT->getFunctionAddress(Main->getName().str());
  EXPECT_TRUE(0 != ptr)
    << "Unable to get pointer to main() from JIT";

  int (*FuncPtr)(void) = (int(*)(void))ptr;
  int returnCode = FuncPtr();
  EXPECT_EQ(returnCode, rc);
}

TEST_F(MCJITTest, return_global) {
  SKIP_UNSUPPORTED_PLATFORM;

  int32_t initialNum = 7;
  GlobalVariable *GV = insertGlobalInt32(M.get(), "myglob", initialNum);

  Function *ReturnGlobal = startFunction<int32_t(void)>(M.get(),
                                                        "ReturnGlobal");
  Value *ReadGlobal = Builder.CreateLoad(GV);
  endFunctionWithRet(ReturnGlobal, ReadGlobal);

  createJIT(std::move(M));
  uint64_t rgvPtr = TheJIT->getFunctionAddress(ReturnGlobal->getName().str());
  EXPECT_TRUE(0 != rgvPtr);

  int32_t(*FuncPtr)(void) = (int32_t(*)(void))rgvPtr;
  EXPECT_EQ(initialNum, FuncPtr())
    << "Invalid value for global returned from JITted function";
}

// FIXME: This case fails due to a bug with getPointerToGlobal().
// The bug is due to MCJIT not having an implementation of getPointerToGlobal()
// which results in falling back on the ExecutionEngine implementation that
// allocates a new memory block for the global instead of using the same
// global variable that is emitted by MCJIT. Hence, the pointer (gvPtr below)
// has the correct initial value, but updates to the real global (accessed by
// JITted code) are not propagated. Instead, getPointerToGlobal() should return
// a pointer into the loaded ObjectImage to reference the emitted global.
/*
TEST_F(MCJITTest, increment_global) {
  SKIP_UNSUPPORTED_PLATFORM;

  int32_t initialNum = 5;
  Function *IncrementGlobal = startFunction<int32_t(void)>(M.get(), "IncrementGlobal");
  GlobalVariable *GV = insertGlobalInt32(M.get(), "my_global", initialNum);
  Value *DerefGV = Builder.CreateLoad(GV);
  Value *AddResult = Builder.CreateAdd(DerefGV,
                                       ConstantInt::get(Context, APInt(32, 1)));
  Builder.CreateStore(AddResult, GV);
  endFunctionWithRet(IncrementGlobal, AddResult);

  createJIT(M.take());
  void *gvPtr = TheJIT->getPointerToGlobal(GV);
  EXPECT_EQ(initialNum, *(int32_t*)gvPtr);

  void *vPtr = TheJIT->getFunctionAddress(IncrementGlobal->getName().str());
  EXPECT_TRUE(0 != vPtr)
    << "Unable to get pointer to main() from JIT";

  int32_t(*FuncPtr)(void) = (int32_t(*)(void))(intptr_t)vPtr;

  for(int i = 1; i < 3; ++i) {
    int32_t result = FuncPtr();
    EXPECT_EQ(initialNum + i, result);            // OK
    EXPECT_EQ(initialNum + i, *(int32_t*)gvPtr);  // FAILS
  }
}
*/

// PR16013: XFAIL this test on ARM, which currently can't handle multiple relocations.
#if !defined(__arm__)

TEST_F(MCJITTest, multiple_functions) {
  SKIP_UNSUPPORTED_PLATFORM;

  unsigned int numLevels = 23;
  int32_t innerRetVal= 5;

  Function *Inner = startFunction<int32_t(void)>(M.get(), "Inner");
  endFunctionWithRet(Inner, ConstantInt::get(Context, APInt(32, innerRetVal)));

  Function *Outer;
  for (unsigned int i = 0; i < numLevels; ++i) {
    std::stringstream funcName;
    funcName << "level_" << i;
    Outer = startFunction<int32_t(void)>(M.get(), funcName.str());
    Value *innerResult = Builder.CreateCall(Inner, {});
    endFunctionWithRet(Outer, innerResult);

    Inner = Outer;
  }

  createJIT(std::move(M));
  uint64_t ptr = TheJIT->getFunctionAddress(Outer->getName().str());
  EXPECT_TRUE(0 != ptr)
    << "Unable to get pointer to outer function from JIT";

  int32_t(*FuncPtr)(void) = (int32_t(*)(void))ptr;
  EXPECT_EQ(innerRetVal, FuncPtr())
    << "Incorrect result returned from function";
}

#endif /*!defined(__arm__)*/

TEST_F(MCJITTest, multiple_decl_lookups) {
  SKIP_UNSUPPORTED_PLATFORM;

  Function *Foo = insertExternalReferenceToFunction<void(void)>(M.get(), "_exit");
  createJIT(std::move(M));
  void *A = TheJIT->getPointerToFunction(Foo);
  void *B = TheJIT->getPointerToFunction(Foo);

  EXPECT_TRUE(A != 0) << "Failed lookup - test not correctly configured.";
  EXPECT_EQ(A, B) << "Repeat calls to getPointerToFunction fail.";
}

typedef void * (*FunctionHandlerPtr)(const std::string &str);

TEST_F(MCJITTest, lazy_function_creator_pointer) {
  SKIP_UNSUPPORTED_PLATFORM;

  Function *Foo = insertExternalReferenceToFunction<int32_t(void)>(M.get(),
                                                                   "\1Foo");
  startFunction<int32_t(void)>(M.get(), "Parent");
  CallInst *Call = Builder.CreateCall(Foo, {});
  Builder.CreateRet(Call);

  createJIT(std::move(M));

  // Set up the lazy function creator that records the name of the last
  // unresolved external function found in the module. Using a function pointer
  // prevents us from capturing local variables, which is why this is static.
  static std::string UnresolvedExternal;
  FunctionHandlerPtr UnresolvedHandler = [] (const std::string &str) {
    // Try to resolve the function in the current process before marking it as
    // unresolved. This solves an issue on ARM where '__aeabi_*' function names
    // are passed to this handler.
    void *symbol =
        llvm::sys::DynamicLibrary::SearchForAddressOfSymbol(str.c_str());
    if (symbol) {
      return symbol;
    }

    UnresolvedExternal = str;
    return (void *)(uintptr_t)-1;
  };
  TheJIT->InstallLazyFunctionCreator(UnresolvedHandler);

  // JIT the module.
  TheJIT->finalizeObject();

  // Verify that our handler was called.
  EXPECT_EQ(UnresolvedExternal, "Foo");
}

TEST_F(MCJITTest, lazy_function_creator_lambda) {
  SKIP_UNSUPPORTED_PLATFORM;

  Function *Foo1 = insertExternalReferenceToFunction<int32_t(void)>(M.get(),
                                                                   "\1Foo1");
  Function *Foo2 = insertExternalReferenceToFunction<int32_t(void)>(M.get(),
                                                                   "\1Foo2");
  startFunction<int32_t(void)>(M.get(), "Parent");
  CallInst *Call1 = Builder.CreateCall(Foo1, {});
  CallInst *Call2 = Builder.CreateCall(Foo2, {});
  Value *Result = Builder.CreateAdd(Call1, Call2);
  Builder.CreateRet(Result);

  createJIT(std::move(M));

  // Set up the lazy function creator that records the name of unresolved
  // external functions in the module.
  std::vector<std::string> UnresolvedExternals;
  auto UnresolvedHandler = [&UnresolvedExternals] (const std::string &str) {
    // Try to resolve the function in the current process before marking it as
    // unresolved. This solves an issue on ARM where '__aeabi_*' function names
    // are passed to this handler.
    void *symbol =
        llvm::sys::DynamicLibrary::SearchForAddressOfSymbol(str.c_str());
    if (symbol) {
      return symbol;
    }
    UnresolvedExternals.push_back(str);
    return (void *)(uintptr_t)-1;
  };
  TheJIT->InstallLazyFunctionCreator(UnresolvedHandler);

  // JIT the module.
  TheJIT->finalizeObject();

  // Verify that our handler was called for each unresolved function.
  auto I = UnresolvedExternals.begin(), E = UnresolvedExternals.end();
  EXPECT_EQ(UnresolvedExternals.size(), 2u);
  EXPECT_FALSE(std::find(I, E, "Foo1") == E);
  EXPECT_FALSE(std::find(I, E, "Foo2") == E);
}

}


text:
Help Questions Answered

This is a catch-all repository where I'm storing user requested examples of how to use Python and specific packages to do something


text:
<?php

namespace denbora\R_T_G_Services\examples\RESTv3\Casino;

use denbora\R_T_G_Services\examples\RESTv3\RestExample;

class GetClientChannelsGET extends RestExample
{
}


text:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

rvm use 1.8.7
bundle install

rvm use 1.9.2
bundle install

rvm use 1.9.3
bundle install

rvm use 2.0.0
bundle install

rvm use ruby-head
bundle install

rvm use jruby
bundle install


text:
layout:     post
title:      "Where are you goals?"
subtitle:   "What are you waiting for..."
date:       2017-01-01 12:00:00
author:     "Adam Allard"
header-img: "img/where-are-your-goals.jpg"
---

Happy 2017 Everyone

*(well, at least at the time of this writing)*

It's 12:23 AM on Janurary 1st, 2017, my kids are sound asleep, my wife finally just went to bed (I got her to actually stay up with me for the ball drop this year, went to bed right after), and I'm fairly drunk by this point, so what better time to write another blog post?

As I scroll down my Facebook feed, I contanstly see more and more statuses about the new year, to which I can pretty much sum most of all up with the simple, yet cliche phrase of *"new year new me."*

Ok, I get it. It's a new year, you want to start bettering yourself. You want to read more. You want to eat better. You want to start going to the gym for 60 minutes at least 3 times a week. Tis' the season to start making goals that you'll give up on within the first 9 days.

Sound cynical? Well, it may be the bottle of champagne that I'm trying to finish all by myself now, or it may be the sad fact that we for some reason need some artificial date such as the beginning of a *New Year* to start bettering ourselves.

My main point of this blog post is to ask the question, **Why do you need to wait to start your goals?**

One main answer to this is question, and I completely agree, is that:
A goal that plans to succeed has had successful planning.

In order to succeed in your goals, you need preperation. Read this post here if you want help on making a goal. But there is no purpose of waiting for some artificial date such as a new year just to start achiving your goal.

My philosophy is that once you're done planning on your goal, just start. Don't wait until the New Year, don't wait until the first of the month, don't wait until *"blah blah blah"*, just start.

I'm a prior smoker, and before I actually quit, I've tried quitting plenty of times. A smoker for nearly 7 years, I've tried to quit a dozen of times. I remember everytime I've attempted to quit was something of the similar of *"I'll quit after this pack"* or *"I'll quit after next month"* or *"My New Year's resolution is to quit smoking!"*

The problem with this type of planning is not that you're giving yourself a set date to start achieving your goal, it's that you're giving yourself an extended opportunity to continue your (what I see as, an) addiction. By stating *"I'll start next month or I'll start [enter your pathetic phrase]"*, you're allowing yourself to knowingly continue your faults. Even if you intend to fully commit to your goal, by stating you're not going to start *right now* is allowing you to convince yourself that it's O.K. to continue your habits for *just a little bit longer.* My point...

STOP PROCRASTINATING

When you think of your next goal, when you notice you have a faul, when you realize that there's a specific area where you can better yourself, understand that there's only two real steps involved: **Plan** and **Execute**.


text:
require.config({
	// The shim config allows us to configure dependencies for
	// scripts that do not call define() to register a module
    baseUrl: 'js/app',

    shim: {
        underscore: {
            exports: '_'
        },
        backbone: {
            deps: [
                'underscore',
                'jquery'
            ],
            exports: 'Backbone'
        },
        backboneLocalstorage: {
            deps: ['backbone'],
            exports: 'Store'
        },
        backboneMarionette: {
            deps: ['jquery', 'underscore', 'backbone'],
            exports: 'Marionette'
        },
    },
    paths: {
        jquery: '../lib/jquery',
        underscore: '../lib/underscore',
        backbone: '../lib/backbone',
        backboneLocalstorage: '../lib/backbone.localStorage',
        text: '../lib/requirejs-text'
        backboneLocalstorage: '../lib/backbone.marionette',

    }
});

require([
    'app',
    'backbone',
    'routers/index',
    'controllers/index'
], function(picpikApp, Backbone, Router, Controller) {
    picpikApp.init();
    new Router({
        controller: Controller
    });
    Backbone.history.start();
});


text:
package com.tngtech.archunit.example.layers;

public interface SomeOtherBusinessInterface {
}


text:
SELECT COUNT_BIG(*) AS 'Counter' FROM [Northwind].[dbo].[Customers]

-- Task 1.1
-- PostgreSQL
-- !!!! PostgreSQL returns bigInt as default
-- SELECT count(*) FROM sometable;

-- Task 1.2
SELECT LEN('Zarichkovyi') AS 'SurnameLen'

-- Task 1.3
SELECT REPLACE('Alexander Zarichkovyi Anatolievich', ' ', '_') AS 'Replaced'

-- Task 1.4
SELECT CONCAT(LEFT([LastName], 2), LEFT([FirstName], 4), '@Zarichkovyi') AS 'E-mail' FROM [Northwind].[dbo].[Employees]

-- Task 1.5
SELECT DATENAME(DW, '1998-06-21') AS 'BirthDayName'

-- Task 2.1
SELECT * FROM [Northwind].[dbo].[Products] AS [P]
LEFT JOIN [Northwind].[dbo].[Categories] AS [C]
          ON [P].[CategoryID] = [C].[CategoryID]
LEFT JOIN [Northwind].[dbo].[Suppliers] AS [S]
          ON [P].[SupplierID] = [S].[SupplierID]

-- Task 2.2
SELECT * FROM [Northwind].[dbo].[Orders]
WHERE ([ShippedDate] IS NULL) AND
      ([OrderDate] BETWEEN '1998-04-01' AND '1998-04-30 23:59:59.000') -- Selection of all dates from interval [1998-04-01; 1998-05-01)

-- Task 2.3
SELECT DISTINCT [LastName]
               ,[FirstName]
FROM [Northwind].[dbo].[Employees] AS [E]
INNER JOIN [Northwind].[dbo].[EmployeeTerritories] AS [ET]
          ON [E].[EmployeeID] = [ET].[EmployeeID]
INNER JOIN [Northwind].[dbo].[Territories] AS [T]
          ON [T].[TerritoryID] = [ET].[TerritoryID]
INNER JOIN [Northwind].[dbo].[Region] AS [R]
          ON [T].[RegionID] = [R].[RegionID]
WHERE [R].[RegionDescription] = 'Northern'

-- Task 2.4
SELECT CAST(SUM([UnitPrice] * (1 - [Discount]) * [Quantity]) AS Money)  AS 'Sum'
FROM [Northwind].[dbo].[Order Details] AS [OD]
INNER JOIN [Northwind].[dbo].[Orders] AS [O]
          ON [O].[OrderID] = [OD].[OrderID]
WHERE (DAY([O].[OrderDate]) % 2 = 1)

-- Task 2.5
;WITH [table] AS (SELECT [OrderID],
                  SUM([UnitPrice] * (1 - [Discount]) * [Quantity]) AS 'Sum'
                  FROM [Northwind].[dbo].[Order Details]
                  GROUP BY [OrderID])

SELECT [ShipAddress]
FROM [Northwind].[dbo].[Orders]
WHERE [OrderID] IN (SELECT [OrderID] FROM [table] -- Taking OrderID of max value
                    WHERE [Sum] = (SELECT MAX([Sum]) FROM [table])) -- Finging max value from table


text:
testenv:
	pip install -r requirements.txt
	pip install Django
	pip install -e .

test:
	nosetests --with-coverage --cover-erase --cover-package=wooey tests
	coverage run --append --branch --source=wooey `which django-admin.py` test --settings=wooey.test_settings wooey.tests
	coverage report


text:
package com.danisola.restify.url.types;

import com.danisola.restify.url.RestParser;
import com.danisola.restify.url.RestUrl;
import org.junit.Test;

import static com.danisola.restify.url.RestParserFactory.parser;
import static com.danisola.restify.url.matchers.IsInvalid.isInvalid;
import static com.danisola.restify.url.matchers.IsValid.isValid;
import static com.danisola.restify.url.types.IntVar.intVar;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

public class IntVarTest {

    @Test
    public void whenNegIntIsCorrectThenIntegerIsReturned() {
        RestParser parser = parser("/users/{}", intVar("userId"));
        RestUrl url = parser.parse("http://www.mail.com/users/-2397");
        assertThat(url, isValid());
        assertThat((Integer) url.variable("userId"), is(-2397));
    }

    @Test
    public void whenNegIntIsNotExpectedThenUrlIsInvalid() {
        RestParser parser = parser("/users/{}", intVar("userId", "[0-9]+"));
        RestUrl url = parser.parse("http://www.mail.com/users/-2397");
        assertThat(url, isInvalid());
    }

    @Test
    public void whenValueIsTooBigThenUrlIsInvalid() {
        RestParser parser = parser("/users/{}", intVar("userId"));
        RestUrl url = parser.parse("http://www.mail.com/users/493483292384928439432397");
        assertThat(url, isInvalid());
    }

    @Test
    public void whenVariableIsEmptyThenUrlIsInvalid() {
        RestParser parser = parser("/users/{}", intVar("userId"));
        RestUrl url = parser.parse("http://www.mail.com/users/");
        assertThat(url, isInvalid());
    }
}


text:
select ceil(-28)+2 from db_root;
select ceil(-28)-2 from db_root;
select ceil(-28)*2 from db_root;
select ceil(-28)/2 from db_root order by 1;


text:
@interface PodsDummy_Pods_OCLogTemplate : NSObject
@end
@implementation PodsDummy_Pods_OCLogTemplate
@end


text:
.class Lcom/google/android/gms/internal/zzli$6;
.super Ljava/lang/Object;

# interfaces
.implements Lcom/google/android/gms/common/api/GoogleApiClient$OnConnectionFailedListener;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/google/android/gms/internal/zzli;->clearDefaultAccountAndReconnect()Lcom/google/android/gms/common/api/PendingResult;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic zzacr:Lcom/google/android/gms/internal/zzli;

.field final synthetic zzacv:Lcom/google/android/gms/internal/zzlo;

# direct methods
.method constructor <init>(Lcom/google/android/gms/internal/zzli;Lcom/google/android/gms/internal/zzlo;)V
    .registers 3

    iput-object p1, p0, Lcom/google/android/gms/internal/zzli$6;->zzacr:Lcom/google/android/gms/internal/zzli;

    iput-object p2, p0, Lcom/google/android/gms/internal/zzli$6;->zzacv:Lcom/google/android/gms/internal/zzlo;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public onConnectionFailed(Lcom/google/android/gms/common/ConnectionResult;)V
    .registers 5
    .param p1, "result"    # Lcom/google/android/gms/common/ConnectionResult;

    .prologue
    iget-object v0, p0, Lcom/google/android/gms/internal/zzli$6;->zzacv:Lcom/google/android/gms/internal/zzlo;

    new-instance v1, Lcom/google/android/gms/common/api/Status;

    const/16 v2, 0x8

    invoke-direct {v1, v2}, Lcom/google/android/gms/common/api/Status;-><init>(I)V

    invoke-virtual {v0, v1}, Lcom/google/android/gms/internal/zzlo;->zzb(Lcom/google/android/gms/common/api/Result;)V

    return-void
.end method


text:
layout: default
title: Learning GitHub Pages
---

Hi there, I'm Robaiatul Islam!

I am trying to learn about GitHub Pages by following some blog posts and video tutorials. Read more about my life...


text:
namespace LinFx.Extensions.ObjectExtending.Modularity
{
    public class ExtensionPropertyUiFormConfiguration
    {
        /// <summary>
        /// Default: true.
        /// </summary>
        public bool IsVisible { get; set; } = true;
    }
}


text:
package listeners;

import global.GlobalValues;
import gui.Renderer;
import gui.RightPanel;
import init.GlobalInit;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.geom.Point2D.Float;

import javax.swing.SwingUtilities;

import logic.RendererLogic;
import objects.World;
import annotations.Autowired;
import utils.Utils;
import static utils.Constants.TILES_PER_SIDE;

public class RendererMouseListener implements MouseListener, MouseMotionListener {

    @Autowired
    private Renderer renderer;
    @Autowired
    private World world;
    @Autowired
    private MousePositionRightPressed mousePositionRightPressed;
    @Autowired
    private GlobalInit globalInit;
    @Autowired
    private GlobalValues globalValues;
    @Autowired
    private MouseDataObject mouseDataObject;
    @Autowired
    private RightPanel rightPanel;
    @Autowired
    private RendererLogic rendererLogic;

    @Override
    public void mouseDragged(MouseEvent e) {
        if (SwingUtilities.isRightMouseButton(e)) {
            world.setOffset_x(mousePositionRightPressed.getTemporaryOffsetX() + (e.getX() - mousePositionRightPressed.getX()));
            world.setOffset_y(mousePositionRightPressed.getTemporaryOffsetY() + (e.getY() - mousePositionRightPressed.getY()));
            globalInit.init();
        }
    }

    @Override
    public void mouseMoved(MouseEvent e) {
        Float colRow = Utils.getColRow(e.getX() - world.getOffset_x(), e.getY() - world.getOffset_y());
        int x = (int) Math.ceil(colRow.getX());
        int y = (int) Math.ceil(colRow.getY());
        if (x >= 0 && x < TILES_PER_SIDE && y >= 0 && y < TILES_PER_SIDE) {
            Utils.getColRow(x, y);
            globalValues.setCurrentlySelectedTile_x(x);
            globalValues.setCurrentlySelectedTile_y(y);
        }
    }

    @Override
    public void mouseClicked(MouseEvent e) {
        // build mode
        if (globalValues.getConstructBuilding() != null) {
            if (globalValues.isCanBuild()) {
                Float colRow = Utils.getColRow(e.getX() - world.getOffset_x(), e.getY() - world.getOffset_y());
                int x = (int) Math.ceil(colRow.getX());
                int y = (int) Math.ceil(colRow.getY());
                if (x >= 0 && x < TILES_PER_SIDE && y >= 0 && y < TILES_PER_SIDE) {
                    Utils.getColRow(x, y);
                    globalValues.setCurrentlySelectedTile_x(x);
                    globalValues.setCurrentlySelectedTile_y(y);
                }
                rendererLogic.build(x, y);
            }
        }
    }

    @Override
    public void mouseEntered(MouseEvent e) {
        // TODO

    }

    @Override
    public void mouseExited(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    @Override
    public void mousePressed(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    @Override
    public void mouseReleased(MouseEvent e) {
        // TODO Auto-generated method stub

    }
}


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.34014
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace _07.AddRowExcel {

    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {

        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));

        public static Settings Default {
            get {
                return defaultInstance;
            }
        }

        [global::System.Configuration.UserScopedSettingAttribute()]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Configuration.DefaultSettingValueAttribute("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=..\\..\\ScoreTable.xlsx;Extended Prop" +
            "erties=\"Excel 12.0 Xml;HDR=YES\";")]
        public string OleDBConnectionString {
            get {
                return ((string)(this["OleDBConnectionString"]));
            }
            set {
                this["OleDBConnectionString"] = value;
            }
        }
    }
}


text:
header
{
    height:64px;
    background-color:yellow;
}

header a
{
}

header img#imgTitle
{
height:64px;
margin:auto;
display:block;
float:left;
}

header img#imgLogo
{
height:64px;
display:block;
float:left;
}

header img#imgMore
{
height:64px;
margin:auto;
display:block;
float:right;
}

header img#settings
{
background:url(../img/settings-down.png)
}

header h1#page_caption
{
    font-size:45px;
}

header img#settings a:hover img
{
visibility:hidden;
}

div#divCurrentStatus
{
    height:48px;
    background-color:yellow;
	margin:0px;
	display:block;
}

div#divCurrentStatus h2
{
    font-size:36px;
	margin:auto;
}

div#menuMore
{
    position: absolute;
    border-radius: 5px;
    background-color:black;
}

div#menuMore.menuHidden
{
    left: -1000px;
}

div#menuMore.menuShow
{
    left: 100px;
}

#menuMore h2{
    display: block;
    margin: 7px;
    padding: 10px 20px;
    font-weight: bold;
    font-size: 20px;
    text-align: center;
    border-radius: 5px;
    background-color:black;
	color:white;
}

div#main_page
{
display:none;
}

div#loginPopup
{
display:none;
}

.modalDialog {
    position: fixed;
    font-family: Arial, Helvetica, sans-serif;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0,0,0,0.8);
    z-index: 99999;
    opacity:0;
    -webkit-transition: opacity 400ms ease-in;
    -moz-transition: opacity 400ms ease-in;
    transition: opacity 400ms ease-in;
    pointer-events: none;
}

.modalDialog:target {
    opacity:1;
    pointer-events: auto;
}

.modalDialog > div {
    width: 400px;
    position: relative;
    margin: 10% auto;
    padding: 5px 20px 13px 20px;
    border-radius: 10px;
    background: #EFF8FB;
    background: -moz-linear- gradient(#fff, # 999);
    background: -webkit-linear- gradient(#fff, # 999);
    background: -o-linear- gradient(#fff, # 999);
}

.modalDialog label {
padding: 10px;
}

.modalDialog input {
width:80%;
}

.modalDialog button {
-webkit-box-shadow: rgba(0, 0, 0, 0.296875) 0px 1px 0px 0px, rgba(0, 0, 0, 0.296875) 0px -1px 0px 0px;
-webkit-transition-delay: 0s;
-webkit-transition-duration: 0.20000000298023224s;
-webkit-transition-property: opacity;
-webkit-transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
background-attachment: scroll;
background-clip: border-box;
background-color: #6699FF;
background-origin: padding-box;
border-bottom-color: #6666FF;
border-radius: 7px;
border-style: solid;
border-width: 1px;
border-top-color: #99CCFF;
box-shadow: rgba(0, 0, 0, 0.296875) 0px 1px 0px 0px, rgba(0, 0, 0, 0.296875) 0px -1px 0px 0px;
color: white;
cursor: pointer;
display: block;
font-family: 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif;
font-size: 16px;
font-style: normal;
font-variant: normal;
font-weight: 500;
outline-color: white;
outline-style: none;
outline-width: 0px;
padding: 7px;
text-align: center;
text-decoration: none;
text-shadow: rgba(0, 0, 0, 0.398438) 1px 1px 0px;
vertical-align: baseline;

text-shadow: 0 1px 1px #000000;
line-height: 20px;
background-color: #6699FF;
border-bottom-color: #6666FF;
border-top-color: #99CCFF;

letter-spacing: 1px;
margin: auto;
}

.close {
    background: #606061;
    color:  #FFFFFF ;
    line-height: 25px;
    position: absolute;
    right: -12px;
    text-align: center;
    top: -10px;
    width: 24px;
    text-decoration: none;
    font-weight: bold;
    -webkit-border-radius: 12px;
    -moz-border-radius: 12px;
    border-radius: 12px;
    -moz-box-shadow: 1px 1px 3px #000;
    -webkit-box-shadow: 1px 1px 3px #000;
    box-shadow: 1px 1px 3px #000;
}

.close:hover { background: #00d9ff; }

div.divSettings {
background: #EFF8FB;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
padding: 20px;
width: 90%;
margin:auto;
counter-reset: fieldsets;
margin-bottom: 20px;
}

div.divSettings fieldset {
border: none;
margin-bottom: 10px;
border-bottom: 1px solid grey;
}

div.divSettings fieldset:last-of-type {
margin-bottom: 0;
border: none;
}

div.divSettings legend {
color: #384313;
font-weight: bold;
padding-bottom: 10px;
}

div.divSettings > fieldset > legend:before {
content: counter(fieldsets) ": ";
counter-increment: fieldsets;
}

div.divSettings ol li {
background: #b9cf6a;
background: rgba(255,255,255,.3);
border-color: #e3ebc3;
border-color: rgba(255,255,255,.6);
border-style: solid;
border-width: 0px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
line-height: 20px;
list-style: none;
padding: 5px 10px;
margin-bottom: 2px;
font-size: 13px;
}

div.divSettings label {
float: left;
width: 240px;
}

div.divSettings input {
width: 350px;
}

div.divSettings textarea {
width: 350px;
}

div.divSettings button {
-webkit-box-shadow: rgba(0, 0, 0, 0.296875) 0px 1px 0px 0px, rgba(0, 0, 0, 0.296875) 0px -1px 0px 0px;
-webkit-transition-delay: 0s;
-webkit-transition-duration: 0.20000000298023224s;
-webkit-transition-property: opacity;
-webkit-transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
background-attachment: scroll;
background-clip: border-box;
background-color: #6699FF;
background-origin: padding-box;
border-bottom-color: #6666FF;
border-radius: 7px;
border-style: solid;
border-width: 1px;
border-top-color: #99CCFF;
box-shadow: rgba(0, 0, 0, 0.296875) 0px 1px 0px 0px, rgba(0, 0, 0, 0.296875) 0px -1px 0px 0px;
color: white;
cursor: pointer;
display: block;
font-family: 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif;
font-size: 16px;
font-style: normal;
font-variant: normal;
font-weight: 500;
outline-color: white;
outline-style: none;
outline-width: 0px;
padding: 7px;
text-align: center;
text-decoration: none;
text-shadow: rgba(0, 0, 0, 0.398438) 1px 1px 0px;
vertical-align: baseline;

text-shadow: 0 1px 1px #000000;
line-height: 20px;
background-color: #6699FF;
border-bottom-color: #6666FF;
border-top-color: #99CCFF;

letter-spacing: 1px;
margin: auto;
}

ul#msgsTable
{
border:0;
border-spacing:0;
cellpadding:10;
cellspacing:0;
 margin: 0;
 padding: 0;
}
ul#msgsTable li{
 list-style: none;
 border: solid 1px #ddd;
 border-radius: 8px;
 -moz-border-radius: 8px;
 margin: 0 0 6px 0;
 padding: 8px;
 overflow: auto;
 background-color: #fff;
}
ul#msgsTable li a{
 text-decoration: none;
}
ul#msgsTable li img{
 display: block;
 float: left;
 margin-right: 8px;
}
ul#msgsTable li strong{
 display: block;
 font-family: Verdana, Arial, Helvetica, sans;
 font-size: 16px;
 line-height: 1.5em;
}
ul#msgsTable li div{
 display: block;
 font-size: 14px;
 color: #000;
}
p.error{
 color:#ff0000;
}

.rbStatus
{
	display:block;
	margin: 5px;
	padding: 20px;
    border-radius: 5px;
    background-color:black;
	color:white;
}


text:
#include <stdint.h>

#include "software_cfu.h"

//
// Create your own version of this function by copying this file to your
// project's src directory, then modifying it.
//
// In this function, place C code to emulate your CFU. You can switch between
// hardware and emulated CFU by setting the CFU_SOFTWARE_DEFINED DEFINE in
// the Makefile.
uint32_t software_cfu(int funct3, int funct7, uint32_t rs1, uint32_t rs2) {
  (void)rs1;
  (void)rs2;
  return 0;
}


text:
<?php
session_start();
require_once("../modelos/Tarifas.php");

$tarifa = new Tarifas();

/*INICIALIZO VARIABLES*/

$idtarifa=isset($_POST['idtarifa'])? limpiarCadena($_POST['idtarifa']):"";

$nombre=isset($_POST["nombre"])? limpiarCadena($_POST["nombre"]):"";

$montotsmp=isset($_POST['montotsmp'])? limpiarCadena($_POST['montotsmp']):"";

$montotsmc=isset($_POST['montotsmc'])? limpiarCadena($_POST['montotsmc']):"";

$montocaribec=isset($_POST['montocaribec'])? limpiarCadena($_POST['montocaribec']):"";

switch ($_GET["op"]){
    case 'guardaryeditar':
		if (empty($idtarifa)){
            $rspta=$tarifa->insertar($nombre,$montotsmp,$montotsmc,$montocaribec);
            echo $rspta ? "Tarifa registrada con exito":"No se pudieron registrar todos los datos de la tarifa";
		}
		else {
            $rspta=$tarifa->editar($idtarifa,$nombre,$montotsmp,$montotsmc,$montocaribec);
			echo $rspta ? "Tarifa actualizada con exito":"No se pudieron actualizar los datos de la tarifa";
		}
    break;

    case 'listar':
        $rspta = $tarifa->listar();
        $data = Array();
        while($reg = $rspta->fetch_object()){
           $data[]=array(
 				"0"=>'<button class="btn btn-warning" onclick="mostrar('.$reg->idtarifa.')"></button>'.
 					' <button class="btn btn-danger" onclick="eliminar('.$reg->idtarifa.')"></button>',
 				"1"=>$reg->nombre,
 				"2"=>$reg->montotsmp,
 				"3"=>$reg->montotsmc,
 				"4"=>$reg->montocaribec
           );
        }
        /*CARGAMOS LA DATA EN LA VARIABLE USADA PARA EL DATATABLE*/
        $results = array(
 			"sEcho"=>1, //Informacion para el datatables
 			"iTotalRecords"=>count($data), //enviamos el total registros al datatable
 			"iTotalDisplayRecords"=>count($data), //enviamos el total registros a visualizar
 			"aaData"=>$data);
        echo json_encode($results);
    break;

    case 'mostrar':
        /*ID USUARIO SE ENVIA POR POST ESTA DECLARADO EN LA INICIALIACION*/
        $rspta = $tarifa->mostrar($idtarifa);
        echo json_encode($rspta);
    break;

    case 'eliminar':
      $rspta = $tarifa->eliminar($idtarifa);
      echo $rspta ? "Tarifa eliminada": "La tarifa no se puede eliminar";
    break;

    case 'listarHTML':
        $rspta = $tarifa->listar();
        $data = Array();
        while($reg = $rspta->fetch_object()){
            echo '
 '.$reg->nombre.'	 '.$reg->montotsmp.'	<input class="normal" type="number" step="1" max="10" min="0">
';
        }
    break;

}


text:
class ApplicationController < ActionController::Base
  SESSION_EXPIRES_AFTER_SECONDS = (ENV.fetch('SESSION_EXPIRES_AFTER_SECONDS'){3600}).to_i

  protect_from_forgery with: :exception
  before_action :set_cache_headers, :login_required, :admin_required

  private

  def login_required
    # User must be logged in to access site
    if session[:user_id]
      @current_user = User.find_by_id session[:user_id]
      return if @current_user
    end
    redirect_to login_path
    false
  end

  def admin_required
    # Non-admin users trying to access /admin prefixed paths are redirected to root
    path = Rails.application.routes.recognize_path request.env['PATH_INFO']
    top_path = "/#{path[:controller].split('/')[0]}"
    if top_path == admin_root_path && !@current_user.admin?
      redirect_to root_path
    end
  end

  def set_cache_headers
    expires_now
    response.headers["Cache-Control"] = "no-cache, no-store"
    response.headers["Pragma"] = "no-cache"
    response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
  end

  def is_demo_mode?
    # Don't set this flag as a constant b/c test env changes it
    ENV['IS_DEMO_MODE'] == '1'
  end
end


text:
$ErrorActionPreference = 'Stop';

$toolsPath = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"

$packageArgs = @{
  packageName    = 'texmaker'
  fileType       = 'exe'
  file           = "$toolsPath\texmakerwin32_install.exe"
  softwareName   = 'Texmaker'
  silentArgs     = '/S'
  validExitCodes = @(0)
}

Install-ChocolateyInstallPackage @packageArgs

Remove-Item -Force -ea 0 "$toolsPath\*.exe","$toolsPath\*.ignore"


text:
package com.android.org.bouncycastle.asn1.x509;

@com.francetelecom.rd.stubs.annotation.ClassDone(0)
public class V1TBSCertificateGenerator
{
  // Constructors

  public V1TBSCertificateGenerator(){
  }
  // Methods

  public void setSerialNumber(com.android.org.bouncycastle.asn1.DERInteger arg1){
  }
  public void setSignature(AlgorithmIdentifier arg1){
  }
  public void setIssuer(X509Name arg1){
  }
  public void setIssuer(com.android.org.bouncycastle.asn1.x500.X500Name arg1){
  }
  public void setStartDate(Time arg1){
  }
  public void setStartDate(com.android.org.bouncycastle.asn1.DERUTCTime arg1){
  }
  public void setEndDate(Time arg1){
  }
  public void setEndDate(com.android.org.bouncycastle.asn1.DERUTCTime arg1){
  }
  public void setSubject(X509Name arg1){
  }
  public void setSubject(com.android.org.bouncycastle.asn1.x500.X500Name arg1){
  }
  public void setSubjectPublicKeyInfo(SubjectPublicKeyInfo arg1){
  }
  public TBSCertificateStructure generateTBSCertificate(){
    return (TBSCertificateStructure) null;
  }
}


text:
import type { TSIZE_SM } from '@/spec'
import { SIZE } from '@/constant'

export const getFontSize = (size: TSIZE_SM): string => {
  switch (size) {
    case SIZE.MEDIUM: {
      return '15px'
    }

    default:
      return '14px'
  }
}

export const holder = 1


text:
import { StartupTypes } from '../Redux/StartupRedux'
import Immutable from 'seamless-immutable'
const Reactotron = require('reactotron-react-native').default
const errorPlugin = require('reactotron-react-native').trackGlobalErrors
const apisaucePlugin = require('reactotron-apisauce')
const { reactotronRedux } = require('reactotron-redux')
const sagaPlugin = require('reactotron-redux-saga')

if (__DEV__) {
  Reactotron
    .configure({
      // host: '10.0.3.2' // default is localhost (on android don't forget to `adb reverse tcp:9090 tcp:9090`)
      name: 'Ignite App' // would you like to see your app's name?
    })

    // forward all errors to Reactotron
    .use(errorPlugin({
      // ignore all error frames from react-native (for example)
      veto: (frame) =>
        frame.fileName.indexOf('/node_modules/react-native/') >= 0
    }))

    // register apisauce so we can install a monitor later
    .use(apisaucePlugin())

    // setup the redux integration with Reactotron
    .use(reactotronRedux({
      // you can flag some of your actions as important by returning true here
      isActionImportant: action => action.type === StartupTypes.STARTUP,

      // you can flag to exclude certain types too... especially the chatty ones
      // except: ['EFFECT_TRIGGERED', 'EFFECT_RESOLVED', 'EFFECT_REJECTED', 'persist/REHYDRATE'],

      // Fires when Reactotron uploads a new copy of the state tree.  Since our reducers are
      // immutable with `seamless-immutable`, we ensure we convert to that format.
      onRestore: state => Immutable(state)
    }))

    // register the redux-saga plugin so we can use the monitor in CreateStore.js
    .use(sagaPlugin())

    // let's connect!
    .connect()

  // Let's clear Reactotron on every time we load the app
  Reactotron.clear()

  // Totally hacky, but this allows you to not both importing reactotron-react-native
  // on every file.  This is just DEV mode, so no big deal.
  console.tron = Reactotron
} else {
  // a mock version should you decide to leave console.tron in your codebase
  console.tron = {
    log: () => false,
    warn: () => false,
    error: () => false,
    display: () => false,
    image: () => false
  }
}


text:
package validation

import (
	"fmt"
	"net"
	"net/url"
	"os"
	"path/filepath"
	"strings"

	"github.com/spf13/pflag"

	"k8s.io/apimachinery/pkg/util/sets"
	"k8s.io/apimachinery/pkg/util/validation"
	"k8s.io/apimachinery/pkg/util/validation/field"
	bootstrapapi "k8s.io/client-go/tools/bootstrap/token/api"
	bootstraputil "k8s.io/client-go/tools/bootstrap/token/util"
	"k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
	"k8s.io/kubernetes/cmd/kubeadm/app/constants"
	"k8s.io/kubernetes/cmd/kubeadm/app/features"
	kubeadmutil "k8s.io/kubernetes/cmd/kubeadm/app/util"
	apivalidation "k8s.io/kubernetes/pkg/apis/core/validation"
	"k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig"
	kubeletscheme "k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig/scheme"
	kubeletvalidation "k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig/validation"
	"k8s.io/kubernetes/pkg/proxy/apis/kubeproxyconfig"
	kubeproxyscheme "k8s.io/kubernetes/pkg/proxy/apis/kubeproxyconfig/scheme"
	kubeproxyconfigv1alpha1 "k8s.io/kubernetes/pkg/proxy/apis/kubeproxyconfig/v1alpha1"
	proxyvalidation "k8s.io/kubernetes/pkg/proxy/apis/kubeproxyconfig/validation"
	"k8s.io/kubernetes/pkg/registry/core/service/ipallocator"
)

// ValidateMasterConfiguration validates master configuration and collects all encountered errors
func ValidateMasterConfiguration(c *kubeadm.MasterConfiguration) field.ErrorList {
	allErrs := field.ErrorList{}
	allErrs = append(allErrs, ValidateNetworking(&c.Networking, field.NewPath("networking"))...)
	allErrs = append(allErrs, ValidateCertSANs(c.APIServerCertSANs, field.NewPath("apiServerCertSANs"))...)
	allErrs = append(allErrs, ValidateAbsolutePath(c.CertificatesDir, field.NewPath("certificatesDir"))...)
	allErrs = append(allErrs, ValidateNodeRegistrationOptions(&c.NodeRegistration, field.NewPath("nodeRegistration"))...)
	allErrs = append(allErrs, ValidateBootstrapTokens(c.BootstrapTokens, field.NewPath("bootstrapTokens"))...)
	allErrs = append(allErrs, ValidateFeatureGates(c.FeatureGates, field.NewPath("featureGates"))...)
	allErrs = append(allErrs, ValidateAPIEndpoint(&c.API, field.NewPath("api"))...)
	allErrs = append(allErrs, ValidateProxy(c.KubeProxy.Config, field.NewPath("kubeProxy").Child("config"))...)
	allErrs = append(allErrs, ValidateEtcd(&c.Etcd, field.NewPath("etcd"))...)
	allErrs = append(allErrs, ValidateKubeletConfiguration(&c.KubeletConfiguration, field.NewPath("kubeletConfiguration"))...)
	return allErrs
}

// ValidateProxy validates proxy configuration and collects all encountered errors
func ValidateProxy(c *kubeproxyconfigv1alpha1.KubeProxyConfiguration, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}

	// Convert to the internal version
	internalcfg := &kubeproxyconfig.KubeProxyConfiguration{}
	err := kubeproxyscheme.Scheme.Convert(c, internalcfg, nil)
	if err != nil {
		allErrs = append(allErrs, field.Invalid(fldPath, "", err.Error()))
		return allErrs
	}
	return proxyvalidation.Validate(internalcfg)
}

// ValidateNodeConfiguration validates node configuration and collects all encountered errors
func ValidateNodeConfiguration(c *kubeadm.NodeConfiguration) field.ErrorList {
	allErrs := field.ErrorList{}
	allErrs = append(allErrs, ValidateDiscovery(c)...)
	allErrs = append(allErrs, ValidateNodeRegistrationOptions(&c.NodeRegistration, field.NewPath("nodeRegistration"))...)

	if !filepath.IsAbs(c.CACertPath) || !strings.HasSuffix(c.CACertPath, ".crt") {
		allErrs = append(allErrs, field.Invalid(field.NewPath("caCertPath"), c.CACertPath, "the ca certificate path must be an absolute path"))
	}
	return allErrs
}

// ValidateNodeRegistrationOptions validates the NodeRegistrationOptions object
func ValidateNodeRegistrationOptions(nro *kubeadm.NodeRegistrationOptions, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	if len(nro.Name) == 0 {
		allErrs = append(allErrs, field.Required(fldPath, "--node-name or .nodeRegistration.name in the config file is a required value. It seems like this value couldn't be automatically detected in your environment, please specify the desired value using the CLI or config file."))
	} else {
		allErrs = append(allErrs, apivalidation.ValidateDNS1123Subdomain(nro.Name, field.NewPath("name"))...)
	}
	allErrs = append(allErrs, ValidateAbsolutePath(nro.CRISocket, fldPath.Child("criSocket"))...)
	// TODO: Maybe validate .Taints as well in the future using something like validateNodeTaints() in pkg/apis/core/validation
	return allErrs
}

// ValidateDiscovery validates discovery related configuration and collects all encountered errors
func ValidateDiscovery(c *kubeadm.NodeConfiguration) field.ErrorList {
	allErrs := field.ErrorList{}
	if len(c.DiscoveryToken) != 0 {
		allErrs = append(allErrs, ValidateToken(c.DiscoveryToken, field.NewPath("discoveryToken"))...)
	}
	if len(c.DiscoveryFile) != 0 {
		allErrs = append(allErrs, ValidateDiscoveryFile(c.DiscoveryFile, field.NewPath("discoveryFile"))...)
	}
	allErrs = append(allErrs, ValidateArgSelection(c, field.NewPath("discovery"))...)
	allErrs = append(allErrs, ValidateToken(c.TLSBootstrapToken, field.NewPath("tlsBootstrapToken"))...)
	allErrs = append(allErrs, ValidateJoinDiscoveryTokenAPIServer(c.DiscoveryTokenAPIServers, field.NewPath("discoveryTokenAPIServers"))...)

	return allErrs
}

// ValidateArgSelection validates discovery related configuration and collects all encountered errors
func ValidateArgSelection(cfg *kubeadm.NodeConfiguration, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	if len(cfg.DiscoveryToken) != 0 && len(cfg.DiscoveryFile) != 0 {
		allErrs = append(allErrs, field.Invalid(fldPath, "", "discoveryToken and discoveryFile cannot both be set"))
	}
	if len(cfg.DiscoveryToken) == 0 && len(cfg.DiscoveryFile) == 0 {
		allErrs = append(allErrs, field.Invalid(fldPath, "", "discoveryToken or discoveryFile must be set"))
	}
	if len(cfg.DiscoveryTokenAPIServers) < 1 && len(cfg.DiscoveryToken) != 0 {
		allErrs = append(allErrs, field.Required(fldPath, "discoveryTokenAPIServers not set"))
	}

	if len(cfg.DiscoveryFile) != 0 && len(cfg.DiscoveryTokenCACertHashes) != 0 {
		allErrs = append(allErrs, field.Invalid(fldPath, "", "discoveryTokenCACertHashes cannot be used with discoveryFile"))
	}

	if len(cfg.DiscoveryFile) == 0 && len(cfg.DiscoveryToken) != 0 &&
		len(cfg.DiscoveryTokenCACertHashes) == 0 && !cfg.DiscoveryTokenUnsafeSkipCAVerification {
		allErrs = append(allErrs, field.Invalid(fldPath, "", "using token-based discovery without discoveryTokenCACertHashes can be unsafe. set --discovery-token-unsafe-skip-ca-verification to continue"))
	}

	// TODO remove once we support multiple api servers
	if len(cfg.DiscoveryTokenAPIServers) > 1 {
		fmt.Println("[validation] WARNING: kubeadm doesn't fully support multiple API Servers yet")
	}
	return allErrs
}

// ValidateJoinDiscoveryTokenAPIServer validates discovery token for API server
func ValidateJoinDiscoveryTokenAPIServer(apiServers []string, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	for _, m := range apiServers {
		_, _, err := net.SplitHostPort(m)
		if err != nil {
			allErrs = append(allErrs, field.Invalid(fldPath, m, err.Error()))
		}
	}
	return allErrs
}

// ValidateDiscoveryFile validates location of a discovery file
func ValidateDiscoveryFile(discoveryFile string, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	u, err := url.Parse(discoveryFile)
	if err != nil {
		allErrs = append(allErrs, field.Invalid(fldPath, discoveryFile, "not a valid HTTPS URL or a file on disk"))
		return allErrs
	}

	if u.Scheme == "" {
		// URIs with no scheme should be treated as files
		if _, err := os.Stat(discoveryFile); os.IsNotExist(err) {
			allErrs = append(allErrs, field.Invalid(fldPath, discoveryFile, "not a valid HTTPS URL or a file on disk"))
		}
		return allErrs
	}

	if u.Scheme != "https" {
		allErrs = append(allErrs, field.Invalid(fldPath, discoveryFile, "if a URL is used, the scheme must be https"))
	}
	return allErrs
}

// ValidateBootstrapTokens validates a slice of BootstrapToken objects
func ValidateBootstrapTokens(bts []kubeadm.BootstrapToken, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	for i, bt := range bts {
		btPath := fldPath.Child(fmt.Sprintf("%d", i))
		allErrs = append(allErrs, ValidateToken(bt.Token.String(), btPath.Child("token"))...)
		allErrs = append(allErrs, ValidateTokenUsages(bt.Usages, btPath.Child("usages"))...)
		allErrs = append(allErrs, ValidateTokenGroups(bt.Usages, bt.Groups, btPath.Child("groups"))...)

		if bt.Expires != nil && bt.TTL != nil {
			allErrs = append(allErrs, field.Invalid(btPath, "", "the BootstrapToken .TTL and .Expires fields are mutually exclusive"))
		}
	}
	return allErrs
}

// ValidateToken validates a Bootstrap Token
func ValidateToken(token string, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}

	if !bootstraputil.IsValidBootstrapToken(token) {
		allErrs = append(allErrs, field.Invalid(fldPath, token, "the bootstrap token is invalid"))
	}

	return allErrs
}

// ValidateTokenGroups validates token groups
func ValidateTokenGroups(usages []string, groups []string, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}

	// adding groups only makes sense for authentication
	usagesSet := sets.NewString(usages...)
	usageAuthentication := strings.TrimPrefix(bootstrapapi.BootstrapTokenUsageAuthentication, bootstrapapi.BootstrapTokenUsagePrefix)
	if len(groups) > 0 && !usagesSet.Has(usageAuthentication) {
		allErrs = append(allErrs, field.Invalid(fldPath, groups, fmt.Sprintf("token groups cannot be specified unless --usages includes %q", usageAuthentication)))
	}

	// validate any extra group names
	for _, group := range groups {
		if err := bootstraputil.ValidateBootstrapGroupName(group); err != nil {
			allErrs = append(allErrs, field.Invalid(fldPath, groups, err.Error()))
		}
	}

	return allErrs
}

// ValidateTokenUsages validates token usages
func ValidateTokenUsages(usages []string, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}

	// validate usages
	if err := bootstraputil.ValidateUsages(usages); err != nil {
		allErrs = append(allErrs, field.Invalid(fldPath, usages, err.Error()))
	}

	return allErrs
}

// ValidateEtcd validates the .Etcd sub-struct.
func ValidateEtcd(e *kubeadm.Etcd, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	localPath := fldPath.Child("local")
	externalPath := fldPath.Child("external")

	if e.Local == nil && e.External == nil {
		allErrs = append(allErrs, field.Invalid(fldPath, "", "either .Etcd.Local or .Etcd.External is required"))
		return allErrs
	}
	if e.Local != nil && e.External != nil {
		allErrs = append(allErrs, field.Invalid(fldPath, "", ".Etcd.Local and .Etcd.External are mutually exclusive"))
		return allErrs
	}
	if e.Local != nil {
		allErrs = append(allErrs, ValidateAbsolutePath(e.Local.DataDir, localPath.Child("dataDir"))...)
		allErrs = append(allErrs, ValidateCertSANs(e.Local.ServerCertSANs, localPath.Child("serverCertSANs"))...)
		allErrs = append(allErrs, ValidateCertSANs(e.Local.PeerCertSANs, localPath.Child("peerCertSANs"))...)
	}
	if e.External != nil {
		requireHTTPS := true
		// Only allow the http scheme if no certs/keys are passed
		if e.External.CAFile == "" && e.External.CertFile == "" && e.External.KeyFile == "" {
			requireHTTPS = false
		}
		// Require either none or both of the cert/key pair
		if (e.External.CertFile == "" && e.External.KeyFile != "") || (e.External.CertFile != "" && e.External.KeyFile == "") {
			allErrs = append(allErrs, field.Invalid(externalPath, "", "either both or none of .Etcd.External.CertFile and .Etcd.External.KeyFile must be set"))
		}
		// If the cert and key are specified, require the VA as well
		if e.External.CertFile != "" && e.External.KeyFile != "" && e.External.CAFile == "" {
			allErrs = append(allErrs, field.Invalid(externalPath, "", "setting .Etcd.External.CertFile and .Etcd.External.KeyFile requires .Etcd.External.CAFile"))
		}

		allErrs = append(allErrs, ValidateURLs(e.External.Endpoints, requireHTTPS, externalPath.Child("endpoints"))...)
		if e.External.CAFile != "" {
			allErrs = append(allErrs, ValidateAbsolutePath(e.External.CAFile, externalPath.Child("caFile"))...)
		}
		if e.External.CertFile != "" {
			allErrs = append(allErrs, ValidateAbsolutePath(e.External.CertFile, externalPath.Child("certFile"))...)
		}
		if e.External.KeyFile != "" {
			allErrs = append(allErrs, ValidateAbsolutePath(e.External.KeyFile, externalPath.Child("keyFile"))...)
		}
	}
	return allErrs
}

// ValidateCertSANs validates alternative names
func ValidateCertSANs(altnames []string, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	for _, altname := range altnames {
		if len(validation.IsDNS1123Subdomain(altname)) != 0 && net.ParseIP(altname) == nil {
			allErrs = append(allErrs, field.Invalid(fldPath, altname, "altname is not a valid dns label or ip address"))
		}
	}
	return allErrs
}

// ValidateURLs validates the URLs given in the string slice, makes sure they are parseable. Optionally, it can enforcs HTTPS usage.
func ValidateURLs(urls []string, requireHTTPS bool, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	for _, urlstr := range urls {
		u, err := url.Parse(urlstr)
		if err != nil || u.Scheme == "" {
			allErrs = append(allErrs, field.Invalid(fldPath, urlstr, "not a valid URL"))
		}
		if requireHTTPS && u.Scheme != "https" {
			allErrs = append(allErrs, field.Invalid(fldPath, urlstr, "the URL must be using the HTTPS scheme"))
		}
	}
	return allErrs
}

// ValidateIPFromString validates ip address
func ValidateIPFromString(ipaddr string, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	if net.ParseIP(ipaddr) == nil {
		allErrs = append(allErrs, field.Invalid(fldPath, ipaddr, "ip address is not valid"))
	}
	return allErrs
}

// ValidateIPNetFromString validates network portion of ip address
func ValidateIPNetFromString(subnet string, minAddrs int64, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	_, svcSubnet, err := net.ParseCIDR(subnet)
	if err != nil {
		allErrs = append(allErrs, field.Invalid(fldPath, subnet, "couldn't parse subnet"))
		return allErrs
	}
	numAddresses := ipallocator.RangeSize(svcSubnet)
	if numAddresses < minAddrs {
		allErrs = append(allErrs, field.Invalid(fldPath, subnet, "subnet is too small"))
	}
	return allErrs
}

// ValidateNetworking validates networking configuration
func ValidateNetworking(c *kubeadm.Networking, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	allErrs = append(allErrs, apivalidation.ValidateDNS1123Subdomain(c.DNSDomain, field.NewPath("dnsDomain"))...)
	allErrs = append(allErrs, ValidateIPNetFromString(c.ServiceSubnet, constants.MinimumAddressesInServiceSubnet, field.NewPath("serviceSubnet"))...)
	if len(c.PodSubnet) != 0 {
		allErrs = append(allErrs, ValidateIPNetFromString(c.PodSubnet, constants.MinimumAddressesInServiceSubnet, field.NewPath("podSubnet"))...)
	}
	return allErrs
}

// ValidateAbsolutePath validates whether provided path is absolute or not
func ValidateAbsolutePath(path string, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	if !filepath.IsAbs(path) {
		allErrs = append(allErrs, field.Invalid(fldPath, path, "path is not absolute"))
	}
	return allErrs
}

// ValidateMixedArguments validates passed arguments
func ValidateMixedArguments(flag *pflag.FlagSet) error {
	// If --config isn't set, we have nothing to validate
	if !flag.Changed("config") {
		return nil
	}

	mixedInvalidFlags := []string{}
	flag.Visit(func(f *pflag.Flag) {
		if f.Name == "config" || f.Name == "ignore-preflight-errors" || strings.HasPrefix(f.Name, "skip-") || f.Name == "dry-run" || f.Name == "kubeconfig" || f.Name == "v" {
			// "--skip-*" flags or other whitelisted flags can be set with --config
			return
		}
		mixedInvalidFlags = append(mixedInvalidFlags, f.Name)
	})

	if len(mixedInvalidFlags) != 0 {
		return fmt.Errorf("can not mix '--config' with arguments %v", mixedInvalidFlags)
	}
	return nil
}

// ValidateFeatureGates validates provided feature gates
func ValidateFeatureGates(featureGates map[string]bool, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	validFeatures := features.Keys(features.InitFeatureGates)

	// check valid feature names are provided
	for k := range featureGates {
		if !features.Supports(features.InitFeatureGates, k) {
			allErrs = append(allErrs, field.Invalid(fldPath, featureGates,
				fmt.Sprintf("%s is not a valid feature name. Valid features are: %s", k, validFeatures)))
		}
	}

	return allErrs
}

// ValidateAPIEndpoint validates API server's endpoint
func ValidateAPIEndpoint(c *kubeadm.API, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}

	endpoint, err := kubeadmutil.GetMasterEndpoint(c)
	if err != nil {
		allErrs = append(allErrs, field.Invalid(fldPath, endpoint, err.Error()))
	}
	return allErrs
}

// ValidateIgnorePreflightErrors validates duplicates in ignore-preflight-errors flag.
func ValidateIgnorePreflightErrors(ignorePreflightErrors []string, skipPreflightChecks bool) (sets.String, error) {
	ignoreErrors := sets.NewString()
	allErrs := field.ErrorList{}

	for _, item := range ignorePreflightErrors {
		ignoreErrors.Insert(strings.ToLower(item)) // parameters are case insensitive
	}

	// TODO: remove once deprecated flag --skip-preflight-checks is removed.
	if skipPreflightChecks {
		ignoreErrors.Insert("all")
	}

	if ignoreErrors.Has("all") && ignoreErrors.Len() > 1 {
		allErrs = append(allErrs, field.Invalid(field.NewPath("ignore-preflight-errors"), strings.Join(ignoreErrors.List(), ","), "don't specify individual checks if 'all' is used"))
	}

	return ignoreErrors, allErrs.ToAggregate()
}

// ValidateKubeletConfiguration validates kubelet configuration and collects all encountered errors
func ValidateKubeletConfiguration(c *kubeadm.KubeletConfiguration, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}

	if c.BaseConfig == nil {
		return allErrs
	}

	scheme, _, err := kubeletscheme.NewSchemeAndCodecs()
	if err != nil {
		allErrs = append(allErrs, field.Invalid(fldPath, "kubeletConfiguration", err.Error()))
		return allErrs
	}

	// Convert versioned config to internal config
	internalcfg := &kubeletconfig.KubeletConfiguration{}
	err = scheme.Convert(c.BaseConfig, internalcfg, nil)
	if err != nil {
		allErrs = append(allErrs, field.Invalid(fldPath, "kubeletConfiguration", err.Error()))
		return allErrs
	}

	err = kubeletvalidation.ValidateKubeletConfiguration(internalcfg)
	if err != nil {
		allErrs = append(allErrs, field.Invalid(fldPath, "kubeletConfiguration", err.Error()))
	}

	return allErrs
}


text:
using System;
using System.Threading.Tasks;

namespace Marten.Events.Aggregation
{
    /// <summary>
    /// Fluent interface option for expressing aggregation projections
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface IAggregationSteps<T>
    {

        /// <summary>
        /// Create a new instance of the aggregate T when the event TEvent is encountered -- if the aggregate does
        /// not already exist
        /// </summary>
        /// <param name="creator"></param>
        /// <typeparam name="TEvent"></typeparam>
        /// <returns></returns>
        IAggregationSteps<T> CreateEvent<TEvent>(Func<TEvent, T> creator) where TEvent : class;

        /// <summary>
        /// Create a new instance of the aggregate T when the event TEvent is encountered -- if the aggregate does
        /// not already exist
        /// </summary>
        /// <param name="creator"></param>
        /// <typeparam name="TEvent"></typeparam>
        /// <returns></returns>
        IAggregationSteps<T> CreateEvent<TEvent>(Func<TEvent, IQuerySession, Task<T>> creator) where TEvent : class;

        /// <summary>
        /// Delete the aggregate document when event of type TEvent is encountered
        /// </summary>
        /// <typeparam name="TEvent"></typeparam>
        /// <returns></returns>
        IAggregationSteps<T> DeleteEvent<TEvent>() where TEvent : class;

        /// <summary>
        /// Conditionally delete the aggregate document when event of type TEvent is encountered based on the supplied
        /// shouldDelete test
        /// </summary>
        /// <param name="shouldDelete"></param>
        /// <typeparam name="TEvent"></typeparam>
        /// <returns></returns>
        IAggregationSteps<T> DeleteEvent<TEvent>(Func<TEvent, bool> shouldDelete) where TEvent : class;

        /// <summary>
        /// Conditionally delete the aggregate document when event of type TEvent is encountered based on the supplied
        /// shouldDelete test
        /// </summary>
        /// <param name="shouldDelete"></param>
        /// <typeparam name="TEvent"></typeparam>
        /// <returns></returns>
        IAggregationSteps<T> DeleteEvent<TEvent>(Func<T, TEvent, bool> shouldDelete) where TEvent : class;

        /// <summary>
        /// Conditionally delete the aggregate document when event of type TEvent is encountered based on the supplied
        /// shouldDelete test
        /// </summary>
        /// <param name="shouldDelete"></param>
        /// <typeparam name="TEvent"></typeparam>
        /// <returns></returns>
        IAggregationSteps<T> DeleteEventAsync<TEvent>(
            Func<IQuerySession, T, TEvent, Task<bool>> shouldDelete) where TEvent : class;

        /// <summary>
        /// Apply changes to the existing aggregate based on the event type TEvent
        /// </summary>
        /// <param name="handler"></param>
        /// <typeparam name="TEvent"></typeparam>
        /// <returns></returns>
        IAggregationSteps<T> ProjectEvent<TEvent>(Action<T> handler)
            where TEvent : class;

        /// <summary>
        /// Apply changes to the existing aggregate based on the event type TEvent
        /// </summary>
        /// <param name="handler"></param>
        /// <typeparam name="TEvent"></typeparam>
        /// <returns></returns>
        IAggregationSteps<T> ProjectEvent<TEvent>(Action<T, TEvent> handler)
            where TEvent : class;

        /// <summary>
        /// Apply changes to the existing aggregate based on the event type TEvent and return
        /// a new aggregate. This is appropriate for immutable aggregate documents
        /// </summary>
        /// <param name="handler"></param>
        /// <typeparam name="TEvent"></typeparam>
        /// <returns></returns>
        IAggregationSteps<T> ProjectEvent<TEvent>(Func<T, TEvent, T> handler)
            where TEvent : class;

        /// <summary>
        /// Apply changes to the existing aggregate based on the event type TEvent and return
        /// a new aggregate. This is appropriate for immutable aggregate documents
        /// </summary>
        /// <param name="handler"></param>
        /// <typeparam name="TEvent"></typeparam>
        /// <returns></returns>
        IAggregationSteps<T> ProjectEvent<TEvent>(Func<T, T> handler)
            where TEvent : class;

        /// <summary>
        /// Apply changes to the existing aggregate based on the event type TEvent
        /// </summary>
        /// <param name="handler"></param>
        /// <typeparam name="TEvent"></typeparam>
        /// <returns></returns>
        IAggregationSteps<T> ProjectEvent<TEvent>(Action<IQuerySession, T, TEvent> handler)
            where TEvent : class;

        /// <summary>
        /// Apply changes to the existing aggregate based on the event type TEvent and return
        /// a new aggregate. This is appropriate for immutable aggregate documents
        /// </summary>
        /// <param name="handler"></param>
        /// <typeparam name="TEvent"></typeparam>
        /// <returns></returns>
        IAggregationSteps<T> ProjectEventAsync<TEvent>(Func<IQuerySession, T, TEvent, Task> handler);

        /// <summary>
        /// Register a source event that is transformed within this aggregation. This is important for
        /// asynchronous projections to enable the projection to subscribe to the source event type
        /// event though there are no direct handlers for the source event type
        /// </summary>
        /// <typeparam name="TEvent"></typeparam>
        /// <returns></returns>
        IAggregationSteps<T> TransformsEvent<TEvent>() where TEvent : class;
    }
}


text:
#import "NSArray.h"

@interface NSArray (Patchworks)
- (void)removeImages;
@end


text:
<?php

namespace OCP\AppliBundle\Tests\Controller;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

class DestockageControllerTest extends WebTestCase
{
}


text:
// Project Includes
#include "stdafx.h"
#include "PerformanceTimer.h"

//-----------------------------------------------------------------------------
namespace Common
{

//-----------------------------------------------------------------------------
PerformanceTimer::PerformanceTimer()
{
    QueryPerformanceFrequency(&m_frequency);
    Start();
}

//-----------------------------------------------------------------------------
PerformanceTimer::~PerformanceTimer()
{
}

//-----------------------------------------------------------------------------
void PerformanceTimer::Start()
{
    QueryPerformanceCounter(&m_start);
}

//-----------------------------------------------------------------------------
double PerformanceTimer::Stop()
{
    QueryPerformanceCounter(&m_stop);

    LARGE_INTEGER elapsed;
    elapsed.QuadPart = m_stop.QuadPart - m_start.QuadPart;

    return LargeIntToSeconds(elapsed);
}

//-----------------------------------------------------------------------------
double PerformanceTimer::LargeIntToSeconds(const LARGE_INTEGER & value) const
{
    return (static_cast<double>(value.QuadPart) / static_cast<double>(m_frequency.QuadPart));
}

//-----------------------------------------------------------------------------
} // End namespace


text:
package org.asynchttpclient.providers.netty3;

import org.asynchttpclient.AsyncHttpClient;
import org.asynchttpclient.AsyncHttpClientConfig;
import org.asynchttpclient.async.FastUnauthorizedUploadTest;
import org.testng.annotations.Test;

@Test
public class NettyFastUnauthorizedUploadTest extends FastUnauthorizedUploadTest {
    @Override
    public AsyncHttpClient getAsyncHttpClient(AsyncHttpClientConfig config) {
        return NettyProviderUtil.nettyProvider(config);
    }
}


text:
import {getName} from "./componentStrategy"
import {getCharCode} from "./zUtil"

function getBoxName (type){
    var name = getName(type);

    var len  = me.getComponentTypeNum(type) ;
    var codekey = getCharCode(len + 1);

    codekey = Zlay.handlerCodekey(codekey);

    name += codekey ;

    return {
        name: name,
        num : len + 1
    }
}