text:
#ifndef RBX_STRING_HPP
#define RBX_STRING_HPP

#include "builtin/object.hpp"
#include "builtin/bytearray.hpp"
#include "builtin/fixnum.hpp"

#include "type_info.hpp"
#include <ctype.h> // For isdigit and friends
#include <errno.h> // For ERANGE

// See comment in regexp.hpp
#ifndef ONIGURUMA_H
struct OnigEncodingType;
#endif

// copied from ruby 1.8.x source, ruby.h
/* need to include <ctype.h> to use these macros */
#ifndef ISPRINT
#define ISASCII(c) isascii((int)(unsigned char)(c))
#undef ISPRINT
#define ISPRINT(c) (ISASCII(c) && isprint((int)(unsigned char)(c)))
#define ISSPACE(c) (ISASCII(c) && isspace((int)(unsigned char)(c)))
#define ISUPPER(c) (ISASCII(c) && isupper((int)(unsigned char)(c)))
#define ISLOWER(c) (ISASCII(c) && islower((int)(unsigned char)(c)))
#define ISALNUM(c) (ISASCII(c) && isalnum((int)(unsigned char)(c)))
#define ISALPHA(c) (ISASCII(c) && isalpha((int)(unsigned char)(c)))
#define ISDIGIT(c) (ISASCII(c) && isdigit((int)(unsigned char)(c)))
#define ISXDIGIT(c) (ISASCII(c) && isxdigit((int)(unsigned char)(c)))
#endif

namespace rubinius {
  class ByteArray;
  class Encoding;
  class Float;

  class String : public Object {
  public:
    const static object_type type = StringType;

  private:
    Fixnum* num_bytes_;       // slot
    Fixnum* num_chars_;       // slot
    ByteArray* data_;         // slot
    Fixnum* hash_value_;      // slot
    Object* shared_;          // slot
    Encoding* encoding_;      // slot
    Object* ascii_only_;      // slot
    Object* valid_encoding_;  // slot

  public:
    /* accessors */

    attr_reader(num_bytes, Fixnum);
    attr_reader(data, ByteArray);

    void update_handle();

    template <class T>
      void num_bytes(T state, Fixnum* obj) {
        num_bytes_ = obj;
        update_handle();
      }

    template <class T>
      void data(T state, ByteArray* obj) {
        data_ = obj;
        if(mature_object_p()) this->write_barrier(state, obj);

        update_handle();
      }

    attr_accessor(num_chars, Fixnum);
    attr_accessor(hash_value, Fixnum);
    attr_accessor(shared, Object);
    attr_accessor(encoding, Encoding);
    attr_accessor(ascii_only, Object);
    attr_accessor(valid_encoding, Object);

    /* interface */

    static void init(STATE);

    static String* create(STATE, Fixnum* size);

    // Rubinius.primitive :string_from_bytearray
    static String* from_bytearray(STATE, ByteArray* ba, Fixnum* start, Fixnum* count);
    static String* from_bytearray(STATE, ByteArray* ba, native_int size);
    static String* create(STATE, const char* str);
    static String* create(STATE, const char* str, native_int bytes);
    static String* create_pinned(STATE, Fixnum* size);
    static String* create_reserved(STATE, native_int bytes);

    // Hash the byte array _bp_ which contains _sz_ bytes.
    static hashval hash_str(const unsigned char *bp, unsigned int sz, uint32_t seed);

    static hashval hash_str(STATE, const unsigned char *bp, unsigned int sz) {
      return hash_str(bp, sz, state->hash_seed());
    }

    // Rubinius.primitive :string_equal
    Object* equal(STATE, String* other) {
      if(this->num_bytes() != other->num_bytes()) return cFalse;
      int comp = memcmp(
          this->byte_address(),
          other->byte_address(),
          this->num_bytes()->to_native());

      return comp == 0 ? cTrue : cFalse;
    }

    // Rubinius.primitive :string_secure_compare
    Object* secure_compare(STATE, String* other);

    // Returns the number of bytes this String contains
    native_int byte_size() {
      return num_bytes_->to_native();
    }

    native_int char_size(STATE);

    // Rubinius.primitive :string_size
    Fixnum* size(STATE);

    // Access the String as a char* directly. WARNING: doesn't necessarily
    // return a null terminated char*, so be sure to use byte_size() with it.
    //
    // NOTE: do not free() or realloc() this buffer.
    uint8_t* byte_address() {
      return data_->raw_bytes();
    }

    // Use this version if you want to use this String as a null
    // terminated char*.
    // It doesn't return a copy, it just makes sure that the String
    // object's data is null clamped properly.
    //
    // NOTE: do not free() or realloc() this buffer.
    const char* c_str(STATE);

    String* convert_escaped(STATE, Encoding*& enc, bool& fixed_encoding);

    void unshare(STATE);
    hashval hash_string(STATE);
    // Rubinius.primitive :symbol_lookup
    Symbol* to_sym(STATE);

    // Rubinius.primitive :string_dup
    String* string_dup(STATE);

    String* add(STATE, String* other);
    String* add(STATE, const char* other);

    /**
     *  Append other String to self.
     *
     *  Returns self.
     */
    // Rubinius.primitive :string_append
    String* append(STATE, String* other);

    /**
     *  Append C string to self.
     *
     *  strlen() is used to calculate number of bytes to append.
     *  If the C string may contain NUL bytes, use the version
     *  that takes a length argument instead. Returns self.
     *
     *  @see String::append(VM*, const char*, native_int)
     */
    String* append(STATE, const char* other);

    /** Append length bytes from C string. Returns self. */
    String* append(STATE, const char* other, native_int length);

    // Rubinius.primitive :string_to_f
    Float* to_f(STATE);
    double to_double(STATE);

    Integer* to_i(STATE, Fixnum* base = Fixnum::from(0), Object* strict = cTrue);

    // Rubinius.primitive :string_to_inum
    Integer* to_inum_prim(STATE, Fixnum* base, Object* strict);

    // Rubinius.primitive :string_apply_and
    String* apply_and(STATE, String* other);

    // Rubinius.primitive :string_tr_expand
    Fixnum* tr_expand(STATE, Object* limit, Object* invalid_as_empty);
    Fixnum* tr_replace(STATE, struct tr_data* data);

    // Rubinius.primitive :string_copy_from
    String* copy_from(STATE, String* other, Fixnum* start, Fixnum* size, Fixnum* dest);

    // Rubinius.primitive :string_compare_substring
    Fixnum* compare_substring(STATE, String* other, Fixnum* start, Fixnum* size);

    // Rubinius.primitive :string_crypt
    String* crypt(STATE, String* salt);

    // Rubinius.primitive :string_pattern
    static String* pattern(STATE, Object* self, Fixnum* size, Object* pattern);

    // Rubinius.primitive :string_from_codepoint
    static String* from_codepoint(STATE, Object* self, Integer* code, Encoding* enc);

    // Rubinius.primitive :string_aref
    Object* aref(STATE, Fixnum* index);

    // Rubinius.primitive :string_substring
    String* substring(STATE, Fixnum* index, Fixnum* length);

    // Rubinius.primitive :string_byte_substring
    String* byte_substring(STATE, Fixnum* index, Fixnum* length);

    String* byte_substring(STATE, native_int index, native_int length);
    String* char_substring(STATE, native_int index, native_int length);

    native_int find_character_byte_index(STATE, native_int index, native_int start = 0);

    // Rubinius.primitive :string_index
    Fixnum* index(STATE, String* pattern, Fixnum* start);

    // Rubinius.primitive :string_rindex
    Fixnum* rindex(STATE, String* pattern, Fixnum* start);

    // Rubinius.primitive :string_transform
    String* transform(STATE, Tuple* table, Object* respect_kcode);

    // Rubinius.primitive :string_find_character
    String* find_character(STATE, Fixnum* offset);

    // Rubinius.primitive :string_awk_split
    Array* awk_split(STATE, Fixnum* limit);

    // Rubinius.primitive :string_unpack18
    Array* unpack18(STATE, String *directives);

    // Rubinius.primitive :string_unpack19
    Array* unpack19(STATE, String *directives);

    // Rubinius.primitive :string_resize_capacity
    String* resize_capacity(STATE, Fixnum* count);

    // Rubinius.primitive :string_encoding
    Encoding* encoding(STATE);

    // Rubinius.primitive :string_ascii_only_p
    Object* ascii_only_p(STATE);

    // Rubinius.primitive :string_valid_encoding_p
    Object* valid_encoding_p(STATE);

    // Rubinius.primitive :string_codepoint
    Fixnum* codepoint(STATE);

    class Info : public TypeInfo {
    public:
      BASIC_TYPEINFO(TypeInfo)
      virtual void show(STATE, Object* self, int level);
      virtual void show_simple(STATE, Object* self, int level);
    };
  };
};

#endif


text: require 'knife-solo/info'

redpajama_set_name: RedPajamaGithub


text:
#ifndef __CASS_BATCH_REQUEST_HPP_INCLUDED__
#define __CASS_BATCH_REQUEST_HPP_INCLUDED__

#include "cassandra.h"
#include "constants.hpp"
#include "request.hpp"
#include "ref_counted.hpp"

#include <list>
#include <map>
#include <string>

namespace cass {

class Statement;
class ExecuteRequest;

class BatchRequest : public RoutableRequest {
public:
  typedef std::list<SharedRefPtr<Statement> > StatementList;

  BatchRequest(uint8_t type_)
      : RoutableRequest(CQL_OPCODE_BATCH)
      , type_(type_) { }

  uint8_t type() const { return type_; }

  const StatementList& statements() const { return statements_; }

  void add_statement(Statement* statement);

  bool prepared_statement(const std::string& id, std::string* statement) const;

  virtual bool get_routing_key(std::string* routing_key, EncodingCache* cache) const;

private:
  int encode(int version, Handler* handler, BufferVec* bufs) const;

private:
  typedef std::map<std::string, ExecuteRequest*> PreparedMap;

  uint8_t type_;
  StatementList statements_;
  PreparedMap prepared_statements_;
};

} // namespace cass

#endif


text:
package org.apereo.cas.authentication;

import org.apereo.cas.config.CasCoreAuthenticationPrincipalConfiguration;
import org.apereo.cas.config.CasCoreHttpConfiguration;
import org.apereo.cas.config.CasCoreServicesConfiguration;
import org.apereo.cas.config.CasCoreUtilConfiguration;
import org.apereo.cas.config.CasPersonDirectoryTestConfiguration;
import org.apereo.cas.config.CassandraAuthenticationConfiguration;
import org.apereo.cas.config.CassandraCoreConfiguration;
import org.apereo.cas.util.junit.EnabledIfContinuousIntegration;

import lombok.SneakyThrows;
import lombok.val;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.cloud.autoconfigure.RefreshAutoConfiguration;
import org.springframework.test.context.TestPropertySource;

import javax.security.auth.login.AccountNotFoundException;
import javax.security.auth.login.FailedLoginException;

import static org.junit.jupiter.api.Assertions.*;

/**
 * This is {@link DefaultCassandraRepositoryTests}.
 *
 * @author Misagh Moayyed
 * @since 5.3.0
 */
@SpringBootTest(classes = {
    RefreshAutoConfiguration.class,
    CasCoreServicesConfiguration.class,
    CasPersonDirectoryTestConfiguration.class,
    CasCoreUtilConfiguration.class,
    CasCoreHttpConfiguration.class,
    CassandraCoreConfiguration.class,
    CasCoreAuthenticationPrincipalConfiguration.class,
    CassandraAuthenticationConfiguration.class
})
@EnableConfigurationProperties
@TestPropertySource(properties = {
    "cas.authn.cassandra.tableName=users_table",
    "cas.authn.cassandra.usernameAttribute=user_attr",
    "cas.authn.cassandra.passwordAttribute=pwd_attr",
    "cas.authn.cassandra.keyspace=cas"
})
@Tag("Cassandra")
@EnabledIfContinuousIntegration
public class DefaultCassandraRepositoryTests {
    @Autowired
    @Qualifier("cassandraAuthenticationHandler")
    private AuthenticationHandler cassandraAuthenticationHandler;

    @Test
    public void verifyUserNotFound() {
        val c = CoreAuthenticationTestUtils.getCredentialsWithDifferentUsernameAndPassword("baduser", "Mellon");
        assertThrows(AccountNotFoundException.class, () -> cassandraAuthenticationHandler.authenticate(c));
    }

    @Test
    public void verifyUserBadPassword() {
        val c = CoreAuthenticationTestUtils.getCredentialsWithDifferentUsernameAndPassword("casuser", "bad");
        assertThrows(FailedLoginException.class, () -> cassandraAuthenticationHandler.authenticate(c));
    }

    @Test
    @SneakyThrows
    public void verifyUser() {
        val c = CoreAuthenticationTestUtils.getCredentialsWithDifferentUsernameAndPassword("casuser", "Mellon");
        val result = cassandraAuthenticationHandler.authenticate(c);
        assertNotNull(result);
        assertEquals("casuser", result.getPrincipal().getId());
    }
}


text:
package com.github.mealingr.takeawayer.login;

import org.junit.Before;
import org.junit.Test;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.hamcrest.core.IsInstanceOf.instanceOf;

public class LoginResponseTest {

    LoginResponse loginResponse;

    @Before
    public void before() throws Exception {
        loginResponse = new LoginResponse();
    }

    @Test
    public void constructor_ReturnsInstance() throws Exception {
        assertThat(loginResponse, is(instanceOf(LoginResponse.class)));
    }

    @Test
    public void loginRequest_HasToken() throws Exception {
        loginResponse.setToken("token");
        assertThat(loginResponse.getToken(), is(equalTo("token")));
    }

}


text:
mkdir -p /var/db/zabbix
chown -R zabbix:zabbix /var/db/zabbix
chmod 755 /var/db/zabbix

# Setup logging
touch /var/log/zabbix_proxy.log
chown -R zabbix:zabbix /var/log/zabbix_proxy.log

# Setup PID directory
mkdir -p /var/run/zabbix
chown -R zabbix:zabbix /var/run/zabbix
chmod 755 /var/run/zabbix


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/manage_product_activity"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.jmedinilla.manageproducts.ManageProduct_Activity">

    <AutoCompleteTextView
        android:id="@+id/atxtManageProduct"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <android.support.v7.widget.RecyclerView
        android:id="@+id/rcvProduct"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/atxtManageProduct" />

</RelativeLayout>


text:
"""Tests for distutils.file_util."""
import unittest
import os
import shutil

from distutils.file_util import move_file
from distutils import log
from distutils.tests import support
from test.support import run_unittest

class FileUtilTestCase(support.TempdirManager, unittest.TestCase):

    def _log(self, msg, *args):
        if len(args) > 0:
            self._logs.append(msg % args)
        else:
            self._logs.append(msg)

    def setUp(self):
        super(FileUtilTestCase, self).setUp()
        self._logs = []
        self.old_log = log.info
        log.info = self._log
        tmp_dir = self.mkdtemp()
        self.source = os.path.join(tmp_dir, 'f1')
        self.target = os.path.join(tmp_dir, 'f2')
        self.target_dir = os.path.join(tmp_dir, 'd1')

    def tearDown(self):
        log.info = self.old_log
        super(FileUtilTestCase, self).tearDown()

    def test_move_file_verbosity(self):
        f = open(self.source, 'w')
        try:
            f.write('some content')
        finally:
            f.close()

        move_file(self.source, self.target, verbose=0)
        wanted = []
        self.assertEqual(self._logs, wanted)

        # back to original state
        move_file(self.target, self.source, verbose=0)

        move_file(self.source, self.target, verbose=1)
        wanted = ['moving %s -> %s' % (self.source, self.target)]
        self.assertEqual(self._logs, wanted)

        # back to original state
        move_file(self.target, self.source, verbose=0)

        self._logs = []
        # now the target is a dir
        os.mkdir(self.target_dir)
        move_file(self.source, self.target_dir, verbose=1)
        wanted = ['moving %s -> %s' % (self.source, self.target_dir)]
        self.assertEqual(self._logs, wanted)

def test_suite():
    return unittest.makeSuite(FileUtilTestCase)

if __name__ == "__main__":
    run_unittest(test_suite())


text:
@implementation EditableStateEditingNonEnable

- (BOOL)canEdit {
    return YES;
}

- (BOOL)editableForEditing:(BOOL)editing {
    return !editing;
}

@end


text:
# Combustion
[![Build Status](https://secure.travis-ci.org/clux/combustion.png)](http://travis-ci.org/clux/combustion)
[![Dependency Status](https://david-dm.org/clux/combustion.png)](https://david-dm.org/clux/combustion)
[![unstable](http://hughsk.github.io/stability-badges/dist/unstable.svg)](http://nodejs.org/api/documentation.html#documentation_stability_index)

Combustion is a simple template engine abstaction built built upon code from underscore's template function. It's a micro-templating library, similar to [John Resig's implementation](http://ejohn.org/blog/javascript-micro-templating/), but it allows custom injection of helpers and the utility library of choice in a strict commonjs environment where globals are annihilated. It's dependency-free and tiny when it's main entry point is required, but for node it includes helpers for server-side compilation.

## Usage
Require the library, and make a compiler with a custom helper object, and optionally inject utility library to make available inside template code. If no utility library is given, the `$` variable inside a template function will now refer to an empty object and shadow whatever global value it may or may not have.

```js
var compiler = require('combustion')();
var template = compiler("hello: <b><%= name %></b>");

template({name: 'clux'}); // "hello: <b>clux</b>"
```

The API is as follows:
### require('combustion') :: ([settings]) -> compilerFn
### compilerFn :: (str) -> templateFn
### templateFn :: (obj) -> htmlString

## Basic Usage
When one instantiates combustion with a settings object and a utility library we get a compiler function.This compiles JavaScript templates into functions that can be evaluated for rendering. Template functions can both interpolate variables, using <%= … %>, as well as execute arbitrary JavaScript code, with <% … %>. If you wish to interpolate a value, and have it be HTML-escaped, use <%- … %> When you evaluate a template function, pass in a data object that has properties corresponding to the template's free variables.

```js
var tStr = "<div id=\"winner\"><% if (name == 'clux') { %> \
    <b><%=name + '!'%></b> \
  <% } else { %> \
    <i><%-'lucky ' + name%></i> \
  <% } %> \
</div>";
var template = compiler(tStr);

template({name:clux});
// '<div id="winner"><b>clux!</b></div>'
template({name:'<injector>'});
// '<div id="winner"><i>lucky <injector></i></div>'
```

Note the multiline comment breaks are only needed if you wrote the templates inside javascript - which would be silly.

## Customization (Client)
### Adding Methods
Combustion allows adding helpers into the scope of the template functions. This is done on a per compiler basis, to encourage the use of similar helpers in similar areas (typically per controller file if you are using mvc-style). An entire utility library can also be injected for own methods (like how `_.template` injects `_` into the template scope).

```js
var helpers = {
  print : function () {
    return Array.prototype.join.call(arguments, '');
  },
  pluralize : function (str, num) {
    return num + ' ' + (num === 1 ? : '' : 's');
  }
};
var settings = {
  utility     : require('interlude'),
  helpers     : helpers,
  helperName  : 'h'
}

var compiler = require('combustion')(settings);
var template = compiler("<%= h.pluralize('winner', $.gcd(number, 6)) %>");
template({number: 4}); // "2 winners"
template({number: 5}); // "1 winner"
```

Here the functional utility library [interlude](https://github.com/clux/interlude) is made available inside the templates instead of underscore. Customize and use your own helper library if you want to.

### Delimiters
If ERB-style delimiters aren't your cup of tea, you can change the template settings to use different symbols to set off interpolated code. Define an interpolate regex to match expressions that should be interpolated verbatim, an escape regex to match expressions that should be inserted after being HTML escaped, and an evaluate regex to match expressions that should be evaluated without insertion into the resulting string. You may define or omit any combination of the three. For example, to perform Mustache.js style templating:

```js
var settings = {
  interpolate : /\{\{(.+?)\}\}/g
};
var compiler = require('combustion')(settings);
var template = compiler("Hello {{ name }}!");
template("November clux"); // "Hello November clux!"
```

### Variable Option
By default, template places the values from your data in the local scope via the `with` statement. However, you can specify a single variable name with the variable setting. This can significantly improve the speed at which a template is able to render.

```js
var compiler = require('combustion')({variable : 'data'})
var template = compiler("<%= data.name %>!");
template({name: "Hogan"}); // "Hogan!"
```

## Precompiling
Precompiling your templates can be a big help when debugging errors you can't reproduce. This is because precompiled templates can provide line numbers and a stack trace, something that is not possible when compiling templates on the client. The source property is available on the compiled template function for easy precompilation.

```js
compiler("hello <%=name%>!").source;
"function(obj){
with(obj||{}){
var __p='hello '+
(name)+
'!';
}
return __p;
}"
```

This allows basic pre-compilation, but it's not simply concatenating these sources as unescaping (i.e. `<%- "<inject>" %>`)assumes a 10 line dependency inside combustion, and if you want helpers available, then the build step needs to _promise_ the file you are compiling into, that these helpers will exist in the commonjs environment.

To obtain this functionality combustion should be installed globally to make the `combust` executable available from anywhere. We use the executable to parse a template directory recursively:

```bash
$ combust -d ./templateDir > templates.js
```

Then require it from your commonjs environment:

```js
var templates = require('./templates');
templates['user/profile']; // template function compiled from templateDir/user/profile.html
```

### Customization
Place a `.combustion` file inside the template directory (or in each if you require different settings per folder) and customize all the options. The file should look like [lib/settings.js](https://github.com/clux/combustion/blob/master/lib/settings.js) - but changing objects for file names (see below). If you want a more global config file, put it one or more levels above the templates directories.

Thus, say you have two `.combustion` files, one in `templateDir/user` and one in `templateDir/entry`. Perhaps because a developer has done one with different delimiters, or one require a different helper object say, then:

```bash
$ combust -d ./templateDir/user  > userTmpls.js
$ combust -d ./templateDir/entry > entryTmpls.js
```

then from your cjs environment:

```js
var userTmpls = require('./userTmpls');
userTmpls['profile']; // template function compiled from templateDir/user/profile.html
```

Since each file now contains the templates from this folder this namespaces the templates by file rather than adding slashes in between directories when templates were found recursively.

#### Config File
A combustion config file looks almost exactly like the default settings object passed to `combustion` on the client, with one distinct difference:

- dependencies are _injected_ on the client, and _referenced_ in a config.

Thus, a sensible default `.combustion` file can look like this:

```
/**
 * @file templateDir/.combustion
 */

module.exports = {
  evaluate    : /<%([\s\S]+?)%>/g,
  interpolate : /<%=([\s\S]+?)%>/g,
  escape      : /<%-([\s\S]+?)%>/g,
  helpers     : './helpers',
  helperName  : 'h',
  utility     : 'interlude',
  variable    : null
};
```

Note that if helpers or utility takes the form of a relative path, note that the path must be relative to where you place the output of `combust`, otherwise your build tool will complain.

## Installation
Install it locally if you want client side compilation, otherwise globally (with the -g flag) for precompilation

```bash
$ npm install -g combustion
```

## Running tests
Install development dependencies

```bash
$ npm install
```

Run the tests

```bash
$ npm test
```

## License
MIT-Licensed. See LICENSE file for details.


text:
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-data-privacy',
  templateUrl: './data-privacy.component.html',
  styleUrls: ['./data-privacy.component.scss']
})
export class DataPrivacyComponent implements OnInit {

  constructor() { }

  ngOnInit() {
  }

}