text:
package jat.tests.propagator;

import jat.coreNOSA.algorithm.integrators.LinePrinter;
import jat.coreNOSA.algorithm.integrators.RungeKutta8;
import jat.coreNOSA.forces.ForceModelListOld;
import jat.coreNOSA.math.MathUtils;
import jat.coreNOSA.math.MatrixVector.data.VectorN;
import jat.coreNOSA.matlabInterface.MatlabControl;
import jat.coreNOSA.spacecraft.Spacecraft;
import jat.coreNOSA.timeRef.EarthRef;
import jat.coreNOSA.trajectory.Trajectory;

/**
 * SimulationLoop provides a way to encapsulate the feedback loop
 * used to propagate the satellite and implement a control law.
 *
 * spacecraft[]-->(sum)-->[Dynamics]->[Control Law]-->acceleration[]
 *                  A -                             |
 *                  |_______________________________|
 *
 * @author Richard C. Page III
 *
 */
public class SimulationLoop {

    /**
     * earthRef: Reference variable for the Earth fixed coordinate system.
     */
    protected EarthRef earthRef;
//    /**
//     * iers: International Earth Rotation and Reference System Service
//     * information.
//     */
//    protected FitIERS iers;
    /**
     * spacecraft: An array of the various spacecraft to propagate.
     * The usage of multiple spacecraft allows for implementation of
     * spacecraft formation dependent controls.
     */
    protected Spacecraft[] sc;
    /**
     * num_sc: number of spacecraft;
     */
    protected int num_sc;
    /**
     * mjd_start: The start time of the simulation as a Modified Julian Date (UTC).
     */
    protected double mjd_start;
    /**
     * t: Current Simulation time expressed as seconds since mjd_start.
     */
    protected double t;
    /**
     * tf: Finish time expressed as seconds since mjd_start.
     */
    protected double tf;
    /**
     * counter: Counts the number of iterations.
     */
    protected int counter;
    /**
     * timestep: Simulation timestep.
     */
    protected double timestep;
    /**
     * forces: An array of force model lists representing the forces
     * which act on the various spacecraft.
     */
    protected ForceModelListOld[] forces;
    /**
     * useJAT: A flag which determines whether to use the integrator from
     * JAT or to call the Matlab(R) integrator.
     */
    protected boolean useJAT = true;
    /**
     * out: Output printer which to print position and velocity data.
     */
    protected LinePrinter out;
    /**
     * rk8: 8th order RungeKutta integrator.
     */
    protected RungeKutta8 rk8;
    /**
     * acceleration: The acceleration developed from the simulation loop
     * on each spacecraft.  (Implemented as a parallel array to SimulationLoop.sc)
     */
    //protected VectorN[] acceleration;
    protected MatlabControl matlab;

    protected Trajectory jat;
    protected double thinning;
    protected boolean use_IERS;

    public SimulationLoop(double mjd0,double dt, Spacecraft[] s,
            ForceModelListOld[] f, boolean q){
        mjd_start = mjd0;
        timestep = dt;
        sc = s;
        num_sc = s.length;
        forces = f;
        this.use_IERS = q;
        t = 0;
        rk8 = new RungeKutta8();
        int size = s.length;
        earthRef = new EarthRef(mjd0);
        for(int i=0; i<forces.length; i++){
            forces[i].updateEarthModel(earthRef);
        }
//        acceleration = new VectorN[size];
//        for(int i=0; i<size; i++){
//            acceleration[i] = new VectorN(0,0,0);
//        }
        jat = new Trajectory();
    }

    private void step(double dt){

System.out.println("step: "+t+" / "+tf+"    stepsize: "+dt);
        rk8.setStepSize(dt);
        //* update models
        double mjd_utc = earthRef.mjd_utc();
        double[] X = new double[6];
        VectorN rnew;
        VectorN vnew;
        double[] tmp = new double[6];
        for(int i=0; i<num_sc; i++){
            //* update force models
            forces[i].updateEarthModel(earthRef);
            //forces[i].computeAccel(sc[i].r(),sc[i].v());  //*** Debug
            //* call integrator
            X[0] = sc[i].r().get(0);
            X[1] = sc[i].r().get(1);
            X[2] = sc[i].r().get(2);
            X[3] = sc[i].v().get(0);
            X[4] = sc[i].v().get(1);
            X[5] = sc[i].v().get(2);
//            if(sc[i].hasControlLaw()){
//                X = rk8.step(t, X, sc[i].getControlLaw());
//            }else{
                X = rk8.step(t, X, forces[i]);
//            }
            //* store new values
            rnew = new VectorN(X[0],X[1],X[2]);
            vnew = new VectorN(X[3],X[4],X[5]);
//rnew.print();
//vnew.print();
            sc[i].updateMotion(rnew,vnew);
            //* update simulation time
            if((t+dt) > tf){
                dt = tf-t;
            }
            t = t+dt;
            earthRef.updateTimeSinceStart(t);
            counter++;
        }
    }

    private void step(double dt, LinePrinter lp){
        step(dt);
        if(MathUtils.mod(counter,lp.getThinning())== 0)
            print(lp);
    }

    /**
     * Simulation loop.  Propagates the spacecraft.
     * @param duration The time over which to propagate in seconds.
     */
    public void loop(double duration){
        //format input parameters
        tf = duration;
        //loop over time equal to "duration"
        while(t < tf){
            step(timestep);
        }
        //store output parameters and stop
    }

    public void loop(double duration, LinePrinter lp){
//      format input parameters
        tf = duration;
        thinning = lp.getThinning();
        double timestep_mod = timestep;
        //print initial condition
//        lp.println("time [days] \t x [km] \t y [km] \t z [km] \t xdot [km/s] \t ydot [km/s] \t zdot [km/s]");
        print(lp);
        //loop over time equal to "duration"
        while(t < tf){
            step(timestep,lp);
        }
        //store output parameters and stop
    }

    protected void print(LinePrinter lp){
        double[] X = new double[6];
        //VectorN a;
        for(int i=0;i<num_sc;i++){
            X[0] = sc[i].r().get(0)/1000.0;
            X[1] = sc[i].r().get(1)/1000.0;
            X[2] = sc[i].r().get(2)/1000.0;
            X[3] = sc[i].v().get(0)/1000.0;
            X[4] = sc[i].v().get(1)/1000.0;
            X[5] = sc[i].v().get(2)/1000.0;
            //lp.println(sc[i].name);
//            System.out.println("printing");
            //a = forces[i].acceleration();
            lp.println(earthRef.mjd_utc()+"\t"+X[0]+"\t"+X[1]+"\t"+X[2]+"\t"
                    +X[3]+"\t"+X[4]+"\t"+X[5]);

            //      +"\t"+a.get(0)+"\t"+a.get(1)+"\t"+a.get(2));
            //System.out.println(t+"\t"+X[0]+"\t"+X[1]+"\t"+X[2]+"\t"+X[3]+"\t"+X[4]+"\t"+X[5]);
            //System.out.println(""+t+"  a: "+a.get(0)+"  "+a.get(1)+"  "+a.get(2));
        }
        jat.add(mjd_start+sec2days(t),X);
    }

    private double sec2days(double s){
        return s*0.000011574074;
    }

    public void set_use_IERS(boolean b){ this.use_IERS = b;}

    public Trajectory getTrajectory(){ return jat;}

    //** See SimulationMatlab.java
//    public void loopMatlab(double duration, LinePrinter lp, String cmd){
//        matlab = new MatlabControl();
////      format input parameters
//        tf = duration;
//        //print initial condition
////        lp.println("time [days] \t x [km] \t y [km] \t z [km] \t xdot [km/s] \t ydot [km/s] \t zdot [km/s]");
//        print(lp);
//        //loop over time equal to "duration"
//        while(t < tf){
//            stepMatlab(timestep,cmd);
//            print(lp);
//        }
//        //store output parameters and stop
//    }

    //** See SimulationMatlab.java
//  protected void stepMatlab(double dt, String cmd){
//      t = t + dt;
//      counter++;
//      //* update models
//      earthRef.incrementTime(dt);
//      double mjd_current = earthRef.mjd_utc();
//      iers.fit(mjd_current);
//      earthRef.setIERS(iers.getX(),iers.getY(),iers.getDUT1());
//      //* update force models
//      forces[0].updateEarthModel(earthRef);
//      //* setup matlab inputs
//      Object[] inputArgs = new Object[3];
//      inputArgs[0] = forces[0];
//      inputArgs[1] = new Double(dt);
//      double[] X = new double[6];
//      X[0] = sc[0].r().get(0);
//      X[1] = sc[0].r().get(1);
//      X[2] = sc[0].r().get(2);
//      X[3] = sc[0].v().get(0);
//      X[4] = sc[0].v().get(1);
//      X[5] = sc[0].v().get(2);
//      inputArgs[2] = X;
//      double[] returnVals;
//      try {
//			returnVals = (double[])matlab.blockingFeval(cmd, inputArgs);
////			returnVals = (double[])Matlab.mtFeval(cmd, inputArgs, 0);
//			sc[0].updateMotion(new VectorN(returnVals[0],returnVals[1],returnVals[2]),
//	        		   new VectorN(returnVals[3],returnVals[4],returnVals[5]));
//		} catch (Exception e) {
//			e.printStackTrace();
//		}
//      //* update simulation time
//      if((t+dt) > tf){
//          dt = tf-t;
//      }
//      //earthRef.incrementTime(dt);
//      t = t+dt;
//      earthRef.updateTimeSinceStart(t);
//      counter++;
//
//  }
}


text:
import { wallet, tx } from "@cityofzion/neon-core";

export type SigningFunction = (
  tx: tx.Transaction,
  details: {
    network: number;
    witnessIndex: number;
  }
) => Promise<string>;

export function signWithAccount(acct: wallet.Account): SigningFunction {
  return async (tx, details) => {
    const txData = tx.getMessageForSigning(details.network);
    const scriptHash = wallet.getScriptHashFromVerificationScript(
      tx.witnesses[details.witnessIndex].verificationScript.toString()
    );
    if (scriptHash !== acct.scriptHash) {
      throw new Error(
        `Requested signature from ${wallet.getAddressFromScriptHash(
          scriptHash,
          acct.addressVersion
        )} but only have key of ${acct.address}.`
      );
    }
    return wallet.sign(txData, acct.privateKey);
  };
}

redpajama_set_name: RedPajamaGithub


text:
package org.auraframework.test.java.controller;

import java.util.Map;

import org.auraframework.def.ControllerDef;
import org.auraframework.def.DefDescriptor;
import org.auraframework.impl.AuraImplTestCase;
import org.auraframework.impl.javascript.controller.JavascriptActionDef;
import org.auraframework.impl.javascript.controller.JavascriptControllerDef;
import org.auraframework.impl.system.DefDescriptorImpl;

/**
 * Test class to verify implementation of Javascript Controllers for component.
 *
 * @hierarchy Aura.Components.Controllers
 * @priority medium
 * @userStory a0790000000DQHs
 */
public class JavascriptControllerDefTest extends AuraImplTestCase {
    public JavascriptControllerDefTest(String name) {
        super(name);
    }

    /**
     * Verify that Javascript Controller with comments is acceptable.
     *
     * @hierarchy Aura.Unit Tests.Json StreamReader
     * @userStorySyncIdOrName a07B0000000DUGnIAO
     * @priority medium
     * @throws Exception
     */
    public void testControllerWithComments() throws Exception {
        DefDescriptor<ControllerDef> descriptor = DefDescriptorImpl.getInstance(
                "js://test.test_JSController_WithComments", ControllerDef.class);
        ControllerDef def = descriptor.getDef();
        assertNotNull("Failed to fetch the definition of the Javascript Controller.", def);
        assertTrue(def instanceof JavascriptControllerDef);
        Map<String, JavascriptActionDef> actions = ((JavascriptControllerDef) def).getActionDefs();
        assertTrue("Expected there be only two action in the javascript controller.", actions.size() == 2);
        assertNotNull("Expected action not present.", actions.get("functionName1"));
        assertNotNull("Expected action not present.", actions.get("functionName2"));
    }

}


text:
@REM Copyright (c) Microsoft. All rights reserved.
@REM Licensed under the MIT license. See LICENSE file in the project root for full license information.

@setlocal EnableExtensions EnableDelayedExpansion
@echo off

set build-root=%~dp0..\..

cd %build-root%\tools\release\bump_version

call npm install
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!

node app.js


text:
package org.batfish.question.bgpproperties;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

import org.batfish.common.util.BatfishObjectMapper;
import org.batfish.datamodel.questions.BgpProcessPropertySpecifier;
import org.junit.Test;

/** Tests for {@link BgpProcessConfigurationQuestion} */
public class BgpProcessConfigurationQuestionTest {

  @Test
  public void testJsonSerialization() {
    BgpProcessConfigurationQuestion q =
        new BgpProcessConfigurationQuestion("nodes", BgpProcessPropertySpecifier.MULTIPATH_EBGP);
    assertThat(BatfishObjectMapper.clone(q, BgpProcessConfigurationQuestion.class), equalTo(q));
  }
}


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

using System.Threading;
using System.Threading.Tasks;

namespace Google.Cloud.Spanner.Data.CommonTesting
{
    public static class SessionPoolHelpers
    {
        public static async Task ShutdownPoolAsync(SpannerConnectionStringBuilder builder)
        {
            // Give this session pool up to 10 seconds to shut down, so we delete the extra sessions
            // and stop its maintenance loop.
            using (var connection = new SpannerConnection(builder))
            {
                var cancellationToken = new CancellationTokenSource(10000).Token;
                await connection.ShutdownSessionPoolAsync(cancellationToken);
            }
        }

        public static async Task ShutdownPoolAsync(string connectionString)
        {
            // Give this session pool up to 10 seconds to shut down, so we delete the extra sessions
            // and stop its maintenance loop.
            using (var connection = new SpannerConnection(connectionString))
            {
                var cancellationToken = new CancellationTokenSource(10000).Token;
                await connection.ShutdownSessionPoolAsync(cancellationToken);
            }
        }
    }
}


text:
package br.ufrn.mala.dto;

import java.io.Serializable;

/**
 * Created by Hugo Oliveira on 24/11/17.
 */

public class MaterialInformacionalDTO implements Serializable {

    private String autor;

    private String codigoBarras;

    private String colecao;

    private Long dataDisponivel;

    private Integer idBiblioteca;

    private Long idMaterialInformacional;

    private Integer idSituacaoMaterial;

    private Integer idStatusMaterial;

    private Integer idTipoMaterial;

    private String localizacao;

    private Integer registroSistema;

    private String titulo;

    private BibliotecaDTO biblioteca;

    private SituacaoMaterialDTO situacaoMaterial;

    private StatusMaterialDTO statusMaterial;

    private TipoMaterialDTO tipoMaterial;

    public String getAutor() { return autor; }

    public void setAutor(String autor) { this.autor = autor; }

    public String getCodigoBarras() { return codigoBarras; }

    public void setCodigoBarras(String codigoBarras) { this.codigoBarras = codigoBarras; }

    public String getColecao() { return colecao; }

    public void setColecao(String colecao) { this.colecao = colecao; }

    public Long getDataDisponivel() { return dataDisponivel; }

    public void setDataDisponivel(Long dataDisponivel) { this.dataDisponivel = dataDisponivel; }

    public Integer getIdBiblioteca() { return idBiblioteca; }

    public void setIdBiblioteca(Integer idBiblioteca) { this.idBiblioteca = idBiblioteca; }

    public Long getIdMaterialInformacional() { return idMaterialInformacional; }

    public void setIdMaterialInformacional(Long idMaterialInformacional) { this.idMaterialInformacional = idMaterialInformacional; }

    public Integer getIdSituacaoMaterial() { return idSituacaoMaterial; }

    public void setIdSituacaoMaterial(Integer idSituacaoMaterial) { this.idSituacaoMaterial = idSituacaoMaterial; }

    public Integer getIdStatusMaterial() { return idStatusMaterial; }

    public void setIdStatusMaterial(Integer idStatusMaterial) { this.idStatusMaterial = idStatusMaterial; }

    public Integer getIdTipoMaterial() { return idTipoMaterial; }

    public void setIdTipoMaterial(Integer idTipoMaterial) { this.idTipoMaterial = idTipoMaterial; }

    public String getLocalizacao() { return localizacao; }

    public void setLocalizacao(String localizacao) { this.localizacao = localizacao; }

    public Integer getRegistroSistema() { return registroSistema; }

    public void setRegistroSistema(Integer registroSistema) { this.registroSistema = registroSistema; }

    public String getTitulo() { return titulo; }

    public void setTitulo(String titulo) { this.titulo = titulo; }

    public BibliotecaDTO getBiblioteca() { return biblioteca; }

    public void setBiblioteca(BibliotecaDTO biblioteca) { this.biblioteca = biblioteca; }

    public SituacaoMaterialDTO getSituacaoMaterial() { return situacaoMaterial;  }

    public void setSituacaoMaterial(SituacaoMaterialDTO situacaoMaterial) { this.situacaoMaterial = situacaoMaterial; }

    public StatusMaterialDTO getStatusMaterial() { return statusMaterial; }

    public void setStatusMaterial(StatusMaterialDTO statusMaterial) { this.statusMaterial = statusMaterial; }

    public TipoMaterialDTO getTipoMaterial() { return tipoMaterial; }

    public void setTipoMaterial(TipoMaterialDTO tipoMaterial) { this.tipoMaterial = tipoMaterial; }
}


text:
This is the iOS SDK of Pitchtarget. This SDK is forked from adjust.io™ and it is
designed as a drop-in replacement for such SDK.

You can read more about adjust.io™ at [adjust.io].

## Basic Installation

These are the minimal steps required to integrate the adjust SDK into your
iOS project. We are going to assume that you use Xcode for your iOS
development.

If you're using [CocoaPods][cocoapods], you can add the following line to your
`Podfile` and continue with [step 3](#step3):

```ruby
pod 'Pitchtarget', :git => 'https://github.com/pitchtarget/adjust-ios-sdk', :branch => 'master'
```

### 1. Get the SDK

Clone this repository or generate a zipball. In the latter case, extract the
archive to a folder.

### 2. Add it to your project

In Xcode's Project Navigator locate the `Supporting Files` group (or any other
group of your choice). From Finder drag the `Adjust` subdirectory into
Xcode's `Supporting Files` group.

![][drag]

In the dialog `Choose options for adding these files` make sure to check the
checkbox to `Copy items into destination group's folder` and select the upper
radio button to `Create groups for any added folders`.

![][add]

### 3. Add the AdSupport framework

In the Project Navigator select your project. In the left hand side of the main
view select your target. In the tab `Build Phases` expand the group `Link
Binary with Libraries`. On the bottom of that group click on the `+` button.
Select the `AdSupport.framework` and click the `Add` button. In the list of
frameworks select the newly added `AdSupport.framework` and change the
attribute `Required` to `Optional`.

![][framework]

### 4. Integrate Pitchtarget into your app

In the Project Navigator open the source file your Application Delegate. Add
the `import` statement at the top of the file. In the `didFinishLaunching` or
`didFinishLaunchingWithOptions` method of your App Delegate add the following
calls to `Adjust`:

```objc
#import "Adjust.h"
// ...
[Adjust appDidLaunch:@"{YourAppToken}"];
[Adjust setLogLevel:AILogLevelInfo];
[Adjust setEnvironment:AIEnvironmentSandbox];
```
![][delegate]

Replace `{YourAppToken}` with your App Token that has been given to you.

You can increase or decrease the amount of logs you see by calling
`setLogLevel:` with one of the following parameters:

```objc
[Adjust setLogLevel:AILogLevelVerbose]; // enable all logging
[Adjust setLogLevel:AILogLevelDebug];   // enable more logging
[Adjust setLogLevel:AILogLevelInfo];    // the default
[Adjust setLogLevel:AILogLevelWarn];    // disable info logging
[Adjust setLogLevel:AILogLevelError];   // disable warnings as well
[Adjust setLogLevel:AILogLevelAssert];  // disable errors as well
```

Depending on whether or not you build your app for testing or for production
you must call `setEnvironment:` with one of these parameters:

```objc
[Adjust setEnvironment:AIEnvironmentSandbox];
[Adjust setEnvironment:AIEnvironmentProduction];
```

**Important:** This value should be set to `AIEnvironmentSandbox` if and only
if you or someone else is testing your app. Make sure to set the environment to
`AIEnvironmentProduction` just before you publish the app. Set it back to
`AIEnvironmentSandbox` when you start testing it again.

We use this environment to distinguish between real traffic and artificial
traffic from test devices. It is very important that you keep this value
meaningful at all times! Especially if you are tracking revenue.

### 5. Build your app

Build and run your app. If the build succeeds, you successfully integrated
Pitchtarget into your app. After the app launched, you should see the debug log
`Tracked session start`.

![][run]

#### Troubleshooting

- If your build failed with the error `Adjust requires ARC`, it looks like
  your project is not using [ARC][arc]. In that case we recommend
  [transitioning your project to use ARC][transition]. If you don't want to
  use ARC, you have to enable ARC for all source files of adjust in the
  target's Build Phases:

    Expand the `Compile Sources` group, select all adjust files (AjustIo,
    AI..., ...+AIAdditions, AF..., ...+AFNetworking) and change the `Compiler
    Flags` to `-fobjc-arc` (Select all and press the `Return` key to change
    all at once).

## Additional features

Once you integrated the Pitchtarget SDK into your project, you can take
advantage of the following features.

### 6. Add tracking of custom events.

You can tell Pitchtarget about every event you want. Suppose you want to track
every tap on a button. Just call you event `button_tap`. In your button's
`buttonDown` method you could then add the following line to track the click:

```objc
[Adjust trackEvent:@"button_tap"];
```
You can also append and other custom paramters to any event you track. Just put
some key-value pairs in a dictionary and pass them to the `trackEvent` method.

For example, if you want to send more data about your button tap event, add the
following lines:

```objc
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[parameters setObject:@"value" forKey:@"key"];
[parameters setObject:@"bar"   forKey:@"foo"];
[Adjust trackEvent:@"abc123" withParameters:parameters];
```

In that case we would track the event and send a request to:

    http://www.adeven.com/callback?key=value&foo=bar

It should be mentioned that we support a variety of placeholders like `{idfa}`
that can be used as parameter values. In the resulting callback this
placeholder would be replaced with the ID for Advertisers of the current
device. Also note that we don't store any of your custom parameters, but only
append them to your callbacks. If you haven't registered a callback for an
event, these parameters won't even be read.

### 7. Add tracking of revenue

If your users can generate revenue by clicking on advertisements or making
in-app purchases you can track those revenues. If, for example, a click is
worth one cent, you could make the following call to track that revenue:

```objc
[Adjust trackRevenue:1.0];
```

The parameter is supposed to be in cents and will get rounded to one decimal
point. If you want to differentiate between different kinds of revenue you can
simply use different event names for each kind. In that case you would make a
call like this:

```objc
[Adjust trackRevenue:1.0 forEvent:@"button_tap"];
```

Again, you can send custom parameters as you would do with normal events.

```objc
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[parameters setObject:@"value" forKey:@"key"];
[parameters setObject:@"bar"   forKey:@"foo"];
[Adjust trackRevenue:1.0 forEvent:@"button_tap" withParameters:parameters];
```

If you want to track In-App Purchases, please make sure to call `trackRevenue`
after `finishTransaction` in `paymentQueue:updatedTransaction` only if the
state changed to `SKPaymentTransactionStatePurchased`:

```objc
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions {
    for (SKPaymentTransaction *transaction in transactions) {
        switch (transaction.transactionState) {
            case SKPaymentTransactionStatePurchased:
                [self finishTransaction:transaction];
                [Adjust trackRevenue:...];
                break;
            // more cases
        }
    }
}
```

### 8. Receive delegate callbacks

Every time your app tries to track a session, an event or some revenue, you can
be notified about the success of that operation and receive additional
information about the current install. Follow these steps to implement the
optional delegate protocol in your app delegate.

1. Open `AppDelegate.h` and add the `Adjust.h` import and the `AdjustDelegate`
   declaration.

    ```objc
    #import "Adjust.h"

    @interface AppDelegate : UIResponder <UIApplicationDelegate, AdjustDelegate>
    ```

2. Open `AppDelegate.m` and set the adjust delegate in `didFinishLaunching`
   where you already set the adjust environment.

    ```objc
    [Adjust setEnvironment:AIEnvironmentSandbox];
    [Adjust setDelegate:self];
    ```

3. Still in `AppDelegate.m` add the following delegate callback function to
   your app delegate implementation.

    ```objc
    - (void)adjustFinishedTrackingWithResponse:(AIResponseData *)responseData {
    }
    ```

4. Implement the delegate function.

The delegate function will get called every time any activity was tracked or
failed to track. Within the delegate function you have access to the
`responseData` parameter. Here is a quick summary of its attributes:

- `AIActivityKind activityKind` indicates what kind of activity
  was tracked. It has one of these values:

    ```
    AIActivityKindSession
    AIActivityKindEvent
    AIActivityKindRevenue
    ```

- `NSString activityKindString` human readable version of the activity kind. Possible values:

    ```
    session
    event
    revenue
    ```

- `BOOL success` indicates whether or not the tracking attempt was
  successful.
- `BOOL willRetry` is true when the request failed, but will be
  retried.
- `NSString error` an error message when the activity failed to track or
  the response could not be parsed. Is `nil` otherwise.
- `NSString trackerToken` the tracker token of the current install. Is `nil` if
  request failed or response could not be parsed.
- `NSString trackerName` the tracker name of the current install. Is `nil` if
  request failed or response could not be parsed.

### 9. Enable event buffering

If your app makes heavy use of event tracking, you might want to delay some
HTTP requests in order to send them in one batch every minute. You can enable
event buffering by adding the following line after your `setEnvironment:` call
in the `didFinishLaunching` method of your Application Delegate:

```objc
[Adjust setEventBufferingEnabled:YES];
```

[adjust.io]: http://adjust.io
[cocoapods]: http://cocoapods.org
[arc]: http://en.wikipedia.org/wiki/Automatic_Reference_Counting
[transition]: http://developer.apple.com/library/mac/#releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html
[drag]: https://raw.github.com/adeven/adjust_sdk/master/Resources/ios/drag3.png
[add]: https://raw.github.com/adeven/adjust_sdk/master/Resources/ios/add2.png
[framework]: https://raw.github.com/adeven/adjust_sdk/master/Resources/ios/framework2.png
[delegate]: https://raw.github.com/adeven/adjust_sdk/master/Resources/ios/delegate3.png
[run]: https://raw.github.com/adeven/adjust_sdk/master/Resources/ios/run3.png

## License

The adjust-sdk is licensed under the MIT License.

Copyright (c) 2012-2013 adeven GmbH,
http://www.adeven.com

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


text:
extern crate genmesh;
extern crate obj;
extern crate fnv;

pub mod resource_system;
pub mod file_system;


text:
package ru.job4j2.lambda;

import org.junit.Assert;
import org.junit.Test;

import java.util.Arrays;
import java.util.List;

import static org.hamcrest.core.Is.is;
/**
 * Checking converting matrix with Integer values to list.
 *
 * @author v.ivanov
 * @version 1
 * @since 12.01.2020
 */
public class MatrixToList {

    /** Field instance of LambdaUtils.*/
    private LambdaUtils<Integer> utils = new LambdaUtils<>();

    /**
     * Method to check converting matrix to list.
     */
    @Test
    public void checkConvertMatrixToList() {
        Integer[][] intArr = new Integer[][] {
                {1, 2, 3, 4, 5},
                {9, 8, 7, 6},
                {10, 11, 12}
        };
        List<Integer> actualList = utils.convertMatrixToList(intArr);
        List<Integer> expectedList = Arrays.asList(1, 2, 3, 4, 5, 9, 8, 7, 6, 10, 11, 12);
        Assert.assertThat(actualList, is(expectedList));
    }
}


text:
package android.nized.org.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.google.android.gms.games.internal.constants.RequestStatus;
import com.loopj.android.http.RequestParams;

import java.io.Serializable;
import java.util.Date;

@JsonSerialize
@JsonDeserialize
@JsonIgnoreProperties(ignoreUnknown = true)
public class ClassBonus implements Serializable {
    private String email;
	private int class_bonus_id;
	private String course_code;
	private String semester;
    private Date createdAt;
    private Date updatedAt;

    public int getClass_bonus_id() {
		return class_bonus_id;
	}

	public void setClass_bonus_id(int id) {
		this.class_bonus_id = id;
	}

	public String getCourseCode() {
		return course_code;
	}

	public void setCourseCode(String courseCode) {
		this.course_code = courseCode;
	}

	public String getSemester() {
		return semester;
	}

	public void setSemester(String semester) {
		this.semester = semester;
	}

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getCourse_code() {
        return course_code;
    }

    public void setCourse_code(String course_code) {
        this.course_code = course_code;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    @Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((course_code == null) ? 0 : course_code.hashCode());
		result = prime * result + class_bonus_id;
		result = prime * result + ((semester == null) ? 0 : semester.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		ClassBonus other = (ClassBonus) obj;
		if (course_code == null) {
			if (other.course_code != null) {
				return false;
			}
		} else if (!course_code.equals(other.course_code)) {
			return false;
		}
		if (class_bonus_id != other.class_bonus_id) {
			return false;
		}
		if (semester == null) {
			if (other.semester != null) {
				return false;
			}
		} else if (!semester.equals(other.semester)) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return course_code + ", " + semester;
	}

    public RequestParams getPersonRequestParams() {
        RequestParams requestParams = new RequestParams();
        requestParams.put("class_bonus_id", class_bonus_id);
        requestParams.put("email", email);

        return requestParams;
    }

    public RequestParams getRequestParams() {
        RequestParams requestParams = new RequestParams();
        requestParams.put("course_code", course_code);
        requestParams.put("semester", semester);

        return requestParams;
    }
}


text:
using System;
using System.Threading;
using NServiceBus;
using NServiceBus.Logging;

#region handler
public class Handler1 : IHandleMessages<Message>
{
    static ILog logger = LogManager.GetLogger(typeof(Handler1));
    static Random random = new Random();

    public void Handle(Message message)
    {
        int milliseconds = random.Next(100, 1000);
        logger.InfoFormat("Message received going to Thread.Sleep({0}ms)", milliseconds);
        Thread.Sleep(milliseconds);
    }
}
#endregion


text:
b3j0f.utils.property module
===========================

.. automodule:: b3j0f.utils.property
    :members:
    :undoc-members:
    :show-inheritance:


text:
namespace sysinfo {

	// flags
	enum { ROTATE, ZOOM } RotateMode;

	// window information
	unsigned int WINX = 0, WINY = 0, WIDTH = 800, HEIGHT = 800;

	// background color
	bool bgchange = false;
	float bgcolor[] = { 0.0, 0.0, 0.5, 0, 0, 0 };

	// fps debugging
	icg::FrameCounter fps;
	std::stringstream title;

};

namespace model {

	//! camera and light
	icg::Camera cam_main(icg::Camera::CameraMode::PERSPECTIVE);
	icg::Camera* camera = &cam_main;
	icg::LightObject light;
	icg::TerrainObject terrain;
	icg::NoiseObject noise;

};

#endif//_GLOBALVAR_H_


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Globals
{
    public class TimeUtility
    {
        public static string ConvertirTime(string hora)
        {
            string horaconvertida = "";
            if (hora.Contains("M"))
            {
                horaconvertida = hora.Replace("PT", "").Replace("H", ":").Replace("M", "");
            }
            else
            {
                horaconvertida = hora.Replace("PT", "").Replace("H", ":00");
            }
            return horaconvertida;
        }
        public static bool OverLapTime(DateTime tStartA, DateTime tEndA, DateTime tStartB, DateTime tEndB)
        {
            return (tStartA < tEndB && tStartB < tEndA);
        }
    }
}


text:
package com.sun.jini.test.spec.lookupservice.test_set02;
import com.sun.jini.qa.harness.QAConfig;

import java.util.logging.Level;

import com.sun.jini.qa.harness.TestException;
import net.jini.core.lookup.ServiceTemplate;
import java.rmi.RemoteException;

/**
 * This class is used to verify that doing a notify with a bad transition
 * results in an IllegalArgumentException.
 */
public class NotifyBadTransition extends NotifyExceptionTest {

    public void run() throws Exception {
	try {
	    getProxy().notify(new ServiceTemplate(null, null, null),
			      1<<5, listener, null, Long.MAX_VALUE);
	    throw new TestException("notify did not "
				  + "throw IllegalArgumentException");
	} catch (IllegalArgumentException e) {
	}
    }
}


text:
![](IMG_0409.jpg)

## My Whitepapers on Hacking the XBOX Kinect

* [On Depth Sensors Applications for Computational Photography and Vision.](http://www.astro.sunysb.edu/steinkirch/reviews/kin_pho.pdf)
* [On How to Get Started with the XBOX Kinect in Linux.](http://www.astro.sunysb.edu/steinkirch/reviews/review_kinect_marina.pdf)

## My Whitepapers on Computational Photography

* [On Gradient-domain Fusion of Pictures.](http://www.astro.sunysb.edu/steinkirch/reviews/comp_hw2.pdf)
* [On Face Morphism.](http://www.astro.sunysb.edu/steinkirch/reviews/comp_hw3.pdf)
* [On Automatic Colorization of Greyscale Faces.](https://github.com/bt3gl/Computational_Photography)

----

## License

When making a reference to my work, please use my [website](http://bt3gl.github.io/index.html).

This work is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-sa/4.0/).


text:
package com.gh.mygreen.xlsmapper.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import com.gh.mygreen.xlsmapper.fieldprocessor.RecordFinder;

/**
 * {@link XlsHorizontalRecords}や{@link XlsVerticalRecords}の読み込み時において、
 * データレコードの開始位置が既存のアノテーションの属性だと表現できない場合に
 * 任意の実装方法を指定するようにします。
 *
 *
属性{@link #value()} で、レコードの開始位置を検索する {@link RecordFinder} の実装クラスを指定します。

 *
属性{@link #args()} で、レコードの開始位置を検索する実装クラスに渡す引数を指定します。

 *
 *

 * {@literal @XlsSheet(name="Users")}
 * // マッピングの定義
 * public class SampleSheet {
 *
 *     // クラスAに対するマッピング定義
 *     {@literal @XlsOrder(1)}
 *     // マッピングの終了条件が、「クラスB」であるため、terminalLabelを指定します。汎用的に正規表現で指定します。
 *     {@literal @XlsHorizontalRecords(tableLabel="成績一覧", bottom=2, terminal=RecordTerminal.Border, terminateLabel="/クラス.+/")}
 *     // クラスAの見出しを探すために、属性argsでクラス名を指定します。
 *     {@literal @XlsRecordFinder(value=ClassNameRecordFinder.class, args="クラスA")}
 *     private {@literal List<UserRecord>} classA;
 *
 *     // クラスBに対するマッピング定義
 *     {@literal @XlsOrder(2)}
 *     // マッピングの終了条件が、終端のセルに罫線があるのため、terminalを指定します。
 *     {@literal @XlsHorizontalRecords(tableLabel="成績一覧", bottom=2, terminal=RecordTerminal.Border, terminateLabel="/クラス.+/")}
 *     // クラスAの見出しを探すために、属性argsでクラス名を指定します。
 *     {@literal @XlsRecordFinder(value=ClassNameRecordFinder.class, args="クラスB")}
 *     private {@literal List<UserRecord>} classB;
 * }
 *
 * // クラス用の見出しのレコードを探すクラス
 * public class ClassNameRecordFinder implements RecordFinder {
 *
 *     {@literal @Override}
 *     public CellPosition find(ProcessCase processCase, String[] args, Sheet sheet,
 *             CellPosition initAddress, Object beanObj, Configuration config) {
 *
 *         // アノテーション {@literal XlsRecordFinder}の属性argsで指定された値を元にセルを検索します。
 *         final String className = args[0];
 *         Cell classNameCell = CellFinder.query(sheet, className, config)
 *                 .startPosition(initAddress)
 *                 .findWhenNotFoundException();
 *
 *         // 見出し用のセルから1つ下がデータレコードの開始位置
 *         return CellPosition.of(classNameCell.getRowIndex()+1, initAddress.getColumn());
 *     }
 *
 * }
 *
 * // ユーザレコードの定義
 * public class UserRecord {
 *
 *     {@literal @XlsColumn(columnName="No.", optional=true)}
 *     private int no;
 *
 *     {@literal @XlsColumn(columnName="氏名")}
 *     private String name;
 *
 *     {@literal @XlsColumn(columnName="算数")}
 *     private Integer sansu;
 *
 *     {@literal @XlsColumn(columnName="国語")}
 *     private Integer kokugo;
 *
 *     {@literal @XlsColumn(columnName="合計")}
 *     {@literal @XlsFormula(value="SUM(D{rowNumber}:E{rowNumber})", primary=true)}
 *     private Integer sum;
 *
 *     {@literal @XlsIgnorable}
 *     public boolean isEmpty() {
 *         return IsEmptyBuilder.reflectionIsEmpty(this, "positions", "labels", "no");
 *     }
 *
 *     // getter、setterは省略
 *
 * }
 *

 *
 *

 *
 *
任意の位置のレコードをマッピングする場合

 *

 *
 * @since 2.0
 * @author T.TSUCHIE
 *
 */
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface XlsRecordFinder {

    /**
     * {@link RecordFinder}の実装クラスを指定します。
     * @return {@link RecordFinder}の実装クラス。
     */
    Class<? extends RecordFinder> value();

    /**
     * {@link RecordFinder}に渡す引数を指定します。
     * @return {@link RecordFinder}に渡す引数。
     */
    String[] args() default {};

}


text:
set -e

yarn global add grunt-cli@1.2.0

mkdir -p "$LOGS_DIR"

if [ "$JOB" != "ci-checks" ]; then
  echo "start_browser_provider"
  ./scripts/travis/start_browser_provider.sh
fi

# ci-checks and unit tests do not run against the packaged code
if [[ "$JOB" != "ci-checks" ]] && [[ "$JOB" != unit-* ]]; then
  grunt package
fi

# unit runs the docs tests too which need a built version of the code
if [[ "$JOB" = unit-* ]]; then
  grunt validate-angular-files
  grunt build
fi

# check this after the package, because at this point the browser_provider
# has probably arrived
if [ "$JOB" != "ci-checks" ]; then
  echo "wait_for_browser_provider"
  ./scripts/travis/wait_for_browser_provider.sh
fi


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

#nullable disable

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;

namespace RunTests
{
    internal readonly struct ProcDumpInfo
    {
        private const string KeyProcDumpFilePath = "ProcDumpFilePath";
        private const string KeyProcDumpDirectory = "ProcDumpOutputPath";
        private const string KeyProcDumpSecondaryDirectory = "ProcDumpSecondaryOutputPath";

        internal string ProcDumpFilePath { get; }
        internal string DumpDirectory { get; }
        internal string SecondaryDumpDirectory { get; }

        internal ProcDumpInfo(string procDumpFilePath, string dumpDirectory, string secondaryDumpDirectory)
        {
            Debug.Assert(Path.IsPathRooted(procDumpFilePath));
            Debug.Assert(Path.IsPathRooted(dumpDirectory));
            Debug.Assert(Path.IsPathRooted(secondaryDumpDirectory));
            ProcDumpFilePath = procDumpFilePath;
            DumpDirectory = dumpDirectory;
            SecondaryDumpDirectory = secondaryDumpDirectory;
        }

        internal void WriteEnvironmentVariables(Dictionary<string, string> environment)
        {
            environment[KeyProcDumpFilePath] = ProcDumpFilePath;
            environment[KeyProcDumpDirectory] = DumpDirectory;
            environment[KeyProcDumpSecondaryDirectory] = SecondaryDumpDirectory;
        }

        internal static ProcDumpInfo? ReadFromEnvironment()
        {
            bool validate(string s) => !string.IsNullOrEmpty(s) && Path.IsPathRooted(s);

            var procDumpFilePath = Environment.GetEnvironmentVariable(KeyProcDumpFilePath);
            var dumpDirectory = Environment.GetEnvironmentVariable(KeyProcDumpDirectory);
            var secondaryDumpDirectory = Environment.GetEnvironmentVariable(KeyProcDumpSecondaryDirectory);

            if (!validate(procDumpFilePath) || !validate(dumpDirectory) || !validate(secondaryDumpDirectory))
            {
                return null;
            }

            return new ProcDumpInfo(procDumpFilePath, dumpDirectory, secondaryDumpDirectory);
        }
    }

    internal static class ProcDumpUtil
    {
        internal static Process AttachProcDump(ProcDumpInfo procDumpInfo, int processId)
        {
            return AttachProcDump(procDumpInfo.ProcDumpFilePath, processId, procDumpInfo.DumpDirectory);
        }

        internal static string GetProcDumpCommandLine(int processId, string dumpDirectory)
        {
            // /accepteula command line option to automatically accept the Sysinternals license agreement.
            // -ma	Write a 'Full' dump file. Includes All the Image, Mapped and Private memory.
            // -e	Write a dump when the process encounters an unhandled exception. Include the 1 to create dump on first chance exceptions.
            // -f C00000FD.STACK_OVERFLOWC Dump when a stack overflow first chance exception is encountered.
            const string procDumpSwitches = "/accepteula -ma -e -f C00000FD.STACK_OVERFLOW";
            dumpDirectory = dumpDirectory.TrimEnd('\\');
            return $" {procDumpSwitches} {processId} \"{dumpDirectory}\"";
        }

        /// <summary>
        /// Attaches a new procdump.exe against the specified process.
        /// </summary>
        /// <param name="procDumpFilePath">The path to the procdump executable</param>
        /// <param name="processId">process id</param>
        /// <param name="dumpDirectory">destination directory for dumps</param>
        internal static Process AttachProcDump(string procDumpFilePath, int processId, string dumpDirectory)
        {
            Directory.CreateDirectory(dumpDirectory);
            return Process.Start(procDumpFilePath, GetProcDumpCommandLine(processId, dumpDirectory));
        }
    }
}


text:
@interface ZZZMainViewController ()

@end

@implementation ZZZMainViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
       [self.tabBar setHidden:YES];
    }
    return self;
}

-(void)loadSubVCs{
   ZZZSilentViewController *vc1 = [[ZZZSilentViewController alloc]init];
   UINavigationController *silentNav = [[UINavigationController alloc] initWithRootViewController:vc1];
   [silentNav setNavigationBarHidden:YES]; // vc3初始化的时候还没有navigaitionbar,所以要在这里控制navigationbar

   ZZZFriendsViewController *vc2 = [[ZZZFriendsViewController alloc]init];
   UINavigationController *friendsNav = [[UINavigationController alloc] initWithRootViewController:vc2];
   [friendsNav setNavigationBarHidden:YES]; // vc3初始化的时候还没有navigaitionbar,所以要在这里控制navigationbar

   ZZZMeViewController *vc3 = [[ZZZMeViewController alloc]init];
   UINavigationController *meNav = [[UINavigationController alloc] initWithRootViewController:vc3];
   [meNav setNavigationBarHidden:YES]; // vc3初始化的时候还没有navigaitionbar,所以要在这里控制navigationbar

   //将这几个VC放入数组
   NSArray *viewControllers = @[silentNav, friendsNav, meNav];

   //数组添加到tabBarController
   //self 既是tabBarController
   //tabBarController.viewControllers  = viewControllers;
   [self setViewControllers:viewControllers animated:YES];
}

-(void)loadView
{
   [super loadView];
   [self loadSubVCs];
   [self createTabBar];
}

- (void)viewDidLoad
{
    [super viewDidLoad];

   //如果没有登录,则弹出登录模态页
   //
	// Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark Custom TabBar

-(void)createTabBar
{
   //自定义tabbar背景
   _screenHeight = [UIScreen mainScreen].bounds.size.height;
   _screenWidth = [UIScreen mainScreen].bounds.size.width;
   NSLog(@"screen size: %ld,%ld", (long)_screenHeight, (long)_screenWidth);

   UIView *customTabBarView = [[UIView alloc] initWithFrame:CGRectMake(0, _screenHeight-49, _screenWidth, 49)];
   customTabBarView.backgroundColor = [UIColor colorWithRed:(58/255.0) green:(63/255.0) blue:(70/255.0) alpha:1]; //tab背景灰
   [self.view addSubview:customTabBarView];

   //自定义的tabbar响应触摸事件
   [customTabBarView isUserInteractionEnabled];

   // a line
   UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, 0, _screenWidth, 2)];
   line.backgroundColor = [UIColor colorWithRed:(18/255.0) green:(156/255.0) blue:(154/255.0) alpha:1];
   [customTabBarView addSubview:line];

   // 添加button的选中样式
   _selectedButton = [[UIView alloc] initWithFrame:CGRectMake(0, 0, _screenWidth/3.0, 8)];
   _selectedButton.backgroundColor = [UIColor colorWithRed:(18/255.0) green:(156/255.0) blue:(154/255.0) alpha:1];
   [customTabBarView addSubview:_selectedButton];

   //自定义tabBar按钮
   float add = 0;
   for (int index = 0; index<=2; index++) {
      UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(add, 0, _screenWidth/3.0, 49)];
      button.tag = index;

      switch (index) {
         case 0:
            [button setTitle:@"SILENT" forState:UIControlStateNormal];
            break;
         case 1:
            [button setTitle:@"FRIENDS" forState:UIControlStateNormal];
            break;
         case 2:
            [button setTitle:@"ME" forState:UIControlStateNormal];
            break;
         default:
            break;
      }

      button.titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:15];
      button.backgroundColor = [UIColor colorWithRed:(63/255.0) green:(70/255.0) blue:(78/255.0) alpha:0];
      [button addTarget:self action:@selector(clickBarButton:) forControlEvents:UIControlEventTouchUpInside];
      [customTabBarView addSubview:button];
      add = add + _screenWidth/3.0;
   }

}

-(void)clickBarButton:(UIButton *)button
{
   // 按照index选择哪个tab被选中(selected)
   self.selectedIndex = button.tag;
   // 选中的index button样式会变
   [_selectedButton setFrame:CGRectMake(_screenWidth*(button.tag)/3.0, 0, _screenWidth/3.0, 8)];
}

@end