text:
package org.openapitools

// TODO: properly handle custom imports
import java.io._
import java.util.UUID
import java.time._
import com.twitter.finagle.http.exp.Multipart.{FileUpload, InMemoryFileUpload, OnDiskFileUpload}

import org.openapitools.models._

trait DataAccessor {
    // TODO: apiInfo -> apis -> operations = TODO error
    private object TODO extends CommonError("Not implemented") {
        def message = "Not implemented"
    }

        /**
        *
        * @return A DefaultCrumbIssuer
        */
        def Base_getCrumb(): Either[CommonError,DefaultCrumbIssuer] = Left(TODO)

        /**
        *
        * @return A Unit
        */
        def BlueOcean_deletePipelineQueueItem(organization: String, pipeline: String, queue: String): Either[CommonError,Unit] = Left(TODO)

        /**
        *
        * @return A User
        */
        def BlueOcean_getAuthenticatedUser(organization: String): Either[CommonError,User] = Left(TODO)

        /**
        *
        * @return A String
        */
        def BlueOcean_getClasses(_class: String): Either[CommonError,String] = Left(TODO)

        /**
        *
        * @return A String
        */
        def BlueOcean_getJsonWebKey(key: Int): Either[CommonError,String] = Left(TODO)

        /**
        *
        * @return A String
        */
        def BlueOcean_getJsonWebToken(expiryTimeInMins: Option[Int], maxExpiryTimeInMins: Option[Int]): Either[CommonError,String] = Left(TODO)

        /**
        *
        * @return A Organisation
        */
        def BlueOcean_getOrganisation(organization: String): Either[CommonError,Organisation] = Left(TODO)

        /**
        *
        * @return A Seq[Organisation]
        */
        def BlueOcean_getOrganisations(): Either[CommonError,Seq[Organisation]] = Left(TODO)

        /**
        *
        * @return A Pipeline
        */
        def BlueOcean_getPipeline(organization: String, pipeline: String): Either[CommonError,Pipeline] = Left(TODO)

        /**
        *
        * @return A Seq[PipelineActivity]
        */
        def BlueOcean_getPipelineActivities(organization: String, pipeline: String): Either[CommonError,Seq[PipelineActivity]] = Left(TODO)

        /**
        *
        * @return A BranchImpl
        */
        def BlueOcean_getPipelineBranch(organization: String, pipeline: String, branch: String): Either[CommonError,BranchImpl] = Left(TODO)

        /**
        *
        * @return A PipelineRun
        */
        def BlueOcean_getPipelineBranchRun(organization: String, pipeline: String, branch: String, run: String): Either[CommonError,PipelineRun] = Left(TODO)

        /**
        *
        * @return A MultibranchPipeline
        */
        def BlueOcean_getPipelineBranches(organization: String, pipeline: String): Either[CommonError,MultibranchPipeline] = Left(TODO)

        /**
        *
        * @return A PipelineFolderImpl
        */
        def BlueOcean_getPipelineFolder(organization: String, folder: String): Either[CommonError,PipelineFolderImpl] = Left(TODO)

        /**
        *
        * @return A PipelineImpl
        */
        def BlueOcean_getPipelineFolderPipeline(organization: String, pipeline: String, folder: String): Either[CommonError,PipelineImpl] = Left(TODO)

        /**
        *
        * @return A Seq[QueueItemImpl]
        */
        def BlueOcean_getPipelineQueue(organization: String, pipeline: String): Either[CommonError,Seq[QueueItemImpl]] = Left(TODO)

        /**
        *
        * @return A PipelineRun
        */
        def BlueOcean_getPipelineRun(organization: String, pipeline: String, run: String): Either[CommonError,PipelineRun] = Left(TODO)

        /**
        *
        * @return A String
        */
        def BlueOcean_getPipelineRunLog(organization: String, pipeline: String, run: String, start: Option[Int], download: Option[Boolean]): Either[CommonError,String] = Left(TODO)

        /**
        *
        * @return A PipelineRunNode
        */
        def BlueOcean_getPipelineRunNode(organization: String, pipeline: String, run: String, node: String): Either[CommonError,PipelineRunNode] = Left(TODO)

        /**
        *
        * @return A PipelineStepImpl
        */
        def BlueOcean_getPipelineRunNodeStep(organization: String, pipeline: String, run: String, node: String, step: String): Either[CommonError,PipelineStepImpl] = Left(TODO)

        /**
        *
        * @return A String
        */
        def BlueOcean_getPipelineRunNodeStepLog(organization: String, pipeline: String, run: String, node: String, step: String): Either[CommonError,String] = Left(TODO)

        /**
        *
        * @return A Seq[PipelineStepImpl]
        */
        def BlueOcean_getPipelineRunNodeSteps(organization: String, pipeline: String, run: String, node: String): Either[CommonError,Seq[PipelineStepImpl]] = Left(TODO)

        /**
        *
        * @return A Seq[PipelineRunNode]
        */
        def BlueOcean_getPipelineRunNodes(organization: String, pipeline: String, run: String): Either[CommonError,Seq[PipelineRunNode]] = Left(TODO)

        /**
        *
        * @return A Seq[PipelineRun]
        */
        def BlueOcean_getPipelineRuns(organization: String, pipeline: String): Either[CommonError,Seq[PipelineRun]] = Left(TODO)

        /**
        *
        * @return A Seq[Pipeline]
        */
        def BlueOcean_getPipelines(organization: String): Either[CommonError,Seq[Pipeline]] = Left(TODO)

        /**
        *
        * @return A GithubScm
        */
        def BlueOcean_getSCM(organization: String, scm: String): Either[CommonError,GithubScm] = Left(TODO)

        /**
        *
        * @return A Seq[GithubOrganization]
        */
        def BlueOcean_getSCMOrganisationRepositories(organization: String, scm: String, scmOrganisation: String, credentialId: Option[String], pageSize: Option[Int], pageNumber: Option[Int]): Either[CommonError,Seq[GithubOrganization]] = Left(TODO)

        /**
        *
        * @return A Seq[GithubOrganization]
        */
        def BlueOcean_getSCMOrganisationRepository(organization: String, scm: String, scmOrganisation: String, repository: String, credentialId: Option[String]): Either[CommonError,Seq[GithubOrganization]] = Left(TODO)

        /**
        *
        * @return A Seq[GithubOrganization]
        */
        def BlueOcean_getSCMOrganisations(organization: String, scm: String, credentialId: Option[String]): Either[CommonError,Seq[GithubOrganization]] = Left(TODO)

        /**
        *
        * @return A User
        */
        def BlueOcean_getUser(organization: String, user: String): Either[CommonError,User] = Left(TODO)

        /**
        *
        * @return A Seq[FavoriteImpl]
        */
        def BlueOcean_getUserFavorites(user: String): Either[CommonError,Seq[FavoriteImpl]] = Left(TODO)

        /**
        *
        * @return A User
        */
        def BlueOcean_getUsers(organization: String): Either[CommonError,User] = Left(TODO)

        /**
        *
        * @return A QueueItemImpl
        */
        def BlueOcean_postPipelineRun(organization: String, pipeline: String, run: String): Either[CommonError,QueueItemImpl] = Left(TODO)

        /**
        *
        * @return A QueueItemImpl
        */
        def BlueOcean_postPipelineRuns(organization: String, pipeline: String): Either[CommonError,QueueItemImpl] = Left(TODO)

        /**
        *
        * @return A FavoriteImpl
        */
        def BlueOcean_putPipelineFavorite(organization: String, pipeline: String, body: Boolean): Either[CommonError,FavoriteImpl] = Left(TODO)

        /**
        *
        * @return A PipelineRun
        */
        def BlueOcean_putPipelineRun(organization: String, pipeline: String, run: String, blocking: Option[String], timeOutInSecs: Option[Int]): Either[CommonError,PipelineRun] = Left(TODO)

        /**
        *
        * @return A String
        */
        def BlueOcean_search(q: String): Either[CommonError,String] = Left(TODO)

        /**
        *
        * @return A String
        */
        def BlueOcean_searchClasses(q: String): Either[CommonError,String] = Left(TODO)

        /**
        *
        * @return A ComputerSet
        */
        def RemoteAccess_getComputer(depth: Int): Either[CommonError,ComputerSet] = Left(TODO)

        /**
        *
        * @return A Hudson
        */
        def RemoteAccess_getJenkins(): Either[CommonError,Hudson] = Left(TODO)

        /**
        *
        * @return A FreeStyleProject
        */
        def RemoteAccess_getJob(name: String): Either[CommonError,FreeStyleProject] = Left(TODO)

        /**
        *
        * @return A String
        */
        def RemoteAccess_getJobConfig(name: String): Either[CommonError,String] = Left(TODO)

        /**
        *
        * @return A FreeStyleBuild
        */
        def RemoteAccess_getJobLastBuild(name: String): Either[CommonError,FreeStyleBuild] = Left(TODO)

        /**
        *
        * @return A Unit
        */
        def RemoteAccess_getJobProgressiveText(name: String, number: String, start: String): Either[CommonError,Unit] = Left(TODO)

        /**
        *
        * @return A Queue
        */
        def RemoteAccess_getQueue(): Either[CommonError,Queue] = Left(TODO)

        /**
        *
        * @return A Queue
        */
        def RemoteAccess_getQueueItem(number: String): Either[CommonError,Queue] = Left(TODO)

        /**
        *
        * @return A ListView
        */
        def RemoteAccess_getView(name: String): Either[CommonError,ListView] = Left(TODO)

        /**
        *
        * @return A String
        */
        def RemoteAccess_getViewConfig(name: String): Either[CommonError,String] = Left(TODO)

        /**
        *
        * @return A Unit
        */
        def RemoteAccess_headJenkins(): Either[CommonError,Unit] = Left(TODO)

        /**
        *
        * @return A Unit
        */
        def RemoteAccess_postCreateItem(name: String, from: Option[String], mode: Option[String], jenkinsCrumb: Option[String], contentType: Option[String], body: String): Either[CommonError,Unit] = Left(TODO)

        /**
        *
        * @return A Unit
        */
        def RemoteAccess_postCreateView(name: String, jenkinsCrumb: Option[String], contentType: Option[String], body: String): Either[CommonError,Unit] = Left(TODO)

        /**
        *
        * @return A Unit
        */
        def RemoteAccess_postJobBuild(name: String, json: String, token: Option[String], jenkinsCrumb: Option[String]): Either[CommonError,Unit] = Left(TODO)

        /**
        *
        * @return A Unit
        */
        def RemoteAccess_postJobConfig(name: String, body: String, jenkinsCrumb: Option[String]): Either[CommonError,Unit] = Left(TODO)

        /**
        *
        * @return A Unit
        */
        def RemoteAccess_postJobDelete(name: String, jenkinsCrumb: Option[String]): Either[CommonError,Unit] = Left(TODO)

        /**
        *
        * @return A Unit
        */
        def RemoteAccess_postJobDisable(name: String, jenkinsCrumb: Option[String]): Either[CommonError,Unit] = Left(TODO)

        /**
        *
        * @return A Unit
        */
        def RemoteAccess_postJobEnable(name: String, jenkinsCrumb: Option[String]): Either[CommonError,Unit] = Left(TODO)

        /**
        *
        * @return A Unit
        */
        def RemoteAccess_postJobLastBuildStop(name: String, jenkinsCrumb: Option[String]): Either[CommonError,Unit] = Left(TODO)

        /**
        *
        * @return A Unit
        */
        def RemoteAccess_postViewConfig(name: String, body: String, jenkinsCrumb: Option[String]): Either[CommonError,Unit] = Left(TODO)

}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
Ann. Sci. Nat. , Bot. sér. 4, 11:139. 1859

#### Original name
null

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
import time
from concurrent.futures import ThreadPoolExecutor

def test(sec):
    time.sleep(sec)
    return "hello"

if __name__ == "__main__":
    with ThreadPoolExecutor(max_workers=1) as executor:
        future = executor.submit(test, 3)
        while not future.done():
            print("running")
            time.sleep(1)
        print(future.result())


text:
#import <UIKit/UIKit.h>

@interface CTAssetsGridViewLayout : UICollectionViewFlowLayout

- (instancetype)initWithContentSize:(CGSize)contentSize traitCollection:(UITraitCollection *)traits;

@end


text:
<?php

return [
    'failed' => 'Ces identifiants ne correspondent pas à nos enregistrements.',
    'password' => 'Le mot de passe est incorrect',
    'throttle' => 'Tentatives de connexion trop nombreuses. Veuillez essayer de nouveau dans :seconds secondes.',
];


text:
    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
      Toggle navigation

    </button>

Campus

Curso do Campus {{$ctrl.campusnav_nome}}

                    <form role="form">
                          <fieldset>

                                  <input class="form-control" placeholder="Nome do Curso" ng-model="$ctrl.formulario.nome" type="text" autofocus>

                          </fieldset>
                     </form>

				                     {{curso.codigo}}
				                     {{curso.nome}}


text:
#include "modules/drivers/lidar/velodyne/driver/driver.h"

#include <cmath>
#include <cstring>
#include <ctime>
#include <string>
#include <thread>

#include "cyber/cyber.h"
#include "modules/common/util/message_util.h"

namespace apollo {
namespace drivers {
namespace velodyne {

uint64_t VelodyneDriver::sync_counter = 0;

VelodyneDriver::~VelodyneDriver() {
  if (poll_thread_.joinable()) {
    poll_thread_.join();
  }
  if (positioning_thread_.joinable()) {
    positioning_thread_.join();
  }
}

bool VelodyneDriver::Init() {
  double frequency = (config_.rpm() / 60.0);  // expected Hz rate

  // default number of packets for each scan is a single revolution
  // (fractions rounded up)
  config_.set_npackets(static_cast<int>(ceil(packet_rate_ / frequency)));
  AINFO << "publishing " << config_.npackets() << " packets per scan";

  // open Velodyne input device

  input_.reset(new SocketInput());
  writer_ = node_->CreateWriter<VelodyneScan>(config_.scan_channel());
  positioning_input_.reset(new SocketInput());
  input_->init(config_.firing_data_port());
  positioning_input_->init(config_.positioning_data_port());

  // raw data output topic
  positioning_thread_ =
      std::thread(&VelodyneDriver::PollPositioningPacket, this);
  poll_thread_ = std::thread(&VelodyneDriver::DevicePoll, this);
  return true;
}

void VelodyneDriver::SetBaseTimeFromNmeaTime(NMEATimePtr nmea_time,
                                             uint64_t* basetime) {
  struct tm time;
  std::memset(&time, 0, sizeof(tm));
  time.tm_year = nmea_time->year + (2000 - 1900);
  time.tm_mon = nmea_time->mon - 1;
  time.tm_mday = nmea_time->day;
  time.tm_hour = nmea_time->hour;

  // set last gps time using gps socket packet
  last_gps_time_ =
      static_cast<uint32_t>((nmea_time->min * 60 + nmea_time->sec) * 1e6);

  AINFO << "Set base unix time : " << time.tm_year << "-" << time.tm_mon << "-"
        << time.tm_mday << " " << time.tm_hour << ":" << time.tm_min << ":"
        << time.tm_sec;
  uint64_t unix_base = static_cast<uint64_t>(timegm(&time));
  *basetime = unix_base * static_cast<uint64_t>(1e6);
}

bool VelodyneDriver::SetBaseTime() {
  NMEATimePtr nmea_time(new NMEATime);
  while (true) {
    int rc = input_->get_positioning_data_packet(nmea_time);
    if (rc == 0) {
      break;  // got a full packet
    }
    if (rc < 0) {
      return false;  // end of file reached
    }
  }

  SetBaseTimeFromNmeaTime(nmea_time, &basetime_);
  input_->init(config_.firing_data_port());
  return true;
}

/** poll the device
 *
 *  @returns true unless end of file reached
 */
bool VelodyneDriver::Poll(const std::shared_ptr<VelodyneScan>& scan) {
  // Allocate a new shared pointer for zero-copy sharing with other nodelets.
  if (basetime_ == 0) {
    // waiting for positioning data
    std::this_thread::sleep_for(std::chrono::microseconds(100));
    AWARN << "basetime is zero";
    return false;
  }

  int poll_result = PollStandard(scan);

  if (poll_result == SOCKET_TIMEOUT || poll_result == RECEIVE_FAIL) {
    return false;  // poll again
  }

  if (scan->firing_pkts().empty()) {
    AINFO << "Get an empty scan from port: " << config_.firing_data_port();
    return false;
  }

  // publish message using time of last packet read
  ADEBUG << "Publishing a full Velodyne scan.";
  scan->mutable_header()->set_timestamp_sec(cyber::Time().Now().ToSecond());
  scan->mutable_header()->set_frame_id(config_.frame_id());
  scan->set_model(config_.model());
  scan->set_mode(config_.mode());
  // we use first packet gps time update gps base hour
  // in cloud nodelet, will update base time packet by packet
  uint32_t current_secs = *(reinterpret_cast<uint32_t*>(
      const_cast<char*>(scan->firing_pkts(0).data().data() + 1200)));

  UpdateGpsTopHour(current_secs);
  scan->set_basetime(basetime_);

  return true;
}

int VelodyneDriver::PollStandard(std::shared_ptr<VelodyneScan> scan) {
  // Since the velodyne delivers data at a very high rate, keep reading and
  // publishing scans as fast as possible.
  while ((config_.use_poll_sync() &&
          ((config_.is_main_frame() &&
            scan->firing_pkts_size() < config_.npackets()) ||
           (!config_.is_main_frame() && sync_counter == last_count_))) ||
         (!config_.use_poll_sync() &&
          scan->firing_pkts_size() < config_.npackets())) {
    while (true) {
      // keep reading until full packet received
      VelodynePacket* packet = scan->add_firing_pkts();
      int rc = input_->get_firing_data_packet(packet);

      if (rc == 0) {
        break;  // got a full packet?
      } else if (rc < 0) {
        return rc;
      }
    }
  }
  if (config_.use_poll_sync()) {
    if (config_.is_main_frame()) {
      ++sync_counter;
    } else {
      last_count_ = sync_counter;
    }
  }
  return 0;
}

void VelodyneDriver::PollPositioningPacket(void) {
  while (!cyber::IsShutdown()) {
    NMEATimePtr nmea_time(new NMEATime);
    bool ret = true;
    if (config_.has_use_gps_time() && !config_.use_gps_time()) {
      time_t t = time(NULL);
      struct tm current_time;
      localtime_r(&t, &current_time);
      nmea_time->year = static_cast<uint16_t>(current_time.tm_year - 100);
      nmea_time->mon = static_cast<uint16_t>(current_time.tm_mon + 1);
      nmea_time->day = static_cast<uint16_t>(current_time.tm_mday);
      nmea_time->hour = static_cast<uint16_t>(current_time.tm_hour);
      nmea_time->min = static_cast<uint16_t>(current_time.tm_min);
      nmea_time->sec = static_cast<uint16_t>(current_time.tm_sec);
      AINFO << "Get NMEA Time from local time :"
            << "year:" << nmea_time->year << "mon:" << nmea_time->mon
            << "day:" << nmea_time->day << "hour:" << nmea_time->hour
            << "min:" << nmea_time->min << "sec:" << nmea_time->sec;
    } else {
      while (!cyber::IsShutdown()) {
        int rc = positioning_input_->get_positioning_data_packet(nmea_time);
        if (rc == 0) {
          break;  // got a full packet
        }
        if (rc < 0) {
          ret = false;  // end of file reached
        }
      }
    }

    if (basetime_ == 0 && ret) {
      SetBaseTimeFromNmeaTime(nmea_time, &basetime_);
    } else {
      std::this_thread::sleep_for(std::chrono::milliseconds(1));
    }
  }
}

void VelodyneDriver::UpdateGpsTopHour(uint32_t current_time) {
  if (last_gps_time_ == 0) {
    last_gps_time_ = current_time;
    return;
  }
  if (last_gps_time_ > current_time) {
    if ((last_gps_time_ - current_time) > 3599000000) {
      basetime_ += static_cast<uint64_t>(3600 * 1e6);
      AINFO << "Base time plus 3600s. Model: " << config_.model() << std::fixed
            << ". current:" << current_time << ", last time:" << last_gps_time_;
    } else {
      AWARN << "Current stamp:" << std::fixed << current_time
            << " less than previous stamp:" << last_gps_time_
            << ". GPS time stamp maybe incorrect!";
    }
  }
  last_gps_time_ = current_time;
}

VelodyneDriver* VelodyneDriverFactory::CreateDriver(
    const std::shared_ptr<::apollo::cyber::Node>& node, const Config& config) {
  auto new_config = config;
  if (new_config.prefix_angle() > 35900 || new_config.prefix_angle() < 100) {
    AWARN << "invalid prefix angle, prefix_angle must be between 100 and 35900";
    if (new_config.prefix_angle() > 35900) {
      new_config.set_prefix_angle(35900);
    } else if (new_config.prefix_angle() < 100) {
      new_config.set_prefix_angle(100);
    }
  }
  VelodyneDriver* driver = nullptr;
  switch (config.model()) {
    case HDL64E_S2: {
      driver = new Velodyne64Driver(node, config);
      driver->SetPacketRate(PACKET_RATE_HDL64E_S2);
      break;
    }
    case HDL64E_S3S: {
      driver = new Velodyne64Driver(node, config);
      driver->SetPacketRate(PACKET_RATE_HDL64E_S3S);
      break;
    }
    case HDL64E_S3D: {
      driver = new Velodyne64Driver(node, config);
      driver->SetPacketRate(PACKET_RATE_HDL64E_S3D);
      break;
    }
    case HDL32E: {
      driver = new VelodyneDriver(node, config);
      driver->SetPacketRate(PACKET_RATE_HDL32E);
      break;
    }
    case VLP32C: {
      driver = new VelodyneDriver(node, config);
      driver->SetPacketRate(PACKET_RATE_VLP32C);
      break;
    }
    case VLP16: {
      driver = new VelodyneDriver(node, config);
      driver->SetPacketRate(PACKET_RATE_VLP16);
      break;
    }
    case VLS128: {
      driver = new VelodyneDriver(node, config);
      driver->SetPacketRate(PACKET_RATE_VLS128);
      break;
    }
    default:
      AERROR << "invalid model, must be 64E_S2|64E_S3S"
             << "|64E_S3D|VLP16|HDL32E|VLS128";
      break;
  }
  return driver;
}

void VelodyneDriver::DevicePoll() {
  while (!apollo::cyber::IsShutdown()) {
    // poll device until end of file
    std::shared_ptr<VelodyneScan> scan = std::make_shared<VelodyneScan>();
    bool ret = Poll(scan);
    if (ret) {
      apollo::common::util::FillHeader("velodyne", scan.get());
      writer_->Write(scan);
    } else {
      AWARN << "device poll failed";
    }
  }
}

}  // namespace velodyne
}  // namespace drivers
}  // namespace apollo


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

namespace Task3
{
    interface ISound
    {
        string MakeSound
        {
            get;
        }
    }
}


text:
Delayed::Worker.backend = :active_record
Delayed::Worker.destroy_failed_jobs = false
Delayed::Worker.sleep_delay = 30
Delayed::Worker.max_attempts = 3
Delayed::Worker.max_run_time = 30.minutes


text:
<?php

use yii\db\Schema;
use yii\db\Migration;

class m150514_045955_complain extends Migration
{
    public function up()
    {
         $this->createTable('complain', [
            'id' => Schema::TYPE_PK,
            'jumlahKomplain' => Schema::TYPE_INTEGER . ' NOT NULL',
            'tanggal' => Schema::TYPE_DATE . ' NOT NULL ',
            'responKomplain' => Schema::TYPE_INTEGER . ' NOT NULL',
             'jumlahCS' => Schema::TYPE_INTEGER . ' NOT NULL',
        ]);
    }

    public function down()
    {
        echo "m150514_045955_complain cannot be reverted.\n";

        return false;
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}


text:
package org.basex.query.func.db;

import static org.basex.query.QueryError.*;
import static org.basex.util.Token.*;

import org.basex.core.*;
import org.basex.query.*;
import org.basex.query.up.primitives.name.*;
import org.basex.query.util.*;
import org.basex.query.value.item.*;
import org.basex.util.*;

/**
 * Function implementation.
 *
 * @author BaseX Team 2005-15, BSD License
 * @author Christian Gruen
 */
public class DbCopy extends DbFn {
  @Override
  public Item item(final QueryContext qc, final InputInfo ii) throws QueryException {
    return copy(qc, true);
  }

  /**
   * Performs the copy function.
   * @param qc query context
   * @param keep keep copied database
   * @return {@code null}
   * @throws QueryException query exception
   */
  final Item copy(final QueryContext qc, final boolean keep) throws QueryException {
    final String name = string(toToken(exprs[0], qc));
    final String newname = string(toToken(exprs[1], qc));

    if(!Databases.validName(name)) throw BXDB_NAME_X.get(info, name);
    if(!Databases.validName(newname)) throw BXDB_NAME_X.get(info, newname);

    // source database does not exist
    if(!qc.context.soptions.dbexists(name)) throw BXDB_WHICH_X.get(info, name);
    if(name.equals(newname)) throw BXDB_SAME_X.get(info, name, newname);

    qc.resources.updates().add(keep ? new DBCopy(name, newname, info, qc) :
      new DBAlter(name, newname, info, qc), qc);
    return null;
  }

  @Override
  public final boolean accept(final ASTVisitor visitor) {
    return dataLock(visitor, 0) || dataLock(visitor, 1) || super.accept(visitor);
  }
}


text:
title: "Study IntelliJ IdeaVim"
date: 2020-04-15T10:44:55+03:00
draft: false
description: ""
tags:
categories: tools, intellij
type: post
url:
author: "Mert Nuhoglu"
output: html_document
blog: mertnuhoglu.com

---

## IdeaVim settings: .ideavimrc

Check `https://github.com/danidiaz/miscellany/blob/master/windows/.ideavimrc`

Edit `~/.ideavimrc`

Action list: https://gist.github.com/zchee/9c78f91cc5ad771c1f5d

``` bash
:actionlist [pattern]
```

Check `~/gdrive/mynotes/content/fork/intellij_actionlist.txt`

```vim
source ~/.ideavimrc
```

## Tool: Intellimacs id=g10992

Spacemacs key bindings for IntelliJ

https://github.com/MarcoIeni/intellimacs

### Install

``` bash
git clone https://github.com/MarcoIeni/intellimacs ~/.intellimacs
```

Edit `~/.ideavimrc`

``` bash
" Selected Intellimacs modules
source ~/.intellimacs/spacemacs.vim
source ~/.intellimacs/extra.vim
source ~/.intellimacs/major.vim
source ~/.intellimacs/hybrid.vim

" My own vim commands
nnoremap Y y$

" Add/edit actions
nnoremap <leader>gl    :action Vcs.Show.Log<CR>
vnoremap <leader>gl    :action Vcs.Show.Log<CR>
```

Scroll menus: Keymap > Editor Actions > Down / Up > Set to: J / K

### Key Bindings

https://github.com/MarcoIeni/intellimacs/blob/master/docs/KEYBINDINGS.org

		SPC SPC		Find Actions
		SPC	Tab		Last buffer
		SPC	!			Terminal window
		SPC *			Find usages
		SPC ;;		Comment lines
		SPC ?			Show keybindings

SPC: prefix

		b b		Recent files	Recent files	#e
		b d		Buffer delete (close tab)	Close	#w
		b n		Next tab
		b p		Prev tab
		b x		Close window	Close Active Tab	^+f4

		c p		Comment paragraph	comment with block comment
		c l		Comment line	Comment with Line Comment	#/	cc

		e l		List errors
		e n		next error	Next Highlighted Error	F2
		e p		prev error	Previous Highlighted Error	+F2

		f e d		Settings
		f e R		reload ideavimrc
		f b			show bookmarks	Show Bookmarks	#F3
		f F			Find files	Go to File	#+o
		f r			Recent files	Recent files	#e
		f y y		Copy file path	Copy Paths	#+c

		i s			insert snippet

		s e			rename symbol
		s h			highlight current word
		s P			find usages
		s p			search in project

		T t			toggle distraction free mode

		w v			split vertically
		w s			split horizontally
		w j			go to window down ...

		gd			go to declaration
		zm			collapse all folds
		M-x			execute an action (Find actions)

		m =			reformat code

		m g i		go to implementation
		m g g		go to declaration

		b 0			go to first tab
		b $			go to last tab
		b j			go to prev tab
		b k			go to next tab

		f N			create new element

		h a			show action list
		j s			jump to symbol
		j e			jump to element in current file

		R c			run class
		R k			kill application
		R s			select configuration and run	Run...	^!r

		s E			search everywhere
		s f			search in current file
		s r			replace in current file

## tool: KJump motion plugin for IntelliJ IdeaVim

Check `~/.ideavimrc`

``` bash
let mapleader = " "
nmap <leader>kf :action KJumpAction<cr>
nmap <leader>kj :action KJumpAction.Word0<cr>
nmap <leader>kl :action KJumpAction.Line<cr>
```


text:
layout: page
title: Ars de Datus-Scientia
excerpt: "Musings of a Datascience PhD (Environmental Microbiology)"
search_omit: true
---

{% for post in site.posts limit:10 %}

{{ post.title }} <time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%B %d, %Y" }}</time>{% if post.excerpt %} {{ post.excerpt | remove: '\[ ... \]' | remove: '\( ... \)' | markdownify | strip_html | strip_newlines | escape_once }}{% endif %}

{% endfor %}


text:
package org.zstack.header.storage.snapshot;

/**
 * Created by xing5 on 2016/5/3.
 */
public interface VolumeSnapshotAfterDeleteExtensionPoint {
    void volumeSnapshotAfterDeleteExtensionPoint(VolumeSnapshotInventory snapshot);
}


text:
namespace map2 {
    CDSUNIT_DEFINE_MichaelMap( cc::michael_map::implementation_tag, Map_InsFind_int )
    CDSUNIT_DEFINE_MichaelMap_nogc( cc::michael_map::implementation_tag, Map_InsFind_int )

    CPPUNIT_TEST_SUITE_PART( Map_InsFind_int, run_MichaelMap )
        CDSUNIT_TEST_MichaelMap
        CDSUNIT_TEST_MichaelMap_nogc
    CPPUNIT_TEST_SUITE_END_PART()
} // namespace map2


text:
<!doctype html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title><%- title %></title>
  <meta name="description" content="<%- description %>">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link rel="apple-touch-icon" href="apple-touch-icon.png">
  <link rel="stylesheet" href="/css/bootstrap.css">

<%= body %>


text:
namespace ui {
namespace test {

class ImeWindowBrowserTest : public InProcessBrowserTest,
                             public ImeWindowObserver {
 public:
  ImeWindowBrowserTest() : ime_window_(nullptr) {}
  ~ImeWindowBrowserTest() override {}

  void TearDownOnMainThread() override {
    if (ime_window_) {
      ime_window_->Close();
      WaitForWindowClosing();
      ime_window_ = nullptr;
    }
  }

 protected:
  // ImeWindowObserver:
  void OnWindowDestroyed(ImeWindow* ime_window) override {
    message_loop_runner_->Quit();
  }

  void WaitForWindowClosing() {
    message_loop_runner_ = std::make_unique<base::RunLoop>();
    message_loop_runner_->Run();
  }

  void CreateImeWindow(const gfx::Rect& bounds, bool follow_cursor) {
    ime_window_ = new ImeWindow(
        browser()->profile(), nullptr, nullptr, "about:blank",
        follow_cursor ? ImeWindow::FOLLOW_CURSOR : ImeWindow::NORMAL, bounds);
    ime_window_->AddObserver(this);
    EXPECT_FALSE(ime_window_->ime_native_window()->IsVisible());
    ime_window_->Show();
    EXPECT_TRUE(ime_window_->ime_native_window()->IsVisible());
  }

  void VerifyImeWindow(const gfx::Rect& expected_bounds) {
    EXPECT_EQ(expected_bounds,
              ime_window_->ime_native_window()->GetBounds());
    EXPECT_GT(ime_window_->GetFrameId(), 0);
  }

  ImeWindow* ime_window_;

  std::unique_ptr<base::RunLoop> message_loop_runner_;

  DISALLOW_COPY_AND_ASSIGN(ImeWindowBrowserTest);
};

// https://crbug.com/919624 : Flaky on Win7 bots
#if defined(OS_WIN)
#define MAYBE_CreateNormalWindow DISABLED_CreateNormalWindow
#define MAYBE_CreateFollowCursorWindow DISABLED_CreateFollowCursorWindow
#else
#define MAYBE_CreateNormalWindow CreateNormalWindow
#define MAYBE_CreateFollowCursorWindow CreateFollowCursorWindow
#endif

IN_PROC_BROWSER_TEST_F(ImeWindowBrowserTest, MAYBE_CreateNormalWindow) {
  gfx::Rect expected_bounds(100, 200, 300, 400);
  CreateImeWindow(expected_bounds, false);
  VerifyImeWindow(expected_bounds);
}

IN_PROC_BROWSER_TEST_F(ImeWindowBrowserTest, MAYBE_CreateFollowCursorWindow) {
  gfx::Rect expected_bounds(100, 200, 300, 400);
  CreateImeWindow(expected_bounds, true);
  VerifyImeWindow(expected_bounds);
}

IN_PROC_BROWSER_TEST_F(ImeWindowBrowserTest, FollowCursor) {
  gfx::Rect expected_bounds(100, 200, 100, 100);
  CreateImeWindow(expected_bounds, true);
  ime_window_->FollowCursor(gfx::Rect(50, 50, 1, 10));
  expected_bounds.set_x(18);  // cursor left - titlebar width(32).
  expected_bounds.set_y(63);  // cursor top + cursor height + margin(3).
  VerifyImeWindow(expected_bounds);
}

}  // namespace test
}  // namespace ui


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <item type="id" name="dicts">false</item>
    <item type="id" name="poweredby">false</item>
    <item type="id" name="header">false</item>
    <item type="id" name="list">false</item>
    <item type="id" name="drag_layer">false</item>
    <item type="id" name="drag">false</item>
    <item type="id" name="move">false</item>
    <item type="id" name="left">false</item>
    <item type="id" name="delete">false</item>
    <item type="id" name="grammertext">false</item>
    <item type="id" name="icon">false</item>
    <item type="id" name="tail">false</item>
    <item type="id" name="grammer">false</item>
    <item type="id" name="text1">false</item>
     <item type="id" name="previous">false</item>
    <item type="id" name="next">false</item>
    <item type="id" name="text2">false</item>
    <item type="id" name="dictionary">false</item>
    <item type="id" name="translation">false</item>
    <item type="id" name="lines">false</item>
    <item type="id" name="stations">false</item>
    <item type="id" name="nearstation">false</item>
    <item type="id" name="bookmarks">false</item>
    <item type="id" name="more">false</item>
    <item type="id" name="back">false</item>
    <item type="id" name="forward">false</item>
    <item type="id" name="bookmark">false</item>
    <item type="id" name="button">false</item>
    <item type="id" name="reverse">false</item>
    <item type="id" name="search">false</item>
    <item type="id" name="tabs">false</item>
    <item type="id" name="tab1">false</item>
    <item type="id" name="tab2">false</item>
    <item type="id" name="title">false</item>
    <item type="id" name="arrow">false</item>
    <item type="id" name="text">false</item>
    <item type="id" name="loader">false</item>
    <item type="id" name="results">false</item>
    <item type="id" name="body">false</item>
    <item type="id" name="row1">false</item>
    <item type="id" name="row2">false</item>
    <item type="id" name="row3">false</item>
    <item type="id" name="image">false</item>
    <item type="id" name="alert">false</item>
    <item type="id" name="time">false</item>
    <item type="id" name="links">false</item>
    <item type="id" name="message">false</item>
    <item type="id" name="footer">false</item>
    <item type="id" name="contents">false</item>
    <item type="id" name="from">false</item>
    <item type="id" name="origin">false</item>
    <item type="id" name="to">false</item>
    <item type="id" name="destination">false</item>
    <item type="id" name="priority">false</item>
    <item type="id" name="fare">false</item>
    <item type="id" name="lists">false</item>
    <item type="id" name="info">false</item>
    <item type="id" name="adult">false</item>
    <item type="id" name="child">false</item>
    <item type="id" name="transfers">false</item>
    <item type="id" name="mapContainer">false</item>
    <item type="id" name="map">false</item>
    <item type="id" name="plot">false</item>
    <item type="id" name="tabContents">false</item>
    <item type="id" name="dummy">false</item>
    <item type="id" name="icon1">false</item>
    <item type="id" name="icon2">false</item>
    <item type="id" name="icon3">false</item>
    <item type="id" name="icon4">false</item>
    <item type="id" name="text3">false</item>
    <item type="id" name="container">false</item>
    <item type="id" name="subtitle">false</item>
    <item type="id" name="icons">false</item>
    <item type="id" name="right">false</item>
    <item type="id" name="center">false</item>
    <item type="id" name="texts">false</item>
    <item type="id" name="loading">false</item>
    <item type="id" name="copyright">false</item>
</resources>


text:
<!DOCTYPE html>

When the AuthorShadowDOM does not have a Shadow DOM, the content won't be rendered.

<form>
    <keygen id="host" style="width: 100px; height:30px; margin: 0; padding: 0; border: 0"></keygen>
    foobar
</form>


text:
use Fcntl;
use File::Spec;
use if $^O eq 'MSWin32', 'Term::ReadKey' => qw/ReadMode/;
use strict;

my $config  = ".my.cnf.$$";
my $command = ".mysql.$$";
my $hadpass = 0;
my $mysql;  # How to call the mysql client
my $rootpass = "";

$SIG{QUIT} = $SIG{INT} = $SIG{TERM} = $SIG{ABRT} = $SIG{HUP} = sub {
  print "\nAborting!\n\n";
  echo_on();
  cleanup();
  exit 1;
};

END {
  # Remove temporary files, even if exiting via die(), etc.
  cleanup();
}

sub read_without_echo {
  my ($prompt) = @_;
  print $prompt;
  echo_off();
  my $answer = <STDIN>;
  echo_on();
  print "\n";
  chomp($answer);
  return $answer;
}

sub echo_on {
  if ($^O eq 'MSWin32') {
    ReadMode('normal');
  } else {
    system("stty echo");
  }
}

sub echo_off {
  if ($^O eq 'MSWin32') {
    ReadMode('noecho');
  } else {
    system("stty -echo");
  }
}

sub write_file {
  my $file = shift;
  -f $file or die "ERROR: file is missing \"$file\": $!";
  open(FILE, ">$file") or die "ERROR: can't write to file \"$file\": $!";
  foreach my $line ( @_ ) {
    print FILE $line, "\n";             # Add EOL char
  }
  close FILE;
}

sub prepare {
  # Locate the mysql client; look in current directory first, then
  # in path
  our $SAVEERR;   # Suppress Perl warning message
  open SAVEERR, ">& STDERR";
  close STDERR;
  for my $m (File::Spec->catfile('bin', 'mysql'), 'mysql') {
    # mysql --version should always work
    qx($m --no-defaults --version);
    next unless $? == 0;

    $mysql = $m;
    last;
  }
  open STDERR, ">& SAVEERR";

  die "Can't find a 'mysql' client in PATH or ./bin\n"
    unless $mysql;

  # Create safe files to avoid leaking info to other users
  foreach my $file ( $config, $command ) {
    next if -f $file;                   # Already exists
    local *FILE;
    sysopen(FILE, $file, O_CREAT, 0600)
      or die "ERROR: can't create $file: $!";
    close FILE;
  }
}

# Simple escape mechanism (\-escape any ' and \), suitable for two contexts:
# - single-quoted SQL strings
# - single-quoted option values on the right hand side of = in my.cnf
#
# These two contexts don't handle escapes identically.  SQL strings allow
# quoting any character (\C => C, for any C), but my.cnf parsing allows
# quoting only \, ' or ".  For example, password='a\b' quotes a 3-character
# string in my.cnf, but a 2-character string in SQL.
#
# This simple escape works correctly in both places.
sub basic_single_escape {
  my ($str) = @_;
  # Inside a character class, \ is not special; this escapes both \ and '
  $str =~ s/([\'])/\\$1/g;
  return $str;
}

sub do_query {
  my $query   = shift;
  write_file($command, $query);
  my $rv = system("$mysql --defaults-file=$config < $command");
  # system() returns -1 if exec fails (e.g., command not found, etc.); die
  # in this case because nothing is going to work
  die "Failed to execute mysql client '$mysql'\n" if $rv == -1;
  # Return true if query executed OK, or false if there was some problem
  # (for example, SQL error or wrong password)
  return ($rv == 0 ? 1 : undef);
}

sub make_config {
  my $password = shift;

  my $esc_pass = basic_single_escape($rootpass);
  write_file($config,
             "# mysql_secure_installation config file",
             "[mysql]",
             "user=root",
             "password='$esc_pass'",
             "connect-expired-password");
}

sub get_root_password {
  my $attempts = 3;
  for (;;) {
    my $password = read_without_echo("Enter current password for root (enter for none): ");
    if ( $password ) {
      $hadpass = 1;
    } else {
      $hadpass = 0;
    }
    $rootpass = $password;
    make_config($rootpass);
    last if do_query("");

    die "Unable to connect to the server as root user, giving up.\n"
      if --$attempts == 0;
  }
  print "OK, successfully used password, moving on...\n\n";
}

sub set_root_password {
  my $password1;
  for (;;) {
    $password1 = read_without_echo("New password: ");

    if ( !$password1 ) {
      print "Sorry, you can't use an empty password here.\n\n";
      next;
    }

    my $password2 = read_without_echo("Re-enter new password: ");

    if ( $password1 ne $password2 ) {
      print "Sorry, passwords do not match.\n\n";
      next;
    }

    last;
  }

  my $esc_pass = basic_single_escape($password1);

  # attempt to lift the password expiration flag for root first
  do_query("SET PASSWORD=PASSWORD('$esc_pass');")
    or die "root password update failed!\n";

  # now since the password has changed, lets use the new one.
  $rootpass = $password1;
  make_config($rootpass);

  # set password for all root users
  # do the old password
  do_query("SET @\@old_passwords=1; UPDATE mysql.user SET Password=PASSWORD('$esc_pass'), password_expired='N' WHERE User='root' and plugin = 'mysql_old_password';")
    or die "old password update failed!\n";

  # do the native password
  do_query("SET @\@old_passwords=0; UPDATE mysql.user SET Password=PASSWORD('$esc_pass'), password_expired='N' WHERE User='root' and plugin in ('', 'mysql_native_password');")
    or die "native password update failed!\n";

  # do the sha256 password
  do_query("SET @\@old_passwords=2; UPDATE mysql.user SET authentication_string=PASSWORD('$esc_pass'), password_expired='N' WHERE User='root' and plugin = 'sha256_password';")
    or die "sha256 password update failed!\n";

  print "Password updated successfully!\n";
  print "Reloading privilege tables..\n";
  reload_privilege_tables()
    or die "Can not continue.\n";

  print "\n";
}

sub remove_anonymous_users {
  do_query("DELETE FROM mysql.user WHERE User='';")
    or die print " ... Failed!\n";
  print " ... Success!\n";
}

sub remove_remote_root {
  if (do_query("DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');")) {
    print " ... Success!\n";
  } else {
    print " ... Failed!\n";
  }
}

sub remove_test_database {
  print " - Dropping test database...\n";
  if (do_query("DROP DATABASE test;")) {
    print " ... Success!\n";
  } else {
    print " ... Failed!  Not critical, keep moving...\n";
  }

  print " - Removing privileges on test database...\n";
  if (do_query("DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'")) {
    print " ... Success!\n";
  } else {
    print " ... Failed!  Not critical, keep moving...\n";
  }
}

sub reload_privilege_tables {
  if (do_query("FLUSH PRIVILEGES;")) {
    print " ... Success!\n";
    return 1;
  } else {
    print " ... Failed!\n";
    return undef;
  }
}

sub cleanup {
  print "Cleaning up...\n";

  foreach my $file ($config, $command) {
    unlink $file or warn "Warning: Could not unlink $file: $!\n";
  }
}

# The actual script starts here

prepare();

print <<HERE;

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

HERE

get_root_password();

#
# Set the root password
#

print "Setting the root password ensures that nobody can log into the MySQL\n";
print "root user without the proper authorisation.\n\n";

if ( $hadpass == 0 ) {
  print "Set root password? [Y/n] ";
} else {
  print "You already have a root password set, so you can safely answer 'n'.\n\n";
  print "Change the root password? [Y/n] ";
}

my $reply = <STDIN>;
if ( $reply =~ /n/i ) {
  print " ... skipping.\n";
} else {
  set_root_password();
}
print "\n";

#
# Remove anonymous users
#

print <<HERE;
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

HERE

print "Remove anonymous users? [Y/n] ";
$reply = <STDIN>;
if ( $reply =~ /n/i ) {
  print " ... skipping.\n";
} else {
  remove_anonymous_users();
}
print "\n";

#
# Disallow remote root login
#

print <<HERE;
Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

HERE

print "Disallow root login remotely? [Y/n] ";
$reply = <STDIN>;
if ( $reply =~ /n/i ) {
  print " ... skipping.\n";
} else {
  remove_remote_root();
}
print "\n";

#
# Remove test database
#

print <<HERE;
By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

HERE

print "Remove test database and access to it? [Y/n] ";
$reply = <STDIN>;
if ( $reply =~ /n/i ) {
  print " ... skipping.\n";
} else {
  remove_test_database();
}
print "\n";

#
# Reload privilege tables
#

print <<HERE;
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

HERE

print "Reload privilege tables now? [Y/n] ";
$reply = <STDIN>;
if ( $reply =~ /n/i ) {
  print " ... skipping.\n";
} else {
  reload_privilege_tables();
}
print "\n";

print <<HERE;

All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

HERE


text:
#import <UIKit/UIKit.h>
#import "UserHook.h"
#import "UHOperation.h"
#import "UHRequest.h"
#import "UHPush.h"
#import "UHApplication.h"
#import "UHMessageView.h"
#import "UHMessageMeta.h"
#import "UHNavigationController.h"

@interface UserHook()

@property (nonatomic, assign) BOOL sessionStarted;
@property (nonatomic, assign) double sessionStartTime;
@property (nonatomic, assign) double backgroundTime;
@property (nonatomic, strong) UHApplication * application;
@property (nonatomic, strong) NSString * feedbackScreenTitle;
@property (nonatomic, strong) NSDictionary * feedbackCustomFields;

@end

@implementation UserHook

static UserHook * _sharedInstance;

@synthesize hasNewFeedback;

-(id) initWithApplicationId:(NSString *) applicationId apiKey:(NSString *)apiKey {
    if (self = [super init]) {
        _applicationId = [applicationId copy];
        _apiKey = [apiKey copy];
        _sessionStarted = NO;
        _sessionStartTime = CFAbsoluteTimeGetCurrent();
        _backgroundTime = CFAbsoluteTimeGetCurrent();

        _promptNibName = @"UHPromptView";

        UH_LOG(@"UserHook initialized");

        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didEnterBackground:) name:UIApplicationDidEnterBackgroundNotification object:nil];
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willEnterForeground:) name:UIApplicationWillEnterForegroundNotification object:nil];
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willTerminate:) name:UIApplicationWillTerminateNotification object:nil];
    }

    return self;
}

+(void) setApplicationId:(NSString *)applicationId apiKey:(NSString *)apiKey {
    if (_sharedInstance == nil) {
        _sharedInstance = [[UserHook alloc] initWithApplicationId:applicationId apiKey:apiKey];

        [UserHook createSession];
    }
}

-(void) setApplicationData:(UHApplication *) application {
    self.application = application;
}

+(UserHook *) sharedInstance {
    if (_sharedInstance == nil || (_sharedInstance.applicationId == nil || _sharedInstance.apiKey == nil)) {
        UH_LOG(@"Application Id and API Key have not been properly set.");
        _sharedInstance = [[UserHook alloc] init];
    }

    return  _sharedInstance;
}

// really only useful to help with testing
+(void) setSharedInstance:(UserHook *) instance {
    _sharedInstance = instance;
}

-(void) dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

+(void) setPayloadHandler:(UHPayloadHandler)payloadHandler {
    [UserHook sharedInstance].payloadHandler = payloadHandler;
}

+(UIViewController *) topViewController {

    UIViewController * rootController = [UIApplication sharedApplication].keyWindow.rootViewController;
    while (rootController.presentedViewController) rootController = rootController.presentedViewController;

    return rootController;
}

#pragma mark - feedback settings
+(void) setFeedbackScreenTitle:(NSString *)feedbackScreenTitle {

    [UserHook sharedInstance].feedbackScreenTitle = feedbackScreenTitle;
}

+(NSString *) feedbackScreenTitle {
    if ([UserHook sharedInstance].feedbackScreenTitle) {
        return [UserHook sharedInstance].feedbackScreenTitle;
    }
    else {
        return @"Feedback";
    }
}

+(void) setFeedbackCustomFields:(NSDictionary *)feedbackCustomFields {
    [UserHook sharedInstance].feedbackCustomFields = feedbackCustomFields;
}

+(NSDictionary *) feedbackCustomFields {
    if ([UserHook sharedInstance].feedbackCustomFields) {
        return [UserHook sharedInstance].feedbackCustomFields;
    }
    else {
        return nil;
    }
}

+(void) createSession {

    UH_LOG(@"creating user session");
    UHOperation * op = [[UHOperation alloc] init];
    [op createSession];
}

+(void) updateSessionData:(NSDictionary * )data {

    UH_LOG(@"updating user session");
    UHOperation * op = [[UHOperation alloc] init];
    [op updateSessionData:data];
}

+(void) updateCustomFields:(NSDictionary * )data {
    [self updateCustomFields:data handler:nil];
}

+(void) updateCustomFields:(NSDictionary * )data handler:(UHResponseHandler)handler {
    UH_LOG(@"updating custom fields");

    UHOperation * op = [[UHOperation alloc] init];

    NSMutableDictionary * customFieldData = [NSMutableDictionary dictionary];
    for (NSString * key in [data allKeys]) {
        [customFieldData setObject:data[key] forKey:[NSString stringWithFormat:@"custom_fields.%@",key]];
    }

    [op updateSessionData:customFieldData handler:handler];
}

+(void) markRated {

    UH_LOG(@"user rated app");
    UHOperation * op = [[UHOperation alloc] init];
    NSDictionary * data = [NSDictionary dictionaryWithObjectsAndKeys:@"true",@"rated", nil];
    [op updateSessionData:data];
}

+(void) updatePurchasedItem:(NSString *)sku forAmount:(NSNumber *)price {
    [self updatePurchasedItem:sku forAmount:price handler:nil];
}

+(void) updatePurchasedItem:(NSString *)sku forAmount:(NSNumber *)price handler:(UHResponseHandler)handler {

    UH_LOG(@"user purchased item");
    UHOperation * op = [[UHOperation alloc] init];
    NSDictionary * data = [NSDictionary dictionaryWithObjectsAndKeys:sku,@"purchases",price,@"purchases_amount", nil];
    [op updateSessionData:data handler:handler];
}

+(void) fetchHookPoint:(UHHookPointHandler)handler {
    UH_LOG(@"loading hookpoint");
    UHOperation * op = [[UHOperation alloc] init];
    [op fetchHookpoint:handler];
}

+(void) trackHookPointDisplay:(UHHookPoint *) hookPoint {
    UH_LOG(@"tracking hookpoint display");
    UHOperation * op = [[UHOperation alloc] init];
    [op trackHookpointDisplay:hookPoint];
}

+(void) trackHookPointInteraction:(UHHookPoint *) hookPoint {
    UH_LOG(@"tracking hookpoint interaction");
    UHOperation * op = [[UHOperation alloc] init];
    [op trackHookpointInteraction:hookPoint];
}

# pragma mark - session methods

- (void)didEnterBackground:(NSNotification *)notification
{
    double sessionLength = CFAbsoluteTimeGetCurrent() - _sessionStartTime;

    // send session length info to server
    if (sessionLength > 0) {
        UHOperation * op = [[UHOperation alloc] init];
        NSDictionary * params = [NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"%f", floor(sessionLength)], @"session_time", nil];
        [op updateSessionData:params];
    }

    _backgroundTime = CFAbsoluteTimeGetCurrent();

    UH_LOG(@"App didEnterBackground");
}

- (void)willEnterForeground:(NSNotification *)notification
{
    // reset session start time
    _sessionStartTime = CFAbsoluteTimeGetCurrent();

    UH_LOG(@"App willEnterForeground");

    if (CFAbsoluteTimeGetCurrent() - _backgroundTime > UH_TIME_BETWEEN_SESSIONS_IN_SECONDS) {
        // mark this as a new session
        [UserHook createSession];
    }
}

- (void)willTerminate:(NSNotification *)notification
{

    double sessionLength = CFAbsoluteTimeGetCurrent() - _sessionStartTime;

    // send session length info to server
    if (sessionLength > 0) {
        UHOperation * op = [[UHOperation alloc] init];
        NSDictionary * params = [NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"%f", floor(sessionLength)], @"session_time", nil];
        [op updateSessionData:params];
    }

    UH_LOG(@"App willTerminate");
}

# pragma mark - hosted pages

+(UHHostedPageViewController *) createHostedPageViewController:(NSString *) pagePath {
    UHHostedPageViewController * controller = [[UHHostedPageViewController alloc] initWithPageName:pagePath];
    return controller;
}

+(void) fetchPageNames:(UHArrayHandler) handler {

    UHOperation * op = [[UHOperation alloc] init];
    [op fetchPageNames:handler];

}

#pragma mark - feedback

+(UHHostedPageViewController *) createFeedbackViewController {
    NSMutableString * url = [NSMutableString stringWithFormat:@"%@feedback/", UH_HOST_URL];

    NSDictionary * customFields = [UserHook feedbackCustomFields];

    // add custom fields to query string
    if (customFields) {

        int i=0;
        NSMutableDictionary * convertedKeys = [NSMutableDictionary dictionary];
        for (NSString * key in [customFields allKeys]) {
            [convertedKeys setValue:key forKey:[NSString stringWithFormat:@"custom_fields[%i][name]", i]];
            [convertedKeys setValue:[customFields valueForKey:key] forKey:[NSString stringWithFormat:@"custom_fields[%i][value]", i]];
            i++;
        }

        NSString * queryString = [UHRequest parametersToQueryString:convertedKeys];
        [url appendFormat:@"?%@", queryString];
    }

    UHHostedPageViewController * controller = [[UHHostedPageViewController alloc] initWithPageUrl:url];
    return controller;
}

+(void) registerDeviceToken:(NSData *) deviceToken {
    [UHPush registerDeviceToken:deviceToken];
}

+(void) registerDeviceTokenString:(NSString *) tokenString {
    [UHPush registerDeviceTokenString:tokenString];
}

+(void) registerForPush:(NSDictionary *) launchOptions {

    UIApplication * application = [UIApplication sharedApplication];

    // Register for Push Notitications
    UIUserNotificationType userNotificationTypes = (UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound);
    UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:userNotificationTypes  categories:nil];
    if ([application respondsToSelector:@selector(registerUserNotificationSettings:)]) {
        [application registerUserNotificationSettings:settings];
        [application registerForRemoteNotifications];
    }

    if (launchOptions && [launchOptions valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey]) {

        NSDictionary * userInfo = [launchOptions valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey];

        if ([UserHook isPushFromUserHook:userInfo]) {
            [UserHook handlePushNotification:userInfo];
        }
    }

}

+(BOOL) isPushFromUserHook:(NSDictionary *) notificationUserInfo {
    return [UHPush isPushFromUserHook:notificationUserInfo];
}

+(void) handlePushNotification:(NSDictionary *)userInfo {

    // The application was just brought from the background to the foreground,
    // so we consider the app as having been "opened by a push notification."
    if ([UIApplication sharedApplication].applicationState != UIApplicationStateActive) {
        [UHPush trackPushOpen:userInfo];
    }

    NSDictionary * payload = [UHPush getPushPayload:userInfo];

    // if this push message is for a feedback reply, tell the app there is new feedback
    if ([payload valueForKey:@"new_feedback"]) {
        [UserHook sharedInstance].hasNewFeedback = [[payload valueForKey:@"new_feedback"] boolValue];
        if ([UserHook sharedInstance].hasNewFeedback) {
            [[NSNotificationCenter defaultCenter] postNotificationName:UH_NotificationNewFeedback object:nil];
        }
    }

    // custom push handler
    if (_sharedInstance.payloadHandler) {
        _sharedInstance.payloadHandler(payload);
    }

}

#pragma mark - actions
+(void) rateThisApp {

    if ([UserHook sharedInstance].application.itunes_id) {

        // open this app's page in itunes
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id%@", _sharedInstance.application.itunes_id]]];

        // mark that this user has "rated" this app
        [UserHook markRated];

    }
}

+(void) displayRatePrompt:(NSString *) message positiveButtonTitle:(NSString *) positiveTitle negativeButtonTitle:(NSString *) negativeTitle {

    UHMessageMetaButton * button1 = [[UHMessageMetaButton alloc] init];
    button1.title = positiveTitle;
    button1.click = UHMessageClickRate;

    UHMessageMetaButton * button2 = [[UHMessageMetaButton alloc] init];
    button2.title = negativeTitle;
    button2.click = UHMessageClickClose;

    [self displayPrompt:message button1:button1 button2:button2];

}

+(void) displayFeedbackPrompt:(NSString *)message positiveButtonTitle:(NSString *) positiveTitle negativeButtonTitle:(NSString *) negativeTitle {

    UHMessageMetaButton * button1 = [[UHMessageMetaButton alloc] init];
    button1.title = positiveTitle;
    button1.click = UHMessageClickFeedback;

    UHMessageMetaButton * button2 = [[UHMessageMetaButton alloc] init];
    button2.title = negativeTitle;
    button2.click = UHMessageClickClose;

    [self displayPrompt:message button1:button1 button2:button2];

}

+(void) displaySurvey:(NSString *)surveyId title:(NSString *)surveyTitle hookpointId:(NSString *)hookpointId {

    UHHostedPageViewController * controller = [[UHHostedPageViewController alloc ] initWithPageUrl:[NSString stringWithFormat:@"%@survey/%@?hp=%@", UH_HOST_URL, surveyId, hookpointId]];

    controller.title = surveyTitle;

    [self displayUHController:controller];
}

+(void) displayFeedback {

    dispatch_async(dispatch_get_main_queue(), ^{

        UHHostedPageViewController * controller = [UserHook createFeedbackViewController];
        controller.title = [UserHook feedbackScreenTitle];

        [self displayUHController:controller];

    });

}

+(void) displayUHController:(UHHostedPageViewController *) controller {

    dispatch_async(dispatch_get_main_queue(), ^{

        // allow the navigation controller to be overridden
        Class navClass;
        if ([UserHook sharedInstance].navControllerClassName) {
            navClass = NSClassFromString([UserHook sharedInstance].navControllerClassName);
        }
        else {
            navClass = [UHNavigationController class];
        }

        UINavigationController * navController = [[navClass alloc] initWithRootViewController:controller];
        UIViewController * rootController = [UserHook topViewController];
        [rootController presentViewController:navController animated:YES completion:nil];

    });
}

+(void) displayPrompt:(NSString *) message button1:(UHMessageMetaButton *) button1 button2:(UHMessageMetaButton *) button2 {

    UHMessageMeta * meta = [[UHMessageMeta alloc] init];
    meta.body = message;

    if (button1 && button2) {
        meta.displayType = UHMessageTypeTwoButtons;
    }
    else if (button1) {
        meta.displayType = UHMessageTypeOneButton;
    }
    else {
        meta.displayType = UHMessageTypeNoButtons;
    }

    meta.button1 = button1;
    meta.button2 = button2;

    dispatch_async(dispatch_get_main_queue(), ^{

        UHMessageView * view = [UHMessageView createViewForMeta:meta];

        if ([UHMessageView canDisplay]) {
            UIViewController * rootController = [UserHook topViewController];
            view.frame = rootController.view.frame;
            [rootController.view addSubview:view];

            [view showDialog];
        }

    });

}

+(void) handlePayload:(NSDictionary *) payload {

    if ([UserHook sharedInstance].payloadHandler) {
        [UserHook sharedInstance].payloadHandler(payload);
    }
}

+(void) displayStaticPage:(NSString *)slug title:(NSString *)title {

    dispatch_async(dispatch_get_main_queue(), ^{

        UHHostedPageViewController * controller = [self createHostedPageViewController:slug];
        controller.title = title;

        [self displayUHController:controller];

    });

}

@end


text:
package org.springframework.act;

import java.util.Date;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class Mojo {
    private String mojoName = "mojo'name";
    private static final Log logger = LogFactory.getLog(Mojo.class);

    public Mojo() {
    	Date now = new Date();
    	mojoName = "mojo'name " + now.toLocaleString();
    	logger.error("Mojo construct use no-arg :" + now.toLocaleString());
    }

    public Mojo(String mojoName) {
    	this.mojoName = mojoName;
    	logger.error("Mojo construct use mojoName: " + mojoName);
    }

	public String getMojoName() {
		return mojoName;
	}

	public void setMojoName(String mojoName) {
		this.mojoName = mojoName;
	}

	@Override
	public String toString() {
		return "Mojo(mojoName:" + mojoName + ")";
	}
}


text:
"""The Normal (Gaussian) distribution class."""

import math

from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shape
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import check_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import nn
from tensorflow.python.ops import random_ops
from tensorflow.python.ops.distributions import distribution
from tensorflow.python.ops.distributions import kullback_leibler
from tensorflow.python.ops.distributions import special_math
from tensorflow.python.util import deprecation
from tensorflow.python.util.tf_export import tf_export

__all__ = [
    "Normal",
    "NormalWithSoftplusScale",
]

@tf_export(v1=["distributions.Normal"])
class Normal(distribution.Distribution):
  """The Normal distribution with location `loc` and `scale` parameters.

  #### Mathematical details

  The probability density function (pdf) is,

  ```none
  pdf(x; mu, sigma) = exp(-0.5 (x - mu)**2 / sigma**2) / Z
  Z = (2 pi sigma**2)**0.5
  ```

  where `loc = mu` is the mean, `scale = sigma` is the std. deviation, and, `Z`
  is the normalization constant.

  The Normal distribution is a member of the [location-scale family](
  https://en.wikipedia.org/wiki/Location-scale_family), i.e., it can be
  constructed as,

  ```none
  X ~ Normal(loc=0, scale=1)
  Y = loc + scale * X
  ```

  #### Examples

  Examples of initialization of one or a batch of distributions.

  ```python
  import tensorflow_probability as tfp
  tfd = tfp.distributions

  # Define a single scalar Normal distribution.
  dist = tfd.Normal(loc=0., scale=3.)

  # Evaluate the cdf at 1, returning a scalar.
  dist.cdf(1.)

  # Define a batch of two scalar valued Normals.
  # The first has mean 1 and standard deviation 11, the second 2 and 22.
  dist = tfd.Normal(loc=[1, 2.], scale=[11, 22.])

  # Evaluate the pdf of the first distribution on 0, and the second on 1.5,
  # returning a length two tensor.
  dist.prob([0, 1.5])

  # Get 3 samples, returning a 3 x 2 tensor.
  dist.sample([3])
  ```

  Arguments are broadcast when possible.

  ```python
  # Define a batch of two scalar valued Normals.
  # Both have mean 1, but different standard deviations.
  dist = tfd.Normal(loc=1., scale=[11, 22.])

  # Evaluate the pdf of both distributions on the same point, 3.0,
  # returning a length 2 tensor.
  dist.prob(3.0)
  ```

  """

  @deprecation.deprecated(
      "2019-01-01",
      "The TensorFlow Distributions library has moved to "
      "TensorFlow Probability "
      "(https://github.com/tensorflow/probability). You "
      "should update all references to use `tfp.distributions` "
      "instead of `tf.distributions`.",
      warn_once=True)
  def __init__(self,
               loc,
               scale,
               validate_args=False,
               allow_nan_stats=True,
               name="Normal"):
    """Construct Normal distributions with mean and stddev `loc` and `scale`.

    The parameters `loc` and `scale` must be shaped in a way that supports
    broadcasting (e.g. `loc + scale` is a valid operation).

    Args:
      loc: Floating point tensor; the means of the distribution(s).
      scale: Floating point tensor; the stddevs of the distribution(s).
        Must contain only positive values.
      validate_args: Python `bool`, default `False`. When `True` distribution
        parameters are checked for validity despite possibly degrading runtime
        performance. When `False` invalid inputs may silently render incorrect
        outputs.
      allow_nan_stats: Python `bool`, default `True`. When `True`,
        statistics (e.g., mean, mode, variance) use the value "`NaN`" to
        indicate the result is undefined. When `False`, an exception is raised
        if one or more of the statistic's batch members are undefined.
      name: Python `str` name prefixed to Ops created by this class.

    Raises:
      TypeError: if `loc` and `scale` have different `dtype`.
    """
    parameters = dict(locals())
    with ops.name_scope(name, values=[loc, scale]) as name:
      with ops.control_dependencies([check_ops.assert_positive(scale)] if
                                    validate_args else []):
        self._loc = array_ops.identity(loc, name="loc")
        self._scale = array_ops.identity(scale, name="scale")
        check_ops.assert_same_float_dtype([self._loc, self._scale])
    super(Normal, self).__init__(
        dtype=self._scale.dtype,
        reparameterization_type=distribution.FULLY_REPARAMETERIZED,
        validate_args=validate_args,
        allow_nan_stats=allow_nan_stats,
        parameters=parameters,
        graph_parents=[self._loc, self._scale],
        name=name)

  @staticmethod
  def _param_shapes(sample_shape):
    return dict(
        zip(("loc", "scale"), ([ops.convert_to_tensor(
            sample_shape, dtype=dtypes.int32)] * 2)))

  @property
  def loc(self):
    """Distribution parameter for the mean."""
    return self._loc

  @property
  def scale(self):
    """Distribution parameter for standard deviation."""
    return self._scale

  def _batch_shape_tensor(self):
    return array_ops.broadcast_dynamic_shape(
        array_ops.shape(self.loc),
        array_ops.shape(self.scale))

  def _batch_shape(self):
    return array_ops.broadcast_static_shape(
        self.loc.get_shape(),
        self.scale.get_shape())

  def _event_shape_tensor(self):
    return constant_op.constant([], dtype=dtypes.int32)

  def _event_shape(self):
    return tensor_shape.TensorShape([])

  def _sample_n(self, n, seed=None):
    shape = array_ops.concat([[n], self.batch_shape_tensor()], 0)
    sampled = random_ops.random_normal(
        shape=shape, mean=0., stddev=1., dtype=self.loc.dtype, seed=seed)
    return sampled * self.scale + self.loc

  def _log_prob(self, x):
    return self._log_unnormalized_prob(x) - self._log_normalization()

  def _log_cdf(self, x):
    return special_math.log_ndtr(self._z(x))

  def _cdf(self, x):
    return special_math.ndtr(self._z(x))

  def _log_survival_function(self, x):
    return special_math.log_ndtr(-self._z(x))

  def _survival_function(self, x):
    return special_math.ndtr(-self._z(x))

  def _log_unnormalized_prob(self, x):
    return -0.5 * math_ops.square(self._z(x))

  def _log_normalization(self):
    return 0.5 * math.log(2. * math.pi) + math_ops.log(self.scale)

  def _entropy(self):
    # Use broadcasting rules to calculate the full broadcast scale.
    scale = self.scale * array_ops.ones_like(self.loc)
    return 0.5 * math.log(2. * math.pi * math.e) + math_ops.log(scale)

  def _mean(self):
    return self.loc * array_ops.ones_like(self.scale)

  def _quantile(self, p):
    return self._inv_z(special_math.ndtri(p))

  def _stddev(self):
    return self.scale * array_ops.ones_like(self.loc)

  def _mode(self):
    return self._mean()

  def _z(self, x):
    """Standardize input `x` to a unit normal."""
    with ops.name_scope("standardize", values=[x]):
      return (x - self.loc) / self.scale

  def _inv_z(self, z):
    """Reconstruct input `x` from a its normalized version."""
    with ops.name_scope("reconstruct", values=[z]):
      return z * self.scale + self.loc

class NormalWithSoftplusScale(Normal):
  """Normal with softplus applied to `scale`."""

  @deprecation.deprecated(
      "2019-01-01",
      "Use `tfd.Normal(loc, tf.nn.softplus(scale)) "
      "instead.",
      warn_once=True)
  def __init__(self,
               loc,
               scale,
               validate_args=False,
               allow_nan_stats=True,
               name="NormalWithSoftplusScale"):
    parameters = dict(locals())
    with ops.name_scope(name, values=[scale]) as name:
      super(NormalWithSoftplusScale, self).__init__(
          loc=loc,
          scale=nn.softplus(scale, name="softplus_scale"),
          validate_args=validate_args,
          allow_nan_stats=allow_nan_stats,
          name=name)
    self._parameters = parameters

@kullback_leibler.RegisterKL(Normal, Normal)
def _kl_normal_normal(n_a, n_b, name=None):
  """Calculate the batched KL divergence KL(n_a || n_b) with n_a and n_b Normal.

  Args:
    n_a: instance of a Normal distribution object.
    n_b: instance of a Normal distribution object.
    name: (optional) Name to use for created operations.
      default is "kl_normal_normal".

  Returns:
    Batchwise KL(n_a || n_b)
  """
  with ops.name_scope(name, "kl_normal_normal", [n_a.loc, n_b.loc]):
    one = constant_op.constant(1, dtype=n_a.dtype)
    two = constant_op.constant(2, dtype=n_a.dtype)
    half = constant_op.constant(0.5, dtype=n_a.dtype)
    s_a_squared = math_ops.square(n_a.scale)
    s_b_squared = math_ops.square(n_b.scale)
    ratio = s_a_squared / s_b_squared
    return (math_ops.squared_difference(n_a.loc, n_b.loc) / (two * s_b_squared)
            + half * (ratio - one - math_ops.log(ratio)))


text:
package org.openhubframework.openhub.api.common.jaxb;

import org.junit.Test;

import java.time.OffsetDateTime;
import java.time.ZoneOffset;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

/**
 * Test suite for {@link JaxbDateAdapter}.
 *
 * @author Tomas Hanus
 */
public class JaxbDateAdapterTest {

    public static final String DATE = "2013-10-05+02:00";
    public static final String DATE_TIME = "2013-10-05T16:02:55+02:00";

    @Test
    public void parseDate() throws Exception {
        final OffsetDateTime result = JaxbDateAdapter.parseDate(DATE);

        assertThat(result.getYear(), is(2013));
        assertThat(result.getMonthValue(), is(10));
        assertThat(result.getDayOfMonth(), is(5));
        assertThat(result.getOffset(), is(ZoneOffset.ofHours(2)));
    }

    @Test
    public void printDate() throws Exception {
        final String result = JaxbDateAdapter.printDate(OffsetDateTime.of(2013, 10, 5, 0, 0, 0, 0, ZoneOffset.ofHours(2)));

        assertThat(result, is("2013-10-05+02:00"));
    }

    @Test
    public void parseDateTime() throws Exception {
        final OffsetDateTime result = JaxbDateAdapter.parseDateTime(DATE_TIME);

        assertThat(result.getYear(), is(2013));
        assertThat(result.getMonthValue(), is(10));
        assertThat(result.getDayOfMonth(), is(5));
        assertThat(result.getHour(), is(16));
        assertThat(result.getMinute(), is(2));
        assertThat(result.getSecond(), is(55));
        assertThat(result.getOffset(), is(ZoneOffset.ofHours(2)));
    }

    @Test
    public void printDateTime() throws Exception {
        final String result = JaxbDateAdapter.printDateTime(OffsetDateTime.of(2013, 10, 5, 16, 2, 55, 0, ZoneOffset.ofHours(2)));
        assertThat(result, is("2013-10-05T16:02:55+02:00"));

        final String resultUTC = JaxbDateAdapter.printDateTime(OffsetDateTime.of(2013, 10, 5, 16, 2, 55, 0, ZoneOffset.UTC));
        assertThat(resultUTC, is("2013-10-05T16:02:55Z"));
    }

}


text:
@interface ImageGpsData : NSObject
@property(nonatomic, strong) NSDictionary *gpsData;

- (id)initWithLocation:(CLLocation *)location;
@end


text:
namespace net {

void ProxyClientSocket::SetStreamPriority(RequestPriority priority) {}

// static
void ProxyClientSocket::BuildTunnelRequest(
    const HostPortPair& endpoint,
    const HttpRequestHeaders& extra_headers,
    const std::string& user_agent,
    std::string* request_line,
    HttpRequestHeaders* request_headers) {
  // RFC 7230 Section 5.4 says a client MUST send a Host header field in all
  // HTTP/1.1 request messages, and Host SHOULD be the first header field
  // following the request-line.  Add "Proxy-Connection: keep-alive" for compat
  // with HTTP/1.0 proxies such as Squid (required for NTLM authentication).
  std::string host_and_port = endpoint.ToString();
  *request_line =
      base::StringPrintf("CONNECT %s HTTP/1.1\r\n", host_and_port.c_str());
  request_headers->SetHeader(HttpRequestHeaders::kHost, host_and_port);
  request_headers->SetHeader(HttpRequestHeaders::kProxyConnection,
                             "keep-alive");
  if (!user_agent.empty())
    request_headers->SetHeader(HttpRequestHeaders::kUserAgent, user_agent);

  request_headers->MergeFrom(extra_headers);
}

// static
int ProxyClientSocket::HandleProxyAuthChallenge(
    HttpAuthController* auth,
    HttpResponseInfo* response,
    const NetLogWithSource& net_log) {
  DCHECK(response->headers.get());
  int rv = auth->HandleAuthChallenge(response->headers, response->ssl_info,
                                     false, true, net_log);
  auth->TakeAuthInfo(&response->auth_challenge);
  if (rv == OK)
    return ERR_PROXY_AUTH_REQUESTED;
  return rv;
}

// static
bool ProxyClientSocket::SanitizeProxyAuth(HttpResponseInfo* response) {
  DCHECK(response && response->headers.get());

  // Copy status line and all hop-by-hop headers to preserve keep-alive
  // behavior.
  const char* kHeadersToKeep[] = {
      "connection",         "proxy-connection", "keep-alive", "trailer",
      "transfer-encoding",  "upgrade",

      "content-length",

      "proxy-authenticate",
  };

  // Create a list of all present header not in |kHeadersToKeep|, and then
  // remove them.
  size_t iter = 0;
  std::string header_name;
  std::string header_value;
  std::unordered_set<std::string> headers_to_remove;
  while (response->headers->EnumerateHeaderLines(&iter, &header_name,
                                                 &header_value)) {
    bool remove = true;
    for (const char* header : kHeadersToKeep) {
      if (base::EqualsCaseInsensitiveASCII(header, header_name)) {
        remove = false;
        break;
      }
    }
    if (remove)
      headers_to_remove.insert(header_name);
  }

  response->headers->RemoveHeaders(headers_to_remove);

  return true;
}

}  // namespace net


text:
package org.jboss.hal.meta.processing;

import java.util.ArrayList;
import java.util.List;

import org.jboss.hal.config.Environment;
import org.jboss.hal.dmr.Operation;
import org.jboss.hal.dmr.ResourceAddress;
import org.jboss.hal.meta.StatementContext;
import org.jboss.hal.meta.description.ResourceDescriptionStatementContext;
import org.jboss.hal.meta.security.SecurityContextStatementContext;

import static org.jboss.hal.dmr.ModelDescriptionConstants.*;
import static org.jboss.hal.meta.processing.LookupResult.ALL_PRESENT;
import static org.jboss.hal.meta.processing.LookupResult.NOTHING_PRESENT;
import static org.jboss.hal.meta.processing.LookupResult.RESOURCE_DESCRIPTION_PRESENT;
import static org.jboss.hal.meta.processing.LookupResult.SECURITY_CONTEXT_PRESENT;

class CreateRrdOperations {

    private final SecurityContextStatementContext securityContextStatementContext;
    private final ResourceDescriptionStatementContext resourceDescriptionStatementContext;
    private final int depth;
    private final String locale;

    CreateRrdOperations(Environment environment, StatementContext statementContext, String locale, int depth) {
        this.securityContextStatementContext = new SecurityContextStatementContext(statementContext, environment);
        this.resourceDescriptionStatementContext = new ResourceDescriptionStatementContext(statementContext,
                environment);
        this.locale = locale;
        this.depth = depth;
    }

    public List<Operation> create(LookupContext context, boolean recursive, boolean optional) {
        LookupResult lookupResult = context.lookupResult;
        List<Operation> operations = new ArrayList<>();
        lookupResult.templates().stream()
                .filter(template -> optional == template.isOptional())
                .forEach(template -> {
                    int missingMetadata = lookupResult.missingMetadata(template);
                    if (missingMetadata != ALL_PRESENT) {

                        ResourceAddress address;
                        Operation.Builder builder = null;

                        if (missingMetadata == NOTHING_PRESENT) {
                            address = template.resolve(securityContextStatementContext);
                            builder = new Operation.Builder(address, READ_RESOURCE_DESCRIPTION_OPERATION)
                                    .param(ACCESS_CONTROL, COMBINED_DESCRIPTIONS)
                                    .param(OPERATIONS, true);

                        } else if (missingMetadata == RESOURCE_DESCRIPTION_PRESENT) {
                            address = template.resolve(securityContextStatementContext);
                            builder = new Operation.Builder(address, READ_RESOURCE_DESCRIPTION_OPERATION)
                                    .param(ACCESS_CONTROL, TRIM_DESCRIPTIONS)
                                    .param(OPERATIONS, true);

                        } else if (missingMetadata == SECURITY_CONTEXT_PRESENT) {
                            address = template.resolve(resourceDescriptionStatementContext);
                            builder = new Operation.Builder(address, READ_RESOURCE_DESCRIPTION_OPERATION)
                                    .param(OPERATIONS, true);
                        }

                        if (builder != null) {
                            if (recursive) {
                                builder.param(RECURSIVE_DEPTH, depth);
                            }
                            builder.param(LOCALE, locale);
                            operations.add(builder.build());
                        }
                    }
                });
        return operations;
    }
}


text:
/* Desc: A bullet slider or primastic joint
 * Author: Nate Koenig
 * Date: 13 Oct 2009
 */

#include "gazebo/common/Assert.hh"
#include "gazebo/common/Console.hh"
#include "gazebo/common/Exception.hh"

#include "gazebo/physics/Model.hh"
#include "gazebo/physics/bullet/bullet_inc.h"
#include "gazebo/physics/bullet/BulletLink.hh"
#include "gazebo/physics/bullet/BulletPhysics.hh"
#include "gazebo/physics/bullet/BulletSliderJoint.hh"

using namespace gazebo;
using namespace physics;

//////////////////////////////////////////////////
BulletSliderJoint::BulletSliderJoint(btDynamicsWorld *_world, BasePtr _parent)
    : SliderJoint<BulletJoint>(_parent)
{
  GZ_ASSERT(_world, "bullet world pointer is NULL");
  this->bulletWorld = _world;
  this->bulletSlider = NULL;
}

//////////////////////////////////////////////////
BulletSliderJoint::~BulletSliderJoint()
{
}

//////////////////////////////////////////////////
void BulletSliderJoint::Load(sdf::ElementPtr _sdf)
{
  SliderJoint<BulletJoint>::Load(_sdf);
}

//////////////////////////////////////////////////
void BulletSliderJoint::Init()
{
  SliderJoint<BulletJoint>::Init();

  BulletLinkPtr bulletChildLink =
    boost::static_pointer_cast<BulletLink>(this->childLink);
  BulletLinkPtr bulletParentLink =
    boost::static_pointer_cast<BulletLink>(this->parentLink);

  // Get axis unit vector (expressed in world frame).
  math::Vector3 axis = this->initialWorldAxis;
  if (axis == math::Vector3::Zero)
  {
    gzerr << "axis must have non-zero length, resetting to 0 0 1\n";
    axis.Set(0, 0, 1);
  }

  // Local variables used to compute pivots and axes in body-fixed frames
  // for the parent and child links.
  math::Vector3 pivotParent, pivotChild, axisParent, axisChild;
  math::Pose pose;
  btTransform frameParent, frameChild;
  btVector3 axis2, axis3;

  // Initialize pivots to anchorPos, which is expressed in the
  // world coordinate frame.
  pivotParent = this->anchorPos;
  pivotChild = this->anchorPos;

  // Check if parentLink exists. If not, the parent will be the world.
  if (this->parentLink)
  {
    // Compute relative pose between joint anchor and CoG of parent link.
    pose = this->parentLink->GetWorldCoGPose();
    // Subtract CoG position from anchor position, both in world frame.
    pivotParent -= pose.pos;
    // Rotate pivot offset and axis into body-fixed frame of parent.
    pivotParent = pose.rot.RotateVectorReverse(pivotParent);
    frameParent.setOrigin(BulletTypes::ConvertVector3(pivotParent));
    axisParent = pose.rot.RotateVectorReverse(axis);
    axisParent = axisParent.Normalize();
    // The following math is based on btHingeConstraint.cpp:95-115
    btPlaneSpace1(BulletTypes::ConvertVector3(axisParent), axis2, axis3);
    frameParent.getBasis().setValue(
      axisParent.x, axis2.x(), axis3.x(),
      axisParent.y, axis2.y(), axis3.y(),
      axisParent.z, axis2.z(), axis3.z());
  }
  // Check if childLink exists. If not, the child will be the world.
  if (this->childLink)
  {
    // Compute relative pose between joint anchor and CoG of child link.
    pose = this->childLink->GetWorldCoGPose();
    // Subtract CoG position from anchor position, both in world frame.
    pivotChild -= pose.pos;
    // Rotate pivot offset and axis into body-fixed frame of child.
    pivotChild = pose.rot.RotateVectorReverse(pivotChild);
    frameChild.setOrigin(BulletTypes::ConvertVector3(pivotChild));
    axisChild = pose.rot.RotateVectorReverse(axis);
    axisChild = axisChild.Normalize();
    // The following math is based on btHingeConstraint.cpp:95-115
    btPlaneSpace1(BulletTypes::ConvertVector3(axisChild), axis2, axis3);
    frameChild.getBasis().setValue(
      axisChild.x, axis2.x(), axis3.x(),
      axisChild.y, axis2.y(), axis3.y(),
      axisChild.z, axis2.z(), axis3.z());
  }

  // If both links exist, then create a joint between the two links.
  if (bulletChildLink && bulletParentLink)
  {
    this->bulletSlider = new btSliderConstraint(
        *bulletParentLink->GetBulletLink(),
        *bulletChildLink->GetBulletLink(),
        frameParent, frameChild, true);
  }
  // If only the child exists, then create a joint between the child
  // and the world.
  else if (bulletChildLink)
  {
    this->bulletSlider = new btSliderConstraint(
        *bulletChildLink->GetBulletLink(), frameChild, true);
  }
  // If only the parent exists, then create a joint between the parent
  // and the world.
  else if (bulletParentLink)
  {
    this->bulletSlider = new btSliderConstraint(
        *bulletParentLink->GetBulletLink(), frameParent, true);
  }
  // Throw an error if no links are given.
  else
  {
    gzthrow("joint without links\n");
  }

  if (!this->bulletSlider)
    gzthrow("unable to create bullet slider joint\n");

  // btSliderConstraint has 2 degrees-of-freedom (like a piston)
  // so disable the rotation.
  this->bulletSlider->setLowerAngLimit(0.0);
  this->bulletSlider->setUpperAngLimit(0.0);

  // Apply joint translation limits here.
  // TODO: velocity and effort limits.
  GZ_ASSERT(this->sdf != NULL, "Joint sdf member is NULL");
  sdf::ElementPtr limitElem;
  limitElem = this->sdf->GetElement("axis")->GetElement("limit");
  this->bulletSlider->setLowerLinLimit(limitElem->Get<double>("lower"));
  this->bulletSlider->setUpperLinLimit(limitElem->Get<double>("upper"));

  this->constraint = this->bulletSlider;

  // Add the joint to the world
  GZ_ASSERT(this->bulletWorld, "bullet world pointer is NULL");
  this->bulletWorld->addConstraint(this->bulletSlider, true);

  // Allows access to impulse
  this->constraint->enableFeedback(true);

  // Setup Joint force and torque feedback
  this->SetupJointFeedback();
}

//////////////////////////////////////////////////
double BulletSliderJoint::GetVelocity(int /*_index*/) const
{
  double result = 0;
  // I'm not sure this will work
  if (this->bulletSlider)
    result = this->bulletSlider->getTargetLinMotorVelocity();
  return result;
}

//////////////////////////////////////////////////
void BulletSliderJoint::SetVelocity(int /*_index*/, double _angle)
{
  if (this->bulletSlider)
    this->bulletSlider->setTargetLinMotorVelocity(_angle);
}

//////////////////////////////////////////////////
void BulletSliderJoint::SetAxis(int /*_index*/, const math::Vector3 &_axis)
{
  // Note that _axis is given in a world frame,
  // but bullet uses a body-fixed frame
  if (!this->bulletSlider)
  {
    // this hasn't been initialized yet, store axis in initialWorldAxis

    /// \TODO: currently we assume joint axis is specified in model frame,
    /// this is incorrect, and should be corrected to be
    /// joint frame which is specified in child link frame.
    if (this->parentLink)
      this->initialWorldAxis =
        this->GetParent()->GetModel()->GetWorldPose().rot.RotateVector(_axis);
    else
      this->initialWorldAxis = _axis;
  }
  else
  {
    gzerr << "SetAxis for existing joint is not implemented\n";
  }
}

//////////////////////////////////////////////////
void BulletSliderJoint::SetDamping(int /*index*/, const double _damping)
{
  if (this->bulletSlider)
    this->bulletSlider->setDampingDirLin(_damping);
}

//////////////////////////////////////////////////
void BulletSliderJoint::SetForceImpl(int /*_index*/, double _effort)
{
  if (this->bulletSlider && this->constraint)
  {
    // x-axis of constraint frame
    btVector3 hingeAxisLocalA =
      this->bulletSlider->getFrameOffsetA().getBasis().getColumn(0);
    btVector3 hingeAxisLocalB =
      this->bulletSlider->getFrameOffsetB().getBasis().getColumn(0);

    btVector3 hingeAxisWorldA =
      this->bulletSlider->getRigidBodyA().getWorldTransform().getBasis() *
      hingeAxisLocalA;
    btVector3 hingeAxisWorldB =
      this->bulletSlider->getRigidBodyB().getWorldTransform().getBasis() *
      hingeAxisLocalB;

    btVector3 hingeForceA = _effort * hingeAxisWorldA;
    btVector3 hingeForceB = _effort * hingeAxisWorldB;

    // TODO: switch to applyForce and specify body-fixed offset
    this->constraint->getRigidBodyA().applyCentralForce(-hingeForceA);
    this->constraint->getRigidBodyB().applyCentralForce(hingeForceB);
  }
}

//////////////////////////////////////////////////
void BulletSliderJoint::SetHighStop(int /*_index*/,
                                    const math::Angle &_angle)
{
  Joint::SetHighStop(0, _angle);
  if (this->bulletSlider)
    this->bulletSlider->setUpperLinLimit(_angle.Radian());
}

//////////////////////////////////////////////////
void BulletSliderJoint::SetLowStop(int /*_index*/,
                                   const math::Angle &_angle)
{
  Joint::SetLowStop(0, _angle);
  if (this->bulletSlider)
    this->bulletSlider->setLowerLinLimit(_angle.Radian());
}

//////////////////////////////////////////////////
math::Angle BulletSliderJoint::GetHighStop(int /*_index*/)
{
  math::Angle result;
  if (this->bulletSlider)
    result = this->bulletSlider->getUpperLinLimit();
  else
    gzerr << "Joint must be created before getting high stop\n";
  return result;
}

//////////////////////////////////////////////////
math::Angle BulletSliderJoint::GetLowStop(int /*_index*/)
{
  math::Angle result;
  if (this->bulletSlider)
    result = this->bulletSlider->getLowerLinLimit();
  else
    gzerr << "Joint must be created before getting low stop\n";
  return result;
}

//////////////////////////////////////////////////
void BulletSliderJoint::SetMaxForce(int /*_index*/, double _force)
{
  if (this->bulletSlider)
    this->bulletSlider->setMaxLinMotorForce(_force);
}

//////////////////////////////////////////////////
double BulletSliderJoint::GetMaxForce(int /*_index*/)
{
  double result = 0;
  if (this->bulletSlider)
    result = this->bulletSlider->getMaxLinMotorForce();
  return result;
}

//////////////////////////////////////////////////
math::Vector3 BulletSliderJoint::GetGlobalAxis(int /*_index*/) const
{
  math::Vector3 result;
  if (this->bulletSlider)
  {
    // I have not verified the following math, though I based it on internal
    // bullet code at line 250 of btHingeConstraint.cpp
    btVector3 vec =
      this->bulletSlider->getRigidBodyA().getCenterOfMassTransform().getBasis()
      * this->bulletSlider->getFrameOffsetA().getBasis().getColumn(2);
    result = BulletTypes::ConvertVector3(vec);
  }
  else
    gzwarn << "bulletHinge does not exist, returning fake axis\n";
  return result;
}

//////////////////////////////////////////////////
math::Angle BulletSliderJoint::GetAngleImpl(int /*_index*/) const
{
  math::Angle result;
  if (this->bulletSlider)
    result = this->bulletSlider->getLinearPos();
  else
    gzwarn << "bulletSlider does not exist, returning default position\n";
  return result;
}


text:
package com.neva.oycland.game;

import com.neva.oycland.core.control.AbstractGame;
import com.neva.oycland.game.screen.LevelScreen;
import com.neva.oycland.game.ui.UiInput;

public class OyclandGame extends AbstractGame {

    protected Progress progress;

    @Override
    public void init() {
        input.addProcessor(new UiInput(this));

        progress = new Progress(this);
        progress.startGame();
    }

    public void start(Class<? extends LevelScreen> levelClass) {
        screens.unload(levelClass);
        LevelScreen level = (LevelScreen) screens.load(this, levelClass);
        progress.changeLevel(level);

        super.setScreen(level);
    }

    public Progress getProgress() {
        return progress;
    }
}


text:
package org.elasticsearch.common.lucene.search;

import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanClause.Occur;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.ConstantScoreQuery;
import org.apache.lucene.search.Filter;
import org.apache.lucene.search.MatchAllDocsQuery;
import org.apache.lucene.search.MatchNoDocsQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.QueryWrapperFilter;
import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.SuppressForbidden;
import org.elasticsearch.index.query.QueryParseContext;
import org.elasticsearch.index.search.child.CustomQueryWrappingFilter;

import java.util.List;
import java.util.regex.Pattern;

/**
 *
 */
public class Queries {

    public static Query newMatchAllQuery() {
        return new MatchAllDocsQuery();
    }

    /** Return a query that matches no document. */
    public static Query newMatchNoDocsQuery() {
        return new BooleanQuery();
    }

    public static Filter newMatchAllFilter() {
        return wrap(newMatchAllQuery());
    }

    public static Filter newMatchNoDocsFilter() {
        return wrap(newMatchNoDocsQuery());
    }

    /** Return a query that matches all documents but those that match the given query. */
    public static Query not(Query q) {
        BooleanQuery bq = new BooleanQuery();
        bq.add(new MatchAllDocsQuery(), Occur.MUST);
        bq.add(q, Occur.MUST_NOT);
        return bq;
    }

    public static boolean isNegativeQuery(Query q) {
        if (!(q instanceof BooleanQuery)) {
            return false;
        }
        List<BooleanClause> clauses = ((BooleanQuery) q).clauses();
        if (clauses.isEmpty()) {
            return false;
        }
        for (BooleanClause clause : clauses) {
            if (!clause.isProhibited()) return false;
        }
        return true;
    }

    public static Query fixNegativeQueryIfNeeded(Query q) {
        if (isNegativeQuery(q)) {
            BooleanQuery newBq = (BooleanQuery) q.clone();
            newBq.add(newMatchAllQuery(), BooleanClause.Occur.MUST);
            return newBq;
        }
        return q;
    }

    public static boolean isConstantMatchAllQuery(Query query) {
        if (query instanceof ConstantScoreQuery) {
            return isConstantMatchAllQuery(((ConstantScoreQuery) query).getQuery());
        } else if (query instanceof QueryWrapperFilter) {
            return isConstantMatchAllQuery(((QueryWrapperFilter) query).getQuery());
        } else if (query instanceof MatchAllDocsQuery) {
            return true;
        }
        return false;
    }

    public static void applyMinimumShouldMatch(BooleanQuery query, @Nullable String minimumShouldMatch) {
        if (minimumShouldMatch == null) {
            return;
        }
        int optionalClauses = 0;
        for (BooleanClause c : query.clauses()) {
            if (c.getOccur() == BooleanClause.Occur.SHOULD) {
                optionalClauses++;
            }
        }

        int msm = calculateMinShouldMatch(optionalClauses, minimumShouldMatch);
        if (0 < msm) {
            query.setMinimumNumberShouldMatch(msm);
        }
    }

    private static Pattern spaceAroundLessThanPattern = Pattern.compile("(\\s+<\\s*)|(\\s*<\\s+)");
    private static Pattern spacePattern = Pattern.compile(" ");
    private static Pattern lessThanPattern = Pattern.compile("<");

    public static int calculateMinShouldMatch(int optionalClauseCount, String spec) {
        int result = optionalClauseCount;
        spec = spec.trim();

        if (-1 < spec.indexOf("<")) {
            /* we have conditional spec(s) */
            spec = spaceAroundLessThanPattern.matcher(spec).replaceAll("<");
            for (String s : spacePattern.split(spec)) {
                String[] parts = lessThanPattern.split(s, 0);
                int upperBound = Integer.parseInt(parts[0]);
                if (optionalClauseCount <= upperBound) {
                    return result;
                } else {
                    result = calculateMinShouldMatch
                            (optionalClauseCount, parts[1]);
                }
            }
            return result;
        }

        /* otherwise, simple expression */

        if (-1 < spec.indexOf('%')) {
            /* percentage - assume the % was the last char.  If not, let Integer.parseInt fail. */
            spec = spec.substring(0, spec.length() - 1);
            int percent = Integer.parseInt(spec);
            float calc = (result * percent) * (1 / 100f);
            result = calc < 0 ? result + (int) calc : (int) calc;
        } else {
            int calc = Integer.parseInt(spec);
            result = calc < 0 ? result + calc : calc;
        }

        return (optionalClauseCount < result ?
                optionalClauseCount : (result < 0 ? 0 : result));

    }

    /**
     * Wraps a query in a filter.
     *
     * If a filter has an anti per segment execution / caching nature then @{@link CustomQueryWrappingFilter} is returned
     * otherwise the standard {@link org.apache.lucene.search.QueryWrapperFilter} is returned.
     */
    @SuppressForbidden(reason = "QueryWrapperFilter cachability")
    public static Filter wrap(Query query, QueryParseContext context) {
        if ((context != null && context.requireCustomQueryWrappingFilter()) || CustomQueryWrappingFilter.shouldUseCustomQueryWrappingFilter(query)) {
            return new CustomQueryWrappingFilter(query);
        } else {
            return new QueryWrapperFilter(query);
        }
    }

    /** Wrap as a {@link Filter}. */
    public static Filter wrap(Query query) {
        return wrap(query, null);
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- This file is part of the DITA Open Toolkit project hosted on
     Sourceforge.net. See the accompanying license.txt file for
     applicable licenses.-->
<!-- (C) Copyright IBM Corporation 2001, 2005. All Rights Reserved.
 *-->
<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
 "../../dtd/technicalContent/dtd/concept.dtd">
<concept id="wheelbarrow" xml:lang="en-us">
<title>Wheel barrow</title>
<shortdesc>A good wheel barrow will save your back from extensive trauma when you
garden.</shortdesc>
<conbody>
</conbody>
</concept>


text:
*[We are looking for wonderful people to join us!](https://discord.gg/E6BCvFG)*

**Short Description**

## People

**List of people working on the project**

## Notes on the code

Having many developers means we are most likely going to encounter differences in coding practices.

You should:
* Use camel case:
```c

int CarNames;

```

* And start with a capital when naming members of a class, struct or the class/struct itself:

```c

class Point {
public:
    int PublicMember;
}

```

* And start with a lower case when naming any other variables

```c

    void Point::GetPoint() {
        int uselessVariable = 0; // The important bit
    }

```