text:
<#
.NOTES
    Created on:   10/26/2017
    Created by:   Andy Simmons
    Organization: St. Luke's Health System
    FileName:     Export-GroupMembers.ps1

.SYNOPSIS
    Exports membership from one or more AD groups to some CSV files.

.PARAMETER GroupName
    Name of one or more Active Directory groups.

.PARAMETER ExportFolder
    Directory where export files will be created.

.PARAMETER NoClobber
    Don't overwrite export files if they already exist.

.EXAMPLE
    .\Export-GroupMembers.ps1 -GroupName (Get-Content .\GG_Groups.txt) -Verbose

    Pulls a list of groups from the file .\GG_Groups.txt and exports membership for each.
#>
[CmdletBinding(SupportsShouldProcess)]
param (
    [Parameter(Mandatory)]
    [String[]]
    $GroupName,

    [IO.DirectoryInfo]
    $ExportFolder = '.\GroupExport',

    [switch]
    $NoClobber
)

Write-Verbose ("Looking up membership for {0} groups..." -f $GroupName.Count)

# Get-ADGroupMember can't deal with large groups, but we can work around it
# with Get-ADGroup/Get-ADObject.
$adGroups = @($GroupName | Get-ADGroup -ErrorAction Continue -Properties 'Members')
if ($adGroups.Count -ne $GroupName.Count)
{
    $difference = $GroupName.Count - $adGroups.Count
    Write-Warning "Skipping export for $difference groups (member lookup error)!"
}

if (!$adGroups) { throw "Member lookup failed for all groups. Aborting." }

# Validate the export directory
if (!$ExportFolder.Exists -and $PSCmdlet.ShouldProcess($ExportFolder.FullName, 'create directory'))
{
    try
    {
        Write-Verbose "Directory '$ExportFolder' not found. Creating."
        New-Item -ItemType Directory -Path $ExportFolder -ErrorAction Stop > $null
    }
    catch { throw "Couldn't create directory '$ExportFolder'. Bailing." }
}

Write-Verbose ("Exporting membership information for {0} groups" -f $adGroups.Count)

$exportCounter = 0

foreach ($adGroup in $adGroups)
{
    $outFile = "{0}\{1}.csv" -f $ExportFolder.FullName, $adGroup.DistinguishedName

    if ($PSCmdlet.ShouldProcess($outFile, 'export membership to file'))
    {
        # We just have DN strings describing members, and DNs change, so we'll grab the
        # corresponding AD objects to export a few other identifiers.
        $adObjects = @($adGroup.Members | Get-ADObject -Properties 'ObjectSID' -ErrorAction Continue)

        if ($adObjects.Count -eq $adGroup.Members.Count) { $content = $adObjects }
        else
        {
            if ($adGroup.Members)
            {
                $difference = $adGroup.Members.Count - $adObjects.Count
                Write-Warning "Member lookup failed for $difference member(s)! Exporting distinguished names only."

                # convert the strings to single-property objects, for consistency across exports
                $content = $adGroup.Members.ForEach({ [pscustomobject] @{ 'DistinguishedName' = $_ } })
            }
            else
            {
                Write-Warning "'$($adGroup.Name)' group has no members. Still generating an export file, but it'll be empty..."
                $content = $null
            }
        }

        if ($NoClobber -and [IOFileInfo]$outFile.Exists)
        {
            Write-Warning "Skipping file '$outFile'. It's already there and I'm not supposed to clobber it."
        }
        else
        {
            try
            {
                $ecsvParams = @{
                    Path              = $outFile
                    NoTypeInformation = $true
                    Confirm           = $false
                    ErrorAction       = 'Stop'
                }
                $content | Export-Csv @ecsvParams
                $exportCounter++
               }
            catch
            {
                Write-Error "Couldn't write to export file '$outFile'!"
                Write-Error $_.Exception.Message
            }
        }
    }
}

"All done! {0} group exports can be found here: '{1}'" -f $exportCounter, $ExportFolder.FullName


text:
+function ($) {

  $(function(){

      $(document).on('click', '[ui-toggle-class]', function (e) {
        e.preventDefault();
        var $this = $(e.target);
        $this.attr('ui-toggle-class') || ($this = $this.closest('[ui-toggle-class]'));

		var classes = $this.attr('ui-toggle-class').split(','),
			targets = ($this.attr('target') && $this.attr('target').split(',')) || Array($this),
			key = 0;
		$.each(classes, function( index, value ) {
			var target = targets[(targets.length && key)];
			$( target ).toggleClass(classes[index]);
			key ++;
		});
		$this.toggleClass('active');

      });

      $('.remove-search').click(function(){
      	var parent = $(this).parent().parent().parent().attr('class');
      	$(this).parent().parent().parent().removeClass('open');
      });
  });
}(jQuery);

redpajama_set_name: RedPajamaGithub


text:
@implementation FLAboveAuxiliaryViewBehavior

FLSynthesizeSingleton(FLAboveAuxiliaryViewBehavior);

- (BOOL) handleInternalTouches:(NSSet*) touches event:(UIEvent*) event viewController:(FLAuxiliaryViewController*) viewController {
    return YES;
}

- (UIViewController*) parentControllerForAuxiliaryViewController:(FLAuxiliaryViewController*) viewController {
    return viewController.parentViewController;
}

- (void) addContainerViewToParentViewController:(FLAuxiliaryViewController*) viewController {
    [viewController.parentViewController addChildViewController:viewController.viewController];
    [viewController.parentViewController.view addSubview:viewController.containerView];
    [viewController.dragController addDragResponder:viewController.containerView];

    viewController.containerView.layer.shadowColor = [UIColor grayColor].CGColor;
    viewController.containerView.layer.shadowOpacity = .6;
    viewController.containerView.layer.shadowRadius = 20.0;
    viewController.containerView.layer.shadowOffset = CGSizeMake(0,3);
    viewController.containerView.clipsToBounds = NO;
}

- (void) showViewControllerAnimated:(BOOL) animated viewController:(FLAuxiliaryViewController*) viewController {
    CGPoint delta = FLPointSubtractPointFromPoint([viewController onscreenFrame].origin, viewController.containerView.frame.origin);
    [viewController.dragController moveDragRespondersByAmount:delta animationDuration:0.3 animationFinished:nil];
}

- (void) hideViewController:(BOOL) animated viewController:(FLAuxiliaryViewController*) viewController {
    if(viewController.viewController) {
        CGPoint delta = FLPointSubtractPointFromPoint([viewController offscreenFrame].origin, viewController.containerView.frame.origin);
        [viewController.dragController moveDragRespondersByAmount:delta animationDuration:0.3 animationFinished:^{ [viewController _hideAnimationFinished]; }];
    }
}

- (void) didFinishDraggingWithResults:(FLViewDraggerResults) results viewController:(FLAuxiliaryViewController*) viewController {

    TODO(why is this commented out?)

    //    [self performBlockWithDelay:1.0f block:
    //        ^{
    //            if(!viewController.auxiliaryViewIsOpen)
    //            {
    //                [viewController hideViewController:NO];
    //            }
    //        }];
}

- (CGRect) initialFrameForContainerView:(FLAuxiliaryViewController*) viewController {
    return [viewController offscreenFrame];
}

- (void) didAddTouchableView:(FLAuxiliaryViewController*) viewController {
    [viewController.dragController addDragResponder:viewController.dragController.touchableView];

    for(id secondary in viewController.dragController.secondaryTouchableViews) {
        [viewController.dragController addDragResponder:secondary];
    }
}

@end


text:
typedef struct {
    int tam;
    int conj[20];
}TConjunto;

//cria o conjunto, setando seu tamanho inicial em 0
void criaConjunto(TConjunto *conjunto);

//adiciona elementos no conjunto
void inserirElemento(TConjunto *conjunto, int n);

//imprime os dados do conjunto
void imprimiConjunto(TConjunto *conjunto);

//faz a unicao entre o conjunto c1 e c2 e armazena em c3
void uniaoConjunto(TConjunto *c1, TConjunto *c2, TConjunto *c3);

//recebe um conjunto, seu indice maximo daquela iteracao e o elemento
//retorna 1 se nao houver elemento repedito, 0 se houver
//1 -> nao existe elemento repetido
//0 -> existe elemento repetido
int elementoRepetido(TConjunto *conjunto, int tam, int elemento);

//faz a intersecao entre o conjunto c1 e c2 e armazena em c3
void intersecaoConjunto(TConjunto *c1, TConjunto *c2, TConjunto *c3);

//recebe dois conjuntos e retona 1 se forem iguais e 0 caso contrario
int conjuntoIgual(TConjunto *c1, TConjunto *c2);


text:
package com.example.android.courtcounter;

import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Vibrator;
import android.preference.PreferenceManager;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

/**
 * This activity keeps track of the basketball score for 2 teams.
 */
public class MainActivity extends AppCompatActivity {

    public static final int MIN_VALUE = 0;

    private static final String PREF_KEEP_SCREEN_ON = "keepScreenOn";

    private static final String PREF_THEME = "theme";

    private static final String THEME_DARK = "dark";

    private static final String THEME_LIGHT = "light";

    private static final long DEFAULT_VIBRATION_DURATION = 20; // Milliseconds

    private static int countScore = 0;

    SharedPreferences sharedPref;

    String Count = "Count";

    boolean doubleBackToExitPressedOnce = false;

    private Vibrator vibrator;

    private Button decrementButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
        if (sharedPref.getString(PREF_THEME, THEME_LIGHT).equals(THEME_DARK)) {
            setTheme(R.style.AppTheme_Dark);
        }
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        decrementButton = (Button) findViewById(R.id.decrement);
        vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
        sharedPref = getPreferences(MODE_PRIVATE);
        countScore = sharedPref.getInt(Count, 0);

        displayCountValue(countScore);
    }

    /**
     * Displays the given score for Team A.
     */
    public void displayCountValue(int score) {
        TextView scoreView = (TextView) findViewById(R.id.team_a_score);
        scoreView.setText(String.valueOf(score));
        checkStateOfButtons();
    }

    private void checkStateOfButtons() {
        if (countScore <= MIN_VALUE) decrementButton.setEnabled(false);
        else decrementButton.setEnabled(true);
    }

   /* @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        return super.onKeyDown(keyCode, event) || this.onKeyDown(keyCode, event);
    }
*/
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.menu_settings) {
            Intent intent = new Intent(this, SettingsActivity.class);
            startActivity(intent);
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

    @Override
    public void onBackPressed() {

        AlertDialog dialog = new AlertDialog.Builder(this)
                .setTitle(R.string.app_name)
                .setMessage("Do you want to exit the App ?").setCancelable(false)
                .setPositiveButton("YES", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        ActivityCompat.finishAffinity(MainActivity.this);
                    }
                })
                .setNegativeButton("NO", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        dialog.dismiss();
                    }
                })
                .create();

        dialog.show();

        /*if (doubleBackToExitPressedOnce) {
            super.onBackPressed();
            return;
        }

        this.doubleBackToExitPressedOnce = true;
        Toast.makeText(this, "Press BACK twice to exit", Toast.LENGTH_SHORT).show();

        new Handler().postDelayed(new Runnable() {

            @Override
            public void run() {
                doubleBackToExitPressedOnce=false;
            }
        }, 2000);*/
    }

    @Override
    protected void onResume() {
        super.onResume();
        if (sharedPref.getBoolean(PREF_KEEP_SCREEN_ON, false)) {
            getWindow().addFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
        } else {
            getWindow().clearFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
        }
    }

    private void vibrate(long duration) {
        if (sharedPref.getBoolean("vibrationOn", true)) {
            vibrator.vibrate(duration);
        }
    }

    public boolean onKeyDown(int keyCode, KeyEvent event, View view) {
        switch (keyCode) {
            case KeyEvent.KEYCODE_VOLUME_UP:
                if (sharedPref.getBoolean("hardControlOn", true)) {
                    addOneCount(view);
                    return true;
                }
                return false;
            case KeyEvent.KEYCODE_VOLUME_DOWN:
                if (sharedPref.getBoolean("hardControlOn", true)) {
                    reduceOneCount(view);
                    return true;
                }
                return false;
            case KeyEvent.KEYCODE_CAMERA:
                if (sharedPref.getBoolean("hardControlOn", true)) {
                    resetScore(view);
                    return true;
                }
                return false;
            default:
                return false;
        }
    }

    /**
     * Increase the score for Team A by 1 point.
     */
    public void addOneCount(View v) {
        countScore = countScore + 1;
        displayCountValue(countScore);
        vibrate(DEFAULT_VIBRATION_DURATION);
        sharedPref = getPreferences(MODE_PRIVATE);
        SharedPreferences.Editor editor = sharedPref.edit();
        editor.putInt(Count, countScore);
        editor.commit();
        return;
    }

    public void reduceOneCount(View v) {
        countScore = countScore - 1;
        displayCountValue(countScore);
        vibrate(DEFAULT_VIBRATION_DURATION + 20);
        sharedPref = getPreferences(MODE_PRIVATE);
        SharedPreferences.Editor editor = sharedPref.edit();
        editor.putInt(Count, countScore);
        editor.commit();
        return;
    }

    /**
     * Resets the score for both teams back to 0.
     */
    public void resetScore(View v) {
        countScore = 0;
        SharedPreferences.Editor editor = sharedPref.edit();
        editor.putInt(Count, countScore);
        editor.commit();
        displayCountValue(countScore);
    }
}


text:
require_relative 'dfareporting_utils'

def get_report_files(dfareporting, args)
  # Get all report files
  request = dfareporting.reports.files.list(
    :profileId => args[:profile_id],
    :reportId => args[:report_id]
  )

  loop do
    result = request.execute()

    # Display results
    result.data.items.each do |file|
      puts 'File with ID %d and file name "%s" has status "%s".' %
          [file.id, file.fileName, file.status]
    end

    token = result.next_page_token

    break unless token and result.data.items.any?
    request = result.next_page
  end
end

if __FILE__ == $0
  # Retrieve command line arguments
  args = DfaReportingUtils.get_arguments(ARGV, :profile_id, :report_id)

  # Authenticate and initialize API service
  dfareporting = DfaReportingUtils.setup()

  get_report_files(dfareporting, args)
end


text:
<?php
/**
 * @author Richard Weinhold
 */
namespace ricwein\shurl\Template\Processor;

use ricwein\shurl\Template\Engine\Variables;

/**
 * simple Template parser with Twig-like syntax
 */
class Comments extends Variables
{

    /**
     * @var string[]
     */
    const REGEX = ['/\{#\s*', '\s*#\}/'];

    /**
     * @param  string $content
     * @param  bool   $inline  convert comments to html inline comments, instead of removing them
     * @return string
     */
    protected function replace(string $content, bool $inline = false): string
    {
        $regex = $this->getRegex('(.*)');
        return preg_replace_callback($regex, function (array $match) use ($inline): string {
            return $inline && isset($match[1]) ? '<!-- ' . trim($match[1]) . ' -->' : '';
        }, $content);
    }
}


text:
using Should.Fluent;
using TechTalk.SpecFlow;

namespace Specs._00BasicGherkin
{

    [Binding]
    public class BasicGherkinSteps
    {
        private class Application
        {
            public Application()
            {
                State = "Running";
            }
            public string State { get; set; }
        }

        private Application SUT;
        protected string returnValue { get; set; }

        [Given(@"the initial state of the application is Running")]
        public void InitialStateIsRunning()
        {
            SUT = new Application { State = "Running" };
        }

        [Given(@"I have authorization to ask application state")]
        public void IsAuthorized()
        { }

        [When(@"I ask what the application state is")]
        public void AskState()
        {
            returnValue = SUT.State;
        }

        [Then(@"I should see Running as the answer")]
        public void SeeRunninAsState()
        {
            SUT.State.Should().Equal("Running");
        }

        [Then(@"I should see the time of the application")]
        public void SeeTheTime() { }

        [Then(@"the state of the application should not be Stopped")]
        public void StateisNotStopped()
        {
            SUT.State.Should().Not.Equal("Stopped");
        }
    }
}


text:
import query from './query.pegjs';

export function parseToAst (string) {
  return query.parse(string);
}


text:
require 'test_helper'

describe BrBoleto::Retorno::Cnab400::Unicred do
	subject { BrBoleto::Retorno::Cnab400::Unicred.new(file) }
	let(:file) { open_fixture('retorno/cnab400/bradesco.ret') }

	it "Deve carregar 6 pagamentos" do
		subject.pagamentos.size.must_equal 6
	end

	describe 'deve setar as informações corretas para os pagamentos' do
		it "valores para o pagamento 1" do
			pagamento = subject.pagamentos[0]
			pagamento.agencia_sem_dv.must_equal            "01467"
			pagamento.numero_conta.must_equal              "0019669"
			pagamento.numero_conta_dv.must_equal           "9"
			pagamento.numero_conta_sem_dv.must_equal       "001966"
			pagamento.nosso_numero_sem_dv.must_equal       "000000000303"
			pagamento.carteira.must_equal                  "09"
			pagamento.numero_documento.must_equal          "0030"
			pagamento.data_vencimento.must_equal           Date.parse('25/05/2015')
			pagamento.valor_titulo.must_equal              1450.0
			pagamento.banco_recebedor.must_equal           "237"
			pagamento.agencia_recebedora_com_dv.must_equal "04157"
			pagamento.sacado_documento.must_equal          "12095870000170"
			pagamento.valor_tarifa.must_equal              1.60
			pagamento.valor_juros_multa.must_equal         0.0
			pagamento.valor_desconto.must_equal            0.0
			pagamento.valor_abatimento.must_equal          0.0
			pagamento.valor_iof.must_equal                 0.0
			pagamento.valor_pago.must_equal                1450.0
			pagamento.valor_liquido.must_equal             1450.0
			pagamento.valor_outras_despesas.must_equal     0.0
			pagamento.valor_outros_creditos.must_equal     0.0
			pagamento.data_ocorrencia.must_equal           Date.parse('15/05/2015')
			pagamento.data_credito.must_equal              Date.parse('15/05/2015')
			pagamento.data_ocorrencia_sacado.must_equal    Date.parse('15/05/2015')
			pagamento.valor_ocorrencia_sacado.must_equal   1450.0
			pagamento.especie_titulo.must_equal            ''
			pagamento.codigo_ocorrencia_sacado.must_be_nil
			pagamento.dv_conta_e_agencia.must_be_nil
			pagamento.identificacao_titulo_empresa.must_be_nil
			pagamento.codigo_moeda.must_be_nil
			pagamento.sacado_tipo_documento.must_be_nil
			pagamento.sacado_nome.must_be_nil
			pagamento.numero_contrato.must_be_nil
			pagamento.motivo_ocorrencia_original_1.must_be_nil
			pagamento.motivo_ocorrencia_original_2.must_be_nil
			pagamento.motivo_ocorrencia_original_3.must_be_nil
			pagamento.motivo_ocorrencia_original_4.must_be_nil
			pagamento.motivo_ocorrencia_original_5.must_be_nil
			pagamento.complemento_ocorrencia_sacado.must_be_nil
			pagamento.codigo_ocorrencia_banco_correspondente.must_be_nil
			pagamento.nosso_numero_banco_correspondente.must_be_nil
		end

		it "valores para o pagamento 2" do
			pagamento = subject.pagamentos[1]
			pagamento.agencia_sem_dv.must_equal            "01467"
			pagamento.numero_conta.must_equal              "0019669"
			pagamento.numero_conta_dv.must_equal           "9"
			pagamento.numero_conta_sem_dv.must_equal       "001966"
			pagamento.nosso_numero_sem_dv.must_equal       "51350000004P"
			pagamento.carteira.must_equal                  "09"
			pagamento.numero_documento.must_equal          "1146"
			pagamento.data_vencimento.must_equal           Date.parse('25/05/2015')
			pagamento.valor_titulo.must_equal              180.0
			pagamento.banco_recebedor.must_equal           "237"
			pagamento.agencia_recebedora_com_dv.must_equal "04157"
			pagamento.sacado_documento.must_equal          "12095870000170"
			pagamento.valor_tarifa.must_equal              1.60
			pagamento.valor_juros_multa.must_equal         0.0
			pagamento.valor_desconto.must_equal            0.0
			pagamento.valor_abatimento.must_equal          0.0
			pagamento.valor_iof.must_equal                 0.0
			pagamento.valor_pago.must_equal                0.0
			pagamento.valor_liquido.must_equal             0.0
			pagamento.valor_outras_despesas.must_equal     0.0
			pagamento.valor_outros_creditos.must_equal     0.0
			pagamento.data_ocorrencia.must_equal           Date.parse('15/05/2015')
			pagamento.data_ocorrencia_sacado.must_equal    Date.parse('15/05/2015')
			pagamento.valor_ocorrencia_sacado.must_equal   0.0
			pagamento.especie_titulo.must_equal            ''
			pagamento.codigo_ocorrencia_sacado.must_be_nil
			pagamento.dv_conta_e_agencia.must_be_nil
			pagamento.identificacao_titulo_empresa.must_be_nil
			pagamento.codigo_moeda.must_be_nil
			pagamento.sacado_tipo_documento.must_be_nil
			pagamento.sacado_nome.must_be_nil
			pagamento.numero_contrato.must_be_nil
			pagamento.motivo_ocorrencia_original_1.must_be_nil
			pagamento.motivo_ocorrencia_original_2.must_be_nil
			pagamento.motivo_ocorrencia_original_3.must_be_nil
			pagamento.motivo_ocorrencia_original_4.must_be_nil
			pagamento.motivo_ocorrencia_original_5.must_be_nil
			pagamento.complemento_ocorrencia_sacado.must_be_nil
			pagamento.codigo_ocorrencia_banco_correspondente.must_be_nil
			pagamento.nosso_numero_banco_correspondente.must_be_nil
		end

		it "valores para o pagamento 3" do
			pagamento = subject.pagamentos[2]
			pagamento.agencia_sem_dv.must_equal            "01467"
			pagamento.numero_conta.must_equal              "0019669"
			pagamento.numero_conta_dv.must_equal           "9"
			pagamento.numero_conta_sem_dv.must_equal       "001966"
			pagamento.nosso_numero_sem_dv.must_equal       "513500000074"
			pagamento.carteira.must_equal                  "09"
			pagamento.numero_documento.must_equal          "1142"
			pagamento.data_vencimento.must_equal           Date.parse('25/05/2015')
			pagamento.valor_titulo.must_equal              720.0
			pagamento.banco_recebedor.must_equal           "237"
			pagamento.agencia_recebedora_com_dv.must_equal "04157"
			pagamento.sacado_documento.must_equal          "12095870000170"
			pagamento.valor_tarifa.must_equal              1.60
			pagamento.valor_juros_multa.must_equal         0.0
			pagamento.valor_desconto.must_equal            0.0
			pagamento.valor_abatimento.must_equal          0.0
			pagamento.valor_iof.must_equal                 0.0
			pagamento.valor_pago.must_equal                0.0
			pagamento.valor_liquido.must_equal             0.0
			pagamento.valor_outras_despesas.must_equal     0.0
			pagamento.valor_outros_creditos.must_equal     0.0
			pagamento.data_ocorrencia.must_equal           Date.parse('15/05/2015')
			pagamento.data_ocorrencia_sacado.must_equal    Date.parse('15/05/2015')
			pagamento.valor_ocorrencia_sacado.must_equal   0.0
			pagamento.especie_titulo.must_equal            ''
			pagamento.codigo_ocorrencia_sacado.must_be_nil
			pagamento.dv_conta_e_agencia.must_be_nil
			pagamento.identificacao_titulo_empresa.must_be_nil
			pagamento.codigo_moeda.must_be_nil
			pagamento.sacado_tipo_documento.must_be_nil
			pagamento.sacado_nome.must_be_nil
			pagamento.numero_contrato.must_be_nil
			pagamento.motivo_ocorrencia_original_1.must_be_nil
			pagamento.motivo_ocorrencia_original_2.must_be_nil
			pagamento.motivo_ocorrencia_original_3.must_be_nil
			pagamento.motivo_ocorrencia_original_4.must_be_nil
			pagamento.motivo_ocorrencia_original_5.must_be_nil
			pagamento.complemento_ocorrencia_sacado.must_be_nil
			pagamento.codigo_ocorrencia_banco_correspondente.must_be_nil
			pagamento.nosso_numero_banco_correspondente.must_be_nil
		end

		it "valores para o pagamento 4" do
			pagamento = subject.pagamentos[3]
			pagamento.agencia_sem_dv.must_equal            "01467"
			pagamento.numero_conta.must_equal              "0019669"
			pagamento.numero_conta_dv.must_equal           "9"
			pagamento.numero_conta_sem_dv.must_equal       "001966"
			pagamento.nosso_numero_sem_dv.must_equal       "513500000090"
			pagamento.carteira.must_equal                  "09"
			pagamento.numero_documento.must_equal          "1145"
			pagamento.data_vencimento.must_equal           Date.parse('12/06/2015')
			pagamento.valor_titulo.must_equal              200.0
			pagamento.banco_recebedor.must_equal           "237"
			pagamento.agencia_recebedora_com_dv.must_equal "04157"
			pagamento.sacado_documento.must_equal          "12095870000170"
			pagamento.valor_tarifa.must_equal              1.60
			pagamento.valor_juros_multa.must_equal         0.0
			pagamento.valor_desconto.must_equal            0.0
			pagamento.valor_abatimento.must_equal          0.0
			pagamento.valor_iof.must_equal                 0.0
			pagamento.valor_pago.must_equal                0.0
			pagamento.valor_liquido.must_equal             0.0
			pagamento.valor_outras_despesas.must_equal     0.0
			pagamento.valor_outros_creditos.must_equal     0.0
			pagamento.data_ocorrencia.must_equal           Date.parse('15/05/2015')
			pagamento.data_ocorrencia_sacado.must_equal    Date.parse('15/05/2015')
			pagamento.valor_ocorrencia_sacado.must_equal   0.0
			pagamento.especie_titulo.must_equal            ''
			pagamento.codigo_ocorrencia_sacado.must_be_nil
			pagamento.dv_conta_e_agencia.must_be_nil
			pagamento.identificacao_titulo_empresa.must_be_nil
			pagamento.codigo_moeda.must_be_nil
			pagamento.sacado_tipo_documento.must_be_nil
			pagamento.sacado_nome.must_be_nil
			pagamento.numero_contrato.must_be_nil
			pagamento.motivo_ocorrencia_original_1.must_be_nil
			pagamento.motivo_ocorrencia_original_2.must_be_nil
			pagamento.motivo_ocorrencia_original_3.must_be_nil
			pagamento.motivo_ocorrencia_original_4.must_be_nil
			pagamento.motivo_ocorrencia_original_5.must_be_nil
			pagamento.complemento_ocorrencia_sacado.must_be_nil
			pagamento.codigo_ocorrencia_banco_correspondente.must_be_nil
			pagamento.nosso_numero_banco_correspondente.must_be_nil
		end

		it "valores para o pagamento 5" do
			pagamento = subject.pagamentos[4]
			pagamento.agencia_sem_dv.must_equal            "01467"
			pagamento.numero_conta.must_equal              "0019669"
			pagamento.numero_conta_dv.must_equal           "9"
			pagamento.numero_conta_sem_dv.must_equal       "001966"
			pagamento.nosso_numero_sem_dv.must_equal       "513500000112"
			pagamento.carteira.must_equal                  "09"
			pagamento.numero_documento.must_equal          "1144"
			pagamento.data_vencimento.must_equal           Date.parse('25/05/2015')
			pagamento.valor_titulo.must_equal              180.0
			pagamento.banco_recebedor.must_equal           "237"
			pagamento.agencia_recebedora_com_dv.must_equal "04157"
			pagamento.sacado_documento.must_equal          "12095870000170"
			pagamento.valor_tarifa.must_equal              1.60
			pagamento.valor_juros_multa.must_equal         0.0
			pagamento.valor_desconto.must_equal            0.0
			pagamento.valor_abatimento.must_equal          0.0
			pagamento.valor_iof.must_equal                 0.0
			pagamento.valor_pago.must_equal                0.0
			pagamento.valor_liquido.must_equal             0.0
			pagamento.valor_outras_despesas.must_equal     0.0
			pagamento.valor_outros_creditos.must_equal     0.0
			pagamento.data_ocorrencia.must_equal           Date.parse('15/05/2015')
			pagamento.data_ocorrencia_sacado.must_equal    Date.parse('15/05/2015')
			pagamento.valor_ocorrencia_sacado.must_equal   0.0
			pagamento.especie_titulo.must_equal            ''
			pagamento.codigo_ocorrencia_sacado.must_be_nil
			pagamento.dv_conta_e_agencia.must_be_nil
			pagamento.identificacao_titulo_empresa.must_be_nil
			pagamento.codigo_moeda.must_be_nil
			pagamento.sacado_tipo_documento.must_be_nil
			pagamento.sacado_nome.must_be_nil
			pagamento.numero_contrato.must_be_nil
			pagamento.motivo_ocorrencia_original_1.must_be_nil
			pagamento.motivo_ocorrencia_original_2.must_be_nil
			pagamento.motivo_ocorrencia_original_3.must_be_nil
			pagamento.motivo_ocorrencia_original_4.must_be_nil
			pagamento.motivo_ocorrencia_original_5.must_be_nil
			pagamento.complemento_ocorrencia_sacado.must_be_nil
			pagamento.codigo_ocorrencia_banco_correspondente.must_be_nil
			pagamento.nosso_numero_banco_correspondente.must_be_nil
		end

		it "valores para o pagamento 6" do
			pagamento = subject.pagamentos[5]
			pagamento.agencia_sem_dv.must_equal            "01467"
			pagamento.numero_conta.must_equal              "0019669"
			pagamento.numero_conta_dv.must_equal           "9"
			pagamento.numero_conta_sem_dv.must_equal       "001966"
			pagamento.nosso_numero_sem_dv.must_equal       "509800000028"
			pagamento.carteira.must_equal                  "09"
			pagamento.numero_documento.must_equal          "1053"
			pagamento.data_vencimento.must_equal           Date.parse('06/05/2015')
			pagamento.valor_titulo.must_equal              200.0
			pagamento.banco_recebedor.must_equal           "237"
			pagamento.agencia_recebedora_com_dv.must_equal "00000"
			pagamento.sacado_documento.must_equal          "12095870000170"
			pagamento.valor_tarifa.must_equal              0.0
			pagamento.valor_juros_multa.must_equal         0.0
			pagamento.valor_desconto.must_equal            0.0
			pagamento.valor_abatimento.must_equal          0.0
			pagamento.valor_iof.must_equal                 0.0
			pagamento.valor_pago.must_equal                0.0
			pagamento.valor_liquido.must_equal             0.0
			pagamento.valor_outras_despesas.must_equal     0.0
			pagamento.valor_outros_creditos.must_equal     0.0
			pagamento.data_ocorrencia.must_equal           Date.parse('15/05/2015')
			pagamento.data_ocorrencia_sacado.must_equal    Date.parse('15/05/2015')
			pagamento.valor_ocorrencia_sacado.must_equal   0.0
			pagamento.especie_titulo.must_equal            ''
			pagamento.codigo_ocorrencia_sacado.must_be_nil
			pagamento.dv_conta_e_agencia.must_be_nil
			pagamento.identificacao_titulo_empresa.must_be_nil
			pagamento.codigo_moeda.must_be_nil
			pagamento.sacado_tipo_documento.must_be_nil
			pagamento.sacado_nome.must_be_nil
			pagamento.numero_contrato.must_be_nil
			pagamento.motivo_ocorrencia_original_1.must_be_nil
			pagamento.motivo_ocorrencia_original_2.must_be_nil
			pagamento.motivo_ocorrencia_original_3.must_be_nil
			pagamento.motivo_ocorrencia_original_4.must_be_nil
			pagamento.motivo_ocorrencia_original_5.must_be_nil
			pagamento.complemento_ocorrencia_sacado.must_be_nil
			pagamento.codigo_ocorrencia_banco_correspondente.must_be_nil
			pagamento.nosso_numero_banco_correspondente.must_be_nil
		end

	end
end


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

<recipeml version="0.5">
  <recipe>
    <head>
      <title>Barbecued Speckled Trout</title>
      <categories>
        <cat>Fish</cat>
        <cat>Bbq</cat></categories>
      <yield>1</yield></head>
    <ingredients>
      <ing>
        <amt>
          <qty>1</qty>
          <unit>small</unit></amt>
        <item>Trout, whole</item></ing>
      <ing>
        <amt>
          <qty/>
          <unit/></amt>
        <item>Flour</item></ing>
      <ing>
        <amt>
          <qty/>
          <unit/></amt>
        <item>Corn oil</item></ing>
      <ing>
        <amt>
          <qty/>
          <unit/></amt>
        <item>Salt & pepper; to taste</item></ing>
      <ing>
        <amt>
          <qty/>
          <unit/></amt>
        <item>Tabasco</item></ing></ingredients>
    <directions>
      <step>  Wash the fish and dry with a paper towel. Make a paste fron the flour,
  corn oil seasoned with salt, pepper and tabasco. Coat the fish with the
  thin paste. Place over a grill over medium heat about three inches from
  the charcoal brickettes. Barbecue about six to eight minutes, turning the
  fish once.

  Allow one fish per person.

  Also for:
  Use flounder, blues, mackerel, snapper, bass, specks, mullet

  File ftp://ftp.idiscover.co.uk/pub/food/mealmaster/recipes/mm-trout.zip

</step></directions></recipe></recipeml>


text:
<?php

namespace Oro\Bundle\LocaleBundle\Form\Type;

use Oro\Bundle\FormBundle\Form\Type\OroEntitySelectOrCreateInlineType;
use Oro\Bundle\LocaleBundle\Entity\Localization;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolver;

class LocalizationParentSelectType extends AbstractType
{
    const NAME = 'oro_localization_parent_select';

    /**
     * {@inheritdoc}
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(
            [
                'autocomplete_alias' => 'oro_localization_parent',
                'configs' => [
                    'component' => 'autocomplete-entity-parent',
                    'placeholder' => 'oro.locale.localization.form.placeholder.select_parent_localization'
                ],
                'grid_name' => 'oro-locale-localizations-select-grid',
            ]
        );
    }

    /**
     * {@inheritdoc}
     */
    public function buildView(FormView $view, FormInterface $form, array $options)
    {
        $parentData = $form->getParent()->getData();

        $view->vars['configs']['entityId'] = $parentData instanceof Localization ? $parentData->getId() : null;
        $view->vars['grid_parameters'] = [
            'ids' => $parentData instanceof Localization ? $parentData->getChildrenIds(true) : []
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function getParent()
    {
        return OroEntitySelectOrCreateInlineType::class;
    }

    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return $this->getBlockPrefix();
    }

    /**
     * {@inheritdoc}
     */
    public function getBlockPrefix()
    {
        return self::NAME;
    }
}


text:
/**
 * @Title: TestLog.java
 * @Package com.test.log
 * @Description: TODO
 * @author tangxinghua tangxh@live.com
 * @version V1.0
 */
package com.test.log;

import java.util.concurrent.CountDownLatch;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Description: TODO
 */
public class TestLog {

	private static Logger log = LoggerFactory.getLogger(TestLog.class);

	/**
	 * @Description: TODO
	 * @param @param args
	 * @return void
	 * @throws InterruptedException
	 */
	public static void main(String[] args) throws InterruptedException {
		int messageSize = 100;
		int threadSize = 10;
		final int everySize = messageSize / threadSize;

		final CountDownLatch cdl = new CountDownLatch(threadSize);
		long startTime = System.currentTimeMillis();
		for (int ts = 0; ts < threadSize; ts++) {
			new Thread(new Runnable() {

				@Override
				public void run() {
					for (int es = 0; es < everySize; es++) {
						log.info("======info");
					}
					cdl.countDown();
				}
			}).start();
		}
		cdl.await();
		long endTime = System.currentTimeMillis();
		System.out.println("log4j1:messageSize = " + messageSize + ",threadSize = " + threadSize + ",costTime = "
				+ (endTime - startTime) + "ms");
	}

}


text:
package org.apache.activemq.artemis.tests.integration.cluster.reattach;

import org.apache.activemq.artemis.api.core.TransportConfiguration;
import org.apache.activemq.artemis.api.core.client.ServerLocator;
import org.apache.activemq.artemis.core.config.Configuration;

public class NettyMultiThreadRandomReattachTest extends MultiThreadRandomReattachTest
{
   @Override
   protected void start() throws Exception
   {
      Configuration liveConf = createDefaultConfig()
         .setJMXManagementEnabled(false)
         .setSecurityEnabled(false)
         .clearAcceptorConfigurations()
         .addAcceptorConfiguration(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY));
      liveServer = createServer(false, liveConf);
      liveServer.start();
      waitForServer(liveServer);
   }

   @Override
   protected ServerLocator createLocator() throws Exception
   {
      ServerLocator locator = createNettyNonHALocator();
      locator.setReconnectAttempts(-1);
      locator.setConfirmationWindowSize(1024 * 1024);
      locator.setAckBatchSize(0);
      return  locator;
   }

}


text:
package com.robparrett.genericmatchinggame;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.InputListener;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.utils.NinePatchDrawable;

/**
 * Created by Rob on 4/26/2015.
 */
public class DifficultyButton extends TextButton {
    private GenericMatchingGame game;
    private MatchScreen.Difficulty difficulty;

    public DifficultyButton(GenericMatchingGame g, MatchScreen.Difficulty d) {
        super("Easy", new TextButtonStyle(
                new NinePatchDrawable(g.skin.getPatch("button")),
                new NinePatchDrawable(g.skin.getPatch("buttonDown")),
                new NinePatchDrawable(g.skin.getPatch("button")),
                g.skin.getFont("pixely64")
        ));

        game = g;
        difficulty = d;

        switch (difficulty) {
            case TRIVIAL:
                setText("Trivial");
                break;
            case EASY:
                setText("Easy");
                break;
            case MED:
                setText("Medium");
                break;
            case HARD:
                setText("Hard");
                break;
        }

        addListener(new InputListener() {
            public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
                Gdx.app.log("DEBUG", "ScoresButton touchDown");
                return true;
            }

            public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
                Gdx.app.log("DEBUG", "ScoresButton touchDown");

                game.matchScreen.setDifficulty(difficulty);
                game.setScreen(game.matchScreen);

                game.tapSound.play(game.data.volume);
                game.data.lastDifficulty = difficulty;
            }
        });
    }
}


text:
package com.koch.ambeth.cache.service;

import java.util.List;

import com.koch.ambeth.service.cache.model.IObjRelation;
import com.koch.ambeth.service.cache.model.IObjRelationResult;

/**
 * Extension to provide the value of a relational propertyd of an entity. This is used in cases
 * where a previous call to the corresponding {@link ICacheRetriever} did not provide the object
 * references (instances of {@link com.koch.ambeth.merge.model.IObjRef}) of this relation in the
 * {@link com.koch.ambeth.service.cache.model.ILoadContainer} for whatever reason. In most cases the
 * relational information has been omitted intentionally in order to provide a lazy-loading pattern
 * to address potential performance concerns.

 *
 * An implementation of this extension can link very easily to the provided extension point with the
 * Link-API of the IoC container:

 * IBeanContextFactory bcf = ...

 * IBeanConfiguration myRelationRetriever = bcf.registerBean(MyRelationRetriever.class);

 * bcf.link(myRelationRetriever).to(IRelationRetrieverExtendable.class).with(MyEntity.class, "MyLazilyLoadedProp");
 *

 */
public interface IRelationRetriever {
	List<IObjRelationResult> getRelations(List<IObjRelation> objPropertyKeys);
}


text:
package cmd

import (
	"fmt"
	"os"
	"text/tabwriter"

	"github.com/spf13/cobra"

	daemonAPI "github.com/cilium/cilium/api/v1/client/daemon"
	"github.com/cilium/cilium/api/v1/models"
	"github.com/cilium/cilium/pkg/api"
	"github.com/cilium/cilium/pkg/command"
)

// mapGetCmd represents the map_get command
var mapGetCmd = &cobra.Command{
	Use:     "get <name>",
	Short:   "Display cached content of given BPF map",
	Example: "cilium map get cilium_ipcache",
	Run: func(cmd *cobra.Command, args []string) {
		if len(args) == 0 {
			Fatalf("map name must be specified")
		}

		params := daemonAPI.NewGetMapNameParams().WithName(args[0]).WithTimeout(api.ClientTimeout)

		resp, err := client.Daemon.GetMapName(params)
		if err != nil {
			Fatalf("%s", err)
		}

		m := resp.Payload
		if m == nil {
			return
		}

		if command.OutputOption() {
			if err := command.PrintOutput(m); err != nil {
				os.Exit(1)
			}
			return
		}

		printMapEntries(m)
	},
}

func printMapEntries(m *models.BPFMap) {
	if m.Cache == nil {
		fmt.Printf("Cache is disabled\n\n")
		return
	}

	if len(m.Cache) == 0 {
		fmt.Printf("Cache is empty\n\n")
		return
	}

	w := tabwriter.NewWriter(os.Stdout, 5, 0, 3, ' ', 0)
	fmt.Fprintf(w, "Key\tValue\tState\tError\n")
	for _, e := range m.Cache {
		if e != nil {
			fmt.Fprintf(w, "%s\t%s\t%s\t%s\n",
				e.Key, e.Value, e.DesiredAction, e.LastError)
		}
	}
	w.Flush()
}

func init() {
	mapCmd.AddCommand(mapGetCmd)
	command.AddOutputOption(mapGetCmd)
}


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

  <meta name="viewport" content="width=device-width,initial-scale=1">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <meta name="lang:clipboard.copy" content="Copy to clipboard">
  <meta name="lang:clipboard.copied" content="Copied to clipboard">
  <meta name="lang:search.language" content="en">
  <meta name="lang:search.pipeline.stopwords" content="True">
  <meta name="lang:search.pipeline.trimmer" content="True">
  <meta name="lang:search.result.none" content="No matching documents">
  <meta name="lang:search.result.one" content="1 matching document">
  <meta name="lang:search.result.other" content="# matching documents">
  <meta name="lang:search.tokenizer" content="[\s\-]+">

    <link href="https://fonts.gstatic.com/" rel="preconnect" crossorigin>
    <link href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,500,700|Roboto:300,400,400i,700&display=fallback" rel="stylesheet">

  <link rel="stylesheet" href="../_static/stylesheets/application.css"/>
  <link rel="stylesheet" href="../_static/stylesheets/application-palette.css"/>
  <link rel="stylesheet" href="../_static/stylesheets/application-fixes.css"/>

  <link rel="stylesheet" href="../_static/fonts/material-icons.css"/>

  <meta name="theme-color" content="#3f51b5">

    <title>statsmodels.robust.robust_linear_model.RLM — statsmodels</title>
  <link rel="icon" type="image/png" sizes="32x32" href="../_static/icons/favicon-32x32.png">
  <link rel="icon" type="image/png" sizes="16x16" href="../_static/icons/favicon-16x16.png">
  <link rel="manifest" href="../_static/icons/site.webmanifest">
  <link rel="mask-icon" href="../_static/icons/safari-pinned-tab.svg" color="#919191">
  <meta name="msapplication-TileColor" content="#2b5797">
  <meta name="msapplication-config" content="../_static/icons/browserconfig.xml">
  <link rel="stylesheet" href="../_static/stylesheets/examples.css">
  <link rel="stylesheet" href="../_static/stylesheets/deprecation.css">
    <link rel="stylesheet" href="../_static/material.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" type="text/css" href="../_static/graphviz.css" />

    <link rel="shortcut icon" href="../_static/favicon.ico"/>
    <link rel="author" title="About these documents" href="../about.html" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="statsmodels.robust.robust_linear_model.RLM.deviance" href="statsmodels.robust.robust_linear_model.RLM.deviance.html" />
    <link rel="prev" title="Weight Functions" href="../rlm_techn1.html" />

  <svg class="md-svg">
    <defs data-children-count="0">

      <svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="__github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg>

    </defs>
  </svg>

  <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer">
  <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search">

   Skip to content

          statsmodels v0.12.0
           statsmodels.robust.robust_linear_model.RLM

    <form class="md-search__form" action="../search.html" method="GET" name="search">
      <input type="text" class="md-search__input" name="q" placeholder="Search"
             autocapitalize="off" autocomplete="off" spellcheck="false"
             data-md-component="query" data-md-state="active">

      <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
        
      </button>
    </form>

            Type to start searching

      <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28">
        <use xlink:href="#__github" width="24" height="24"></use>
      </svg>

    statsmodels

User Guide

Robust Linear Models

    statsmodels v0.12.0

      <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28">
        <use xlink:href="#__github" width="24" height="24"></use>
      </svg>

    statsmodels

      Installing statsmodels

      Getting started

      User Guide

      Background

      Regression and Linear Models

      Linear Regression

      Generalized Linear Models

      Generalized Estimating Equations

      Generalized Additive Models (GAM)

      Robust Linear Models

      Linear Mixed Effects Models

      Regression with Discrete Dependent Variable

      Generalized Linear Mixed Effects Models

      ANOVA

      Time Series Analysis

      Other Models

      Statistics and Tools

      Data Sets

      Sandbox

      Examples

      API Reference

      About statsmodels

      Developer Page

      Release Notes

Show Source

statsmodels.robust.robust_linear_model.RLM¶

class statsmodels.robust.robust_linear_model.RLM(endog, exog, M=None, missing='none', **kwargs)[source]¶

Robust Linear Model

Estimate a robust linear model via iteratively reweighted least squares
given a robust criterion estimator.

Parameters

endogarray_like

A 1-d endogenous response variable. The dependent variable.

exogarray_like

A nobs x k array where nobs is the number of observations and k
is the number of regressors. An intercept is not included by default
and should be added by the user. See
statsmodels.tools.add_constant.

Mstatsmodels.robust.norms.RobustNorm, optional

The robust criterion function for downweighting outliers.
The current options are LeastSquares, HuberT, RamsayE, AndrewWave,
TrimmedMean, Hampel, and TukeyBiweight.  The default is HuberT().
See statsmodels.robust.norms for more information.

missingstr

Available options are 'none', 'drop', and 'raise'. If 'none', no nan
checking is done. If 'drop', any observations with nans are dropped.
If 'raise', an error is raised. Default is 'none'.

Examples

>>> import statsmodels.api as sm
>>> data = sm.datasets.stackloss.load(as_pandas=False)
>>> data.exog = sm.add_constant(data.exog)
>>> rlm_model = sm.RLM(data.endog, data.exog,                            M=sm.robust.norms.HuberT())

>>> rlm_results = rlm_model.fit()
>>> rlm_results.params
array([  0.82938433,   0.92606597,  -0.12784672, -41.02649835])
>>> rlm_results.bse
array([ 0.11100521,  0.30293016,  0.12864961,  9.79189854])
>>> rlm_results_HC2 = rlm_model.fit(cov="H2")
>>> rlm_results_HC2.params
array([  0.82938433,   0.92606597,  -0.12784672, -41.02649835])
>>> rlm_results_HC2.bse
array([ 0.11945975,  0.32235497,  0.11796313,  9.08950419])
>>> mod = sm.RLM(data.endog, data.exog, M=sm.robust.norms.Hampel())
>>> rlm_hamp_hub = mod.fit(scale_est=sm.robust.scale.HuberScale())
>>> rlm_hamp_hub.params
array([  0.73175452,   1.25082038,  -0.14794399, -40.27122257])

Attributes

df_modelfloat

The degrees of freedom of the model.  The number of regressors p less
one for the intercept.  Note that the reported model degrees
of freedom does not count the intercept as a regressor, though
the model is assumed to have an intercept.

df_residfloat

The residual degrees of freedom.  The number of observations n
less the number of regressors p.  Note that here p does include
the intercept as using a degree of freedom.

endogndarray

See above.  Note that endog is a reference to the data so that if
data is already an array and it is changed, then endog changes
as well.

exogndarray

See above.  Note that endog is a reference to the data so that if
data is already an array and it is changed, then endog changes
as well.

Mstatsmodels.robust.norms.RobustNorm

See above.  Robust estimator instance instantiated.

nobsfloat

The number of observations n

pinv_wexogndarray

The pseudoinverse of the design / exogenous data array.  Note that
RLM has no whiten method, so this is just the pseudo inverse of the
design.

normalized_cov_paramsndarray

The p x p normalized covariance of the design / exogenous data.
This is approximately equal to (X.T X)^(-1)

Methods

<colgroup>
<col style="width: 10%"/>
<col style="width: 90%"/>
</colgroup>

deviance(tmp_results)

Returns the (unnormalized) log-likelihood from the M estimator.

fit([maxiter, tol, scale_est, init, cov, …])

Fits the model using iteratively reweighted least squares.

from_formula(formula, data[, subset, drop_cols])

Create a Model from a formula and dataframe.

hessian(params)

The Hessian matrix of the model.

information(params)

Fisher information matrix of model.

initialize()

Initialize (possibly re-initialize) a Model instance.

loglike(params)

Log-likelihood of model.

predict(params[, exog])

Return linear predicted values from a design matrix.

score(params)

Score vector of model.

Methods

<colgroup>
<col style="width: 10%"/>
<col style="width: 90%"/>
</colgroup>

deviance(tmp_results)

Returns the (unnormalized) log-likelihood from the M estimator.

fit([maxiter, tol, scale_est, init, cov, …])

Fits the model using iteratively reweighted least squares.

from_formula(formula, data[, subset, drop_cols])

Create a Model from a formula and dataframe.

hessian(params)

The Hessian matrix of the model.

information(params)

Fisher information matrix of model.

initialize()

Initialize (possibly re-initialize) a Model instance.

loglike(params)

Log-likelihood of model.

predict(params[, exog])

Return linear predicted values from a design matrix.

score(params)

Score vector of model.

Properties

<colgroup>
<col style="width: 10%"/>
<col style="width: 90%"/>
</colgroup>

endog_names

Names of endogenous variables.

exog_names

Names of exogenous variables.

                   Previous  Weight Functions

  Next  statsmodels.robust.robust_linear_model.RLM.deviance

              © Copyright 2009-2019, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers.

            Last updated on
              Aug 27, 2020.

            Created using
            Sphinx 3.2.1.
             and
            Material for
              Sphinx


text:
#include <aws/core/client/AWSError.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/importexport/ImportExportErrors.h>

using namespace Aws::Client;
using namespace Aws::Utils;
using namespace Aws::ImportExport;

namespace Aws
{
namespace ImportExport
{
namespace ImportExportErrorMapper
{

static const int INVALID_VERSION_HASH = HashingUtils::HashString("InvalidVersionException");
static const int INVALID_ADDRESS_HASH = HashingUtils::HashString("InvalidAddressException");
static const int EXPIRED_JOB_ID_HASH = HashingUtils::HashString("ExpiredJobIdException");
static const int UNABLE_TO_CANCEL_JOB_ID_HASH = HashingUtils::HashString("UnableToCancelJobIdException");
static const int INVALID_CUSTOMS_HASH = HashingUtils::HashString("InvalidCustomsException");
static const int INVALID_JOB_ID_HASH = HashingUtils::HashString("InvalidJobIdException");
static const int CREATE_JOB_QUOTA_EXCEEDED_HASH = HashingUtils::HashString("CreateJobQuotaExceededException");
static const int UNABLE_TO_UPDATE_JOB_ID_HASH = HashingUtils::HashString("UnableToUpdateJobIdException");
static const int MISSING_MANIFEST_FIELD_HASH = HashingUtils::HashString("MissingManifestFieldException");
static const int INVALID_PARAMETER_HASH = HashingUtils::HashString("InvalidParameterException");
static const int CANCELED_JOB_ID_HASH = HashingUtils::HashString("CanceledJobIdException");
static const int NO_SUCH_BUCKET_HASH = HashingUtils::HashString("NoSuchBucketException");
static const int MALFORMED_MANIFEST_HASH = HashingUtils::HashString("MalformedManifestException");
static const int INVALID_FILE_SYSTEM_HASH = HashingUtils::HashString("InvalidFileSystemException");
static const int BUCKET_PERMISSION_HASH = HashingUtils::HashString("BucketPermissionException");
static const int MULTIPLE_REGIONS_HASH = HashingUtils::HashString("MultipleRegionsException");
static const int INVALID_MANIFEST_FIELD_HASH = HashingUtils::HashString("InvalidManifestFieldException");
static const int MISSING_CUSTOMS_HASH = HashingUtils::HashString("MissingCustomsException");

AWSError<CoreErrors> GetErrorForName(const char* errorName)
{
  int hashCode = HashingUtils::HashString(errorName);

  if (hashCode == INVALID_VERSION_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(ImportExportErrors::INVALID_VERSION), false);
  }
  else if (hashCode == INVALID_ADDRESS_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(ImportExportErrors::INVALID_ADDRESS), false);
  }
  else if (hashCode == EXPIRED_JOB_ID_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(ImportExportErrors::EXPIRED_JOB_ID), false);
  }
  else if (hashCode == UNABLE_TO_CANCEL_JOB_ID_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(ImportExportErrors::UNABLE_TO_CANCEL_JOB_ID), false);
  }
  else if (hashCode == INVALID_CUSTOMS_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(ImportExportErrors::INVALID_CUSTOMS), false);
  }
  else if (hashCode == INVALID_JOB_ID_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(ImportExportErrors::INVALID_JOB_ID), false);
  }
  else if (hashCode == CREATE_JOB_QUOTA_EXCEEDED_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(ImportExportErrors::CREATE_JOB_QUOTA_EXCEEDED), false);
  }
  else if (hashCode == UNABLE_TO_UPDATE_JOB_ID_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(ImportExportErrors::UNABLE_TO_UPDATE_JOB_ID), false);
  }
  else if (hashCode == MISSING_MANIFEST_FIELD_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(ImportExportErrors::MISSING_MANIFEST_FIELD), false);
  }
  else if (hashCode == INVALID_PARAMETER_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(ImportExportErrors::INVALID_PARAMETER), false);
  }
  else if (hashCode == CANCELED_JOB_ID_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(ImportExportErrors::CANCELED_JOB_ID), false);
  }
  else if (hashCode == NO_SUCH_BUCKET_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(ImportExportErrors::NO_SUCH_BUCKET), false);
  }
  else if (hashCode == MALFORMED_MANIFEST_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(ImportExportErrors::MALFORMED_MANIFEST), false);
  }
  else if (hashCode == INVALID_FILE_SYSTEM_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(ImportExportErrors::INVALID_FILE_SYSTEM), false);
  }
  else if (hashCode == BUCKET_PERMISSION_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(ImportExportErrors::BUCKET_PERMISSION), false);
  }
  else if (hashCode == MULTIPLE_REGIONS_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(ImportExportErrors::MULTIPLE_REGIONS), false);
  }
  else if (hashCode == INVALID_MANIFEST_FIELD_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(ImportExportErrors::INVALID_MANIFEST_FIELD), false);
  }
  else if (hashCode == MISSING_CUSTOMS_HASH)
  {
    return AWSError<CoreErrors>(static_cast<CoreErrors>(ImportExportErrors::MISSING_CUSTOMS), false);
  }
  return AWSError<CoreErrors>(CoreErrors::UNKNOWN, false);
}

} // namespace ImportExportErrorMapper
} // namespace ImportExport
} // namespace Aws


text:
using XData.Data.Helpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;

namespace XData.Data.Schema
{
    public class ConfigPluralMapper : Mapper, IMapper
    {
        protected XElement Config;
        protected ConfigNameMapping ConfigNameMapping;
        protected PluralNameMapping PluralNameMapping = new PluralNameMapping();

        public ConfigPluralMapper(XElement config) : base()
        {
            Config = config;
            ConfigNameMapping = new ConfigNameMapping(Config);
        }

        public ConfigPluralMapper(string fileName) : this(LoadFromFile(fileName))
        {
        }

        protected override string GetCollectionName(string tableName)
        {
            string name = ConfigNameMapping.GetCollectionName(tableName);
            return (string.IsNullOrWhiteSpace(name)) ? PluralNameMapping.GetCollectionName(tableName) : name;
        }

        protected override string GetEntityName(string tableName)
        {
            string name = ConfigNameMapping.GetEntityName(tableName);
            return (string.IsNullOrWhiteSpace(name)) ? PluralNameMapping.GetEntityName(tableName) : name;
        }

        protected override string GetPropertyName(string tableName, string columnName)
        {
            string name = ConfigNameMapping.GetPropertyName(tableName, columnName);
            return (string.IsNullOrWhiteSpace(name)) ? PluralNameMapping.GetPropertyName(tableName, columnName) : name;
        }

        protected static XElement LoadFromFile(string fileName)
        {
            return ElementHelper.LoadFromFile(fileName);
        }

    }
}


text:
package com.google.gerrit.server.notedb;

import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assert_;
import static com.google.gerrit.truth.OptionalSubject.assertThat;

import com.google.gerrit.exceptions.StorageException;
import com.google.gerrit.git.LockFailureException;
import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.server.extensions.events.GitReferenceUpdated;
import java.io.IOException;
import org.eclipse.jgit.errors.IncorrectObjectTypeException;
import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription;
import org.eclipse.jgit.internal.storage.dfs.InMemoryRepository;
import org.eclipse.jgit.junit.TestRepository;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.RefUpdate;
import org.eclipse.jgit.revwalk.RevWalk;
import org.junit.Before;
import org.junit.Test;

public class IntBlobTest {
  // Note: Can't easily test GitRefUpdated behavior, since binding GitRefUpdated requires a thick
  // stack of dependencies, and it's not just a simple interface or abstract class.

  private Project.NameKey projectName;
  private InMemoryRepository repo;
  private TestRepository<InMemoryRepository> tr;
  private RevWalk rw;

  @Before
  public void setUp() throws Exception {
    projectName = new Project.NameKey("repo");
    repo = new InMemoryRepository(new DfsRepositoryDescription(projectName.get()));
    tr = new TestRepository<>(repo);
    rw = tr.getRevWalk();
  }

  @Test
  public void parseNoRef() throws Exception {
    assertThat(IntBlob.parse(repo, "refs/nothing")).isEmpty();
  }

  @Test
  public void parseNonBlob() throws Exception {
    String refName = "refs/foo/master";
    tr.branch(refName).commit().create();
    try {
      IntBlob.parse(repo, refName);
      assert_().fail("Expected IncorrectObjectTypeException");
    } catch (IncorrectObjectTypeException e) {
      // Expected.
    }
  }

  @Test
  public void parseValid() throws Exception {
    String refName = "refs/foo";
    ObjectId id = tr.update(refName, tr.blob("123"));
    assertThat(IntBlob.parse(repo, refName)).value().isEqualTo(IntBlob.create(id, 123));
  }

  @Test
  public void parseWithWhitespace() throws Exception {
    String refName = "refs/foo";
    ObjectId id = tr.update(refName, tr.blob(" 123 "));
    assertThat(IntBlob.parse(repo, refName)).value().isEqualTo(IntBlob.create(id, 123));
  }

  @Test
  public void parseInvalid() throws Exception {
    String refName = "refs/foo";
    ObjectId id = tr.update(refName, tr.blob("1 2 3"));
    try {
      IntBlob.parse(repo, refName);
      assert_().fail("Expected StorageException");
    } catch (StorageException e) {
      assertThat(e).hasMessageThat().isEqualTo("invalid value in refs/foo blob at " + id.name());
    }
  }

  @Test
  public void tryStoreNoOldId() throws Exception {
    String refName = "refs/foo";
    RefUpdate ru =
        IntBlob.tryStore(repo, rw, projectName, refName, null, 123, GitReferenceUpdated.DISABLED);
    assertThat(ru.getResult()).isEqualTo(RefUpdate.Result.NEW);
    assertThat(ru.getName()).isEqualTo(refName);
    assertThat(IntBlob.parse(repo, refName))
        .value()
        .isEqualTo(IntBlob.create(ru.getNewObjectId(), 123));
  }

  @Test
  public void tryStoreOldIdZero() throws Exception {
    String refName = "refs/foo";
    RefUpdate ru =
        IntBlob.tryStore(
            repo, rw, projectName, refName, ObjectId.zeroId(), 123, GitReferenceUpdated.DISABLED);
    assertThat(ru.getResult()).isEqualTo(RefUpdate.Result.NEW);
    assertThat(ru.getName()).isEqualTo(refName);
    assertThat(IntBlob.parse(repo, refName))
        .value()
        .isEqualTo(IntBlob.create(ru.getNewObjectId(), 123));
  }

  @Test
  public void tryStoreCorrectOldId() throws Exception {
    String refName = "refs/foo";
    ObjectId id = tr.update(refName, tr.blob("123"));
    RefUpdate ru =
        IntBlob.tryStore(repo, rw, projectName, refName, id, 456, GitReferenceUpdated.DISABLED);
    assertThat(ru.getResult()).isEqualTo(RefUpdate.Result.FORCED);
    assertThat(ru.getName()).isEqualTo(refName);
    assertThat(IntBlob.parse(repo, refName))
        .value()
        .isEqualTo(IntBlob.create(ru.getNewObjectId(), 456));
  }

  @Test
  public void tryStoreWrongOldId() throws Exception {
    String refName = "refs/foo";
    RefUpdate ru =
        IntBlob.tryStore(
            repo,
            rw,
            projectName,
            refName,
            ObjectId.fromString("deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"),
            123,
            GitReferenceUpdated.DISABLED);
    assertThat(ru.getResult()).isEqualTo(RefUpdate.Result.LOCK_FAILURE);
    assertThat(ru.getName()).isEqualTo(refName);
    assertThat(IntBlob.parse(repo, refName)).isEmpty();
  }

  @Test
  public void storeNoOldId() throws Exception {
    String refName = "refs/foo";
    IntBlob.store(repo, rw, projectName, refName, null, 123, GitReferenceUpdated.DISABLED);
    assertThat(IntBlob.parse(repo, refName))
        .value()
        .isEqualTo(IntBlob.create(getRef(refName), 123));
  }

  @Test
  public void storeOldIdZero() throws Exception {
    String refName = "refs/foo";
    IntBlob.store(
        repo, rw, projectName, refName, ObjectId.zeroId(), 123, GitReferenceUpdated.DISABLED);
    assertThat(IntBlob.parse(repo, refName))
        .value()
        .isEqualTo(IntBlob.create(getRef(refName), 123));
  }

  @Test
  public void storeCorrectOldId() throws Exception {
    String refName = "refs/foo";
    ObjectId id = tr.update(refName, tr.blob("123"));
    IntBlob.store(repo, rw, projectName, refName, id, 456, GitReferenceUpdated.DISABLED);
    assertThat(IntBlob.parse(repo, refName))
        .value()
        .isEqualTo(IntBlob.create(getRef(refName), 456));
  }

  @Test
  public void storeWrongOldId() throws Exception {
    String refName = "refs/foo";
    try {
      IntBlob.store(
          repo,
          rw,
          projectName,
          refName,
          ObjectId.fromString("deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"),
          123,
          GitReferenceUpdated.DISABLED);
      assert_().fail("expected LockFailureException");
    } catch (LockFailureException e) {
      assertThat(e.getFailedRefs()).containsExactly("refs/foo");
    }
    assertThat(IntBlob.parse(repo, refName)).isEmpty();
  }

  private ObjectId getRef(String refName) throws IOException {
    return repo.exactRef(refName).getObjectId();
  }
}


text:
#ifndef DALI_INTERNAL_PROPERTY_CONSTRAINT_PTR_H
#define DALI_INTERNAL_PROPERTY_CONSTRAINT_PTR_H

// INTERNAL INCLUDES
#include <dali/internal/common/owner-pointer.h>
#include <dali/internal/event/animation/property-constraint.h>

namespace Dali
{
namespace Internal
{
template<class P>
struct PropertyConstraintPtr
{
  using Type = OwnerPointer<PropertyConstraint<P> >;
};

} // namespace Internal

} // namespace Dali

#endif // DALI_INTERNAL_PROPERTY_CONSTRAINT_PTR_H


text:
package com.cherish.cdsnapp;

import android.app.Activity;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Looper;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.Toast;

import com.cherish.bean.CommonException;
import com.cherish.cdsnapp.bean.News;
import com.cherish.cdsnapp.dao.NewsDto;

import java.util.List;

import me.maxwin.view.XListView;

public class NewsContentActivity extends Activity{
    //private XListView mListView;
    private ListView mListView;

    /**
     * 该页面的url
     */
    private String url;
    private NewsDto newsDto;
    private List<News> mDatas;

    private ProgressBar mProgressBar;
    private NewContentAdapter mAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.news_content);

        newsDto = new NewsDto();

        Bundle extras = getIntent().getExtras();
        url = extras.getString("url");

        mAdapter = new NewContentAdapter(this);

        //mListView = (XListView) findViewById(R.id.id_listview);
        mListView = (ListView) findViewById(R.id.id_listview);
        mProgressBar = (ProgressBar) findViewById(R.id.id_newsContentPro);

        mListView.setAdapter(mAdapter);
        //mListView.setPullLoadEnable(true);
        //mListView.setXListViewListener(this);

        mProgressBar.setVisibility(View.VISIBLE);
        //onRefresh();
        new LoadDataTask().execute();

        mListView.setOnItemClickListener(new AdapterView.OnItemClickListener()
        {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id)
            {

                News news = mDatas.get(position);
                String imageLink = news.getImageLink();
                //Toast.makeText(NewContentActivity.this, imageLink, 1).show();
                Intent intent = new Intent(NewsContentActivity.this,ImageShowActivity.class);
                intent.putExtra("url", imageLink);
                startActivity(intent);
            }
        });

    }

    class LoadDataTask extends AsyncTask<Void,Void,Void> {
        @Override
        protected Void doInBackground(Void... params) {
            try
            {
                //NewsDto mNewsDto = newsDto.getNews(url);
                List<News> list = newsDto.getNewsMobile(url);
                //mDatas = mNewsDto.getNewses();
                mDatas = list;
            } catch (CommonException e)
            {
                Looper.prepare();
                Toast.makeText(getApplicationContext(), e.getMessage(), Toast.LENGTH_SHORT).show();
                Looper.loop();
            }

            return null;
        }

        @Override
        protected void onPostExecute(Void aVoid) {
            if(mDatas == null)
                return ;
            mAdapter.addList(mDatas);
            mAdapter.notifyDataSetChanged();
            mProgressBar.setVisibility(View.GONE);
        }
    }

    /**
     * 点击返回按钮
     * @param view
     */
    public void back(View view)
    {
        finish();
    }

    public void copyright(View view)
    {
        Intent intent = new Intent(this,copyrightActivity.class);
        startActivity(intent);
    }

}


text:
package main

import (
	"fmt"
	"strconv"
)

// check takes id[s] of torrent[s] or 'all' to verify them
func check(tokens []string) {
	// make sure that we got at least one argument
	if len(tokens) == 0 {
		send("check: needs an argument", false)
		return
	}

	torrents, err := rtorrent.Torrents()
	if err != nil {
		logger.Print("check:", err)
		send("check: "+err.Error(), false)
		return
	}

	// if the first argument is 'all' then start all torrents
	if tokens[0] == "all" {
		if err := rtorrent.Check(torrents...); err != nil {
			logger.Print("check:", err)
			send("check: error occurred while verifying some torrents", false)
			return
		}
		send("hash checking all torrents", false)
		return

	}

	for _, i := range tokens {
		id, err := strconv.Atoi(i)
		if err != nil {
			send(fmt.Sprintf("check: %s is not a number", i), false)
			continue
		}

		if id >= len(torrents) || id < 0 {
			send(fmt.Sprintf("Check: No torrent with an ID of '%d'", id), false)
			continue
		}

		if err := rtorrent.Check(torrents[id]); err != nil {
			logger.Print("Check:", err)
			send("Check: "+err.Error(), false)
			continue
		}
		send(fmt.Sprintf("Checking: %s", torrents[id].Name), false)
	}
}


text:
var bing = require('../lib/bing-api');
var client = new bing.SearchClient({appId: process.env.BING_APP_ID});
client.search("variolabs", function(error, response, data) {

  if (!error && response.statusCode == 200)
  {
    console.log("SUCCESS: Found " + data.SearchResponse.Web.Results.length + " results");
  } else {
    console.log("ERROR! " + error + "/" + response.statusCode);
  }

});


text:
package com.sproutlife.model.echosystem;

import java.awt.Point;
import java.util.HashSet;
import java.util.Random;

/**
 * Class used for keeping track of an Organism's attributes some of which are
 * experimental. For the sake of speed we implement these as variables rather
 * than using a hashtable.
 *
 * @author Alex Shapiro
 *
 */
public class OrgAttributes {
    public int colorKind = 0;

    // territory is used to track all visited points
    public HashSet<Point> territory;
    // territoryProduct is the sum of territory size at every timestep
    public double territoryProduct = 0;
    public int competitiveScore = 0;
    public int cellSum = 0;

    public int maxCells;
    public int parentAgeAtBirth;
    public int birthOrder;
    public int collisionCount=0;

    public OrgAttributes(Organism o) {
        this.territory = new HashSet<Point>();
        this.maxCells = 0;

        Organism parent = o.getParent();
        if (parent==null) {
            this.colorKind = (new Random()).nextInt(3);
            this.birthOrder = 0;
        }
        else {
            this.colorKind = parent.getAttributes().colorKind;
            this.parentAgeAtBirth = parent.getAge();
            this.birthOrder = parent.getChildren().size();
        }
    }

    public int getTerritorySize() {
        return territory.size();
    }
}


text:
""" Code to feed information from the optimizer via the resume code into the
optimizer of the bridge attached to a guard. """

from rpython.jit.metainterp import resumecode

# adds the following sections at the end of the resume code:
#
# ---- known classes
# <bitfield> size is the number of reference boxes in the liveboxes
#            1 klass known
#            0 klass unknown
#            (the class is found by actually looking at the runtime value)
#            the bits are bunched in bunches of 7
#
# ---- heap knowledge
# <length>
# (<box1> <descr> <box2>) length times, if getfield(box1, descr) == box2
#                         both boxes should be in the liveboxes
#
# ----

# maybe should be delegated to the optimization classes?

def tag_box(box, liveboxes_from_env, memo):
    from rpython.jit.metainterp.history import Const
    if isinstance(box, Const):
        return memo.getconst(box)
    else:
        return liveboxes_from_env[box] # has to exist

def decode_box(resumestorage, tagged, liveboxes, cpu):
    from rpython.jit.metainterp.resume import untag, TAGCONST, TAGINT, TAGBOX
    from rpython.jit.metainterp.resume import NULLREF, TAG_CONST_OFFSET, tagged_eq
    from rpython.jit.metainterp.history import ConstInt
    num, tag = untag(tagged)
    # NB: the TAGVIRTUAL case can't happen here, because this code runs after
    # virtuals are already forced again
    if tag == TAGCONST:
        if tagged_eq(tagged, NULLREF):
            box = cpu.ts.CONST_NULL
        else:
            box = resumestorage.rd_consts[num - TAG_CONST_OFFSET]
    elif tag == TAGINT:
        box = ConstInt(num)
    elif tag == TAGBOX:
        box = liveboxes[num]
    else:
        raise AssertionError("unreachable")
    return box

def serialize_optimizer_knowledge(optimizer, numb_state, liveboxes, liveboxes_from_env, memo):
    available_boxes = {}
    for box in liveboxes:
        if box is not None and box in liveboxes_from_env:
            available_boxes[box] = None
    metainterp_sd = optimizer.metainterp_sd

    # class knowledge is stored as bits, true meaning the class is known, false
    # means unknown. on deserializing we look at the bits, and read the runtime
    # class for the known classes (which has to be the same in the bridge) and
    # mark that as known. this works for guard_class too: the class is only
    # known *after* the guard
    bitfield = 0
    shifts = 0
    for box in liveboxes:
        if box is None or box.type != "r":
            continue
        info = optimizer.getptrinfo(box)
        known_class = info is not None and info.get_known_class(optimizer.cpu) is not None
        bitfield <<= 1
        bitfield |= known_class
        shifts += 1
        if shifts == 6:
            numb_state.append_int(bitfield)
            bitfield = shifts = 0
    if shifts:
        numb_state.append_int(bitfield << (6 - shifts))

    # heap knowledge: we store triples of known heap fields in non-virtual
    # structs
    # XXX could be extended to arrays
    if optimizer.optheap:
        triples = optimizer.optheap.serialize_optheap(available_boxes)
        # can only encode descrs that have a known index into
        # metainterp_sd.all_descrs
        triples = [triple for triple in triples if triple[1].descr_index != -1]
        numb_state.append_int(len(triples))
        for box1, descr, box2 in triples:
            index = descr.descr_index
            numb_state.append_short(tag_box(box1, liveboxes_from_env, memo))
            numb_state.append_int(index)
            numb_state.append_short(tag_box(box2, liveboxes_from_env, memo))
    else:
        numb_state.append_int(0)

def deserialize_optimizer_knowledge(optimizer, resumestorage, frontend_boxes, liveboxes):
    reader = resumecode.Reader(resumestorage.rd_numb)
    assert len(frontend_boxes) == len(liveboxes)
    metainterp_sd = optimizer.metainterp_sd

    # skip resume section
    startcount = reader.next_item()
    reader.jump(startcount - 1)

    # class knowledge
    bitfield = 0
    mask = 0
    for i, box in enumerate(liveboxes):
        if box.type != "r":
            continue
        if not mask:
            bitfield = reader.next_item()
            mask = 0b100000
        class_known = bitfield & mask
        mask >>= 1
        if class_known:
            cls = optimizer.cpu.ts.cls_of_box(frontend_boxes[i])
            optimizer.make_constant_class(box, cls)

    # heap knowledge
    if not optimizer.optheap:
        return
    length = reader.next_item()
    result = []
    for i in range(length):
        tagged = reader.next_item()
        box1 = decode_box(resumestorage, tagged, liveboxes, metainterp_sd.cpu)
        index = reader.next_item()
        descr = metainterp_sd.all_descrs[index]
        tagged = reader.next_item()
        box2 = decode_box(resumestorage, tagged, liveboxes, metainterp_sd.cpu)
        result.append((box1, descr, box2))
    optimizer.optheap.deserialize_optheap(result)


text:
--TEST--
Test lstat() and stat() functions: usage variations - effects of touch() on file
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
if (substr(PHP_OS, 0, 3) == 'WIN') {
    die('skip.. Not valid for Windows');
}
?>
--FILE--
<?php
/* Prototype: array lstat ( string $filename );
   Description: Gives information about a file or symbolic link

   Prototype: array stat ( string $filename );
   Description: Gives information about a file
*/

/* test the effects of touch() on stats of file */

$file_path = dirname(__FILE__);
require "$file_path/file.inc";

/* create temp file  */

$file_name = "$file_path/lstat_stat_variation4.tmp";
$fp = fopen($file_name, "w");  // temp file
fclose($fp);

// touch a file check stat, there should be difference in atime
echo "*** Testing stat() for file after using touch() on the file ***\n";
$old_stat = stat($file_name);
// clear the cache
clearstatcache();
sleep(2);
var_dump( touch($file_name) );
$new_stat = stat($file_name);

// compare self stats
var_dump( compare_self_stat($old_stat) );
var_dump( compare_self_stat($new_stat) );

// compare the stat
$affected_members = array(8, 'atime');
var_dump( compare_stats($old_stat, $new_stat, $affected_members, "<") );
// clear the cache
clearstatcache();

echo "\n--- Done ---";
?>

--CLEAN--
<?php
$file_path = dirname(__FILE__);
unlink("$file_path/lstat_stat_variation4.tmp");
?>
--EXPECTF--
*** Testing stat() for file after using touch() on the file ***
bool(true)
bool(true)
bool(true)
bool(true)

--- Done ---


text:
require 'test_helper'

class NodesHelperTest < ActionView::TestCase
end


text:
@interface PodsDummy_Pods_ABCFrameWorkTests : NSObject
@end
@implementation PodsDummy_Pods_ABCFrameWorkTests
@end


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Proc. Roy. Soc. Queensland 67(4):27, t. 3. 1956

#### Original name
null

### Remarks
null


text:
.. include:: /_includes/core/announcement.rst

.. _core-walkthrough:

What is Ray Core?
=================

Ray Core provides a small number of core primitives (i.e., tasks, actors, objects) for building and scaling distributed applications. Below we'll walk through simple examples that show you how to turn your functions and classes easily into Ray tasks and actors, and how to work with Ray objects.

Getting Started
---------------

To get started, install Ray via ``pip install -U ray``. See :ref:`Installing Ray <installation>` for more installation options. The following few sections will walk through the basics of using Ray Core.

The first step is to import and initialize Ray:

.. literalinclude:: doc_code/getting_started.py
    :language: python
    :start-after: __starting_ray_start__
    :end-before: __starting_ray_end__

.. note::

  In recent versions of Ray (>=1.5), ``ray.init()`` is automatically called on the first use of a Ray remote API.

Running a Task
--------------

Ray lets you run functions as remote tasks in the cluster. To do this, you decorate your function with ``@ray.remote`` to declare that you want to run this function remotely.
Then, you call that function with ``.remote()`` instead of calling it normally.
This remote call returns a future, a so-called Ray *object reference*, that you can then fetch with ``ray.get``:

.. literalinclude:: doc_code/getting_started.py
    :language: python
    :start-after: __running_task_start__
    :end-before: __running_task_end__

Calling an Actor
----------------

Ray provides actors to allow you to parallelize computation across multiple actor instances. When you instantiate a class that is a Ray actor, Ray will start a remote instance of that class in the cluster. This actor can then execute remote method calls and maintain its own internal state:

.. literalinclude:: doc_code/getting_started.py
    :language: python
    :start-after: __calling_actor_start__
    :end-before: __calling_actor_end__

The above covers very basic actor usage. For a more in-depth example, including using both tasks and actors together, check out :ref:`monte-carlo-pi`.

Passing an Object
-----------------

As seen above, Ray stores task and actor call results in its :ref:`distributed object store <objects-in-ray>`, returning *object references* that can be later retrieved. Object references can also be created explicitly via ``ray.put``, and object references can be passed to tasks as substitutes for argument values:

.. literalinclude:: doc_code/getting_started.py
    :language: python
    :start-after: __passing_object_start__
    :end-before: __passing_object_end__

Next Steps
----------

Ray's key primitives are simple, but can be composed together to express almost any kind of distributed computation.
Learn more about Ray's :ref:`key concepts <core-key-concepts>` with the following user guides:

.. panels::
    :container: container pb-4
    :column: col-md-4 px-2 py-2
    :img-top-cls: pt-5 w-50 d-block mx-auto

    ---
    :img-top: /images/tasks.png

    .. link-button:: ray-remote-functions
        :type: ref
        :text: Using remote functions (Tasks)
        :classes: btn-link btn-block stretched-link

    ---
    :img-top: /images/actors.png

    .. link-button:: ray-remote-classes
        :type: ref
        :text: Using remote classes (Actors)
        :classes: btn-link btn-block stretched-link

    ---
    :img-top: /images/objects.png

    .. link-button:: objects-in-ray
        :type: ref
        :text: Working with Ray Objects
        :classes: btn-link btn-block stretched-link

.. include:: /_includes/core/announcement_bottom.rst


text:
package com.google.android.gms.example.bannerexample;

import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import com.google.android.gms.ads.doubleclick.PublisherAdRequest;
import com.google.android.gms.ads.doubleclick.PublisherAdView;

/**
 * Main Activity. Inflates main activity xml and child fragments.
 */
public class MyActivity extends AppCompatActivity {

    private PublisherAdView adView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my);

        // Gets the ad view defined in layout/ad_fragment.xml with ad unit ID set in
        // values/strings.xml.
        adView = findViewById(R.id.ad_view);

        // Create an ad request. Check logcat output for the hashed device ID to
        // get test ads on a physical device. e.g.
        // "Use AdRequest.Builder.addTestDevice("ABCDEF012345") to get test ads on this device."
        PublisherAdRequest adRequest = new PublisherAdRequest.Builder().build();

        // Start loading the ad in the background.
        adView.loadAd(adRequest);
    }

    /** Called when leaving the activity */
    @Override
    public void onPause() {
        if (adView != null) {
            adView.pause();
        }
        super.onPause();
    }

    /** Called when returning to the activity */
    @Override
    public void onResume() {
        super.onResume();
        if (adView != null) {
            adView.resume();
        }
    }

    /** Called before the activity is destroyed */
    @Override
    public void onDestroy() {
        if (adView != null) {
            adView.destroy();
        }
        super.onDestroy();
    }
}


text:
A dead simple round-robin array iterator

[![build
status](https://secure.travis-ci.org/watson/roundround.png)](http://travis-ci.org/watson/roundround)

## Install

```
npm install roundround
```

## Usage

```javascript
var roundround = require('roundround');

// Initialize RoundRound with any Array (null or undefined are ok as well, so no
// guards necessary)
var rr = roundround([1,2,3]);

// Then call the result to get the next element in the array
rr(); // => 1
rr(); // => 2
rr(); // => 3

// When reaching the end of the internal array, the iterator starts over from
// the beginning
rr(); // => 1

// You can also specify an index from where RoundRound should start
var rr = roundround([1,2,3], 1);
rr(); // => 2
```

## License

MIT


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

require_once(APPPATH."libraries/Admin_controller.php");

class Inventorypackage extends Admin_Controller
{

    function __construct()
    {
        parent::__construct();

        if(!is_logged_in())
            redirect('login');

       $this->load->model('inventorypackage_model');
	   $this->load->library('listing');

	}

	 public function index()
    {

        $this->layout->add_javascripts(array('listing'));

        $this->load->library('listing');

        $this->simple_search_fields = array(
                                    'name'       => 'Name',
                                    'status'     => 'Status'
        );

        $this->_narrow_search_conditions = array("start_date");

        $str = '

                ';

        $this->listing->initialize(array('listing_action' => $str));

        $listing = $this->listing->get_listings('inventorypackage_model', 'listing');

        if($this->input->is_ajax_request())
            $this->_ajax_output(array('listing' => $listing), TRUE);

        $this->data['bulk_actions'] = array('' => 'select', 'delete' => 'Delete');
        $this->data['simple_search_fields'] = $this->simple_search_fields;
        $this->data['search_conditions'] = $this->session->userdata($this->namespace.'_search_conditions');
        $this->data['per_page'] = $this->listing->_get_per_page();
        $this->data['per_page_options'] = array_combine($this->listing->_get_per_page_options(), $this->listing->_get_per_page_options());

        $this->data['search_bar'] = $this->load->view('listing/search_bar', $this->data, TRUE);

        $this->data['listing'] = $listing;

        $this->data['grid'] = $this->load->view('listing/view', $this->data, TRUE);

        $this->layout->view("frontend/inventory/package/index");

    }

    public function add( $edit_id ='')
    {
        try
        {
            if($this->input->post('edit_id'))
                $edit_id = $this->input->post('edit_id');

            $this->form_validation->set_rules('name','Package Name','trim|required');

            $this->form_validation->set_error_delimiters('', '');

            if ($this->form_validation->run())
            {
                $ins_data = array();
                $ins_data['name']       = $this->input->post('name');
                $ins_data['status']     = $this->input->post('status');

                if($edit_id)
                {
                    $ins_data['updated_date'] = date('Y-m-d H:i:s');
                    $ins_data['updated_id']   = get_current_user_id();
                    $this->inventorypackage_model->update(array("id" => $edit_id),$ins_data);

                    $msg = 'Package updated successfully';
                }
                else
                {
                    $ins_data['created_date'] = date('Y-m-d H:i:s');
                    $ins_data['updated_date'] = date('Y-m-d H:i:s');
                    $ins_data['created_id']   = get_current_user_id();

                    $this->inventorypackage_model->insert($ins_data);

                    $msg = 'Package added successfully';
                }

                $this->session->set_flashdata('success_msg',$msg,TRUE);

                redirect('inventorypackage');
            }
            else
            {
                $edit_data = array();
                $edit_data['id']          = '';
                $edit_data['name']        = '';
                $edit_data['status']      = '';
            }
        }
        catch (Exception $e)
        {
            $this->data['status']   = 'error';
            $this->data['message']  = $e->getMessage();

        }

        if($edit_id)
            $edit_data =$this->inventorypackage_model->get_where(array("id" => $edit_id))->row_array();

         $this->data['editdata']  = $edit_data;
         $this->layout->view('frontend/inventory/package/add');
    }

    public function delete($del_id)
    {
        $access_data = $this->inventorypackage_model->get_where(array("id"=>$del_id),'id')->row_array();

        $output=array();

        if(count($access_data) > 0){

            $this->inventorypackage_model->delete(array("id"=>$del_id));

            $output['message'] ="Record deleted successfuly.";
            $output['status']  = "success";
        }
        else
        {
           $output['message'] ="This record not matched by Inventory.";
           $output['status']  = "error";
        }

        $this->_ajax_output($output, TRUE);

    }

}
?>


text:
package org.apache.tapestry5.ioc.test;

import org.apache.tapestry5.ioc.annotations.ImportModule;

@ImportModule(SkelterModule.class)
public class HelterModule
{
    public Runnable buildHelter()
    {
        return null;
    }
}


text:
import nnabla as nn
import nnabla.functions as F
from nnabla.initializer import (
    calc_uniform_lim_glorot,
    ConstantInitializer, UniformInitializer)

from .module import Module

class Convolution(Module):
    """N-D Convolution with a bias term.

    For Dilated Convolution (a.k.a. Atrous Convolution), refer to:

    - Chen et al., DeepLab: Semantic Image Segmentation with Deep Convolutional Nets, Atrous Convolution, and Fully Connected CRFs. https://arxiv.org/abs/1606.00915

    - Yu et al., Multi-Scale Context Aggregation by Dilated Convolutions. https://arxiv.org/abs/1511.07122

    Note:

        Convolution is a computationally intensive operation that
        should preferably be run with the `cudnn` backend. NNabla
        then uses CuDNN library functions to determine and cache the
        fastest algorithm for the given set of convolution parameters,
        which results in additional memory consumption which may pose
        a problem for GPUs with insufficient memory size. In that
        case, the `NNABLA_CUDNN_WORKSPACE_LIMIT` environment variable
        can be used to restrict the choice of algorithms to those that
        fit the given workspace memory limit, expressed in bytes. In
        some cases it may also be desired to restrict the automatic
        search to algorithms that produce deterministic (reproducable)
        results. This can be requested by setting the the environment
        variable `NNABLA_CUDNN_DETERMINISTIC` to a non-zero value.

    Args:
        inp (~nnabla.Variable): N-D array.
        outmaps (int): Number of convolution kernels (which is equal to the number of output channels). For example, to apply convolution on an input with 16 types of filters, specify 16.
        kernel (:obj:`tuple` of :obj:`int`): Convolution kernel size. For example, to apply convolution on an image with a 3 (height) by 5 (width) two-dimensional kernel, specify (3,5).
        pad (:obj:`tuple` of :obj:`int`): Padding sizes for dimensions.
        stride (:obj:`tuple` of :obj:`int`): Stride sizes for dimensions.
        dilation (:obj:`tuple` of :obj:`int`): Dilation sizes for dimensions.
        group (int): Number of groups of channels. This makes connections across channels more sparse by grouping connections along map direction.
        w_init (:obj:`nnabla.initializer.BaseInitializer` or :obj:`numpy.ndarray`): Initializer for weight. By default, it is initialized with :obj:`nnabla.initializer.UniformInitializer` within the range determined by :obj:`nnabla.initializer.calc_uniform_lim_glorot`.
        b_init (:obj:`nnabla.initializer.BaseInitializer` or :obj:`numpy.ndarray`): Initializer for bias. By default, it is initialized with zeros if `with_bias` is `True`.
        base_axis (int): Dimensions up to `base_axis` are treated as the sample dimensions.
        fix_parameters (bool): When set to `True`, the weights and biases will not be updated.
        rng (numpy.random.RandomState): Random generator for Initializer.
        with_bias (bool): Specify whether to include the bias term.

    Returns:
        :class:`~nnabla.Variable`: N-D array. See :obj:`~nnabla.functions.convolution` for the output shape.

    """

    def __init__(self, inmaps, outmaps, kernel,
                 pad=None, stride=None, dilation=None, group=1,
                 w_init=None, b_init=None,
                 base_axis=1, fix_parameters=False, rng=None, with_bias=True):
        if w_init is None:
            w_init = UniformInitializer(
                calc_uniform_lim_glorot(inmaps, outmaps, tuple(kernel)), rng=rng)
        if with_bias and b_init is None:
            b_init = ConstantInitializer()
        w_shape = (outmaps, inmaps // group) + tuple(kernel)
        w = nn.Variable.from_numpy_array(
            w_init(w_shape)).apply(need_grad=not fix_parameters)
        b = None
        if with_bias:
            b_shape = (outmaps, )
            b = nn.Variable.from_numpy_array(
                b_init(b_shape)).apply(need_grad=not fix_parameters)

        self.W = w
        self.b = b
        self.base_axis = base_axis
        self.pad = pad
        self.stride = stride
        self.dilation = dilation
        self.group = group

    def __call__(self, inp):
        return F.convolution(inp, self.W, self.b, self.base_axis,
                             self.pad, self.stride, self.dilation, self.group)

Conv1d = Convolution
Conv2d = Convolution
Conv3d = Convolution
ConvNd = Convolution