text:
package com.google.cloud.dialogflow.v2.stub;

import static com.google.cloud.dialogflow.v2.ParticipantsClient.ListLocationsPagedResponse;
import static com.google.cloud.dialogflow.v2.ParticipantsClient.ListParticipantsPagedResponse;

import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.core.BackgroundResourceAggregation;
import com.google.api.gax.grpc.GrpcCallSettings;
import com.google.api.gax.grpc.GrpcStubCallableFactory;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.dialogflow.v2.AnalyzeContentRequest;
import com.google.cloud.dialogflow.v2.AnalyzeContentResponse;
import com.google.cloud.dialogflow.v2.CreateParticipantRequest;
import com.google.cloud.dialogflow.v2.GetParticipantRequest;
import com.google.cloud.dialogflow.v2.ListParticipantsRequest;
import com.google.cloud.dialogflow.v2.ListParticipantsResponse;
import com.google.cloud.dialogflow.v2.Participant;
import com.google.cloud.dialogflow.v2.SuggestArticlesRequest;
import com.google.cloud.dialogflow.v2.SuggestArticlesResponse;
import com.google.cloud.dialogflow.v2.SuggestFaqAnswersRequest;
import com.google.cloud.dialogflow.v2.SuggestFaqAnswersResponse;
import com.google.cloud.dialogflow.v2.SuggestSmartRepliesRequest;
import com.google.cloud.dialogflow.v2.SuggestSmartRepliesResponse;
import com.google.cloud.dialogflow.v2.UpdateParticipantRequest;
import com.google.cloud.location.GetLocationRequest;
import com.google.cloud.location.ListLocationsRequest;
import com.google.cloud.location.ListLocationsResponse;
import com.google.cloud.location.Location;
import com.google.common.collect.ImmutableMap;
import com.google.longrunning.stub.GrpcOperationsStub;
import io.grpc.MethodDescriptor;
import io.grpc.protobuf.ProtoUtils;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
 * gRPC stub implementation for the Participants service API.
 *
 * <p>This class is for advanced usage and reflects the underlying API directly.
 */
@Generated("by gapic-generator-java")
public class GrpcParticipantsStub extends ParticipantsStub {
  private static final MethodDescriptor<CreateParticipantRequest, Participant>
      createParticipantMethodDescriptor =
          MethodDescriptor.<CreateParticipantRequest, Participant>newBuilder()
              .setType(MethodDescriptor.MethodType.UNARY)
              .setFullMethodName("google.cloud.dialogflow.v2.Participants/CreateParticipant")
              .setRequestMarshaller(
                  ProtoUtils.marshaller(CreateParticipantRequest.getDefaultInstance()))
              .setResponseMarshaller(ProtoUtils.marshaller(Participant.getDefaultInstance()))
              .build();

  private static final MethodDescriptor<GetParticipantRequest, Participant>
      getParticipantMethodDescriptor =
          MethodDescriptor.<GetParticipantRequest, Participant>newBuilder()
              .setType(MethodDescriptor.MethodType.UNARY)
              .setFullMethodName("google.cloud.dialogflow.v2.Participants/GetParticipant")
              .setRequestMarshaller(
                  ProtoUtils.marshaller(GetParticipantRequest.getDefaultInstance()))
              .setResponseMarshaller(ProtoUtils.marshaller(Participant.getDefaultInstance()))
              .build();

  private static final MethodDescriptor<ListParticipantsRequest, ListParticipantsResponse>
      listParticipantsMethodDescriptor =
          MethodDescriptor.<ListParticipantsRequest, ListParticipantsResponse>newBuilder()
              .setType(MethodDescriptor.MethodType.UNARY)
              .setFullMethodName("google.cloud.dialogflow.v2.Participants/ListParticipants")
              .setRequestMarshaller(
                  ProtoUtils.marshaller(ListParticipantsRequest.getDefaultInstance()))
              .setResponseMarshaller(
                  ProtoUtils.marshaller(ListParticipantsResponse.getDefaultInstance()))
              .build();

  private static final MethodDescriptor<UpdateParticipantRequest, Participant>
      updateParticipantMethodDescriptor =
          MethodDescriptor.<UpdateParticipantRequest, Participant>newBuilder()
              .setType(MethodDescriptor.MethodType.UNARY)
              .setFullMethodName("google.cloud.dialogflow.v2.Participants/UpdateParticipant")
              .setRequestMarshaller(
                  ProtoUtils.marshaller(UpdateParticipantRequest.getDefaultInstance()))
              .setResponseMarshaller(ProtoUtils.marshaller(Participant.getDefaultInstance()))
              .build();

  private static final MethodDescriptor<AnalyzeContentRequest, AnalyzeContentResponse>
      analyzeContentMethodDescriptor =
          MethodDescriptor.<AnalyzeContentRequest, AnalyzeContentResponse>newBuilder()
              .setType(MethodDescriptor.MethodType.UNARY)
              .setFullMethodName("google.cloud.dialogflow.v2.Participants/AnalyzeContent")
              .setRequestMarshaller(
                  ProtoUtils.marshaller(AnalyzeContentRequest.getDefaultInstance()))
              .setResponseMarshaller(
                  ProtoUtils.marshaller(AnalyzeContentResponse.getDefaultInstance()))
              .build();

  private static final MethodDescriptor<SuggestArticlesRequest, SuggestArticlesResponse>
      suggestArticlesMethodDescriptor =
          MethodDescriptor.<SuggestArticlesRequest, SuggestArticlesResponse>newBuilder()
              .setType(MethodDescriptor.MethodType.UNARY)
              .setFullMethodName("google.cloud.dialogflow.v2.Participants/SuggestArticles")
              .setRequestMarshaller(
                  ProtoUtils.marshaller(SuggestArticlesRequest.getDefaultInstance()))
              .setResponseMarshaller(
                  ProtoUtils.marshaller(SuggestArticlesResponse.getDefaultInstance()))
              .build();

  private static final MethodDescriptor<SuggestFaqAnswersRequest, SuggestFaqAnswersResponse>
      suggestFaqAnswersMethodDescriptor =
          MethodDescriptor.<SuggestFaqAnswersRequest, SuggestFaqAnswersResponse>newBuilder()
              .setType(MethodDescriptor.MethodType.UNARY)
              .setFullMethodName("google.cloud.dialogflow.v2.Participants/SuggestFaqAnswers")
              .setRequestMarshaller(
                  ProtoUtils.marshaller(SuggestFaqAnswersRequest.getDefaultInstance()))
              .setResponseMarshaller(
                  ProtoUtils.marshaller(SuggestFaqAnswersResponse.getDefaultInstance()))
              .build();

  private static final MethodDescriptor<SuggestSmartRepliesRequest, SuggestSmartRepliesResponse>
      suggestSmartRepliesMethodDescriptor =
          MethodDescriptor.<SuggestSmartRepliesRequest, SuggestSmartRepliesResponse>newBuilder()
              .setType(MethodDescriptor.MethodType.UNARY)
              .setFullMethodName("google.cloud.dialogflow.v2.Participants/SuggestSmartReplies")
              .setRequestMarshaller(
                  ProtoUtils.marshaller(SuggestSmartRepliesRequest.getDefaultInstance()))
              .setResponseMarshaller(
                  ProtoUtils.marshaller(SuggestSmartRepliesResponse.getDefaultInstance()))
              .build();

  private static final MethodDescriptor<ListLocationsRequest, ListLocationsResponse>
      listLocationsMethodDescriptor =
          MethodDescriptor.<ListLocationsRequest, ListLocationsResponse>newBuilder()
              .setType(MethodDescriptor.MethodType.UNARY)
              .setFullMethodName("google.cloud.location.Locations/ListLocations")
              .setRequestMarshaller(
                  ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance()))
              .setResponseMarshaller(
                  ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance()))
              .build();

  private static final MethodDescriptor<GetLocationRequest, Location> getLocationMethodDescriptor =
      MethodDescriptor.<GetLocationRequest, Location>newBuilder()
          .setType(MethodDescriptor.MethodType.UNARY)
          .setFullMethodName("google.cloud.location.Locations/GetLocation")
          .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance()))
          .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance()))
          .build();

  private final UnaryCallable<CreateParticipantRequest, Participant> createParticipantCallable;
  private final UnaryCallable<GetParticipantRequest, Participant> getParticipantCallable;
  private final UnaryCallable<ListParticipantsRequest, ListParticipantsResponse>
      listParticipantsCallable;
  private final UnaryCallable<ListParticipantsRequest, ListParticipantsPagedResponse>
      listParticipantsPagedCallable;
  private final UnaryCallable<UpdateParticipantRequest, Participant> updateParticipantCallable;
  private final UnaryCallable<AnalyzeContentRequest, AnalyzeContentResponse> analyzeContentCallable;
  private final UnaryCallable<SuggestArticlesRequest, SuggestArticlesResponse>
      suggestArticlesCallable;
  private final UnaryCallable<SuggestFaqAnswersRequest, SuggestFaqAnswersResponse>
      suggestFaqAnswersCallable;
  private final UnaryCallable<SuggestSmartRepliesRequest, SuggestSmartRepliesResponse>
      suggestSmartRepliesCallable;
  private final UnaryCallable<ListLocationsRequest, ListLocationsResponse> listLocationsCallable;
  private final UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse>
      listLocationsPagedCallable;
  private final UnaryCallable<GetLocationRequest, Location> getLocationCallable;

  private final BackgroundResource backgroundResources;
  private final GrpcOperationsStub operationsStub;
  private final GrpcStubCallableFactory callableFactory;

  public static final GrpcParticipantsStub create(ParticipantsStubSettings settings)
      throws IOException {
    return new GrpcParticipantsStub(settings, ClientContext.create(settings));
  }

  public static final GrpcParticipantsStub create(ClientContext clientContext) throws IOException {
    return new GrpcParticipantsStub(ParticipantsStubSettings.newBuilder().build(), clientContext);
  }

  public static final GrpcParticipantsStub create(
      ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException {
    return new GrpcParticipantsStub(
        ParticipantsStubSettings.newBuilder().build(), clientContext, callableFactory);
  }

  /**
   * Constructs an instance of GrpcParticipantsStub, using the given settings. This is protected so
   * that it is easy to make a subclass, but otherwise, the static factory methods should be
   * preferred.
   */
  protected GrpcParticipantsStub(ParticipantsStubSettings settings, ClientContext clientContext)
      throws IOException {
    this(settings, clientContext, new GrpcParticipantsCallableFactory());
  }

  /**
   * Constructs an instance of GrpcParticipantsStub, using the given settings. This is protected so
   * that it is easy to make a subclass, but otherwise, the static factory methods should be
   * preferred.
   */
  protected GrpcParticipantsStub(
      ParticipantsStubSettings settings,
      ClientContext clientContext,
      GrpcStubCallableFactory callableFactory)
      throws IOException {
    this.callableFactory = callableFactory;
    this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory);

    GrpcCallSettings<CreateParticipantRequest, Participant> createParticipantTransportSettings =
        GrpcCallSettings.<CreateParticipantRequest, Participant>newBuilder()
            .setMethodDescriptor(createParticipantMethodDescriptor)
            .setParamsExtractor(
                request -> {
                  ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
                  params.put("parent", String.valueOf(request.getParent()));
                  return params.build();
                })
            .build();
    GrpcCallSettings<GetParticipantRequest, Participant> getParticipantTransportSettings =
        GrpcCallSettings.<GetParticipantRequest, Participant>newBuilder()
            .setMethodDescriptor(getParticipantMethodDescriptor)
            .setParamsExtractor(
                request -> {
                  ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
                  params.put("name", String.valueOf(request.getName()));
                  return params.build();
                })
            .build();
    GrpcCallSettings<ListParticipantsRequest, ListParticipantsResponse>
        listParticipantsTransportSettings =
            GrpcCallSettings.<ListParticipantsRequest, ListParticipantsResponse>newBuilder()
                .setMethodDescriptor(listParticipantsMethodDescriptor)
                .setParamsExtractor(
                    request -> {
                      ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
                      params.put("parent", String.valueOf(request.getParent()));
                      return params.build();
                    })
                .build();
    GrpcCallSettings<UpdateParticipantRequest, Participant> updateParticipantTransportSettings =
        GrpcCallSettings.<UpdateParticipantRequest, Participant>newBuilder()
            .setMethodDescriptor(updateParticipantMethodDescriptor)
            .setParamsExtractor(
                request -> {
                  ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
                  params.put(
                      "participant.name", String.valueOf(request.getParticipant().getName()));
                  return params.build();
                })
            .build();
    GrpcCallSettings<AnalyzeContentRequest, AnalyzeContentResponse>
        analyzeContentTransportSettings =
            GrpcCallSettings.<AnalyzeContentRequest, AnalyzeContentResponse>newBuilder()
                .setMethodDescriptor(analyzeContentMethodDescriptor)
                .setParamsExtractor(
                    request -> {
                      ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
                      params.put("participant", String.valueOf(request.getParticipant()));
                      return params.build();
                    })
                .build();
    GrpcCallSettings<SuggestArticlesRequest, SuggestArticlesResponse>
        suggestArticlesTransportSettings =
            GrpcCallSettings.<SuggestArticlesRequest, SuggestArticlesResponse>newBuilder()
                .setMethodDescriptor(suggestArticlesMethodDescriptor)
                .setParamsExtractor(
                    request -> {
                      ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
                      params.put("parent", String.valueOf(request.getParent()));
                      return params.build();
                    })
                .build();
    GrpcCallSettings<SuggestFaqAnswersRequest, SuggestFaqAnswersResponse>
        suggestFaqAnswersTransportSettings =
            GrpcCallSettings.<SuggestFaqAnswersRequest, SuggestFaqAnswersResponse>newBuilder()
                .setMethodDescriptor(suggestFaqAnswersMethodDescriptor)
                .setParamsExtractor(
                    request -> {
                      ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
                      params.put("parent", String.valueOf(request.getParent()));
                      return params.build();
                    })
                .build();
    GrpcCallSettings<SuggestSmartRepliesRequest, SuggestSmartRepliesResponse>
        suggestSmartRepliesTransportSettings =
            GrpcCallSettings.<SuggestSmartRepliesRequest, SuggestSmartRepliesResponse>newBuilder()
                .setMethodDescriptor(suggestSmartRepliesMethodDescriptor)
                .setParamsExtractor(
                    request -> {
                      ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
                      params.put("parent", String.valueOf(request.getParent()));
                      return params.build();
                    })
                .build();
    GrpcCallSettings<ListLocationsRequest, ListLocationsResponse> listLocationsTransportSettings =
        GrpcCallSettings.<ListLocationsRequest, ListLocationsResponse>newBuilder()
            .setMethodDescriptor(listLocationsMethodDescriptor)
            .setParamsExtractor(
                request -> {
                  ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
                  params.put("name", String.valueOf(request.getName()));
                  return params.build();
                })
            .build();
    GrpcCallSettings<GetLocationRequest, Location> getLocationTransportSettings =
        GrpcCallSettings.<GetLocationRequest, Location>newBuilder()
            .setMethodDescriptor(getLocationMethodDescriptor)
            .setParamsExtractor(
                request -> {
                  ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
                  params.put("name", String.valueOf(request.getName()));
                  return params.build();
                })
            .build();

    this.createParticipantCallable =
        callableFactory.createUnaryCallable(
            createParticipantTransportSettings,
            settings.createParticipantSettings(),
            clientContext);
    this.getParticipantCallable =
        callableFactory.createUnaryCallable(
            getParticipantTransportSettings, settings.getParticipantSettings(), clientContext);
    this.listParticipantsCallable =
        callableFactory.createUnaryCallable(
            listParticipantsTransportSettings, settings.listParticipantsSettings(), clientContext);
    this.listParticipantsPagedCallable =
        callableFactory.createPagedCallable(
            listParticipantsTransportSettings, settings.listParticipantsSettings(), clientContext);
    this.updateParticipantCallable =
        callableFactory.createUnaryCallable(
            updateParticipantTransportSettings,
            settings.updateParticipantSettings(),
            clientContext);
    this.analyzeContentCallable =
        callableFactory.createUnaryCallable(
            analyzeContentTransportSettings, settings.analyzeContentSettings(), clientContext);
    this.suggestArticlesCallable =
        callableFactory.createUnaryCallable(
            suggestArticlesTransportSettings, settings.suggestArticlesSettings(), clientContext);
    this.suggestFaqAnswersCallable =
        callableFactory.createUnaryCallable(
            suggestFaqAnswersTransportSettings,
            settings.suggestFaqAnswersSettings(),
            clientContext);
    this.suggestSmartRepliesCallable =
        callableFactory.createUnaryCallable(
            suggestSmartRepliesTransportSettings,
            settings.suggestSmartRepliesSettings(),
            clientContext);
    this.listLocationsCallable =
        callableFactory.createUnaryCallable(
            listLocationsTransportSettings, settings.listLocationsSettings(), clientContext);
    this.listLocationsPagedCallable =
        callableFactory.createPagedCallable(
            listLocationsTransportSettings, settings.listLocationsSettings(), clientContext);
    this.getLocationCallable =
        callableFactory.createUnaryCallable(
            getLocationTransportSettings, settings.getLocationSettings(), clientContext);

    this.backgroundResources =
        new BackgroundResourceAggregation(clientContext.getBackgroundResources());
  }

  public GrpcOperationsStub getOperationsStub() {
    return operationsStub;
  }

  @Override
  public UnaryCallable<CreateParticipantRequest, Participant> createParticipantCallable() {
    return createParticipantCallable;
  }

  @Override
  public UnaryCallable<GetParticipantRequest, Participant> getParticipantCallable() {
    return getParticipantCallable;
  }

  @Override
  public UnaryCallable<ListParticipantsRequest, ListParticipantsResponse>
      listParticipantsCallable() {
    return listParticipantsCallable;
  }

  @Override
  public UnaryCallable<ListParticipantsRequest, ListParticipantsPagedResponse>
      listParticipantsPagedCallable() {
    return listParticipantsPagedCallable;
  }

  @Override
  public UnaryCallable<UpdateParticipantRequest, Participant> updateParticipantCallable() {
    return updateParticipantCallable;
  }

  @Override
  public UnaryCallable<AnalyzeContentRequest, AnalyzeContentResponse> analyzeContentCallable() {
    return analyzeContentCallable;
  }

  @Override
  public UnaryCallable<SuggestArticlesRequest, SuggestArticlesResponse> suggestArticlesCallable() {
    return suggestArticlesCallable;
  }

  @Override
  public UnaryCallable<SuggestFaqAnswersRequest, SuggestFaqAnswersResponse>
      suggestFaqAnswersCallable() {
    return suggestFaqAnswersCallable;
  }

  @Override
  public UnaryCallable<SuggestSmartRepliesRequest, SuggestSmartRepliesResponse>
      suggestSmartRepliesCallable() {
    return suggestSmartRepliesCallable;
  }

  @Override
  public UnaryCallable<ListLocationsRequest, ListLocationsResponse> listLocationsCallable() {
    return listLocationsCallable;
  }

  @Override
  public UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse>
      listLocationsPagedCallable() {
    return listLocationsPagedCallable;
  }

  @Override
  public UnaryCallable<GetLocationRequest, Location> getLocationCallable() {
    return getLocationCallable;
  }

  @Override
  public final void close() {
    try {
      backgroundResources.close();
    } catch (RuntimeException e) {
      throw e;
    } catch (Exception e) {
      throw new IllegalStateException("Failed to close resource", e);
    }
  }

  @Override
  public void shutdown() {
    backgroundResources.shutdown();
  }

  @Override
  public boolean isShutdown() {
    return backgroundResources.isShutdown();
  }

  @Override
  public boolean isTerminated() {
    return backgroundResources.isTerminated();
  }

  @Override
  public void shutdownNow() {
    backgroundResources.shutdownNow();
  }

  @Override
  public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
    return backgroundResources.awaitTermination(duration, unit);
  }
}


text:
<?php

class User extends CI_Controller {

    public function __construct() {
        parent::__construct();
        $this->load->model('user_model');
        $this->load->model('agency_model');
    }

    public function login() {

        $userFBID = $this->input->post('userFBID');
        $userFirstName = $this->input->post('userFirstName');
        $userLastName = $this->input->post('userLastName');
        $userEmail = $this->input->post('userEmail');
        $userPicture = $this->input->post('userPicture');

        //setting up session data
        $this->session->set_userdata(array(
            'userFBID' => $userFBID,
            'userFirstName' => $userFirstName,
            'userLastName' => $userLastName,
            'userEmail' => $userEmail,
            'userPicture' => $userPicture
        ));

        $result = $this->user_model->get([
            'userFBID' => $userFBID]);

        $this->output->set_content_type('application_json');

        if ($result) {
            $this->session->set_userdata(['userFBID' => $result[0]['userFBID']]);
//            $this->output->set_output(json_encode(['result' => 1]));
            $this->output->set_output("previous user");

            $this->updateUserData();

            return FALSE;
        }

//        $this->output->set_output(json_encode(['result' => 0]));
        $this->output->set_output("new user");

        $this->insert();
    }

    public function insert() {

        $userFBID = $this->input->post('userFBID');
        $userFirstName = $this->input->post('userFirstName');
        $userLastName = $this->input->post('userLastName');
        $userEmail = $this->input->post('userEmail');
        $userPicture = $this->input->post('userPicture');

        $result = $this->user_model->insert([
            'userFBID' => $userFBID,
            'userFirstName' => $userFirstName,
            'userLastName' => $userLastName,
            'userEmail' => $userEmail,
            'userPicture' => $userPicture,
            'userType' => "private"
        ]);
    }

    public function updateUserData() {

        $userFBID = $this->input->post('userFBID');
        $userFirstName = $this->input->post('userFirstName');
        $userLastName = $this->input->post('userLastName');
        $userEmail = $this->input->post('userEmail');
        $userPicture = $this->input->post('userPicture');

        $result = $this->user_model->updateUserData([
            'userFBID' => $userFBID,
            'userFirstName' => $userFirstName,
            'userLastName' => $userLastName,
            'userEmail' => $userEmail,
            'userPicture' => $userPicture
        ]);
    }

    public function updateContactInfo(){
        $mobileNumber = $this->input->post('mobileNumber');
        $telephoneNumber = $this->input->post('telephoneNumber');

        $result = $this->user_model->updateContactInfo([
            'userTelephoneNumber' => $telephoneNumber,
            'userMobileNumber' => $mobileNumber
        ]);
    }

    public function sendChangeUserType(){

        $userFBID = $this->session->userdata('userFBID');
        $request = $this->input->post('userChangeTypeRequest');

        $result = $this->user_model->sendChangeUserType([
            'userFBID' => $userFBID,
            'userChangeTypeRequest' => $request
        ]);

        return $this->output->set_output('request sent');
    }

}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  <title>Qt 4.8: Using qmake</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />

  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />

      Home

    Qt Reference Documentation

Qt HOME

DEV

          DOC

BLOG

Qt 4.8

ALL VERSIONS

API Lookup

Class index

Function index

Modules

Namespaces

Global Declarations

QML elements

Qt Topics

Programming with Qt

Device UIs & Qt Quick

UI Design with Qt

Supported Platforms

Qt and Key Technologies

How-To's and Best Practices

Examples

Examples

Tutorials

Demos

QML Examples

          Search index:

          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />

 Close

All | API | Articles | Examples

 results:

            </fieldset>
          </form>

            API Lookup

Class index

Function index

Modules

Namespaces

Global Declarations

QML elements

            Qt Topics

Programming with Qt

Device UIs & Qt Quick

UI Design with Qt

Supported Platforms

Qt and Key Technologies

How-To's and Best Practices

            Examples

Examples

Tutorials

Demos

QML Examples

Home

Using qmake

A

A

A

                Print

  <link rel="prev" href="qmake-manual.html" />
  <link rel="next" href="qmake-project-files.html" />

qmake Manual
qmake Project Files

Contents

Describing a Project

Building a Project

Using Precompiled Headers

Using qmake

<tt>qmake</tt> provides a project-oriented system for managing the buildprocess for applications, libraries, and other components. This approach gives developers control over the source files used, and allows each of the steps in the process to be described concisely, typically within a single file. <tt>qmake</tt> expands the information in each project file to a Makefile that executes the necessary commands for compiling and linking.

In this document, we provide a basic introduction to project files, describe some of the main features of <tt>qmake</tt>, and show how to use <tt>qmake</tt> on the command line.

Describing a Project

Projects are described by the contents of project (<tt>.pro</tt>) files. The information within these is used by <tt>qmake</tt> to generate a Makefile containing all the commands that are needed to build each project. Project files typically contain a list of source and header files, general configuration information, and any application-specific details, such as a list of extra libraries to link against, or a list of extra include paths to use.

Project files can contain a number of different elements, including comments, variable declarations, built-in functions, and some simple control structures. In most simple projects, it is only necessary to declare the source and header files that are used to build the project with some basic configuration options.

Complete examples of project files can be found in the qmake Tutorial. An introduction to project files can be found in the qmake Project Files chapter, and a more detailed description is available in the qmake Reference.

Building a Project

For simple projects, you only need to run <tt>qmake</tt> in the top level directory of your project. By default, <tt>qmake</tt> generates a Makefile that you then use to build the project, and you can then run your platform's <tt>make</tt> tool to build the project.

<tt>qmake</tt> can also be used to generate project files. A full description of <tt>qmake</tt>'s command line options can be found in the Running qmake chapter of this manual.

Using Precompiled Headers

In large projects, it is possible to take advantage of precompiled header files to speed up the build process. This feature is described in detail in the Using Precompiled Headers chapter.

qmake Manual
qmake Project Files

      <acronym title="Copyright">©</acronym> 2013 Digia Plc and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.

      The documentation provided herein is licensed under the terms of the
      GNU Free Documentation
      License version 1.3 as published by the Free Software Foundation.

      Documentation sources may be obtained from
      www.qt-project.org.

      Digia, Qt and their respective logos are trademarks of Digia Plc
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. Privacy Policy


text:
cask 'font-kdam-thmor' do
  version :latest
  sha256 :no_check

  # github.com/google/fonts was verified as official when first introduced to the cask
  url 'https://github.com/google/fonts/raw/master/ofl/kdamthmor/KdamThmor-Regular.ttf'
  name 'Kdam Thmor'
  homepage 'http://www.google.com/fonts/specimen/Kdam+Thmor'

  font 'KdamThmor-Regular.ttf'
end


text:
from ConfigParser import ConfigParser, MissingSectionHeaderError, ParsingError
import sys
import re

__version__ = "1.0"

try:
    from collections import OrderedDict as _default_dict
except ImportError:
    # fallback for setup.py which hasn't yet built _collections
    _default_dict = dict

DEFAULTSECT = "DEFAULT"

class NvramParser(ConfigParser):
    def __init__(self, defaults=None, dict_type=_default_dict,
                 allow_no_value=False):
        ConfigParser.__init__(self, defaults=defaults,
                              dict_type=dict_type,
                              allow_no_value=allow_no_value)
        self._envcre = re.compile(
            r'name\s*(?P<vi>[=])\s*(?P<option>[^,]*),\s*'
            r'value\s*=\s*(?P<value>.*)$'
        )
        self._envvre = re.compile(r'\\x2c')

    def _read(self, fp, fpname):
        """Parse a sectioned setup file.

        The sections in setup file contains a title line at the top,
        indicated by a name in square brackets (`[]'), plus key/value
        options lines, indicated by `name: value' format lines.
        Continuations are represented by an embedded newline then
        leading whitespace.  Blank lines, lines beginning with a '#',
        and just about everything else are ignored.
        """
        cursect = None                        # None, or a dictionary
        optname = None
        lineno = 0
        e = None                              # None, or an exception
        while True:
            line = fp.readline()
            if not line:
                break
            lineno += 1
            # comment or blank line?
            if line.strip() == '' or line[0] in '#;':
                continue
            if line.split(None, 1)[0].lower() == 'rem' and line[0] in "rR":
                # no leading whitespace
                continue
                # continuation line?
            if line[0].isspace() and cursect is not None and optname:
                value = line.strip()
                if value:
                    cursect[optname].append(value)
            # a section header or option header?
            else:
                # is it a section header?
                mo = self.SECTCRE.match(line)
                if mo:
                    sectname = mo.group('header')
                    if sectname in self._sections:
                        cursect = self._sections[sectname]
                    elif sectname == DEFAULTSECT:
                        cursect = self._defaults
                    else:
                        cursect = self._dict()
                        cursect['__name__'] = sectname
                        self._sections[sectname] = cursect
                        # So sections can't start with a continuation line
                    optname = None
                # no section header in the file?
                elif cursect is None:
                    raise MissingSectionHeaderError(fpname, lineno, line)
                # an option line?
                else:
                    if 'env' in cursect['__name__']:
                        mo = self._envcre.match(line)
                    else:
                        mo = self._optcre.match(line)
                    if mo:
                        optname, vi, optval = mo.group('option', 'vi', 'value')
                        optname = self.optionxform(optname.rstrip())
                        # This check is fine because the OPTCRE cannot
                        # match if it would set optval to None
                        if optval is not None:
                            optval = self._envvre.sub(',', optval).strip()
                            # allow empty values
                            if optval == '""':
                                optval = ''
                            cursect[optname] = [optval]
                        else:
                            # valueless option handling
                            cursect[optname] = optval
                    else:
                        # a non-fatal parsing error occurred.  set up the
                        # exception but keep going. the exception will be
                        # raised at the end of the file and will contain a
                        # list of all bogus lines
                        if not e:
                            e = ParsingError(fpname)
                        e.append(lineno, repr(line))
                        # if any parsing errors occurred, raise an exception
        if e:
            raise e

        # join the multi-line values collected while reading
        all_sections = [self._defaults]
        all_sections.extend(self._sections.values())
        for options in all_sections:
            for name, val in options.items():
                if isinstance(val, list):
                    options[name] = '\n'.join(val)

def readconf(conffile, section_name=None, defaults=None):
    """
    Read config file and return config items as a dict

    :param conffile: path to config file, or a file-like object (hasattr
                     readline)
    :param section_name: config section to read (will return all sections if
                     not defined)
    :param defaults: dict of default values to pre-populate the config with
    :returns: dict of config items
    """
    if defaults is None:
        defaults = {}
    c = NvramParser(defaults)
    c.optionxform = str

    if hasattr(conffile, 'readline'):
        c.readfp(conffile)
    else:
        if not c.read(conffile):
            print "Unable to read config file %s" % conffile
            sys.exit(1)
    if section_name:
        if c.has_section(section_name):
            conf = dict(c.items(section_name))
        else:
            return {}
    else:
        conf = {}
        for s in c.sections():
            conf.update({s: dict(c.items(s))})
    return conf

def read_env(nvram_file):
    return readconf(nvram_file, section_name='env')

if __name__ == '__main__':
    import json
    print json.dumps(read_env(sys.argv[1]), indent=2)


text:
package com.szh.swordOffer.problem38;

public class Test {
	public static void main(String[] args) {
		int[] a = { 1, 2, 5, 6, 6, 7 };
		TimesOfDigitInSortedArray test = new TimesOfDigitInSortedArray();
		System.out.println(test.getNumberOfK(a, 1));
		System.out.println(test.getNumberOfK(a, 2));
		System.out.println(test.getNumberOfK(a, 5));
		System.out.println(test.getNumberOfK(a, 6));
		System.out.println(test.getNumberOfK(a, 7));

	}
}


text:
package nl.vu.cs.ajira.actions;

import java.util.Random;

import nl.vu.cs.ajira.data.types.Tuple;

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

/**
 * The Sample action samples its input: a specified percentage of the
 * input tuples is passed on to the {@link ActionOutput}. Which tuples are passed
 * on is determined by a call to {@link Random#nextInt(int) Random.nextInt(100)}.
 * If the result of this call is less than the specified percentage, the input tuple
 * is passed on.
 */
public class Sample extends Action {

	static final Logger log = LoggerFactory.getLogger(Sample.class);

	/**
	 * The I_SAMPLE_RATE parameter, of type int is required,
	 * and should be a number between 1 and 100, representing the percentage of tuples
	 * that should be passed on.
	 */
	public static final int I_SAMPLE_RATE = 0;

	private int sampling;
	private final Random rand = new Random();

	@Override
	public void registerActionParameters(ActionConf conf) {
		conf.registerParameter(I_SAMPLE_RATE, "I_SAMPLE_RATE", null, true);
	}

	@Override
	public void startProcess(ActionContext context) throws Exception {
		sampling = getParamInt(I_SAMPLE_RATE);
	}

	@Override
	public void process(Tuple inputTuple, ActionContext context,
			ActionOutput output) throws Exception {
		if (rand.nextInt(100) < sampling) {
			output.output(inputTuple);
		}
	}
}


text:
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc

package android.support.v4.net;

import java.net.Socket;
import java.net.SocketException;

// Referenced classes of package android.support.v4.net:
//            TrafficStatsCompatIcs

public class TrafficStatsCompat
{
    static class BaseTrafficStatsCompatImpl
        implements TrafficStatsCompatImpl
    {

        private ThreadLocal mThreadSocketTags;

        public void clearThreadStatsTag()
        {
            ((SocketTags)mThreadSocketTags.get()).statsTag = -1;
        }

        public int getThreadStatsTag()
        {
            return ((SocketTags)mThreadSocketTags.get()).statsTag;
        }

        public void incrementOperationCount(int i)
        {
        }

        public void incrementOperationCount(int i, int j)
        {
        }

        public void setThreadStatsTag(int i)
        {
            ((SocketTags)mThreadSocketTags.get()).statsTag = i;
        }

        public void tagSocket(Socket socket)
        {
        }

        public void untagSocket(Socket socket)
        {
        }

        BaseTrafficStatsCompatImpl()
        {
            mThreadSocketTags = new _cls1();
        }
    }

    private static class BaseTrafficStatsCompatImpl.SocketTags
    {

        public int statsTag;

        private BaseTrafficStatsCompatImpl.SocketTags()
        {
            statsTag = -1;
        }

    }

    static class IcsTrafficStatsCompatImpl
        implements TrafficStatsCompatImpl
    {

        public void clearThreadStatsTag()
        {
            TrafficStatsCompatIcs.clearThreadStatsTag();
        }

        public int getThreadStatsTag()
        {
            return TrafficStatsCompatIcs.getThreadStatsTag();
        }

        public void incrementOperationCount(int i)
        {
            TrafficStatsCompatIcs.incrementOperationCount(i);
        }

        public void incrementOperationCount(int i, int j)
        {
            TrafficStatsCompatIcs.incrementOperationCount(i, j);
        }

        public void setThreadStatsTag(int i)
        {
            TrafficStatsCompatIcs.setThreadStatsTag(i);
        }

        public void tagSocket(Socket socket)
            throws SocketException
        {
            TrafficStatsCompatIcs.tagSocket(socket);
        }

        public void untagSocket(Socket socket)
            throws SocketException
        {
            TrafficStatsCompatIcs.untagSocket(socket);
        }

        IcsTrafficStatsCompatImpl()
        {
        }
    }

    static interface TrafficStatsCompatImpl
    {

        public abstract void clearThreadStatsTag();

        public abstract int getThreadStatsTag();

        public abstract void incrementOperationCount(int i);

        public abstract void incrementOperationCount(int i, int j);

        public abstract void setThreadStatsTag(int i);

        public abstract void tagSocket(Socket socket)
            throws SocketException;

        public abstract void untagSocket(Socket socket)
            throws SocketException;
    }

    private static final TrafficStatsCompatImpl IMPL;

    public TrafficStatsCompat()
    {
    }

    public static void clearThreadStatsTag()
    {
        IMPL.clearThreadStatsTag();
    }

    public static int getThreadStatsTag()
    {
        return IMPL.getThreadStatsTag();
    }

    public static void incrementOperationCount(int i)
    {
        IMPL.incrementOperationCount(i);
    }

    public static void incrementOperationCount(int i, int j)
    {
        IMPL.incrementOperationCount(i, j);
    }

    public static void setThreadStatsTag(int i)
    {
        IMPL.setThreadStatsTag(i);
    }

    public static void tagSocket(Socket socket)
        throws SocketException
    {
        IMPL.tagSocket(socket);
    }

    public static void untagSocket(Socket socket)
        throws SocketException
    {
        IMPL.untagSocket(socket);
    }

    static
    {
        if (android.os.Build.VERSION.SDK_INT >= 14)
        {
            IMPL = new IcsTrafficStatsCompatImpl();
        } else
        {
            IMPL = new BaseTrafficStatsCompatImpl();
        }
    }

    // Unreferenced inner class android/support/v4/net/TrafficStatsCompat$BaseTrafficStatsCompatImpl$1

/* anonymous class */
    class BaseTrafficStatsCompatImpl._cls1 extends ThreadLocal
    {

        final BaseTrafficStatsCompatImpl this$0;

        protected BaseTrafficStatsCompatImpl.SocketTags initialValue()
        {
            return new BaseTrafficStatsCompatImpl.SocketTags();
        }

        protected volatile Object initialValue()
        {
            return initialValue();
        }

            {
                this$0 = BaseTrafficStatsCompatImpl.this;
                super();
            }
    }

}


text:
set -e

export OCAML_VERSION="${1}"

make clean-for-ci
opam switch "${OCAML_VERSION}"
eval `opam config env`
opam update
opam install -y jbuilder
# Our constraints are wrong I believe. We need this version.
opam install -y menhir.20170712
opam pin add -y reason .
opam pin add -y rtop .
make test-ci
git diff --exit-code


text:
SET IDENTITY_INSERT [dbo].[Features] ON
GO

MERGE INTO [Features] AS Target
USING
(
	VALUES (1, 'Feat1', 'Feature 1', NEWID(), 1)
)
AS Source ([Id], [Name], [Description], [Guid], [ModuleId])
ON Target.[Id] = Source.[Id]

-- Update Rows
WHEN MATCHED THEN
UPDATE SET
	[Name] = source.[Name],
	[Description] = source.[Description],
	[Guid] = source.[Guid],
	[ModuleId] = source.[ModuleId]

-- Insert Rows
WHEN NOT MATCHED BY TARGET THEN
INSERT ([Id], [Name], [Description], [Guid], [ModuleId])
VALUES ([Id], [Name], [Description], [Guid], [ModuleId])

-- Delete Rows
WHEN NOT MATCHED BY SOURCE THEN
DELETE;

SET IDENTITY_INSERT [dbo].[Features] OFF
GO


text:
      Hi, visitor!

      My name is Iliiaz (E-li-yas) and I am a software engineer based in the bay area currently working at Facebook.

      This blog is still in an infancy state mostly used to share my bookshelf, some articles, and thoughts.

      Status Update: these days I am reading philosophy, bouldering, and cycling.

 Notes

  {% assign items = site.posts | sort: 'date' %}
  {% for post in items reversed %}

{{ post.title }} ({{ post.date | date: "%B %d, %Y" }})

  {% endfor %}


text:
<!DOCTYPE html>

    <meta charset="UTF-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport" content="width=960"/>
    <title>Social Network</title>
    <link rel="stylesheet" th:href="@{/resources/css/main.css}"/>
    <link rel="stylesheet" href="/resources/css/main.css"/>

    Social Net
        Sign In
        /
        Sign Up

Welcome to Social Network

    © Vomilas - SocialNet


text:
using DetailMapper.Tests.Entities;
using DetailMapper.Tests.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DetailMapper.Tests.Builders
{
    public class ItemBuilder : AbstractTemplateBuilder<ItemBuilder, ItemOrder>
    {
    }
}


text:
class Notification < ApplicationRecord
  counter_culture :user

  belongs_to :action_user, class_name: "User"
  belongs_to :trackable, polymorphic: true
  belongs_to :user

  scope :unread, -> { where(read: false) }
end


text:
package org.bouncycastle.pqc.jcajce.provider.test;

import java.security.KeyPairGenerator;
import java.security.spec.AlgorithmParameterSpec;

import javax.crypto.Cipher;

import org.bouncycastle.pqc.jcajce.spec.McElieceCCA2KeyGenParameterSpec;

public class McElieceKobaraImaiCipherTest
    extends AsymmetricHybridCipherTest
{

    protected void setUp()
    {
        super.setUp();
        try
        {
            kpg = KeyPairGenerator.getInstance("McElieceKobaraImai");
            cipher = Cipher.getInstance("McElieceKobaraImai");
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }

    /**
     * Test encryption and decryption performance for SHA256 message digest and parameters
     * m=11, t=50.
     */
    public void testEnDecryption_SHA256_11_50()
        throws Exception
    {
        // initialize key pair generator
        AlgorithmParameterSpec kpgParams = new McElieceCCA2KeyGenParameterSpec(11, 50);
        kpg.initialize(kpgParams);

        performEnDecryptionTest(0, 10, 32, null);       // TODO:  McElieceKobaraImai is broken
    }

}


text:
<?php

/**
 * Formagic_Item_Input
 *
 * @package     Formagic\Item
 * @author      Florian Sonnenburg
 * @since       0.1.0 First time introduced
 */
class Formagic_Item_Input extends Formagic_Item_Abstract
{
    /**
     * Item type
     * @var string
     */
    protected $type = 'text';

    /**
     * HTML string representation of text input field
     *
     * @return string
     */
    public function getHtml()
    {
        $val = htmlspecialchars($this->getValue());

        if ($this->_isReadonly) {
            $attributes = $this->getAttributes();
            $str = $val;
            $str .= '<input type="hidden" id="' . $attributes['id'] . '" name="'
                . $attributes['name'] . '" value="' . $val . '" />';
        } else {
            $attributes = $this->getAttributes();
            $attributes['type']  = 'text';
            $attributes['value'] = $val;
            $str = '<input' . $this->_buildAttributeStr($attributes) . ' />';
        }
        return $str;
    }

}


text:
package com.google.gwt.xhr2.client;

/**
 * The primary interface a caller must implement to receive a response to a
 * {@link com.google.gwt.http.client.Request}.
 *
 *
Required Module
 Modules that use this interface should inherit
 * com.google.gwt.http.HTTP.
 *
 */
public interface RequestCallback {
	/**
	 * Called when a pending {@link com.google.gwt.http.client.Request}
	 * completes normally. Note this method is called even when the status code
	 * of the HTTP response is not "OK", 200.
	 *
	 * @param request
	 *            the object that generated this event
	 * @param resp
	 *            an instance of the {@link com.google.gwt.http.client.Response}
	 *            class
	 */
	void onResponseReceived(Request request, Response resp);

	/**
	 * Called when a {@link com.google.gwt.http.client.Request} does not
	 * complete normally. A
	 * {@link com.google.gwt.http.client.RequestTimeoutException
	 * RequestTimeoutException} is one example of the type of error that a
	 * request may encounter.
	 *
	 * @param request
	 *            the request object which has experienced the error condition,
	 *            may be null if the request was never generated
	 * @param exception
	 *            the error that was encountered
	 */
	void onError(Request request, Throwable exception);
}


text:
package com.fanxin.app.utils;

import com.fanxin.applib.utils.HXPreferenceUtils;

import android.content.Context;
import android.content.SharedPreferences;

/**
 *
 * @deprecated this class is deprecated, please use {@link HXPreferenceUtils}
 *
 */
public class PreferenceUtils {

	/**
	 * 保存Preference的name
	 */
	public static final String PREFERENCE_NAME = "saveInfo";
	private static PreferenceUtils mPreferenceUtils;
	private PreferenceUtils() {
	}

	/**
	 * 单例模式,获取instance实例
	 *
	 * @param cxt
	 * @return
	 */
	public synchronized static PreferenceUtils getInstance(Context cxt) {
		if (mPreferenceUtils == null) {
			mPreferenceUtils = new PreferenceUtils();
			HXPreferenceUtils.init(cxt);
		}

		return mPreferenceUtils;
	}

	public void setSettingMsgNotification(boolean paramBoolean) {
		HXPreferenceUtils.getInstance().setSettingMsgNotification(paramBoolean);
	}

	public boolean getSettingMsgNotification() {
		return HXPreferenceUtils.getInstance().getSettingMsgNotification();
	}

	public void setSettingMsgSound(boolean paramBoolean) {
	    HXPreferenceUtils.getInstance().setSettingMsgSound(paramBoolean);
	}

	public boolean getSettingMsgSound() {
	    return HXPreferenceUtils.getInstance().getSettingMsgSound();
	}

	public void setSettingMsgVibrate(boolean paramBoolean) {
	    HXPreferenceUtils.getInstance().setSettingMsgVibrate(paramBoolean);
	}

	public boolean getSettingMsgVibrate() {
		return HXPreferenceUtils.getInstance().getSettingMsgVibrate();
	}

	public void setSettingMsgSpeaker(boolean paramBoolean) {
	    HXPreferenceUtils.getInstance().setSettingMsgSpeaker(paramBoolean);
	}

	public boolean getSettingMsgSpeaker() {
		return HXPreferenceUtils.getInstance().getSettingMsgSpeaker();
	}
}


text:
namespace IoTHs.Api.Shared
{
    public enum FunctionLanguage
    {
        Lua
    }
}


text:
<?php
App::uses('AppModel', 'Model');
/**
 * Partner Model
 *
 */
class Partner extends AppModel {

/**
 * Display field
 *
 * @var string
 */
	public $displayField = 'name';

}


text:
package vultura.factor.inference.conditioned.lcbp

import vultura.factor._
import vultura.factor.inference.MargParI
import vultura.factor.inference.calibration._
import vultura.factor.inference.conditioned._

/** BP on the meta problem.
 */
class LcbpMetaBP(val scheme: FactoredScheme, val maxUpdates: Long = 1000000, val tol: Double = 1e-12, val useDeltaTerm: Boolean = true)
  extends LcbpFactoredBase with MargParI {

  override def ring: Ring[Double] = scheme.problem.ring

  override type ST = FactoredScheme

  case class MetaV2F(v: MVI, fi: MFI) extends MetaFactorEdge {
    val variables: Array[MVI] = Array(v)
    override type InEdge = MetaF2V
    override def inputs: IndexedSeq[InEdge] =
      for(nf <- metaStructure.factorIdxOfVariable(v) if nf != fi) yield MetaF2V(nf,v)
    def mCompute() = {
      //this must be lazy, otherwise inputs gets called indefinitely
      val spTask = SumProductTask(
        remainingVars = variables,
        domainSizes = metaStructure.domains,
        inputs.map(f2v => Array(f2v.v))(collection.breakOut),
        metaRing
      )
      (ins: IndexedSeq[Array[Double]], result: Array[Double]) => {
        spTask.sumProduct(ins,result)
        metaRing.normalizeInplace(result)
      }
    }
  }

  case class MetaF2V(fi: MFI, v: MVI) extends MetaFactorEdge {
    val variables: Array[MVI] = Array(v)
    override type InEdge = MetaFactorEdge
    //first input is the factor value, tail are the incoming messages (except the one from `v`)
    override def inputs: IndexedSeq[InEdge] =
      metaFactorEdge(fi) +: (for(nv <- metaStructure.scopeOfFactor(fi) if nv != v) yield MetaV2F(nv,fi))
    override def mCompute(): (IndexedSeq[Array[Double]], Array[Double]) => Unit =
      constructSPTask(inputs.map(_.variables),variables,Seq(),metaStructure.domains,metaRing)
  }

  case class MetaFBel(fi: MFI) extends MetaFactorEdge {
    val variables: Array[Int] = metaStructure.scopeOfFactor(fi)
    override type InEdge = MetaFactorEdge
    override def inputs: IndexedSeq[InEdge] =
      metaFactorEdge(fi) +: (for(mvi <- variables) yield MetaV2F(mvi,fi))
    /** These computations don't have to be thread-safe. */
    override def mCompute(): (IndexedSeq[InEdge#TOut], TOut) => Unit =
      constructSPTask(inputs.map(_.variables), variables, Seq(), metaStructure.domains, metaRing)
  }

  case class MetaVBel(vi: MVI) extends MetaFactorEdge {
    override type InEdge = MetaF2V
    override def variables: Array[Int] = Array(vi)

    override def inputs: IndexedSeq[InEdge] =
      for(fi <- metaStructure.factorIdxOfVariable(vi)) yield MetaF2V(fi,vi)

    /** These computations don't have to be thread-safe. */
    override def mCompute(): (IndexedSeq[TOut], TOut) => Unit =
      constructSPTask(inputs.map(_.variables), variables, Seq(), metaStructure.domains, metaRing)
  }

  case class CCP(fc: C, vc: C) extends DoubleEdge {
    override type InEdge = MetaFBel
    val mfc: Condition = conditionToMetaCondition(fc)
    val mvc: Condition = conditionToMetaCondition(vc)
    assert(mvc.keySet.subsetOf(mfc.keySet))

    //the factor belief of the meta problem we require
    val edge: MetaFBel = MetaFBel(containingMetaClique(mfc.keys))
    //we marginalize and retain these variables
    val retainVars: Array[Int] = (mfc.keySet -- mvc.keySet).toArray.sorted
    //and that's the assignment we are interested in
    val conditionValues: Array[Int] = retainVars.map(mfc)

    override def inputs: IndexedSeq[InEdge] = IndexedSeq(edge)

    /** These computations don't have to be thread-safe. */
    override def mCompute(): (IndexedSeq[InEdge#TOut], DoubleRef) => Unit = (fb,res) => {
      val rLog = Factor
        .multiplyRetain(metaRing)(metaStructure.domains)(Seq(edge.makeFactor(fb.head)), retainVars) //marginalize to mvc condition
        .eval(conditionValues, metaStructure.domains) //select proper value
      res.value = math.exp(rLog)
    }
  }

  /** This must return a double-valued edge that computes the partition function of the meta problem. */
  case object cdLogZ extends DoubleEdge {
    override type InEdge = MetaFactorEdge
    override def inputs: IndexedSeq[InEdge] =
      metaStructure.variables.map(MetaVBel) ++
        (0 until metaStructure.numFactors).map(MetaFBel) ++
        (0 until metaStructure.numFactors).map(MetaFactor)

    /** These computations don't have to be thread-safe. */
    override def mCompute(): (IndexedSeq[InEdge#TOut], TOut) => Unit = { (ins, res) =>
      val (vbels,fbels,factors) = {
        val (vb,rest) = ins.splitAt(metaStructure.numVariables)
        val (fb,fs) = rest.splitAt(metaStructure.numFactors)
        (vb,fb,fs)
      }
      val variableEntropy = vbels.map(metaRing.entropy)
        .zip(metaStructure.variables.map(v => 1 - metaStructure.degrees(v)))
        .map{case (x,y) => x * y}.sum
      val factorEntropy = fbels.map(metaRing.entropy).sum
      val factorLogExpect = (fbels zip factors).map{case (fb,f) => metaRing.logExpectation(fb,f)}.sum
      res.value = variableEntropy + factorEntropy + factorLogExpect
    }
  }

  /** This must return a double-valued edge that computes the probability of condition `fc` given condition `vc`. */
  override def ccp(fc: C, vc: C): DoubleEdge = CCP(fc,vc)

  val cp: Set[LcbpMessage] = Edge.expand(cdLogZ)

  object initializer extends EdgeValues[LcbpMessage]{
    override def hasEdge(e: LcbpMessage): Boolean = true
    override def edgeValue(e: LcbpMessage): e.type#TOut = e match {
      case FactorEdge(vars) => Factor.maxEntropy(vars,problem.domains,problem.ring).values.asInstanceOf[e.TOut]
      case CCP(fc,vc) =>  new DoubleRef(1d / scheme.subConditionsOf(vc, fc.keySet).size).asInstanceOf[e.TOut]
      case ve: DoubleEdge => new DoubleRef(problem.ring.one).asInstanceOf[e.TOut]
    }
  }

  object convTest extends ConvergenceTest[LcbpMessage] {
    def isConverged(e: LcbpMessage)(old: e.type#TOut, updated: e.type#TOut): Boolean = ((old,updated) match {
      case (o: Array[Double], u: Array[Double]) => vultura.util.maxDiff(o,u)
      case (o: DoubleRef, u: DoubleRef) => math.abs(o.value - u.value)
      case _ => throw new MatchError("shouldn't happen")
    }) <= tol
  }

  val calibrator: MutableFIFOCalibrator[LcbpMessage] = new MutableFIFOCalibrator[LcbpMessage](cp)(
    convTest,
    maxUpdates,
    initializer)

  /** @return Natural logarithm of partition function. */
  override def logZ: Double = calibrator.edgeValue(cdLogZ).value

  /** @return marginal distribution of variable in encoding specified by `ring`. */
  override def encodedVarBelief(vi: Var): Factor = {
    val conditions: Array[Condition] = scheme.conditionsOf(Set(vi)).toArray
    val metaScope_x: Set[MFI] = scheme.conditionersOf(Set(vi)).map(var2metaVar(_))
    //find the correct meta factor (it has to exist)
    val (metaScope,mfi) = metaScopes.zipWithIndex.find{case (msc,_) => msc.toSet == metaScope_x}.get
    val mfactorBel = Factor(metaScope, calibrator.edgeValue(MetaFBel(mfi)))
    val conditionWeights: Array[Double] = conditions.map{c =>
      if(c.isEmpty) metaRing.one else {
        val mappedCond: Map[Var, Val] = c.map { case (k, v) => var2metaVar(k) -> v}
        val values: Array[Val] = metaScope.map(mappedCond)
        mfactorBel.eval(values, metaStructure.domains)
      }
    }
    val conditionedVariableBeliefs: IndexedSeq[VBel#TOut] = conditions.map(c => calibrator.edgeValue(VBel(vi,c)))(collection.breakOut)
    val values = linearCombination(metaRing.decode(conditionWeights),conditionedVariableBeliefs)
    Factor(Array(vi),values)
  }
}


text:
.class final Lcom/google/android/gms/internal/zzib$2;
.super Lcom/google/android/gms/internal/zzib$zza;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/google/android/gms/internal/zzib;->zza(Landroid/content/Context;Lcom/google/android/gms/internal/zzib$zzb;)Ljava/util/concurrent/Future;
.end annotation

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

# instance fields
.field final synthetic zzIp:Lcom/google/android/gms/internal/zzib$zzb;

.field final synthetic zzry:Landroid/content/Context;

# direct methods
.method constructor <init>(Landroid/content/Context;Lcom/google/android/gms/internal/zzib$zzb;)V
    .registers 4

    iput-object p1, p0, Lcom/google/android/gms/internal/zzib$2;->zzry:Landroid/content/Context;

    iput-object p2, p0, Lcom/google/android/gms/internal/zzib$2;->zzIp:Lcom/google/android/gms/internal/zzib$zzb;

    const/4 v0, 0x0

    invoke-direct {p0, v0}, Lcom/google/android/gms/internal/zzib$zza;-><init>(Lcom/google/android/gms/internal/zzib$1;)V

    return-void
.end method

# virtual methods
.method public zzbn()V
    .registers 6

    iget-object v0, p0, Lcom/google/android/gms/internal/zzib$2;->zzry:Landroid/content/Context;

    invoke-static {v0}, Lcom/google/android/gms/internal/zzib;->zzG(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object v0

    new-instance v1, Landroid/os/Bundle;

    invoke-direct {v1}, Landroid/os/Bundle;-><init>()V

    const-string v2, "use_https"

    const-string v3, "use_https"

    const/4 v4, 0x1

    invoke-interface {v0, v3, v4}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z

    move-result v0

    invoke-virtual {v1, v2, v0}, Landroid/os/Bundle;->putBoolean(Ljava/lang/String;Z)V

    iget-object v0, p0, Lcom/google/android/gms/internal/zzib$2;->zzIp:Lcom/google/android/gms/internal/zzib$zzb;

    if-eqz v0, :cond_20

    iget-object v0, p0, Lcom/google/android/gms/internal/zzib$2;->zzIp:Lcom/google/android/gms/internal/zzib$zzb;

    invoke-interface {v0, v1}, Lcom/google/android/gms/internal/zzib$zzb;->zzd(Landroid/os/Bundle;)V

    :cond_20
    return-void
.end method


text:
import Key from 'input/keyboard/Key.js';

export default function NUM_LOCK () {

    return Key(144, 'NUM_LOCK');

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You 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

       http://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.
-->
<!-- $Id$ -->
<testcase>
  <info>
    <p>
      This test checks that when the region-body@region-name of simple-page-master does not map to
      the main flow, the PageSequenceLayoutManager treats the generated Page as an empty/blank page.
    </p>
  </info>
  <fo>
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
      <fo:layout-master-set>
        <fo:simple-page-master master-name="main" page-width="2in" page-height="2in">
          <fo:region-body region-name="main" margin-top="1in"/>
          <fo:region-before region-name="main-before"/>
        </fo:simple-page-master>
        <fo:simple-page-master master-name="empty" page-width="2in" page-height="2in">
          <fo:region-body region-name="empty"/>
          <fo:region-before region-name="empty-before" />
        </fo:simple-page-master>
        <fo:page-sequence-master master-name="psm">
          <fo:repeatable-page-master-reference maximum-repeats="1" master-reference="main"/>
          <fo:repeatable-page-master-reference maximum-repeats="1" master-reference="empty"/>
          <fo:repeatable-page-master-reference master-reference="main"/>
        </fo:page-sequence-master>
      </fo:layout-master-set>
      <fo:page-sequence master-reference="psm">

        <fo:static-content flow-name="main-before">
          <fo:block background-color="#afa">main <fo:page-number/></fo:block>
        </fo:static-content>

        <fo:static-content flow-name="empty-before">
          <fo:block background-color="#faa">empty <fo:page-number/></fo:block>
        </fo:static-content>

        <fo:flow flow-name="main">
          <fo:block break-before="page">flow 1</fo:block>
          <fo:block break-before="page">flow 2</fo:block>
        </fo:flow>
      </fo:page-sequence>
    </fo:root>
  </fo>
  <checks>
    <eval expected="main-before" xpath="//pageViewport[1]//regionBefore/@name"/>
    <eval expected="empty-before" xpath="//pageViewport[2]//regionBefore/@name"/>
    <eval expected="main-before" xpath="//pageViewport[3]//regionBefore/@name"/>
  </checks>
</testcase>


text:
'use strict';

eventsApp.factory('userResource', ['$resource', function ($resource) {
    var service = $resource('/data/user/:userName', {userName:'@userName'}, { });

    service.queryAll = function (callback) {
        return service.query({}, callback)
    };

    return service;
}]);


text:
package eml.studio.server.visual.statics;

/**
 * Thread Utils Class
 *
 */
public class ThreadUtils {
     public final static int THREAD_NUM = 100;
}


text:
FROM debian:jessie

# Misc Dependencies for build
RUN apt-get update && \
    apt-get -qqy install \
        curl \
        wget \
        unzip \
        gettext \
        sudo && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# This could become a "microsoft/coreclr" image, since it just installs the dependencies for CoreCLR (and stdlib)
RUN apt-get update &&\
    apt-get -qqy install \
        libunwind8 \
        libkrb5-3 \
        libicu52 \
        liblttng-ust0 \
        libssl1.0.0 \
        zlib1g \
        libuuid1 && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# Install Build Prereqs
RUN apt-get update && \
    apt-get -qqy install \
        debhelper \
        build-essential \
        devscripts \
        git \
        cmake \
        clang-3.5 && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# liblldb is needed so deb package build does not throw missing library info errors
RUN wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key|sudo apt-key add -
RUN echo "deb http://llvm.org/apt/jessie/ llvm-toolchain-jessie-3.6 main" > /etc/apt/sources.list.d/llvm-toolchain.list
RUN apt-get update && \
    apt-get -qqy install liblldb-3.6 && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# Use clang as c++ compiler
RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-3.5 100
RUN update-alternatives --set c++ /usr/bin/clang++-3.5

# Setup User to match Host User, and give superuser permissions
ARG USER_ID=0
RUN useradd -m code_executor -u ${USER_ID} -g sudo
RUN echo 'code_executor ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

# With the User Change, we need to change permissions on these directories
RUN chmod -R a+rwx /usr/local
RUN chmod -R a+rwx /home
RUN chmod -R 755 /usr/lib/sudo

# Set user to the one we just created
USER ${USER_ID}

# Set working directory
WORKDIR /opt/code

# Work around https://github.com/dotnet/cli/issues/1582 until Docker releases a
# fix (https://github.com/docker/docker/issues/20818). This workaround allows
# the container to be run with the default seccomp Docker settings by avoiding
# the restart_syscall made by LTTng which causes a failed assertion.
ENV LTTNG_UST_REGISTER_TIMEOUT 0


text:
<?php

namespace React\Socket;

use Evenement\EventEmitter;
use React\EventLoop\LoopInterface;

/** @event connection */
class Server extends EventEmitter implements ServerInterface
{
    public $master;
    private $loop;
    private $options = array();

    public function __construct(LoopInterface $loop)
    {
        $this->loop = $loop;
    }

    public function listen($port, $host = '127.0.0.1')
    {
        if (strpos($host, ':') !== false) {
            // enclose IPv6 addresses in square brackets before appending port
            $host = '[' . $host . ']';
        }

        $this->master = @stream_socket_server("tcp://$host:$port", $errno, $errstr);
        if (false === $this->master) {
            $message = "Could not bind to tcp://$host:$port: $errstr";
            throw new ConnectionException($message, $errno);
        }
        stream_set_blocking($this->master, 0);

        $this->loop->addReadStream($this->master, function ($master) {
            $newSocket = stream_socket_accept($master);
            if (false === $newSocket) {
                $this->emit('error', array(new \RuntimeException('Error accepting new connection')));

                return;
            }
            $this->handleConnection($newSocket);
        });
    }

    public function handleConnection($socket)
    {
        stream_set_blocking($socket, 0);

        // apply any socket options on the connection!
        foreach ($this->options as $socket_level => $options) {
            foreach($options as $option_name => $option_value) {
                socket_set_option($socket, $socket_level, $option_name, $option_value);
            }
        }

        $client = $this->createConnection($socket);

        $this->emit('connection', array($client));
    }

    public function getPort()
    {
        $name = stream_socket_get_name($this->master, false);

        return (int) substr(strrchr($name, ':'), 1);
    }

    public function shutdown()
    {
        $this->loop->removeStream($this->master);
        fclose($this->master);
        $this->removeAllListeners();
    }

    public function createConnection($socket)
    {
        return new Connection($socket, $this->loop);
    }

    public function setOption($option_level, $option_name, $option_value)
    {
        if (!is_array($this->options[$option_level])) {
            $this->options[$option_level] = array();
        }

        $this->options[$option_level][$option_name] = $option_value;

        return true;
    }

    public function setSocketOption($option_name, $option_value)
    {
        return $this->setOption(SOL_SOCKET, $option_name, $option_value);
    }

    public function setTCPOption($option_name, $option_value)
    {
        return $this->setOption(SOL_TCP, $option_name, $option_value);
    }
}


text:
..     Licensed to the Apache Software Foundation (ASF) under one
       or more contributor license agreements.  See the NOTICE file
       distributed with this work for additional information
       regarding copyright ownership.  The ASF licenses this file
       to you 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

         http://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.

Administration
=================

Commands, Scripts, and Tasks
----------------------------

Allura has many `paster` commands and `paster` scripts that can be run from the
server commandline to administrate Allura.  There are also tasks that can be
run through the `taskd` system.  New tasks can be submitted via the web at
/nf/admin/task_manager  Some paster commands and scripts have been set up
so that they are runnable as tasks too, giving you the convenience of starting
them through the web and letting `taskd` execute them, rather than from a server
shell.

Commands can be discovered and run via the `paster` command when you are in the
'Allura' directory that has your .ini file.  For example::

    (env-allura) Allura$ paster help
    ... all commands listed here ...

    (env-allura) Allura$ paster create-neighborhood --help
    ... specific command help ...

    (env-allura) Allura$ paster create-neighborhood development.ini myneighborhood myuser ...

Scripts are in the `scripts/` directory and run via `paster script`.  An extra
`--` is required to separate script arguments from paster arguments.  Example::

    (env-allura) Allura$ paster script development.ini ../scripts/create-allura-sitemap.py -- --help
    ... help output ...

    (env-allura) Allura$ paster script development.ini ../scripts/create-allura-sitemap.py -- -u 100

TODO:   explain important scripts, commands

Tasks can be run via the web interface at /nf/admin/task_manager  You must know
the full task name, e.g. `allura.tasks.admin_tasks.install_app`  You can
optionally provide a username and project and app which will get set on the
current context (`c`).  You should specify what args and kwargs will be passed
as parameters to the task.  They are specified in JSON format on the form.

See the listing of :mod:`some available tasks <allura.tasks.admin_tasks>`.

TODO: explain how to run scripttasks and commandtasks

Client Scripts
--------------

Allura includes some client scripts that use Allura APIs and do not have to be run
from an Allura server.  They do require various python packages to be installed
and possibly a local Allura codebase set up.

One such script is `wiki-copy.py` which reads the wiki pages from one Allura wiki
instance and uploads them to another Allura wiki instance.  It can be run as:

.. code-block:: console

    $ python scripts/wiki-copy.py --help

Site Notifications
------------------

Allura has support for site-wide notifications that appear below the site header,
but there is currently no UI for managing them.  They can easily be inserted via
manual mongo queries, however:

.. code-block:: console

    > db.site_notification.insert({
    ... active: true,
    ... impressions: 10,
    ... content: 'You can now reimport exported project data.'
    ... })

This will create a notification that will be shown for 10 page views or until the
user closes it manually.  An `impressions` value of 0 will show the notification
indefinitely (until closed).  The notification content can contain HTML.  Only the
most recent notification will be shown, unless it has `active:false`, in which case
no notification will be shown.

Using Projects and Tools
------------------------

We currently don't have any further documentation for basic operations of managing
users, projects, and tools on Allura.  However, SourceForge has help docs that cover
these functions https://sourceforge.net/p/forge/documentation/Docs%20Home/  Note
that this documentation also covers some SourceForge features that are not part of Allura.

Public API Documentation
------------------------

Allura's web api is currently documented at https://sourceforge.net/p/forge/documentation/Allura%20API/