text:
BlockInfo *
BI_Block_Copy ( BlockInfo * bi, byte* dstAddress, byte * srcAddress, int64 bsize, Boolean optSetupFlag )
{
    Compiler * compiler = _Compiler_ ;
    if ( ! bi ) bi = ( BlockInfo * ) Stack_Top ( compiler->CombinatorBlockInfoStack ) ;
    byte * saveHere = Here, * saveAddress = srcAddress ;
    ud_t * ud = Debugger_UdisInit ( _Debugger_ ) ;
    int64 isize, left ;
    if ( dstAddress ) SetHere ( dstAddress, 1 ) ;
    bi->CopiedToStart = Here ;
    //CSL_AdjustDbgSourceCode_ScInUseFalse ( srcAddress ) ;
    for ( left = bsize ; ( left > 0 ) ; srcAddress += isize )
    {
        if ( optSetupFlag ) PeepHole_Optimize ( ) ;
        isize = _Udis_GetInstructionSize ( ud, srcAddress ) ;
        left -= isize ;
        CSL_AdjustDbgSourceCodeAddress ( srcAddress, Here ) ;
        CSL_AdjustLabels ( srcAddress ) ;
        if ( * srcAddress == _RET )
        {
            if ( ( left > 0 ) && ( ( * srcAddress + 1 ) != NOOP ) ) //  noop from our logic overwrite
            {
                // ?? unable at present to compile inline with more than one return in the block
                SetHere ( saveHere, 1 ) ;
                Compile_Call ( saveAddress ) ;
            }
            else break ; // don't include RET
        }
        else if ( * srcAddress == CALLI32 )
        {
            int32 offset = * ( int32* ) ( srcAddress + 1 ) ; // 1 : 1 byte CALLI32 opCode
            if ( ! offset )
            {
                dllist_Map1 ( compiler->GotoList, ( MapFunction1 ) AdjustGotoJmpOffsetPointer, ( int64 ) ( srcAddress + 1 ) ) ;
                CSL_SetupRecursiveCall ( ) ;
                continue ;
            }
            else
            {
                byte * jcAddress = JumpCallInstructionAddress ( srcAddress ) ;
                Word * word = Word_GetFromCodeAddress ( jcAddress ) ;
                if ( word )
                {
                    _Word_Compile ( word ) ;
                    continue ;
                }
            }
        }
        else if ( * srcAddress == JMPI32 )
        {
            int64 offset = * ( int32* ) ( srcAddress + 1 ) ; // 1 : 1 byte JMPI32 opCode
            if ( offset )
            {
                dllist_Map1 ( compiler->GotoList, ( MapFunction1 ) AdjustGotoJmpOffsetPointer, ( int64 ) ( srcAddress + 1 ) ) ;
            }
            else dllist_Map1 ( compiler->GotoList, ( MapFunction1 ) _AdjustGotoInfo, ( int64 ) srcAddress ) ; //, ( int64 ) end ) ;
        }
        _CompileN ( srcAddress, isize ) ;
        //if ( _DBI || _O_->Dbi ) Debugger_UdisOneInstruction ( _Debugger_, srcAddress, ( byte* ) "", ( byte* ) "" ) ;
        //if ( _DBI  ) Debugger_UdisOneInstruction ( _Debugger_, srcAddress, ( byte* ) "", ( byte* ) "" ) ;
    }
    bi->CopiedToEnd = Here ;
    bi->CopiedSize = bi->CopiedToEnd - bi->CopiedToStart ;
    d0 ( if ( Is_DebugModeOn ) Debugger_Disassemble ( _Debugger_, bi->CopiedToStart, bi->CopiedSize, 1 ) ) ;
    return bi ;
}

void
Compile_BlockLogicTest ( BlockInfo * bi )
{
    int64 diff ;
    if ( bi )
    {
        if ( ( bi->JccLogicCode || ( bi->LogicCodeWord && bi->LogicCodeWord->StackPushRegisterCode ) ) )
        {
            if ( ! bi->JccLogicCode ) bi->JccLogicCode = bi->LogicCodeWord->StackPushRegisterCode ;
            diff = bi->JccLogicCode - bi->bp_First ; // find its diff position in original block
            bi->CopiedToLogicJccCode = bi->CopiedToStart + diff ; // use diff in copied block
            if ( bi->LogicCodeWord && ( bi->LogicCodeWord->W_OpInsnCode != CMP ) ) // cmp sets flags no need for test code //CAttribute & CATEGORY_LOGIC ) ) )
            {
                SetHere ( bi->CopiedToLogicJccCode, 1 ) ;
                Compiler_SCA_Word_SetCodingHere_And_ClearPreviousUse ( bi->LogicCodeWord, 0 ) ;
                BI_CompileRecord_TestCode_Reg (bi, bi->LogicCodeWord->RegToUse, CELL) ;
                bi->CopiedToLogicJccCode = Here ;
                BI_Set_Tttn ( bi, TTT_ZERO, NEGFLAG_ON, TTT_ZERO, NEGFLAG_OFF ) ;
            }
            else if ( bi->LogicCodeWord && ( bi->LogicCodeWord->W_MorphismAttributes & CATEGORY_OP_1_ARG ) && ( bi->LogicCodeWord->W_MorphismAttributes & LOGIC_NEGATE ) )
            {
                SetHere ( bi->LogicCodeWord->Coding, 1 ) ;
                Compiler_SCA_Word_SetCodingHere_And_ClearPreviousUse ( bi->LogicCodeWord, 0 ) ;
                BI_CompileRecord_TestCode_Reg (bi, bi->LogicCodeWord->RegToUse, CELL) ;
                bi->CopiedToLogicJccCode = Here ;
                BI_Set_Tttn ( bi, TTT_ZERO, NEGFLAG_ON, TTT_ZERO, NEGFLAG_ON ) ;
            }
        }
        else
        {
            _Compile_GetTestLogicFromTOS ( bi ) ;
            bi->CopiedToLogicJccCode = Here ;
        }
    }
}

byte *
Block_CopyCompile ( byte * srcAddress, int64 bindex, Boolean jccFlag )
{
    byte * compiledAtAddress = 0 ;
    Compiler * compiler = _Context_->Compiler0 ;
    BlockInfo *bi = ( BlockInfo * ) _Stack_Pick ( compiler->CombinatorBlockInfoStack, bindex ) ;
    BI_Block_Copy ( bi, Here, srcAddress, bi->bp_Last - bi->bp_First, 0 ) ; //nb!! 0 : turns off peephole optimization ; peephole optimization will be done in CSL_EndCombinator
    if ( jccFlag )
    {
        Compile_BlockLogicTest ( bi ) ;
        compiledAtAddress = _BI_Compile_Jcc ( bi, 0 ) ;
        Stack_Push_PointerToJmpOffset ( compiledAtAddress ) ;
        bi->CopiedToEnd = Here ;
        bi->CopiedSize = bi->CopiedToEnd - bi->CopiedToStart ;
        //d1 ( if ( Is_DebugModeOn ) Debugger_Disassemble ( _Debugger_, ( byte* ) bi->CopiedToStart, bi->CopiedSize, 1 ) ) ;
    }
    return compiledAtAddress ;
}

// a 'block' is merely a notation borrowed from C
// for a pointer to an anonymous subroutine 'call'

void
CSL_TurnOffBlockCompiler ( )
{
    Context * cntx = _Context_ ;
    Compiler * compiler = cntx->Compiler0 ;
    if ( ! GetState ( compiler, LISP_MODE ) ) CSL_LeftBracket ( ) ;
    _CSL_RemoveNamespaceFromUsingListAndClear ( ( byte* ) "__labels__" ) ;
    if ( ! GetState ( _CSL_, DEBUG_SOURCE_CODE_MODE ) ) Compiler_FreeLocalsNamespaces ( compiler ) ;
    SetState ( compiler, COMPILE_MODE | VARIABLE_FRAME, false ) ;
    cntx->LastCompiledWord = cntx->CurrentWordBeingCompiled ;
    cntx->CurrentWordBeingCompiled = 0 ;
}

void
CSL_TurnOnBlockCompiler ( )
{
    _CSL_RightBracket ( ) ;
}

// blocks are a notation for subroutines or blocks of code compiled in order,
// nested in code, for any purpose, worded or anonymously
// we currently jmp over them to code which pushes
// a pointer to the beginning of the block on the stack
// so the next word will see it on the top of the stack
// some combinators take more than one block on the stack

BlockInfo *
_CSL_BeginBlock0 ( )
{
    Context * cntx = _Context_ ;
    Compiler * compiler = cntx->Compiler0 ;
    BlockInfo *bi = BlockInfo_New ( ) ;
    if ( ( ! CompileMode ) || ( ! Compiler_BlockLevel ( compiler ) ) )// first block
    {
        CheckCodeSpaceForRoom ( ) ;
        _Context_->CurrentWordBeingCompiled = compiler->Current_Word_Create ;
        CSL_TurnOnBlockCompiler ( ) ;
    }
    compiler->LHS_Word = 0 ;
    bi->OriginalActualCodeStart = Here ;
    byte * compiledAtAddress = Compile_UninitializedJump ( ) ;
    bi->PtrToJumpOffset = Here - INT32_SIZE ; // before CSL_CheckCompileLocalFrame after CompileUninitializedJump
    Stack_Push_PointerToJmpOffset ( compiledAtAddress ) ;
    bi->bp_First = Here ; // after the jump for inlining
    return bi ;
}

BlockInfo *
_CSL_BeginBlock1 ( BlockInfo * bi )
{
    Compiler * compiler = _Context_->Compiler0 ;
    if ( _Stack_IsEmpty ( compiler->BlockStack ) )
    {
        // remember : we always jmp around the blocks to the combinator ; the combinator sees the blocks on the stack and uses them otherwise they are lost
        // the jmps are optimized out so the word->Definition is a call to the first combinator
        // we always add a frame and if not needed we move the blocks to overwrite the extra code
        bi->LocalFrameStart = Here ; // before _Compile_AddLocalFrame
        _Compiler_AddLocalFrame ( compiler ) ; // cf EndBlock : if frame is not needed we use BI_Start else BI_FrameStart -- ?? could waste some code space ??
        if ( compiler->NumberOfRegisterArgs ) Compile_Init_LocalRegisterParamenterVariables ( compiler ) ; // this function is called twice to deal with words that have locals before the first block and regular colon words
        CSL_TypeStackReset ( ) ;
    }
    bi->AfterLocalFrame = Here ; // after _Compiler_AddLocalFrame and Compile_InitRegisterVariables
    return bi ;
}

void
_CSL_BeginBlock2 ( BlockInfo * bi )
{
    Compiler * compiler = _Context_->Compiler0 ;
    _Stack_Push ( compiler->BlockStack, ( int64 ) bi ) ; // _Context->CompileSpace->IndexStart before set frame size after turn on
    _Stack_Push ( compiler->CombinatorBlockInfoStack, ( int64 ) bi ) ; // _Context->CompileSpace->IndexStart before set frame size after turn on
}

void
CSL_BeginBlock ()
{
    BlockInfo * bi = _CSL_BeginBlock0 ( ) ;
    _CSL_BeginBlock1 ( bi ) ;
    _CSL_BeginBlock2 ( bi ) ;
}

void
CSL_FinalizeBlocks ( BlockInfo * bi )
{
    Compiler * compiler = _Context_->Compiler0 ;
    _CSL_InstallGotoCallPoints_Keyed ( bi, GI_RETURN ) ;
    if ( Compiler_IsFrameNecessary ( compiler ) )
    {
        Compiler_SetLocalsFrameSize_AtItsCellOffset ( compiler ) ;
        Compiler_RemoveLocalFrame ( compiler ) ;
        bi->bp_First = bi->LocalFrameStart ; // default
    }
    else
    {
        if ( compiler->NumberOfRegisterVariables ) Compiler_RemoveLocalFrame ( compiler ) ;
        bi->bp_First = bi->AfterLocalFrame ;
    }
}

void
_CSL_EndBlock1 ( BlockInfo * bi )
{
    Compiler * compiler = _Context_->Compiler0 ;
    if ( ! Compiler_BlockLevel ( compiler ) ) CSL_FinalizeBlocks ( bi ) ;
    compiler->LHS_Word = 0 ;
    _Compile_Return ( ) ;
    DataStack_Push ( ( int64 ) bi->bp_First ) ;
    bi->bp_Last = Here ;
    Compiler_CalculateAndSetPreviousJmpOffset ( compiler, bi->PtrToJumpOffset ) ;
    _SetOffsetForCallOrJump ( bi->PtrToJumpOffset, Here, 0 ) ;
}

byte *
_CSL_EndBlock2 ( BlockInfo * bi )
{
    Context * cntx = _Context_ ;
    Compiler * compiler = cntx->Compiler0 ;
    byte * first = bi->bp_First ;
    if ( ! Compiler_BlockLevel ( compiler ) )
    {
        _CSL_InstallGotoCallPoints_Keyed ( bi, GI_GOTO | GI_RECURSE ) ;
        CSL_TurnOffBlockCompiler ( ) ;
    }
    else _Namespace_RemoveFromUsingListAndClear ( bi->BI_LocalsNamespace ) ;
    CSL_TypeStackReset ( ) ;
    return first ;
}

void
CSL_EndBlock ( )
{
    Context * cntx = _Context_ ;
    Compiler * compiler = cntx->Compiler0 ;
    BlockInfo * bi = ( BlockInfo * ) Stack_Pop_WithExceptionOnEmpty ( compiler->BlockStack ) ;
    bi->LogicCodeWord = _CSL_WordList ( 1 ) ;
    _CSL_EndBlock1 ( bi ) ;
    _CSL_EndBlock2 ( bi ) ;
}

BlockInfo *
BlockInfo_New ( )
{
    BlockInfo *bi = ( BlockInfo * ) Mem_Allocate ( sizeof (BlockInfo ), COMPILER_TEMP ) ;
    return bi ;
}


text:
cdb.admin.mod.TorqueWizard = cdb.admin.mod.SimpleWizard.extend({

  MODULES: ['legends'],

  events: {
    'click .to_the_top': 'moveToFront'
  },

  LAYER_PROPS: ['property',
    'torque-duration',
    'torque-frame-count',
    'torque-blend-mode',
    'torque-trails',
    'torque-is-time'
  ],

  error_msg: {
    NO_CONTENT_MSG: _t('There are no numeric or date columns on your dataset to make an animated map.
If you have numbers on your dataset, but you don\'t see them here is likely they are set as String.'),
    LAYER_ON_TOP: _t('Animated layers should be on top of the map.'),
    ONLY_ONE_TORQUE_LAYER: _t('Sorry, but for the moment only one Torque layer is allowed per map.')
  },

  initialize: function() {
    this.type = 'torque';
    this.layer_type = 'torque';
    this.layers = this.options.map.layers;
    cdb.admin.mod.SimpleWizard.prototype.initialize.call(this);
  },

  validColumns: function() {
    return this.options.table.columnNamesByType('number').concat(
      this.options.table.columnNamesByType('date')
    );
  },

  isLayerOnTop: function() {
    return this.layers.last().cid === this.options.layer.cid;
  },

  moveToFront: function(e) {
    if (e) e.preventDefault();
    this.options.layer.moveToFront();
  },

  torqueLayersCount: function() {
    return this.layers.getLayersByType('torque').length;
  },

  getTorqueLayer: function() {
    return this.layers.getLayersByType('torque')[0];
  },

  isValid: function() {
    // check if the layer is on top and there are numeric columns
    return this.validColumns().length > 0 &&
           this.isLayerOnTop() &&
           (this.torqueLayersCount() === 0 || (
              this.torqueLayersCount() === 1 && this.getTorqueLayer().cid === this.options.layer.cid)
           )
  },

  render: function() {
    if(this.isValid()) {
      cdb.admin.mod.SimpleWizard.prototype.render.call(this);
    } else {
      if (this.torqueLayersCount() !== 0) {
        this.renderError(this.error_msg.ONLY_ONE_TORQUE_LAYER);
      }
      else if (!this.isLayerOnTop()) {
        this.renderError(this.error_msg.LAYER_ON_TOP);
        $(this.$('.wrapper .no_content')[0]).append(' Please move it to the top.');
      } else {
        this.renderError(this.error_msg.NO_CONTENT_MSG);
      }
    }
    return this;
  },

});

redpajama_set_name: RedPajamaGithub


text:
package com.arialyy.aria.core.upload;

import android.text.TextUtils;
import com.arialyy.aria.core.inf.ICheckEntityUtil;
import com.arialyy.aria.util.ALog;
import com.arialyy.aria.util.CheckUtil;
import java.io.File;

public class CheckUEntityUtil implements ICheckEntityUtil {
  private final String TAG = "CheckUEntityUtil";
  private UTaskWrapper mWrapper;
  private UploadEntity mEntity;
  private int action;

  public static CheckUEntityUtil newInstance(UTaskWrapper wrapper, int action) {
    return new CheckUEntityUtil(wrapper, action);
  }

  private CheckUEntityUtil(UTaskWrapper wrapper, int action) {
    this.action = action;
    mWrapper = wrapper;
    mEntity = mWrapper.getEntity();
  }

  @Override
  public boolean checkEntity() {
    if (mWrapper.getErrorEvent() != null) {
      ALog.e(TAG, String.format("任务操作失败,%s", mWrapper.getErrorEvent().errorMsg));
      return false;
    }

    boolean b = checkUrl() && checkFilePath();
    if (b) {
      mEntity.save();
    }
    return b;
  }

  private boolean checkFilePath() {
    String filePath = mEntity.getFilePath();
    if (TextUtils.isEmpty(filePath)) {
      ALog.e(TAG, "上传失败,文件路径为null");
      return false;
    } else if (!filePath.startsWith("/")) {
      ALog.e(TAG, "上传失败,文件路径【" + filePath + "】不合法");
      return false;
    }
    // 任务是新任务,并且路径冲突就不会继续执行
    if (mWrapper.isNewTask()
        && !CheckUtil.checkUPathConflicts(mWrapper.isIgnoreFilePathOccupy(), filePath,
        mWrapper.getRequestType())) {
      return false;
    }

    File file = new File(mEntity.getFilePath());
    if (!file.exists()) {
      ALog.e(TAG, "上传失败,文件【" + filePath + "】不存在");
      return false;
    }
    if (file.isDirectory()) {
      ALog.e(TAG, "上传失败,文件【" + filePath + "】不能是文件夹");
      return false;
    }

    return true;
  }

  private boolean checkUrl() {

    final String url = mWrapper.getTempUrl();
    if (TextUtils.isEmpty(url)) {
      ALog.e(TAG, "上传失败,url为null");
      return false;
    } else if (!CheckUtil.checkUrl(url)) {
      ALog.e(TAG, "上传失败,url【" + url + "】错误");
      return false;
    }
    int index = url.indexOf("://");
    if (index == -1) {
      ALog.e(TAG, "上传失败,url【" + url + "】不合法");
      return false;
    }
    mEntity.setUrl(url);
    return true;
  }
}


text:
package tr.edu.boun.cmpe.sculture.activity;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.android.volley.toolbox.NetworkImageView;

import java.util.ArrayList;

import tr.edu.boun.cmpe.sculture.BaseApplication;
import tr.edu.boun.cmpe.sculture.ImageLocation;
import tr.edu.boun.cmpe.sculture.LargeBundle;
import tr.edu.boun.cmpe.sculture.R;

import static tr.edu.boun.cmpe.sculture.Constants.API_IMAGE_GET;
import static tr.edu.boun.cmpe.sculture.Constants.BUNDLE_INDEX;
import static tr.edu.boun.cmpe.sculture.Constants.BUNDLE_MEDIA_IDS;

/**
 * Media browsing screen
 *

 * {@link tr.edu.boun.cmpe.sculture.Constants#BUNDLE_MEDIA_IDS}: An integer which points the data index on {@link LargeBundle} class
 *

 * {@link tr.edu.boun.cmpe.sculture.Constants#BUNDLE_INDEX}: An integer which points the index of image which will be opened on start
 */
public class ImageShowActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_image_show);
        Bundle bundle = getIntent().getExtras();
        ArrayList<ImageLocation> imageLocations = null;
        int index = 0;
        if (bundle != null) {
            int address = bundle.getInt(BUNDLE_MEDIA_IDS, -1);
            if (address != -1)
                imageLocations = (ArrayList<ImageLocation>) LargeBundle.getItem(address);
            index = bundle.getInt(BUNDLE_INDEX);
        }

        ViewPager viewPager = (ViewPager) findViewById(R.id.view_pager);
        ImagePagerAdapter adapter = new ImagePagerAdapter();
        adapter.imageLocations = imageLocations;
        viewPager.setAdapter(adapter);
        viewPager.setCurrentItem(index);

    }

    private class ImagePagerAdapter extends PagerAdapter {

        private ArrayList<ImageLocation> imageLocations;

        @Override
        public int getCount() {
            return imageLocations.size();
        }

        @Override
        public boolean isViewFromObject(View view, Object object) {
            return view == object;
        }

        @Override
        public Object instantiateItem(ViewGroup container, int position) {
            Context context = ImageShowActivity.this;

            int padding = context.getResources().getDimensionPixelSize(
                    R.dimen.padding_medium);
            ImageLocation imageLocation = imageLocations.get(position);
            if (imageLocation.isLocal()) {
                ImageView imageView = new ImageView(context);
                imageView.setPadding(padding, padding, padding, padding);
                imageView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
                imageView.setImageURI(imageLocation.getUri());
                container.addView(imageView, 0);
                return imageView;
            } else {

                NetworkImageView imageView = new NetworkImageView(context);

                imageView.setPadding(padding, padding, padding, padding);
                imageView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
                imageView.setImageUrl(API_IMAGE_GET + imageLocation.getId(), BaseApplication.baseApplication.mImageLoader);

                container.addView(imageView, 0);
                return imageView;
            }
        }

        @Override
        public void destroyItem(ViewGroup container, int position, Object object) {
            container.removeView((ImageView) object);
        }
    }
}


text:
class AddForeignKeyToCiPipelineVariables < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_concurrent_foreign_key(:ci_pipeline_variables, :ci_pipelines, column: :pipeline_id)
  end

  def down
    remove_foreign_key(:ci_pipeline_variables, column: :pipeline_id)
  end
end


text:
package codecleaver;

import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.FieldVisitor;
import org.objectweb.asm.MethodVisitor;

/**
 * A visitor to visit a Java class. The methods of this interface must be called in the following
 * order: <tt>visitFile</tt> (<tt>visit</tt> [ <tt>visitSource</tt> ] [ <tt>visitOuterClass</tt> ] (
 * <tt>visitAnnotation</tt> | <tt>visitAttribute</tt> )* (<tt>visitInnerClass</tt> |
 * <tt>visitField</tt> | <tt>visitMethod</tt> )* <tt>visitEnd</tt> )*.
 */
public interface IdClassVisitor {
  /**
   * Visit the containing jar file or directory.
   *
   * @param fileName The name of the containing jar file or directory.
   */
  void visitFile(String fileName);

  /**
   * Visits the header of the class.
   *
   * @param version the class version.
   * @param access the class's access flags (see {@link org.objectweb.asm.Opcodes}). This parameter
   *        also indicates if the class is deprecated.
   * @param name the internal name of the class (see {@link org.objectweb.asm.Type#getInternalName()
   *        getInternalName}).
   * @param signature the signature of this class. May be <tt>null</tt> if the class is not a
   *        generic one, and does not extend or implement generic classes or interfaces.
   * @param superName the internal of name of the super class (see {@link
   *        org.objectweb.asm.Type#getInternalName() getInternalName}). For interfaces, the super
   *        class is {@link Object}. May be <tt>null</tt>, but only for the {@link Object} class.
   * @param interfaces the internal names of the class's interfaces (see {@link
   *        org.objectweb.asm.Type#getInternalName() getInternalName}). May be <tt>null</tt>.
   */
  void visit(TypeId id,
      int version,
      int access,
      String name,
      String signature,
      String superName,
      String[] interfaces);

  /**
   * Visits an annotation of the class.
   *
   * @param desc the class descriptor of the annotation class.
   * @param visible <tt>true</tt> if the annotation is visible at runtime.
   * @return a visitor to visit the annotation values, or <tt>null</tt> if this visitor is not
   *         interested in visiting this annotation.
   */
  AnnotationVisitor visitAnnotation(String desc, boolean visible);

  /**
   * Visit an EnclosingMethod attribute. Used for anonymous inner classes.
   *
   * @param owner The enclosing class of this anonymous inner class.
   * @param name The method name of the enclosing method of this inner class. May be null.
   * @param desc The method desc of the enclosing method of this inner class. May be null.
   */
  void visitOuterClass(String owner, String name, String desc);

  /**
   * Visit an InnerClass attribute.
   *
   * NOTE:
   *
   * InnerClass attributes can be placed in either the inner class's class file, the outer
   * class's class file, or on a class file completely unrelated to the named inner/outer types.
   *
   * @param innerFullName Full name of the class with the attribute.
   * @param outerName Full name of the containing class. Null if named class is anonymous.
   * @param innerUnqualifiedName Unqualified name of the inner class.
   * @param access Access flags of named class.
   */
  void visitInnerClass(
      String innerFullName, String outerName, String innerUnqualifiedName, int access);

  /**
   * Visits a field of the class.
   *
   * @param access the field's access flags (see {@link org.objectweb.asm.Opcodes}). This parameter
   *        also indicates if the field is synthetic and/or deprecated.
   * @param name the field's name.
   * @param desc the field's descriptor (see {@link org.objectweb.asm.Type Type}).
   * @param signature the field's signature. May be <tt>null</tt> if the field's type does not use
   *        generic types.
   * @param value the field's initial value. This parameter, which may be <tt>null</tt> if the field
   *        does not have an initial value, must be an {@link Integer}, a {@link Float}, a {@link
   *        Long}, a {@link Double} or a {@link String} (for <tt>int</tt>, <tt>float</tt> ,
   *        <tt>long</tt> or <tt>String</tt> fields respectively). This parameter is only used
   *        for static fields. Its value is ignored for non static fields, which must be
   *        initialized through bytecode instructions in constructors or methods.
   * @return a visitor to visit field annotations and attributes, or <tt>null</tt> if this class
   *         visitor is not interested in visiting these annotations and attributes.
   */
  FieldVisitor visitField(FieldId id,
      int access,
      String name,
      String desc,
      String signature,
      Object value);

  /**
   * Visits a method of the class. This method must return a new {@link MethodVisitor}
   * instance (or <tt>null</tt>) each time it is called, i.e., it should not return a previously
   * returned visitor.
   *
   * @param access the method's access flags (see {@link org.objectweb.asm.Opcodes}). This parameter
   *        also indicates if the method is synthetic and/or deprecated.
   * @param name the method's name.
   * @param desc the method's descriptor (see {@link org.objectweb.asm.Type Type}).
   * @param signature the method's signature. May be <tt>null</tt> if the method parameters, return
   *        type and exceptions do not use generic types.
   * @param exceptions the internal names of the method's exception classes (see {@link
   *        org.objectweb.asm.Type#getInternalName() getInternalName}). May be <tt>null</tt>.
   * @return an object to visit the byte code of the method, or <tt>null</tt> if this class visitor
   *         is not interested in visiting the code of this method.
   */
  MethodVisitor visitMethod(MethodId id,
      int access,
      String name,
      String desc,
      String signature,
      String[] exceptions);

  void visitEnd();
}


text:
#include <OgreSceneNode.h>
#include <OgreSceneManager.h>

#include <ros/time.h>

#include <rviz/default_plugin/point_cloud_common.h>
#include <rviz/default_plugin/point_cloud_transformers.h>
#include <rviz/display_context.h>
#include <rviz/frame_manager.h>
#include <rviz/ogre_helpers/point_cloud.h>
#include <rviz/properties/int_property.h>
#include <rviz/validate_floats.h>

#include "relative_humidity_display.h"

namespace rviz
{
RelativeHumidityDisplay::RelativeHumidityDisplay() : point_cloud_common_(new PointCloudCommon(this))
{
}

RelativeHumidityDisplay::~RelativeHumidityDisplay()
{
  RelativeHumidityDisplay::unsubscribe();
  delete point_cloud_common_;
}

void RelativeHumidityDisplay::onInitialize()
{
  // Use the threaded queue for processing of incoming messages
  update_nh_.setCallbackQueue(context_->getThreadedQueue());

  MFDClass::onInitialize();
  point_cloud_common_->initialize(context_, scene_node_);

  // Set correct initial values
  subProp("Channel Name")->setValue("relative_humidity");
  subProp("Autocompute Intensity Bounds")->setValue(false);
  subProp("Min Intensity")->setValue(0.0); // 0% relative humidity
  subProp("Max Intensity")->setValue(1.0); // 100% relative humidity
}

void RelativeHumidityDisplay::processMessage(const sensor_msgs::RelativeHumidityConstPtr& msg)
{
  sensor_msgs::PointCloud2Ptr filtered(new sensor_msgs::PointCloud2);

  // Create fields
  sensor_msgs::PointField x;
  x.name = "x";
  x.offset = 0;
  x.datatype = sensor_msgs::PointField::FLOAT32;
  x.count = 1;
  sensor_msgs::PointField y;
  y.name = "y";
  y.offset = 4;
  y.datatype = sensor_msgs::PointField::FLOAT32;
  y.count = 1;
  sensor_msgs::PointField z;
  z.name = "z";
  z.offset = 8;
  z.datatype = sensor_msgs::PointField::FLOAT32;
  z.count = 1;
  sensor_msgs::PointField relative_humidity;
  relative_humidity.name = "relative_humidity";
  relative_humidity.offset = 12;
  relative_humidity.datatype = sensor_msgs::PointField::FLOAT64;
  relative_humidity.count = 1;

  // Create pointcloud from message
  filtered->header = msg->header;
  filtered->fields.push_back(x);
  filtered->fields.push_back(y);
  filtered->fields.push_back(z);
  filtered->fields.push_back(relative_humidity);
  filtered->data.resize(20);
  const float zero_float = 0.0; // RelativeHumidity is always on its tf frame
  memcpy(&filtered->data[x.offset], &zero_float, 4);
  memcpy(&filtered->data[y.offset], &zero_float, 4);
  memcpy(&filtered->data[z.offset], &zero_float, 4);
  memcpy(&filtered->data[relative_humidity.offset], &msg->relative_humidity, 8);
  filtered->height = 1;
  filtered->width = 1;
  filtered->is_bigendian = false;
  filtered->point_step = 20;
  filtered->row_step = 1;

  // Give to point_cloud_common to draw
  point_cloud_common_->addMessage(filtered);
}

void RelativeHumidityDisplay::update(float wall_dt, float ros_dt)
{
  point_cloud_common_->update(wall_dt, ros_dt);

  // Hide unneeded properties
  subProp("Position Transformer")->hide();
  subProp("Color Transformer")->hide();
  subProp("Channel Name")->hide();
  subProp("Autocompute Intensity Bounds")->hide();
}

void RelativeHumidityDisplay::reset()
{
  MFDClass::reset();
  point_cloud_common_->reset();
}

} // namespace rviz

#include <pluginlib/class_list_macros.hpp>
PLUGINLIB_EXPORT_CLASS(rviz::RelativeHumidityDisplay, rviz::Display)


text:
<?php namespace SSD\RegexKit\Expressions;

abstract class Expression {

    /**
     * Array of arguments passed through the constructor.
     *
     * @var array
     */
    protected $arguments = [];

    /**
     * Constructor.
     *
     * @param array $arguments
     */
    public function __construct(array $arguments)
    {

        $this->arguments = $arguments;

    }

    /**
     * Replace all urls with anchor tag.
     *
     * @return mixed
     */
    final public function make()
    {

        return preg_replace_callback(
            $this->regex(),
            [$this, 'replace'],
            $this->arguments[0]
        );

    }

    abstract protected function regex();

    abstract protected function replace($matches);

}


text:
PKG_NAME = libzen
PKG_VERS = 0.4.34
PKG_EXT = tar.bz2
PKG_DIST_NAME = $(PKG_NAME)_$(PKG_VERS).$(PKG_EXT)
PKG_DIST_SITE = http://mediaarea.net/download/source/$(PKG_NAME)/$(PKG_VERS)
PKG_DIR = ZenLib/Project/GNU/Library

DEPENDS =

HOMEPAGE = http://sourceforge.net/projects/zenlib/
COMMENT  = Small C++ derivate class to have a simpler life.
LICENSE  =

PRE_CONFIGURE_TARGET = myPreConfigure
GNU_CONFIGURE = 1

CONFIGURE_ARGS = --enable-shared

include ../../mk/spksrc.cross-cc.mk

myPreConfigure:
	$(RUN) ; ./autogen.sh


text:
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { ResponsiveAppleProductsPage } from './responsive-apple-products';

@NgModule({
  declarations: [
    ResponsiveAppleProductsPage,
  ],
  imports: [
    IonicPageModule.forChild(ResponsiveAppleProductsPage),
  ],
})
export class ResponsiveAppleProductsPageModule {}


text:
#ifndef _BRIDGE_HANDCACHE2INCLUDED
#define _BRIDGE_HANDCACHE2INCLUDED /* intentional */

/**
 * provide mechanism to cache visited nodes
 * using bit representation of the position
 */

#include <stdint.h>

#include <unordered_map>
#include <vector>

#include "dtac/CStats.h"
#include "dtac/Claim.h"
#include "dtac/Hand.h"
#include "dtac/HandCacheConfig.h"

namespace dtac {

/* specific to start position of two hands! (and length of suits?)
 * also deal with 32/64-bit*/

class HandCache2 {
 public:
  HandCache2(const Hand& lead, const Hand& follow);

  typedef uint64_t hash_key;
  typedef std::shared_ptr<Claim>
      hash_val;         // if a solution, add pointer to the claim obj
#if defined(__x86_64__) /* 64-bit mode */
  struct PairHash {
    size_t operator()(const hash_key& key) const { return key; }
  };
  typedef std::unordered_map<hash_key, hash_val, PairHash> cacheType;
#else /* 32-bit mode */
  struct PairHash {
    size_t operator()(const hash_key& key) const {
      size_t low32 = (size_t)key, high32 = (size_t)(key >> 32);
      return low32 ^ high32;  // try Xor as an initial
    }
  };
  typedef std::unordered_map<hash_key, hash_val, PairHash> cacheType;
#endif

  // add current state of reminaing cards + suits to cache
  // 52 bits of S|H|D|C remaining holding of players (combined)
  // 1 bit is the leader
  // 8 low-bits of rounds-of
  // 'value' is the rest of 'rounds-of'
  void addToCache(cacheType::value_type key) { add(key); }

  // found a solution from this point.  Save that info
  void addSolution(cacheType::value_type key, std::shared_ptr<Claim> claim) {
    cacheType::iterator it(visited.find(key.first));
    ASSERT_MSG(it != visited.end(),
               "must be already in cache to append a soln");
    it->second = claim;
  }

  std::shared_ptr<Claim> getSolution(cacheType::value_type key) const {
    cacheType::const_iterator it(visited.find(key.first));
    bool nope = it == visited.end();
    return nope ? std::shared_ptr<Claim>() : key.second;
  }

  // find out if a state is in the cache
  bool notInCache(const Hand& origLead, const Hand& partner, const Claim& claim,
                  bool pdLeads) const {
    if (!CACHING_ON) return true;
    cacheType::value_type key = getCacheKey(origLead, partner, claim, pdLeads);
    return notInCache(key);
  }
  bool notInCache(cacheType::value_type key) const {
    if (!CACHING_ON) return true;
    cacheType::const_iterator it(visited.find(key.first));
    bool nope = it == visited.end();
    if (STATS_ON) {
      if (nope)
        ++stats->misses;
      else
        ++stats->hits;
    }
    return nope;
  }
  void reset() { visited.clear(); }

  std::shared_ptr<CStats> stats;  // if taken

 public:
  cacheType::value_type getCacheKey(const Hand& origLead, const Hand& partner,
                                    const Claim& claim, bool pdLeads) const {
    hash_key key = 0;
    for (int i = 0; i < (int)NUM_SUITS; ++i) {
      const std::vector<size_t>& suit_mask = card_masks[i];
      const std::vector<size_t>& slot_mask = slot_map[i];
      hash_key suit = origLead.getSuit(i) | partner.getSuit(i);
      if (!suit) continue;
      ASSERT_MSG_DBG(suit < (1 << 13), "assert less than 13-bits");
      for (int b = 0, size = suit_mask.size(); b < size; ++b) {
        if (suit & suit_mask[b]) key |= slot_mask[b];
      }
    }

    // use first bit after card-portion for who leads (btw - that overwrites
    // the '4s' bit of spades 'round-of' in key
    if (pdLeads) key |= (1L << card_bits);
    // else already 0

    // add in played info, can only play a suit 7 rounds to be valid
    // hash_val
    hash_key val = 0;
    for (int i = 0; i < (int)NUM_SUITS; ++i) {
      ASSERT_MSG_DBG(claim.round_of[i] < 16, "sane roundsof");
      // take 4-bit number (0-15), and pack in 16-bits
      val |= (claim.round_of[i] << (i << 2));
    }
    key |= (val << (card_bits + 1));  // append bit string

    //    cerr << std::hex << key << endl;

    return std::make_pair(key, std::shared_ptr<Claim>());
  }

  // to share cache
  HandCache2& operator=(const HandCache2& other) {
    visited = other.visited;
    return *this;
  }

  HandCache2(const HandCache2& other) : visited(other.visited) {}

 protected:
  void add(cacheType::value_type key) {
    if (!CACHING_ON) return;

    if (STATS_ON) {
      if (visited.find(key.first) != visited.end()) ++stats->collisions;
    }
    visited.insert(key);  // kick out a collision
  }

 protected:
  // hash-key is n-bits of 4 suits (up to 26), 1 bit of who is on lead (2 if
  // 4-player hash)
  // low 2-bits of rounds-of 4 suits => 61 bit key.  Then val is all 4 suits
  // 4-bits
  // rounds of
  cacheType visited;

  // 2nd-phase cache fields

  // each vector's outer-dimension is [SUIT]
  std::vector<std::vector<size_t> > card_masks;  // set of masks to look for,
                                                 // map if (card_masks[suit][i]
                                                 // & hand[suit])
  std::vector<std::vector<size_t> >
      slot_map;   // then add slot_map[suit][i] to mask
  int card_bits;  // count of bits used by card-portion
};                // end class

}  // namespace dtac

#endif /* hdr */


text:
namespace Anycmd.Xacml.Consts
{
    public partial class Schema1
    {
        public class MatchElement
        {
            /// <summary>The name of the element/attribute in the XSD schema.</summary>
            public const string MatchId = "MatchId";
        }
    }
}


text:
package org.labkey.ETLChemistryAnalyzer;

import org.labkey.api.data.DbSchema;
import org.labkey.api.data.DbSchemaType;
import org.labkey.api.data.dialect.SqlDialect;

public class ETLChemistryAnalyzerSchema
{
    private static final ETLChemistryAnalyzerSchema _instance = new ETLChemistryAnalyzerSchema();
    public static final String NAME = "ETLChemistryAnalyzer";

    public static ETLChemistryAnalyzerSchema getInstance()
    {
        return _instance;
    }

    private ETLChemistryAnalyzerSchema()
    {
        // private constructor to prevent instantiation from
        // outside this class: this singleton should only be
        // accessed via org.labkey.ETLChemistryAnalyzer.ETLChemistryAnalyzerSchema.getInstance()
    }

    public DbSchema getSchema()
    {
        return DbSchema.get(NAME, DbSchemaType.Module);
    }

    public SqlDialect getSqlDialect()
    {
        return getSchema().getSqlDialect();
    }
}


text:
package com.datastax.spark.connector.japi.rdd;

import scala.Tuple2;

import static com.datastax.spark.connector.japi.CassandraJavaUtil.column;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import org.junit.Test;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import com.datastax.spark.connector.ColumnRef;
import com.datastax.spark.connector.cql.CassandraConnector;
import com.datastax.spark.connector.rdd.CassandraRDD;
import com.datastax.spark.connector.rdd.ReadConf;
import com.datastax.spark.connector.util.JavaApiHelper;

@SuppressWarnings({"unchecked", "RedundantTypeArguments"})
public class CassandraJavaPairRDDTest {

    @Test
    public void testSelectColumnNames() {
        CassandraRDD<Tuple2<String, Integer>> rdd = mock(CassandraRDD.class);
        CassandraRDD<Tuple2<String, Integer>> rdd2 = mock(CassandraRDD.class);
        when(rdd.select(JavaApiHelper.<ColumnRef>toScalaSeq(
                new ColumnRef[]{column("a"), column("b")}))).thenReturn(rdd2);
        CassandraJavaPairRDD<String, Integer> jrdd = new CassandraJavaPairRDD<>(rdd, String.class, Integer.class);
        assertThat(jrdd.select("a", "b").rdd(), is(rdd2));
    }

    @Test
    public void testSelectColumns() {
        CassandraRDD<Tuple2<String, Integer>> rdd = mock(CassandraRDD.class);
        CassandraRDD<Tuple2<String, Integer>> rdd2 = mock(CassandraRDD.class);
        when(rdd.select(JavaApiHelper.<ColumnRef>toScalaSeq(
                new ColumnRef[]{column("a"), column("b")}))).thenReturn(rdd2);
        CassandraJavaPairRDD<String, Integer> jrdd = new CassandraJavaPairRDD<>(rdd, String.class, Integer.class);
        assertThat(jrdd.select(column("a"), column("b")).rdd(), is(rdd2));
    }

    @Test
    public void testWhere() {
        CassandraRDD<Tuple2<String, Integer>> rdd = mock(CassandraRDD.class);
        CassandraRDD<Tuple2<String, Integer>> rdd2 = mock(CassandraRDD.class);
        when(rdd.where("a=?", JavaApiHelper.toScalaSeq(new Object[]{1})))
                .thenReturn(rdd2);
        CassandraJavaPairRDD<String, Integer> jrdd = new CassandraJavaPairRDD<>(rdd, String.class, Integer.class);
        assertThat(jrdd.where("a=?", 1).rdd(), is(rdd2));
    }

    @Test
    public void testWithAscOrder() {
        CassandraRDD<Tuple2<String, Integer>> rdd = mock(CassandraRDD.class);
        CassandraRDD<Tuple2<String, Integer>> rdd2 = mock(CassandraRDD.class);
        when(rdd.withAscOrder()).thenReturn(rdd2);
        CassandraJavaPairRDD<String, Integer> jrdd = new CassandraJavaPairRDD<>(rdd, String.class, Integer.class);
        assertThat(jrdd.withAscOrder().rdd(), is(rdd2));
    }

    @Test
    public void testWithDescOrder() {
        CassandraRDD<Tuple2<String, Integer>> rdd = mock(CassandraRDD.class);
        CassandraRDD<Tuple2<String, Integer>> rdd2 = mock(CassandraRDD.class);
        when(rdd.withDescOrder()).thenReturn(rdd2);
        CassandraJavaPairRDD<String, Integer> jrdd = new CassandraJavaPairRDD<>(rdd, String.class, Integer.class);
        assertThat(jrdd.withDescOrder().rdd(), is(rdd2));
    }

    @Test
    public void testSelectedColumnRefs() {
        CassandraRDD<Tuple2<String, Integer>> rdd = mock(CassandraRDD.class);
        when(rdd.selectedColumnRefs())
                .thenReturn(JavaApiHelper.<ColumnRef>toScalaSeq(new ColumnRef[]{column("a"), column("b")}));
        CassandraJavaPairRDD<String, Integer> jrdd = new CassandraJavaPairRDD<>(rdd, String.class, Integer.class);
        assertThat(jrdd.selectedColumnRefs(), is(new ColumnRef[] {column("a"), column("b")}));
    }

    @Test
    public void testSelectedColumnNames() {
        CassandraRDD<Tuple2<String, Integer>> rdd = mock(CassandraRDD.class);
        when(rdd.selectedColumnNames())
                .thenReturn(JavaApiHelper.<String>toScalaSeq(new String[]{"a", "b"}));
        CassandraJavaPairRDD<String, Integer> jrdd = new CassandraJavaPairRDD<>(rdd, String.class, Integer.class);
        assertThat(jrdd.selectedColumnNames(), is(new String[] {"a", "b"}));

    }

    @Test
    public void testWithConnector() {
        CassandraRDD<Tuple2<String, Integer>> rdd = mock(CassandraRDD.class);
        CassandraRDD<Tuple2<String, Integer>> rdd2 = mock(CassandraRDD.class);
        CassandraConnector connector = mock(CassandraConnector.class);
        when(rdd.withConnector(connector)).thenReturn(rdd2);
        CassandraJavaPairRDD<String, Integer> jrdd = new CassandraJavaPairRDD<>(rdd, String.class, Integer.class);
        assertThat(jrdd.withConnector(connector).rdd(), is(rdd2));
    }

    @Test
    public void testWithReadConf() {
        CassandraRDD<Tuple2<String, Integer>> rdd = mock(CassandraRDD.class);
        CassandraRDD<Tuple2<String, Integer>> rdd2 = mock(CassandraRDD.class);
        ReadConf readConf = mock(ReadConf.class);
        when(rdd.withReadConf(readConf)).thenReturn(rdd2);
        CassandraJavaPairRDD<String, Integer> jrdd = new CassandraJavaPairRDD<>(rdd, String.class, Integer.class);
        assertThat(jrdd.withReadConf(readConf).rdd(), is(rdd2));
    }

    @Test
    public void testLimit() {
        CassandraRDD<Tuple2<String, Integer>> rdd = mock(CassandraRDD.class);
        CassandraRDD<Tuple2<String, Integer>> rdd2 = mock(CassandraRDD.class);
        when(rdd.limit(1L)).thenReturn(rdd2);
        CassandraJavaPairRDD<String, Integer> jrdd = new CassandraJavaPairRDD<>(rdd, String.class, Integer.class);
        assertThat(jrdd.limit(1L).rdd(), is(rdd2));
    }

    @Test
    public void testPerPartitionLimit() {
        CassandraRDD<Tuple2<String, Integer>> rdd = mock(CassandraRDD.class);
        CassandraRDD<Tuple2<String, Integer>> rdd2 = mock(CassandraRDD.class);
        when(rdd.perPartitionLimit(1L)).thenReturn(rdd2);
        CassandraJavaPairRDD<String, Integer> jrdd = new CassandraJavaPairRDD<>(rdd, String.class, Integer.class);
        assertThat(jrdd.perPartitionLimit(1L).rdd(), is(rdd2));
    }

}


text:
using content::BrowserThread;

static base::LazyInstance<feedback::FeedbackProfileObserver>::Leaky
    g_feedback_profile_observer = LAZY_INSTANCE_INITIALIZER;

namespace feedback {

// static
void FeedbackProfileObserver::Initialize() {
  g_feedback_profile_observer.Get();
}

FeedbackProfileObserver::FeedbackProfileObserver() {
  prefs_registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CREATED,
                       content::NotificationService::AllSources());
}

FeedbackProfileObserver::~FeedbackProfileObserver() {
  prefs_registrar_.RemoveAll();
}

void FeedbackProfileObserver::Observe(
    int type,
    const content::NotificationSource& source,
    const content::NotificationDetails& details) {
  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
  DCHECK_EQ(chrome::NOTIFICATION_PROFILE_CREATED, type);

  Profile* profile = content::Source<Profile>(source).ptr();
  if (profile && !profile->IsOffTheRecord())
    QueueUnsentReports(profile);
}

void FeedbackProfileObserver::QueueSingleReport(
    feedback::FeedbackUploader* uploader,
    const std::string& data) {
  BrowserThread::PostTask(
      BrowserThread::UI, FROM_HERE, base::Bind(&FeedbackUploader::QueueReport,
                                               uploader->AsWeakPtr(), data));
}

void FeedbackProfileObserver::QueueUnsentReports(
    content::BrowserContext* context) {
  feedback::FeedbackUploader* uploader =
      feedback::FeedbackUploaderFactory::GetForBrowserContext(context);
  BrowserThread::PostBlockingPoolTask(FROM_HERE,
      base::Bind(
          &FeedbackReport::LoadReportsAndQueue,
          uploader->GetFeedbackReportsPath(),
          base::Bind(&FeedbackProfileObserver::QueueSingleReport, uploader)));
}

}  // namespace feedback


text:
import roslib; roslib.load_manifest('floor_graph')
import rospy
import tf
import igraph as ig
from visualization_msgs.msg import MarkerArray,Marker
from geometry_msgs.msg import Point
from roslib.packages import get_pkg_dir

rospy.init_node('build_graph')
listener = tf.TransformListener()
mpub = rospy.Publisher("/graph/viz",MarkerArray,latch=True, queue_size=1)
rospy.sleep(1.0);

ma = MarkerArray()
now = rospy.Time.now()

print get_pkg_dir('floor_graph')+"/graph.picklez"
g = ig.Graph.Read_Picklez(get_pkg_dir('floor_graph')+"/graph.picklez")
id = 0
for v in g.vs:
    marker = Marker()
    marker.header.stamp = now
    marker.header.frame_id = "/world"
    marker.ns = "graph_nodes"
    marker.id = id; id += 1
    marker.type = Marker.CYLINDER
    marker.action = Marker.ADD
    marker.pose.position.x = v["x"]
    marker.pose.position.y = v["y"]
    marker.pose.position.z = -0.05
    marker.scale.x = 0.2
    marker.scale.y = 0.2
    marker.scale.z = 0.01;
    marker.color.a = 1.0;
    marker.color.r = 1.0;
    marker.color.g = 1.0;
    marker.color.b = 0.0;
    ma.markers.append(marker)
for e in g.es:
    v0 = g.vs[e.source]
    v1 = g.vs[e.target]
    print (e.source,e.target)
    marker = Marker()
    marker.header.stamp = now
    marker.header.frame_id = "/world"
    marker.ns = "graph_edges"
    marker.id = id; id += 1
    marker.type = Marker.LINE_STRIP
    marker.action = Marker.ADD
    marker.pose.position.x = 0
    marker.pose.position.y = 0
    marker.pose.position.z = -0.05
    marker.scale.x = 0.05
    marker.color.a = 1.0;
    marker.color.r = 0.0;
    marker.color.g = 1.0;
    marker.color.b = 0.0;
    marker.points = [Point(v0["x"],v0["y"],0),Point(v1["x"],v1["y"],0)];
    ma.markers.append(marker)

while not rospy.is_shutdown():
    mpub.publish(ma)
    rospy.sleep(1.0)


text:
thanks

        twitter.com/assertchris


text:
<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Labels Language Lines
    |--------------------------------------------------------------------------
    |
    | The following language lines are used in labels throughout the system.
    | Regardless where it is placed, a label can be listed here so it is easily
    | found in a intuitive way.
    |
    */

    'change_password_box_title' => 'Cambiar contraseña',
    'change_password_button' => 'Cambiar contraseña',
    'country' => 'Pais',
    'edit_information' => 'Editar informacion',
    'forgot_password' => 'Olvido su contraseña?',
    'login_box_title' => 'Iniciar sesion',
    'login_button' => 'Iniciar sesion',
    'login_with' => 'Iniciar sesion con :social_media',
    'macro_examples' => 'Macro Ejemplos',
    'register_box_title' => 'Registrarse',
    'register_button' => 'Registrarse',
    'remember_me' => 'Recordarme',
    'reset_password_box_title' => 'Reestablecer contraseña',
    'reset_password_button' => 'Reestablecer contraseña',
    'save_button' => 'Guardar',
    'send_password_reset_link_button' => 'Send Password Reset Link',
    'state' => 'Provincia',
    'toggle_navigation' => 'Ocultar navegacion',
    'update_information_box_title' => 'Actualizar navegacion',

];


text:
using BEPUphysics.BroadPhaseEntries.MobileCollidables;
using BEPUutilities;
using BEPUphysics.CollisionShapes;

namespace BEPUphysics.Entities
{
    ///
    /// Entity with modifiable collision information.
    ///
    public class MorphableEntity : Entity
    {
        ///
        /// Gets or sets the collidable associated with the entity.
        ///
        public new EntityCollidable CollisionInformation
        {
            get
            {
                return base.CollisionInformation;
            }
            set
            {
                SetCollisionInformation(value);
            }
        }

        ///
        /// Constructs a new morphable entity.
        ///
        ///<param name="collisionInformation">Collidable to use with the entity.</param>
        public MorphableEntity(EntityCollidable collisionInformation)
            : base(collisionInformation)
        {
        }

        ///
        /// Constructs a new morphable entity.
        ///
        ///<param name="collisionInformation">Collidable to use with the entity.</param>
        ///<param name="mass">Mass of the entity.</param>
        public MorphableEntity(EntityCollidable collisionInformation, float mass)
            : base(collisionInformation, mass)
        {
        }

        ///
        /// Constructs a new morphable entity.
        ///
        ///<param name="collisionInformation">Collidable to use with the entity.</param>
        ///<param name="mass">Mass of the entity.</param>
        /// <param name="inertiaTensor">Inertia tensor of the entity.</param>
        public MorphableEntity(EntityCollidable collisionInformation, float mass, Matrix3x3 inertiaTensor)
            : base(collisionInformation, mass, inertiaTensor)
        {
        }

        ///
        /// Constructs a new morphable entity.
        ///
        ///<param name="shape">Shape to use with the entity.</param>
        public MorphableEntity(EntityShape shape)
            : base(shape)
        {
        }

        ///
        /// Constructs a new morphable entity.
        ///
        ///<param name="shape">Shape to use with the entity.</param>
        ///<param name="mass">Mass of the entity.</param>
        public MorphableEntity(EntityShape shape, float mass)
            : base(shape, mass)
        {
        }

        ///
        /// Constructs a new morphable entity.
        ///
        ///<param name="shape">Shape to use with the entity.</param>
        ///<param name="mass">Mass of the entity.</param>
        /// <param name="inertiaTensor">Inertia tensor of the entity.</param>
        public MorphableEntity(EntityShape shape, float mass, Matrix3x3 inertiaTensor)
            : base(shape, mass, inertiaTensor)
        {
        }

        ///
        /// Sets the collision information of the entity to another collidable.
        ///
        /// <param name="newCollisionInformation">New collidable to use.</param>
        public void SetCollisionInformation(EntityCollidable newCollisionInformation)
        {
            //Temporarily remove the object from the space.
            //The reset process will update any systems that need to be updated.
            //This is not thread safe, but this operation should not be performed mid-frame anyway.
            Space space = Space;
            if (space != null)
                Space.Remove(this);

            CollisionInformation.Entity = null;

            if (isDynamic)
                Initialize(newCollisionInformation, mass);
            else
                Initialize(newCollisionInformation);

            if (space != null)
                space.Add(this);
        }

        ///
        /// Sets the collision information of the entity to another collidable.
        ///
        /// <param name="newCollisionInformation">New collidable to use.</param>
        /// <param name="newMass">New mass to use for the entity.</param>
        public void SetCollisionInformation(EntityCollidable newCollisionInformation, float newMass)
        {
            //Temporarily remove the object from the space.
            //The reset process will update any systems that need to be updated.
            //This is not thread safe, but this operation should not be performed mid-frame anyway.
            Space space = Space;
            if (space != null)
                Space.Remove(this);

            CollisionInformation.Entity = null;

            Initialize(newCollisionInformation, newMass);

            if (space != null)
                space.Add(this);
        }

        ///
        /// Sets the collision information of the entity to another collidable.
        ///
        /// <param name="newCollisionInformation">New collidable to use.</param>
        /// <param name="newMass">New mass to use for the entity.</param>
        /// <param name="newInertia">New inertia tensor to use for the entity.</param>
        public void SetCollisionInformation(EntityCollidable newCollisionInformation, float newMass, Matrix3x3 newInertia)
        {
            //Temporarily remove the object from the space.
            //The reset process will update any systems that need to be updated.
            //This is not thread safe, but this operation should not be performed mid-frame anyway.
            Space space = Space;
            if (space != null)
                Space.Remove(this);

            CollisionInformation.Entity = null;

            Initialize(newCollisionInformation, newMass, newInertia);

            if (space != null)
                space.Add(this);
        }

    }
}


text:
namespace Microsoft.Azure.Management.Blueprint.Models
{
    using Microsoft.Rest;
    using Microsoft.Rest.Serialization;
    using Newtonsoft.Json;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;

    /// <summary>
    /// Represents a published blueprint.
    /// </summary>
    [Rest.Serialization.JsonTransformation]
    public partial class PublishedBlueprint : AzureResourceBase
    {
        /// <summary>
        /// Initializes a new instance of the PublishedBlueprint class.
        /// </summary>
        public PublishedBlueprint()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the PublishedBlueprint class.
        /// </summary>
        /// <param name="id">String Id used to locate any resource on
        /// Azure.</param>
        /// <param name="type">Type of this resource.</param>
        /// <param name="name">Name of this resource.</param>
        /// <param name="displayName">One-liner string explain this
        /// resource.</param>
        /// <param name="description">Multi-line explain this resource.</param>
        /// <param name="status">Status of the blueprint. This field is
        /// readonly.</param>
        /// <param name="targetScope">The scope where this blueprint definition
        /// can be assigned. Possible values include: 'subscription',
        /// 'managementGroup'</param>
        /// <param name="parameters">Parameters required by this blueprint
        /// definition.</param>
        /// <param name="resourceGroups">Resource group placeholders defined by
        /// this blueprint definition.</param>
        /// <param name="blueprintName">Name of the published blueprint
        /// definition.</param>
        /// <param name="changeNotes">Version-specific change notes.</param>
        public PublishedBlueprint(string id = default(string), string type = default(string), string name = default(string), string displayName = default(string), string description = default(string), BlueprintStatus status = default(BlueprintStatus), string targetScope = default(string), IDictionary<string, ParameterDefinition> parameters = default(IDictionary<string, ParameterDefinition>), IDictionary<string, ResourceGroupDefinition> resourceGroups = default(IDictionary<string, ResourceGroupDefinition>), string blueprintName = default(string), string changeNotes = default(string))
            : base(id, type, name)
        {
            DisplayName = displayName;
            Description = description;
            Status = status;
            TargetScope = targetScope;
            Parameters = parameters;
            ResourceGroups = resourceGroups;
            BlueprintName = blueprintName;
            ChangeNotes = changeNotes;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets one-liner string explain this resource.
        /// </summary>
        [JsonProperty(PropertyName = "properties.displayName")]
        public string DisplayName { get; set; }

        /// <summary>
        /// Gets or sets multi-line explain this resource.
        /// </summary>
        [JsonProperty(PropertyName = "properties.description")]
        public string Description { get; set; }

        /// <summary>
        /// Gets status of the blueprint. This field is readonly.
        /// </summary>
        [JsonProperty(PropertyName = "properties.status")]
        public BlueprintStatus Status { get; private set; }

        /// <summary>
        /// Gets or sets the scope where this blueprint definition can be
        /// assigned. Possible values include: 'subscription',
        /// 'managementGroup'
        /// </summary>
        [JsonProperty(PropertyName = "properties.targetScope")]
        public string TargetScope { get; set; }

        /// <summary>
        /// Gets or sets parameters required by this blueprint definition.
        /// </summary>
        [JsonProperty(PropertyName = "properties.parameters")]
        public IDictionary<string, ParameterDefinition> Parameters { get; set; }

        /// <summary>
        /// Gets or sets resource group placeholders defined by this blueprint
        /// definition.
        /// </summary>
        [JsonProperty(PropertyName = "properties.resourceGroups")]
        public IDictionary<string, ResourceGroupDefinition> ResourceGroups { get; set; }

        /// <summary>
        /// Gets or sets name of the published blueprint definition.
        /// </summary>
        [JsonProperty(PropertyName = "properties.blueprintName")]
        public string BlueprintName { get; set; }

        /// <summary>
        /// Gets or sets version-specific change notes.
        /// </summary>
        [JsonProperty(PropertyName = "properties.changeNotes")]
        public string ChangeNotes { get; set; }

        /// <summary>
        /// Validate the object.
        /// </summary>
        /// <exception cref="ValidationException">
        /// Thrown if validation fails
        /// </exception>
        public virtual void Validate()
        {
            if (DisplayName != null)
            {
                if (DisplayName.Length > 256)
                {
                    throw new ValidationException(ValidationRules.MaxLength, "DisplayName", 256);
                }
            }
            if (Description != null)
            {
                if (Description.Length > 500)
                {
                    throw new ValidationException(ValidationRules.MaxLength, "Description", 500);
                }
            }
            if (Parameters != null)
            {
                foreach (var valueElement in Parameters.Values)
                {
                    if (valueElement != null)
                    {
                        valueElement.Validate();
                    }
                }
            }
            if (ResourceGroups != null)
            {
                foreach (var valueElement1 in ResourceGroups.Values)
                {
                    if (valueElement1 != null)
                    {
                        valueElement1.Validate();
                    }
                }
            }
            if (ChangeNotes != null)
            {
                if (ChangeNotes.Length > 500)
                {
                    throw new ValidationException(ValidationRules.MaxLength, "ChangeNotes", 500);
                }
            }
        }
    }
}


text:
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.execution.console;

import com.intellij.ide.ui.UISettings;
import com.intellij.openapi.util.SimpleModificationTracker;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.containers.ConcurrentFactoryMap;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

/**
 * @author Gregory.Shrago
 */
public class DefaultConsoleHistoryModel extends SimpleModificationTracker implements ConsoleHistoryModel {

  private final static Map<String, DefaultConsoleHistoryModel> ourModels =
    ConcurrentFactoryMap.create(key -> new DefaultConsoleHistoryModel(null),
                                   ContainerUtil::createConcurrentWeakValueMap);

  public static DefaultConsoleHistoryModel createModel(String persistenceId) {
    return ourModels.get(persistenceId).copy();
  }

  private final Object myLock;
  private final LinkedList<String> myEntries;
  private int myIndex;
  private String myContent;

  DefaultConsoleHistoryModel(@Nullable DefaultConsoleHistoryModel masterModel) {
    myEntries = masterModel == null ? new LinkedList<>() : masterModel.myEntries;
    myLock = masterModel == null ? this : masterModel.myLock;  // hard ref to master model
    resetIndex();
  }

  public DefaultConsoleHistoryModel copy() {
    return new DefaultConsoleHistoryModel(this);
  }

  @Override
  public void resetEntries(@NotNull List<String> entries) {
    synchronized (myLock) {
      myEntries.clear();
      myEntries.addAll(ContainerUtil.getFirstItems(entries, getMaxHistorySize()));
      incModificationCount();
    }
  }

  @Override
  public void addToHistory(@Nullable String statement) {
    if (StringUtil.isEmptyOrSpaces(statement)) return;

    synchronized (myLock) {
      int maxHistorySize = getMaxHistorySize();
      myEntries.remove(statement);
      int size = myEntries.size();
      if (size >= maxHistorySize && size > 0) {
        myEntries.removeFirst();
      }
      myEntries.addLast(statement);
      incModificationCount();
    }
  }

  @Override
  public void incModificationCount() {
    resetIndex();
    super.incModificationCount();
  }

  protected void resetIndex() {
    synchronized (myLock) {
      myIndex = myEntries.size();
    }
  }

  @Override
  public int getMaxHistorySize() {
    return UISettings.getInstance().getConsoleCommandHistoryLimit();
  }

  @Override
  public void removeFromHistory(String statement) {
    synchronized (myLock) {
      myEntries.remove(statement);
      incModificationCount();
    }
  }

  @NotNull
  @Override
  public List<String> getEntries() {
    synchronized (myLock) {
      return new ArrayList<>(myEntries);
    }
  }

  @Override
  public boolean isEmpty() {
    synchronized (myLock) {
      return myEntries.isEmpty();
    }
  }

  @Override
  public int getHistorySize() {
    synchronized (myLock) {
      return myEntries.size();
    }
  }

  @Override
  @Nullable
  public Entry getHistoryNext() {
    synchronized (myLock) {
      if (myIndex >= 0) --myIndex;
      return new Entry(getCurrentEntry(), -1);
    }
  }

  @Override
  @Nullable
  public Entry getHistoryPrev() {
    synchronized (myLock) {
      if (myIndex <= myEntries.size() - 1) ++myIndex;
      return new Entry(getCurrentEntry(), -1);
    }
  }

  @Override
  public boolean hasHistory() {
    synchronized (myLock) {
      return myIndex <= myEntries.size() - 1;
    }
  }

  String getCurrentEntry() {
    synchronized (myLock) {
      return myIndex >= 0 && myIndex < myEntries.size() ? myEntries.get(myIndex) :
             myIndex == myEntries.size() ? myContent : null;
    }
  }

  @Override
  public int getCurrentIndex() {
    synchronized (myLock) {
      return myIndex;
    }
  }

  @Override
  public void setContent(@NotNull String userContent) {
    myContent = userContent;
  }
}


text:
package com.jme3.scene.plugins.fbx;

import com.jme3.animation.AnimControl;
import com.jme3.animation.Animation;
import com.jme3.animation.Bone;
import com.jme3.animation.BoneTrack;
import com.jme3.animation.Skeleton;
import com.jme3.animation.Track;
import com.jme3.asset.AssetInfo;
import com.jme3.asset.AssetKey;
import com.jme3.asset.AssetLoadException;
import com.jme3.asset.AssetLoader;
import com.jme3.asset.AssetManager;
import com.jme3.asset.ModelKey;
import com.jme3.math.Matrix4f;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import com.jme3.scene.plugins.fbx.anim.FbxToJmeTrack;
import com.jme3.scene.plugins.fbx.anim.FbxAnimCurveNode;
import com.jme3.scene.plugins.fbx.anim.FbxAnimLayer;
import com.jme3.scene.plugins.fbx.anim.FbxAnimStack;
import com.jme3.scene.plugins.fbx.anim.FbxBindPose;
import com.jme3.scene.plugins.fbx.anim.FbxLimbNode;
import com.jme3.scene.plugins.fbx.file.FbxElement;
import com.jme3.scene.plugins.fbx.file.FbxFile;
import com.jme3.scene.plugins.fbx.file.FbxReader;
import com.jme3.scene.plugins.fbx.file.FbxId;
import com.jme3.scene.plugins.fbx.misc.FbxGlobalSettings;
import com.jme3.scene.plugins.fbx.node.FbxNode;
import com.jme3.scene.plugins.fbx.node.FbxRootNode;
import com.jme3.scene.plugins.fbx.obj.FbxObjectFactory;
import com.jme3.scene.plugins.fbx.obj.FbxObject;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;

public class FbxLoader implements AssetLoader {

    private static final Logger logger = Logger.getLogger(FbxLoader.class.getName());

    private AssetManager assetManager;

    private String sceneName;
    private String sceneFilename;
    private String sceneFolderName;
    private FbxGlobalSettings globalSettings;
    private final Map<FbxId, FbxObject> objectMap = new HashMap<>();

    private final List<FbxAnimStack> animStacks = new ArrayList<>();
    private final List<FbxBindPose> bindPoses = new ArrayList<>();

    @Override
    public Object load(AssetInfo assetInfo) throws IOException {
        this.assetManager = assetInfo.getManager();
        AssetKey<?> assetKey = assetInfo.getKey();
        if (!(assetKey instanceof ModelKey)) {
            throw new AssetLoadException("Invalid asset key");
        }

        InputStream stream = assetInfo.openStream();
        try {
            sceneFilename = assetKey.getName();
            sceneFolderName = assetKey.getFolder();
            String ext = assetKey.getExtension();

            sceneName = sceneFilename.substring(0, sceneFilename.length() - ext.length() - 1);
            if (sceneFolderName != null && sceneFolderName.length() > 0) {
                sceneName = sceneName.substring(sceneFolderName.length());
            }

            reset();

            // Load the data from the stream.
            loadData(stream);

            // Bind poses are needed to compute world transforms.
            applyBindPoses();

            // Need world transforms for skeleton creation.
            updateWorldTransforms();

            // Need skeletons for meshes to be created in scene graph construction.
            // Mesh bone indices require skeletons to determine bone index.
            constructSkeletons();

            // Create the jME3 scene graph from the FBX scene graph.
            // Also creates SkeletonControls based on the constructed skeletons.
            Spatial scene = constructSceneGraph();

            // Load animations into AnimControls
            constructAnimations();

            return scene;
        } finally {
            releaseObjects();
            if (stream != null) {
                stream.close();
            }
        }
    }

    private void reset() {
        globalSettings = new FbxGlobalSettings();
    }

    private void releaseObjects() {
        globalSettings = null;
        objectMap.clear();
        animStacks.clear();
    }

    private void loadData(InputStream stream) throws IOException {
        FbxFile scene = FbxReader.readFBX(stream);

        //FbxDump.dumpFile(scene);

        // TODO: Load FBX object templates

        for (FbxElement e : scene.rootElements) {
            if (e.id.equals("FBXHeaderExtension")) {
                loadHeader(e);
            } else if (e.id.equals("GlobalSettings")) {
                loadGlobalSettings(e);
             } else if (e.id.equals("Objects")) {
                loadObjects(e);
            } else if (e.id.equals("Connections")) {
                connectObjects(e);
            }
        }
    }

    private void loadHeader(FbxElement element) {
        for (FbxElement e : element.children) {
            if (e.id.equals("FBXVersion")) {
                Integer version = (Integer) e.properties.get(0);
                if (version < 7100) {
                    logger.log(Level.WARNING, "FBX file version is older than 7.1. "
                                            + "Some features may not work.");
                }
            }
        }
    }

    private void loadGlobalSettings(FbxElement element) {
        globalSettings = new FbxGlobalSettings();
        globalSettings.fromElement(element);
    }

    private void loadObjects(FbxElement element) {
        // Initialize the FBX root element.
        objectMap.put(FbxId.ROOT, new FbxRootNode(assetManager, sceneFolderName));

        for(FbxElement e : element.children) {
            if (e.id.equals("GlobalSettings")) {
                // Old FBX files seem to have the GlobalSettings element
                // under Objects (??)
                globalSettings.fromElement(e);
            } else {
                FbxObject object = FbxObjectFactory.createObject(e, assetManager, sceneFolderName);
                if (object != null) {
                    if (objectMap.containsKey(object.getId())) {
                        logger.log(Level.WARNING, "An object with ID \"{0}\" has "
                                                + "already been defined. "
                                                + "Ignoring.",
                                                   object.getId());
                    }

                    objectMap.put(object.getId(), object);

                    if (object instanceof FbxAnimStack) {
                        // NOTE: animation stacks are implicitly global.
                        // Capture them here.
                        animStacks.add((FbxAnimStack) object);
                    } else if (object instanceof FbxBindPose) {
                        bindPoses.add((FbxBindPose) object);
                    }
                } else {
                    throw new UnsupportedOperationException("Failed to create FBX object of type: " + e.id);
                }
            }
        }
    }

    private void connectObjects(FbxElement element) {
        if (objectMap.isEmpty()) {
            logger.log(Level.WARNING, "FBX file is missing object information");
            return;
        } else if (objectMap.size() == 1) {
            // Only root node (automatically added by jME3)
            logger.log(Level.WARNING, "FBX file has no objects");
            return;
        }

        for (FbxElement el : element.children) {
            if (!el.id.equals("C") && !el.id.equals("Connect")) {
                continue;
            }
            String type = (String) el.properties.get(0);
            FbxId childId;
            FbxId parentId;
            if (type.equals("OO")) {
                childId = FbxId.create(el.properties.get(1));
                parentId = FbxId.create(el.properties.get(2));
                FbxObject child = objectMap.get(childId);
                FbxObject parent;

                if (parentId.isNull()) {
                    // TODO: maybe clean this up a bit..
                    parent = objectMap.get(FbxId.ROOT);
                } else {
                    parent = objectMap.get(parentId);
                }

                if (parent == null) {
                    throw new UnsupportedOperationException("Cannot find parent object ID \"" + parentId + "\"");
                }

                parent.connectObject(child);
            } else if (type.equals("OP")) {
                childId = FbxId.create(el.properties.get(1));
                parentId = FbxId.create(el.properties.get(2));
                String propName = (String) el.properties.get(3);
                FbxObject child = objectMap.get(childId);
                FbxObject parent = objectMap.get(parentId);
                parent.connectObjectProperty(child, propName);
            } else {
                logger.log(Level.WARNING, "Unknown connection type: {0}. Ignoring.", type);
            }
        }
    }

    /**
     * Copies the bind poses from FBX BindPose objects to FBX nodes.
     * Must be called prior to {@link #updateWorldTransforms()}.
     */
    private void applyBindPoses() {
        for (FbxBindPose bindPose : bindPoses) {
            Map<FbxId, Matrix4f> bindPoseData = bindPose.getJmeObject();
            if (logger.isLoggable(Level.INFO)) {
                logger.log(Level.INFO, "Applying {0} bind poses", bindPoseData.size());
            }
            for (Map.Entry<FbxId, Matrix4f> entry : bindPoseData.entrySet()) {
                FbxObject obj = objectMap.get(entry.getKey());
                if (obj instanceof FbxNode) {
                    FbxNode node = (FbxNode) obj;
                    node.setWorldBindPose(entry.getValue());
                } else {
                    logger.log(Level.WARNING, "Bind pose can only be applied to FBX nodes. Ignoring.");
                }
            }
        }
    }

    /**
     * Updates world transforms and bind poses for the FBX scene graph.
     */
    private void updateWorldTransforms() {
        FbxNode fbxRoot = (FbxNode) objectMap.get(FbxId.ROOT);
        fbxRoot.updateWorldTransforms(null, null);
    }

    private void constructAnimations() {
        // In FBX, animation are not attached to any root.
        // They are implicitly global.
        // So, we need to use heuristics to find which node(s)
        // an animation is associated with, so we can create the AnimControl
        // in the appropriate location in the scene.
        Map<FbxToJmeTrack, FbxToJmeTrack> pairs = new HashMap<>();
        for (FbxAnimStack stack : animStacks) {
            for (FbxAnimLayer layer : stack.getLayers()) {
                for (FbxAnimCurveNode curveNode : layer.getAnimationCurveNodes()) {
                    for (Map.Entry<FbxNode, String> nodePropertyEntry : curveNode.getInfluencedNodeProperties().entrySet()) {
                        FbxToJmeTrack lookupPair = new FbxToJmeTrack();
                        lookupPair.animStack = stack;
                        lookupPair.animLayer = layer;
                        lookupPair.node = nodePropertyEntry.getKey();

                        // Find if this pair is already stored
                        FbxToJmeTrack storedPair = pairs.get(lookupPair);
                        if (storedPair == null) {
                            // If not, store it.
                            storedPair = lookupPair;
                            pairs.put(storedPair, storedPair);
                        }

                        String property = nodePropertyEntry.getValue();
                        storedPair.animCurves.put(property, curveNode);
                    }
                }
            }
        }

        // At this point we can construct the animation for all pairs ...
        for (FbxToJmeTrack pair : pairs.values()) {
            String animName = pair.animStack.getName();
            float duration    = pair.animStack.getDuration();

            //System.out.println("ANIMATION: " + animName + ", duration = " + duration);
            //System.out.println("NODE: " + pair.node.getName());

            duration = pair.getDuration();

            if (pair.node instanceof FbxLimbNode) {
                // Find the spatial that has the skeleton for this limb.
                FbxLimbNode limbNode = (FbxLimbNode) pair.node;
                Bone bone = limbNode.getJmeBone();
                Spatial jmeSpatial = limbNode.getSkeletonHolder().getJmeObject();
                Skeleton skeleton = limbNode.getSkeletonHolder().getJmeSkeleton();

                // Get the animation control (create if missing).
                AnimControl animControl = jmeSpatial.getControl(AnimControl.class);
                if (animControl.getSkeleton() != skeleton) {
                    throw new UnsupportedOperationException();
                }

                // Get the animation (create if missing).
                Animation anim = animControl.getAnim(animName);
                if (anim == null) {
                    anim = new Animation(animName, duration);
                    animControl.addAnim(anim);
                }

                // Find the bone index from the spatial's skeleton.
                int boneIndex = skeleton.getBoneIndex(bone);

                // Generate the bone track.
                BoneTrack bt = pair.toJmeBoneTrack(boneIndex, bone.getBindInverseTransform());

                // Add the bone track to the animation.
                anim.addTrack(bt);
            } else {
                // Create the spatial animation
                Animation anim = new Animation(animName, duration);
                anim.setTracks(new Track[]{ pair.toJmeSpatialTrack() });

                // Get the animation control (create if missing).
                Spatial jmeSpatial = pair.node.getJmeObject();
                AnimControl animControl = jmeSpatial.getControl(AnimControl.class);

                if (animControl == null) {
                    animControl = new AnimControl(null);
                    jmeSpatial.addControl(animControl);
                }

                // Add the spatial animation
                animControl.addAnim(anim);
            }
        }
    }

    private void constructSkeletons() {
        FbxNode fbxRoot = (FbxNode) objectMap.get(FbxId.ROOT);
        FbxNode.createSkeletons(fbxRoot);
    }

    private Spatial constructSceneGraph() {
        // Acquire the implicit root object.
        FbxNode fbxRoot = (FbxNode) objectMap.get(FbxId.ROOT);

        // Convert it into a jME3 scene
        Node jmeRoot = (Node) FbxNode.createScene(fbxRoot);

        // Fix the name (will probably be set to something like "-node")
        jmeRoot.setName(sceneName + "-scene");

        return jmeRoot;
    }
}


text:
<?php namespace Miinto\Database\Schema;

use Illuminate\Database\Schema\Blueprint;

/**
 * Class MsSqlBlueprint
 *
 * @package Miinto\Database\Schema
 */
class MsSqlBlueprint extends Blueprint
{
	/**
	 * @author Michał Durys <md@miinto.com>
	 *
	 * @param string $column
	 *
	 * @return \Illuminate\Support\Fluent
	 */
	public function bit($column)
	{
		return $this->addColumn('bit', $column);
	}

	/**
	 * @author Michał Durys <md@miinto.com>
	 *
	 * @param string $column
	 *
	 * @return \Illuminate\Support\Fluent
	 */
	public function dateTime2($column)
	{
		return $this->addColumn('datetime2', $column);
	}

	/**
	 * @author Michał Durys <md@miinto.com>
	 *
	 * @param string $column
	 *
	 * @return \Illuminate\Support\Fluent
	 */
	public function real($column)
	{
		return $this->addColumn('real', $column);
	}

	/**
	 * @author Michał Durys <md@miinto.com>
	 *
	 * @param string $column
	 *
	 * @return \Illuminate\Support\Fluent
	 */
	public function uniqueIdentifier($column)
	{
		return $this->addColumn('uniqueidentifier', $column);
	}

	/**
	 * @author Michał Durys <md@miinto.com>
	 *
	 * @param string $column
	 *
	 * @return \Illuminate\Support\Fluent
	 */
	public function money($column)
	{
		return $this->addColumn('money', $column);
	}

	/**
	 * @author Michał Durys <md@miinto.com>
	 *
	 * @param string $column
	 *
	 * @return \Illuminate\Support\Fluent
	 */
	public function smallMoney($column)
	{
		return $this->addColumn('smallmoney', $column);
	}

	/**
	 * @author Simon Jensen <sj@miinto.com>
	 *
	 * @param string $column
	 *
	 * @return \Illuminate\Support\Fluent
	 */
	public function xml($column)
	{
		return $this->addColumn('xml', $column);
	}
}


text:
You can call us, [Ed](http://edbirmingham.org).

## What We Do
The unique and specific focus of our work is "[Network-Building](https://www.youtube.com/watch?v=OI0qip6XlZc)". The Birmingham Education Foundation (Ed) is dedicated to increasing the number of students in the Birmingham City Schools that are on the path to college, career, and life readiness. We believe that this is only possible by cultivating a diverse network of people who demand excellence for our students and inspire others to do the same. We believe Network members are:

1. Committed to deliberate actions that demonstrate their belief in and love for our students; and
2. Intentionally connected through a set of relationships, taking advantage of opportunities to act together,
and exchanging value between individuals and groups.

To actively cultivate the Network, we provide direct programming for students and fun and interactive opportunities for Network members to build new relationships and strengthen existing ones. We serve as Connectors among five different stakeholder groups – students, educators, families, local residents, and community partners– bringing them together to create a new operating culture that sparks organic and objective-driven visions to increase student preparedness for college, career, and life.

## Network Asset Database [![Build Status](https://travis-ci.org/edbirmingham/network.svg)](https://travis-ci.org/edbirmingham/network)
In order to reach our Network membership and action goals it is imperative that we maintain organization of our data, communication, and progress. The Network Asset Database, aka [edbirmingham/network](https://github.com/edbirmingham/network), is being developed to increase Ed's Network activity; maintaining Membership records, supporting stewardship (progress to requests/offers between Network members), and increasing access and awareness to school/community based assets.

## Contributing
Network is 100% free and open-source. We encourage and support an active, healthy community that accepts contributions from the public – including you!  To maximize openness we operate according to the [Collective Code Construction Contract](c4.md)
* Questions? Visit our [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/edbirmingham/network?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) room.
* Not sure what to work on?  Check out the [![Stories in Ready](https://badge.waffle.io/edbirmingham/network.svg?label=ready&title=Ready)](http://waffle.io/edbirmingham/network) issues at [waffle](https://waffle.io/edbirmingham/network).  When beginning work on an issue, please move it to the [waffle](https://waffle.io/edbirmingham/network) "In Progress" column if you are a maintainer.  Otherwise, comment on the issue indicating that you are working on it. If you want a quick and easy issue to help you get started, check out out our [help-wanted](https://waffle.io/edbirmingham/network?label=help-wanted) and [help-wanted-easy](https://waffle.io/edbirmingham/network?label=help-wanted-easy) issues
* Wondering how to setup a development environment?  See the [Super Easy](#super-easy-setup) setup instructions below.
* Want to learn about the technology being used?  See the [Rails Guides](http://guides.rubyonrails.org/).

## Super Easy Setup
This setup uses Cloud9 for your development environment.  Cloud9 provides an online development environment and server for you to use.  All you need is a browser and good internet connection.  Everything else is available on Cloud9's site.
* Create a Github account
* Fork [Network](https://github.com/edbirmingham/network)
  * Scroll to the top of this page and click "fork" in the top right corner.
* Setup Cloud9
  * Signup for [Cloud9 IDE](http://c9.io) with your Github Account
  * Goto the Repositories link in Cloud9 IDE
  * Select "Clone to edit" on *your* fork of Network.
    * Note, you may see two options for Network.  One is "edbirmingham/network", which you do not want to select.  The other is "*your name*/network" which is the correct repository to select.
    * Enter a workspace name, network will probably be fine.
    * Enter a description.
    * Choose the Rails Ruby template.
    * Click the "Create workspace" button.
  * Cloud9 will soon display the development environment.
  * In the bash tab (bottom of the screen), setup a git remote to the main project:
  ```
  git remote add upstream https://github.com/edbirmingham/network.git
  git pull upstream master
  ```
  * In the bash tab, install the Ruby gems used by the project and setup the data in the database by entering the following commands:
  ```
  bundle install
  rake db:setup
  ```
  > Note: If the command fails, you can restart the workspace by clicking in the top right corner where it says "Memory, CPU, and Disk". Then click restart in that menu.

  * To start the app run the following from the command line:
  ```
  rails server -p $PORT -b $IP
  ```
  * To view the app in the browser, select Preview from the editor menu and then select Preview Running Application.  This will open the application in a tab of the editor.  Log into the application with email `jane.doe@example.com` and password `password`.
* Hack away
* Send lots of pull requests!!
* In order to get updates from the main project use the following command in the bash tab:
```
git pull upstream master
```


text:
package org.tzi.context.server.command;

import org.tzi.context.common.Protocol;

public class CmdLogout implements ServerCommand {

	//@Override
	public ServerCommandResult processCommand(ServerCommandParameters scp) {
		ServerCommandResult scr = new ServerCommandResult();
		scr.reply.setLength(0);
		scr.reply.append(Protocol.OK);
		return scr;
	}

}


text:
package uo.idoc;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import java.awt.image.FilteredImageSource;
import java.awt.image.ImageFilter;
import java.awt.image.ImageProducer;
import java.awt.image.RGBImageFilter;
import java.io.IOException;

import javax.imageio.ImageIO;

import uo.idoc.difference.HouseDifference;
import uo.idoc.model.House;

public class ScreenshotMarker {

  private static final String HALO_IMG_RESOURCE = "halo-arrow.png";

  private final BufferedImage halo;

  public ScreenshotMarker() {
    try {
      halo = ImageIO.read(this.getClass().getClassLoader().getResourceAsStream(HALO_IMG_RESOURCE));
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }

  private static final int OLD_COLOR = 0x00FF00E1;
  private static final int NEW_COLOR = 0x00FFEA00;
  private static final int LATITUDE_OFFSET_PX = 12;
  private static final int LONGITUDE_OFFSET_PX = 7;

  // assumes 0,0 lat long is at top left of image
  public BufferedImage markScreenshot(BufferedImage im, HouseDifference diff) {
    System.out.println(String.format("Marking %d new houses",diff.getOnlyInNew().size()));
    System.out.println(String.format("Marking %d old houses",diff.getOnlyInOld().size()));
    markHouses(im, diff.getOnlyInNew(), NEW_COLOR, true);
    markHouses(im, diff.getOnlyInOld(), OLD_COLOR, false);

    writeLegend(im);
    return im;
  }

  private void writeLegend(BufferedImage im) {
    Graphics2D graph = im.createGraphics();

    int fontSize = 80;

    graph.setFont(new Font ("Courier New", 1, fontSize));
    graph.setColor(new Color(OLD_COLOR));
    graph.drawString("Fallen houses", fontSize*2, fontSize*2);
    graph.setColor(new Color(NEW_COLOR));
    graph.drawString("New Houses", fontSize*2, fontSize*3);
  }

  private void markHouses(BufferedImage im, Iterable<House> houses, int color, boolean isLeft) {
    for (House h : houses) {
      int x = h.getLatitude();
      int y = h.getLongitude();
      drawHalo(im, x + LATITUDE_OFFSET_PX, y + LONGITUDE_OFFSET_PX, color, isLeft);
    }
  }

  private void drawHalo(BufferedImage im, int x, int y, int color, boolean isLeft) {
    Graphics2D graph = im.createGraphics();
    AffineTransform t = new AffineTransform();
    int offset = 25;
    int rotationDegrees = (isLeft ? 1 : -1) * 45;
    t.rotate(Math.toRadians(rotationDegrees), x, y);
    graph.setTransform(t);
    graph.drawImage(addHueToImage(halo, color), null, x - offset, y - offset);
    graph.dispose();
  }

  public static BufferedImage addHueToImage(BufferedImage im, final int color) {
    ImageFilter filter = new RGBImageFilter() {
      public final int filterRGB(int x, int y, int rgb) {
        return (rgb ^ color);
      }
    };

    ImageProducer ip = new FilteredImageSource(im.getSource(), filter);
    return toBufferedImage(Toolkit.getDefaultToolkit().createImage(ip));
  }

  /**
   * Converts a given Image into a BufferedImage
   * @param img The Image to be converted
   * @return The converted BufferedImage
   */
  public static BufferedImage toBufferedImage(Image img) {
    if (img instanceof BufferedImage) {
      return (BufferedImage) img;
    }

    // Create a buffered image with transparency
    BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB);

    // Draw the image on to the buffered image
    Graphics2D bGr = bimage.createGraphics();
    bGr.drawImage(img, 0, 0, null);
    bGr.dispose();

    // Return the buffered image
    return bimage;
  }

}


text:
class VoteController < ApplicationController
  skip_before_filter :verify_authenticity_token
  before_filter :authenticate_user!

  layout 'member'
  respond_to :js

  def upvote
    @upvotable = find_upvotable
    if @upvotable.user != current_user
      user_upvote = @upvotable.upvotes.find_by(:user_id => current_user.id)
      user_downvote = @upvotable.downvotes.find_by(:user_id => current_user.id)
      if user_upvote.present?
        user_upvote.destroy
      else
        @upvotable.upvotes.create(:user_id => current_user.id)
        if user_downvote.present?
          user_downvote.destroy
        end
      end
    else
      @error = "You can't vote your own #{@upvotable.model_name}"
    end
  end

  def downvote
    @downvotable = find_downvotable
    if @downvotable.user != current_user
      user_downvote = @downvotable.downvotes.find_by(:user_id => current_user.id)
      user_upvote = @downvotable.upvotes.find_by(:user_id => current_user.id)
      if user_downvote.present?
        user_downvote.destroy
      else
        @downvotable.downvotes.create(:user_id => current_user.id)
        if user_upvote.present?
          user_upvote.destroy
        end
      end
    else
      @error = "You can't vote your own #{@downvotable.model_name}"
    end
  end

  def accepted
    @answer = Answer.find(params[:a_id])
    question = @answer.question
    if current_user == question.user
      if @answer.user != current_user
        update_points(@answer, question)
      end
    end
  end

  private

  def update_points(answer, question)
    previousAccepted = question.answers.find_by(accepted: true)
    currentProfile = answer.user.profile
    questionerProfile = question.user.profile
    if previousAccepted.present?
      if previousAccepted == answer
        answer.update_column(:accepted, false)
        currentProfile.update_column(:points, currentProfile.points - 20)
        questionerProfile.update_column(:points, questionerProfile.points - 5)
      else
        previousAccepted.update_column(:accepted, false)
        answer.update_column(:accepted, true)
        previousProfile = previousAccepted.user.profile
        previousProfile.update_column(:points, previousProfile.points - 20)
        currentProfile.update_column(:points, currentProfile.points + 20)
      end
    else
      answer.update_column(:accepted, true)
      currentProfile.update_column(:points, currentProfile.points + 20)
      questionerProfile.update_column(:points, questionerProfile.points + 5)
    end
  end

  def find_upvotable
    if params[:a_id].present?
      return Answer.find(params[:a_id])
    else
      return Question.find(params[:q_id])
    end
  end

  def find_downvotable
    if params[:a_id].present?
      Answer.find(params[:a_id])
    else
      Question.find(params[:q_id])
    end
  end

end


text:
#include "si_base/core/core.h"
#include "si_base/gpu/dx12/dx12_shader.h"
#include "si_base/gpu/gfx_root_signature.h"
#include "si_base/gpu/gfx_device.h"
#include "si_base/memory/pool_allocator.h"
#include "si_base/gpu/dx12/dx12_root_signature.h"

namespace SI
{
	void* GfxRootSignature::GetNative()
	{
		return m_base->GetNative();
	}

} // namespace SI


text:
<!DOCTYPE HTML>

		<title>BitMesh - Chris Lunoe</title>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<meta name="description" content="" />
		<meta name="keywords" content="" />

			<link rel="stylesheet" href="css/skel.css" />
			<link rel="stylesheet" href="css/style.css" />
			<link rel="stylesheet" href="css/style-wide.css" />

Chris Lunoe

We are an open source project that will

					revolutionize the way you share and purchase internet.

Twitter

Github

© BitMesh. All rights reserved.

Design: HTML5 UP


text:
package testlib

import (
	"fmt"
	"testing"
	"time"

	"github.com/youtube/vitess/go/vt/logutil"
	myproto "github.com/youtube/vitess/go/vt/mysqlctl/proto"
	"github.com/youtube/vitess/go/vt/tabletmanager/tmclient"
	"github.com/youtube/vitess/go/vt/tabletserver"
	"github.com/youtube/vitess/go/vt/topo/topoproto"
	"github.com/youtube/vitess/go/vt/wrangler"
	"github.com/youtube/vitess/go/vt/zktopo"

	pb "github.com/youtube/vitess/go/vt/proto/topodata"
)

func TestPlannedReparentShard(t *testing.T) {
	ts := zktopo.NewTestServer(t, []string{"cell1", "cell2"})
	wr := wrangler.New(logutil.NewConsoleLogger(), ts, tmclient.NewTabletManagerClient(), time.Second)
	vp := NewVtctlPipe(t, ts)
	defer vp.Close()

	// Create a master, a couple good slaves
	oldMaster := NewFakeTablet(t, wr, "cell1", 0, pb.TabletType_MASTER)
	newMaster := NewFakeTablet(t, wr, "cell1", 1, pb.TabletType_REPLICA)
	goodSlave1 := NewFakeTablet(t, wr, "cell1", 2, pb.TabletType_REPLICA)
	goodSlave2 := NewFakeTablet(t, wr, "cell2", 3, pb.TabletType_REPLICA)

	// new master
	newMaster.FakeMysqlDaemon.ReadOnly = true
	newMaster.FakeMysqlDaemon.Replicating = true
	newMaster.FakeMysqlDaemon.WaitMasterPosition = myproto.ReplicationPosition{
		GTIDSet: myproto.MariadbGTID{
			Domain:   7,
			Server:   123,
			Sequence: 990,
		},
	}
	newMaster.FakeMysqlDaemon.PromoteSlaveResult = myproto.ReplicationPosition{
		GTIDSet: myproto.MariadbGTID{
			Domain:   7,
			Server:   456,
			Sequence: 991,
		},
	}
	newMaster.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
		"CREATE DATABASE IF NOT EXISTS _vt",
		"SUBCREATE TABLE IF NOT EXISTS _vt.reparent_journal",
		"SUBINSERT INTO _vt.reparent_journal (time_created_ns, action_name, master_alias, replication_position) VALUES",
	}
	newMaster.StartActionLoop(t, wr)
	defer newMaster.StopActionLoop(t)

	// old master
	oldMaster.FakeMysqlDaemon.ReadOnly = false
	oldMaster.FakeMysqlDaemon.Replicating = false
	oldMaster.FakeMysqlDaemon.DemoteMasterPosition = newMaster.FakeMysqlDaemon.WaitMasterPosition
	oldMaster.FakeMysqlDaemon.SetMasterCommandsInput = fmt.Sprintf("%v:%v", newMaster.Tablet.Hostname, newMaster.Tablet.PortMap["mysql"])
	oldMaster.FakeMysqlDaemon.SetMasterCommandsResult = []string{"set master cmd 1"}
	oldMaster.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
		"set master cmd 1",
		"START SLAVE",
	}
	oldMaster.StartActionLoop(t, wr)
	defer oldMaster.StopActionLoop(t)
	oldMaster.Agent.QueryServiceControl.(*tabletserver.TestQueryServiceControl).QueryServiceEnabled = true

	// good slave 1 is replicating
	goodSlave1.FakeMysqlDaemon.ReadOnly = true
	goodSlave1.FakeMysqlDaemon.Replicating = true
	goodSlave1.FakeMysqlDaemon.SetMasterCommandsInput = fmt.Sprintf("%v:%v", newMaster.Tablet.Hostname, newMaster.Tablet.PortMap["mysql"])
	goodSlave1.FakeMysqlDaemon.SetMasterCommandsResult = []string{"set master cmd 1"}
	goodSlave1.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
		"STOP SLAVE",
		"set master cmd 1",
		"START SLAVE",
	}
	goodSlave1.StartActionLoop(t, wr)
	defer goodSlave1.StopActionLoop(t)

	// good slave 2 is not replicating
	goodSlave2.FakeMysqlDaemon.ReadOnly = true
	goodSlave2.FakeMysqlDaemon.Replicating = false
	goodSlave2.FakeMysqlDaemon.SetMasterCommandsInput = fmt.Sprintf("%v:%v", newMaster.Tablet.Hostname, newMaster.Tablet.PortMap["mysql"])
	goodSlave2.FakeMysqlDaemon.SetMasterCommandsResult = []string{"set master cmd 1"}
	goodSlave2.StartActionLoop(t, wr)
	goodSlave2.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{
		"set master cmd 1",
	}
	defer goodSlave2.StopActionLoop(t)

	// run PlannedReparentShard
	if err := vp.Run([]string{"PlannedReparentShard", "-wait_slave_timeout", "10s", newMaster.Tablet.Keyspace + "/" + newMaster.Tablet.Shard, topoproto.TabletAliasString(newMaster.Tablet.Alias)}); err != nil {
		t.Fatalf("PlannedReparentShard failed: %v", err)
	}

	// check what was run
	if err := newMaster.FakeMysqlDaemon.CheckSuperQueryList(); err != nil {
		t.Errorf("newMaster.FakeMysqlDaemon.CheckSuperQueryList failed: %v", err)
	}
	if err := oldMaster.FakeMysqlDaemon.CheckSuperQueryList(); err != nil {
		t.Errorf("oldMaster.FakeMysqlDaemon.CheckSuperQueryList failed: %v", err)
	}
	if err := goodSlave1.FakeMysqlDaemon.CheckSuperQueryList(); err != nil {
		t.Errorf("goodSlave1.FakeMysqlDaemon.CheckSuperQueryList failed: %v", err)
	}
	if err := goodSlave2.FakeMysqlDaemon.CheckSuperQueryList(); err != nil {
		t.Errorf("goodSlave2.FakeMysqlDaemon.CheckSuperQueryList failed: %v", err)
	}
	if newMaster.FakeMysqlDaemon.ReadOnly {
		t.Errorf("newMaster.FakeMysqlDaemon.ReadOnly set")
	}
	if !oldMaster.FakeMysqlDaemon.ReadOnly {
		t.Errorf("oldMaster.FakeMysqlDaemon.ReadOnly not set")
	}
	if !goodSlave1.FakeMysqlDaemon.ReadOnly {
		t.Errorf("goodSlave1.FakeMysqlDaemon.ReadOnly not set")
	}
	if !goodSlave2.FakeMysqlDaemon.ReadOnly {
		t.Errorf("goodSlave2.FakeMysqlDaemon.ReadOnly not set")
	}
	if oldMaster.Agent.QueryServiceControl.(*tabletserver.TestQueryServiceControl).QueryServiceEnabled {
		t.Errorf("oldMaster...QueryServiceEnabled set")
	}

	// verify the old master was told to start replicating (and not
	// the slave that wasn't replicating in the first place)
	if !oldMaster.FakeMysqlDaemon.Replicating {
		t.Errorf("oldMaster.FakeMysqlDaemon.Replicating not set")
	}
	if !goodSlave1.FakeMysqlDaemon.Replicating {
		t.Errorf("goodSlave1.FakeMysqlDaemon.Replicating not set")
	}
	if goodSlave2.FakeMysqlDaemon.Replicating {
		t.Errorf("goodSlave2.FakeMysqlDaemon.Replicating set")
	}
}