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

<android.support.v7.widget.CardView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:cardCornerRadius="2dp"
    app:cardElevation="4dp"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    >
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/white"
    android:descendantFocusability="blocksDescendants"
    android:orientation="vertical"
    android:padding="5dp">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignTop="@id/imgUserHead"
            android:layout_toRightOf="@id/imgUserHead"
            android:orientation="vertical">

            <TextView
                android:id="@+id/tvGoodsName"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="6dp"
                android:layout_marginBottom="3dp"
                android:layout_marginLeft="3dp"
                android:textSize="18sp" />

            <TextView
                android:id="@+id/tvGoodsPrices"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="3dp"
                android:textColor="@android:color/holo_red_light"
                android:textSize="20dp" />

        </LinearLayout>

            <Button
                android:id="@+id/btn_market"
                android:layout_width="54dp"
                android:layout_height="33dip"
                android:layout_centerVertical="true"
                android:layout_alignParentRight="true"
                android:textSize="12sp"
                android:textColor="@color/blue"
                android:text="推广" />

    </RelativeLayout>

    <com.deeal.exchange.view.MyGirdView
        android:id="@+id/glpublish"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:numColumns="3"
        android:stretchMode="columnWidth">
    </com.deeal.exchange.view.MyGirdView>

    <TextView
        android:id="@+id/tv_mycollect"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="3dp"
        android:layout_marginTop="6dp"
        android:layout_marginBottom="6dp"
        android:textSize="10sp"
        android:text="0 收藏" />

    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="#eeeeee" />

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="39dp">

        <TextView
            android:id="@+id/tv_showDate"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_margin="7dp" />

        <Button
            android:id="@+id/btn_edit"
            android:layout_width="50dp"
            android:layout_height="33dp"
            android:layout_centerVertical="true"
            android:layout_marginRight="5dp"
            android:layout_toLeftOf="@+id/btn_delete"
            android:text="编辑"
            android:textSize="12sp" />

        <Button
            android:id="@+id/btn_delete"
            android:layout_width="50dp"
            android:layout_height="33dip"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:text="删除"
            android:textSize="12sp" />

    </RelativeLayout>

</LinearLayout>
</android.support.v7.widget.CardView>


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Photo_model extends CI_Model {

    public function __construct(){
        // 呼叫模型(Model)的建構函數
        parent::__construct();
    }

    public function dbAll_album($NType, $per_page){
        $data["album_type"] = $NType;

        $this->db->where($data);
        $this->db->order_by("album_id", "desc");
        $query = $this->db->get('album', $per_page, $this->uri->segment(5));
        if($query->num_rows() > 0){
            return $query->result();
        }
        return array();
    }

    public function dbInsert_album(){
        $this->album_title   = $this->input->post('NTitle');
        $this->album_content = $this->input->post('NContent');
        $this->album_type    = $this->input->post('NType');
        $this->BuildUser     = $this->session->userdata('AccID');
        $this->BuildDate     = date('Y-m-d');

        return $this->db->insert('album', $this);
    }

    public function dbUpdate_album(){
        $this->album_title   = $this->input->post('NTitle');
        $this->album_content = $this->input->post('NContent');

        return $this->db->update('album', $this, array('album_id' => $this->input->post('ID', true) ));
    }

    public function dbShow_album($ID){
        $query = $this->db->query("SELECT * FROM album WHERE album_id = '$ID'");
        if($query->num_rows() > 0){
            return $query->row();
        }
        return array();
    }

    public function dbAll_photo($album_id, $per_page){
        $data["album_id"] = $album_id;

        $this->db->where($data);
        $this->db->order_by("album_pid", "desc");
        $query = $this->db->get('album_img', $per_page, $this->uri->segment(6));
        if($query->num_rows() > 0){
            return $query->result();
        }
        return array();
    }

    public function dbPhoto_creat($file_data){
        $this->db->insert('album_img', $file_data);
    }

    public function dbTopPhotos(){
        $show_row_num = 3;
        $query = $this->db->query("SELECT * FROM album A, album_img B WHERE A.album_id = B.album_id AND A.album_type = '1' GROUP BY A.album_id ORDER BY A.album_id DESC LIMIT 0, $show_row_num");
        if($query->num_rows() > 0){
            return $query->result();
        }
        return array();
    }
}

redpajama_set_name: RedPajamaGithub


text:
import{Component,OnInit}from'@angular/core';
import{Router,ActivatedRoute} from'@angular/router';
import{ResourceService} from'app/service/resource.service';
import{Resource} from'app/models/resource.model';
import {PurchaseService} from'app/service/purchase.service';
import{PurchaseOrder} from'app/models/purchaseOrder.model';

@Component({
    selector:'app-carrito',
    templateUrl:'carrito.component.html'
})

export class CarritoComponent implements OnInit{
    purchases:PurchaseOrder[]

    resource:Resource;

    constructor(private router:Router,activatedRouter:ActivatedRoute, private service:ResourceService,private purchaseService:PurchaseService){

        const id = activatedRouter.snapshot.params['id'];
        service.getResource(id).subscribe(
            resource => this.resource = resource,
            error => console.error(error)
        );

    }

    ngOnInit(){
        this.purchaseService.getPurchases().subscribe(
            purchases => this.purchases = purchases,
            error => console.log(error)
        );
    }
     terminarCompra() {
    this.router.navigate(['/perfil']);
  }

   /* removeResource(){
        let okResponse = window.confirm("¿Esta seguro de eliminar el articulo?");
        if(okResponse){
            this.service.removeResource(this.resource).subscribe(
                _ => this.router.navigate(['/articulo']),
                error => console.error(error)
            )

        }
    }*/
 }


text:
<?xml version="1.0" encoding="utf-8"?>
<PRONOM-Report xmlns="http://pronom.nationalarchives.gov.uk">
  <report_format_detail>
    <FileFormat>
      <FormatID>2372</FormatID>
      <FormatName>Daisy-Dot Font File</FormatName>
      <FormatVersion>III</FormatVersion>
      <FormatAliases>
      </FormatAliases>
      <FormatFamilies>
      </FormatFamilies>
      <FormatTypes>Font</FormatTypes>
      <FormatDisclosure>
      </FormatDisclosure>
      <FormatDescription>Daisy-Dot is a text processing program written by Roy Goldman for the Atari line of computers enabling dot-matrix printers to utilise near letter quality (NLQ) printing technology. Three versions of Daisy-Dot were released between 1987 and 1990. A number of Daisy-Dot font files are pre-packaged with the text processor while others can be user-generated using the Daisy-Dot font editor. Daisy-Dot I and II fonts can be identified by the ASCII signature '3' followed by 0x9B.</FormatDescription>
      <BinaryFileFormat>
      </BinaryFileFormat>
      <ByteOrders>
      </ByteOrders>
      <ReleaseDate>
      </ReleaseDate>
      <WithdrawnDate>
      </WithdrawnDate>
      <ProvenanceSourceID>180</ProvenanceSourceID>
      <ProvenanceName>The National Archives and Records Administration / The National Archives and Records Administration</ProvenanceName>
      <ProvenanceSourceDate>08 Nov 2021</ProvenanceSourceDate>
      <ProvenanceDescription>
      </ProvenanceDescription>
      <LastUpdatedDate>08 Nov 2021</LastUpdatedDate>
      <FormatNote>http://fileformats.archiveteam.org/wiki/Daisy-Dot_font

https://atariage.com/forums/topic/291455-daisy-dot-source-code/

http://infolab.stanford.edu/~royg/work/index.html

http://85.11.68.68/stuff/collections/PoolDisk%20Too/CD2/UMICH/TEXT/PRINTING/DDOT2/

https://ia601000.us.archive.org/20/items/DaisyDotIIIUsersGuide/Daisy_Dot_III_Users_Guide.pdf

http://docplayer.net/210522943-Daisy-dot-iii-copyright-1990-by-roy-goldman.html</FormatNote>
      <FormatRisk>
      </FormatRisk>
      <TechnicalEnvironment>
      </TechnicalEnvironment>
      <FileFormatIdentifier>
        <Identifier>fmt/1547</Identifier>
        <IdentifierType>PUID</IdentifierType>
      </FileFormatIdentifier>
      <ExternalSignature>
        <ExternalSignatureID>2825</ExternalSignatureID>
        <Signature>nlq</Signature>
        <SignatureType>File extension</SignatureType>
      </ExternalSignature>
      <InternalSignature>
        <SignatureID>1892</SignatureID>
        <SignatureName>Daisy-Dot Font (Version III)</SignatureName>
        <SignatureNote>BOF:'3' followed by 0x9B</SignatureNote>
        <ByteSequence>
          <ByteSequenceID>2190</ByteSequenceID>
          <PositionType>Absolute from BOF</PositionType>
          <Offset>0</Offset>
          <MaxOffset>0</MaxOffset>
          <IndirectOffsetLocation>
          </IndirectOffsetLocation>
          <IndirectOffsetLength>
          </IndirectOffsetLength>
          <Endianness>
          </Endianness>
          <ByteSequenceValue>339B</ByteSequenceValue>
        </ByteSequence>
      </InternalSignature>
    </FileFormat>
    <SearchCriteria>Criteria</SearchCriteria>
  </report_format_detail>
</PRONOM-Report>


text:
Additional header content

Initializes a new instance of the GlobalResourcesModel class

**Namespace:** iTin.Export.Model
**Assembly:** iTin.Export.Core (in iTin.Export.Core.dll) Version: 2.0.0.0 (2.0.0.0)

## Syntax

**C#**

``` C#
public GlobalResourcesModel()
```

**VB**

``` VB
Public Sub New
```

## Remarks
\[Missing <remarks> documentation for "M:iTin.Export.Model.GlobalResourcesModel.#ctor"\]

## See Also

#### Reference
GlobalResourcesModel Class
iTin.Export.Model Namespace


text:
var path = require('path');
var webpack = require('webpack');

var dist = path.resolve(__dirname, '../static/dist');

module.exports = {
  devtool: 'source-map',
  entry: './app/index.js',
  output: {
    path: dist,
    filename: '[name]-[hash].js',
    chunkFilename: '[name]-[chunkhash].js',
    publicPath: '/dist/'
  },
  module: {
    loaders: [
      { test: /\.js$/, exclude: /node_modules/, loaders: ['babel'] },
    ]
  },
  plugins: [
    new webpack.DefinePlugin({
      'process.env': {
        NODE_ENV: JSON.stringify('production'),
        BROWSER: JSON.stringify(true)
      }
    }),
    new webpack.optimize.DedupePlugin(),
    new webpack.optimize.OccurenceOrderPlugin(),
    new webpack.optimize.UglifyJsPlugin({
      compress: {
        warnings: false
      }
    })
  ]
};


text:
package org.reclipse.structure.inference.annotations.impl;

import org.eclipse.emf.ecore.EClass;
import org.reclipse.structure.inference.annotations.AnnotationsPackage;
import org.reclipse.structure.inference.annotations.TemporaryAnnotation;

/**
 *
 * An implementation of the model object 'Temporary Annotation'.
 *
 *

 *

 *
 * @generated
 */
public class TemporaryAnnotationImpl extends ASGAnnotationImpl implements TemporaryAnnotation
{
   /**
    *
    *
    * @generated
    */
   protected TemporaryAnnotationImpl()
   {
      super();
   }

   /**
    *
    *
    * @generated
    */
   @Override
   protected EClass eStaticClass()
   {
      return AnnotationsPackage.Literals.TEMPORARY_ANNOTATION;
   }

} //TemporaryAnnotationImpl


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.servicelinker.models;

import com.azure.core.util.ExpandableStringEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.Collection;

/** Defines values for AzureResourceType. */
public final class AzureResourceType extends ExpandableStringEnum<AzureResourceType> {
    /** Static value KeyVault for AzureResourceType. */
    public static final AzureResourceType KEY_VAULT = fromString("KeyVault");

    /**
     * Creates or finds a AzureResourceType from its string representation.
     *
     * @param name a name to look for.
     * @return the corresponding AzureResourceType.
     */
    @JsonCreator
    public static AzureResourceType fromString(String name) {
        return fromString(name, AzureResourceType.class);
    }

    /**
     * Gets known AzureResourceType values.
     *
     * @return known AzureResourceType values.
     */
    public static Collection<AzureResourceType> values() {
        return values(AzureResourceType.class);
    }
}


text:
import { Component } from '@angular/core';
import { Router } from '@angular/router';

import { User } from '../shared/user.model';
import { AuthService } from '../auth.service';

@Component({
  selector: 'app-home',
  templateUrl: './home.component.html',
  styleUrls: ['./home.component.css']
})
export class HomeComponent {

  constructor(
    private router: Router,
    private authService: AuthService
  ) { }

  onClick(route: string) {
    this.router.navigate([route]);
  }

  onLoadServer(index: number) {
    this.router.navigate(['/servers', index, 'edit'], {
      queryParams:
        { allowEdit: true },
      fragment: 'loading'
    });
  }

  log(action: string) {
    action === 'in' ? this.authService.login() : this.authService.logout();
  }
}


text:
<?php
/**
 * Отображение для GalleryWidget/gallerywidget:
 *
 * @category YupeView
 * @package  yupe
 * @author   Yupe Team <team@yupe.ru>
 * @license  https://github.com/yupe/yupe/blob/master/LICENSE BSD
 * @link     http://yupe.ru
 **/
$this->widget(
    'gallery.extensions.colorbox.ColorBox',
    array(
        'target' => '.gallery-image',
        'config' => array( // тут конфиги плагина, подробнее http://www.jacklmoore.com/colorbox
        ),
    )
);
$mainAssets = Yii::app()->assetManager->publish(Yii::getPathOfAlias('gallery.views.assets'));
Yii::app()->clientScript->registerCssFile($mainAssets . '/css/gallery.css');
?>

<?php $this->widget(
    'bootstrap.widgets.TbListView',
    array(
        'dataProvider'  => $dataProvider,
        'itemView'      => '_image',
        'template'      => "{items}\n{pager}",
        'itemsCssClass' => 'row gallery-thumbnails thumbnails',
        'itemsTagName'  => 'div'
    )
); ?>


text:
<?php

namespace hzphp\DBI;

/**
 *  Defines a common interface for any records-based source of data.
 *
 */
interface Result {

    /**
     *  Retrieves the current record as an associative array, and advances the
     *  internal pointer to the next record.
     *
     *  @return         Contents of the current record as an associative array
     */
    public function fetch_assoc();

    /**
     *  Retrieves an array of objects describing each field in the record set.
     *
     *  See: http://www.php.net/manual/en/mysqli-result.fetch-fields.php
     *
     *  @return         Contents of the current record as an associative array
     */
    public function fetch_fields();

    /**
     *  Retrieves the current record as a numeric array, and advances the
     *  internal pointer to the next record.
     *
     *  @return         Contents of current record as a numeric array
     */
    public function fetch_row();

    /**
     *  Returns the number of fields in the current record set.
     *
     *  @return         The number of fields in the set
     */
    public function get_num_fields();

    /**
     *  Returns the number of records in the current record set.
     *
     *  @return         The number of records in the set
     */
    public function get_num_records();

    /**
     *  Seeks to the specified record by 0-based offset.
     *
     *  @param offset   The offset into the current record set
     *  @return         True on success, false on failure
     */
    public function data_seek(
        $offset
    );

}


text:
<template name="room">

				{{_ "Drop_to_upload_file"}}

				{{#unless embeddedVersion}}

					{{> burger}}

						{{#if showToggleFavorite}}

						{{/if}}

						{{roomName}}
						{{#if isTranslated}}

						{{/if}}
						{{{RocketChatMarkdown roomTopic}}}

				{{/unless}}

					{{#with unreadData}}
						{{#if since}}
							{{#if count}}

									<button class="jump-to">
										{{_ "Jump_to_first_unread"}}
										{{_ "Jump"}}
									</button>

										{{_ "S_new_messages_since_s" count formatUnreadSince}}

										{{_ "N_new_messages" count}}

									<button class="mark-read">
										{{_ "Mark_as_read"}}
									</button>

							{{/if}}
						{{/if}}
					{{/with}}
					{{#each uploading}}

							{{#if error}}

									{{error}}
									<button>
										{{_ "close"}}
									</button>

							{{else}}

									{{name}}... {{percentage}}%
									<button>
										{{_ "cancel"}}
									</button>

							{{/if}}

					{{/each}}

					<button class="new-message background-primary-action-color color-content-background-color not">

						{{_ "New_messages"}}
					</button>

						<button>{{_ "Jump_to_recent_messages"}} </button>

					{{#unless canPreview}}

								{{_ "You_must_join_to_view_messages_in_this_channel"}}

					{{/unless}}

							{{#if canPreview}}
								{{#if hasMore}}

										{{#if isLoading}}
											{{> loading}}
										{{/if}}

								{{else}}

										{{_ "Start_of_conversation"}}

								{{/if}}
							{{/if}}
							{{#each messagesHistory}}
								{{#nrr nrrargs 'message' .}}{{/nrr}}
							{{/each}}
							{{#if hasMoreNext}}

									{{#if isLoading}}
										{{> loading}}
									{{/if}}

							{{/if}}

					{{> messageBox}}

Copyright © NTUH. All rights reserved.

			{{#with flexData}}
				{{> flexTabBar}}
			{{/with}}

</template>


text:
package com.google.api.client.googleapis.testing.auth.oauth2;

import com.google.api.client.googleapis.auth.oauth2.GoogleCredential;
import com.google.api.client.http.HttpExecuteInterceptor;
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.json.Json;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.jackson2.JacksonFactory;
import com.google.api.client.testing.http.MockHttpTransport;
import com.google.api.client.testing.http.MockLowLevelHttpRequest;
import com.google.api.client.testing.http.MockLowLevelHttpResponse;
import com.google.api.client.util.Beta;
import com.google.api.client.util.Clock;

import java.io.IOException;

/**
 * {@link Beta}

 * Mock for {@link GoogleCredential}.
 *
 * @since 1.20
 */
@Beta
public class MockGoogleCredential extends GoogleCredential {
  public static final String ACCESS_TOKEN = "access_xyz";
  public static final String REFRESH_TOKEN = "refresh123";
  private static final String EXPIRES_IN_SECONDS = "3600";
  private static final String TOKEN_TYPE = "Bearer";
  private static final String TOKEN_RESPONSE = "{"
      +   "\"access_token\": \"%s\", "
      +   "\"expires_in\":  %s, "
      +   "\"refresh_token\": \"%s\", "
      +   "\"token_type\": \"%s\""
      + "}";

  private static final String DEFAULT_TOKEN_RESPONSE_JSON = String.format(TOKEN_RESPONSE,
      ACCESS_TOKEN, EXPIRES_IN_SECONDS, REFRESH_TOKEN, TOKEN_TYPE);

  public MockGoogleCredential(Builder builder) {
    super(builder);
  }

  /**
   * Mock for GoogleCredential.Builder.
   *
   *
Setters that are necessary for simple {@link GoogleCredential} creation are overridden in
   * order to change the return type. A concrete {@link JsonFactory} is set by default, since JSON
   * parsing is relied upon often in GoogleCredential which makes mocking parse calls problematic.
   *

   *
   *
By default, a standard {@link MockHttpTransport} is supplied. For simple tests in which
   * 'refresh' methods are called but the request/response isn't used
   * {@link #newMockHttpTransportWithSampleTokenResponse()} provides a minimal implementation. For
   * more complex tests which check request/response behavior prefer MockTokenServerTransport.

   */
  @Beta
  public static class Builder extends GoogleCredential.Builder {
    @Override
    public Builder setTransport(HttpTransport transport) {
      return (MockGoogleCredential.Builder) super.setTransport(transport);
    }

    @Override
    public Builder setClientAuthentication(HttpExecuteInterceptor clientAuthentication) {
      return (MockGoogleCredential.Builder) super.setClientAuthentication(clientAuthentication);
    }

    @Override
    public Builder setJsonFactory(JsonFactory jsonFactory) {
      return (MockGoogleCredential.Builder) super.setJsonFactory(jsonFactory);
    }

    @Override
    public Builder setClock(Clock clock) {
      return (MockGoogleCredential.Builder) super.setClock(clock);
    }

    @Override
    public MockGoogleCredential build() {
      if (getTransport() == null) {
        setTransport(new MockHttpTransport.Builder().build());
      }
      if (getClientAuthentication() == null) {
        setClientAuthentication(new MockClientAuthentication());
      }
      if (getJsonFactory() == null) {
        setJsonFactory(new JacksonFactory());
      }
      return new MockGoogleCredential(this);
    }
  }

 /**
  * Returns a new {@link MockHttpTransport} with a sample {@link MockLowLevelHttpResponse}. The
  * response includes sample TokenResponse content as specified in DEFAULT_TOKEN_RESPONSE_JSON. This
  * is meant to produce a minimal implementation that allows methods such as
  * {@link GoogleCredential#executeRefreshToken()} to be called without failing abruptly. This
  * content is static. If you are making assertions based on the content of the request, then
  * MockTokenServerTransport should be used instead.
  *
  * @return mockHttpTransport
  */
  public static MockHttpTransport newMockHttpTransportWithSampleTokenResponse() {
    MockLowLevelHttpResponse mockLowLevelHttpResponse = new MockLowLevelHttpResponse()
       .setContentType(Json.MEDIA_TYPE)
       .setContent(DEFAULT_TOKEN_RESPONSE_JSON);
    MockLowLevelHttpRequest request = new MockLowLevelHttpRequest()
        .setResponse(mockLowLevelHttpResponse);
    return new MockHttpTransport.Builder()
        .setLowLevelHttpRequest(request)
        .build();
  }

  /**
   * Mock for ClientAuthentication.
   */
  @Beta
  private static class MockClientAuthentication implements HttpExecuteInterceptor {
    @Override
    public void intercept(HttpRequest request) throws IOException {
      // pass
    }
  }
}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.ComponentModel.Composition;
using Microsoft.CodeAnalysis.Editor.Host;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.VisualStudio.Language.Intellisense;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Utilities;

namespace Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.QuickInfo
{
    [ContentType(ContentTypeNames.RoslynContentType)]
    [Export(typeof(IAsyncQuickInfoSourceProvider))]
    [Name("RoslynQuickInfoProvider")]
    internal partial class QuickInfoSourceProvider : IAsyncQuickInfoSourceProvider
    {
        private readonly Lazy<IStreamingFindUsagesPresenter> _streamingPresenter;

        [ImportingConstructor]
        [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
        public QuickInfoSourceProvider(Lazy<IStreamingFindUsagesPresenter> streamingPresenter)
        {
            _streamingPresenter = streamingPresenter;
        }

        public IAsyncQuickInfoSource TryCreateQuickInfoSource(ITextBuffer textBuffer)
        {
            return new QuickInfoSource(textBuffer, _streamingPresenter);
        }
    }
}


text:
#pragma once
#ifndef CTEST_COMMON_H
#define CTEST_COMMON_H

#ifdef __APPLE__
#include <Opencl/cl.h>
#else
#include <CL/cl.h>
#endif

#ifndef CTEST_RNG_TYPE
#error "CTEST_RNG_TYPE undefined"
#endif

#ifndef CTEST_RNG_HEADER
#error "CTEST_RNG_HEADER undefined"
#endif

#define RNG_HOST_HEADER   <CTEST_RNG_HEADER.h>
#define RNG_DEVICE_HEADER <CTEST_RNG_HEADER.clh>

#define _RNG_MANGLE(ident)          _RNG_MANGLE_(ident,CTEST_RNG_TYPE)
#define _RNG_MANGLE_(ident,rng)     _RNG_MANGLE__(ident,rng)
#define _RNG_MANGLE__(ident,rng)    clrng ## rng ## ident

#define CTEST_MANGLE(ident)        CTEST_MANGLE_(ident,CTEST_RNG_TYPE)
#define CTEST_MANGLE_(ident,rng)   CTEST_MANGLE__(ident,rng)
#define CTEST_MANGLE__(ident,rng)  ctest ## rng ## _ ## ident

#define CTEST_MANGLE_PREC(ident,fp)        CTEST_MANGLE_PREC_(ident,CTEST_RNG_TYPE,fp)
#define CTEST_MANGLE_PREC_(ident,rng,fp)   CTEST_MANGLE_PREC__(ident,rng,fp)
#define CTEST_MANGLE_PREC__(ident,rng,fp)  ctest ## rng ## _ ## fp ## _ ## ident

#ifdef CLRNG_SINGLE_PRECISION
#define CTEST_MANGLE_PREC2(ident)   CTEST_MANGLE_PREC_(ident,CTEST_RNG_TYPE,float)
#define write_array		    write_array_cl_float
typedef cl_float fp_type;
#define DEVICE_FP_TYPE		    "float"
#else
#define CTEST_MANGLE_PREC2(ident)  CTEST_MANGLE_PREC_(ident,CTEST_RNG_TYPE,double)
#define write_array		    write_array_cl_double
typedef cl_double fp_type;
#define DEVICE_FP_TYPE		    "double"
#endif

// utility macro
#define CTEST_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))

// for size types
#if defined(_MSC_VER) || defined(__MINGW32__)
    #define SIZE_T_FORMAT   "Iu"
#elif defined(__GNUC__)
    #define SIZE_T_FORMAT   "zu"
#else
    #define SIZE_T_FORMAT   "lu"
#endif

#define _CTEST_STR_(x)  _CTEST_STR__(x)
#define _CTEST_STR__(x) #x

#define RNG_TYPE_S          _CTEST_STR_(CTEST_RNG_TYPE)
#define RNG_DEVICE_HEADER_S _CTEST_STR_(RNG_DEVICE_HEADER)

#define clrngStreamState                _RNG_MANGLE(StreamState)
#define clrngStream                     _RNG_MANGLE(Stream)
#define clrngStreamCreator              _RNG_MANGLE(StreamCreator)
#define clrngCopyStreamCreator          _RNG_MANGLE(CopyStreamCreator)
#define clrngDestroyStreamCreator       _RNG_MANGLE(DestroyStreamCreator)
#define clrngRewindStreamCreator        _RNG_MANGLE(RewindStreamCreator)
#define clrngSetBaseCreatorState        _RNG_MANGLE(SetBaseCreatorState)
#define clrngChangeStreamsSpacing       _RNG_MANGLE(ChangeStreamsSpacing)
#define clrngAllocStreams               _RNG_MANGLE(AllocStreams)
#define clrngDestroyStreams             _RNG_MANGLE(DestroyStreams)
#define clrngCreateStreams              _RNG_MANGLE(CreateStreams)
#define clrngCreateOverStreams          _RNG_MANGLE(CreateOverStreams)
#define clrngCopyStreams                _RNG_MANGLE(CopyStreams)
#define clrngCopyOverStreams            _RNG_MANGLE(CopyOverStreams)
#define clrngRandomU01                  _RNG_MANGLE(RandomU01)
#define clrngRandomInteger              _RNG_MANGLE(RandomInteger)
#define clrngRandomU01Array             _RNG_MANGLE(RandomU01Array)
#define clrngRandomIntegerArray         _RNG_MANGLE(RandomIntegerArray)
#define clrngRewindStreams              _RNG_MANGLE(RewindStreams)
#define clrngRewindSubstreams           _RNG_MANGLE(RewindSubstreams)
#define clrngForwardToNextSubstreams    _RNG_MANGLE(ForwardToNextSubstreams)
#define clrngMakeSubstreams             _RNG_MANGLE(MakeSubstreams)
#define clrngMakeOverSubstreams         _RNG_MANGLE(MakeOverSubstreams)
#define clrngAdvanceStreams             _RNG_MANGLE(AdvanceStreams)
#define clrngDeviceRandomU01Array       _RNG_MANGLE(DeviceRandomU01Array)
#define clrngWriteStreamInfo            _RNG_MANGLE(WriteStreamInfo)

#include RNG_HOST_HEADER

// defined in ctest_cli.c
extern int ctestVerbose;

#endif


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Composition;
using Microsoft.CodeAnalysis.Completion;
using Microsoft.CodeAnalysis.Completion.Providers;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.LanguageServer.Handler.Completion;
using Microsoft.CodeAnalysis.Options;

namespace Microsoft.CodeAnalysis.LanguageServer.Handler
{
    [ExportRoslynLanguagesLspRequestHandlerProvider(typeof(CompletionHandler), typeof(CompletionResolveHandler)), Shared]
    internal class CompletionHandlerProvider : IRequestHandlerProvider
    {
        private readonly IEnumerable<Lazy<CompletionProvider, CompletionProviderMetadata>> _completionProviders;
        private readonly IGlobalOptionService _globalOptions;

        [ImportingConstructor]
        [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
        public CompletionHandlerProvider(
            IGlobalOptionService globalOptions,
            [ImportMany] IEnumerable<Lazy<CompletionProvider, CompletionProviderMetadata>> completionProviders)
        {
            _globalOptions = globalOptions;
            _completionProviders = completionProviders;
        }

        public ImmutableArray<IRequestHandler> CreateRequestHandlers(WellKnownLspServerKinds serverKind)
        {
            var completionListCache = new CompletionListCache();
            return ImmutableArray.Create<IRequestHandler>(
                new CompletionHandler(_globalOptions, _completionProviders, completionListCache),
                new CompletionResolveHandler(_globalOptions, completionListCache));
        }
    }
}


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

package org.apache.flex.compiler.tools.problems;

import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;

import java.io.File;
import java.io.PrintWriter;

/**
 * Goal which touches a timestamp file.
 */
@Mojo(name="generate-problems-enum",defaultPhase = LifecyclePhase.GENERATE_SOURCES)
public class ProblemEnumGeneratorMojo
    extends BaseProblemGeneratorMojo
{
    @Parameter(defaultValue="${project.basedir}/src/main/java/org/apache/flex/compiler/problems",
            property="inputDir", required=true)
    private File inputDirectory;

    @Parameter(defaultValue="${project.build.directory}/generated-sources/build-tools",
            property="outputDir", required=true)
    private File outputDirectory;

    @Parameter(defaultValue="org/apache/flex/compiler/problems/ProblemID.java",
            property="outputFile", required=true)
    private String outputFile;

    @Parameter(defaultValue="${project}")
    private MavenProject project;

    @Override
    protected File getInputDirectory() {
        return inputDirectory;
    }

    @Override
    protected File getOutputDirectory() {
        return outputDirectory;
    }

    @Override
    protected String getOutputFile() {
        return outputFile;
    }

    @Override
    public void execute() throws MojoExecutionException {
        super.execute();

        // Add the output directory to the source path.
        project.addCompileSourceRoot(outputDirectory.getPath());
    }

    @Override
    protected void printHeader(PrintWriter writer) {
        writer.println("/*");
        writer.println(" *  Licensed to the Apache Software Foundation (ASF) under one or more");
        writer.println(" *  contributor license agreements.  See the NOTICE file distributed with");
        writer.println(" *  this work for additional information regarding copyright ownership.");
        writer.println(" *  The ASF licenses this file to You under the Apache License, Version 2.0");
        writer.println(" *  (the \"License\"); you may not use this file except in compliance with");
        writer.println(" *  the License.  You may obtain a copy of the License at");
        writer.println();
        writer.println(" *      http://www.apache.org/licenses/LICENSE-2.0");
        writer.println();
        writer.println(" *  Unless required by applicable law or agreed to in writing, software");
        writer.println(" *  distributed under the License is distributed on an \"AS IS\" BASIS,");
        writer.println(" *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.");
        writer.println(" *  See the License for the specific language governing permissions and");
        writer.println(" *  limitations under the License.");
        writer.println(" */");
        writer.println();
        writer.println("package org.apache.flex.compiler.problems;");
        writer.println();
        writer.println("import java.util.EnumSet;");
        writer.println("import com.google.common.collect.ImmutableMap;");
        writer.println();
        writer.println("public enum ProblemID");
        writer.println("{");
    }

    @Override
    protected void printEntry(PrintWriter writer, File source, boolean last) {
        writer.println("    " + getProblemEnumEntry(source.getName()) + (last ? ";" : ","));
    }

    @Override
    protected void printFooter(PrintWriter writer) {
        writer.println();
        writer.println("    private ProblemID(Class<? extends CompilerProblem> problemClass)");
        writer.println("    {");
        writer.println("        this.problemClass = problemClass;");
        writer.println("    }");
        writer.println();
        writer.println("    private final Class<? extends CompilerProblem> problemClass;");
        writer.println("    public final Class<? extends CompilerProblem> getProblemClass()");
        writer.println("    {");
        writer.println("        return problemClass;");
        writer.println("    }");
        writer.println();
        writer.println("    public static final ProblemID getID(ICompilerProblem problem)");
        writer.println("    {");
        writer.println("        final CompilerProblem problemImpl = (CompilerProblem)problem;");
        writer.println("        return classToIDMap.get(problemImpl.getClass());");
        writer.println("    }");
        writer.println();
        writer.println("    public static final ProblemID getID(Class<?> problemClass)");
        writer.println("    {");
        writer.println("        return classToIDMap.get(problemClass);");
        writer.println("    }");
        writer.println();
        writer.println("    private static final ImmutableMap<Class<? extends CompilerProblem>, ProblemID> classToIDMap = createClassToIDMap();");
        writer.println("    private static ImmutableMap<Class<? extends CompilerProblem>, ProblemID> createClassToIDMap()");
        writer.println("    {");
        writer.println("        final ImmutableMap.Builder<Class<? extends CompilerProblem>, ProblemID> builder = new ImmutableMap.Builder<Class<? extends CompilerProblem>, ProblemID>();");
        writer.println("        for (ProblemID id : EnumSet.allOf(ProblemID.class))");
        writer.println("            builder.put(id.getProblemClass(), id);");
        writer.println("        return builder.build();");
        writer.println("    }");
        writer.println("}");
    }

    private static String getProblemEnumEntry(String problemClassName) {
        String problemTypeName = problemClassName.substring(0, problemClassName.length() - "class".length());
        String enumConstantName = getEnumName(problemTypeName.replaceAll("Problem$", ""));
        return enumConstantName + "(" + problemTypeName + ".class" + ")";
    }

    private static String getEnumName(String problemTypeName) {
        return "PROBLEM_" + problemTypeName;
    }

    @Override
    protected void clean(File outputFile) throws MojoExecutionException {
        // If the file already exists, delete it before generating output.
        if(outputFile.exists()) {
            if(!outputFile.delete()) {
                throw new MojoExecutionException("Could not clear previously created file: " + outputFile.getPath());
            }
        }
    }

}


text:
<?xml version="1.0"?>
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
        <parameter key="zicht_page.page_url_provider.class">Zicht\Bundle\PageBundle\Url\PageUrlProvider</parameter>
        <parameter key="zicht_page.admin.event_propagation_builder.class">Zicht\Bundle\PageBundle\AdminMenu\EventPropagationBuilder</parameter>
        <parameter key="zicht_bundle_page.admin_menu.translate_page_event_propagation_builder.class">Zicht\Bundle\PageBundle\AdminMenu\TranslatePageEventPropagationBuilder</parameter>
        <parameter key="zicht_page.page_manager_subscriber.class">Zicht\Bundle\PageBundle\Manager\Doctrine\Subscriber</parameter>
        <parameter key="zicht_page.form.type.zicht_content_item_type_type.class">Zicht\Bundle\PageBundle\Type\ContentItemTypeType</parameter>
        <parameter key="zicht_page.form.type.zicht_content_item_region_type.class">Zicht\Bundle\PageBundle\Type\ContentItemRegionType</parameter>
        <parameter key="main.form.type.zicht_discriminator_map_type.class">Zicht\Bundle\PageBundle\Type\DiscriminatorMapType</parameter>
        <parameter key="zicht_page.page_manager.class">Zicht\Bundle\PageBundle\Manager\PageManager</parameter>
        <parameter key="zicht_page.security.authorization.voter.page_voter.class">Zicht\Bundle\PageBundle\Security\Voter\PageVoter</parameter>
        <parameter key="zicht_page.security.authorization.voter.scheduled_content_voter.class">Zicht\Bundle\PageBundle\Security\Voter\ScheduledContentVoter</parameter>
        <parameter key="zicht_page.validator.content_item_matrix_validator.class">Zicht\Bundle\PageBundle\Validator\Constraints\ContentItemMatrixValidator</parameter>
        <parameter key="zicht_page.controller.view_validator.class">Zicht\Bundle\PageBundle\Security\PageViewValidation</parameter>
    </parameters>
    <services>
        <service id="zicht_page.page_url_provider" class="%zicht_page.page_url_provider.class%">
            <argument type="service" id="router"/>
            <argument type="service" id="zicht_page.page_manager"/>
            <tag name="zicht_url.url_provider"/>
        </service>
        <service id="zicht_page.page_manager_subscriber" class="%zicht_page.page_manager_subscriber.class%">
            <argument type="service" id="zicht_page.page_manager"/>
            <tag name="doctrine.event_subscriber"/>
        </service>
        <service id="zicht_page.form.type.zicht_content_item_type_type" class="%zicht_page.form.type.zicht_content_item_type_type.class%">
            <argument/>
            <argument type="service" id="translator"/>
            <argument type="service" id="sonata.admin.pool" on-invalid="null" />
            <tag name="form.type" alias="zicht_content_item_type"/>
        </service>
        <service id="zicht_page.form.type.zicht_content_item_region_type" class="%zicht_page.form.type.zicht_content_item_region_type.class%">
            <argument/>
            <argument/>
            <argument type="service" id="translator" />
            <tag name="form.type" alias="zicht_content_item_region"/>
        </service>
        <service id="main.form.type.zicht_discriminator_map_type" class="%main.form.type.zicht_discriminator_map_type.class%">
            <argument type="service" id="doctrine"/>
            <tag name="form.type" alias="zicht_discriminator_map"/>
        </service>
        <service id="zicht_page.admin.event_propagation_builder" class="%zicht_page.admin.event_propagation_builder.class%">
            <argument type="service" id="sonata.admin.pool" on-invalid="null" />
            <argument type="service" id="zicht_url.provider" on-invalid="null" />
            <argument type="service" id="event_dispatcher"/>
            <tag name="zicht_admin.event_propagation" event="zicht_page.view"/>
        </service>
        <service id="zicht_bundle_page.admin_menu.translate_page_event_propagation_builder" class="%zicht_bundle_page.admin_menu.translate_page_event_propagation_builder.class%">
            <argument type="service" id="router" on-invalid="null"/>
            <argument type="service" id="event_dispatcher"/>
            <tag name="zicht_admin.event_propagation" event="zicht_page.view"/>
        </service>
        <service id="zicht_page.page_manager" class="%zicht_page.page_manager.class%" public="true">
            <argument type="service" id="doctrine"/>
            <argument type="service" id="event_dispatcher"/>
            <argument/>
            <argument/>
        </service>
        <service id="Zicht\Bundle\PageBundle\Manager\PageManager" alias="zicht_page.page_manager" public="true"/>
        <service id="zicht_page.security.authorization.voter.page_voter" class="%zicht_page.security.authorization.voter.page_voter.class%" public="false">
            <tag name="security.voter" />
        </service>
        <service id="zicht_page.security.authorization.voter.scheduled_content_voter" class="%zicht_page.security.authorization.voter.scheduled_content_voter.class%" public="false">
            <tag name="security.voter" />
        </service>
        <service id="zicht_page.validator.content_item_matrix_validator" class="%zicht_page.validator.content_item_matrix_validator.class%">
            <tag name="validator.constraint_validator" alias="zicht_page.validator.content_item_matrix_validator" />
            <argument type="service" id="translator"/>
        </service>
        <service id="zicht_page.controller.view_validator" class="%zicht_page.controller.view_validator.class%" public="true">
            <argument type="service" id="security.authorization_checker" on-invalid="null"/>
        </service>
        <service id="Zicht\Bundle\PageBundle\Security\PageViewValidation" alias="zicht_page.controller.view_validator"/>

        <service id="Zicht\Bundle\PageBundle\Command\CheckContentItemsCommand">
            <tag name="console.command"/>
            <argument type="service" id="doctrine"/>
        </service>

        <service id="Zicht\Bundle\PageBundle\Command\ListCommand">
            <tag name="console.command"/>
            <argument type="service" id="zicht_page.page_manager"/>
            <argument type="service" id="zicht_url.provider"/>
        </service>

        <service id="Zicht\Bundle\PageBundle\Event\AdminObjectDuplicateListener">
            <tag name="kernel.event_listener" event="zicht_admin.object_duplicate"/>
        </service>

        <service id="Zicht\Bundle\PageBundle\Controller\DebugPagesController">
            <argument type="service" id="doctrine.orm.entity_manager"/>
        </service>

        <prototype namespace="Zicht\Bundle\PageBundle\Controller\" resource="../../Controller/" autowire="true" public="true">
            <tag name="controller.service_arguments" />
            <tag name="container.service_subscriber" />
            <call method="setContainer">
                <argument type="service" id="Psr\Container\ContainerInterface" />
            </call>
        </prototype>
    </services>
</container>


text:
"""Support for FRITZ!Box routers."""
from __future__ import annotations

import logging

import voluptuous as vol

from homeassistant.components.device_tracker import (
    DOMAIN as DEVICE_TRACKER_DOMAIN,
    PLATFORM_SCHEMA as PARENT_PLATFORM_SCHEMA,
    SOURCE_TYPE_ROUTER,
)
from homeassistant.components.device_tracker.config_entry import ScannerEntity
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import HomeAssistant, callback
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.typing import ConfigType

from .common import FritzBoxTools, FritzDevice
from .const import DATA_FRITZ, DEFAULT_DEVICE_NAME, DOMAIN

_LOGGER = logging.getLogger(__name__)

YAML_DEFAULT_HOST = "169.254.1.1"
YAML_DEFAULT_USERNAME = "admin"

PLATFORM_SCHEMA = vol.All(
    cv.deprecated(CONF_HOST),
    cv.deprecated(CONF_USERNAME),
    cv.deprecated(CONF_PASSWORD),
    PARENT_PLATFORM_SCHEMA.extend(
        {
            vol.Optional(CONF_HOST, default=YAML_DEFAULT_HOST): cv.string,
            vol.Optional(CONF_USERNAME, default=YAML_DEFAULT_USERNAME): cv.string,
            vol.Optional(CONF_PASSWORD): cv.string,
        }
    ),
)

async def async_get_scanner(hass: HomeAssistant, config: ConfigType):
    """Import legacy FRITZ!Box configuration."""
    _LOGGER.debug("Import legacy FRITZ!Box configuration from YAML")

    hass.async_create_task(
        hass.config_entries.flow.async_init(
            DOMAIN,
            context={"source": SOURCE_IMPORT},
            data=config[DEVICE_TRACKER_DOMAIN],
        )
    )

    _LOGGER.warning(
        "Your Fritz configuration has been imported into the UI, "
        "please remove it from configuration.yaml. "
        "Loading Fritz via scanner setup is now deprecated"
    )

    return None

async def async_setup_entry(
    hass: HomeAssistant, entry: ConfigEntry, async_add_entities
) -> None:
    """Set up device tracker for FRITZ!Box component."""
    _LOGGER.debug("Starting FRITZ!Box device tracker")
    router = hass.data[DOMAIN][entry.entry_id]
    data_fritz = hass.data[DATA_FRITZ]

    @callback
    def update_router():
        """Update the values of the router."""
        _async_add_entities(router, async_add_entities, data_fritz)

    entry.async_on_unload(
        async_dispatcher_connect(hass, router.signal_device_new, update_router)
    )

    update_router()

@callback
def _async_add_entities(router, async_add_entities, data_fritz):
    """Add new tracker entities from the router."""

    def _is_tracked(mac, device):
        for tracked in data_fritz.tracked.values():
            if mac in tracked:
                return True

        return False

    new_tracked = []
    if router.unique_id not in data_fritz.tracked:
        data_fritz.tracked[router.unique_id] = set()

    for mac, device in router.devices.items():
        if device.ip_address == "" or _is_tracked(mac, device):
            continue

        new_tracked.append(FritzBoxTracker(router, device))
        data_fritz.tracked[router.unique_id].add(mac)

    if new_tracked:
        async_add_entities(new_tracked)

class FritzBoxTracker(ScannerEntity):
    """This class queries a FRITZ!Box router."""

    def __init__(self, router: FritzBoxTools, device: FritzDevice) -> None:
        """Initialize a FRITZ!Box device."""
        self._router = router
        self._mac = device.mac_address
        self._name = device.hostname or DEFAULT_DEVICE_NAME
        self._last_activity = device.last_activity
        self._active = False
        self._attrs: dict = {}

    @property
    def is_connected(self):
        """Return device status."""
        return self._active

    @property
    def name(self):
        """Return device name."""
        return self._name

    @property
    def unique_id(self):
        """Return device unique id."""
        return self._mac

    @property
    def ip_address(self) -> str:
        """Return the primary ip address of the device."""
        return self._router.devices[self._mac].ip_address

    @property
    def mac_address(self) -> str:
        """Return the mac address of the device."""
        return self._mac

    @property
    def hostname(self) -> str:
        """Return hostname of the device."""
        return self._router.devices[self._mac].hostname

    @property
    def source_type(self) -> str:
        """Return tracker source type."""
        return SOURCE_TYPE_ROUTER

    @property
    def device_info(self):
        """Return the device information."""
        return {
            "connections": {(CONNECTION_NETWORK_MAC, self._mac)},
            "identifiers": {(DOMAIN, self.unique_id)},
            "default_name": self.name,
            "default_manufacturer": "AVM",
            "default_model": "FRITZ!Box Tracked device",
            "via_device": (
                DOMAIN,
                self._router.unique_id,
            ),
        }

    @property
    def should_poll(self) -> bool:
        """No polling needed."""
        return False

    @property
    def icon(self):
        """Return device icon."""
        if self.is_connected:
            return "mdi:lan-connect"
        return "mdi:lan-disconnect"

    @property
    def entity_registry_enabled_default(self) -> bool:
        """Return if the entity should be enabled when first added to the entity registry."""
        return False

    @property
    def extra_state_attributes(self) -> dict[str, str]:
        """Return the attributes."""
        attrs: dict[str, str] = {}
        if self._last_activity is not None:
            attrs["last_time_reachable"] = self._last_activity.isoformat(
                timespec="seconds"
            )
        return attrs

    @callback
    def async_process_update(self) -> None:
        """Update device."""
        device: FritzDevice = self._router.devices[self._mac]
        self._active = device.is_connected
        self._last_activity = device.last_activity

    @callback
    def async_on_demand_update(self):
        """Update state."""
        self.async_process_update()
        self.async_write_ha_state()

    async def async_added_to_hass(self):
        """Register state update callback."""
        self.async_process_update()
        self.async_on_remove(
            async_dispatcher_connect(
                self.hass,
                self._router.signal_device_update,
                self.async_on_demand_update,
            )
        )


text:
'use strict';

import * as assert from 'assert';
import * as fs from 'fs';
import * as os from 'os';
import {workspace, window, Position, Range} from 'vscode';
import {createRandomFile, deleteFile, cleanUp} from './utils';
import {join} from 'path';

suite("editor tests", () => {

	teardown(cleanUp);

	test('make edit', () => {
		return createRandomFile().then(file => {
			return workspace.openTextDocument(file).then(doc => {
				return window.showTextDocument(doc).then((editor) => {
					return editor.edit((builder) => {
						builder.insert(new Position(0, 0), 'Hello World');
					}).then(applied => {
						assert.ok(applied);
						assert.equal(doc.getText(), 'Hello World');
						assert.ok(doc.isDirty);

						return doc.save().then(saved => {
							assert.ok(saved);
							assert.ok(!doc.isDirty);

							return deleteFile(file);
						});
					});
				});
			});
		});
	});

	test('issue #6281: Edits fail to validate ranges correctly before applying', () => {
		return createRandomFile('Hello world!').then(file => {
			return workspace.openTextDocument(file).then(doc => {
				return window.showTextDocument(doc).then((editor) => {
					return editor.edit((builder) => {
						builder.replace(new Range(0, 0, Number.MAX_VALUE, Number.MAX_VALUE), 'new');
					}).then(applied => {
						assert.ok(applied);
						assert.equal(doc.getText(), 'new');
						assert.ok(doc.isDirty);

						return doc.save().then(saved => {
							assert.ok(saved);
							assert.ok(!doc.isDirty);

							return deleteFile(file);
						});
					});
				});
			});
		});
	});
});


text:
import { FS } from 'grind-support'
import { codeFrameColumns } from '@babel/code-frame'

const path = require('path')

export async function makeSyntaxError(
	app,
	{ message, fileName, lineNumber, columnNumber, causedBy } = {},
) {
	if (!causedBy.isNil) {
		if (typeof message !== 'string') {
			message = causedBy.message
		}

		if (typeof fileName !== 'string') {
			fileName = causedBy.fileName || causedBy.filename || causedBy.file
		}

		if (typeof lineNumber !== 'number') {
			lineNumber = causedBy.lineNumber || causedBy.line
		}

		if (typeof columnNumber !== 'number') {
			columnNumber = causedBy.columnNumber || causedBy.column
		}
	}

	if (
		typeof fileName !== 'string' ||
		typeof lineNumber !== 'number' ||
		lineNumber <= 0 ||
		!(await FS.exists(fileName))
	) {
		return causedBy || new SyntaxError(message)
	}

	const lines = (await FS.readFile(fileName)).toString()
	const codeFrame = codeFrameColumns(
		lines,
		{
			start: {
				line: lineNumber || 1,
				column: columnNumber || 1,
			},
		},
		{
			highlightCode: true,
			forceColor: true,
		},
	)

	const relativeFileName = `./${path.relative(app.paths.base(), fileName)}`
	const error = new SyntaxError(
		`${relativeFileName}\nLine ${lineNumber}: ${message}\n\n${codeFrame}`,
		fileName,
		lineNumber,
	)

	error.cause = causedBy

	return error
}


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>Backoffice</title>
    <link href="/assets/backoffice/css/bootstrap.min.css" rel="stylesheet">
    <link href="/assets/backoffice/css/metisMenu/metisMenu.min.css" rel="stylesheet">
    <link href="/assets/backoffice/css/timeline.css" rel="stylesheet">
    <link href="/assets/backoffice/css/backoffice/sb-admin-2.css" rel="stylesheet">
    <link href="/assets/backoffice/css/morrisjs/morris.css" rel="stylesheet">
    <link href="/assets/backoffice/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <link href="/assets/backoffice/css/backoffice/dataTables.bootstrap.css" rel="stylesheet">

    <link href="/assets/backoffice/css/backoffice/dataTables.responsive.css" rel="stylesheet">

        <?php
echo $head;
?>

Malls

                            Malls

                                            Name
                                            Address
                                            City
                                            Delete

                                      <?php foreach ($malls as $key => $value) { ?>

                                            <?php echo $value['name']; ?>
                                            <?php echo $value['address']; ?>
                                            <?php echo $value['city']; ?>
                                            <a href="/backoffice/delete/malls/<?php echo $value['id'] ?>" title="Delete" class="btn btn-default delete">Delete

                                      <?php } ?>

            <button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
                                Add Mall
                            </button>

            <form action="/backoffice/addMall" method="post">

                                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

Add a New Mall

                                            Mall Name
                                            <input type="text" class="form-control" name="name">

                                            Mall Address
                                            <input type="text" class="form-control" name="address">

                                            Mall City
                                            <select class="form-control" name="city">
                                              <option value="New Delhi">New Delhi</option>
                                              <option value="Noida">Noida</option>
                                              <option value="Ghaziabad">Ghaziabad</option>
                                              <option value="Greater Noida">Greater Noida</option>
                                              <option value="Faridabad">Faridabad</option>
                                              <option value="Gurgaon">Gurgaon</option>
                                            </select>

                                            <input type="hidden" name="<?php echo $csrf_token_name ?>" value="<?php echo $csrf_token ?>">
                                            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                                            <button type="submit" class="btn btn-primary">Add Mall</button>

                           </form>


text:
require "codeclimate-test-reporter"
CodeClimate::TestReporter.start
require 'coveralls'
Coveralls.wear!

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
  CodeClimate::TestReporter::Formatter,
  Coveralls::SimpleCov::Formatter
]

ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'

class ActiveSupport::TestCase
  # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
  # fixtures :all

  # Add more helper methods to be used by all tests here...
end

class ActionController::TestCase
  include Devise::TestHelpers
end


text:
using System.Collections.Generic;
using FluentAssertions.Common;

namespace FluentAssertions.Equivalency.Selection;

/// <summary>
/// Selection rule that removes a particular property from the structural comparison.
/// </summary>
internal class ExcludeMemberByPathSelectionRule : SelectMemberByPathSelectionRule
{
    private MemberPath memberToExclude;

    public ExcludeMemberByPathSelectionRule(MemberPath pathToExclude)
        : base(pathToExclude.ToString())
    {
        memberToExclude = pathToExclude;
    }

    protected override void AddOrRemoveMembersFrom(List<IMember> selectedMembers, INode parent, string parentPath,
        MemberSelectionContext context)
    {
        selectedMembers.RemoveAll(member =>
            memberToExclude.IsSameAs(new MemberPath(member, parentPath)));
    }

    public void AppendPath(MemberPath nextPath)
    {
        memberToExclude = memberToExclude.AsParentCollectionOf(nextPath);
        SetSelectedPath(memberToExclude.ToString());
    }

    public override string ToString()
    {
        return "Exclude member " + memberToExclude;
    }
}


text:
import { Component, OnInit } from '@angular/core';
import {Http} from "@angular/http";
import 'rxjs/add/operator/map'
import {PlanetaSWInterface} from "../../Interfaces/PlanetaSWInterface";

@Component({
  selector: 'app-inicio',
  templateUrl: './inicio.component.html',
  styleUrls: ['./inicio.component.css']
})
export class InicioComponent implements OnInit {

  nombre: string = "nombresito";
  arregloUsr=[{
    nombre:"nombrecito1",
    apellido:"apellidito1",
    conectado: true
  },
    {
      nombre:"nombrecito2",
      apellido:"apellidito2",
      conectado: false
    },
    {
      nombre:"nombrecito3",
      apellido:"apellidito3",
      conectado: true
    }];
  cambiarNombre(){
    this.nombre="otro nombresito";
  }

  otroNombre():void{
    this.nombre="un nombre de foco";
  }

  cambiarInput(nombreEtiqueta){
  console.log(nombreEtiqueta.type);
  console.log(nombreEtiqueta.value);
    this.nombre= nombreEtiqueta.value;
}
  planetas: PlanetaSWInterface[];
  constructor(private _http:Http) {
    // Inicia la clase pero el componente no esta listo
  }

  ngOnInit() {
    //Esta listo el componente
  }
  cargarPlanetas() {
    this._http
      .get('http://swapi.co/api/planets')
      // .map(response => response.json())
      .subscribe(
        (reponse) => {
          console.log('Response: ', reponse);
          console.log(reponse.json());
          let repuesta:any = reponse.json();
          console.log(repuesta.next);
          this.planetas = reponse.json().results;
          this.planetas = this.planetas.map(
            (planeta)=>{
              planeta.imagenURL = "/assets/imagenesStarWars" + planeta.name+'.jpg';
              return planeta;
            }
          )
          //Arreglo

        },
        (error) => {
          console.log('Error: ', error);
        },
        () => {
          console.log('Finally');

        }
      );
  }

}


text:
package nu.studer.teamcity.buildscan.internal.slack;

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

final class BuildScanPayload {

    String state;
    Data data;

    Data data() {
        if (data == null) {
            data = new Data();
        }
        return data;
    }

    @Override
    public String toString() {
        return "BuildScanPayload{" +
            "state='" + state + '\'' +
            ", data=" + data +
            '}';
    }

    static final class Data {

        String publicId;
        Summary summary;
        Tests tests;

        Summary summary() {
            if (summary == null) {
                summary = new Summary();
            }
            return summary;
        }

        Tests tests() {
            if (tests == null) {
                tests = new Tests();
            }
            return tests;
        }

        @Override
        public String toString() {
            return "Data{" +
                "publicId='" + publicId + '\'' +
                ", summary=" + summary +
                ", tests=" + tests +
                '}';
        }

        static final class Summary {

            boolean failed;
            long startTime;
            String rootProjectName;
            Identity identity;

            Identity identity() {
                if (identity == null) {
                    identity = new Identity();
                }
                return identity;
            }

            @Override
            public String toString() {
                return "Summary{" +
                    "failed=" + failed +
                    ", startTime=" + startTime +
                    ", rootProjectName='" + rootProjectName + '\'' +
                    ", identity=" + identity +
                    '}';
            }

            static final class Identity {

                String identityName;
                String avatarChecksum;

                @Override
                public String toString() {
                    return "Identity{" +
                        "identityName='" + identityName + '\'' +
                        ", avatarChecksum='" + avatarChecksum + '\'' +
                        '}';
                }

            }

        }

        static final class Tests {

            int numFailed;
            List<Row> rows;

            List<Row> rows() {
                if (rows == null) {
                    rows = new ArrayList<>();
                }
                return rows;
            }

            @Override
            public String toString() {
                return "Tests{" +
                    "numFailed=" + numFailed +
                    ", rows=" + rows +
                    '}';
            }

            static final class Row {

                String id;
                String name;
                String result;

                @Override
                public String toString() {
                    return "Row{" +
                        "id='" + id + '\'' +
                        ", name='" + name + '\'' +
                        ", result='" + result + '\'' +
                        '}';
                }

            }

        }

    }

}


text:
= 11)   document.write('

UPDATED: 8 :31 a.m. PDT, January 20, 2008

  ?

Complete Forecast

|

Home Page

|

Site Index

|

RSS Feeds

|

About Us

|

Contact Us

|

Advertise

NEWS

BIZ

SPORTS

HS SPORTS

FORUMS

BLOGS

VIDEO

ENTERTAINMENT

LIVING

JOBS

AUTOS

REAL ESTATE

CLASSIFIEDS

SHOPPING

OregonLive.com

-

Entertainment

<form action="javascript:void(0)" class="fndart">
<input class="x-nc-invisible">

SEARCH:

<input name="keywords" value="Enter Keyword(s)" type="text">

<input src="http://www.oregonlive.com/images/toprail/gosearch_button.gif" align="absmiddle" height="14" type="image" width="45">

</form>

<dir>

?

14-Day Archives

|

Paid Archives

?

Subscribe

|

Today's Paper & More

</dir>

TOP STORIES

?

Malcolm's father goes bad with rolling meth lab

?

Chasing the dream as we surf the channels

?

Exploiting the underclass for the fun of it

?

More Headlines

BLOGS

Entertainment

?

Portland Art Center to close

6:03 p.m. PT

?

More Entries

Arts & Books

?

Leonard Ruder: Evidence of a life's work

10:38 a.m. PT

?

More Entries

Dining

?

Restaurant Review: Veritable Quandary

10:38 a.m. PT

?

More Entries

Music

?

Movie review: "Pete Seeger: The Power of Song"

2:19 p.m. PT

?

More Entries

Performance

?

At Center Stage, a Bard by any other name would play as such a treat.

7:46 a.m. PT

?

More Entries

TV & Film

?

TV Review: "Breaking Bad"

11:02 a.m. PT

?

More Entries

More Ent. Blogs

<menu>

?

Mad About Movies

?

Idiot Box

?

Pop Music

?

Classical Music

?

Visual Arts

</menu>

?

More Blogs

FORUMS

Movies Forum

?

Good Luck Chuck

by

CHASS

01/16/2008 5:41 a.m. PT

?

Movie quote

by

Stickyfloor

01/15/2008 10:32 p.m. PT

?

ID4

by

FollowChrist

01/16/2008 3:39 p.m. PT

?

More

Hot Topics

<menu>

?

Food & Drink

?

Back Fence

?

Education

?

Gardening

?

Home Improvement

?

Pets

?

Relationships

?

Recipe Swap

?

Shaping Up

?

Travel

?

Women's Issues

</menu>

?

All Forums

|

Highlights

MULTIMEDIA

Entertainment Videos

?

Diner 2007 (6/15/07)

?

Mahler in Pendleton (05/26/07)

?

The real Charis Wilson (3/2/07)

?

More

VIDEO

?

More AP Video

Doin' the

FACTBOX

?

review Cloverfield

Friday, January 18, 2008

SHAWN LEVY

The Oregonian Staff

"Cloverfield" is an old-fashioned film with a newfangled shape.

It's a monster-comes-to-town movie -- you know, "Godzilla," "King Kong," that sort of thing -- but it's composed, like "The Blair Witch Project," of a videotape shot by the victims of the attack.

Like "Blair Witch," "Cloverfield" begins in a light tone and then takes us through a horrendous event in a make-believe version of you-are-there real time. It's a little craftier than that -- there's a framing tale that compels some of the actions our protagonists take -- but by and large it's like a very long YouTube version of the worst day ever, complete with shaky framing, interrupted shots and a cameraman frequently screaming in terror of what he's filming.

The tape, discovered in what a title card refers to as "the area formerly known as Central Park," chiefly records a spring night in lower Manhattan. Rob (Michael Stahl-David) is about to leave for a job in Japan, so his brother Jason (Mike Vogel) and Jason's sweetie, Lily (Jessica Lucas), are throwing him a going-away party. Hud (T.J. Miller), another of the gang, is deputized to film the partygoer's farewells to their friend. Booze, music, hotties of both genders: good times, good times.

The one latecomer is Beth (Odette Yustman), a pillar of the gang who's been out of touch in recent weeks. As we in the audience know, because we've seen the beginning of the tape, Rob and Beth have slept together -- apparently a big deal in their circle. During the party, right in front of Hud's prying video eye, this secret spills into the open and quarrels and recriminations ensue.

And then the thing happens. We're a mile or so from ground zero, remember, so when a tremendous boom shakes the building and fires are visible from the roof and debris comes screaming through the air, everybody runs down to the street -- where they're met with the sickening sight of the head of the Statue of Liberty falling among them like a discarded apple core.

In the mayhem, Hud has captured an image of a gigantic something, and watching buildings collapse and feeling the earth shake, everybody is convinced that Manhattan is no place to be. And then Beth manages to call Rob and announce that she needs help and Rob decides to tempt whatever it is that's out there to go find her. And he and the rest find a very nasty thing -- several very nasty things, actually -- between themselves and safety.

For a short film with a no-name cast and a B-movie premise, "Cloverfield" has some truly fiendish ways of getting under your skin. Obviously there's a massive Sept. 11 allegory at work, with Manhattan once again the target of a bloody and random attack. But there's the sly twist, too, that it's a relationship movie: have sex with one of your chums, it tells us with a wink, and there's no telling what kind of ill mood will arise amid your merry gang.

And then there are the critters. (Close your eyes for the rest of this paragraph if you don't want to spoil the surprise.) Director Matt Reeves uses the venerable method of only gradually revealing his monsters, which turn out to be a really big one that looks like some kind of nuked-up chameleon and a lot of crab-like little ones that fall off big boy like dandruff and glom onto people with vicious speed.

This combination of meanies is a little curious (and not exactly fair play on the monsters' part, let's be honest), but it allows Reeves to stage both big battles (Army vs. gigantic monster) and little skirmishes (our heroes vs. the crab thingies) and to alternate between wide-open spaces (the Brooklyn Bridge, Central Park), claustrophobic spaces (subway tunnels) and frightening make-believe spaces (a pair of high-rise buildings collapsed against one another).

In the midst of all this mayhem and choppy photography -- you might wish you'd mixed in a Dramamine with your popcorn -- acting isn't really a priority. But Miller is agreeably clownish behind the camera (which, ironically, means we see him least), and Lizzy Caplan is continually interesting as a girl who accidentally joins our little band and continually reveals new strengths and resources.

"Cloverfield" isn't quite the smack to the brain that "Blair Witch" was, but it's a sharp and vivid film, filled with moments of tremendous ingenuity and characterized by a persistent avoidance of the expected tropes. It's far scarier than the big-budget remakes of "Godzilla" and "King Kong," more engaging than "I Am Legend," more human than a sackful of slasher films. But if that makes it sound like something you've seen before, rest assured that you haven't.

SHARE THIS STORY

<menu>

Reddit

Digg

del.icio.us

Google

Yahoo

</menu>
<dir class="mdsmall">
?

How Does It Work?

</dir>

SITE TOOLS

<menu>

E-mail This

Print This

Newsletters

</menu>

SPONSORED LINKS

<map name="adv_realcities">
<area class="x-nc-invisible">

<area class="x-nc-invisible">

</map>

Home

|

News

|

Sports

|

Forums

|

Blogs

|

Multimedia

|

Entertainment

|

Jobs

|

Autos

|

Real Estate

|

Classifieds

|

Shopping

Complete Forecast

|

RSS Feeds

|

RSS Terms & Conditions

|

Site Index

|

About Us

|

Contact Us

|

Advertise

|

Help/Feedback

The Oregonian

-

The Oregonian Business Center

|

Hillsboro Argus

© 2007 Oregon Live LLC.  All Rights Reserved.  Use of this site constitutes acceptance of our

User Agreement

,

Privacy Policy

and

Advertising Agreement

.


text:
using System;
using System.Diagnostics;
using System.Globalization;
using System.Runtime.InteropServices;
using System.ComponentModel.Design;
using Microsoft.Win32;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.OLE.Interop;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.ComponentModelHost;

namespace VsShowChars
{
    [PackageRegistration(UseManagedResourcesOnly = true)]
    [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)]
    [ProvideMenuResource("Menus.ctmenu", 1)]
    [Guid(Constants.VsShowCharsPackageString)]
    public sealed class VsShowCharsPackage : Package
    {
        private IVsShowCharsOptions _options;

        public VsShowCharsPackage()
        {

        }

        protected override void Initialize()
        {
            base.Initialize();

            var componentModel = (IComponentModel)GetService(typeof(SComponentModel));
            var exportProvider = componentModel.DefaultExportProvider;
            _options = exportProvider.GetExportedValue<IVsShowCharsOptions>();

            // Add our command handlers for menu (commands must exist in the .vsct file)
            var mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
            if (mcs != null)
            {
                // Create the command for the menu item.
                var viewControlCharsId = new CommandID(Constants.VsShowCharsCommandSetGuid, CommandList.ViewControlChars);
                var viewNewLinesId = new CommandID(Constants.VsShowCharsCommandSetGuid, CommandList.ViewNewLines);
                mcs.AddCommand(new MenuCommand(OnViewControlCharsClick, viewControlCharsId));
                mcs.AddCommand(new MenuCommand(OnViewNewLinesClick, viewNewLinesId));
            }
        }

        private void OnViewControlCharsClick(object sender, EventArgs e)
        {
            _options.EnableControlChars = !_options.EnableControlChars;
        }

        private void OnViewNewLinesClick(object sender, EventArgs e)
        {
            _options.EnableNewLines = !_options.EnableNewLines;
        }
    }
}


text:
'use strict';

/**
 * Module dependencies.
 */
var should = require('should'),
  mongoose = require('mongoose'),
  User = mongoose.model('User'),
  Contactu = mongoose.model('Contactu');

/**
 * Globals
 */
var user,
  contactu;

/**
 * Unit tests
 */
describe('Contactu Model Unit Tests:', function() {
  beforeEach(function(done) {
    user = new User({
      firstName: 'Full',
      lastName: 'Name',
      displayName: 'Full Name',
      email: 'test@test.com',
      username: 'username',
      password: 'password'
    });

    user.save(function() {
      contactu = new Contactu({
        name: 'Contactu Name',
        user: user
      });

      done();
    });
  });

  describe('Method Save', function() {
    it('should be able to save without problems', function(done) {
      this.timeout(0);
      return contactu.save(function(err) {
        should.not.exist(err);
        done();
      });
    });

    it('should be able to show an error when try to save without name', function(done) {
      contactu.name = '';

      return contactu.save(function(err) {
        should.exist(err);
        done();
      });
    });
  });

  afterEach(function(done) {
    Contactu.remove().exec(function() {
      User.remove().exec(function() {
        done();
      });
    });
  });
});


text:
package connproto

import proto "github.com/golang/protobuf/proto"
import json "encoding/json"
import math "math"

// Reference proto, json, and math imports to suppress error if they are not otherwise used.
var _ = proto.Marshal
var _ = &json.SyntaxError{}
var _ = math.Inf

type ConnProto_ProType int32

const (
	ConnProto_CALL  ConnProto_ProType = 1
	ConnProto_ACK   ConnProto_ProType = 2
	ConnProto_HEART ConnProto_ProType = 3
)

var ConnProto_ProType_name = map[int32]string{
	1: "CALL",
	2: "ACK",
	3: "HEART",
}
var ConnProto_ProType_value = map[string]int32{
	"CALL":  1,
	"ACK":   2,
	"HEART": 3,
}

func (x ConnProto_ProType) Enum() *ConnProto_ProType {
	p := new(ConnProto_ProType)
	*p = x
	return p
}
func (x ConnProto_ProType) String() string {
	return proto.EnumName(ConnProto_ProType_name, int32(x))
}
func (x ConnProto_ProType) MarshalJSON() ([]byte, error) {
	return json.Marshal(x.String())
}
func (x *ConnProto_ProType) UnmarshalJSON(data []byte) error {
	value, err := proto.UnmarshalJSONEnum(ConnProto_ProType_value, data, "ConnProto_ProType")
	if err != nil {
		return err
	}
	*x = ConnProto_ProType(value)
	return nil
}

type ConnProto struct {
	Type             *ConnProto_ProType `protobuf:"varint,1,req,enum=connproto.ConnProto_ProType" json:"Type,omitempty"`
	Msgid            *uint64            `protobuf:"fixed64,2,opt" json:"Msgid,omitempty"`
	Ackmsgid         *uint64            `protobuf:"fixed64,3,opt" json:"Ackmsgid,omitempty"`
	Busstype         *int32             `protobuf:"varint,100,opt" json:"Busstype,omitempty"`
	Bussdata         []byte             `protobuf:"bytes,101,opt" json:"Bussdata,omitempty"`
	XXX_unrecognized []byte             `json:"-"`
}

func (m *ConnProto) Reset()         { *m = ConnProto{} }
func (m *ConnProto) String() string { return proto.CompactTextString(m) }
func (*ConnProto) ProtoMessage()    {}

func (m *ConnProto) GetType() ConnProto_ProType {
	if m != nil && m.Type != nil {
		return *m.Type
	}
	return 0
}

func (m *ConnProto) GetMsgid() uint64 {
	if m != nil && m.Msgid != nil {
		return *m.Msgid
	}
	return 0
}

func (m *ConnProto) GetAckmsgid() uint64 {
	if m != nil && m.Ackmsgid != nil {
		return *m.Ackmsgid
	}
	return 0
}

func (m *ConnProto) GetBusstype() int32 {
	if m != nil && m.Busstype != nil {
		return *m.Busstype
	}
	return 0
}

func (m *ConnProto) GetBussdata() []byte {
	if m != nil {
		return m.Bussdata
	}
	return nil
}

func init() {
	proto.RegisterEnum("connproto.ConnProto_ProType", ConnProto_ProType_name, ConnProto_ProType_value)
}


text:
import subprocess

from constants import get_migration_directory, JobStatus
from models import ConvertConfigJob
from multi_process import WorkUnit
import os
import re

NOX_64_BINARY = "nox-linux-64.bin"
NOX_64_MAC = "nox-mac64.bin"

class ConvertConfigWorkUnit(WorkUnit):
    def __init__(self, job_id):
        WorkUnit.__init__(self)

        self.job_id = job_id

    def start(self, db_session, logger, process_name):
        self.db_session = db_session
        try:
            self.convert_config_job = self.db_session.query(ConvertConfigJob).filter(ConvertConfigJob.id ==
                                                                                self.job_id).first()
            if self.convert_config_job is None:
                logger.error('Unable to retrieve convert config job: %s' % self.job_id)
                return

            self.convert_config_job.set_status("Converting the configurations")
            self.db_session.commit()

            file_path = self.convert_config_job.file_path

            nox_to_use = get_migration_directory() + NOX_64_BINARY
            # nox_to_use = get_migration_directory() + NOX_64_MAC
            print "start executing nox conversion..."
            try:
                commands = [subprocess.Popen(["chmod", "+x", nox_to_use]),
                            subprocess.Popen([nox_to_use, "-f", file_path],
                                             stdout=subprocess.PIPE, stderr=subprocess.PIPE)
                            ]

                nox_output, nox_error = commands[1].communicate()
                print "the nox finished its job."
            except OSError:
                self.convert_config_job.set_status(JobStatus.FAILED)
                self.db_session.commit()
                logger.exception("Running the configuration migration tool " +
                                 "{} on config file {} hit OSError.".format(nox_to_use, file_path))

            conversion_successful = False

            if nox_error:
                self.convert_config_job.set_status(JobStatus.FAILED)
                self.db_session.commit()
                logger.exception("Running the configuration migration tool {} ".format(nox_to_use) +
                                 "on config file {} hit error:\n {}".format(file_path, nox_error))

            if re.search("Done \[.*\]", nox_output):
                path = ""
                filename = file_path
                if file_path.count("/") > 0:
                    path_filename = file_path.rsplit("/", 1)
                    path = path_filename[0]
                    filename = path_filename[1]

                converted_filename = filename.rsplit('.', 1)[0] + ".csv"

                if os.path.isfile(os.path.join(path, converted_filename)):
                    self.convert_config_job.set_status(JobStatus.COMPLETED)
                    self.db_session.commit()
                    conversion_successful = True

            if not conversion_successful:
                self.convert_config_job.set_status(JobStatus.FAILED)
                self.db_session.commit()
                logger.exception("Configuration migration tool failed to convert {}".format(file_path) +
                                 ": {}".format(nox_output))

        finally:
            self.db_session.close()

    def get_unique_key(self):
        return 'convert_config_job_{}'.format(self.job_id)


text:
#ifndef __vtkSlicerAstroMomentMapsLogic_h
#define __vtkSlicerAstroMomentMapsLogic_h

// Slicer includes
#include "vtkSlicerModuleLogic.h"
class vtkMRMLVolumeNode;
class vtkSlicerAstroVolumeLogic;

// AstroMomentMapss includes
#include "vtkSlicerAstroMomentMapsModuleLogicExport.h"
class vtkMRMLAstroMomentMapsParametersNode;

/// \class vtkSlicerAstroMomentMapsLogic
/// \brief Create 0th, 1st and 2nd moment maps given a selection or segmentation.
///
/// \ingroup SlicerAstro_QtModules_AstroMomentMaps
class VTK_SLICERASTRO_ASTROMOMENTMAPS_MODULE_LOGIC_EXPORT vtkSlicerAstroMomentMapsLogic
  : public vtkSlicerModuleLogic
{
public:

  static vtkSlicerAstroMomentMapsLogic *New();
  vtkTypeMacro(vtkSlicerAstroMomentMapsLogic,vtkSlicerModuleLogic);
  void PrintSelf(ostream& os, vtkIndent indent) override;

  /// Set AstroVolume module logic
  void SetAstroVolumeLogic(vtkSlicerAstroVolumeLogic* logic);

  /// Get AstroVolume module logic
  vtkSlicerAstroVolumeLogic* GetAstroVolumeLogic();

  /// Register MRML Node classes to Scene.
  /// Gets called automatically when the MRMLScene is attached to this logic class
  virtual void RegisterNodes() override;

  /// Run moment maps calculation algorithm
  /// \param MRML parameter node
  /// \return Success flag
  bool CalculateMomentMaps(vtkMRMLAstroMomentMapsParametersNode *pnode);

protected:
  vtkSlicerAstroMomentMapsLogic();
  virtual ~vtkSlicerAstroMomentMapsLogic();

private:
  vtkSlicerAstroMomentMapsLogic(const vtkSlicerAstroMomentMapsLogic&); // Not implemented
  void operator=(const vtkSlicerAstroMomentMapsLogic&);           // Not implemented

  class vtkInternal;
  vtkInternal* Internal;
};

#endif


text:
namespace gl
{
class Framebuffer;
struct Rectangle;
struct Extents;
struct Box;
struct Offset;
struct ImageIndex;
}

namespace rx
{
class RendererD3D;
class RenderTarget;
class TextureStorage;

class Image
{
  public:
    Image();
    virtual ~Image() {};

    GLsizei getWidth() const { return mWidth; }
    GLsizei getHeight() const { return mHeight; }
    GLsizei getDepth() const { return mDepth; }
    GLenum getInternalFormat() const { return mInternalFormat; }
    GLenum getTarget() const { return mTarget; }
    bool isRenderableFormat() const { return mRenderable; }

    void markDirty() {mDirty = true;}
    void markClean() {mDirty = false;}
    virtual bool isDirty() const = 0;

    virtual bool redefine(GLenum target, GLenum internalformat, const gl::Extents &size, bool forceRelease) = 0;

    virtual gl::Error loadData(const gl::Box &area, GLint unpackAlignment, GLenum type, const void *input) = 0;
    virtual gl::Error loadCompressedData(const gl::Box &area, const void *input) = 0;

    virtual gl::Error copy(const gl::Offset &destOffset, const gl::Rectangle &sourceArea, const gl::Framebuffer *source) = 0;
    virtual gl::Error copy(const gl::Offset &destOffset, const gl::Box &sourceArea,
                           const gl::ImageIndex &sourceIndex, TextureStorage *source) = 0;

  protected:
    GLsizei mWidth;
    GLsizei mHeight;
    GLsizei mDepth;
    GLenum mInternalFormat;
    bool mRenderable;
    GLenum mTarget;

    bool mDirty;

  private:
    DISALLOW_COPY_AND_ASSIGN(Image);
};

}

#endif // LIBANGLE_RENDERER_IMAGE_H_


text:
package de.hub.clickwatch.specificmodels.brn.lease_tab_leases.impl;

import java.util.Collection;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.eclipse.emf.ecore.util.EDataTypeEList;
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.util.InternalEList;

import de.hub.clickwatch.specificmodels.brn.lease_tab_leases.Client;
import de.hub.clickwatch.specificmodels.brn.lease_tab_leases.Dhcpleases;
import de.hub.clickwatch.specificmodels.brn.lease_tab_leases.Lease_tab_leasesPackage;
import de.hub.clickwatch.specificmodels.brn.lease_tab_leases.Leases;

/**
 *
 * An implementation of the model object 'Dhcpleases'.
 *
 *

 * The following features are implemented:
 *

 *
{@link de.hub.clickwatch.specificmodels.brn.lease_tab_leases.impl.DhcpleasesImpl#getEContainer_dhcpleases EContainer dhcpleases}

 *
{@link de.hub.clickwatch.specificmodels.brn.lease_tab_leases.impl.DhcpleasesImpl#getText Text}

 *
{@link de.hub.clickwatch.specificmodels.brn.lease_tab_leases.impl.DhcpleasesImpl#getClient Client}

 *
{@link de.hub.clickwatch.specificmodels.brn.lease_tab_leases.impl.DhcpleasesImpl#getCount Count}

 *
{@link de.hub.clickwatch.specificmodels.brn.lease_tab_leases.impl.DhcpleasesImpl#getTime Time}

 *

 *

 *
 * @generated
 */
public class DhcpleasesImpl extends EObjectImpl implements Dhcpleases {
    /**
     * The cached value of the '{@link #getText() Text}' attribute list.
     *
     *
     * @see #getText()
     * @generated
     * @ordered
     */
    protected EList<String> text;

    /**
     * The cached value of the '{@link #getClient() Client}' containment reference list.
     *
     *
     * @see #getClient()
     * @generated
     * @ordered
     */
    protected EList<Client> client;

    /**
     * The default value of the '{@link #getCount() Count}' attribute.
     *
     *
     * @see #getCount()
     * @generated
     * @ordered
     */
    protected static final int COUNT_EDEFAULT = 0;

    /**
     * The cached value of the '{@link #getCount() Count}' attribute.
     *
     *
     * @see #getCount()
     * @generated
     * @ordered
     */
    protected int count = COUNT_EDEFAULT;

    /**
     * The default value of the '{@link #getTime() Time}' attribute.
     *
     *
     * @see #getTime()
     * @generated
     * @ordered
     */
    protected static final double TIME_EDEFAULT = 0.0;

    /**
     * The cached value of the '{@link #getTime() Time}' attribute.
     *
     *
     * @see #getTime()
     * @generated
     * @ordered
     */
    protected double time = TIME_EDEFAULT;

    /**
     *
     *
     * @generated
     */
    protected DhcpleasesImpl() {
        super();
    }

    /**
     *
     *
     * @generated
     */
    @Override
    protected EClass eStaticClass() {
        return Lease_tab_leasesPackage.Literals.DHCPLEASES;
    }

    /**
     *
     *
     * @generated
     */
    public Leases getEContainer_dhcpleases() {
        if (eContainerFeatureID() != Lease_tab_leasesPackage.DHCPLEASES__ECONTAINER_DHCPLEASES) return null;
        return (Leases)eContainer();
    }

    /**
     *
     *
     * @generated
     */
    public NotificationChain basicSetEContainer_dhcpleases(Leases newEContainer_dhcpleases, NotificationChain msgs) {
        msgs = eBasicSetContainer((InternalEObject)newEContainer_dhcpleases, Lease_tab_leasesPackage.DHCPLEASES__ECONTAINER_DHCPLEASES, msgs);
        return msgs;
    }

    /**
     *
     *
     * @generated
     */
    public void setEContainer_dhcpleases(Leases newEContainer_dhcpleases) {
        if (newEContainer_dhcpleases != eInternalContainer() || (eContainerFeatureID() != Lease_tab_leasesPackage.DHCPLEASES__ECONTAINER_DHCPLEASES && newEContainer_dhcpleases != null)) {
            if (EcoreUtil.isAncestor(this, newEContainer_dhcpleases))
                throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
            NotificationChain msgs = null;
            if (eInternalContainer() != null)
                msgs = eBasicRemoveFromContainer(msgs);
            if (newEContainer_dhcpleases != null)
                msgs = ((InternalEObject)newEContainer_dhcpleases).eInverseAdd(this, Lease_tab_leasesPackage.LEASES__DHCPLEASES, Leases.class, msgs);
            msgs = basicSetEContainer_dhcpleases(newEContainer_dhcpleases, msgs);
            if (msgs != null) msgs.dispatch();
        }
        else if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, Lease_tab_leasesPackage.DHCPLEASES__ECONTAINER_DHCPLEASES, newEContainer_dhcpleases, newEContainer_dhcpleases));
    }

    /**
     *
     *
     * @generated
     */
    public EList<String> getText() {
        if (text == null) {
            text = new EDataTypeEList<String>(String.class, this, Lease_tab_leasesPackage.DHCPLEASES__TEXT);
        }
        return text;
    }

    /**
     *
     *
     * @generated
     */
    public EList<Client> getClient() {
        if (client == null) {
            client = new EObjectContainmentWithInverseEList<Client>(Client.class, this, Lease_tab_leasesPackage.DHCPLEASES__CLIENT, Lease_tab_leasesPackage.CLIENT__ECONTAINER_CLIENT);
        }
        return client;
    }

    /**
     *
     *
     * @generated
     */
    public int getCount() {
        return count;
    }

    /**
     *
     *
     * @generated
     */
    public void setCount(int newCount) {
        int oldCount = count;
        count = newCount;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, Lease_tab_leasesPackage.DHCPLEASES__COUNT, oldCount, count));
    }

    /**
     *
     *
     * @generated
     */
    public double getTime() {
        return time;
    }

    /**
     *
     *
     * @generated
     */
    public void setTime(double newTime) {
        double oldTime = time;
        time = newTime;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, Lease_tab_leasesPackage.DHCPLEASES__TIME, oldTime, time));
    }

    /**
     *
     *
     * @generated
     */
    @SuppressWarnings("unchecked")
    @Override
    public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
        switch (featureID) {
            case Lease_tab_leasesPackage.DHCPLEASES__ECONTAINER_DHCPLEASES:
                if (eInternalContainer() != null)
                    msgs = eBasicRemoveFromContainer(msgs);
                return basicSetEContainer_dhcpleases((Leases)otherEnd, msgs);
            case Lease_tab_leasesPackage.DHCPLEASES__CLIENT:
                return ((InternalEList<InternalEObject>)(InternalEList<?>)getClient()).basicAdd(otherEnd, msgs);
        }
        return super.eInverseAdd(otherEnd, featureID, msgs);
    }

    /**
     *
     *
     * @generated
     */
    @Override
    public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
        switch (featureID) {
            case Lease_tab_leasesPackage.DHCPLEASES__ECONTAINER_DHCPLEASES:
                return basicSetEContainer_dhcpleases(null, msgs);
            case Lease_tab_leasesPackage.DHCPLEASES__CLIENT:
                return ((InternalEList<?>)getClient()).basicRemove(otherEnd, msgs);
        }
        return super.eInverseRemove(otherEnd, featureID, msgs);
    }

    /**
     *
     *
     * @generated
     */
    @Override
    public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
        switch (eContainerFeatureID()) {
            case Lease_tab_leasesPackage.DHCPLEASES__ECONTAINER_DHCPLEASES:
                return eInternalContainer().eInverseRemove(this, Lease_tab_leasesPackage.LEASES__DHCPLEASES, Leases.class, msgs);
        }
        return super.eBasicRemoveFromContainerFeature(msgs);
    }

    /**
     *
     *
     * @generated
     */
    @Override
    public Object eGet(int featureID, boolean resolve, boolean coreType) {
        switch (featureID) {
            case Lease_tab_leasesPackage.DHCPLEASES__ECONTAINER_DHCPLEASES:
                return getEContainer_dhcpleases();
            case Lease_tab_leasesPackage.DHCPLEASES__TEXT:
                return getText();
            case Lease_tab_leasesPackage.DHCPLEASES__CLIENT:
                return getClient();
            case Lease_tab_leasesPackage.DHCPLEASES__COUNT:
                return getCount();
            case Lease_tab_leasesPackage.DHCPLEASES__TIME:
                return getTime();
        }
        return super.eGet(featureID, resolve, coreType);
    }

    /**
     *
     *
     * @generated
     */
    @SuppressWarnings("unchecked")
    @Override
    public void eSet(int featureID, Object newValue) {
        switch (featureID) {
            case Lease_tab_leasesPackage.DHCPLEASES__ECONTAINER_DHCPLEASES:
                setEContainer_dhcpleases((Leases)newValue);
                return;
            case Lease_tab_leasesPackage.DHCPLEASES__TEXT:
                getText().clear();
                getText().addAll((Collection<? extends String>)newValue);
                return;
            case Lease_tab_leasesPackage.DHCPLEASES__CLIENT:
                getClient().clear();
                getClient().addAll((Collection<? extends Client>)newValue);
                return;
            case Lease_tab_leasesPackage.DHCPLEASES__COUNT:
                setCount((Integer)newValue);
                return;
            case Lease_tab_leasesPackage.DHCPLEASES__TIME:
                setTime((Double)newValue);
                return;
        }
        super.eSet(featureID, newValue);
    }

    /**
     *
     *
     * @generated
     */
    @Override
    public void eUnset(int featureID) {
        switch (featureID) {
            case Lease_tab_leasesPackage.DHCPLEASES__ECONTAINER_DHCPLEASES:
                setEContainer_dhcpleases((Leases)null);
                return;
            case Lease_tab_leasesPackage.DHCPLEASES__TEXT:
                getText().clear();
                return;
            case Lease_tab_leasesPackage.DHCPLEASES__CLIENT:
                getClient().clear();
                return;
            case Lease_tab_leasesPackage.DHCPLEASES__COUNT:
                setCount(COUNT_EDEFAULT);
                return;
            case Lease_tab_leasesPackage.DHCPLEASES__TIME:
                setTime(TIME_EDEFAULT);
                return;
        }
        super.eUnset(featureID);
    }

    /**
     *
     *
     * @generated
     */
    @Override
    public boolean eIsSet(int featureID) {
        switch (featureID) {
            case Lease_tab_leasesPackage.DHCPLEASES__ECONTAINER_DHCPLEASES:
                return getEContainer_dhcpleases() != null;
            case Lease_tab_leasesPackage.DHCPLEASES__TEXT:
                return text != null && !text.isEmpty();
            case Lease_tab_leasesPackage.DHCPLEASES__CLIENT:
                return client != null && !client.isEmpty();
            case Lease_tab_leasesPackage.DHCPLEASES__COUNT:
                return count != COUNT_EDEFAULT;
            case Lease_tab_leasesPackage.DHCPLEASES__TIME:
                return time != TIME_EDEFAULT;
        }
        return super.eIsSet(featureID);
    }

    /**
     *
     *
     * @generated
     */
    @Override
    public String toString() {
        if (eIsProxy()) return super.toString();

        StringBuffer result = new StringBuffer(super.toString());
        result.append(" (text: ");
        result.append(text);
        result.append(", count: ");
        result.append(count);
        result.append(", time: ");
        result.append(time);
        result.append(')');
        return result.toString();
    }

} //DhcpleasesImpl