text:
namespace {

class FakeNetLogProxySource : public network::mojom::NetLogProxySource {
 public:
  explicit FakeNetLogProxySource(
      mojo::PendingReceiver<network::mojom::NetLogProxySource>
          proxy_source_receiver)
      : proxy_source_receiver_(this, std::move(proxy_source_receiver)),
        run_loop_(std::make_unique<base::RunLoop>()) {}
  FakeNetLogProxySource(const FakeNetLogProxySource&) = delete;
  FakeNetLogProxySource& operator=(const FakeNetLogProxySource&) = delete;

  // mojom::NetLogProxySource:
  void UpdateCaptureModes(net::NetLogCaptureModeSet modes) override {
    EXPECT_FALSE(already_stored_last_modes_);
    already_stored_last_modes_ = true;
    last_modes_ = modes;

    run_loop_->Quit();
  }

  net::NetLogCaptureModeSet WaitForUpdateCaptureModes() {
    run_loop_->Run();
    EXPECT_TRUE(already_stored_last_modes_);
    already_stored_last_modes_ = false;
    net::NetLogCaptureModeSet last_modes = last_modes_;
    last_modes_ = 0;
    run_loop_ = std::make_unique<base::RunLoop>();
    return last_modes;
  }

 private:
  mojo::Receiver<network::mojom::NetLogProxySource> proxy_source_receiver_;
  bool already_stored_last_modes_ = false;
  std::unique_ptr<base::RunLoop> run_loop_;
  net::NetLogCaptureModeSet last_modes_;
};

void CreateObserver(std::unique_ptr<net::RecordingNetLogObserver>* out_observer,
                    net::NetLogCaptureMode capture_mode) {
  *out_observer = std::make_unique<net::RecordingNetLogObserver>(capture_mode);
}

void DestroyObserver(
    std::unique_ptr<net::RecordingNetLogObserver>* out_observer) {
  out_observer->reset();
}

}  // namespace

TEST(NetLogProxySink, TestMultipleObservers) {
  base::test::TaskEnvironment scoped_task_environment;

  network::NetLogProxySink net_log_sink;

  mojo::PendingRemote<network::mojom::NetLogProxySource> proxy_source_remote;
  mojo::PendingReceiver<network::mojom::NetLogProxySource>
      proxy_source_receiver =
          proxy_source_remote.InitWithNewPipeAndPassReceiver();
  mojo::Remote<network::mojom::NetLogProxySink> proxy_sink_remote;

  FakeNetLogProxySource net_log_proxy_source(std::move(proxy_source_receiver));

  net_log_sink.AttachSource(std::move(proxy_source_remote),
                            proxy_sink_remote.BindNewPipeAndPassReceiver());

  // Attaching should notify with the current capture modeset.
  EXPECT_EQ(0U, net_log_proxy_source.WaitForUpdateCaptureModes());

  std::unique_ptr<net::RecordingNetLogObserver> net_log_observer1 =
      std::make_unique<net::RecordingNetLogObserver>(
          net::NetLogCaptureMode::kIncludeSensitive);
  EXPECT_EQ(
      net::NetLogCaptureModeToBit(net::NetLogCaptureMode::kIncludeSensitive),
      net_log_proxy_source.WaitForUpdateCaptureModes());

  std::unique_ptr<net::RecordingNetLogObserver> net_log_observer2;
  // Create observer2 on a different thread.
  base::ThreadPool::PostTask(FROM_HERE,
                             base::BindOnce(&CreateObserver, &net_log_observer2,
                                            net::NetLogCaptureMode::kDefault));
  EXPECT_EQ(
      net::NetLogCaptureModeToBit(net::NetLogCaptureMode::kIncludeSensitive) |
          net::NetLogCaptureModeToBit(net::NetLogCaptureMode::kDefault),
      net_log_proxy_source.WaitForUpdateCaptureModes());

  base::RunLoop add_entry_runloop;
  net_log_observer1->SetThreadsafeAddEntryCallback(
      add_entry_runloop.QuitClosure());

  base::TimeTicks source1_start_time =
      base::TimeTicks() + base::TimeDelta::FromMilliseconds(10);
  base::TimeTicks source1_event0_time =
      source1_start_time + base::TimeDelta::FromMilliseconds(1);
  base::Value source1_event0_params(base::Value::Type::DICTIONARY);
  source1_event0_params.SetStringKey("hello", "world");
  proxy_sink_remote->AddEntry(
      static_cast<uint32_t>(net::NetLogEventType::REQUEST_ALIVE),
      static_cast<uint32_t>(net::NetLogSourceType::URL_REQUEST), 1U,
      source1_start_time, net::NetLogEventPhase::BEGIN, source1_event0_time,
      source1_event0_params.Clone());

  add_entry_runloop.Run();

  auto entries = net_log_observer1->GetEntries();
  ASSERT_EQ(1U, entries.size());

  EXPECT_EQ(net::NetLogEventType::REQUEST_ALIVE, entries[0].type);
  EXPECT_EQ(net::NetLogSourceType::URL_REQUEST, entries[0].source.type);
  EXPECT_EQ(1U, entries[0].source.id);
  EXPECT_EQ(source1_start_time, entries[0].source.start_time);
  EXPECT_EQ(net::NetLogEventPhase::BEGIN, entries[0].phase);
  EXPECT_EQ(source1_event0_time, entries[0].time);
  EXPECT_TRUE(entries[0].HasParams());
  EXPECT_EQ(source1_event0_params, entries[0].params);

  auto entries2 = net_log_observer2->GetEntries();
  ASSERT_EQ(1U, entries2.size());
  EXPECT_EQ(entries[0].type, entries2[0].type);
  EXPECT_EQ(entries[0].source.type, entries2[0].source.type);
  EXPECT_EQ(entries[0].source.id, entries2[0].source.id);
  EXPECT_EQ(entries[0].source.start_time, entries2[0].source.start_time);
  EXPECT_EQ(entries[0].phase, entries2[0].phase);
  EXPECT_EQ(entries[0].time, entries2[0].time);
  EXPECT_EQ(entries[0].params, entries2[0].params);

  net_log_observer1.reset();
  EXPECT_EQ(net::NetLogCaptureModeToBit(net::NetLogCaptureMode::kDefault),
            net_log_proxy_source.WaitForUpdateCaptureModes());

  // Destroy observer2 on a different thread.
  base::ThreadPool::PostTask(
      FROM_HERE, base::BindOnce(DestroyObserver, &net_log_observer2));
  EXPECT_EQ(0U, net_log_proxy_source.WaitForUpdateCaptureModes());
}

TEST(NetLogProxySink, TestAttachAfterObserverAdded) {
  base::test::TaskEnvironment scoped_task_environment;

  // Start observing before creating/attaching the net log proxy.
  std::unique_ptr<net::RecordingNetLogObserver> net_log_observer1 =
      std::make_unique<net::RecordingNetLogObserver>(
          net::NetLogCaptureMode::kIncludeSensitive);

  network::NetLogProxySink net_log_sink;

  mojo::PendingRemote<network::mojom::NetLogProxySource> proxy_source_remote;
  mojo::PendingReceiver<network::mojom::NetLogProxySource>
      proxy_source_receiver =
          proxy_source_remote.InitWithNewPipeAndPassReceiver();
  mojo::Remote<network::mojom::NetLogProxySink> proxy_sink_remote;

  FakeNetLogProxySource net_log_proxy_source(std::move(proxy_source_receiver));

  net_log_sink.AttachSource(std::move(proxy_source_remote),
                            proxy_sink_remote.BindNewPipeAndPassReceiver());

  // Attaching should notify with the current capture modeset.
  EXPECT_EQ(
      net::NetLogCaptureModeToBit(net::NetLogCaptureMode::kIncludeSensitive),
      net_log_proxy_source.WaitForUpdateCaptureModes());

  net_log_observer1.reset();
  EXPECT_EQ(0U, net_log_proxy_source.WaitForUpdateCaptureModes());
}


text:
        Foucault's Pendulum

                        author

                        Umberto Eco

                        original language
Italian

                        published
1988

Back cover

Bored with their work, and after reading too many manuscripts about occult conspiracy theories, three vanity publisher employees (Belbo, Diotallevi and Casaubon) invent their own conspiracy for fun. They call this satirical intellectual game "The Plan," a hoax that connects the medieval Knights Templar with other occult groups from ancient to modern times. This produces a map indicating the geographical point from which all the powers of the earth can be controlled—a point located in Paris, France, at Foucault's Pendulum. But in a fateful turn the joke becomes all too real.

The three become increasingly obsessed with The Plan, and sometimes forget that it's just a game. Worse still, other conspiracy theorists learn about The Plan, and take it seriously. Belbo finds himself the target of a real secret society that believes he possesses the key to the lost treasure of the Knights Templar.

Opening

That was when I saw the Pendulum.

redpajama_set_name: RedPajamaGithub


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Cadastro extends CI_Controller {

    public function __construct()
    {
        parent::__construct();
        // Carrega a biblioteca de teste
        $this->load->library('unit_test');
        // Carrega o model de cadastro
        $this->load->model('cadastro_model');
    }

	public function index()
	{
		// carrega o cabeçalho da página, bootstrap, javascript e etc...
		$this->load->view('comum/header');
		// carrega o modelo com os dados do banco
		$this->load->model('cadastro_model');
		// carrega a view de cadastro
		$this->load->view('cadastro');
		// carrega o footer da página, por enquanto sem nada
		$this->load->view('comum/footer');
	}

	public function realizaCadastro(){
	    // recebe o valor do campo nome
	    $nome = $this->input->post('dsc_nome');
	    // recebe o valor do campo cpf
	    $cpf = $this->input->post('nu_cpf');
	    // recebe o valor do campo email
	    $email = $this->input->post('dsc_email');
	    // recebe o valor do campo senha
	    $senha = $this->input->post('senha');
	    // recebe o valor do campo matricula
	    $matricula = $this->input->post('nu_matricula');

        $objModel = new cadastro_model();
        $cadastro = $objModel->cadastraPessoa($nome,$cpf,$email,$senha,$matricula);
        if($cadastro == 0 ){
            redirect(base_url());
        }
        else{
            redirect('cadastro');
        }
    }
    /* Como executar a função de teste
        1 - Vá ao terminal e navegue até o diretorio da pasta /projeto
        2 - Execute o comando php index.php <nome_da_classe> <nome_da_funçao_de_teste>
        Ex: php index.php Cadastro realizaCadastroTeste
    */
    public function realizaCadastroTeste(){
	    // Testa a função cadastraPessoa que retorna 0 se cadastramos um cpf que não existe no banco
        $objModel = new cadastro_model();
        $test = $objModel->cadastraPessoa('Luiz','04274488161','lp.lobofilho@gmail.com','algumaSenha' ,12000);
        $expected_result = 0  ;
        $test_name = 'Cadastrar novo usuário no banco';
        $str_template = 'ITEM | DESCRIÇÃO'.PHP_EOL.'{rows}{item} | {result}'.PHP_EOL.'{/rows}';
        $this->unit->set_template($str_template);
        echo $this->unit->run($test, $expected_result, $test_name);
    }

}


text:
title: Contact me
author: Filip Bunkens
layout: page
pagestyle: contact
date: 2012-07-19
class: page
menu:
  main:
   Name: "Contact me"
   Weight: 200
---

[![Foto Filip Bunkens][5]][5]

You can contact me in several ways, please choose the one that suits you the most:

**Telephone**: +32 486 36 29 61

**e-mail**: [info@pitslamp.com][4]

**Twitter**: [@Pitslamp][1]

**Facebook**: [Filip Bunkens][2]

**Google plus**: [PitsLamp Photography][3]

**Postcard**: Rue de l'etang 13, 1315 Sart-Risbart

**VAT-number**: BE 0890.177.017

Photo: [Ilja Vladimirovitsj][6]

[1]: http://www.twitter.com/pitslamp
[2]: http://www.facebook.com/bunkens
[3]: http://google.com/+Pitslamp
[4]: mailto:info@pitslamp.com
[5]: /images/filip.jpg
[6]: https://www.facebook.com/atmospherephotosofficial


text:
package feign.jaxrs;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;

import javax.ws.rs.Consumes;
import javax.ws.rs.FormParam;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.HttpMethod;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import feign.Contract;
import feign.MethodMetadata;

import static feign.Util.checkState;
import static feign.Util.emptyToNull;

/**
 * Please refer to the Feign
 * JAX-RS README.
 */
public final class JAXRSContract extends Contract.BaseContract {

  static final String ACCEPT = "Accept";
  static final String CONTENT_TYPE = "Content-Type";

  // Protected so unittest can call us
  // XXX: Should parseAndValidateMetadata(Class, Method) be public instead? The old deprecated parseAndValidateMetadata(Method) was public..
  @Override
  protected MethodMetadata parseAndValidateMetadata(Class<?> targetType, Method method) {
    return super.parseAndValidateMetadata(targetType, method);
  }

  @Override
  protected void processAnnotationOnClass(MethodMetadata data, Class<?> clz) {
    Path path = clz.getAnnotation(Path.class);
    if (path != null) {
      String pathValue = emptyToNull(path.value());
      checkState(pathValue != null, "Path.value() was empty on type %s", clz.getName());
      if (!pathValue.startsWith("/")) {
        pathValue = "/" + pathValue;
      }
      if (pathValue.endsWith("/")) {
          // Strip off any trailing slashes, since the template has already had slashes appropriately added
          pathValue = pathValue.substring(0, pathValue.length() - 1);
      }
      data.template().insert(0, pathValue);
    }
    Consumes consumes = clz.getAnnotation(Consumes.class);
    if (consumes != null) {
      handleConsumesAnnotation(data, consumes, clz.getName());
    }
    Produces produces = clz.getAnnotation(Produces.class);
    if (produces != null) {
      handleProducesAnnotation(data, produces, clz.getName());
    }
  }

  @Override
  protected void processAnnotationOnMethod(MethodMetadata data, Annotation methodAnnotation,
                                           Method method) {
    Class<? extends Annotation> annotationType = methodAnnotation.annotationType();
    HttpMethod http = annotationType.getAnnotation(HttpMethod.class);
    if (http != null) {
      checkState(data.template().method() == null,
                 "Method %s contains multiple HTTP methods. Found: %s and %s", method.getName(),
                 data.template().method(), http.value());
      data.template().method(http.value());
    } else if (annotationType == Path.class) {
      String pathValue = emptyToNull(Path.class.cast(methodAnnotation).value());
      checkState(pathValue != null, "Path.value() was empty on method %s", method.getName());
      String methodAnnotationValue = Path.class.cast(methodAnnotation).value();
      if (!methodAnnotationValue.startsWith("/") && !data.template().url().endsWith("/")) {
        methodAnnotationValue = "/" + methodAnnotationValue;
      }
      // jax-rs allows whitespace around the param name, as well as an optional regex. The contract should
      // strip these out appropriately.
      methodAnnotationValue = methodAnnotationValue.replaceAll("\\{\\s*(.+?)\\s*(:.+?)?\\}", "\\{$1\\}");
      data.template().append(methodAnnotationValue);
    } else if (annotationType == Produces.class) {
      handleProducesAnnotation(data, (Produces) methodAnnotation, "method " + method.getName());
    } else if (annotationType == Consumes.class) {
      handleConsumesAnnotation(data, (Consumes) methodAnnotation, "method " + method.getName());
    }
  }

  private void handleProducesAnnotation(MethodMetadata data, Produces produces, String name) {
    String[] serverProduces = produces.value();
    String clientAccepts = serverProduces.length == 0 ? null : emptyToNull(serverProduces[0]);
    checkState(clientAccepts != null, "Produces.value() was empty on %s", name);
    data.template().header(ACCEPT, (String) null); // remove any previous produces
    data.template().header(ACCEPT, clientAccepts);
  }

  private void handleConsumesAnnotation(MethodMetadata data, Consumes consumes, String name) {
    String[] serverConsumes = consumes.value();
    String clientProduces = serverConsumes.length == 0 ? null : emptyToNull(serverConsumes[0]);
    checkState(clientProduces != null, "Consumes.value() was empty on %s", name);
    data.template().header(CONTENT_TYPE, (String) null); // remove any previous consumes
    data.template().header(CONTENT_TYPE, clientProduces);
  }

  @Override
  protected boolean processAnnotationsOnParameter(MethodMetadata data, Annotation[] annotations,
                                                  int paramIndex) {
    boolean isHttpParam = false;
    for (Annotation parameterAnnotation : annotations) {
      Class<? extends Annotation> annotationType = parameterAnnotation.annotationType();
      if (annotationType == PathParam.class) {
        String name = PathParam.class.cast(parameterAnnotation).value();
        checkState(emptyToNull(name) != null, "PathParam.value() was empty on parameter %s",
                   paramIndex);
        nameParam(data, name, paramIndex);
        isHttpParam = true;
      } else if (annotationType == QueryParam.class) {
        String name = QueryParam.class.cast(parameterAnnotation).value();
        checkState(emptyToNull(name) != null, "QueryParam.value() was empty on parameter %s",
                   paramIndex);
        Collection<String> query = addTemplatedParam(data.template().queries().get(name), name);
        data.template().query(name, query);
        nameParam(data, name, paramIndex);
        isHttpParam = true;
      } else if (annotationType == HeaderParam.class) {
        String name = HeaderParam.class.cast(parameterAnnotation).value();
        checkState(emptyToNull(name) != null, "HeaderParam.value() was empty on parameter %s",
                   paramIndex);
        Collection<String> header = addTemplatedParam(data.template().headers().get(name), name);
        data.template().header(name, header);
        nameParam(data, name, paramIndex);
        isHttpParam = true;
      } else if (annotationType == FormParam.class) {
        String name = FormParam.class.cast(parameterAnnotation).value();
        checkState(emptyToNull(name) != null, "FormParam.value() was empty on parameter %s",
                   paramIndex);
        data.formParams().add(name);
        nameParam(data, name, paramIndex);
        isHttpParam = true;
      }
    }
    return isHttpParam;
  }

  // Not using override as the super-type's method is deprecated and will be removed.
  protected Collection<String> addTemplatedParam(Collection<String> possiblyNull, String name) {
    if (possiblyNull == null) {
      possiblyNull = new ArrayList<String>();
    }
    possiblyNull.add(String.format("{%s}", name));
    return possiblyNull;
  }
}


text:
t_ultrasonic_sensors_controller::t_ultrasonic_sensors_controller (void)
{
  num_sensors = 0;
  sensors = NULL;
}
//---------------------------------------------------------------------
void t_ultrasonic_sensors_controller::trigger (byte sensor_index)
{
  if (sensor_index < num_sensors) {
    sensors[sensor_index].trigger();
  }
}
//---------------------------------------------------------------------
void t_ultrasonic_sensors_controller::set_sensor_pins(byte sensor_index, byte trig_pin, byte echo_pin)
{
  if (sensor_index < num_sensors)
    sensors[sensor_index].create_init(trig_pin, echo_pin);
}
//---------------------------------------------------------------------
void t_ultrasonic_sensors_controller::set_num_sensors(byte new_num_sensors)
{
  if (new_num_sensors != num_sensors) {
    num_sensors = new_num_sensors;
    if (sensors)
      delete[] sensors;

    if (num_sensors > 0) {

      sensors = new t_ultrasonic[num_sensors];
    }
    else
      sensors = NULL;
  }
}
//---------------------------------------------------------------------
byte t_ultrasonic_sensors_controller::get_num_sensors(void)
{
  return num_sensors;
}
//---------------------------------------------------------------------
void t_ultrasonic_sensors_controller::get_sensor_pins(byte sensor_index, byte *trig_pins, byte *echo_pins)
{
  sensors[sensor_index].get_sensor_pins(trig_pins, echo_pins);
}
//---------------------------------------------------------------------
void t_ultrasonic_sensors_controller::update_results(char *serial_out)
{
  serial_out[0] = 0;
  for (byte m = 0; m < num_sensors; m++) {
    if (sensors[m].check_echo()) {
      int distance = sensors[m].get_last_read_distance();
      if (distance > -1) {
        char tmp_s[10];
        sprintf(tmp_s, "RU%u %d#", m, distance);
        strcat(serial_out, tmp_s);
      }
    }
  }
}
//---------------------------------------------------------------------


text:
/* httpclient.C, by Zhang Haibin, 2011-9-6
 */

#include "httpclient.h"
#include "info.h"
CHttpClientLink::CHttpClientLink()
{
   mCode.content = new char[MaxMsgLength];
   mCode.length = MaxMsgLength;

   clearParseState();
   setShortConnectionMode();
}

CHttpClientLink::~CHttpClientLink()
{
   delete[] mCode.content;
}

void CHttpClientLink::clearParseState()
{
   state = http_r_GetHeaderLine;
   contentLength = -1;
   version.clear();
   rCode = 0;
   line.clear();
   content.clear();
}

int CHttpClientLink::parseStream(const char* p, int length)
{
   for(int i=0; i<length; i++)
   {
      switch(state)
      {
      case http_r_GetHeaderLine:
         if(p[i] == '\r')
         {
            if(line.empty())
            {
               state = http_r_GetCrlf2;
            }
            else
               state = http_r_GetCrlf;
         }
         else
            line += p[i];
         break;
      case http_r_GetCrlf:
         if(p[i] == '\n')
         {
            // get a line
            if(version.empty())
            {
               line.cut(" ", version);
               CStr rCodeStr;
               line.cut(" ", rCodeStr);
               rCode = rCodeStr.toInt();
            }
            else
            {
               CStr name;
               line.cut(":", name);
               if(strcasecmp(name.c_str(), "Content-Length")==0)
               {
                  line.trim();
                  contentLength = line.toInt();
               }
            }
            line.clear();
            state = http_r_GetHeaderLine;
         }
         else
         {
            UniERROR("http response missing LF");
            return -1;
         }
         break;
      case http_r_GetCrlf2:
         if(p[i] == '\n')
         {
            if(contentLength == -1 || contentLength == 0)
               return 1;
            state = http_r_GetContent;
         }
         else
         {
            UniERROR("http response missing LF");
            return -1;
         }
         break;
      case http_r_GetContent:
         if(downloadFile.empty())
         {
            content.nCat(p + i, length - i);
            logDownloadState(content.length());
            if(content.length() >= contentLength)
               return 1;
         }
         else
         {
            if(!writeToFile(p + i, length - i))
               return -1;
            logDownloadState(downloadBytes);
            if(downloadBytes >= contentLength)
            {
               return 1;
            }
         }
         return 0;
      default:
         UniERROR("invalid state %d when client parse http response");
         return -1;
      }
   }
   return 0;
}

//void httpResponseToApp(int appKey, int linkId, CStr& version, int rCode, CStr& content);

int CHttpClientLink::processRecv()
{
   mCode.clear();
   int rt = receive(mCode);
   if(rt==1)
   {
      int re = parseStream(mCode.content, mCode.length);
      if(re == 1)
      {
  //       httpResponseToApp(appKey, linkId(), version, rCode, content);
         return -1;
      }
      else if(re<0)
      {
         return -1;
      }
   }
   else if( -9 == rt || 0 == rt)
   {
      return -1;
   }
   return 1;
}

void CHttpClientLink::setDownload(const char* downloadFileName)
{
   downloadFile = downloadFileName;
   downloadBytes = 0;
}

void CHttpClientLink::logDownloadState(int count)
{
      return;
}

bool CHttpClientLink::writeToFile(const char* s, int len)
{
   FILE* f = NULL;
   if(downloadBytes == 0)
   {
   }
   else
      f = fopen(downloadFile.c_str(), "a");
   if(f == NULL)
   {
      UniERROR("fopen %s failed", downloadFile.c_str());
      return false;
   }
   int n = fwrite(s, 1, len, f);
   fclose(f);
   if(n != len)
   {
      UniERROR("fwrite failed, %d/%d wrote", n, len);
      return false;
   }
   downloadBytes += len;
   return true;
}


text:
package org.support.project.knowledge.logic.notification.webhook;

import java.io.IOException;
import java.io.StringReader;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;

import org.support.project.common.log.Log;
import org.support.project.common.log.LogFactory;
import org.support.project.common.util.FileUtil;
import org.support.project.common.util.StringUtils;
import org.support.project.di.Container;
import org.support.project.di.DI;
import org.support.project.di.Instance;
import org.support.project.knowledge.entity.KnowledgesEntity;
import org.support.project.knowledge.entity.WebhookConfigsEntity;
import org.support.project.knowledge.entity.WebhooksEntity;
import org.support.project.knowledge.logic.KnowledgeLogic;
import org.support.project.knowledge.vo.notification.webhook.WebhookKnowledgeJson;

import com.google.gson.JsonElement;
import com.google.gson.JsonParser;

import net.arnx.jsonic.JSON;

/**
 * 記事が投稿された際のWebHook通知
 *
 * @author koda
 */
@DI(instance = Instance.Prototype)
public class KnowledgeUpdateWebHookNotification extends AbstractWebHookNotification {
    /** ログ */
    private static final Log LOG = LogFactory.getLog(KnowledgeUpdateWebHookNotification.class);

    /** インスタンス取得 */
    public static KnowledgeUpdateWebHookNotification get() {
        return Container.getComp(KnowledgeUpdateWebHookNotification.class);
    }

    private KnowledgesEntity knowledge;
    private int type;
    public void init(KnowledgesEntity knowledge, int type) {
        this.knowledge = knowledge;
        this.type = type;
        super.inited = true;
    }
    @Override
    protected String getHook() {
        return WebhookConfigsEntity.HOOK_KNOWLEDGES;
    }
    @Override
    protected String createWebhookJson() {
        LOG.trace("createWebhookJson");
        WebhookKnowledgeJson json = new WebhookKnowledgeJson();
        json.knowledgeId = knowledge.getKnowledgeId();
        json.type = type;
        boolean became_public = false;
        if (knowledge.getNotifyStatus() == null || knowledge.getNotifyStatus().intValue() == 0) {
            if (knowledge.getPublicFlag().intValue() != KnowledgeLogic.PUBLIC_FLAG_PRIVATE) {
                // 今まで非公開だったものが、初めての通知になった
                became_public = true;
            }
        }
        json.became_public = became_public;
        return JSON.encode(json);
    }

    @Override
    public String createSendTestJson(WebhookConfigsEntity configEntity) throws UnsupportedEncodingException, IOException {
        WebhookKnowledgeJson json = new WebhookKnowledgeJson();
        json.type = 0;
        json.became_public = true;
        KnowledgesEntity knowledge = new KnowledgesEntity();
        knowledge.setTitle("Test knowledge");
        knowledge.setContent("This is sample data for test.");
        knowledge.setGroupName("TestGroup");
        knowledge.setKnowledgeId(new Long(1));
        return createSendJson(configEntity, json, knowledge);
    }

    @Override
    public String createSendJson(WebhooksEntity entity, WebhookConfigsEntity configEntity) throws UnsupportedEncodingException, IOException {
        LOG.trace("createSendJson");
        WebhookKnowledgeJson json = JSON.decode(entity.getContent(), WebhookKnowledgeJson.class);
        long knowledgeId = json.knowledgeId;
        KnowledgesEntity knowledge = loadKnowledgeData(knowledgeId);
        if (knowledge == null) {
            return ""; // 生成エラー
        }
        return createSendJson(configEntity, json, knowledge);
    }

    private String createSendJson(WebhookConfigsEntity configEntity, WebhookKnowledgeJson json, KnowledgesEntity knowledge)
            throws UnsupportedEncodingException, IOException {
        String template = loadTemplate(configEntity);
        JsonElement send = new JsonParser().parse(new StringReader(template));

        Map<String, Object> map = new HashMap<>();
        map.put("knowledge", knowledge);
        map.put("knowledge.type", json.type);
        map.put("knowledge.became_public", json.became_public);
        buildJson(send.getAsJsonObject(), map);
        return send.toString();
    }

    @Override
    public String loadTemplate(WebhookConfigsEntity configEntity) throws UnsupportedEncodingException, IOException {
        String template = configEntity.getTemplate();
        if (StringUtils.isEmpty(template)) {
            template = FileUtil.read(getClass().getResourceAsStream("knowledge_template.json"), "UTF-8");
        }
        return template;
    }

}


text:
REDIS_SERVER = ["127.0.0.1:6379", "myip:redisport", "anotherip:redisport:mypassword"]
# interval which you monitor the redis info.
INFO_INTERVAL = 2.0
# in the index, the table is set to show 10 rows redis data by default. you can change it.
TABLE_MAX_ROWS = 10
# flaks debug mode
DEBUG = False
SECRET_KEY = 'temporary_secret_key'


text:
<?php

namespace Itslearning\Objects\Organisation;

class ExtensionInstance
{

    /**
     * @var string
     */
    private $syncKey;

    /**
     * Either "Course" or "Library"
     * @var string
     */
    private $location;

    /**
     * @var int
     */
    private $extensionId;

    /**
     * @var string
     */
    private $courseSyncKey;

    /**
     * @var string
     */
    private $userSyncKey;

    /**
     * @var string
     */
    private $title;

    /**
     * @var string
     */
    private $description;

    /**
     * @var string
     */
    private $content;

    /**
     * @var string
     */
    private $language;

    /**
     * @var string[]
     */
    private $keywords;

    /**
     * @todo whut is this
     * @var mixed
     */
    private $learningObjectives;

    /**
     * @var string
     */
    private $intendedEndUserRole;

    /**
     * @return string
     */
    public function getSyncKey()
    {
        return $this->syncKey;
    }

    /**
     * @param string $syncKey
     */
    public function setSyncKey(string $syncKey)
    {
        $this->syncKey = $syncKey;
    }

    /**
     * @return string
     */
    public function getLocation()
    {
        return $this->location;
    }

    /**
     * @param string $location
     */
    public function setLocation(string $location)
    {
        $this->location = $location;
    }

    /**
     * @return int
     */
    public function getExtensionId()
    {
        return $this->extensionId;
    }

    /**
     * @param int $extensionId
     */
    public function setExtensionId(int $extensionId)
    {
        $this->extensionId = $extensionId;
    }

    /**
     * @return string
     */
    public function getCourseSyncKey()
    {
        return $this->courseSyncKey;
    }

    /**
     * @param string $courseSyncKey
     */
    public function setCourseSyncKey(string $courseSyncKey)
    {
        $this->courseSyncKey = $courseSyncKey;
    }

    /**
     * @return string
     */
    public function getUserSyncKey()
    {
        return $this->userSyncKey;
    }

    /**
     * @param string $userSyncKey
     */
    public function setUserSyncKey(string $userSyncKey)
    {
        $this->userSyncKey = $userSyncKey;
    }

    /**
     * @return string
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * @param string $title
     */
    public function setTitle(string $title)
    {
        $this->title = $title;
    }

    /**
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * @param string $description
     */
    public function setDescription(string $description)
    {
        $this->description = $description;
    }

    /**
     * @return string
     */
    public function getContent()
    {
        return $this->content;
    }

    /**
     * @param string $content
     */
    public function setContent(string $content)
    {
        $this->content = $content;
    }

    /**
     * @return string
     */
    public function getLanguage()
    {
        return $this->language;
    }

    /**
     * @param string $language
     */
    public function setLanguage(string $language)
    {
        $this->language = $language;
    }

    /**
     * @return mixed
     */
    public function getLearningObjectives()
    {
        return $this->learningObjectives;
    }

    /**
     * @param mixed $learningObjectives
     */
    public function setLearningObjectives($learningObjectives)
    {
        $this->learningObjectives = $learningObjectives;
    }

    /**
     * @return \string[]
     */
    public function getKeywords()
    {
        return $this->keywords;
    }

    /**
     * @param \string[] $keywords
     */
    public function setKeywords($keywords)
    {
        $this->keywords = $keywords;
    }

    /**
     * @return string
     */
    public function getIntendedEndUserRole()
    {
        return $this->intendedEndUserRole;
    }

    /**
     * @param string $intendedEndUserRole
     */
    public function setIntendedEndUserRole(string $intendedEndUserRole)
    {
        $this->intendedEndUserRole = $intendedEndUserRole;
    }
}


text:
layout: post
date: 2015-12-06
title: "Camille La Vie Heavily Beaded Wedding Dress Sleeveless Chapel Train Mermaid/Trumpet"
category: Camille La Vie
tags: [Camille La Vie,Mermaid/Trumpet,Sweetheart,Chapel Train,Sleeveless]
---
### Camille La Vie Heavily Beaded Wedding Dress
Just **$339.99**
###   Sleeveless Chapel Train Mermaid/Trumpet

BRANDS	Camille La Vie

Silhouette	Mermaid/Trumpet

Neckline	Sweetheart

Hemline/Train	Chapel Train

Sleeve	Sleeveless

Buy it: [https://www.readybrides.com/en/camille-la-vie/10309-camille-la-vie-heavily-beaded-wedding-dress.html](https://www.readybrides.com/en/camille-la-vie/10309-camille-la-vie-heavily-beaded-wedding-dress.html)


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using SPS.Core;
using SPS.Model;
using CS.SL.Common.Extensions;

namespace SPS
{
    public partial class CtrlNewContent : CtrlPopWindow
    {
        public CtrlNewContent()
        {
            InitializeComponent();
        }
        protected override void AsyncProcess()
        {
            base.AsyncProcess();
            if (string.IsNullOrWhiteSpace(txtContentName.Text))
            {
                base.ShowError("EmptyContentName", txtContentName.Text);
                return;
            }
            if (!txtContentName.Text.IsFileName())
            {
                base.ShowError("InvalidContentName", txtContentName.Text);
                return;
            }
             ContextMenuInfo action = this.Tag as ContextMenuInfo;
             if (action == BusinessLayer.NewContentMenu)
             {
                 base.AsynProcessed(true, txtContentName.Text);
             }
        }
    }
}


text:
<?php

namespace ESIEE\GameBundle\Repository;

use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query;

/**
 * TileFamilyRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class TileFamilyRepository extends EntityRepository
{
    public function findAllSimple()
    {
        return $this->createQueryBuilder('f')
            ->select('f.id, f.name, IDENTITY(f.ground) ground')
            ->getQuery()->getResult(Query::HYDRATE_ARRAY);
    }
}


text:
{{::vm.title}}

                <sk-change-password ng-if="vm.manageInfo.hasLocalLogin"></sk-change-password>
                <sk-create-local-login ng-if="!vm.manageInfo.hasLocalLogin"></sk-create-local-login>

Registered logins

                        <sk-user-login login="login" action="vm.removeLogin(login)"></sk-user-login>

Add another login

                        <sk-login-provider provider="provider" action="vm.addLogin(provider)"></sk-login-provider>


text:
ALTER SESSION ENABLE PARALLEL DML;

MERGE /*+ APPEND PARALLEL */ INTO xtn2 USING xtn ON (xtn2.xtn_id = xtn.xtn_id)
	WHEN NOT MATCHED THEN INSERT (xtn_id, username, command, is_readonly, start_time)
		VALUES (xtn.xtn_id, xtn.username, xtn.command, xtn.is_readonly, xtn.start_time);
COMMIT;

MERGE /*+ APPEND PARALLEL */ INTO xtn2_detail USING xtn_detail ON (xtn2_detail.xtn_id = xtn_detail.xtn_id AND xtn2_detail.name = xtn_detail.name AND xtn2_detail.value = xtn_detail.value)
	WHEN NOT MATCHED THEN INSERT (xtn_id, name, value)
		VALUES (xtn_detail.xtn_id, xtn_detail.name, xtn_detail.value);
COMMIT;

MERGE /*+ APPEND PARALLEL */ INTO xtn2_end USING xtn_end ON (xtn2_end.xtn_id = xtn_end.xtn_id)
	WHEN NOT MATCHED THEN INSERT (xtn_id, return_code, end_time)
		VALUES (xtn_end.xtn_id, xtn_end.return_code, xtn_end.end_time);
COMMIT;

QUIT;


text:
<?php
function getVideoVoteRate( $videoId ){
    $pos_count     = (int) get_post_meta($videoId, "votes_pos_count", true);
    $neg_count  = (int) get_post_meta($videoId, "votes_neg_count", true);
    $total_count    = $pos_count + $neg_count;

    if($total_count > 0)
        return $pos_count / $total_count * 100;
    else
        return false;
}

function getVideoVotes( $videoId ){
    $pos_count     = (int) get_post_meta($videoId, "votes_pos_count", true);
    $neg_count  = (int) get_post_meta($videoId, "votes_neg_count", true);
    $total_count    = $pos_count + $neg_count;

    if($total_count > 0)
        return $total_count;
    else
        return 0;
}

function getVideoPercentVotes( $videoId ){

    if( getVideoVoteRate($videoId) !== false )
        return floor( getVideoVoteRate($videoId) ) . '%';
    else
        return '0%';
}


text:
namespace ash::secure_channel {

class AuthenticatedChannel;
class ClientConnectionParameters;
class ConnectionAttemptDetails;
class ConnectionDetails;
enum class ConnectionPriority;

// Attempts to create connections to remote devices. If a connection request
// fails or is canceled, the client will be notified. If a connection is
// created successfully, PendingConnectionManager notifies its delegate.
class PendingConnectionManager {
 public:
  class Delegate {
   public:
    virtual ~Delegate() = default;
    virtual void OnConnection(
        std::unique_ptr<AuthenticatedChannel> authenticated_channel,
        std::vector<std::unique_ptr<ClientConnectionParameters>> clients,
        const ConnectionDetails& connection_details) = 0;
  };

  PendingConnectionManager(const PendingConnectionManager&) = delete;
  PendingConnectionManager& operator=(const PendingConnectionManager&) = delete;

  virtual ~PendingConnectionManager();

  // Attempts a connection according to the provided parameters. If other
  // clients have requested a connection with the same details, a single
  // connection attempt is created which combines all clients which would like
  // to connect to the same device.
  virtual void HandleConnectionRequest(
      const ConnectionAttemptDetails& connection_attempt_details,
      std::unique_ptr<ClientConnectionParameters> client_connection_parameters,
      ConnectionPriority connection_priority) = 0;

 protected:
  PendingConnectionManager(Delegate* delegate);

  void NotifyOnConnection(
      std::unique_ptr<AuthenticatedChannel> authenticated_channel,
      std::vector<std::unique_ptr<ClientConnectionParameters>> clients,
      const ConnectionDetails& connection_details);

 private:
  Delegate* delegate_;
};

}  // namespace ash::secure_channel

#endif  // ASH_SERVICES_SECURE_CHANNEL_PENDING_CONNECTION_MANAGER_H_


text:
using System;
using System.IO;
using System.Linq;

namespace Entitas.Migration {

    public static class MigrationUtils {

        public static MigrationFile[] GetFiles(string path, string searchPattern = "*.cs") {
            return Directory.GetFiles(path, searchPattern, SearchOption.AllDirectories)
                .Select(p => new MigrationFile(p, File.ReadAllText(p)))
                .ToArray();
        }

        public static void WriteFiles(MigrationFile[] files) {
            foreach (var file in files) {
                Console.WriteLine("Migrating: " + file.fileName);
                File.WriteAllText(file.fileName, file.fileContent);
            }
        }
    }
}


text:
<?php

// We always have times in UTC
date_default_timezone_set('UTC');

// FIXME: Use a host that better supports PHP include paths...
set_include_path(get_include_path() . PATH_SEPARATOR . '/customers/f/9/a/tasktaste.com/httpd.www/phpincludes');
require_once 'TaskTasteConfig/config.php';

require_once 'TaskTaste/ajax-object.php';
require_once 'TaskTaste/authentication.php';
require_once 'TaskTaste/data-point.php';
require_once 'TaskTaste/constants.php';
require_once 'TaskTaste/project.php';
require_once 'TaskTaste/sql-query.php';
require_once 'TaskTaste/sql.php';
require_once 'TaskTaste/task.php';
require_once 'TaskTaste/user.php';
require_once 'TaskTaste/utils.php';

?>


text:
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddDatesToShifts extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('shifts', function ($table)
        {
            $table->text('dates');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('shifts', function ($table)
        {
            $table->dropColumn('dates');
        });
    }
}


text:
package forms

import play.api.data.Form
import play.api.data.Forms._

object SignInForm {

  val form: Form[Data] = Form(
    mapping(
      "email" -> email,
      "password" -> nonEmptyText
    )(Data.apply)(Data.unapply)
  )

  case class Data(email: String, password: String)

}


text:
class AddResetPasswordTokenToCASinoUsers < ActiveRecord::Migration
  def change
    add_column :casino_users, :reset_password_token, :string, after: :telephone
  end
end


text:
namespace MassTransit.Middleware
{
    using System.Diagnostics;
    using System.Threading.Tasks;

    /// <summary>
    /// Uses a delayed exchange in ActiveMQ to delay a message retry
    /// </summary>
    /// <typeparam name="TMessage"></typeparam>
    public class DelayedMessageRedeliveryFilter<TMessage> :
        IFilter<ConsumeContext<TMessage>>
        where TMessage : class
    {
        readonly RedeliveryOptions _options;

        public DelayedMessageRedeliveryFilter(RedeliveryOptions options)
        {
            _options = options;
        }

        public void Probe(ProbeContext context)
        {
            var scope = context.CreateFilterScope("delayedMessageRedelivery");
            scope.Add("messageType", TypeCache<TMessage>.ShortName);
        }

        [DebuggerNonUserCode]
        public Task Send(ConsumeContext<TMessage> context, IPipe<ConsumeContext<TMessage>> next)
        {
            context.GetOrAddPayload<MessageRedeliveryContext>(() => new DelayedMessageRedeliveryContext<TMessage>(context, _options));

            return next.Send(context);
        }
    }
}


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

Imports System.Threading
Imports Microsoft.CodeAnalysis
Imports Microsoft.CodeAnalysis.FindUsages
Imports Microsoft.CodeAnalysis.Editor.UnitTests
Imports Microsoft.CodeAnalysis.Editor.UnitTests.Utilities.GoToHelpers
Imports Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces
Imports Microsoft.CodeAnalysis.Remote.Testing

Friend Class GoToHelpers
    Friend Shared Async Function TestAsync(
            workspaceDefinition As XElement,
            testHost As TestHost,
            testingMethod As Func(Of Document, Integer, SimpleFindUsagesContext, Task),
            Optional shouldSucceed As Boolean = True,
            Optional metadataDefinitions As String() = Nothing) As Task

        Using workspace = TestWorkspace.Create(workspaceDefinition, composition:=EditorTestCompositions.EditorFeatures.WithTestHostParts(testHost))
            Dim documentWithCursor = workspace.DocumentWithCursor
            Dim position = documentWithCursor.CursorPosition.Value

            Dim solution = workspace.CurrentSolution
            Dim document = solution.GetDocument(documentWithCursor.Id)

            Dim context = New SimpleFindUsagesContext(workspace.GlobalOptions)
            Await testingMethod(document, position, context)

            If Not shouldSucceed Then
                Assert.NotNull(context.Message)
            Else
                Dim actualDefinitions = New List(Of FilePathAndSpan)

                For Each definition In context.GetDefinitions()
                    For Each sourceSpan In definition.SourceSpans
                        actualDefinitions.Add(New FilePathAndSpan(sourceSpan.Document.FilePath, sourceSpan.SourceSpan))
                    Next
                Next
                actualDefinitions.Sort()

                Dim expectedDefinitions = workspace.Documents.SelectMany(
                    Function(d) d.SelectedSpans.Select(Function(ss) New FilePathAndSpan(d.FilePath, ss))).ToList()

                expectedDefinitions.Sort()

                Assert.Equal(expectedDefinitions.Count, actualDefinitions.Count)

                For i = 0 To actualDefinitions.Count - 1
                    Dim actual = actualDefinitions(i)
                    Dim expected = expectedDefinitions(i)

                    Assert.True(actual.CompareTo(expected) = 0,
                                $"Expected: ({expected}) but got: ({actual})")
                Next

                Dim actualDefintionsWithoutSpans = context.GetDefinitions() _
                    .Where(Function(d) d.SourceSpans.IsDefaultOrEmpty) _
                    .Select(Function(di)
                                Return String.Format("{0}:{1}",
                                                     String.Join("", di.OriginationParts.Select(Function(t) t.Text)),
                                                     String.Join("", di.NameDisplayParts.Select(Function(t) t.Text)))
                            End Function).ToList()

                actualDefintionsWithoutSpans.Sort()

                If metadataDefinitions Is Nothing Then
                    metadataDefinitions = {}
                End If

                AssertEx.Equal(metadataDefinitions, actualDefintionsWithoutSpans)
            End If
        End Using
    End Function
End Class


text:
The goal of this package is to be able to automatically manage imports in Python. To that end it can:

- Build an index of all known symbols in all packages.
- Find unresolved references in source, and resolve them against the index, effectively automating imports.
- Automatically arrange imports according to PEP8.

It was originally written for the Sublime Text 2 [Python Import Magic](https://github.com/alecthomas/SublimePythonImportMagic) plugin.

## Example of use in Sublime Text 2 plugin

![Example of Import Magic at work](importmagic.gif)

## Using the library

Getting index from cache:

```python
index = importmagic.SymbolIndex()
index.get_or_create_index(name='foo', paths=sys.path)
```

Build an index:

```python
index = importmagic.SymbolIndex()
index.build_index(sys.path)
with open('index.json') as fd:
    index.serialize(fd)
```

Load an existing index:

```python
with open('index.json') as fd:
    index = SymbolIndex.deserialize(fd)
```

Find unresolved and unreferenced symbols:

```python
scope = importmagic.Scope.from_source(python_source)
unresolved, unreferenced = scope.find_unresolved_and_unreferenced_symbols()
```

Print new import block:

```python
start_line, end_line, import_block = importmagic.get_update(python_source, index, unresolved, unreferenced)
```

Update source code with new import blocks:

```
python_source = importmagic.update_imports(python_source, index, unresolved, unreferenced)
```

For more fine-grained control over what symbols are imported, the index can be queried directly:

```python
imports = importmagic.Imports(index, python_source)
imports.remove(unreferenced)

for symbol in unresolved:
    for score, module, variable in index.symbol_scores(symbol):
        if variable is None:
            imports.add_import(module)
        else:
            imports.add_import_from(module, variable)
        break

python_source = imports.update_source()
```

### Configuration

Configuring import styles

1. Using `importmagic.Imports`.

```python
imports = importmagic.Imports.set_style(multiline='backslash', max_columns=80, indent_with_tabs=True)
```

`multiline` takes `backlslash` or `parentheses`.

2. From `setup.cfg`

Add configuration to setup.cfg

```python
[importmagic]
multiline = 'parentheses'
max_columns = 120
indent_with_tabs = 1
```

and pass root directory to importmagic

```python
imports = importmagic.Imports(root_dir='/foo/bar/')
```


text:
package net.ccmob.netlight.server.utils;

/**
 *
 * @author Marcel Benning
 * @date 27.07.2014
 *
 */

public enum MessageType {

	INFO,
	ERROR,
	FATAL_ERROR,
	SUCCESS

}


text:
id: timers
title: Timers (C++ only)
---

Timers perform delayed actions or repeat actions at set intervals.

## Timer Management

Timers are managed by a global `TimerManager`. Any void returning callable can
be used to create a timer. Timers may safely be created and cleared by timer
callbacks. Additionally, timers may clear themselves on callback without causing
error.

To access the timer manager, use the static `Get()` method:

```c++
TimerManager* timer_manager = TimerManager::Get();
```

### Creating and Clearing Timers

```c++
auto TimerManager::set_timer(Timer::Closure,
                             const int interval,
                             const int repeat_count) -> Timer*;
auto TimerManager::clear_timer(Timer*) -> void;
```

`Timer::Closure` is defined as a callable whose signature is `void()`. The
`interval` is the time, in milliseconds, to wait before the first call and
between any subsequent calls. A zero interval will immediately set the timer in
a finished state. Calls are _repeated_ `repeat_count` times, e.g. a repeat count
of four makes the timer perform an action five times. For infinity, use any
negative value. `TimerManager::set_timer()` returns a `Timer` object which can
be used to pause and resume the timer, as well as querying its state.

A `Timer` that has run its course, will be put in a paused state. It can be
resumed but the repeat count will not be restored.

### Pausing and Resuming Timers

```c++
void Timer::pause();
void Timer::resume();
```

Pausing a timer will freeze it in its current state until it is resumed.

### Timer Information

```c++
auto Timer::is_active() const -> bool;
```

Returns whether the timer is currently active. This method returns `true` while
the timer is running normally, and `false` otherwise.

```c++
auto Timer::elapsed() const -> int;
```

Returns the elapsed time.

```c++
auto Timer::interval() const -> int;
```

Returns the timer's delay/interval in milliseconds.

```c++
auto Timer::repeat_count() const -> int;
```

Returns the number of times the action will be repeated. Note that this number
excludes the first call.

## Example

The following example creates four timers. Two that are performed 5 times
(repeated 4 times) with an interval of 500 ms, and two that are performed after
a 500 ms delay. We use a freestanding function, a functor, a lambda function,
and a bound member function to create them. For simplicity's sake, we only clear
the first repeated timer.

```c++
#include <functional>

#include "Script/GameBase.h"
#include "Script/Timer.h"

void action()
{
  LOGI("A freestanding function was called.");
}

class RepeatableAction
{
public:
  void action()
  {
    LOGI("A bound, repeated action was performed: %i time(s)", ++counter_);
  }

  void operator()()
  {
    LOGI("A repeated action was performed: %i time(s)", ++counter_);
  }

private:
  int counter_ = 0;
};

class TimerExample final : public rainbow::GameBase
{
public:
  TimerExample(rainbow::Director& director)
    : rainbow::GameBase(director), repeated_(nullptr)
  {
  }

private:
  rainbow::Timer* repeated_;
  RepeatableAction action_;

  void init_impl(const rainbow::Vec2i&) override
  {
    auto timer_manager = rainbow::TimerManager::Get();

    // Create a delayed action using a function.
    timer_manager->set_timer(&action, 500, 0);

    // Create a repeated action using a functor.
    repeated_ = timer_manager->set_timer(RepeatableAction{}, 500, 4);

    // Create a delayed action using a lambda function.
    timer_manager->set_timer(
      [] { LOGI("A delayed action was performed."); }, 500, 0);

    // Create a repeated action using a bound member function.
    timer_manager->set_timer(
      std::bind(&RepeatableAction::action, action_), 500, 4);
  }

  void update_impl(uint64_t) override
  {
    if (repeated_ && !repeated_->is_active())
    {
      rainbow::TimerManager::Get()->clear_timer(repeated_);
      repeated_ = nullptr;
      LOGI("The repeated timer was cleared.");
    }
  }
};

auto rainbow::GameBase::create(rainbow::Director& director)
  -> std::unique_ptr<rainbow::GameBase>
{
  return std::make_unique<TimerExample>(director);
}
```

Output:

```console
[1428273728390|INFO] A freestanding function was called.
[1428273728390|INFO] A repeated action was performed: 1 time(s)
[1428273728390|INFO] A delayed action was performed.
[1428273728390|INFO] A bound, repeated action was performed: 1 time(s)
[1428273728847|INFO] A repeated action was performed: 2 time(s)
[1428273728847|INFO] A bound, repeated action was performed: 2 time(s)
[1428273729352|INFO] A repeated action was performed: 3 time(s)
[1428273729352|INFO] A bound, repeated action was performed: 3 time(s)
[1428273729863|INFO] A repeated action was performed: 4 time(s)
[1428273729863|INFO] A bound, repeated action was performed: 4 time(s)
[1428273730380|INFO] A repeated action was performed: 5 time(s)
[1428273730380|INFO] A bound, repeated action was performed: 5 time(s)
[1428273730380|INFO] The repeated timer was cleared.
```

## Caveats and Known Limitations

Timer handlers are reused. This implies that an old handler may be used to
manipulate a more recent timer.


text:
{{ theme.openhead }}
{{ theme.style }}
<title>{{ sitename }}</title>
{{ theme.closehead }}
{{ theme.openbody }}
{{ theme.header }}
{{ theme.opencontent }}
{{ pagination.currpage }}
{{ theme.openpost }}

        {{ pagination.newer_link }}
        Page {{pagination.currpagenum}} of {{ pagination.totalpages }}
        {{ pagination.older_link }}

{{ theme.closepost }}
{{ theme.closecontent }}
{{ theme.closebody }}


text:
import sys
import os

import recommonmark
from recommonmark.parser import CommonMarkParser
from recommonmark.transform import AutoStructify

# -- General configuration

extensions = [
  'sphinx.ext.todo',
  'sphinx.ext.imgmath',
  'sphinx.ext.intersphinx',
  'sphinxcontrib.bibtex',
  'javasphinx'
]
imgmath_image_format = 'svg'
templates_path = ['_templates']
source_parsers = {
  '.md': CommonMarkParser,
}
source_suffix = ['.rst', '.md']
master_doc = 'index'
project = 'Declare Your Language'
copyright = '2015-2017, Eelco Visser'
author = 'Eelco Visser'
version = '0.5'
release = version
language = None
exclude_patterns = ['_build', 'notes', 'include', 'README.md']
pygments_style = 'sphinx'
todo_include_todos = True

# Include include/_all.rst in all documents.
rst_prolog = """
.. include:: /include/_all.rst
"""

# -- Options for HTML output

# Only import and set the ReadTheDocs theme if we're building docs locally.
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if not on_rtd:
  import sphinx_rtd_theme
  html_theme = 'sphinx_rtd_theme'
  html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

html_static_path = ['_static']
htmlhelp_basename = 'Spoofaxdoc'

# -- Options for LaTeX output

latex_documents = [
  (master_doc, 'Spoofax.tex', 'Spoofax Documentation', 'MetaBorg', 'manual'),
]

# -- Options for manual page output

man_pages = [
  (master_doc, 'spoofax', 'Spoofax Documentation', [author], 1)
]

# -- Options for Texinfo output

texinfo_documents = [
  (master_doc, 'Spoofax', 'Spoofax Documentation', author, 'Spoofax', 'Spoofax documentation', 'Miscellaneous')
]

# -- Options for Epub output

epub_title = project
epub_author = author
epub_publisher = author
epub_copyright = copyright
epub_exclude_files = ['search.html']

# -- Options for intersphix extension

spoofax_api_loc = 'http://www.metaborg.org/projects/spoofax-api/en/latest/'

intersphinx_mapping = {'api': (spoofax_api_loc, None)}

# -- Additional Sphinx configuration

def setup(app):
  app.add_config_value('recommonmark_config', {'auto_toc_tree_section': 'Contents'}, 'env')
  app.add_transform(AutoStructify)


text:
package lombok.test;

@org.openlegacy.core.annotations.screen.ScreenEntity
@javax.xml.bind.annotation.XmlAccessorType(javax.xml.bind.annotation.XmlAccessType.FIELD)
public class ScreenEntity implements org.openlegacy.core.terminal.ScreenEntity {
	@com.fasterxml.jackson.annotation.JsonIgnore
	@javax.xml.bind.annotation.XmlTransient
	@java.lang.SuppressWarnings("all")
	@javax.annotation.Generated("lombok")
	private java.lang.String pcCommand;
	@com.fasterxml.jackson.annotation.JsonIgnore
	@javax.xml.bind.annotation.XmlTransient
	@java.lang.SuppressWarnings("all")
	@javax.annotation.Generated("lombok")
	private java.lang.String focusField;
	@com.fasterxml.jackson.annotation.JsonIgnore
	@javax.xml.bind.annotation.XmlTransient
	@java.lang.SuppressWarnings("all")
	@javax.annotation.Generated("lombok")
	private java.util.List<org.openlegacy.core.terminal.definitions.TerminalActionDefinition> actions = new java.util.ArrayList<org.openlegacy.core.terminal.definitions.TerminalActionDefinition>();

	@java.lang.SuppressWarnings("all")
	@javax.annotation.Generated("lombok")
	public java.util.List<org.openlegacy.core.terminal.definitions.TerminalActionDefinition> getActions() {
		return this.actions;
	}

	@java.lang.SuppressWarnings("all")
	@javax.annotation.Generated("lombok")
	public java.lang.String getFocusField() {
		return this.focusField;
	}

	@java.lang.SuppressWarnings("all")
	@javax.annotation.Generated("lombok")
	public java.lang.String getPcCommand() {
		return this.pcCommand;
	}

	@java.lang.SuppressWarnings("all")
	@javax.annotation.Generated("lombok")
	public void setActions(final java.util.List<org.openlegacy.core.terminal.definitions.TerminalActionDefinition> actions) {
		this.actions = actions;
	}

	@java.lang.SuppressWarnings("all")
	@javax.annotation.Generated("lombok")
	public void setFocusField(final java.lang.String focusField) {
		this.focusField = focusField;
	}

	@java.lang.SuppressWarnings("all")
	@javax.annotation.Generated("lombok")
	public void setPcCommand(final java.lang.String pcCommand) {
		this.pcCommand = pcCommand;
	}
}


text:
package com.intellij.build.progress;

import com.intellij.build.BuildBundle;
import com.intellij.build.BuildProgressListener;
import com.intellij.build.events.BuildEventsNls;
import com.intellij.build.events.FinishBuildEvent;
import com.intellij.build.events.FinishEvent;
import com.intellij.build.events.StartEvent;
import com.intellij.build.events.impl.*;

import javax.annotation.Nonnull;

//@ApiStatus.Internal
public class BuildRootProgressImpl extends BuildProgressImpl {
  private final BuildProgressListener myListener;

  public BuildRootProgressImpl(BuildProgressListener buildProgressListener) {
    super(buildProgressListener, null);
    myListener = buildProgressListener;
  }

  @Nonnull
  @Override
  public Object getId() {
    return getBuildId();
  }

  @Override
  @Nonnull
  protected StartEvent createStartEvent(BuildProgressDescriptor descriptor) {
    return new StartBuildEventImpl(descriptor.getBuildDescriptor(), BuildBundle.message("build.status.running"));
  }

  @Override
  public @Nonnull
  BuildProgress<BuildProgressDescriptor> finish() {
    return finish(System.currentTimeMillis(), false, BuildBundle.message("build.status.finished"));
  }

  @Nonnull
  @Override
  public BuildProgress<BuildProgressDescriptor> finish(long timeStamp, boolean isUpToDate, @Nonnull @BuildEventsNls.Message String message) {
    assertStarted();
    FinishEvent event = new FinishBuildEventImpl(getId(), null, timeStamp, message, new SuccessResultImpl(isUpToDate));
    myListener.onEvent(getBuildId(), event);
    return this;
  }

  @Nonnull
  @Override
  public BuildProgress<BuildProgressDescriptor> fail() {
    return fail(System.currentTimeMillis(), BuildBundle.message("build.status.failed"));
  }

  @Nonnull
  @Override
  public BuildRootProgressImpl fail(long timeStamp, @Nonnull @BuildEventsNls.Message String message) {
    assertStarted();
    FinishBuildEvent event = new FinishBuildEventImpl(getId(), null, timeStamp, message, new FailureResultImpl());
    myListener.onEvent(getBuildId(), event);
    return this;
  }

  @Nonnull
  @Override
  public BuildProgress<BuildProgressDescriptor> cancel() {
    return cancel(System.currentTimeMillis(), BuildBundle.message("build.status.cancelled"));
  }

  @Nonnull
  @Override
  public BuildRootProgressImpl cancel(long timeStamp, @Nonnull String message) {
    assertStarted();
    FinishBuildEventImpl event = new FinishBuildEventImpl(getId(), null, timeStamp, message, new SkippedResultImpl());
    myListener.onEvent(getBuildId(), event);
    return this;
  }
}


text:
export default class blit {
	constructor( canvas, x = 0, y = 0, width = 0, height = 0 ) {
		width = width || canvas.width;
		height = height || canvas.height;
		this.canvas = document.createElement( 'canvas' );
		this.canvas.width = width;
		this.canvas.height = height;
		this.ctx = this.canvas.getContext( '2d' );
		this.ctx.drawImage( canvas, x, y, width, height, 0, 0, width, height );
	}

	getImageData() {
		return this.ctx.getImageData( 0, 0, this.canvas.width, this.canvas.height );
	}
}


text:
module Phrase
  module HashFlattener
    FLATTEN_SEPARATOR = "."
    SEPARATOR_ESCAPE_CHAR = "\001"

    def self.escape_default_separator(key)
      key.to_s.tr(FLATTEN_SEPARATOR, SEPARATOR_ESCAPE_CHAR)
    end

    def self.flatten(hash, escape, previous_key=nil, &block)
      hash.each_pair do |key, value|
        key = escape_default_separator(key) if escape
        current_key = [previous_key, key].compact.join(FLATTEN_SEPARATOR).to_sym
        yield current_key, value
        flatten(value, escape, current_key, &block) if value.is_a?(Hash)
      end
    end
  end
end


text:
title:  Kapahingahan, mga Relasyon, at Pagpapag aling
date:  07/08/2021
---

### Basahin Para sa Pag-aaral sa Linggong Ito
Genesis 42:7–20; Mateo 25:41–46; Genesis 42:21-24; Genesis 45:1–15; Lucas 23:34; Genesis 50:15–21.

>
Talatang Sauluhin

> " 'Ngayon huwag kayong magdalamhati o magalit sa inyong mga sarili sapagkat ako'y ipinagbili ninyo rito; sapagkat sinugo ako ng Diyos na una sa inyo upang magligtas ng buhay?' " (Genesis 45:5).

Inakusahan ang isang lalaki ng sekswal na pang-aabuso sa isang babae. Positibong kinilala niya siya sa isang talaan ng pulisya. Bagaman ang kanyang kasalanan ay naging kuwestiyunable dahil sa ebidensya, matatag ang babae na si "Johnny'' ang may sala.

At kaya napunta si Johnny sa bilangguan, kung saan nabulok siya ng 14 taon para sa isang krimeng hindi niya ginawa. Nang pinawalang-sala siya ng ebidensya ng DNA lamang naunawaan ng babae, si "Joan," ang kanyang nakakikilabot na pagkakamali.

Gusto niyang makatagpo si Johnny pagkatapos na siya'y mapalaya. Ano ang gagawin ng lalaking ito, na nagdusa nang gayon na lamang, kapag siya'y nakipagkita nang harap-harapan sa babaeng sumira ng kanyang buhay sa napakaraming taon?

Nasa isang kuwarto siya, naghihintay sa kanya para dumating. Nang pumasok siya at nagkatinginan sila sa mata, napahagulhol si Joan.

"Sumandal lamang si Johnny at kinuha ang aking mga kamay, at tumingin siya sa akin at sinabing, "Pinatatawad kita." Hindi ako makapaniwala. Narito ang lalaking kinamuhian ko at gusto ko lamang mamatay. At gayunma'y, narito siya, nagsasabi sa akin, na nakagawa sa kanya ng napakalaking kamalian, na pinatawad niya ako? Noon ko lamang napasimulang maunawaan kung ano talaga ang patungkol sa biyaya. At noon lamang ako nagpasimulang gumaling at magkaroon ng tunay na kapahingahan."

Sa linggong ito'y ating titingnan ang pagpapatawad at kung ano ang magagawa nito para sa balisang puso ng tao.


text:
<?php

namespace frontend\modules\product\controllers;

use Yii;
use yii\web\NotFoundHttpException;
//use yii\web\Controller;
use frontend\components\CController;
use common\models\Product;
use common\models\Category;

use yii\data\Pagination;

class DefaultController extends CController
{
    public function actionIndex()
    {
		$listCategory = Category::find()
				->where('parent_id IS NULL')
				->visible()
				->all();

        return $this->render('index', [
			'listCategory' => $listCategory
		]);
    }

	public function actionCategory()
    {
		//http://www.yiiframework.com/doc-2.0/yii-data-pagination.html
		$categorySlug = Yii::$app->getRequest()->getQueryParam('cateslug');

		$category = Category::find()->where('slug = :slug', [':slug' => $categorySlug])->visible()->one();
		if (null === $category) {
            throw new NotFoundHttpException(Yii::t('app', 'Record not found.'));
        }

		//Get all child category
		$categoriesId = [$category->id];
		$categoriesId = array_merge($categoriesId, Category::getListChildId($category->id));

		$query = Product::find()
				->joinWith('categories', false, 'LEFT JOIN')
				->where(['{{%category}}.id' => $categoriesId])
				->orderBy([Product::tableName().'.created_at' => SORT_DESC])
				->visible(0, Product::tableName().'.');

		$countQuery = clone $query;

		$pagination = new Pagination([
			'totalCount' => $countQuery->count(),
			'pageSize' => 10,
		]);

		$products = $query->offset($pagination->offset)
					->limit($pagination->limit)
					->all();

        return $this->render('category', [
			'category' => $category,
			'products' => $products,
			'pagination' => $pagination
		]);
    }

	public function actionDetail()
    {
		$slug = Yii::$app->getRequest()->getQueryParam('slug');

		$product = Product::find()->where('slug = :slug', [':slug' => $slug])->visible()->one();

		if (null === $product) {
            throw new NotFoundHttpException(Yii::t('app', 'Record not found.'));
        }

		$product->getImgList();

        return $this->render('detail', [
			'product' => $product
		]);
    }

	public function actionShoppingCart()
    {
        return $this->render('shopping_cart');
    }
}


text:
==============================================
Storing custom user information in the client.
==============================================

.. index:: object: memcached_st

Manage user specific data

-------
LIBRARY
-------

C Client Library for memcached (libmemcached, -lmemcached)

--------
SYNOPSIS
--------

.. code-block:: c

#include <libmemcached/memcached.h>

.. c:function:: void *memcached_get_user_data (memcached_st *ptr)

.. c:function:: void *memcached_set_user_data (memcached_st *ptr, void *data)

Compile and link with -lmemcached

-----------
DESCRIPTION
-----------

libmemcached(3) allows you to store a pointer to a user specific data inside
the memcached_st structure.

:c:func:`memcached_set_user_data` is used to set the user specific data in the
:c:type:`memcached_st` structure.

:c:func:`memcached_get_user_data` is used to retrieve the user specific data in the :c:type:`memcached_st` structure.

------
RETURN
------

:c:func:`memcached_set_user_data` returns the previous value of the user specific data.

:c:func:`memcached_get_user_data` returns the current value uf the user specific data.

----
HOME
----

To find out more information please check:
`http://libmemcached.org/ <http://libmemcached.org/>`_

--------
SEE ALSO
--------

:manpage:`memcached(1)` :manpage:`libmemcached(3)`


text:
This repository contains the code used for masked language model and unsupervised parsing experiments in
[StructFormer: Joint Unsupervised Induction of Dependency and Constituency Structure from Masked Language Modeling](https://arxiv.org/abs/2012.00857) paper.
If you use this code or our results in your research, we'd appreciate if you cite our paper as following:

```
@misc{shen2020structformer,
      title={StructFormer: Joint Unsupervised Induction of Dependency and Constituency Structure from Masked Language Modeling},
      author={Yikang Shen and Yi Tay and Che Zheng and Dara Bahri and Donald Metzler and Aaron Courville},
      year={2020},
      eprint={2012.00857},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}
```

## Software Requirements
Python 3.6, NLTK and PyTorch 1.5.1 are required for the current codebase.

## Steps

1. Install PyTorch and NLTK

2. Download PTB data. Note that the two tasks, i.e., language modeling and unsupervised parsing share the same model strucutre but require different formats of the PTB data. For language modeling we need the standard 10,000 word  [Penn Treebank corpus](https://github.com/pytorch/examples/tree/75e435f98ab7aaa7f82632d4e633e8e03070e8ac/word_language_model/data/penn) data and for parsing we need [Penn Treebank Parsed](https://catalog.ldc.upenn.edu/LDC99T42) data. The [Penn Treebank Parsed](https://catalog.ldc.upenn.edu/LDC99T42) should be put into NLTK's corpus folder.

3. Scripts and commands, from `google-research/`:

  	+  Train Language Modeling
  	```python -m structformer.main --cuda --pos_emb --save /path/to/your/model --data /path/to/your/ptb/corpus```

  	+ Test Unsupervised Parsing
    ```python -m structformer.test_phrase_grammar --cuda --checkpoint /path/to/your/model --print```

    The default setting in `main.py` achieves a perplexity of approximately `60.9` on PTB test set, unlabeled F1 of approximately `54.0` and unlabeled attachment score of approximately `46.2` on WSJ test set.

## Acknowledgements
Much of our preprocessing and evaluation code is based on the following repository:
- [Ordered Neurons](https://github.com/yikangshen/Ordered-Neurons)


text:
[![CocoaPods](https://img.shields.io/cocoapods/l/Stripe.svg?style=flat)](https://github.com/nohup-atulparmar/payeezy_ios/blob/master/LICENSE)
[![CocoaPods](https://img.shields.io/cocoapods/p/Stripe.svg?style=flat)](https://github.com/nohup-atulparmar/payeezy_ios)

The Payeezy iOS SDK support secure In-App payments via Apple's Apple Pay technology.

# Minimum System requirements
The iOS mobile SDK requires iOS SDK 6 and XCode 5.1 and above

## iOS SDK Integration
We've written a step by step integration [iOS guide](https://github.com/payeezy/payeezy_ios/blob/master/payeezy_ios_guide/apple_pay_quick_start.pdf) that explains everything from installation, to creating payment tokens, to Apple Pay integration and more.

Import framework and follow the guideline

## Feedback
We appreciate the time you take to try out our sample code and welcome your feedback. Here are a few ways to get in touch:
* For generally applicable issues and feedback, create an issue in this repository.
* support@payeezy.com - for personal support at any phase of integration
* [1.855.799.0790](tel:+18557990790)  - for personal support in real time

## Terms of Use

Terms and conditions for using Payeezy IOS SDK: Please see [Payeezy Terms & conditions](https://developer.payeezy.com/terms-use)

### License
The Payeezy IOS SDK is open source and available under the MIT license. See the LICENSE file for more info.


text:
/*global define, $, brackets */
'use strict';

define(function (require, exports) {

    var PreferencesManager = brackets.getModule('preferences/PreferencesManager');
    var CommandManager = brackets.getModule('command/CommandManager');
    var Commands = brackets.getModule('command/Commands');
    var Editor = brackets.getModule('editor/EditorManager');
    var prefs = PreferencesManager.getExtensionPrefs('brackets-nodejs-integration');

    var strings = require('strings');
    var utils = require('../../utils');

    var Debug = function () {
        this._nodeDebuggerDomain = null;
        this._activeLine = 0;
        this._activeDocPath = '';
        this._highlightCm = null;
    };
    exports.create_new = function () {
        return new Debug();
    };

    var nextClickHandler = function (nodeDebuggerDomain) {
        nodeDebuggerDomain.exec('stepNext');
    };

    var inClickHandler = function (nodeDebuggerDomain) {
        nodeDebuggerDomain.exec('stepIn');
    };

    var outClickHandler = function (nodeDebuggerDomain) {
        nodeDebuggerDomain.exec('stepOut');
    };

    var continueClickHandler = function (nodeDebuggerDomain) {
        nodeDebuggerDomain.exec('continue');
    };

    var openActiveDoc = function (that) {
        if (that._activeDocPath && that._activeLine) {
            //NOTE: For some reason the execute promisie doesn't resolve to fail but this workaround will do for now
            try {
                CommandManager.execute(Commands.CMD_OPEN, {
                        fullPath: that._activeDocPath
                    })
                    .then(function () {

                        var ae = Editor.getActiveEditor();
                        //_activeLine = body.sourceLine;
                        //_activeDocPath = docPath;
                        ae.setCursorPos(that._activeLine);
                        //Highlight the line
                        that._highlightCm = ae._codeMirror;
                        that._activeLine = that._highlightCm.addLineClass(that._activeLine, 'node-debugger-highlight-background', 'node-debugger-highlight');
                    }, function () {
                        console.log('[Node Debugger] Failed to open Document: ' + that._activeDocPath);
                    });
            }
            catch (e) {
                console.log('[Node Debugger] Failed to open Document: ' + that._activeDocPath);
            }
        }
    };

    Debug.prototype.init = function (nodeDebuggerDomain, nodeDebuggerPanel) {
        this._nodeDebuggerDomain = nodeDebuggerDomain;
        this.nodeDebuggerPanel = nodeDebuggerPanel;
        //and set the event listener
        debuggerDomainEvents(this);
        var that = this;
        //Add all the standard control elements
        var $activate = $('').addClass('icon activate').attr('title', strings.DEBUGGER_CONNECT_STATUS).html('');
        var $next = $('').addClass('icon inactive step_over_btn').attr('href', '#').attr('title', strings.DEBUGGER_STEP_OVER_TO_NEXT_FUNCTION).html('');
        var $in = $('').addClass('icon inactive').attr('href', '#').attr('title', strings.DEBUGGER_STEP_IN).html('');
        var $out = $('').addClass('icon inactive').attr('href', '#').attr('title', strings.DEBUGGER_STEP_OUT).html('');
        var $continue = $('').addClass('icon inactive continue_btn').attr('href', '#').attr('title', strings.DEBUGGER_CONTINUE).html('');

        var $jumpToBreak = $('').addClass('icon inactive').attr('href', '#').attr('title', strings.DEBUGGER_JUMP_TO_BREAK).html('');

        nodeDebuggerPanel.addControlElement($continue, true, function () {
            continueClickHandler(nodeDebuggerDomain);
        });
        nodeDebuggerPanel.addControlElement($out, true, function () {
            outClickHandler(nodeDebuggerDomain);
        });
        nodeDebuggerPanel.addControlElement($in, true, function () {
            inClickHandler(nodeDebuggerDomain);
        });
        nodeDebuggerPanel.addControlElement($next, true, function () {
            nextClickHandler(nodeDebuggerDomain);
        });
        nodeDebuggerPanel.addControlElement($activate, true, function () {});
        nodeDebuggerPanel.addControlElement($jumpToBreak, false, function () {
            openActiveDoc(that);
        });
    };

    /**
     * Add all the event listener to the Debugger Domain
     **/
    var debuggerDomainEvents = function (that) {
        //If debugger is running again deactive buttons and remove line highlight
        that._nodeDebuggerDomain.on('running', function () {
            that.nodeDebuggerPanel.$logPanel.find('a.active').addClass('inactive').removeClass('active');
            if (that._highlightCm) {
                that._highlightCm.removeLineClass(that._activeLine, 'node-debugger-highlight-background', 'node-debugger-highlight');
                that._highlightCm = null;
                that._activeLine = null;
                that._activeDocPath = null;
            }
        });

        //If the debugger breaks, activate buttons and open the file we break/highlight line
        that._nodeDebuggerDomain.on('break', function (e, body) {
            var docPath = '';
            if (body.script && body.script.name) {
                //Fixme: Just to support windows, however this most likely won't work in every case
                docPath = body.script.name.replace(/\\/g, '/');
            }

            //Make sure the panel is open
            that.nodeDebuggerPanel.panel.show();
            that.nodeDebuggerPanel.$logPanel.find('a.inactive').addClass('active').removeClass('inactive');
            // Clear locals
            that.nodeDebuggerPanel.$debuggerSideBar.find('.brackets-nodejs-integration-debugger-log').remove();

            //Remove old highlight
            if (that._highlightCm) {
                that._highlightCm.removeLineClass(that._activeLine, 'node-debugger-highlight-background', 'node-debugger-highlight');
            }

            //Where is the break?
            that._activeLine = body.sourceLine;
            that._activeDocPath = docPath;
            //Open the document and jump to line
            openActiveDoc(that);
        });

        //If the Debugger connects highlight the UI parts that need to be highlighted
        that._nodeDebuggerDomain.on('connect', function (e, body) {
            that.nodeDebuggerPanel.$debuggerSideBar.find('.brackets-nodejs-integration-debugger-log').remove();
            that.nodeDebuggerPanel.$logPanel.find('.activate').html('');
            if (prefs.get('debugger_break_on_start')) {
                utils.show_popup_message(strings.DEBUGGER_FIRST_BREAK);
            }
            else {
                utils.show_popup_message(strings.DEBUGGER_CONNECTED);
            }

            if (body.running) {
                that.nodeDebuggerPanel.$logPanel.find('a.active').addClass('inactive').removeClass('active');
            }
            else {
                that.nodeDebuggerPanel.$logPanel.find('a.inactive').addClass('active').removeClass('inactive');
            }
        });

        //If the Debugger disconnect remove all the highlights
        that._nodeDebuggerDomain.on('close', function (e, err) {
            var msg = err;
            if (err === 'ECONNREFUSED') {
                msg = 'Could not connect to ' + prefs.get('debugger-host') + ':' + prefs.get('debugger-port');
            }

            if (msg && msg !== 'ECONNRESET') {
                that.nodeDebuggerPanel.log($('').text(msg));
                utils.show_popup_message('Debugger: ' + msg);
            }
            if (err === false) {
                utils.show_popup_message('Debugger: disconnected.');
            }

            //GUI update
            that.nodeDebuggerPanel.$logPanel.find('.activate').html('');
            that.nodeDebuggerPanel.$logPanel.find('a.active').addClass('inactive').removeClass('active');

            //remove highlight
            if (that._highlightCm) {
                that._highlightCm.removeLineClass(that._activeLine, 'node-debugger-highlight-background', 'node-debugger-highlight');
                that._highlightCm = null;
                that._activeLine = null;
            }
        });

        //On evaluate display the result
        that._nodeDebuggerDomain.on('eval', function (e, body) {
            var $wrapper = $('').addClass('wrapper');
            var $output = that.nodeDebuggerPanel.createEvalHTML(body, 0, body.lookup, prefs.get('lookupDepth'));

            $output.appendTo($wrapper);
            that.nodeDebuggerPanel.log($wrapper);
        });

    };

});


text:
CMake HDF5 hello world example
==============================

Example project which demonstrates the use of HDF5 within CMake infrastructure.
Here CMakeLists.txt will attempt to find and link to HDF5 if already installed,
or download, configure, compile, and link HDF5 otherwise.  Licensed under
[BSD-3](../master/LICENSE).


text:
#if !NET45
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace TXTextControl.ReportingCloud
{
    internal static class HttpContentExtension
    {
        internal static async Task<T> ReadAsAsync<T>(this HttpContent content)
        {
            return JsonConvert.DeserializeObject<T>(await content.ReadAsStringAsync());
        }

        internal static Task<HttpResponseMessage> PostAsync(this HttpClient client, string url, object content, JsonMediaTypeFormatter formatter)
        {
            return client.PostAsync(url,
                new StringContent(JsonConvert.SerializeObject(content, formatter.SerializerSettings), Encoding.UTF8, "application/json"));
        }
    }

    internal class JsonMediaTypeFormatter
    {
        internal JsonSerializerSettings SerializerSettings { get; set; }
    }
}
#endif


text:
MAKEFLAGS = --no-print-directory --always-make
MAKE = make $(MAKEFLAGS)

BUILDDIR = ./.build

CLOSUREURL = http://closure-compiler.googlecode.com/files/compiler-latest.zip
CLOSUREDIR = $(BUILDDIR)/closure
CLOSUREFILE = $(CLOSUREDIR)/compiler.jar
YUIURL = http://yui.zenfs.com/releases/yuicompressor/yuicompressor-2.4.7.zip
YUIDIR = $(BUILDDIR)/yui
YUIFILE = $(YUIDIR)/yuicompressor-2.4.7/build/yuicompressor-2.4.7.jar

all:
	$(MAKE) build;
	$(MAKE) add;

demo:
	open ./demo/index.html

add:
	git add .gitignore CHECKLIST.* COPYING.* demo Makefile README.* scripts

push:
	git push --all ; git push --tags ;

edithooks:
	mate .git/hooks/pre-commit

refresh:
	wget -q http://github.com/balupton/jquery-sparkle/raw/master/scripts/resources/core.console.js -O scripts/resources/core.console.js ;
	wget -q http://github.com/balupton/jquery-history/raw/master/demo/styles/generic.css -O demo/styles/generic.css ;

pack:
	cat \
		./scripts/resources/core.console.js \
		./scripts/resources/jquery.history.js \
		> ./scripts/jquery.history.js;

compress:
	java -jar $(CLOSUREFILE) --create_source_map ./scripts/closure.map --js_output_file=./scripts/jquery.history.min.js --js=./scripts/jquery.history.js;

build:
	$(MAKE) pack;
	$(MAKE) compress;

build-update:
	$(MAKE) clean;
	mkdir $(BUILDDIR) $(CLOSUREDIR) $(YUIDIR);
	cd $(CLOSUREDIR); wget $(CLOSUREURL) -O file.zip; tar -xf file.zip;
	cd $(YUIDIR); wget $(YUIURL) -O file.zip; tar -xf file.zip;

clean:
	rm -Rf $(BUILDDIR);