text:
import { TsFileImageDimensionConstraints } from './image-dimension-constraints';
import { TsFileAcceptedMimeTypes } from './mime-types';
import { TsSelectedFile } from './selected-file';

const CONSTRAINTS_MOCK: TsFileImageDimensionConstraints = [
  {
    height: {
      min: 50,
      max: 100,
    },
    width: {
      min: 50,
      max: 100,
    },
  },
  {
    height: {
      min: 100,
      max: 100,
    },
    width: {
      min: 100,
      max: 100,
    },
  },
];

// IMAGE MOCK
const FILE_BLOB = new Blob(
  // eslint-disable-next-line max-len
  ['data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABIAQMAAABvIyEEAAAAA1BMVEXXbFn0Q9OUAAAADklEQVR4AWMYRmAUjAIAAtAAAaW+yXMAAAAASUVORK5CYII='],
  { type: 'image/png' },
);
FILE_BLOB['lastModifiedDate'] = new Date();
FILE_BLOB['name'] = 'foo';
jest.spyOn(FILE_BLOB, 'size', 'get').mockReturnValue(3 * 1024);
const FILE_MOCK = FILE_BLOB as File;

// CSV MOCK
const FILE_CSV_BLOB = new Blob(
  ['my csv value'],
  { type: 'text/csv' },
);
FILE_CSV_BLOB['lastModifiedDate'] = new Date();
FILE_CSV_BLOB['name'] = 'myCSV';
jest.spyOn(FILE_CSV_BLOB, 'size', 'get').mockReturnValue(3 * 1024);
const FILE_CSV_MOCK = FILE_CSV_BLOB as File;

// VIDEO MOCK
const FILE_VIDEO_BLOB = new Blob(
  ['my video value'],
  { type: 'video/mp4' },
);
FILE_VIDEO_BLOB['lastModifiedDate'] = new Date();
FILE_VIDEO_BLOB['name'] = 'myVideo';
jest.spyOn(FILE_VIDEO_BLOB, 'size', 'get').mockReturnValue(3 * 1024);
const FILE_VIDEO_MOCK = FILE_VIDEO_BLOB as File;

describe(`TsSelectedFile`, function() {
  const createFile = (
    file = FILE_MOCK,
    constraints: TsFileImageDimensionConstraints | undefined = CONSTRAINTS_MOCK,
    types: TsFileAcceptedMimeTypes[] = ['image/png', 'image/jpg'],
    size = (10 * 1024),
    ratio = [{
      widthRatio: 1,
      heightRatio: 1,
    }],
  ): TsSelectedFile => new TsSelectedFile(
    file,
    constraints ? constraints : undefined,
    types,
    size,
    ratio,
  );

  // Mock `FileReader` and `Image`:
  beforeEach(() => {
    // Mock FileReader
    class DummyFileReader {
      public onload = jest.fn();
      public addEventListener = jest.fn();
      public readAsDataURL = jest.fn().mockImplementation(function(this: FileReader) {
        // FIXME
        // @ts-ignore
        this.onload({} as Event);
      });
      // eslint-disable-next-line max-len
      public result = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABIAQMAAABvIyEEAAAAA1BMVEXXbFn0Q9OUAAAADklEQVR4AWMYRmAUjAIAAtAAAaW+yXMAAAAASUVORK5CYII=';
    }
    // Not sure why any is needed
    (window as any).FileReader = jest.fn(() => new DummyFileReader);

    class DummyImage {
      public _onload = () => {};
      public set onload(fn) {
        this._onload = fn;
      }
      public get onload() {
        return this._onload;
      }
      public set src(source) {
        this.onload();
      }
      public get naturalWidth() {
        return 100;
      }
      public get naturalHeight() {
        return 100;
      }
    }
    (window as any).Image = jest.fn(() => new DummyImage());
  });

  describe(`constructor`, () => {
    test(`should set top-level items and validations`, () => {
      const file = createFile();
      file.fileLoaded$.subscribe(f => {
        if (f) {
          expect(f.mimeType).toEqual('image/png');
          expect(f.size).toEqual(3);
          expect(f.name).toEqual('foo');
          expect(f.validations.fileType).toEqual(true);
          expect(f.validations.fileSize).toEqual(true);
          expect(f.validations.imageDimensions).toEqual(true);
        }
      });
      expect.assertions(6);
    });

    test(`should set top-level items and validations for videos`, done => {
      const file = createFile(FILE_VIDEO_MOCK, undefined, ['video/mp4']);
      file.fileLoaded$.subscribe(f => {
        if (f) {
          expect(f.mimeType).toEqual('video/mp4');
          expect(f.size).toEqual(3);
          expect(f.name).toEqual('myVideo');
          expect(f.validations.fileType).toEqual(true);
          expect(f.validations.fileSize).toEqual(true);
          expect(f.validations.imageDimensions).toEqual(true);
        }
      });
      expect.assertions(6);
      done();
    });
  });

  describe(`width`, () => {
    test(`should return the width or zero`, () => {
      const file = createFile();
      expect(file.width).toEqual(100);

      file.dimensions = undefined;
      expect(file.width).toEqual(0);
    });
  });

  describe(`height`, () => {
    test(`should return the height or zero`, () => {
      const file = createFile();
      expect(file.height).toEqual(100);

      file.dimensions = undefined;
      expect(file.height).toEqual(0);
    });
  });

  describe(`isCSV`, () => {
    test(`should return true is the file is a CSV`, () => {
      const file = createFile(FILE_CSV_MOCK);
      file.fileLoaded$.subscribe(f => {
        if (f) {
          expect(f.isCSV).toEqual(true);
        }
      });
      expect.assertions(1);
    });
  });

  describe(`isImage`, () => {
    test(`should return true is the file is an image`, () => {
      const file = createFile();
      file.fileLoaded$.subscribe(f => {
        if (f) {
          expect(file.isImage).toEqual(true);
        }
      });
    });
  });

  describe(`isVideo`, () => {
    test(`should return true is the file is a video`, () => {
      const file = createFile(FILE_VIDEO_MOCK);
      file.fileLoaded$.subscribe(f => {
        if (f) {
          expect(f.isVideo).toEqual(true);
        }
      });
      expect.assertions(1);
    });
  });

  describe(`fileContents`, () => {
    test(`should return the FileReader result`, () => {
      const file = createFile();
      file.fileLoaded$.subscribe(f => {
        if (f) {
          expect(f.fileContents.indexOf('data:image')).toBeGreaterThanOrEqual(0);
        }
      });

      expect.assertions(1);
    });

    describe(`fileReader result`, () => {
      /**
       * Convert a string to an array buffer
       *
       * @param str
       */
      function str2ab(str) {
        const buf = new ArrayBuffer(str.length * 2); // 2 bytes for each char
        const bufView = new Uint16Array(buf);
        for (let i = 0, strLen = str.length; i < strLen; i++) {
          bufView[i] = str.charCodeAt(i);
        }
        return buf;
      }

      test(`should warn if image result is not a string`, () => {
        window.console.warn = jest.fn();
        // Mock FileReader for ArrayBuffer
        class DummyArrayBufferFileReader {
          public onload = jest.fn();
          public addEventListener = jest.fn();
          public readAsDataURL = jest.fn().mockImplementation(function(this: FileReader) {
            // FIXME
            // @ts-ignore
            this.onload!({} as ProgressEvent);
          });
          public result = str2ab(FILE_BLOB);
        }
        (window as any).FileReader = jest.fn(() => new DummyArrayBufferFileReader);

        const file = createFile();
        file.fileLoaded$.subscribe(f => {});
        expect(window.console.warn).toHaveBeenCalled();

        expect.assertions(1);
      });

      test(`should warn if csv result is not a string`, () => {
        window.console.warn = jest.fn();
        // Mock FileReader for ArrayBuffer
        class DummyArrayBufferFileReader {
          public onload = jest.fn();
          public addEventListener = jest.fn();
          public readAsDataURL = jest.fn().mockImplementation(function(this: FileReader) {
            // FIXME
            // @ts-ignore
            this.onload!({} as ProgressEvent);
          });
          public result = str2ab(FILE_CSV_BLOB);
        }
        (window as any).FileReader = jest.fn(() => new DummyArrayBufferFileReader);

        const file = createFile(FILE_CSV_MOCK);
        file.fileLoaded$.subscribe(f => {
          file.fileContents.valueOf();
        });
        expect(window.console.warn).toHaveBeenCalled();

        expect.assertions(1);
      });
    });
  });

  describe(`isValid`, () => {
    const file = createFile();

    beforeEach(() => {
      file.validations.fileType = true;
      file.validations.fileSize = true;
      file.validations.imageDimensions = true;
      file.validations.imageRatio = true;
    });

    test(`should return true if all validations are true`, () => {
      expect(file.isValid).toEqual(true);
    });

    test(`should return false if file type validation is false`, () => {
      file.validations.fileType = false;
      expect(file.isValid).toEqual(false);
    });

    test(`should return false if file size validation is false`, () => {
      file.validations.fileSize = false;
      expect(file.isValid).toEqual(false);
    });

    test(`should return false if image dimensions validation is false`, () => {
      file.validations.imageDimensions = false;
      expect(file.isValid).toEqual(false);
    });

    test(`should return false if image ration validation is false`, () => {
      file.validations.imageRatio = false;
      expect(file.isValid).toEqual(false);
    });
  });

  describe(`determineImageDimensions`, () => {
    test(`should set validation to true and exit if the file is not an image`, done => {
      const file = createFile(FILE_CSV_MOCK);
      file.fileLoaded$.subscribe(f => {
        if (f) {
          expect(f.dimensions).toBeFalsy();
          expect(f.height).toEqual(0);
          expect(f.width).toEqual(0);
          expect(f.validations.imageDimensions).toEqual(true);
          done();
        }
      });
      expect.assertions(4);
    });

    test(`should still seed the FileReader for non-image files`, done => {
      const file = createFile(FILE_CSV_MOCK);
      file.fileLoaded$.subscribe(f => {
        if (f) {
          expect(f.fileContents).toBeTruthy();
          done();
        }
      });
      expect.assertions(1);
    });

    test(`should set dimensions and call callback`, () => {
      createFile().fileLoaded$.subscribe(f => {
        if (f) {
          expect(f.dimensions).toBeTruthy();
          expect(f.height).toBeGreaterThan(1);
          expect(f.width).toBeGreaterThan(1);
          expect(f.validations.imageDimensions).toEqual(true);
        }
      });
      expect.assertions(4);
    });
  });

  describe(`validateImageRatio`, () => {
    test(`should return true if no constraints exist`, () => {
      const file = createFile();
      expect(file['validateImageRatio'](undefined)).toEqual(true);
    });

    test(`should return true if ratio are valid`, () => {
      const file = createFile();
      const result = file['validateImageRatio']([{
        widthRatio: 1,
        heightRatio: 1,
      }]);
      expect(result).toEqual(true);
    });

    test(`should return false if ratio are not valid`, () => {
      const file = createFile();
      const result = file['validateImageRatio']([{
        widthRatio: 2,
        heightRatio: 1,
      }]);
      expect(result).toEqual(false);
    });
  });

  describe(`validateImageDimensions`, () => {
    test(`should return true if no constraints exist`, () => {
      const file = createFile();
      expect(file['validateImageDimensions'](undefined)).toEqual(true);
    });

    test(`should return true if dimensions are valid`, () => {
      const file = createFile();
      const result = file['validateImageDimensions'](CONSTRAINTS_MOCK);
      expect(result).toEqual(true);
    });

    test(`should return false if dimensions are not valid`, () => {
      const file = createFile();
      const constraints = [
        {
          height: {
            min: 150,
            max: 200,
          },
          width: {
            min: 150,
            max: 200,
          },
        },
        {
          height: {
            min: 100,
            max: 100,
          },
          width: {
            min: 150,
            max: 200,
          },
        },
      ];
      const result = file['validateImageDimensions'](constraints);
      expect(result).toEqual(false);
    });
  });
});


text:
package org.locxar.roguelike.actors;

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

import static org.junit.Assert.*;

// TODO: Auto-generated Javadoc
/**
 * Created by LocXar on 16.09.2016.
 */
public class NpcTest
{

    /**
     * Sets the up.
     *
     * @throws Exception the exception
     */
    @Before
    public void setUp() throws Exception
    {

    }

    /**
     * Tear down.
     *
     * @throws Exception the exception
     */
    @After
    public void tearDown() throws Exception
    {

    }

    /**
     * Gets the logger.
     *
     * @return the logger
     * @throws Exception the exception
     */
    @Test
    public void getLogger() throws Exception
    {

    }

    /**
     * Gets the health points.
     *
     * @return the health points
     * @throws Exception the exception
     */
    @Test
    public void getHealthPoints() throws Exception
    {

    }

    /**
     * Sets the health points.
     *
     * @throws Exception the exception
     */
    @Test
    public void setHealthPoints() throws Exception
    {

    }

    /**
     * Gets the mana points.
     *
     * @return the mana points
     * @throws Exception the exception
     */
    @Test
    public void getManaPoints() throws Exception
    {

    }

    /**
     * Sets the mana points.
     *
     * @throws Exception the exception
     */
    @Test
    public void setManaPoints() throws Exception
    {

    }

    /**
     * Gets the action points.
     *
     * @return the action points
     * @throws Exception the exception
     */
    @Test
    public void getActionPoints() throws Exception
    {

    }

    /**
     * Sets the action points.
     *
     * @throws Exception the exception
     */
    @Test
    public void setActionPoints() throws Exception
    {

    }

    /**
     * Gets the name.
     *
     * @return the name
     * @throws Exception the exception
     */
    @Test
    public void getName() throws Exception
    {

    }

    /**
     * Sets the name.
     *
     * @throws Exception the exception
     */
    @Test
    public void setName() throws Exception
    {

    }

}

redpajama_set_name: RedPajamaGithub


text:
ACCEPTED

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

#### Published in
Bull. natn. Sci. Mus. , Tokyo, B 3(1): 24 (1977)

#### Original name
Cavimalum indicum Yoshim. Doi, Dargan & K.S. Thind, 1977

### Remarks
null


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

using System.Threading.Tasks;
using System.Xml.Linq;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Test.Utilities;
using Microsoft.VisualStudio.IntegrationTest.Utilities;
using Roslyn.VisualStudio.IntegrationTests;
using Roslyn.VisualStudio.IntegrationTests.InProcess;
using Xunit;

namespace Roslyn.VisualStudio.NewIntegrationTests.VisualBasic
{
    public class BasicAddMissingReference : AbstractEditorTest
    {
        private const string FileInLibraryProject1 = @"Public Class Class1
    Inherits System.Windows.Forms.Form
    Public Sub goo()

    End Sub
End Class

Public Class class2
    Public Sub goo(ByVal x As System.Windows.Forms.Form)

    End Sub

    Public Event ee As System.Windows.Forms.ColumnClickEventHandler
End Class

Public Class class3
    Implements System.Windows.Forms.IButtonControl

    Public Property DialogResult() As System.Windows.Forms.DialogResult Implements System.Windows.Forms.IButtonControl.DialogResult
        Get

        End Get
        Set(ByVal Value As System.Windows.Forms.DialogResult)

        End Set
    End Property

    Public Sub NotifyDefault(ByVal value As Boolean) Implements System.Windows.Forms.IButtonControl.NotifyDefault

    End Sub

    Public Sub PerformClick() Implements System.Windows.Forms.IButtonControl.PerformClick

    End Sub
End Class
";
        private const string FileInLibraryProject2 = @"Public Class Class1
    Inherits System.Xml.XmlAttribute
    Sub New()
        MyBase.New(Nothing, Nothing, Nothing, Nothing)
    End Sub
    Sub goo()

    End Sub
    Public bar As ClassLibrary3.Class1
End Class
";
        private const string FileInLibraryProject3 = @"Public Class Class1
    Public Enum E
        E1
        E2
    End Enum

    Public Function Goo() As ADODB.Recordset
        Dim x As ADODB.Recordset = Nothing
        Return x
    End Function

End Class
";
        private const string FileInConsoleProject1 = @"Imports System.Data.XLinq

Module Module1

    Sub Main()
        'ERRID_UnreferencedAssembly3
        Dim y As New ClassLibrary1.class2
        y.goo(Nothing)

        'ERRID_UnreferencedAssemblyEvent3
        AddHandler y.ee, Nothing

        'ERRID_UnreferencedAssemblyBase3
        Dim x As New ClassLibrary1.Class1
        x.goo()
        'ERRID_UnreferencedAssemblyImplements3
        Dim z As New ClassLibrary1.class3
        Dim xxx = z.DialogResult
        'ERRID_SymbolFromUnreferencedProject3
        Dim a As New ClassLibrary2.Class1
        Dim c As Boolean = a.HasChildNodes()

        Dim d = a.bar
    End Sub

End Module
";

        private const string ClassLibrary1Name = "ClassLibrary1";
        private const string ClassLibrary2Name = "ClassLibrary2";
        private const string ClassLibrary3Name = "ClassLibrary3";
        private const string ConsoleProjectName = "ConsoleApplication1";

        protected override string LanguageName => LanguageNames.VisualBasic;

        public override async Task InitializeAsync()
        {
            await base.InitializeAsync().ConfigureAwait(true);

            await TestServices.SolutionExplorer.CreateSolutionAsync("ReferenceErrors", solutionElement: XElement.Parse(
                "<Solution>" +
               $"   <Project ProjectName=\"{ClassLibrary1Name}\" ProjectTemplate=\"{WellKnownProjectTemplates.WinFormsApplication}\" Language=\"{LanguageNames.VisualBasic}\">" +
                "       <Document FileName=\"Class1.vb\"><![CDATA[" +
                FileInLibraryProject1 +
                "]]>" +
                "       </Document>" +
                "   </Project>" +
               $"   <Project ProjectName=\"{ClassLibrary2Name}\" ProjectReferences=\"{ClassLibrary3Name}\" ProjectTemplate=\"{WellKnownProjectTemplates.ClassLibrary}\" Language=\"{LanguageNames.VisualBasic}\">" +
                "       <Document FileName=\"Class1.vb\"><![CDATA[" +
               FileInLibraryProject2 +
                "]]>" +
                "       </Document>" +
                "   </Project>" +
               $"   <Project ProjectName=\"{ClassLibrary3Name}\" ProjectTemplate=\"{WellKnownProjectTemplates.ClassLibrary}\" Language=\"{LanguageNames.VisualBasic}\">" +
                "       <Document FileName=\"Class1.vb\"><![CDATA[" +
               FileInLibraryProject3 +
                "]]>" +
                "       </Document>" +
                "   </Project>" +
               $"   <Project ProjectName=\"{ConsoleProjectName}\" ProjectReferences=\"{ClassLibrary1Name};{ClassLibrary2Name}\" ProjectTemplate=\"{WellKnownProjectTemplates.ConsoleApplication}\" Language=\"{LanguageNames.VisualBasic}\">" +
                "       <Document FileName=\"Module1.vb\"><![CDATA[" +
               FileInConsoleProject1 +
                "]]>" +
                "       </Document>" +
               "   </Project>" +
                "</Solution>"), HangMitigatingCancellationToken);
        }

        [IdeFact, Trait(Traits.Feature, Traits.Features.AddMissingReference)]
        public async Task InvokeSomeFixesInVisualBasicThenVerifyReferences()
        {
            await TestServices.SolutionExplorer.OpenFileAsync(ConsoleProjectName, "Module1.vb", HangMitigatingCancellationToken);
            await TestServices.Editor.PlaceCaretAsync("y.goo", charsOffset: 1, HangMitigatingCancellationToken);
            await TestServices.Editor.InvokeCodeActionListAsync(HangMitigatingCancellationToken);
            await TestServices.EditorVerifier.CodeActionAsync("Add reference to 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.", applyFix: true, cancellationToken: HangMitigatingCancellationToken);
            await TestServices.SolutionVerifier.AssemblyReferencePresentAsync(
               projectName: ConsoleProjectName,
               assemblyName: "System.Windows.Forms",
               assemblyVersion: "4.0.0.0",
               assemblyPublicKeyToken: "b77a5c561934e089",
               HangMitigatingCancellationToken);
            await TestServices.Editor.PlaceCaretAsync("a.bar", charsOffset: 1, HangMitigatingCancellationToken);
            await TestServices.Editor.InvokeCodeActionListAsync(HangMitigatingCancellationToken);
            await TestServices.EditorVerifier.CodeActionAsync("Add project reference to 'ClassLibrary3'.", applyFix: true, cancellationToken: HangMitigatingCancellationToken);
            await TestServices.SolutionVerifier.ProjectReferencePresent(
               projectName: ConsoleProjectName,
               referencedProjectName: ClassLibrary3Name,
               HangMitigatingCancellationToken);
        }
    }
}


text:
package com.freeman.project.sm.dao;

import com.freeman.project.sm.dto.UserDto;
import com.freeman.project.sm.dto.UserRoleDto;
import com.freeman.project.sm.po.User;
import com.freeman.project.sm.po.UserExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface UserMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table p_user
     *
     * @mbg.generated Tue Jun 13 20:24:58 CST 2017
     */
    long countByExample(UserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table p_user
     *
     * @mbg.generated Tue Jun 13 20:24:58 CST 2017
     */
    int deleteByExample(UserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table p_user
     *
     * @mbg.generated Tue Jun 13 20:24:58 CST 2017
     */
    int deleteByPrimaryKey(String userId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table p_user
     *
     * @mbg.generated Tue Jun 13 20:24:58 CST 2017
     */
    int insert(User record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table p_user
     *
     * @mbg.generated Tue Jun 13 20:24:58 CST 2017
     */
    int insertSelective(User record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table p_user
     *
     * @mbg.generated Tue Jun 13 20:24:58 CST 2017
     */
    List<User> selectByExample(UserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table p_user
     *
     * @mbg.generated Tue Jun 13 20:24:58 CST 2017
     */
    User selectByPrimaryKey(String userId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table p_user
     *
     * @mbg.generated Tue Jun 13 20:24:58 CST 2017
     */
    int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table p_user
     *
     * @mbg.generated Tue Jun 13 20:24:58 CST 2017
     */
    int updateByExample(@Param("record") User record, @Param("example") UserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table p_user
     *
     * @mbg.generated Tue Jun 13 20:24:58 CST 2017
     */
    int updateByPrimaryKeySelective(User record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table p_user
     *
     * @mbg.generated Tue Jun 13 20:24:58 CST 2017
     */
    int updateByPrimaryKey(User record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table p_user
     *
     * @mbg.generated Tue Jun 13 20:24:58 CST 2017
     */
    List<User> selectByCondition(User condition);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table p_user
     *
     * @mbg.generated Tue Jun 13 20:24:58 CST 2017
     */
    long countByCondition(User condition);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table p_user
     *
     * @mbg.generated Tue Jun 13 20:24:58 CST 2017
     */
    List<User> selectAll();

    //add manual
    List<String> selectPermsByUserId(String userId);

    UserRoleDto selectUserRoles(String userId);

    List<UserDto> selectUserDtoByCondition(User condition);
}


text:
.. _str: https://docs.python.org/2/library/stdtypes.html

.. _vim.fault.MigrationFault: ../../vim/fault/MigrationFault.rst

vim.fault.FaultToleranceNeedsThickDisk
======================================
    :extends:

        `vim.fault.MigrationFault`_

  Fault Tolerance VM requires thick disks

Attributes:

    vmName (`str`_)


text:
Backup MBInfo Google site
=========================

This backup use
[google-sites-liberation](https://code.google.com/p/google-sites-liberation/downloads/list)
and make it available in your command line. Check out the source code.

Change `<mainClass>com.google.sites.liberation.util.GuiMain</mainClass>` to
`<mainClass>com.google.sites.liberation.imprt.Main in pom.xml</mainClass>` so that we get command line jar.

Then run maven.

    mvn clean compile assembly:single

That should generate SNAPSHOT-jar-with-dependencies.jar file in `target` directory.

Use `ant backup` to download the site into local.

Run the script in command line

    export d=mechanobio.info
    export n=copy-test7
    export w=https://sites.google.com/a/$d/$n
    export t=$(date +"%m-%d-%y")
    export f=~/Download/$(date +"%m-%d-%y")
    java -jar target/google-sites-liberation-1.0.4-SNAPSHOT-jar-with-dependencies.jar -d $d -w $w -f $f

Upload to Google cloud storage

    gsutil cp -a public-read -z html,css,js,csv,jpg,jpeg -r site/* gs://mbinfo-backup/2013-05-13


text:
namespace net {
class URLRequestContextGetter;

// Interface for watching when a URLRequestContext associated with a
// URLRequestContextGetter is shutting down.
class NET_EXPORT URLRequestContextGetterObserver {
 public:
  URLRequestContextGetterObserver() = default;

  URLRequestContextGetterObserver(const URLRequestContextGetterObserver&) =
      delete;
  URLRequestContextGetterObserver& operator=(
      const URLRequestContextGetterObserver&) = delete;

  // Called before the URLRequestContext shuts down. When called, the Getter's
  // GetURLRequestContext method must return NULL to protected against
  // re-entrancy, but the Context must still be valid and GetNetworkTaskRunner()
  // must return the thread it lives on. Called on the network thread.
  virtual void OnContextShuttingDown() = 0;

 protected:
  virtual ~URLRequestContextGetterObserver() = default;
};

}  // namespace net

#endif  // NET_URL_REQUEST_URL_REQUEST_CONTEXT_GETTER_OBSERVER_H_


text:
from _winreg import OpenKey, CloseKey, QueryValueEx, HKEY_LOCAL_MACHINE

from core.os_utils import find_first_file
from core.patch import TrollPatch
from core.version import VERSION_FILE_EXT
import sys

def get_warband_path():
    """
    Attempts to locate the warband installation directory
    from the windows registry.

    :return: The warband installation path if found
    or None otherwise.
    """
    try:
        a_key = OpenKey(HKEY_LOCAL_MACHINE, r"SOFTWARE\mount&blade warband")
        install_path = QueryValueEx(a_key, "install_path")
        CloseKey(a_key)
        return install_path[0]
    except WindowsError as e:
        try:
            a_key = OpenKey(HKEY_LOCAL_MACHINE, r"SOFTWARE\WOW6432Node\mount&blade warband")
            install_path = QueryValueEx(a_key, "install_path")
            CloseKey(a_key)
            return install_path[0]
        except WindowsError as e:
            print("Error getting warband path: " + str(e))
            sys.exit(1)

def is_addon_installed(addon_name, native_path):
    """
    Checks if the addon is installed in the native directory.

    :param addon_name: The file name of the addon (excluding extension)
    :param native_path: The absolute path of the native directory of warband.
    :return: True if the addon version file was found or False otherwise.
    """
    if addon_name is None or native_path is None:
        return False

    return True if find_first_file(native_path,
                                   addon_name + VERSION_FILE_EXT) else False

def is_patch_installed(native_path):
    """
    Checks if the patch is installed in the native directory.

    :param native_path: The absolute path of the native directory of warband.
    :return: True if the patch version file was found or False otherwise.
    """
    return True if find_first_file(native_path, TrollPatch.NAME + VERSION_FILE_EXT) else False


text:
param(
    [string]$environment = "Debug"
)

$workingDir = Split-Path ((Get-Variable MyInvocation -Scope 0).Value.MyCommand.Path)
Set-Location $workingDir #otherwise the helpers are not found if we're running the script from a different folder
. .\_Helpers.ps1

#####################################################
#
#  Local helper functions.
#
#####################################################
function GetConnectionDetails($environment)
{
    $connectionString = GetConfigValue -name:'DefaultConnection'
    $connectionStringBuilder = New-Object System.Data.Common.DbConnectionStringBuilder
    $connectionStringBuilder.set_ConnectionString($connectionString)

    $result = @{ 'server'=$connectionStringBuilder['server']; 'database'=$connectionStringBuilder['database']; 'user'=$connectionStringBuilder['user'];'password'=$connectionStringBuilder['password'];}
    return $result
}

function EnsureDatabaseExists($connection)
{
    $server=$connection.server
    $database=$connection.database
    $createDatabase = "
        IF NOT EXISTS(SELECT * FROM sys.databases WHERE name='$database')
        BEGIN
	        PRINT 'Creating $database database'
	        CREATE DATABASE $database
        END
        GO
    "

    $database = $connection.database
    $connection.database = 'master'
    RunQuery -query $createDatabase -connection:$connection

    $connection.database = $database
}

function UpgradeDatabase($versionFolder, $connection)
{
    $path = $versionFolder.FullName
    foreach($file in Get-ChildItem $path -Recurse -Filter *.sql) {
        RunQuery -file "$path\$file" -connection:$connection
    }
}

#####################################################
#
#  Main.
#
#####################################################
try {
    ClearPreviousErrors

    $connection = GetConnectionDetails -environment:$environment
    Log -level 'info' -message "Setting up database [$($connection.database)] at [$($connection.server)] server"

    EnsureDatabaseExists -connection:$connection

    $rootFolder = (Resolve-Path "Database").Path
    foreach($versionFolder in Get-ChildItem -Directory $rootFolder) {
        UpgradeDatabase -versionFolder $versionFolder -connection $connection
    }
}
finally {
    Set-Location $workingDir
}


text:
<resources>
    <string name="app_name">BindingSample</string>
</resources>


text:
package kd.push.utils;

import android.os.Build.VERSION;

public class VersionUtils {
    private VersionUtils() {
    }

    public static boolean hasFroyo() {
        return VERSION.SDK_INT >= 8;
    }

    public static boolean hasGingerbread() {
        return VERSION.SDK_INT >= 9;
    }

    public static boolean hasHoneycomb() {
        return VERSION.SDK_INT >= 11;
    }

    public static boolean hasICE_CREAM_SANDWICH() {
        return VERSION.SDK_INT >= 14;
    }

    public static boolean hasHoneycombMR1() {
        return VERSION.SDK_INT >= 12;
    }

    public static boolean hasJellyBean() {
        return VERSION.SDK_INT >= 16;
    }

    public static boolean hasKitkat() {
        return VERSION.SDK_INT >= 19;
    }
}


text:
namespace org.apache.lucene.analysis.miscellaneous
{

	using BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;

	public class TestCodepointCountFilterFactory : BaseTokenStreamFactoryTestCase
	{

//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testPositionIncrements() throws Exception
	  public virtual void testPositionIncrements()
	  {
		Reader reader = new StringReader("foo foobar super-duper-trooper");
		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
		stream = tokenFilterFactory("CodepointCount", "min", "4", "max", "10").create(stream);
		assertTokenStreamContents(stream, new string[] {"foobar"}, new int[] {2});
	  }

	  /// <summary>
	  /// Test that bogus arguments result in exception </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testBogusArguments() throws Exception
	  public virtual void testBogusArguments()
	  {
		try
		{
		  tokenFilterFactory("CodepointCount", "min", "4", "max", "5", "bogusArg", "bogusValue");
		  fail();
		}
		catch (System.ArgumentException expected)
		{
		  assertTrue(expected.Message.contains("Unknown parameters"));
		}
	  }

	  /// <summary>
	  /// Test that invalid arguments result in exception </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testInvalidArguments() throws Exception
	  public virtual void testInvalidArguments()
	  {
		try
		{
		  Reader reader = new StringReader("foo foobar super-duper-trooper");
		  TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
		  tokenFilterFactory("CodepointCount", CodepointCountFilterFactory.MIN_KEY, "5", CodepointCountFilterFactory.MAX_KEY, "4").create(stream);
		  fail();
		}
		catch (System.ArgumentException expected)
		{
		  assertTrue(expected.Message.contains("maximum length must not be greater than minimum length"));
		}
	  }
	}
}


text:
{% extends 'insumo/index.html' %}

{% block title.content %}{{ titulo }} - {{ block.super }}{% endblock title.content %}
{% block header.content %}{{ titulo }} - {{ block.super }}{% endblock header.content %}

{% block stylesheet %}

{% endblock %}

{% block content %}
<form action="{% url 'insumo:busca' %}" method="post">
    {% csrf_token %}
    {{ form.as_p }}
    <input type="submit" value="Busca"/>
</form>
{% if filtro %}

Filtro: {{ filtro }}

{% endif %}
{% if msg_erro %}

{{ msg_erro }}

{% endif %}
{% if data %}

    {% include "layout/html_thead.html" with data=headers only %}
    {% include "layout/html_tbody_link.html" with fields=fields data=data link=link only %}

{% endif %}
{% endblock %}


text:
package com.xinqihd.sns.gameserver.admin.action.game;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.JButton;

import com.xinqihd.sns.gameserver.admin.action.CopyMongoCollectionAction;
import com.xinqihd.sns.gameserver.admin.gui.ext.MyTablePanel;
import com.xinqihd.sns.gameserver.admin.model.MyTableModel;
import com.xinqihd.sns.gameserver.admin.util.ImageUtil;
import com.xinqihd.sns.gameserver.service.RefreshMyTableService;

/**
 * Refresh the gamedata collection's data.
 * @author wangqi
 *
 */
public class MyTableRefreshAction extends AbstractAction {

	private MyTablePanel panel = null;
	private CopyMongoCollectionAction backupAction = null;

	public MyTableRefreshAction(MyTablePanel panel) {
		super("", ImageUtil.createImageSmallIcon("Button Reload.png", "Refresh"));
		this.panel = panel;
	}

	/**
	 * @return the backupAction
	 */
	public CopyMongoCollectionAction getBackupAction() {
		return backupAction;
	}

	/**
	 * @param backupAction the backupAction to set
	 */
	public void setBackupAction(CopyMongoCollectionAction backupAction) {
		this.backupAction = backupAction;
	}

	/* (non-Javadoc)
	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
	 */
	@Override
	public void actionPerformed(ActionEvent e) {
		JButton button = (JButton)e.getSource();
		MyTableModel myTableModel = this.panel.getTableModel();
		RefreshMyTableService service = new RefreshMyTableService(myTableModel);
		service.setBackupAction(backupAction);
		service.execute();
	}

}


text:
package di.spring.extensions;

import di.spring.extensions.custom.IBar;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class PropertyOverrideMain {

    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("property-override.xml");
        context.registerShutdownHook();

        IBar bar = context.getBean(IBar.class);

        bar.printIt();

    }
}


text:
<?php

defined( 'ABSPATH' ) or die();

/**
 * A PSR-3 inspired logger class
 * This class logs + formats logs for display in the Simple History GUI/Viewer
 *
 * Extend this class to make your own logger
 *
 * @link https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md PSR-3 specification
 */
class SimpleLogger {

	/**
	 * Unique slug for this logger
	 * Will be saved in DB and used to associate each log row with its logger
	 */
	public $slug = __CLASS__;

	/**
	 * Will contain the untranslated messages from getInfo()
	 *
	 * By adding your messages here they will be stored both translated and non-translated
	 * You then log something like this:
	 *
	 *   $this->info( $this->messages["POST_UPDATED"] );
	 *
	 * or with the shortcut
	 *
	 *   $this->infoMessage("POST_UPDATED");
	 *
	 * which results in the original, untranslated, string being added to the log and database
	 * the translated string are then only used when showing the log in the GUI
	 */
	public $messages;

	/**
	 * ID of last inserted row. Used when chaining methods.
	 */
	public $lastInsertID;

	/**
	 * Constructor. Remember to call this as parent constructor if making a childlogger
	 * @param $simpleHistory history class  objectinstance
	 */
        public function __construct( $simpleHistory = null ) {

		global $wpdb;

		$this->db_table = $wpdb->prefix . SimpleHistory::DBTABLE;
		$this->db_table_contexts = $wpdb->prefix . SimpleHistory::DBTABLE_CONTEXTS;

		$this->simpleHistory = $simpleHistory;

	}

	/**
	 * Method that is called automagically when logger is loaded by Simple History
	 * Add your init stuff here
	 */
	public function loaded() {

	}

	/**
	 * Get array with information about this logger
	 *
	 * @return array
	 */
	function getInfo() {

		$arr_info = array(

			// The logger slug. Defaulting to the class name is nice and logical I think
			"slug" => __CLASS__,

			// Shown on the info-tab in settings, use these fields to tell
			// an admin what your logger is used for
			"name" => "SimpleLogger",
			"description" => "The built in logger for Simple History",

			// Capability required to view log entries from this logger
			"capability" => "edit_pages",
			"messages" => array(
				// No pre-defined variants
				// when adding messages __() or _x() must be used
			),

		);

		return $arr_info;

	}

	/**
	 * Return single array entry from the array in getInfo()
	 * Returns the value of the key if value exists, or null
	 *
	 * @since 2.5.4
	 * @return Mixed
	 */
	function getInfoValueByKey( $key ) {

		$arr_info = $this->getInfo();

		return isset( $arr_info[ $key ] ) ? $arr_info[ $key ] : null;

	}

	/**
	 * Returns the capability required to read log rows from this logger
	 *
	 * @return $string capability
	 */
	public function getCapability() {

		$arr_info = $this->getInfo();

		$capability = "manage_options";

		if ( ! empty( $arr_info["capability"] ) ) {
			$capability = $arr_info["capability"];
		}

		return $capability;

	}

	/**
	 * Interpolates context values into the message placeholders.
	 *
	 * @param string $message
	 * @param array $context
	 * @param array $row Currently not always passed, because loggers need to be updated to support this...
	 */
	function interpolate( $message, $context = array(), $row = null ) {

		if ( ! is_array( $context ) ) {
			return $message;
		}

		/**
		 * Filter the context used to create the message from the message template
		 *
		 * @since 2.2.4
		 */
		$context = apply_filters( "simple_history/logger/interpolate/context", $context, $message, $row );

		// Build a replacement array with braces around the context keys
		$replace = array();
		foreach ( $context as $key => $val ) {

			// Both key and val must be strings or number (for vals)
			if ( is_string( $key ) || is_numeric( $key ) ) {
				// key ok
			}

			if ( is_string( $val ) || is_numeric( $val ) ) {
				// val ok
			} else {
				// not a value we can replace
				continue;
			}

			$replace['{' . $key . '}'] = $val;

		}

		// Interpolate replacement values into the message and return
		/*
		if ( ! is_string( $message )) {
			echo "message:";
			var_dump($message);exit;
		}
		//*/
		/*
		if ( ! is_string( $replace )) {
			echo "replace: \n";
			var_dump($replace);
		}
		// */

		return strtr( $message, $replace );

	}

	/**
	 * Returns header output for a log row
	 * Format should be common for all log rows and should be like:
	 * Username (user role) · Date
	 * @return string HTML
	 */
	function getLogRowHeaderOutput($row) {

		// HTML for initiator
		$initiator_html = "";

		$initiator = $row->initiator;
		$context = $row->context;

		switch ($initiator) {

			case "wp":
				$initiator_html .= 'WordPress ';
				break;

			case "wp_cli":
				$initiator_html .= 'WP-CLI ';
				break;

			// wp_user = wordpress uses, but user may have been deleted since log entry was added
			case "wp_user":

				$user_id = isset($row->context["_user_id"]) ? $row->context["_user_id"] : null;

				if ($user_id > 0 && $user = get_user_by("id", $user_id)) {

					// Sender is user and user still exists
					$is_current_user = ($user_id == get_current_user_id()) ? true : false;

					// get user role, as done in user-edit.php
					$wp_roles = $GLOBALS["wp_roles"];
					$all_roles = (array) $wp_roles->roles;
					$user_roles = array_intersect( array_values( (array) $user->roles ), array_keys( (array) $wp_roles->roles ));
					$user_role = array_shift( $user_roles );

					$user_display_name = $user->display_name;

					/*
					 * If user who logged this is the currently logged in user
					 * skip name and email and use just "You"
					 *
					 * @param bool If you should be used
					 * @since 2.1
					 */
					$use_you = apply_filters("simple_history/header_initiator_use_you", true);

					if ( $use_you && $is_current_user ) {

						$tmpl_initiator_html = '

								%5$s

						';

					} else {

						$tmpl_initiator_html = '

								%3$s
								%2$s

						';

					}

					/**
					 * Filter the format for the user output
					 *
					 * @since 2.0
					 *
					 * @param string $format.
					 */
					$tmpl_initiator_html = apply_filters("simple_history/header_initiator_html_existing_user", $tmpl_initiator_html);

					$initiator_html .= sprintf(
						$tmpl_initiator_html,
						esc_html($user->user_login), 	// 1
						esc_html($user->user_email), 	// 2
						esc_html($user_display_name), 	// 3
						$user_role, 	// 4
						_x("You", "header output when initiator is the currently logged in user", "simple-history"),	// 5
						get_edit_user_link( $user_id ) // 6
					);

				} else if ($user_id > 0) {

					// Sender was a user, but user is deleted now
					// output all info we have
					// _user_id
					// _username
					// _user_login
					// _user_email
					$initiator_html .= sprintf(
						'' .
						__('Deleted user (had id %1$s, email %2$s, login %3$s)', "simple-history") .
						'',
						esc_html($context["_user_id"]), // 1
						esc_html($context["_user_email"]), // 2
						esc_html($context["_user_login"]) // 3
					);

				}

				break;

			case "web_user":

				/*
				Note: server_remote_addr may not show visiting/attacking ip, if server is behind...stuff..
				Can be behind varnish cashe, or browser can for example use compression in chrome mobile
				then the real ip is behind _server_http_x_forwarded_for_0 or similar
				_server_remote_addr	66.249.81.222
				_server_http_x_forwarded_for_0	5.35.187.212
				*/

				// Check if additional IP addresses are stored, from http_x_forwarded_for and so on
				$arr_found_additional_ip_headers = $this->get_event_ip_number_headers($row);

				if ( empty( $context["_server_remote_addr"] ) ) {

					$initiator_html .= "" . __("Anonymous web user", "simple-history") . " ";

				} else {

					$initiator_html .= "";

					#if ( sizeof( $arr_found_additional_ip_headers ) ) {

						#$iplookup_link = sprintf('https://ipinfo.io/%1$s', esc_attr($context["_server_remote_addr"]));

						#$ip_numbers_joined = wp_sprintf_l('%l', array("_server_remote_addr" => $context["_server_remote_addr"]) + $arr_found_additional_ip_headers);

						/*$initiator_html .= sprintf(
							__('Anonymous user with multiple IP addresses detected: %1$s', "simple-history"),
							"" . esc_html( $ip_numbers_joined ) . ""
						);*/

						/*
						print_r($arr_found_additional_ip_headers);
						Array
						(
						    [_server_http_x_forwarded_for_0] => 5.35.187.212
						    [_server_http_x_forwarded_for_1] => 83.251.97.21
						)
						*/

					#} else {

						// single ip address
						$iplookup_link = sprintf('https://ipinfo.io/%1$s', esc_attr($context["_server_remote_addr"]));

						$initiator_html .= sprintf(
							__('Anonymous user from %1$s', "simple-history"),
							"" . esc_html($context["_server_remote_addr"]) . ""
						);

					#} // multiple ip

					$initiator_html .= " ";

					// $initiator_html .= "" . __("

Unknown user from {$context["_server_remote_addr"]}") . "";
					// $initiator_html .= "" . __("

{$context["_server_remote_addr"]}") . "";
					// $initiator_html .= "" . __("

User from IP {$context["_server_remote_addr"]}") . "";
					// $initiator_html .= "" . __("

Non-logged in user from IP  {$context["_server_remote_addr"]}") . "";

				}

				break;

			case "other":
				$initiator_html .= "" . _x("Other", "Event header output, when initiator is unknown", "simple-history") . "";
				break;

			// no initiator
			case null:
				// $initiator_html .= "Null";
				break;

			default:
				$initiator_html .= "" . esc_html($initiator) . "";

		}

		/**
		 * Filter generated html for the initiator row header html
		 *
		 * @since 2.0
		 *
		 * @param string $initiator_html
		 * @param object $row Log row
		 */
		$initiator_html = apply_filters("simple_history/row_header_initiator_output", $initiator_html, $row);

		// HTML for date
		// Date (should...) always exist
		// http://developers.whatwg.org/text-level-semantics.html#the-time-element
		$date_html = "";
		$str_when = "";

		// $row->date is in GMT
		$date_datetime = new DateTime( $row->date, new DateTimeZone('GMT') );

		// Current datetime in GMT
		$time_current = strtotime( current_time("mysql", 1) );

		/**
		 * Filter how many seconds as most that can pass since an
		 * event occured to show "nn minutes ago" (human diff time-format) instead of exact date
		 *
		 * @since 2.0
		 *
		 * @param int $time_ago_max_time Seconds
		 */
		$time_ago_max_time = DAY_IN_SECONDS * 2;
		$time_ago_max_time = apply_filters("simple_history/header_time_ago_max_time", $time_ago_max_time);

		/**
		 * Filter how many seconds as most that can pass since an
		 * event occured to show "just now" instead of exact date
		 *
		 * @since 2.0
		 *
		 * @param int $time_ago_max_time Seconds
		 */
		$time_ago_just_now_max_time = 30;
		$time_ago_just_now_max_time = apply_filters("simple_history/header_just_now_max_time", $time_ago_just_now_max_time);

		if ( $time_current - $date_datetime->getTimestamp() <= $time_ago_just_now_max_time ) {

			// show "just now" if event is very recent
			$str_when = __("Just now", "simple-history");

		} else if ( $time_current - $date_datetime->getTimestamp() > $time_ago_max_time ) {

			/* translators: Date format for log row header, see http://php.net/date */
			$datef = __('M j, Y \a\t G:i', "simple-history");
			$str_when = date_i18n( $datef, strtotime( get_date_from_gmt( $row->date ) ) );

		} else {

			// Show "nn minutes ago" when event is xx seconds ago or earlier
			$date_human_time_diff = human_time_diff($date_datetime->getTimestamp(), $time_current );
			/* translators: 1: last modified date and time in human time diff-format */
			$str_when = sprintf(__('%1$s ago', 'simple-history'), $date_human_time_diff);

		}

		$item_permalink = admin_url("index.php?page=simple_history_page");
		if ( ! empty( $row->id ) ) {
			$item_permalink .= "#item/{$row->id}";
		}

		$date_format = get_option('date_format') . ' - '. get_option('time_format');
		$str_datetime_title = sprintf(
			__('%1$s local time %3$s (%2$s GMT time)', "simple-history"),
			get_date_from_gmt( $date_datetime->format('Y-m-d H:i:s'), $date_format ), // 1 local time
			$date_datetime->format( $date_format ), // GMT time
			PHP_EOL // 3, new line
		);

		$date_html = "";
		$date_html .= "";
		$date_html .= sprintf(
			'<time datetime="%3$s" title="%1$s" class="">%2$s</time>',
			esc_attr( $str_datetime_title ), // 1 datetime attribute
			esc_html( $str_when ), // 2 date text, visible in log
			$date_datetime->format( DateTime::RFC3339 ) // 3
		);
		$date_html .= "";
		$date_html .= "";

		/**
		 * Filter the output of the date section of the header.
		 *
		 * @since 2.5.1
		 *
		 * @param String $date_html
		 * @param array $row
		 */
		$date_html = apply_filters("simple_history/row_header_date_output", $date_html, $row);

		// Logger "via" info in header, i.e. output some extra
		// info next to the time to make it more clear what plugin etc.
		// that "caused" this event
		$via_html = "";
		$logger_name_via = $this->getInfoValueByKey("name_via");

		if ( $logger_name_via ) {

			$via_html = "";
			$via_html .= $logger_name_via;
			$via_html .= "";

		}

		// Loglevel
		// SimpleHistoryLogitem--loglevel-warning
		/*
		$level_html = sprintf(
		'%1$s',
		$row->level
		);
		 */

		// Glue together final result
		$template = '
			%1$s
			%2$s
			%3$s
		';
		#if ( ! $initiator_html ) {
		#	$template = '%2$s';
		#}

		$html = sprintf(
			$template,
			$initiator_html, // 1
			$date_html, // 2
			$via_html // 3
		);

		/**
		 * Filter generated html for the log row header
		 *
		 * @since 2.0
		 *
		 * @param string $html
		 * @param object $row Log row
		 */
		$html = apply_filters("simple_history/row_header_output", $html, $row);

		return $html;

	}

	/**
	 * Returns the plain text version of this entry
	 * Used in for example CSV-exports.
	 * Defaults to log message with context interpolated.
	 * Keep format as plain and simple as possible.
	 * Links are ok, for example to link to users or posts.
	 * Tags will be stripped when text is used for CSV-exports and so on.
	 * Keep it on a single line. No
 or
 and so on.
	 *
	 * Example output:
	 * Edited post "About the company"
	 *
	 * Message should sound like it's coming from the user.
	 * Image that the name of the user is added in front of the text:
	 * Jessie James: Edited post "About the company"
	 */
	public function getLogRowPlainTextOutput($row) {

		$message = $row->message;
		$message_key = isset( $row->context["_message_key"] ) ? $row->context["_message_key"] : null;

		// Message is translated here, but translation must be added in
		// plain text before
		if ( empty( $message_key ) ) {

			// Message key did not exist, so check if we should translate using textdomain
			if ( ! empty( $row->context["_gettext_domain"] ) ) {
				$message = __( $message, $row->context["_gettext_domain"] );
			}

		} else {

			// Check that messages does exist
			// If we for example disable a Logger we may have references
			// to message keys that are unavailable. If so then fallback to message.
			if ( isset( $this->messages[$message_key]["translated_text"] ) ) {
				$message = $this->messages[$message_key]["translated_text"];
			} else {
				// Not message exists for message key. Just keep using message.
			}

		}

		$html = $this->interpolate($message, $row->context, $row);

		// All messages are escaped by default.
		// If you need unescaped output override this method
		// in your own logger
		$html = esc_html($html);

		/**
		 * Filter generated output for plain text output
		 *
		 * @since 2.0
		 *
		 * @param string $html
		 * @param object $row Log row
		 */
		$html = apply_filters("simple_history/row_plain_text_output", $html, $row);

		return $html;

	}

	/**
	 * Get output for image
	 * Image can be for example gravar if sender is user,
	 * or other images if sender i system, wordpress, and so on
	 */
	public function getLogRowSenderImageOutput($row) {

		$sender_image_html = "";
		$sender_image_size = 32;

		$initiator = $row->initiator;

		switch ($initiator) {

			// wp_user = wordpress uses, but user may have been deleted since log entry was added
			case "wp_user":

				$user_id = isset($row->context["_user_id"]) ? $row->context["_user_id"] : null;

				if ($user_id > 0 && $user = get_user_by("id", $user_id)) {

					// Sender was user
					$sender_image_html = $this->simpleHistory->get_avatar($user->user_email, $sender_image_size);

				} else if ($user_id > 0) {

					// Sender was a user, but user is deleted now
					$sender_image_html = $this->simpleHistory->get_avatar("", $sender_image_size);

				} else {

					$sender_image_html = $this->simpleHistory->get_avatar("", $sender_image_size);

				}

				break;

		}

		/**
		 * Filter generated output for row image (sender image)
		 *
		 * @since 2.0
		 *
		 * @param string $sender_image_html
		 * @param object $row Log row
		 */
		$sender_image_html = apply_filters("simple_history/row_sender_image_output", $sender_image_html, $row);

		return $sender_image_html;

	}

	/**
	 * Use this method to output detailed output for a log row
	 * Example usage is if a user has uploaded an image then a
	 * thumbnail of that image can bo outputed here
	 *
	 * @param object $row
	 * @return string HTML-formatted output
	 */
	public function getLogRowDetailsOutput($row) {

		$html = "";

		/**
		 * Filter generated output for details
		 *
		 * @since 2.0
		 *
		 * @param string $html
		 * @param object $row Log row
		 */
		$html = apply_filters("simple_history/row_details_output", $html, $row);

		return $html;

	}

	/**
	 * System is unusable.
	 *
	 * @param string $message
	 * @param array $context
	 * @return null
	 */
	public static function emergency($message, array $context = array()) {

		return $this->log(SimpleLoggerLogLevels::EMERGENCY, $message, $context);

	}

	/**
	 * System is unusable.
	 *
	 * @param string $message key from getInfo messages array
	 * @param array $context
	 * @return null
	 */
	public function emergencyMessage($message, array $context = array()) {

		return $this->logByMessageKey(SimpleLoggerLogLevels::EMERGENCY, $message, $context);

	}

	/**
	 * Log with message
	 * Called from infoMessage(), errorMessage(), and so on
	 *
	 * Call like this:
	 *
	 *   return $this->logByMessageKey(SimpleLoggerLogLevels::EMERGENCY, $message, $context);
	 */
	private function logByMessageKey($SimpleLoggerLogLevelsLevel, $messageKey, $context) {

		// When logging by message then the key must exist
		if ( ! isset( $this->messages[ $messageKey ]["untranslated_text"] ) ) {
			return;
		}

		/**
		 * Filter so plugins etc. can shortut logging
		 *
		 * @since 2.0.20
		 *
		 * @param true yes, we default to do the logging
		 * @param string logger slug
		 * @param string messageKey
		 * @param string log level
		 * @param array context
		 * @return bool false to abort logging
		 */
		$doLog = apply_filters("simple_history/simple_logger/log_message_key", true, $this->slug, $messageKey, $SimpleLoggerLogLevelsLevel, $context);

		if ( ! $doLog ) {
			return;
		}

		$context["_message_key"] = $messageKey;
		$message = $this->messages[ $messageKey ]["untranslated_text"];

		$this->log( $SimpleLoggerLogLevelsLevel, $message, $context );

	}

	/**
	 * Action must be taken immediately.
	 *
	 * @param string $message
	 * @param array $context
	 * @return null
	 */
	public static function alert($message, array $context = array()) {
		return $this->log(SimpleLoggerLogLevels::ALERT, $message, $context);

	}

	/**
	 * Action must be taken immediately.
	 *
	 * @param string $message key from getInfo messages array
	 * @param array $context
	 * @return null
	 */
	public function alertMessage($message, array $context = array()) {

		return $this->logByMessageKey(SimpleLoggerLogLevels::ALERT, $message, $context);

	}

	/**
	 * Critical conditions.
	 *
	 * Example: Application component unavailable, unexpected exception.
	 *
	 * @param string $message
	 * @param array $context
	 * @return null
	 */
	public static function critical($message, array $context = array()) {

		return $this->log(SimpleLoggerLogLevels::CRITICAL, $message, $context);

	}

	/**
	 * Critical conditions.
	 *
	 * @param string $message key from getInfo messages array
	 * @param array $context
	 * @return null
	 */
	public function criticalMessage($message, array $context = array()) {

		if (!isset($this->messages[$message]["untranslated_text"])) {
			return;
		}

		$context["_message_key"] = $message;
		$message = $this->messages[$message]["untranslated_text"];

		$this->log(SimpleLoggerLogLevels::CRITICAL, $message, $context);

	}

	/**
	 * Runtime errors that do not require immediate action but should typically
	 * be logged and monitored.
	 *
	 * @param string $message
	 * @param array $context
	 * @return null
	 */
	public function error($message, array $context = array()) {

		return $this->log(SimpleLoggerLogLevels::ERROR, $message, $context);

	}

	/**
	 * Runtime errors that do not require immediate action but should typically
	 * be logged and monitored.
	 *
	 * @param string $message key from getInfo messages array
	 * @param array $context
	 * @return null
	 */
	public function errorMessage($message, array $context = array()) {

		return $this->logByMessageKey(SimpleLoggerLogLevels::ERROR, $message, $context);

	}

	/**
	 * Exceptional occurrences that are not errors.
	 *
	 * Example: Use of deprecated APIs, poor use of an API, undesirable things
	 * that are not necessarily wrong.
	 *
	 * @param string $message
	 * @param array $context
	 * @return null
	 */
	public function warning($message, array $context = array()) {

		return $this->log(SimpleLoggerLogLevels::WARNING, $message, $context);

	}

	/**
	 * Exceptional occurrences that are not errors.
	 *
	 * @param string $message key from getInfo messages array
	 * @param array $context
	 * @return null
	 */
	public function warningMessage($message, array $context = array()) {

		return $this->logByMessageKey(SimpleLoggerLogLevels::WARNING, $message, $context);

	}

	/**
	 * Normal but significant events.
	 *
	 * @param string $message
	 * @param array $context
	 * @return null
	 */
	public function notice($message, array $context = array()) {

		return $this->log(SimpleLoggerLogLevels::NOTICE, $message, $context);

	}

	/**
	 * Normal but significant events.
	 *
	 * @param string $message key from getInfo messages array
	 * @param array $context
	 * @return null
	 */
	public function noticeMessage($message, array $context = array()) {

		return $this->logByMessageKey(SimpleLoggerLogLevels::NOTICE, $message, $context);

	}

	/**
	 * Interesting events.
	 *
	 * Example: User logs in, SQL logs.
	 *
	 * @param string $message
	 * @param array $context
	 * @return null
	 */
	public function info($message, array $context = array()) {

		return $this->log(SimpleLoggerLogLevels::INFO, $message, $context);

	}

	/**
	 * Interesting events.
	 *
	 * Example: User logs in, SQL logs.
	 *
	 * @param string $message key from getInfo messages array
	 * @param array $context
	 * @return null
	 */
	public function infoMessage($message, array $context = array()) {

		return $this->logByMessageKey(SimpleLoggerLogLevels::INFO, $message, $context);

	}

	/**
	 * Detailed debug information.
	 *
	 * @param string $message
	 * @param array $context
	 * @return null
	 */
	public function debug($message, array $context = array()) {

		return $this->log(SimpleLoggerLogLevels::DEBUG, $message, $context);

	}

	/**
	 * Detailed debug information.
	 *
	 * @param string $message key from getInfo messages array
	 * @param array $context
	 * @return null
	 */
	public function debugMessage($message, array $context = array()) {

		return $this->logByMessageKey(SimpleLoggerLogLevels::DEBUG, $message, $context);

	}

	/**
	 * Logs with an arbitrary level.
	 *
	 * @param mixed  $level The log level.
	 * @param string $message The log message.
	 * @param array  $context The log context.
	 * @return class SimpleLogger instance
	 */
	public function log( $level = 'info', $message = '', $context = array() ) {

		global $wpdb;

		// Check that passed args are of correct types.
		if ( ! is_string( $level ) || ! is_string( $message ) ) {
			return $this;
		}

		// Context must be array, but can be passed as null and so on.
		if ( ! is_array( $context ) ) {
			$context = array();
		}

		// Don't go on if message is empty.
		if ( empty( $message ) ) {
			return $this;
		}

		/*
		 * Filter that makes it possible to shortcut this log.
		 * Return bool false to cancel.
		 *
		 * @since 2.3.1
		 */
		$do_log = apply_filters( 'simple_history/log/do_log', true, $level, $message, $context, $this );

		if ( $do_log === false ) {
			return $this;
		}

		// Check if $message is a translated message, and if so then fetch original
		$sh_latest_translations = $this->simpleHistory->gettextLatestTranslations;

		if ( ! empty( $sh_latest_translations ) ) {

			if ( isset( $sh_latest_translations[ $message ] ) ) {

				// Translation of this phrase was found, so use original phrase instead of translated one

				// Store textdomain since it's required to translate
				$context["_gettext_domain"] = $sh_latest_translations[$message]["domain"];

				// These are good to keep when debugging
				// $context["_gettext_org_message"] = $sh_latest_translations[$message]["text"];
				// $context["_gettext_translated_message"] = $sh_latest_translations[$message]["translation"];

				$message = $sh_latest_translations[ $message ]["text"];
			}

		}

		/**
		 * Filter arguments passed to log funtion
		 *
		 * @since 2.0
		 *
		 * @param string $level
		 * @param string $message
		 * @param array $context
		 * @param object SimpleLogger object
		 */
		apply_filters("simple_history/log_arguments", $level, $message, $context, $this);
		$context = apply_filters("simple_history/log_argument/context", $context, $level, $message, $this);
		$level = apply_filters("simple_history/log_argument/level", $level, $context, $message, $this);
		$message = apply_filters("simple_history/log_argument/message", $message, $level, $context, $this);

		/* Store date as GMT date, i.e. not local date/time
		 * Some info here:
		 * http://www.skyverge.com/blog/down-the-rabbit-hole-wordpress-and-timezones/
		 */
		$localtime = current_time("mysql", 1);

		$db_table = $wpdb->prefix . SimpleHistory::DBTABLE;

		/**
		 * Filter db table used for simple history events
		 *
		 * @since 2.0
		 *
		 * @param string $db_table
		 */
		$db_table = apply_filters("simple_history/db_table", $db_table);

		$data = array(
			"logger" => $this->slug,
			"level" => $level,
			"date" => $localtime,
			"message" => $message,
		);

		// Allow date to be override
		// Date must be in format 'Y-m-d H:i:s'
		if (isset($context["_date"])) {
			$data["date"] = $context["_date"];
			unset($context["_date"]);
		}

		// Add occasions id
		$occasions_id = null;
		if (isset($context["_occasionsID"])) {

			// Minimize risk of similar loggers logging same messages and such and resulting in same occasions id
			// by always adding logger slug
			$occasions_data = array(
				"_occasionsID" => $context["_occasionsID"],
				"_loggerSlug" => $this->slug,
			);
			$occasions_id = md5(json_encode($occasions_data));
			unset($context["_occasionsID"]);

		} else {

			// No occasions id specified, create one bases on the data array
			$occasions_data = $data + $context;
			// error_log(simpleHistory::json_encode($occasions_data));
			// Don't include date in context data
			unset($occasions_data["date"]);

			//sf_d($occasions_data);exit;
			$occasions_id = md5(json_encode($occasions_data));

		}

		$data["occasionsID"] = $occasions_id;

		// Log event type, defaults to other if not set
		/*
		if ( isset( $context["_type"] ) ) {
		$data["type"] = $context["_type"];
		unset( $context["_type"] );
		} else {
		$data["type"] = SimpleLoggerLogTypes::OTHER;
		}
		 */

		// Log initiator, defaults to current user if exists, or other if not user exist
		if ( isset( $context["_initiator"] ) ) {

			// Manually set in context
			$data["initiator"] = $context["_initiator"];
			unset( $context["_initiator"] );

		} else {

			// No initiator set, try to determine

			// Default to other
			$data["initiator"] = SimpleLoggerLogInitiators::OTHER;

			// Check if user is responsible.
			if ( function_exists("wp_get_current_user") ) {

				$current_user = wp_get_current_user();

				if ( isset( $current_user->ID ) && $current_user->ID ) {

					$data["initiator"] = SimpleLoggerLogInitiators::WP_USER;
					$context["_user_id"] = $current_user->ID;
					$context["_user_login"] = $current_user->user_login;
					$context["_user_email"] = $current_user->user_email;

				}

			}

			// If cron then set WordPress as responsible
			if ( defined('DOING_CRON') && DOING_CRON ) {

				// Seems to be wp cron running and doing this
				$data["initiator"] = SimpleLoggerLogInitiators::WORDPRESS;
				$context["_wp_cron_running"] = true;

			}

			// If running as CLI and WP_CLI_PHP_USED is set then it is WP CLI that is doing it
			// How to log this? Is this a user, is it WordPress, or what?
			// I'm thinking:
			//  - it is a user that is manually doing this, on purpose, with intent, so not auto wordpress
			//  - it is a specific user, but we don't know who
			// - sounds like a special case, set initiator to wp_cli
			// Can be used by plugins/themes to check if WP-CLI is running or not
			if ( defined( "WP_CLI" ) && WP_CLI ) {

				$data["initiator"] = SimpleLoggerLogInitiators::WP_CLI;

			}

		}

		// Detect XML-RPC calls and append to context, if not already there
		if ( defined("XMLRPC_REQUEST") && XMLRPC_REQUEST && ! isset( $context["_xmlrpc_request"] ) ) {

			$context["_xmlrpc_request"] = true;

		}

		// Trim message
		$data["message"] = trim( $data["message"] );

		/**
		 * Filter data to be saved to db
		 *
		 * @since 2.0
		 *
		 * @param array $data
		 */
		$data = apply_filters("simple_history/log_insert_data", $data);

		// Insert data into db
		// sf_d($db_table, '$db_table');exit;

		$result = $wpdb->insert($db_table, $data);

		$data_parent_row = null;

		// Only save context if able to store row
		if (false === $result) {

			$history_inserted_id = null;

		} else {

			$history_inserted_id = $wpdb->insert_id;

			$db_table_contexts = $wpdb->prefix . SimpleHistory::DBTABLE_CONTEXTS;

			/**
			 * Filter table name for contexts
			 *
			 * @since 2.0
			 *
			 * @param string $db_table_contexts
			 */
			$db_table_contexts = apply_filters("simple_history/logger_db_table_contexts", $db_table_contexts);

			if (!is_array($context)) {
				$context = array();
			}

			// Append user id to context, if not already added
			if (!isset($context["_user_id"])) {

				// wp_get_current_user is ont available early
				// http://codex.wordpress.org/Function_Reference/wp_get_current_user
				// https://core.trac.wordpress.org/ticket/14024
				if (function_exists("wp_get_current_user")) {

					$current_user = wp_get_current_user();

					if (isset($current_user->ID) && $current_user->ID) {
						$context["_user_id"] = $current_user->ID;
						$context["_user_login"] = $current_user->user_login;
						$context["_user_email"] = $current_user->user_email;
					}

				}

			}

			// Add remote addr to context
			// Good to always have
			if ( ! isset($context["_server_remote_addr"]) ) {

				$context["_server_remote_addr"] = empty($_SERVER["REMOTE_ADDR"]) ? "" : $_SERVER["REMOTE_ADDR"];

				// If web server is behind a load balancer then the ip address will always be the same
				// See bug report: https://wordpress.org/support/topic/use-x-forwarded-for-http-header-when-logging-remote_addr?replies=1#post-6422981
				// Note that the x-forwarded-for header can contain multiple ips, comma separated
				// Also note that the header can be faked
				// Ref: http://stackoverflow.com/questions/753645/how-do-i-get-the-correct-ip-from-http-x-forwarded-for-if-it-contains-multiple-ip
				// Ref: http://blackbe.lt/advanced-method-to-obtain-the-client-ip-in-php/

				// Check for IP in lots of headers
				// Based on code found here:
				// http://blackbe.lt/advanced-method-to-obtain-the-client-ip-in-php/
				$ip_keys = $this->get_ip_number_header_keys();

				foreach ( $ip_keys as $key ) {

					if (array_key_exists($key, $_SERVER) === true) {

						// Loop through all IPs
						$ip_loop_num = 0;
						foreach (explode(',', $_SERVER[$key]) as $ip) {

							// trim for safety measures
							$ip = trim($ip);

							// attempt to validate IP
							if ($this->validate_ip($ip)) {

								// valid, add to context, with loop index appended so we can store many IPs
								$key_lower = strtolower($key);
								$context["_server_{$key_lower}_{$ip_loop_num}"] = $ip;

							}

							$ip_loop_num++;

						}

					}

				}

			}

			// Append http referer
			// Also good to always have!
			if (!isset($context["_server_http_referer"]) && isset($_SERVER["HTTP_REFERER"])) {
				$context["_server_http_referer"] = $_SERVER["HTTP_REFERER"];
			}

			/**
			 * Filter the context to store for this event/row
			 *
			 * @since 2.0.29
			 *
			 * @param array $context Array with all context data to store. Modify and return this.
			 * @param array $data Array with data used for parent row.
			 * @param array $this Reference to this logger instance
			 */
			$context = apply_filters("simple_history/log_insert_context", $context, $data, $this);
			$data_parent_row = $data;

			// Insert all context values into db
			foreach ( $context as $key => $value ) {

				// If value is array or object then use json_encode to store it
				//if ( is_object( $value ) || is_array( $value ) ) {
				//	$value = simpleHistory::json_encode($value);
				//}
				// Any reason why the check is not the other way around?
				// Everything except strings should be json_encoded
				if ( ! is_string( $value ) ) {
					$value = simpleHistory::json_encode( $value );
				}

				$data = array(
					"history_id" => $history_inserted_id,
					"key" => $key,
					"value" => $value,
				);

				$result = $wpdb->insert ($db_table_contexts, $data );

			}

		}

		$this->lastInsertID = $history_inserted_id;

		$this->simpleHistory->get_cache_incrementor(true);

		/**
		 * Action that is called after an event has been logged
		 *
		 * @since 2.5.1
		 *
		 * @param array $context Array with all context data to store. Modify and return this.
		 * @param array $data Array with data used for parent row.
		 * @param array $this Reference to this logger instance
		 */
		do_action( "simple_history/log/inserted", $context, $data_parent_row, $this );

		// Return $this so we can chain methods
		return $this;

	} // log

	/**
	 * Returns array with headers that may contain user IP
	 *
	 * @since 2.0.29
	 */
	public function get_ip_number_header_keys() {

		$arr = array(
			'HTTP_CLIENT_IP',
			'HTTP_X_FORWARDED_FOR',
			'HTTP_X_FORWARDED',
			'HTTP_X_CLUSTER_CLIENT_IP',
			'HTTP_FORWARDED_FOR',
			'HTTP_FORWARDED'
		);

		return $arr;

	}

	/**
	 * Returns additional headers with ip number from context
	 *
	 * @since 2.0.29
	 */
	function get_event_ip_number_headers($row) {

		$ip_keys = $this->get_ip_number_header_keys();
		$arr_found_additional_ip_headers = array();
		$context = $row->context;

		foreach ( $ip_keys as $one_ip_header_key ) {

			$one_ip_header_key_lower = strtolower($one_ip_header_key);

			foreach ( $context as $context_key => $context_val ) {

				#$key_check_for = "_server_" . strtolower($one_ip_header_key) . "_0";

				$match = preg_match("/^_server_{$one_ip_header_key_lower}_[\d+]/", $context_key, $matches);
				if ( $match ) {
					$arr_found_additional_ip_headers[ $context_key ] = $context_val;
				}

			} // foreach context key for this ip header key

		} // foreach ip header key

		return $arr_found_additional_ip_headers;

	}

	/**
	 * Ensures an ip address is both a valid IP and does not fall within
	 * a private network range.
	 */
	function validate_ip($ip) {

		if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4|FILTER_FLAG_NO_PRIV_RANGE|FILTER_FLAG_NO_RES_RANGE) === false) {
			return false;
		}

		return true;

	}

	/**
	 * Override this to add CSS in  for your logger.
	 * The CSS that you output will only be outputed
	 * on pages where Simple History is used.
	 */
	function adminCSS() {
		/*
	?>

	<?php
	 */
	}

	/**
	 * Override this to add JavaScript in the footer for your logger.
	 * The JS that you output will only be outputed
	 * on pages where Simple History is used.
	 */
	function adminJS() {
		/*
	?>

	<?php
	 */
	}

}

/**
 * Describes log initiator, i.e. who caused to log event to happend
 */
class SimpleLoggerLogInitiators {

	// A wordpress user that at the log event created did exist in the wp database
	// May have been deleted when the log is viewed
	const WP_USER = 'wp_user';

	// Cron job run = wordpress initiated
	// Email sent to customer on webshop = system/wordpress/anonymous web user
	// Javascript error occured on website = anonymous web user
	const WEB_USER = 'web_user';

	// WordPress core or plugins updated automatically via wp-cron
	const WORDPRESS = "wp";

	// WP CLI / terminal
	const WP_CLI = "wp_cli";

	// I dunno
	const OTHER = 'other';
}

/**
 * Describes log event type
 * Based on the CRUD-types
 * http://en.wikipedia.org/wiki/Create,_read,_update_and_delete
 * More may be added later on if needed
 * Note: not in use at the moment
 */
class SimpleLoggerLogTypes {
	const CREATE = 'create';
	const READ = 'read';
	const UPDATE = 'update';
	const DELETE = 'delete';
	const OTHER = 'other';
}

/**
 * Describes log levels
 */
class SimpleLoggerLogLevels {
	const EMERGENCY = 'emergency';
	const ALERT = 'alert';
	const CRITICAL = 'critical';
	const ERROR = 'error';
	const WARNING = 'warning';
	const NOTICE = 'notice';
	const INFO = 'info';
	const DEBUG = 'debug';
}


text:
#ifndef _MESSAGES_LC_H_
#define _MESSAGES_LC_H_

#include "MessageCore.h"
#define LOBBYVER 12 //Imago updated for R5 8/6/09 /- #2 6/10

 /*
  *************************************************
                 MESSAGES START HERE

         Messages range for this file is 251 - 300

  *************************************************

  Message prefixes:
    L_  lobby to client
    C_  client to lobby
    LC_ both ways
*/

// We've changed the logon message but need to let older clients connect and
// auto-update.  We should remove this post-beta.
DEFINE_FEDMSG(C, LOGON_LOBBY_OLD, 251) // if the lobby is in club mode, everyone has to have a valid ticket, otherwise the ticket is ignored
  FM_VAR_ITEM(ZoneTicket);    // Encrypted
  short verLobby;
  int   crcFileList;
  DWORD dwTime;
END_FEDMSG

DEFINE_FEDMSG(C, LOGOFF_LOBBY, 252) // note: we don't care whether they joined a game or quit altogether
END_FEDMSG

// When a client receives ART_SERVER_INFO, it logs off
DEFINE_FEDMSG(L, AUTO_UPDATE_INFO, 253)
  FM_VAR_ITEM(FTPSite); // FTP Server
  FM_VAR_ITEM(FTPInitialDirectory);
  FM_VAR_ITEM(FTPAccount);
  FM_VAR_ITEM(FTPPassword);
  int         crcFileList; // correct version of server's filelist
  unsigned    nFileListSize;
END_FEDMSG

DEFINE_FEDMSG(C, CREATE_MISSION_REQ, 254) // client should lock ui until it gets back an ack or nack
    FM_VAR_ITEM(Server);        // KGJV #114
    FM_VAR_ITEM(Address);       // KGJV #114
	FM_VAR_ITEM(IGCStaticFile); // KGJV #114
	FM_VAR_ITEM(GameName);      // KGJV #114
END_FEDMSG

DEFINE_FEDMSG(L, CREATE_MISSION_ACK, 255)
  DWORD dwCookie; // when the client gets the lobby mission info for this guy, he's free to join. Maybe make that more explicit?
END_FEDMSG

DEFINE_FEDMSG(L, CREATE_MISSION_NACK, 256) // the mission could not be created, because there are no available servers
END_FEDMSG

DEFINE_FEDMSG(C, JOIN_GAME_REQ, 257) // successful request is responded w/ a JOIN_MISSION
  DWORD dwCookie;
END_FEDMSG

DEFINE_FEDMSG(L, JOIN_GAME_NACK, 259)
END_FEDMSG

DEFINE_FEDMSG(L, JOIN_MISSION, 260)
  DWORD dwCookie; // client should ignore this message unless it's the cookie for the most recent join/create request
char szServer[INET6_ADDRSTRLEN];
  DWORD dwPort;			// mdvalley: pass the port to the client
  GUID guidInstance;
END_FEDMSG

DEFINE_FEDMSG(L, LOGON_ACK, 261)
  DWORD dwTimeOffset;
  int iID;
END_FEDMSG

DEFINE_FEDMSG(L, LOGON_NACK, 262)  // tells client that theyt can't join the lobby.
  FM_VAR_ITEM(Reason);
  bool fRetry;
END_FEDMSG

DEFINE_FEDMSG(C, FIND_PLAYER, 263)
  FM_VAR_ITEM(szCharacterName);
END_FEDMSG

DEFINE_FEDMSG(L, FOUND_PLAYER, 264)
  DWORD         dwCookie;
END_FEDMSG

//
// If LOGON_LOBBY ever changes, existing clients will not be able to AutoUpdate to this lobby's version.
// unless we pull another LOGON_LOBBY_OLD trick.
//

#define CL_LOGON_KEY ("%x:%s: Corrupt artwork file ") // just to confuse a hacker

DEFINE_FEDMSG(C, LOGON_LOBBY, 265) // if the lobby is in club mode, everyone has to have a valid ticket, otherwise the ticket is ignored
  FM_VAR_ITEM(CdKey);
  short verLobby;
  int   crcFileList;
  DWORD dwTime;
  char  szName[c_cbName];
  char  szPW[c_cbCDKey];
END_FEDMSG

// KGJV #114
struct ServerCoreInfo
{
	char szName[c_cbName];
	char szRemoteAddress[INET6_ADDRSTRLEN];
	char szLocation[c_cbFileName]; //it's not a filename but we want it short- keep in sync with CFLServer::m_szLocation
	int  iCurGames;
	int  iMaxGames;
	DWORD dwCoreMask; // 32 bits mask (so max is 32 cores)
};

DEFINE_FEDMSG(C, GET_SERVERS_REQ, 266) // sent by clients to request the servers list
END_FEDMSG

DEFINE_FEDMSG(L, SERVERS_LIST, 267) // sent by lobby in reply to GET_SERVERS_REQ
  FM_VAR_ITEM(Cores);	// CoreInfo array of cCores elements
  FM_VAR_ITEM(Servers); // ServerCoreInfo array of cServers elements
  int cCores;
  int cServers;
END_FEDMSG

#endif // _MESSAGES_LC_H_


text:
<?php

namespace BrainExe\Core\Console;

use BrainExe\Core\Traits\RedisTrait;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use BrainExe\Core\Annotations\Command as CommandAnnotation;

/**
 * @CommandAnnotation
 */
class ClearSessionsCommand extends Command
{

    use RedisTrait;

    /**
     * {@inheritdoc}
     */
    protected function configure()
    {
        $this->setName('sessions:clear')
            ->setDescription('Clear all sessions');
    }

    /**
     * {@inheritdoc}
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $redis = $this->getRedis();

        $sessionIds = $redis->keys('sessions:*');

        foreach ($sessionIds as $sessionId) {
            $redis->del($sessionId);
        }

        $output->writeln(sprintf('Deleted <info>%d</info> sessions', count($sessionIds)));
    }
}


text:
package ee.ria.xroad.proxy.conf;

import ee.ria.xroad.common.CodedException;
import ee.ria.xroad.common.cert.CertChain;
import ee.ria.xroad.common.conf.globalconf.GlobalConf;
import ee.ria.xroad.common.identifier.ClientId;
import ee.ria.xroad.common.signature.SignatureBuilder;
import ee.ria.xroad.common.signature.SignatureData;
import ee.ria.xroad.common.util.CryptoUtils;
import ee.ria.xroad.proxy.signedmessage.SigningKey;

import lombok.RequiredArgsConstructor;
import org.bouncycastle.cert.ocsp.OCSPResp;

import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.List;

import static ee.ria.xroad.common.ErrorCodes.X_CANNOT_CREATE_SIGNATURE;

/**
 * Encapsulates security-related parameters of a given member,
 * such as currently used signing key and cert.
 */
@RequiredArgsConstructor
public class SigningCtxImpl implements SigningCtx {

    // TODO make it configurable.
    private static final String DIGEST_ALGORITHM = CryptoUtils.SHA512_ID;

    /** The subject id of the signer. */
    private final ClientId subject;

    /** Encapsulates private key of the signer. */
    private final SigningKey key;

    /** The certificate of the signer. */
    private final X509Certificate cert;

    @Override
    public SignatureData buildSignature(SignatureBuilder builder) throws Exception {
        List<X509Certificate> extraCerts = getIntermediateCaCerts();
        List<OCSPResp> ocspResponses = getOcspResponses(extraCerts);

        builder.addExtraCertificates(extraCerts);
        builder.addOcspResponses(ocspResponses);
        builder.setSigningCert(cert);

        return builder.build(key, DIGEST_ALGORITHM);
    }

    private List<OCSPResp> getOcspResponses(List<X509Certificate> certs) throws Exception {
        List<X509Certificate> allCerts = new ArrayList<>(certs.size() + 1);
        allCerts.add(cert);
        allCerts.addAll(certs);

        return KeyConf.getAllOcspResponses(allCerts);
    }

    private List<X509Certificate> getIntermediateCaCerts() throws Exception {
        CertChain chain = GlobalConf.getCertChain(subject.getXRoadInstance(), cert);

        if (chain == null) {
            throw new CodedException(X_CANNOT_CREATE_SIGNATURE, "Got empty certificate chain for certificate %s",
                    cert.getSerialNumber());
        }

        return chain.getAdditionalCerts();
    }
}


text:
package org.apache.lucene.search.suggest.xdocument;

import org.apache.lucene.store.DataOutput;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.BytesRefBuilder;
import org.apache.lucene.util.IntsRefBuilder;
import org.apache.lucene.util.fst.*;

import java.io.IOException;
import java.util.PriorityQueue;

import static org.apache.lucene.search.suggest.xdocument.NRTSuggester.encode;

/**
 * Builder for {@link NRTSuggester}
 *
 */
final class NRTSuggesterBuilder {

  /**
   * Label used to separate surface form and docID
   * in the output
   */
  public static final int PAYLOAD_SEP = '\u001F';

  /**
   * Marks end of the analyzed input and start of dedup
   * byte.
   */
  public static final int END_BYTE = 0x0;

  private final PairOutputs<Long, BytesRef> outputs;
  private final Builder<PairOutputs.Pair<Long, BytesRef>> builder;
  private final IntsRefBuilder scratchInts = new IntsRefBuilder();
  private final BytesRefBuilder analyzed = new BytesRefBuilder();
  private final PriorityQueue<Entry> entries;
  private final int payloadSep;
  private final int endByte;

  private int maxAnalyzedPathsPerOutput = 0;

  /**
   * Create a builder for {@link NRTSuggester}
   */
  public NRTSuggesterBuilder() {
    this.payloadSep = PAYLOAD_SEP;
    this.endByte = END_BYTE;
    this.outputs = new PairOutputs<>(PositiveIntOutputs.getSingleton(), ByteSequenceOutputs.getSingleton());
    this.entries = new PriorityQueue<>();
    this.builder = new Builder<>(FST.INPUT_TYPE.BYTE1, outputs);
  }

  /**
   * Initializes an FST input term to add entries against
   */
  public void startTerm(BytesRef analyzed) {
    this.analyzed.copyBytes(analyzed);
    this.analyzed.append((byte) endByte);
  }

  /**
   * Adds an entry for the latest input term, should be called after
   * {@link #startTerm(org.apache.lucene.util.BytesRef)} on the desired input
   */
  public void addEntry(int docID, BytesRef surfaceForm, long weight) throws IOException {
    BytesRef payloadRef = NRTSuggester.PayLoadProcessor.make(surfaceForm, docID, payloadSep);
    entries.add(new Entry(payloadRef, encode(weight)));
  }

  /**
   * Writes all the entries for the FST input term
   */
  public void finishTerm() throws IOException {
    int numArcs = 0;
    int numDedupBytes = 1;
    analyzed.grow(analyzed.length() + 1);
    analyzed.setLength(analyzed.length() + 1);
    for (Entry entry : entries) {
      if (numArcs == maxNumArcsForDedupByte(numDedupBytes)) {
        analyzed.setByteAt(analyzed.length() - 1, (byte) (numArcs));
        analyzed.grow(analyzed.length() + 1);
        analyzed.setLength(analyzed.length() + 1);
        numArcs = 0;
        numDedupBytes++;
      }
      analyzed.setByteAt(analyzed.length() - 1, (byte) numArcs++);
      XUtil.toIntsRef(analyzed.get(), scratchInts);
      builder.add(scratchInts.get(), outputs.newPair(entry.weight, entry.payload));
    }
    maxAnalyzedPathsPerOutput = Math.max(maxAnalyzedPathsPerOutput, entries.size());
    entries.clear();
  }

  /**
   * Builds and stores a FST that can be loaded with
   * {@link NRTSuggester#load(org.apache.lucene.store.IndexInput)}
   */
  public boolean store(DataOutput output) throws IOException {
    final FST<PairOutputs.Pair<Long, BytesRef>> build = builder.finish();
    if (build == null) {
      return false;
    }
    build.save(output);

    /* write some more meta-info */
    assert maxAnalyzedPathsPerOutput > 0;
    output.writeVInt(maxAnalyzedPathsPerOutput);
    output.writeVInt(END_BYTE);
    output.writeVInt(PAYLOAD_SEP);
    return true;
  }

  /**
   * Num arcs for nth dedup byte:
   * if n <= 5: 1 + (2 * n)
   * else: (1 + (2 * n)) * n
   * <p>
   * TODO: is there a better way to make the fst built to be
   * more TopNSearcher friendly?
   */
  private static int maxNumArcsForDedupByte(int currentNumDedupBytes) {
    int maxArcs = 1 + (2 * currentNumDedupBytes);
    if (currentNumDedupBytes > 5) {
      maxArcs *= currentNumDedupBytes;
    }
    return Math.min(maxArcs, 255);
  }

  private final static class Entry implements Comparable<Entry> {
    final BytesRef payload;
    final long weight;

    public Entry(BytesRef payload, long weight) {
      this.payload = payload;
      this.weight = weight;
    }

    @Override
    public int compareTo(Entry o) {
      return Long.compare(weight, o.weight);
    }
  }
}


text:
@implementation PHFComposeBarView_Button

- (void)setHighlighted:(BOOL)highlighted {
    if (highlighted) {
        [self setAlpha:0.2f];
    } else {
        [UIView animateWithDuration:0.2
                              delay:0
                            options:UIViewAnimationOptionBeginFromCurrentState
                         animations:^{
                             [self setAlpha:1.0f];
                         }
                         completion:NULL];
    }
}

@end


text:
"""
playa.web
~~~~~~~~~

:copyright: (c) 2011 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""


text:
'use strict';

module.exports = function(stream, devour, type, inject) {
	var dest = 'public/' + type,
		ext  = type === 'script' ? 'js' : 'css',
		minifier = type === 'script' ? 'uglify' : 'minify-css';

	stream = stream
		//  put the files in the proper order before concatenation
		.pipe(devour.pipe('order'))

		//  combine the file into a single file containing all (included) sources
		.pipe(devour.plugin('concat', dest + '/combined.' + ext))

		//  write the plain combined file
		.pipe(devour.write())
	;

	if (inject) {
		stream = stream.pipe(inject);
	}

	return stream
		.pipe(devour.pipe('minify', minifier))
	;
};


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="rustdoc">
    <meta name="description" content="API documentation for the Rust `OwnedAttribute` struct in crate `xml`.">
    <meta name="keywords" content="rust, rustlang, rust-lang, OwnedAttribute">

    <title>xml::attribute::OwnedAttribute - Rust</title>

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

xml::<wbr>attribute

        <form class="search-form js-only">

                <input class="search-input" name="search"
                       autocomplete="off"
                       placeholder="Click or press 'S' to search, '?' for more options..."
                       type="search">

        </form>

Struct xml::<wbr>attribute::<wbr>OwnedAttribute

                [−]

        [src]

pub struct OwnedAttribute {
    pub name: OwnedName,
    pub value: String,
}

Fields

                                  name

                                  value

Methods

impl OwnedAttribute

fn borrow(&self) -> Attribute

fn new(name: OwnedName, value: String) -> OwnedAttribute

Trait Implementations

impl Display for OwnedAttribute

fn fmt(&self, f: &mut Formatter) -> Result

Derived Implementations

impl Debug for OwnedAttribute

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Hash for OwnedAttribute

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher

impl PartialEq for OwnedAttribute

fn eq(&self, __arg_0: &OwnedAttribute) -> bool

fn ne(&self, __arg_0: &OwnedAttribute) -> bool

impl Eq for OwnedAttribute

impl Clone for OwnedAttribute

fn clone(&self) -> OwnedAttribute

fn clone_from(&mut self, source: &Self)

Keyboard shortcuts

?

Show this help dialog

S

Focus the search field

⇤

Move up in search results

⇥

Move down in search results

⏎

Go to active search result

Search tricks

                Prefix searches with a type followed by a colon (e.g.
                fn:) to restrict the search to a given type.

                Accepted types are: fn, mod,
                struct, enum,
                trait, typedef (or
                tdef).

                Search functions by type signature (e.g.
                vec -> usize)


text:
package ee.ria.xroad.opmonitordaemon;

import ee.ria.xroad.common.db.DatabaseCtx;
import ee.ria.xroad.common.db.TransactionCallback;

import org.apache.commons.lang.StringUtils;
import org.hibernate.EmptyInterceptor;
import org.hibernate.type.StringType;
import org.hibernate.type.Type;

import java.io.Serializable;

/**
 * Database context for the operational monitoring daemon
 */
final class OpMonitorDaemonDatabaseCtx {

    private static final DatabaseCtx CTX = new DatabaseCtx("op-monitor",
            new StringValueTruncator());

    private OpMonitorDaemonDatabaseCtx() {
    }

    /**
     * @return the database context instance
     */
    static DatabaseCtx get() {
        return CTX;
    }

    /**
     * Convenience method for executing a database operation in a transaction.
     * @param <T> the type of result
     * @param callback the callback
     * @return the result
     * @throws Exception if an error occurs
     */
    static <T> T doInTransaction(TransactionCallback<T> callback)
            throws Exception {
        return CTX.doInTransaction(callback);
    }

    private static class StringValueTruncator extends EmptyInterceptor {
        private static final long serialVersionUID = 1L;

        private static final String SOAP_FAULT_STRING = "soapFaultString";

        private static final int FAULT_MAX_LENGTH = 2048;
        private static final int MAX_LENGTH = 255;

        @Override
        public boolean onFlushDirty(Object entity, Serializable id,
                Object[] currentState, Object[] previousState,
                String[] propertyNames, Type[] types) {
            if (entity instanceof OperationalDataRecord) {
                truncateStringProperties(currentState, propertyNames, types);
                return true;
            }

            return false;
        }

        @Override
        public boolean onSave(Object entity, Serializable id, Object[] state,
                String[] propertyNames, Type[] types) {
            if (entity instanceof OperationalDataRecord) {
                truncateStringProperties(state, propertyNames, types);
                return true;
            }

            return false;
        }

        private static void truncateStringProperties(Object[] state,
                String[] propertyNames, Type[] types) {
            for (int i = 0; i < types.length; i++) {
                if (types[i] instanceof StringType) {
                    int maxLength = MAX_LENGTH;
                    if (propertyNames[i].equals(SOAP_FAULT_STRING)) {
                        maxLength = FAULT_MAX_LENGTH;
                    }

                    state[i] = StringUtils.substring((String) state[i], 0,
                            maxLength);
                }
            }
        }

    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>TestStepDto (testah-junit 1.1.3 API)</title>
<meta name="date" content="2018-07-22">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.testah.client.dto

Class TestStepDto

java.lang.Object

org.testah.client.dto.TestStepDto

Direct Known Subclasses:

Step

public class TestStepDto
extends java.lang.Object

The Class TestStepDto.

Field Summary

Fields

Modifier and Type
Field and Description

protected java.util.List<StepActionDto>
stepActions

The step actions.

Constructor Summary

Constructors

Constructor and Description

TestStepDto()

Instantiates a new test step dto.

TestStepDto(java.lang.String name,
           java.lang.String description)

Instantiates a new test step dto.

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

TestStepDto
addStepAction(StepActionDto stepActions)

Adds the step action.

TestStepDto
addStepActions(StepActionDto stepAction)

Adds the step actions.

java.lang.String
getDescription()

Gets the description.

java.lang.String
getExceptionMessages()

Gets the exception messages.

int
getId()

Gets the id.

java.lang.String
getName()

Gets the name.

RunTimeDto
getRunTime()

Gets the run time.

java.lang.Boolean
getStatus()

Gets the status.

TestStatus
getStatusEnum()

Gets the status enum.

java.util.List<StepActionDto>
getStepActions()

Gets the step actions.

TestStepDto
setDescription(java.lang.String description)

Sets the description.

TestStepDto
setExceptionMessages(java.lang.String exceptionMessage)

TestStepDto
setId(int id)

Sets the id.

TestStepDto
setName(java.lang.String name)

Sets the name.

TestStepDto
setRunTime(RunTimeDto runTime)

Sets the run time.

TestStepDto
setStatus()

Sets the status.

TestStepDto
setStatus(java.lang.Boolean status)

Sets the status.

TestStepDto
setStatusEnum(TestStatus statusEnum)

TestStepDto
setStepActions(java.util.List<StepActionDto> stepActions)

Sets the step actions.

TestStepDto
start()

Start.

TestStepDto
stop()

Stop.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

stepActions

protected java.util.List<StepActionDto> stepActions

The step actions.

Constructor Detail

TestStepDto

public TestStepDto()

Instantiates a new test step dto.

TestStepDto

public TestStepDto(java.lang.String name,
                   java.lang.String description)

Instantiates a new test step dto.

Parameters:

name - the name

description - the description

Method Detail

addStepAction

public TestStepDto addStepAction(StepActionDto stepActions)

Adds the step action.

Parameters:

stepActions - the step actions

Returns:

the test step dto

start

public TestStepDto start()

Start.

Returns:

the test step dto

stop

public TestStepDto stop()

Stop.

Returns:

the test step dto

setStatus

public TestStepDto setStatus(java.lang.Boolean status)

Sets the status.

Parameters:

status - the status

Returns:

the test step dto

setStatus

public TestStepDto setStatus()

Sets the status.

Returns:

the test step dto

getRunTime

public RunTimeDto getRunTime()

Gets the run time.

Returns:

the run time

setRunTime

public TestStepDto setRunTime(RunTimeDto runTime)

Sets the run time.

Parameters:

runTime - the run time

Returns:

the test step dto

getStatus

public java.lang.Boolean getStatus()

Gets the status.

Returns:

the status

getExceptionMessages

public java.lang.String getExceptionMessages()

Gets the exception messages.

Returns:

the exception messages

setExceptionMessages

public TestStepDto setExceptionMessages(java.lang.String exceptionMessage)

getStepActions

public java.util.List<StepActionDto> getStepActions()

Gets the step actions.

Returns:

the step actions

addStepActions

public TestStepDto addStepActions(StepActionDto stepAction)

Adds the step actions.

Parameters:

stepAction - the step action

Returns:

the test step dto

setStepActions

public TestStepDto setStepActions(java.util.List<StepActionDto> stepActions)

Sets the step actions.

Parameters:

stepActions - the step actions

Returns:

the test step dto

getId

public int getId()

Gets the id.

Returns:

the id

setId

public TestStepDto setId(int id)

Sets the id.

Parameters:

id - the id

Returns:

the test step dto

getStatusEnum

public TestStatus getStatusEnum()

Gets the status enum.

Returns:

the status enum

setStatusEnum

public TestStepDto setStatusEnum(TestStatus statusEnum)

getName

public java.lang.String getName()

Gets the name.

Returns:

the name

setName

public TestStepDto setName(java.lang.String name)

Sets the name.

Parameters:

name - the name

Returns:

the test step dto

getDescription

public java.lang.String getDescription()

Gets the description.

Returns:

the description

setDescription

public TestStepDto setDescription(java.lang.String description)

Sets the description.

Parameters:

description - the description

Returns:

the test step dto

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
module HealthSeven::V2_5
class Xad < ::HealthSeven::DataType
  # Street Address
  attribute :street_address, Sad, position: "XAD.1"
  # Other Designation
  attribute :other_designation, St, position: "XAD.2"
  # City
  attribute :city, St, position: "XAD.3"
  # State or Province
  attribute :state_or_province, St, position: "XAD.4"
  # Zip or Postal Code
  attribute :zip_or_postal_code, St, position: "XAD.5"
  # Country
  attribute :country, Id, position: "XAD.6"
  # Address Type
  attribute :address_type, Id, position: "XAD.7"
  # Other Geographic Designation
  attribute :other_geographic_designation, St, position: "XAD.8"
  # County/Parish Code
  attribute :county_parish_code, Is, position: "XAD.9"
  # Census Tract
  attribute :census_tract, Is, position: "XAD.10"
  # Address Representation Code
  attribute :address_representation_code, Id, position: "XAD.11"
  # Address Validity Range
  attribute :address_validity_range, Dr, position: "XAD.12"
  # Effective Date
  attribute :effective_date, Ts, position: "XAD.13"
  # Expiration Date
  attribute :expiration_date, Ts, position: "XAD.14"
end
end