text:
class PhotosController < ApplicationController
  before_action :authenticate_user!, except: %i(show index)
  respond_to :html, :json

  def show
    @photo = if user_signed_in?
      current_user.photos_from(Person.find_by_guid(params[:person_id])).where(id: params[:id]).first
    else
      Photo.where(id: params[:id], public: true).first
    end

    raise ActiveRecord::RecordNotFound unless @photo
  end

  def index
    @post_type = :photos
    @person = Person.find_by_guid(params[:person_id])
    authenticate_user! if @person.try(:remote?) && !user_signed_in?

    if @person
      @contact = current_user.contact_for(@person) if user_signed_in?
      @posts = Photo.visible(current_user, @person, :all, max_time)
      respond_to do |format|
        format.all do
          gon.preloads[:person] = PersonPresenter.new(@person, current_user).as_json
          gon.preloads[:photos] = {
            count: Photo.visible(current_user, @person).count(:all)
          }
          gon.preloads[:contacts] = {
            count: Contact.contact_contacts_for(current_user, @person).count(:all),
          }
          render "people/show", layout: "with_header"
        end
        format.mobile { render "people/show" }
        format.json{ render_for_api :backbone, :json => @posts, :root => :photos }
      end
    else
      flash[:error] = I18n.t 'people.show.does_not_exist'
      redirect_to people_path
    end
  end

  def create
    rescuing_photo_errors do
      if remotipart_submitted?
        @photo = current_user.build_post(:photo, photo_params)
        if @photo.save
          respond_to do |format|
            format.json { render :json => {"success" => true, "data" => @photo.as_api_response(:backbone)} }
          end
        else
          respond_with @photo, :location => photos_path, :error => message
        end
      else
        legacy_create
      end
    end
  end

  def make_profile_photo
    author_id = current_user.person_id
    @photo = Photo.where(:id => params[:photo_id], :author_id => author_id).first

    if @photo
      profile_hash = {:image_url        => @photo.url(:thumb_large),
                      :image_url_medium => @photo.url(:thumb_medium),
                      :image_url_small  => @photo.url(:thumb_small)}

      if current_user.update_profile(profile_hash)
        respond_to do |format|
          format.js{ render :json => { :photo_id  => @photo.id,
                                       :image_url => @photo.url(:thumb_large),
                                       :image_url_medium => @photo.url(:thumb_medium),
                                       :image_url_small  => @photo.url(:thumb_small),
                                       :author_id => author_id},
                            :status => 201}
        end
      else
        render :nothing => true, :status => 422
      end
    else
      render :nothing => true, :status => 422
    end
  end

  def destroy
    photo = current_user.photos.where(:id => params[:id]).first

    if photo
      current_user.retract(photo)

      respond_to do |format|
        format.json{ render :nothing => true, :status => 204 }
        format.html do
          flash[:notice] = I18n.t 'photos.destroy.notice'
          if StatusMessage.find_by_guid(photo.status_message_guid)
              respond_with photo, :location => post_path(photo.status_message)
          else
            respond_with photo, :location => person_photos_path(current_user.person)
          end
        end
      end
    else
      respond_with photo, :location => person_photos_path(current_user.person)
    end
  end

  def edit
    if @photo = current_user.photos.where(:id => params[:id]).first
      respond_with @photo
    else
      redirect_to person_photos_path(current_user.person)
    end
  end

  def update
    photo = current_user.photos.where(:id => params[:id]).first
    if photo
      if current_user.update_post( photo, photo_params )
        flash.now[:notice] = I18n.t 'photos.update.notice'
        respond_to do |format|
          format.js{ render :json => photo, :status => 200 }
        end
      else
        flash.now[:error] = I18n.t 'photos.update.error'
        respond_to do |format|
          format.html{ redirect_to [:edit, photo] }
          format.js{ render :status => 403 }
        end
      end
    else
      redirect_to person_photos_path(current_user.person)
    end
  end

  private

  def photo_params
    params.require(:photo).permit(:public, :text, :pending, :user_file, :image_url, :aspect_ids, :set_profile_photo)
  end

  def file_handler(params)
    # For XHR file uploads, request.params[:qqfile] will be the path to the temporary file
    # For regular form uploads (such as those made by Opera), request.params[:qqfile] will be an UploadedFile which can be returned unaltered.
    if not request.params[:qqfile].is_a?(String)
      params[:qqfile]
    else
      ######################## dealing with local files #############
      # get file name
      file_name = params[:qqfile]
      # get file content type
      att_content_type = (request.content_type.to_s == "") ? "application/octet-stream" : request.content_type.to_s
      # create tempora##l file
      file = Tempfile.new(file_name, {:encoding =>  'BINARY'})
      # put data into this file from raw post request
      file.print request.raw_post.force_encoding('BINARY')

      # create several required methods for this temporal file
      Tempfile.send(:define_method, "content_type") {return att_content_type}
      Tempfile.send(:define_method, "original_filename") {return file_name}
      file
    end
  end

  def legacy_create
    if params[:photo][:aspect_ids] == "all"
      params[:photo][:aspect_ids] = current_user.aspects.collect { |x| x.id }
    elsif params[:photo][:aspect_ids].is_a?(Hash)
      params[:photo][:aspect_ids] = params[:photo][:aspect_ids].values
    end

    params[:photo][:user_file] = file_handler(params)

    @photo = current_user.build_post(:photo, params[:photo])

    if @photo.save
      aspects = current_user.aspects_from_ids(params[:photo][:aspect_ids])

      unless @photo.pending
        current_user.add_to_streams(@photo, aspects)
        current_user.dispatch_post(@photo, :to => params[:photo][:aspect_ids])
      end

      if params[:photo][:set_profile_photo]
        profile_params = {:image_url => @photo.url(:thumb_large),
                          :image_url_medium => @photo.url(:thumb_medium),
                          :image_url_small => @photo.url(:thumb_small)}
        current_user.update_profile(profile_params)
      end

      respond_to do |format|
        format.json{ render(:layout => false , :json => {"success" => true, "data" => @photo}.to_json )}
        format.html{ render(:layout => false , :json => {"success" => true, "data" => @photo}.to_json )}
      end
    else
      respond_with @photo, :location => photos_path, :error => message
    end
  end

  def rescuing_photo_errors
    begin
      yield
    rescue TypeError
      message = I18n.t 'photos.create.type_error'
      respond_with @photo, :location => photos_path, :error => message

    rescue CarrierWave::IntegrityError
      message = I18n.t 'photos.create.integrity_error'
      respond_with @photo, :location => photos_path, :error => message

    rescue RuntimeError => e
      message = I18n.t 'photos.create.runtime_error'
      respond_with @photo, :location => photos_path, :error => message
      raise e
    end
  end
end


text:
Arithmetic
==========

Arithmetic

redpajama_set_name: RedPajamaGithub


text:
package com.google.appengine.api.taskqueue.dev;

import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
import static java.util.concurrent.TimeUnit.SECONDS;
import static junit.framework.TestCase.assertFalse;
import static org.junit.Assert.assertThrows;
import static org.mockito.Mockito.mock;

import com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueAddRequest;
import com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueAddRequest.Header;
import com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueAddResponse;
import com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueRetryParameters;
import com.google.appengine.api.taskqueue.TaskQueuePb.TaskQueueServiceError.ErrorCode;
import com.google.appengine.api.urlfetch.URLFetchServicePb.URLFetchRequest;
import com.google.appengine.tools.development.Clock;
import com.google.appengine.tools.development.LocalServerEnvironment;
import com.google.apphosting.api.ApiProxy;
import com.google.apphosting.utils.config.QueueXml;
import com.google.common.collect.Lists;
import com.google.protobuf.ByteString;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.SimpleTrigger;

/**
 * Integration tests for local dev queue. These tests use a real Quartz {@link Scheduler}.
 *
 */
@RunWith(JUnit4.class)
public class DevQueueIntegrationTest {

  private static final String SERVER_NAME = "server1";

  private DevQueue queue;
  private Scheduler scheduler;

  private CountDownLatch latch;
  private final List<URLFetchRequest> providedFetchReqs =
      Collections.synchronizedList(new ArrayList<URLFetchRequest>());

  private Integer success() throws Exception {
    latch.countDown();
    return 200;
  }

  private Integer doFail() throws Exception {
    latch.countDown();
    return 301;
  }

  private Callable<Integer> onExecute = this::success;

  class TestLocalTaskQueueCallback implements LocalTaskQueueCallback {
    @Override
    public int execute(URLFetchRequest fetchReq) {
      providedFetchReqs.add(fetchReq);
      try {
        return onExecute.call();
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }

    @Override
    public void initialize(Map<String, String> properties) {
      // no initialization necessary
    }
  }

  @Before
  public void setUp() throws Exception {
    setUp(false);
  }

  private void setUp(boolean disableAutoTaskExecution) throws Exception {
    LocalServerEnvironment lse = mock(LocalServerEnvironment.class);
    UrlFetchJob.initialize(lse, Clock.DEFAULT);
    scheduler = LocalTaskQueue.startScheduler(disableAutoTaskExecution);
    latch = new CountDownLatch(1);
    queue =
        new DevPushQueue(
            getDefaultQueueXmlEntry(),
            scheduler,
            "http://localhost:8080",
            Clock.DEFAULT,
            new TestLocalTaskQueueCallback());
    providedFetchReqs.clear();
    onExecute = this::success;
  }

  private static QueueXml.Entry getDefaultQueueXmlEntry() {
    QueueXml.Entry queueXmlEntry = QueueXml.defaultEntry();
    queueXmlEntry.setRate(32.2);
    queueXmlEntry.setTarget(SERVER_NAME);
    return queueXmlEntry;
  }

  @After
  public void tearDown() throws Exception {
    queue.flush();
    LocalTaskQueue.stopScheduler(scheduler);
    latch = null;
  }

  private TaskQueueAddRequest.Builder newAddRequest(long execTime) {
    return TaskQueueAddRequest.newBuilder()
        .setQueueName(ByteString.copyFromUtf8(QueueXml.defaultEntry().getName()))
        .setEtaUsec(execTime)
        .setMethod(TaskQueueAddRequest.RequestMethod.GET)
        .setUrl(ByteString.copyFromUtf8("/my/url"));
  }

  private long getNowMilliseconds(int addSeconds) {
    Instant i = Instant.now();
    return (i.getEpochSecond() + addSeconds) * 1000000 + i.getNano() / 1000;
  }

  @Test
  public void testAdd_NamedTask() throws Exception {
    // schedule way in the past
    TaskQueueAddRequest.Builder add =
        newAddRequest(1000).setTaskName(ByteString.copyFromUtf8("the name"));

    queue.add(add);
    waitForJobExecution();
    assertThat(providedFetchReqs).hasSize(1);
    assertFetchReqEquals(
        providedFetchReqs.get(0),
        URLFetchRequest.RequestMethod.GET,
        "http://localhost:8080/my/url",
        false,
        0,
        "the name",
        0);
  }

  @Test
  public void testAdd_UnnamedTask() throws Exception {
    // schedule way in the past
    TaskQueueAddRequest.Builder add = newAddRequest(1000);

    TaskQueueAddResponse response = queue.add(add);
    waitForJobExecution();
    assertThat(providedFetchReqs).hasSize(1);

    assertFetchReqEquals(
        providedFetchReqs.get(0),
        URLFetchRequest.RequestMethod.GET,
        "http://localhost:8080/my/url",
        false,
        0,
        response.getChosenTaskName().toStringUtf8(),
        0);
  }

  @Test
  public void testAddTaskRespectsHostHeader() throws Exception {
    // schedule way in the past
    TaskQueueAddRequest.Builder add = newAddRequest(1000);
    Header header =
        TaskQueueAddRequest.Header.newBuilder()
            .setKey(ByteString.copyFromUtf8("Host"))
            .setValue(ByteString.copyFromUtf8("localhost:24358"))
            .build();
    add.addHeader(header);

    TaskQueueAddResponse response = queue.add(add);
    waitForJobExecution();
    assertThat(providedFetchReqs).hasSize(1);

    assertFetchReqEquals(
        providedFetchReqs.get(0),
        URLFetchRequest.RequestMethod.GET,
        "http://localhost:24358/my/url",
        false,
        0,
        response.getChosenTaskName().toStringUtf8(),
        0);
  }

  @Test
  public void testAddTaskIgnoresNonLocalhostHostHeader() throws Exception {
    // schedule way in the past
    TaskQueueAddRequest.Builder add = newAddRequest(1000);
    Header header =
        TaskQueueAddRequest.Header.newBuilder()
            .setKey(ByteString.copyFromUtf8("Host"))
            .setValue(ByteString.copyFromUtf8("foo:8085"))
            .build();
    add.addHeader(header);

    TaskQueueAddResponse response = queue.add(add);
    waitForJobExecution();
    assertThat(providedFetchReqs).hasSize(1);

    assertFetchReqEquals(
        providedFetchReqs.get(0),
        URLFetchRequest.RequestMethod.GET,
        "http://localhost:8080/my/url",
        false,
        0,
        response.getChosenTaskName().toStringUtf8(),
        0);
  }

  @Test
  public void testAddDupe() throws Exception {
    // schedule way out in the future to make sure the task doesn't execute
    // before we add the dupe
    TaskQueueAddRequest.Builder a =
        newAddRequest(getNowMilliseconds(10000000))
            .setTaskName(ByteString.copyFromUtf8("task 9"));
    queue.add(a);
    ApiProxy.ApplicationException exception =
        assertThrows(ApiProxy.ApplicationException.class, () -> queue.add(a));
    // expected.
    assertThat(exception.getApplicationError()).isEqualTo(ErrorCode.TASK_ALREADY_EXISTS_VALUE);
    assertThat(providedFetchReqs).isEmpty();
  }

  @Test
  public void testDelete() throws Exception {
    assertFalse(queue.deleteTask("task 9"));

    // schedule way out in the future to make sure the task doesn't execute
    // before we delete
    TaskQueueAddRequest.Builder addRequest =
        newAddRequest(getNowMilliseconds(10000000))
            .setTaskName(ByteString.copyFromUtf8("task 9"));
    queue.add(addRequest);
    assertThat(queue.deleteTask("task 9")).isTrue();
    assertFalse(queue.deleteTask("task 9"));

    assertThat(providedFetchReqs).isEmpty();
  }

  @Test
  public void testRun() throws Exception {
    assertThat(providedFetchReqs).isEmpty();
    assertFalse(queue.deleteTask("task 9"));

    // schedule way out in the future to make sure the task doesn't execute
    // before we execute
    TaskQueueAddRequest.Builder addRequest =
        newAddRequest(getNowMilliseconds(10000000))
            .setTaskName(ByteString.copyFromUtf8("task 9"));
    queue.add(addRequest);
    assertThat(queue.runTask("task 9")).isTrue();
    assertThat(providedFetchReqs).isNotEmpty();
    assertFetchReqEquals(
        providedFetchReqs.get(0),
        URLFetchRequest.RequestMethod.GET,
        "http://localhost:8080/my/url",
        false,
        0,
        "task 9",
        0);

    providedFetchReqs.clear();
    assertFalse(queue.runTask("task 9"));
    assertFalse(queue.deleteTask("task 9"));
    assertThat(providedFetchReqs).isEmpty();
  }

  @Test
  public void testGetStateInfo() throws Exception {
    List<String> jobNames = Lists.newArrayList();
    List<Long> etas = Lists.newArrayList();
    // In micro seconds. Adding buffer of 200 micro second so that task are not scheduled
    // before test run is completed.
    long startingEta = (System.currentTimeMillis() + 200) * 1000;
    for (int i = 0; i < 10; i++) {
      // Add task in reverse order so that task 10 is scheduled before task 9.
      TaskQueueAddRequest.Builder addRequest = newAddRequest(startingEta - (i * 1000));
      String taskName = "task" + i;
      addRequest.setTaskName(ByteString.copyFromUtf8(taskName));
      jobNames.add(taskName);
      SimpleTrigger trig =
          new SimpleTrigger(taskName, "default", new Date(addRequest.getEtaUsec() / 1000));
      etas.add(trig.getStartTime().getTime());
      queue.add(addRequest);

      assertThat(providedFetchReqs).isEmpty();
    }

    QueueStateInfo info = queue.getStateInfo();
    assertThat(info.getCountTasks()).isEqualTo(10);
    Iterator<String> reversedJobNames = Lists.reverse(jobNames).iterator();
    Iterator<Long> reversedEtas = Lists.reverse(etas).iterator();
    for (QueueStateInfo.TaskStateInfo taskInfo : info.getTaskInfo()) {
      assertThat(taskInfo.getTaskName()).isEqualTo(reversedJobNames.next());
      assertThat(taskInfo.getEtaMillis()).isEqualTo(reversedEtas.next().longValue());
    }
  }

  @Test
  public void testFlush() throws SchedulerException {
    // schedule way out in the future to make sure the task doesn't execute
    // before we flush
    TaskQueueAddRequest.Builder addRequest =
        newAddRequest(getNowMilliseconds(10000000));
    addRequest.setTaskName(ByteString.copyFromUtf8("task 10"));

    queue.flush();
    assertFalse(queue.deleteTask("task 9"));
    assertFalse(queue.deleteTask("task 10"));

    assertThat(providedFetchReqs).isEmpty();
  }

  @Test
  public void testTaskDoesNotAutoRunWhenAutoExecDisabled() throws Exception {
    tearDown();
    // disable task execution
    setUp(true);
    assertThat(scheduler.isInStandbyMode()).isTrue();
    // schedule way in the past
    TaskQueueAddRequest.Builder addRequest =
        newAddRequest(1000).setTaskName(ByteString.copyFromUtf8("task 9"));
    queue.add(addRequest);
    // we'll give the task 3 seconds to execute but it shouldn't ever happen
    boolean success = latch.await(3, SECONDS);
    assertWithMessage("Job was automatically executed").that(success).isFalse();
    assertThat(providedFetchReqs).isEmpty();

    // make sure we can still manually invoke the task even though we're
    // in standby mode
    assertThat(queue.runTask("task 9")).isTrue();
    assertThat(providedFetchReqs).isNotNull();
    assertThat(providedFetchReqs).hasSize(1);
    assertFetchReqEquals(
        providedFetchReqs.get(0),
        URLFetchRequest.RequestMethod.GET,
        "http://localhost:8080/my/url",
        false,
        0,
        "task 9",
        0);
    providedFetchReqs.clear();

    // now we'll add another task and delete it
    queue.add(addRequest);
    assertThat(queue.deleteTask("task 9")).isTrue();
  }

  @Test
  public void testTaskDoesNotAutoRunWhenQueueRateIsZero() throws Exception {
    QueueXml.Entry entry = getDefaultQueueXmlEntry();
    entry.setRate(0.00);
    queue =
        new DevPushQueue(
            entry,
            scheduler,
            "http://localhost:8080",
            Clock.DEFAULT,
            new TestLocalTaskQueueCallback());
    assertFalse(scheduler.isInStandbyMode());
    // schedule way in the past
    TaskQueueAddRequest.Builder addRequest =
        newAddRequest(1000).setTaskName(ByteString.copyFromUtf8("task 9"));
    queue.add(addRequest);
    Set<?> triggerGroups = scheduler.getPausedTriggerGroups();
    assertThat(triggerGroups).containsExactly(entry.getName());

    // we'll give the task 3 seconds to execute but it shouldn't ever happen
    boolean executed = latch.await(3, SECONDS);
    assertWithMessage("Job was automatically executed").that(executed).isFalse();
    assertThat(providedFetchReqs).isEmpty();

    // make sure we can still manually invoke the task even though the job
    // group is paused
    assertThat(queue.runTask("task 9")).isTrue();
    assertThat(providedFetchReqs).isNotNull();
    assertThat(providedFetchReqs).hasSize(1);

    assertFetchReqEquals(
        providedFetchReqs.get(0),
        URLFetchRequest.RequestMethod.GET,
        "http://localhost:8080/my/url",
        false,
        0,
        "task 9",
        0);

    providedFetchReqs.clear();

    // now we'll add another task and delete it
    queue.add(addRequest);
    assertThat(queue.deleteTask("task 9")).isTrue();
  }

  @Test
  public void testTaskDoesRunWhenQueueRateIsNearZero() throws Exception {
    QueueXml.Entry entry = getDefaultQueueXmlEntry();
    entry.setRate(0.4);
    queue =
        new DevPushQueue(
            entry,
            scheduler,
            "http://localhost:8080",
            Clock.DEFAULT,
            new TestLocalTaskQueueCallback());

    // schedule way in the past
    TaskQueueAddRequest.Builder add =
        newAddRequest(1000).setTaskName(ByteString.copyFromUtf8("the name"));

    queue.add(add);
    Set<?> triggerGroups = scheduler.getPausedTriggerGroups();
    assertThat(triggerGroups).isEmpty();
    waitForJobExecution();
    assertThat(providedFetchReqs).hasSize(1);
    assertFetchReqEquals(
        providedFetchReqs.get(0),
        URLFetchRequest.RequestMethod.GET,
        "http://localhost:8080/my/url",
        false,
        0,
        "the name",
        0);
  }

  @Test
  public void testSuccessCodes() throws InterruptedException {
    // All codes [200-299] are considered to be successful.
    for (int code = 200; code < 300; code += 1) {
      final int httpResponseCode = code;
      onExecute =
          () -> {
            success();
            return httpResponseCode;
          };
      // schedule way in the past
      TaskQueueAddRequest.Builder add =
          newAddRequest(1000).setTaskName(ByteString.copyFromUtf8("the name" + httpResponseCode));
      queue.add(add);
      waitForJobExecution();
    }
  }

  @Test
  public void testRetries() throws InterruptedException {
    // install a handler that fails twice and succeeds on the third
    // attempt
    onExecute =
        new Callable<Integer>() {
          int attempt = 0;

          @Override
          public Integer call() throws Exception {
            if (++attempt == 3) {
              return success();
            }
            return 301;
          }
        };
    // schedule way in the past
    TaskQueueAddRequest.Builder add =
        newAddRequest(1000).setTaskName(ByteString.copyFromUtf8("the name"));
    queue.add(add);
    waitForJobExecution();
    assertThat(providedFetchReqs).hasSize(3);
    assertFetchReqEquals(
        providedFetchReqs.get(0),
        URLFetchRequest.RequestMethod.GET,
        "http://localhost:8080/my/url",
        false,
        0,
        "the name",
        0);
    assertFetchReqEquals(
        providedFetchReqs.get(1),
        URLFetchRequest.RequestMethod.GET,
        "http://localhost:8080/my/url",
        false,
        1,
        "the name",
        301);
    assertFetchReqEquals(
        providedFetchReqs.get(2),
        URLFetchRequest.RequestMethod.GET,
        "http://localhost:8080/my/url",
        false,
        2,
        "the name",
        301);
  }

  @Test
  public void testRetryLimitNoRetries() throws InterruptedException {
    onExecute = this::doFail;
    // schedule way in the past
    TaskQueueAddRequest.Builder add =
        newAddRequest(1000).setTaskName(ByteString.copyFromUtf8("the name"));
    TaskQueueRetryParameters.Builder retryParams = add.getRetryParametersBuilder();
    // Schedule no retries, so only the initial task execution should occur.
    retryParams.setRetryLimit(0);

    queue.add(add);
    waitForJobExecution();
    // Give the scheduler a chance to run additional fetches (which of course it
    // shouldn't).
    Thread.sleep(500);
    assertThat(providedFetchReqs).hasSize(1);
    assertFetchReqEquals(
        providedFetchReqs.get(0),
        URLFetchRequest.RequestMethod.GET,
        "http://localhost:8080/my/url",
        false,
        0,
        "the name",
        0);
  }

  @Test
  public void testRetryLimitOneRetry() throws InterruptedException {
    onExecute = this::doFail;
    // schedule way in the past
    TaskQueueAddRequest.Builder add =
        newAddRequest(1000).setTaskName(ByteString.copyFromUtf8("the name"));
    add.getRetryParametersBuilder().setRetryLimit(1);
    // We expect the handler to be called twice.
    latch = new CountDownLatch(2);

    queue.add(add);
    waitForJobExecution();
    // Give the scheduler a chance to run additional fetches (which of course it
    // shouldn't).
    Thread.sleep(1000);
    assertThat(providedFetchReqs).hasSize(2);
    assertFetchReqEquals(
        providedFetchReqs.get(0),
        URLFetchRequest.RequestMethod.GET,
        "http://localhost:8080/my/url",
        false,
        0,
        "the name",
        0);
    assertFetchReqEquals(
        providedFetchReqs.get(1),
        URLFetchRequest.RequestMethod.GET,
        "http://localhost:8080/my/url",
        false,
        1,
        "the name",
        301);
  }

  @Test
  public void testAgeLimitSec() throws InterruptedException {
    onExecute = this::doFail;
    // schedule way in the past
    TaskQueueAddRequest.Builder add =
        newAddRequest(1000).setTaskName(ByteString.copyFromUtf8("the name"));
    add.getRetryParametersBuilder().setAgeLimitSec(1);
    ;

    queue.add(add);
    // Give the scheduler a chance to run plenty of fetches.
    Thread.sleep(5000);
    // The expectations here are somewhat subtle.  Ideally the task would be
    // executed precisely 5 times: the initial execution, plus at deltas of
    // 100, 300, 700, 1500 milliseconds. The last one is run because it is
    // scheduled before the first second is over.  Note however that we accept
    // any result between 2 and 5 executions, because contention on the machine
    // may slow things down.
    assertThat(providedFetchReqs.size()).isAtLeast(2);
    assertThat(providedFetchReqs.size()).isAtMost(5);
    assertFetchReqEquals(
        providedFetchReqs.get(0),
        URLFetchRequest.RequestMethod.GET,
        "http://localhost:8080/my/url",
        false,
        0,
        "the name",
        0);
    assertFetchReqEquals(
        providedFetchReqs.get(1),
        URLFetchRequest.RequestMethod.GET,
        "http://localhost:8080/my/url",
        false,
        1,
        "the name",
        301);
  }

  @Test
  public void testRetryLimitWithAgeLimitSec() throws InterruptedException {
    onExecute = this::doFail;
    // schedule way in the past
    TaskQueueAddRequest.Builder add =
        newAddRequest(1000).setTaskName(ByteString.copyFromUtf8("the name"));
    TaskQueueRetryParameters.Builder retryParams = add.getRetryParametersBuilder();
    // Both of the following limits must apply before retries are stopped.
    retryParams.setAgeLimitSec(0);
    retryParams.setRetryLimit(0);

    queue.add(add);
    // Give the scheduler a chance to run plenty of fetches.
    Thread.sleep(500);
    // See comment in testAgeLimitSec(). Note that retries weren't limited to zero retries.
    assertThat(providedFetchReqs).isNotEmpty();
    assertThat(providedFetchReqs.size()).isAtMost(2);
    assertFetchReqEquals(
        providedFetchReqs.get(0),
        URLFetchRequest.RequestMethod.GET,
        "http://localhost:8080/my/url",
        false,
        0,
        "the name",
        0);
    // The age limit is only measured to ms resolution. That means in most cases, the scheduler
    // checks the task age before 1 ms has passed from the first try. In slower situations, the
    // more than 1 ms passes between these events and the retry code thinks the task is now
    // too old.
    if (providedFetchReqs.size() == 2) {
      assertFetchReqEquals(
          providedFetchReqs.get(1),
          URLFetchRequest.RequestMethod.GET,
          "http://localhost:8080/my/url",
          false,
          1,
          "the name",
          301);
    }
  }

  @Test
  public void testMinBackoffSec() throws InterruptedException {
    onExecute = this::doFail;
    // schedule way in the past
    TaskQueueAddRequest.Builder add =
        newAddRequest(1000).setTaskName(ByteString.copyFromUtf8("the name"));
    add.getRetryParametersBuilder().setMinBackoffSec(10.0);
    ;

    queue.add(add);
    // Give the scheduler a chance to run plenty of fetches.
    Thread.sleep(5000);
    // No retries should be run.
    assertThat(providedFetchReqs).hasSize(1);
    assertFetchReqEquals(
        providedFetchReqs.get(0),
        URLFetchRequest.RequestMethod.GET,
        "http://localhost:8080/my/url",
        false,
        0,
        "the name",
        0);
  }

  private void assertFetchReqEquals(
      URLFetchRequest req,
      URLFetchRequest.RequestMethod reqMethod,
      String url,
      boolean hasPayload,
      int retryCount,
      String taskName,
      int previousResponse) {
    assertThat(req.getMethod()).isEqualTo(reqMethod);
    assertThat(req.getUrl()).isEqualTo(url);
    assertThat(req.hasPayload()).isEqualTo(hasPayload);
    assertRetryCountEquals(retryCount, req);
    assertExecutionCountEquals(retryCount, req);
    assertPreviousResponseEquals(previousResponse, req);
    assertQueueNameEquals("default", req);
    assertTaskNameEquals(taskName, req);
    assertTargetEquals(SERVER_NAME, req);
  }

  private void waitForJobExecution() throws InterruptedException {
    int secondsToWait = 10;
    boolean executed = latch.await(secondsToWait, SECONDS);
    assertWithMessage("Job was not executed after %s seconds", secondsToWait)
        .that(executed)
        .isTrue();
    assertThat(providedFetchReqs).isNotEmpty();
  }

  private void assertRetryCountEquals(int expected, URLFetchRequest req) {
    assertHeaderEquals(UrlFetchJob.X_APPENGINE_TASK_RETRY_COUNT, Integer.toString(expected), req);
  }

  private void assertExecutionCountEquals(int expected, URLFetchRequest req) {
    assertHeaderEquals(
        UrlFetchJob.X_APPENGINE_TASK_EXECUTION_COUNT, Integer.toString(expected), req);
  }

  private void assertPreviousResponseEquals(int expected, URLFetchRequest req) {
    // If zero, we assert that it's totally missing.
    if (expected == 0) {
      assertHeaderMissing(UrlFetchJob.X_APPENGINE_TASK_PREVIOUS_RESPONSE, req);
    } else {
      assertHeaderEquals(
          UrlFetchJob.X_APPENGINE_TASK_PREVIOUS_RESPONSE, Integer.toString(expected), req);
    }
  }

  private void assertQueueNameEquals(String expected, URLFetchRequest req) {
    assertHeaderEquals(UrlFetchJob.X_APPENGINE_QUEUE_NAME, expected, req);
  }

  private void assertTaskNameEquals(String expected, URLFetchRequest req) {
    assertHeaderEquals(UrlFetchJob.X_APPENGINE_TASK_NAME, expected, req);
  }

  private void assertTargetEquals(String expected, URLFetchRequest req) {
    assertHeaderEquals(UrlFetchJob.X_APPENGINE_SERVER_NAME, expected, req);
  }

  private void assertHeaderEquals(String header, String expected, URLFetchRequest req) {
    boolean found = false;
    for (URLFetchRequest.Header h : req.getHeaderList()) {
      if (h.getKey().equals(header)) {
        assertThat(h.getValue()).isEqualTo(expected);
        found = true;
        break;
      }
    }
    assertWithMessage("header %s not found", header).that(found).isTrue();
  }

  private void assertHeaderMissing(String header, URLFetchRequest req) {
    for (URLFetchRequest.Header h : req.getHeaderList()) {
      assertWithMessage("header %s found with value %s", header, h.getValue())
          .that(h.getKey())
          .isNotEqualTo(header);
    }
  }
}


text:
<?php

namespace PayPalHttp;

/**
 * Class HttpResponse
 * @package PayPalHttp
 *
 * Object that holds your response details
 */
class HttpResponse
{
    /**
     * @var integer
     */
    public $statusCode;

    /**
     * @var array | string
     */
    public $result;

    /**
     * @var array
     */
    public $headers;

    public function __construct($statusCode, $body, $headers)
    {
        $this->statusCode = $statusCode;
        $this->headers = $headers;
        $this->result = $body;
    }
}


text:
using System;
using System.IO;

namespace DiscUtils.Common
{
    public class CommandLineSwitch
    {
        private string[] _shortSwitches;
        private string _fullSwitch;
        private string _paramName;
        private string _description;
        private bool _isPresent;
        private string _paramValue;

        public CommandLineSwitch(string fullSwitch, string paramName, string description)
        {
            _shortSwitches = new string[0];
            _fullSwitch = fullSwitch;
            _paramName = paramName;
            _description = description;
        }

        public CommandLineSwitch(string shortSwitch, string fullSwitch, string paramName, string description)
        {
            _shortSwitches = new string[] { shortSwitch };
            _fullSwitch = fullSwitch;
            _paramName = paramName;
            _description = description;
        }

        public CommandLineSwitch(string[] shortSwitches, string fullSwitch, string paramName, string description)
        {
            _shortSwitches = shortSwitches;
            _fullSwitch = fullSwitch;
            _paramName = paramName;
            _description = description;
        }

        public string ParameterName
        {
            get { return _paramName; }
        }

        public string FullSwitchName
        {
            get { return _fullSwitch; }
        }

        public virtual string FullDescription
        {
            get { return _description; }
        }

        public bool IsPresent
        {
            get { return _isPresent; }
        }

        public string Value
        {
            get { return _paramValue; }
        }

        internal void WriteDescription(TextWriter writer, string lineTemplate, int perLineDescWidth)
        {
            string[] switches;
            int ignore;
            switches = BuildSwitchInfo(_shortSwitches, _fullSwitch, _paramName, out ignore);

            string[] text = Utilities.WordWrap(FullDescription, perLineDescWidth);

            for (int i = 0; i < Math.Max(switches.Length, text.Length); ++i)
            {
                writer.WriteLine(lineTemplate, ((i < switches.Length) ? switches[i] : ""), ((i < text.Length) ? text[i] : ""));
            }
        }

        internal int SwitchDisplayLength
        {
            get
            {
                int maxLen;
                BuildSwitchInfo(_shortSwitches, _fullSwitch, _paramName, out maxLen);
                return maxLen;
            }
        }

        private static string[] BuildSwitchInfo(string[] shortSwitches, string fullSwitch, string param, out int maxLen)
        {
            maxLen = 0;

            string[] result = new string[shortSwitches.Length + 1];

            for (int i = 0; i < shortSwitches.Length; ++i)
            {
                result[i] = "-" + shortSwitches[i];
                if (param != null)
                {
                    result[i] += " <" + param + ">";
                }
                maxLen = Math.Max(result[i].Length, maxLen);
            }

            result[result.Length - 1] = "-" + fullSwitch;
            if (param != null)
            {
                result[result.Length - 1] += " <" + param + ">";
            }
            maxLen = Math.Max(result[result.Length - 1].Length, maxLen);

            return result;
        }

        internal bool Matches(string switchName)
        {
            if (switchName == _fullSwitch)
            {
                return true;
            }

            foreach (string sw in _shortSwitches)
            {
                if (sw == switchName)
                {
                    return true;
                }
            }

            return false;
        }

        internal virtual int Process(string[] args, int pos)
        {
            _isPresent = true;

            if (!string.IsNullOrEmpty(_paramName))
            {
                if (pos >= args.Length)
                {
                    throw new Exception(string.Format("Command-line switch {0} is missing value", _fullSwitch));
                }

                _paramValue = args[pos];
                ++pos;
            }

            return pos;
        }
    }
}


text:
package com.geek.click.game;

import com.geek.click.game.ui.Screen;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        Screen screen = new Screen(this);
        setContentView(screen);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {

        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

}


text:
package org.svv.datagenerator;

public class Test {

}


text:
require_relative 'spec_helper'

describe InvoiceService do

  let(:stripe_event_id) { 'xxx' }

  let(:metadata) {{
    country_code: 'NL',
    vat_registered: 'false',
    vat_number: 'NL123',
    accounting_id: '10001',
    other: 'random'
  }}

  let(:plan) do
    begin
      Stripe::Plan.retrieve('test')
    rescue
      Stripe::Plan.create \
        id: 'test',
        name: 'Test Plan',
        amount: 1499,
        currency: 'usd',
        interval: 'month'
    end
  end

  let(:customer) do
    Stripe::Customer.create \
      card: {
        number: '4242424242424242',
        exp_month: '12',
        exp_year: '30',
        cvc: '222'
      },
      metadata: metadata
  end

  let(:customer_invoices) do
    Stripe::Invoice.list(customer: customer.id, limit: 1)
  end

  let(:coupon) do
    begin
      Stripe::Coupon.retrieve('25OFF')
    rescue
      Stripe::Coupon.create(
        percent_off: 25,
        duration: 'repeating',
        duration_in_months: 3,
        id: '25OFF'
      )
    end
  end

  let(:service) { InvoiceService.new(customer_id: customer.id) }

  describe '#process_payment' do
    describe 'with new invoice' do
      it 'finalizes the invoice' do
        VCR.use_cassette('process_payment_new') do
          service.create_subscription(plan: plan.id)

          invoice = service.process_payment(
            stripe_event_id: stripe_event_id,
            stripe_invoice_id: service.last_stripe_invoice.id
          )

          _(invoice.finalized?).must_equal true
          _(invoice.subtotal).must_equal 1499
          _(invoice.discount_amount).must_equal 0
          _(invoice.subtotal_after_discount).must_equal 1499
          _(invoice.vat_amount).must_equal 315
          _(invoice.vat_rate).must_equal 21
          _(invoice.total).must_equal 1814
          _(invoice.currency).must_equal 'usd'
          _(invoice.customer_country_code).must_equal 'NL'
          _(invoice.customer_vat_number).must_equal 'NL123'
          _(invoice.stripe_event_id).must_equal stripe_event_id
          _(invoice.stripe_customer_id).must_equal customer.id
          _(invoice.customer_accounting_id).must_equal '10001'
          _(invoice.customer_vat_registered).must_equal false
          _(invoice.card_brand).must_equal 'Visa'
          _(invoice.card_last4).must_equal '4242'
          _(invoice.card_country_code).must_equal 'US'
          _(invoice.interval).must_equal 'month'
          _(invoice.stripe_subscription_id).wont_be_nil
        end
      end

      describe 'when the plan is yearly' do
        let(:plan) do
          begin
            Stripe::Plan.retrieve('test_yearly')
          rescue
            Stripe::Plan.create \
              id: 'test_yearly',
              name: 'Test Yearly Plan',
              amount: 10000,
              currency: 'usd',
              interval: 'year'
          end
        end

        it 'finalizes the invoice' do
          VCR.use_cassette('process_payment_yearly') do
            service.create_subscription(plan: plan.id)

            invoice = service.process_payment(
              stripe_event_id: stripe_event_id,
              stripe_invoice_id: service.last_stripe_invoice.id
            )

            _(invoice.finalized?).must_equal true
            _(invoice.interval).must_equal 'year'
          end
        end
      end
    end

    describe 'with new invoice and discount' do
      it 'finalizes the invoice' do
        VCR.use_cassette('process_payment_new_discount') do
          service.create_subscription(plan: plan.id, coupon: coupon.id)

          invoice = service.process_payment(
            stripe_event_id: stripe_event_id,
            stripe_invoice_id: service.last_stripe_invoice.id
          )

          _(invoice.finalized?).must_equal true
          _(invoice.subtotal).must_equal 1499
          _(invoice.discount_amount).must_equal 375
          _(invoice.subtotal_after_discount).must_equal 1499-375
          _(invoice.vat_amount).must_equal 236
          _(invoice.vat_rate).must_equal 21
          _(invoice.total).must_equal 1360
          _(invoice.currency).must_equal 'usd'
          _(invoice.customer_country_code).must_equal 'NL'
          _(invoice.customer_vat_number).must_equal 'NL123'
          _(invoice.stripe_event_id).must_equal stripe_event_id
          _(invoice.stripe_customer_id).must_equal customer.id
          _(invoice.customer_accounting_id).must_equal '10001'
          _(invoice.customer_vat_registered).must_equal false
          _(invoice.card_brand).must_equal 'Visa'
          _(invoice.card_last4).must_equal '4242'
          _(invoice.card_country_code).must_equal 'US'
          _(invoice.interval).must_equal 'month'
        end
      end
    end

    describe 'when all the invoice lines are zero' do
      it 'does not create an invoice' do
        VCR.use_cassette('process_payment_zero_lines') do
          customer.subscriptions.create(plan: plan.id, trial_end: (Time.now.to_i + 1000))
          stripe_invoice = customer_invoices.first
          invoice = service.process_payment(
            stripe_event_id: stripe_event_id,
            stripe_invoice_id: stripe_invoice.id
          )

          _(invoice).must_be_nil
        end
      end
    end

    describe 'when the invoice total is zero' do
      it 'does create an invoice if some lines are not zero' do
        VCR.use_cassette('process_payment_zero') do
          Stripe::InvoiceItem.create(customer: customer.id, amount: -100, currency: 'usd')
          Stripe::InvoiceItem.create(customer: customer.id, amount: 100, currency: 'usd')
          stripe_invoice = Stripe::Invoice.create(customer: customer.id)
          stripe_invoice.pay

          stripe_invoice = customer_invoices.first
          invoice = service.process_payment(
            stripe_event_id: stripe_event_id,
            stripe_invoice_id: stripe_invoice.id
          )

          _(invoice).wont_be_nil
          _(invoice.total).must_equal 0
        end
      end
    end

    describe 'when an error occurs' do
      it 'does not finalize the invoice and rolls back the transaction' do
        VCR.use_cassette('process_failed_finalization') do
          service.create_subscription(plan: plan.id)

          Stripe::Subscription.expects(:retrieve).raises(Stripe::RateLimitError)

          _(proc do
            service.process_payment(
              stripe_event_id: stripe_event_id,
              stripe_invoice_id: service.last_stripe_invoice.id
            )
          end).must_raise Stripe::RateLimitError
          _(Invoice.where(stripe_id: service.last_stripe_invoice.id).empty?).must_equal true
        end
      end
    end
  end

  describe '#process_credit_note' do
    it 'is an orphan refund' do
      VCR.use_cassette('process_credit_note_orphan') do
        stripe_credit_note = create_stripe_credit_note

        Stripe::CreditNote.expects(:retrieve).returns(stripe_credit_note)
        stripe_credit_note.expects(:refund).returns(false) # Skip getting the charge, not relevant
        Invoice.where(stripe_id: stripe_credit_note.invoice).delete # Delete the invoice

        _(proc do
          service.process_credit_note(
            stripe_event_id: stripe_event_id,
            stripe_credit_note_id: stripe_credit_note.id
          )
        end).must_raise InvoiceService::OrphanRefund
      end
    end

    describe 'when it is a real refund' do
      it 'creates a credit note' do
        VCR.use_cassette('process_credit_note') do
          stripe_credit_note = create_stripe_credit_note

          credit_note = service.process_credit_note(
            stripe_event_id: stripe_event_id,
            stripe_credit_note_id: stripe_credit_note.id
          )

          _(credit_note.finalized?).must_equal true
          _(credit_note.subtotal).must_equal 1499
          _(credit_note.discount_amount).must_equal 375
          _(credit_note.subtotal_after_discount).must_equal 1499-375
          _(credit_note.vat_amount).must_equal 236
          _(credit_note.vat_rate).must_equal 21
          _(credit_note.total).must_equal 1360
          _(credit_note.currency).must_equal 'usd'
          _(credit_note.customer_country_code).must_equal 'NL'
          _(credit_note.customer_vat_number).must_equal 'NL123'
          _(credit_note.stripe_event_id).must_equal stripe_event_id
          _(credit_note.stripe_customer_id).must_equal customer.id
          _(credit_note.customer_accounting_id).must_equal '10001'
          _(credit_note.customer_vat_registered).must_equal false
          _(credit_note.card_brand).must_equal 'Visa'
          _(credit_note.card_last4).must_equal '4242'
          _(credit_note.card_country_code).must_equal 'US'
          _(credit_note.interval).must_be_nil
        end
      end
    end

    describe 'when the VAT data has changed since the invoice' do
      let(:metadata) {{
        country_code: 'BE',
        vat_registered: 'true',
        vat_number: 'BE0849451764',
        accounting_id: '10001',
        other: 'random'
      }}

      it 'creates a creditnote with the original VAT data' do
        VCR.use_cassette('process_credit_note_changed_vat') do
          stripe_credit_note = create_stripe_credit_note(
            metadata: {country_code: 'FI', vat_number: 'FI789456', vat_registered: 'false'}
          )

          credit_note = service.process_credit_note(
            stripe_event_id: stripe_event_id,
            stripe_credit_note_id: stripe_credit_note.id
          )

          invoice = credit_note.reference

          [invoice, credit_note].each do |document|
            _(document.customer_country_code).must_equal 'BE'
            _(document.customer_vat_number).must_equal 'BE0849451764'
            _(document.customer_vat_registered).must_equal true
          end
        end
      end
    end

    def create_stripe_credit_note(type: 'refund', metadata: nil) # other options are 'credit' and 'out_of_band'
      service.create_subscription(plan: plan.id, coupon: coupon.id)

      invoice = service.process_payment(
        stripe_event_id: stripe_event_id,
        stripe_invoice_id: service.last_stripe_invoice.id
      )

      if metadata
        customer.metadata.update_attributes(metadata)
        customer.save
      end

      stripe_invoice = Stripe::Invoice.retrieve(invoice.stripe_id)

      Stripe::CreditNote.create(
        invoice: invoice.stripe_id,
        reason: 'order_change',
        :"#{type}_amount" => stripe_invoice.total,
        lines: stripe_invoice.lines.map do |line|
          {
            type: 'invoice_line_item',
            invoice_line_item: line.id,
            quantity: 1
          }
        end
      )
    end
  end
end


text:
#ifndef __EXTRACT_H
#define __EXTRACT_H

#include "Windows/FileFind.h"

#include "../../Archive/IArchive.h"

#include "ArchiveExtractCallback.h"
#include "ArchiveOpenCallback.h"
#include "ExtractMode.h"
#include "Property.h"

#include "../Common/LoadCodecs.h"

struct CExtractOptions
{
  bool StdInMode;
  bool StdOutMode;
  bool YesToAll;
  bool TestMode;
  bool CalcCrc;
  NExtract::NPathMode::EEnum PathMode;
  NExtract::NOverwriteMode::EEnum OverwriteMode;
  FString OutputDir;

  // bool ShowDialog;
  // bool PasswordEnabled;
  // UString Password;
  #if !defined(_7ZIP_ST) && !defined(_SFX)
  CObjectVector<CProperty> Properties;
  #endif

  #ifdef EXTERNAL_CODECS
  CCodecs *Codecs;
  #endif

  CExtractOptions():
      StdInMode(false),
      StdOutMode(false),
      YesToAll(false),
      TestMode(false),
      CalcCrc(false),
      PathMode(NExtract::NPathMode::kFullPathnames),
      OverwriteMode(NExtract::NOverwriteMode::kAskBefore)
      {}
};

struct CDecompressStat
{
  UInt64 NumArchives;
  UInt64 UnpackSize;
  UInt64 PackSize;
  UInt64 NumFolders;
  UInt64 NumFiles;
  UInt32 CrcSum;

  void Clear()
  {
    NumArchives = UnpackSize = PackSize = NumFolders = NumFiles = 0;
    CrcSum = 0;
  }
};

HRESULT DecompressArchives(
    CCodecs *codecs, const CIntVector &formatIndices,
    UStringVector &archivePaths, UStringVector &archivePathsFull,
    const NWildcard::CCensorNode &wildcardCensor,
    const CExtractOptions &options,
    IOpenCallbackUI *openCallback,
    IExtractCallbackUI *extractCallback,
    UString &errorMessage,
    CDecompressStat &stat);

#endif


text:
var Credits = function(game) {};

Credits.prototype = {

  preload: function () {
    this.optionCount = 1;
    this.creditCount = 0;

  },

  addCredit: function(task, author) {
    var authorStyle = { font: '40pt TheMinion', fill: 'white', align: 'center', stroke: 'rgba(0,0,0,0)', strokeThickness: 4};
    var taskStyle = { font: '30pt TheMinion', fill: 'white', align: 'center', stroke: 'rgba(0,0,0,0)', strokeThickness: 4};
    var authorText = game.add.text(game.world.centerX, 900, author, authorStyle);
    var taskText = game.add.text(game.world.centerX, 950, task, taskStyle);
    authorText.anchor.setTo(0.5);
    authorText.stroke = "rgba(0,0,0,0)";
    authorText.strokeThickness = 4;
    taskText.anchor.setTo(0.5);
    taskText.stroke = "rgba(0,0,0,0)";
    taskText.strokeThickness = 4;
    game.add.tween(authorText).to( { y: -300 }, 20000, Phaser.Easing.Cubic.Out, true, this.creditCount * 10000);
    game.add.tween(taskText).to( { y: -200 }, 20000, Phaser.Easing.Cubic.Out, true, this.creditCount * 10000);
    this.creditCount ++;
  },

  addMenuOption: function(text, callback) {
    var optionStyle = { font: '30pt TheMinion', fill: 'white', align: 'left', stroke: 'rgba(0,0,0,0)', srokeThickness: 4};
    var txt = game.add.text(10, (this.optionCount * 80) + 450, text, optionStyle);

    txt.stroke = "rgba(0,0,0,0";
    txt.strokeThickness = 4;
    var onOver = function (target) {
      target.fill = "#FEFFD5";
      target.stroke = "rgba(200,200,200,0.5)";
      txt.useHandCursor = true;
    };
    var onOut = function (target) {
      target.fill = "white";
      target.stroke = "rgba(0,0,0,0)";
      txt.useHandCursor = false;
    };
    //txt.useHandCursor = true;
    txt.inputEnabled = true;
    txt.events.onInputUp.add(callback, this);
    txt.events.onInputOver.add(onOver, this);
    txt.events.onInputOut.add(onOut, this);

    this.optionCount ++;
  },

  create: function () {
    this.stage.disableVisibilityChange = true;

    var bg = game.add.sprite(0, 0, 'gameover-bg');
    this.addCredit('Music', 'The internet');
    this.addCredit('Developer', 'Mihai');
    this.addCredit('Developer', 'Delia');
    this.addCredit('Developer', 'Cosmin');
    this.addCredit('Developer', 'Ionut');
    this.addCredit('Caveats', 'Keyboard Cat');
    this.addCredit('Phaser.io', 'Powered By');
    this.addCredit('for playing', 'Thank you');
    this.addMenuOption('<- Back', function (e) {
      game.state.start("GameMenu");
    });
    game.add.tween(bg).to({alpha: 0}, 20000, Phaser.Easing.Cubic.Out, true, 40000);
  }

};


text:
ID | Summary | Priority | Severity | Cause
------- | ------- | ------- | ------- | -------
 | | | |

###2、Disabled Rules
ID | Summary | Priority | Severity | Cause
------- | ------- | ------- | ------- | -------
TypographyDashes | Hyphen can be replaced with dash | 5 / 10 | Warning | 无聊......
TypographyEllipsis | Ellipsis string can be replaced with ellipsis character | 5 / 10 | Warning | 无聊......
TypographyFractions | Fraction string can be replaced with fraction character | 5 / 10 | Warning | 无聊......
TypographyQuotes | Straight quotes can be replaced with curvy quotes | 5 / 10 | Warning | 无聊......
TypographyOther | Other typographical problems | 3 / 10 | Warning | 无聊......


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>alternative Standard Libary: include/weak_ptr.hpp-Dateireferenz</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>

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

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

alternative Standard Libary
    0.29.8

Klassen |
Namensbereiche |
Funktionen

weak_ptr.hpp-Dateireferenz

#include "shared_ptr.hpp"

   Include-Abhängigkeitsdiagramm für weak_ptr.hpp:

<map name="include_2weak__ptr_8hpp" id="include_2weak__ptr_8hpp">
<area shape="rect" id="node2" href="../../d0/dc5/shared__ptr_8hpp.html" title="shared_ptr.hpp" alt="" coords="525,80,633,107"/>
<area shape="rect" id="node3" href="../../dd/d3a/common_8hpp.html" title="common.hpp" alt="" coords="519,379,617,405"/>
<area shape="rect" id="node17" href="../../d5/d6c/atomic_8hpp.html" title="atomic.hpp" alt="" coords="465,155,551,181"/>
<area shape="rect" id="node4" href="../../db/d16/config_8h.html" title="config.h" alt="" coords="5,453,72,480"/>
<area shape="rect" id="node5" href="../../d6/d88/unknown_8hpp.html" title="unknown.hpp" alt="" coords="96,453,195,480"/>
<area shape="rect" id="node18" href="../../de/d55/algorithm_8hpp.html" title="algorithm.hpp" alt="" coords="397,229,497,256"/>
<area shape="rect" id="node19" href="../../d8/d8f/inttokey_8hpp.html" title="inttokey.hpp" alt="" coords="205,379,299,405"/>
<area shape="rect" id="node20" href="../../d9/dde/iterator_8hpp.html" title="iterator.hpp" alt="" coords="525,304,611,331"/>
<area shape="rect" id="node21" href="../../dc/d54/type__traits_8hpp.html" title="type_traits.hpp" alt="" coords="393,304,501,331"/>
<area shape="rect" id="node22" href="../../d1/d4e/utility_8hpp.html" title="utility.hpp" alt="" coords="290,304,369,331"/>
<area shape="rect" id="node23" href="../../df/d09/new_8hpp.html" title="new.hpp" alt="" coords="323,379,394,405"/>
</map>

gehe zum Quellcode dieser Datei

Klassen

class  	std::weak_ptr< T >

Namensbereiche

  	std

Funktionen

template<class TA , class TB >

bool 	std::operator< (const weak_ptr< TA > &a, weak_ptr< TB > const &b)

template<class T >

void 	std::swap (weak_ptr< T > &a, weak_ptr< T > &b)

include

weak_ptr.hpp

Erzeugt von

     1.8.13


text:
package leap.lang.jdbc;

import java.sql.Connection;
import java.sql.SQLException;

public interface ConnectionCallback {

	void execute(Connection connection) throws SQLException;

}


text:
<?php

namespace LastCall\Crawler\Test\Handler\Logging;

use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use LastCall\Crawler\CrawlerEvents;
use LastCall\Crawler\Event\CrawlerRequestEvent;
use LastCall\Crawler\Event\CrawlerResponseEvent;
use LastCall\Crawler\Handler\Logging\RequestLogger;
use LastCall\Crawler\Test\Handler\HandlerTestTrait;
use Psr\Log\LoggerInterface;

class RequestLoggerTest extends \PHPUnit_Framework_TestCase
{
    use HandlerTestTrait;

    public function testSendingLogging()
    {
        $request = new Request('GET', 'https://lastcallmedia.com');
        $logger = $this->prophesize(LoggerInterface::class);
        $handler = new RequestLogger($logger->reveal());
        $event = new CrawlerRequestEvent($request);
        $this->invokeEvent($handler, CrawlerEvents::SENDING, $event);
        $logger->debug('Sending https://lastcallmedia.com', [
            'url' => 'https://lastcallmedia.com',
        ])->shouldHaveBeenCalled();
    }

    public function testSuccessLogging()
    {
        $request = new Request('GET', 'https://lastcallmedia.com');
        $response = new Response(200);
        $logger = $this->prophesize(LoggerInterface::class);
        $handler = new RequestLogger($logger->reveal());
        $event = new CrawlerResponseEvent($request, $response);
        $this->invokeEvent($handler, CrawlerEvents::SUCCESS, $event);
        $logger->debug('Received https://lastcallmedia.com', [
            'url' => 'https://lastcallmedia.com',
            'status' => 200,
        ])->shouldHaveBeenCalled();
    }

    public function testSuccessLoggingRedirect()
    {
        $request = new Request('GET', 'https://lastcallmedia.com');
        $response = new Response(301, ['Location' => '/foo']);
        $logger = $this->prophesize(LoggerInterface::class);
        $handler = new RequestLogger($logger->reveal());
        $event = new CrawlerResponseEvent($request, $response);
        $this->invokeEvent($handler, CrawlerEvents::SUCCESS, $event);
        $logger->info('Received https://lastcallmedia.com redirecting to /foo',
            [
                'url' => 'https://lastcallmedia.com',
                'status' => 301,
                'redirect' => '/foo',
            ])->shouldHaveBeenCalled();
    }

    public function testFailureLogging()
    {
        $request = new Request('GET', 'https://lastcallmedia.com');
        $response = new Response(400);
        $logger = $this->prophesize(LoggerInterface::class);
        $handler = new RequestLogger($logger->reveal());

        $event = new CrawlerResponseEvent($request, $response);
        $this->invokeEvent($handler, CrawlerEvents::FAILURE, $event);
        $logger->warning('Failure https://lastcallmedia.com', [
            'url' => 'https://lastcallmedia.com',
            'status' => 400,
        ])->shouldHaveBeenCalled();
    }
}


text:
base_dir Dir.pwd + "/"

# where to store cached files and cookbook output
file_cache_path base_dir + "cache/"

# where to find cookbooks
cookbook_path base_dir + "cookbooks/"


text:
from django import forms
from goodies.forms import CrispyBaseModelForm
from goodies.widgets import BootstrapDateTimeInput
from tasks.models import TaskItem

__author__ = 'andrei'

class TaskItemForm(CrispyBaseModelForm):
    class Meta:
        model = TaskItem
        exclude = ("owner", "parent_task", "status")

    start_date = forms.DateTimeField(widget=BootstrapDateTimeInput, required=True)
    end_date = forms.DateTimeField(widget=BootstrapDateTimeInput, required=False)


text:
2013-10-23
----------

* [b29ec29](http://github.com/transcode-open/apt-cyg/commit/b29ec29)
  Added multiarch support
* [9058643](http://github.com/transcode-open/apt-cyg/commit/9058643)
  Added xz archives support


text:
"use strict";
var router_1 = require('@angular/router');
var page1_component_1 = require('./page1.component');
var page2_component_1 = require('./page2.component');
var admin_component_1 = require('./admin.component');
var auth_guard_1 = require('./auth.guard');
exports.routes = [
    {
        path: 'page1',
        component: page1_component_1.Page1Component
    },
    {
        path: 'page2',
        component: page2_component_1.Page2Component
    },
    {
        path: 'admin',
        component: admin_component_1.AdminComponent,
        canActivate: [auth_guard_1.AuthGuard]
    },
    { path: '',
        component: page1_component_1.Page1Component
    }
];
exports.AUTH_PROVIDERS = [auth_guard_1.AuthGuard];
exports.APP_ROUTER_PROVIDERS = [
    router_1.provideRouter(exports.routes),
    exports.AUTH_PROVIDERS
];
//# sourceMappingURL=app.routes.js.map


text:
#ifdef HAVE_OPENCL

#if FMT_EXTERNS_H
extern struct fmt_main fmt_ocl_pbkdf1_sha1;
#elif FMT_REGISTERS_H
john_register_one(&fmt_ocl_pbkdf1_sha1);
#else

#include <ctype.h>
#include <string.h>

#include "common-opencl.h"
#include "arch.h"
#include "misc.h"
#include "common.h"
#include "formats.h"
#include "johnswap.h"
#include "base64_convert.h"
#include "stdint.h"
#include "options.h"
#define OUTLEN 20
#include "opencl_pbkdf2_hmac_sha1.h"
#undef MMX_COEF
#define PBKDF2_HMAC_SHA1_ALSO_INCLUDE_CTX 1
#include "pbkdf2_hmac_sha1.h"

//#define DEBUG
#define dump_stuff_msg(a, b, c)	dump_stuff_msg((void*)a, b, c)

#define FORMAT_LABEL		"PBKDF2-HMAC-SHA1-opencl"
#define FORMAT_NAME		""
#define ALGORITHM_NAME		"PBKDF2-SHA1 OpenCL"
#define BENCHMARK_COMMENT	""
#define BENCHMARK_LENGTH	-1
#define MIN_KEYS_PER_CRYPT	1
#define MAX_KEYS_PER_CRYPT	1

#define BINARY_SIZE		20
#define BINARY_ALIGN		sizeof(uint32_t)
#define MAX_BINARY_SIZE         (4 * BINARY_SIZE)
#define PLAINTEXT_LENGTH	64
#define SALT_SIZE		sizeof(pbkdf2_salt)
#define SALT_ALIGN		sizeof(int)
#define MAX_SALT_SIZE           52
#define MAX_CIPHERTEXT_LENGTH   (TAG_LEN + 6 + 1 + 2*MAX_SALT_SIZE + 1 + 2*MAX_BINARY_SIZE)

#define FORMAT_TAG              "$pbkdf2-hmac-sha1$"
#define PKCS5S2_TAG             "{PKCS5S2}"
#define PK5K2_TAG               "$p5k2$"
#define TAG_LEN                 (sizeof(FORMAT_TAG) - 1)

#define uint8_t			unsigned char
#define uint16_t		unsigned short
#define uint32_t		unsigned int

#define MIN(a, b)		(((a) > (b)) ? (b) : (a))
#define MAX(a, b)		(((a) > (b)) ? (a) : (b))

/* This handles all widths */
#define GETPOS(i, index)	(((index) % v_width) * 4 + ((i) & ~3U) * v_width + (((i) & 3) ^ 3) + ((index) / v_width) * PLAINTEXT_LENGTH * v_width)

/*
 * HASH_LOOPS is ideally made by factors of (iteration count - 1) and should
 * be chosen for a kernel duration of not more than 200 ms
 */
#define HASH_LOOPS		333

#define LOOP_COUNT		(((cur_salt->iterations - 1 + HASH_LOOPS - 1)) / HASH_LOOPS)
#define STEP			0
#define SEED			256
#define OCL_CONFIG		"pbkdf2-hmac-sha1"

static const char * warn[] = {
	"P xfer: "  ,  ", init: "   , ", loop: " , ", final: ", ", res xfer: "
};

static int split_events[] = { 2, -1, -1 };

static cl_kernel pbkdf2_init, pbkdf2_loop, pbkdf2_final;
static int crypt_all(int *pcount, struct db_salt *_salt);
static int crypt_all_benchmark(int *pcount, struct db_salt *_salt);

//This file contains auto-tuning routine(s). Has to be included after formats definitions.
#include "opencl-autotune.h"
#include "memdbg.h"

/* ------- Helper functions ------- */
static size_t get_task_max_work_group_size()
{
	size_t s;

	s = autotune_get_task_max_work_group_size(FALSE, 0, pbkdf2_init);
	s = MIN(s, autotune_get_task_max_work_group_size(FALSE, 0, pbkdf2_loop));
	s = MIN(s, autotune_get_task_max_work_group_size(FALSE, 0, pbkdf2_final));
	return s;
}

static size_t get_task_max_size()
{
	return 0;
}

static size_t get_default_workgroup()
{
	if (cpu(device_info[gpu_id]))
		return get_platform_vendor_id(platform_id) == DEV_INTEL ?
			8 : 1;
	else
		return 64;
}

static struct fmt_tests tests[] = {
	{"$pbkdf2-hmac-sha1$1000.fd11cde0.27de197171e6d49fc5f55c9ef06c0d8751cd7250", "3956"},
	{"$pbkdf2-hmac-sha1$1000.6926d45e.231c561018a4cee662df7cd4a8206701c5806af9", "1234"},
	{"$pbkdf2-hmac-sha1$1000.98fcb0db.37082711ff503c2d2dea9a5cf7853437c274d32e", "5490"},
	// WPA-PSK DK (raw key as stored by some routers):
	// iterations is always 4096.
	// ESSID was "Harkonen" - converted to hex 4861726b6f6e656e.
	// Only first 20 bytes (40 hex chars) of key is required but if
	// you supply all 32 (64) of them, they will be double checked
	// without sacrificing speed.
	// Please also note that you should run such hashes with --min-len=8,
	// because WPAPSK passwords can't be shorter than that.
	{"$pbkdf2-hmac-sha1$4096$4861726b6f6e656e$ee51883793a6f68e9615fe73c80a3aa6f2dd0ea537bce627b929183cc6e57925", "12345678"},
	// these get converted in prepare()
	// http://pythonhosted.org/passlib/lib/passlib.hash.atlassian_pbkdf2_sha1.html
	{"{PKCS5S2}DQIXJU038u4P7FdsuFTY/+35bm41kfjZa57UrdxHp2Mu3qF2uy+ooD+jF5t1tb8J", "password"},
	// http://pythonhosted.org/passlib/lib/passlib.hash.cta_pbkdf2_sha1.html
	{"$p5k2$2710$oX9ZZOcNgYoAsYL-8bqxKg==$AU2JLf2rNxWoZxWxRCluY0u6h6c=", "password" },
	{NULL}
};

static size_t key_buf_size;
static unsigned int *inbuffer;
static pbkdf2_out *output;
static pbkdf2_salt *cur_salt;
static cl_mem mem_in, mem_out, mem_salt, mem_state;
static unsigned int v_width = 1;	/* Vector width of kernel */
static int new_keys;

#if 0
struct fmt_main *me;
#endif

static void create_clobj(size_t gws, struct fmt_main *self)
{
	gws *= v_width;
	key_buf_size = PLAINTEXT_LENGTH * gws;

	/// Allocate memory
	inbuffer = mem_calloc(key_buf_size);
	output = mem_alloc(sizeof(pbkdf2_out) * gws);

	mem_in = clCreateBuffer(context[gpu_id], CL_MEM_READ_ONLY, key_buf_size, NULL, &ret_code);
	HANDLE_CLERROR(ret_code, "Error allocating mem in");
	mem_salt = clCreateBuffer(context[gpu_id], CL_MEM_READ_ONLY, sizeof(pbkdf2_salt), NULL, &ret_code);
	HANDLE_CLERROR(ret_code, "Error allocating mem salt");
	mem_out = clCreateBuffer(context[gpu_id], CL_MEM_WRITE_ONLY, sizeof(pbkdf2_out) * gws, NULL, &ret_code);
	HANDLE_CLERROR(ret_code, "Error allocating mem out");
	mem_state = clCreateBuffer(context[gpu_id], CL_MEM_READ_WRITE, sizeof(pbkdf2_state) * gws, NULL, &ret_code);
	HANDLE_CLERROR(ret_code, "Error allocating mem_state");

	HANDLE_CLERROR(clSetKernelArg(pbkdf2_init, 0, sizeof(mem_in), &mem_in), "Error while setting mem_in kernel argument");
	HANDLE_CLERROR(clSetKernelArg(pbkdf2_init, 1, sizeof(mem_salt), &mem_salt), "Error while setting mem_salt kernel argument");
	HANDLE_CLERROR(clSetKernelArg(pbkdf2_init, 2, sizeof(mem_state), &mem_state), "Error while setting mem_state kernel argument");

	HANDLE_CLERROR(clSetKernelArg(pbkdf2_loop, 0, sizeof(mem_state), &mem_state), "Error while setting mem_state kernel argument");

	HANDLE_CLERROR(clSetKernelArg(pbkdf2_final, 0, sizeof(mem_salt), &mem_salt), "Error while setting mem_salt kernel argument");
	HANDLE_CLERROR(clSetKernelArg(pbkdf2_final, 1, sizeof(mem_out), &mem_out), "Error while setting mem_out kernel argument");
	HANDLE_CLERROR(clSetKernelArg(pbkdf2_final, 2, sizeof(mem_state), &mem_state), "Error while setting mem_state kernel argument");
}

static void release_clobj(void)
{
	HANDLE_CLERROR(clReleaseMemObject(mem_state), "Release mem state");
	HANDLE_CLERROR(clReleaseMemObject(mem_out), "Release mem out");
	HANDLE_CLERROR(clReleaseMemObject(mem_salt), "Release mem setting");
	HANDLE_CLERROR(clReleaseMemObject(mem_in), "Release mem in");

	MEM_FREE(output);
	MEM_FREE(inbuffer);
}

static void done(void)
{
	release_clobj();

	HANDLE_CLERROR(clReleaseKernel(pbkdf2_init), "Release kernel");
	HANDLE_CLERROR(clReleaseKernel(pbkdf2_loop), "Release kernel");
	HANDLE_CLERROR(clReleaseKernel(pbkdf2_final), "Release kernel");
	HANDLE_CLERROR(clReleaseProgram(program[gpu_id]), "Release Program");
}

static void init(struct fmt_main *self)
{
	char build_opts[64];
	static char valgo[sizeof(ALGORITHM_NAME) + 8] = "";

#if 0
	me = self;
#endif
	if ((v_width = opencl_get_vector_width(gpu_id,
	                                       sizeof(cl_int))) > 1) {
		/* Run vectorized kernel */
		snprintf(valgo, sizeof(valgo),
		         ALGORITHM_NAME " %ux", v_width);
		self->params.algorithm_name = valgo;
	}

	snprintf(build_opts, sizeof(build_opts),
	         "-DHASH_LOOPS=%u -DOUTLEN=%u "
	         "-DPLAINTEXT_LENGTH=%u -DV_WIDTH=%u",
	         HASH_LOOPS, OUTLEN, PLAINTEXT_LENGTH, v_width);
	opencl_init("$JOHN/kernels/pbkdf2_hmac_sha1_kernel.cl", gpu_id, build_opts);

	pbkdf2_init = clCreateKernel(program[gpu_id], "pbkdf2_init", &ret_code);
	HANDLE_CLERROR(ret_code, "Error creating kernel");
	crypt_kernel = pbkdf2_loop = clCreateKernel(program[gpu_id], "pbkdf2_loop", &ret_code);
	HANDLE_CLERROR(ret_code, "Error creating kernel");
	pbkdf2_final = clCreateKernel(program[gpu_id], "pbkdf2_final", &ret_code);
	HANDLE_CLERROR(ret_code, "Error creating kernel");

	//Initialize openCL tuning (library) for this format.
	opencl_init_auto_setup(SEED, 2*HASH_LOOPS, split_events,
		warn, 2, self, create_clobj, release_clobj,
	        sizeof(pbkdf2_state), 0);

	//Auto tune execution from shared/included code.
	self->methods.crypt_all = crypt_all_benchmark;
	autotune_run(self, 2*999+4, 0,
		(cpu(device_info[gpu_id]) ? 1000000000 : 5000000000ULL));
	self->methods.crypt_all = crypt_all;

	self->params.min_keys_per_crypt = local_work_size * v_width;
	self->params.max_keys_per_crypt = global_work_size * v_width;
}

static char *prepare(char *fields[10], struct fmt_main *self)
{
	static char Buf[256];
	if (strncmp(fields[1], PKCS5S2_TAG, 9) != 0 && strncmp(fields[1], PK5K2_TAG, 6))
		return fields[1];
	if (!strncmp(fields[1], PKCS5S2_TAG, 9)) {
		char tmp[120];
		if (strlen(fields[1]) > 75) return fields[1];
		//{"{PKCS5S2}DQIXJU038u4P7FdsuFTY/+35bm41kfjZa57UrdxHp2Mu3qF2uy+ooD+jF5t1tb8J", "password"},
		//{"$pbkdf2-hmac-sha1$10000.0d0217254d37f2ee0fec576cb854d8ff.edf96e6e3591f8d96b9ed4addc47a7632edea176bb2fa8a03fa3179b75b5bf09", "password"},
		base64_convert(&(fields[1][9]), e_b64_mime, strlen(&(fields[1][9])), tmp, e_b64_hex, sizeof(tmp), 0);
		sprintf(Buf, "$pbkdf2-hmac-sha1$10000.%32.32s.%s", tmp, &tmp[32]);
		return Buf;
	}
	if (!strncmp(fields[1], PK5K2_TAG, 6)) {
		char tmps[140], tmph[70], *cp, *cp2;
		unsigned iter=0;
		// salt was listed as 1024 bytes max. But our max salt size is 64 bytes (~90 base64 bytes).
		if (strlen(fields[1]) > 128) return fields[1];
		//{"$p5k2$2710$oX9ZZOcNgYoAsYL-8bqxKg==$AU2JLf2rNxWoZxWxRCluY0u6h6c=", "password" },
		//{"$pbkdf2-hmac-sha1$10000.a17f5964e70d818a00b182fef1bab12a.014d892dfdab3715a86715b144296e634bba87a7", "password"},
		cp = fields[1];
		cp += 6;
		while (*cp && *cp != '$') {
			iter *= 0x10;
			iter += atoi16[ARCH_INDEX(*cp)];
			++cp;
		}
		if (*cp != '$') return fields[1];
		++cp;
		cp2 = strchr(cp, '$');
		if (!cp2) return fields[1];
		base64_convert(cp, e_b64_mime, cp2-cp, tmps, e_b64_hex, sizeof(tmps), flg_Base64_MIME_DASH_UNDER);
		++cp2;
		base64_convert(cp2, e_b64_mime, strlen(cp2), tmph, e_b64_hex, sizeof(tmph), flg_Base64_MIME_DASH_UNDER);
		sprintf(Buf, "$pbkdf2-hmac-sha1$%d.%s.%s", iter, tmps, tmph);
		return Buf;
	}
	return fields[1];
}

static int ishex(char *q)
{
	while (atoi16[ARCH_INDEX(*q)] != 0x7F)
		q++;
	return !*q;
}

static int valid(char *ciphertext, struct fmt_main *self)
{
	char *ptr, *ctcopy, *keeptr;
	size_t len;
	char *delim;

	if (strncmp(ciphertext, FORMAT_TAG, TAG_LEN))
		return 0;

	if (strlen(ciphertext) > MAX_CIPHERTEXT_LENGTH)
		return 0;

	ciphertext += TAG_LEN;

	delim = strchr(ciphertext, '.') ? "." : "$";

	if (!(ctcopy = strdup(ciphertext)))
		return 0;
	keeptr = ctcopy;
	if (!(ptr = strtok(ctcopy, delim)))
		goto error;
	if (!atoi(ptr))
		goto error;
	if (!(ptr = strtok(NULL, delim)))
		goto error;
	len = strlen(ptr); // salt hex length
	if (len > 2 * MAX_SALT_SIZE || len & 1)
		goto error;
	if (!ishex(ptr))
		goto error;
	if (!(ptr = strtok(NULL, delim)))
		goto error;
	len = strlen(ptr); // binary hex length
	if (len < BINARY_SIZE || len > MAX_BINARY_SIZE || len & 1)
		goto error;
	if (!ishex(ptr))
		goto error;
	MEM_FREE(keeptr);
	return 1;
error:
	MEM_FREE(keeptr);
	return 0;
}

static char *split(char *ciphertext, int index, struct fmt_main *self)
{
	static char out[MAX_CIPHERTEXT_LENGTH + 1];

	strnzcpy(out, ciphertext, sizeof(out));
	strlwr(out);
	return out;
}

static void *salt(char *ciphertext)
{
	static pbkdf2_salt cs;
	char *p;
	int saltlen;
	char delim;

	if (!strncmp(ciphertext, FORMAT_TAG, sizeof(FORMAT_TAG) - 1))
		ciphertext += sizeof(FORMAT_TAG) - 1;
	cs.iterations = atoi(ciphertext);
	delim = strchr(ciphertext, '.') ? '.' : '$';
	ciphertext = strchr(ciphertext, delim) + 1;
	p = strchr(ciphertext, delim);
	saltlen = 0;
	memset(cs.salt, 0, sizeof(cs.salt));
	while (ciphertext < p) {        /** extract salt **/
		cs.salt[saltlen++] =
			atoi16[ARCH_INDEX(ciphertext[0])] * 16 +
			atoi16[ARCH_INDEX(ciphertext[1])];
		ciphertext += 2;
	}
	cs.length = saltlen;
	cs.outlen = BINARY_SIZE;

	return (void*)&cs;
}

static void *binary(char *ciphertext)
{
	static union {
		unsigned char c[MAX_BINARY_SIZE];
		uint32_t dummy;
	} buf;
	unsigned char *out = buf.c;
	char *p;
	int i, len;
	char delim;

	delim = strchr(ciphertext, '.') ? '.' : '$';
	p = strrchr(ciphertext, delim) + 1;
	len = strlen(p) / 2;
	for (i = 0; i < len && *p; i++) {
		out[i] =
			(atoi16[ARCH_INDEX(*p)] << 4) |
			atoi16[ARCH_INDEX(p[1])];
		p += 2;
	}
#if !ARCH_LITTLE_ENDIAN
	for (i = 0; i < len/sizeof(uint32_t); ++i) {
		((uint32_t*)out)[i] = JOHNSWAP(((uint32_t*)out)[i]);
	}
#endif
#if 0
	dump_stuff_msg(__FUNCTION__, out, BINARY_SIZE);
#endif
	return out;
}

static void set_salt(void *salt)
{
	cur_salt = (pbkdf2_salt*)salt;
	HANDLE_CLERROR(clEnqueueWriteBuffer(queue[gpu_id], mem_salt, CL_FALSE, 0, sizeof(pbkdf2_salt), cur_salt, 0, NULL, NULL), "Copy salt to gpu");
#if 0
	fprintf(stderr, "\n%s(%.*s) len %u iter %u\n", __FUNCTION__, cur_salt->length, cur_salt->salt, cur_salt->length, cur_salt->iterations);
	dump_stuff_msg("salt", cur_salt->salt, cur_salt->length);
#endif
}

static void clear_keys(void)
{
	memset(inbuffer, 0, key_buf_size);
}

static void set_key(char *key, int index)
{
	int i;
	int length = strlen(key);

	for (i = 0; i < length; i++)
		((char*)inbuffer)[GETPOS(i, index)] = key[i];

	new_keys = 1;
}

static char* get_key(int index)
{
	static char ret[PLAINTEXT_LENGTH + 1];
	int i = 0;

	while (i < PLAINTEXT_LENGTH &&
	       (ret[i] = ((char*)inbuffer)[GETPOS(i, index)]))
		i++;
	ret[i] = 0;

	return ret;
}

static int crypt_all(int *pcount, struct db_salt *salt)
{
	int count = *pcount;
	int i;
	size_t scalar_gws;

	global_work_size = ((count + (v_width * local_work_size - 1)) / (v_width * local_work_size)) * local_work_size;
	scalar_gws = global_work_size * v_width;

	/// Copy data to gpu
	if (new_keys) {
		HANDLE_CLERROR(clEnqueueWriteBuffer(queue[gpu_id], mem_in, CL_FALSE, 0, key_buf_size, inbuffer, 0, NULL, NULL), "Copy data to gpu");
		new_keys = 0;
	}

	/// Run kernels
	HANDLE_CLERROR(clEnqueueNDRangeKernel(queue[gpu_id], pbkdf2_init, 1, NULL, &global_work_size, &local_work_size, 0, NULL, NULL), "Run initial kernel");

	for (i = 0; i < LOOP_COUNT; i++) {
		HANDLE_CLERROR(clEnqueueNDRangeKernel(queue[gpu_id], pbkdf2_loop, 1, NULL, &global_work_size, &local_work_size, 0, NULL, NULL), "Run loop kernel");
		HANDLE_CLERROR(clFinish(queue[gpu_id]), "Error running loop kernel");
		opencl_process_event();
	}

	HANDLE_CLERROR(clEnqueueNDRangeKernel(queue[gpu_id], pbkdf2_final, 1, NULL, &global_work_size, &local_work_size, 0, NULL, NULL), "Run intermediate kernel");

	/// Read the result back
	HANDLE_CLERROR(clEnqueueReadBuffer(queue[gpu_id], mem_out, CL_TRUE, 0, sizeof(pbkdf2_out) * scalar_gws, output, 0, NULL, NULL), "Copy result back");

	return count;
}

static int crypt_all_benchmark(int *pcount, struct db_salt *salt)
{
	size_t scalar_gws;
	size_t *lws = local_work_size ? &local_work_size : NULL;

	global_work_size = local_work_size ? ((*pcount + (v_width * local_work_size - 1)) / (v_width * local_work_size)) * local_work_size : *pcount / v_width;
	scalar_gws = global_work_size * v_width;

#if 0
	fprintf(stderr, "%s(%d) lws %zu gws %zu sgws %zu kpc %d/%d\n", __FUNCTION__, *pcount, local_work_size, global_work_size, scalar_gws, me->params.min_keys_per_crypt, me->params.max_keys_per_crypt);
#endif

	/// Copy data to gpu
	BENCH_CLERROR(clEnqueueWriteBuffer(queue[gpu_id], mem_in, CL_FALSE, 0, key_buf_size, inbuffer, 0, NULL, multi_profilingEvent[0]), "Copy data to gpu");

	/// Run kernels
	BENCH_CLERROR(clEnqueueNDRangeKernel(queue[gpu_id], pbkdf2_init, 1, NULL, &global_work_size, lws, 0, NULL, multi_profilingEvent[1]), "Run initial kernel");

	BENCH_CLERROR(clEnqueueNDRangeKernel(queue[gpu_id], pbkdf2_loop, 1, NULL, &global_work_size, lws, 0, NULL, NULL), "Run loop kernel");
	BENCH_CLERROR(clFinish(queue[gpu_id]), "Error running loop kernel");
	BENCH_CLERROR(clEnqueueNDRangeKernel(queue[gpu_id], pbkdf2_loop, 1, NULL, &global_work_size, lws, 0, NULL, multi_profilingEvent[2]), "Run loop kernel");
	BENCH_CLERROR(clFinish(queue[gpu_id]), "Error running loop kernel");

	BENCH_CLERROR(clEnqueueNDRangeKernel(queue[gpu_id], pbkdf2_final, 1, NULL, &global_work_size, lws, 0, NULL, multi_profilingEvent[3]), "Run intermediate kernel");

	/// Read the result back
	BENCH_CLERROR(clEnqueueReadBuffer(queue[gpu_id], mem_out, CL_TRUE, 0, sizeof(pbkdf2_out) * scalar_gws, output, 0, NULL, multi_profilingEvent[4]), "Copy result back");

	return *pcount;
}

static int binary_hash_0(void *binary)
{
#if 0
	dump_stuff_msg(__FUNCTION__, binary, BINARY_SIZE);
#endif
	return (((uint32_t *) binary)[0] & 0xf);
}

static int get_hash_0(int index)
{
#if 0
	dump_stuff_msg(__FUNCTION__, output[index].dk, BINARY_SIZE);
#endif
	return *(uint32_t*)output[index].dk & 0xf;
}
static int get_hash_1(int index) { return *(uint32_t*)output[index].dk & 0xff; }
static int get_hash_2(int index) { return *(uint32_t*)output[index].dk & 0xfff; }
static int get_hash_3(int index) { return *(uint32_t*)output[index].dk & 0xffff; }
static int get_hash_4(int index) { return *(uint32_t*)output[index].dk & 0xfffff; }
static int get_hash_5(int index) { return *(uint32_t*)output[index].dk & 0xffffff; }
static int get_hash_6(int index) { return *(uint32_t*)output[index].dk & 0x7ffffff; }

static int cmp_all(void *binary, int count)
{
	int index;

	for (index = 0; index < count; index++)
		if (*(uint32_t*)binary == *(uint32_t*)output[index].dk)
			return 1;
	return 0;
}

static int cmp_one(void *binary, int index)
{
	return !memcmp(binary, output[index].dk, BINARY_SIZE);
}

/* Check the FULL binary, just for good measure. There is not a chance we'll
   have a false positive here but this function is not performance critical. */
static int cmp_exact(char *source, int index)
{
	int i = 0, len, result;
	char *p, *key = get_key(index);
	char delim;
	unsigned char *binary, *crypt;

	delim = strchr(source, '.') ? '.' : '$';
	p = strrchr(source, delim) + 1;
	len = strlen(p) / 2;

	if (len == BINARY_SIZE) return 1;

	binary = mem_alloc(len);
	crypt = mem_alloc(len);

	while (*p) {
		binary[i++] = (atoi16[ARCH_INDEX(*p)] << 4) |
			atoi16[ARCH_INDEX(p[1])];
		p += 2;
	}
#if !ARCH_LITTLE_ENDIAN
	for (i = 0; i < len/sizeof(uint32_t); ++i) {
		((uint32_t*)binary)[i] = JOHNSWAP(((uint32_t*)binary)[i]);
	}
#endif
	pbkdf2_sha1((const unsigned char*)key,
	            strlen(key),
	            cur_salt->salt, cur_salt->length,
	            cur_salt->iterations, crypt, len, 0);
	result = !memcmp(binary, crypt, len);
#if 0
	dump_stuff_msg("hash binary", binary, len);
	dump_stuff_msg("calc binary", crypt, len);
#endif
	MEM_FREE(binary);
	MEM_FREE(crypt);
	if (!result)
		fprintf(stderr, "\n%s: Warning: Partial match for '%s'.\n"
		        "This is a bug or a malformed input line of:\n%s\n",
		        FORMAT_LABEL, key, source);
	return result;
}

static int salt_hash(void *salt)
{
	unsigned char *s = (unsigned char*)salt;
	unsigned int hash = 5381;
	int len = SALT_SIZE;

	while (len--)
		hash = ((hash << 5) + hash) ^ *s++;

	return hash & (SALT_HASH_SIZE - 1);
}

#if FMT_MAIN_VERSION > 11
static unsigned int iteration_count(void *salt)
{
	return ((pbkdf2_salt*)salt)->iterations;
}
#endif

struct fmt_main fmt_ocl_pbkdf1_sha1 = {
	{
		FORMAT_LABEL,
		FORMAT_NAME,
		ALGORITHM_NAME,
		BENCHMARK_COMMENT,
		BENCHMARK_LENGTH,
		PLAINTEXT_LENGTH,
		BINARY_SIZE,
		BINARY_ALIGN,
		SALT_SIZE,
		SALT_ALIGN,
		MIN_KEYS_PER_CRYPT,
		MAX_KEYS_PER_CRYPT,
		FMT_CASE | FMT_8_BIT | FMT_SPLIT_UNIFIES_CASE,
#if FMT_MAIN_VERSION > 11
		{
			"iterations",
		},
#endif
		tests
	}, {
		init,
		done,
		fmt_default_reset,
		prepare,
		valid,
		split,
		binary,
		salt,
#if FMT_MAIN_VERSION > 11
		{
			iteration_count,
		},
#endif
		fmt_default_source,
		{
			binary_hash_0,
			fmt_default_binary_hash_1,
			fmt_default_binary_hash_2,
			fmt_default_binary_hash_3,
			fmt_default_binary_hash_4,
			fmt_default_binary_hash_5,
			fmt_default_binary_hash_6
		},
		salt_hash,
		set_salt,
		set_key,
		get_key,
		clear_keys,
		crypt_all,
		{
			get_hash_0,
			get_hash_1,
			get_hash_2,
			get_hash_3,
			get_hash_4,
			get_hash_5,
			get_hash_6
		},
		cmp_all,
		cmp_one,
		cmp_exact
	}
};

#endif /* plugin stanza */

#endif /* HAVE_OPENCL */


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
        android:text="TextView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/txt"
        android:textAppearance="@style/TextAppearance.AppCompat.Title" />

    <TextView
        android:text="TextView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/textViewCargo" />
</LinearLayout>


text:
<?php
require('class/config.inc.php');
require('class/class.news.php');
require('class/class.message.php');

$page = new basic_page();

/*******Checking Authentication****************/

$page->auth->Checklogin();

$notify = new Notification();

/**********************************************/

$news= new News();

$message= new Message();

$news->SetUserID($page->auth->Get_user_id());

$ajax=new PHPLiveX();

$ajax->AjaxifyObjects(array("news"));

/*******Setting Page access Rules & checking Authorization****************/

/************************************************************************/

$page -> setPageKeywords('');
$page -> setPageDescription('');
$page -> setPageTitle("READ NEWS");
$page -> setActiveButton('7');
$page -> setInnerNav('');
//$page -> setImportCss1('main_style.css');
//$page -> setImportCss2('form.css'); // each page should have it's own .css sheet.  Link mulitple sheets here and below
$page -> SetDynamicCSS_1('main_style.php');
$page -> SetDynamicCSS_2('form.php');

$page -> setImportCss3('css/news.css');
$page -> setImportCss4('css/message.css');

$page -> SetDynamicCSS_3('css/message.php');
//$page -> SetDynamicCSS_2('form.php');

$page -> setImportCss5('');
$page -> setExtJavaScripts3(''); // might not need
$page -> setExtJavaScripts4(''); // might not need

$page -> setCustomJavaScripts('tinyMCE.init({
								mode : "textareas",
								theme : "advanced" ,
								theme_advanced_buttons1 : "bold,italic,underline,ustifyleft,justifycenter,justifyright,justifyfull,undo,redo,link,unlink,forecolor",
								theme_advanced_buttons2 : "",
								theme_advanced_buttons3 : ""
								});
function getText(id)
{
return tinyMCE.get(id).getContent();
}
								');

//*********************Page Style *******************************//
// used to set page styles.  This should be used sparingly.  External css should be used instead.
$page_style = '';

$page -> setPageStyle($page_style);

$page -> displayPageTop();

// **********************Start html for content column ****************************//

$ajax->Run('js/phplivex.js'); // Must be called inside the 'html' or 'body' tags

$notify->Notify();

$id=$_REQUEST[id];

?>

	Viewing News <?php if($id!='') { ?>View All<? } ?>

	<?php

		if($id=='')
		$news->Show_All_News();
		else{
		?>

		<?php	echo $news->Read_News($id); ?>

		<?php
		}
	?>

<?php
// **********************Closes the Content Column and begins Info Column ****************************//
$page-> printContentColumnEnd();
// **********************Start code for Info Column ****************************//

if($page->auth->isAdmin()){
?>

<?php
}
?>

Your Recent Messages

		view all

			<?php $message->GetRecentMessages($page->auth->Get_user_name(),5); ?>

Recent News

		view all

			<?php $news->Get_Recent_News(4); ?>

<?
$page -> displayPageBottom();
?>


text:
package org.apache.flink.contrib.streaming.state;

import org.apache.flink.core.memory.DataInputDeserializer;
import org.apache.flink.core.memory.DataOutputSerializer;
import org.apache.flink.runtime.state.CompositeKeySerializationUtils;
import org.apache.flink.runtime.state.InternalPriorityQueue;
import org.apache.flink.runtime.state.InternalPriorityQueueTestBase;
import org.apache.flink.runtime.state.heap.KeyGroupPartitionedPriorityQueue;

import org.junit.Rule;

/**
 * Test of {@link KeyGroupPartitionedPriorityQueue} powered by a {@link
 * RocksDBCachingPriorityQueueSet}.
 */
public class KeyGroupPartitionedPriorityQueueWithRocksDBStoreTest
        extends InternalPriorityQueueTestBase {

    @Rule public final RocksDBResource rocksDBResource = new RocksDBResource();

    @Override
    protected InternalPriorityQueue<TestElement> newPriorityQueue(int initialCapacity) {
        return new KeyGroupPartitionedPriorityQueue<>(
                KEY_EXTRACTOR_FUNCTION,
                TEST_ELEMENT_PRIORITY_COMPARATOR,
                newFactory(),
                KEY_GROUP_RANGE,
                KEY_GROUP_RANGE.getNumberOfKeyGroups());
    }

    @Override
    protected boolean testSetSemanticsAgainstDuplicateElements() {
        return true;
    }

    private KeyGroupPartitionedPriorityQueue.PartitionQueueSetFactory<
                    TestElement, RocksDBCachingPriorityQueueSet<TestElement>>
            newFactory() {

        return (keyGroupId, numKeyGroups, keyExtractorFunction, elementComparator) -> {
            DataOutputSerializer outputStreamWithPos = new DataOutputSerializer(128);
            DataInputDeserializer inputStreamWithPos = new DataInputDeserializer();
            int keyGroupPrefixBytes =
                    CompositeKeySerializationUtils.computeRequiredBytesInKeyGroupPrefix(
                            numKeyGroups);
            TreeOrderedSetCache orderedSetCache = new TreeOrderedSetCache(32);
            return new RocksDBCachingPriorityQueueSet<>(
                    keyGroupId,
                    keyGroupPrefixBytes,
                    rocksDBResource.getRocksDB(),
                    rocksDBResource.getReadOptions(),
                    rocksDBResource.getDefaultColumnFamily(),
                    TestElementSerializer.INSTANCE,
                    outputStreamWithPos,
                    inputStreamWithPos,
                    rocksDBResource.getBatchWrapper(),
                    orderedSetCache);
        };
    }
}


text:
<book name="theSlightlyLessSimpleExplorer">

<passage name="main">

Sally passes you a note: "Its your birthday what should we do today?"

<choice name="first-blood" link="angel">[ ]</choice>Rebuild the economy

<choice name="first-blood" link="pragmetism">[ ]</choice>Kidnap The President

        WOAH WOAH
        <explore link="look-around">lets take a breath!</explore>

</passage>
<passage name="angel">
    You and Sally join the young idustrialists club and rebuild Galt's great machine.
</passage>
<passage name="pragmetism">

Cops flood in

Sally pulls out her badge proudly moves behind them

Sally:"<explore link="jail">Take their terrorist butt to jail boys!</explore>

</passage>
<passage name="look-around">

You step outside to catch your breath too much is happening now.
    You go out to call you friend Finn but nothing gets through.

Thats when you see the SWAT bus and now its a trap!

Do you <choice name="first-blood" link="fire">light the building on fire with
    Sally in it</choice> or <choice name="first-blood" link="run">just cut the tires
    and make a run for it.</choice>
</passage>
<passage name="fire">
    You watch the fires engulf the night and remember this is what snitches get.
</passage>
<passage name="run">
    POP HISSSSSS

Nothing more satifying than a clean get away but you can't help but feel
    burned.  Meeting an undercover via OKC! Thats a story for the books.

</passage>

</book>


text:
<!DOCTYPE html >

          <title>Bs3Navbar - net.liftmodules.FoBoBs.snippet.FoBo.Bs3Navbar</title>
          <meta name="description" content="Bs3Navbar - net.liftmodules.FoBoBs.snippet.FoBo.Bs3Navbar" />
          <meta name="keywords" content="Bs3Navbar net.liftmodules.FoBoBs.snippet.FoBo.Bs3Navbar" />
          <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

      <link href="../../../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
      <link href="../../../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />

net.liftmodules.FoBoBs.snippet.FoBo

Bs3Navbar

        object

        Bs3Navbar extends Bs3Navbar

          Linear Supertypes

Bs3Navbar, DispatchSnippet, FlexMenuBuilder, AnyRef, Any

<input id="mbrsel-input" type="text" accesskey="/" />

              Ordering

Alphabetic

By inheritance

                Inherited

Bs3Navbar

Bs3Navbar

DispatchSnippet

FlexMenuBuilder

AnyRef

Any

Hide All

Show all

            Learn more about member selection

            Visibility

Public

All

Type Members

        type

        DispatchIt = PartialFunction[String, (NodeSeq) ⇒ NodeSeq]

Definition Classes

DispatchSnippet

        type

        StructBuildItem = AnyRef { def buildItem(kids: List[net.liftweb.sitemap.MenuItem],current: Boolean,path: Boolean): net.liftweb.common.Box[net.liftweb.sitemap.MenuItem] }

Definition Classes

FlexMenuBuilder

Value Members

        final
        def

        !=(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        final
        def

        ##(): Int

Definition Classes

AnyRef → Any

        final
        def

        ==(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        final
        def

        asInstanceOf[T0]: T0

Definition Classes

Any

        def

        buildInnerTag(contents: NodeSeq, path: Boolean, current: Boolean): Elem

Definition Classes

Bs3Navbar → FlexMenuBuilder

        def

        buildItemMenu[A](loc: Loc[A], currLoc: Box[Loc[_]], expandAll: Boolean): List[MenuItem]

Definition Classes

Bs3Navbar → FlexMenuBuilder

        def

        buildTBDivider(contents: NodeSeq, path: Boolean, current: Boolean): Elem

Definition Classes

Bs3Navbar

        def

        buildTBInnerTag(contents: NodeSeq, path: Boolean, current: Boolean): Elem

Definition Classes

Bs3Navbar

        def

        buildTBVerticalDivider(contents: NodeSeq, path: Boolean, current: Boolean): Elem

Definition Classes

Bs3Navbar

        def

        clone(): AnyRef

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        def

        dispatch: DispatchIt

Definition Classes

Bs3Navbar → DispatchSnippet

        def

        emptyGroup: NodeSeq

Definition Classes

Bs3Navbar → FlexMenuBuilder

        def

        emptyMenu: NodeSeq

Definition Classes

Bs3Navbar → FlexMenuBuilder

        def

        emptyPlaceholder: NodeSeq

Definition Classes

Bs3Navbar → FlexMenuBuilder

        final
        def

        eq(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        def

        equals(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        def

        expandAll: Boolean

Definition Classes

Bs3Navbar → FlexMenuBuilder

        def

        expandAny: Boolean

Attributes

protected

Definition Classes

FlexMenuBuilder

        def

        finalize(): Unit

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      classOf[java.lang.Throwable]
    )

        final
        def

        getClass(): Class[_]

Definition Classes

AnyRef → Any

        def

        hashCode(): Int

Definition Classes

AnyRef → Any

        final
        def

        isInstanceOf[T0]: Boolean

Definition Classes

Any

        def

        linkToSelf: Boolean

Definition Classes

Bs3Navbar → FlexMenuBuilder

        final
        def

        ne(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        final
        def

        notify(): Unit

Definition Classes

AnyRef

        final
        def

        notifyAll(): Unit

Definition Classes

AnyRef

        def

        overridenDispatch: DispatchIt

Definition Classes

Bs3Navbar

        def

        render: NodeSeq

Definition Classes

FlexMenuBuilder

        def

        renderItem(item: MenuItem, renderInner: (Seq[MenuItem]) ⇒ NodeSeq): Elem

Definition Classes

Bs3Navbar → FlexMenuBuilder

        def

        renderItemInPath(item: MenuItem, renderInner: (Seq[MenuItem]) ⇒ NodeSeq): Elem

Definition Classes

Bs3Navbar → FlexMenuBuilder

        def

        renderLink(uri: NodeSeq, text: NodeSeq, path: Boolean, current: Boolean): NodeSeq

Definition Classes

Bs3Navbar → FlexMenuBuilder

        def

        renderLinkWithTarget(uri: NodeSeq, text: NodeSeq, path: Boolean, current: Boolean, f: Function0[_]): NodeSeq

Definition Classes

Bs3Navbar

        def

        renderOuterTag(inner: NodeSeq, top: Boolean): NodeSeq

Definition Classes

Bs3Navbar → FlexMenuBuilder

        def

        renderPlaceholder(item: MenuItem, renderInner: (Seq[MenuItem]) ⇒ NodeSeq): Elem

Definition Classes

Bs3Navbar → FlexMenuBuilder

        def

        renderSelf(item: MenuItem): NodeSeq

Definition Classes

Bs3Navbar → FlexMenuBuilder

        def

        renderSelfLinked(item: MenuItem, renderInner: (Seq[MenuItem]) ⇒ NodeSeq): Elem

Definition Classes

Bs3Navbar → FlexMenuBuilder

        def

        renderSelfNotLinked(item: MenuItem, renderInner: (Seq[MenuItem]) ⇒ NodeSeq): Elem

Definition Classes

Bs3Navbar → FlexMenuBuilder

        def

        renderWhat(expandAll: Boolean): Seq[MenuItem]

Attributes

protected

Definition Classes

FlexMenuBuilder

        final
        def

        synchronized[T0](arg0: ⇒ T0): T0

Definition Classes

AnyRef

        def

        toRender: Seq[MenuItem]

Definition Classes

FlexMenuBuilder

        def

        toString(): String

Definition Classes

AnyRef → Any

        def

        updateForCurrent(nodes: Elem, current: Boolean): Elem

Definition Classes

Bs3Navbar → FlexMenuBuilder

        def

        updateForPath(nodes: Elem, path: Boolean): Elem

Definition Classes

Bs3Navbar → FlexMenuBuilder

        final
        def

        wait(): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        final
        def

        wait(arg0: Long, arg1: Int): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        final
        def

        wait(arg0: Long): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

Inherited from Bs3Navbar

Inherited from DispatchSnippet

Inherited from FlexMenuBuilder

Inherited from AnyRef

Inherited from Any

Ungrouped