text:
.class Lcom/android/server/policy/GlobalActions$8$1;
.super Ljava/lang/Object;
.source "GlobalActions.java"

# interfaces
.implements Landroid/content/DialogInterface$OnClickListener;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/android/server/policy/GlobalActions$8;->onPress()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$1:Lcom/android/server/policy/GlobalActions$8;

# direct methods
.method constructor <init>(Lcom/android/server/policy/GlobalActions$8;)V
    .locals 0
    .param p1, "this$1"    # Lcom/android/server/policy/GlobalActions$8;

    .prologue
    .line 380
    iput-object p1, p0, Lcom/android/server/policy/GlobalActions$8$1;->this$1:Lcom/android/server/policy/GlobalActions$8;

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

    return-void
.end method

# virtual methods
.method public onClick(Landroid/content/DialogInterface;I)V
    .locals 4
    .param p1, "dialog"    # Landroid/content/DialogInterface;
    .param p2, "which"    # I

    .prologue
    .line 385
    invoke-static {}, Landroid/app/ActivityManager;->isUserAMonkey()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 386
    return-void

    .line 391
    :cond_0
    iget-object v0, p0, Lcom/android/server/policy/GlobalActions$8$1;->this$1:Lcom/android/server/policy/GlobalActions$8;

    iget-object v0, v0, Lcom/android/server/policy/GlobalActions$8;->this$0:Lcom/android/server/policy/GlobalActions;

    invoke-static {v0}, Lcom/android/server/policy/GlobalActions;->-get7(Lcom/android/server/policy/GlobalActions;)Landroid/os/Handler;

    move-result-object v0

    new-instance v1, Lcom/android/server/policy/GlobalActions$8$1$1;

    invoke-direct {v1, p0}, Lcom/android/server/policy/GlobalActions$8$1$1;-><init>(Lcom/android/server/policy/GlobalActions$8$1;)V

    .line 399
    const-wide/16 v2, 0x1f4

    .line 391
    invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    .line 382
    return-void
.end method


text:
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { ModificarPerfilComponent } from './modificar-perfil.component';

describe('ModificarPerfilComponent', () => {
  let component: ModificarPerfilComponent;
  let fixture: ComponentFixture<ModificarPerfilComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ ModificarPerfilComponent ]
    })
    .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(ModificarPerfilComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });
});

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace modules\user\controllers;

use Yii;
use modules\user\models\Assignment;
use modules\user\models\search\Assignment as AssignmentSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;

/**
 * AssignmentController implements the CRUD actions for Assignment model.
 */
class AssignmentController extends Controller
{
    public $userClassName;
    public $idField = 'id';
    public $usernameField = 'username';
    public $fullnameField;
    public $searchClass;
    public $extraColumns = [];

    /**
     * @inheritdoc
     */
    public function init()
    {
        parent::init();
        if ($this->userClassName === null) {
            $this->userClassName = Yii::$app->getUser()->identityClass;
            $this->userClassName = $this->userClassName ? : 'modules\user\models\User';
        }
    }

    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'assign' => ['post'],
                    'revoke' => ['post'],
                ],
            ],
        ];
    }

    /**
     * Lists all Assignment models.
     * @return mixed
     */
    public function actionIndex()
    {

        if ($this->searchClass === null) {
            $searchModel = new AssignmentSearch;
            $dataProvider = $searchModel->search(Yii::$app->getRequest()->getQueryParams(), $this->userClassName, $this->usernameField);
        } else {
            $class = $this->searchClass;
            $searchModel = new $class;
            $dataProvider = $searchModel->search(Yii::$app->getRequest()->getQueryParams());
        }

        return $this->render('index', [
                'dataProvider' => $dataProvider,
                'searchModel' => $searchModel,
                'idField' => $this->idField,
                'usernameField' => $this->usernameField,
                'extraColumns' => $this->extraColumns,
        ]);
    }

    /**
     * Displays a single Assignment model.
     * @param  integer $id
     * @return mixed
     */
    public function actionView($id)
    {
        $model = $this->findModel($id);

        return $this->render('view', [
                'model' => $model,
                'idField' => $this->idField,
                'usernameField' => $this->usernameField,
                'fullnameField' => $this->fullnameField,
        ]);
    }

    /**
     * Assign items
     * @param string $id
     * @return array
     */
    public function actionAssign($id)
    {
        $items = Yii::$app->getRequest()->post('items', []);
        $model = new Assignment($id);
        $success = $model->assign($items);
        Yii::$app->getResponse()->format = 'json';

        return array_merge($model->getItems(), ['success' => $success]);
    }

    /**
     * Assign items
     * @param string $id
     * @return array
     */
    public function actionRevoke($id)
    {
        $items = Yii::$app->getRequest()->post('items', []);
        $model = new Assignment($id);
        $success = $model->revoke($items);
        Yii::$app->getResponse()->format = 'json';

        return array_merge($model->getItems(), ['success' => $success]);
    }

    /**
     * Finds the Assignment model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param  integer $id
     * @return Assignment the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id)
    {
        $class = $this->userClassName;
        if (($user = $class::findIdentity($id)) !== null) {
            return new Assignment($id, $user);
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
}


text:
.. _reference-index:

###################
Language Reference
###################

This is the reference guide for the Idris Language.
It documents the language specification and internals.
This will tell you how Idris works, for using it you should read the Idris Tutorial.

.. note::
   The documentation for Idris has been published under the Creative
   Commons CC0 License. As such to the extent possible under law, *The
   Idris Community* has waived all copyright and related or neighboring
   rights to Documentation for Idris.

   More information concerning the CC0 can be found online at: https://creativecommons.org/publicdomain/zero/1.0/

.. toctree::
   :maxdepth: 1

   codegen
   documenting
   packages
   uniqueness-types
   ffi
   syntax-guide
   syntax-reference
   erasure
   ide-protocol
   semantic-highlighting
   tactics
   repl
   compilation
   internals
   language-features
   language-extensions
   type-directed-search
   partial-evaluation
   misc


text:
package com.github.database.rider.core.model.lowercase;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;

@Entity
@Table(name = "\"user\"")
public class User {

    @Id
    @GeneratedValue
    @Column(name = "\"id\"")
    private long id;

    @Column(name = "\"name\"")
    private String name;

    @OneToMany(mappedBy = "user")
    private List<Tweet> tweets;

    @OneToMany(mappedBy = "followedUser")
    private List<Follower> followers;

    public User() {
    }

    public User(long id) {
        this.id = id;
    }

    public User(long id, String name, String tweetId, String tweetContent, Integer tweetLikes) {
        this.id = id;
        this.name = name;
        this.tweets = new ArrayList<>();
        Tweet tweet = new Tweet();
        tweet.setId(tweetId);
        tweet.setContent(tweetContent);
        tweet.setLikes(tweetLikes);
        tweets.add(tweet);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Tweet> getTweets() {
        return tweets;
    }

    public void setTweets(List<Tweet> tweets) {
        this.tweets = tweets;
    }

    public List<Follower> getFollowers() {
        return followers;
    }

    public void setFollowers(List<Follower> followers) {
        this.followers = followers;
    }

    public long getId() {
        return id;
    }

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

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        User user = (User) o;

        return id == user.id;

    }

    @Override
    public int hashCode() {
        return name != null ? name.hashCode() : (int) id;
    }
}


text:
package ee.risk.sbt.plugins.wsdl2java.wsdl

/**
 * Created by The Ranger (ranger@risk.ee) on 2016-08-17
 * for Baltnet Communications LLC (info@baltnet.ee)
 */
class WSDLException(message: String) extends Exception(message)


text:
#ifndef MAGICKCORE_CONFIGURE_H
#define MAGICKCORE_CONFIGURE_H

#include "magick/hashmap.h"

#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif

typedef struct _ConfigureInfo
{
  char
    *path,
    *name,
    *value;

  MagickBooleanType
    exempt,
    stealth;

  struct _ConfigureInfo
    *previous,
    *next;  /* deprecated, use GetConfigureInfoList() */

  size_t
    signature;
} ConfigureInfo;

extern MagickExport char
  **GetConfigureList(const char *,size_t *,ExceptionInfo *),
  *GetConfigureOption(const char *);

extern MagickExport const char
  *GetConfigureValue(const ConfigureInfo *);

extern MagickExport const ConfigureInfo
  *GetConfigureInfo(const char *,ExceptionInfo *),
  **GetConfigureInfoList(const char *,size_t *,ExceptionInfo *);

extern MagickExport LinkedListInfo
  *DestroyConfigureOptions(LinkedListInfo *),
  *GetConfigurePaths(const char *,ExceptionInfo *),
  *GetConfigureOptions(const char *,ExceptionInfo *);

extern MagickExport MagickBooleanType
  ConfigureComponentGenesis(void),
  ListConfigureInfo(FILE *,ExceptionInfo *);

extern MagickExport void
  ConfigureComponentTerminus(void);

#if defined(__cplusplus) || defined(c_plusplus)
}
#endif

#endif


text:
package com.twu.biblioteca.model;

import com.twu.biblioteca.model.Menu;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
 * Created by David on 21.05.17.
 */
public class MenuTest {

    @Test
    public void menuHasCorrectFormat() throws Exception {
        final String formattedMenu = new Menu().formatMenuItems();

        final String expectedFormat = "Choose an option from the menu below:\n" +
                "\n0: Log in" +
                "\n1: List Books" +
                "\n2: Check out <Book Title>. For example: 2 Alice in Wonderland" +
                "\n3: Check in <Book Title>. For example: 3 To Kill a Mockingbird" +
                "\n4: List Movies" +
                "\n5: Check out <Movie Title>. For example: 5 Blade Runner" +
                "\n6: Display user information" +
                "\nQ: Quit";

        assertEquals(expectedFormat, formattedMenu);
    }

}


text:
@import url("./css/main.css");
@import url("./css/header.css");
@import url("./css/portfolio.css");
@import url("./css/social.css");
@import url("./css/footer.css");


text:
class AddRequirementsBuildReference < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false
  INDEX_NAME = 'index_requirements_management_test_reports_on_build_id'

  def up
    add_column :requirements_management_test_reports, :build_id, :bigint
    add_index :requirements_management_test_reports, :build_id, name: INDEX_NAME # rubocop:disable Migration/AddIndex

    with_lock_retries do
      add_foreign_key :requirements_management_test_reports, :ci_builds, column: :build_id, on_delete: :nullify # rubocop:disable Migration/AddConcurrentForeignKey
    end
  end

  def down
    with_lock_retries do
      remove_column :requirements_management_test_reports, :build_id
    end
  end
end


text:
//-*- Mode: C++ -*-
// ************************************************************************
// This file is property of and copyright by the ALICE HLT Project        *
// ALICE Experiment at CERN, All rights reserved.                         *
// See cxx source for full Copyright notice                               *
//                                                                        *
//*************************************************************************

#ifndef ALIHLTTPCCANEIGHBOURSCLEANER_H
#define ALIHLTTPCCANEIGHBOURSCLEANER_H

#include "AliHLTTPCCADef.h"

MEM_CLASS_PRE() class AliHLTTPCCATracker;

/**
 * @class AliHLTTPCCANeighboursCleaner
 *
 */
class AliHLTTPCCANeighboursCleaner
{
  public:
    MEM_CLASS_PRE() class AliHLTTPCCASharedMemory
    {
        friend class AliHLTTPCCANeighboursCleaner;
      public:
#if !defined(HLTCA_GPUCODE)
        AliHLTTPCCASharedMemory()
            : fIRow( 0 ), fIRowUp( 0 ), fIRowDn( 0 ), fNRows( 0 ), fNHits( 0 ) {}
        AliHLTTPCCASharedMemory( const AliHLTTPCCASharedMemory& /*dummy*/ )
            : fIRow( 0 ), fIRowUp( 0 ), fIRowDn( 0 ), fNRows( 0 ), fNHits( 0 ) {}
        AliHLTTPCCASharedMemory& operator=( const AliHLTTPCCASharedMemory& /*dummy*/ ) { return *this; }
#endif //!HLTCA_GPUCODE

      protected:
        int fIRow; // current row index
        int fIRowUp; // current row index
        int fIRowDn; // current row index
        int fNRows; // number of rows
        int fNHits; // number of hits
    };

    GPUd() static int NThreadSyncPoints() { return 1; }

    GPUd() static void Thread( int /*nBlocks*/, int nThreads, int iBlock, int iThread, int iSync,
                               MEM_LOCAL(GPUsharedref() AliHLTTPCCASharedMemory) &smem,  MEM_CONSTANT(GPUconstant() AliHLTTPCCATracker) &tracker );
};

#endif //ALIHLTTPCCANEIGHBOURSCLEANER_H


text:
package com.intellij.java.codeInspection;

import com.intellij.JavaTestUtil;
import com.intellij.analysis.AnalysisScope;
import com.intellij.codeInsight.JavaCodeInsightTestCase;
import com.intellij.codeInsight.daemon.impl.DaemonProgressIndicator;
import com.intellij.codeInspection.*;
import com.intellij.codeInspection.actions.RunInspectionIntention;
import com.intellij.codeInspection.ex.*;
import com.intellij.codeInspection.reference.RefElement;
import com.intellij.codeInspection.reference.RefMethodImpl;
import com.intellij.codeInspection.ui.InspectionToolPresentation;
import com.intellij.codeInspection.visibility.VisibilityInspection;
import com.intellij.ide.highlighter.JavaFileType;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.WriteAction;
import com.intellij.openapi.fileTypes.PlainTextFileType;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.progress.util.ProgressWrapper;
import com.intellij.psi.*;
import com.intellij.testFramework.InspectionsKt;
import com.intellij.util.ui.UIUtil;
import org.intellij.lang.annotations.Language;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;

public class GlobalInspectionContextTest extends JavaCodeInsightTestCase {
  @Override
  public void setUp() throws Exception {
    super.setUp();
    InspectionProfileImpl.INIT_INSPECTIONS = true;
    ApplicationManager.getApplication().assertIsDispatchThread();
    assertFalse(ApplicationManager.getApplication().isWriteAccessAllowed());
  }

  @Override
  public void tearDown() throws Exception {
    InspectionProfileImpl.INIT_INSPECTIONS = false;
    super.tearDown();
  }

  @NotNull
  @Override
  protected String getTestDataPath() {
    return JavaTestUtil.getJavaTestDataPath() + "/inspection/globalContext/";
  }

  public void testProblemDuplication() throws Exception {
    String shortName = new VisibilityInspection().getShortName();
    InspectionProfileImpl profile = new InspectionProfileImpl("Foo");
    InspectionsKt.disableAllTools(profile);
    profile.enableTool(shortName, getProject());

    GlobalInspectionContextImpl context = ((InspectionManagerEx)InspectionManager.getInstance(getProject())).createNewGlobalContext();
    context.setExternalProfile(profile);
    configureByFile("Foo.java");

    AnalysisScope scope = new AnalysisScope(getFile());
    context.doInspections(scope);
    UIUtil.dispatchAllInvocationEvents(); // wait for launchInspections in invoke later

    Tools tools = context.getTools().get(shortName);
    GlobalInspectionToolWrapper toolWrapper = (GlobalInspectionToolWrapper)tools.getTool();
    InspectionToolPresentation presentation = context.getPresentation(toolWrapper);
    assertEquals(1, presentation.getProblemDescriptors().size());

    context.doInspections(scope);
    UIUtil.dispatchAllInvocationEvents(); // wait for launchInspections in invoke later

    tools = context.getTools().get(shortName);
    toolWrapper = (GlobalInspectionToolWrapper)tools.getTool();
    presentation = context.getPresentation(toolWrapper);
    assertEquals(1, presentation.getProblemDescriptors().size());
  }

  public void testBatchInspectionMustBeRunUnderDaemonProgressIndicatorToAvoidSpammingStatusBarWithIrrelevantMessages() throws Throwable {
    AtomicBoolean run = new AtomicBoolean();
    AtomicReference<Throwable> throwable = new AtomicReference<>();
    LocalInspectionTool tool = new LocalInspectionTool() {
      @Nls
      @NotNull
      @Override
      public String getGroupDisplayName() {
        return "fegna2";
      }

      @Nls
      @NotNull
      @Override
      public String getDisplayName() {
        return getGroupDisplayName();
      }

      @NotNull
      @Override
      public String getShortName() {
        return getGroupDisplayName();
      }

      @NotNull
      @Override
      public PsiElementVisitor buildVisitor(@NotNull ProblemsHolder holder, boolean isOnTheFly) {
        return new PsiElementVisitor() {
          @Override
          public void visitFile(@NotNull PsiFile file) {
            run.set(true);
            ProgressIndicator indicator = ProgressWrapper.unwrapAll(ProgressManager.getGlobalProgressIndicator());
            if (!(indicator instanceof DaemonProgressIndicator)) {
              throwable.set(new IllegalStateException("expected DaemonProgressIndicator but got: " + indicator +" "+indicator.getClass()));
            }
          }
        };
      }
    };
    InspectionProfileImpl profile = InspectionsKt.configureInspections(new InspectionProfileEntry[]{tool}, getProject(), getTestRootDisposable());

    GlobalInspectionContextImpl context = ((InspectionManagerEx)InspectionManager.getInstance(getProject())).createNewGlobalContext();
    context.setExternalProfile(profile);
    configureByText(PlainTextFileType.INSTANCE, "blah");

    AnalysisScope scope = new AnalysisScope(getFile());
    context.doInspections(scope);
    UIUtil.dispatchAllInvocationEvents(); // wait for launchInspections in invoke later

    assertTrue(run.get());
    if (throwable.get() != null) throw throwable.get();
  }

  public void testRunInspectionContext() {
    InspectionProfile profile = new InspectionProfileImpl("foo");
    List<InspectionToolWrapper<?, ?>> tools = profile.getInspectionTools(null);
    PsiFile file = createDummyFile("xx.txt", "xxx");
    for (InspectionToolWrapper<?, ?> toolWrapper : tools) {
      if (!toolWrapper.isEnabledByDefault()) {
        InspectionManagerEx instance = (InspectionManagerEx)InspectionManager.getInstance(myProject);
        GlobalInspectionContextImpl context = RunInspectionIntention.createContext(toolWrapper, instance, file);
        context.initializeTools(new ArrayList<>(), new ArrayList<>(), new ArrayList<>());
        assertEquals(1, context.getTools().size());
        return;
      }
    }
    fail("No disabled tools found: " + tools);
  }

  public void testJavaMethodExternalization() throws Exception {
    PsiFile file = createFile("Foo.java", """
      public class Foo {
          <T> void foo(T t) {
          }
      }""");
    GlobalInspectionContextImpl context = ((InspectionManagerEx)InspectionManager.getInstance(getProject())).createNewGlobalContext();
    context.setCurrentScope(new AnalysisScope(file));
    context.initializeTools(new ArrayList<>(), new ArrayList<>(), new ArrayList<>());
    PsiClass[] classes = ((PsiClassOwner)file).getClasses();
    PsiClass fooClass = classes[0];
    PsiMethod fooMethod = fooClass.findMethodsByName("foo", false)[0];
    RefElement refMethod = context.getRefManager().getReference(fooMethod);
    String externalName = refMethod.getExternalName();
    PsiMethod deserialized = RefMethodImpl.findPsiMethod(fooMethod.getManager(), externalName);
    assertEquals(deserialized, fooMethod);
  }

  public void testGlobalSimpleInspectionGetsInterruptedOnWriteActionStart() {
    AtomicBoolean inspectionStarted = new AtomicBoolean();
    AtomicBoolean doRunInspection = new AtomicBoolean(true);
    GlobalSimpleInspectionTool myTool = new GlobalSimpleInspectionTool() {
      @Override
      public void checkFile(@NotNull PsiFile file,
                            @NotNull InspectionManager manager,
                            @NotNull ProblemsHolder problemsHolder,
                            @NotNull GlobalInspectionContext globalContext,
                            @NotNull ProblemDescriptionsProcessor problemDescriptionsProcessor) {
        inspectionStarted.set(true);
        while (doRunInspection.get()) {
          ProgressManager.checkCanceled();
        }
        problemsHolder.registerProblem(manager.createProblemDescriptor(file, "Finished: "+getShortName(), (LocalQuickFix)null, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, true));
      }

      @NotNull
      @Override
      public String getShortName() {
        return "myTool";
      }

      @NotNull
      @Override
      public String getDisplayName() {
        return "A"+getShortName();
      }
    };
    String shortName = myTool.getShortName();
    InspectionProfileImpl profile = new InspectionProfileImpl("myTestProfile:"+getTestName(false));
    InspectionsKt.disableAllTools(profile);
    profile.addTool(getProject(), new GlobalInspectionToolWrapper(myTool), null);
    profile.enableTool(shortName, getProject());

    GlobalInspectionContextImpl context = ((InspectionManagerEx)InspectionManager.getInstance(getProject())).createNewGlobalContext();
    context.setExternalProfile(profile);
    @Language("JAVA")
    String text = "class Foo {}";
    configureByText(JavaFileType.INSTANCE, text);

    AnalysisScope scope = new AnalysisScope(getFile());
    //noinspection SSBasedInspection
    SwingUtilities.invokeLater(new Runnable() {
      @Override
      public void run() {
        if (!inspectionStarted.get()) {
          SwingUtilities.invokeLater(this);
          return;
        }

        inspectionStarted.set(false);
        WriteAction.run(() -> { });

        // have to restart
        while (!inspectionStarted.get()) {
          UIUtil.dispatchAllInvocationEvents();
        }

        doRunInspection.set(false);
      }
    });

    context.doInspections(scope);

    UIUtil.dispatchAllInvocationEvents();

    Tools tools = context.getTools().get(shortName);
    GlobalInspectionToolWrapper toolWrapper = (GlobalInspectionToolWrapper)tools.getTool();
    InspectionToolPresentation presentation = context.getPresentation(toolWrapper);
    CommonProblemDescriptor descriptor = assertOneElement(presentation.getProblemDescriptors());
    assertEquals("Finished: "+shortName, descriptor.getDescriptionTemplate());
  }
}


text:
#include <linux/ieee80211.h>
#include <net/cfg80211.h>
#include <net/mac80211.h>
#include "ieee80211_i.h"
#include "sta_info.h"
#include "wme.h"

static void ieee80211_send_refuse_measurement_request(struct ieee80211_sub_if_data *sdata,
					struct ieee80211_msrment_ie *request_ie,
					const u8 *da, const u8 *bssid,
					u8 dialog_token)
{
	struct ieee80211_local *local = sdata->local;
	struct sk_buff *skb;
	struct ieee80211_mgmt *msr_report;

	skb = dev_alloc_skb(sizeof(*msr_report) + local->hw.extra_tx_headroom +
				sizeof(struct ieee80211_msrment_ie));
	if (!skb)
		return;

	skb_reserve(skb, local->hw.extra_tx_headroom);
	msr_report = (struct ieee80211_mgmt *)skb_put(skb, 24);
	memset(msr_report, 0, 24);
	memcpy(msr_report->da, da, ETH_ALEN);
	memcpy(msr_report->sa, sdata->vif.addr, ETH_ALEN);
	memcpy(msr_report->bssid, bssid, ETH_ALEN);
	msr_report->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
						IEEE80211_STYPE_ACTION);

	skb_put(skb, 1 + sizeof(msr_report->u.action.u.measurement));
	msr_report->u.action.category = WLAN_CATEGORY_SPECTRUM_MGMT;
	msr_report->u.action.u.measurement.action_code =
				WLAN_ACTION_SPCT_MSR_RPRT;
	msr_report->u.action.u.measurement.dialog_token = dialog_token;

	msr_report->u.action.u.measurement.element_id = WLAN_EID_MEASURE_REPORT;
	msr_report->u.action.u.measurement.length =
			sizeof(struct ieee80211_msrment_ie);

	memset(&msr_report->u.action.u.measurement.msr_elem, 0,
		sizeof(struct ieee80211_msrment_ie));
	msr_report->u.action.u.measurement.msr_elem.token = request_ie->token;
	msr_report->u.action.u.measurement.msr_elem.mode |=
			IEEE80211_SPCT_MSR_RPRT_MODE_REFUSED;
	msr_report->u.action.u.measurement.msr_elem.type = request_ie->type;

	ieee80211_tx_skb(sdata, skb);
}

void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata,
				       struct ieee80211_mgmt *mgmt,
				       size_t len)
{
	/*
	 * Ignoring measurement request is spec violation.
	 * Mandatory measurements must be reported optional
	 * measurements might be refused or reported incapable
	 * For now just refuse
	 * TODO: Answer basic measurement as unmeasured
	 */
	ieee80211_send_refuse_measurement_request(sdata,
			&mgmt->u.action.u.measurement.msr_elem,
			mgmt->sa, mgmt->bssid,
			mgmt->u.action.u.measurement.dialog_token);
}


text:
package org.pathvisio.core.preferences;

/**
 * A preference must have at least two things:
 *

 *
a key in the hash maintained by PreferenceMgr
 *
a default value
 *

 * Anything that implements this interface can be stored as a preference.
 * We recommend defining mulitple Preferences in an enum, but that is not absolutely
 * required.
 */
public interface Preference
{
	/** name will be the "key" in the properties file.
	 * If you use an enum that implements this interface, name will be automatically defined  */
	public String name();

	/**
	 * The default value for this property. Used to initialize when the key is not
	 * present in the properties file, or if the user wants to reset to default values.
	 */
	public String getDefault();
}


text:
package com.ul.biz.waimai.service.impl;

import com.ul.biz.waimai.mapper.WmOrderInfoMapper;
import com.ul.biz.waimai.model.WmOrderInfo;
import com.ul.biz.waimai.service.WmOrderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WmOrderInfoServiceImpl implements WmOrderInfoService{

    @Autowired
    private WmOrderInfoMapper wmOrderInfoMapper;

    @Override
    public int insert(WmOrderInfo record) {
        return 0;
    }

    @Override
    public List<WmOrderInfo> selectAll() {
        return wmOrderInfoMapper.selectAll();
    }

    @Override
    public WmOrderInfo findOrderInfoById(String orderId) {
        return wmOrderInfoMapper.findOrderInfoByOrderId(orderId);
    }
}


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace GSoft.Dynamite.Monitoring
{
    /// <summary>
    /// Time tracking scope
    /// </summary>
    public class TimeTrackerScope : IDisposable
    {
        private string aggregateKey;
        private IAggregateTimeTracker parentAggregator;
        private Stopwatch stopWatch;

        /// <summary>
        /// Starts a time profiling scope for the specified key.
        /// </summary>
        /// <param name="aggregateKey">The key of the time aggregate we should be adding to while profiling</param>
        /// <param name="parentAggregator">The parent time aggregator</param>
        public TimeTrackerScope(string aggregateKey, IAggregateTimeTracker parentAggregator)
        {
            this.aggregateKey = aggregateKey;
            this.parentAggregator = parentAggregator;
            this.stopWatch = new Stopwatch();
            this.stopWatch.Start();
        }

        /// <summary>
        /// Stops time tracking for the scope
        /// </summary>
        public void Dispose()
        {
            this.Dispose(true);
            GC.SuppressFinalize(this);
        }

        /// <summary>
        /// Stops time tracking for the scope
        /// </summary>
        /// <param name="cleanupBothManagedAndNative">Time tracker is stopped, regardless of this parameter's value.</param>
        protected virtual void Dispose(bool cleanupBothManagedAndNative)
        {
            this.stopWatch.Stop();
            this.parentAggregator.AddTimeSpanToAggregateTimeSpentForKey(this.aggregateKey, this.stopWatch.Elapsed);
        }
    }
}


text:
from django.db import models
import datetime

import logging
logger = logging.getLogger(__name__)

TRANSFER_STATUS_RUNNING=1
TRANSFER_STATUS_SUCCESS=2
TRANSFER_STATUS_FAILED=3
TRANSFER_STATUS_PARTIAL=4
TRANSFER_STATUS = (
  (TRANSFER_STATUS_RUNNING, "Running"),
  (TRANSFER_STATUS_FAILED, "Failed"),
  (TRANSFER_STATUS_SUCCESS, "Complete"),
  (TRANSFER_STATUS_PARTIAL, "Partial Import"),
)

TRANSFER_NOTE_STATUS_NOTE = "note"
TRANSFER_NOTE_STATUS_ERROR = "error"
TRANSFER_NOTE_STATUS_WARNING = "warning"
TRANSFER_NOTE_STATUS = (
 (TRANSFER_NOTE_STATUS_NOTE, "Note"),
 (TRANSFER_NOTE_STATUS_ERROR, "Error"),
 (TRANSFER_NOTE_STATUS_WARNING, "Warning"),
)

class InputRecordManager(models.Manager):

    def make_note(self, input_record, note, type, exception=None):
        ir = InputNote(note=note, type=type)
        ir.input_record = input_record
        ir.exception = exception
        getattr(logger, {'note':'info', 'error':'error', 'warning':'warning'}.get(type, 'debug'))("Transfer Note %s" % vars(ir))
        #print "Transfer Note", vars(ir)
        ir.save()

    def end_import(self, input_record, status=None):
        if status:
            input_record.status = status
        input_record.end = datetime.datetime.now()
        input_record.save()

class InputRecord(models.Model):
    start = models.DateTimeField(auto_now_add=True)
    end = models.DateTimeField(blank=True, null=True)
    type = models.CharField(max_length=64, blank=True, null=True)
    exception = models.CharField(max_length=128, blank=True, null=True)
    status = models.IntegerField(choices=TRANSFER_STATUS, default=TRANSFER_STATUS_RUNNING)

    objects = InputRecordManager()

    def __unicode__(self):
        return "%s" % self.start

    def get_notes(self):
        return self.inputnote_set.all()

    def get_errors(self):
        return self.get_notes().filter(type=TRANSFER_NOTE_STATUS_ERROR)

    def get_num_errors(self):
        return self.get_errors().count()
    get_num_errors.short_description = "Errors"

    def get_warnings(self):
        return self.get_notes().filter(type=TRANSFER_NOTE_STATUS_WARNING)

    def get_num_warnings(self):
        return self.get_warnings().count()
    get_num_warnings.short_description = "Warnings"

class InputNote(models.Model):
    input_record = models.ForeignKey(InputRecord)
    note = models.TextField(blank=True, null=True)
    exception = models.CharField(max_length=128, blank=True, null=True)
    created = models.DateTimeField(auto_now_add=True)
    type = models.CharField(choices=TRANSFER_NOTE_STATUS, max_length=24)

    def __unicode__(self):
        return "%s" % self.created


text:
namespace {

#if defined(OS_CHROMEOS)
bool IsPrivilegedCrosSetting(const std::string& pref_name) {
  if (!chromeos::CrosSettings::IsCrosSettings(pref_name))
    return false;
  // kSystemTimezone should be changeable by all users.
  if (pref_name == chromeos::kSystemTimezone)
    return false;
  // All other Cros settings are considered privileged and are either policy
  // controlled or owner controlled.
  return true;
}
#endif

}  // namespace

namespace extensions {

namespace settings_private = api::settings_private;

PrefsUtil::PrefsUtil(Profile* profile) : profile_(profile) {}

PrefsUtil::~PrefsUtil() {}

#if defined(OS_CHROMEOS)
using CrosSettings = chromeos::CrosSettings;
#endif

const PrefsUtil::TypedPrefMap& PrefsUtil::GetWhitelistedKeys() {
  static PrefsUtil::TypedPrefMap* s_whitelist = nullptr;
  if (s_whitelist)
    return *s_whitelist;
  s_whitelist = new PrefsUtil::TypedPrefMap();

  // Miscellaneous
  (*s_whitelist)[::prefs::kAlternateErrorPagesEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[autofill::prefs::kAutofillEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[bookmarks::prefs::kShowBookmarkBar] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
  (*s_whitelist)[::prefs::kUseCustomChromeFrame] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
#endif
  (*s_whitelist)[::prefs::kShowHomeButton] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;

  // Appearance settings.
  (*s_whitelist)[::prefs::kCurrentThemeID] =
      settings_private::PrefType::PREF_TYPE_STRING;
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
  (*s_whitelist)[::prefs::kUsesSystemTheme] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
#endif
  (*s_whitelist)[::prefs::kHomePage] =
      settings_private::PrefType::PREF_TYPE_URL;
  (*s_whitelist)[::prefs::kHomePageIsNewTabPage] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kWebKitDefaultFixedFontSize] =
      settings_private::PrefType::PREF_TYPE_NUMBER;
  (*s_whitelist)[::prefs::kWebKitDefaultFontSize] =
      settings_private::PrefType::PREF_TYPE_NUMBER;
  (*s_whitelist)[::prefs::kWebKitMinimumFontSize] =
      settings_private::PrefType::PREF_TYPE_NUMBER;
  (*s_whitelist)[::prefs::kWebKitFixedFontFamily] =
      settings_private::PrefType::PREF_TYPE_STRING;
  (*s_whitelist)[::prefs::kWebKitSansSerifFontFamily] =
      settings_private::PrefType::PREF_TYPE_STRING;
  (*s_whitelist)[::prefs::kWebKitSerifFontFamily] =
      settings_private::PrefType::PREF_TYPE_STRING;
  (*s_whitelist)[::prefs::kWebKitStandardFontFamily] =
      settings_private::PrefType::PREF_TYPE_STRING;
  (*s_whitelist)[::prefs::kDefaultCharset] =
      settings_private::PrefType::PREF_TYPE_STRING;

  // On startup.
  (*s_whitelist)[::prefs::kRestoreOnStartup] =
      settings_private::PrefType::PREF_TYPE_NUMBER;
  (*s_whitelist)[::prefs::kURLsToRestoreOnStartup] =
      settings_private::PrefType::PREF_TYPE_LIST;

  // Downloads settings.
  (*s_whitelist)[::prefs::kDownloadDefaultDirectory] =
      settings_private::PrefType::PREF_TYPE_STRING;
  (*s_whitelist)[::prefs::kPromptForDownload] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[drive::prefs::kDisableDrive] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;

  // Printing settings.
  (*s_whitelist)[::prefs::kLocalDiscoveryNotificationsEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;

  // Miscellaneous. TODO(stevenjb): categorize.
  (*s_whitelist)[::prefs::kEnableDoNotTrack] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kApplicationLocale] =
      settings_private::PrefType::PREF_TYPE_STRING;
  (*s_whitelist)[::prefs::kNetworkPredictionOptions] =
      settings_private::PrefType::PREF_TYPE_NUMBER;
  (*s_whitelist)[password_manager::prefs::kPasswordManagerSavingEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[password_manager::prefs::kCredentialsEnableAutosignin] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kSafeBrowsingEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kSafeBrowsingExtendedReportingEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kSearchSuggestEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[spellcheck::prefs::kSpellCheckDictionaries] =
      settings_private::PrefType::PREF_TYPE_LIST;
  (*s_whitelist)[spellcheck::prefs::kSpellCheckUseSpellingService] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kEnableTranslate] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[translate::TranslatePrefs::kPrefTranslateBlockedLanguages] =
      settings_private::PrefType::PREF_TYPE_LIST;

  // Search page.
  (*s_whitelist)[::prefs::kDefaultSearchProviderEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;

  // Site Settings prefs.
  (*s_whitelist)[::prefs::kBlockThirdPartyCookies] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kPluginsAlwaysOpenPdfExternally] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;

  // Clear browsing data settings.
  (*s_whitelist)[browsing_data::prefs::kDeleteBrowsingHistory] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[browsing_data::prefs::kDeleteDownloadHistory] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[browsing_data::prefs::kDeleteCache] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[browsing_data::prefs::kDeleteCookies] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[browsing_data::prefs::kDeletePasswords] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[browsing_data::prefs::kDeleteFormData] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[browsing_data::prefs::kDeleteHostedAppsData] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[browsing_data::prefs::kDeleteMediaLicenses] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[browsing_data::prefs::kDeleteTimePeriod] =
      settings_private::PrefType::PREF_TYPE_NUMBER;

#if defined(OS_CHROMEOS)
  // Accounts / Users / People.
  (*s_whitelist)[chromeos::kAccountsPrefAllowGuest] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[chromeos::kAccountsPrefSupervisedUsersEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[chromeos::kAccountsPrefShowUserNamesOnSignIn] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[chromeos::kAccountsPrefAllowNewUser] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[chromeos::kAccountsPrefUsers] =
      settings_private::PrefType::PREF_TYPE_LIST;
  (*s_whitelist)[::prefs::kEnableAutoScreenLock] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;

  // Accessibility.
  (*s_whitelist)[::prefs::kAccessibilitySpokenFeedbackEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kAccessibilityAutoclickEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kAccessibilityAutoclickDelayMs] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kAccessibilityCaretHighlightEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kAccessibilityCursorHighlightEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kShouldAlwaysShowAccessibilityMenu] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kAccessibilityFocusHighlightEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kAccessibilityHighContrastEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kAccessibilityLargeCursorEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kAccessibilityScreenMagnifierEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kAccessibilitySelectToSpeakEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kAccessibilityStickyKeysEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kAccessibilitySwitchAccessEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kAccessibilityVirtualKeyboardEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kAccessibilityMonoAudioEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;

  // Misc.
  (*s_whitelist)[::prefs::kUse24HourClock] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kLanguagePreferredLanguages] =
      settings_private::PrefType::PREF_TYPE_STRING;
  (*s_whitelist)[::prefs::kTapDraggingEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[chromeos::kStatsReportingPref] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[chromeos::kAttestationForContentProtectionEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;

  // Bluetooth & Internet settings.
  (*s_whitelist)[chromeos::kAllowBluetooth] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[proxy_config::prefs::kUseSharedProxies] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kWakeOnWifiDarkConnect] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;

  // Timezone settings.
  (*s_whitelist)[chromeos::kSystemTimezone] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kResolveTimezoneByGeolocation] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;

  // Ash settings.
  (*s_whitelist)[::prefs::kEnableStylusTools] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kLaunchPaletteOnEjectEvent] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;

  // Input method settings.
  (*s_whitelist)[::prefs::kLanguagePreloadEngines] =
      settings_private::PrefType::PREF_TYPE_STRING;
  (*s_whitelist)[::prefs::kLanguageEnabledExtensionImes] =
      settings_private::PrefType::PREF_TYPE_STRING;

  // Device settings.
  (*s_whitelist)[::prefs::kTapToClickEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kNaturalScroll] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kTouchpadSensitivity] =
      settings_private::PrefType::PREF_TYPE_NUMBER;
  (*s_whitelist)[::prefs::kPrimaryMouseButtonRight] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kMouseSensitivity] =
      settings_private::PrefType::PREF_TYPE_NUMBER;
  (*s_whitelist)[::prefs::kLanguageRemapSearchKeyTo] =
      settings_private::PrefType::PREF_TYPE_NUMBER;
  (*s_whitelist)[::prefs::kLanguageRemapControlKeyTo] =
      settings_private::PrefType::PREF_TYPE_NUMBER;
  (*s_whitelist)[::prefs::kLanguageRemapAltKeyTo] =
      settings_private::PrefType::PREF_TYPE_NUMBER;
  (*s_whitelist)[::prefs::kLanguageRemapCapsLockKeyTo] =
      settings_private::PrefType::PREF_TYPE_NUMBER;
  (*s_whitelist)[::prefs::kLanguageRemapBackspaceKeyTo] =
      settings_private::PrefType::PREF_TYPE_NUMBER;
  (*s_whitelist)[::prefs::kLanguageRemapEscapeKeyTo] =
      settings_private::PrefType::PREF_TYPE_NUMBER;
  (*s_whitelist)[::prefs::kLanguageRemapDiamondKeyTo] =
      settings_private::PrefType::PREF_TYPE_NUMBER;
  (*s_whitelist)[::prefs::kLanguageSendFunctionKeys] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kLanguageXkbAutoRepeatEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kLanguageXkbAutoRepeatDelay] =
      settings_private::PrefType::PREF_TYPE_NUMBER;
  (*s_whitelist)[::prefs::kLanguageXkbAutoRepeatInterval] =
      settings_private::PrefType::PREF_TYPE_NUMBER;
#else
  (*s_whitelist)[::prefs::kAcceptLanguages] =
      settings_private::PrefType::PREF_TYPE_STRING;

  // System settings.
  (*s_whitelist)[::prefs::kBackgroundModeEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kHardwareAccelerationModeEnabled] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;

  // Import data
  (*s_whitelist)[::prefs::kImportAutofillFormData] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kImportBookmarks] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kImportHistory] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kImportSavedPasswords] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
  (*s_whitelist)[::prefs::kImportSearchEngine] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
#endif

  // Proxy settings.
  (*s_whitelist)[proxy_config::prefs::kProxy] =
      settings_private::PrefType::PREF_TYPE_DICTIONARY;

#if defined(GOOGLE_CHROME_BUILD)
  (*s_whitelist)[::prefs::kMediaRouterEnableCloudServices] =
      settings_private::PrefType::PREF_TYPE_BOOLEAN;
#endif  // defined(GOOGLE_CHROME_BUILD)

  return *s_whitelist;
}

settings_private::PrefType PrefsUtil::GetType(const std::string& name,
                                              base::Value::Type type) {
  switch (type) {
    case base::Value::Type::TYPE_BOOLEAN:
      return settings_private::PrefType::PREF_TYPE_BOOLEAN;
    case base::Value::Type::TYPE_INTEGER:
    case base::Value::Type::TYPE_DOUBLE:
      return settings_private::PrefType::PREF_TYPE_NUMBER;
    case base::Value::Type::TYPE_STRING:
      return IsPrefTypeURL(name) ? settings_private::PrefType::PREF_TYPE_URL
                                 : settings_private::PrefType::PREF_TYPE_STRING;
    case base::Value::Type::TYPE_LIST:
      return settings_private::PrefType::PREF_TYPE_LIST;
    case base::Value::Type::TYPE_DICTIONARY:
      return settings_private::PrefType::PREF_TYPE_DICTIONARY;
    default:
      return settings_private::PrefType::PREF_TYPE_NONE;
  }
}

std::unique_ptr<settings_private::PrefObject> PrefsUtil::GetCrosSettingsPref(
    const std::string& name) {
  std::unique_ptr<settings_private::PrefObject> pref_object(
      new settings_private::PrefObject());

#if defined(OS_CHROMEOS)
  const base::Value* value = CrosSettings::Get()->GetPref(name);
  DCHECK(value) << "Pref not found: " << name;
  pref_object->key = name;
  pref_object->type = GetType(name, value->GetType());
  pref_object->value.reset(value->DeepCopy());
#endif

  return pref_object;
}

std::unique_ptr<settings_private::PrefObject> PrefsUtil::GetPref(
    const std::string& name) {
  const PrefService::Preference* pref = nullptr;
  std::unique_ptr<settings_private::PrefObject> pref_object;
  if (IsCrosSetting(name)) {
    pref_object = GetCrosSettingsPref(name);
  } else {
    PrefService* pref_service = FindServiceForPref(name);
    pref = pref_service->FindPreference(name);
    if (!pref)
      return nullptr;
    pref_object.reset(new settings_private::PrefObject());
    pref_object->key = pref->name();
    pref_object->type = GetType(name, pref->GetType());
    pref_object->value.reset(pref->GetValue()->DeepCopy());
  }

#if defined(OS_CHROMEOS)
  if (IsPrefPrimaryUserControlled(name)) {
    pref_object->controlled_by =
        settings_private::ControlledBy::CONTROLLED_BY_PRIMARY_USER;
    pref_object->enforcement =
        settings_private::Enforcement::ENFORCEMENT_ENFORCED;
    pref_object->controlled_by_name.reset(
        new std::string(user_manager::UserManager::Get()
                            ->GetPrimaryUser()
                            ->GetAccountId()
                            .GetUserEmail()));
    return pref_object;
  }

  if (IsPrefEnterpriseManaged(name)) {
    // Enterprise managed prefs are treated the same as device policy restricted
    // prefs in the UI.
    pref_object->controlled_by =
        settings_private::ControlledBy::CONTROLLED_BY_DEVICE_POLICY;
    pref_object->enforcement =
        settings_private::Enforcement::ENFORCEMENT_ENFORCED;
    return pref_object;
  }
#endif

  if (pref && pref->IsManaged()) {
    pref_object->controlled_by =
        settings_private::ControlledBy::CONTROLLED_BY_USER_POLICY;
    pref_object->enforcement =
        settings_private::Enforcement::ENFORCEMENT_ENFORCED;
    return pref_object;
  }

  if (pref && pref->IsRecommended()) {
    pref_object->controlled_by =
        settings_private::ControlledBy::CONTROLLED_BY_USER_POLICY;
    pref_object->enforcement =
        settings_private::Enforcement::ENFORCEMENT_RECOMMENDED;
    pref_object->recommended_value.reset(
        pref->GetRecommendedValue()->DeepCopy());
    return pref_object;
  }

#if defined(OS_CHROMEOS)
  if (IsPrefOwnerControlled(name)) {
    // Check for owner controlled after managed checks because if there is a
    // device policy there is no "owner". (In the unlikely case that both
    // situations apply, either badge is potentially relevant, so the order
    // is somewhat arbitrary).
    pref_object->controlled_by =
        settings_private::ControlledBy::CONTROLLED_BY_OWNER;
    pref_object->enforcement =
        settings_private::Enforcement::ENFORCEMENT_ENFORCED;
    pref_object->controlled_by_name.reset(new std::string(
        user_manager::UserManager::Get()->GetOwnerAccountId().GetUserEmail()));
    return pref_object;
  }
#endif

  const Extension* extension = GetExtensionControllingPref(*pref_object);
  if (extension) {
    pref_object->controlled_by =
        settings_private::ControlledBy::CONTROLLED_BY_EXTENSION;
    pref_object->enforcement =
        settings_private::Enforcement::ENFORCEMENT_ENFORCED;
    pref_object->extension_id.reset(new std::string(extension->id()));
    pref_object->controlled_by_name.reset(new std::string(extension->name()));
    bool can_be_disabled = !ExtensionSystem::Get(profile_)->management_policy()
        ->MustRemainEnabled(extension, nullptr);
    pref_object->extension_can_be_disabled.reset(new bool(can_be_disabled));
    return pref_object;
  }

  // TODO(dbeam): surface !IsUserModifiable or IsPrefSupervisorControlled?

  return pref_object;
}

PrefsUtil::SetPrefResult PrefsUtil::SetPref(const std::string& pref_name,
                                            const base::Value* value) {
  if (IsCrosSetting(pref_name))
    return SetCrosSettingsPref(pref_name, value);

  PrefService* pref_service = FindServiceForPref(pref_name);

  if (!IsPrefUserModifiable(pref_name))
    return PREF_NOT_MODIFIABLE;

  const PrefService::Preference* pref = pref_service->FindPreference(pref_name);
  if (!pref)
    return PREF_NOT_FOUND;

  DCHECK_EQ(pref->GetType(), value->GetType());

  switch (pref->GetType()) {
    case base::Value::TYPE_BOOLEAN:
    case base::Value::TYPE_DOUBLE:
    case base::Value::TYPE_LIST:
    case base::Value::TYPE_DICTIONARY:
      pref_service->Set(pref_name, *value);
      break;
    case base::Value::TYPE_INTEGER: {
      // In JS all numbers are doubles.
      double double_value;
      if (!value->GetAsDouble(&double_value))
        return PREF_TYPE_MISMATCH;

      pref_service->SetInteger(pref_name, static_cast<int>(double_value));
      break;
    }
    case base::Value::TYPE_STRING: {
      std::string string_value;
      if (!value->GetAsString(&string_value))
        return PREF_TYPE_MISMATCH;

      if (IsPrefTypeURL(pref_name)) {
        GURL fixed = url_formatter::FixupURL(string_value, std::string());
        if (fixed.is_valid())
          string_value = fixed.spec();
        else
          string_value = std::string();
      }

      pref_service->SetString(pref_name, string_value);
      break;
    }
    default:
      return PREF_TYPE_UNSUPPORTED;
  }

  // TODO(orenb): Process setting metrics here and in the CrOS setting method
  // too (like "ProcessUserMetric" in CoreOptionsHandler).
  return SUCCESS;
}

PrefsUtil::SetPrefResult PrefsUtil::SetCrosSettingsPref(
    const std::string& pref_name, const base::Value* value) {
#if defined(OS_CHROMEOS)
  chromeos::OwnerSettingsServiceChromeOS* service =
      chromeos::OwnerSettingsServiceChromeOSFactory::GetForBrowserContext(
          profile_);

  // Check if setting requires owner.
  if (service && service->HandlesSetting(pref_name)) {
    if (service->Set(pref_name, *value))
      return SUCCESS;
    return PREF_NOT_MODIFIABLE;
  }

  CrosSettings::Get()->Set(pref_name, *value);
  return SUCCESS;
#else
  return PREF_NOT_FOUND;
#endif
}

bool PrefsUtil::AppendToListCrosSetting(const std::string& pref_name,
                                        const base::Value& value) {
#if defined(OS_CHROMEOS)
  chromeos::OwnerSettingsServiceChromeOS* service =
      chromeos::OwnerSettingsServiceChromeOSFactory::GetForBrowserContext(
          profile_);

  // Returns false if not the owner, for settings requiring owner.
  if (service && service->HandlesSetting(pref_name)) {
    return service->AppendToList(pref_name, value);
  }

  CrosSettings::Get()->AppendToList(pref_name, &value);
  return true;
#else
  return false;
#endif
}

bool PrefsUtil::RemoveFromListCrosSetting(const std::string& pref_name,
                                          const base::Value& value) {
#if defined(OS_CHROMEOS)
  chromeos::OwnerSettingsServiceChromeOS* service =
      chromeos::OwnerSettingsServiceChromeOSFactory::GetForBrowserContext(
          profile_);

  // Returns false if not the owner, for settings requiring owner.
  if (service && service->HandlesSetting(pref_name)) {
    return service->RemoveFromList(pref_name, value);
  }

  CrosSettings::Get()->RemoveFromList(pref_name, &value);
  return true;
#else
  return false;
#endif
}

bool PrefsUtil::IsPrefTypeURL(const std::string& pref_name) {
  settings_private::PrefType pref_type =
      settings_private::PrefType::PREF_TYPE_NONE;

  const TypedPrefMap keys = GetWhitelistedKeys();
  const auto& iter = keys.find(pref_name);
  if (iter != keys.end())
    pref_type = iter->second;

  return pref_type == settings_private::PrefType::PREF_TYPE_URL;
}

#if defined(OS_CHROMEOS)
bool PrefsUtil::IsPrefEnterpriseManaged(const std::string& pref_name) {
  if (IsPrivilegedCrosSetting(pref_name)) {
    policy::BrowserPolicyConnectorChromeOS* connector =
        g_browser_process->platform_part()->browser_policy_connector_chromeos();
    if (connector->IsEnterpriseManaged())
      return true;
  }
  return false;
}

bool PrefsUtil::IsPrefOwnerControlled(const std::string& pref_name) {
  if (IsPrivilegedCrosSetting(pref_name)) {
    if (!chromeos::ProfileHelper::IsOwnerProfile(profile_))
      return true;
  }
  return false;
}

bool PrefsUtil::IsPrefPrimaryUserControlled(const std::string& pref_name) {
  if (pref_name == prefs::kWakeOnWifiDarkConnect) {
    user_manager::UserManager* user_manager = user_manager::UserManager::Get();
    const user_manager::User* user =
        chromeos::ProfileHelper::Get()->GetUserByProfile(profile_);
    if (user &&
        user->GetAccountId() != user_manager->GetPrimaryUser()->GetAccountId())
      return true;
  }
  return false;
}
#endif

bool PrefsUtil::IsPrefSupervisorControlled(const std::string& pref_name) {
  if (pref_name != prefs::kBrowserGuestModeEnabled &&
      pref_name != prefs::kBrowserAddPersonEnabled) {
    return false;
  }
  return profile_->IsSupervised();
}

bool PrefsUtil::IsPrefUserModifiable(const std::string& pref_name) {
  const PrefService::Preference* profile_pref =
      profile_->GetPrefs()->FindPreference(pref_name);
  if (profile_pref)
    return profile_pref->IsUserModifiable();

  const PrefService::Preference* local_state_pref =
      g_browser_process->local_state()->FindPreference(pref_name);
  if (local_state_pref)
    return local_state_pref->IsUserModifiable();

  return false;
}

PrefService* PrefsUtil::FindServiceForPref(const std::string& pref_name) {
  PrefService* user_prefs = profile_->GetPrefs();

  // Proxy is a peculiar case: on ChromeOS, settings exist in both user
  // prefs and local state, but chrome://settings should affect only user prefs.
  // Elsewhere the proxy settings are stored in local state.
  // See http://crbug.com/157147

  if (pref_name == proxy_config::prefs::kProxy) {
#if defined(OS_CHROMEOS)
    return user_prefs;
#else
    return g_browser_process->local_state();
#endif
  }

  // Find which PrefService contains the given pref. Pref names should not
  // be duplicated across services, however if they are, prefer the user's
  // prefs.
  if (user_prefs->FindPreference(pref_name))
    return user_prefs;

  if (g_browser_process->local_state()->FindPreference(pref_name))
    return g_browser_process->local_state();

  return user_prefs;
}

bool PrefsUtil::IsCrosSetting(const std::string& pref_name) {
#if defined(OS_CHROMEOS)
  return CrosSettings::Get()->IsCrosSettings(pref_name);
#else
  return false;
#endif
}

const Extension* PrefsUtil::GetExtensionControllingPref(
    const settings_private::PrefObject& pref_object) {
  // Look for specific prefs that might be extension controlled. This generally
  // corresponds with some indiciator that should be shown in the settings UI.
  if (pref_object.key == ::prefs::kHomePage)
    return GetExtensionOverridingHomepage(profile_);

  if (pref_object.key == ::prefs::kRestoreOnStartup) {
    int restore_on_startup;
    CHECK(pref_object.value->GetAsInteger(&restore_on_startup));

    if (restore_on_startup == SessionStartupPref::kPrefValueURLs)
      return GetExtensionOverridingStartupPages(profile_);
  }

  if (pref_object.key == ::prefs::kURLsToRestoreOnStartup)
    return GetExtensionOverridingStartupPages(profile_);

  if (pref_object.key == ::prefs::kDefaultSearchProviderEnabled)
    return GetExtensionOverridingSearchEngine(profile_);

  if (pref_object.key == proxy_config::prefs::kProxy)
    return GetExtensionOverridingProxy(profile_);

  return nullptr;
}

}  // namespace extensions


text:
package spec

import (
	"encoding/json"
	"fmt"
	"time"

	"k8s.io/client-go/pkg/api/v1"
)

const (
	defaultVersion = "1.0.0-alpha"

	TPRGroup   = "fabric.hyperledger.org"
	TPRVersion = "v1beta1"
)

// PodPolicy defines the policy to create pod for the member container.
type PodPolicy struct {
	// NodeSelector specifies a map of key-value pairs. For the pod to be eligible
	// to run on a node, the node must have each of the indicated key-value pairs as
	// labels.
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`

	// AntiAffinity determines if the etcd-operator tries to avoid putting
	// the fabric members in the same cluster onto the same node.
	AntiAffinity bool `json:"antiAffinity"`

	// Resources is the resource requirements for the member container.
	// This field cannot be updated once the cluster is created.
	Resources v1.ResourceRequirements `json:"resources"`
}

type ClusterSpec struct {
	// Version is the expected version of the peer cluster.
	// The operator will eventually make the peer cluster version
	// equal to the expected version.
	//
	// The version must follow the [semver]( http://semver.org) format, for example "3.1.4".
	// Only fabric released versions are supported: https://github.com/hyperledger/fabric/releases
	//
	// If version is not set, latest version used.
	Version string `json:"version"`

	// Paused is to pause the control of the operator for the peer cluster.
	Paused bool `json:"paused,omitempty"`

	// Pod defines the policy to create pod for the peer container.
	Pod *PodPolicy `json:"pod,omitempty"`
}

type ClusterPhase string

const (
	ClusterPhaseNone     ClusterPhase = ""
	ClusterPhaseCreating              = "Creating"
	ClusterPhaseRunning               = "Running"
	ClusterPhaseFailed                = "Failed"
)

type ClusterCondition struct {
	Type ClusterConditionType `json:"type"`

	Reason string `json:"reason"`

	TransitionTime string `json:"transitionTime"`
}

type ClusterConditionType string

const (
	ClusterConditionReady = "Ready"

	ClusterConditionRemovingDeadMember = "RemovingDeadMember"

	ClusterConditionRecovering = "Recovering"

	ClusterConditionScalingUp   = "ScalingUp"
	ClusterConditionScalingDown = "ScalingDown"

	ClusterConditionUpgrading = "Upgrading"
)

type ClusterStatus struct {
	// Phase is the cluster running phase
	Phase  ClusterPhase `json:"phase"`
	Reason string       `json:"reason"`

	// ControlPuased indicates the operator pauses the control of the cluster.
	ControlPaused bool `json:"controlPaused"`

	// Condition keeps ten most recent cluster conditions
	Conditions []ClusterCondition `json:"conditions"`

	// Size is the current size of the cluster
	Size int `json:"size"`
	// Members are the etcd members in the cluster
	Members MembersStatus `json:"members"`
	// CurrentVersion is the current cluster version
	CurrentVersion string `json:"currentVersion"`
	// TargetVersion is the version the cluster upgrading to.
	// If the cluster is not upgrading, TargetVersion is empty.
	TargetVersion string `json:"targetVersion"`
}

type MembersStatus struct {
	// Ready are the etcd members that are ready to serve requests
	// The member names are the same as the etcd pod names
	Ready []string `json:"ready,omitempty"`
	// Unready are the etcd members not ready to serve requests
	Unready []string `json:"unready,omitempty"`
}

func (cs ClusterStatus) Copy() ClusterStatus {
	newCS := ClusterStatus{}
	b, err := json.Marshal(cs)
	if err != nil {
		panic(err)
	}
	err = json.Unmarshal(b, &newCS)
	if err != nil {
		panic(err)
	}
	return newCS
}

func (cs *ClusterStatus) IsFailed() bool {
	if cs == nil {
		return false
	}
	return cs.Phase == ClusterPhaseFailed
}

func (cs *ClusterStatus) SetPhase(p ClusterPhase) {
	cs.Phase = p
}

func (cs *ClusterStatus) PauseControl() {
	cs.ControlPaused = true
}

func (cs *ClusterStatus) Control() {
	cs.ControlPaused = false
}

func (cs *ClusterStatus) UpgradeVersionTo(v string) {
	cs.TargetVersion = v
}

func (cs *ClusterStatus) SetVersion(v string) {
	cs.TargetVersion = ""
	cs.CurrentVersion = v
}

func (cs *ClusterStatus) SetReason(r string) {
	cs.Reason = r
}

func (cs *ClusterStatus) AppendScalingUpCondition(from, to int) {
	c := ClusterCondition{
		Type:           ClusterConditionScalingUp,
		Reason:         scalingReason(from, to),
		TransitionTime: time.Now().Format(time.RFC3339),
	}
	cs.appendCondition(c)
}

func (cs *ClusterStatus) AppendScalingDownCondition(from, to int) {
	c := ClusterCondition{
		Type:           ClusterConditionScalingDown,
		Reason:         scalingReason(from, to),
		TransitionTime: time.Now().Format(time.RFC3339),
	}
	cs.appendCondition(c)
}

func (cs *ClusterStatus) AppendRecoveringCondition() {
	c := ClusterCondition{
		Type:           ClusterConditionRecovering,
		TransitionTime: time.Now().Format(time.RFC3339),
	}
	cs.appendCondition(c)
}

func (cs *ClusterStatus) AppendUpgradingCondition(to string, member string) {
	reason := fmt.Sprintf("upgrading cluster member %s version to %v", member, to)

	c := ClusterCondition{
		Type:           ClusterConditionUpgrading,
		Reason:         reason,
		TransitionTime: time.Now().Format(time.RFC3339),
	}
	cs.appendCondition(c)
}

func (cs *ClusterStatus) AppendRemovingDeadMember(name string) {
	reason := fmt.Sprintf("removing dead member %s", name)

	c := ClusterCondition{
		Type:           ClusterConditionRemovingDeadMember,
		Reason:         reason,
		TransitionTime: time.Now().Format(time.RFC3339),
	}
	cs.appendCondition(c)
}

func (cs *ClusterStatus) SetReadyCondition() {
	c := ClusterCondition{
		Type:           ClusterConditionReady,
		TransitionTime: time.Now().Format(time.RFC3339),
	}

	if len(cs.Conditions) == 0 {
		cs.appendCondition(c)
		return
	}

	lastc := cs.Conditions[len(cs.Conditions)-1]
	if lastc.Type == ClusterConditionReady {
		return
	}
	cs.appendCondition(c)
}

func (cs *ClusterStatus) appendCondition(c ClusterCondition) {
	cs.Conditions = append(cs.Conditions, c)
	if len(cs.Conditions) > 10 {
		cs.Conditions = cs.Conditions[1:]
	}
}

func scalingReason(from, to int) string {
	return fmt.Sprintf("Current cluster size: %d, desired cluster size: %d", from, to)
}


text:
@protocol PharmacyPatientViewDelegate <NSObject>

-(void) PharmacyPatientViewUpdatedAndClose;

@end

@interface PharmacyPatientViewController : UIViewController <UITableViewDataSource, UITableViewDelegate>
{
    CameraFacade *facade;
}

@property (strong, nonatomic) NSMutableDictionary * patientData;
- (IBAction)verify:(id)sender;

@property (strong, nonatomic) NSMutableArray * prescriptions;

@property (weak, nonatomic) id<PharmacyPatientViewDelegate>delegate;
@property (weak, nonatomic) IBOutlet UITextField *patientNameField;
@property (weak, nonatomic) IBOutlet UITextField *familyNameField;
@property (weak, nonatomic) IBOutlet UITextField *villageNameField;
@property (weak, nonatomic) IBOutlet UITextField *patientAgeField;
@property (weak, nonatomic) IBOutlet UITextField *patientSexField;
@property (weak, nonatomic) IBOutlet UIImageView *patientPhoto;
@property (weak, nonatomic) IBOutlet UITextView *medicalNotes;
@property (weak, nonatomic) IBOutlet UIView *patientView;
@property (weak, nonatomic) IBOutlet UIButton *checkoutButton;
@property (weak, nonatomic) IBOutlet UITableView *tableView;

- (IBAction)checkoutPatient:(id)sender;
@end


text:
import { Component, OnInit, ElementRef, Renderer }        from '@angular/core';
import { Observable }       from 'rxjs/Observable';
import { Subject }          from 'rxjs/Subject';
import { LocationService } from './location.service';
import {Location} from './location.component';
import './rxjs-operators';

@Component({
    selector: 'lesson-08',
    templateUrl: './views/lesson08.html',
    providers: [LocationService]
})
export class Lesson08 implements OnInit{

    constructor(private locationService: LocationService, private _elem: ElementRef) { }

    aLoc: Location;

    ngOnInit() {
        this.aLoc = new Location();
    }

    errorMessage: string;
    locations: Location[];
    mode = 'Observable';
    displayValue: string;

    private searchTermStream = new Subject<string>();

    search(term: string) {
        this.searchTermStream.next(term);
    }

    onClick() {
        console.log("Got ya");
    }

    items: Observable<Location[]> = this.searchTermStream
        .debounceTime(300)
        .distinctUntilChanged()
        .switchMap((term: string) => this.locationService.search(term));
}


text:
package softlayer_layout_profile

// DO NOT EDIT. THIS FILE WAS AUTOMATICALLY GENERATED


text:
namespace org {
  namespace apache {
    namespace lucene {
      namespace queryparser {
        namespace surround {
          namespace parser {
            class QueryParserConstants;
            class Token;
            class CharStream;
          }
        }
      }
    }
  }
}
namespace java {
  namespace lang {
    class Class;
    class String;
  }
  namespace io {
    class PrintStream;
  }
}
template<class T> class JArray;

namespace org {
  namespace apache {
    namespace lucene {
      namespace queryparser {
        namespace surround {
          namespace parser {

            class QueryParserTokenManager : public ::java::lang::Object {
            public:
              enum {
                mid_init$_5bfa6473,
                mid_init$_5ba65d1b,
                mid_ReInit_5bfa6473,
                mid_ReInit_5ba65d1b,
                mid_SwitchTo_39c7bd3c,
                mid_getNextToken_353aefd6,
                mid_setDebugStream_1b7c898b,
                mid_jjFillToken_353aefd6,
                max_mid
              };

              enum {
                fid_debugStream,
                max_fid
              };

              static ::java::lang::Class *class$;
              static jmethodID *mids$;
              static jfieldID *fids$;
              static bool live$;
              static jclass initializeClass(bool);

              explicit QueryParserTokenManager(jobject obj) : ::java::lang::Object(obj) {
                if (obj != NULL)
                  env->getClass(initializeClass);
              }
              QueryParserTokenManager(const QueryParserTokenManager& obj) : ::java::lang::Object(obj) {}

              static JArray< jint > *jjnewLexState;
              static JArray< ::java::lang::String > *jjstrLiteralImages;
              static JArray< ::java::lang::String > *lexStateNames;

              ::java::io::PrintStream _get_debugStream() const;
              void _set_debugStream(const ::java::io::PrintStream &) const;

              QueryParserTokenManager(const ::org::apache::lucene::queryparser::surround::parser::CharStream &);
              QueryParserTokenManager(const ::org::apache::lucene::queryparser::surround::parser::CharStream &, jint);

              void ReInit(const ::org::apache::lucene::queryparser::surround::parser::CharStream &) const;
              void ReInit(const ::org::apache::lucene::queryparser::surround::parser::CharStream &, jint) const;
              void SwitchTo(jint) const;
              ::org::apache::lucene::queryparser::surround::parser::Token getNextToken() const;
              void setDebugStream(const ::java::io::PrintStream &) const;
            };
          }
        }
      }
    }
  }
}

#include <Python.h>

namespace org {
  namespace apache {
    namespace lucene {
      namespace queryparser {
        namespace surround {
          namespace parser {
            extern PyTypeObject PY_TYPE(QueryParserTokenManager);

            class t_QueryParserTokenManager {
            public:
              PyObject_HEAD
              QueryParserTokenManager object;
              static PyObject *wrap_Object(const QueryParserTokenManager&);
              static PyObject *wrap_jobject(const jobject&);
              static void install(PyObject *module);
              static void initialize(PyObject *module);
            };
          }
        }
      }
    }
  }
}

#endif


text:
/* Catena_PollableInterface.h	Sat Mar 18 2017 14:48:29 tmm */

/*

Module:  Catena_PollableInterface.h

Function:
	McciCatena::cPollableInterface

Version:
	V0.5.0	Sat Mar 18 2017 14:48:29 tmm	Edit level 1

Copyright notice:
	This file copyright (C) 2017 by

		MCCI Corporation
		3520 Krums Corners Road
		Ithaca, NY  14850

	An unpublished work.  All rights reserved.

	This file is proprietary information, and may not be disclosed or
	copied without the prior permission of MCCI Corporation.

Author:
	Terry Moore, MCCI Corporation	March 2017

Revision history:
   0.5.0  Sat Mar 18 2017 14:48:29  tmm
	Module created.

*/

#ifndef _CATENA_POLLABLEINTERFACE_H_		/* prevent multiple includes */
#define _CATENA_POLLABLEINTERFACE_H_

#pragma once

namespace McciCatena {

class cPollableInterface
	{
public:
	// empty virtual detructor
	virtual ~cPollableInterface() {};

	// override this, please:
	virtual void poll(void) = 0;
	};

class cPollingEngine; // forward reference

class cPollableObject : public cPollableInterface
	{
public:
        cPollableObject() {};

	// neither copyable nor movable
	cPollableObject(const cPollableObject&) = delete;
	cPollableObject& operator=(const cPollableObject&) = delete;
	cPollableObject(const cPollableObject&&) = delete;
	cPollableObject& operator=(const cPollableObject&&) = delete;

private:
        // forward link in polling list
	cPollableObject *m_pNext = nullptr;
        // reverse link in polling list
	cPollableObject *m_pLast = nullptr;

        // polling engine owns this list so can manipulate.
	friend class cPollingEngine;
	};

class cPollingEngine : public cPollableInterface
	{
public:
	cPollingEngine() {};
	virtual ~cPollingEngine() {};

	// neither copyable nor movable
	cPollingEngine(const cPollingEngine&) = delete;
	cPollingEngine& operator=(const cPollingEngine&) = delete;
	cPollingEngine(const cPollingEngine&&) = delete;
	cPollingEngine& operator=(const cPollingEngine&&) = delete;

        // prepare for operation.
	void begin() {};

        // poll this list represented by this engine.
	virtual void poll()
		{
		auto const pHead = this->m_pHead;
		if (pHead != nullptr)
			{
			auto pThis = pHead;
			do
				{
				pThis->poll();
				pThis = pThis->m_pNext;
				} while (pThis != pHead);
			}
		}

        // register an object to be polled in this list.
        void registerObject(cPollableObject *pObject)
                {
                auto const pHead = this->m_pHead;
                if (pHead == nullptr)
                        {
                        pObject->m_pNext = pObject;
                        pObject->m_pLast = pObject;
                        this->m_pHead = pObject;
                        }
                else
                        {
                        auto const pLast = pHead->m_pLast;
                        pObject->m_pNext = pHead;
                        pObject->m_pLast = pLast;
                        pLast->m_pNext = pObject;
                        pHead->m_pLast = pObject;
                        }
                }

private:
	cPollableObject *m_pHead = nullptr;
	};

}; // namespace McciCatena

/**** end of Catena_PollableInterface.h ****/
#endif /* _CATENA_POLLABLEINTERFACE_H_ */


text:
class Spinach::Features::RevertCommits < Spinach::FeatureSteps
  include SharedAuthentication
  include SharedProject
  include SharedPaths
  include SharedDiffNote
  include RepoHelpers

  step 'I click on commit link' do
    visit namespace_project_commit_path(@project.namespace, @project, sample_commit.id)
  end

  step 'I click on the revert button' do
    find("a[href='#modal-revert-commit']").click
  end

  step 'I revert the changes directly' do
    page.within('#modal-revert-commit') do
      uncheck 'create_merge_request'
      click_button 'Revert'
    end
  end

  step 'I should see the revert commit notice' do
    page.should have_content('The commit has been successfully reverted.')
  end

  step 'I should see a revert error' do
    page.should have_content('Sorry, we cannot revert this commit automatically.')
  end

  step 'I revert the changes in a new merge request' do
    page.within('#modal-revert-commit') do
      click_button 'Revert'
    end
  end

  step 'I should see the new merge request notice' do
    page.should have_content('The commit has been successfully reverted. You can now submit a merge request to get this change into the original branch.')
  end
end


text:
require 'spec_helper'
require 'puppet/file_bucket/dipper'
require 'puppet_spec/compiler'

describe Puppet::Type.type(:cron).provider(:crontab), '(integration)', :unless => Puppet.features.microsoft_windows? do
  include PuppetSpec::Files
  include PuppetSpec::Compiler

  before :each do
    Puppet::Type.type(:cron).stubs(:defaultprovider).returns described_class
    Puppet::FileBucket::Dipper.any_instance.stubs(:backup) # Don't backup to filebucket

    # I don't want to execute anything
    described_class.stubs(:filetype).returns Puppet::Util::FileType::FileTypeFlat
    described_class.stubs(:default_target).returns crontab_user1

    # I don't want to stub Time.now to get a static header because I don't know
    # where Time.now is used elsewhere, so just go with a very simple header
    described_class.stubs(:header).returns "# HEADER: some simple\n# HEADER: header\n"
    FileUtils.cp(my_fixture('crontab_user1'), crontab_user1)
    FileUtils.cp(my_fixture('crontab_user2'), crontab_user2)
  end

  after :each do
    described_class.clear
  end

  let :crontab_user1 do
    tmpfile('cron_integration_specs')
  end

  let :crontab_user2 do
    tmpfile('cron_integration_specs')
  end

  def expect_output(fixture_name)
    File.read(crontab_user1).should == File.read(my_fixture(fixture_name))
  end

  describe "when managing a cron entry" do

    it "should be able to purge unmanaged entries" do
      apply_with_error_check(<<-MANIFEST)
      cron {
        'only managed entry':
          ensure      => 'present',
          command     => '/bin/true',
          target      => '#{crontab_user1}',
      }
      resources { 'cron': purge => 'true' }
      MANIFEST
      expect_output('purged')
    end

    describe "with ensure absent" do
      it "should do nothing if entry already absent" do
        apply_with_error_check(<<-MANIFEST)
        cron {
          'no_such_entry':
            ensure => 'absent',
            target => '#{crontab_user1}',
        }
        MANIFEST
        expect_output('crontab_user1')
      end

      it "should remove the resource from crontab if present" do
        apply_with_error_check(<<-MANIFEST)
        cron {
          'My daily failure':
            ensure => 'absent',
            target => '#{crontab_user1}',
        }
        MANIFEST
        expect_output('remove_named_resource')
      end

      it "should remove a matching cronentry if present" do
        apply_with_error_check(<<-MANIFEST)
        cron {
          'no_such_named_resource_in_crontab':
            ensure   => absent,
            minute   => [ '17-19', '22' ],
            hour     => [ '0-23/2' ],
            weekday  => 'Tue',
            command  => '/bin/unnamed_regular_command',
            target   => '#{crontab_user1}',
        }
        MANIFEST
        expect_output('remove_unnamed_resource')
      end
    end

    describe "with ensure present" do

      context "and no command specified" do
        it "should work if the resource is already present" do
          apply_with_error_check(<<-MANIFEST)
          cron {
            'My daily failure':
              special => 'daily',
              target  => '#{crontab_user1}',
          }
          MANIFEST
          expect_output('crontab_user1')
        end
        it "should fail if the resource needs creating" do
          manifest = <<-MANIFEST
          cron {
            'Entirely new resource':
              special => 'daily',
              target  => '#{crontab_user1}',
          }
          MANIFEST
          apply_compiled_manifest(manifest) do |res|
            if res.ref == 'Cron[Entirely new resource]'
              res.expects(:err).with(regexp_matches(/no command/))
            else
              res.expects(:err).never
            end
          end
        end
      end

      it "should do nothing if entry already present" do
        apply_with_error_check(<<-MANIFEST)
        cron {
          'My daily failure':
            special => 'daily',
            command => '/bin/false',
            target  => '#{crontab_user1}',
        }
        MANIFEST
        expect_output('crontab_user1')
      end

      it "should work correctly when managing 'target' but not 'user'" do
        apply_with_error_check(<<-MANIFEST)
        cron {
          'My daily failure':
            special => 'daily',
            command => '/bin/false',
            target  => '#{crontab_user1}',
        }
        MANIFEST
        expect_output('crontab_user1')
      end

      it "should do nothing if a matching entry already present" do
        apply_with_error_check(<<-MANIFEST)
        cron {
          'no_such_named_resource_in_crontab':
            ensure   => present,
            minute   => [ '17-19', '22' ],
            hour     => [ '0-23/2' ],
            command  => '/bin/unnamed_regular_command',
            target   => '#{crontab_user1}',
        }
        MANIFEST
        expect_output('crontab_user1')
      end

      it "should add a new normal entry if currently absent" do
        apply_with_error_check(<<-MANIFEST)
        cron {
          'new entry':
            ensure      => present,
            minute      => '12',
            weekday     => 'Tue',
            command     => '/bin/new',
            environment => [
              'MAILTO=""',
              'SHELL=/bin/bash'
            ],
            target      => '#{crontab_user1}',
        }
        MANIFEST
        expect_output('create_normal_entry')
      end

      it "should add a new special entry if currently absent" do
        apply_with_error_check(<<-MANIFEST)
        cron {
          'new special entry':
            ensure      => present,
            special     => 'reboot',
            command     => 'echo "Booted" 1>&2',
            environment => 'MAILTO=bob@company.com',
            target      => '#{crontab_user1}',
        }
        MANIFEST
        expect_output('create_special_entry')
      end

      it "should change existing entry if out of sync" do
        apply_with_error_check(<<-MANIFEST)
        cron {
          'Monthly job':
            ensure      => present,
            special     => 'monthly',
            #minute => ['22'],
            command     => '/usr/bin/monthly',
            environment => [],
            target      => '#{crontab_user1}',
        }
        MANIFEST
        expect_output('modify_entry')
      end
      it "should change a special schedule to numeric if requested" do
        apply_with_error_check(<<-MANIFEST)
        cron {
          'My daily failure':
            special     => 'absent',
            command     => '/bin/false',
            target      => '#{crontab_user1}',
        }
        MANIFEST
        expect_output('unspecialized')
      end
      it "should not try to move an entry from one file to another" do
        # force the parsedfile provider to also parse user1's crontab
        apply_with_error_check(<<-MANIFEST)
        cron {
          'foo':
            ensure => absent,
            target => '#{crontab_user1}';
          'My daily failure':
            special      => 'daily',
            command      => "/bin/false",
            target       => '#{crontab_user2}',
        }
        MANIFEST
        File.read(crontab_user1).should == File.read(my_fixture('moved_cronjob_input1'))
        File.read(crontab_user2).should == File.read(my_fixture('moved_cronjob_input2'))
      end
    end
  end

end


text:
"""
cats sample data files

Contents
--------
1. 328927009.fasta
   Homo sapiens EGF-like, fibronectin type III and laminin G domains (EGFLAM),
   transcript variant 5, mRNA
   http://www.ncbi.nlm.nih.gov/nucleotide/328927009

2. transcripts.gff3
   Broad Institute Sample GFF3 file
   http://www.broadinstitute.org/annotation/gebo/help/gff3.html
"""
import os
import cats

__author__ = "Keith Hughitt"
__email__ = "khughitt@umd.edu"

rootdir = os.path.join(os.path.dirname(cats.__file__), "data", "sample")

# FASTA
FASTA = os.path.abspath(os.path.join(rootdir, '328927009.fasta'))

# GFF
GFF = os.path.abspath(os.path.join(rootdir, 'transcripts.gff3'))


text:
include $(ZEPHYR_BASE)/tests/Makefile.test

obj-y = test_thread_init.o


text:
layout: page
title: About
permalink: /about/
tags: about
---

I'm Lioncache! I'm interested in tooling, low-level emulation and reverse engineering. In particular, I love working around instruction set architectures, seeing how things tick, and optimizing around them, even if I still have a lot to learn.

I usually contribute to projects relating to hardware emulation. Currently I'm a core developer and maintainer of [Dolphin](https://dolphin-emu.org), a Nintendo GameCube and Wii emulator; [Citra](https://citra-emu.org), a Nintendo 3DS emulator; [yuzu](http://yuzu-emu.org), a Nintendo Switch emulator; and [dynarmic](https://github.com/MerryMage/dynarmic), an ARM dynamic recompiler.

#### Contact

IRC: Lioncash (on Freenode)

Twitter: [@Lioncache](https://twitter.com/Lioncache)

#### Theme Credits

The site theme used is Pixyll, which was created by [John Otander](http://johnotander.com/).


text:
#!/usr/bin/env python

from distutils.core import setup
from io import open
import setuptools

with open("README.md", encoding="utf-8") as f:
    README = f.read()
with open("changelog.md", encoding="utf-8") as f:
    CHANGELOG = f.read()

setup(name='azure-cosmos',
      version='3.2.0',
      description='Azure Cosmos Python SDK',
      long_description=README + "\n\n" + CHANGELOG,
      long_description_content_type="text/markdown",
      author="Microsoft",
      author_email="askdocdb@microsoft.com",
      maintainer="Microsoft",
      maintainer_email="askdocdb@microsoft.com",
      url="https://github.com/Azure/azure-documentdb-python",
      license='MIT',
      install_requires=['six >=1.6', 'requests>=2.10.0'],
      classifiers=[
        'License :: OSI Approved :: MIT License',
        'Intended Audience :: Developers',
        'Natural Language :: English',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: Implementation :: CPython',
        'Topic :: Software Development :: Libraries :: Python Modules'
      ],
      packages=setuptools.find_packages(exclude=['test', 'test.*', 'azure', 'samples', 'samples.*', 'doc']),
      extras_require={
          ':python_version<"3.0"': ['azure-nspkg'],
      },
)


text:
import sys, struct

if sys.platform == 'win32':
   ## on windows, we need to use the following reactor for serial support
   ## http://twistedmatrix.com/trac/ticket/3802
   ##
   from twisted.internet import win32eventreactor
   win32eventreactor.install()

from twisted.internet import reactor
print "Using Twisted reactor", reactor.__class__
print

from twisted.python import usage, log
from twisted.internet.defer import Deferred, returnValue, inlineCallbacks
from twisted.internet.serialport import SerialPort

from srdp import SrdpHostProtocol, SrdpFrameHeader

##
## scalar
## object
## vector of scalars
## vector of objects
## string
##

# string
# float, double
# int8, int16, int32, int64
# uint8, uint16, uint32, uint64

class DemoBoardHostProtocol(SrdpHostProtocol):

   IDX_REG_FREE_RAM = 1024

   @inlineCallbacks
   def getFreeMem(self):
      try:
         res = yield self.readRegister(0, self.IDX_REG_FREE_RAM)
      except Exception, e:
         error_code = struct.unpack("<l", e.args[0])[0]
         if SrdpFrameHeader.SRDP_ERR_DESC.has_key(error_code):
            error_text = SrdpFrameHeader.SRDP_ERR_DESC[error_code]
         raise Exception(error_code, error_text)
      else:
         res = struct.unpack("<L", res)[0]
         returnValue(res)

   @inlineCallbacks
   def runTests(self):
      try:
         print "Free memory (bytes): %d" % (yield self.getFreeMem())
      except Exception, e:
         print "Error:", e
      self.transport.loseConnection()

   def connectionMade(self):
      log.msg('Serial port connected.')
      reactor.callLater(1, self.runTests)

   def connectionLost(self, reason):
      log.msg('Serial port connection lost: %s' % reason)
      reactor.stop()

# http://twistedmatrix.com/trac/ticket/1248
# http://stackoverflow.com/a/287293/884770
class SerialPortFix(SerialPort):

   def __init__(self, *args, **kw):
      super(SerialPortFix, self).__init__(*args, **kw)
      self._tempDataBuffer = []

   def writeSomeData(self, data):
      return len(data)

# class Super( object ):
#    def __init__( self, this, that ):
#        self.this = this
#        self.that = that

# class Sub( Super ):
#    def __init__( self, myStuff, *args, **kw ):
#        super( Sub, self ).__init__( *args, **kw )
#        self.myStuff= myStuff

class DemoBoardHostOptions(usage.Options):
   """
   Command line options for this app.
   """
   optFlags = [['debug', 'd', 'Enable debug log messages.']]
   optParameters = [
      ['baudrate', 'b', 115200, 'Serial port baudrate [default: 9600]'],
      ['port', 'p', 11, 'Serial port to use (e.g. "11" for COM12 or "/dev/ttxACM0") [default: 11]'],
      ['wsuri', 'w', "ws://127.0.0.1/ws", 'Tavendo WebMQ WebSocket endpoint [default: ws://127.0.0.1/ws]']
   ]

import json, os, sys, re
from pprint import pprint

if __name__ == '__main__':

   db = SrdpEdsDatabase()
   db.loadFromDir("../eds")
   db.toHtml("http://eds.tavendo.com/device/arduino-combocontrol", "arduino-combocontrol.html")
   #db.pprint("http://eds.tavendo.com/device/arduino-combocontrol")
   #db.pprint("http://eds.tavendo.com/device/device")
   #db.pprint("http://eds.tavendo.com/device/colorlight")
   #db.pprint("http://eds.tavendo.com/device/arduino-rgb-led")
   #db.pprint()

   sys.exit(0)

   eds = SrdpEds()
   eds.load('../eds/devices/device.eds')
   eds.load('../eds/devices/colorlight.eds')
   eds.load('../eds/devices/tavendo_arduino_colorlight.eds')
   pprint(eds.registersByIndex)
   pprint(eds.registersByPath)

   ## parse options
   ##
   options = DemoBoardHostOptions()
   try:
      options.parseOptions()
   except usage.UsageError, errortext:
      print '%s %s' % (sys.argv[0], errortext)
      print 'Try %s --help for usage details' % sys.argv[0]
      sys.exit(1)

   log.startLogging(sys.stdout)

   baudrate = int(options.opts['baudrate'])
   port = options.opts['port']
   try:
      port = int(port)
   except:
      # on RaspberryPi, Serial-over-USB appears as /dev/ttyACM0
      pass
   wsuri = options.opts['wsuri']
   debug = True if options['debug'] else False

   ## serial connection to Arduino
   ##
   log.msg("Opening serial port %s [%d baud]" % (port, baudrate))
   serialProtocol = DemoBoardHostProtocol(debug = debug)
   serialPort = SerialPortFix(serialProtocol, port, reactor, baudrate = baudrate)

   reactor.run()


text:
<?php

/**
 * This file is part of Yii2-Swap project
 * (c) kirillantv <http://github.com/kirillantv/>
 *
 * For more information read README and LICENSE file
 */

use yii\bootstrap\Alert;

/**
 * @var dektrium\user\Module $module
 */
?>

        <?php foreach (Yii::$app->session->getAllFlashes() as $type => $message): ?>
            <?php if (in_array($type, ['success', 'danger', 'warning', 'info'])):  ?>
                <?= Alert::widget([
                    'options' => ['class' => 'alert-dismissible alert-' . $type],
                    'body' => $message
                ]) ?>
            <?php endif ?>
        <?php endforeach ?>


text:
void BAMbinSortUnmapped(uint32 iBin, uint nThreads, string dirBAMsort, Parameters &P, Genome &genome, Solo &solo) {

    BGZF *bgzfBin;
    bgzfBin=bgzf_open((dirBAMsort+"/b"+to_string((uint) iBin)).c_str(),("w"+to_string((long long) P.outBAMcompression)).c_str());
    if (bgzfBin==NULL) {
        ostringstream errOut;
        errOut <<"EXITING because of fatal ERROR: could not open temporary bam file: " << dirBAMsort+"/b"+to_string((uint) iBin) << "\n";
        errOut <<"SOLUTION: check that the disk is not full, increase the max number of open files with Linux command ulimit -n before running STAR";
        exitWithError(errOut.str(), std::cerr, P.inOut->logMain, EXIT_CODE_PARAMETER, P);
    };

    outBAMwriteHeader(bgzfBin,P.samHeaderSortedCoord,genome.chrNameAll,genome.chrLengthAll);

    vector<string> bamInFile;
    std::map <uint,uint> startPos;

    for (uint it=0; it<nThreads; it++) {//files from all threads, and BySJout
        bamInFile.push_back(dirBAMsort+to_string(it)+"/"+to_string((uint) iBin));
        bamInFile.push_back(dirBAMsort+to_string(it)+"/"+to_string((uint) iBin)+".BySJout");
    };
    vector<uint32> bamSize(bamInFile.size(),0);//record sizes

    //allocate arrays
    char **bamIn=new char* [bamInFile.size()];
    ifstream *bamInStream = new ifstream [bamInFile.size()];

    for (uint it=0; it<bamInFile.size(); it++) {//initialize
        bamIn[it] = new char [BAMoutput_oneAlignMaxBytes];

        bamInStream[it].open(bamInFile.at(it).c_str());//opean all files

        bamInStream[it].read(bamIn[it],sizeof(int32));//read BAM record size
        if (bamInStream[it].good()) {
            bamSize[it]=((*(uint32*)bamIn[it])+sizeof(int32));//true record size +=4 (4 bytes for uint-iRead)
            bamInStream[it].read(bamIn[it]+sizeof(int32),bamSize.at(it)-sizeof(int32)+sizeof(uint64));//read the rest of the record, including last uint = iRead
            uint64 iRead=*(uint*)(bamIn[it]+bamSize.at(it));
            iRead = iRead >> 32; //iRead is recorded in top 32bits
            startPos[iRead]=it;//startPos[iRead]=it : record the order of the files to output
        } else {//nothing to do here, file is empty, do not record it
        };
    };

    //send ordered aligns to bgzf one-by-one
    char bam1[BAM_ATTR_MaxSize];//temp array
    while (startPos.size()>0) {
        uint it=startPos.begin()->second;
        uint startNext=startPos.size()>1 ? (++startPos.begin())->first : (uint) -1;

        while (true) {
            //add extra tags to the BAM record
            char* bam0=bamIn[it];
            uint32 size0=bamSize.at(it);

            if (solo.pSolo.samAttrYes)
	        solo.soloFeat[solo.pSolo.featureInd[solo.pSolo.samAttrFeature]]->addBAMtags(bam0,size0,bam1);

            bgzf_write(bgzfBin, bam0, size0);
            bamInStream[it].read(bamIn[it],sizeof(int32));//read record size
            if (bamInStream[it].good()) {
                 bamSize[it]=((*(uint32*)bamIn[it])+sizeof(int32));
                 bamInStream[it].read(bamIn[it]+sizeof(int32),bamSize.at(it)-sizeof(int32)+sizeof(uint));//read the rest of the record, including
                 uint64 iRead=*(uint*)(bamIn[it]+bamSize.at(it));
                 iRead = iRead >> 32; //iRead is recorded in top 32bits
                 if (iRead>startNext) {//this read from this chunk is > than a read from another chunk
                     startPos[iRead]=it;
                     break;
                 };
            } else {//nothing to do here, reached the end of the file
                 break;
            };
        };
        startPos.erase(startPos.begin());
    };

    bgzf_flush(bgzfBin);
    bgzf_close(bgzfBin);

    for (uint it=0; it<bamInFile.size(); it++) {//destroy at the end
        bamInStream[it].close();
        remove(bamInFile.at(it).c_str());
        delete [] bamIn[it];
    };
    delete [] bamIn;
    delete [] bamInStream;
};


text:
package com.dumu.housego.view;

import java.util.List;

import com.dumu.housego.entity.LiuYanList;

public interface ILiuYanDetailsView {
	void liuyanDetailSuccess(List<LiuYanList>liuyans);
	void liuyanDetailFail(String info);
}


text:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

    <!-- Bottom 2dp Shadow -->
    <item>
        <shape  android:shape="rectangle">

            <solid android:color="#d8d8d8" />
            <stroke android:width="8dp"
                 android:color="#d8d8d8"/>
        </shape>
    </item>

    <!-- White Top color -->
    <item android:bottom="5px" android:right="5px" android:top="1px" android:left="1px">

        <shape  android:shape="rectangle">

            <solid android:color="#FFFFFF" />
        </shape>

    </item>

</layer-list>


text:
namespace Microsoft.Azure.Management.Compute.Models
{

    /// <summary>
    /// Defines values for DiskStorageAccountTypes.
    /// </summary>
    public static class DiskStorageAccountTypes
    {
        /// <summary>
        /// Standard HDD locally redundant storage. Best for backup,
        /// non-critical, and infrequent access.
        /// </summary>
        public const string StandardLRS = "Standard_LRS";
        /// <summary>
        /// Premium SSD locally redundant storage. Best for production and
        /// performance sensitive workloads.
        /// </summary>
        public const string PremiumLRS = "Premium_LRS";
        /// <summary>
        /// Standard SSD locally redundant storage. Best for web servers,
        /// lightly used enterprise applications and dev/test.
        /// </summary>
        public const string StandardSSDLRS = "StandardSSD_LRS";
        /// <summary>
        /// Ultra SSD locally redundant storage. Best for IO-intensive
        /// workloads such as SAP HANA, top tier databases (for example, SQL,
        /// Oracle), and other transaction-heavy workloads.
        /// </summary>
        public const string UltraSSDLRS = "UltraSSD_LRS";
        /// <summary>
        /// Premium SSD zone redundant storage. Best for the production
        /// workloads that need storage resiliency against zone failures.
        /// </summary>
        public const string PremiumZRS = "Premium_ZRS";
        /// <summary>
        /// Standard SSD zone redundant storage. Best for web servers, lightly
        /// used enterprise applications and dev/test that need storage
        /// resiliency against zone failures.
        /// </summary>
        public const string StandardSSDZRS = "StandardSSD_ZRS";
        /// <summary>
        /// Premium SSD v2 locally redundant storage. Best for production and
        /// performance-sensitive workloads that consistently require low
        /// latency and high IOPS and throughput.
        /// </summary>
        public const string PremiumV2LRS = "PremiumV2_LRS";
    }
}


text:
package com.yanxin.blurbackground.demo;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

/**
 * Created by YanXin on 2016/5/20.
 */
public class BlurDemoFragmentActivity extends AppCompatActivity {

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