text:
int main()
{
    MODSERIAL* pcSerial = new MODSERIAL(USBTX,USBRX); //dynamic allocation of the serial device

    pcSerial->printf("Alive!\n");

    //Set up a serial communication object
    SerialComm serialComm(pcSerial);

    while(1) {
        if(serialComm.checkIfNewMessage()) {

            int valueInteger = serialComm.getInt();

            float valueFloat = serialComm.getFloat();

            pcSerial->printf("Int:%d, Float:%f\n",valueInteger,valueFloat);

            float valueFloats[NUM_FLOATS];

            serialComm.getFloats(valueFloats,NUM_FLOATS);

            for (int i = 0; i < NUM_FLOATS; i++)
            {
                pcSerial->printf("Val#%d: %f\n",i,valueFloats[i]);
            }
        }
    }

}


text:
import $ from 'jquery';
import 'foundation-sites/js/foundation/foundation';
import 'foundation-sites/js/foundation/foundation.dropdown';
import utils from '@bigcommerce/stencil-utils';
import ProductDetails from '../common/product-details';
import { defaultModal } from './modal';

export default function (context) {
    const modal = defaultModal();

    $('body').on('click', '.quickview', (event) => {
        event.preventDefault();

        const productId = $(event.currentTarget).data('product-id');

        modal.open({ size: 'large' });

        utils.api.product.getById(productId, { template: 'products/quick-view' }, (err, response) => {
            modal.updateContent(response);

            modal.$content.find('.productView').addClass('productView--quickView');

            return new ProductDetails(modal.$content.find('.quickView'), context);

        });

        setTimeout(function () {
            $('.productView-options').css('height', 'auto');
            $('.productView-options').css('opacity', 1);
        }, 5000);

    });
}

redpajama_set_name: RedPajamaGithub


text:
package com.sleepycat.je.sync;

/**
 * Provides custom conversion between local field/property values and external
 * field/column values.
 */
public interface FieldConverter {

    /**
     * Converts a external field/column value to a local field/property value,
     * or returns fromValue unchanged if no custom conversion is needed.
     */
    Object externalToLocal(Object fromValue,
                           Class toClass,
                           String localFieldName,
                           String externalFieldName);

    /**
     * Converts a local field/property value to a external field/column value,
     * or returns fromValue unchanged if no custom conversion is needed.
     */
    Object localToExternal(Object fromValue,
                           Class toClass,
                           String localFieldName,
                           String externalFieldName);
}


text:
package org.apache.flink.runtime.scheduler.adaptive;

import org.apache.flink.core.testutils.FlinkMatchers;
import org.apache.flink.core.testutils.OneShotLatch;
import org.apache.flink.testutils.executor.TestExecutorResource;
import org.apache.flink.util.TestLogger;

import org.hamcrest.Matchers;
import org.junit.ClassRule;
import org.junit.Test;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

/** Tests for the {@link BackgroundTask}. */
public class BackgroundTaskTest extends TestLogger {

    @ClassRule
    public static final TestExecutorResource<ExecutorService> TEST_EXECUTOR_RESOURCE =
            new TestExecutorResource<>(() -> Executors.newFixedThreadPool(2));

    @Test
    public void testFinishedBackgroundTaskIsTerminated() {
        final BackgroundTask<Void> finishedBackgroundTask = BackgroundTask.finishedBackgroundTask();

        assertTrue(finishedBackgroundTask.getTerminationFuture().isDone());
        finishedBackgroundTask.getTerminationFuture().join();
    }

    @Test
    public void testFinishedBackgroundTaskDoesNotContainAResult() {
        final BackgroundTask<Void> finishedBackgroundTask = BackgroundTask.finishedBackgroundTask();

        assertTrue(finishedBackgroundTask.getResultFuture().isCompletedExceptionally());
    }

    @Test
    public void testNormalCompletionOfBackgroundTask() {
        final String expectedValue = "foobar";
        final BackgroundTask<String> backgroundTask =
                BackgroundTask.finishedBackgroundTask()
                        .runAfter(() -> expectedValue, TEST_EXECUTOR_RESOURCE.getExecutor());

        assertThat(backgroundTask.getResultFuture().join(), Matchers.is(expectedValue));
        // check that the termination future has completed normally
        backgroundTask.getTerminationFuture().join();
    }

    @Test
    public void testExceptionalCompletionOfBackgroundTask() throws InterruptedException {
        final Exception expectedException = new Exception("Test exception");
        final BackgroundTask<String> backgroundTask =
                BackgroundTask.finishedBackgroundTask()
                        .runAfter(
                                () -> {
                                    throw expectedException;
                                },
                                TEST_EXECUTOR_RESOURCE.getExecutor());

        try {
            backgroundTask.getResultFuture().get();
            fail("Expected an exceptionally completed result future.");
        } catch (ExecutionException ee) {
            assertThat(ee, FlinkMatchers.containsCause(expectedException));
        }
        // check that the termination future has completed normally
        backgroundTask.getTerminationFuture().join();
    }

    @Test
    public void testRunAfterExecutesBackgroundTaskAfterPreviousHasCompleted() {
        final OneShotLatch blockingLatch = new OneShotLatch();
        final BlockingQueue<Integer> taskCompletions = new ArrayBlockingQueue<>(2);
        final BackgroundTask<Void> backgroundTask =
                BackgroundTask.initialBackgroundTask(
                                () -> {
                                    blockingLatch.await();
                                    taskCompletions.offer(1);
                                    return null;
                                },
                                TEST_EXECUTOR_RESOURCE.getExecutor())
                        .runAfter(
                                () -> {
                                    taskCompletions.offer(2);
                                    return null;
                                },
                                TEST_EXECUTOR_RESOURCE.getExecutor());

        blockingLatch.trigger();

        backgroundTask.getTerminationFuture().join();

        assertThat(taskCompletions, Matchers.contains(1, 2));
    }

    @Test
    public void testAbortSkipsTasksWhichHaveNotBeenStarted() {
        final OneShotLatch blockingLatch = new OneShotLatch();
        final BlockingQueue<Integer> taskCompletions = new ArrayBlockingQueue<>(2);
        final BackgroundTask<Void> backgroundTask =
                BackgroundTask.initialBackgroundTask(
                                () -> {
                                    blockingLatch.await();
                                    taskCompletions.offer(1);
                                    return null;
                                },
                                TEST_EXECUTOR_RESOURCE.getExecutor())
                        .runAfter(
                                () -> {
                                    taskCompletions.offer(2);
                                    return null;
                                },
                                TEST_EXECUTOR_RESOURCE.getExecutor());

        final BackgroundTask<Void> finalTask =
                backgroundTask.runAfter(
                        () -> {
                            taskCompletions.offer(3);
                            return null;
                        },
                        TEST_EXECUTOR_RESOURCE.getExecutor());

        backgroundTask.abort();

        blockingLatch.trigger();

        finalTask.getTerminationFuture().join();

        assertThat(taskCompletions, Matchers.contains(1, 3));
    }
}


text:
/*==============================================================*/
/* Table: channel                                               */
/*==============================================================*/
create table channel
(
   channel_id           tinyint unsigned not null auto_increment,
   name                 char(20) not null,
   host                 char(30) not null,
   port                 smallint unsigned not null,
   login                char(20) not null,
   password             char(30) not null,
   bind_type            char(3) not null,
   bind_ton             tinyint unsigned not null,
   bind_npi             tinyint unsigned not null,
   source_addr_ton      tinyint unsigned not null,
   source_addr_npi      tinyint unsigned not null,
   dest_addr_ton        tinyint unsigned not null,
   dest_addr_npi        tinyint unsigned not null,
   send_speed           smallint not null,
   check_speed          smallint not null,
   enabled              boolean not null,
   primary key (channel_id),
   unique key AK_Unique_Channel_Key (login, host, port)
);

/*==============================================================*/
/* Index: Channel_Index                                         */
/*==============================================================*/
create index Channel_Index on channel
(
   host
);

/*==============================================================*/
/* Table: channel2sender                                        */
/*==============================================================*/
create table channel2sender
(
   channel_id           tinyint unsigned not null,
   sender_id            smallint unsigned not null,
   primary key (channel_id, sender_id)
);

/*==============================================================*/
/* Table: sender                                                */
/*==============================================================*/
create table sender
(
   sender_id            smallint unsigned not null auto_increment,
   sign                 char(15) not null,
   primary key (sender_id),
   unique key AK_Unique_Sender_Sign_Key (sign)
);

/*==============================================================*/
/* Index: Sender_Index                                          */
/*==============================================================*/
create index Sender_Index on sender
(
   sign
);

/*==============================================================*/
/* Table: sms                                                   */
/*==============================================================*/
create table sms
(
   server_id            integer unsigned not null,
   phone                char(20) not null,
   sender_id            smallint unsigned,
   sender_sign          char(15),
   channel_id           tinyint unsigned,
   sms_text             char(160) not null,
   sms_group_id         integer unsigned not null,
   sms_group_count      tinyint unsigned not null,
   sms_group_index      tinyint unsigned not null,
   status               tinyint not null,
   user_id              smallint unsigned not null,
   smsclient_id         integer not null,
   date_client          datetime not null,
   date_server          datetime not null,
   last_updated_date    datetime not null,
   smsc_id              char(65),
   informed             boolean not null default 1,
   version              smallint unsigned not null default 0,
   primary key (server_id)
);

/*==============================================================*/
/* Index: SMS_Status_User_Index                                 */
/*==============================================================*/
create index SMS_Status_User_Index on sms
(
   status,
   user_id
);

/*==============================================================*/
/* Index: SMS_Date_Index                                        */
/*==============================================================*/
create index SMS_Date_Index on sms
(
   date_client
);

/*==============================================================*/
/* Index: SMS_Smsc_Index                                        */
/*==============================================================*/
create index SMS_Smsc_Index on sms
(
   smsc_id
);

/*==============================================================*/
/* Index: SMS_Status_Channel_Index                              */
/*==============================================================*/
create index SMS_Status_Channel_Index on sms
(
   status,
   channel_id
);

/*==============================================================*/
/* Table: user                                                  */
/*==============================================================*/
create table user
(
   user_id              smallint unsigned not null auto_increment,
   name                 char(10) not null,
   password             char(128) not null,
   allowed_ip           char(15),
   description          char(200) not null,
   created_on           datetime not null,
   last_login           datetime null,
   error_count          tinyint not null default 0,
   enabled              boolean not null default 1,
   primary key (user_id),
   unique key AK_Unique_User_Name_Key (name)
);

/*==============================================================*/
/* Index: User_Index                                            */
/*==============================================================*/
create unique index User_Index on user
(
   name,
   password
);

/*==============================================================*/
/* Table: user2sender                                           */
/*==============================================================*/
create table user2sender
(
   user_id              smallint unsigned not null,
   sender_id            smallint unsigned not null,
   primary key (user_id, sender_id)
);

alter table channel2sender add constraint FK_Channel_ID foreign key (channel_id)
      references channel (channel_id) on delete restrict on update restrict;

alter table channel2sender add constraint FK_Sender_ID2 foreign key (sender_id)
      references sender (sender_id) on delete restrict on update restrict;

alter table sms add constraint FK_SMS2Channel_ID foreign key (channel_id)
      references channel (channel_id) on delete restrict on update restrict;

alter table sms add constraint FK_SMS2Sender_ID foreign key (sender_id)
      references sender (sender_id) on delete restrict on update restrict;

alter table sms add constraint FK_SMS2User_ID foreign key (user_id)
      references user (user_id) on delete restrict on update restrict;

alter table user2sender add constraint FK_Sender_ID foreign key (sender_id)
      references sender (sender_id) on delete restrict on update restrict;

alter table user2sender add constraint FK_User_ID foreign key (user_id)
      references user (user_id) on delete restrict on update restrict;


text:
package pubme.interfaces;

import pubme.model.Pub;

import java.util.List;

public interface IGeneratorService {
    Pub generateRandomPub();

    List<Pub> generateRandomPubs(int number);
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="Hello">Hello World, Click Me!</string>
    <string name="ApplicationName">SwipeableCardStackDemoApp</string>
</resources>


text:
{%- if .app.settings.use_fontawesome.bool and .libs['moya.fontawesome'] %}
{% include "widgets/editor-fa.html" %}
{%- else %}
{% include "widgets/editor-basic.html" %}
{%- endif %}


text:
_Released 08/21/2015_

**Features:**

- Reporters in CI can now be specified.
- Added `teamcity` reporter.


text:
<?xml version="1.0" encoding="UTF-8"?>
<database xmlns="http://nouveau.freedesktop.org/"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://nouveau.freedesktop.org/ rules-ng.xsd">
<import file="copyright.xml"/>

<import file="nvchipsets.xml" />

<domain name="NV_MMIO" bare="yes" prefix="chipset">

<array name="PVPE" offset="0xb000" stride="0x100" length="1" variants="NV40:NV98 NVA0">
	<reg32 offset="0x070" name="UNK070"/> <!-- RO 101 -->
	<reg32 offset="0x074" name="UNK074"/> <!-- 40404040/ffffffff -->
</array>

<bitset name="pvpe_dma" inline="yes">
	<bitfield low="0" high="15" name="INSTANCE"/>
	<bitfield pos="31" name="VALID"/>
</bitset>

</domain>

</database>


text:
using namespace android;

namespace {

const char* const kClassPathName = "android/net/http/CertificateChainValidator";

// Convert X509 chain to DER format bytes.
jobjectArray GetCertificateByteArray(
    JNIEnv* env,
    const std::vector<std::string> cert_chain) {
  size_t count = cert_chain.size();
  DCHECK_GT(count, 0U);
  // TODO(joth): See if we can centrally cache common classes like this, e.g.
  // as JniConstants does.
  jclass byte_array_class = env->FindClass("[B");
  jobjectArray joa = env->NewObjectArray(count, byte_array_class, NULL);
  if (joa == NULL)
    return NULL;

  for (size_t i = 0; i < count; ++i) {
    size_t len = cert_chain[i].length();

    jbyteArray byte_array = env->NewByteArray(len);
    if (!byte_array) {
      env->DeleteLocalRef(joa);
      return NULL;
    }

    jbyte* bytes = env->GetByteArrayElements(byte_array, NULL);
    DCHECK(bytes);
    size_t copied = cert_chain[i].copy(reinterpret_cast<char*>(bytes), len);
    DCHECK_EQ(copied, len);
    env->ReleaseByteArrayElements(byte_array, bytes, 0);
    env->SetObjectArrayElement(joa, i, byte_array);
    env->DeleteLocalRef(byte_array);
  }
  return joa;
}

}  // namespace

AndroidNetworkLibraryImpl::VerifyResult
    AndroidNetworkLibraryImpl::VerifyX509CertChain(
        const std::vector<std::string>& cert_chain,
        const std::string& hostname,
        const std::string& auth_type) {
  if (!cert_verifier_class_)
    return VERIFY_INVOCATION_ERROR;

  JNIEnv* env = jni::GetJNIEnv();
  DCHECK(env);

  static jmethodID verify_fn = env->GetStaticMethodID(
      cert_verifier_class_, "verifyServerCertificates",
      "([[BLjava/lang/String;Ljava/lang/String;)Landroid/net/http/SslError;");
  if (jni::CheckException(env)) {
    LOG(ERROR) << "verifyServerCertificates method not found; skipping";
    return VERIFY_INVOCATION_ERROR;
  }
  DCHECK(verify_fn);

  jobjectArray chain_byte_array = GetCertificateByteArray(env, cert_chain);
  if (!chain_byte_array)
    return VERIFY_INVOCATION_ERROR;

  jstring host_string = jni::ConvertUTF8ToJavaString(env, hostname);
  DCHECK(host_string);
  jstring auth_string = jni::ConvertUTF8ToJavaString(env, auth_type);
  DCHECK(auth_string);

  jobject error = env->CallStaticObjectMethod(cert_verifier_class_, verify_fn,
                                              chain_byte_array, host_string,
                                              auth_string);
  env->DeleteLocalRef(chain_byte_array);
  env->DeleteLocalRef(host_string);
  env->DeleteLocalRef(auth_string);

  VerifyResult result = VERIFY_INVOCATION_ERROR;
  if (!jni::CheckException(env)) {
    if (!error) {
      result = VERIFY_OK;
    } else {
      jclass error_class = env->GetObjectClass(error);
      DCHECK(error_class);
      static jmethodID error_fn = env->GetMethodID(error_class,
                                                   "getPrimaryError", "()I");
      if (error_fn) {
        int code = env->CallIntMethod(error, error_fn);
        if (!jni::CheckException(env)) {
          if (code == 2) {  // SSL_IDMISMATCH == 2
            result = VERIFY_BAD_HOSTNAME;
          } else if (code == 3) {  // SSL_UNTRUSTED == 3
            result = VERIFY_NO_TRUSTED_ROOT;
          }
        }
      }
      env->DeleteLocalRef(error);
    }
  } else {
    // an uncaught exception has happened in java code, clear it and return
    // a proper error
    env->ExceptionClear();
    result = VERIFY_INVOCATION_ERROR;
  }
  // TODO(joth): This balances the GetJNIEnv call; we need to detach as
  // currently this method is called in chrome from a worker pool thread that
  // may shutdown at anytime. However this assumption should not be baked in
  // here: another user of the function may not want to have their thread
  // detached at this point.
  jni::DetachFromVM();
  return result;
}

// static
void AndroidNetworkLibraryImpl::InitWithApplicationContext(JNIEnv* env,
                                                           jobject context) {
  // Currently ignoring |context| as it is not needed (but remains in signature
  // for API consistency with the equivalent method on class AndroidOS).
  if (!net::AndroidNetworkLibrary::GetSharedInstance())
    net::AndroidNetworkLibrary::RegisterSharedInstance(
        new AndroidNetworkLibraryImpl(env));
}

AndroidNetworkLibraryImpl::AndroidNetworkLibraryImpl(JNIEnv* env)
    : cert_verifier_class_(NULL) {
  jclass cls = env->FindClass(kClassPathName);
  if (jni::CheckException(env) || !cls) {
      NOTREACHED() << "Unable to load class " << kClassPathName;
  } else {
    cert_verifier_class_ = static_cast<jclass>(env->NewGlobalRef(cls));
    env->DeleteLocalRef(cls);
  }
}

AndroidNetworkLibraryImpl::~AndroidNetworkLibraryImpl() {
  if (cert_verifier_class_)
    jni::GetJNIEnv()->DeleteGlobalRef(cert_verifier_class_);
}


text:
Synonym is an attempt to create a database connection tool that will allow connections to various database types. The first databases to be supported will be Postgres, MySQL, and REDIS.

#### Toggle Chrome DevTools

- OS X: Cmd Alt I or F12
- Linux: Ctrl Shift I or F12
- Windows: Ctrl Shift I or F12

- see [electron-debug](https://github.com/sindresorhus/electron-debug) for more detail information.

#### Toggle Redux DevTools

Ctrl+H

- see [redux-devtools-dock-monitor](https://github.com/gaearon/redux-devtools-dock-monitor) for more detail information.

## Package

```bash
npm run package
```

#### Options

- --name, -n: Application name (default: Synonym)
- --version, -v: Electron version (default: latest version)
- --asar, -a: [asar](https://github.com/atom/asar) support (default: false)
- --icon, -i: Application icon
- --all: pack for all platforms

Use `electron-packager` to pack your app with `--all` options for darwin (osx), linux and win32 (windows) platform. After build, you will find them in `release` folder. Otherwise, you will only find one for your os.

`test`, `tools`, `release` folder and devDependencies in `package.json` will be ignored by default.


text:
cipher_context_t context;
uint8_t key[AES_KEY_SIZE+1] = "testtesttesttest";
uint8_t pblock_aes[AES_BLOCK_SIZE+1] = "  !testtesttest!";
uint8_t cblock_aes[AES_BLOCK_SIZE+1] = "testtesttesttest";
uint8_t rpblock_aes[AES_BLOCK_SIZE+1] = "  !testtesttest!";

static inline void printAES(void){
  DEBUG("AES DONE\n\r");
  DEBUG("Text: %s\n\r", pblock_aes);
  DEBUG("CText: \n\r");
  int i;
  for (i=0; i< AES_BLOCK_SIZE; i++){
    DEBUG("%x", cblock_aes[i]);
  }
  DEBUG("\n\r");
  DEBUG("Text: %s\n\r", rpblock_aes);
  if(!memcmp(pblock_aes, rpblock_aes, AES_BLOCK_SIZE)){
    DEBUG("AES SUCCESS\n\r");
  }else{
    DEBUG("AES FAILED\n\r");
  }
}

void updateAES(int i){
  pblock_aes[0] = getValidASCII((uint8_t)(i>>8));
  pblock_aes[1] = getValidASCII((uint8_t)i);
}

int setupAES(void){
  aes_init (&context, key, AES_KEY_SIZE);
#ifdef CONTIKI
  aes_128_set_padded_key(key, AES_KEY_SIZE);
#endif
}

void testAES(int i){
#ifdef SIGNAL
  signalHigh();
#endif
#ifdef TESTLPM
  __delay_cycles(12500);
#endif
#ifdef SIGNAL
  signalLow();
#endif
  updateAES(i);
#ifdef SIGNAL
  signalHigh();
#endif
  aes_encrypt(&context, pblock_aes, cblock_aes);
#ifdef SIGNAL
  signalLow();
  signalHigh();
#endif
  aes_decrypt(&context, cblock_aes, rpblock_aes);
#ifdef SIGNAL
  signalLow();
#endif
  printAES();
#ifdef CONTIKI
#ifdef SIGNAL
  signalHigh();
#endif
  memcpy(cblock_aes, pblock_aes, AES_BLOCK_SIZE);
  aes_128_padded_encrypt(cblock_aes,AES_BLOCK_SIZE);
#ifdef SIGNAL
  signalLow();
  signalHigh();
#endif
  memcpy(rpblock_aes, cblock_aes, AES_BLOCK_SIZE);
  aes_128_padded_encrypt(rpblock_aes,AES_BLOCK_SIZE);
#ifdef SIGNAL
  signalLow();
#endif
  printAES();
#endif
}


text:
#include "polycode/core/PolyTimer.h"
#include "polycode/core/PolyCoreServices.h"
#include "polycode/core/PolyTimerManager.h"
#include "polycode/core/PolyEvent.h"

using namespace Polycode;

Timer::Timer(bool triggerMode, int msecs) : EventDispatcher() {
	this->msecs = msecs;
	this->triggerMode = triggerMode;
	paused = false;
	Reset();
	CoreServices::getInstance()->getTimerManager()->addTimer(this);
}

void Timer::setTimerInterval(int msecs) {
	this->msecs = msecs;
}

Timer::~Timer() {
	CoreServices::getInstance()->getTimerManager()->removeTimer(this);
}

void Timer::Reset() {
	ticks = 0;
	last = 0;
	elapsed = 0;
}

unsigned int Timer::getTicks() {
	return ticks;
}

void Timer::Pause(bool paused) {
	last = ticks;
	elapsed = 0;
	this->paused = paused;
}

Number Timer::getElapsedf() {
	return ((Number)(elapsed))/1000.0f;
}

bool Timer::isPaused() {
	return paused;
}

bool Timer::hasElapsed() {
	if(ticks-last > msecs) {
		last = ticks;
		return true;
	}
	return false;
}

void Timer::Update(unsigned int ticks) {
	if(last == 0) {
		last = ticks;
		return;
	}

	this->ticks = ticks;
	elapsed = ticks-last;

	if(paused)
		return;

	if(triggerMode) {
		if(elapsed > msecs) {
			last = ticks;
			this->dispatchEvent(new Event(), EVENT_TRIGGER);
		} else {
		}
	}
}


text:
<?php
/**
 * The Header for our theme.
 *
 * Displays all of the  section and everything up till the page content starts
 *
 * @package WordPress
 * @subpackage Vegetarianized
 * @since Vegetarianized 1.0
 */
?><!DOCTYPE html>

<html <?php language_attributes(); ?>>

    <meta charset="<?php bloginfo( 'charset' ); ?>" />
    <meta name="viewport" content="width=device-width" />
    <title><?php bloginfo('name'); ?> | <?php is_home() ? bloginfo('description') : wp_title(''); ?></title>
    <link rel="profile" href="http://gmpg.org/xfn/11" />
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    <link rel="icon" type="image/png" href="<?php echo esc_url( home_url( '/' ) ); ?>/apple-touch-icon.png" />
    <link rel="shortcut icon" href="http://www.vegetarianized.com/favicon.ico?v=2" />

    <?php wp_head(); ?>

<body <?php body_class(); ?>>

<?php
global $brand_name;
$logo_image =  get_template_directory_uri()."/images/vegetarianized_logo_".$brand_name.".png";
$logo_print_image =  get_template_directory_uri()."/images/vegetarianized_logo_".$brand_name."_print.png";
?>

<object type="image/svg+xml" width="192" height="32" data="<?php echo $logo_print_image ?>">Your browser does not support SVG</object>

<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php echo $logo_image ?>" />

<?php echo do_shortcode("[shareaholic app='follow_buttons' id='7527394']"); ?>

                <?php
                    $about_page = get_page_by_title('About');
                    $about_page_link = get_permalink($about_page->ID);
                ?><a href="<?php echo $about_page_link ?>">About

                <?php
                    $press_page = get_page_by_title('Press');
                    $press_page_link = get_permalink($press_page->ID);
                ?><a href="<?php echo $press_page_link ?>">Press

                <?php
                    $why_page = get_page_by_title('Why');
                    $why_page_link = get_permalink($why_page->ID);
                ?><a href="<?php echo $why_page_link ?>">Why

                Subscribe

                Search

                    <?php get_search_form(); ?>

                Recipes

                        <?php wp_list_categories('show_count=1&title_li=&exclude=1'); ?>


text:
This is a Library cookbook that provides github_hook provider.

Github hook provider can manage any service hook that is available via the
github api.

# Requirements

## Platform:
Should work on all platforms that omni chef works on. The only dep is the octokit Gem

# Attributes
`node[:github][:api][:gem][:version]` - controll the version of octokit gem to install

# Recipes
there is only a blank `default` recipe that does nothing

# Resources

* [github_hook](#github_hook)

## github_hook

This manages github hooks via github api with octokit

### Attribute Parameters

- oauth_token: Github api authentication token
- hook_name: the name of the service hook: "web", "irc" etc
- register_events: The github hook api events to register too defait Defaults to ["push"].
- config: a hash of config options for this service hook
- org: the github org name to use on api calls
- repo: the repo name
- user: The github user to use for api calls
- password: Github users password.
- active: enable/disable the hook exspects true/false Defaults to true.

### Examples

    # heres an example that would trigger on push and pull requests
    # the resourcce name is parsed into org, repo, hook_name
    #   org  = spheromak
    #   user = spheromak
    #   repo = rawr_cook
    #
    # here I use oauth token, but you could use password if you wish
    #
    # register_events is documented more in the github api, but its
    # pretty straight forward
    github_hook "spheromak/rawr_cook/web" do
      config { :url => "http://google.com/dosomething" }
      oauth_token "123x098190y283901283"
      register_events %w{ push pull_request }
    end

# License and Maintainer

Maintainer:: Jesse Nelson (<spheromak@gmail.com>)

License:: APL2


text:
var lib = require('../../lib')

module.exports = {
  maxCLIArgs: 0,
  pultModuleDeps: [],
  pultModuleConflicts: [ 'spa' ],
  get: function get (vfs, baseConfig, moduleArgs) {

    var serverConfig = lib.clone(baseConfig.server)

    serverConfig.routerPipeline.unshift('./marko.js')

    var config = {
      package: {
        scripts: Object.assign({}, baseConfig.package.scripts, {
          watch: "./node_modules/.bin/browser-refresh server/index.js"
        })
      },
      dependencies: {
        "less": "^2.7",
        "lasso": "^2.11",
        "lasso-marko": "^2.3",
        "lasso-less": "^2.1",
        "marko": "^4.2",
        "marko-magic": "Concatapult/marko-magic",
        "browser-refresh-taglib": "*",
      },
      devDependencies: {
        "browser-refresh": "^1.7.0",
      },
      server: serverConfig,
    }

    config.installs = Object.keys(config.dependencies)

    // git ignore generated files
    var gitignorePath = baseConfig.projectRoot + '/.gitignore'
    var gitignore     = vfs.read(gitignorePath)
    vfs.write(gitignorePath, gitignore + gitIgnoreAdditions)

    return config
  }
}

var gitIgnoreAdditions = `
*.marko.js
.cache/
client/public/static/
client/pages/*/index.js
client/pages/*/index.browser.js
client/components/*/index.js
client/components/*/index.browser.js
`


text:
package aima.gui.fx.applications.search;

import aima.core.environment.nqueens.NQueensBoard;
import aima.core.environment.nqueens.NQueensBoard.Config;
import aima.core.environment.nqueens.NQueensFunctions;
import aima.core.search.framework.Metrics;
import aima.core.search.framework.qsearch.GraphSearch;
import aima.core.search.framework.qsearch.TreeSearch;
import aima.core.search.informed.AStarSearch;
import aima.core.search.informed.GreedyBestFirstSearch;
import aima.core.search.uninformed.BreadthFirstSearch;
import aima.core.search.uninformed.DepthFirstSearch;
import aima.core.search.uninformed.IterativeDeepeningSearch;
import aima.gui.fx.framework.IntegrableApplication;
import aima.gui.fx.framework.Parameter;
import aima.gui.fx.framework.SimulationPaneBuilder;
import aima.gui.fx.framework.SimulationPaneCtrl;
import aima.gui.fx.views.NQueensViewCtrl;
import javafx.application.Platform;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.Pane;
import javafx.scene.layout.StackPane;

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

/**
 * Integrable application which demonstrates how different search strategies
 * solve the N-Queens problem.
 *
 * @author Ruediger Lunde
 *
 */
public class NQueensSearchApp extends IntegrableApplication {

	public static void main(String[] args) {
		launch(args);
	}

	private final static String PARAM_STRATEGY = "strategy";
	private final static String PARAM_BOARD_SIZE = "boardSize";
	private final static String PARAM_INIT_CONFIG = "initConfig";

	private NQueensViewCtrl stateViewCtrl;
	private SimulationPaneCtrl simPaneCtrl;
	private NQueensSearchDemo experiment;

	public NQueensSearchApp() {
		experiment = new NQueensSearchDemo();
		experiment.addProgressTracker(this::updateStateView);
	}

	@Override
	public String getTitle() {
		return "N-Queens Search App";
	}

	/**
	 * Defines state view, parameters, and call-back functions and calls the
	 * simulation pane builder to create layout and controller objects.
	 */
	@Override
	public Pane createRootPane() {
		BorderPane root = new BorderPane();

		StackPane stateView = new StackPane();
		stateViewCtrl = new NQueensViewCtrl(stateView);

		List<Parameter> params = createParameters();

		SimulationPaneBuilder builder = new SimulationPaneBuilder();
		builder.defineParameters(params);
		builder.defineStateView(stateView);
		builder.defineInitMethod(this::initialize);
		builder.defineSimMethod(this::simulate);
		simPaneCtrl = builder.getResultFor(root);
		simPaneCtrl.setParam(SimulationPaneCtrl.PARAM_SIM_SPEED, 1);

		return root;
	}

	protected List<Parameter> createParameters() {
		Parameter p1 = new Parameter(PARAM_STRATEGY,
				"Depth-First Search (incremental)", "Breadth-First Search (incremental)",
				"Iterative Deepening Search",
				"Greedy Best-First Search (attacking pair heuristic)", "A* search (attacking pair heuristic)",
				"Hill Climbing", "Simulated Annealing", "Genetic Algorithm");
		Parameter p2 = new Parameter(PARAM_BOARD_SIZE, 4, 8, 16, 32, 64);
		p2.setDefaultValueIndex(1);
		Parameter p3 = new Parameter(PARAM_INIT_CONFIG, "FirstRow", "Random");
		p3.setDependency(PARAM_STRATEGY, "Iterative Deepening Search",
				"Greedy Best-First Search (attacking pair heuristic)", "A* search (attacking pair heuristic)",
				"Hill Climbing", "Simulated Annealing", "Genetic Algorithm");
		return Arrays.asList(p1, p2, p3);
	}

	/** Displays the initialized board on the state view. */
	@Override
	public void initialize() {
		experiment.setBoardSize(simPaneCtrl.getParamAsInt(PARAM_BOARD_SIZE));
		Object strategy = simPaneCtrl.getParamValue(PARAM_STRATEGY);
		Config config;
		//noinspection SuspiciousMethodCalls
		if (Arrays.asList("Depth-First Search (incremental)", "Breadth-First Search (incremental)", "Genetic Algorithm")
                .contains(strategy))
			config = Config.EMPTY;
		else if (simPaneCtrl.getParamValue(PARAM_INIT_CONFIG).equals("Random"))
			config = Config.QUEEN_IN_EVERY_COL;
		else
			config = Config.QUEENS_IN_FIRST_ROW;
		experiment.initExperiment(config);
		stateViewCtrl.update(experiment.getBoard());
	}

	@Override
	public void cleanup() {
		simPaneCtrl.cancelSimulation();
	}

	/** Starts the experiment. */
	public void simulate() {
		Object strategy = simPaneCtrl.getParamValue(PARAM_STRATEGY);
		if (strategy.equals("Depth-First Search (incremental)"))
			experiment.startExperiment(new DepthFirstSearch<>(new TreeSearch<>()));
		else if (strategy.equals("Breadth-First Search (incremental)"))
			experiment.startExperiment(new BreadthFirstSearch<>(new TreeSearch<>()));
		else if (strategy.equals("Iterative Deepening Search"))
			experiment.startExperiment(new IterativeDeepeningSearch<>());
		else if (strategy.equals("Greedy Best-First Search (attacking pair heuristic)"))
			experiment.startExperiment(new GreedyBestFirstSearch<>(new GraphSearch<>(),
					NQueensFunctions.createAttackingPairsHeuristicFunction()));
        else if (strategy.equals("A* search (attacking pair heuristic)"))
            experiment.startExperiment(new AStarSearch<>(new GraphSearch<>(),
					NQueensFunctions.createAttackingPairsHeuristicFunction()));
		else if (strategy.equals("Hill Climbing"))
			experiment.startHillClimbingExperiment();
		else if (strategy.equals("Simulated Annealing"))
			experiment.startSimulatedAnnealingExperiment();
		else if (strategy.equals("Genetic Algorithm"))
			experiment.startGenAlgoExperiment(simPaneCtrl.getParamValue(PARAM_INIT_CONFIG).equals("Random"));
	}

	/**
	 * Caution: While the background thread should be slowed down, updates of
	 * the GUI have to be done in the GUI thread!
	 */
	private void updateStateView(NQueensBoard board, Metrics metrics) {
		Platform.runLater(() -> updateStateViewLater(board, metrics));
		simPaneCtrl.waitAfterStep();
	}

	/**
	 * Must be called by the GUI thread!
	 */
	private void updateStateViewLater(NQueensBoard board, Metrics metrics) {
		stateViewCtrl.update(board);
		simPaneCtrl.setStatus(metrics.toString());
	}
}


text:
#ifndef MARACLUSTER_PVALUECALCULATOR_H_
#define MARACLUSTER_PVALUECALCULATOR_H_

/**
This file provides functions for calculating pvalues using dynamic programming
Adapted from https://code.google.com/p/in-silico-mass-fingerprinting/
*/
#include <vector>
#include <map>
#include <string>

#include <cmath>
#include <algorithm>
#include <numeric>

#include <iostream>
#include <sstream>

#include <cassert>
#include <cstdlib>
#include <stdexcept>

#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>

#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/lu.hpp>

namespace maracluster {

class PvalueCalculator {
 public:
  static unsigned int probDiscretizationLevels_;
  static const unsigned int kPolyfitDegree = 5u;
  static const double kMinProb, kMaxProb;
  static const unsigned int kMaxScoringPeaks = 40u;
  static unsigned int kMinScoringPeaks;
  static const bool kVariableScoringPeaks;

  PvalueCalculator() : maxScore_(0u) {}
  inline unsigned int getNumScoringPeaks() const { return peakBins_.size(); }

  // prevents ODR usage of kMaxScoringPeaks: http://en.cppreference.com/w/cpp/language/definition#ODR-use
  static unsigned int getMaxScoringPeaksConstant() {
    return kMaxScoringPeaks;
  }

  static unsigned int getMaxScoringPeaks(double mass) {
    unsigned int maxScoringPeaks = getMaxScoringPeaksConstant();
    if (kVariableScoringPeaks) {
      return std::min(maxScoringPeaks, static_cast<unsigned int>(mass / 50.0));
    } else {
      return maxScoringPeaks;
    }
  }

  static unsigned int getMinScoringPeaks(double mass) {
    if (kVariableScoringPeaks) {
      return std::min(kMinScoringPeaks, static_cast<unsigned int>(mass / 50.0));
    } else {
      return kMinScoringPeaks;
    }
  }

  inline void setPeakBins(std::vector<unsigned int>& peakBins) {
    peakBins_.swap(peakBins);
  }
  void initPolyfit(std::vector<unsigned int>& peakBins,
                   std::vector<unsigned int>& peakScores,
                   std::vector<double>& polyfit);

  void computePvalVector(const std::vector<double>& peakDist,
                         std::vector<double>& sumProb);
  double computePval(const std::vector<unsigned int>& queryPeakBins,
      bool smoothing, std::vector<double>& sumProb);

  void computePvalVectorPolyfit(const std::vector<double>& peakDist);
  double computePvalPolyfit(const std::vector<unsigned int>& queryPeakBins);

  void copyPolyfit(short* peakBins, short* peakScores, double* polyfit);
  void serialize(std::string& polyfitString, std::string& peakScorePairsString);
  void deserialize(std::string& polyfitString, std::string& peakScorePairsString);

  inline std::vector<unsigned int> getPeakBins() const { return peakBins_; }
  inline std::vector<unsigned int>& getPeakBinsRef() { return peakBins_; }
  inline std::vector<unsigned int> getPeakScores() const { return peakScores_; }
  inline std::vector<double> getPolyfit() const { return polyfit_; }

  static bool pvalUnitTest();
  static bool pvalPolyfitUnitTest();
  static bool pvalUniformUnitTest();
  static bool binaryPeakMatchUnitTest();

  // needed for smoothing and unit tests
  inline static void setSeed(unsigned long s) { seed_ = s; }
  static unsigned long lcg_rand();
  static double lcg_rand_unif();

 private:
  unsigned int maxScore_;
  std::vector<unsigned int> peakBins_;
  std::vector<unsigned int> peakScores_;
  std::vector<double> polyfit_;

  void initFromPeakBins(const std::vector<double>& peakDist,
                        std::vector<double>& peakProbs);
  void binaryMatchPeakBins(const std::vector<unsigned int>& queryPeakBins, std::vector<bool>& d);
  double polyval(double x);

  // used for unit tests
  static inline bool isEqual(double a, double b) { return (std::abs(a - b) < 1e-5); }
  static unsigned long seed_;
};

} /* namespace maracluster */

#endif /* MARACLUSTER_PVALUECALCULATOR_H_ */


text:
static const int nCheckpointSpan = 500;

namespace Checkpoints
{
    typedef std::map<int, uint256> MapCheckpoints;

    //
    // What makes a good checkpoint block?
    // + Is surrounded by blocks with reasonable timestamps
    //   (no blocks before with a timestamp after, none after with
    //    timestamp before)
    // + Contains no strange transactions
    //

    static MapCheckpoints mapCheckpoints =
        boost::assign::map_list_of
        ( 15000, uint256("0xca3548f27e851f563008cfd79b3f97b555002ade6d6d1abf82af5161b3e5b0df") )
        ( 55000, uint256("0xb12293afc8d69f285cf0f7c1767b55d27c571c499ac91bdb47a5bccfa76b63b8") )
        ( 110000, uint256("0x92f5e226fb7bcc58f9933fa1c4836b5e2bf029bdb8e9eae366d80b14017841bc") )
        ( 300500, uint256("0x09d9bd6b9002bf66527e098f0e620a6f59c6a3b244bc0bc8f4c4879e19b8fbfa") )
        ( 345000, uint256("0x251f44f94e369ebebc51304ce1a7b367ecad8025e822a5a28407085915542a47") )
        ( 427520, uint256("0xbcb1998feb84a6741beba7b11eb28fc496f3eacc51e110b3f7b03749b5c5b37e") )
    ;

    // TestNet has no checkpoints
    static MapCheckpoints mapCheckpointsTestnet;

    bool CheckHardened(int nHeight, const uint256& hash)
    {
        MapCheckpoints& checkpoints = (TestNet() ? mapCheckpointsTestnet : mapCheckpoints);

        MapCheckpoints::const_iterator i = checkpoints.find(nHeight);
        if (i == checkpoints.end()) return true;
        return hash == i->second;
    }

    int GetTotalBlocksEstimate()
    {
        MapCheckpoints& checkpoints = (TestNet() ? mapCheckpointsTestnet : mapCheckpoints);

        if (checkpoints.empty())
            return 0;
        return checkpoints.rbegin()->first;
    }

    CBlockIndex* GetLastCheckpoint(const std::map<uint256, CBlockIndex*>& mapBlockIndex)
    {
        MapCheckpoints& checkpoints = (TestNet() ? mapCheckpointsTestnet : mapCheckpoints);

        BOOST_REVERSE_FOREACH(const MapCheckpoints::value_type& i, checkpoints)
        {
            const uint256& hash = i.second;
            std::map<uint256, CBlockIndex*>::const_iterator t = mapBlockIndex.find(hash);
            if (t != mapBlockIndex.end())
                return t->second;
        }
        return NULL;
    }

    // Automatically select a suitable sync-checkpoint
    const CBlockIndex* AutoSelectSyncCheckpoint()
    {
        const CBlockIndex *pindex = pindexBest;
        // Search backward for a block within max span and maturity window
        while (pindex->pprev && pindex->nHeight + nCheckpointSpan > pindexBest->nHeight)
            pindex = pindex->pprev;
        return pindex;
    }

    // Check against synchronized checkpoint
    bool CheckSync(int nHeight)
    {
        const CBlockIndex* pindexSync = AutoSelectSyncCheckpoint();

        if (nHeight <= pindexSync->nHeight)
            return false;
        return true;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.opencb.commons</groupId>
        <artifactId>commons-datastore</artifactId>
        <version>3.4.0-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>commons-datastore-mongodb</artifactId>
    <version>${java.commons.version}</version>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>org.opencb.commons</groupId>
            <artifactId>commons-datastore-core</artifactId>
        </dependency>

        <dependency>
            <groupId>org.mongodb</groupId>
            <artifactId>mongo-java-driver</artifactId>
            <version>3.2.2</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
    </dependencies>

</project>


text:
package org.apache.camel.component.google.sheets;

import com.google.api.services.sheets.v4.Sheets;

public interface GoogleSheetsClientFactory {

    Sheets makeClient(String clientId, String clientSecret, String applicationName, String refreshToken, String accessToken);

}


text:
package bssopenapi

//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

// PermissionListItem is a nested struct in bssopenapi response
type PermissionListItem struct {
	EndTime        string `json:"EndTime" xml:"EndTime"`
	StartTime      string `json:"StartTime" xml:"StartTime"`
	PermissionCode string `json:"PermissionCode" xml:"PermissionCode"`
	PermissionName string `json:"PermissionName" xml:"PermissionName"`
}


text:
var fs = require('fs')
var glob = require('glob')

var CombinedStream = require('combined-stream')
var BlkDatStream = require('../')

glob(process.env.BLOCKS_DIR + '/blk*.dat', function (err, fileNames) {
  if (err) throw err

  var cs = new CombinedStream()

  fileNames.forEach(function (fileName) {
    cs.append(fs.createReadStream(fileName, { mode: '0444' }))
  })

  var bds = new BlkDatStream()
  var j = 0
  bds.on('data', function () {
    console.log('>> Read block (', j, ')')
    j++
  })

  cs.pipe(bds)
})


text:
1. User Story: I can get the IP address, language and operating system for my browser.

## Example Usage:
http://rvg-timestamp.herokuapp.com/December%2015,%202015
http://rvg-timestamp.herokuapp.com/1450137600

## Example Output
* {"ip_address":"127.0.0.1","operating_system":"Linux x86_64","language":"pt-BR"}


text:
<!DOCTYPE html>

  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0" />
  <title>ATOS Time Machine</title>

  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  <link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection" />
  <link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection" />

      <form>

            Time Machine

Recover

Login

                  Staff ID
                  <input type="text" class="validate" id="log_id" />

                  Password
                  <input type="password" class="validate" id="log_password" />

                <button type="button" class="btn light-blue lighten-1 waves-effect waves-light" id="login">Login</button>

      </form>