text:
function New-SysmonConfiguration
{
    [CmdletBinding(HelpUri = 'https://github.com/darkoperator/Posh-Sysmon/blob/master/docs/New-SysmonConfiguration.md')]
    Param
    (
        # Path to write XML config file.
        [Parameter(Mandatory=$true,
                   ValueFromPipelineByPropertyName=$true,
                   Position=0)]
        [String]
        $Path,

        # Specify one or more hash algorithms used for image identification
        [Parameter(Mandatory=$true,
                   ValueFromPipelineByPropertyName=$true,
                   Position=1)]
        [ValidateSet('ALL', 'MD5', 'SHA1', 'SHA256', 'IMPHASH')]
        [string[]]
        $HashingAlgorithm,

        # Log Network Connections
        [Parameter(Mandatory=$False,
                   ValueFromPipelineByPropertyName=$true,
                   Position=2)]
        [Switch]
        $NetworkConnect,

        # Log process loading of modules.
        [Parameter(Mandatory=$False,
                   ValueFromPipelineByPropertyName=$true,
                   Position=3)]
        [Switch]
        $DriverLoad,

        # Log process loading of modules.
        [Parameter(Mandatory=$False,
                   ValueFromPipelineByPropertyName=$true,
                   Position=4)]
        [Switch]
        $ImageLoad,

        # Log create remote thread actions.
        [Parameter(Mandatory=$False,
                   ValueFromPipelineByPropertyName=$true,
                   Position=5)]
        [Switch]
        $CreateRemoteThread,

        # Log file creation time modifications.
        [Parameter(Mandatory=$False,
                   ValueFromPipelineByPropertyName=$true,
                   Position=6)]
        [Switch]
        $FileCreateTime,

        # Log process creation.
        [Parameter(Mandatory=$False,
                   ValueFromPipelineByPropertyName=$true,
                   Position=7)]
        [Switch]
        $ProcessCreate,

        # Log process termination.
        [Parameter(Mandatory=$False,
                   ValueFromPipelineByPropertyName=$true,
                   Position=8)]
        [Switch]
        $ProcessTerminate,

        # Log when a running process opens another process.
        [Parameter(Mandatory=$False,
                   ValueFromPipelineByPropertyName=$true,
                   Position=9)]
        [Switch]
        $ProcessAccess,

        # Log raw access reads of files.
        [Parameter(Mandatory=$False,
                   ValueFromPipelineByPropertyName=$true,
                   Position=10)]
        [Switch]
        $RawAccessRead,

        # Check for signature certificate revocation.
        [Parameter(Mandatory=$False,
                   ValueFromPipelineByPropertyName=$true,
                   Position=11 )]
        [Switch]
        $CheckRevocation,

        # Log Registry events.
        [Parameter(Mandatory=$False,
                   ValueFromPipelineByPropertyName=$true,
                   Position=12 )]
        [Switch]
        $RegistryEvent,

        # Log File Creation events.
        [Parameter(Mandatory=$False,
                   ValueFromPipelineByPropertyName=$true,
                   Position=13 )]
        [Switch]
        $FileCreate,

        # Log File Stream creations events.
        [Parameter(Mandatory=$False,
                   ValueFromPipelineByPropertyName=$true,
                   Position=14 )]
        [Switch]
        $FileCreateStreamHash,

        # Log NamedPipes connection and creations events.
        [Parameter(Mandatory=$False,
                   ValueFromPipelineByPropertyName=$true,
                   Position=15 )]
        [Switch]
        $PipeEvent,

        # WMI Permanent Event component events.
        [Parameter(Mandatory=$False,
                   ValueFromPipelineByPropertyName=$true,
                   Position=16 )]
        [Switch]
        $WmiEvent,

        # Comment for purpose of the configuration file.
        [Parameter(Mandatory=$False,
                   ValueFromPipelineByPropertyName=$true)]
        [String]
        $Comment,

        # Schema Vesion for the configuration file, default is 4.1.
        [Parameter(Mandatory=$False,
                   ValueFromPipelineByPropertyName=$true)]
                   [ValidateSet('4.0','4.1')]
        [string]
        $SchemaVersion = '4.1'
    )

    Begin{}
    Process {
        if ($HashingAlgorithm -contains 'ALL') {
            $Hash = '*'
        } else {
            $Hash = $HashingAlgorithm -join ','
        }

        $Config = ($ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Path))

        # get an XMLTextWriter to create the XML

        $XmlWriter = New-Object System.XMl.XmlTextWriter($Config,$Null)

        # choose a pretty formatting:
        $xmlWriter.Formatting = 'Indented'
        $xmlWriter.Indentation = 1

        # write the header
        if ($Comment)
        {
            $xmlWriter.WriteComment($Comment)
        }
        $xmlWriter.WriteStartElement('Sysmon')

        $XmlWriter.WriteAttributeString('schemaversion', $SchemaVersion)

        Write-Verbose -Message "Enabling hashing algorithms : $($Hash)"
        $xmlWriter.WriteElementString('HashAlgorithms',$Hash)

        # Enable checking revocation.
        if ($CheckRevocation) {
            Write-Verbose -message 'Enabling CheckRevocation.'
            $xmlWriter.WriteElementString('CheckRevocation','')
        }

        # Create empty EventFiltering section.
        $xmlWriter.WriteStartElement('EventFiltering')

        if ($NetworkConnect) {
            Write-Verbose -Message 'Enabling network connection logging for all connections by setting no filter and onmatch to exclude.'
            $xmlWriter.WriteStartElement('NetworkConnect')
            $XmlWriter.WriteAttributeString('onmatch', 'exclude')
            $xmlWriter.WriteFullEndElement()
        }

        if ($DriverLoad) {
            Write-Verbose -Message 'Enabling logging all driver loading by setting no filter and onmatch to exclude.'
            $xmlWriter.WriteStartElement('DriverLoad ')
            $XmlWriter.WriteAttributeString('onmatch', 'exclude')
            $xmlWriter.WriteFullEndElement()
        }

        if ($ImageLoad) {
            Write-Verbose -Message 'Enabling logging all image loading by setting no filter and onmatch to exclude.'
            $xmlWriter.WriteStartElement('ImageLoad ')
            $XmlWriter.WriteAttributeString('onmatch', 'exclude')
            $xmlWriter.WriteFullEndElement()
        }

        if ($CreateRemoteThread) {
            Write-Verbose -Message 'Enabling logging all  CreateRemoteThread API actions by setting no filter and onmatch to exclude.'
            $xmlWriter.WriteStartElement('CreateRemoteThread ')
            $XmlWriter.WriteAttributeString('onmatch', 'exclude')
            $xmlWriter.WriteFullEndElement()
        }

        if ($ProcessCreate) {
            Write-Verbose -Message 'Enabling logging all  process creation by setting no filter and onmatch to exclude.'
            $xmlWriter.WriteStartElement('ProcessCreate ')
            $XmlWriter.WriteAttributeString('onmatch', 'exclude')
            $xmlWriter.WriteFullEndElement()
        }

        if ($ProcessTerminate) {
            Write-Verbose -Message 'Enabling logging all  process termination by setting no filter and onmatch to exclude.'
            $xmlWriter.WriteStartElement('ProcessTerminate ')
            $XmlWriter.WriteAttributeString('onmatch', 'exclude')
            $xmlWriter.WriteFullEndElement()
        }

        if ($FileCreateTime) {
            Write-Verbose -Message 'Enabling logging all  process creation by setting no filter and onmatch to exclude.'
            $xmlWriter.WriteStartElement('FileCreateTime ')
            $XmlWriter.WriteAttributeString('onmatch', 'exclude')
            $xmlWriter.WriteFullEndElement()
        }

        if ($ProcessAccess) {
            Write-Verbose -Message 'Enabling logging all  process access by setting no filter and onmatch to exclude.'
            $xmlWriter.WriteStartElement('ProcessAccess ')
            $XmlWriter.WriteAttributeString('onmatch', 'exclude')
            $xmlWriter.WriteFullEndElement()
        }

        if ($RawAccessRead) {
            Write-Verbose -Message 'Enabling logging all  process access by setting no filter and onmatch to exclude.'
            $xmlWriter.WriteStartElement('RawAccessRead ')
            $XmlWriter.WriteAttributeString('onmatch', 'exclude')
            $xmlWriter.WriteFullEndElement()
        }

        # Log registry events.
        if ($RegistryEvent) {
            Write-Verbose -message 'Enabling RegistryEvent.'
            $xmlWriter.WriteStartElement('RegistryEvent ')
            $XmlWriter.WriteAttributeString('onmatch', 'exclude')
            $xmlWriter.WriteFullEndElement()
        }

        # Log file create events.
        if ($FileCreate) {
            Write-Verbose -message 'Enabling FileCreate.'
            $xmlWriter.WriteStartElement('FileCreate ')
            $XmlWriter.WriteAttributeString('onmatch', 'exclude')
            $xmlWriter.WriteFullEndElement()
        }

        # Log file create events.
        if ($FileCreateStreamHash) {
            Write-Verbose -message 'Enabling FileCreateStreamHash.'
            $xmlWriter.WriteStartElement('FileCreateStreamHash ')
            $XmlWriter.WriteAttributeString('onmatch', 'exclude')
            $xmlWriter.WriteFullEndElement()
        }

        # NamedPipes create and connect events.
        if ($PipeEvent) {
            Write-Verbose -message 'Enabling PipeEvent.'
            $xmlWriter.WriteStartElement('PipeEvent ')
            $XmlWriter.WriteAttributeString('onmatch', 'exclude')
            $xmlWriter.WriteFullEndElement()
        }

        # NamedPipes create and connect events.
        if ($WmiEvent) {
            Write-Verbose -message 'Enabling WmiEvent.'
            $xmlWriter.WriteStartElement('WmiEvent ')
            $XmlWriter.WriteAttributeString('onmatch', 'exclude')
            $xmlWriter.WriteFullEndElement()
        }

        # End Element of EventFiltering
        $xmlWriter.WriteFullEndElement()

        # Sysmon
        $xmlWriter.WriteEndElement()

        # finalize the document:
        #$xmlWriter.WriteEndDocument()
        $xmlWriter.Flush()
        $xmlWriter.Close()
        Write-Verbose -Message "Config file created as $($Config)"
        write-verbose -Message "Configuration is for Sysmon $($sysmonVerMap[$SchemaVersion])"
    }
    End {}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<Tokens version="1.0">
	<File path="Categories/UIPinchGestureRecognizer+RecordingAdditions.html">

		<Token>
			<TokenIdentifier>//apple_ref/occ/cat/UIPinchGestureRecognizer(RecordingAdditions)</TokenIdentifier>
			<Abstract type="html"></Abstract>
			<DeclaredIn>UIPinchGestureRecognizer-RecordingAdditions.h</DeclaredIn>

			<NodeRef refid="70"/>
		</Token>

		<Token>
			<TokenIdentifier>//apple_ref/occ/instm/UIPinchGestureRecognizer/_automationName</TokenIdentifier>
			<Abstract type="html"></Abstract>
			<DeclaredIn>UIPinchGestureRecognizer-RecordingAdditions.h</DeclaredIn>

			<Declaration>- (id)_automationName</Declaration>

			<Anchor>//api/name/_automationName</Anchor>
            <NodeRef refid="70"/>
		</Token>

	</File>
</Tokens>

redpajama_set_name: RedPajamaGithub


text:
namespace MiniORM.App.Data.Entities
{
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;

    public class Employee
    {
        [Key]
        public int Id { get; set; }

        [Required]
        public string FirstName { get; set; }

        public string MiddleName { get; set; }

        [Required]
        public string LastName { get; set; }

        public bool IsEmployed { get; set; }

        [ForeignKey(nameof(Department))]
        public int DepartmentId { get; set; }

        public Department Department { get; set; }

        public ICollection<EmployeesProject> EmployeesProjects { get; }
    }
}


text:
var battleground = {
  active: false,
  incumbent : "null",
  challenger : "null",
  region: "null",
  low : 0,
  high : 10,

  handle : function(id, value){

    id = id.substring(14)

    if (id == "incumbent"){
      battleground.incumbent = value;
    } else if (id == "challenger"){
      battleground.challenger = value
    } else if (id =="region"){
      if (value == "null"){
        battleground.region = "null";
      } else if (value == "england"){
        battleground.region = regionMap["england"];
      } else {
          battleground.region = [value];
      }
    } else if (id == "majlow") {
      if (!(isNaN(parseFloat(value)))){
          if (parseFloat(value) < 0){
            value = 0;
          }
          battleground.low = parseFloat(value);
      }
    } else if (id == "majhigh"){
      if (!(isNaN(parseFloat(value)))){
        if (parseFloat(value) > 100){
          value = 100;
        }
          battleground.high = parseFloat(value);
      }
    }

    battleground.check();
  },

  check : function(){

    if (battleground.incumbent != "null" && battleground.challenger != "null"){
      filters.reset();
      if (battleground.incumbent != battleground.challenger){
          battleground.filter();
      }
    } else {
      filters.reset();
    }
  },

  filter : function(){

    if (currentMap.name == "election2017"){
      var dataSet = currentMap.seatData;
    }  else {
      var dataSet = currentMap.previousSeatData;
    }

    $.each(currentMap.seatData, function(seat, data){
      if (dataSet[seat].seatInfo.current != battleground.incumbent){
        data.filtered = false;

      } else {

        var incumbent = dataSet[seat].seatInfo.current;

        if (battleground.challenger in dataSet[seat].partyInfo){
          var incumbentVotes = dataSet[seat].partyInfo[incumbent].total;
          var challengerVotes = dataSet[seat].partyInfo[battleground.challenger].total;
          var totalVotes = dataSet[seat].seatInfo.turnout;
          var lead = 100 * ((incumbentVotes / totalVotes) - (challengerVotes / totalVotes));

          if (battleground.low <= lead  && lead <= battleground.high){

            data.filtered = true;
          } else {
            data.filtered = false;
          }
        } else {
          data.filtered = false;
        }
      }

      if (battleground.region != "null"){
        var region = dataSet[seat].seatInfo.region
        if (battleground.region.indexOf(region) == -1){
          data.filtered = false
        }
      }

      if (data.filtered == false) {
          filters.opacities[seat] = 0.05;
      } else {
        filters.opacities[seat] = 1;
      }

    });
    filters.display();
  }
};


text:
import tflearn
from tflearn.data_utils import shuffle, to_categorical
from tflearn.models.dnn import DNN
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.conv import conv_2d, max_pool_2d
from tflearn.layers.estimator import regression
from tflearn.data_preprocessing import ImagePreprocessing
from tflearn.data_augmentation import ImageAugmentation
from tflearn.optimizers import SGD
import numpy as np
import tensorflow as tf
import urllib

from sklearn import svm
from sklearn.ensemble import BaggingClassifier
from sklearn.multiclass import OneVsRestClassifier
from sklearn.svm import SVC
from itertools import compress
import glob
import time

def get_proper_images(raw):
    raw_float = np.array(raw, dtype=float)
    images = raw_float.reshape([-1, 3, 32, 32])
    images = images.transpose([0, 2, 3, 1])
    return images

def onehot_labels(labels):
    return np.eye(10)[labels]

def unpickle(file):
    # import cPickle
    import pickle as cPickle
    fo = open(file, 'rb')
    # dict = cPickle.load(fo)
    dict = cPickle.load(fo, encoding='bytes')
    fo.close()
    return dict

def get_data():
    data_norm = True
    data_augmentation = True

    data1  = unpickle('../cifar-10-batches-py/data_batch_1')
    data2  = unpickle('../cifar-10-batches-py/data_batch_2')
    data3  = unpickle('../cifar-10-batches-py/data_batch_3')
    data4  = unpickle('../cifar-10-batches-py/data_batch_4')
    data5  = unpickle('../cifar-10-batches-py/data_batch_5')
    # print(list(data1.keys()))
    # X = np.concatenate((get_proper_images(data1['data']),
    #                     get_proper_images(data2['data']),
    #                     get_proper_images(data3['data']),
    #                     get_proper_images(data4['data']),
    #                     get_proper_images(data5['data'])))
    X = np.concatenate((get_proper_images(data1[b'data']),
                        get_proper_images(data2[b'data']),
                        get_proper_images(data3[b'data']),
                        get_proper_images(data4[b'data']),
                        get_proper_images(data5[b'data'])))
    # Y = np.concatenate((onehot_labels(data1['labels']),
    #                     onehot_labels(data2['labels']),
    #                     onehot_labels(data3['labels']),
    #                     onehot_labels(data4['labels']),
    #                     onehot_labels(data5['labels'])))
    Y = np.concatenate((onehot_labels(data1[b'labels']),
                        onehot_labels(data2[b'labels']),
                        onehot_labels(data3[b'labels']),
                        onehot_labels(data4[b'labels']),
                        onehot_labels(data5[b'labels'])))

    # X_test = get_proper_images(unpickle('../cifar-10-batches-py/test_batch')['data'])
    # Y_test = onehot_labels(unpickle('../cifar-10-batches-py/test_batch')['labels'])

    X_test = get_proper_images(unpickle('../cifar-10-batches-py/test_batch')[b'data'])
    Y_test = onehot_labels(unpickle('../cifar-10-batches-py/test_batch')[b'labels'])

    img_prep = ImagePreprocessing()
    if data_norm:
        img_prep.add_featurewise_zero_center()
        img_prep.add_featurewise_stdnorm()

    img_aug = ImageAugmentation()
    if data_augmentation:
        img_aug.add_random_flip_leftright()
        img_aug.add_random_rotation(max_angle=30.)
        img_aug.add_random_crop((32, 32), 6)

    return X, Y, X_test, Y_test, img_prep, img_aug

def my_model(img_prep, img_aug):

    dropout_probability = 0.5
    # dropout_probability = 1.0
    initial_learning_rate = 0.0001
    # learning_decay = 1E-5
    initializer = 'uniform_scaling'
    # initializer = 'truncated_normal'
    activation_function = 'relu'
#     activation_function = 'sigmoid'
    objective_function = 'categorical_crossentropy'
#     objective_function = 'mean_square'

    network = input_data(shape=[None, 32, 32, 3],
                         data_preprocessing=img_prep,
                         data_augmentation=img_aug)
    network = conv_2d(network, 32, 3, strides=1, padding='same', activation=activation_function,
                      bias=True, bias_init='zeros', weights_init=initializer)
    network = max_pool_2d(network, 2, strides=None, padding='same')
    network = conv_2d(network, 64, 3, strides=1, padding='same', activation=activation_function,
                      bias=True, bias_init='zeros', weights_init=initializer)
    network = conv_2d(network, 64, 3, strides=1, padding='same', activation=activation_function,
                      bias=True, bias_init='zeros', weights_init=initializer)
    network = max_pool_2d(network, 2, strides=None, padding='same')
    features = fully_connected(network, 512, activation=activation_function, name='derived_features')
    network = dropout(features, dropout_probability)
    network = fully_connected(network, 10, activation='softmax',
                              name='softmax_classification')
    network = regression(network, optimizer='adam',
                         loss=objective_function,
                         learning_rate=initial_learning_rate)
# QUESTION    # sgd = SGD(learning_rate=initial_learning_rate, lr_decay=learning_decay, decay_step=90)
    # network = regression(network, optimizer=sgd,
    #                      loss='categorical_crossentropy')
    return network, features

def main():
    x, y, x_test, y_test, img_prep, img_aug = get_data()
#     with tf.device('/gpu:0'):
#         with tf.contrib.framework.arg_scope([tflearn.variables.variable], device='/cpu:0'):
    model, features = my_model(img_prep, img_aug)
    network = DNN(model)
    # network.fit(x, y, n_epoch=100, shuffle=True, validation_set=(x_test, y_test), show_metric=True,
    #             batch_size=100, run_id='aa2')
    # task 3 stuff
    network.load('./lenet5_run.tflearn')
    feature_generator = DNN(features, session=network.session)
    if len(glob.glob('./lenet5_svm_features.npy')) != 1:
        svm_features = np.zeros((0, 512))
        for i in range(x.shape[0]):
            if i % 1000 == 0:
                print(i, svm_features.shape)
            chuckmein = x[i, :, :].reshape((1, x.shape[1], x.shape[2], x.shape[3]))
            svm_features = np.vstack((svm_features, feature_generator.predict(chuckmein)))
        np.save('./lenet5_svm_features.npy', svm_features)
    else:
        svm_features = np.load('./lenet5_svm_features.npy')

    if len(glob.glob('./lenet5_svm_features_test.npy')) != 1:
        svm_features_test = np.zeros((0, 512))
        for i in range(x_test.shape[0]):
            chuckmein = x_test[i, :, :].reshape((1, x.shape[1], x.shape[2], x.shape[3]))
            svm_features_test = np.vstack((svm_features_test, feature_generator.predict(chuckmein)))
        np.save('./lenet5_svm_features_test.npy', svm_features_test)
    else:
        svm_features_test = np.load('./lenet5_svm_features_test.npy')
    #  from here it's y vs. y_predict
    svm_y = np.zeros((y.shape[0], ))
    svm_y_test = np.zeros((y_test.shape[0]))
    for i in range(y.shape[0]):
        # print(y[i, :] == 1)
        mask =  y[i, :] == 1
        meh = list(compress(range(len(mask)), mask))
        svm_y[i] = meh[0]
    for i in range(y_test.shape[0]):
        mask = y_test[i, :] == 1
        meh = list(compress(range(len(mask)), mask))
        svm_y_test[i] = meh[0]

    # clf = svm.SVC()
    # clf.fit(svm_features, svm_y)
    # predicted_y = clf.predict(svm_features_test)
    # accuracy_mask = svm_y_test == predicted_y
    # accuracy = float(len(list(compress(range(len(accuracy_mask)), accuracy_mask)))) / float(len(accuracy_mask))
    # print(accuracy)

    n_estimators = 10
    n_jobs = 4
    start = time.time()
    clf = OneVsRestClassifier(BaggingClassifier(
        SVC(kernel='linear', probability=True, class_weight=None),
        max_samples=1.0 / n_estimators, n_estimators=n_estimators, n_jobs=n_jobs))
    clf.fit(svm_features, svm_y)
    end = time.time()
    print("Bagging SVC", end - start, clf.score(svm_features_test, svm_y_test))

    # y_test vs. predicted_y metric

    return

main()


text:
namespace base {
namespace android {

// This enumeration maps to the values returned by BuildInfo::sdk_int(),
// indicating the Android release associated with a given SDK version.
enum SdkVersion {
  SDK_VERSION_JELLY_BEAN = 16,
  SDK_VERSION_JELLY_BEAN_MR1 = 17,
  SDK_VERSION_JELLY_BEAN_MR2 = 18,
  SDK_VERSION_KITKAT = 19,
  SDK_VERSION_KITKAT_WEAR = 20,
  SDK_VERSION_LOLLIPOP = 21,
  SDK_VERSION_LOLLIPOP_MR1 = 22,
  SDK_VERSION_MARSHMALLOW = 23,
  SDK_VERSION_NOUGAT = 24,
  SDK_VERSION_NOUGAT_MR1 = 25,
  SDK_VERSION_OREO = 26,
  SDK_VERSION_O_MR1 = 27,
  SDK_VERSION_P = 28,
};

// BuildInfo is a singleton class that stores android build and device
// information. It will be called from Android specific code and gets used
// primarily in crash reporting.
class BASE_EXPORT BuildInfo {
 public:

  ~BuildInfo() {}

  // Static factory method for getting the singleton BuildInfo instance.
  // Note that ownership is not conferred on the caller and the BuildInfo in
  // question isn't actually freed until shutdown. This is ok because there
  // should only be one instance of BuildInfo ever created.
  static BuildInfo* GetInstance();

  // Const char* is used instead of std::strings because these values must be
  // available even if the process is in a crash state. Sadly
  // std::string.c_str() doesn't guarantee that memory won't be allocated when
  // it is called.
  const char* device() const {
    return device_;
  }

  const char* manufacturer() const {
    return manufacturer_;
  }

  const char* model() const {
    return model_;
  }

  const char* brand() const {
    return brand_;
  }

  const char* android_build_id() const {
    return android_build_id_;
  }

  const char* android_build_fp() const {
    return android_build_fp_;
  }

  const char* gms_version_code() const {
    return gms_version_code_;
  }

  const char* host_package_name() const { return host_package_name_; }

  const char* host_version_code() const { return host_version_code_; }

  const char* host_package_label() const { return host_package_label_; }

  const char* package_version_code() const {
    return package_version_code_;
  }

  const char* package_version_name() const {
    return package_version_name_;
  }

  const char* package_name() const {
    return package_name_;
  }

  // Will be empty string if no app id is assigned.
  const char* firebase_app_id() const { return firebase_app_id_; }

  const char* custom_themes() const { return custom_themes_; }

  const char* resources_version() const { return resources_version_; }

  const char* build_type() const {
    return build_type_;
  }

  const char* board() const { return board_; }

  const char* installer_package_name() const { return installer_package_name_; }

  const char* abi_name() const { return abi_name_; }

  std::string extracted_file_suffix() const { return extracted_file_suffix_; }

  int sdk_int() const {
    return sdk_int_;
  }

  bool is_at_least_q() const { return is_at_least_q_; }

  bool targets_at_least_r() const { return targets_at_least_r_; }

  bool is_debug_android() const { return is_debug_android_; }

 private:
  friend struct BuildInfoSingletonTraits;

  explicit BuildInfo(const std::vector<std::string>& params);

  // Const char* is used instead of std::strings because these values must be
  // available even if the process is in a crash state. Sadly
  // std::string.c_str() doesn't guarantee that memory won't be allocated when
  // it is called.
  const char* const brand_;
  const char* const device_;
  const char* const android_build_id_;
  const char* const manufacturer_;
  const char* const model_;
  const int sdk_int_;
  const char* const build_type_;
  const char* const board_;
  const char* const host_package_name_;
  const char* const host_version_code_;
  const char* const host_package_label_;
  const char* const package_name_;
  const char* const package_version_code_;
  const char* const package_version_name_;
  const char* const android_build_fp_;
  const char* const gms_version_code_;
  const char* const installer_package_name_;
  const char* const abi_name_;
  const char* const firebase_app_id_;
  const char* const custom_themes_;
  const char* const resources_version_;
  // Not needed by breakpad.
  const std::string extracted_file_suffix_;
  const bool is_at_least_q_;
  const bool targets_at_least_r_;
  const bool is_debug_android_;

  DISALLOW_COPY_AND_ASSIGN(BuildInfo);
};

}  // namespace android
}  // namespace base

#endif  // BASE_ANDROID_BUILD_INFO_H_


text:
class BayesianUpdateWorker
  include Sidekiq::Worker
  include Sidetiq::Schedulable

  recurrence { daily }

  def perform
    Anime.recompute_bayesian_ratings!
  end
end


text:
In this lab, you will learn how to publish, deploy, and update a composite Prism Windows Presentation Foundation (WPF) application that uses dynamic module loading with ClickOnce. After completing this lab, you will be able to do the following:

- Publish an existing WPF Prism shell application project with ClickOnce.
- Add dynamically loaded modules to the published application for deployment.
- Deploy the application to a client computer.
- Publish an update to the application.
- Deploy the update to a client computer.

## System Requirements

This guidance was designed to run on the Microsoft Windows 8, Windows 7, Windows Vista, Windows Server 2012, or Windows Server 2008 operating system. WPF applications built using this guidance require the .NET Framework 4.5.
Before you can use the Prism Library, the following must be installed:
- Microsoft Visual Studio 2013 Professional, Premium, or Ultimate editions
- Microsoft .NET Framework 4.5 (installed with Visual Studio 2013)
- Optional tool:
    - [Microsoft Blend for Visual Studio 2013](https://www.microsoft.com/expression/products/Blend_Overview.aspx)

## Preparation

This topic requires you to have Prism and the Prism QuickStarts in the default installed directory structure. This lab uses the ModularityWithUnity.Desktop QuickStart that is included with the Prism installed source code.

_**Note:** This hands-on lab uses the QuickStart that uses a Unity container, but you can also use the Managed Extensibility Framework (MEF) variant of the QuickStart._

**To compile the solution**

1. Open the solution file \\Quickstarts\\Modularity\\Desktop\\ModularityWithUnity\\ModularityWithUnity.Desktop.sln.
2. Build the solution.

Additionally, this lab uses the Manifest Manager Utility, which is available on the Prism CodePlex site at <http://compositewpf.codeplex.com/releases/view/14771> in the **Download** section. You will need to download and extract the source code for that utility, and build it to use it later in the lab. You can either run it from a separate instance of Visual Studio or you can build once and just run the binaries for the second task in this lab.

_**Note:** This hands-on lab assumes that you understand Prism modularity and deployment concepts. For more information, see [Modular Application Development](30-ModularApplicationDevelopment.md) and [Deploying Applications](90-DeployingPrismApplications.md)._

## Procedures

This lab includes the following tasks:

- Task 1: Publishing an initial version of the shell application
- Task 2: Updating the manifests to include dynamically loaded module assemblies
- Task 3: Deploying the initial version to a client machine
- Task 4: Publishing an updated version of the application and updating the manifests
- Task 5: Deploying the updated version to a client computer

The next sections describe each of these tasks.

_**Note:** The instructions for this hands-on lab are based on the ModularityWithUnity.Desktop solution._

## Task 1: Publishing an Initial Version of the Shell Application

In this task, you will publish the initial version of the shell application project using Visual Studio. The following steps will be performed:

1. **Set the ClickOnce publish settings**. In this task, you review and configure the project settings for the shell project that determine the ClickOnce deployment behavior.
2. **Add a publisher certificate**. In this task, you create a test publisher certificate to enable ClickOnce publishing and associate it with the application.
3. **Publish the application**. In this task, you physically publish the shell application from Visual Studio to a target deployment directory.
4. **Verify the published output**. In this task, you verify the output of the publication in the target directory.

The following procedure describes how to configure the ClickOnce publish settings within the shell project. These settings alter the behavior of ClickOnce, both at initial installation time and when setting the update policies for the application. The publish settings are only relevant for the shell project itself because it is the launch application executable, which determines the deployment behavior of the application as a whole in a ClickOnce deployed application.

**To set the ClickOnce publish settings**

1. In Visual Studio, open the project properties for the ModularityWithUnity.Desktop WPF project. To do this, right-click the project in Solution Explorer, and then click **Properties**. In the project settings, click the **Publish** tab. The ClickOnce publishing settings will be shown, as in the following illustration.

    ![ClickOnce publish settings](images/DeploymentHOLFigure1.png)

2. Change the publishing folder location to **http://localhost/PrismDeploymentHOL** if you have IIS on your local computer. If you do not, you can publish to another IIS computer for which you have administrator permissions to create a new virtual directory, or you can use a fully qualified Universal Naming Convention (UNC) file path (such as \\\\mymachinename\\c$\\PrismDeploymentHOL) if you first create that directory. The address used is the one that will be used to install the application later in the lab, so make sure you note the address. This address is the physical address you use to push the ClickOnce manifests and application files to the deployment server when you publish.

3. The installation folder URL can be used if the externally exposed address used for installation of the application will be different from the one used for publishing (for example, if you are publishing via FTP to one of your servers, but users will install the application based on an externally visible HTTP path to that server). This path represents the installation address on the deployment server to the users. If the path is not supplied, it is assumed you can launch the application using the same address you used to publish.

4. The install mode and settings provide you fine-grained options for configuring the way the application installs, what files it is composed of, if there are prerequisite installations that need to happen first (such as installing the .NET Framework 4.5), how updates are performed, and a number of other options. For this lab, you will use the default settings, which configures the application to install for offline use (meaning it can at least be launched even if you are not connected to the deployment server, but it depends on what your application does after launch as to whether it will function properly). The default settings also set the application to automatically update before launch if a new version is detected on the deployment server.

5. Click the **Updates** button, and then select check box labeled **The application should check for updates**, as shown in the following illustration.

    ![Application Updates dialog box](images/DeploymentHOLFigure1b.png)

6. Click the **Options** button. In the **Options** dialog box, click **Manifests** in the left pane, and then select the check box labeled **Create desktop shortcut**.

    ![Publish Options dialog box](images/DeploymentHOLFigure1a.png)

7. The publish version drives detection of updates for installed ClickOnce applications. Generally, you want to be in explicit control over this version in a real deployment. For this lab, you will allow Visual Studio to automatically increment this version number each time you publish.

The following procedure explains how to set up the certificate used for signing the published application. To ensure that your application cannot be replaced on the deployment server with a tampered version, ClickOnce requires you to digitally sign the ClickOnce manifests using an X509 code signing certificate. For development purposes, Visual Studio can generate a test certificate for your use. For putting your application into production, it is not recommended to use a test certificate. You should either obtain a certificate from a well-known (Trusted Root) certificate authority for public deployments or obtain one from your domain administrators for an internal deployment. In this lab, you will simply use the Visual Studio–generated test certificate.

**To add a publisher certificate**

1. In the shell project properties, click the **Signing** tab.

2. Select the check box labeled **Sign the ClickOnce manifests**. The certificate information will initially be blank if you have not previously created or associated a certificate with the project.

    ![ClickOnce Publish project property settings](images/DeploymentHOLFigure2.png)

3. Click the **Create Test Certificate** button. This opens the Create Test Certificate dialog box, as shown in the following illustration.

    ![Create Test Certificate password dialog box](images/DeploymentHOLFigure3.png)

4. Click **OK** to leave the test certificate without a password.

5. The certificate information should now be populated, and the certificate name and issuer will be based on your logged-on Windows account information. If you have an existing certificate as a file or already installed in your certificate stores, you can select the certificate using one of the buttons next to the certificate information instead.

**To publish the shell application**

1. Build the application and make sure it builds as expected. Publishing the application will cause the application to build, but it is easier to resolve any build errors with a normal build before publishing.

2. In Visual Studio, click **Publish ModularityWithUnity.Desktop** on the **Build** menu.

3. The **Publish Wizard** dialog box displays the publish folder location address that you entered in step 2, as shown in the following illustration. Click **Finish** to publish the application.

    ![Publish Wizard dialog box](images/DeploymentHOLFigure4.png)

 _**Note:** Depending on the computer you publish to and the security settings, you may get a warning that Visual Studio is unable to view the published application. This simply means it was unable to launch a browser and navigate to the publish location URL. However, the application is not really ready to install yet at this point because you need to add the dynamic modules to the manifests in the next task._

## Task 2: Updating the Manifests to Include Dynamically Loaded Module Assemblies

In this task, you will edit the ClickOnce manifests of your deployed application to add the dynamic module assemblies. This involves editing the application files list in the application manifest, saving and re-signing the application manifest, updating the application manifest reference within the deployment manifest, and saving and re-signing the deployment manifest. These steps can all be performed individually using the .NET Framework SDK tool named the Manifest Generating and Editing tool (Mage). However, the Manifest Manager Utility that you can download from the Prism CodePlex site automates these steps into a single easy editor. To accomplish them, you will do the following:

1. **Open the deployment manifest in the Manifest Manager Utility**. In this task, you run the utility to simplify editing of the manifests.

 _**Important**: You must run this utility as an administrator._

2. **Add the dynamically loaded modules to the manifests**. In this task, you locate and add the dynamic module assemblies to the manifest and get them deployed to the publish location.

3. **Save and sign the manifests**. In this task, you select the publisher certificate used for signing the ClickOnce manifests to save and re-sign the manifests.

The following procedure describes how to add the dynamic module assemblies to the ClickOnce manifests.

**To open the deployment manifest in the Manifest Manager Utility**

1. If you have not already done so, download the most recent Manifest Manager Utility from the **Download** section of the Prism CodePlex site at <http://compositewpf.codeplex.com/releases/view/14771> and unzip it to a working directory on your computer.
2. In Visual Studio 2013, open the file ManifestManagerUtility.sln, build it, and run it.

 _**Important**: You must run this utility as an administrator. If you are running this from Visual Studio, you must start Visual Studio as an administrator._

3. On the **File** menu, click **Open**, and then navigate to the publish folder location where you published the QuickStart in the previous task. In that folder, select the deployment manifest file ModularityWithUnity.Desktop.application, and then click **Open**.

    ![Open dialog box from Manifest Manager Utility in publish folder location](images/DeploymentHOLFigure5.png)

4. The deployment and linked application manifest files will be opened by the utility and will be presented in the unified view of the utility, as shown in the following illustration. You can see that the shell executable file and all referenced assemblies that are not part of the framework are automatically included. Note that Modules A and C are included because they were referenced for static loading by the QuickStart, but you will need to add the additional modules using the utility.

    ![Manifest Manager utility](images/DeploymentHOLFigure6.png)

**To add the dynamically loaded modules to the manifest**

1. On the **Edit** menu, click **Add Files**. In the **Add Application Files** dialog box, navigate to the build output folder for Module B (such as C:\\temp\\ModularityWithUnity\\ModuleB\\bin\\Debug\\) and select the module DLL (such as ModularityWithUnity.Desktop.ModuleB.dll). In the **Add Application Files** dialog box, click **Open** to add the module DLL to the manifest.

2. When you click **Open**, a **Browse For Folder** dialog box appears. In this dialog box, you can specify the destination folder to copy the module file to the publish folder. Modules B and D are loaded in the QuickStart through directory scan, and the bootstrapper sets the folder it scans to a relative path of .\\DirectoryModules from the executable file. This means the files need to be in that same relative path in the published application.

3. Select the version-specific Application Files folder, and then click the **Make New Folder** button at the bottom of the dialog box.

4. Name the new folder DirectoryModules.

5. Make sure the new folder is selected, and then click **OK**. This copies the Module B DLL into the DirectoryModules subfolder of the application files, as shown in the following illustration.

    ![Browse For Folder dialog box with DirectoryModules subfolder selected](images/DeploymentHOLFigure7.png)

6. Repeat the preceding steps to add Module D to the manifest and place it in the DirectoryModules subfolder.

7. Repeat the preceding steps to add Modules E and F to the manifest, but those both go in the root Application Files folder (ModularityWithUnity.Desktop\_1\_0\_0\_0).

8. At this point, the additional modules should be listed in Manifest Manager Utility with the relative path shown for Modules B and D, as shown in the following illustration (order does not matter).

    ![Manifest Manager utility with Modules B, D, E, and F added](images/DeploymentHOLFigure8.png)

**To sign and save the manifests**

1. Click the **Save** button on the toolbar of the utility. This opens the **Select Publisher Certificate to Sign Manifest** dialog box.

    ![Select Publisher Certificate to Sign Manifest dialog box](images/DeploymentHOLFigure9.png)

2. Click the **Browse** button, and then locate and select the ModularityWithUnity.Desktop\_TemporaryKey.pfx file that was generated when you added the test certificate to the project in the first task of this lab.

3. Click the **Save and Sign** button, leaving the password blank again.

At this point, you have successfully published the application with modified manifest files and it is ready to install.

## Task 3: Deploying the Initial Version to a Client Computer

In this task, you will launch and install the application.

**To launch and install the application**

1. Open an Internet Explorer browser window and enter the address you used as the publish folder location with the deployment manifest (.application file) path added to the end of it (such as http://localhost/PrismDeploymentHOL/ModularityWithUnity.Desktop.application).

2. A **Launching Application** dialog box briefly appears as ClickOnce downloads the manifests for the application, as shown in the following illustration.

    ![ClickOnce Launching Application dialog box](images/DeploymentHOLFigure10.png)

3. A security warning appears, as shown in the following illustration. It notifies the user of who the publisher of this application is. Because you are using a test certificate, it will show an unknown publisher. To get a more friendly security warning, you will need a certificate issued from a trusted root certification authority.

    ![ClickOnce security warning](images/DeploymentHOLFigure11.png)

4. Click **Install.** While the rest of the application files are downloaded and launched, you will briefly see a dialog box with a progress bar, as shown in the following illustration.

    ![Install progress bar](images/DeploymentHOLFigure12.png)

5. The QuickStart should launch and you should see Modules A and D load when it starts. You can click on the other squares to get the other modules to load on demand.

    ![Modularity with Unity QuickStart running](images/DeploymentHOLFigure13.png)

## Task 4: Publishing an Updated Version of the Application and Updating the Manifests

In this task, you will make a simple visible change to the application and publish the new version. To accomplish this, you will do the following:

1. **Modify the title of the application**. In this task, you will modify the large text at the top of the application to indicate a modified version. This gives a simple visible change to the application so you can verify the updated application launches in the next task.
2. **Publish the new version of the application**. In this task, you publish the application again with a new publish version so that the ClickOnce update checking will see that there is a new version of the application on the deployment server.
3. **Update the manifests**. In this task, you will use the manifest manager utility again to re-add Modules B, D, E, and F to the deployment because each time you re-publish, the manifest is re-generated by Visual Studio based on the referenced assemblies from the shell.

The following procedure describes how to publish the updated version.

**To modify the title of the application**

1. With the ModularityWithUnity.Desktop project open, open the Shell.xaml file in the designer.
2. Modify the **Title** property of the window to read **Modularity with Unity QuickStart – Desktop – Modified**.
3. Save and build the solution.

**To publish the new version of the application**

1. On the **Build** menu, click **Publish ModularityWithUnity.Desktop**.
2. In the Publish Wizard, click **Finish**.
3. The new version will be published and the publish version number will be 1.0.0.1 because Visual Studio auto-incremented the publish version when you first published in Task 1.

**To update the manifests for the new version**

1. Open Manifest Manager Utility again.
2. On the **File** menu, click **Open**, and then locate and open the ModularityWithUnity.Desktop.application deployment manifest again (Manifest Manager Utility should remember the location from the last time you opened a manifest). You should see that the manifest version is now 1.0.0.1 and Modules B, D, E, and F are missing again.
3. On the **Edit** menu, click **Add Files** to select the Modules B assembly.
4. When the **Browse For Folder** dialog box appears, go to the new published version's Application Files folder (ModularityWithUnity.Desktop\_1\_0\_0\_1), create a DirectoryModules subfolder, and then select it to place Module B in that relative path.
5. Repeat steps 3 and 4 for Module D, also putting it into the DirectoryModules subfolder.
6. Repeat steps 3 and 4 for Modules E and F, but place them in the ModularityWithUnity.Desktop\_1\_0\_0\_1 directory, not the DirectoryModules subfolder.
7. On the toolbar, click the **Save** button.
8. Manifest Manager Utility should remember the path to the publisher certificate file you used to publish the first version, so you can just click the **Save and Sign** button.

The new version is published and ready to deploy.

## Task 5: Deploying the Updated Version to a Client Computer

In this task, you will launch the application as the client computer and see that it automatically updates.

**To deploy the updated version to a client computer**

1. Locate the shortcut on your desktop that was created when you installed the initial version of the application (ModularityWithUnity.Desktop), and then click it to launch the application from the client computer.

2. The Update Available dialog box appears, as shown in the following illustration. Click **OK** to accept the update.

    ![Update Available dialog box](images/DeploymentHOLFigure14.png)

You should see the modified title on the application after it has launched.


text:
module App {
    "use strict";

    angular.module("knowledgeCenterApp")
        .config([
            "$provide", ($provide: ng.auto.IProvideService): void => {
                $provide.decorator("$exceptionHandler",
                ["$delegate", "config", "logger", extendExceptionHandler]);
            }
        ]);

    // extend the $exceptionHandler service to also display a toast.
    function extendExceptionHandler($delegate: Function, config: App.IConfigProvider, logger: Common.ILoggerService): Function {
        var appErrorPrefix: string = config.appErrorPrefix;
        return (exception: Error, cause: string): void => {
            $delegate(exception, cause);
            if (appErrorPrefix && exception.message.indexOf(appErrorPrefix) === 0) { return; }

            var errorData: any = { exception: exception, cause: cause };
            var msg: string = appErrorPrefix + exception.message;
            logger.logError(msg, errorData, "knowledgeCenterApp", true);
        };
    }
}


text:
package com.igormaznitsa.jbbp.io;

import com.igormaznitsa.jbbp.mapper.Bin;
import java.io.IOException;
import java.lang.reflect.Field;

/**
 * The Interface describes an object which can save data for custom fields in mapped classes.
 *
 * @see Bin
 * @see JBBPOut
 * @since 1.1
 */
public interface JBBPCustomFieldWriter {
  /**
   * To write the field data into the bit stream.
   *
   * @param context             the JBBPOut context, must not be null
   * @param outStream           the current context output stream, must not be null
   * @param instanceToSave      the mapped class instance, must not be null
   * @param instanceCustomField the field of the mapped class which data must be saved into the stream, must not be null
   * @param fieldAnnotation     the field Bin annotation which can be used as extra data source about the field, must not be null
   * @param value               the value found in the field, can be null
   * @throws IOException it will be thrown if it is impossible to process field data and save them into the stream
   */
  void writeCustomField(final JBBPOut context, final JBBPBitOutputStream outStream,
                        final Object instanceToSave, final Field instanceCustomField,
                        final Bin fieldAnnotation, final Object value) throws IOException;
}


text:
<?php

namespace Malenki\Url;

class Scheme
{
    protected $value = null;

    public function __get($name)
    {
        if ($name == 'clear') {
            return $this->clear();
        }
    }

    public function __construct($str = null)
    {
        if ($str) {
            $this->set($str);
        }
    }

    public function set($str)
    {
        if (is_string($str)) {
            $str = preg_replace('@.//$@' , '', $str);

            if (strlen($str) && preg_match('/^[a-z]{1}[a-z0-9\+\.\-]+$/i', $str)) {
                $this->value = strtolower($str);
            } else {
                throw new \InvalidArgumentException('Invalid scheme name!');
            }
        } else {
            throw new \InvalidArgumentException('Scheme must a string!');
        }
    }

    public function get()
    {
        return $this->value;
    }

    public function clear()
    {
        $this->value = null;

        return $this;
    }

    public function isVoid()
    {
        return is_null($this->value);
    }

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


text:
set -e
rm -rf tmp;
mkdir tmp;

# just copy playground and dist files for now
cp -r dist test_data playground tmp/

cd tmp
git init

git config user.name "Travis CI"
git config user.email "mb@w69b.com"

git add .
git commit -m "Deploy to GitHub Pages"

git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1


text:
.class Lcom/android/internal/telephony/cat/RilMessageDecoder$StateCmdParamsReady;
.super Lcom/android/internal/util/State;
.source "RilMessageDecoder.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/internal/telephony/cat/RilMessageDecoder;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "StateCmdParamsReady"
.end annotation

# instance fields
.field final synthetic this$0:Lcom/android/internal/telephony/cat/RilMessageDecoder;

# direct methods
.method private constructor <init>(Lcom/android/internal/telephony/cat/RilMessageDecoder;)V
    .locals 0
    .parameter

    .prologue
    .line 123
    iput-object p1, p0, Lcom/android/internal/telephony/cat/RilMessageDecoder$StateCmdParamsReady;->this$0:Lcom/android/internal/telephony/cat/RilMessageDecoder;

    invoke-direct {p0}, Lcom/android/internal/util/State;-><init>()V

    return-void
.end method

.method synthetic constructor <init>(Lcom/android/internal/telephony/cat/RilMessageDecoder;Lcom/android/internal/telephony/cat/RilMessageDecoder$1;)V
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 123
    invoke-direct {p0, p1}, Lcom/android/internal/telephony/cat/RilMessageDecoder$StateCmdParamsReady;-><init>(Lcom/android/internal/telephony/cat/RilMessageDecoder;)V

    return-void
.end method

# virtual methods
.method public processMessage(Landroid/os/Message;)Z
    .locals 2
    .parameter "msg"

    .prologue
    .line 126
    iget v0, p1, Landroid/os/Message;->what:I

    const/4 v1, 0x2

    if-ne v0, v1, :cond_0

    .line 127
    iget-object v0, p0, Lcom/android/internal/telephony/cat/RilMessageDecoder$StateCmdParamsReady;->this$0:Lcom/android/internal/telephony/cat/RilMessageDecoder;

    #getter for: Lcom/android/internal/telephony/cat/RilMessageDecoder;->mCurrentRilMessage:Lcom/android/internal/telephony/cat/RilMessage;
    invoke-static {v0}, Lcom/android/internal/telephony/cat/RilMessageDecoder;->access$500(Lcom/android/internal/telephony/cat/RilMessageDecoder;)Lcom/android/internal/telephony/cat/RilMessage;

    move-result-object v0

    iget v1, p1, Landroid/os/Message;->arg1:I

    invoke-static {v1}, Lcom/android/internal/telephony/cat/ResultCode;->fromInt(I)Lcom/android/internal/telephony/cat/ResultCode;

    move-result-object v1

    iput-object v1, v0, Lcom/android/internal/telephony/cat/RilMessage;->mResCode:Lcom/android/internal/telephony/cat/ResultCode;

    .line 128
    iget-object v0, p0, Lcom/android/internal/telephony/cat/RilMessageDecoder$StateCmdParamsReady;->this$0:Lcom/android/internal/telephony/cat/RilMessageDecoder;

    #getter for: Lcom/android/internal/telephony/cat/RilMessageDecoder;->mCurrentRilMessage:Lcom/android/internal/telephony/cat/RilMessage;
    invoke-static {v0}, Lcom/android/internal/telephony/cat/RilMessageDecoder;->access$500(Lcom/android/internal/telephony/cat/RilMessageDecoder;)Lcom/android/internal/telephony/cat/RilMessage;

    move-result-object v0

    iget-object v1, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    iput-object v1, v0, Lcom/android/internal/telephony/cat/RilMessage;->mData:Ljava/lang/Object;

    .line 129
    iget-object v0, p0, Lcom/android/internal/telephony/cat/RilMessageDecoder$StateCmdParamsReady;->this$0:Lcom/android/internal/telephony/cat/RilMessageDecoder;

    iget-object v1, p0, Lcom/android/internal/telephony/cat/RilMessageDecoder$StateCmdParamsReady;->this$0:Lcom/android/internal/telephony/cat/RilMessageDecoder;

    #getter for: Lcom/android/internal/telephony/cat/RilMessageDecoder;->mCurrentRilMessage:Lcom/android/internal/telephony/cat/RilMessage;
    invoke-static {v1}, Lcom/android/internal/telephony/cat/RilMessageDecoder;->access$500(Lcom/android/internal/telephony/cat/RilMessageDecoder;)Lcom/android/internal/telephony/cat/RilMessage;

    move-result-object v1

    #calls: Lcom/android/internal/telephony/cat/RilMessageDecoder;->sendCmdForExecution(Lcom/android/internal/telephony/cat/RilMessage;)V
    invoke-static {v0, v1}, Lcom/android/internal/telephony/cat/RilMessageDecoder;->access$600(Lcom/android/internal/telephony/cat/RilMessageDecoder;Lcom/android/internal/telephony/cat/RilMessage;)V

    .line 130
    iget-object v0, p0, Lcom/android/internal/telephony/cat/RilMessageDecoder$StateCmdParamsReady;->this$0:Lcom/android/internal/telephony/cat/RilMessageDecoder;

    iget-object v1, p0, Lcom/android/internal/telephony/cat/RilMessageDecoder$StateCmdParamsReady;->this$0:Lcom/android/internal/telephony/cat/RilMessageDecoder;

    #getter for: Lcom/android/internal/telephony/cat/RilMessageDecoder;->mStateStart:Lcom/android/internal/telephony/cat/RilMessageDecoder$StateStart;
    invoke-static {v1}, Lcom/android/internal/telephony/cat/RilMessageDecoder;->access$700(Lcom/android/internal/telephony/cat/RilMessageDecoder;)Lcom/android/internal/telephony/cat/RilMessageDecoder$StateStart;

    move-result-object v1

    #calls: Lcom/android/internal/telephony/cat/RilMessageDecoder;->transitionTo(Lcom/android/internal/util/IState;)V
    invoke-static {v0, v1}, Lcom/android/internal/telephony/cat/RilMessageDecoder;->access$800(Lcom/android/internal/telephony/cat/RilMessageDecoder;Lcom/android/internal/util/IState;)V

    .line 137
    :goto_0
    const/4 v0, 0x1

    :goto_1
    return v0

    .line 132
    :cond_0
    iget v0, p1, Landroid/os/Message;->what:I

    const/4 v1, -0x1

    if-ne v0, v1, :cond_1

    const/4 v0, 0x0

    goto :goto_1

    .line 133
    :cond_1
    new-instance v0, Ljava/lang/StringBuilder;

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

    const-string v1, "StateCmdParamsReady expecting CMD_PARAMS_READY=2 got "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget v1, p1, Landroid/os/Message;->what:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {p0, v0}, Lcom/android/internal/telephony/cat/CatLog;->d(Ljava/lang/Object;Ljava/lang/String;)V

    .line 135
    iget-object v0, p0, Lcom/android/internal/telephony/cat/RilMessageDecoder$StateCmdParamsReady;->this$0:Lcom/android/internal/telephony/cat/RilMessageDecoder;

    #calls: Lcom/android/internal/telephony/cat/RilMessageDecoder;->deferMessage(Landroid/os/Message;)V
    invoke-static {v0, p1}, Lcom/android/internal/telephony/cat/RilMessageDecoder;->access$900(Lcom/android/internal/telephony/cat/RilMessageDecoder;Landroid/os/Message;)V

    goto :goto_0
.end method


text:
import sys
import os

#append installer directory to sys.path
root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(root)

manifestFile = os.path.join(root, 'HandlerManifest.json')
if os.path.exists(manifestFile):
    import json
    jsonData = open(manifestFile)
    manifest = json.load(jsonData)
    jsonData.close()
    extName="{0}-{1}".format(manifest[0]["name"], manifest[0]["version"])
    print("Start test: %s" % extName)

    extDir=os.path.join("/var/lib/waagent", extName)
    if(os.path.isdir(extDir)):
        os.chdir(extDir)
        print("Switching to dir: %s" % os.getcwd())


text:
// Copyright (c) Samuel Cragg.
//
// Licensed under the MIT license. See LICENSE file in the project root for
// full license information.

namespace Crest.Host.Conversion
{
    using System.Collections.Generic;
    using Crest.Core;

    /// <content>
    /// Contains the nested <see cref="FileData"/> class.
    /// </content>
    internal partial class FileDataFactory
    {
        private class FileData : IFileData
        {
            private readonly byte[] data;

            internal FileData(byte[] data, IReadOnlyDictionary<string, string> headers)
            {
                headers.TryGetValue(ContentTypeHeader, out string contentType);

                this.data = data;
                this.ContentType = contentType ?? DefaultContentType;
                this.Headers = headers;
                this.Filename = ParseFilename(headers);
            }

            /// <inheritdoc />
            public string ContentType { get; }

            /// <inheritdoc />
            public string Filename { get; }

            /// <inheritdoc />
            public IReadOnlyDictionary<string, string> Headers { get; }

            /// <inheritdoc />
            public byte[] GetContents()
            {
                return this.data;
            }
        }
    }
}


text:
package aws.daleks.database

import com.amazonaws.regions.Region
import scala.collection.JavaConverters._
import com.amazonaws.services.elasticache.AmazonElastiCacheClient
import rx.lang.scala._
import com.amazonaws.services.elasticache.model.ReplicationGroup
import com.amazonaws.services.elasticache.model.DeleteReplicationGroupRequest
import java.util.List
import aws.daleks.RxDalek
import com.amazonaws.services.elasticache.AmazonElastiCacheClientBuilder

//TODO: Consider pagination
//TODO: Delete cache clusters with replication group
case class ElastiCacheReplicationGroupDalek() extends RxDalek[ReplicationGroup] {

  val ecache = AmazonElastiCacheClientBuilder.standard().withRegion(regions).build()

  override def list:List[ReplicationGroup] =
      ecache.describeReplicationGroups.getReplicationGroups()

  override def mercy(ar:ReplicationGroup) = ar.getStatus != "available"

  override def exterminate(ar:ReplicationGroup):Unit =
    ecache.deleteReplicationGroup(new DeleteReplicationGroupRequest().withReplicationGroupId(ar.getReplicationGroupId))

  override def describe(ar:ReplicationGroup):Map[String,String] = Map(
      ("replicationGroupId"->ar.getReplicationGroupId()),
      ("status"->ar.getStatus())
  )
}


text:
namespace AgpuVulkan
{

void AVkDescriptorSetPoolAllocation::free()
{
    owner->free(this);
}

AVkDescriptorSetPoolBlock::AVkDescriptorSetPoolBlock()
{
    poolHandle = VK_NULL_HANDLE;
}

AVkDescriptorSetPoolBlock::~AVkDescriptorSetPoolBlock()
{
    auto &device = owner->device;
    for(auto allocation : allocationList)
        delete allocation;

    if(poolHandle != VK_NULL_HANDLE)
        vkDestroyDescriptorPool(deviceForVk->device, poolHandle, nullptr);
}

AVkDescriptorSetPoolAllocation *AVkDescriptorSetPoolBlock::allocate()
{
    assert(this == owner->freeBlocks.back().get());
    if(freeList.empty())
    {
        if(remainingAllocationCount == 0)
            return nullptr;

        VkDescriptorSetAllocateInfo allocateInfo = {};
        allocateInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO;
        allocateInfo.descriptorPool = poolHandle;
        allocateInfo.descriptorSetCount = 1;
        allocateInfo.pSetLayouts = &owner->setDescription.descriptorSetLayout;

        VkDescriptorSet descriptorSet;
        auto &device = owner->device;
        auto error = vkAllocateDescriptorSets(deviceForVk->device, &allocateInfo, &descriptorSet);
        if (error)
        {
            printError("Failed to allocate descriptor set.\n");
            return nullptr;
        }

        remainingAllocationCount = remainingAllocationCount - 1;
        auto newAllocation = new AVkDescriptorSetPoolAllocation;
        newAllocation->descriptorSet = descriptorSet;
        newAllocation->owner = this;
        allocationList.push_back(newAllocation);
        freeList.push_back(newAllocation);
    }

    auto result = freeList.back();
    freeList.pop_back();
    if(freeList.empty() && remainingAllocationCount == 0)
        owner->allocationBlockCompleted(shared_from_this());

    return result;
}

void AVkDescriptorSetPoolBlock::free(AVkDescriptorSetPoolAllocation *allocation)
{
    auto isNewFreeBlock = freeList.empty() && remainingAllocationCount == 0;
    freeList.push_back(allocation);
    if(isNewFreeBlock)
        owner->freeBlocks.push_back(shared_from_this());
}

AVkDescriptorSetPool::AVkDescriptorSetPool()
{
}

AVkDescriptorSetPool::~AVkDescriptorSetPool()
{
    allocationBlocks.clear();
    freeBlocks.clear();
    if(setDescription.descriptorSetLayout != VK_NULL_HANDLE)
        vkDestroyDescriptorSetLayout(deviceForVk->device, setDescription.descriptorSetLayout, nullptr);
}

AVkDescriptorSetPoolAllocation *AVkDescriptorSetPool::allocate()
{
    std::unique_lock<std::mutex> l(mutex);

    if(freeBlocks.empty())
    {
        VkDescriptorPoolCreateInfo poolCreateInfo = {};
        poolCreateInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO;
        poolCreateInfo.maxSets = setDescription.maxBindings;
        poolCreateInfo.poolSizeCount = (uint32_t)elementSizes.size();
        poolCreateInfo.pPoolSizes = &elementSizes[0];
        poolCreateInfo.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT;

        VkDescriptorPool poolHandle;
        auto error = vkCreateDescriptorPool(deviceForVk->device, &poolCreateInfo, nullptr, &poolHandle);
        if (error)
            return nullptr;

        auto newBlock = std::make_shared<AVkDescriptorSetPoolBlock> ();
        newBlock->owner = this;
        newBlock->poolHandle = poolHandle;
        newBlock->remainingAllocationCount = setDescription.maxBindings;
        allocationBlocks.push_back(newBlock);
        freeBlocks.push_back(newBlock);
    }

    return freeBlocks.back()->allocate();
}

void AVkDescriptorSetPool::allocationBlockCompleted(AVkDescriptorSetPoolBlockPtr block)
{
    auto blockPosition = std::find(freeBlocks.begin(), freeBlocks.end(), block);
    if(blockPosition != freeBlocks.end())
        freeBlocks.erase(blockPosition);
}

void AVkDescriptorSetPool::free(AVkDescriptorSetPoolAllocation *allocation)
{
    std::unique_lock<std::mutex> l(mutex);
    allocation->owner->free(allocation);
}

} // End of namespace AgpuVulkan


text:
package org.apache.cassandra.streaming;

import java.io.IOError;
import java.io.IOException;
import java.net.InetAddress;

import org.apache.cassandra.net.MessageIn;

public class StreamUtil
{
    /**
     * Takes an stream request message and creates an empty status response. Exists here because StreamRequestMessage
     * is package protected.
     */
    static public void finishStreamRequest(MessageIn<StreamRequest> msg, InetAddress to)
    {
        StreamInSession session = StreamInSession.get(to, msg.payload.sessionId);
        try
        {
            session.closeIfFinished();
        }
        catch (IOException e)
        {
            throw new IOError(e);
        }
    }
}


text:
"""

UniqueStr is a base class for implementing enums
as strings.

see MediaType and TextEncoding subclasses for example
subclasses.

"""

class UniqueStr(str):
    """
    UniqueStr looks like an ascii str, but it has been normalized.

    It's a string that behaves like an enum.

    Subclass this for values like media-types, charsets,
    language names, locale, etc.
    """

    # dictionary mapping names to known values.
    # multiple names may match to the same unique str if it has aliases.
    # this looks like a mapping from str to str but it's really a mapping
    # from str to UniqueStr.
    _known = dict()

    # if set, attempts to create new values will fail
    _exclusive = False

    def __new__(cls, s):
        # make sure cls has its own _known and _exclusive -
        #  i'm sure there is a better way to do this...
        if '_known' not in cls.__dict__:
            cls._known = {}
            cls._exclusive = False

        s = cls.normalize(s)
        mt = cls._known.get(s)
        if not mt:
            if cls._exclusive:
                raise ValueError, "Unknown unique string"

            mt = str.__new__(cls, s)
            cls._known[s] = mt
        return mt

    @classmethod
    def normalize(cls, s):
        """
        normalize a string before intern-ing it.

        this is useful when there are multiple values of a string
        that are acceptable but you want to convert them to a
        preferred format, e.g. using a particular capitalization
        style for case-insensitive identifiers.

        this is also an opportunity to reject (with ValueError)
        invalid values.
        """
        if not isinstance(s, str):
            s = str(s)
            #raise ValueError('%s must be a string' % cls.__name__)

        return s.strip()

    def addalias(self, alias):
        """
        add an alias for this unique string.

        you can do more powerful things by overriding .normalize().
        """
        if alias in self._known:
            if self is not self._known[alias]:
                raise ValueError, 'attempt to change UniqueStr alias'
            # XXX should log a warning here, but it's safe to continue
            return
        self._known[alias] = self


text:
import random

def tah(herni_pole, cislo_policka, symbol):
    return herni_pole[:cislo_policka] + symbol + herni_pole[cislo_policka + 1:]

def tah_pocitace(herni_pole):

    while True:
        cislo_policka = random.randrange(len(herni_pole))
        if herni_pole[cislo_policka] == "-":
            return tah(herni_pole, cislo_policka, "o")


text:
package com.cortrium.cortriumc3.ApiConnection.models;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

public class Device {

    @SerializedName("identifier")
    @Expose
    private String identifier;
    @SerializedName("firmwareversion")
    @Expose
    private String firmwareversion;
    @SerializedName("hardwareversion")
    @Expose
    private String hardwareversion;
    @SerializedName("gain")
    @Expose
    private Integer gain;
    @SerializedName("samplingrate")
    @Expose
    private Integer samplingrate;
    @SerializedName("id")
    @Expose
    private String id;

    /**
     * No args constructor for use in serialization
     *
     */
    public Device() {
    }

    /**
     *
     * @param id
     * @param firmwareversion
     * @param samplingrate
     * @param hardwareversion
     * @param identifier
     * @param gain
     */
    public Device(String identifier, String firmwareversion, String hardwareversion, Integer gain, Integer samplingrate, String id) {
        super();
        this.identifier = identifier;
        this.firmwareversion = firmwareversion;
        this.hardwareversion = hardwareversion;
        this.gain = gain;
        this.samplingrate = samplingrate;
        this.id = id;
    }

    public String getIdentifier() {
        return identifier;
    }

    public void setIdentifier(String identifier) {
        this.identifier = identifier;
    }

    public Device withIdentifier(String identifier) {
        this.identifier = identifier;
        return this;
    }

    public String getFirmwareversion() {
        return firmwareversion;
    }

    public void setFirmwareversion(String firmwareversion) {
        this.firmwareversion = firmwareversion;
    }

    public Device withFirmwareversion(String firmwareversion) {
        this.firmwareversion = firmwareversion;
        return this;
    }

    public String getHardwareversion() {
        return hardwareversion;
    }

    public void setHardwareversion(String hardwareversion) {
        this.hardwareversion = hardwareversion;
    }

    public Device withHardwareversion(String hardwareversion) {
        this.hardwareversion = hardwareversion;
        return this;
    }

    public Integer getGain() {
        return gain;
    }

    public void setGain(Integer gain) {
        this.gain = gain;
    }

    public Device withGain(Integer gain) {
        this.gain = gain;
        return this;
    }

    public Integer getSamplingrate() {
        return samplingrate;
    }

    public void setSamplingrate(Integer samplingrate) {
        this.samplingrate = samplingrate;
    }

    public Device withSamplingrate(Integer samplingrate) {
        this.samplingrate = samplingrate;
        return this;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Device withId(String id) {
        this.id = id;
        return this;
    }

}


text:
#ifndef _SYS_SOCKIO_H_
#define	_SYS_SOCKIO_H_

#include <sys/ioccom.h>

/* Socket ioctl's. */
#define	SIOCSHIWAT	 _IOW('s',  0, int)		/* set high watermark */
#define	SIOCGHIWAT	 _IOR('s',  1, int)		/* get high watermark */
#define	SIOCSLOWAT	 _IOW('s',  2, int)		/* set low watermark */
#define	SIOCGLOWAT	 _IOR('s',  3, int)		/* get low watermark */
#define	SIOCATMARK	 _IOR('s',  7, int)		/* at oob mark? */
#define	SIOCSPGRP	 _IOW('s',  8, int)		/* set process group */
#define	SIOCGPGRP	 _IOR('s',  9, int)		/* get process group */

#define	SIOCADDRT	 _IOW('r', 10, struct ortentry)	/* add route */
#define	SIOCDELRT	 _IOW('r', 11, struct ortentry)	/* delete route */
#define	SIOCGETVIFCNT	_IOWR('r', 15, struct sioc_vif_req)/* get vif pkt cnt */
#define	SIOCGETSGCNT	_IOWR('r', 16, struct sioc_sg_req) /* get s,g pkt cnt */

#define	SIOCSIFADDR	 _IOW('i', 12, struct ifreq)	/* set ifnet address */
#define	OSIOCGIFADDR	_IOWR('i', 13, struct ifreq)	/* get ifnet address */
#define	SIOCGIFADDR	_IOWR('i', 33, struct ifreq)	/* get ifnet address */
#define	SIOCSIFDSTADDR	 _IOW('i', 14, struct ifreq)	/* set p-p address */
#define	OSIOCGIFDSTADDR	_IOWR('i', 15, struct ifreq)	/* get p-p address */
#define	SIOCGIFDSTADDR	_IOWR('i', 34, struct ifreq)	/* get p-p address */
#define	SIOCSIFFLAGS	 _IOW('i', 16, struct ifreq)	/* set ifnet flags */
#define	SIOCGIFFLAGS	_IOWR('i', 17, struct ifreq)	/* get ifnet flags */
#define	OSIOCGIFBRDADDR	_IOWR('i', 18, struct ifreq)	/* get broadcast addr */
#define	SIOCGIFBRDADDR	_IOWR('i', 35, struct ifreq)	/* get broadcast addr */
#define	SIOCSIFBRDADDR	 _IOW('i', 19, struct ifreq)	/* set broadcast addr */
#define	OSIOCGIFCONF	_IOWR('i', 20, struct ifconf)	/* get ifnet list */
#define	SIOCGIFCONF	_IOWR('i', 36, struct ifconf)	/* get ifnet list */
#define	OSIOCGIFNETMASK	_IOWR('i', 21, struct ifreq)	/* get net addr mask */
#define	SIOCGIFNETMASK	_IOWR('i', 37, struct ifreq)	/* get net addr mask */
#define	SIOCSIFNETMASK	 _IOW('i', 22, struct ifreq)	/* set net addr mask */
#define	SIOCGIFMETRIC	_IOWR('i', 23, struct ifreq)	/* get IF metric */
#define	SIOCSIFMETRIC	 _IOW('i', 24, struct ifreq)	/* set IF metric */
#define	SIOCDIFADDR	 _IOW('i', 25, struct ifreq)	/* delete IF addr */
#define	SIOCAIFADDR	 _IOW('i', 26, struct ifaliasreq)/* add/chg IF alias */

#define	SIOCALIFADDR	 _IOW('i', 27, struct if_laddrreq) /* add IF addr */
#define	SIOCGLIFADDR	_IOWR('i', 28, struct if_laddrreq) /* get IF addr */
#define	SIOCDLIFADDR	 _IOW('i', 29, struct if_laddrreq) /* delete IF addr */
#define	SIOCSIFCAP	 _IOW('i', 30, struct ifreq)	/* set IF features */
#define	SIOCGIFCAP	_IOWR('i', 31, struct ifreq)	/* get IF features */
#define	SIOCGIFINDEX	_IOWR('i', 32, struct ifreq)	/* get IF index */
#define	SIOCGIFMAC	_IOWR('i', 38, struct ifreq)	/* get IF MAC label */
#define	SIOCSIFMAC	 _IOW('i', 39, struct ifreq)	/* set IF MAC label */
#define	SIOCSIFNAME	 _IOW('i', 40, struct ifreq)	/* set IF name */
#define	SIOCSIFDESCR	 _IOW('i', 41, struct ifreq)	/* set ifnet descr */
#define	SIOCGIFDESCR	_IOWR('i', 42, struct ifreq)	/* get ifnet descr */

#define	SIOCADDMULTI	 _IOW('i', 49, struct ifreq)	/* add m'cast addr */
#define	SIOCDELMULTI	 _IOW('i', 50, struct ifreq)	/* del m'cast addr */
#define	SIOCGIFMTU	_IOWR('i', 51, struct ifreq)	/* get IF mtu */
#define	SIOCSIFMTU	 _IOW('i', 52, struct ifreq)	/* set IF mtu */
#define	SIOCGIFPHYS	_IOWR('i', 53, struct ifreq)	/* get IF wire */
#define	SIOCSIFPHYS	 _IOW('i', 54, struct ifreq)	/* set IF wire */
#define	SIOCSIFMEDIA	_IOWR('i', 55, struct ifreq)	/* set net media */
#define	SIOCGIFMEDIA	_IOWR('i', 56, struct ifmediareq) /* get net media */

#define	SIOCSIFGENERIC	 _IOW('i', 57, struct ifreq)	/* generic IF set op */
#define	SIOCGIFGENERIC	_IOWR('i', 58, struct ifreq)	/* generic IF get op */

#define	SIOCGIFSTATUS	_IOWR('i', 59, struct ifstat)	/* get IF status */
#define	SIOCSIFLLADDR	 _IOW('i', 60, struct ifreq)	/* set linklevel addr */

#define	SIOCSIFPHYADDR	 _IOW('i', 70, struct ifaliasreq) /* set gif addres */
#define	SIOCGIFPSRCADDR	_IOWR('i', 71, struct ifreq)	/* get gif psrc addr */
#define	SIOCGIFPDSTADDR	_IOWR('i', 72, struct ifreq)	/* get gif pdst addr */
#define	SIOCDIFPHYADDR	 _IOW('i', 73, struct ifreq)	/* delete gif addrs */
#define	SIOCSLIFPHYADDR	 _IOW('i', 74, struct if_laddrreq) /* set gif addrs */
#define	SIOCGLIFPHYADDR	_IOWR('i', 75, struct if_laddrreq) /* get gif addrs */

#define	SIOCGPRIVATE_0	_IOWR('i', 80, struct ifreq)	/* device private 0 */
#define	SIOCGPRIVATE_1	_IOWR('i', 81, struct ifreq)	/* device private 1 */

#define	SIOCSIFVNET	_IOWR('i', 90, struct ifreq)	/* move IF jail/vnet */
#define	SIOCSIFRVNET	_IOWR('i', 91, struct ifreq)	/* reclaim vnet IF */

#define	SIOCGIFFIB	_IOWR('i', 92, struct ifreq)	/* get IF fib */
#define	SIOCSIFFIB	 _IOW('i', 93, struct ifreq)	/* set IF fib */

#define	SIOCSDRVSPEC	_IOW('i', 123, struct ifdrv)	/* set driver-specific
								  parameters */
#define	SIOCGDRVSPEC	_IOWR('i', 123, struct ifdrv)	/* get driver-specific
								  parameters */

#define	SIOCIFCREATE	_IOWR('i', 122, struct ifreq)	/* create clone if */
#define	SIOCIFCREATE2	_IOWR('i', 124, struct ifreq)	/* create clone if */
#define	SIOCIFDESTROY	 _IOW('i', 121, struct ifreq)	/* destroy clone if */
#define	SIOCIFGCLONERS	_IOWR('i', 120, struct if_clonereq) /* get cloners */

#define	SIOCAIFGROUP	 _IOW('i', 135, struct ifgroupreq) /* add an ifgroup */
#define	SIOCGIFGROUP	_IOWR('i', 136, struct ifgroupreq) /* get ifgroups */
#define	SIOCDIFGROUP	 _IOW('i', 137, struct ifgroupreq) /* delete ifgroup */
#define	SIOCGIFGMEMB	_IOWR('i', 138, struct ifgroupreq) /* get members */

#endif /* !_SYS_SOCKIO_H_ */


text:
/*
 * kill document defaults margin & padding. We all do that all the times, right ?
 */
html,
body {
  margin: 0;
  padding: 0;
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>|Designer Co.</title>

    <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">

    <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css" type="text/css">

    <link rel="stylesheet" href="css/animate.min.css" type="text/css">

    <link rel="stylesheet" href="css/creative.css" type="text/css">

                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>
                /BMDesign

                        Sobre

                        Serviços

                        Portfólio

                        Contato

Sua marca do jeito certo

Fazemos cartões de visita, folhetos, modelos de sites, tudo aquilo que precisa de uma dose de arte.

                Saiba mais

Somos uma equipe de designers preparados para te atender da melhor forma. Temos experiência e muita criatividade.

Nosso trabalho

Satisfação

Sua satisfação é nosso foco. Queremos que volte sempre que precisar

Do seu jeito

Seu pedido é extravagante? Quer algo diferente? Não tem problema

Tudo pode mudar

Fez o pedido e esqueceu de algum detalhe? Fale conosco, enquanto desenhamos o protótipo tudo pode mudar!

Feito com amor

Fazemos o que gostamos, arte!

                                    Produto

                                    Produto

                                    Produto

                                    Produto

                                    Produto

                                    Produto

Faça seu pedido!

Entre em contato conosco e vamos falar sobre o que você precisa. Ficaremos felizes em te atender.

                    <form class="form-horizontal" method="post" action="mail/contact.php">

                            Nome

                                <input type="text" class="form-control" name="nome" id="inputNome" placeholder="José da Silva" required>

                            Email

                                <input type="email" class="form-control" name="email" id="inputEmail" placeholder="seu.email@exemplo.com" required>

                            Telefone

                                <input type="number" class="form-control" name="telefone" id="inputTelefone" placeholder="(11) 91234-0987" required>

                            Detalhes do pedido

                                <textarea class="form-control" name="pedido" id="inputPedido" rows="3" placeholder="Descreva seu pedido aqui..." style="overflow:auto; resize:none" required></textarea>

                            <button type="submit" class="btn btn-primary">Enviar Seu Pedido</button>

                    </form>

Nosso telefone e email

(11) 92345-0987

email.pra.contato@exemplo.com


text:
/* SPDX-License-Identifier: BSD-2-Clause */
/*
 * Copyright (c) 2015 - 2018 Intel Corporation
 * All rights reserved.
 */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
#include <limits.h>
#include <string.h>
#include <stdio.h>

#ifndef _WIN32
#include <poll.h>
#include <netdb.h>
#include <netinet/in.h>
#include <unistd.h>
#endif

#include "tss2_tpm2_types.h"

#include "io.h"
#define LOGMODULE tcti
#include "util/log.h"

#define MAX_PORT_STR_LEN    sizeof("65535")

/* sockaddr_un::sun_path is documented as char[108], but it seems safer to let
 * the compiler (or rather, the headers) derive this for us. (Cast to int to
 * avoid signed/unsigned comparison warnings.) */
#define MAX_SADDR_UN_PATH  (int)sizeof(((struct sockaddr_un *)0)->sun_path)

/*
 * The 'read_all' function attempts to read all of the 'size' bytes requested
 * from the 'fd' provided into the buffer 'data'. This function will continue
 * to retry after temporary failures and "short reads". It will only stop
 * once all of the requested data has been read, an error occurs, or EOF.
 * On error or EOF, the number of bytes read (if any) will be returned.
 */
ssize_t
read_all (
    SOCKET fd,
    uint8_t *data,
    size_t size)
{
    ssize_t recvd;
    size_t recvd_total = 0;

    LOG_DEBUG ("reading %zu bytes from fd %d to buffer at 0x%" PRIxPTR,
               size, fd, (uintptr_t)data);
    do {
#ifdef _WIN32
        TEMP_RETRY (recvd, recv (fd, (char *) &data [recvd_total], size, 0));
        if (recvd < 0) {
            LOG_WARNING ("read on fd %d failed with errno %d: %s",
                         fd, WSAGetLastError(), strerror (WSAGetLastError()));
            return recvd_total;
        }
#else
        TEMP_RETRY (recvd, read (fd, &data [recvd_total], size));
        if (recvd < 0) {
            LOG_WARNING ("read on fd %d failed with errno %d: %s",
                         fd, errno, strerror (errno));
            return recvd_total;
        }
#endif
        if (recvd == 0) {
            LOG_WARNING ("Attempted read %zu bytes from fd %d, but EOF "
                         "returned", size, fd);
            return recvd_total;
        }
        LOGBLOB_DEBUG (&data [recvd_total], recvd, "read %zd bytes from fd %d:", recvd, fd);
        recvd_total += recvd;
        size -= recvd;
    } while (size > 0);

    return recvd_total;
}

ssize_t
write_all (
    SOCKET fd,
    const uint8_t *buf,
    size_t size)
{
    ssize_t written = 0;
    size_t written_total = 0;

    do {
        LOG_DEBUG("writing %zu bytes starting at 0x%" PRIxPTR " to fd %d",
                  size - written_total,
                  (uintptr_t)(buf + written_total),
                  fd);
#ifdef _WIN32
        TEMP_RETRY (written, send (fd,
                                   (const char*)&buf [written_total],
                                   size - written_total, 0));
#else
         TEMP_RETRY (written, write (fd,
                                     (const char*)&buf [written_total],
                                     size - written_total));
#endif
        if (written >= 0) {
            LOG_DEBUG ("wrote %zd bytes to fd %d", written, fd);
            written_total += (size_t)written;
        } else {
#ifdef _WIN32
            LOG_ERROR ("failed to write to fd %d: %s", fd, strerror (WSAGetLastError()));
#else
            LOG_ERROR ("failed to write to fd %d: %s", fd, strerror (errno));
#endif
            return written_total;
        }
    } while (written_total < size);

    return (ssize_t)written_total;
}

ssize_t
socket_recv_buf (
    SOCKET sock,
    uint8_t *data,
    size_t size)
{
    return read_all (sock, data, size);
}

TSS2_RC
socket_xmit_buf (
    SOCKET sock,
    const void *buf,
    size_t size)
{
    int ret;

    LOGBLOB_DEBUG (buf, size, "Writing %zu bytes to socket %d:", size, sock);
    ret = write_all (sock, buf, size);
    if (ret < (ssize_t) size) {
#ifdef _WIN32
        LOG_ERROR ("write to fd %d failed, errno %d: %s", sock, WSAGetLastError(), strerror (WSAGetLastError()));
#else
        LOG_ERROR ("write to fd %d failed, errno %d: %s", sock, errno, strerror (errno));
#endif
        return TSS2_TCTI_RC_IO_ERROR;
    }
    return TSS2_RC_SUCCESS;
}

TSS2_RC
socket_close (
    SOCKET *socket)
{
    int ret;

    if (socket == NULL) {
        return TSS2_TCTI_RC_BAD_REFERENCE;
    }
    if (*socket == INVALID_SOCKET) {
        return TSS2_RC_SUCCESS;
    }
#ifdef _WIN32
    ret = closesocket (*socket);
    WSACleanup();
    if (ret == SOCKET_ERROR) {
        LOG_WARNING ("Failed to close SOCKET %d. errno %d: %s",
                     *socket, WSAGetLastError(), strerror (WSAGetLastError()));
        return TSS2_TCTI_RC_IO_ERROR;
    }
#else
    ret = close (*socket);
    if (ret == SOCKET_ERROR) {
        LOG_WARNING ("Failed to close SOCKET %d. errno %d: %s",
                     *socket, errno, strerror (errno));
        return TSS2_TCTI_RC_IO_ERROR;
    }
#endif
    *socket = INVALID_SOCKET;

    return TSS2_RC_SUCCESS;
}

TSS2_RC
socket_connect (
    const char *hostname,
    uint16_t port,
    int control,
    SOCKET *sock)
{
    static const struct addrinfo hints = { .ai_socktype = SOCK_STREAM,
        .ai_family = AF_UNSPEC, .ai_protocol = IPPROTO_TCP};
    struct addrinfo *retp = NULL;
    struct addrinfo *p;
    char port_str[MAX_PORT_STR_LEN];
    int ret = 0;
#ifdef _WIN32
    char host_buff[_HOST_NAME_MAX];
    const char *h = hostname;
    WSADATA wsaData;
    int iResult;
    iResult = WSAStartup(MAKEWORD(2, 2), &wsaData);
    if (iResult != 0) {
        LOG_WARNING("WSAStartup failed: %d", iResult);
        return TSS2_TCTI_RC_IO_ERROR;
    }
#else
    char host_buff[_HOST_NAME_MAX] __attribute__((unused));
    const char *h __attribute__((unused)) = hostname;
#endif

    if (hostname == NULL || sock == NULL) {
        return TSS2_TCTI_RC_BAD_REFERENCE;
    }

    if (control)
        port++;

    ret = snprintf(port_str, sizeof(port_str), "%u", port);
    if (ret < 0)
        return TSS2_TCTI_RC_BAD_VALUE;

    LOG_DEBUG ("Resolving host %s", hostname);
    ret = getaddrinfo (hostname, port_str, &hints, &retp);
    if (ret != 0) {
        LOG_WARNING ("Host %s does not resolve to a valid address: %d: %s",
            hostname, ret, gai_strerror(ret));
        return TSS2_TCTI_RC_IO_ERROR;
    }

    for (p = retp; p != NULL; p = p->ai_next) {
        *sock = socket (p->ai_family, SOCK_STREAM, 0);
        void *sockaddr;

        if (*sock == INVALID_SOCKET)
            continue;

        if (p->ai_family == AF_INET)
            sockaddr = &((struct sockaddr_in*)p->ai_addr)->sin_addr;
        else
            sockaddr = &((struct sockaddr_in6*)p->ai_addr)->sin6_addr;

        h = inet_ntop(p->ai_family, sockaddr, host_buff, sizeof(host_buff));

        if (h == NULL)
            h = hostname;

        LOG_DEBUG ("Attempting TCP connection to host %s, port %s", h, port_str);
        if (connect (*sock, p->ai_addr, p->ai_addrlen) != SOCKET_ERROR)
            break; /* socket connected OK */
        socket_close (sock);
    }
    freeaddrinfo (retp);
    if (p == NULL) {
#ifdef _WIN32
        LOG_WARNING ("Failed to connect to host %s, port %s: errno %d: %s",
                      h, port_str, WSAGetLastError(), strerror (WSAGetLastError()));
#else
        LOG_WARNING ("Failed to connect to host %s, port %s: errno %d: %s",
                     h, port_str, errno, strerror (errno));
#endif

        return TSS2_TCTI_RC_IO_ERROR;
    }

    return TSS2_RC_SUCCESS;
}

TSS2_RC
socket_connect_unix (
    const char *path,
    int control,
    SOCKET *sock)
{
#ifdef _WIN32
    return TSS2_TCTI_RC_BAD_REFERENCE;
#else
    struct sockaddr_un saddr;

    if (path == NULL)
        return TSS2_TCTI_RC_BAD_REFERENCE;

    saddr.sun_family = AF_UNIX;

    if (snprintf(saddr.sun_path, MAX_SADDR_UN_PATH,
                 control ? "%s.ctrl" : "%s", path) >= MAX_SADDR_UN_PATH) {
        LOG_ERROR ("Socket %s%s is too long for AF_UNIX",
                   path, control ? ".ctrl" : "");
        return TSS2_TCTI_RC_BAD_VALUE;
    }

    *sock = socket (AF_UNIX, SOCK_STREAM, 0);

    if (*sock == INVALID_SOCKET) {
        LOG_WARNING ("Failed to create AF_UNIX socket");
        return TSS2_TCTI_RC_IO_ERROR;
    }

    LOG_DEBUG ("Attempting UNIX connection to %s", saddr.sun_path);
    if (connect (*sock, (struct sockaddr *)&saddr, sizeof(saddr)) == SOCKET_ERROR) {
        LOG_WARNING ("Failed to connect to %s", saddr.sun_path);
        return TSS2_TCTI_RC_IO_ERROR;
    }

    return TSS2_RC_SUCCESS;
#endif
}

TSS2_RC
socket_set_nonblock (SOCKET sock)
{
#ifndef _WIN32
    int flgs;

    flgs = fcntl(sock, F_GETFL);
    if (flgs == -1)
        return TSS2_TCTI_RC_IO_ERROR;

    flgs |= O_NONBLOCK;
    if (fcntl(sock, F_SETFL, flgs) != 0)
        return TSS2_TCTI_RC_IO_ERROR;
#endif
    return TSS2_RC_SUCCESS;
}

TSS2_RC
socket_poll (SOCKET sock, int timeout)
{
#ifndef _WIN32
    struct pollfd fds;
    int rc_poll, nfds = 1;

    fds.fd = sock;
    fds.events = POLLIN;

    /* Timeout of 0 ie return immediately is not
     * well handled throughout the upper layers currenty
     * cousing the integration tests to hang randomly.
     * Make the poll to waint to at least 10 ms */
    if (timeout == 0)
        timeout = 10;

    rc_poll = poll(&fds, nfds, timeout);
    if (rc_poll < 0) {
        LOG_ERROR ("Failed to poll for response from fd %d, got errno %d: %s",
                   sock, errno, strerror(errno));
        return TSS2_TCTI_RC_IO_ERROR;
    } else if (rc_poll == 0) {
        LOG_INFO ("Poll timed out on fd %d.", sock);
        return TSS2_TCTI_RC_TRY_AGAIN;
    } else if (fds.revents == POLLIN) {
        return TSS2_RC_SUCCESS;
    }
#endif
    return TSS2_RC_SUCCESS;
}


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SQLite;
using swapHDSD;
using System.IO;

namespace swapHDSD
{
    public partial class editerForm: Form
    {
        Projet projet;
        string projetSel = "";
        enum MODE { EDITER, CREER };
        MODE mode;
        public editerForm(Projet projet)
        {
            InitializeComponent();
            this.projet = projet;
            sauvegarderButton.Text = "Creer";
            mode = MODE.CREER;
        }

        public editerForm(Projet projet, string projetSel)
        {
            InitializeComponent();
            this.projet = projet;
            this.projetSel = projetSel;
            mode = MODE.EDITER;
        }

        private void sdhd_Click(object sender, EventArgs e)
        {
            this.Hide();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            if (mode == MODE.EDITER)
            {
                projet.chargeProjet(projetSel);
                projet.getNoms(nomTextbox, pathTextbox);
                Console.WriteLine("Fenêtre d'édition ouverte, " + projetSel + " sélectionné.");
            }
            else
            {
                Console.WriteLine("Fenêtre d'édition ouverte en mode création.");
            }

        }

        // Édition du path
        private void parcourirButton_Click(object sender, EventArgs e)
        {
            if (mode == MODE.EDITER)
                MessageBox.Show("Le chemin du projet sera changé, mais les dossiers du chemin précédent existeront toujours.");

            BrowserDialog.ShowDialog();

            if (!Directory.Exists(BrowserDialog.SelectedPath))
            {
                MessageBox.Show("Le répertoire sélectionné n'existe pas : \n\'{0}\'", BrowserDialog.SelectedPath);
            }
            else
            {
                pathTextbox.Text = BrowserDialog.SelectedPath;
            }
        }

        // On sauvegarde selon l'état de la fenêtre
        private void sauvegarderButton_Click(object sender, EventArgs e)
        {
            if (mode == MODE.EDITER)
            {
                // Sauvegarde le projet en cours
                if (projet.update(nomTextbox.Text, pathTextbox.Text))
                    this.Close();
            }
            else
            {
                if (projet.creer(nomTextbox.Text, pathTextbox.Text))
                    this.Close();
            }
        }

        // On s'assure que du texte a été entré
        private void verifValide(object sender, EventArgs e)
        {
            if(nomTextbox.Text == "" || pathTextbox.Text == "")
            {
                sauvegarderButton.Enabled = false;
            }
            else
            {
                sauvegarderButton.Enabled = true;
            }
        }

    }
}